@sentry/junior 0.264.0 → 0.266.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 (69) hide show
  1. package/README.md +1 -1
  2. package/dist/{adapter-BIbMSKlG.js → adapter-eRFA_naf.js} +1 -1
  3. package/dist/{admin-D4d0HXax.js → admin-tILpP51p.js} +1 -1
  4. package/dist/{agent-runner-CvRxb09K.js → agent-runner-BtYK7bht.js} +263 -198
  5. package/dist/api/schema.d.ts +216 -15
  6. package/dist/api/schema.js +5 -5
  7. package/dist/api.js +109 -42
  8. package/dist/{app-Buc5gIWz.d.ts → app-Csbi9dW7.d.ts} +0 -4
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +79 -390
  11. package/dist/{assistant-reply-BcJj_ORj.js → assistant-reply-UyzAfZQo.js} +1 -1
  12. package/dist/{automation-CWX0qL8U.js → automation-BKpY9LPa.js} +31 -10
  13. package/dist/{briefs-BFfIE5N6.js → briefs-DgfWMU7e.js} +5 -5
  14. package/dist/{catalog-runtime-R53MWcMi.js → catalog-runtime-DAJjAbSx.js} +1 -1
  15. package/dist/cli/chat.js +15 -15
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/init.js +4 -18
  18. package/dist/cli/main.js +4 -4
  19. package/dist/cli/plugins.js +4 -4
  20. package/dist/cli/snapshot-create.js +4 -4
  21. package/dist/cli/upgrade.js +3 -3
  22. package/dist/{client-DpOwh_zX.js → client-B0YZfxNy.js} +3 -8
  23. package/dist/{config-BxPrFVJP.js → config-C0UwYqDK.js} +100 -3
  24. package/dist/{connections-BnTM1nRf.js → connections-Bwu3VORi.js} +11 -10
  25. package/dist/{conversation-B0baEwoA.js → conversation-DF4rUcjb.js} +6 -2
  26. package/dist/{conversation-privacy-ueJ6i-t9.js → conversation-privacy-CY7JVjxn.js} +1 -1
  27. package/dist/{credential-sync-DeDkof_D.js → credential-sync-VGAMUTGp.js} +20 -20
  28. package/dist/{agent-hooks-D_PbluRX.js → credentialed-enF5Bf3y.js} +3316 -179
  29. package/dist/{executor-D3WIS4vl.js → executor-TnWbvL09.js} +10 -300
  30. package/dist/{history-AY8rs-FR.js → history-C84mlAwO.js} +2 -1
  31. package/dist/{images-5VNK_yYC.js → images-BKQqSi5W.js} +3 -3
  32. package/dist/instrumentation.js +41 -25
  33. package/dist/{job-queue-BYHonCAH.js → job-queue-DBpHmKnd.js} +53 -14
  34. package/dist/{logging-DNQqsQ57.js → logging-Ce0mXZ8J.js} +19 -32
  35. package/dist/{message-CDTJISxL.js → message-VZ3DFpGb.js} +4 -4
  36. package/dist/nitro.d.ts +17 -2
  37. package/dist/nitro.js +26 -27
  38. package/dist/{oauth-callback-server-Bk4rbLOs.js → oauth-callback-server-CpqWLjVY.js} +2 -2
  39. package/dist/{prompt-CxatQVaj.js → prompt-BcCGlmg2.js} +2 -2
  40. package/dist/{registry-CfdUEk4N.js → registry-1BEIPdbT.js} +1 -1
  41. package/dist/{resolve-BXShI336.js → resolve-BSHHkEGE.js} +7 -106
  42. package/dist/{result-R35jcahx.js → result-CwOpzqdh.js} +8 -8
  43. package/dist/{runner-IC4Drh3Y.js → runner-CEaX04kz.js} +11 -11
  44. package/dist/{sandbox-egress-signals-C4RIfjb8.js → sandbox-egress-signals-BwtGHwqa.js} +1 -1
  45. package/dist/{schema-QidbykYl.js → schema-RsaBHxRH.js} +45 -4
  46. package/dist/{sentry-BBUlHih9.js → sentry-MDkYAVPV.js} +3 -6
  47. package/dist/{service-account-DJSRo2cL.js → service-account-6wC76eBZ.js} +5 -5
  48. package/dist/{service-account-DifohWyX.js → service-account-Dg4lIbHm.js} +3 -3
  49. package/dist/{session-stop-B9RRGC-P.js → session-stop-tZOw9AJD.js} +120 -80
  50. package/dist/{skills-DVJmS_ZP.js → skills-DzyGN7wd.js} +2 -2
  51. package/dist/{spawn-DkVYGfSY.js → spawn-6rokq7l_.js} +2 -2
  52. package/dist/{store-BvolNnx4.js → store-DcKkzrdt.js} +3 -3
  53. package/dist/{store-C_mHwAnR.js → store-FALy-JQb.js} +6 -6
  54. package/dist/{task-queue-BcEyPhtX.js → task-queue-Bg4RS2Gy.js} +14 -19
  55. package/dist/{task-runner-CiQj5M_9.js → task-runner-8N5LIkSg.js} +47 -29
  56. package/dist/{tasks-OgXmReUv.js → tasks-DDT-J3Rf.js} +17 -2078
  57. package/dist/{thread-state-XFvpWXE9.js → thread-state-cprEaxgl.js} +5 -5
  58. package/dist/{turn-failure-response-BjBAtnVt.js → turn-failure-response-C8sMdsdX.js} +8 -8
  59. package/dist/{turn-lifecycle-nvKL2rul.js → turn-lifecycle-DaBVoz7h.js} +2 -2
  60. package/dist/{turn-session-routing-DEMxHySb.js → turn-session-routing-a9CHX-w6.js} +1 -1
  61. package/dist/{validation-XOFldwvE.js → validation-C2lllinq.js} +1 -1
  62. package/dist/{version-C9f5hdHD.js → version-oaLfxxnf.js} +1 -1
  63. package/dist/version.js +1 -1
  64. package/dist/{viewer-BuPwzOC9.js → viewer-BpE6Z3qf.js} +22 -6
  65. package/dist/{web-input-4t7TYLsY.js → web-input-B-bMjD1V.js} +147 -48
  66. package/dist/{work-C_aF6JN5.js → work-VX1SHWha.js} +52 -51
  67. package/dist/{worker-DR633sA-.js → worker-hook-y_Y.js} +5 -5
  68. package/package.json +10 -9
  69. package/dist/profile-ieODOp4u.js +0 -582
@@ -1,15 +1,15 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { At as abandonTurnRecord, Ht as isTurnExecutionLimitExceededError, Kt as getTerminalAssistantMessages, Mt as failTurnRecord, Nt as getTurnRecord, R as openConversationProjection, bt as AuthorizationFlowDisabledError, gt as PluginCredentialFailureError, kt as saveTurnCheckpoint } from "./tasks-OgXmReUv.js";
3
- import { n as botConfig } from "./config-BxPrFVJP.js";
4
- import { c as getConversationEventStore, u as getConversationStore } from "./viewer-BuPwzOC9.js";
5
- import { m as sameActorIdentity, u as agentInstructionProvenance } from "./history-AY8rs-FR.js";
6
- import { H as recordSubagentStarted, V as recordSubagentEnded, X as withoutSavedSteeringMessages, Y as buildSteeringPiMessage, et as readBlockedReport, z as stopChildAgentsOf } from "./agent-runner-CvRxb09K.js";
7
- import { E as markAgentInvocationSteered, H as TurnInputCommitLostError, K as isTurnInputCommitLostError, L as agentTypeInstructions, O as reportReplacedAgentInvocation, R as agentTypeStartsWithParentHistory, S as markAgentInvocationMailboxAppended, T as markAgentInvocationRunning, W as getConversationTurnBoundaryError, _ as getLatestAgentInvocationForConversation, c as getAgentInvocation, f as getAgentInvocationMessageId, m as getAgentInvocationTurnId, n as completeAgentInvocation, r as createAgentInvocation, s as getActiveAgentInvocationForConversation, w as markAgentInvocationPaused, y as isTerminalAgentInvocation } from "./store-BvolNnx4.js";
8
- import { n as getAssistantReplyText } from "./assistant-reply-BcJj_ORj.js";
9
- import { F as resetAutomatedTurnLimit, N as maybePostAutomatedTurnLimitNotice, P as recordFinishedTurnForAutomatedLimit } from "./session-stop-B9RRGC-P.js";
10
- import { r as appendAndEnqueueInboundMessage } from "./store-C_mHwAnR.js";
11
- import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-nvKL2rul.js";
12
- import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-XFvpWXE9.js";
2
+ import { At as abandonTurnRecord, Ht as isTurnExecutionLimitExceededError, Kt as getTerminalAssistantMessages, Mt as failTurnRecord, Nt as getTurnRecord, R as openConversationProjection, bt as AuthorizationFlowDisabledError, gt as PluginCredentialFailureError, kt as saveTurnCheckpoint } from "./tasks-DDT-J3Rf.js";
3
+ import { n as botConfig } from "./config-C0UwYqDK.js";
4
+ import { d as getConversationStore, l as getConversationEventStore } from "./viewer-BpE6Z3qf.js";
5
+ import { m as sameActorIdentity, u as agentInstructionProvenance } from "./history-C84mlAwO.js";
6
+ import { B as stopChildAgentsOf, H as recordSubagentEnded, U as recordSubagentStarted, X as buildSteeringPiMessage, Z as withoutSavedSteeringMessages, tt as readBlockedReport } from "./agent-runner-BtYK7bht.js";
7
+ import { E as markAgentInvocationSteered, H as TurnInputCommitLostError, K as isTurnInputCommitLostError, L as agentTypeInstructions, O as reportReplacedAgentInvocation, R as agentTypeStartsWithParentHistory, S as markAgentInvocationMailboxAppended, T as markAgentInvocationRunning, W as getConversationTurnBoundaryError, _ as getLatestAgentInvocationForConversation, c as getAgentInvocation, f as getAgentInvocationMessageId, m as getAgentInvocationTurnId, n as completeAgentInvocation, r as createAgentInvocation, s as getActiveAgentInvocationForConversation, w as markAgentInvocationPaused, y as isTerminalAgentInvocation } from "./store-DcKkzrdt.js";
8
+ import { n as getAssistantReplyText } from "./assistant-reply-UyzAfZQo.js";
9
+ import { F as recordFinishedTurnForAutomatedLimit, I as resetAutomatedTurnLimit, P as maybePostAutomatedTurnLimitNotice } from "./session-stop-tZOw9AJD.js";
10
+ import { r as appendAndEnqueueInboundMessage } from "./store-FALy-JQb.js";
11
+ import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-DaBVoz7h.js";
12
+ import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-cprEaxgl.js";
13
13
  import { isDeepStrictEqual } from "node:util";
14
14
  import { z } from "zod";
15
15
  // src/chat/runtime/turn-execution.ts
@@ -35,11 +35,16 @@ async function executeTurn(agentRunner, run, saveResult) {
35
35
  }
36
36
  if (outcome.status !== "completed") return outcome;
37
37
  const saved = await saveResult(outcome.result);
38
+ await finishTurn(run.conversationId, run.turnId, saved);
39
+ return { status: "completed" };
40
+ }
41
+ /** Record the terminal lifecycle event of a Turn from its saved result. */
42
+ async function finishTurn(conversationId, turnId, saved) {
38
43
  const lifecycle = new ConversationTurnLifecycleService(getConversationEventStore());
39
44
  const common = {
40
- conversationId: run.conversationId,
45
+ conversationId,
41
46
  createdAtMs: saved.finishedAtMs ?? Date.now(),
42
- turnId: run.turnId
47
+ turnId
43
48
  };
44
49
  if (saved.outcome === "failed") await lifecycle.fail({
45
50
  ...common,
@@ -51,7 +56,6 @@ async function executeTurn(agentRunner, run, saveResult) {
51
56
  ...common,
52
57
  outcome: saved.outcome
53
58
  });
54
- return { status: "completed" };
55
59
  }
56
60
  // src/chat/agent-invocations/fork-history.ts
57
61
  /**
@@ -234,32 +238,41 @@ function createAgentMessageSteeringDrain(context, running) {
234
238
  return accepted;
235
239
  };
236
240
  }
237
- /** Project the terminal invocation into the idempotent turn lifecycle. */
238
- async function persistTerminalLifecycle(invocation) {
239
- const lifecycle = new ConversationTurnLifecycleService(getConversationEventStore());
240
- const common = {
241
- conversationId: invocation.childConversationId,
242
- createdAtMs: "terminalAtMs" in invocation ? invocation.terminalAtMs : invocation.updatedAtMs,
243
- turnId: getAgentInvocationTurnId(invocation.invocationId)
244
- };
245
- if (invocation.status === "completed") await lifecycle.complete({
246
- ...common,
247
- outcome: invocation.result?.trim() ? "success" : "no_reply"
248
- });
249
- else if (invocation.status === "stopped") {
250
- await abandonTurnRecord({
251
- conversationId: common.conversationId,
252
- errorMessage: "Turn cancelled",
253
- turnId: common.turnId
254
- });
255
- await lifecycle.complete({
256
- ...common,
241
+ /**
242
+ * How a terminal agent invocation ends its child Turn. The live save and the
243
+ * recovery paths both use this, so a status cannot end the Turn two ways.
244
+ */
245
+ function agentInvocationTurnEnd(terminal) {
246
+ const finishedAtMs = terminal.terminalAtMs;
247
+ switch (terminal.status) {
248
+ case "completed": return {
249
+ finishedAtMs,
250
+ outcome: terminal.result.trim() ? "success" : "no_reply"
251
+ };
252
+ case "stopped": return {
253
+ finishedAtMs,
257
254
  outcome: "cancelled"
258
- });
259
- } else if (invocation.status === "blocked" || invocation.status === "failed") await lifecycle.fail({
260
- ...common,
261
- failureCode: "model_execution_failed"
255
+ };
256
+ case "blocked": return {
257
+ finishedAtMs,
258
+ outcome: "blocked"
259
+ };
260
+ case "failed": return {
261
+ failureCode: "model_execution_failed",
262
+ finishedAtMs,
263
+ outcome: "failed"
264
+ };
265
+ }
266
+ }
267
+ /** Project the terminal invocation into the idempotent turn lifecycle. */
268
+ async function persistTerminalLifecycle(terminal) {
269
+ const turnId = getAgentInvocationTurnId(terminal.invocationId);
270
+ if (terminal.status === "stopped") await abandonTurnRecord({
271
+ conversationId: terminal.childConversationId,
272
+ errorMessage: "Turn cancelled",
273
+ turnId
262
274
  });
275
+ await finishTurn(terminal.childConversationId, turnId, agentInvocationTurnEnd(terminal));
263
276
  }
264
277
  /** Stop an invocation whose worker died, or project its terminal turn result. */
265
278
  async function projectTerminalTurn(invocation) {
@@ -345,19 +358,7 @@ async function saveAgentInvocationResult(args) {
345
358
  }
346
359
  });
347
360
  if (!terminal || !isTerminalAgentInvocation(terminal)) throw new Error(`Agent invocation did not finish for ${args.invocation.invocationId}`);
348
- if (terminal.status === "completed") return {
349
- finishedAtMs: terminal.terminalAtMs,
350
- outcome: terminal.result.trim() ? "success" : "no_reply"
351
- };
352
- if (terminal.status === "stopped") return {
353
- finishedAtMs: terminal.terminalAtMs,
354
- outcome: "cancelled"
355
- };
356
- return {
357
- finishedAtMs: terminal.terminalAtMs,
358
- failureCode: "model_execution_failed",
359
- outcome: "failed"
360
- };
361
+ return agentInvocationTurnEnd(terminal);
361
362
  }
362
363
  /**
363
364
  * Read how many parents a child Conversation has and the root Conversation's
@@ -1,9 +1,9 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { y as isProviderRetryError } from "./client-DpOwh_zX.js";
3
- import { f as logException, m as logWarn, p as logInfo, w as withLogContext, y as setSpanAttributes } from "./logging-DNQqsQ57.js";
4
- import { i as getChatConfig } from "./config-BxPrFVJP.js";
5
- import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-BYHonCAH.js";
6
- import { C as requestAnotherSlice, M as isInvalidConversationRecordError, T as startConversationWork, b as recordConversationRetry, d as countPendingConversationMessages, f as deadLetterAttempt, g as getConversationWorkState, i as beginConversationResume, j as isFinalAttempt, k as hasConversationStop, l as completeConversationStop, m as ensureConversationWake, o as checkInConversationWork, p as drainConversationMailbox, s as clearConsumedConversationWake, t as ackMessages, u as completeConversationWork, x as releaseConversationWork, y as recordAttemptFailure } from "./store-C_mHwAnR.js";
2
+ import { y as isProviderRetryError } from "./client-B0YZfxNy.js";
3
+ import { i as getChatConfig } from "./config-C0UwYqDK.js";
4
+ import { f as logException, m as logWarn, p as logInfo, w as withLogContext, y as setSpanAttributes } from "./logging-Ce0mXZ8J.js";
5
+ import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-DBpHmKnd.js";
6
+ import { C as requestAnotherSlice, M as isInvalidConversationRecordError, T as startConversationWork, b as recordConversationRetry, d as countPendingConversationMessages, f as deadLetterAttempt, g as getConversationWorkState, i as beginConversationResume, j as isFinalAttempt, k as hasConversationStop, l as completeConversationStop, m as ensureConversationWake, o as checkInConversationWork, p as drainConversationMailbox, s as clearConsumedConversationWake, t as ackMessages, u as completeConversationWork, x as releaseConversationWork, y as recordAttemptFailure } from "./store-FALy-JQb.js";
7
7
  // src/chat/task-execution/worker.ts
8
8
  var worker_exports = /* @__PURE__ */ __exportAll({
9
9
  CONVERSATION_WORK_DEFER_DELAY_MS: () => CONVERSATION_WORK_DEFER_DELAY_MS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior",
3
- "version": "0.264.0",
3
+ "version": "0.266.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -63,9 +63,9 @@
63
63
  "@logtape/logtape": "^2.1.1",
64
64
  "@modelcontextprotocol/sdk": "1.32.0",
65
65
  "@neondatabase/serverless": "^1.1.0",
66
- "@opentelemetry/api": "1.9.1",
67
- "@opentelemetry/core": "2.9.0",
68
- "@sentry/node": "10.65.0",
66
+ "@sentry/nitro": "11.10.0",
67
+ "@sentry/node": "11.10.0",
68
+ "@sentry/server-utils": "11.10.0",
69
69
  "@sinclair/typebox": "^0.34.49",
70
70
  "@slack/types": "^2.21.1",
71
71
  "@slack/web-api": "^7.16.0",
@@ -75,7 +75,8 @@
75
75
  "@vercel/queue": "^0.2.0",
76
76
  "@vercel/sandbox": "2.8.0",
77
77
  "ai": "^7.0.153",
78
- "better-auth": "^1.7.7",
78
+ "aws4fetch": "^1.0.20",
79
+ "better-auth": "^1.7.14",
79
80
  "chat": "4.29.0",
80
81
  "commander": "^14.0.3",
81
82
  "diff": "^8.0.4",
@@ -89,12 +90,12 @@
89
90
  "sharp": "^0.35.3",
90
91
  "yaml": "^2.9.0",
91
92
  "zod": "^4.5.4",
92
- "@sentry/junior-plugin-api": "0.264.0"
93
+ "@sentry/junior-plugin-api": "0.266.0"
93
94
  },
94
95
  "devDependencies": {
95
96
  "@emnapi/core": "^1.10.0",
96
97
  "@emnapi/runtime": "^1.10.0",
97
- "@hono/node-server": "1.19.15",
98
+ "@hono/node-server": "2.1.3",
98
99
  "@oxlint/plugins": "1.79.0",
99
100
  "@types/node": "^25.9.1",
100
101
  "@types/pg": "^8.15.6",
@@ -109,9 +110,9 @@
109
110
  "typescript": "^7.0.2",
110
111
  "vercel": "^54.4.0",
111
112
  "vitest": "^4.1.12",
113
+ "@sentry/junior-github": "0.266.0",
112
114
  "@sentry/junior-testing": "0.0.0",
113
- "@sentry/junior-github": "0.264.0",
114
- "@sentry/junior-memory": "0.264.0"
115
+ "@sentry/junior-memory": "0.266.0"
115
116
  },
116
117
  "scripts": {
117
118
  "build": "tsdown",