Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### 3.3.1 (Next)

* [#609](https://github.com/slack-ruby/slack-ruby-client/pull/609): Expose agents.conversations endpoints in the Web API client - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* [#609](https://github.com/slack-ruby/slack-ruby-client/pull/609): Add error classes for additional agent, canvas, channel, invitation, validation, and resource-limit error codes - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* Your contribution here.

### 3.3.0 (2026/10/09)
Expand Down
4 changes: 2 additions & 2 deletions bin/commands/admin_analytics_messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module Cli
class App
desc 'AdminAnalyticsMessages methods.'
command 'admin_analytics_messages' do |g|
g.desc 'Retrieves activity metrics for messages from a given channel.'
g.long_desc %( Retrieves activity metrics for messages from a given channel. )
g.desc 'Retrieves activity metrics for messages from a given channel, created between oldest_ts and latest_ts'
g.long_desc %( Retrieves activity metrics for messages from a given channel, created between oldest_ts and latest_ts )
g.command 'activity' do |c|
c.flag 'channel', desc: 'Channel ID for channel of the message activity to query.'
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.'
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/admin_apps_permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class App
c.flag 'app_id', desc: 'Encoded ID of the app.'
c.flag 'permission_type', desc: 'The type of permission that defines who can access the app.'
c.flag 'user_ids', desc: 'List of user IDs to allow for named_entities visibility.'
c.flag 'usergroup_ids', desc: 'List of encoded usergroup IDs.'
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.'
c.flag 'channel_restriction_mode', desc: 'The mode that defines where the app can be used in channels.'
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.'
c.action do |_global_options, options, _args|
Expand Down
123 changes: 123 additions & 0 deletions bin/commands/agents_conversations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Cli
class App
desc 'AgentsConversations methods.'
command 'agents_conversations' do |g|
g.desc 'Archive a code channel.'
g.long_desc %( Archive a code channel. )
g.command 'archive' do |c|
c.flag 'channel_id', desc: 'ID of the code channel to archive.'
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.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.agents_conversations_archive(options))
end
end

g.desc 'Create a dedicated code channel for an agent session.'
g.long_desc %( Create a dedicated code channel for an agent session. )
g.command 'create' do |c|
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.'
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.'
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.'
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."
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.'
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.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.agents_conversations_create(options))
end
end

g.desc 'Fetch a canvas attached to a code channel.'
g.long_desc %( Fetch a canvas attached to a code channel. )
g.command 'getCanvas' do |c|
c.flag 'channel', desc: 'ID of the agent session channel the canvas belongs to.'
c.flag 'canvas_id', desc: 'Encoded ID of the canvas to fetch.'
c.flag 'content_format', desc: 'Format to render the canvas content in. Defaults to markdown.'
c.flag 'include_resolved', desc: 'Whether to include resolved comment threads in the response. Defaults to false.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.agents_conversations_getCanvas(options))
end
end

g.desc 'List the views currently attached to a code channel.'
g.long_desc %( List the views currently attached to a code channel. )
g.command 'listViews' do |c|
c.flag 'channel_id', desc: 'ID of the code channel to list views for.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.agents_conversations_listViews(options))
end
end

g.desc 'Remove a view from a code channel.'
g.long_desc %( Remove a view from a code channel. )
g.command 'removeView' do |c|
c.flag 'channel_id', desc: 'ID of the code channel to remove the view from.'
c.flag 'view_key', desc: 'Agent-assigned key of the view to remove. Provide exactly one of view_key or view_id.'
c.flag 'view_id', desc: 'Encoded channel tab ID of the view to remove. Provide exactly one of view_key or view_id.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.agents_conversations_removeView(options))
end
end

g.desc 'Replace the full markdown content of a plan canvas attached to a code channel.'
g.long_desc %( Replace the full markdown content of a plan canvas attached to a code channel. )
g.command 'setCanvasContent' do |c|
c.flag 'channel', desc: 'ID of the agent session channel the canvas is attached to.'
c.flag 'canvas_id', desc: 'Encoded ID of the canvas whose content to replace.'
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.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.agents_conversations_setCanvasContent(options))
end
end

g.desc 'Register the set of agent-defined slash commands for the calling agent in a code channel.'
g.long_desc %( Register the set of agent-defined slash commands for the calling agent in a code channel. )
g.command 'setCommands' do |c|
c.flag 'channel_id', desc: 'ID of the code channel to register commands for.'
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."
c.action do |_global_options, options, _args|
puts JSON.dump(@client.agents_conversations_setCommands(options))
end
end

g.desc 'Set properties on a code channel.'
g.long_desc %( Set properties on a code channel. )
g.command 'setProperties' do |c|
c.flag 'channel_id', desc: 'ID of the code channel to update.'
c.flag 'title', desc: 'New display title for the agent session.'
c.flag 'status', desc: 'New status for the agent session.'
c.flag 'code_channel', desc: 'Code channel properties to set. Only provided fields are updated.'
c.flag 'agent_resource', desc: 'Agent resource properties to set. Only provided fields are updated.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.agents_conversations_setProperties(options))
end
end

g.desc 'Create or update a view in a code channel.'
g.long_desc %( Create or update a view in a code channel. )
g.command 'setView' do |c|
c.flag 'channel_id', desc: 'ID of the code channel to render the view in.'
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.'
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)."
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.'
c.flag 'blocks', desc: 'Block Kit blocks to render in the view tab. Required when type is block_kit; ignored otherwise.'
c.flag 'canvas_id', desc: 'Encoded ID of the canvas to attach as the view. Required when type is canvas; ignored otherwise.'
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."
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.'
c.flag 'pr_url', desc: "For pull_request views: the pull request's URL. Required when type is pull_request; ignored otherwise."
c.flag 'base_branch', desc: 'For diff views: base branch name for display purposes.'
c.flag 'head_branch', desc: 'For diff views: head branch name for display purposes.'
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."
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."
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.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.agents_conversations_setView(options))
end
end
end
end
end
end
2 changes: 1 addition & 1 deletion bin/commands/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class App
g.long_desc %( Appends text to an existing streaming conversation. )
g.command 'appendStream' do |c|
c.flag 'channel', desc: 'An encoded ID that represents a channel, private group, or DM.'
c.flag 'chunks', desc: 'Array of streaming chunks.'
c.flag 'chunks', desc: 'Array of streaming chunks that can contain either markdown text or task updates.'
c.flag 'ts', desc: 'The timestamp of the streaming message.'
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.'
c.action do |_global_options, options, _args|
Expand Down
2 changes: 2 additions & 0 deletions lib/slack/web/api/endpoints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
require_relative 'endpoints/admin_workflows_collaborators'
require_relative 'endpoints/admin_workflows_permissions'
require_relative 'endpoints/admin_workflows_triggers_types_permissions'
require_relative 'endpoints/agents_conversations'
require_relative 'endpoints/agents_sessions'
require_relative 'endpoints/api'
require_relative 'endpoints/apps'
Expand Down Expand Up @@ -153,6 +154,7 @@ module Endpoints
include AdminWorkflowsCollaborators
include AdminWorkflowsPermissions
include AdminWorkflowsTriggersTypesPermissions
include AgentsConversations
include AgentsSessions
include Api
include Apps
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/admin_analytics_messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Api
module Endpoints
module AdminAnalyticsMessages
#
# Retrieves activity metrics for messages from a given channel.
# Retrieves activity metrics for messages from a given channel, created between oldest_ts and latest_ts
#
# @option options [channel] :channel
# Channel ID for channel of the message activity to query.
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/admin_apps_permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def admin_apps_permissions_remove(options = {})
# @option options [array] :user_ids
# List of user IDs to allow for named_entities visibility.
# @option options [array] :usergroup_ids
# List of encoded usergroup IDs.
# 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.
# @option options [enum] :channel_restriction_mode
# The mode that defines where the app can be used in channels.
# @option options [array] :channel_ids
Expand Down
Loading