@sentry/junior 0.302.0 → 0.304.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 (100) hide show
  1. package/dist/{adapter-context-Cx9fn9B3.js → adapter-context-B1IpoELr.js} +2 -2
  2. package/dist/{admin-_poE5NKL.js → admin-BnVFGo_z.js} +5 -5
  3. package/dist/{agent-runner-CY9RvsTX.js → agent-runner-CoEeZSRh.js} +1461 -1248
  4. package/dist/api/schema.d.ts +2 -2
  5. package/dist/api/schema.js +6 -6
  6. package/dist/api.d.ts +13 -12
  7. package/dist/api.js +230 -105
  8. package/dist/{app-BpY3wtRP.d.ts → app-Cs157Zc5.d.ts} +17 -15
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +108 -96
  11. package/dist/{automation-Cva5ZOwW.js → automation-CuA3yEcD.js} +3 -1
  12. package/dist/{background-compaction-queue-CXFq1_Cz.js → background-compaction-queue-WLPNSF_b.js} +6 -6
  13. package/dist/{briefs-B3NG-pid.js → briefs-CagVVefw.js} +12 -9
  14. package/dist/{catalog-runtime-Dss0lSV6.js → catalog-runtime-B8ZXvXWm.js} +2 -2
  15. package/dist/cli/chat.d.ts +1 -1
  16. package/dist/cli/chat.js +21 -21
  17. package/dist/cli/check.js +10 -10
  18. package/dist/cli/env.d.ts +1 -0
  19. package/dist/cli/env.js +8 -7
  20. package/dist/cli/init.js +13 -4
  21. package/dist/cli/main.js +4 -4
  22. package/dist/cli/plugins.js +6 -6
  23. package/dist/cli/snapshot-create.js +7 -5
  24. package/dist/cli/upgrade.d.ts +2 -2
  25. package/dist/cli/upgrade.js +6 -6
  26. package/dist/{config-CzeZiMKs.js → config-DdO1BNcw.js} +142 -67
  27. package/dist/{connections-CDYhMfrs.js → connections-D20kp0j5.js} +6 -6
  28. package/dist/{continue-in-slack-7Uf05ndC.js → continue-in-slack-BKEVMBj1.js} +8 -8
  29. package/dist/{conversation-BNXfq6Lb.js → conversation-BOqdRtUx.js} +4 -12
  30. package/dist/{conversation-feed-Clf_cv0n.js → conversation-feed-CgpgP7yi.js} +35 -2
  31. package/dist/{conversation-privacy-D9xnM5mK.js → conversation-privacy-L1SK_v0V.js} +16 -8
  32. package/dist/{conversation-turn-D7SEZgTG.js → conversation-turn-BptVJylj.js} +20 -23
  33. package/dist/{credential-sync-DoD0gW-j.js → credential-sync-D1J1CGzL.js} +19 -19
  34. package/dist/{db-B-gtnNjr.js → db-EKJnkrIb.js} +180 -17
  35. package/dist/{db-BdsCzytP.d.ts → db-zbN5ZV_o.d.ts} +26 -26
  36. package/dist/{executor-DZg20EqU.js → executor-CoIZmFK8.js} +55 -15
  37. package/dist/{history-IjdmO_r6.js → history-m2-ceTTX.js} +21 -12
  38. package/dist/{install-t1KQyTUs.js → install-BT2Pf6HP.js} +3 -3
  39. package/dist/instrumentation.d.ts +4 -4
  40. package/dist/instrumentation.js +15 -11
  41. package/dist/{lineage-C79GjoQr.js → lineage-C5DGQCS_.js} +2 -2
  42. package/dist/{logging-C9oDAg4M.js → logging-QSZuMcvo.js} +19 -19
  43. package/dist/{message-BLUCzJXN.js → message-TtxftRHj.js} +9 -9
  44. package/dist/{model-input-5jwNC45G.js → model-input-BHXfA29g.js} +4 -9
  45. package/dist/nitro.d.ts +1 -1
  46. package/dist/nitro.js +8 -8
  47. package/dist/{oauth-callback-server-BBl66vCb.js → oauth-callback-server-B0enqHtZ.js} +5 -4
  48. package/dist/{oauth-relay-DRzq73b6.js → oauth-relay-DAmfVmJu.js} +3 -6
  49. package/dist/{package-discovery-DJhGdS4c.js → package-discovery-x4AvVhMj.js} +1 -1
  50. package/dist/{plugin-module-Cf5gVPWP.js → plugin-module-Cv2ETe8Y.js} +1 -1
  51. package/dist/{plugins-BBX07Jzt.js → plugins-Bkk0XRo2.js} +3 -3
  52. package/dist/{projection-CIBwgD3s.js → projection-CNKK7doO.js} +755 -221
  53. package/dist/{prompt-CRQbzp5e.js → prompt-DSjhoKu5.js} +185 -12
  54. package/dist/{queue-DtCDaIct.js → queue-CDxkit82.js} +4 -4
  55. package/dist/{queue-CZyYgPF0.d.ts → queue-CbEHUO0l.d.ts} +1 -1
  56. package/dist/{registry-DdFQHZ_d.js → registry-DBDNUUmz.js} +37 -37
  57. package/dist/{resolve-CdW4BdrK.js → resolve-CQLhMWSu.js} +3 -3
  58. package/dist/{result-oOMv1t4O.js → result-B-pauj42.js} +10 -15
  59. package/dist/rolldown-runtime-BKpuH2hG.js +26 -0
  60. package/dist/{runner-DqitLtm-.js → runner-B3KxKks5.js} +10 -10
  61. package/dist/{sandbox-egress-signals-Bw9I0yfJ.js → sandbox-egress-signals-DJJX9ClG.js} +1 -1
  62. package/dist/{schema-DnVQepWP.js → schema-Bx0Mlo32.js} +77 -13
  63. package/dist/{schema-BIFM-U1a.d.ts → schema-CKcu-IK6.d.ts} +562 -23
  64. package/dist/{secrets-DebYU866.js → secrets-DHaJ5TTn.js} +4 -4
  65. package/dist/{sentry-BRTJqumy.js → sentry-CPbZjomA.js} +3 -28
  66. package/dist/{sentry-route-name-BhwWnfqj.js → sentry-route-name-C6EIzAGP.js} +1 -1
  67. package/dist/{service-account-CrZftRTb.js → service-account-2HmlNPvy.js} +49 -48
  68. package/dist/{service-account-B6mKAPVo.js → service-account-DQLqkSVv.js} +5 -5
  69. package/dist/{session-stop-DW63Z3kj.js → session-stop-DEeZKqbX.js} +132 -74
  70. package/dist/{skills-C16fz60Z.js → skills-2UrD7JkN.js} +6 -9
  71. package/dist/{slack-conversation-unfurl-BHhefEb7.js → slack-conversation-unfurl-Dd129Uov.js} +14 -18
  72. package/dist/{spawn-D_RnFYfy.js → spawn-eMho9HDJ.js} +7 -7
  73. package/dist/{legacy-web-actor-id-C-cEeWqL.js → state-Bveuc4Zh.js} +32 -32
  74. package/dist/{stop-7p1i08CY.js → stop-D_ltJLDS.js} +359 -171
  75. package/dist/{store-C28I0CVW.js → store-COeYnPL_.js} +5 -5
  76. package/dist/{task-queue-BVUJbQ28.js → task-queue-CBIDXZpV.js} +3 -3
  77. package/dist/{task-runner-CWi8j7Z6.js → task-runner-CJF7zIJL.js} +15 -18
  78. package/dist/{thread-context-D3-yYUd0.js → thread-context-Cg0jt0aE.js} +12 -12
  79. package/dist/{turn-session-routing-BFMS9ATF.js → turn-session-routing-CaY3Tp8m.js} +32 -32
  80. package/dist/{turn-user-message-C3-O8Omt.js → turn-user-message-tcom1RYd.js} +3 -3
  81. package/dist/{validation-BSFKUIb4.js → validation-EU91JwIT.js} +2 -2
  82. package/dist/vercel.js +1 -1
  83. package/dist/{version-BHHXNi-0.js → version-BYRPhY5G.js} +1 -1
  84. package/dist/version.js +1 -1
  85. package/dist/{viewer-B1SO21Qa.js → viewer-Cf8ISkAc.js} +3 -3
  86. package/dist/{warmup-Bz9bzkzN.js → warmup-TgY4S1vx.js} +202 -577
  87. package/dist/{worker-BspReIIK.js → worker-C6Uq4OKD.js} +9 -12
  88. package/migrations/0109_user_preferences.sql +1 -0
  89. package/migrations/0110_code_change_repository_state_index.sql +1 -0
  90. package/migrations/0111_attachment_kinds.sql +14 -0
  91. package/migrations/0112_attachment_url_fill.sql +51 -0
  92. package/migrations/0113_attachment_url_index.sql +1 -0
  93. package/migrations/meta/0099_snapshot.json +102 -326
  94. package/migrations/meta/0109_snapshot.json +4925 -0
  95. package/migrations/meta/0110_snapshot.json +4952 -0
  96. package/migrations/meta/0111_snapshot.json +5011 -0
  97. package/migrations/meta/0112_snapshot.json +5011 -0
  98. package/migrations/meta/0113_snapshot.json +5033 -0
  99. package/migrations/meta/_journal.json +36 -1
  100. package/package.json +16 -19
@@ -1,8 +1,10 @@
1
- import { C as completeObject$1, S as completeDecision$1, T as embedTexts$1, w as completeText$1 } from "./config-CzeZiMKs.js";
2
- import { _ as runBestEffort, a as extractGenAiUsageSummary } from "./logging-C9oDAg4M.js";
3
- import { at as agentTurnCostUsd, r as getConversationEventStore } from "./db-B-gtnNjr.js";
4
- import { Q as briefOutcomeStatusSchema, et as conversationBriefSchema, tt as parseBriefInput } from "./conversation-BNXfq6Lb.js";
1
+ import { A as searchWeb$1, C as completeObject$1, D as generateImages$1, E as gatewayCostUsd, G as createProviderError, Q as resolveGatewayCredential, S as completeDecision$1, T as embedTexts$1, U as ProviderError, X as isProviderRetryError, b as GEN_AI_PROVIDER_NAME, w as completeText$1, x as GEN_AI_SERVER_ADDRESS } from "./config-DdO1BNcw.js";
2
+ import { E as withSpan, _ as runBestEffort, a as extractGenAiUsageSummary, i as extractGenAiUsageAttributes, p as logException } from "./logging-QSZuMcvo.js";
3
+ import { r as getConversationEventStore, st as agentTurnCostUsd } from "./db-EKJnkrIb.js";
4
+ import { $ as conversationBriefSchema, Z as briefOutcomeStatusSchema, et as parseBriefInput } from "./conversation-BOqdRtUx.js";
5
5
  import * as z from "zod";
6
+ import { createGatewayProvider } from "@ai-sdk/gateway";
7
+ import { transcribe } from "ai";
6
8
  import { conversationEventPresentationSchema, defineConversationEvent } from "@sentry/junior-plugin-api";
7
9
  // src/chat/conversations/structured-events.ts
8
10
  /** Reserved namespace for Junior-owned conversation metadata events. */
@@ -137,6 +139,151 @@ function renderJuniorNativeConversationEvent(args) {
137
139
  const presentation = definition.renderEvent(definition.parse(args.content));
138
140
  return presentation === void 0 ? void 0 : conversationEventPresentationSchema.parse(presentation);
139
141
  }
142
+ // src/chat/pi/transcription.ts
143
+ const GEN_AI_OPERATION_TRANSCRIPTION = "transcription";
144
+ const NO_AUDIO_PATTERN = /\(invalid_audio\)\s*$/;
145
+ const SENTENCE_END_PATTERN = /[.?!]["')\]]*$/;
146
+ /** The file has no audio that the model can transcribe. */
147
+ var NoAudioError = class extends Error {
148
+ name = "NoAudioError";
149
+ };
150
+ const diarizedWordsSchema = z.object({ elevenlabs: z.object({ words: z.array(z.object({
151
+ speaker_id: z.string().nullish(),
152
+ start: z.number(),
153
+ text: z.string(),
154
+ type: z.string()
155
+ })) }) });
156
+ /**
157
+ * Group diarized words into entries. A speech entry ends when the speaker
158
+ * changes or a sentence ends. Each audio event is its own sound entry.
159
+ * Spaces join words and never start an entry.
160
+ */
161
+ function transcriptEntries(words) {
162
+ const entries = [];
163
+ let current;
164
+ for (const word of words) {
165
+ if (word.type === "spacing") {
166
+ if (current) current.text += word.text;
167
+ continue;
168
+ }
169
+ if (word.type === "audio_event") {
170
+ entries.push({
171
+ kind: "sound",
172
+ startSeconds: word.start,
173
+ text: word.text.replace(/^[[(]+|[\])]+$/g, "")
174
+ });
175
+ current = void 0;
176
+ continue;
177
+ }
178
+ const speaker = word.speaker_id ?? void 0;
179
+ if (!current || current.speaker !== speaker) {
180
+ current = {
181
+ kind: "speech",
182
+ startSeconds: word.start,
183
+ text: "",
184
+ ...speaker ? { speaker } : void 0
185
+ };
186
+ entries.push(current);
187
+ }
188
+ current.text += word.text;
189
+ if (SENTENCE_END_PATTERN.test(word.text)) current = void 0;
190
+ }
191
+ return entries.map((entry) => ({
192
+ ...entry,
193
+ text: entry.text.trim()
194
+ })).filter((entry) => entry.text.length > 0);
195
+ }
196
+ /**
197
+ * Keep the classification of a failed call, but not the SDK error. That
198
+ * error keeps the request body, and the body holds the signed URL.
199
+ */
200
+ function withoutSourceUrl(error, sourceUrl, modelId) {
201
+ const failure = error instanceof Error ? error : void 0;
202
+ const message = (failure?.message ?? String(error)).replaceAll(sourceUrl, "<signed URL>");
203
+ const classified = createProviderError(Object.assign(new Error(message, { cause: failure?.cause }), {
204
+ code: failure && "code" in failure ? failure.code : void 0,
205
+ statusCode: failure && "statusCode" in failure ? failure.statusCode : void 0
206
+ }), { modelId });
207
+ return new ProviderError({
208
+ cause: new Error(message),
209
+ kind: classified.kind,
210
+ modelId,
211
+ retryable: classified.retryable,
212
+ retryAfterMs: classified.retryAfterMs,
213
+ status: classified.status
214
+ });
215
+ }
216
+ /**
217
+ * Transcribe speech in a file that the provider downloads from `sourceUrl`.
218
+ *
219
+ * The URL goes to the provider as `sourceUrl` with empty audio, so the file
220
+ * never passes through this process. The URL is a bearer credential: it is
221
+ * not put on spans, logs, or errors.
222
+ */
223
+ async function transcribeFromUrl$1(params) {
224
+ const credential = await resolveGatewayCredential();
225
+ const provider = createGatewayProvider({ apiKey: credential.token });
226
+ try {
227
+ return await withSpan(`${GEN_AI_OPERATION_TRANSCRIPTION} ${params.modelId}`, "gen_ai.transcription", {
228
+ modelId: params.modelId,
229
+ ...params.conversationId ? { conversationId: params.conversationId } : void 0
230
+ }, async (setSpanAttributes) => {
231
+ const result = await transcribe({
232
+ model: provider.transcriptionModel(params.modelId),
233
+ audio: /* @__PURE__ */ new Uint8Array(),
234
+ providerOptions: { elevenlabs: {
235
+ diarize: true,
236
+ sourceUrl: params.sourceUrl,
237
+ tagAudioEvents: true
238
+ } },
239
+ ...params.signal ? { abortSignal: params.signal } : void 0
240
+ }).catch((error) => {
241
+ if (error instanceof Error && NO_AUDIO_PATTERN.test(error.message)) {
242
+ setSpanAttributes({ "error.type": "invalid_audio" });
243
+ throw new NoAudioError("The file has no audio to transcribe.");
244
+ }
245
+ throw error;
246
+ });
247
+ const costUsd = gatewayCostUsd(result.providerMetadata);
248
+ const generationId = result.providerMetadata["gateway"]?.["generationId"];
249
+ const words = diarizedWordsSchema.safeParse(result.providerMetadata);
250
+ const entries = words.success ? transcriptEntries(words.data.elevenlabs.words) : result.segments.map((segment) => ({
251
+ kind: "speech",
252
+ startSeconds: segment.startSecond,
253
+ text: segment.text
254
+ }));
255
+ setSpanAttributes({
256
+ ...typeof generationId === "string" ? { "gen_ai.response.id": generationId } : void 0,
257
+ ...result.durationInSeconds !== void 0 ? { "app.transcription.audio_seconds": result.durationInSeconds } : void 0,
258
+ "app.transcription.entry_count": entries.length,
259
+ ...extractGenAiUsageAttributes(costUsd !== void 0 ? { cost: { total: costUsd } } : void 0)
260
+ });
261
+ return {
262
+ ...costUsd !== void 0 ? { costUsd } : void 0,
263
+ ...result.durationInSeconds !== void 0 ? { durationSeconds: result.durationInSeconds } : void 0,
264
+ entries,
265
+ ...result.language ? { language: result.language } : void 0
266
+ };
267
+ }, {
268
+ "gen_ai.provider.name": GEN_AI_PROVIDER_NAME,
269
+ "gen_ai.operation.name": GEN_AI_OPERATION_TRANSCRIPTION,
270
+ "gen_ai.request.model": params.modelId,
271
+ "server.address": GEN_AI_SERVER_ADDRESS,
272
+ "server.port": 443,
273
+ "gen_ai.provider.auth_mode": credential.mode
274
+ });
275
+ } catch (error) {
276
+ if (error instanceof NoAudioError) throw error;
277
+ const providerError = withoutSourceUrl(error, params.sourceUrl, params.modelId);
278
+ if (isProviderRetryError(providerError)) throw providerError;
279
+ logException(providerError, "ai.transcription.failed", {
280
+ "gen_ai.provider.name": GEN_AI_PROVIDER_NAME,
281
+ "gen_ai.operation.name": GEN_AI_OPERATION_TRANSCRIPTION,
282
+ "gen_ai.request.model": params.modelId
283
+ });
284
+ throw providerError;
285
+ }
286
+ }
140
287
  // src/chat/core-model.ts
141
288
  function gatewayParams(params) {
142
289
  const { cost: _cost, operation, ...rest } = params;
@@ -190,6 +337,29 @@ async function embedTexts(params) {
190
337
  await recordCost(params, result.costUsd);
191
338
  return result;
192
339
  }
340
+ /** Run one web search and attribute its cost. */
341
+ async function searchWeb(params) {
342
+ const result = await searchWeb$1(gatewayParams(params));
343
+ await recordCost(params, result.costUsd);
344
+ return result;
345
+ }
346
+ /** Generate or edit images and attribute the cost. */
347
+ async function generateImages(params) {
348
+ const { cost: _cost, operation: _operation, ...rest } = params;
349
+ const result = await generateImages$1(rest);
350
+ await recordCost(params, result.costUsd);
351
+ return result;
352
+ }
353
+ /** Transcribe speech in a file at a signed URL and attribute the cost. */
354
+ async function transcribeFromUrl(params) {
355
+ const { cost, operation: _operation, ...rest } = params;
356
+ const result = await transcribeFromUrl$1({
357
+ ...rest,
358
+ ..."conversationId" in cost ? { conversationId: cost.conversationId } : void 0
359
+ });
360
+ await recordCost(params, result.costUsd);
361
+ return result;
362
+ }
193
363
  // src/chat/briefs/generate.ts
194
364
  const MAX_INPUT_CHARS = 6e4;
195
365
  const MAX_MESSAGE_TEXT_CHARS = 4e3;
@@ -260,12 +430,14 @@ const RUNTIME_MARKER_PATTERN = /\[\[NO_REPLY\]\]|<\/?(?:active-asks|analysis-err
260
430
  function hasRuntimeMarker(value) {
261
431
  return RUNTIME_MARKER_PATTERN.test(value);
262
432
  }
433
+ const ASSISTANT_ATTRIBUTION = "assistant";
263
434
  function normalizeModelBrief(args) {
264
435
  let coercedDecisionKinds = 0;
265
436
  let droppedAttributionCount = 0;
266
437
  let droppedRuntimeMarkerCount = 0;
267
438
  const participantNames = new Map(args.record.participants.map((participant) => [participant.name.toLowerCase(), participant.name]));
268
- participantNames.set("junior", "Junior");
439
+ participantNames.set(args.assistantName.toLowerCase(), args.assistantName);
440
+ participantNames.set(ASSISTANT_ATTRIBUTION, args.assistantName);
269
441
  const attribution = (value) => {
270
442
  if (!value?.trim()) return void 0;
271
443
  const matched = participantNames.get(value.trim().toLowerCase());
@@ -279,10 +451,10 @@ function normalizeModelBrief(args) {
279
451
  }
280
452
  let by = attribution(decision.by);
281
453
  let kind = decision.kind;
282
- if (by === "Junior" && kind !== "assumed") {
454
+ if (by === args.assistantName && kind !== "assumed") {
283
455
  kind = "assumed";
284
456
  coercedDecisionKinds += 1;
285
- } else if (by && by !== "Junior" && kind === "assumed") {
457
+ } else if (by && by !== args.assistantName && kind === "assumed") {
286
458
  by = void 0;
287
459
  coercedDecisionKinds += 1;
288
460
  }
@@ -552,6 +724,7 @@ async function generateBrief(args) {
552
724
  previous: args.previous
553
725
  });
554
726
  const normalized = normalizeModelBrief({
727
+ assistantName: args.assistantName,
555
728
  caps,
556
729
  links,
557
730
  model,
@@ -697,7 +870,7 @@ function briefEntriesFromReportEvents(events) {
697
870
  return entries;
698
871
  }
699
872
  // src/chat/briefs/prompt.ts
700
- const BRIEF_PROMPT = `You write one durable Brief for a Junior Conversation.
873
+ const BRIEF_PROMPT = `You write one durable Brief for a Conversation. The assistant wrote the entries with role \`assistant\`.
701
874
 
702
875
  Use only facts supported by the supplied entries, evidence, or previous Brief. Do not invent names, ids, numbers, outcomes, choices, or links.
703
876
 
@@ -705,14 +878,14 @@ Rules:
705
878
  - Summarize the intent and current outcome in plain prose.
706
879
  - Keep earlier decisions unless later entries reverse them. State a reversal as a new decision.
707
880
  - A decision is a choice made by a listed participant in this Conversation. It is not a research finding, tool result, action, observation, or suggestion. Put findings in facts or the summary.
708
- - Set each decision's \`kind\` to \`stated\` when a human participant stated the choice themselves, \`confirmed\` when Junior proposed it and a human participant explicitly accepted it, or \`assumed\` when Junior chose while working and no participant confirmed or objected.
709
- - Set a decision's \`by\` to the participant who made it, or Junior. Use only names in the supplied record. Set \`by\` to \`null\` when no supported attribution exists.
881
+ - Set each decision's \`kind\` to \`stated\` when a human participant stated the choice themselves, \`confirmed\` when the assistant proposed it and a human participant explicitly accepted it, or \`assumed\` when the assistant chose while working and no participant confirmed or objected.
882
+ - Set a decision's \`by\` to the participant who made it, or to \`assistant\` for the assistant. Use only names in the supplied record. Set \`by\` to \`null\` when no supported attribution exists.
710
883
  - Facts are durable one-line facts that help after the transcript expires. Prefer ids, versions, owners, constraints, and numbers. Do not list fields, recap the transcript, or include transient progress.
711
- - Ignore Junior runtime mechanics and context tags.
884
+ - Ignore the assistant's runtime mechanics and context tags.
712
885
  - Never say that a code change was merged, closed, deployed, or released unless a supplied code change or resource has that status. Say opened for an open code change.
713
886
  - Choose the outcome status that best describes where the Conversation ended.
714
887
  - Follow the supplied size class caps. Keep the first items that matter most.
715
888
  - Cite a URL only when its exact full string occurs in an entry, evidence, or the previous Brief. Return cited URLs in \`urls\`. Core adds code changes and resources separately.
716
889
  - Keep the summary under 600 characters, intent under 400 characters, outcome text under 600 characters, and each other string under 400 characters.
717
890
  `;
718
- export { renderJuniorNativeConversationEvent as _, EVENT_SYSTEM_ACTOR as a, completeDecision as c, embedTexts as d, JUNIOR_NATIVE_EVENT_NAMESPACE as f, conversationNoteEvent as g, authenticationUnlinkedEvent as h, EVENT_MESSAGE_AUTHOR as i, completeObject as l, authenticationLinkedEvent as m, briefEntriesFromReportEvents as n, isEventConversationMessage as o, agentsInstructionsUpdatedEvent as p, EVENT_AUTHOR_ID as r, generateBrief as s, BRIEF_PROMPT as t, completeText as u };
891
+ export { agentsInstructionsUpdatedEvent as _, EVENT_SYSTEM_ACTOR as a, conversationNoteEvent as b, completeDecision as c, embedTexts as d, generateImages as f, JUNIOR_NATIVE_EVENT_NAMESPACE as g, NoAudioError as h, EVENT_MESSAGE_AUTHOR as i, completeObject as l, transcribeFromUrl as m, briefEntriesFromReportEvents as n, isEventConversationMessage as o, searchWeb as p, EVENT_AUTHOR_ID as r, generateBrief as s, BRIEF_PROMPT as t, completeText as u, authenticationLinkedEvent as v, renderJuniorNativeConversationEvent as x, authenticationUnlinkedEvent as y };
@@ -1,6 +1,6 @@
1
- import { i as getChatConfig } from "./config-CzeZiMKs.js";
2
- import { h as logWarn } from "./logging-C9oDAg4M.js";
3
- import { a as queueCallback, d as verifyQueueMessage, f as getQueueProvider, l as QUEUE_SIGNATURE_MAX_AGE_MS, u as signQueueMessage } from "./background-compaction-queue-CXFq1_Cz.js";
1
+ import { i as getChatConfig } from "./config-DdO1BNcw.js";
2
+ import { h as logWarn } from "./logging-QSZuMcvo.js";
3
+ import { a as queueCallback, d as verifyQueueMessage, f as getQueueProvider, l as QUEUE_SIGNATURE_MAX_AGE_MS, u as signQueueMessage } from "./background-compaction-queue-WLPNSF_b.js";
4
4
  import * as z from "zod";
5
5
  import { createHash } from "node:crypto";
6
6
  // src/chat/sandbox/snapshot/job-queue.ts
@@ -92,7 +92,7 @@ function cacheWarmupCallback() {
92
92
  maxDeliveries: 1,
93
93
  onRejected: logCacheWarmupRejected,
94
94
  run: async (message) => {
95
- const { runCacheWarmup } = await import("./warmup-Bz9bzkzN.js").then((n) => n.o);
95
+ const { runCacheWarmup } = await import("./warmup-TgY4S1vx.js").then((n) => n.s);
96
96
  await runCacheWarmup(message);
97
97
  },
98
98
  skip: () => !getChatConfig().cacheWarmingEnabled,
@@ -7,7 +7,7 @@ declare const conversationQueueMessageSchema: z.ZodObject<{
7
7
  /** Conversation work hint accepted by the queue callback and worker. */
8
8
  type ConversationQueueMessage = z.output<typeof conversationQueueMessageSchema>;
9
9
  interface ConversationQueueSendOptions {
10
- delayMs?: number;
10
+ delayMs?: number | undefined;
11
11
  idempotencyKey?: string;
12
12
  }
13
13
  interface ConversationQueueSendResult {
@@ -1,6 +1,6 @@
1
- import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-C9oDAg4M.js";
1
+ import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-x4AvVhMj.js";
2
+ import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-QSZuMcvo.js";
2
3
  import { o as isUserActor, s as parseActorUserId } from "./actor-D2iXzvlN.js";
3
- import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-DJhGdS4c.js";
4
4
  import * as z from "zod";
5
5
  import path from "node:path";
6
6
  import { randomUUID } from "node:crypto";
@@ -305,7 +305,7 @@ function manifestConfigPatch(config) {
305
305
  setDefined(result, "command-env", config.commandEnv);
306
306
  setDefined(result, "env-vars", config.envVars);
307
307
  if (config.credentials !== void 0) {
308
- if (!config.credentials) result.credentials = null;
308
+ if (!config.credentials) result["credentials"] = null;
309
309
  else {
310
310
  const credentials = {};
311
311
  setDefined(credentials, "type", config.credentials.type);
@@ -313,13 +313,13 @@ function manifestConfigPatch(config) {
313
313
  setDefined(credentials, "api-headers", config.credentials.apiHeaders);
314
314
  setDefined(credentials, "auth-token-env", config.credentials.authTokenEnv);
315
315
  setDefined(credentials, "auth-token-placeholder", config.credentials.authTokenPlaceholder);
316
- result.credentials = credentials;
316
+ result["credentials"] = credentials;
317
317
  }
318
318
  }
319
319
  setDefined(result, "runtime-dependencies", config.runtimeDependencies);
320
320
  setDefined(result, "runtime-postinstall", config.runtimePostinstall);
321
321
  if (config.mcp !== void 0) {
322
- if (!config.mcp) result.mcp = null;
322
+ if (!config.mcp) result["mcp"] = null;
323
323
  else {
324
324
  const mcp = {};
325
325
  setDefined(mcp, "transport", config.mcp.transport);
@@ -329,11 +329,11 @@ function manifestConfigPatch(config) {
329
329
  setDefined(mcp, "oauth-client", config.mcp.oauthClient && mcpOauthClientSource(config.mcp.oauthClient));
330
330
  setDefined(mcp, "allowed-tools", config.mcp.allowedTools);
331
331
  setDefined(mcp, "wrapped-tools", config.mcp.wrappedTools);
332
- result.mcp = mcp;
332
+ result["mcp"] = mcp;
333
333
  }
334
334
  }
335
335
  if (config.oauth !== void 0) {
336
- if (!config.oauth) result.oauth = null;
336
+ if (!config.oauth) result["oauth"] = null;
337
337
  else {
338
338
  const oauth = {};
339
339
  setDefined(oauth, "client-id-env", config.oauth.clientIdEnv);
@@ -345,18 +345,18 @@ function manifestConfigPatch(config) {
345
345
  setDefined(oauth, "token-auth-method", config.oauth.tokenAuthMethod);
346
346
  setDefined(oauth, "token-extra-headers", config.oauth.tokenExtraHeaders);
347
347
  setDefined(oauth, "treat-empty-scope-as-unreported", config.oauth.treatEmptyScopeAsUnreported);
348
- result.oauth = oauth;
348
+ result["oauth"] = oauth;
349
349
  }
350
350
  }
351
- if (config.accounts !== void 0) result.accounts = config.accounts && accountsSource(config.accounts);
351
+ if (config.accounts !== void 0) result["accounts"] = config.accounts && accountsSource(config.accounts);
352
352
  if (config.target !== void 0) {
353
- if (!config.target) result.target = null;
353
+ if (!config.target) result["target"] = null;
354
354
  else {
355
355
  const target = {};
356
356
  setDefined(target, "type", config.target.type);
357
357
  setDefined(target, "config-key", config.target.configKey);
358
358
  setDefined(target, "command-flags", config.target.commandFlags);
359
- result.target = target;
359
+ result["target"] = target;
360
360
  }
361
361
  }
362
362
  return result;
@@ -382,7 +382,7 @@ function mergeManifestConfig(base, patch, options = {}) {
382
382
  return merged;
383
383
  }
384
384
  function applyManifestConfig(source, config) {
385
- const name = source.name;
385
+ const name = source["name"];
386
386
  if (typeof name !== "string") return source;
387
387
  const manifestConfig = config?.manifests?.[name];
388
388
  if (manifestConfig && "name" in manifestConfig) throw new Error("plugins.manifests cannot change plugin names");
@@ -478,7 +478,7 @@ function assertCommandEnvHostRefsAreExplicitlyExposed(commandEnv, envVars, plugi
478
478
  }
479
479
  }
480
480
  function normalizeCredentials(data, name) {
481
- if (data.type !== "oauth-bearer") throw new Error(`Plugin ${name} has unsupported credentials.type: "${String(data.type)}"`);
481
+ if (data["type"] !== "oauth-bearer") throw new Error(`Plugin ${name} has unsupported credentials.type: "${String(data["type"])}"`);
482
482
  const result = oauthBearerCredentialsSchema.safeParse(data);
483
483
  if (!result.success) throw new Error(issueMessage(result.error, `Plugin ${name} credentials`));
484
484
  if (!result.data.domains) throw new Error(`Plugin ${name} credentials requires domains`);
@@ -602,7 +602,7 @@ function expandEnvPlaceholders(template, envVars, context) {
602
602
  }
603
603
  function normalizeMcp(data, envVars, name) {
604
604
  const prepared = { ...data };
605
- if (typeof prepared.url === "string") prepared.url = expandEnvPlaceholders(prepared.url, envVars, `Plugin ${name} mcp.url`);
605
+ if (typeof prepared["url"] === "string") prepared["url"] = expandEnvPlaceholders(prepared["url"], envVars, `Plugin ${name} mcp.url`);
606
606
  const result = mcpSourceSchema.safeParse(prepared);
607
607
  if (!result.success) throw new Error(issueMessage(result.error, `Plugin ${name} mcp`));
608
608
  const headers = result.data.headers ? normalizeStringMap(result.data.headers, `Plugin ${name} mcp.headers`, { forbiddenKeys: FORBIDDEN_API_HEADER_NAMES }) : void 0;
@@ -668,20 +668,20 @@ function parseManifestSource(parsedSource, dir, config, options) {
668
668
  if (!sourceResult.success) {
669
669
  const issue = sourceResult.error.issues[0];
670
670
  const path = formatPath(issue?.path ?? []);
671
- if (path === "name") throw new Error(`Invalid plugin name in ${dir}: "${parsedSource.name}"`);
671
+ if (path === "name") throw new Error(`Invalid plugin name in ${dir}: "${String(parsedSource["name"])}"`);
672
672
  if (path === "description") throw new Error(`Invalid plugin description in ${dir}`);
673
- if (path === "config-keys") throw new Error(`Plugin ${String(parsedSource.name ?? "unknown")} config-keys must be an array when provided`);
674
- if (path === "domains") throw new Error(`Plugin ${String(parsedSource.name ?? "unknown")} ${path} must be a non-empty array of domains`);
675
- if (path === "api-headers") throw new Error(`Plugin ${String(parsedSource.name ?? "unknown")} api-headers must be an object when provided`);
676
- if (path === "command-env") throw new Error(`Plugin ${String(parsedSource.name ?? "unknown")} command-env must be an object when provided`);
677
- if (path === "credentials") throw new Error(`Plugin ${String(parsedSource.name ?? "unknown")} credentials must be an object when provided`);
678
- if (path === "runtime-dependencies") throw new Error(`Plugin ${String(parsedSource.name ?? "unknown")} runtime-dependencies must be an array`);
679
- if (path === "runtime-postinstall") throw new Error(`Plugin ${String(parsedSource.name ?? "unknown")} runtime-postinstall must be an array`);
680
- if (path === "env-vars") throw new Error(`Plugin ${String(parsedSource.name ?? "unknown")} env-vars must be an object`);
681
- if (path === "mcp") throw new Error(`Plugin ${String(parsedSource.name ?? "unknown")} mcp must be an object`);
682
- if (path === "oauth") throw new Error(`Plugin ${String(parsedSource.name ?? "unknown")} oauth must be an object`);
683
- if (path === "accounts") throw new Error(`Plugin ${String(parsedSource.name ?? "unknown")} accounts must be an object`);
684
- if (path === "target") throw new Error(`Plugin ${String(parsedSource.name ?? "unknown")} target must be an object`);
673
+ if (path === "config-keys") throw new Error(`Plugin ${String(parsedSource["name"] ?? "unknown")} config-keys must be an array when provided`);
674
+ if (path === "domains") throw new Error(`Plugin ${String(parsedSource["name"] ?? "unknown")} ${path} must be a non-empty array of domains`);
675
+ if (path === "api-headers") throw new Error(`Plugin ${String(parsedSource["name"] ?? "unknown")} api-headers must be an object when provided`);
676
+ if (path === "command-env") throw new Error(`Plugin ${String(parsedSource["name"] ?? "unknown")} command-env must be an object when provided`);
677
+ if (path === "credentials") throw new Error(`Plugin ${String(parsedSource["name"] ?? "unknown")} credentials must be an object when provided`);
678
+ if (path === "runtime-dependencies") throw new Error(`Plugin ${String(parsedSource["name"] ?? "unknown")} runtime-dependencies must be an array`);
679
+ if (path === "runtime-postinstall") throw new Error(`Plugin ${String(parsedSource["name"] ?? "unknown")} runtime-postinstall must be an array`);
680
+ if (path === "env-vars") throw new Error(`Plugin ${String(parsedSource["name"] ?? "unknown")} env-vars must be an object`);
681
+ if (path === "mcp") throw new Error(`Plugin ${String(parsedSource["name"] ?? "unknown")} mcp must be an object`);
682
+ if (path === "oauth") throw new Error(`Plugin ${String(parsedSource["name"] ?? "unknown")} oauth must be an object`);
683
+ if (path === "accounts") throw new Error(`Plugin ${String(parsedSource["name"] ?? "unknown")} accounts must be an object`);
684
+ if (path === "target") throw new Error(`Plugin ${String(parsedSource["name"] ?? "unknown")} target must be an object`);
685
685
  throw new Error(issue?.message ?? `Invalid plugin manifest in ${dir}`);
686
686
  }
687
687
  const data = sourceResult.data;
@@ -762,7 +762,7 @@ function parsePluginManifest(raw, dir, config) {
762
762
  try {
763
763
  parsedYaml = parse(raw);
764
764
  } catch (error) {
765
- throw new Error(`Invalid plugin manifest in ${dir}: ${error instanceof Error ? error.message : String(error)}`);
765
+ throw new Error(`Invalid plugin manifest in ${dir}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
766
766
  }
767
767
  if (!parsedYaml || typeof parsedYaml !== "object" || Array.isArray(parsedYaml)) throw new Error(`Invalid plugin manifest in ${dir}: expected an object`);
768
768
  return parseManifestSource(parsedYaml, dir, config);
@@ -1034,7 +1034,7 @@ async function readBoundedOAuthErrorBody(response) {
1034
1034
  }
1035
1035
  /** Preserve small OAuth error responses while bounding bodies before SDK parsing. */
1036
1036
  function fetchWithBoundedOAuthErrorBodies(fetchFn = globalThis.fetch, onErrorResponseStatus) {
1037
- return (async (input, init) => {
1037
+ return async (input, init) => {
1038
1038
  const response = await fetchFn(input, init);
1039
1039
  if (response.ok) return response;
1040
1040
  onErrorResponseStatus?.(response.status);
@@ -1050,7 +1050,7 @@ function fetchWithBoundedOAuthErrorBodies(fetchFn = globalThis.fetch, onErrorRes
1050
1050
  status: response.status,
1051
1051
  statusText: response.statusText
1052
1052
  });
1053
- });
1053
+ };
1054
1054
  }
1055
1055
  // src/chat/plugins/command-env.ts
1056
1056
  const ENV_PLACEHOLDER_RE$1 = /\$\{([A-Z_][A-Z0-9_]*)\}/g;
@@ -1161,8 +1161,8 @@ function buildOAuthTokenRequest(input) {
1161
1161
  const payload = { ...input.payload };
1162
1162
  if (input.tokenAuthMethod === "basic") headers.set("Authorization", `Basic ${Buffer.from(`${input.clientId}:${input.clientSecret}`).toString("base64")}`);
1163
1163
  else {
1164
- payload.client_id = input.clientId;
1165
- payload.client_secret = input.clientSecret;
1164
+ payload["client_id"] = input.clientId;
1165
+ payload["client_secret"] = input.clientSecret;
1166
1166
  }
1167
1167
  const contentType = headers.get("Content-Type") ?? DEFAULT_TOKEN_CONTENT_TYPE;
1168
1168
  const serializedHeaders = {};
@@ -1178,11 +1178,11 @@ function buildOAuthTokenRequest(input) {
1178
1178
  function parseOAuthTokenResponse(data, requestedScope, options) {
1179
1179
  const response = requireTokenResponseObject(data);
1180
1180
  const accessToken = requireNonEmptyTokenField(response, "access_token");
1181
- const resolvedRefreshToken = response.refresh_token === void 0 ? options?.refreshToken : requireNonEmptyTokenField(response, "refresh_token");
1181
+ const resolvedRefreshToken = response["refresh_token"] === void 0 ? options?.refreshToken : requireNonEmptyTokenField(response, "refresh_token");
1182
1182
  if (!resolvedRefreshToken) throw new Error("OAuth token response missing refresh_token");
1183
- const expiresIn = response.expires_in;
1184
- const refreshTokenExpiresIn = response.refresh_token_expires_in;
1185
- const responseScope = response.scope;
1183
+ const expiresIn = response["expires_in"];
1184
+ const refreshTokenExpiresIn = response["refresh_token_expires_in"];
1185
+ const responseScope = response["scope"];
1186
1186
  let scope;
1187
1187
  if (responseScope !== void 0) {
1188
1188
  if (typeof responseScope !== "string") throw new Error("OAuth token response returned invalid scope");
@@ -1542,7 +1542,7 @@ function logLoadedPlugins(state) {
1542
1542
  for (const plugin of [...state.pluginDefinitions].sort((left, right) => left.manifest.name.localeCompare(right.manifest.name))) {
1543
1543
  if (loggedPluginNames.has(plugin.manifest.name)) continue;
1544
1544
  loggedPluginNames.add(plugin.manifest.name);
1545
- logInfo("plugin.loaded", {
1545
+ logInfo("plugin.manifest.loaded", {
1546
1546
  "app.plugin.name": plugin.manifest.name,
1547
1547
  "app.plugin.config_key_count": plugin.manifest.configKeys.length,
1548
1548
  "app.plugin.has_mcp": Boolean(plugin.manifest.mcp),
@@ -1,6 +1,6 @@
1
- import { ea as create, ia as getSandboxProvider, is as sleep, na as isStale } from "./projection-CIBwgD3s.js";
2
- import { J as getStateAdapter } from "./db-B-gtnNjr.js";
3
- import { i as trace, n as postinstall, o as getSandboxResources, t as dependencies } from "./install-t1KQyTUs.js";
1
+ import { i as trace, n as postinstall, o as getSandboxResources, t as dependencies } from "./install-BT2Pf6HP.js";
2
+ import { ea as create, fs as sleep, ia as getSandboxProvider, na as isStale } from "./projection-CNKK7doO.js";
3
+ import { X as getStateAdapter } from "./db-EKJnkrIb.js";
4
4
  import * as z from "zod";
5
5
  // src/chat/sandbox/snapshot/resolve.ts
6
6
  const SNAPSHOT_CACHE_PREFIX = "junior:sandbox_snapshot_profile:v2";
@@ -1,23 +1,18 @@
1
- import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { Jn as renderUntrustedTag } from "./projection-CIBwgD3s.js";
3
- import { D as turnBehavior, M as SYSTEM_IDENTITY_ID, a as getConversationStore } from "./db-B-gtnNjr.js";
4
- import { f as credentialContextForActor } from "./registry-DdFQHZ_d.js";
5
- import { a as EVENT_SYSTEM_ACTOR } from "./prompt-CRQbzp5e.js";
6
- import { C as listActiveMailboxTurns, N as renderEventBatchInputs, P as timerWatchCredentialSubject, T as resolveMailboxTurnWork, j as eventBatchMessageMeta, k as EVENT_WAIT_MS, s as eventReviewItemInputs, t as getConversationStoppedAtMs, w as parseEventMessages, x as getEventBatchDelayMs } from "./session-stop-DW63Z3kj.js";
7
- import { $t as reportReplacedWithoutOpenWork, Cn as createAgentInvocationFromLatest, Ht as NON_TERMINAL_AGENT_INVOCATION_STATUSES, Jt as isTerminalAgentInvocation, Qt as markAgentInvocationParentMailboxAppended, Ut as TERMINAL_AGENT_INVOCATION_STATUSES, Vt as listUnreportedSiblingAgents, Yt as listAgentInvocationsForConversation, cn as parentMessageText, en as sendsResultToParent, fn as endActiveAgentInvocations, hn as resolveAgentInvocationId, in as routeChildInput, ln as readParentMessage, mn as enqueueAgentInvocation, nn as getChildAgentInputSender, pn as endAgentInvocationsOfStoppedWork, qt as getLatestAgentInvocationForConversation, rn as readChildConversationSender, sn as logDroppedParentMessage, tn as childAgentInput, un as createAgentInvocationWorker } from "./warmup-Bz9bzkzN.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
+ import { P as SYSTEM_IDENTITY_ID, a as getConversationStore, k as turnBehavior } from "./db-EKJnkrIb.js";
3
+ import { C as listActiveMailboxTurns, N as renderEventBatchInputs, P as timerWatchCredentialSubject, T as resolveMailboxTurnWork, j as eventBatchMessageMeta, k as EVENT_WAIT_MS, s as eventReviewItemInputs, t as getConversationStoppedAtMs, w as parseEventMessages, x as getEventBatchDelayMs } from "./session-stop-DEeZKqbX.js";
4
+ import { a as EVENT_SYSTEM_ACTOR } from "./prompt-DSjhoKu5.js";
5
+ import { f as credentialContextForActor } from "./registry-DBDNUUmz.js";
6
+ import { A as getAgentInvocationResultMessageId, C as ownAgentInvocation, D as getAgentInvocationIdForMessage, E as getAgentInvocationIdForEvents, F as getTurnReplyKey, M as getAgentReplyMessageId, O as getAgentInvocationIdForResult, R as buildDeterministicTurnId, S as listChildMessages, b as hasAgentInvocationReply, j as getAgentInvocationTurnId, y as childMessageSenderMetadata } from "./turn-user-message-tcom1RYd.js";
7
+ import { _ as getConversationWorkState, r as appendAndEnqueueInboundMessage } from "./store-COeYnPL_.js";
8
+ import { $t as childAgentInput, Bt as NON_TERMINAL_AGENT_INVOCATION_STATUSES, Gt as getLatestAgentInvocationForConversation, Kt as isTerminalAgentInvocation, Qt as sendsResultToParent, Vt as TERMINAL_AGENT_INVOCATION_STATUSES, Xt as markAgentInvocationParentMailboxAppended, Zt as reportReplacedWithoutOpenWork, an as logDroppedParentMessage, cn as createAgentInvocationWorker, dn as endAgentInvocationsOfStoppedWork, en as getChildAgentInputSender, fn as enqueueAgentInvocation, nn as routeChildInput, on as parentMessageText, pn as resolveAgentInvocationId, qt as listAgentInvocationsForConversation, sn as readParentMessage, tn as readChildConversationSender, un as endActiveAgentInvocations, xn as createAgentInvocationFromLatest, zt as listUnreportedSiblingAgents } from "./warmup-TgY4S1vx.js";
9
+ import { Kn as renderUntrustedTag } from "./projection-CNKK7doO.js";
8
10
  import { C as agentInvocationResultEventType, S as AGENT_REPLY_EVENT_TYPE, b as AGENT_MESSAGE_EVENT_TYPE, y as AGENT_INVOCATION_EVENT_NAMESPACE } from "./web-message-id-lNodcCOI.js";
9
- import { A as getAgentInvocationResultMessageId, C as ownAgentInvocation, D as getAgentInvocationIdForMessage, E as getAgentInvocationIdForEvents, F as getTurnReplyKey, M as getAgentReplyMessageId, O as getAgentInvocationIdForResult, R as buildDeterministicTurnId, S as listChildMessages, b as hasAgentInvocationReply, j as getAgentInvocationTurnId, y as childMessageSenderMetadata } from "./turn-user-message-C3-O8Omt.js";
10
- import { _ as getConversationWorkState, r as appendAndEnqueueInboundMessage } from "./store-C28I0CVW.js";
11
11
  import { actorSchema } from "@sentry/junior-plugin-api";
12
12
  // src/chat/agent-invocations/result.ts
13
13
  var result_exports = /* @__PURE__ */ __exportAll({
14
14
  createChildConversationWorker: () => createChildConversationWorker,
15
- createDeliverToParent: () => createDeliverToParent,
16
- createEndStoppedChildWork: () => createEndStoppedChildWork,
17
- enqueueAgentInvocationResult: () => enqueueAgentInvocationResult,
18
- enqueueAgentMessageToParent: () => enqueueAgentMessageToParent,
19
- enqueueChildResultToParent: () => enqueueChildResultToParent,
20
- withAgentInvocationResultActors: () => withAgentInvocationResultActors
15
+ createDeliverToParent: () => createDeliverToParent
21
16
  });
22
17
  const AGENT_INVOCATION_RESULT_MAX_LENGTH = 12e3;
23
18
  /**
@@ -0,0 +1,26 @@
1
+ // \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __exportAll = (all, flags) => {
7
+ let target = Object.setPrototypeOf({}, null);
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ if (!(flags & 1)) __defProp(target, Symbol.toStringTag, { value: "Module" });
13
+ return flags & 2 ? target : Object.preventExtensions(target);
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
17
+ key = keys[i];
18
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
19
+ get: ((k) => from[k]).bind(null, key),
20
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
21
+ });
22
+ }
23
+ return to;
24
+ };
25
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
26
+ export { __reExport as n, __exportAll as t };
@@ -1,12 +1,12 @@
1
- import { A as latestConversationMessageSeq, I as upsertConversationMessage, M as normalizeConversationText, N as recordDeliveredAssistantMessage, W as authorizationId, a as loadProjection, b as persistConversationMessages, bn as persistWithRetry, d as recordAuthorizationCompleted, j as markConversationMessage, nt as saveTurnCheckpoint, t as commitAcceptedReply, un as getAssistantReplyText, v as hydrateConversationMessages } from "./projection-CIBwgD3s.js";
2
- import { S as setTags, T as withLogContext, p as logException } from "./logging-C9oDAg4M.js";
3
- import { M as SYSTEM_IDENTITY_ID, a as getConversationStore, r as getConversationEventStore } from "./db-B-gtnNjr.js";
4
- import { f as credentialContextForActor } from "./registry-DdFQHZ_d.js";
5
- import { V as messageCardText } from "./conversation-BNXfq6Lb.js";
6
- import { a as getPersistedThreadState, c as coerceThreadConversationState, i as getPersistedSandboxState, s as persistThreadStateById } from "./turn-session-routing-BFMS9ATF.js";
7
- import { _ as ConversationTurnLifecycleService, g as startActiveTurn, h as markTurnFailed } from "./turn-user-message-C3-O8Omt.js";
8
- import { c as buildDeliveredTurnStatePatch, l as loadPendingMessageCards, o as completeAuthPauseTurn, r as finalizeFailedTurnReplyWithEvent, t as buildTurnThreadContext } from "./thread-context-D3-yYUd0.js";
9
- import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-CWi8j7Z6.js";
1
+ import { B as messageCardText } from "./conversation-BOqdRtUx.js";
2
+ import { c as buildDeliveredTurnStatePatch, l as loadPendingMessageCards, o as completeAuthPauseTurn, r as finalizeFailedTurnReplyWithEvent, t as buildTurnThreadContext } from "./thread-context-Cg0jt0aE.js";
3
+ import { A as latestConversationMessageSeq, I as upsertConversationMessage, M as normalizeConversationText, N as recordDeliveredAssistantMessage, W as authorizationId, a as loadProjection, b as persistConversationMessages, bn as persistWithRetry, d as recordAuthorizationCompleted, j as markConversationMessage, nt as saveTurnCheckpoint, t as commitAcceptedReply, un as getAssistantReplyText, v as hydrateConversationMessages } from "./projection-CNKK7doO.js";
4
+ import { S as setTags, T as withLogContext, p as logException } from "./logging-QSZuMcvo.js";
5
+ import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-CJF7zIJL.js";
6
+ import { a as getPersistedThreadState, c as coerceThreadConversationState, i as getPersistedSandboxState, s as persistThreadStateById } from "./turn-session-routing-CaY3Tp8m.js";
7
+ import { _ as ConversationTurnLifecycleService, g as startActiveTurn, h as markTurnFailed } from "./turn-user-message-tcom1RYd.js";
8
+ import { f as credentialContextForActor } from "./registry-DBDNUUmz.js";
9
+ import { P as SYSTEM_IDENTITY_ID, a as getConversationStore, r as getConversationEventStore } from "./db-EKJnkrIb.js";
10
10
  import { randomUUID } from "node:crypto";
11
11
  import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
12
12
  // src/chat/local/runner.ts
@@ -317,7 +317,7 @@ async function runLocalAgentTurnInContext(input, deps) {
317
317
  failureCode: "persistence_failed",
318
318
  turnId
319
319
  });
320
- throw new AggregateError([error, persistenceError], "Local turn failure state could not be persisted");
320
+ throw new AggregateError([error, persistenceError], "Local turn failure state could not be persisted", { cause: persistenceError });
321
321
  }
322
322
  await lifecycle.fail({
323
323
  conversationId: input.conversationId,
@@ -1,4 +1,4 @@
1
- import { qa as sandboxEgressSignalsResponseSchema } from "./projection-CIBwgD3s.js";
1
+ import { qa as sandboxEgressSignalsResponseSchema } from "./projection-CNKK7doO.js";
2
2
  // src/chat/local/sandbox-egress-signals.ts
3
3
  const SANDBOX_EGRESS_SIGNALS_PATH = "/api/internal/sandbox-egress/signals";
4
4
  const LOCAL_DEV_SERVER_TIMEOUT_MS = 1e3;