@sentry/junior 0.208.0 → 0.210.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 (54) hide show
  1. package/dist/{agent-BfxfHsf1.js → agent-DKboUiLS.js} +34 -25
  2. package/dist/{agent-hooks-CuGjLjmR.js → agent-hooks-4I-C-LhZ.js} +8 -8
  3. package/dist/{agent-runner-Dz1PMKP0.js → agent-runner-DgqYKBZm.js} +5 -5
  4. package/dist/api.js +15 -15
  5. package/dist/{app-DfNrn_gS.d.ts → app-gyu3D9Gn.d.ts} +2 -0
  6. package/dist/app.d.ts +1 -1
  7. package/dist/app.js +64 -31
  8. package/dist/{auth-pause-state-Bjoh8wCy.js → auth-pause-state-3wQ2cGwW.js} +6 -6
  9. package/dist/{briefs-q_onrGmf.js → briefs-DsJVC55W.js} +3 -3
  10. package/dist/{catalog-runtime-D8YUMNhb.js → catalog-runtime-D11j6L4T.js} +1 -1
  11. package/dist/{checkpoint-FKMcINix.js → checkpoint-CHdApjyQ.js} +6 -6
  12. package/dist/cli/chat.js +13 -13
  13. package/dist/cli/check.js +3 -3
  14. package/dist/cli/main.js +2 -2
  15. package/dist/cli/plugins.js +3 -3
  16. package/dist/cli/snapshot-create.js +3 -3
  17. package/dist/cli/upgrade.js +3 -3
  18. package/dist/{client-bRyPqwAV.js → client-CuyBdpWp.js} +54 -6
  19. package/dist/{config-EtF2uEaW.js → config-DoMOvr4Z.js} +3 -3
  20. package/dist/{conversation-privacy-whGaV2TG.js → conversation-privacy-Dxiz_d9l.js} +1 -1
  21. package/dist/{credential-sync-DM-EE1ey.js → credential-sync-6WRLsSQy.js} +32 -23
  22. package/dist/{execution-stats-C-f8zwMU.js → execution-stats-D7Q3Mo8Y.js} +4 -4
  23. package/dist/{executor-BW5qp0jC.js → executor-BR-u7Eiz.js} +277 -21
  24. package/dist/instrumentation.js +3 -3
  25. package/dist/{job-queue-BIHNIEIX.js → job-queue-FcjDDzOt.js} +1 -1
  26. package/dist/{logging-sNS84Yuu.js → logging-GTB-Z6hs.js} +2 -2
  27. package/dist/nitro.d.ts +1 -1
  28. package/dist/nitro.js +3 -3
  29. package/dist/{oauth-callback-server-Co6D_yXP.js → oauth-callback-server-CuLHQpGM.js} +2 -2
  30. package/dist/{pending-auth-CRJCt9Ux.js → pending-auth-DZKNc2-v.js} +2 -2
  31. package/dist/{profile-BfLMVhWo.js → profile-DEoalaoa.js} +4 -4
  32. package/dist/{prompt-x-0ZtTyb.js → prompt-Calvr7V2.js} +3 -3
  33. package/dist/{registry-Cyww_jnC.js → registry-wMxSBovn.js} +1 -1
  34. package/dist/{resolve-BApIFQXX.js → resolve-C0ds-bvC.js} +2 -2
  35. package/dist/{runner-C9okx4GL.js → runner-BoK9ACgc.js} +9 -9
  36. package/dist/{sandbox-egress-signals-BHfx0esj.js → sandbox-egress-signals-CnzazNxY.js} +1 -1
  37. package/dist/{sentry-CD3SdJl-.js → sentry-CgWZM_kV.js} +3 -2
  38. package/dist/{skills-DhL_wXEp.js → skills-CbGNcUOh.js} +2 -2
  39. package/dist/{spawn-msnzfE8_.js → spawn-Dm3kRFmC.js} +2 -2
  40. package/dist/{stats-Cq5w_Awk.js → stats-DROv84Z6.js} +46 -34
  41. package/dist/{task-queue-JfmWmpjS.js → task-queue-BUAVtd2X.js} +3 -3
  42. package/dist/{task-runner-Cm0gXoLH.js → task-runner-ByBGnm9Q.js} +7 -7
  43. package/dist/{thread-state-lw2QwQ-y.js → thread-state-BTFCRXKk.js} +5 -5
  44. package/dist/{turn-execution-C7K6lQp1.js → turn-execution-BXKiBFtp.js} +3 -3
  45. package/dist/{turn-lifecycle-DVlJLwB0.js → turn-lifecycle-Bu7HgoE6.js} +1 -1
  46. package/dist/{usage-BMuAlKIW.js → usage-DJ2WBjfc.js} +2 -2
  47. package/dist/{validation-BI-r3iQA.js → validation-ZZEOV02h.js} +1 -1
  48. package/dist/{version-s6smK6lP.js → version-Cf7Fwr1w.js} +1 -1
  49. package/dist/version.js +1 -1
  50. package/dist/{web-authorization-C9MxPvXX.js → web-authorization-D74eDSAs.js} +1 -1
  51. package/dist/{web-input-CwVlaLd0.js → web-input-c6W_exA0.js} +4 -4
  52. package/dist/{work-BK0W1QAt.js → work-zBMuzR-T.js} +9 -9
  53. package/dist/{worker-D-WWKHQD.js → worker-C-9UqHKm.js} +19 -11
  54. package/package.json +6 -6
@@ -1,10 +1,10 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { b as isProviderRetryError } from "./client-bRyPqwAV.js";
3
- import { S as withLogContext, d as logInfo, f as logWarn, u as logException } from "./logging-sNS84Yuu.js";
4
- import { a as getChatConfig } from "./config-EtF2uEaW.js";
5
- import { At as recordConversationRetry, Bt as isFinalAttempt, Ct as drainConversationMailbox, Et as getConversationWorkState, Ft as startConversationWork, Nt as requestAnotherSlice, St as deadLetterAttempt, Vt as isInvalidConversationRecordError, _t as clearConsumedConversationWake, bt as completeConversationWork, dt as ackMessages, gt as checkInConversationWork, jt as releaseConversationWork, kt as recordAttemptFailure, mt as beginConversationResume, wt as ensureConversationWake, xt as countPendingConversationMessages, yt as completeConversationStop } from "./stats-Cq5w_Awk.js";
2
+ import { b as isProviderRetryError } from "./client-CuyBdpWp.js";
3
+ import { S as withLogContext, d as logInfo, f as logWarn, u as logException } from "./logging-GTB-Z6hs.js";
4
+ import { a as getChatConfig } from "./config-DoMOvr4Z.js";
5
+ import { At as recordConversationRetry, Ct as drainConversationMailbox, Et as getConversationWorkState, Ft as startConversationWork, Ht as isInvalidConversationRecordError, Nt as requestAnotherSlice, St as deadLetterAttempt, Vt as isFinalAttempt, _t as clearConsumedConversationWake, bt as completeConversationWork, dt as ackMessages, gt as checkInConversationWork, jt as releaseConversationWork, kt as recordAttemptFailure, mt as beginConversationResume, wt as ensureConversationWake, xt as countPendingConversationMessages, yt as completeConversationStop, zt as hasConversationStop } from "./stats-DROv84Z6.js";
6
6
  import { c as ConversationQueueMessageRejectedError } from "./vercel-queue-DIkVcfK4.js";
7
- import { a as getTurnRequestDeadline } from "./job-queue-BIHNIEIX.js";
7
+ import { a as getTurnRequestDeadline } from "./job-queue-FcjDDzOt.js";
8
8
  //#region src/chat/task-execution/worker.ts
9
9
  var worker_exports = /* @__PURE__ */ __exportAll({
10
10
  CONVERSATION_WORK_DEFER_DELAY_MS: () => CONVERSATION_WORK_DEFER_DELAY_MS,
@@ -26,7 +26,9 @@ function selectAttemptMessages(work) {
26
26
  const messages = work.messages;
27
27
  const interrupts = messages.filter((message) => message.delivery === "interrupt");
28
28
  if (interrupts.length > 0) return selectContiguousTurnBatch(interrupts);
29
- return work.execution.status === "paused" ? [] : selectContiguousTurnBatch(messages);
29
+ if (work.execution.status === "paused") return [];
30
+ const nonEventMessages = messages.filter((message) => message.source !== "event");
31
+ return selectContiguousTurnBatch(nonEventMessages.length > 0 ? nonEventMessages : messages);
30
32
  }
31
33
  function nudgeIdempotencyKey(reason, conversationId, nowMs) {
32
34
  return `${reason}:${conversationId}:${nowMs}`;
@@ -132,7 +134,7 @@ function startLeaseCheckIn(args) {
132
134
  timer.unref?.();
133
135
  return timer;
134
136
  }
135
- /** Poll shared state only when a worker adapter asks to observe remote stops. */
137
+ /** Poll the run-scoped stop marker only when an adapter observes remote stops. */
136
138
  function createConversationStopSignal(args) {
137
139
  const controller = new AbortController();
138
140
  let checking = false;
@@ -142,15 +144,16 @@ function createConversationStopSignal(args) {
142
144
  const requestStop = () => {
143
145
  if (!controller.signal.aborted) controller.abort(/* @__PURE__ */ new Error("Conversation work stopped"));
144
146
  };
145
- if (args.initialStopRunId === args.runId) requestStop();
147
+ if (args.initiallyStopped) requestStop();
146
148
  const check = async () => {
147
149
  if (checking || controller.signal.aborted) return;
148
150
  checking = true;
149
151
  try {
150
- if ((await getConversationWorkState({
152
+ if (await hasConversationStop({
151
153
  conversationId: args.conversationId,
154
+ runId: args.runId,
152
155
  state: args.options.state
153
- }))?.execution.stop?.runId === args.runId) requestStop();
156
+ })) requestStop();
154
157
  } catch (error) {
155
158
  if (!failureCaptured) {
156
159
  failureCaptured = true;
@@ -374,7 +377,11 @@ async function processConversationWorkInContext(message, options) {
374
377
  };
375
378
  const stop = createConversationStopSignal({
376
379
  conversationId,
377
- initialStopRunId: leasedWork.execution.stop?.runId,
380
+ initiallyStopped: await hasConversationStop({
381
+ conversationId,
382
+ runId,
383
+ state: options.state
384
+ }),
378
385
  options,
379
386
  runId
380
387
  });
@@ -464,6 +471,7 @@ async function processConversationWorkInContext(message, options) {
464
471
  return (await ensureConversationWake({
465
472
  conversationId,
466
473
  conversationStore: options.conversationStore,
474
+ delayMs: result.delayMs,
467
475
  idempotencyKey: nudgeIdempotencyKey("deferred", conversationId, deferredNowMs),
468
476
  nowMs: deferredNowMs,
469
477
  queue: options.queue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior",
3
- "version": "0.208.0",
3
+ "version": "0.210.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -58,7 +58,7 @@
58
58
  "@chat-adapter/state-memory": "4.29.0",
59
59
  "@chat-adapter/state-redis": "4.29.0",
60
60
  "@earendil-works/pi-agent-core": "0.84.1",
61
- "@earendil-works/pi-ai": "0.84.1",
61
+ "@earendil-works/pi-ai": "0.85.1",
62
62
  "@hono/zod-validator": "^0.9.0",
63
63
  "@logtape/logtape": "^2.1.1",
64
64
  "@modelcontextprotocol/sdk": "1.29.0",
@@ -85,7 +85,7 @@
85
85
  "pg": "^8.16.3",
86
86
  "yaml": "^2.9.0",
87
87
  "zod": "^4.5.4",
88
- "@sentry/junior-plugin-api": "0.208.0"
88
+ "@sentry/junior-plugin-api": "0.210.0"
89
89
  },
90
90
  "devDependencies": {
91
91
  "@emnapi/core": "^1.10.0",
@@ -104,9 +104,9 @@
104
104
  "typescript": "^6.0.3",
105
105
  "vercel": "^54.4.0",
106
106
  "vitest": "^4.1.7",
107
- "@sentry/junior-github": "0.208.0",
108
- "@sentry/junior-testing": "0.0.0",
109
- "@sentry/junior-memory": "0.208.0"
107
+ "@sentry/junior-github": "0.210.0",
108
+ "@sentry/junior-memory": "0.210.0",
109
+ "@sentry/junior-testing": "0.0.0"
110
110
  },
111
111
  "scripts": {
112
112
  "build": "tsdown",