@sentry/junior 0.308.0 → 0.310.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 (89) hide show
  1. package/dist/{actor-D2iXzvlN.js → actor-BsBdxDXQ.js} +0 -1
  2. package/dist/{adapter-context-BO432242.js → adapter-context-BhKpjpGD.js} +2 -2
  3. package/dist/{admin-vSmheo3Z.js → admin-tgZEZAk2.js} +2 -2
  4. package/dist/{agent-runner-BnOofGFG.js → agent-runner-D9cvNlQl.js} +245 -204
  5. package/dist/api/schema.d.ts +1 -1
  6. package/dist/api/schema.js +5 -5
  7. package/dist/api.d.ts +4 -2
  8. package/dist/api.js +416 -272
  9. package/dist/{app-CqYqy541.d.ts → app-B_7Wn0en.d.ts} +4 -6
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +74 -193
  12. package/dist/{background-compaction-queue-BpmDEQf6.js → background-compaction-queue-BGHqkhkY.js} +4 -4
  13. package/dist/{briefs-Dbh94cRp.js → briefs-DKxkoruh.js} +3 -3
  14. package/dist/{catalog-runtime-q9AJjuUN.js → catalog-runtime-BxwzbLKY.js} +1 -1
  15. package/dist/cli/chat.js +16 -16
  16. package/dist/cli/check.js +10 -10
  17. package/dist/cli/main.js +3 -3
  18. package/dist/cli/plugins.js +4 -4
  19. package/dist/cli/snapshot-create.js +5 -5
  20. package/dist/cli/upgrade.d.ts +1 -1
  21. package/dist/cli/upgrade.js +3 -3
  22. package/dist/{config-Cx8H0MRw.js → config-Dkt2Le2b.js} +51 -92
  23. package/dist/{continue-in-slack-CtTv1tkn.js → continue-in-slack-BWVwePKD.js} +6 -6
  24. package/dist/{conversation--f85g4zL.js → conversation-M9KZ5JxF.js} +7 -2
  25. package/dist/{conversation-feed-BNs9KiqC.js → conversation-feed-Ci6YD1N-.js} +1 -1
  26. package/dist/{conversation-privacy-CivmFlWP.js → conversation-privacy-C39g8BY4.js} +1 -1
  27. package/dist/{conversation-turn-C9-Nfnsy.js → conversation-turn-CBlZIH02.js} +20 -21
  28. package/dist/{credential-sync-CWIORwD9.js → credential-sync-vGnrB0BY.js} +31 -23
  29. package/dist/{db-C41UgdBj.d.ts → db-B4Hjxr-u.d.ts} +2 -2
  30. package/dist/{db-CO6Y10eM.js → db-CFZggNoy.js} +20 -10
  31. package/dist/{executor-Doo-N6Yn.js → executor-BPkZDx5-.js} +12 -4
  32. package/dist/fan-out-Cod-yEHG.js +10 -0
  33. package/dist/{history-N7IVbUom.js → history-CYstOMKX.js} +6 -0
  34. package/dist/{connections-DUylBPiR.js → html-2r2KmLwi.js} +146 -11
  35. package/dist/{install-Y2s9ZPvk.js → install-C-oE6C_u.js} +2 -2
  36. package/dist/instrumentation.js +2 -2
  37. package/dist/{lineage-BcqyhMyp.js → lineage-CsvrEFQe.js} +2 -2
  38. package/dist/{logging-DnBYBM8z.js → logging-D5gkyvnK.js} +1 -1
  39. package/dist/{message-fSnXIqvl.js → message-DwvJ-I3w.js} +8 -8
  40. package/dist/{model-input-DRChpXJ7.js → model-input-MAq2881y.js} +15 -10
  41. package/dist/nitro.d.ts +1 -1
  42. package/dist/nitro.js +4 -4
  43. package/dist/{oauth-callback-server-BUU6zd_T.js → oauth-callback-server-DIF6Li06.js} +2 -2
  44. package/dist/{oauth-relay-gO_Ynmpb.js → oauth-relay-DPE-wrwO.js} +1 -1
  45. package/dist/{package-discovery-x4AvVhMj.js → package-discovery-DD9vencX.js} +0 -1
  46. package/dist/{projection-Bqn6zdVT.js → projection-jZSlEAXG.js} +116 -123
  47. package/dist/{prompt-DAjjk5fm.js → prompt-CaMyeCpA.js} +25 -14
  48. package/dist/{registry-tHJLCtKS.js → registry-BBkWFCl8.js} +3 -3
  49. package/dist/{resolve-z2sKt8xM.js → resolve-B38MkHXE.js} +3 -3
  50. package/dist/{result-D2wshngt.js → result-BaqSZcJb.js} +12 -13
  51. package/dist/{runner-BvNPWLAy.js → runner-11h8PrHh.js} +10 -10
  52. package/dist/{sandbox-egress-signals-CmHD-6vr.js → sandbox-egress-signals-CTcACAtJ.js} +1 -1
  53. package/dist/{schedule-BG1tEbRF.js → schedule-DWxZ3kja.js} +1 -1
  54. package/dist/{schema-CRXcj4fj.d.ts → schema-DriSvB40.d.ts} +43 -43
  55. package/dist/{schema-D4jdesIu.js → schema-obw5jvR4.js} +65 -28
  56. package/dist/{service-account-B2d1Er_r.js → service-account-Bx93N1n1.js} +3 -3
  57. package/dist/{service-account-CddxU-yC.js → service-account-Zc5bUcIJ.js} +7 -8
  58. package/dist/{session-stop-BQ0J0Fph.js → session-stop-BfY4rhJs.js} +179 -199
  59. package/dist/{skills-Dm2-5nn5.js → skills-C8Npu5zO.js} +99 -57
  60. package/dist/{slack-conversation-unfurl-CLH0tTLk.js → slack-conversation-unfurl-DlRVA02H.js} +18 -15
  61. package/dist/{spawn-PwAuSN59.js → spawn-CXr58R0x.js} +6 -6
  62. package/dist/{state-rXH58smZ.js → state-CGrGVeQC.js} +4 -4
  63. package/dist/{stop-CcHPEcFE.js → stop-DYzjRf2U.js} +176 -135
  64. package/dist/{store-7QA00oK6.js → store-D4FQ1Nml.js} +5 -5
  65. package/dist/{task-queue-DvQZH5rG.js → task-queue-CaZffYaH.js} +7 -4
  66. package/dist/{task-runner-CyZMcuZy.js → task-runner-Dm7BHbGp.js} +11 -12
  67. package/dist/{thread-context-C-hLTQST.js → thread-context-Dyj1KWaY.js} +13 -11
  68. package/dist/{turn-session-routing-Cqjj1B3i.js → turn-session-routing-CD0BRCex.js} +4 -4
  69. package/dist/{turn-user-message-DbU7MNd9.js → turn-user-message-9IxeEv5v.js} +14 -5
  70. package/dist/{queue-CbEHUO0l.d.ts → types-fnU7Xs__.d.ts} +3 -1
  71. package/dist/{users-B-UpCmw9.js → users-CaUAYMb3.js} +1 -1
  72. package/dist/{validation-BEUlev32.js → validation-DxVNIxA0.js} +1 -1
  73. package/dist/{version-BE1OyrXV.js → version-Cr7Z71yG.js} +1 -1
  74. package/dist/version.js +1 -1
  75. package/dist/{viewer-CqOkWizK.js → viewer-AHldghAD.js} +7 -5
  76. package/dist/{warmup-HFgFZFwS.js → warmup-C6LOZ2d2.js} +138 -80
  77. package/dist/{worker-CCEDWbsY.js → worker-CUBtu1Li.js} +8 -8
  78. package/migrations/0121_people_list_metric_index.sql +1 -0
  79. package/migrations/0122_automation_rollout_repair.sql +56 -0
  80. package/migrations/0123_cache_warming_history_reset.sql +10 -0
  81. package/migrations/0124_artifact_visibility.sql +9 -0
  82. package/migrations/0125_artifact_public_sha_index.sql +1 -0
  83. package/migrations/meta/0121_snapshot.json +5481 -0
  84. package/migrations/meta/0122_snapshot.json +5481 -0
  85. package/migrations/meta/0123_snapshot.json +5481 -0
  86. package/migrations/meta/0124_snapshot.json +5516 -0
  87. package/migrations/meta/0125_snapshot.json +5516 -0
  88. package/migrations/meta/_journal.json +35 -0
  89. package/package.json +7 -7
@@ -1,11 +1,11 @@
1
- import { $ as ProviderError, A as searchWeb$1, C as completeObject$1, D as generateImages$1, E as gatewayCostUsd, S as completeDecision$1, T as embedTexts$1, b as GEN_AI_PROVIDER_NAME, ct as resolveGatewayCredential, ot as isProviderRetryError, tt as createProviderError, w as completeText$1, x as GEN_AI_SERVER_ADDRESS } from "./config-Cx8H0MRw.js";
2
- import { E as withSpan, _ as runBestEffort, a as extractGenAiUsageSummary, i as extractGenAiUsageAttributes, p as logException } from "./logging-DnBYBM8z.js";
3
- import { _t as agentTurnCostUsd, r as getConversationEventStore } from "./db-CO6Y10eM.js";
4
- import { I as conversationBriefSchema, L as parseBriefInput, P as briefOutcomeStatusSchema } from "./conversation--f85g4zL.js";
1
+ import { A as searchWeb$1, C as completeObject$1, D as generateImages$1, E as gatewayCostUsd, S as completeDecision$1, T as embedTexts$1, Y as ProviderError, Z as createProviderError, b as GEN_AI_PROVIDER_NAME, it as resolveGatewayCredential, nt as isProviderRetryError, w as completeText$1, x as GEN_AI_SERVER_ADDRESS } from "./config-Dkt2Le2b.js";
2
+ import { E as withSpan, _ as runBestEffort, a as extractGenAiUsageSummary, i as extractGenAiUsageAttributes, p as logException } from "./logging-D5gkyvnK.js";
3
+ import { r as getConversationEventStore, yt as agentTurnCostUsd } from "./db-CFZggNoy.js";
4
+ import { I as conversationBriefSchema, L as parseBriefInput, P as briefOutcomeStatusSchema } from "./conversation-M9KZ5JxF.js";
5
5
  import * as z from "zod";
6
6
  import { createGatewayProvider } from "@ai-sdk/gateway";
7
7
  import { transcribe } from "ai";
8
- import { conversationEventPresentationSchema, defineConversationEvent } from "@sentry/junior-plugin-api";
8
+ import { conversationEventPresentationSchema, defineConversationEvent, mentionsTag, renderTag } from "@sentry/junior-plugin-api";
9
9
  // src/chat/conversations/structured-events.ts
10
10
  /** Reserved namespace for Junior-owned conversation metadata events. */
11
11
  const JUNIOR_NATIVE_EVENT_NAMESPACE = "junior";
@@ -426,9 +426,25 @@ function uniqueStrings(values, limit) {
426
426
  }
427
427
  return [...unique];
428
428
  }
429
- const RUNTIME_MARKER_PATTERN = /\[\[NO_REPLY\]\]|<\/?(?:active-asks|analysis-error|available-skills|brief-input|compaction|current-instruction|image-attachment|omitted-image-attachments|pi-history|plugin-contribution|resolved-or-replaced-asks|runtime-turn-context|thread-compactions|thread-context|turn-context)\b/i;
429
+ const RUNTIME_MARKER_TAGS = [
430
+ "active-asks",
431
+ "analysis-error",
432
+ "available-skills",
433
+ "brief-input",
434
+ "compaction",
435
+ "current-instruction",
436
+ "image-attachment",
437
+ "omitted-image-attachments",
438
+ "pi-history",
439
+ "plugin-contribution",
440
+ "resolved-or-replaced-asks",
441
+ "runtime-turn-context",
442
+ "thread-compactions",
443
+ "thread-context",
444
+ "turn-context"
445
+ ];
430
446
  function hasRuntimeMarker(value) {
431
- return RUNTIME_MARKER_PATTERN.test(value);
447
+ return value.includes("[[NO_REPLY]]") || mentionsTag(value, RUNTIME_MARKER_TAGS);
432
448
  }
433
449
  const ASSISTANT_ATTRIBUTION = "assistant";
434
450
  function normalizeModelBrief(args) {
@@ -575,12 +591,7 @@ function promptInput(args) {
575
591
  if (candidate.length <= MAX_INPUT_CHARS) text = candidate;
576
592
  else keptTools.pop();
577
593
  }
578
- return [
579
- "<brief-input>",
580
- text,
581
- "</brief-input>",
582
- "Return the next Brief as structured data."
583
- ].join("\n");
594
+ return [renderTag("brief-input", {}, [text]), "Return the next Brief as structured data."].join("\n");
584
595
  }
585
596
  function deterministicLinks(input) {
586
597
  return [...input.codeChanges.map((change) => ({
@@ -896,4 +907,4 @@ Rules:
896
907
  - 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.
897
908
  - Keep the summary under 600 characters, intent under 400 characters, outcome text under 600 characters, and each other string under 400 characters.
898
909
  `;
899
- export { renderJuniorNativeConversationEvent as S, JUNIOR_NATIVE_EVENT_NAMESPACE as _, EVENT_SYSTEM_ACTOR as a, authenticationUnlinkedEvent as b, generateBrief as c, completeText as d, embedTexts as f, NoAudioError as g, transcribeFromUrl as h, EVENT_MESSAGE_AUTHOR as i, completeDecision as l, searchWeb as m, briefEntriesFromReportEvents as n, eventBotAuthorId as o, generateImages as p, EVENT_AUTHOR_ID as r, isEventConversationMessage as s, BRIEF_PROMPT as t, completeObject as u, agentsInstructionsUpdatedEvent as v, conversationNoteEvent as x, authenticationLinkedEvent as y };
910
+ export { JUNIOR_NATIVE_EVENT_NAMESPACE as _, EVENT_SYSTEM_ACTOR as a, conversationNoteEvent as b, generateBrief as c, completeText as d, embedTexts as f, NoAudioError as g, transcribeFromUrl as h, EVENT_MESSAGE_AUTHOR as i, completeDecision as l, searchWeb as m, briefEntriesFromReportEvents as n, eventBotAuthorId as o, generateImages as p, EVENT_AUTHOR_ID as r, isEventConversationMessage as s, BRIEF_PROMPT as t, completeObject as u, agentsInstructionsUpdatedEvent as v, renderJuniorNativeConversationEvent as x, authenticationLinkedEvent as y };
@@ -1,6 +1,6 @@
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-DnBYBM8z.js";
3
- import { o as isUserActor, s as parseActorUserId } from "./actor-D2iXzvlN.js";
1
+ import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-DD9vencX.js";
2
+ import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-D5gkyvnK.js";
3
+ import { o as isUserActor, s as parseActorUserId } from "./actor-BsBdxDXQ.js";
4
4
  import * as z from "zod";
5
5
  import path from "node:path";
6
6
  import { randomUUID } from "node:crypto";
@@ -1,6 +1,6 @@
1
- import { i as trace, n as postinstall, o as getSandboxResources, t as dependencies } from "./install-Y2s9ZPvk.js";
2
- import { Ji as isStale, Ki as create, Ms as sleep, Xi as getSandboxProvider } from "./projection-Bqn6zdVT.js";
3
- import { $ as getStateAdapter } from "./db-CO6Y10eM.js";
1
+ import { i as trace, n as postinstall, o as getSandboxResources, t as dependencies } from "./install-C-oE6C_u.js";
2
+ import { $i as getSandboxProvider, Fs as sleep, Yi as create, Zi as isStale } from "./projection-jZSlEAXG.js";
3
+ import { tt as getStateAdapter } from "./db-CFZggNoy.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,14 +1,14 @@
1
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-CO6Y10eM.js";
3
- import { A as parseEventMessages, B as renderEventBatchInputs, D as getEventBatchDelayMs, F as EVENT_WAIT_MS, R as eventBatchMessageMeta, V as timerWatchCredentialSubject, j as resolveMailboxTurnWork, k as listActiveMailboxTurns, s as eventReviewItemInputs, t as getConversationStoppedAtMs } from "./session-stop-BQ0J0Fph.js";
4
- import { a as EVENT_SYSTEM_ACTOR } from "./prompt-DAjjk5fm.js";
5
- import { p as credentialContextForActor } from "./registry-tHJLCtKS.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-DbU7MNd9.js";
7
- import { _ as getConversationWorkState, r as appendAndEnqueueInboundMessage } from "./store-7QA00oK6.js";
8
- import { $t as readChildConversationSender, Gt as listAgentInvocationsForConversation, Jt as markAgentInvocationParentMailboxAppended, Lt as listUnreportedSiblingAgents, Qt as getChildAgentInputSender, Rt as NON_TERMINAL_AGENT_INVOCATION_STATUSES, Ut as getLatestAgentInvocationForConversation, Wt as isTerminalAgentInvocation, Xt as sendsResultToParent, Yt as reportReplacedWithoutOpenWork, Zt as childAgentInput, an as readParentMessage, cn as endActiveAgentInvocations, dn as resolveAgentInvocationId, en as routeChildInput, in as parentMessageText, ln as endAgentInvocationsOfStoppedWork, on as createAgentInvocationWorker, rn as logDroppedParentMessage, un as enqueueAgentInvocation, yn as createAgentInvocationFromLatest, zt as TERMINAL_AGENT_INVOCATION_STATUSES } from "./warmup-HFgFZFwS.js";
9
- import { Z as renderUntrustedTag } from "./config-Cx8H0MRw.js";
2
+ import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
3
+ import { A as turnBehavior, F as SYSTEM_IDENTITY_ID, a as getConversationStore } from "./db-CFZggNoy.js";
4
+ import { A as parseEventMessages, B as renderEventBatchInputs, D as getEventBatchDelayMs, F as EVENT_WAIT_MS, R as eventBatchMessageMeta, V as timerWatchCredentialSubject, j as resolveMailboxTurnWork, k as listActiveMailboxTurns, s as eventReviewItemInputs, t as getConversationStoppedAtMs } from "./session-stop-BfY4rhJs.js";
5
+ import { a as EVENT_SYSTEM_ACTOR } from "./prompt-CaMyeCpA.js";
6
+ import { p as credentialContextForActor } from "./registry-BBkWFCl8.js";
7
+ import { C as ownAgentInvocation, D as getAgentInvocationIdForEvents, I as getTurnReplyKey, M as getAgentInvocationTurnId, N as getAgentReplyMessageId, O as getAgentInvocationIdForMessage, S as listChildMessages, b as hasAgentInvocationReply, j as getAgentInvocationResultMessageId, k as getAgentInvocationIdForResult, y as childMessageSenderMetadata, z as buildDeterministicTurnId } from "./turn-user-message-9IxeEv5v.js";
8
+ import { _ as getConversationWorkState, r as appendAndEnqueueInboundMessage } from "./store-D4FQ1Nml.js";
9
+ import { $t as getChildAgentInputSender, Bt as TERMINAL_AGENT_INVOCATION_STATUSES, Gt as isTerminalAgentInvocation, Kt as listAgentInvocationsForConversation, Qt as childAgentInput, Rt as listUnreportedSiblingAgents, Wt as getLatestAgentInvocationForConversation, Xt as reportReplacedWithoutOpenWork, Yt as markAgentInvocationParentMailboxAppended, Zt as sendsResultToParent, an as parentMessageText, bn as createAgentInvocationFromLatest, dn as enqueueAgentInvocation, en as readChildConversationSender, fn as resolveAgentInvocationId, in as logDroppedParentMessage, ln as endActiveAgentInvocations, on as readParentMessage, sn as createAgentInvocationWorker, tn as routeChildInput, un as endAgentInvocationsOfStoppedWork, zt as NON_TERMINAL_AGENT_INVOCATION_STATUSES } from "./warmup-C6LOZ2d2.js";
10
+ import { J as renderUntrustedTag } from "./config-Dkt2Le2b.js";
10
11
  import { C as AGENT_MESSAGE_EVENT_TYPE, E as agentInvocationResultEventType, S as AGENT_INVOCATION_EVENT_NAMESPACE, T as AGENT_REPLY_EVENT_TYPE } from "./web-message-id-BT8Mg8LL.js";
11
- import pLimit from "p-limit";
12
12
  import { actorSchema } from "@sentry/junior-plugin-api";
13
13
  // src/chat/agent-invocations/result.ts
14
14
  var result_exports = /* @__PURE__ */ __exportAll({
@@ -356,7 +356,7 @@ async function startAgentInvocationsForChildInput(context, options) {
356
356
  const latest = await getLatestAgentInvocationForConversation(context.conversationId);
357
357
  if (messages.length === 0 || !latest) return;
358
358
  const stoppedAtMs = await getConversationStoppedAtMs(context.conversationId);
359
- const routes = await Promise.all(messages.map((message) => routeChildInput(message, latest, stoppedAtMs)));
359
+ const routes = await mapBounded(messages, (message) => routeChildInput(message, latest, stoppedAtMs));
360
360
  if (!routes.includes("agent invocation")) return;
361
361
  const inputs = messages.map(childAgentInput);
362
362
  const isAgentInput = messages.every((message, index) => inputs[index] !== void 0 || readParentMessage(message) !== void 0);
@@ -501,8 +501,7 @@ async function withAgentInvocationResultActors(work) {
501
501
  if (work.kind !== "mailbox") return work;
502
502
  const conversationId = work.batch[0]?.message.conversationId;
503
503
  const [latest, stoppedAtMs] = conversationId ? await Promise.all([getLatestAgentInvocationForConversation(conversationId), getConversationStoppedAtMs(conversationId)]) : [void 0, void 0];
504
- const limit = pLimit(8);
505
- const kept = (await Promise.all(work.batch.map((entry) => limit(async () => {
504
+ const kept = (await mapBounded(work.batch, async (entry) => {
506
505
  const parentMessage = readParentMessage(entry.message);
507
506
  if (parentMessage) {
508
507
  if (await routeChildInput(entry.message, latest, stoppedAtMs) === "dropped") {
@@ -540,7 +539,7 @@ async function withAgentInvocationResultActors(work) {
540
539
  ...entry,
541
540
  actor
542
541
  };
543
- })))).filter((entry) => entry !== void 0);
542
+ })).filter((entry) => entry !== void 0);
544
543
  return kept.length > 0 ? {
545
544
  kind: "mailbox",
546
545
  batch: kept
@@ -1,13 +1,13 @@
1
- import { q as messageCardText } from "./conversation--f85g4zL.js";
2
- import { a as buildDeliveredTurnStatePatch, o as loadPendingMessageCards, r as completeAuthPauseTurn, t as buildTurnThreadContext } from "./thread-context-C-hLTQST.js";
3
- import { A as normalizeConversationText, H as authorizationId, O as latestConversationMessageSeq, P as upsertConversationMessage, a as loadProjection, b as persistConversationMessages, cn as getAssistantReplyText, d as recordAuthorizationCompleted, et as saveTurnCheckpoint, j as recordDeliveredAssistantMessage, k as markConversationMessage, t as commitAcceptedReply, v as hydrateConversationMessages, vn as persistWithRetry } from "./projection-Bqn6zdVT.js";
4
- import { S as setTags, T as withLogContext, p as logException } from "./logging-DnBYBM8z.js";
5
- import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-CyZMcuZy.js";
6
- import { a as getPersistedThreadState, c as coerceThreadConversationState, i as getPersistedSandboxState, s as persistThreadStateById } from "./turn-session-routing-Cqjj1B3i.js";
7
- import { _ as ConversationTurnLifecycleService, g as startActiveTurn, h as markTurnFailed } from "./turn-user-message-DbU7MNd9.js";
8
- import { L as finalizeFailedTurnReplyWithEvent } from "./agent-runner-BnOofGFG.js";
9
- import { p as credentialContextForActor } from "./registry-tHJLCtKS.js";
10
- import { P as SYSTEM_IDENTITY_ID, a as getConversationStore, r as getConversationEventStore } from "./db-CO6Y10eM.js";
1
+ import { q as messageCardText } from "./conversation-M9KZ5JxF.js";
2
+ import { a as buildDeliveredTurnStatePatch, o as loadPendingMessageCards, r as completeAuthPauseTurn, t as buildTurnThreadContext } from "./thread-context-Dyj1KWaY.js";
3
+ import { A as latestConversationMessageSeq, I as upsertConversationMessage, M as normalizeConversationText, N as recordDeliveredAssistantMessage, S as persistConversationMessages, W as authorizationId, b as hydrateConversationMessages, bn as persistWithRetry, f as recordAuthorizationCompleted, j as markConversationMessage, nt as saveTurnCheckpoint, o as loadProjection, t as commitAcceptedReply, un as getAssistantReplyText } from "./projection-jZSlEAXG.js";
4
+ import { S as setTags, T as withLogContext, p as logException } from "./logging-D5gkyvnK.js";
5
+ import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-Dm7BHbGp.js";
6
+ import { a as getPersistedThreadState, c as coerceThreadConversationState, i as getPersistedSandboxState, s as persistThreadStateById } from "./turn-session-routing-CD0BRCex.js";
7
+ import { _ as ConversationTurnLifecycleService, g as startActiveTurn, h as markTurnFailed } from "./turn-user-message-9IxeEv5v.js";
8
+ import { L as finalizeFailedTurnReplyWithEvent } from "./agent-runner-D9cvNlQl.js";
9
+ import { p as credentialContextForActor } from "./registry-BBkWFCl8.js";
10
+ import { F as SYSTEM_IDENTITY_ID, a as getConversationStore, r as getConversationEventStore } from "./db-CFZggNoy.js";
11
11
  import { randomUUID } from "node:crypto";
12
12
  import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
13
13
  // src/chat/local/runner.ts
@@ -1,4 +1,4 @@
1
- import { ba as sandboxEgressSignalsResponseSchema } from "./projection-Bqn6zdVT.js";
1
+ import { Ca as sandboxEgressSignalsResponseSchema } from "./projection-jZSlEAXG.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;
@@ -1,4 +1,4 @@
1
- import { i as actorIdentitySchema } from "./conversation--f85g4zL.js";
1
+ import { i as actorIdentitySchema } from "./conversation-M9KZ5JxF.js";
2
2
  import * as z from "zod";
3
3
  import { actorUserIdSchema, destinationVisibilitySchema, eventMatchFieldsSchema, eventMatchSchema, eventReachSchema, eventTypeSchema, pluginEventTypeSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
4
4
  // src/chat/automations/task.ts
@@ -243,7 +243,8 @@ declare const conversationDetailQuerySchema: z.ZodObject<{
243
243
  /**
244
244
  * Page toward the start with `before`, toward the latest with `after`, or
245
245
  * both ways from one event with `around`. A link target asks for the page
246
- * around one event by its `event` seq, or around the start of a `turn`.
246
+ * around one event by its `event` seq, around one `message` by its id, or
247
+ * around the start of a `turn`.
247
248
  */
248
249
  declare const conversationEventsQuerySchema: z.ZodUnion<readonly [z.ZodObject<{
249
250
  before: z.ZodString;
@@ -260,6 +261,9 @@ declare const conversationEventsQuerySchema: z.ZodUnion<readonly [z.ZodObject<{
260
261
  }, z.core.$strict>, z.ZodObject<{
261
262
  turn: z.ZodString;
262
263
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
264
+ }, z.core.$strict>, z.ZodObject<{
265
+ message: z.ZodString;
266
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
263
267
  }, z.core.$strict>]>;
264
268
  declare const createConversationMessageBodySchema: z.ZodObject<{
265
269
  idempotencyKey: z.ZodString;
@@ -5211,12 +5215,6 @@ declare const guardianStatsSchema: z.ZodObject<{
5211
5215
  requests: z.ZodNumber;
5212
5216
  }, z.core.$strict>;
5213
5217
  declare const conversationStatsReportSchema: z.ZodObject<{
5214
- active: z.ZodNumber;
5215
- cachedInputTokens: z.ZodOptional<z.ZodNumber>;
5216
- cacheCreationTokens: z.ZodOptional<z.ZodNumber>;
5217
- conversations: z.ZodNumber;
5218
- durationMs: z.ZodNumber;
5219
- failed: z.ZodNumber;
5220
5218
  generatedAt: z.ZodString;
5221
5219
  guardian: z.ZodObject<{
5222
5220
  allow: z.ZodNumber;
@@ -5291,28 +5289,7 @@ declare const conversationStatsReportSchema: z.ZodObject<{
5291
5289
  outcomes: z.ZodOptional<z.ZodNumber>;
5292
5290
  tokens: z.ZodOptional<z.ZodNumber>;
5293
5291
  }, z.core.$strict>>>;
5294
- locations: z.ZodArray<z.ZodObject<{
5295
- active: z.ZodNumber;
5296
- conversations: z.ZodNumber;
5297
- durationMs: z.ZodNumber;
5298
- failed: z.ZodNumber;
5299
- label: z.ZodString;
5300
- costUsd: z.ZodOptional<z.ZodNumber>;
5301
- tokens: z.ZodOptional<z.ZodNumber>;
5302
- }, z.core.$strict>>;
5303
- actors: z.ZodArray<z.ZodObject<{
5304
- active: z.ZodNumber;
5305
- conversations: z.ZodNumber;
5306
- durationMs: z.ZodNumber;
5307
- failed: z.ZodNumber;
5308
- label: z.ZodString;
5309
- costUsd: z.ZodOptional<z.ZodNumber>;
5310
- tokens: z.ZodOptional<z.ZodNumber>;
5311
- }, z.core.$strict>>;
5312
5292
  source: z.ZodLiteral<"conversation_index">;
5313
- costUsd: z.ZodOptional<z.ZodNumber>;
5314
- inputTokens: z.ZodOptional<z.ZodNumber>;
5315
- tokens: z.ZodOptional<z.ZodNumber>;
5316
5293
  windowEnd: z.ZodString;
5317
5294
  windowStart: z.ZodString;
5318
5295
  }, z.core.$strict>;
@@ -5796,13 +5773,11 @@ declare const actorDirectoryWindowsSchema: z.ZodObject<{
5796
5773
  priorCostUsd: z.ZodNumber;
5797
5774
  }, z.core.$strict>;
5798
5775
  }, z.core.$strict>;
5776
+ /**
5777
+ * One person in the People list. Counts and spend are per range; the Turn
5778
+ * range is all-time. Profile totals live on the profile read.
5779
+ */
5799
5780
  declare const actorSummaryReportSchema: z.ZodObject<{
5800
- active: z.ZodNumber;
5801
- activeDays: z.ZodNumber;
5802
- conversations: z.ZodNumber;
5803
- durationMs: z.ZodNumber;
5804
- failed: z.ZodNumber;
5805
- tokens: z.ZodOptional<z.ZodNumber>;
5806
5781
  firstSeenAt: z.ZodString;
5807
5782
  lastSeenAt: z.ZodString;
5808
5783
  actor: z.ZodObject<{
@@ -5857,12 +5832,6 @@ declare const actorDirectoryReportSchema: z.ZodObject<{
5857
5832
  }, z.core.$strict>>>;
5858
5833
  generatedAt: z.ZodString;
5859
5834
  people: z.ZodArray<z.ZodObject<{
5860
- active: z.ZodNumber;
5861
- activeDays: z.ZodNumber;
5862
- conversations: z.ZodNumber;
5863
- durationMs: z.ZodNumber;
5864
- failed: z.ZodNumber;
5865
- tokens: z.ZodOptional<z.ZodNumber>;
5866
5835
  firstSeenAt: z.ZodString;
5867
5836
  lastSeenAt: z.ZodString;
5868
5837
  actor: z.ZodObject<{
@@ -7094,7 +7063,8 @@ declare const cacheWarmingSavingsReportSchema: z.ZodObject<{
7094
7063
  unwarmedIdlePeriods: z.ZodNumber;
7095
7064
  unwarmedOracleSavingsUsd: z.ZodNumber;
7096
7065
  date: z.ZodString;
7097
- netSavingsUsd: z.ZodNullable<z.ZodNumber>;
7066
+ netSavingsUsd: z.ZodNumber;
7067
+ history: z.ZodBoolean;
7098
7068
  }, z.core.$strict>>;
7099
7069
  totals: z.ZodObject<{
7100
7070
  idlePeriods: z.ZodNumber;
@@ -7105,9 +7075,9 @@ declare const cacheWarmingSavingsReportSchema: z.ZodObject<{
7105
7075
  unwarmedIdlePeriods: z.ZodNumber;
7106
7076
  unwarmedOracleSavingsUsd: z.ZodNumber;
7107
7077
  netSavingsUsd: z.ZodNumber;
7108
- knownCostOracleSavingsUsd: z.ZodNumber;
7078
+ liveOracleSavingsUsd: z.ZodNumber;
7109
7079
  effectiveness: z.ZodNullable<z.ZodNumber>;
7110
- unknownCostDays: z.ZodNumber;
7080
+ historyDays: z.ZodNumber;
7111
7081
  }, z.core.$strict>;
7112
7082
  }, z.core.$strict>;
7113
7083
  type CacheWarmingSavingsReport = z.output<typeof cacheWarmingSavingsReportSchema>;
@@ -9299,6 +9269,7 @@ type ReviewItemChangeRecord = z.output<typeof reviewItemChangeRecordSchema>;
9299
9269
  /** One Review item as the viewer sees it. */
9300
9270
  declare const reviewItemSchema: z.ZodObject<{
9301
9271
  addedByConversationId: z.ZodString;
9272
+ addedByLabel: z.ZodOptional<z.ZodString>;
9302
9273
  addedByTurnId: z.ZodOptional<z.ZodString>;
9303
9274
  answer: z.ZodOptional<z.ZodObject<{
9304
9275
  other: z.ZodOptional<z.ZodString>;
@@ -9329,6 +9300,13 @@ declare const reviewItemSchema: z.ZodObject<{
9329
9300
  action: "action";
9330
9301
  notice: "notice";
9331
9302
  }>;
9303
+ related: z.ZodOptional<z.ZodObject<{
9304
+ conversationIds: z.ZodArray<z.ZodString>;
9305
+ items: z.ZodArray<z.ZodObject<{
9306
+ id: z.ZodString;
9307
+ title: z.ZodString;
9308
+ }, z.core.$strict>>;
9309
+ }, z.core.$strict>>;
9332
9310
  request: z.ZodOptional<z.ZodObject<{
9333
9311
  question: z.ZodString;
9334
9312
  fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -9357,7 +9335,14 @@ declare const reviewItemSchema: z.ZodObject<{
9357
9335
  description: z.ZodOptional<z.ZodString>;
9358
9336
  kind: z.ZodLiteral<"text">;
9359
9337
  }, z.core.$strip>], "kind">>;
9338
+ evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
9339
+ conversationId: z.ZodOptional<z.ZodString>;
9340
+ label: z.ZodString;
9341
+ note: z.ZodOptional<z.ZodString>;
9342
+ url: z.ZodOptional<z.ZodString>;
9343
+ }, z.core.$strict>>>;
9360
9344
  }, z.core.$strip>>;
9345
+ rootConversationId: z.ZodString;
9361
9346
  status: z.ZodEnum<{
9362
9347
  dismissed: "dismissed";
9363
9348
  done: "done";
@@ -9404,6 +9389,7 @@ type ReviewItemPayload = z.output<typeof reviewItemSchema>;
9404
9389
  declare const reviewItemListSchema: z.ZodObject<{
9405
9390
  items: z.ZodArray<z.ZodObject<{
9406
9391
  addedByConversationId: z.ZodString;
9392
+ addedByLabel: z.ZodOptional<z.ZodString>;
9407
9393
  addedByTurnId: z.ZodOptional<z.ZodString>;
9408
9394
  answer: z.ZodOptional<z.ZodObject<{
9409
9395
  other: z.ZodOptional<z.ZodString>;
@@ -9434,6 +9420,13 @@ declare const reviewItemListSchema: z.ZodObject<{
9434
9420
  action: "action";
9435
9421
  notice: "notice";
9436
9422
  }>;
9423
+ related: z.ZodOptional<z.ZodObject<{
9424
+ conversationIds: z.ZodArray<z.ZodString>;
9425
+ items: z.ZodArray<z.ZodObject<{
9426
+ id: z.ZodString;
9427
+ title: z.ZodString;
9428
+ }, z.core.$strict>>;
9429
+ }, z.core.$strict>>;
9437
9430
  request: z.ZodOptional<z.ZodObject<{
9438
9431
  question: z.ZodString;
9439
9432
  fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -9462,7 +9455,14 @@ declare const reviewItemListSchema: z.ZodObject<{
9462
9455
  description: z.ZodOptional<z.ZodString>;
9463
9456
  kind: z.ZodLiteral<"text">;
9464
9457
  }, z.core.$strip>], "kind">>;
9458
+ evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
9459
+ conversationId: z.ZodOptional<z.ZodString>;
9460
+ label: z.ZodString;
9461
+ note: z.ZodOptional<z.ZodString>;
9462
+ url: z.ZodOptional<z.ZodString>;
9463
+ }, z.core.$strict>>>;
9465
9464
  }, z.core.$strip>>;
9465
+ rootConversationId: z.ZodString;
9466
9466
  status: z.ZodEnum<{
9467
9467
  dismissed: "dismissed";
9468
9468
  done: "done";
@@ -1,8 +1,8 @@
1
1
  import { F as sumUtcHoursIntoSixHours, M as fillUtcHours, d as userInputRequestSchema, i as AGENT_INVOCATION_STATUSES, j as fillUtcDays, y as PLAN_ITEM_STATUSES } from "./web-message-id-BT8Mg8LL.js";
2
- import { $ as inputFileSchema, D as conversationChildAgentTotalsSchema, E as idempotencyKeySchema, c as conversationAuxiliaryCostsSchema, i as actorIdentitySchema, m as conversationParamsSchema, x as conversationUsageSchema, y as conversationSummaryReportSchema } from "./conversation--f85g4zL.js";
3
- import "./conversation-feed-BNs9KiqC.js";
2
+ import { $ as inputFileSchema, D as conversationChildAgentTotalsSchema, E as idempotencyKeySchema, c as conversationAuxiliaryCostsSchema, i as actorIdentitySchema, m as conversationParamsSchema, x as conversationUsageSchema, y as conversationSummaryReportSchema } from "./conversation-M9KZ5JxF.js";
3
+ import "./conversation-feed-Ci6YD1N-.js";
4
4
  import { t as isPushServiceEndpoint } from "./push-endpoint-CO-nomUd.js";
5
- import { r as notificationScheduleSchema } from "./schedule-BG1tEbRF.js";
5
+ import { r as notificationScheduleSchema } from "./schedule-DWxZ3kja.js";
6
6
  import * as z from "zod";
7
7
  import { codeChangeStateSchema, eventMatchSchema, objectTypeSchema, ownedObjectAnnotationSchema } from "@sentry/junior-plugin-api";
8
8
  // src/api/schema/conversation-attachment-upload.ts
@@ -162,23 +162,12 @@ const guardianStatsSchema = z.object({
162
162
  requests: z.number()
163
163
  }).strict();
164
164
  const conversationStatsReportSchema = z.object({
165
- active: z.number(),
166
- cachedInputTokens: z.number().optional(),
167
- cacheCreationTokens: z.number().optional(),
168
- conversations: z.number(),
169
- durationMs: z.number(),
170
- failed: z.number(),
171
165
  generatedAt: z.string(),
172
166
  guardian: guardianStatsSchema,
173
167
  metricDays: z.array(conversationMetricDaySchema),
174
168
  metricHours: z.array(conversationMetricDaySchema).optional(),
175
169
  metricSixHours: z.array(conversationMetricDaySchema).optional(),
176
- locations: z.array(conversationStatsItemSchema),
177
- actors: z.array(conversationStatsItemSchema),
178
170
  source: z.literal("conversation_index"),
179
- costUsd: z.number().optional(),
180
- inputTokens: z.number().optional(),
181
- tokens: z.number().optional(),
182
171
  windowEnd: z.string(),
183
172
  windowStart: z.string()
184
173
  }).strict();
@@ -662,7 +651,11 @@ const actorDirectoryWindowsSchema = z.object({
662
651
  90: actorWindowMetricsSchema
663
652
  }).strict();
664
653
  const identifiedActorSchema = actorIdentitySchema.extend({ email: z.string().min(1) }).strict();
665
- const actorSummaryReportSchema = actorTotalsReportSchema.extend({
654
+ /**
655
+ * One person in the People list. Counts and spend are per range; the Turn
656
+ * range is all-time. Profile totals live on the profile read.
657
+ */
658
+ const actorSummaryReportSchema = z.object({
666
659
  firstSeenAt: z.string(),
667
660
  lastSeenAt: z.string(),
668
661
  actor: identifiedActorSchema,
@@ -771,24 +764,22 @@ const cacheWarmingSavingsSchema = z.object({
771
764
  const cacheWarmingSavingsReportSchema = z.object({
772
765
  days: z.array(cacheWarmingSavingsSchema.extend({
773
766
  date: z.string(),
767
+ /** Saved less warmup cost. */
768
+ netSavingsUsd: z.number(),
774
769
  /**
775
- * Saved less warmup cost. Null on a day filled from history, which
776
- * has no warmup calls, so its warmup cost is unknown.
770
+ * Filled from history: hits count only when a recorded warmup call
771
+ * reached the return, and the warm state split is unknown.
777
772
  */
778
- netSavingsUsd: z.number().nullable()
773
+ history: z.boolean()
779
774
  })),
780
775
  totals: cacheWarmingSavingsSchema.extend({
781
- /** Net savings of the days with known warmup cost. */
782
776
  netSavingsUsd: z.number(),
783
- /** Oracle savings of the days with known warmup cost. */
784
- knownCostOracleSavingsUsd: z.number().nonnegative(),
785
- /**
786
- * Net savings over oracle savings of the days with known warmup cost.
787
- * Null with no oracle savings on those days.
788
- */
777
+ /** Oracle savings of the days with live counters. */
778
+ liveOracleSavingsUsd: z.number().nonnegative(),
779
+ /** Net savings over oracle savings. Null with no oracle savings. */
789
780
  effectiveness: z.number().nullable(),
790
- /** Days filled from history, with unknown warmup cost. */
791
- unknownCostDays: z.number().int().nonnegative()
781
+ /** Days filled from history. The totals include them. */
782
+ historyDays: z.number().int().nonnegative()
792
783
  })
793
784
  }).strict();
794
785
  const cacheWarmingSavingsRefillSchema = z.object({
@@ -806,6 +797,25 @@ const cacheWarmingSavingsRefillSchema = z.object({
806
797
  totalConversations: z.number().int().nonnegative().optional()
807
798
  }).strict();
808
799
  const cacheWarmingSavingsRefillResponseSchema = z.object({ refill: cacheWarmingSavingsRefillSchema }).strict();
800
+ // src/chat/review-items/evidence.ts
801
+ /**
802
+ * One source that an agent cites for a Review item: a link or a
803
+ * Conversation, with a short label and an optional one-line note. A link
804
+ * points outside Junior; a Conversation reference points to work in Junior.
805
+ * The question stores the list, and the dashboard shows it beside the
806
+ * answer choices.
807
+ */
808
+ const reviewItemEvidenceSchema = z.object({
809
+ conversationId: z.string().min(1).max(500).optional(),
810
+ label: z.string().min(1).max(120),
811
+ note: z.string().min(1).max(200).optional(),
812
+ url: z.string().min(1).max(2e3).optional()
813
+ }).strict().refine((entry) => entry.url === void 0 !== (entry.conversationId === void 0), "Evidence has a `url` or a `conversationId`, not both.");
814
+ /**
815
+ * The question of a Review item with the evidence for its answer. Evidence
816
+ * is part of the question, so it is stored in the `request` column.
817
+ */
818
+ const reviewItemRequestSchema = userInputRequestSchema.safeExtend({ evidence: z.array(reviewItemEvidenceSchema).optional() });
809
819
  // src/api/schema/review-item.ts
810
820
  const answerSchema = z.object({
811
821
  other: z.string().max(4e3).optional(),
@@ -820,6 +830,11 @@ const personSchema = z.object({
820
830
  /** One Review item as the viewer sees it. */
821
831
  const reviewItemSchema = z.object({
822
832
  addedByConversationId: z.string().min(1),
833
+ /**
834
+ * Names the Conversation that added the item when it is not
835
+ * `rootConversationId`, such as a child agent's Thread title.
836
+ */
837
+ addedByLabel: z.string().min(1).optional(),
823
838
  /** Turn that added the item. Unset for a plugin item. */
824
839
  addedByTurnId: z.string().min(1).optional(),
825
840
  answer: answerSchema.optional(),
@@ -839,7 +854,29 @@ const reviewItemSchema = z.object({
839
854
  createdAt: z.string().datetime(),
840
855
  id: z.string().min(1),
841
856
  kind: z.enum(["notice", "action"]),
842
- request: userInputRequestSchema.optional(),
857
+ /**
858
+ * Other open work that the viewer can see on the same subject or linked
859
+ * work. Only an open item has it.
860
+ */
861
+ related: z.object({
862
+ /** Linked Conversations other than the one that added the item. */
863
+ conversationIds: z.array(z.string().min(1)),
864
+ /**
865
+ * Open items with the same subject id or URL, or linked to one of
866
+ * those Conversations, newest first.
867
+ */
868
+ items: z.array(z.object({
869
+ id: z.string().min(1),
870
+ title: z.string().min(1)
871
+ }).strict())
872
+ }).strict().optional(),
873
+ request: reviewItemRequestSchema.optional(),
874
+ /**
875
+ * The top of the item's Conversation tree that the viewer can see, at
876
+ * any depth: the Conversation that added the item when it is a root, or
877
+ * when the viewer cannot see its root. The Inbox stacks items by it.
878
+ */
879
+ rootConversationId: z.string().min(1),
843
880
  status: z.enum([
844
881
  "open",
845
882
  "done",
@@ -1,6 +1,6 @@
1
- import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-CddxU-yC.js";
2
- import { n as pluginCatalogRuntime } from "./catalog-runtime-q9AJjuUN.js";
3
- import { Z as disconnectStateAdapter } from "./db-CO6Y10eM.js";
1
+ import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-Zc5bUcIJ.js";
2
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BxwzbLKY.js";
3
+ import { $ as disconnectStateAdapter } from "./db-CFZggNoy.js";
4
4
  import { CLI_USAGE } from "./cli/run.js";
5
5
  import { createServer } from "node:http";
6
6
  // src/cli/service-account.ts
@@ -1,9 +1,9 @@
1
- import { K as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-DnBYBM8z.js";
2
- import { i as resolvePluginHeaderEnvRefs, l as fetchWithBoundedOAuthErrorBodies } from "./registry-tHJLCtKS.js";
3
- import { $ as getStateAdapter, Dt as parseDestination, at as withLock, it as fenceLock, nt as MUTATION_LOCK_TTL_MS } from "./db-CO6Y10eM.js";
4
- import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-rXH58smZ.js";
5
- import { n as botConfig } from "./config-Cx8H0MRw.js";
6
- import pLimit from "p-limit";
1
+ import { K as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-D5gkyvnK.js";
2
+ import { i as resolvePluginHeaderEnvRefs, l as fetchWithBoundedOAuthErrorBodies } from "./registry-BBkWFCl8.js";
3
+ import { it as MUTATION_LOCK_TTL_MS, kt as parseDestination, ot as fenceLock, st as withLock, tt as getStateAdapter } from "./db-CFZggNoy.js";
4
+ import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-CGrGVeQC.js";
5
+ import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
6
+ import { n as botConfig } from "./config-Dkt2Le2b.js";
7
7
  import { AsyncLocalStorage } from "node:async_hooks";
8
8
  import { randomUUID } from "node:crypto";
9
9
  import { sourceSchema } from "@sentry/junior-plugin-api";
@@ -235,8 +235,7 @@ async function deleteMcpAuthSessionsForUserProvider(userId, provider) {
235
235
  const stateAdapter = await getConnectedStateAdapter();
236
236
  const indexKey = sessionIndexKey(userId, provider);
237
237
  const authSessionIds = parseSessionIndex(await stateAdapter.get(indexKey));
238
- const limit = pLimit(8);
239
- await Promise.all(authSessionIds.map((authSessionId) => limit(() => stateAdapter.delete(sessionKey(authSessionId)))));
238
+ await mapBounded(authSessionIds, (authSessionId) => stateAdapter.delete(sessionKey(authSessionId)));
240
239
  await stateAdapter.delete(indexKey);
241
240
  }
242
241
  async function getMcpStoredOAuthCredentials(userId, provider) {