Skip to content

Commit 194f5ec

Browse files
committed
Update API from slack-api-ref@0ae4e98 (2026-10-26)
- Expose agents.conversations endpoints through the Web API client - Add error classes for newly documented Slack API error codes
1 parent 7e69bd4 commit 194f5ec

12 files changed

Lines changed: 478 additions & 8 deletions

‎bin/commands/admin_analytics_messages.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ module Cli
66
class App
77
desc 'AdminAnalyticsMessages methods.'
88
command 'admin_analytics_messages' do |g|
9-
g.desc 'Retrieves activity metrics for messages from a given channel.'
10-
g.long_desc %( Retrieves activity metrics for messages from a given channel. )
9+
g.desc 'Retrieves activity metrics for messages from a given channel, created between oldest_ts and latest_ts'
10+
g.long_desc %( Retrieves activity metrics for messages from a given channel, created between oldest_ts and latest_ts )
1111
g.command 'activity' do |c|
1212
c.flag 'channel', desc: 'Channel ID for channel of the message activity to query.'
1313
c.flag 'oldest_ts', desc: 'Oldest timestamp to include in the results. Defaults to 7 days before current time. If not passed while still passing the latest_ts parameter, defaults to 7 days before latest_ts.'

‎bin/commands/admin_apps_permissions.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class App
4545
c.flag 'app_id', desc: 'Encoded ID of the app.'
4646
c.flag 'permission_type', desc: 'The type of permission that defines who can access the app.'
4747
c.flag 'user_ids', desc: 'List of user IDs to allow for named_entities visibility.'
48-
c.flag 'usergroup_ids', desc: 'List of encoded usergroup IDs.'
48+
c.flag 'usergroup_ids', desc: 'List of encoded usergroup IDs the permission applies to. With named_entities the listed groups may access the app; with named_entities_exclude they may not.'
4949
c.flag 'channel_restriction_mode', desc: 'The mode that defines where the app can be used in channels.'
5050
c.flag 'channel_ids', desc: 'List of encoded channel IDs for channel restrictions. Semantics depend on channel_restriction_mode: allowlist for specific_channels, exclusion list for all_channels_except.'
5151
c.action do |_global_options, options, _args|
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# frozen_string_literal: true
2+
# This file was auto-generated by lib/tasks/web.rake
3+
4+
module Slack
5+
module Cli
6+
class App
7+
desc 'AgentsConversations methods.'
8+
command 'agents_conversations' do |g|
9+
g.desc 'Archive a code channel.'
10+
g.long_desc %( Archive a code channel. )
11+
g.command 'archive' do |c|
12+
c.flag 'channel_id', desc: 'ID of the code channel to archive.'
13+
c.flag 'summary_message_ts', desc: 'Timestamp of a message in the code channel to share back as a thread reply on the origin message. Requires the channel to have an origin_link set.'
14+
c.action do |_global_options, options, _args|
15+
puts JSON.dump(@client.agents_conversations_archive(options))
16+
end
17+
end
18+
19+
g.desc 'Create a dedicated code channel for an agent session.'
20+
g.long_desc %( Create a dedicated code channel for an agent session. )
21+
g.command 'create' do |c|
22+
c.flag 'team_id', desc: 'Encoded team id to create the channel in. Required for org tokens when origin_channel_id is not provided. When omitted, the workspace is derived from the origin channel.'
23+
c.flag 'session_id', desc: 'An opaque identifier for the agent session. When provided, the call is idempotent: if a channel already exists for this session_id, it is returned instead of creating a new one.'
24+
c.flag 'name', desc: 'A friendly display name for the code channel. Optional when origin_channel_id and origin_message_ts are provided — in that case the channel is named from the origin message and re-titled automatically. Required when no origin link is given.'
25+
c.flag 'is_private', desc: "Whether the code channel is private. When omitted, the channel matches the privacy of origin_channel_id, or is public if no origin is given. An explicit value is always honored, even if it differs from the origin channel's privacy: passing false creates a public channel from a private origin."
26+
c.flag 'origin_channel_id', desc: 'The channel ID where the agent session was initiated from. Must be provided together with origin_message_ts. The channel must be accessible to the calling user and must not be externally shared (Slack Connect). When team_id is omitted with an org token, the channel is created in the same workspace as this origin channel.'
27+
c.flag 'origin_message_ts', desc: 'The message timestamp in the origin channel that started the agent session. Must be provided together with origin_channel_id. The author of this message is automatically invited to the newly created code channel.'
28+
c.action do |_global_options, options, _args|
29+
puts JSON.dump(@client.agents_conversations_create(options))
30+
end
31+
end
32+
33+
g.desc 'Fetch a canvas attached to a code channel.'
34+
g.long_desc %( Fetch a canvas attached to a code channel. )
35+
g.command 'getCanvas' do |c|
36+
c.flag 'channel', desc: 'ID of the agent session channel the canvas belongs to.'
37+
c.flag 'canvas_id', desc: 'Encoded ID of the canvas to fetch.'
38+
c.flag 'content_format', desc: 'Format to render the canvas content in. Defaults to markdown.'
39+
c.flag 'include_resolved', desc: 'Whether to include resolved comment threads in the response. Defaults to false.'
40+
c.action do |_global_options, options, _args|
41+
puts JSON.dump(@client.agents_conversations_getCanvas(options))
42+
end
43+
end
44+
45+
g.desc 'List the views currently attached to a code channel.'
46+
g.long_desc %( List the views currently attached to a code channel. )
47+
g.command 'listViews' do |c|
48+
c.flag 'channel_id', desc: 'ID of the code channel to list views for.'
49+
c.action do |_global_options, options, _args|
50+
puts JSON.dump(@client.agents_conversations_listViews(options))
51+
end
52+
end
53+
54+
g.desc 'Remove a view from a code channel.'
55+
g.long_desc %( Remove a view from a code channel. )
56+
g.command 'removeView' do |c|
57+
c.flag 'channel_id', desc: 'ID of the code channel to remove the view from.'
58+
c.flag 'view_key', desc: 'Agent-assigned key of the view to remove. Provide exactly one of view_key or view_id.'
59+
c.flag 'view_id', desc: 'Encoded channel tab ID of the view to remove. Provide exactly one of view_key or view_id.'
60+
c.action do |_global_options, options, _args|
61+
puts JSON.dump(@client.agents_conversations_removeView(options))
62+
end
63+
end
64+
65+
g.desc 'Replace the full markdown content of a plan canvas attached to a code channel.'
66+
g.long_desc %( Replace the full markdown content of a plan canvas attached to a code channel. )
67+
g.command 'setCanvasContent' do |c|
68+
c.flag 'channel', desc: 'ID of the agent session channel the canvas is attached to.'
69+
c.flag 'canvas_id', desc: 'Encoded ID of the canvas whose content to replace.'
70+
c.flag 'content', desc: 'The full new canvas content as markdown. The server diffs this against the current content and applies only the changed sections.'
71+
c.action do |_global_options, options, _args|
72+
puts JSON.dump(@client.agents_conversations_setCanvasContent(options))
73+
end
74+
end
75+
76+
g.desc 'Register the set of agent-defined slash commands for the calling agent in a code channel.'
77+
g.long_desc %( Register the set of agent-defined slash commands for the calling agent in a code channel. )
78+
g.command 'setCommands' do |c|
79+
c.flag 'channel_id', desc: 'ID of the code channel to register commands for.'
80+
c.flag 'commands', desc: "Full set of commands to register for the calling agent in this channel, replacing that agent's previously registered set. Pass an empty array to clear the agent's commands. At most 10 commands may exist across all agents in the channel; names must be unique within the set and must not collide with builtin Slack commands."
81+
c.action do |_global_options, options, _args|
82+
puts JSON.dump(@client.agents_conversations_setCommands(options))
83+
end
84+
end
85+
86+
g.desc 'Set properties on a code channel.'
87+
g.long_desc %( Set properties on a code channel. )
88+
g.command 'setProperties' do |c|
89+
c.flag 'channel_id', desc: 'ID of the code channel to update.'
90+
c.flag 'title', desc: 'New display title for the agent session.'
91+
c.flag 'status', desc: 'New status for the agent session.'
92+
c.flag 'code_channel', desc: 'Code channel properties to set. Only provided fields are updated.'
93+
c.flag 'agent_resource', desc: 'Agent resource properties to set. Only provided fields are updated.'
94+
c.action do |_global_options, options, _args|
95+
puts JSON.dump(@client.agents_conversations_setProperties(options))
96+
end
97+
end
98+
99+
g.desc 'Create or update a view in a code channel.'
100+
g.long_desc %( Create or update a view in a code channel. )
101+
g.command 'setView' do |c|
102+
c.flag 'channel_id', desc: 'ID of the code channel to render the view in.'
103+
c.flag 'type', desc: 'The kind of view to create or update. Defaults to html. Determines which other arguments are required: html and diff require content, block_kit requires blocks, canvas requires canvas_id, pull_request requires pr_url.'
104+
c.flag 'view_key', desc: "Agent-assigned stable identity for the view (e.g. the source file path on the agent's machine). Used as the upsert key: calls with the same view_key update the same view. Required for html, block_kit, and canvas views; ignored for diff (a diff view is a per-channel singleton)."
105+
c.flag 'content', desc: 'View content. For html, a full self-contained HTML document; for diff, raw unified diff text. Capped at 1,000,000 bytes — larger content returns content_too_large. The cap is enforced by the handler (not schema maxLength) so the documented error code actually surfaces instead of a generic argument-validation failure. Required when type is html or diff.'
106+
c.flag 'blocks', desc: 'Block Kit blocks to render in the view tab. Required when type is block_kit; ignored otherwise.'
107+
c.flag 'canvas_id', desc: 'Encoded ID of the canvas to attach as the view. Required when type is canvas; ignored otherwise.'
108+
c.flag 'access_level', desc: "For canvas views: access level granted to the channel for the canvas tab. Defaults to write. Use 'comment' to grant channel members comment access (read and comment, no editing) so the agent remains the sole author of the canvas text."
109+
c.flag 'agent_content_hash', desc: 'For canvas views: hash of the canvas-derived markdown the agent last wrote, recorded so the agent can later detect human edits to the canvas. Opaque to the server.'
110+
c.flag 'pr_url', desc: "For pull_request views: the pull request's URL. Required when type is pull_request; ignored otherwise."
111+
c.flag 'base_branch', desc: 'For diff views: base branch name for display purposes.'
112+
c.flag 'head_branch', desc: 'For diff views: head branch name for display purposes.'
113+
c.flag 'name', desc: "Display label for the view tab. Preferred over the legacy 'label' argument (name wins if both are supplied). Defaults to the last path segment of view_key, stripped of any .html/.htm extension."
114+
c.flag 'label', desc: "Deprecated alias for 'name'. Display label for the view tab. Defaults to the last path segment of view_key, stripped of any .html/.htm extension."
115+
c.flag 'csp', desc: 'Content-Security-Policy domain declarations for the view. Domains are validated server-side (https-only, no private/internal hosts) and persisted. Only resource_domains is honored at render time today; connect_domains is accepted and stored for forward-compatibility but NOT honored yet.'
116+
c.action do |_global_options, options, _args|
117+
puts JSON.dump(@client.agents_conversations_setView(options))
118+
end
119+
end
120+
end
121+
end
122+
end
123+
end

‎bin/commands/chat.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class App
1010
g.long_desc %( Appends text to an existing streaming conversation. )
1111
g.command 'appendStream' do |c|
1212
c.flag 'channel', desc: 'An encoded ID that represents a channel, private group, or DM.'
13-
c.flag 'chunks', desc: 'Array of streaming chunks.'
13+
c.flag 'chunks', desc: 'Array of streaming chunks that can contain either markdown text or task updates.'
1414
c.flag 'ts', desc: 'The timestamp of the streaming message.'
1515
c.flag 'markdown_text', desc: 'Accepts message text formatted in markdown. Limit this field to 12,000 characters. This text is what will be appended to the message received so far.'
1616
c.action do |_global_options, options, _args|

‎lib/slack/web/api/endpoints.rb‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
require_relative 'endpoints/admin_workflows_collaborators'
3838
require_relative 'endpoints/admin_workflows_permissions'
3939
require_relative 'endpoints/admin_workflows_triggers_types_permissions'
40+
require_relative 'endpoints/agents_conversations'
4041
require_relative 'endpoints/agents_sessions'
4142
require_relative 'endpoints/api'
4243
require_relative 'endpoints/apps'
@@ -153,6 +154,7 @@ module Endpoints
153154
include AdminWorkflowsCollaborators
154155
include AdminWorkflowsPermissions
155156
include AdminWorkflowsTriggersTypesPermissions
157+
include AgentsConversations
156158
include AgentsSessions
157159
include Api
158160
include Apps

‎lib/slack/web/api/endpoints/admin_analytics_messages.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Api
77
module Endpoints
88
module AdminAnalyticsMessages
99
#
10-
# Retrieves activity metrics for messages from a given channel.
10+
# Retrieves activity metrics for messages from a given channel, created between oldest_ts and latest_ts
1111
#
1212
# @option options [channel] :channel
1313
# Channel ID for channel of the message activity to query.

‎lib/slack/web/api/endpoints/admin_apps_permissions.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def admin_apps_permissions_remove(options = {})
6464
# @option options [array] :user_ids
6565
# List of user IDs to allow for named_entities visibility.
6666
# @option options [array] :usergroup_ids
67-
# List of encoded usergroup IDs.
67+
# List of encoded usergroup IDs the permission applies to. With named_entities the listed groups may access the app; with named_entities_exclude they may not.
6868
# @option options [enum] :channel_restriction_mode
6969
# The mode that defines where the app can be used in channels.
7070
# @option options [array] :channel_ids

0 commit comments

Comments
 (0)