@sentry/junior 0.144.0 → 0.145.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 (88) hide show
  1. package/dist/{agent-hooks-GCUTGKY3.js → agent-hooks-L7D2BDVV.js} +10 -10
  2. package/dist/api/conversations/detail.d.ts +1 -0
  3. package/dist/api/schema/conversation.d.ts +2 -0
  4. package/dist/api/schema.js +1 -1
  5. package/dist/api.js +40 -22
  6. package/dist/app.js +335 -409
  7. package/dist/{catalog-runtime-DWVYKDC6.js → catalog-runtime-QLAC4Q3W.js} +5 -5
  8. package/dist/chat/agent/request.d.ts +1 -1
  9. package/dist/chat/agent/resume.d.ts +6 -15
  10. package/dist/chat/agent/tools.d.ts +1 -1
  11. package/dist/chat/agent-dispatch/types.d.ts +1 -1
  12. package/dist/chat/app/conversation-work.d.ts +24 -0
  13. package/dist/chat/conversations/projection.d.ts +11 -3
  14. package/dist/chat/conversations/store.d.ts +1 -1
  15. package/dist/chat/runtime/agent-run-outcome.d.ts +1 -1
  16. package/dist/chat/runtime/reply-executor.d.ts +5 -5
  17. package/dist/chat/runtime/slack-resume.d.ts +12 -4
  18. package/dist/chat/state/locks.d.ts +28 -0
  19. package/dist/chat/task-execution/checkpoint.d.ts +86 -0
  20. package/dist/chat/task-execution/paused-turn.d.ts +29 -0
  21. package/dist/chat/task-execution/queue-signing.d.ts +1 -0
  22. package/dist/chat/task-execution/queue.d.ts +7 -1
  23. package/dist/chat/task-execution/slack-work.d.ts +1 -1
  24. package/dist/chat/task-execution/state.d.ts +4 -4
  25. package/dist/chat/task-execution/store.d.ts +2 -2
  26. package/dist/chat/task-execution/turn-cursor-keys.d.ts +6 -0
  27. package/dist/chat/{state/turn-session.d.ts → task-execution/turn-cursor.d.ts} +52 -42
  28. package/dist/chat/task-execution/turn-wake.d.ts +29 -0
  29. package/dist/chat/tools/types.d.ts +1 -1
  30. package/dist/{chunk-HNO2E5WB.js → chunk-27TEJTZO.js} +1 -1
  31. package/dist/{chunk-RIFJUJSI.js → chunk-2LWPFSB4.js} +1 -1
  32. package/dist/{chunk-SBZP2J5Q.js → chunk-2UH3JI64.js} +10 -9
  33. package/dist/{chunk-QUZJDAQQ.js → chunk-2XET6PKP.js} +93 -89
  34. package/dist/{chunk-SUK7NC5A.js → chunk-5PNPQYTO.js} +2 -2
  35. package/dist/{chunk-SSDTQDYQ.js → chunk-64SBYW2O.js} +132 -127
  36. package/dist/{chunk-DVO5VKYQ.js → chunk-B46ZMVOV.js} +5 -5
  37. package/dist/{chunk-A67GZN73.js → chunk-CD2XFGYQ.js} +1 -1
  38. package/dist/{chunk-WTX2RFJG.js → chunk-DS3J6WGY.js} +1 -1
  39. package/dist/{chunk-PKH6762I.js → chunk-DXEQAIUV.js} +1 -1
  40. package/dist/{chunk-WSOLZJJS.js → chunk-EIX2LQ6L.js} +3 -3
  41. package/dist/{chunk-KQBXT5B7.js → chunk-FUBRJA5F.js} +6 -6
  42. package/dist/{chunk-I44JB7HQ.js → chunk-GDV5LXRA.js} +1 -1
  43. package/dist/{chunk-7KAW7UF4.js → chunk-GUWLDMGF.js} +4 -4
  44. package/dist/{chunk-PELZ2ZSY.js → chunk-HISR3DTV.js} +33 -61
  45. package/dist/{chunk-HD6BHR25.js → chunk-HLOUZC5C.js} +32 -34
  46. package/dist/{chunk-BBCWYXHB.js → chunk-I47UGQPJ.js} +7 -7
  47. package/dist/{chunk-IUFM5JWV.js → chunk-JAL3CH4G.js} +3 -0
  48. package/dist/{chunk-E7HCWOHG.js → chunk-JLMVCNXL.js} +2 -1
  49. package/dist/{chunk-STFCL3K4.js → chunk-JTGS3ZZE.js} +1 -1
  50. package/dist/{chunk-GKA74DRA.js → chunk-LVVSIMBB.js} +1 -1
  51. package/dist/{chunk-SHEEZSLY.js → chunk-PJ4NMVQB.js} +2 -2
  52. package/dist/{chunk-W7JFV5SB.js → chunk-QJBDABQA.js} +14 -17
  53. package/dist/{chunk-UDQMY6RS.js → chunk-QUG4JSZK.js} +43 -1
  54. package/dist/{chunk-4X5KM7Z6.js → chunk-RUSS62EN.js} +14 -14
  55. package/dist/{chunk-ZF3N3JD6.js → chunk-SIN3MXH6.js} +1 -1
  56. package/dist/{chunk-QE3TICD4.js → chunk-TZRXYWRE.js} +2 -2
  57. package/dist/{chunk-CNTWB2SM.js → chunk-VTDMB7XX.js} +1 -1
  58. package/dist/{chunk-LDWNYCZ6.js → chunk-WF5HVH3M.js} +1 -1
  59. package/dist/{chunk-KCBZSJRU.js → chunk-WR76IVA5.js} +5 -2
  60. package/dist/{chunk-3GU4PWA3.js → chunk-XFKIRN3Q.js} +29 -29
  61. package/dist/{chunk-ZZCTGAIT.js → chunk-YD54Q45G.js} +4 -4
  62. package/dist/{chunk-BEGGFVFR.js → chunk-ZIAMN2UW.js} +407 -523
  63. package/dist/{chunk-44RJWAND.js → chunk-ZIMRGFYL.js} +6 -6
  64. package/dist/{chunk-54JMYQYS.js → chunk-ZYAJMESY.js} +2 -2
  65. package/dist/cli/chat.js +32 -32
  66. package/dist/cli/check.js +6 -6
  67. package/dist/cli/plugins.js +13 -13
  68. package/dist/cli/snapshot-create.js +9 -9
  69. package/dist/cli/upgrade.js +7 -7
  70. package/dist/{db-EFLHTBU6.js → db-62PW6LM3.js} +7 -7
  71. package/dist/instrumentation.js +4 -4
  72. package/dist/nitro.js +4 -4
  73. package/dist/{oauth-callback-server-RO3IQKWM.js → oauth-callback-server-6NZNHJAM.js} +25 -25
  74. package/dist/{runner-LOWW7JKA.js → runner-GCRPG3GQ.js} +19 -18
  75. package/dist/{skills-ZLMUG7AE.js → skills-2S3MDFIQ.js} +6 -6
  76. package/dist/spawn-7WK37BTD.js +39 -0
  77. package/dist/{validation-MAKEZNTS.js → validation-HAOLCJ5A.js} +6 -6
  78. package/dist/version.js +1 -1
  79. package/dist/{work-5OAGC3I4.js → work-R4XYKMUW.js} +17 -16
  80. package/dist/worker-U2UCVR7M.js +24 -0
  81. package/package.json +4 -4
  82. package/dist/chat/agent/session.d.ts +0 -19
  83. package/dist/chat/runtime/agent-continue-runner.d.ts +0 -37
  84. package/dist/chat/services/agent-continue.d.ts +0 -29
  85. package/dist/chat/services/turn-session-record.d.ts +0 -164
  86. package/dist/chat/state/turn-session-keys.d.ts +0 -6
  87. package/dist/spawn-R3LUV6RF.js +0 -38
  88. package/dist/worker-KTGGRTTP.js +0 -24
@@ -16,22 +16,22 @@ import {
16
16
  recordAttemptFailure,
17
17
  recordConversationRetry,
18
18
  releaseConversationWork,
19
- requestConversationContinuation,
19
+ requestAnotherSlice,
20
20
  startConversationWork
21
- } from "./chunk-HD6BHR25.js";
21
+ } from "./chunk-HLOUZC5C.js";
22
22
  import {
23
23
  ConversationQueueMessageRejectedError
24
- } from "./chunk-IUFM5JWV.js";
24
+ } from "./chunk-JAL3CH4G.js";
25
25
  import {
26
26
  getChatConfig,
27
27
  isProviderRetryError
28
- } from "./chunk-3GU4PWA3.js";
28
+ } from "./chunk-XFKIRN3Q.js";
29
29
  import {
30
30
  logException,
31
31
  logInfo,
32
32
  logWarn,
33
33
  withLogContext
34
- } from "./chunk-RIFJUJSI.js";
34
+ } from "./chunk-2LWPFSB4.js";
35
35
 
36
36
  // src/chat/task-execution/worker.ts
37
37
  var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
@@ -59,7 +59,7 @@ function selectAttemptMessages(work) {
59
59
  if (interrupts.length > 0) {
60
60
  return selectContiguousActorBatch(interrupts);
61
61
  }
62
- return work.execution.status === "awaiting_resume" ? [] : selectContiguousActorBatch(messages);
62
+ return work.execution.status === "paused" ? [] : selectContiguousActorBatch(messages);
63
63
  }
64
64
  function nudgeIdempotencyKey(reason, conversationId, nowMs) {
65
65
  return `${reason}:${conversationId}:${nowMs}`;
@@ -91,7 +91,7 @@ async function requestLostLeaseRecovery(args) {
91
91
  );
92
92
  return;
93
93
  }
94
- const resumeRequested = await requestConversationContinuation({
94
+ const sliceRequested = await requestAnotherSlice({
95
95
  conversationId: args.conversationId,
96
96
  destination: args.destination,
97
97
  leaseToken: args.leaseToken,
@@ -99,7 +99,7 @@ async function requestLostLeaseRecovery(args) {
99
99
  nowMs: args.nowMs,
100
100
  state: args.options.state
101
101
  });
102
- if (!resumeRequested) {
102
+ if (!sliceRequested) {
103
103
  return;
104
104
  }
105
105
  const released = await releaseConversationWork({
@@ -343,7 +343,7 @@ async function processConversationWorkInContext(message, options) {
343
343
  });
344
344
  return { status: "lost_lease" };
345
345
  }
346
- const resumePending = leasedWork.execution.status === "awaiting_resume";
346
+ const resumePending = leasedWork.execution.status === "paused";
347
347
  const attemptMessages = selectAttemptMessages(leasedWork);
348
348
  attemptStartMessageIds = new Set(
349
349
  leasedWork.messages.map((message2) => message2.inboundMessageId)
@@ -433,7 +433,7 @@ async function processConversationWorkInContext(message, options) {
433
433
  return { status: "lost_lease" };
434
434
  }
435
435
  if (result.status === "yielded") {
436
- const resumeRequested = await requestConversationContinuation({
436
+ const sliceRequested = await requestAnotherSlice({
437
437
  conversationId,
438
438
  destination,
439
439
  leaseToken: lease.leaseToken,
@@ -441,7 +441,7 @@ async function processConversationWorkInContext(message, options) {
441
441
  nowMs: now(options),
442
442
  state: options.state
443
443
  });
444
- if (!resumeRequested) {
444
+ if (!sliceRequested) {
445
445
  return { status: "lost_lease" };
446
446
  }
447
447
  return await yieldWork();
@@ -514,7 +514,7 @@ async function processConversationWorkInContext(message, options) {
514
514
  if (!next || next.lease?.leaseToken !== lease.leaseToken) {
515
515
  return { status: "lost_lease" };
516
516
  }
517
- if (next.execution.status !== "awaiting_resume" && countPendingConversationMessages(next) === 0) {
517
+ if (next.execution.status !== "paused" && countPendingConversationMessages(next) === 0) {
518
518
  break;
519
519
  }
520
520
  }
@@ -613,7 +613,7 @@ async function processConversationWorkInContext(message, options) {
613
613
  recoveryRecorded = true;
614
614
  return { status: "failed" };
615
615
  }
616
- const resumeRequested = await requestConversationContinuation({
616
+ const sliceRequested = await requestAnotherSlice({
617
617
  conversationId,
618
618
  destination,
619
619
  leaseToken: lease.leaseToken,
@@ -621,7 +621,7 @@ async function processConversationWorkInContext(message, options) {
621
621
  nowMs: errorNowMs,
622
622
  state: options.state
623
623
  });
624
- if (resumeRequested) {
624
+ if (sliceRequested) {
625
625
  await ensureConversationWake({
626
626
  conversationId,
627
627
  conversationStore: options.conversationStore,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createPluginCatalogRuntime
3
- } from "./chunk-A67GZN73.js";
3
+ } from "./chunk-CD2XFGYQ.js";
4
4
 
5
5
  // src/chat/plugins/catalog-runtime.ts
6
6
  var pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-EM225ITJ.js";
4
4
  import {
5
5
  getSlackBotToken
6
- } from "./chunk-3GU4PWA3.js";
6
+ } from "./chunk-XFKIRN3Q.js";
7
7
  import {
8
8
  parseSlackChannelReferenceId
9
9
  } from "./chunk-F3B2YJ76.js";
@@ -12,7 +12,7 @@ import {
12
12
  setSpanAttributes,
13
13
  setSpanStatus,
14
14
  withSpan
15
- } from "./chunk-RIFJUJSI.js";
15
+ } from "./chunk-2LWPFSB4.js";
16
16
 
17
17
  // src/chat/slack/client.ts
18
18
  import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  botConfig,
3
3
  resolveGatewayModel
4
- } from "./chunk-3GU4PWA3.js";
4
+ } from "./chunk-XFKIRN3Q.js";
5
5
 
6
6
  // src/chat/services/context-budget.ts
7
7
  var COMPACTION_TRIGGER_RATIO = 0.9;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-ZF3N3JD6.js";
3
+ } from "./chunk-SIN3MXH6.js";
4
4
 
5
5
  // src/chat/plugins/validation.ts
6
6
  import { isDeepStrictEqual } from "util";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  conversationQueueMessageSchema
3
- } from "./chunk-IUFM5JWV.js";
3
+ } from "./chunk-JAL3CH4G.js";
4
4
  import {
5
5
  createVercelQueueClient
6
6
  } from "./chunk-5I6ORJUY.js";
@@ -79,7 +79,10 @@ function verifyConversationQueueMessage(value, nowMs = Date.now()) {
79
79
  }
80
80
  return {
81
81
  status: "verified",
82
- message: { conversationId: message.conversationId }
82
+ message: {
83
+ schemaVersion: message.schemaVersion,
84
+ conversationId: message.conversationId
85
+ }
83
86
  };
84
87
  }
85
88
 
@@ -3,7 +3,7 @@ import {
3
3
  toCanonicalInputMessage,
4
4
  toCanonicalOutputMessage,
5
5
  toGenAiMessagesTraceAttributes
6
- } from "./chunk-STFCL3K4.js";
6
+ } from "./chunk-JTGS3ZZE.js";
7
7
  import {
8
8
  extractGenAiUsageAttributes,
9
9
  logException,
@@ -11,7 +11,7 @@ import {
11
11
  normalizeGenAiFinishReason,
12
12
  serializeGenAiAttribute,
13
13
  withSpan
14
- } from "./chunk-RIFJUJSI.js";
14
+ } from "./chunk-2LWPFSB4.js";
15
15
 
16
16
  // src/chat/services/provider-error.ts
17
17
  var ProviderError = class extends Error {
@@ -195,31 +195,6 @@ function getProviderErrorAttributes(error) {
195
195
  };
196
196
  }
197
197
 
198
- // src/chat/model-profile.ts
199
- import { z } from "zod";
200
- var STANDARD_MODEL_PROFILE = "standard";
201
- var DEFAULT_HANDOFF_MODEL_PROFILE = "handoff";
202
- var modelProfileSchema = z.string().regex(/^[a-z][a-z0-9_-]*$/);
203
- var ModelProfileNotConfiguredError = class extends Error {
204
- constructor(profile) {
205
- super(`Model profile "${profile}" is not configured`);
206
- this.name = "ModelProfileNotConfiguredError";
207
- }
208
- };
209
- function modelIdForProfile(config, profile) {
210
- return profileConfig(config, profile).modelId;
211
- }
212
- function standardModelId(config) {
213
- return modelIdForProfile(config, STANDARD_MODEL_PROFILE);
214
- }
215
- function profileConfig(config, profile) {
216
- const profileConfig2 = Object.hasOwn(config.profiles, profile) ? config.profiles[profile] : void 0;
217
- if (!profileConfig2) {
218
- throw new ModelProfileNotConfiguredError(profile);
219
- }
220
- return profileConfig2;
221
- }
222
-
223
198
  // src/chat/config.ts
224
199
  import { getModel as getModel2 } from "@earendil-works/pi-ai/compat";
225
200
 
@@ -677,7 +652,7 @@ function normalizeSlackEmojiName(value) {
677
652
  }
678
653
 
679
654
  // src/chat/reasoning-level.ts
680
- import { z as z2 } from "zod";
655
+ import { z } from "zod";
681
656
  var TURN_REASONING_LEVELS = [
682
657
  "none",
683
658
  "low",
@@ -686,7 +661,32 @@ var TURN_REASONING_LEVELS = [
686
661
  "xhigh"
687
662
  ];
688
663
  function parseTurnReasoningLevel(value) {
689
- return z2.enum(TURN_REASONING_LEVELS).parse(value);
664
+ return z.enum(TURN_REASONING_LEVELS).parse(value);
665
+ }
666
+
667
+ // src/chat/model-profile.ts
668
+ import { z as z2 } from "zod";
669
+ var STANDARD_MODEL_PROFILE = "standard";
670
+ var DEFAULT_HANDOFF_MODEL_PROFILE = "handoff";
671
+ var modelProfileSchema = z2.string().regex(/^[a-z][a-z0-9_-]*$/);
672
+ var ModelProfileNotConfiguredError = class extends Error {
673
+ constructor(profile) {
674
+ super(`Model profile "${profile}" is not configured`);
675
+ this.name = "ModelProfileNotConfiguredError";
676
+ }
677
+ };
678
+ function modelIdForProfile(config, profile) {
679
+ return profileConfig(config, profile).modelId;
680
+ }
681
+ function standardModelId(config) {
682
+ return modelIdForProfile(config, STANDARD_MODEL_PROFILE);
683
+ }
684
+ function profileConfig(config, profile) {
685
+ const profileConfig2 = Object.hasOwn(config.profiles, profile) ? config.profiles[profile] : void 0;
686
+ if (!profileConfig2) {
687
+ throw new ModelProfileNotConfiguredError(profile);
688
+ }
689
+ return profileConfig2;
690
690
  }
691
691
 
692
692
  // src/chat/config.ts
@@ -4,22 +4,22 @@ import {
4
4
  import {
5
5
  canRouteResourceEvents,
6
6
  getPlugins
7
- } from "./chunk-44RJWAND.js";
7
+ } from "./chunk-ZIMRGFYL.js";
8
8
  import {
9
9
  getDb
10
- } from "./chunk-SBZP2J5Q.js";
10
+ } from "./chunk-2UH3JI64.js";
11
11
  import {
12
12
  juniorEventTasks,
13
13
  juniorSchedulerRuns,
14
14
  juniorSchedulerTasks,
15
15
  juniorStats
16
- } from "./chunk-HNO2E5WB.js";
16
+ } from "./chunk-27TEJTZO.js";
17
17
  import {
18
18
  juniorDestinations
19
19
  } from "./chunk-VFUK3X5B.js";
20
20
  import {
21
21
  logInfo
22
- } from "./chunk-RIFJUJSI.js";
22
+ } from "./chunk-2LWPFSB4.js";
23
23
 
24
24
  // src/chat/event-tasks/store.ts
25
25
  import { and, asc, desc, eq, inArray, or, sql } from "drizzle-orm";