Conversation
Add the 9 Slack Code (code channel) Web API methods to @slack/web-api: create, archive, setProperties, setView, setCommands, listViews, removeView, getCanvas, setCanvasContent — all requiring the code_channels:manage bot scope. Argument interfaces are hand-typed from the docs #816 method schemas. Per those schemas, getCanvas and setCanvasContent use `channel` (not `channel_id`); the other seven use `channel_id`. Response types follow the repo's auto-generated shape; since these are net-new methods with no java-slack-sdk samples yet, they are hand-written minimal WebAPICallResult extensions rather than codegen output. Only agents.conversations.* names are added — the legacy codeChannels.* names are intentionally not shipped (decision 2026-09-23). Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 4414513 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2748 +/- ##
==========================================
+ Coverage 89.15% 89.28% +0.12%
==========================================
Files 65 65
Lines 10442 10534 +92
Branches 480 480
==========================================
+ Hits 9310 9405 +95
+ Misses 1100 1097 -3
Partials 32 32
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
…+ drop channel remark Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Order the 9 agents.conversations method registrations (methods.ts) and their request-argument interfaces (types/request/agents.ts) alphabetically: archive, create, getCanvas, listViews, removeView, setCanvasContent, setCommands, setProperties, setView. Pure reorder; tsc --noEmit clean. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… add type tests Six agents.conversations methods (archive, create, listViews, removeView, setProperties, setView) were bound with bindApiCallWithOptionalArgument, so calling them with no argument type-checked despite channel_id/name being required. Switch all nine to bindApiCall (required argument) for parity with getCanvas/setCanvasContent/setCommands, and add test/types/methods/agents.test-d.ts covering the sad/happy paths for each (tsd clean; tsc --noEmit clean). Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…in request types The agents.sessions argument interfaces sat before agents.conversations in types/request/agents.ts; conversations sorts first. Move the sessions block after the conversations block. Pure reorder; tsc --noEmit clean. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
zimeg
left a comment
There was a problem hiding this comment.
🧪 Notes on docs and arguments me might not want to have!
| * @description 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`. |
There was a problem hiding this comment.
| * @description 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`. | |
| * @description 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. |
| export interface AgentsConversationsCreateArguments extends TokenOverridable { | ||
| /** | ||
| * @description 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 token. |
There was a problem hiding this comment.
| * provided. When omitted, the workspace is derived from the token. | |
| * provided. When omitted, the workspace is derived from the origin channel. |
| is_private?: boolean; | ||
| /** | ||
| * @description 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 app. |
There was a problem hiding this comment.
| * `origin_message_ts`. The channel must be accessible to the calling app. | |
| * `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. |
| origin_channel_id?: string; | ||
| /** | ||
| * @description The message timestamp in the origin channel that started the agent session. Must be provided together | ||
| * with `origin_channel_id`. |
There was a problem hiding this comment.
| * with `origin_channel_id`. | |
| * with `origin_channel_id`. The author of this message is automatically invited to the newly created code channel. |
| session_id?: string; | ||
| /** | ||
| * @description A friendly display name for the code channel. Optional when `origin_channel_id` and `origin_message_ts` | ||
| * are provided — in that case the channel name is derived from the origin message. |
There was a problem hiding this comment.
| * are provided — in that case the channel name is derived from the origin message. | |
| * are provided — in that case the channel name is derived from the origin message and re-titled automatically. Required when no origin link is given. |
| canvas_id?: string; | ||
| /** | ||
| * @description For canvas views: access level granted to the channel for the canvas tab. Defaults to `write`. Use | ||
| * `comment` to grant channel members comment access. |
There was a problem hiding this comment.
| * `comment` to grant channel members comment access. | |
| * `comment` to grant channel members comment access (read and comment, no editing) so the agent remains the sole author of the canvas text. |
| access_level?: string; | ||
| /** | ||
| * @description 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. |
There was a problem hiding this comment.
| * later detect human edits to the canvas. | |
| * later detect human edits to the canvas. Opaque to the server. |
| head_branch?: string; | ||
| /** | ||
| * @description 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`. |
There was a problem hiding this comment.
| * supplied). Defaults to the last path segment of `view_key`. | |
| * supplied). Defaults to the last path segment of `view_key`, stripped of any .html/.htm extension. |
| label?: string; | ||
| /** | ||
| * @description Content-Security-Policy domain declarations for the view. Domains are validated server-side | ||
| * (https-only, no private/internal hosts) and persisted with the view. |
There was a problem hiding this comment.
| * (https-only, no private/internal hosts) and persisted with the view. | |
| * (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. |
| create: bindApiCallWithOptionalArgument<CanvasesCreateArguments, CanvasesCreateResponse>(this, 'canvases.create'), | ||
| create: bindApiCall<CanvasesCreateArguments, CanvasesCreateResponse>(this, 'canvases.create'), |
There was a problem hiding this comment.
👁️🗨️ suggestion: Let's revert this?
- Type the complex args inline instead of Record<string, unknown>:
commands ({name, description?, argument_hint?}[]), code_channel
(context_bar_items[] + summary_message), agent_resource
(url/resource_type/title/provider) — mirroring the java typed classes.
- Apply the reviewer's docs wording (archive origin_link, create team_id/
name/origin fields, setCommands limits, setView view_key/content/
access_level/agent_content_hash/name/csp).
- Drop the deprecated label field from setView; make create name optional
(required only without an origin link) and remove the now-invalid
create({}) type-test case.
- Revert the accidental canvases.create binding change (it correctly uses
bindApiCallWithOptionalArgument).
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The docs mark name as Required (the conditional 'optional with an origin
link' is prose, not the declared arg requirement), so keep name: string
and restore the create({}) missing-name type-test.
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…perties Session title/status are set via agents.sessions.rename / setStatus; they don't belong on setProperties. Remove the deprecated fields per review. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ava json-logs Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
…ence Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Summary
Adds the 9 Slack Code (code channel) Web API methods to
@slack/web-api, under theagents.conversations.*namespace. Slack Code / code channels are going dev-GA; these type the client for that work.All 9 methods require the
code_channels:managebot scope:agents.conversations.create— create a dedicated code channel for an agent sessionagents.conversations.archive— archive a code channelagents.conversations.setProperties— set properties on a code channelagents.conversations.setView— create or update a view in a code channelagents.conversations.setCommands— register agent-defined slash commands (commandsis required)agents.conversations.listViews— list the views attached to a code channelagents.conversations.removeView— remove a view from a code channelagents.conversations.getCanvas— fetch a canvas attached to a code channelagents.conversations.setCanvasContent— replace a plan canvas's markdown contentNotes
getCanvasandsetCanvasContenttakechannel(notchannel_id); the other seven takechannel_id. This asymmetry is intentional and matches the method definitions.WebAPICallResultextensions). Because these are net-new methods with nojava-slack-sdksamples yet, the response files are hand-written minimal/honest stubs rather than codegen output; they can be regenerated once samples land.codeChannels.*names — only theagents.conversations.*names are shipped, per the SDK naming decision (2026-09-23).agents.conversations.*method schemas in docs PR Add TypeScript definitions for events #816.Status
Experimental / draft — pending the API going dev-GA and docs PR #816 landing. Opened as a draft on purpose.
Testing
npm run build --workspace=packages/web-api(tsc typecheck) — cleannpx @biomejs/biome check packages— clean (666 files)npm test --workspace=packages/web-api— 152/152 pass🤖 Generated with Claude Code