The turn state type used by the application.
Creates a new SlackAgentExtension and registers the before-turn token injection hook.
The turn state type used by the application.
The agent application to attach to.
Adds a route to the agent application that is only active for the channel specified in this extension. This method creates a channel-specific route by wrapping the provided route selector with an additional check to ensure the incoming activity matches the extension's channel ID.
The agent application instance to add the route to
A function that determines if the route should handle the incoming activity
The handler function that will process the activity when the route is matched
OptionalisInvokeRoute: booleanOptional. Whether this route handles invoke activities. Defaults to false
Optionalrank: numberOptional. The priority rank of this route for routing precedence. Defaults to RouteRank.Unspecified
Creates a SlackStream for sending an agentic streaming response. Reads the channel and thread timestamp from the incoming activity's channel data.
The current turn context.
Optionaloptions: SlackStreamOptionsOptional recipient and display mode overrides.
A stream instance ready to call start().
Registers a route that handles Slack events of a specific type (e.g. 'block_actions').
Matches on the type field of the Slack event envelope or its inner event object.
The Slack event type to match.
Handler to invoke when the event type matches.
The extension instance, for chaining.
Registers a route that handles all incoming Slack message activities.
Handler to invoke for every Slack message.
The extension instance, for chaining.
Registers a route that handles Slack message activities whose text equals text.
Exact text to match against activity.text.
Handler to invoke on match.
The extension instance, for chaining.
Registers a route that handles Slack message activities whose text matches regex.
Regular expression to test against activity.text.
Handler to invoke on match.
The extension instance, for chaining.
Channel extension that adds Slack-specific routing and API access to an AgentApplication.
Remarks
Register via
app.registerExtension(new SlackAgentExtension(app), ext => { ... }).On each turn with
channelId === 'slack', abeforeTurnhook resolves the bot token fromactivity.channelData.ApiToken(injected by Azure Bot Service) or theSLACK_TOKENenvironment variable, and stores a SlackApi client incontext.turnStateunder SlackApiKey.