@sentry/junior 0.183.0 → 0.185.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 (122) hide show
  1. package/dist/{agent-hooks-SNRBZYAU.js → agent-hooks-NGZQLL5O.js} +13 -11
  2. package/dist/api/acp/auth.d.ts +46 -0
  3. package/dist/api/acp/authorization-page.d.ts +11 -0
  4. package/dist/api/acp/conversations.d.ts +70 -0
  5. package/dist/api/acp/errors.d.ts +6 -0
  6. package/dist/api/acp/route.d.ts +16 -0
  7. package/dist/api/acp/schema.d.ts +115 -0
  8. package/dist/api/acp/sleep.d.ts +2 -0
  9. package/dist/api/acp/state.d.ts +22 -0
  10. package/dist/api/acp/transport.d.ts +113 -0
  11. package/dist/api/code/overview.d.ts +39 -0
  12. package/dist/api/locations/detail.d.ts +1 -1
  13. package/dist/api/people/code.d.ts +22 -0
  14. package/dist/api/schema/code.d.ts +46 -0
  15. package/dist/api/schema/conversation.d.ts +100 -20
  16. package/dist/api/schema/location.d.ts +1 -1
  17. package/dist/api/schema/person.d.ts +1 -1
  18. package/dist/api/schema.d.ts +4 -4
  19. package/dist/api/schema.js +12 -1
  20. package/dist/api.js +358 -76
  21. package/dist/app.d.ts +0 -4
  22. package/dist/app.js +2450 -493
  23. package/dist/{catalog-runtime-3I3JOIIH.js → catalog-runtime-AAEAO2RL.js} +4 -4
  24. package/dist/chat/api-turns/accepted-reply.d.ts +11 -0
  25. package/dist/chat/api-turns/cancellation.d.ts +3 -5
  26. package/dist/chat/api-turns/work.d.ts +4 -9
  27. package/dist/chat/app/conversation-work.d.ts +1 -1
  28. package/dist/chat/app/factory.d.ts +4 -0
  29. package/dist/chat/app/services.d.ts +4 -3
  30. package/dist/chat/conversations/history.d.ts +83 -9
  31. package/dist/chat/conversations/turn-lifecycle.d.ts +4 -3
  32. package/dist/chat/providers/slack/input.d.ts +32 -0
  33. package/dist/chat/{runtime → providers/slack}/processing-reaction.d.ts +6 -8
  34. package/dist/chat/{runtime/slack-resume.d.ts → providers/slack/resume.d.ts} +16 -19
  35. package/dist/chat/providers/slack/runtime.d.ts +1 -10
  36. package/dist/chat/providers/slack/turn.d.ts +11 -24
  37. package/dist/chat/resource-events/store.d.ts +1 -1
  38. package/dist/chat/resource-events/tool-support.d.ts +0 -5
  39. package/dist/chat/runtime/turn-execution.d.ts +7 -2
  40. package/dist/chat/sandbox/egress/credentials.d.ts +3 -3
  41. package/dist/chat/sandbox/egress/session.d.ts +5 -6
  42. package/dist/chat/scheduled-tasks/tool-support.d.ts +5 -5
  43. package/dist/chat/scheduled-tasks/tools/create.d.ts +2 -2
  44. package/dist/chat/scheduled-tasks/tools/delete.d.ts +2 -2
  45. package/dist/chat/scheduled-tasks/tools/list.d.ts +2 -2
  46. package/dist/chat/scheduled-tasks/tools/run-now.d.ts +2 -2
  47. package/dist/chat/scheduled-tasks/tools/update.d.ts +2 -2
  48. package/dist/chat/scheduled-tasks/types.d.ts +1 -1
  49. package/dist/chat/services/provider-retry.d.ts +2 -0
  50. package/dist/chat/services/turn-failure-response.d.ts +4 -0
  51. package/dist/chat/task-execution/paused-turn.d.ts +0 -2
  52. package/dist/chat/task-execution/state.d.ts +2 -2
  53. package/dist/chat/task-execution/store.d.ts +1 -1
  54. package/dist/chat/task-execution/turn-wake.d.ts +12 -0
  55. package/dist/chat/tool-support/action-review.d.ts +1 -1
  56. package/dist/chat/tools/resource-events.d.ts +1 -1
  57. package/dist/chat/tools/search-conversation-events.d.ts +1 -1
  58. package/dist/chat/tools/types.d.ts +1 -1
  59. package/dist/chat/tools/watch-resource-events.d.ts +2 -2
  60. package/dist/{chunk-2EPYYVJC.js → chunk-4HA36IWS.js} +9 -94
  61. package/dist/{chunk-WVIA7V3M.js → chunk-4K25ODAO.js} +27 -1
  62. package/dist/{chunk-V64JCZUV.js → chunk-4S47VHJR.js} +3 -3
  63. package/dist/{chunk-QZV76CM4.js → chunk-6DOAUXLD.js} +231 -198
  64. package/dist/{chunk-M3QYTBQ6.js → chunk-6Q7YZLCL.js} +2 -1
  65. package/dist/{chunk-W46NIB5H.js → chunk-7GAP2XG4.js} +2 -3
  66. package/dist/{chunk-EENQGEIP.js → chunk-7MHNIGHP.js} +1 -1
  67. package/dist/{chunk-AX3UDIMA.js → chunk-ABAX75GG.js} +10 -384
  68. package/dist/{chunk-KTXOGLNE.js → chunk-ATUWN6Z3.js} +2 -2
  69. package/dist/{chunk-3HJ4F4L7.js → chunk-C6TS47CQ.js} +4 -4
  70. package/dist/chunk-D4YV5TDV.js +45 -0
  71. package/dist/{chunk-HUK5XIZL.js → chunk-D63IUQQE.js} +4 -4
  72. package/dist/{chunk-WOKJRLM2.js → chunk-DAPC2HTM.js} +24 -6
  73. package/dist/{chunk-2ADFGSUS.js → chunk-EIJCPJOY.js} +1 -1
  74. package/dist/{chunk-X52ESOBP.js → chunk-EJYP3NQ4.js} +4 -4
  75. package/dist/{chunk-35PM4YY5.js → chunk-EWEH2PJW.js} +6 -6
  76. package/dist/{chunk-W5JMPEBO.js → chunk-FFHXG2FX.js} +13 -11
  77. package/dist/{chunk-FJMTMGBC.js → chunk-FTVMXDNN.js} +1 -1
  78. package/dist/chunk-GFBR4S3Q.js +406 -0
  79. package/dist/{chunk-E3OBGRHN.js → chunk-GJTIZQGJ.js} +1 -1
  80. package/dist/{chunk-IO6KFXYE.js → chunk-HJPC32TQ.js} +12 -50
  81. package/dist/{chunk-RF6J3DIO.js → chunk-INQHUE72.js} +84 -1
  82. package/dist/{chunk-LMNMMESF.js → chunk-LRI5IRGY.js} +19 -44
  83. package/dist/{chunk-6UXDTPEN.js → chunk-LVK4WJKM.js} +1 -1
  84. package/dist/{chunk-AYW7J6K4.js → chunk-MWOH6CIK.js} +178 -148
  85. package/dist/{chunk-LZBPGX5A.js → chunk-OMQ2J6F6.js} +1 -1
  86. package/dist/{chunk-G2B2XZQW.js → chunk-PNYJOEVV.js} +1 -1
  87. package/dist/{chunk-37IQ6DGU.js → chunk-QCT4226Q.js} +3 -3
  88. package/dist/{chunk-R767Y7QV.js → chunk-QZKHHG3B.js} +34 -8
  89. package/dist/{chunk-VOV3SCM3.js → chunk-TVVAMOLS.js} +2 -2
  90. package/dist/{chunk-56XONJPF.js → chunk-U4CTAVWN.js} +1 -1
  91. package/dist/{chunk-4WGFWHWP.js → chunk-UUULGCKK.js} +1 -1
  92. package/dist/{chunk-AHMWPFIW.js → chunk-VH4IU3UC.js} +928 -984
  93. package/dist/chunk-W7GCLNIV.js +58 -0
  94. package/dist/{chunk-24OJZ5OU.js → chunk-WLKWN4CD.js} +22 -12
  95. package/dist/{chunk-T5MTGX2E.js → chunk-X2SS6BF7.js} +201 -210
  96. package/dist/{chunk-SQHFVIMZ.js → chunk-X7NCJQAA.js} +1 -1
  97. package/dist/{chunk-PLZT45VC.js → chunk-Y5G23T2D.js} +5 -5
  98. package/dist/{chunk-3L7CWDQQ.js → chunk-ZIF2S464.js} +1 -1
  99. package/dist/{chunk-QI5JW5AG.js → chunk-ZKKGFUWM.js} +6 -6
  100. package/dist/cli/chat.js +35 -33
  101. package/dist/cli/check.js +5 -5
  102. package/dist/cli/plugins.js +14 -12
  103. package/dist/cli/snapshot-create.js +10 -9
  104. package/dist/cli/upgrade.js +7 -6
  105. package/dist/{db-K2VMNLHQ.js → db-TRJ77FAU.js} +8 -6
  106. package/dist/instrumentation.js +3 -3
  107. package/dist/nitro.js +7 -6
  108. package/dist/{oauth-callback-server-DZZMTKSS.js → oauth-callback-server-XD5SV3MS.js} +30 -27
  109. package/dist/{runner-IIAKWDXI.js → runner-KFX7NG6D.js} +24 -19
  110. package/dist/{skills-EXIQ7BP5.js → skills-J2AH26CW.js} +5 -5
  111. package/dist/spawn-VU3CSRI6.js +41 -0
  112. package/dist/task-runner-5JG3VIIY.js +34 -0
  113. package/dist/{validation-XUGIWBJF.js → validation-O5J4VOPF.js} +5 -5
  114. package/dist/version.js +1 -1
  115. package/dist/{work-G4RLJ634.js → work-ECPQTG3U.js} +24 -19
  116. package/dist/worker-RS3DXUDO.js +24 -0
  117. package/package.json +5 -6
  118. package/dist/app-adapter.d.ts +0 -85
  119. package/dist/chat/api-turns/adapter-conversations.d.ts +0 -15
  120. package/dist/spawn-ZR6OOEAN.js +0 -37
  121. package/dist/task-runner-C52HYCVD.js +0 -32
  122. package/dist/worker-R2JEHK67.js +0 -22
@@ -1,3 +1,7 @@
1
+ import {
2
+ isExperimentalFeatureEnabled
3
+ } from "./chunk-2LYHWMR4.js";
4
+
1
5
  // src/chat/agent/types.ts
2
6
  var RetryableDeliveryError = class extends Error {
3
7
  constructor(cause) {
@@ -124,11 +128,90 @@ function surfaceFromRun(run) {
124
128
  return "internal";
125
129
  }
126
130
 
131
+ // src/chat/runtime/agent-runner.ts
132
+ var AGENT_ABORT_SETTLE_GRACE_MS = 5e3;
133
+ function createAgentRunner(execute, options) {
134
+ const attachmentStorage = options?.attachmentStorage;
135
+ const streamFn = options?.streamFn;
136
+ const tracePropagation = options?.tracePropagation;
137
+ const bindSpawnAgent = options?.bindSpawnAgent;
138
+ const canBindSpawn = Boolean(bindSpawnAgent) && isExperimentalFeatureEnabled("subagents");
139
+ return {
140
+ run: async (run) => {
141
+ const spawnAgent = bindSpawnAgent && canBindSpawn && !isAgentRunFeatureDisabled(run.disabledFeatures, "subagents") ? bindSpawnAgent(run) : void 0;
142
+ const nextRun = {
143
+ ...run,
144
+ environment: {
145
+ ...run.environment,
146
+ attachmentStorage: run.environment?.attachmentStorage ?? attachmentStorage,
147
+ sandboxTracePropagation: run.environment?.sandboxTracePropagation ?? tracePropagation
148
+ },
149
+ ...spawnAgent ? {
150
+ durability: {
151
+ ...run.durability,
152
+ spawnAgent
153
+ }
154
+ } : void 0
155
+ };
156
+ return await execute(nextRun, streamFn);
157
+ }
158
+ };
159
+ }
160
+ async function waitForAgentSettlement(runPromise) {
161
+ let timeoutId;
162
+ const settleGrace = new Promise((resolve) => {
163
+ timeoutId = setTimeout(resolve, AGENT_ABORT_SETTLE_GRACE_MS);
164
+ timeoutId.unref?.();
165
+ });
166
+ await Promise.race([
167
+ runPromise.then(
168
+ () => void 0,
169
+ () => void 0
170
+ ),
171
+ settleGrace
172
+ ]);
173
+ if (timeoutId) {
174
+ clearTimeout(timeoutId);
175
+ }
176
+ }
177
+ async function runAgentWithTimeout(agentRunner, run, timeoutMs) {
178
+ if (typeof timeoutMs !== "number") {
179
+ return await agentRunner.run(run);
180
+ }
181
+ const timeoutError = new Error(
182
+ `executeAgentRun timed out after ${timeoutMs}ms`
183
+ );
184
+ const abortController = new AbortController();
185
+ const signal = run.signal ? AbortSignal.any([run.signal, abortController.signal]) : abortController.signal;
186
+ const runPromise = agentRunner.run({ ...run, signal });
187
+ let timeoutId;
188
+ const timeoutPromise = new Promise((_, reject) => {
189
+ timeoutId = setTimeout(() => {
190
+ abortController.abort(timeoutError);
191
+ reject(timeoutError);
192
+ }, timeoutMs);
193
+ });
194
+ try {
195
+ return await Promise.race([runPromise, timeoutPromise]);
196
+ } catch (error) {
197
+ if (abortController.signal.aborted) {
198
+ await waitForAgentSettlement(runPromise);
199
+ }
200
+ throw error;
201
+ } finally {
202
+ if (timeoutId) {
203
+ clearTimeout(timeoutId);
204
+ }
205
+ }
206
+ }
207
+
127
208
  export {
128
209
  RetryableDeliveryError,
129
210
  isAgentRunFeatureDisabled,
130
211
  actorFromRun,
131
212
  assertRunConsistency,
132
213
  toolInvocationDestination,
133
- surfaceFromRun
214
+ surfaceFromRun,
215
+ createAgentRunner,
216
+ runAgentWithTimeout
134
217
  };
@@ -1,9 +1,13 @@
1
+ import {
2
+ modelProfileSchema,
3
+ parseTurnReasoningLevel
4
+ } from "./chunk-D4YV5TDV.js";
1
5
  import {
2
6
  getCurrentConversationPrivacy,
3
7
  toCanonicalInputMessage,
4
8
  toCanonicalOutputMessage,
5
9
  toGenAiMessagesTraceAttributes
6
- } from "./chunk-2ADFGSUS.js";
10
+ } from "./chunk-EIJCPJOY.js";
7
11
  import {
8
12
  extractGenAiUsageAttributes,
9
13
  logException,
@@ -11,7 +15,7 @@ import {
11
15
  normalizeGenAiFinishReason,
12
16
  serializeGenAiAttribute,
13
17
  withSpan
14
- } from "./chunk-LZBPGX5A.js";
18
+ } from "./chunk-OMQ2J6F6.js";
15
19
 
16
20
  // src/chat/services/provider-error.ts
17
21
  var ProviderError = class extends Error {
@@ -72,6 +76,15 @@ var RETRYABLE_KINDS = /* @__PURE__ */ new Set([
72
76
  function providerMessage(error) {
73
77
  return (error instanceof Error ? error.message : String(error)).trim();
74
78
  }
79
+ var PROVIDER_ERROR_SUMMARY_MAX_CHARS = 240;
80
+ function summarizeProviderErrorMessage(message) {
81
+ const normalized = message.trim().replace(/\s+/g, " ");
82
+ if (!normalized) return void 0;
83
+ const jsonStart = normalized.indexOf("{");
84
+ const summary = (jsonStart >= 0 ? normalized.slice(0, jsonStart) : normalized).trim();
85
+ if (!summary) return void 0;
86
+ return summary.length > PROVIDER_ERROR_SUMMARY_MAX_CHARS ? `${summary.slice(0, PROVIDER_ERROR_SUMMARY_MAX_CHARS)}...` : summary;
87
+ }
75
88
  function extractTransportKind(error, depth = 0) {
76
89
  if (!(error instanceof Error) || depth > 4) return void 0;
77
90
  const providerError = error;
@@ -186,11 +199,15 @@ function getProviderErrorUserMessage(error) {
186
199
  }
187
200
  }
188
201
  function getProviderErrorAttributes(error) {
202
+ const cause = error.cause;
203
+ const causeMessage = cause instanceof Error ? cause.message : typeof cause === "string" ? cause : void 0;
204
+ const summary = causeMessage ? summarizeProviderErrorMessage(causeMessage) : void 0;
189
205
  return {
190
206
  "app.ai.provider_error.kind": error.kind,
191
207
  "app.ai.provider_error.retryable": error.retryable,
192
208
  ...error.status !== void 0 ? { "app.ai.provider_error.status": error.status } : void 0,
193
209
  ...error.retryAfterMs !== void 0 ? { "app.ai.provider_error.retry_after_ms": error.retryAfterMs } : void 0,
210
+ ...summary ? { "app.ai.provider_error.summary": summary } : void 0,
194
211
  ...error.modelId ? { "gen_ai.request.model": error.modelId } : void 0
195
212
  };
196
213
  }
@@ -653,42 +670,6 @@ function normalizeSlackEmojiName(value) {
653
670
  return SLACK_EMOJI_NAME_RE.test(normalized) ? normalized : null;
654
671
  }
655
672
 
656
- // src/chat/reasoning-level.ts
657
- import { z } from "zod";
658
- var TURN_REASONING_LEVELS = [
659
- "none",
660
- "low",
661
- "medium",
662
- "high",
663
- "xhigh"
664
- ];
665
- function parseTurnReasoningLevel(value) {
666
- return z.enum(TURN_REASONING_LEVELS).parse(value);
667
- }
668
-
669
- // src/chat/model-profile.ts
670
- import { z as z2 } from "zod";
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 defaultModelId(config) {
682
- return modelIdForProfile(config, config.defaultProfile);
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
- }
691
-
692
673
  // src/chat/config.ts
693
674
  var MIN_AGENT_TURN_TIMEOUT_MS = 10 * 1e3;
694
675
  var DEFAULT_AGENT_TURN_TIMEOUT_MS = 12 * 60 * 1e3;
@@ -1104,12 +1085,6 @@ export {
1104
1085
  completeObject,
1105
1086
  embedTexts,
1106
1087
  normalizeSlackEmojiName,
1107
- TURN_REASONING_LEVELS,
1108
- modelProfileSchema,
1109
- ModelProfileNotConfiguredError,
1110
- modelIdForProfile,
1111
- defaultModelId,
1112
- profileConfig,
1113
1088
  DEFAULT_SQL_STATEMENT_TIMEOUT_MS,
1114
1089
  FUNCTION_TIMEOUT_BUFFER_SECONDS,
1115
1090
  configureFunctionMaxDurationSeconds,
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-VFUK3X5B.js";
5
5
  import {
6
6
  DEFAULT_SQL_STATEMENT_TIMEOUT_MS
7
- } from "./chunk-LMNMMESF.js";
7
+ } from "./chunk-LRI5IRGY.js";
8
8
 
9
9
  // src/db/neon.ts
10
10
  import { AsyncLocalStorage } from "async_hooks";