@sentry/junior 0.147.0 → 0.149.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.
Files changed (162) hide show
  1. package/dist/{agent-hooks-HS6VGUPM.js → agent-hooks-CWMCXAMT.js} +10 -10
  2. package/dist/api/conversations/access.d.ts +2 -1
  3. package/dist/api/conversations/aggregate.d.ts +2 -0
  4. package/dist/api/conversations/archive.d.ts +3 -5
  5. package/dist/api/conversations/create.d.ts +6 -0
  6. package/dist/api/conversations/detail.d.ts +2 -296
  7. package/dist/api/conversations/event-list.d.ts +2 -193
  8. package/dist/api/conversations/list.d.ts +4 -66
  9. package/dist/api/conversations/pending-messages.d.ts +15 -0
  10. package/dist/api/conversations/routes.d.ts +1 -1
  11. package/dist/api/conversations/stats.d.ts +0 -54
  12. package/dist/api/http.d.ts +2 -6
  13. package/dist/api/locations/detail.d.ts +3 -111
  14. package/dist/api/locations/list.d.ts +0 -45
  15. package/dist/api/locations/query.d.ts +2 -1
  16. package/dist/api/locations/routes.d.ts +1 -1
  17. package/dist/api/people/list.d.ts +0 -29
  18. package/dist/api/people/profile.d.ts +2 -106
  19. package/dist/api/people/profile.query.d.ts +2 -1
  20. package/dist/api/people/routes.d.ts +1 -1
  21. package/dist/api/people/shared.d.ts +3 -1
  22. package/dist/api/people/spend.d.ts +3 -4
  23. package/dist/api/personal-tokens/routes.d.ts +2 -2
  24. package/dist/api/route.d.ts +8 -14
  25. package/dist/api/schema/conversation.d.ts +130 -25
  26. package/dist/api/schema/location.d.ts +4 -0
  27. package/dist/api/schema/person.d.ts +7 -3
  28. package/dist/api/schema.d.ts +2 -2
  29. package/dist/api/schema.js +13 -1
  30. package/dist/api/stats.d.ts +0 -13
  31. package/dist/api/validation.d.ts +7 -0
  32. package/dist/api/viewer.d.ts +3 -0
  33. package/dist/api.d.ts +2 -1
  34. package/dist/api.js +772 -561
  35. package/dist/app.js +241 -204
  36. package/dist/{catalog-runtime-M6ZTPYRV.js → catalog-runtime-GAW5APVI.js} +5 -5
  37. package/dist/chat/actor.d.ts +4 -1
  38. package/dist/chat/agent/request.d.ts +2 -0
  39. package/dist/chat/agent/resume.d.ts +1 -0
  40. package/dist/chat/agent-dispatch/context.d.ts +2 -2
  41. package/dist/chat/agent-invocations/types.d.ts +52 -0
  42. package/dist/chat/api-turns/work.d.ts +108 -0
  43. package/dist/chat/app/services.d.ts +1 -1
  44. package/dist/chat/conversations/history.d.ts +60 -0
  45. package/dist/chat/conversations/provenance.d.ts +6 -0
  46. package/dist/chat/conversations/sql/actor-identity.d.ts +19 -0
  47. package/dist/chat/conversations/store.d.ts +1 -1
  48. package/dist/chat/resource-events/store.d.ts +1 -1
  49. package/dist/chat/runtime/reply-executor.d.ts +1 -3
  50. package/dist/chat/runtime/slack-runtime.d.ts +2 -1
  51. package/dist/chat/runtime/turn-preparation.d.ts +9 -0
  52. package/dist/chat/scheduled-tasks/tool-support.d.ts +5 -5
  53. package/dist/chat/scheduled-tasks/tools/create.d.ts +2 -2
  54. package/dist/chat/scheduled-tasks/tools/delete.d.ts +2 -2
  55. package/dist/chat/scheduled-tasks/tools/list.d.ts +2 -2
  56. package/dist/chat/scheduled-tasks/tools/run-now.d.ts +2 -2
  57. package/dist/chat/scheduled-tasks/tools/update.d.ts +2 -2
  58. package/dist/chat/services/conversation-memory.d.ts +2 -2
  59. package/dist/chat/services/conversation-title.d.ts +20 -0
  60. package/dist/chat/slack/assistant-thread/title.d.ts +10 -27
  61. package/dist/chat/slack/channel.d.ts +26 -0
  62. package/dist/chat/slack/dispatch-turn.d.ts +1 -0
  63. package/dist/chat/slack/timestamp-param.d.ts +0 -2
  64. package/dist/chat/slack/{tools → tool-support}/canvas/api.d.ts +1 -1
  65. package/dist/chat/slack/{tools → tool-support}/canvas/context.d.ts +3 -0
  66. package/dist/chat/slack/tool-support/channel-access.d.ts +42 -0
  67. package/dist/chat/slack/tool-support/channel-target.d.ts +27 -0
  68. package/dist/chat/slack/tool-support/list/params.d.ts +5 -0
  69. package/dist/chat/slack/tools/canvas/create.d.ts +1 -1
  70. package/dist/chat/slack/tools/channel-join.d.ts +28 -0
  71. package/dist/chat/slack/tools/channel-list-messages.d.ts +3 -2
  72. package/dist/chat/slack/tools/conversation-message-search.d.ts +2 -8
  73. package/dist/chat/slack/tools/message-add-reaction.d.ts +1 -1
  74. package/dist/chat/slack/tools/public-search.d.ts +63 -2
  75. package/dist/chat/slack/tools/send-files.d.ts +1 -1
  76. package/dist/chat/slack/tools/thread-read.d.ts +2 -5
  77. package/dist/chat/source.d.ts +2 -0
  78. package/dist/chat/state/conversation.d.ts +1 -0
  79. package/dist/chat/task-execution/checkpoint.d.ts +1 -0
  80. package/dist/chat/task-execution/state.d.ts +9 -4
  81. package/dist/chat/task-execution/store.d.ts +3 -2
  82. package/dist/chat/task-execution/turn-cursor.d.ts +2 -0
  83. package/dist/chat/task-execution/worker.d.ts +2 -0
  84. package/dist/chat/tasks/read.d.ts +1 -1
  85. package/dist/chat/tools/search-conversation-events.d.ts +1 -1
  86. package/dist/chat/tools/types.d.ts +11 -4
  87. package/dist/chat/tools/watch-resource-events.d.ts +2 -2
  88. package/dist/{chunk-ORO3PWKQ.js → chunk-25SC7D6Z.js} +1 -1
  89. package/dist/{chunk-GGB4WL5A.js → chunk-2JHKISQA.js} +1 -1
  90. package/dist/{chunk-AVZDSUFB.js → chunk-2P6BQQER.js} +4 -4
  91. package/dist/{chunk-7NVJVJID.js → chunk-32CXPIZE.js} +2 -2
  92. package/dist/{chunk-YSB2N563.js → chunk-3GYZ5YEH.js} +121 -87
  93. package/dist/{chunk-DU74WPIC.js → chunk-3I2IVWSZ.js} +1 -1
  94. package/dist/{chunk-SVHUEHUL.js → chunk-3JVUWLR7.js} +65 -4
  95. package/dist/{chunk-RXBVB2JM.js → chunk-3KGQOKIG.js} +1 -1
  96. package/dist/{chunk-YBVXBNSV.js → chunk-4JGM7FXO.js} +2 -2
  97. package/dist/{chunk-AZ7EAOBE.js → chunk-4YKPOYRV.js} +5 -5
  98. package/dist/chunk-5CWUQXXT.js +806 -0
  99. package/dist/{chunk-DLDRQHG5.js → chunk-6G5RCDKP.js} +1 -1
  100. package/dist/{chunk-AYU72WO7.js → chunk-75DSYFFB.js} +47 -70
  101. package/dist/{chunk-YHDERDRO.js → chunk-7BH46NB4.js} +91 -75
  102. package/dist/{chunk-745QJ3ZA.js → chunk-ALJG73MQ.js} +2 -2
  103. package/dist/chunk-ART7P442.js +48 -0
  104. package/dist/{chunk-7A4M7PCV.js → chunk-DK5UT6PQ.js} +1180 -556
  105. package/dist/{chunk-AIOK6LAG.js → chunk-EW2LNCRL.js} +813 -44
  106. package/dist/chunk-EXW76GW4.js +36 -0
  107. package/dist/chunk-GDFF3BQG.js +136 -0
  108. package/dist/{chunk-7UQIVT6G.js → chunk-JMH3DBM5.js} +6 -6
  109. package/dist/{chunk-CWP5RHVX.js → chunk-JMSMXXED.js} +12 -5
  110. package/dist/{chunk-CSZINQJ2.js → chunk-MEMURSBG.js} +1 -1
  111. package/dist/{chunk-YNTTROJT.js → chunk-QIW7OQEO.js} +1 -1
  112. package/dist/{chunk-Q4R73I43.js → chunk-RB26T3LU.js} +58 -28
  113. package/dist/{chunk-4LJO56OJ.js → chunk-RLVZIWNQ.js} +1 -1
  114. package/dist/{chunk-SGZO7UWH.js → chunk-SWHPVZBV.js} +2 -2
  115. package/dist/{chunk-PVNG6UMU.js → chunk-TFBNBXPU.js} +22 -10
  116. package/dist/{chunk-EFLJ2WJH.js → chunk-URDCZAL4.js} +5 -5
  117. package/dist/{chunk-6H5SZR24.js → chunk-UZGASGOD.js} +300 -383
  118. package/dist/{chunk-YEO3VX72.js → chunk-W7UONUIZ.js} +8 -6
  119. package/dist/{chunk-JUUKWRBE.js → chunk-X22XXSZA.js} +1 -1
  120. package/dist/{chunk-X5UY34KT.js → chunk-XPYWWMHR.js} +8 -8
  121. package/dist/{chunk-IIOOO4FQ.js → chunk-ZYMYLLWG.js} +2 -1
  122. package/dist/cli/chat.js +32 -35
  123. package/dist/cli/check.js +6 -6
  124. package/dist/cli/plugins.js +13 -13
  125. package/dist/cli/snapshot-create.js +9 -9
  126. package/dist/cli/upgrade.js +7 -7
  127. package/dist/db/schema/agent-invocations.d.ts +20 -0
  128. package/dist/db/schema/conversation-annotations.d.ts +2 -2
  129. package/dist/db/schema.d.ts +22 -2
  130. package/dist/{db-CSEW4RII.js → db-JBZLRIVY.js} +7 -7
  131. package/dist/instrumentation.js +4 -4
  132. package/dist/nitro.js +2 -2
  133. package/dist/{oauth-callback-server-FUEV5HNG.js → oauth-callback-server-MNTVYY2I.js} +24 -26
  134. package/dist/{runner-U3XHSKSH.js → runner-K24BWZSZ.js} +23 -25
  135. package/dist/{skills-AKE6W3WI.js → skills-AU5ST2CG.js} +6 -6
  136. package/dist/spawn-6PO7CVJ6.js +38 -0
  137. package/dist/{validation-WDTAULUF.js → validation-IXGZCFRO.js} +6 -6
  138. package/dist/version.js +1 -1
  139. package/dist/{work-C3HAO2BG.js → work-WCZIYILX.js} +18 -19
  140. package/dist/{worker-LNP4YKBM.js → worker-U2AACBEY.js} +11 -10
  141. package/package.json +6 -5
  142. package/dist/api/health.d.ts +0 -7
  143. package/dist/api/personal-tokens/create.d.ts +0 -11
  144. package/dist/api/personal-tokens/list.d.ts +0 -12
  145. package/dist/api/personal-tokens/revoke.d.ts +0 -5
  146. package/dist/api/plugin-reports.d.ts +0 -63
  147. package/dist/api/plugins.d.ts +0 -8
  148. package/dist/api/runtime.d.ts +0 -24
  149. package/dist/api/skills.d.ts +0 -6
  150. package/dist/chat/slack/tools/channel-access.d.ts +0 -30
  151. package/dist/chunk-34GS7B6L.js +0 -115
  152. package/dist/chunk-AVOCH2Z5.js +0 -285
  153. package/dist/chunk-HLXXQI5Q.js +0 -238
  154. package/dist/chunk-K4SZAP3K.js +0 -67
  155. package/dist/chunk-R776HKPK.js +0 -81
  156. package/dist/chunk-Z4YU7Z4L.js +0 -76
  157. package/dist/spawn-B6GDTWJ4.js +0 -39
  158. /package/dist/chat/slack/{tools → tool-support}/canvas/markdown.d.ts +0 -0
  159. /package/dist/chat/slack/{tools → tool-support}/channel-capabilities.d.ts +0 -0
  160. /package/dist/chat/slack/{tools → tool-support}/context.d.ts +0 -0
  161. /package/dist/chat/slack/{tools → tool-support}/list/api.d.ts +0 -0
  162. /package/dist/chat/slack/{tools → tool-support}/slack-message-url.d.ts +0 -0
@@ -23,7 +23,7 @@ export declare function createSlackScheduleListTasksTool(context: SchedulerToolC
23
23
  channel_id: string;
24
24
  };
25
25
  conversation_access: {
26
- audience: "direct" | "channel" | "group";
26
+ audience: "channel" | "direct" | "group";
27
27
  visibility: "public" | "private";
28
28
  };
29
29
  credential_mode: "system" | "creator";
@@ -53,7 +53,7 @@ export declare function createSlackScheduleListTasksTool(context: SchedulerToolC
53
53
  channel_id: string;
54
54
  };
55
55
  conversation_access: {
56
- audience: "direct" | "channel" | "group";
56
+ audience: "channel" | "direct" | "group";
57
57
  visibility: "public" | "private";
58
58
  };
59
59
  credential_mode: "system" | "creator";
@@ -22,7 +22,7 @@ export declare function createSlackScheduleRunTaskNowTool(context: SchedulerTool
22
22
  channel_id: string;
23
23
  };
24
24
  conversation_access: {
25
- audience: "direct" | "channel" | "group";
25
+ audience: "channel" | "direct" | "group";
26
26
  visibility: "public" | "private";
27
27
  };
28
28
  credential_mode: "system" | "creator";
@@ -52,7 +52,7 @@ export declare function createSlackScheduleRunTaskNowTool(context: SchedulerTool
52
52
  channel_id: string;
53
53
  };
54
54
  conversation_access: {
55
- audience: "direct" | "channel" | "group";
55
+ audience: "channel" | "direct" | "group";
56
56
  visibility: "public" | "private";
57
57
  };
58
58
  credential_mode: "system" | "creator";
@@ -49,7 +49,7 @@ export declare function createSlackScheduleUpdateTaskTool(context: SchedulerTool
49
49
  channel_id: string;
50
50
  };
51
51
  conversation_access: {
52
- audience: "direct" | "channel" | "group";
52
+ audience: "channel" | "direct" | "group";
53
53
  visibility: "public" | "private";
54
54
  };
55
55
  credential_mode: "system" | "creator";
@@ -79,7 +79,7 @@ export declare function createSlackScheduleUpdateTaskTool(context: SchedulerTool
79
79
  channel_id: string;
80
80
  };
81
81
  conversation_access: {
82
- audience: "direct" | "channel" | "group";
82
+ audience: "channel" | "direct" | "group";
83
83
  visibility: "public" | "private";
84
84
  };
85
85
  credential_mode: "system" | "creator";
@@ -11,7 +11,6 @@ export interface ConversationMemoryService {
11
11
  actorId?: string;
12
12
  runId?: string;
13
13
  }) => Promise<void>;
14
- generateThreadTitle: (sourceText: string) => Promise<string>;
15
14
  }
16
15
  export declare function generateConversationId(prefix: "assistant" | "backfill" | "compaction" | "turn"): string;
17
16
  /** Normalize message boundaries without changing transcript formatting. */
@@ -23,6 +22,7 @@ export declare function upsertConversationMessage(conversation: ThreadConversati
23
22
  export declare function recordDeliveredAssistantMessage(args: {
24
23
  conversation: ThreadConversationState;
25
24
  sessionId: string;
25
+ source?: "web";
26
26
  text: string;
27
27
  userMessageId?: string;
28
28
  }): string;
@@ -39,7 +39,7 @@ export declare function buildConversationContext(conversation: ThreadConversatio
39
39
  }): string | undefined;
40
40
  /** Return the earliest human-authored message known for a thread. */
41
41
  export declare function getThreadTitleSourceMessage(conversation: ThreadConversationState): ConversationMessage | undefined;
42
- /** Build the service that owns durable conversation memory compaction and titles. */
42
+ /** Build the service that owns durable conversation memory compaction. */
43
43
  export declare function createConversationMemoryService(deps: ConversationMemoryDeps): ConversationMemoryService;
44
44
  export declare function isHumanConversationMessage(message: ConversationMessage): boolean;
45
45
  /** Return the native Slack timestamp for a persisted conversation message. */
@@ -0,0 +1,20 @@
1
+ import type { ConversationStore } from "@/chat/conversations/store";
2
+ import type { ThreadConversationState } from "@/chat/state/conversation";
3
+ /** Test-only: clear in-flight title work between cases. */
4
+ export declare function resetConversationTitleStateForTests(): void;
5
+ /**
6
+ * Fire-and-forget title work after durable human transcript writes.
7
+ * This is the only entry that starts generation.
8
+ */
9
+ export declare function scheduleConversationTitle(args: {
10
+ conversation: ThreadConversationState;
11
+ conversationId: string | undefined;
12
+ }): void;
13
+ /**
14
+ * Join in-flight generation when present, otherwise read the stored title.
15
+ * Does not start generation; providers use this only to project a title.
16
+ */
17
+ export declare function resolveConversationTitle(args: {
18
+ conversationId: string;
19
+ conversationStore?: Pick<ConversationStore, "get">;
20
+ }): Promise<string | undefined>;
@@ -1,33 +1,16 @@
1
1
  import type { SlackAdapter } from "@chat-adapter/slack";
2
- import { type ConversationMemoryService } from "@/chat/services/conversation-memory";
3
- import type { ThreadConversationState } from "@/chat/state/conversation";
2
+ /** Test-only: clear set-once DM title projection between cases. */
3
+ export declare function resetAssistantTitleProjectionForTests(): void;
4
4
  /**
5
- * Best-effort conversation title generation for all Slack conversations.
5
+ * Best-effort Slack projection for a stored conversation title.
6
6
  *
7
- * Title generation is intentionally detached from reply generation and visible
8
- * reply delivery. For DM assistant threads the generated title is also pushed
9
- * to Slack via `setAssistantTitle`. For channel conversations the title is
10
- * generated and returned for dashboard reporting only — the Slack API for
11
- * setting thread titles is DM-only and is not called.
12
- *
13
- * Stable Slack permission failures on DM title updates are treated as a
14
- * terminal skip for the current source message so later turns do not keep
15
- * paying for the same fast-model call that Slack will reject.
7
+ * Only DM assistant threads support `setAssistantTitle`. Channel conversations
8
+ * keep the title in Junior for dashboard reporting and do not call Slack.
9
+ * Projection is set-once per DM thread so later turns do not rewrite Slack.
16
10
  */
17
- export declare function maybeUpdateAssistantTitle(args: {
18
- assistantThreadContext?: {
19
- channelId: string;
20
- threadTs: string;
21
- };
22
- assistantUserName: string;
11
+ export declare function maybeSyncAssistantTitle(args: {
23
12
  channelId?: string;
24
- conversation: ThreadConversationState;
25
- generateThreadTitle: ConversationMemoryService["generateThreadTitle"];
26
13
  getSlackAdapter: () => Pick<SlackAdapter, "setAssistantTitle">;
27
- modelId: string;
28
- actorId?: string;
29
- runId?: string;
30
- threadId?: string;
31
- }): Promise<{
32
- title?: string;
33
- } | undefined>;
14
+ threadTs?: string;
15
+ title: string;
16
+ }): Promise<void>;
@@ -50,3 +50,29 @@ export declare function listThreadReplies(input: {
50
50
  maxPages?: number;
51
51
  targetMessageTs?: string[];
52
52
  }): Promise<SlackThreadReply[]>;
53
+ export interface SlackConversationInfo {
54
+ id: SlackChannelId;
55
+ name?: string;
56
+ isChannel: boolean;
57
+ isPrivate: boolean;
58
+ isIm: boolean;
59
+ isMpim: boolean;
60
+ isMember?: boolean;
61
+ }
62
+ /** Load conversation metadata used for cross-channel read access checks. */
63
+ export declare function getConversationInfo(channelId: SlackChannelId): Promise<SlackConversationInfo>;
64
+ /** Join a public channel so the bot can read history and threads there. */
65
+ export declare function joinPublicChannel(channelId: SlackChannelId): Promise<void>;
66
+ export interface SlackPublicChannelSummary {
67
+ id: SlackChannelId;
68
+ name?: string;
69
+ isMember?: boolean;
70
+ isArchived?: boolean;
71
+ }
72
+ /** List public channels the bot can see for name resolution. */
73
+ export declare function listPublicChannels(input?: {
74
+ limit?: number;
75
+ maxPages?: number;
76
+ }): Promise<SlackPublicChannelSummary[]>;
77
+ /** Resolve a public channel name (with or without leading #) to a channel id. */
78
+ export declare function resolvePublicChannelByName(channelName: string): Promise<SlackPublicChannelSummary | undefined>;
@@ -8,6 +8,7 @@ interface DispatchReplyToThread {
8
8
  conversationId?: string;
9
9
  destination: DispatchRecord["destination"];
10
10
  execution: DispatchTurnContext;
11
+ publishExternally?: boolean;
11
12
  onTurnDeliveryAccepted?: (messageId?: string) => void;
12
13
  onTurnOutcome?: (result: DispatchTurnResult) => void;
13
14
  shouldYield?: () => boolean;
@@ -16,8 +16,6 @@ type RequiredSlackTimestampParamResult = {
16
16
  };
17
17
  /** Define a model-facing Slack timestamp, normalizing numeric model args to strings. */
18
18
  export declare function slackTimestampParam(description: string): z.ZodPreprocess<z.ZodString>;
19
- /** Define an optional model-facing Slack timestamp string parameter. */
20
- export declare function optionalSlackTimestampParam(description: string): z.ZodOptional<z.ZodPreprocess<z.ZodString>>;
21
19
  /** Parse tool input into a branded Slack timestamp before provider calls. */
22
20
  export declare function parseSlackTimestampParam(field: string, value: string | number | undefined): SlackTimestampParamResult;
23
21
  /** Parse a required tool input timestamp into a branded Slack timestamp. */
@@ -1,4 +1,4 @@
1
- import { type CanvasMarkdownNormalization } from "@/chat/slack/tools/canvas/markdown";
1
+ import { type CanvasMarkdownNormalization } from "@/chat/slack/tool-support/canvas/markdown";
2
2
  export { extractCanvasId } from "@/chat/slack/canvas-references";
3
3
  export interface CanvasCreateInput {
4
4
  title: string;
@@ -1,3 +1,6 @@
1
+ import { z } from "zod";
2
+ /** Model-facing Slack canvas ID or docs URL parameter. */
3
+ export declare const slackCanvasRefParam: z.ZodString;
1
4
  /** Resolve model-provided canvas references before Slack API calls. */
2
5
  export declare function resolveCanvasTarget(canvas: string): {
3
6
  ok: true;
@@ -0,0 +1,42 @@
1
+ import type { SlackChannelId, SlackTeamId } from "@/chat/slack/ids";
2
+ export type SlackChannelReadAccess = {
3
+ allowed: true;
4
+ channelName?: string;
5
+ isMember?: boolean;
6
+ isPublic?: boolean;
7
+ } | {
8
+ allowed: false;
9
+ error: string;
10
+ reason: SlackChannelReadDenialReason;
11
+ };
12
+ export type SlackChannelReadDenialReason = "private" | "not_found" | "not_in_channel" | "missing_scope" | "unknown";
13
+ /**
14
+ * Decide whether the model may read Slack content from a target channel.
15
+ *
16
+ * The current conversation is always readable. Any other channel first checks
17
+ * persisted visibility in the same workspace. Cross-channel reads require live
18
+ * `conversations.info` proof that the destination is public. Stale persisted
19
+ * public rows are not enough, so a channel that later becomes private fails
20
+ * closed. Channel-id prefixes alone cannot prove a channel public.
21
+ */
22
+ export declare function checkSlackChannelReadAccess(args: {
23
+ currentChannelIds: Array<SlackChannelId | undefined>;
24
+ targetChannelId: SlackChannelId;
25
+ teamId: SlackTeamId;
26
+ }): Promise<SlackChannelReadAccess>;
27
+ /**
28
+ * Join one public channel when a read failed because the bot is not a member.
29
+ *
30
+ * Callers should try the read first, then use this helper on `not_in_channel`.
31
+ */
32
+ export declare function joinPublicChannelForRead(args: {
33
+ channelName?: string;
34
+ targetChannelId: SlackChannelId;
35
+ }): Promise<{
36
+ ok: true;
37
+ channelName?: string;
38
+ } | {
39
+ ok: false;
40
+ error: string;
41
+ reason: SlackChannelReadDenialReason;
42
+ }>;
@@ -0,0 +1,27 @@
1
+ import { type SlackChannelId } from "@/chat/slack/ids";
2
+ import { z } from "zod";
3
+ export interface ResolvedSlackChannelTarget {
4
+ channelId: SlackChannelId;
5
+ channelName?: string;
6
+ resolvedFromName: boolean;
7
+ }
8
+ /** Model-facing Slack channel ID or public channel name parameter. */
9
+ export declare const slackChannelRefParam: z.ZodString;
10
+ /**
11
+ * Resolve a channel reference from a tool param value.
12
+ *
13
+ * Exact channel ids are parsed directly. Anything else is treated as a public
14
+ * channel name (with or without a leading `#`) and resolved via Slack.
15
+ */
16
+ export declare function resolveSlackChannelRef(input: {
17
+ field: string;
18
+ value: string;
19
+ }): Promise<ResolvedSlackChannelTarget>;
20
+ /**
21
+ * Resolve an optional channel reference, falling back to the active channel.
22
+ */
23
+ export declare function resolveOptionalSlackChannelRef(input: {
24
+ field?: string;
25
+ value?: string;
26
+ defaultChannelId?: SlackChannelId;
27
+ }): Promise<ResolvedSlackChannelTarget>;
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+ /** Model-facing Slack list ID parameter. */
3
+ export declare const slackListIdParam: z.ZodString;
4
+ /** Model-facing Slack list item ID parameter. */
5
+ export declare const slackListItemIdParam: z.ZodString;
@@ -1,4 +1,4 @@
1
- import type { SlackToolContext } from "@/chat/slack/tools/context";
1
+ import type { SlackToolContext } from "@/chat/slack/tool-support/context";
2
2
  import type { ToolState } from "@/chat/tools/types";
3
3
  /** Create a tool that provisions a new Slack canvas in the active channel. */
4
4
  export declare function createSlackCanvasCreateTool(context: SlackToolContext, state: ToolState): Omit<import("../../../tools/definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
@@ -0,0 +1,28 @@
1
+ import type { SlackToolContext } from "@/chat/slack/tool-support/context";
2
+ /** Create a tool that joins one public Slack channel. */
3
+ export declare function createSlackChannelJoinTool(context: SlackToolContext): Omit<import("../../tools/definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
4
+ inputSchema: import("../../tools/definition").JsonSchemaObject;
5
+ outputSchema: import("../../tools/definition").JsonSchemaObject;
6
+ prepareArguments(args: unknown): {
7
+ channel_id: string;
8
+ };
9
+ execute?: ((input: unknown, options: import("../../tools/definition").ToolExecuteOptions) => {
10
+ [x: string]: unknown;
11
+ target?: string | undefined;
12
+ truncated?: boolean | undefined;
13
+ timed_out?: boolean | undefined;
14
+ continuation?: {
15
+ arguments: Record<string, unknown>;
16
+ reason?: string | undefined;
17
+ } | undefined;
18
+ } | Promise<{
19
+ [x: string]: unknown;
20
+ target?: string | undefined;
21
+ truncated?: boolean | undefined;
22
+ timed_out?: boolean | undefined;
23
+ continuation?: {
24
+ arguments: Record<string, unknown>;
25
+ reason?: string | undefined;
26
+ } | undefined;
27
+ }>) | undefined;
28
+ };
@@ -1,9 +1,10 @@
1
- import type { SlackToolContext } from "@/chat/slack/tools/context";
2
- /** Create the active-channel history tool with preflight timestamp normalization. */
1
+ import type { SlackToolContext } from "@/chat/slack/tool-support/context";
2
+ /** Create the channel history tool with optional cross-channel targets. */
3
3
  export declare function createSlackChannelListMessagesTool(context: SlackToolContext): Omit<import("../../tools/definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
4
4
  inputSchema: import("../../tools/definition").JsonSchemaObject;
5
5
  outputSchema: import("../../tools/definition").JsonSchemaObject;
6
6
  prepareArguments(args: unknown): {
7
+ channel_id?: string | undefined;
7
8
  limit?: number | undefined;
8
9
  cursor?: string | undefined;
9
10
  oldest?: string | undefined;
@@ -1,11 +1,6 @@
1
- import type { ConversationMessageSearchScope, ConversationMessageSearchStore } from "@/chat/conversations/message-search";
2
- import { getSlackMessagePermalink } from "@/chat/slack/outbound";
3
- interface ConversationMessageSearchToolDeps {
4
- getPermalink?: typeof getSlackMessagePermalink;
5
- store?: ConversationMessageSearchStore;
6
- }
1
+ import type { ConversationMessageSearchScope } from "@/chat/conversations/message-search";
7
2
  /** Create a tool that searches retained public messages in an authorized Slack workspace. */
8
- export declare function createSlackConversationMessageSearchTool(scope: ConversationMessageSearchScope, currentConversationId: string, deps?: ConversationMessageSearchToolDeps): Omit<import("../../tools/definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
3
+ export declare function createSlackConversationMessageSearchTool(scope: ConversationMessageSearchScope, currentConversationId: string): Omit<import("../../tools/definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
9
4
  inputSchema: import("../../tools/definition").JsonSchemaObject;
10
5
  outputSchema: import("../../tools/definition").JsonSchemaObject;
11
6
  prepareArguments(args: unknown): {
@@ -61,4 +56,3 @@ export declare function createSlackConversationMessageSearchTool(scope: Conversa
61
56
  query?: string | undefined;
62
57
  }>) | undefined;
63
58
  };
64
- export {};
@@ -1,4 +1,4 @@
1
- import type { SlackToolContext } from "@/chat/slack/tools/context";
1
+ import type { SlackToolContext } from "@/chat/slack/tool-support/context";
2
2
  import type { ToolState } from "@/chat/tools/types";
3
3
  /** Create the tool that reacts to the current inbound Slack message. */
4
4
  export declare function createSlackMessageAddReactionTool(context: SlackToolContext, state: ToolState): Omit<import("../../tools/definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
@@ -1,10 +1,11 @@
1
1
  import type { SlackActionToken } from "@/chat/slack/action-token";
2
- /** Create an interactive, public-channel-only Slack search tool. */
3
- export declare function createSlackPublicSearchTool(actionToken: SlackActionToken): Omit<import("../../tools/definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
2
+ /** Create the public-channel Slack search tool. */
3
+ export declare function createSlackPublicSearchTool(actionToken?: SlackActionToken): Omit<import("../../tools/definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
4
4
  inputSchema: import("../../tools/definition").JsonSchemaObject;
5
5
  outputSchema: import("../../tools/definition").JsonSchemaObject;
6
6
  prepareArguments(args: unknown): {
7
7
  query: string;
8
+ content_types?: ("messages" | "files" | "channels" | "users")[] | undefined;
8
9
  after?: number | undefined;
9
10
  before?: number | undefined;
10
11
  cursor?: string | undefined;
@@ -15,6 +16,7 @@ export declare function createSlackPublicSearchTool(actionToken: SlackActionToke
15
16
  execute?: ((input: unknown, options: import("../../tools/definition").ToolExecuteOptions) => {
16
17
  [x: string]: unknown;
17
18
  query: string;
19
+ content_types: ("messages" | "files" | "channels" | "users")[];
18
20
  count: number;
19
21
  messages: {
20
22
  channel_id: string;
@@ -26,6 +28,35 @@ export declare function createSlackPublicSearchTool(actionToken: SlackActionToke
26
28
  channel_name?: string | undefined;
27
29
  is_author_bot?: boolean | undefined;
28
30
  }[];
31
+ files: {
32
+ file_id: string;
33
+ title?: string | undefined;
34
+ name?: string | undefined;
35
+ filetype?: string | undefined;
36
+ user_id?: string | undefined;
37
+ user_name?: string | undefined;
38
+ channel_id?: string | undefined;
39
+ channel_name?: string | undefined;
40
+ permalink?: string | undefined;
41
+ content?: string | undefined;
42
+ }[];
43
+ channels: {
44
+ channel_id: string;
45
+ channel_name?: string | undefined;
46
+ is_private?: boolean | undefined;
47
+ is_member?: boolean | undefined;
48
+ topic?: string | undefined;
49
+ purpose?: string | undefined;
50
+ permalink?: string | undefined;
51
+ }[];
52
+ users: {
53
+ user_id: string;
54
+ user_name?: string | undefined;
55
+ real_name?: string | undefined;
56
+ display_name?: string | undefined;
57
+ title?: string | undefined;
58
+ permalink?: string | undefined;
59
+ }[];
29
60
  target?: string | undefined;
30
61
  truncated?: boolean | undefined;
31
62
  timed_out?: boolean | undefined;
@@ -37,6 +68,7 @@ export declare function createSlackPublicSearchTool(actionToken: SlackActionToke
37
68
  } | Promise<{
38
69
  [x: string]: unknown;
39
70
  query: string;
71
+ content_types: ("messages" | "files" | "channels" | "users")[];
40
72
  count: number;
41
73
  messages: {
42
74
  channel_id: string;
@@ -48,6 +80,35 @@ export declare function createSlackPublicSearchTool(actionToken: SlackActionToke
48
80
  channel_name?: string | undefined;
49
81
  is_author_bot?: boolean | undefined;
50
82
  }[];
83
+ files: {
84
+ file_id: string;
85
+ title?: string | undefined;
86
+ name?: string | undefined;
87
+ filetype?: string | undefined;
88
+ user_id?: string | undefined;
89
+ user_name?: string | undefined;
90
+ channel_id?: string | undefined;
91
+ channel_name?: string | undefined;
92
+ permalink?: string | undefined;
93
+ content?: string | undefined;
94
+ }[];
95
+ channels: {
96
+ channel_id: string;
97
+ channel_name?: string | undefined;
98
+ is_private?: boolean | undefined;
99
+ is_member?: boolean | undefined;
100
+ topic?: string | undefined;
101
+ purpose?: string | undefined;
102
+ permalink?: string | undefined;
103
+ }[];
104
+ users: {
105
+ user_id: string;
106
+ user_name?: string | undefined;
107
+ real_name?: string | undefined;
108
+ display_name?: string | undefined;
109
+ title?: string | undefined;
110
+ permalink?: string | undefined;
111
+ }[];
51
112
  target?: string | undefined;
52
113
  truncated?: boolean | undefined;
53
114
  timed_out?: boolean | undefined;
@@ -1,4 +1,4 @@
1
- import type { SlackToolContext } from "@/chat/slack/tools/context";
1
+ import type { SlackToolContext } from "@/chat/slack/tool-support/context";
2
2
  import { type SandboxFileMaterializationInput, type SandboxFileUpload } from "@/chat/tools/sandbox/file-uploads";
3
3
  import type { ToolState } from "@/chat/tools/types";
4
4
  /** Convert a model-supplied sandbox file path into bytes safe for Slack upload. */
@@ -1,9 +1,6 @@
1
- import { type DestinationVisibilityReader } from "@/chat/slack/tools/channel-access";
2
- import type { SlackToolContext } from "@/chat/slack/tools/context";
1
+ import type { SlackToolContext } from "@/chat/slack/tool-support/context";
3
2
  /** Create a tool that reads a Slack thread from a shared message URL or explicit coordinates. */
4
- export declare function createSlackThreadReadTool(context: SlackToolContext, deps?: {
5
- visibilityStore?: DestinationVisibilityReader;
6
- }): Omit<import("../../tools/definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
3
+ export declare function createSlackThreadReadTool(context: SlackToolContext): Omit<import("../../tools/definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
7
4
  inputSchema: import("../../tools/definition").JsonSchemaObject;
8
5
  outputSchema: import("../../tools/definition").JsonSchemaObject;
9
6
  prepareArguments(args: unknown): {
@@ -1,6 +1,8 @@
1
1
  import { type Source } from "@sentry/junior-plugin-api";
2
2
  /** Source coordinates reduced to the stable locator for one conversation. */
3
3
  export type SessionSource = Extract<Source, {
4
+ platform: "web";
5
+ }> | Extract<Source, {
4
6
  platform: "local";
5
7
  }> | Omit<Extract<Source, {
6
8
  platform: "slack";
@@ -7,6 +7,7 @@ export interface ConversationAuthor {
7
7
  }
8
8
  export interface ConversationMessageMeta {
9
9
  attachmentCount?: number;
10
+ source?: "web";
10
11
  eventType?: string;
11
12
  explicitMention?: boolean;
12
13
  imageAttachmentCount?: number;
@@ -46,6 +46,7 @@ interface TurnCheckpointWrite {
46
46
  destinationVisibility?: ConversationPrivacy;
47
47
  dispatchId?: string;
48
48
  dispatchOutcome?: AgentDispatchOutcome;
49
+ publishExternally?: boolean;
49
50
  source?: Source;
50
51
  surface?: AgentTurnSurface;
51
52
  turnStartMessageIndex?: number;
@@ -16,12 +16,13 @@ export declare const CONVERSATION_WORK_MAX_DELIVERY_ATTEMPTS = 5;
16
16
  export declare const CONVERSATION_WORK_MAX_RETRIES = 5;
17
17
  declare const inboundMessageSourceSchema: z.ZodEnum<{
18
18
  slack: "slack";
19
- plugin: "plugin";
20
19
  local: "local";
20
+ web: "web";
21
+ plugin: "plugin";
21
22
  api: "api";
22
23
  internal: "internal";
23
- resource_event: "resource_event";
24
24
  scheduler: "scheduler";
25
+ resource_event: "resource_event";
25
26
  }>;
26
27
  export type Source = z.output<typeof inboundMessageSourceSchema>;
27
28
  export type ExecutionStatus = "paused" | "failed" | "idle" | "pending" | "running";
@@ -37,6 +38,8 @@ export declare const inboundMessageDeliverySchema: z.ZodEnum<{
37
38
  defer: "defer";
38
39
  interrupt: "interrupt";
39
40
  }>;
41
+ /** Whether this turn also publishes assistant output to the conversation destination. */
42
+ export declare const publishExternallySchema: z.ZodBoolean;
40
43
  export type InboundMessageDelivery = z.output<typeof inboundMessageDeliverySchema>;
41
44
  /** Canonical durable mailbox entry owned by task execution. */
42
45
  export declare const inboundMessageSchema: z.ZodObject<{
@@ -64,14 +67,16 @@ export declare const inboundMessageSchema: z.ZodObject<{
64
67
  text: z.ZodString;
65
68
  }, z.core.$strict>;
66
69
  receivedAtMs: z.ZodNumber;
70
+ publishExternally: z.ZodBoolean;
67
71
  source: z.ZodEnum<{
68
72
  slack: "slack";
69
- plugin: "plugin";
70
73
  local: "local";
74
+ web: "web";
75
+ plugin: "plugin";
71
76
  api: "api";
72
77
  internal: "internal";
73
- resource_event: "resource_event";
74
78
  scheduler: "scheduler";
79
+ resource_event: "resource_event";
75
80
  }>;
76
81
  }, z.core.$strict>;
77
82
  export type InboundMessage = z.output<typeof inboundMessageSchema>;
@@ -27,7 +27,7 @@ export declare function recordConversationRetry(args: {
27
27
  leaseToken: string;
28
28
  nowMs?: number;
29
29
  state?: StateAdapter;
30
- }): Promise<"stopped" | "lost_lease" | "recorded">;
30
+ }): Promise<"lost_lease" | "recorded" | "stopped">;
31
31
  /** Count mailbox messages that have not yet reached the conversation event log. */
32
32
  export declare function countPendingConversationMessages(conversation: Conversation): number;
33
33
  /** Return whether a conversation has pending or resumable execution work. */
@@ -114,7 +114,8 @@ export declare function drainConversationMailbox(args: Parameters<typeof workSta
114
114
  metadata?: Record<string, unknown> | undefined;
115
115
  };
116
116
  receivedAtMs: number;
117
- source: "slack" | "plugin" | "local" | "api" | "internal" | "resource_event" | "scheduler";
117
+ publishExternally: boolean;
118
+ source: "slack" | "local" | "web" | "plugin" | "api" | "internal" | "scheduler" | "resource_event";
118
119
  attemptCount?: number | undefined;
119
120
  destination?: {
120
121
  platform: "slack";
@@ -43,6 +43,7 @@ export interface TurnRecord {
43
43
  */
44
44
  actors: Actor[];
45
45
  resumeReason?: TurnPauseReason;
46
+ publishExternally?: boolean;
46
47
  resumedFromSliceId?: number;
47
48
  turnId: string;
48
49
  sliceId: number;
@@ -96,6 +97,7 @@ export declare function upsertTurnRecord(args: {
96
97
  trailingMessageProvenance?: ConversationMessageProvenance[];
97
98
  actor?: Actor;
98
99
  resumeReason?: TurnPauseReason;
100
+ publishExternally?: boolean;
99
101
  errorMessage?: string;
100
102
  resumedFromSliceId?: number;
101
103
  traceId?: string;
@@ -9,6 +9,8 @@ export interface ConversationWorkerContext {
9
9
  checkIn(): Promise<boolean>;
10
10
  conversationId: string;
11
11
  destination?: Destination;
12
+ publishExternally: boolean;
13
+ /** True when the current execution slice must stop at its next safe boundary. */
12
14
  shouldYield(): boolean;
13
15
  }
14
16
  export interface InboxAttempt {
@@ -13,7 +13,7 @@ export declare function readViewerTaskExecutions(user: User, kind: "scheduled" |
13
13
  /** Resolve the source task for one conversation when a terminal execution links it. */
14
14
  export declare function readConversationSourceTask(args: {
15
15
  conversationId: string;
16
- verifiedViewerEmail?: string;
16
+ viewer?: User;
17
17
  }): Promise<ConversationSourceTask | undefined>;
18
18
  /** Delete one viewer-owned scheduled or event task. */
19
19
  export declare function deleteViewerTask(user: User, kind: "scheduled" | "event", id: string): Promise<void>;
@@ -9,7 +9,7 @@ export declare function createSearchConversationEventsTool(context: ToolRuntimeC
9
9
  after_seq?: number | null | undefined;
10
10
  before_seq?: number | null | undefined;
11
11
  limit?: number | null | undefined;
12
- types?: ("message" | "handoff" | "user_message" | "assistant_message" | "tool_result" | "compaction" | "mcp_provider_connected" | "authorization_requested" | "authorization_completed" | "tool_execution_started" | "guardian_action_reviewed" | "message_updated" | "message_handled" | "messages_summarized" | "turn_started" | "turn_routed" | "turn_context" | "structured_event" | "turn_completed" | "turn_failed" | "subagent_started" | "subagent_ended")[] | null | undefined;
12
+ types?: ("message" | "message_handled" | "assistant_message" | "turn_routed" | "guardian_action_reviewed" | "turn_context" | "structured_event" | "compaction" | "handoff" | "user_message" | "tool_result" | "mcp_provider_connected" | "authorization_requested" | "authorization_completed" | "tool_execution_started" | "message_updated" | "messages_summarized" | "turn_started" | "turn_completed" | "turn_failed" | "subagent_started" | "subagent_ended")[] | null | undefined;
13
13
  };
14
14
  execute?: ((input: unknown, options: import("./definition").ToolExecuteOptions) => {
15
15
  [x: string]: unknown;