@sentry/junior 0.184.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.
- package/dist/{agent-hooks-XTZVALGQ.js → agent-hooks-NGZQLL5O.js} +13 -11
- package/dist/api/acp/schema.d.ts +20 -2
- package/dist/api/code/overview.d.ts +39 -0
- package/dist/api/locations/detail.d.ts +1 -1
- package/dist/api/people/code.d.ts +22 -0
- package/dist/api/schema/code.d.ts +46 -0
- package/dist/api/schema/conversation.d.ts +100 -20
- package/dist/api/schema/location.d.ts +1 -1
- package/dist/api/schema/person.d.ts +1 -1
- package/dist/api/schema.d.ts +4 -4
- package/dist/api/schema.js +12 -1
- package/dist/api.js +358 -76
- package/dist/app.js +406 -377
- package/dist/{catalog-runtime-5357XR4F.js → catalog-runtime-AAEAO2RL.js} +4 -4
- package/dist/chat/api-turns/accepted-reply.d.ts +11 -0
- package/dist/chat/api-turns/cancellation.d.ts +3 -5
- package/dist/chat/api-turns/work.d.ts +4 -9
- package/dist/chat/app/conversation-work.d.ts +1 -1
- package/dist/chat/app/factory.d.ts +4 -0
- package/dist/chat/app/services.d.ts +4 -3
- package/dist/chat/conversations/history.d.ts +83 -9
- package/dist/chat/conversations/turn-lifecycle.d.ts +4 -3
- package/dist/chat/providers/slack/input.d.ts +32 -0
- package/dist/chat/{runtime → providers/slack}/processing-reaction.d.ts +6 -8
- package/dist/chat/{runtime/slack-resume.d.ts → providers/slack/resume.d.ts} +16 -19
- package/dist/chat/providers/slack/runtime.d.ts +1 -10
- package/dist/chat/providers/slack/turn.d.ts +11 -24
- package/dist/chat/resource-events/store.d.ts +1 -1
- package/dist/chat/resource-events/tool-support.d.ts +0 -5
- package/dist/chat/runtime/turn-execution.d.ts +7 -2
- package/dist/chat/sandbox/egress/credentials.d.ts +3 -3
- package/dist/chat/sandbox/egress/session.d.ts +5 -6
- package/dist/chat/scheduled-tasks/tool-support.d.ts +5 -5
- package/dist/chat/scheduled-tasks/tools/create.d.ts +2 -2
- package/dist/chat/scheduled-tasks/tools/delete.d.ts +2 -2
- package/dist/chat/scheduled-tasks/tools/list.d.ts +2 -2
- package/dist/chat/scheduled-tasks/tools/run-now.d.ts +2 -2
- package/dist/chat/scheduled-tasks/tools/update.d.ts +2 -2
- package/dist/chat/scheduled-tasks/types.d.ts +1 -1
- package/dist/chat/services/provider-retry.d.ts +2 -0
- package/dist/chat/services/turn-failure-response.d.ts +4 -0
- package/dist/chat/task-execution/paused-turn.d.ts +0 -2
- package/dist/chat/task-execution/state.d.ts +2 -2
- package/dist/chat/task-execution/store.d.ts +1 -1
- package/dist/chat/task-execution/turn-wake.d.ts +12 -0
- package/dist/chat/tool-support/action-review.d.ts +1 -1
- package/dist/chat/tools/resource-events.d.ts +1 -1
- package/dist/chat/tools/search-conversation-events.d.ts +1 -1
- package/dist/chat/tools/types.d.ts +1 -1
- package/dist/chat/tools/watch-resource-events.d.ts +2 -2
- package/dist/{chunk-FKEZZMXS.js → chunk-4HA36IWS.js} +9 -94
- package/dist/{chunk-WVIA7V3M.js → chunk-4K25ODAO.js} +27 -1
- package/dist/{chunk-UF6BUA5W.js → chunk-4S47VHJR.js} +3 -3
- package/dist/{chunk-JNO2GUDS.js → chunk-6DOAUXLD.js} +231 -198
- package/dist/{chunk-M3QYTBQ6.js → chunk-6Q7YZLCL.js} +2 -1
- package/dist/{chunk-6VOYP4M6.js → chunk-7GAP2XG4.js} +1 -1
- package/dist/{chunk-LHXIZLFF.js → chunk-7MHNIGHP.js} +1 -1
- package/dist/{chunk-IZDYYYGP.js → chunk-ABAX75GG.js} +10 -384
- package/dist/{chunk-WQFEWULF.js → chunk-ATUWN6Z3.js} +2 -2
- package/dist/{chunk-4RONS3WR.js → chunk-C6TS47CQ.js} +4 -4
- package/dist/chunk-D4YV5TDV.js +45 -0
- package/dist/{chunk-Z3QAXJR7.js → chunk-D63IUQQE.js} +4 -4
- package/dist/{chunk-M5YWNMTE.js → chunk-DAPC2HTM.js} +24 -6
- package/dist/{chunk-BHYRYYLY.js → chunk-EIJCPJOY.js} +1 -1
- package/dist/{chunk-SHJK75Z2.js → chunk-EJYP3NQ4.js} +4 -4
- package/dist/{chunk-K7VDC2QW.js → chunk-EWEH2PJW.js} +6 -6
- package/dist/{chunk-6WGC3SO4.js → chunk-FFHXG2FX.js} +13 -11
- package/dist/{chunk-MLSQX2EX.js → chunk-FTVMXDNN.js} +1 -1
- package/dist/chunk-GFBR4S3Q.js +406 -0
- package/dist/{chunk-PJPRXO2T.js → chunk-GJTIZQGJ.js} +1 -1
- package/dist/{chunk-BT53RIGJ.js → chunk-HJPC32TQ.js} +12 -50
- package/dist/{chunk-RF6J3DIO.js → chunk-INQHUE72.js} +84 -1
- package/dist/{chunk-6UDPINOX.js → chunk-LRI5IRGY.js} +19 -44
- package/dist/{chunk-BCHYQS4B.js → chunk-LVK4WJKM.js} +1 -1
- package/dist/{chunk-UBOIHNTH.js → chunk-MWOH6CIK.js} +178 -148
- package/dist/{chunk-3S7ULUWW.js → chunk-OMQ2J6F6.js} +1 -1
- package/dist/{chunk-DUKIDPF6.js → chunk-PNYJOEVV.js} +1 -1
- package/dist/{chunk-MAPJFUMV.js → chunk-QCT4226Q.js} +3 -3
- package/dist/{chunk-HIPUIPJM.js → chunk-QZKHHG3B.js} +34 -8
- package/dist/{chunk-QABCY33S.js → chunk-TVVAMOLS.js} +2 -2
- package/dist/{chunk-JA43DV4Y.js → chunk-U4CTAVWN.js} +1 -1
- package/dist/{chunk-LCP4EDKR.js → chunk-UUULGCKK.js} +1 -1
- package/dist/{chunk-4CNDGK25.js → chunk-VH4IU3UC.js} +928 -984
- package/dist/chunk-W7GCLNIV.js +58 -0
- package/dist/{chunk-2ZQPVX7C.js → chunk-WLKWN4CD.js} +22 -12
- package/dist/{chunk-ACPDVEJO.js → chunk-X2SS6BF7.js} +198 -209
- package/dist/{chunk-YKX6MTLU.js → chunk-X7NCJQAA.js} +1 -1
- package/dist/{chunk-E57WPXWY.js → chunk-Y5G23T2D.js} +5 -5
- package/dist/{chunk-HUXFMDBZ.js → chunk-ZIF2S464.js} +1 -1
- package/dist/{chunk-JM2COLGC.js → chunk-ZKKGFUWM.js} +6 -6
- package/dist/cli/chat.js +35 -33
- package/dist/cli/check.js +5 -5
- package/dist/cli/plugins.js +14 -12
- package/dist/cli/snapshot-create.js +10 -9
- package/dist/cli/upgrade.js +7 -6
- package/dist/{db-MA52H62H.js → db-TRJ77FAU.js} +8 -6
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +7 -6
- package/dist/{oauth-callback-server-DXGHKN6S.js → oauth-callback-server-XD5SV3MS.js} +30 -27
- package/dist/{runner-4IXUAQNK.js → runner-KFX7NG6D.js} +24 -19
- package/dist/{skills-X3DY7AXO.js → skills-J2AH26CW.js} +5 -5
- package/dist/spawn-VU3CSRI6.js +41 -0
- package/dist/task-runner-5JG3VIIY.js +34 -0
- package/dist/{validation-Z6JXSTJS.js → validation-O5J4VOPF.js} +5 -5
- package/dist/version.js +1 -1
- package/dist/{work-OKWRFBDW.js → work-ECPQTG3U.js} +24 -19
- package/dist/worker-RS3DXUDO.js +24 -0
- package/package.json +4 -4
- package/dist/spawn-43WGS6CH.js +0 -37
- package/dist/task-runner-VDRKITPV.js +0 -32
- package/dist/worker-B236AE72.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-
|
|
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-
|
|
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,
|