Release: Node SDK updates
By Steven Van ·
The Node SDK adds Slack Code agent methods, new Block Kit types, and an HTTP/1.1 pin for Socket Mode WebSocket connections.
Slack's Node SDK packages picked up three updates, the largest being new Web API methods for Slack Code. The Slack Node SDK release covers Socket Mode, Types and Web API.
Web API v8.2.0
The Web API package adds the agents.conversations.* methods for Slack Code: create, archive, setProperties, setView, setCommands, listViews, removeView, getCanvas and setCanvasContent.
setCanvasContent replaces the markdown content of a plan canvas attached to a code channel. It takes a channel, a canvas_id and the full new content as markdown. Slack diffs that content against the canvas's current sections and applies only the changed sections. Unchanged sections keep their section IDs, so comment threads anchored to them stay in place. If the content is byte-for-byte current, the call is a no-op and returns sections_changed_count: 0 without bumping the canvas version.
The method needs a granular bot token with the code_channels:manage scope and is rate limited at Tier 3 (50+ per minute). In the Node SDK it is called as app.client.agents.conversations.setCanvasContent.
A comment-only canvas loop
- Attach the canvas as a view with agents.conversations.setView, using type: "canvas" and access_level: "comment". Channel members can then read and comment, while only the agent edits the text.
- Read unresolved comments with agents.conversations.getCanvas and fold them into the agent's context.
- Write the revised document back with setCanvasContent.
Errors include too_many_sections, returned when the content or the existing canvas has too many sections to diff. The fix is to reduce the number of distinct blocks in the document.
Types v3.2.0
- Added the ContainerBlock block interface.
- Added the data_table Block Kit block type (DataTableBlock).
- Allowed raw_number cells in TableBlock rows, which adds RawNumberElement.
- Added an optional action_id property to the WorkflowButton block element.
Socket Mode v3.1.0
The default dispatcher now pins the WebSocket connection to HTTP/1.1, because undici@^8 offers HTTP/2 by default. A custom ProxyAgent dispatcher can do the same by passing requestTls: { allowH2: false }.