@mono-agent/slack-adapter 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -41,7 +41,7 @@ the reaction instead — no configuration needed for the fallback.
41
41
 
42
42
  ## Dependency Boundary
43
43
 
44
- This package may depend on core agent contracts/settings plus Slack transport dependencies. It must not depend on the agent harness, runtime adapter, operator surfaces, other communication adapters, or host/demo code.
44
+ This package may depend on `@mono-agent/agent-contracts` plus Slack transport dependencies. It must not depend on the agent harness, runtime adapter, operator surfaces, other communication adapters, or host/demo code.
45
45
 
46
46
  ## What This Package Does Not Own
47
47
 
package/dist/adapter.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type AgentAttachment, type AgentRequestBase, type AgentResponder as SharedAgentResponder, type AgentResponse } from "@mono-agent/agent-contracts";
2
2
  import { type AgentMessageStream, type SlackMessageStreamLogger } from "./message-stream.js";
3
- import type { SlackChannelId, SlackEventCallback, SlackMessageTs, SlackUserId, SlackWebApi } from "./types.js";
3
+ import type { SlackBlockActionsPayload, SlackChannelId, SlackEventCallback, SlackInteractivityPayload, SlackMessageTs, SlackShortcutPayload, SlackUserId, SlackWebApi } from "./types.js";
4
4
  export type SlackTriggerKind = "direct" | "app_mention";
5
5
  export interface AgentRequest extends AgentRequestBase {
6
6
  conversationId: string;
@@ -53,6 +53,25 @@ export interface SlackRequestMetadata {
53
53
  }
54
54
  export type { AgentResponse };
55
55
  export type AgentResponder = SharedAgentResponder<AgentRequest, AgentMessageStream, AgentResponse>;
56
+ /**
57
+ * Outcome of a proactive {@link SlackAdapter.notify} delivery. `delivered` is
58
+ * true only when the answer reached the channel; otherwise `reason` carries a
59
+ * short, human-readable cause for the silent drop (e.g. concurrency cap, the
60
+ * agent produced no answer, a cancelled or failed run).
61
+ */
62
+ export interface SlackNotifyResult {
63
+ readonly delivered: boolean;
64
+ readonly reason?: string;
65
+ }
66
+ /**
67
+ * Options for {@link SlackAdapter.notify}. With `verbatim`, `text` is posted to
68
+ * the destination UNCHANGED with no model call (native cron/webhook notification
69
+ * — the producing run already wrote the message) and recorded to history so a
70
+ * reply resumes with it in context. Without it, `text` is run as a turn.
71
+ */
72
+ export interface SlackNotifyOptions {
73
+ readonly verbatim?: boolean;
74
+ }
56
75
  export interface SlackAdapterMessages {
57
76
  welcomeText?: string;
58
77
  helpText?: string;
@@ -80,6 +99,71 @@ export interface SlackAdapterLogger extends SlackMessageStreamLogger {
80
99
  debug?(message: string, metadata?: Record<string, unknown>): void;
81
100
  info?(message: string, metadata?: Record<string, unknown>): void;
82
101
  }
102
+ /**
103
+ * Binds a Slack shortcut `callback_id` to a prompt. When a user invokes that
104
+ * shortcut, the adapter runs the prompt as a proactive turn — the same machinery
105
+ * as a cron/webhook nudge — making the shortcut a persistent one-click trigger
106
+ * for an agent routine. A GLOBAL shortcut carries no channel, so `channelId`
107
+ * must say where the reply goes; a MESSAGE shortcut falls back to its source
108
+ * channel when `channelId` is omitted.
109
+ */
110
+ export interface SlackShortcutBinding {
111
+ readonly callbackId: string;
112
+ readonly prompt: string;
113
+ /**
114
+ * Destination channel for the run's reply. Required for global shortcuts.
115
+ * For a MESSAGE shortcut this falls back to the invoking channel — so under
116
+ * `allowAllChannels` the invoker chooses where operator-authored output lands;
117
+ * pin `channelId` to bound the destination.
118
+ */
119
+ readonly channelId?: SlackChannelId;
120
+ /**
121
+ * Optional message posted immediately when the shortcut is invoked, before the
122
+ * run starts — instant feedback for an action whose result lands seconds later
123
+ * (e.g. "🔄 Syncing…"). Best-effort: a failed ack post does not block the run.
124
+ */
125
+ readonly ackText?: string;
126
+ }
127
+ /**
128
+ * Outcome of routing an interaction (a shortcut or a Home-tab button). `id` is
129
+ * the shortcut's `callback_id` or the button's `action_id`. `triggered` means a
130
+ * bound interaction ran (`delivered` mirrors the proactive turn's outcome); the
131
+ * other kinds explain why nothing ran, for logging.
132
+ */
133
+ export type SlackInteractionHandlingResult = {
134
+ kind: "triggered";
135
+ id: string;
136
+ channelId: SlackChannelId;
137
+ delivered: boolean;
138
+ reason?: string;
139
+ } | {
140
+ kind: "ignored";
141
+ reason: "no_action" | "unbound" | "missing_channel";
142
+ id?: string;
143
+ } | {
144
+ kind: "unauthorized";
145
+ id: string;
146
+ channelId: SlackChannelId;
147
+ };
148
+ /**
149
+ * A button rendered on the App Home tab. Clicking it runs `prompt` as a proactive
150
+ * turn (same machinery as a shortcut), replying in `channelId` (the Home tab
151
+ * carries no channel of its own, so this — or the first allowlisted channel — is
152
+ * where the result lands). `label` is the button text; `ackText` posts instantly.
153
+ */
154
+ export interface SlackHomeButton {
155
+ readonly actionId: string;
156
+ readonly label: string;
157
+ readonly prompt: string;
158
+ readonly channelId?: SlackChannelId;
159
+ readonly ackText?: string;
160
+ }
161
+ /** App Home tab options: whether to publish it, an optional header, and its buttons. */
162
+ export interface SlackHomeTabOptions {
163
+ readonly enabled: boolean;
164
+ readonly headerText?: string;
165
+ readonly buttons: readonly SlackHomeButton[];
166
+ }
83
167
  export interface SlackAdapterOptions {
84
168
  api: SlackWebApi;
85
169
  responder: AgentResponder;
@@ -91,7 +175,34 @@ export interface SlackAdapterOptions {
91
175
  stream?: SlackAdapterStreamOptions;
92
176
  messages?: SlackAdapterMessages;
93
177
  attachments?: SlackAttachmentOptions;
178
+ /**
179
+ * Shortcut bindings (callback_id → prompt). Invoking a bound shortcut in/for an
180
+ * authorized channel runs its prompt as a proactive turn. Omitted/empty means
181
+ * no shortcuts are wired (interactions are ignored).
182
+ */
183
+ shortcuts?: readonly SlackShortcutBinding[];
184
+ /**
185
+ * App Home tab configuration. When `enabled`, the adapter publishes a persistent
186
+ * panel of action buttons whenever a user opens the Home tab, and a button click
187
+ * runs its bound prompt as a proactive turn. Omitted/disabled means no Home tab.
188
+ */
189
+ homeTab?: SlackHomeTabOptions;
94
190
  logger?: SlackAdapterLogger;
191
+ /**
192
+ * Resolve an in-thread reply back to the conversation that produced the message
193
+ * it threads off. When set and an inbound threaded reply's `(channel, threadTs)`
194
+ * matches a recorded post, the run continues that producing conversation instead
195
+ * of a fresh `slack:<channel>:<threadTs>` (which would have no history). Injected
196
+ * by the host so this package stays free of the artifact store.
197
+ */
198
+ resolvePostIndex?: (channelId: string, ts: string) => Promise<string | undefined>;
199
+ /**
200
+ * Record that this adapter posted a message at `(channel, ts)` for conversation
201
+ * `conversationId`, so a later in-thread reply can be resolved back to it. Used
202
+ * for top-level proactive posts (a fresh thread root with no prior history).
203
+ * Fire-and-forget; best-effort.
204
+ */
205
+ recordPostedMessage?: (channelId: string, ts: string, conversationId: string) => void;
95
206
  }
96
207
  export type SlackEventIgnoredReason = "unsupported_event" | "unsupported_message" | "empty_text" | "no_usable_attachments" | "from_bot" | "from_self";
97
208
  export type SlackEventHandlingResult = {
@@ -124,6 +235,10 @@ export type SlackEventHandlingResult = {
124
235
  eventId: string;
125
236
  channelId?: SlackChannelId;
126
237
  error: unknown;
238
+ } | {
239
+ kind: "home_published";
240
+ eventId: string;
241
+ userId: SlackUserId;
127
242
  };
128
243
  /**
129
244
  * Thrown synchronously by {@link SerialQueue.run} when the queue is already at
@@ -166,7 +281,19 @@ export declare class SlackAdapter {
166
281
  private readonly messages;
167
282
  private readonly attachmentMaxBytes;
168
283
  private readonly allowedMimeTypes;
284
+ /** callback_id → shortcut binding for registered Slack shortcuts. */
285
+ private readonly shortcuts;
286
+ /** action_id → button binding for App Home tab buttons. */
287
+ private readonly homeButtons;
288
+ /** Ordered Home tab buttons (for rendering the view in config order). */
289
+ private readonly homeButtonOrder;
290
+ private readonly homeTabEnabled;
291
+ private readonly homeTabHeaderText;
292
+ /** First allowlisted channel (original case), used as a global interaction's default reply destination. */
293
+ private readonly defaultShortcutChannelId;
169
294
  private readonly logger;
295
+ private readonly resolvePostIndex;
296
+ private readonly recordPostedMessage;
170
297
  /**
171
298
  * In-flight abort controllers per thread. The harness serializes runs for a
172
299
  * conversation, so several may be queued/active concurrently; /cancel aborts
@@ -185,6 +312,72 @@ export declare class SlackAdapter {
185
312
  private readonly admissionQueues;
186
313
  constructor(options: SlackAdapterOptions);
187
314
  handleEventCallback(callback: SlackEventCallback): Promise<SlackEventHandlingResult>;
315
+ /**
316
+ * Deliver a proactive notification to a Slack destination by running it as a
317
+ * turn on that destination's OWN harness (shared session/history + the same
318
+ * per-conversation admission queue as inbound messages) and posting the answer
319
+ * through the normal stream. `threadTs` targets an existing thread (clean
320
+ * continuity — the user's in-thread replies share the session); omitting it
321
+ * posts top-level (fire-and-forget: a fresh top-level post has no pre-existing
322
+ * thread to share continuity with). Used by cron/webhook nudges. Best-effort:
323
+ * a failed or empty turn posts nothing.
324
+ */
325
+ notify(channelId: SlackChannelId, threadTs: SlackMessageTs | undefined, text: string, options?: SlackNotifyOptions): Promise<SlackNotifyResult>;
326
+ /**
327
+ * Route any interactivity payload to the right handler: a shortcut/message
328
+ * action by `callback_id`, or a Block Kit button click by `action_id`.
329
+ */
330
+ handleInteraction(payload: SlackInteractivityPayload): Promise<SlackInteractionHandlingResult>;
331
+ /**
332
+ * Route a Slack shortcut payload. When its `callback_id` is bound to a prompt
333
+ * and the resolved destination channel is authorized, run that prompt as a
334
+ * proactive turn. The destination is the binding's `channelId`, else the
335
+ * payload's own channel (message shortcuts), else the first allowlisted channel.
336
+ */
337
+ handleShortcut(payload: SlackShortcutPayload): Promise<SlackInteractionHandlingResult>;
338
+ /**
339
+ * Route a Block Kit `block_actions` payload (a clicked button — typically on the
340
+ * App Home tab). Acts on the first action whose `action_id` is a bound Home
341
+ * button. A Home-tab click carries no channel, so the reply goes to the button's
342
+ * `channelId` (or the first allowlisted channel).
343
+ */
344
+ handleBlockActions(payload: SlackBlockActionsPayload): Promise<SlackInteractionHandlingResult>;
345
+ /**
346
+ * Shared interaction run path: resolve the destination channel, enforce the
347
+ * allowlist, post the optional instant ack, then run the bound prompt as a
348
+ * proactive turn. The returned result is for logging.
349
+ */
350
+ private runBoundInteraction;
351
+ /**
352
+ * Publish the App Home tab for a user when they open it. Best-effort: a publish
353
+ * failure is logged, not thrown, so opening Home never surfaces an error.
354
+ */
355
+ private handleAppHomeOpened;
356
+ /** Build the App Home tab Block Kit: an optional header plus one button per configured Home button. */
357
+ private buildHomeTabBlocks;
358
+ /**
359
+ * Build the stream options shared by both proactive delivery paths
360
+ * ({@link runProactiveTurn} and {@link runVerbatimDelivery}): a threaded post
361
+ * targets the existing thread; a top-level post records its ts → this
362
+ * conversation so a user's in-thread reply resolves back here.
363
+ */
364
+ private buildProactiveStreamOptions;
365
+ /**
366
+ * Deliver `text` VERBATIM to a Slack destination: post it unchanged through the
367
+ * normal stream with NO model call (the producing cron/webhook run already wrote
368
+ * the message), then record it to the destination's durable history via the
369
+ * responder so a later reply resumes with it in context. Best-effort: a
370
+ * history-record failure never fails an already-delivered post.
371
+ */
372
+ private runVerbatimDelivery;
373
+ private runProactiveTurn;
374
+ /**
375
+ * The conversation the run should continue. A genuine in-thread reply
376
+ * (`threadTs !== messageTs`) whose `(channel, threadTs)` matches a message we
377
+ * posted resolves to that producing conversation; everything else uses the
378
+ * default `slack:<channel>:<threadTs>`. Best-effort: a lookup error falls back.
379
+ */
380
+ private resolveConversationId;
188
381
  private respondToEvent;
189
382
  /**
190
383
  * Download each inbound Slack file's bytes into an {@link AgentAttachment}.
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,cAAc,IAAI,oBAAoB,EAC3C,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAE9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,cAAc,EAEd,kBAAkB,EAElB,cAAc,EACd,WAAW,EACX,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,aAAa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