UNPKG

agents

Version:

A home for your AI agents

141 lines (139 loc) 4.08 kB
import { F as ChannelMessageSurface, d as ChannelRoute, k as ChannelIngress, n as Channel, u as ChannelMessage } from "../channel-Bnm4S7T2.js"; //#region src/channels/adapters/slack.d.ts /** The subset of a Slack event used by the adapter, with unknown fields retained. */ type SlackEvent = { type?: string; user?: string; text?: string; ts?: string; thread_ts?: string; channel?: string; channel_type?: string; subtype?: string; bot_id?: string; app_id?: string; [key: string]: unknown; }; type SlackAuthorization = { team_id?: string; user_id?: string; is_bot?: boolean; [key: string]: unknown; }; /** A typed Slack Events API callback retained in an ingress envelope. */ type SlackEventCallback = { type: "event_callback"; event_id: string; team_id: string; event: SlackEvent; authorizations?: readonly SlackAuthorization[]; [key: string]: unknown; }; /** A typed Slack URL verification request. */ type SlackUrlVerification = { type: "url_verification"; challenge: string; [key: string]: unknown; }; type SlackBlockAction = { action_id?: string; action_ts?: string; value?: string; [key: string]: unknown; }; /** A typed Slack Block Kit interaction retained in an ingress envelope. */ type SlackBlockActions = { type: "block_actions"; team?: { id?: string; [key: string]: unknown; }; user?: { id?: string; username?: string; name?: string; [key: string]: unknown; }; channel?: { id?: string; [key: string]: unknown; }; message?: { ts?: string; thread_ts?: string; [key: string]: unknown; }; container?: { channel_id?: string; message_ts?: string; thread_ts?: string; [key: string]: unknown; }; actions?: readonly SlackBlockAction[]; [key: string]: unknown; }; /** Authenticated Slack payloads which may be passed to a Channel route. */ type SlackIngressPayload = SlackEventCallback | SlackBlockActions; type SlackWebhookOptions = { /** Slack app signing secret. */ signingSecret: string /** Exact webhook pathname accepted by this ingress. @default "/webhooks/slack" */; path?: string /** Maximum accepted request timestamp skew in seconds. @default 300 */; maxSkewSeconds?: number /** Bot user id used to discard events sent by this app. */; botUserId?: string; }; type SlackMessageSurface = ChannelMessageSurface< string, | { channelId: string; threadTs?: string /** The reader a channel stream is rendered for. Slack requires it. */; recipientUserId?: string; recipientTeamId?: string; } | { teamId: string; userId: string; } >; /** Configuration for a Slack Channel. */ type SlackChannelOptions = { /** Bot token used with chat.postMessage. */ botToken: string /** Slack Web API origin. @default "https://slack.com/api" */; apiBaseUrl?: string /** Project canonical Channel Markdown into Slack mrkdwn text. */; toText?: (message: ChannelMessage) => string; /** * Smallest gap between `chat.appendStream` calls. Chunks produced inside * one interval are appended together. @default 500 */ streamIntervalMs?: number /** Add signed Slack HTTP ingress to the returned Channel. */; webhook?: SlackWebhookOptions /** Select an application route from the event, exact payload, and Host context. */; route?: ChannelRoute<SlackIngressPayload> /** Override fetch for testing or custom network routing. */; fetch?: typeof globalThis.fetch; }; /** Create dependency-free, request-signed Slack HTTP ingress. */ declare function slackWebhook( options: SlackWebhookOptions ): ChannelIngress<SlackIngressPayload>; /** Create a configured Slack Web API Channel. */ declare function slack( options: SlackChannelOptions ): Channel<SlackIngressPayload>; //#endregion export { SlackAuthorization, SlackBlockAction, SlackBlockActions, SlackChannelOptions, SlackEvent, SlackEventCallback, SlackIngressPayload, SlackMessageSurface, SlackUrlVerification, SlackWebhookOptions, slack, slackWebhook }; //# sourceMappingURL=slack.d.ts.map