@dual-os/slack-api
v6.0.6
Published
`@dual-os/slack-api` includes the Slack API Actions, event Trigger and Agent Channel.
Downloads
418
Readme
Slack Agent Channel
@dual-os/slack-api includes the Slack API Actions, event Trigger and Agent Channel.
The customer's own Slack app as the Agent Channel slack-api/agent-conversations.
A DM to the app is a direct conversation (a thread inside it is its own
conversation); a mention in a channel is a group conversation threaded by the message's root
ts. Deployment settings choose where (channelIds, directMessages), who (access,
allowedSenderKeys) and when (respondTo: mentions or all_messages, which answers every
message of the chosen channels) the Agent is activated; a DM always counts as addressed. Slack's
agent_session_stopped becomes a stop event. The bot's own messages, other bots, edits,
deletions and Slack Connect guests are ignored. Message files are not read: the host downloads
assets inside the webhook request, and Slack retries an event after three seconds.
Connection: bot-token with botToken (xoxb-) and signingSecret. Every request must carry
Slack's v0 signature over its exact body, signed at most five minutes from now. Activation
checks the token with auth.test and keeps the workspace, bot user and bot IDs as state; the
installation key is <team>/<bot user>. The url_verification challenge is answered by the
serving installation, because Slack sends it only when the Request URL is saved.
Output operations: present_outcome replies in the thread; create_message, update_message
and delete_message use chat.postMessage, chat.update and chat.delete (a message reference
is <channel>/<ts>). set_reaction uses reactions.add/reactions.remove. read_context
returns a thread's or a DM's latest messages (DM: up to 200; thread: up to 2,000, otherwise
rejected). The host does not yet consume read_context. Automatic activity, processing indicators, native stop
buttons, plan rendering, streaming and inbound files are not supported. Verified
agent_session_stopped notifications are accepted without provider-side status mutations.
Delivery is at-most-once: Slack has no idempotency key for a post.
Import slackApiPlugin from @dual-os/slack-api/executable; @dual-os/slack-api/definition exports
slackApiPluginBase. Existing API Connections remain valid for Actions and Triggers; only
the bot-token method can activate this Channel. Old slack-app Channel pins are not rewritten:
reselect this Channel and create a Connection under slack-api before redeploying.
No live Slack workspace was verified. Ported in part from
HumanLayer effect-channels (MIT).
