@sentry/junior 0.113.0 → 0.115.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-BKEMWR3Z.js → agent-hooks-4EUUXP2F.js} +12 -11
- package/dist/api/conversations/detail.d.ts +26 -0
- package/dist/api/conversations/event-list.d.ts +26 -0
- package/dist/api/conversations/events.d.ts +1 -1
- package/dist/api/health.d.ts +7 -0
- package/dist/api/plugin-reports.d.ts +62 -0
- package/dist/api/plugins.d.ts +9 -0
- package/dist/api/runtime.d.ts +24 -0
- package/dist/api/schema/conversation.d.ts +104 -0
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +6 -6
- package/dist/api/skills.d.ts +6 -0
- package/dist/api.js +140 -100
- package/dist/app.d.ts +2 -0
- package/dist/app.js +1117 -5010
- package/dist/catalog-runtime-Y32UEQLB.js +18 -0
- package/dist/chat/agent/request.d.ts +6 -0
- package/dist/chat/agent/sandbox.d.ts +2 -0
- package/dist/chat/agent/tools.d.ts +2 -0
- package/dist/chat/config.d.ts +3 -1
- package/dist/chat/conversations/history.d.ts +92 -0
- package/dist/chat/conversations/projection.d.ts +20 -1
- package/dist/chat/local/credential-sync.d.ts +5 -0
- package/dist/chat/local/oauth-relay.d.ts +4 -0
- package/dist/chat/mcp/oauth.d.ts +1 -0
- package/dist/chat/oauth-authorization.d.ts +17 -0
- package/dist/chat/oauth-flow.d.ts +9 -0
- package/dist/chat/sandbox/egress/schemas.d.ts +46 -0
- package/dist/chat/sandbox/egress/signals.d.ts +9 -0
- package/dist/chat/sandbox/sandbox.d.ts +2 -0
- package/dist/chat/sentry-payload-filter.d.ts +4 -4
- package/dist/chat/services/context-budget.d.ts +7 -2
- package/dist/chat/services/context-compaction.d.ts +28 -1
- package/dist/chat/services/conversation-memory.d.ts +1 -0
- package/dist/chat/services/mcp-auth-orchestration.d.ts +5 -3
- package/dist/chat/services/plugin-auth-orchestration.d.ts +2 -0
- package/dist/chat/services/provider-error.d.ts +1 -0
- package/dist/chat/services/turn-router.d.ts +1 -0
- package/dist/chat/slack/message-control.d.ts +2 -0
- package/dist/chat/slack/oauth-authorization-message.d.ts +3 -0
- package/dist/chat/task-execution/slack-work.d.ts +2 -0
- package/dist/chat/tool-support/zod-tool.d.ts +1 -1
- package/dist/chat/tools/definition.d.ts +5 -0
- package/dist/chat/tools/sandbox/edit-file.d.ts +1 -1
- package/dist/chat/tools/sandbox/text-edits.d.ts +1 -0
- package/dist/{chunk-4WZ7YKDF.js → chunk-2QG4MZQ7.js} +2 -2
- package/dist/{chunk-H5ON7XTE.js → chunk-43RYMWJ2.js} +954 -2514
- package/dist/chunk-4CODA7P5.js +43 -0
- package/dist/{chunk-HMRVILWZ.js → chunk-67CVNDJ7.js} +1 -1
- package/dist/{chunk-LR2SKL5Y.js → chunk-6FKLPVF3.js} +1 -1
- package/dist/{chunk-2ZTTXTSZ.js → chunk-6OPTF4BQ.js} +10 -4
- package/dist/{chunk-3CTIAKSS.js → chunk-6V762AB4.js} +1 -1
- package/dist/{chunk-WBB22ANL.js → chunk-AGLQYELI.js} +77 -8
- package/dist/{chunk-DXRPHBOU.js → chunk-CEYOL62C.js} +77 -36
- package/dist/{chunk-QTS66GMR.js → chunk-CWEZEPD4.js} +3 -3
- package/dist/chunk-DIB4GX3G.js +8 -0
- package/dist/{chunk-OXE5ZUTS.js → chunk-EW5MLKT5.js} +10 -75
- package/dist/{chunk-42WRQLJ6.js → chunk-F3B2YJ76.js} +0 -14
- package/dist/chunk-FA6POGLH.js +70 -0
- package/dist/{chunk-ZRSUCJGA.js → chunk-FHC4JUSF.js} +1 -1
- package/dist/{chunk-6Y5L4BOM.js → chunk-FXOYURO4.js} +5 -3
- package/dist/{chunk-UKGNSJQQ.js → chunk-G36V2YGB.js} +108 -82
- package/dist/{chunk-K5BXPM74.js → chunk-G5SX4UPR.js} +3 -43
- package/dist/chunk-HDSDCEPK.js +80 -0
- package/dist/{chunk-LLKDNPYV.js → chunk-HWCQRGLL.js} +37 -3
- package/dist/{chunk-C4MZ3GP5.js → chunk-HZF5P5UN.js} +1 -1
- package/dist/chunk-LYA2AB5G.js +1914 -0
- package/dist/{chunk-36UJA3OD.js → chunk-NVUQSFWX.js} +2 -2
- package/dist/chunk-OB42YVAE.js +16 -0
- package/dist/{chunk-4VKFQPCW.js → chunk-PVZHG2XZ.js} +4 -4
- package/dist/{chunk-YJ44UT7D.js → chunk-RAVKCKXA.js} +7 -7
- package/dist/{chunk-RCBUZGIT.js → chunk-SYJT7AKB.js} +23 -20
- package/dist/{chunk-NP7TYFYR.js → chunk-TVE25LPW.js} +1 -1
- package/dist/chunk-W3U3YQYI.js +71 -0
- package/dist/chunk-YCLO7D7M.js +4267 -0
- package/dist/cli/chat.js +72 -40
- package/dist/cli/check.js +10 -8
- package/dist/cli/init.js +1 -0
- package/dist/cli/plugins.js +16 -14
- package/dist/cli/snapshot-warmup.js +13 -11
- package/dist/cli/upgrade.js +10 -8
- package/dist/{db-2ASK6MV6.js → db-KBSJHAZU.js} +8 -7
- package/dist/handlers/sandbox-egress-signals.d.ts +4 -0
- package/dist/instrumentation.js +72 -4
- package/dist/nitro.js +2 -2
- package/dist/oauth-callback-server-EYRMJTCS.js +231 -0
- package/dist/oauth-relay-3ZU72UGL.js +9 -0
- package/dist/reporting-schema.d.ts +12 -4
- package/dist/reporting.d.ts +5 -5
- package/dist/{runner-L363K62Z.js → runner-RQGZ5Z2S.js} +139 -72
- package/dist/sandbox-egress-signals-CDFAP67O.js +75 -0
- package/dist/{skills-VCPG3NOO.js → skills-JJQIE3BT.js} +10 -8
- package/dist/validation-MZ47PZP5.js +21 -0
- package/dist/version.js +1 -1
- package/package.json +5 -5
- package/dist/catalog-runtime-6XYOUVRZ.js +0 -16
- package/dist/chat/oauth-authorization-message.d.ts +0 -6
- package/dist/validation-GY7AJBLC.js +0 -19
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toOptionalString
|
|
3
|
+
} from "./chunk-OB42YVAE.js";
|
|
1
4
|
import {
|
|
2
5
|
parseSlackChannelId,
|
|
3
6
|
parseSlackMessageTs,
|
|
4
|
-
parseSlackTeamId
|
|
5
|
-
|
|
6
|
-
} from "./chunk-42WRQLJ6.js";
|
|
7
|
+
parseSlackTeamId
|
|
8
|
+
} from "./chunk-F3B2YJ76.js";
|
|
7
9
|
|
|
8
10
|
// src/chat/conversation-privacy.ts
|
|
9
11
|
import { AsyncLocalStorage } from "async_hooks";
|
|
@@ -5,9 +5,37 @@ import {
|
|
|
5
5
|
juniorDestinationKindSchema
|
|
6
6
|
} from "./chunk-VFUK3X5B.js";
|
|
7
7
|
|
|
8
|
-
// src/api/
|
|
8
|
+
// src/api/activity.ts
|
|
9
9
|
import { z } from "zod";
|
|
10
|
-
var
|
|
10
|
+
var dailyConversationActivitySchema = z.object({
|
|
11
|
+
active: z.number(),
|
|
12
|
+
conversations: z.number(),
|
|
13
|
+
date: z.string(),
|
|
14
|
+
durationMs: z.number(),
|
|
15
|
+
failed: z.number(),
|
|
16
|
+
tokens: z.number().optional()
|
|
17
|
+
}).strict();
|
|
18
|
+
function emptyActivityDay(date) {
|
|
19
|
+
return {
|
|
20
|
+
active: 0,
|
|
21
|
+
conversations: 0,
|
|
22
|
+
date,
|
|
23
|
+
durationMs: 0,
|
|
24
|
+
failed: 0
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function activityDays(days, nowMs, count) {
|
|
28
|
+
const items = [];
|
|
29
|
+
const end = new Date(nowMs);
|
|
30
|
+
end.setUTCHours(0, 0, 0, 0);
|
|
31
|
+
const start = new Date(end);
|
|
32
|
+
start.setUTCDate(start.getUTCDate() - (count - 1));
|
|
33
|
+
for (const cursor = new Date(start); cursor.getTime() <= end.getTime(); cursor.setUTCDate(cursor.getUTCDate() + 1)) {
|
|
34
|
+
const date = cursor.toISOString().slice(0, 10);
|
|
35
|
+
items.push(days.get(date) ?? emptyActivityDay(date));
|
|
36
|
+
}
|
|
37
|
+
return items;
|
|
38
|
+
}
|
|
11
39
|
|
|
12
40
|
// src/api/schema/conversation.ts
|
|
13
41
|
import { z as z2 } from "zod";
|
|
@@ -117,13 +145,38 @@ var conversationReportTurnLifecycleEventDataSchema = z2.discriminatedUnion(
|
|
|
117
145
|
}).strict()
|
|
118
146
|
]
|
|
119
147
|
);
|
|
120
|
-
var
|
|
148
|
+
var conversationReportTurnRoutedEventDataSchema = z2.object({
|
|
149
|
+
type: z2.literal("turn_routed"),
|
|
150
|
+
turnId: z2.string().min(1),
|
|
151
|
+
modelProfile: z2.string().min(1),
|
|
152
|
+
modelId: z2.string().min(1),
|
|
153
|
+
reasoningLevel: z2.string().min(1),
|
|
154
|
+
confidence: z2.number().min(0).max(1).optional(),
|
|
155
|
+
source: z2.enum(["configured", "inherited", "router"])
|
|
156
|
+
}).strict();
|
|
157
|
+
var conversationReportCompactionEventDataSchema = z2.object({
|
|
158
|
+
type: z2.literal("compaction"),
|
|
159
|
+
modelProfile: z2.string().min(1).optional(),
|
|
160
|
+
modelId: z2.string().min(1).optional(),
|
|
161
|
+
summary: z2.string().min(1).optional(),
|
|
162
|
+
details: z2.object({
|
|
163
|
+
reason: z2.literal("capacity"),
|
|
164
|
+
estimatedInputTokens: z2.number().int().nonnegative(),
|
|
165
|
+
replacementInputTokens: z2.number().int().nonnegative().optional(),
|
|
166
|
+
triggerTokens: z2.number().int().nonnegative(),
|
|
167
|
+
inputLimitTokens: z2.number().int().positive(),
|
|
168
|
+
inputMessageCount: z2.number().int().nonnegative(),
|
|
169
|
+
retainedMessageCount: z2.number().int().nonnegative(),
|
|
170
|
+
summaryChars: z2.number().int().nonnegative()
|
|
171
|
+
}).strict().optional()
|
|
172
|
+
}).strict();
|
|
121
173
|
var conversationReportHandoffEventDataSchema = z2.object({
|
|
122
174
|
type: z2.literal("handoff"),
|
|
123
175
|
modelProfile: z2.string().min(1),
|
|
124
176
|
modelId: z2.string().min(1),
|
|
125
177
|
reasoningLevel: z2.string().min(1).optional(),
|
|
126
|
-
triggeringToolCallId: z2.string().min(1).optional()
|
|
178
|
+
triggeringToolCallId: z2.string().min(1).optional(),
|
|
179
|
+
summary: z2.string().min(1).optional()
|
|
127
180
|
}).strict();
|
|
128
181
|
var conversationReportSubagentEventDataSchema = z2.object({
|
|
129
182
|
type: z2.literal("subagent"),
|
|
@@ -139,6 +192,7 @@ var conversationReportEventDataSchema = z2.discriminatedUnion("type", [
|
|
|
139
192
|
conversationReportMessageHandledEventDataSchema,
|
|
140
193
|
conversationReportToolCallsEventDataSchema,
|
|
141
194
|
conversationReportTurnLifecycleEventDataSchema,
|
|
195
|
+
conversationReportTurnRoutedEventDataSchema,
|
|
142
196
|
conversationReportCompactionEventDataSchema,
|
|
143
197
|
conversationReportHandoffEventDataSchema,
|
|
144
198
|
conversationReportSubagentEventDataSchema
|
|
@@ -258,37 +312,58 @@ var conversationStatsReportSchema = z2.object({
|
|
|
258
312
|
windowStart: z2.string()
|
|
259
313
|
}).strict();
|
|
260
314
|
|
|
261
|
-
// src/api/
|
|
315
|
+
// src/api/schema/person.ts
|
|
262
316
|
import { z as z3 } from "zod";
|
|
263
|
-
var
|
|
317
|
+
var personParamsSchema = z3.object({ email: z3.string().trim().min(1) }).strict();
|
|
318
|
+
var peopleConversationStatsItemSchema = conversationStatsItemSchema.omit({ costUsd: true });
|
|
319
|
+
var actorActivityDayReportSchema = z3.object({
|
|
264
320
|
active: z3.number(),
|
|
265
321
|
conversations: z3.number(),
|
|
322
|
+
costUsd: z3.number().optional(),
|
|
266
323
|
date: z3.string(),
|
|
267
324
|
durationMs: z3.number(),
|
|
268
325
|
failed: z3.number(),
|
|
269
326
|
tokens: z3.number().optional()
|
|
270
327
|
}).strict();
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
328
|
+
var peopleActivityDayReportSchema = z3.object({
|
|
329
|
+
activePeople: z3.number(),
|
|
330
|
+
conversations: z3.number(),
|
|
331
|
+
date: z3.string()
|
|
332
|
+
}).strict();
|
|
333
|
+
var actorTotalsReportSchema = z3.object({
|
|
334
|
+
active: z3.number(),
|
|
335
|
+
activeDays: z3.number(),
|
|
336
|
+
conversations: z3.number(),
|
|
337
|
+
durationMs: z3.number(),
|
|
338
|
+
failed: z3.number(),
|
|
339
|
+
tokens: z3.number().optional()
|
|
340
|
+
}).strict();
|
|
341
|
+
var identifiedActorSchema = actorIdentitySchema.extend({ email: z3.string().min(1) }).strict();
|
|
342
|
+
var actorSummaryReportSchema = actorTotalsReportSchema.extend({
|
|
343
|
+
firstSeenAt: z3.string(),
|
|
344
|
+
lastSeenAt: z3.string(),
|
|
345
|
+
actor: identifiedActorSchema
|
|
346
|
+
}).strict();
|
|
347
|
+
var actorDirectoryReportSchema = z3.object({
|
|
348
|
+
activityDays: z3.array(peopleActivityDayReportSchema),
|
|
349
|
+
generatedAt: z3.string(),
|
|
350
|
+
people: z3.array(actorSummaryReportSchema),
|
|
351
|
+
source: z3.literal("conversation_index"),
|
|
352
|
+
windowEnd: z3.string(),
|
|
353
|
+
windowStart: z3.string()
|
|
354
|
+
}).strict();
|
|
355
|
+
var actorProfileReportSchema = z3.object({
|
|
356
|
+
activityDays: z3.array(actorActivityDayReportSchema),
|
|
357
|
+
generatedAt: z3.string(),
|
|
358
|
+
locations: z3.array(peopleConversationStatsItemSchema),
|
|
359
|
+
recentConversations: z3.array(conversationSummaryReportSchema),
|
|
360
|
+
actor: identifiedActorSchema,
|
|
361
|
+
source: z3.literal("conversation_index"),
|
|
362
|
+
surfaces: z3.array(peopleConversationStatsItemSchema),
|
|
363
|
+
totals: actorTotalsReportSchema,
|
|
364
|
+
windowEnd: z3.string(),
|
|
365
|
+
windowStart: z3.string()
|
|
366
|
+
}).strict();
|
|
292
367
|
|
|
293
368
|
// src/api/schema/location.ts
|
|
294
369
|
import { z as z4 } from "zod";
|
|
@@ -327,58 +402,9 @@ var locationDetailReportSchema = locationSummaryReportSchema.extend({
|
|
|
327
402
|
windowStart: z4.string()
|
|
328
403
|
}).strict();
|
|
329
404
|
|
|
330
|
-
// src/api/schema/
|
|
405
|
+
// src/api/schema/common.ts
|
|
331
406
|
import { z as z5 } from "zod";
|
|
332
|
-
var
|
|
333
|
-
var peopleConversationStatsItemSchema = conversationStatsItemSchema.omit({ costUsd: true });
|
|
334
|
-
var actorActivityDayReportSchema = z5.object({
|
|
335
|
-
active: z5.number(),
|
|
336
|
-
conversations: z5.number(),
|
|
337
|
-
costUsd: z5.number().optional(),
|
|
338
|
-
date: z5.string(),
|
|
339
|
-
durationMs: z5.number(),
|
|
340
|
-
failed: z5.number(),
|
|
341
|
-
tokens: z5.number().optional()
|
|
342
|
-
}).strict();
|
|
343
|
-
var peopleActivityDayReportSchema = z5.object({
|
|
344
|
-
activePeople: z5.number(),
|
|
345
|
-
conversations: z5.number(),
|
|
346
|
-
date: z5.string()
|
|
347
|
-
}).strict();
|
|
348
|
-
var actorTotalsReportSchema = z5.object({
|
|
349
|
-
active: z5.number(),
|
|
350
|
-
activeDays: z5.number(),
|
|
351
|
-
conversations: z5.number(),
|
|
352
|
-
durationMs: z5.number(),
|
|
353
|
-
failed: z5.number(),
|
|
354
|
-
tokens: z5.number().optional()
|
|
355
|
-
}).strict();
|
|
356
|
-
var identifiedActorSchema = actorIdentitySchema.extend({ email: z5.string().min(1) }).strict();
|
|
357
|
-
var actorSummaryReportSchema = actorTotalsReportSchema.extend({
|
|
358
|
-
firstSeenAt: z5.string(),
|
|
359
|
-
lastSeenAt: z5.string(),
|
|
360
|
-
actor: identifiedActorSchema
|
|
361
|
-
}).strict();
|
|
362
|
-
var actorDirectoryReportSchema = z5.object({
|
|
363
|
-
activityDays: z5.array(peopleActivityDayReportSchema),
|
|
364
|
-
generatedAt: z5.string(),
|
|
365
|
-
people: z5.array(actorSummaryReportSchema),
|
|
366
|
-
source: z5.literal("conversation_index"),
|
|
367
|
-
windowEnd: z5.string(),
|
|
368
|
-
windowStart: z5.string()
|
|
369
|
-
}).strict();
|
|
370
|
-
var actorProfileReportSchema = z5.object({
|
|
371
|
-
activityDays: z5.array(actorActivityDayReportSchema),
|
|
372
|
-
generatedAt: z5.string(),
|
|
373
|
-
locations: z5.array(peopleConversationStatsItemSchema),
|
|
374
|
-
recentConversations: z5.array(conversationSummaryReportSchema),
|
|
375
|
-
actor: identifiedActorSchema,
|
|
376
|
-
source: z5.literal("conversation_index"),
|
|
377
|
-
surfaces: z5.array(peopleConversationStatsItemSchema),
|
|
378
|
-
totals: actorTotalsReportSchema,
|
|
379
|
-
windowEnd: z5.string(),
|
|
380
|
-
windowStart: z5.string()
|
|
381
|
-
}).strict();
|
|
407
|
+
var apiErrorSchema = z5.object({ error: z5.string().min(1) }).strict();
|
|
382
408
|
|
|
383
409
|
export {
|
|
384
410
|
apiErrorSchema,
|
|
@@ -398,11 +424,11 @@ export {
|
|
|
398
424
|
conversationStatsReportSchema,
|
|
399
425
|
dailyConversationActivitySchema,
|
|
400
426
|
activityDays,
|
|
427
|
+
personParamsSchema,
|
|
428
|
+
actorDirectoryReportSchema,
|
|
429
|
+
actorProfileReportSchema,
|
|
401
430
|
locationParamsSchema,
|
|
402
431
|
locationActivityDayReportSchema,
|
|
403
432
|
locationDirectoryReportSchema,
|
|
404
|
-
locationDetailReportSchema
|
|
405
|
-
personParamsSchema,
|
|
406
|
-
actorDirectoryReportSchema,
|
|
407
|
-
actorProfileReportSchema
|
|
433
|
+
locationDetailReportSchema
|
|
408
434
|
};
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
healthReportSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6OPTF4BQ.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeSlackConversationId
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CWEZEPD4.js";
|
|
7
7
|
import {
|
|
8
8
|
parseSlackThreadId
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
getClient
|
|
12
|
-
} from "./chunk-6GWA276C.js";
|
|
9
|
+
} from "./chunk-FXOYURO4.js";
|
|
13
10
|
|
|
14
11
|
// src/handlers/health.ts
|
|
15
12
|
function readHealthReport() {
|
|
@@ -23,42 +20,6 @@ function GET() {
|
|
|
23
20
|
return Response.json(readHealthReport());
|
|
24
21
|
}
|
|
25
22
|
|
|
26
|
-
// src/chat/sentry-links.ts
|
|
27
|
-
function getSentryOrgSlug() {
|
|
28
|
-
const slug = process.env.SENTRY_ORG_SLUG?.trim();
|
|
29
|
-
return slug || void 0;
|
|
30
|
-
}
|
|
31
|
-
function isSentrySaasDsnHost(host) {
|
|
32
|
-
return host === "sentry.io" || host.endsWith(".sentry.io");
|
|
33
|
-
}
|
|
34
|
-
function buildSentryWebBaseUrl(dsn) {
|
|
35
|
-
if (isSentrySaasDsnHost(dsn.host)) {
|
|
36
|
-
return "https://sentry.io";
|
|
37
|
-
}
|
|
38
|
-
const port = dsn.port ? `:${dsn.port}` : "";
|
|
39
|
-
const path = dsn.path ? `/${dsn.path}` : "";
|
|
40
|
-
return `${dsn.protocol}://${dsn.host}${port}${path}`;
|
|
41
|
-
}
|
|
42
|
-
function buildSentryConversationUrl(conversationId) {
|
|
43
|
-
const client = getClient();
|
|
44
|
-
const dsn = client?.getDsn();
|
|
45
|
-
if (!dsn?.host || !dsn.projectId) {
|
|
46
|
-
return void 0;
|
|
47
|
-
}
|
|
48
|
-
const orgSlug = getSentryOrgSlug();
|
|
49
|
-
if (!orgSlug) {
|
|
50
|
-
return void 0;
|
|
51
|
-
}
|
|
52
|
-
const encodedId = encodeURIComponent(conversationId);
|
|
53
|
-
const params = new URLSearchParams();
|
|
54
|
-
params.set("project", dsn.projectId);
|
|
55
|
-
const path = `explore/conversations/${encodedId}/?${params.toString()}`;
|
|
56
|
-
if (isSentrySaasDsnHost(dsn.host)) {
|
|
57
|
-
return `https://${orgSlug}.sentry.io/${path}`;
|
|
58
|
-
}
|
|
59
|
-
return `${buildSentryWebBaseUrl(dsn)}/organizations/${orgSlug}/${path}`;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
23
|
// src/chat/slack/conversation-context.ts
|
|
63
24
|
function normalizeConversationName(type, channelName) {
|
|
64
25
|
const trimmed = channelName?.trim();
|
|
@@ -144,7 +105,6 @@ function formatSlackConversationRedactedLabel(context) {
|
|
|
144
105
|
export {
|
|
145
106
|
readHealthReport,
|
|
146
107
|
GET,
|
|
147
|
-
buildSentryConversationUrl,
|
|
148
108
|
conversationVisibilityFromSlackChannelType,
|
|
149
109
|
resolveSlackChannelTypeFromMessage,
|
|
150
110
|
resolveSlackConversationContext,
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import {
|
|
2
|
+
credentialContextSchema
|
|
3
|
+
} from "./chunk-W3U3YQYI.js";
|
|
4
|
+
|
|
5
|
+
// src/chat/sandbox/egress/schemas.ts
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import {
|
|
8
|
+
pluginAuthorizationSchema,
|
|
9
|
+
pluginCredentialHeaderTransformSchema,
|
|
10
|
+
pluginGrantSchema,
|
|
11
|
+
pluginProviderAccountSchema
|
|
12
|
+
} from "@sentry/junior-plugin-api";
|
|
13
|
+
var finiteNumberSchema = z.number().refine(Number.isFinite);
|
|
14
|
+
var httpStatusSchema = z.number().int().min(100).max(599);
|
|
15
|
+
var providerNameSchema = z.string().regex(/^[a-z][a-z0-9-]*$/);
|
|
16
|
+
var credentialSignalKindSchema = z.enum(["auth_required", "unavailable"]);
|
|
17
|
+
var sandboxEgressGrantSchema = pluginGrantSchema;
|
|
18
|
+
var sandboxEgressCredentialContextSchema = z.object({
|
|
19
|
+
credentials: credentialContextSchema,
|
|
20
|
+
egressId: z.string().min(1),
|
|
21
|
+
expiresAtMs: finiteNumberSchema,
|
|
22
|
+
contextId: z.string().min(1)
|
|
23
|
+
}).strict();
|
|
24
|
+
var sandboxEgressCredentialLeaseSchema = z.object({
|
|
25
|
+
account: pluginProviderAccountSchema.optional(),
|
|
26
|
+
authorization: pluginAuthorizationSchema.optional(),
|
|
27
|
+
grant: sandboxEgressGrantSchema,
|
|
28
|
+
provider: providerNameSchema,
|
|
29
|
+
expiresAt: z.string().min(1),
|
|
30
|
+
headerTransforms: z.array(pluginCredentialHeaderTransformSchema).min(1)
|
|
31
|
+
}).strict();
|
|
32
|
+
var sandboxEgressAuthRequiredSignalSchema = z.object({
|
|
33
|
+
authorization: pluginAuthorizationSchema.optional(),
|
|
34
|
+
grant: sandboxEgressGrantSchema,
|
|
35
|
+
kind: credentialSignalKindSchema.default("auth_required"),
|
|
36
|
+
provider: providerNameSchema,
|
|
37
|
+
message: z.string().optional(),
|
|
38
|
+
createdAtMs: finiteNumberSchema
|
|
39
|
+
}).strict().superRefine((signal, ctx) => {
|
|
40
|
+
if (signal.authorization && signal.authorization.provider !== signal.provider) {
|
|
41
|
+
ctx.addIssue({
|
|
42
|
+
code: z.ZodIssueCode.custom,
|
|
43
|
+
message: "Auth signal authorization provider must match provider",
|
|
44
|
+
path: ["authorization", "provider"]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
var sandboxEgressPermissionDeniedSignalSchema = z.object({
|
|
49
|
+
account: pluginProviderAccountSchema.optional(),
|
|
50
|
+
acceptedPermissions: z.string().optional(),
|
|
51
|
+
grant: sandboxEgressGrantSchema,
|
|
52
|
+
message: z.string().min(1),
|
|
53
|
+
provider: providerNameSchema,
|
|
54
|
+
source: z.literal("upstream"),
|
|
55
|
+
sso: z.string().optional(),
|
|
56
|
+
status: httpStatusSchema,
|
|
57
|
+
upstreamHost: z.string().min(1),
|
|
58
|
+
upstreamPath: z.string().min(1),
|
|
59
|
+
createdAtMs: finiteNumberSchema
|
|
60
|
+
}).strict();
|
|
61
|
+
var sandboxEgressSignalsResponseSchema = z.object({
|
|
62
|
+
auth_required: sandboxEgressAuthRequiredSignalSchema.optional(),
|
|
63
|
+
permission_denied: sandboxEgressPermissionDeniedSignalSchema.optional()
|
|
64
|
+
}).strict();
|
|
65
|
+
function parseSandboxEgressAuthRequiredSignal(value) {
|
|
66
|
+
const result = sandboxEgressAuthRequiredSignalSchema.safeParse(value);
|
|
67
|
+
return result.success ? result.data : void 0;
|
|
68
|
+
}
|
|
69
|
+
function parseSandboxEgressPermissionDeniedSignal(value) {
|
|
70
|
+
const result = sandboxEgressPermissionDeniedSignalSchema.safeParse(value);
|
|
71
|
+
return result.success ? result.data : void 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export {
|
|
75
|
+
sandboxEgressCredentialContextSchema,
|
|
76
|
+
sandboxEgressCredentialLeaseSchema,
|
|
77
|
+
sandboxEgressSignalsResponseSchema,
|
|
78
|
+
parseSandboxEgressAuthRequiredSignal,
|
|
79
|
+
parseSandboxEgressPermissionDeniedSignal
|
|
80
|
+
};
|
|
@@ -6,19 +6,20 @@ import {
|
|
|
6
6
|
juniorUsers
|
|
7
7
|
} from "./chunk-JQFJO5WH.js";
|
|
8
8
|
import {
|
|
9
|
+
TURN_REASONING_LEVELS,
|
|
9
10
|
getChatConfig,
|
|
10
11
|
modelProfileSchema
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SYJT7AKB.js";
|
|
12
13
|
import {
|
|
13
14
|
juniorDestinations
|
|
14
15
|
} from "./chunk-VFUK3X5B.js";
|
|
15
16
|
import {
|
|
16
17
|
normalizeIdentityEmail
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NVUQSFWX.js";
|
|
18
19
|
import {
|
|
19
20
|
parseSlackChannelReferenceId,
|
|
20
21
|
parseSlackTeamId
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-F3B2YJ76.js";
|
|
22
23
|
|
|
23
24
|
// src/chat/conversations/sql/store.ts
|
|
24
25
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
@@ -809,6 +810,16 @@ var replacementHistoryMessageSchema = conversationMessageDataSchema.extend({
|
|
|
809
810
|
sourceEventSeq: z2.number().int().nonnegative().optional()
|
|
810
811
|
});
|
|
811
812
|
var replacementHistorySchema = z2.array(replacementHistoryMessageSchema);
|
|
813
|
+
var compactionDetailsSchema = z2.object({
|
|
814
|
+
reason: z2.literal("capacity"),
|
|
815
|
+
estimatedInputTokens: z2.number().int().nonnegative(),
|
|
816
|
+
replacementInputTokens: z2.number().int().nonnegative().optional(),
|
|
817
|
+
triggerTokens: z2.number().int().nonnegative(),
|
|
818
|
+
inputLimitTokens: z2.number().int().positive(),
|
|
819
|
+
inputMessageCount: z2.number().int().nonnegative(),
|
|
820
|
+
retainedMessageCount: z2.number().int().nonnegative(),
|
|
821
|
+
summaryChars: z2.number().int().nonnegative()
|
|
822
|
+
}).strict();
|
|
812
823
|
var historyReplacementEventDataSchema = z2.discriminatedUnion("type", [
|
|
813
824
|
z2.object({
|
|
814
825
|
type: z2.literal("handoff"),
|
|
@@ -816,12 +827,15 @@ var historyReplacementEventDataSchema = z2.discriminatedUnion("type", [
|
|
|
816
827
|
modelId: z2.string().min(1),
|
|
817
828
|
reasoningLevel: z2.string().min(1).optional(),
|
|
818
829
|
triggeringToolCallId: z2.string().min(1).optional(),
|
|
830
|
+
summary: z2.string().min(1).optional(),
|
|
819
831
|
replacementHistory: replacementHistorySchema
|
|
820
832
|
}).strict(),
|
|
821
833
|
z2.object({
|
|
822
834
|
type: z2.literal("compaction"),
|
|
823
835
|
modelProfile: modelProfileSchema,
|
|
824
836
|
modelId: z2.string().min(1),
|
|
837
|
+
details: compactionDetailsSchema.optional(),
|
|
838
|
+
summary: z2.string().min(1).optional(),
|
|
825
839
|
replacementHistory: replacementHistorySchema
|
|
826
840
|
}).strict()
|
|
827
841
|
]);
|
|
@@ -919,6 +933,15 @@ var turnStartedEventDataSchema = z2.object({
|
|
|
919
933
|
(data) => new Set(data.inputMessageIds).size === data.inputMessageIds.length,
|
|
920
934
|
"turn input message ids must be unique"
|
|
921
935
|
);
|
|
936
|
+
var turnRoutedEventDataSchema = z2.object({
|
|
937
|
+
type: z2.literal("turn_routed"),
|
|
938
|
+
turnId: z2.string().min(1),
|
|
939
|
+
modelProfile: modelProfileSchema,
|
|
940
|
+
modelId: z2.string().min(1),
|
|
941
|
+
reasoningLevel: z2.enum(TURN_REASONING_LEVELS),
|
|
942
|
+
confidence: z2.number().min(0).max(1).optional(),
|
|
943
|
+
source: z2.enum(["configured", "inherited", "router"])
|
|
944
|
+
}).strict();
|
|
922
945
|
var turnCompletedEventDataSchema = z2.object({
|
|
923
946
|
type: z2.literal("turn_completed"),
|
|
924
947
|
turnId: z2.string().min(1),
|
|
@@ -960,6 +983,7 @@ var appendableConversationEventDataSchema = z2.union([
|
|
|
960
983
|
messageHandledEventDataSchema,
|
|
961
984
|
messagesSummarizedEventDataSchema,
|
|
962
985
|
turnStartedEventDataSchema,
|
|
986
|
+
turnRoutedEventDataSchema,
|
|
963
987
|
turnCompletedEventDataSchema,
|
|
964
988
|
turnFailedEventDataSchema,
|
|
965
989
|
subagentStartedEventDataSchema,
|
|
@@ -981,6 +1005,7 @@ var knownConversationEventTypeSchema = z2.enum([
|
|
|
981
1005
|
"message_handled",
|
|
982
1006
|
"messages_summarized",
|
|
983
1007
|
"turn_started",
|
|
1008
|
+
"turn_routed",
|
|
984
1009
|
"turn_completed",
|
|
985
1010
|
"turn_failed",
|
|
986
1011
|
"subagent_started",
|
|
@@ -1219,6 +1244,15 @@ var SqlConversationEventStore = class {
|
|
|
1219
1244
|
).orderBy(asc2(juniorConversationEvents.seq));
|
|
1220
1245
|
return rows.map(eventFromRow);
|
|
1221
1246
|
}
|
|
1247
|
+
async loadByIdempotencyKey(conversationId, idempotencyKey) {
|
|
1248
|
+
const [row] = await this.executor.db().select().from(juniorConversationEvents).where(
|
|
1249
|
+
and3(
|
|
1250
|
+
eq3(juniorConversationEvents.conversationId, conversationId),
|
|
1251
|
+
eq3(juniorConversationEvents.idempotencyKey, idempotencyKey)
|
|
1252
|
+
)
|
|
1253
|
+
).limit(1);
|
|
1254
|
+
return row ? eventFromRow(row) : void 0;
|
|
1255
|
+
}
|
|
1222
1256
|
async loadHistoryContaining(conversationId, seq, throughSeq) {
|
|
1223
1257
|
const [boundary] = await this.executor.db().select({ historyVersion: juniorConversationEvents.historyVersion }).from(juniorConversationEvents).where(
|
|
1224
1258
|
and3(
|