@sentry/junior 0.316.0 → 0.318.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 (124) hide show
  1. package/dist/{admin-QYiDMnsu.js → admin-UOHix_5P.js} +1 -1
  2. package/dist/{agent-runner-Cr5Fhjf-.js → agent-runner-DeYymwh2.js} +13494 -13135
  3. package/dist/{reporting-window-C4dbzDiR.js → agent-status-BA5x3Xtp.js} +33 -1
  4. package/dist/{agent-update-delivery-BY13DPSD.js → agent-update-delivery-DH8bx7jU.js} +5 -5
  5. package/dist/api/schema.d.ts +600 -130
  6. package/dist/api/schema.js +6 -6
  7. package/dist/api.js +228 -214
  8. package/dist/{app-BhvzRD__.d.ts → app-DKAOuaoC.d.ts} +33 -18
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +193 -177
  11. package/dist/{thread-context-fiMNylbg.js → auth-pause-state-f9hJM_zO.js} +6 -59
  12. package/dist/catalog-runtime-BfdAnztW.js +6 -0
  13. package/dist/{change-record-Bqsa5ZXE.d.ts → change-record-BzJgLsv7.d.ts} +60 -1
  14. package/dist/{adapter-context-Bref7aPI.js → channel-access-A0de5lRv.js} +2 -42
  15. package/dist/{chat-core-engine-3dtlMku3.js → chat-core-engine-D3Wd7f5n.js} +6 -5
  16. package/dist/{child-message--2G3Ft26.js → child-message-peFWLcCZ.js} +2 -6
  17. package/dist/cli/chat.js +38 -30
  18. package/dist/cli/check.js +5 -5
  19. package/dist/cli/main.js +2 -2
  20. package/dist/cli/plugins.js +5 -4
  21. package/dist/cli/snapshot-create.js +4 -2
  22. package/dist/cli/upgrade.js +5 -3
  23. package/dist/context-BKF_5zzI.js +1833 -0
  24. package/dist/{continue-in-slack-DbQUFe_F.js → continue-in-slack-YxwMQVeR.js} +3 -3
  25. package/dist/{conversation-feed-B84pMjHo.js → conversation-feed-Cj7IuBtM.js} +3 -3
  26. package/dist/{proxy-path-BTmXDjfx.js → conversation-privacy-Cr_dNW1p.js} +2 -16
  27. package/dist/{conversation-turn-DzEpTIaf.js → conversation-turn-Bru4w_FD.js} +196 -80
  28. package/dist/{create-DUJBXr6E.js → create-Btl1y1rq.js} +12 -11
  29. package/dist/{credential-sync-JH_K9Adg.js → credential-sync-DTarZ63K.js} +20 -15
  30. package/dist/{db-DhzvUY23.js → db-of6e3sGt.js} +20724 -27256
  31. package/dist/{deployment-BhvrhQeh.js → deployment-C0qXa0FD.js} +17 -15
  32. package/dist/{engine-context-C9Nal48K.js → engine-context-C_QL_bMQ.js} +304 -56
  33. package/dist/{html-B_12WjKT.js → html-9_pS9SjY.js} +6 -2
  34. package/dist/instrumentation.js +15 -7
  35. package/dist/{job-runner-DO8nslyY.js → job-runner-B2XEvpif.js} +392 -26
  36. package/dist/{lineage-D3AZAJVe.js → lineage-nh4z9iQN.js} +1 -1
  37. package/dist/{list-B0zsb5Cp.js → list-HRP3TIRl.js} +238 -550
  38. package/dist/{logging-B8KEJegM.js → logging-BnOG0qz2.js} +4 -50
  39. package/dist/{session-stop-DponjDUZ.js → mailbox-turn-Byrry9o1.js} +4807 -7102
  40. package/dist/{list-mkB_GU8R.js → markers-CTTtJqYn.js} +171 -124
  41. package/dist/{message-B5fKDYzz.js → message-BRUuLgrY.js} +13 -24
  42. package/dist/{model-input-CuMWy37l.js → model-input-CFC62mf-.js} +3 -3
  43. package/dist/nitro.d.ts +1 -1
  44. package/dist/nitro.js +21 -7
  45. package/dist/{oauth-callback-server-B3Vvlydo.js → oauth-callback-server-CjnnUr4o.js} +2 -2
  46. package/dist/{oauth-relay-6ERrGPbA.js → oauth-relay-BvHFH0fV.js} +2 -2
  47. package/dist/{package-discovery-BI6T_RkD.js → package-discovery-DD9vencX.js} +1 -50
  48. package/dist/{plugins-BXMdNdyA.js → plugins-D_Ru4CWc.js} +1 -1
  49. package/dist/profile-iHw1uu32.js +4657 -0
  50. package/dist/{transcript-CCi7323k.js → prompt-DEkStuxG.js} +92 -98
  51. package/dist/proxy-path-BHYoKZdq.js +15 -0
  52. package/dist/registry-Cl7Labpe.js +3279 -0
  53. package/dist/reports-C1d9azyV.js +195 -0
  54. package/dist/{resolve-D5JVvv6A.js → resolve-DC6zBuDV.js} +9 -29
  55. package/dist/{result-CS_7mo8a.js → result-DxewDuXb.js} +27 -118
  56. package/dist/run-conversation-Cz2ubZK-.js +337 -0
  57. package/dist/{runner-BzAES5W3.js → runner-99YxVN_r.js} +10 -18
  58. package/dist/{sandbox-egress-signals-Dwhk2Q5F.js → sandbox-egress-signals-CgoX5CTI.js} +1 -1
  59. package/dist/{schema-z5-wA6N4.js → schema-BTojNBr5.js} +48 -86
  60. package/dist/sender-actors-77zTQbSG.js +84 -0
  61. package/dist/{service-account-D6AsAtc1.js → service-account-YDCPSByj.js} +3 -1
  62. package/dist/{skills-DgJ9GBPR.js → skills-CleC0Hze.js} +6 -5
  63. package/dist/{slack-conversation-unfurl-Dq71EkhM.js → slack-conversation-unfurl-BNQLC12R.js} +7 -6
  64. package/dist/{spawn-BJWpdwhQ.js → spawn-DuZfodPa.js} +5 -5
  65. package/dist/{system-prompt-table-iIgpmslr.js → system-prompt-table-Ci6Ck4gk.js} +88 -69
  66. package/dist/{task-runner-BJae4JwE.js → task-runner-BJ9Up3bG.js} +30 -53
  67. package/dist/topics-BoCkoPJJ.js +21 -0
  68. package/dist/turn-membership-VT7XZh-L.js +856 -0
  69. package/dist/{turn-wake-BjDW7x-5.js → turn-wake-C7HeLHAM.js} +3 -4
  70. package/dist/{media-BebquhET.js → types-DCzTAA63.js} +629 -593
  71. package/dist/user-customization-CvfuY9Eo.js +93 -0
  72. package/dist/users-Cb9c1k9q.js +181 -0
  73. package/dist/{validation-D5WmmmhX.js → validation-BiUmWPhy.js} +1 -1
  74. package/dist/{version-CBQoanXb.js → version-VEXiEcZu.js} +1 -1
  75. package/dist/version.js +1 -1
  76. package/dist/{worker-Cyb4kF17.js → worker-ChWYQdhm.js} +5 -4
  77. package/migrations/20261126025226_drop_agent_invocations/migration.sql +6 -0
  78. package/migrations/20261126025226_drop_agent_invocations/snapshot.json +9 -0
  79. package/migrations/20261126033000_space_conversations_lead_children/migration.sql +155 -0
  80. package/migrations/20261126033000_space_conversations_lead_children/snapshot.json +9 -0
  81. package/migrations/20261126144620_drop_user_message_time_index/migration.sql +1 -0
  82. package/migrations/20261126144620_drop_user_message_time_index/snapshot.json +38 -0
  83. package/migrations/20261126153100_inbox_item_subjects/migration.sql +140 -0
  84. package/migrations/20261126153100_inbox_item_subjects/snapshot.json +9 -0
  85. package/migrations/20261126153103_inbox_item_subjects_not_null/migration.sql +12 -0
  86. package/migrations/20261126153103_inbox_item_subjects_not_null/snapshot.json +9 -0
  87. package/migrations/20261126153105_inbox_item_subject_indexes/migration.sql +1 -0
  88. package/migrations/20261126153105_inbox_item_subject_indexes/snapshot.json +9 -0
  89. package/migrations/20261126153108_automation_run_conversation_index/migration.sql +1 -0
  90. package/migrations/20261126153108_automation_run_conversation_index/snapshot.json +9 -0
  91. package/migrations/20261126153159_inbox_item_subjects_schema/migration.sql +4 -0
  92. package/migrations/20261126153159_inbox_item_subjects_schema/snapshot.json +437 -0
  93. package/migrations/20261126153259_inbox_questions/migration.sql +76 -0
  94. package/migrations/20261126153259_inbox_questions/snapshot.json +9 -0
  95. package/migrations/20261126153301_inbox_questions_valid/migration.sql +3 -0
  96. package/migrations/20261126153301_inbox_questions_valid/snapshot.json +9 -0
  97. package/migrations/20261126153343_inbox_questions_schema/migration.sql +5 -0
  98. package/migrations/20261126153343_inbox_questions_schema/snapshot.json +407 -0
  99. package/migrations/20261126154025_inbox_item_owners/migration.sql +74 -0
  100. package/migrations/20261126154025_inbox_item_owners/snapshot.json +9 -0
  101. package/migrations/20261126154048_inbox_item_open_subject_key_index/migration.sql +1 -0
  102. package/migrations/20261126154048_inbox_item_open_subject_key_index/snapshot.json +9 -0
  103. package/migrations/20261126154051_drop_inbox_item_owner_indexes/migration.sql +7 -0
  104. package/migrations/20261126154051_drop_inbox_item_owner_indexes/snapshot.json +9 -0
  105. package/migrations/20261126154121_inbox_item_owners_schema/migration.sql +8 -0
  106. package/migrations/20261126154121_inbox_item_owners_schema/snapshot.json +311 -0
  107. package/migrations/20261126175601_conversation_event_turn/migration.sql +5 -0
  108. package/migrations/20261126175601_conversation_event_turn/snapshot.json +103 -0
  109. package/migrations/20261126175614_conversation_event_turn_index/migration.sql +1 -0
  110. package/migrations/20261126175614_conversation_event_turn_index/snapshot.json +62 -0
  111. package/migrations/20261126230028_merge_leaves/migration.sql +2 -0
  112. package/migrations/20261126230028_merge_leaves/snapshot.json +12 -0
  113. package/migrations/20261126231932_space_lead_holds_name/migration.sql +46 -0
  114. package/migrations/20261126231932_space_lead_holds_name/snapshot.json +58 -0
  115. package/migrations/20261127001022_merge_leaves/migration.sql +2 -0
  116. package/migrations/20261127001022_merge_leaves/snapshot.json +12 -0
  117. package/migrations/20261127002500_turn_discarded_usage/migration.sql +2 -0
  118. package/migrations/20261127002500_turn_discarded_usage/snapshot.json +73 -0
  119. package/package.json +5 -5
  120. package/dist/people-CUtFApfL.js +0 -81
  121. package/dist/start-conversation-B-LIqqNi.js +0 -162
  122. package/dist/turn-session-routing-D15orfwy.js +0 -1309
  123. package/dist/user-customization-B27StpVQ.js +0 -9
  124. package/dist/web-message-id-C6P83ans.js +0 -10
@@ -1,9 +1,8 @@
1
- import { a as getDb, n as getConversationEventStore, ua as listConversationAnnotations } from "./db-DhzvUY23.js";
2
- import { G as mapBounded } from "./transcript-CCi7323k.js";
3
- import { b as setSpanAttributes } from "./logging-B8KEJegM.js";
4
- import { Bt as removedCardSchema, Vt as resolveMessageCards, zt as readMessageCardRefs } from "./media-BebquhET.js";
5
- import { Gr as clearPendingAuth, R as getTurnUserMessageId, Sr as markConversationMessage, X as markTurnCompleted, Xt as getConversationWorkState, Y as markTurnClosed, _r as buildConversationContext, at as persistThreadStateById, fr as hydrateConversationMessages, ot as coerceThreadConversationState, rt as getPersistedThreadState } from "./session-stop-DponjDUZ.js";
6
- import { n as listChildMessages } from "./child-message--2G3Ft26.js";
1
+ import { a as getDb, an as getConversationWorkState, is as listConversationAnnotations, n as getConversationEventStore } from "./db-of6e3sGt.js";
2
+ import { Gt as resolveMessageCards, Ut as readMessageCardRefs, Wt as removedCardSchema } from "./types-DCzTAA63.js";
3
+ import { G as mapBounded } from "./prompt-DEkStuxG.js";
4
+ import { Pn as hydrateConversationMessages, Wn as markConversationMessage, X as getTurnUserMessageId, ct as markTurnCompleted, gt as coerceThreadConversationState, ht as persistThreadStateById, pt as getPersistedThreadState, st as markTurnClosed, ur as clearPendingAuth } from "./mailbox-turn-Byrry9o1.js";
5
+ import { t as listChildMessages } from "./child-message-peFWLcCZ.js";
7
6
  // src/chat/conversations/pending-cards.ts
8
7
  /**
9
8
  * Add the cards that tool results selected since the last visible assistant
@@ -111,56 +110,4 @@ async function persistAuthPauseTurnState(args) {
111
110
  });
112
111
  await persistThreadStateById(args.threadStateId, { conversation });
113
112
  }
114
- // src/chat/conversations/thread-context.ts
115
- const CURSOR_TURN_LOOKBACK = 10;
116
- async function loadThreadContextCursor(args) {
117
- const store = getConversationEventStore();
118
- const [started, completed] = await Promise.all([store.query(args.conversationId, {
119
- limit: CURSOR_TURN_LOOKBACK,
120
- types: ["turn_started"]
121
- }), store.query(args.conversationId, {
122
- limit: CURSOR_TURN_LOOKBACK,
123
- types: ["turn_completed"]
124
- })]);
125
- const finished = new Set(completed.events.flatMap((event) => event.data.type === "turn_completed" && event.data.outcome !== "cancelled" ? [event.data.turnId] : []));
126
- const previous = [...started.events].reverse().find((event) => event.data.type === "turn_started" && event.data.turnId !== args.turnId && finished.has(event.data.turnId));
127
- return previous?.data.type === "turn_started" ? previous.data.threadContextThroughSeq : void 0;
128
- }
129
- /**
130
- * Return the oldest cursor of the Turns that the cursor lookup reads. Messages
131
- * after it may still be in the thread context delta of the next Turn, also
132
- * when the latest Turns failed or the next Turn retries.
133
- */
134
- async function loadThreadContextTrimFloor(conversationId) {
135
- const cursors = (await getConversationEventStore().query(conversationId, {
136
- limit: CURSOR_TURN_LOOKBACK,
137
- types: ["turn_started"]
138
- })).events.flatMap((event) => event.data.type === "turn_started" && event.data.threadContextThroughSeq !== void 0 ? [event.data.threadContextThroughSeq] : []);
139
- return cursors.length > 0 ? Math.min(...cursors) : void 0;
140
- }
141
- /**
142
- * Build the thread context of one Turn prompt. With agent history, show only
143
- * the thread Messages saved after the cursor of the previous Turn.
144
- *
145
- * Sets `app.thread_context.*` on the active span: `chat.reply` in a Slack
146
- * Turn, `chat.turn` in a web or Event Turn. Cursor `missing` means that the
147
- * previous Turn ran before cursors existed.
148
- */
149
- async function buildTurnThreadContext(args) {
150
- const afterSeq = args.hasHistory ? await loadThreadContextCursor({
151
- conversationId: args.conversationId,
152
- turnId: args.turnId
153
- }) : void 0;
154
- const block = buildConversationContext(args.conversation, {
155
- excludeMessageIds: args.excludeMessageIds,
156
- ...args.hasHistory ? { history: { afterSeq } } : void 0
157
- });
158
- setSpanAttributes({
159
- "app.thread_context.chars": block.text?.length ?? 0,
160
- "app.thread_context.shown_messages": block.shownMessages,
161
- "app.thread_context.omitted_messages": block.omittedMessages,
162
- "app.thread_context.cursor": !args.hasHistory ? "no_history" : afterSeq === void 0 ? "missing" : "found"
163
- });
164
- return block.text;
165
- }
166
- export { buildDeliveredTurnStatePatch as a, persistAuthPauseTurnState as i, loadThreadContextTrimFloor as n, loadPendingMessageCards as o, completeAuthPauseTurn as r, buildTurnThreadContext as t };
113
+ export { loadPendingMessageCards as i, persistAuthPauseTurnState as n, buildDeliveredTurnStatePatch as r, completeAuthPauseTurn as t };
@@ -0,0 +1,6 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-Cl7Labpe.js";
3
+ // src/chat/plugins/catalog-runtime.ts
4
+ var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
5
+ const pluginCatalogRuntime = createPluginCatalogRuntime();
6
+ export { pluginCatalogRuntime as n, catalog_runtime_exports as t };
@@ -98,6 +98,65 @@ declare function normalizeUserInputAnswer(request: UserInputRequest, answer: Use
98
98
  declare function answeredChoices(request: UserInputRequest, answer: UserInputAnswer): string[];
99
99
  /** Return true when an answer has no value and no free text. */
100
100
  declare function isEmptyUserInputAnswer(answer: UserInputAnswer): boolean;
101
+ /**
102
+ * The question of an Inbox item with its related links. The links are part
103
+ * of the question, so they are stored with it in `request`.
104
+ */
105
+ declare const inboxItemRequestSchema: z.ZodObject<{
106
+ question: z.ZodString;
107
+ fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
108
+ id: z.ZodString;
109
+ label: z.ZodString;
110
+ description: z.ZodOptional<z.ZodString>;
111
+ kind: z.ZodLiteral<"choice">;
112
+ options: z.ZodArray<z.ZodObject<{
113
+ label: z.ZodString;
114
+ description: z.ZodOptional<z.ZodString>;
115
+ recommended: z.ZodOptional<z.ZodBoolean>;
116
+ }, z.core.$strip>>;
117
+ }, z.core.$strip>, z.ZodObject<{
118
+ id: z.ZodString;
119
+ label: z.ZodString;
120
+ description: z.ZodOptional<z.ZodString>;
121
+ kind: z.ZodLiteral<"multi_choice">;
122
+ options: z.ZodArray<z.ZodObject<{
123
+ label: z.ZodString;
124
+ description: z.ZodOptional<z.ZodString>;
125
+ recommended: z.ZodOptional<z.ZodBoolean>;
126
+ }, z.core.$strip>>;
127
+ }, z.core.$strip>, z.ZodObject<{
128
+ id: z.ZodString;
129
+ label: z.ZodString;
130
+ description: z.ZodOptional<z.ZodString>;
131
+ kind: z.ZodLiteral<"text">;
132
+ }, z.core.$strip>], "kind">>;
133
+ related: z.ZodOptional<z.ZodArray<z.ZodObject<{
134
+ conversationId: z.ZodOptional<z.ZodString>;
135
+ label: z.ZodString;
136
+ note: z.ZodOptional<z.ZodString>;
137
+ url: z.ZodOptional<z.ZodString>;
138
+ }, z.core.$strict>>>;
139
+ }, z.core.$strip>;
140
+ type InboxItemRequest = z.output<typeof inboxItemRequestSchema>;
141
+ /**
142
+ * The request of a notice: only the related links that say what it is
143
+ * about, such as a pull request. A notice asks nothing, so it has no
144
+ * question.
145
+ */
146
+ declare const inboxItemNoticeRequestSchema: z.ZodObject<{
147
+ related: z.ZodArray<z.ZodObject<{
148
+ conversationId: z.ZodOptional<z.ZodString>;
149
+ label: z.ZodString;
150
+ note: z.ZodOptional<z.ZodString>;
151
+ url: z.ZodOptional<z.ZodString>;
152
+ }, z.core.$strict>>;
153
+ }, z.core.$strict>;
154
+ type InboxItemNoticeRequest = z.output<typeof inboxItemNoticeRequestSchema>;
155
+ /**
156
+ * Return the question of an item's request. A notice's request holds only
157
+ * related links, so it has none.
158
+ */
159
+ declare function inboxItemQuestion(request: InboxItemRequest | InboxItemNoticeRequest | null | undefined): InboxItemRequest | undefined;
101
160
  /** Saved automation facts shown with a Message, not a live status view. */
102
161
  declare const automationCardSchema: z.ZodObject<{
103
162
  kind: z.ZodLiteral<"automation">;
@@ -172,4 +231,4 @@ declare const inboxItemChangeRecordSchema: z.ZodObject<{
172
231
  reviewItemId: z.ZodString;
173
232
  }, z.core.$strict>;
174
233
  type InboxItemChangeRecord = z.output<typeof inboxItemChangeRecordSchema>;
175
- export { InputFile as _, annotationCard as a, MessageAttachment as b, AutomationCard as c, UserInputField as d, UserInputRequest as f, normalizeUserInputAnswer as g, isEmptyUserInputAnswer as h, MessageCard as i, USER_INPUT_NOTE as l, buttonUserInputField as m, conversationTurnFailureCodeSchema as n, messageCardText as o, answeredChoices as p, conversationTurnFailureReasonSchema as r, resolveMessageCards as s, InboxItemChangeRecord as t, UserInputAnswer as u, MAX_ATTACHMENT_BYTES as v, MAX_INPUT_ATTACHMENTS as y };
234
+ export { normalizeUserInputAnswer as _, annotationCard as a, MAX_INPUT_ATTACHMENTS as b, AutomationCard as c, UserInputAnswer as d, UserInputField as f, isEmptyUserInputAnswer as g, buttonUserInputField as h, MessageCard as i, inboxItemQuestion as l, answeredChoices as m, conversationTurnFailureCodeSchema as n, messageCardText as o, UserInputRequest as p, conversationTurnFailureReasonSchema as r, resolveMessageCards as s, InboxItemChangeRecord as t, USER_INPUT_NOTE as u, InputFile as v, MessageAttachment as x, MAX_ATTACHMENT_BYTES as y };
@@ -1,4 +1,4 @@
1
- import { Nd as withSlackRetries, Td as getSlackClient, i as getConversationStore, jd as runWithSlackInstallationToken, nf as getStateAdapter, xd as SlackActionError } from "./db-DhzvUY23.js";
1
+ import { Bs as withSlackRetries, Ms as getSlackClient, Os as SlackActionError, i as getConversationStore } from "./db-of6e3sGt.js";
2
2
  import * as z from "zod";
3
3
  // src/chat/slack/channel.ts
4
4
  const replySubtypeSchema = z.object({ subtype: z.string().optional() });
@@ -217,44 +217,4 @@ async function joinPublicChannelForRead(args) {
217
217
  throw error;
218
218
  }
219
219
  }
220
- // src/chat/slack/adapter-context.ts
221
- const initializedAdapters = /* @__PURE__ */ new WeakSet();
222
- async function getConnectedState(stateAdapter) {
223
- const state = stateAdapter ?? getStateAdapter();
224
- await state.connect();
225
- return state;
226
- }
227
- /** Initialize the Slack adapter against the repository state adapter. */
228
- async function ensureSlackAdapterInitialized(args) {
229
- if (initializedAdapters.has(args.adapter)) return;
230
- const state = await getConnectedState(args.state);
231
- await args.adapter.initialize({ getState: () => state });
232
- if (args.adapter.defaultBotTokenProvider && !args.adapter.botUserId) throw new Error("Slack adapter initialized without a resolved bot user id");
233
- initializedAdapters.add(args.adapter);
234
- }
235
- /** Verify a Slack request using the adapter's configured signing secret. */
236
- function verifySlackSignature(args) {
237
- const verifySignature = args.adapter.verifySignature;
238
- if (!verifySignature) throw new Error("Slack adapter does not expose signature verification");
239
- return verifySignature.call(args.adapter, args.body, args.request.headers.get("x-slack-request-timestamp"), args.request.headers.get("x-slack-signature"));
240
- }
241
- /** Run Slack work with the installation token that matches the inbound event. */
242
- async function runWithSlackInstallation(args) {
243
- await ensureSlackAdapterInitialized({
244
- adapter: args.adapter,
245
- state: args.state
246
- });
247
- const internals = args.adapter;
248
- if (internals.defaultBotTokenProvider) return await args.task();
249
- const installationId = args.installation.isEnterpriseInstall ? args.installation.enterpriseId : args.installation.teamId;
250
- if (!installationId) throw new Error("Slack installation context is missing team id");
251
- if (!internals.resolveTokenForTeam || !internals.requestContext) throw new Error("Slack adapter cannot resolve workspace installations");
252
- const tokenContext = await internals.resolveTokenForTeam.call(args.adapter, installationId, args.installation.isEnterpriseInstall);
253
- if (!tokenContext) throw new Error(`Slack installation token was not found for ${installationId}`);
254
- return await internals.requestContext.run({
255
- ...tokenContext,
256
- enterpriseId: args.installation.enterpriseId,
257
- isEnterpriseInstall: args.installation.isEnterpriseInstall
258
- }, () => runWithSlackInstallationToken(tokenContext.token, args.task));
259
- }
260
- export { getChannelMessage as a, isPublicSlackChannel as c, listThreadReplies as d, joinPublicChannelForRead as i, joinPublicChannel as l, verifySlackSignature as n, getConversationInfo as o, checkSlackChannelReadAccess as r, isConversationMember as s, runWithSlackInstallation as t, listChannelMessages as u };
220
+ export { isConversationMember as a, listChannelMessages as c, getConversationInfo as i, listThreadReplies as l, joinPublicChannelForRead as n, isPublicSlackChannel as o, getChannelMessage as r, joinPublicChannel as s, checkSlackChannelReadAccess as t };
@@ -1,12 +1,13 @@
1
- import { Ff as getChatConfig, Gl as juniorTurns, i as getConversationStore, sl as SYSTEM_IDENTITY_ID, u as createSqlConversationEventStore } from "./db-DhzvUY23.js";
1
+ import { R as getChatConfig } from "./context-BKF_5zzI.js";
2
+ import { $s as SYSTEM_IDENTITY_ID, af as juniorTurns, d as createSqlConversationEventStore, i as getConversationStore } from "./db-of6e3sGt.js";
2
3
  import { t as startLocalVercelQueueServer } from "./local-server-CpnGhYml.js";
3
- import { ea as projectConversationEvents } from "./session-stop-DponjDUZ.js";
4
+ import { ai as projectConversationEvents } from "./mailbox-turn-Byrry9o1.js";
4
5
  import { n as TURN_STEP_TOPIC } from "./topic-CRYYBYp-.js";
5
- import { a as scheduleInput, i as turnStepConsumer, n as turnTools, r as createGatewayModelClient, t as createEngineContext } from "./engine-context-C9Nal48K.js";
6
- import { randomUUID } from "node:crypto";
6
+ import { a as scheduleInput, i as turnStepConsumer, n as turnTools, r as createGatewayModelClient, t as createEngineContext } from "./engine-context-C_QL_bMQ.js";
7
+ import { eq } from "drizzle-orm";
7
8
  import { localDestinationSchema } from "@sentry/junior-plugin-api";
9
+ import { randomUUID } from "node:crypto";
8
10
  import { setTimeout } from "node:timers/promises";
9
- import { eq } from "drizzle-orm";
10
11
  // src/turn-steps/group-key.ts
11
12
  /** The group key of an input that this Actor Identity sent from this Source. */
12
13
  function turnGroupKey(actorIdentityId, source) {
@@ -1,8 +1,4 @@
1
- // src/chat/agent-invocations/child-message.ts
2
- /** Mailbox metadata that stores who sent one child reply or result. */
3
- function childMessageSenderMetadata(sender) {
4
- return { sender };
5
- }
1
+ // src/chat/child-agents/child-message.ts
6
2
  /**
7
3
  * List the child replies and results among the ids that reached one
8
4
  * mailbox, oldest first, with the sender fields that the mailbox keeps.
@@ -16,4 +12,4 @@ function listChildMessages(inboundMessageIds, messageSenders) {
16
12
  }] : [];
17
13
  });
18
14
  }
19
- export { listChildMessages as n, childMessageSenderMetadata as t };
15
+ export { listChildMessages as t };
package/dist/cli/chat.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
2
- import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-Cr5Fhjf-.js";
2
+ import { G as loadConfig, W as installChatConfig } from "../context-BKF_5zzI.js";
3
+ import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-DeYymwh2.js";
3
4
  import path from "node:path";
4
5
  import { createHash, randomUUID } from "node:crypto";
5
6
  import { stderr, stdin, stdout } from "node:process";
@@ -86,10 +87,19 @@ function writeStream(stream, text) {
86
87
  });
87
88
  });
88
89
  }
89
- /** Keep local chat ephemeral by default; Redis is opt-in via an explicit adapter. */
90
- function defaultStateAdapterForLocalChat() {
91
- if (process.env["JUNIOR_STATE_ADAPTER"]) return;
92
- process.env["JUNIOR_STATE_ADAPTER"] = "memory";
90
+ /**
91
+ * Install the config of a local chat run. Local chat is ephemeral by default:
92
+ * it uses the memory state adapter unless `JUNIOR_STATE_ADAPTER` is set, so
93
+ * Redis is opt-in.
94
+ */
95
+ function installLocalChatConfig(options = {}) {
96
+ installChatConfig(loadConfig({
97
+ env: process.env,
98
+ options: {
99
+ ...options,
100
+ state: { adapter: process.env["JUNIOR_STATE_ADAPTER"] ? void 0 : "memory" }
101
+ }
102
+ }));
93
103
  }
94
104
  /** Load the app plugin module so source-mode local chat matches server wiring. */
95
105
  async function loadLocalPluginSet() {
@@ -97,18 +107,18 @@ async function loadLocalPluginSet() {
97
107
  }
98
108
  /** Configure plugin hooks after local chat has selected its state adapter. */
99
109
  async function configureLocalChatPlugins(pluginSet) {
100
- const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
101
- import("../plugins-BXMdNdyA.js").then((n) => n.o),
102
- import("../db-DhzvUY23.js").then((n) => n.W),
103
- import("../db-DhzvUY23.js").then((n) => n.Ar),
104
- import("../validation-D5WmmmhX.js").then((n) => n.r),
105
- import("../db-DhzvUY23.js").then((n) => n.t)
110
+ const [pluginsModule, registryModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
111
+ import("../plugins-D_Ru4CWc.js").then((n) => n.o),
112
+ import("../db-of6e3sGt.js").then((n) => n.Tt),
113
+ import("../catalog-runtime-BfdAnztW.js").then((n) => n.t),
114
+ import("../validation-BiUmWPhy.js").then((n) => n.r),
115
+ import("../db-of6e3sGt.js").then((n) => n.t)
106
116
  ]);
107
117
  const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
108
118
  const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
109
119
  const pluginConfig = resolvedPluginSet ? pluginsModule.pluginCatalogConfigFromPluginSet(resolvedPluginSet) : pluginsModule.pluginCatalogConfigFromEnv();
110
120
  const shouldValidatePluginCatalog = Boolean(pluginConfig) || Boolean(resolvedPluginSet?.registrations.length);
111
- agentHooksModule.validatePlugins(plugins);
121
+ registryModule.validatePlugins(plugins);
112
122
  const previousPluginCatalogConfig = catalogRuntimeModule.pluginCatalogRuntime.setConfig(pluginConfig);
113
123
  try {
114
124
  if (shouldValidatePluginCatalog) {
@@ -117,7 +127,7 @@ async function configureLocalChatPlugins(pluginSet) {
117
127
  validationModule.validatePluginEgressCredentialHooks(resolvedPluginSet?.registrations ?? []);
118
128
  }
119
129
  databaseModule.getDb();
120
- agentHooksModule.setPlugins(plugins);
130
+ registryModule.setPlugins(plugins);
121
131
  } catch (error) {
122
132
  catalogRuntimeModule.pluginCatalogRuntime.setConfig(previousPluginCatalogConfig);
123
133
  throw error;
@@ -152,30 +162,28 @@ function localDevServerUrl() {
152
162
  }
153
163
  /** Wire the shared local-turn setup so prompt and interactive runs stay identical. */
154
164
  async function prepareLocalChatRun(io, pluginSet) {
155
- defaultStateAdapterForLocalChat();
165
+ installLocalChatConfig({ eventEmbeddings: { enabled: true } });
156
166
  await configureLocalChatPlugins(pluginSet);
157
- const { setEventEmbeddingsConfig } = await import("../db-DhzvUY23.js").then((n) => n.dn);
158
- setEventEmbeddingsConfig({ enabled: true });
159
- const { runLocalAgentTurn } = await import("../runner-BzAES5W3.js");
160
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-B3Vvlydo.js");
161
- const { createLocalOAuthState } = await import("../oauth-relay-6ERrGPbA.js").then((n) => n.t);
162
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-Dwhk2Q5F.js");
163
- const { bindSpawnAgent } = await import("../spawn-BJWpdwhQ.js").then((n) => n.n);
164
- const { bindMessageAgent } = await import("../message-B5fKDYzz.js").then((n) => n.n);
165
- const { createChildConversationWorker } = await import("../result-CS_7mo8a.js").then((n) => n.a);
166
- const { createConversationTurnWorker } = await import("../conversation-turn-DzEpTIaf.js").then((n) => n.t);
167
- const { resumeForPersonInput } = await import("../session-stop-DponjDUZ.js").then((n) => n.a);
167
+ const { runLocalAgentTurn } = await import("../runner-99YxVN_r.js");
168
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-CjnnUr4o.js");
169
+ const { createLocalOAuthState } = await import("../oauth-relay-BvHFH0fV.js").then((n) => n.t);
170
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-CgoX5CTI.js");
171
+ const { bindSpawnAgent } = await import("../spawn-DuZfodPa.js").then((n) => n.n);
172
+ const { bindMessageAgent } = await import("../message-BRUuLgrY.js").then((n) => n.n);
173
+ const { runConversation } = await import("../run-conversation-Cz2ubZK-.js").then((n) => n.n);
174
+ const { createConversationTurnWorker } = await import("../conversation-turn-Bru4w_FD.js").then((n) => n.t);
175
+ const { resumeForPersonInput } = await import("../mailbox-turn-Byrry9o1.js").then((n) => n.K);
168
176
  const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
169
- const { processConversationWork } = await import("../worker-Cyb4kF17.js").then((n) => n.n);
177
+ const { processConversationWork } = await import("../worker-ChWYQdhm.js").then((n) => n.n);
170
178
  let agentRunner;
171
179
  const localConversationWork = createLocalConversationWork(async (message) => {
172
180
  if (!agentRunner) throw new Error("Local agent runner is not ready");
173
- const childWorker = createChildConversationWorker({ runTurn: createConversationTurnWorker(agentRunner, void 0, { queue: localConversationWork.queue }) });
181
+ const runTurn = createConversationTurnWorker(agentRunner, void 0, { queue: localConversationWork.queue });
174
182
  await processConversationWork(message, {
175
183
  queue: localConversationWork.queue,
176
184
  run: async (context) => {
177
185
  await resumeForPersonInput(context.conversationId, context.attempt.messages);
178
- return await childWorker(context);
186
+ return await runConversation(context, { runTurn });
179
187
  }
180
188
  });
181
189
  });
@@ -231,9 +239,9 @@ async function runPrompt(options, io, pluginSet) {
231
239
  }
232
240
  }
233
241
  async function runCorePrompt(options, io, pluginSet) {
234
- defaultStateAdapterForLocalChat();
242
+ installLocalChatConfig();
235
243
  await configureLocalChatPlugins(pluginSet);
236
- const { runCoreEnginePrompt } = await import("../chat-core-engine-3dtlMku3.js");
244
+ const { runCoreEnginePrompt } = await import("../chat-core-engine-D3Wd7f5n.js");
237
245
  const result = await runCoreEnginePrompt({
238
246
  conversationId: newRunConversationId(),
239
247
  message: options.message
package/dist/cli/check.js CHANGED
@@ -1,11 +1,11 @@
1
- import { G as mapBounded } from "../transcript-CCi7323k.js";
2
- import { a as parseSkillFile } from "../skills-DgJ9GBPR.js";
3
- import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, c as JUNIOR_HEARTBEAT_ROUTE, m as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION } from "../deployment-BhvrhQeh.js";
4
- import { _i as parsePluginManifest, gi as parseInlinePluginManifest } from "../db-DhzvUY23.js";
1
+ import { G as mapBounded } from "../prompt-DEkStuxG.js";
2
+ import { a as parseSkillFile } from "../skills-CleC0Hze.js";
3
+ import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, c as JUNIOR_HEARTBEAT_ROUTE, m as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION } from "../deployment-C0qXa0FD.js";
4
+ import { X as parseInlinePluginManifest, Z as parsePluginManifest } from "../registry-Cl7Labpe.js";
5
5
  import * as z from "zod";
6
- import pLimit from "p-limit";
7
6
  import path from "node:path";
8
7
  import { mentionsTag } from "@sentry/junior-plugin-api";
8
+ import pLimit from "p-limit";
9
9
  import fs from "node:fs/promises";
10
10
  import { pathToFileURL } from "node:url";
11
11
  // src/cli/check.ts
package/dist/cli/main.js CHANGED
@@ -45,10 +45,10 @@ async function runChat(argv, pluginSet) {
45
45
  return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
46
46
  }
47
47
  async function runAdmin(argv) {
48
- return await (await import("../admin-QYiDMnsu.js")).runAdmin(argv);
48
+ return await (await import("../admin-UOHix_5P.js")).runAdmin(argv);
49
49
  }
50
50
  async function runServiceAccount(argv) {
51
- return await (await import("../service-account-D6AsAtc1.js")).runServiceAccount(argv);
51
+ return await (await import("../service-account-YDCPSByj.js")).runServiceAccount(argv);
52
52
  }
53
53
  function topLevelCommand(argv) {
54
54
  return (argv[0] === "--" ? argv.slice(1) : argv)[0];
@@ -1,8 +1,9 @@
1
- import { a as getDb, jr as pluginCatalogRuntime, nt as setPlugins, rt as validatePlugins, ut as coreRegistrations } from "../db-DhzvUY23.js";
2
- import { I as createPluginLogger } from "../transcript-CCi7323k.js";
3
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-D5WmmmhX.js";
1
+ import { Dt as validatePlugins, Et as setPlugins, a as getDb, kt as coreRegistrations } from "../db-of6e3sGt.js";
2
+ import { h as createPluginLogger } from "../prompt-DEkStuxG.js";
3
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-BfdAnztW.js";
4
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-BiUmWPhy.js";
4
5
  import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
5
- import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-BXMdNdyA.js";
6
+ import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-D_Ru4CWc.js";
6
7
  import { Command, CommanderError } from "commander";
7
8
  import { stderr, stdout } from "node:process";
8
9
  import { createJiti } from "jiti";
@@ -1,5 +1,7 @@
1
- import { Ff as getChatConfig, Gn as create, ef as disconnectStateAdapter, jr as pluginCatalogRuntime, yi as SANDBOX_RUNTIME } from "../db-DhzvUY23.js";
2
- import { n as resolve } from "../resolve-D5JVvv6A.js";
1
+ import { R as getChatConfig, _ as disconnectStateAdapter } from "../context-BKF_5zzI.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-BfdAnztW.js";
3
+ import { n as resolve } from "../resolve-DC6zBuDV.js";
4
+ import { t as create, u as SANDBOX_RUNTIME } from "../profile-iHw1uu32.js";
3
5
  // src/cli/snapshot-create.ts
4
6
  const DEFAULT_TIMEOUT_MS = 6e5;
5
7
  function progressMessage(phase) {
@@ -1,11 +1,13 @@
1
- import { Ff as getChatConfig, Mr as createPluginCatalogRuntime, c as pendingMigrations, l as readMigrationRecords, s as createJuniorSqlExecutor } from "../db-DhzvUY23.js";
1
+ import { R as getChatConfig } from "../context-BKF_5zzI.js";
2
+ import { c as pendingMigrations, l as readMigrationRecords, s as createJuniorSqlExecutor } from "../db-of6e3sGt.js";
2
3
  import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
3
- import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-BXMdNdyA.js";
4
+ import { t as createPluginCatalogRuntime } from "../registry-Cl7Labpe.js";
5
+ import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-D_Ru4CWc.js";
4
6
  import { t as isMissingVirtualModule } from "../virtual-module-BeKA_EII.js";
5
7
  import { basename, dirname, join, resolve } from "node:path";
6
8
  import { createHash } from "node:crypto";
7
- import { fileURLToPath } from "node:url";
8
9
  import { readMigrationFiles } from "drizzle-orm/migrator";
10
+ import { fileURLToPath } from "node:url";
9
11
  import { createJiti } from "jiti";
10
12
  // src/chat/conversations/sql/migrations.ts
11
13
  /** SQL schema migrations for durable Junior records. */