@sentry/junior 0.304.0 → 0.306.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/{adapter-context-B1IpoELr.js → adapter-context-CnY-i32r.js} +2 -2
- package/dist/{admin-BnVFGo_z.js → admin-BLLdLnXh.js} +2 -2
- package/dist/{agent-runner-CoEeZSRh.js → agent-runner-BaLjEjPR.js} +312 -204
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +7 -8
- package/dist/api.d.ts +19 -4
- package/dist/api.js +137 -40
- package/dist/{app-Cs157Zc5.d.ts → app-DvYbM9UD.d.ts} +2 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +489 -445
- package/dist/{background-compaction-queue-WLPNSF_b.js → background-compaction-queue-D2wzxtGU.js} +7 -3
- package/dist/{briefs-CagVVefw.js → briefs-DvyzXfrF.js} +3 -3
- package/dist/{catalog-runtime-B8ZXvXWm.js → catalog-runtime-B1R-nHd3.js} +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +5 -5
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{config-DdO1BNcw.js → config-DUD-zMvp.js} +111 -13
- package/dist/{connections-D20kp0j5.js → connections-CDhsqPcC.js} +6 -6
- package/dist/{continue-in-slack-BKEVMBj1.js → continue-in-slack-BXQizz9o.js} +5 -5
- package/dist/{conversation-BOqdRtUx.js → conversation--f85g4zL.js} +132 -132
- package/dist/{conversation-feed-CgpgP7yi.js → conversation-feed-BNs9KiqC.js} +1 -1
- package/dist/{conversation-privacy-L1SK_v0V.js → conversation-privacy-YE54gMN8.js} +1 -1
- package/dist/{conversation-turn-BptVJylj.js → conversation-turn-BzdmrHb0.js} +22 -40
- package/dist/{credential-sync-D1J1CGzL.js → credential-sync-Cdm-e1vJ.js} +14 -13
- package/dist/{db-EKJnkrIb.js → db-DV2ZUb1Y.js} +90 -11
- package/dist/{db-zbN5ZV_o.d.ts → db-pH357Dkt.d.ts} +1 -1
- package/dist/{executor-CoIZmFK8.js → executor-CjNhwwnj.js} +47 -4
- package/dist/{history-m2-ceTTX.js → history-N7IVbUom.js} +5 -1
- package/dist/{install-BT2Pf6HP.js → install-DbD7C5td.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{lineage-C5DGQCS_.js → lineage-BFdIPb3o.js} +2 -2
- package/dist/{logging-QSZuMcvo.js → logging-oYpJYr-S.js} +1 -1
- package/dist/{message-TtxftRHj.js → message-BBPcMKJY.js} +8 -8
- package/dist/{model-input-BHXfA29g.js → model-input-DYYF3a8B.js} +3 -3
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +4 -4
- package/dist/{oauth-callback-server-B0enqHtZ.js → oauth-callback-server-C7Q987su.js} +2 -2
- package/dist/{projection-CNKK7doO.js → projection-CWXDE0f6.js} +7740 -6165
- package/dist/{prompt-DSjhoKu5.js → prompt-P3eRqO8C.js} +15 -7
- package/dist/{queue-CDxkit82.js → queue-7FSijgqG.js} +4 -4
- package/dist/{registry-DBDNUUmz.js → registry-1pzXmplY.js} +1 -1
- package/dist/{resolve-CQLhMWSu.js → resolve-n87oXY-d.js} +3 -3
- package/dist/{result-B-pauj42.js → result-BmF9v9bv.js} +9 -9
- package/dist/{runner-B3KxKks5.js → runner-4j7ZsxP5.js} +13 -15
- package/dist/{sandbox-egress-signals-DJJX9ClG.js → sandbox-egress-signals-BRQI8HvT.js} +1 -1
- package/dist/{automation-CuA3yEcD.js → schedule-CHPWQn-x.js} +347 -5
- package/dist/{schema-CKcu-IK6.d.ts → schema-CVbIjrF3.d.ts} +71 -1
- package/dist/{schema-Bx0Mlo32.js → schema-D7iIEh6t.js} +52 -6
- package/dist/{service-account-DQLqkSVv.js → service-account-BDQ9xzta.js} +3 -3
- package/dist/{service-account-2HmlNPvy.js → service-account-DzQiOmqa.js} +5 -5
- package/dist/{session-stop-DEeZKqbX.js → session-stop-BQxgHR4X.js} +919 -168
- package/dist/{skills-2UrD7JkN.js → skills-CPf4vNuC.js} +2 -2
- package/dist/{slack-conversation-unfurl-Dd129Uov.js → slack-conversation-unfurl-B1KEptUg.js} +10 -9
- package/dist/{spawn-eMho9HDJ.js → spawn-CjGddiAU.js} +6 -6
- package/dist/{state-Bveuc4Zh.js → state-9wfj6aSD.js} +4 -4
- package/dist/{stop-D_ltJLDS.js → stop-CsQGuN5n.js} +62 -118
- package/dist/{store-COeYnPL_.js → store-Dz3YZ7gQ.js} +5 -5
- package/dist/{task-queue-CBIDXZpV.js → task-queue-CFlrJguF.js} +3 -3
- package/dist/{task-runner-CJF7zIJL.js → task-runner-frzlUvFD.js} +8 -9
- package/dist/{thread-context-Cg0jt0aE.js → thread-context-C4QuZlM8.js} +8 -91
- package/dist/turn-session-routing-BXaubz2w.js +244 -0
- package/dist/{turn-user-message-tcom1RYd.js → turn-user-message-DNC0eRZ7.js} +3 -3
- package/dist/users-XCCKn3xW.js +181 -0
- package/dist/{validation-EU91JwIT.js → validation-L5fdjmFX.js} +1 -1
- package/dist/{version-BYRPhY5G.js → version-BFmuwgxP.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-Cf8ISkAc.js → viewer-DKOeHpv3.js} +3 -3
- package/dist/{warmup-TgY4S1vx.js → warmup-mTMIatCV.js} +271 -279
- package/dist/{web-message-id-lNodcCOI.js → web-message-id-CUaSiGme.js} +16 -1
- package/dist/{worker-C6Uq4OKD.js → worker-Bz4KNxjI.js} +7 -7
- package/migrations/0114_plan_items.sql +22 -0
- package/migrations/meta/0114_snapshot.json +5203 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +6 -6
- package/dist/schedule-cP0AACm1.js +0 -344
- package/dist/turn-session-routing-CaY3Tp8m.js +0 -1792
|
@@ -1,136 +1,6 @@
|
|
|
1
|
-
import { a as conversationTurnFailureReasonSchema, h as usageSchema, i as conversationTurnFailureCodeSchema } from "./history-
|
|
1
|
+
import { a as conversationTurnFailureReasonSchema, h as usageSchema, i as conversationTurnFailureCodeSchema } from "./history-N7IVbUom.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
import { codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, objectFactFields, objectTypeSchema } from "@sentry/junior-plugin-api";
|
|
4
|
-
// src/chat/briefs/schema.ts
|
|
5
|
-
/**
|
|
6
|
-
* Runtime schemas for the Brief record and the generator input. Both cross a
|
|
7
|
-
* durable or CLI edge, so these schemas own the exported types.
|
|
8
|
-
*/
|
|
9
|
-
const LINE_MAX = 400;
|
|
10
|
-
const lineSchema = z.string().trim().min(1).max(LINE_MAX);
|
|
11
|
-
const urlSchema = z.string().url().max(2048);
|
|
12
|
-
const timestampSchema = z.string().datetime();
|
|
13
|
-
const briefLocationSchema = z.object({
|
|
14
|
-
provider: z.string().trim().min(1).max(100),
|
|
15
|
-
channelName: lineSchema.optional()
|
|
16
|
-
}).strict();
|
|
17
|
-
const briefOutcomeStatusSchema = z.enum([
|
|
18
|
-
"in_progress",
|
|
19
|
-
"answered",
|
|
20
|
-
"done",
|
|
21
|
-
"partial",
|
|
22
|
-
"blocked",
|
|
23
|
-
"abandoned"
|
|
24
|
-
]);
|
|
25
|
-
const briefCodeChangeSchema = z.object({
|
|
26
|
-
repository: lineSchema,
|
|
27
|
-
number: z.number().int().positive(),
|
|
28
|
-
title: lineSchema.optional(),
|
|
29
|
-
url: urlSchema,
|
|
30
|
-
state: codeChangeStateSchema,
|
|
31
|
-
openedAt: timestampSchema.optional(),
|
|
32
|
-
mergedAt: timestampSchema.optional(),
|
|
33
|
-
closedAt: timestampSchema.optional()
|
|
34
|
-
}).strict();
|
|
35
|
-
const briefLinkSchema = z.object({
|
|
36
|
-
kind: z.enum([
|
|
37
|
-
"code_change",
|
|
38
|
-
"resource",
|
|
39
|
-
"url"
|
|
40
|
-
]),
|
|
41
|
-
label: lineSchema,
|
|
42
|
-
url: urlSchema,
|
|
43
|
-
status: lineSchema.optional()
|
|
44
|
-
}).strict();
|
|
45
|
-
const briefRecordSchema = z.object({
|
|
46
|
-
startedAt: timestampSchema,
|
|
47
|
-
lastActivityAt: timestampSchema,
|
|
48
|
-
durationMs: z.number().int().nonnegative(),
|
|
49
|
-
participants: z.array(z.object({
|
|
50
|
-
name: lineSchema,
|
|
51
|
-
messages: z.number().int().positive()
|
|
52
|
-
}).strict()),
|
|
53
|
-
userMessages: z.number().int().nonnegative(),
|
|
54
|
-
assistantMessages: z.number().int().nonnegative(),
|
|
55
|
-
toolResults: z.number().int().nonnegative(),
|
|
56
|
-
events: z.number().int().nonnegative(),
|
|
57
|
-
turns: z.number().int().positive().optional(),
|
|
58
|
-
location: briefLocationSchema.optional(),
|
|
59
|
-
codeChanges: z.array(briefCodeChangeSchema)
|
|
60
|
-
}).strict();
|
|
61
|
-
const conversationBriefSchema = z.object({
|
|
62
|
-
schemaVersion: z.literal(1),
|
|
63
|
-
record: briefRecordSchema,
|
|
64
|
-
summary: z.string().trim().min(1).max(600),
|
|
65
|
-
intent: lineSchema,
|
|
66
|
-
outcome: z.object({
|
|
67
|
-
status: briefOutcomeStatusSchema,
|
|
68
|
-
text: z.string().trim().min(1).max(600)
|
|
69
|
-
}).strict(),
|
|
70
|
-
decisions: z.array(z.object({
|
|
71
|
-
text: lineSchema,
|
|
72
|
-
by: lineSchema.optional(),
|
|
73
|
-
kind: z.enum([
|
|
74
|
-
"stated",
|
|
75
|
-
"confirmed",
|
|
76
|
-
"assumed"
|
|
77
|
-
])
|
|
78
|
-
}).strict()).max(20),
|
|
79
|
-
facts: z.array(lineSchema).max(30),
|
|
80
|
-
links: z.array(briefLinkSchema).max(40),
|
|
81
|
-
keywords: z.array(z.string().trim().toLowerCase().min(1).max(400)).max(12)
|
|
82
|
-
}).strict();
|
|
83
|
-
/** Parse a stored Brief row, dropping fields that older versions wrote. */
|
|
84
|
-
function parseStoredBrief(content) {
|
|
85
|
-
if (content && typeof content === "object" && "openDecisions" in content) {
|
|
86
|
-
const { openDecisions: _openDecisions, ...rest } = content;
|
|
87
|
-
return conversationBriefSchema.parse(rest);
|
|
88
|
-
}
|
|
89
|
-
return conversationBriefSchema.parse(content);
|
|
90
|
-
}
|
|
91
|
-
const briefEntrySchema = z.object({
|
|
92
|
-
index: z.number().int().nonnegative(),
|
|
93
|
-
role: z.enum([
|
|
94
|
-
"user",
|
|
95
|
-
"assistant",
|
|
96
|
-
"tool",
|
|
97
|
-
"event"
|
|
98
|
-
]),
|
|
99
|
-
author: lineSchema.optional(),
|
|
100
|
-
text: z.string().min(1),
|
|
101
|
-
createdAtMs: z.number().int().nonnegative(),
|
|
102
|
-
turnId: z.string().min(1).optional()
|
|
103
|
-
}).strict();
|
|
104
|
-
const briefResourceSchema = z.object({
|
|
105
|
-
label: lineSchema,
|
|
106
|
-
url: urlSchema,
|
|
107
|
-
status: lineSchema.optional()
|
|
108
|
-
}).strict();
|
|
109
|
-
const briefInputSchema = z.object({
|
|
110
|
-
conversationId: z.string().min(1),
|
|
111
|
-
title: lineSchema.optional(),
|
|
112
|
-
visibility: z.enum(["private", "public"]),
|
|
113
|
-
location: briefLocationSchema.optional(),
|
|
114
|
-
entries: z.array(briefEntrySchema),
|
|
115
|
-
codeChanges: z.array(briefCodeChangeSchema),
|
|
116
|
-
resources: z.array(briefResourceSchema)
|
|
117
|
-
}).strict();
|
|
118
|
-
/**
|
|
119
|
-
* Label an annotation as a Brief resource. An object label is only its id,
|
|
120
|
-
* such as `owner/repo#123`, so keep its title: Brief search matches labels,
|
|
121
|
-
* and a later Conversation must find the object by its topic.
|
|
122
|
-
*/
|
|
123
|
-
function briefResourceLabel(annotation) {
|
|
124
|
-
return (annotation.kind === "object" && annotation.title !== annotation.label ? `${annotation.label} · ${annotation.title}` : annotation.label).slice(0, LINE_MAX).trim();
|
|
125
|
-
}
|
|
126
|
-
/** Parse the provider-neutral input used by every Brief generator adapter. */
|
|
127
|
-
function parseBriefInput(input) {
|
|
128
|
-
const parsed = briefInputSchema.parse(input);
|
|
129
|
-
return {
|
|
130
|
-
...parsed,
|
|
131
|
-
entries: [...parsed.entries].sort((left, right) => left.index - right.index || left.createdAtMs - right.createdAtMs)
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
4
|
// src/chat/attachments/input.ts
|
|
135
5
|
/**
|
|
136
6
|
* Largest file that Junior stores from Slack or the web, or loads into the
|
|
@@ -288,6 +158,136 @@ const conversationTitleSchema = z.string().trim().min(1).max(200);
|
|
|
288
158
|
const renameConversationBodySchema = z.object({ title: conversationTitleSchema }).strict();
|
|
289
159
|
/** The stored title after the rename. */
|
|
290
160
|
const renameConversationResponseSchema = z.object({ title: z.string().min(1) }).strict();
|
|
161
|
+
// src/chat/briefs/schema.ts
|
|
162
|
+
/**
|
|
163
|
+
* Runtime schemas for the Brief record and the generator input. Both cross a
|
|
164
|
+
* durable or CLI edge, so these schemas own the exported types.
|
|
165
|
+
*/
|
|
166
|
+
const LINE_MAX = 400;
|
|
167
|
+
const lineSchema = z.string().trim().min(1).max(LINE_MAX);
|
|
168
|
+
const urlSchema = z.string().url().max(2048);
|
|
169
|
+
const timestampSchema = z.string().datetime();
|
|
170
|
+
const briefLocationSchema = z.object({
|
|
171
|
+
provider: z.string().trim().min(1).max(100),
|
|
172
|
+
channelName: lineSchema.optional()
|
|
173
|
+
}).strict();
|
|
174
|
+
const briefOutcomeStatusSchema = z.enum([
|
|
175
|
+
"in_progress",
|
|
176
|
+
"answered",
|
|
177
|
+
"done",
|
|
178
|
+
"partial",
|
|
179
|
+
"blocked",
|
|
180
|
+
"abandoned"
|
|
181
|
+
]);
|
|
182
|
+
const briefCodeChangeSchema = z.object({
|
|
183
|
+
repository: lineSchema,
|
|
184
|
+
number: z.number().int().positive(),
|
|
185
|
+
title: lineSchema.optional(),
|
|
186
|
+
url: urlSchema,
|
|
187
|
+
state: codeChangeStateSchema,
|
|
188
|
+
openedAt: timestampSchema.optional(),
|
|
189
|
+
mergedAt: timestampSchema.optional(),
|
|
190
|
+
closedAt: timestampSchema.optional()
|
|
191
|
+
}).strict();
|
|
192
|
+
const briefLinkSchema = z.object({
|
|
193
|
+
kind: z.enum([
|
|
194
|
+
"code_change",
|
|
195
|
+
"resource",
|
|
196
|
+
"url"
|
|
197
|
+
]),
|
|
198
|
+
label: lineSchema,
|
|
199
|
+
url: urlSchema,
|
|
200
|
+
status: lineSchema.optional()
|
|
201
|
+
}).strict();
|
|
202
|
+
const briefRecordSchema = z.object({
|
|
203
|
+
startedAt: timestampSchema,
|
|
204
|
+
lastActivityAt: timestampSchema,
|
|
205
|
+
durationMs: z.number().int().nonnegative(),
|
|
206
|
+
participants: z.array(z.object({
|
|
207
|
+
name: lineSchema,
|
|
208
|
+
messages: z.number().int().positive()
|
|
209
|
+
}).strict()),
|
|
210
|
+
userMessages: z.number().int().nonnegative(),
|
|
211
|
+
assistantMessages: z.number().int().nonnegative(),
|
|
212
|
+
toolResults: z.number().int().nonnegative(),
|
|
213
|
+
events: z.number().int().nonnegative(),
|
|
214
|
+
turns: z.number().int().positive().optional(),
|
|
215
|
+
location: briefLocationSchema.optional(),
|
|
216
|
+
codeChanges: z.array(briefCodeChangeSchema)
|
|
217
|
+
}).strict();
|
|
218
|
+
const conversationBriefSchema = z.object({
|
|
219
|
+
schemaVersion: z.literal(1),
|
|
220
|
+
record: briefRecordSchema,
|
|
221
|
+
summary: z.string().trim().min(1).max(600),
|
|
222
|
+
intent: lineSchema,
|
|
223
|
+
outcome: z.object({
|
|
224
|
+
status: briefOutcomeStatusSchema,
|
|
225
|
+
text: z.string().trim().min(1).max(600)
|
|
226
|
+
}).strict(),
|
|
227
|
+
decisions: z.array(z.object({
|
|
228
|
+
text: lineSchema,
|
|
229
|
+
by: lineSchema.optional(),
|
|
230
|
+
kind: z.enum([
|
|
231
|
+
"stated",
|
|
232
|
+
"confirmed",
|
|
233
|
+
"assumed"
|
|
234
|
+
])
|
|
235
|
+
}).strict()).max(20),
|
|
236
|
+
facts: z.array(lineSchema).max(30),
|
|
237
|
+
links: z.array(briefLinkSchema).max(40),
|
|
238
|
+
keywords: z.array(z.string().trim().toLowerCase().min(1).max(400)).max(12)
|
|
239
|
+
}).strict();
|
|
240
|
+
/** Parse a stored Brief row, dropping fields that older versions wrote. */
|
|
241
|
+
function parseStoredBrief(content) {
|
|
242
|
+
if (content && typeof content === "object" && "openDecisions" in content) {
|
|
243
|
+
const { openDecisions: _openDecisions, ...rest } = content;
|
|
244
|
+
return conversationBriefSchema.parse(rest);
|
|
245
|
+
}
|
|
246
|
+
return conversationBriefSchema.parse(content);
|
|
247
|
+
}
|
|
248
|
+
const briefEntrySchema = z.object({
|
|
249
|
+
index: z.number().int().nonnegative(),
|
|
250
|
+
role: z.enum([
|
|
251
|
+
"user",
|
|
252
|
+
"assistant",
|
|
253
|
+
"tool",
|
|
254
|
+
"event"
|
|
255
|
+
]),
|
|
256
|
+
author: lineSchema.optional(),
|
|
257
|
+
text: z.string().min(1),
|
|
258
|
+
createdAtMs: z.number().int().nonnegative(),
|
|
259
|
+
turnId: z.string().min(1).optional()
|
|
260
|
+
}).strict();
|
|
261
|
+
const briefResourceSchema = z.object({
|
|
262
|
+
label: lineSchema,
|
|
263
|
+
url: urlSchema,
|
|
264
|
+
status: lineSchema.optional()
|
|
265
|
+
}).strict();
|
|
266
|
+
const briefInputSchema = z.object({
|
|
267
|
+
conversationId: z.string().min(1),
|
|
268
|
+
title: lineSchema.optional(),
|
|
269
|
+
visibility: z.enum(["private", "public"]),
|
|
270
|
+
location: briefLocationSchema.optional(),
|
|
271
|
+
entries: z.array(briefEntrySchema),
|
|
272
|
+
codeChanges: z.array(briefCodeChangeSchema),
|
|
273
|
+
resources: z.array(briefResourceSchema)
|
|
274
|
+
}).strict();
|
|
275
|
+
/**
|
|
276
|
+
* Label an annotation as a Brief resource. An object label is only its id,
|
|
277
|
+
* such as `owner/repo#123`, so keep its title: Brief search matches labels,
|
|
278
|
+
* and a later Conversation must find the object by its topic.
|
|
279
|
+
*/
|
|
280
|
+
function briefResourceLabel(annotation) {
|
|
281
|
+
return (annotation.kind === "object" && annotation.title !== annotation.label ? `${annotation.label} · ${annotation.title}` : annotation.label).slice(0, LINE_MAX).trim();
|
|
282
|
+
}
|
|
283
|
+
/** Parse the provider-neutral input used by every Brief generator adapter. */
|
|
284
|
+
function parseBriefInput(input) {
|
|
285
|
+
const parsed = briefInputSchema.parse(input);
|
|
286
|
+
return {
|
|
287
|
+
...parsed,
|
|
288
|
+
entries: [...parsed.entries].sort((left, right) => left.index - right.index || left.createdAtMs - right.createdAtMs)
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
291
|
// src/chat/agent-invocations/agent-types.ts
|
|
292
292
|
/**
|
|
293
293
|
* Child agent types. A type is plain data: when to pick it and what the child
|
|
@@ -1016,4 +1016,4 @@ const conversationDetailReportSchema = conversationSummaryReportSchema.extend({
|
|
|
1016
1016
|
sentryConversationUrl: z.string().optional(),
|
|
1017
1017
|
sourceTask: conversationSourceTaskSchema.optional()
|
|
1018
1018
|
}).strict().superRefine(validateConversationEvents);
|
|
1019
|
-
export {
|
|
1019
|
+
export { inputFileSchema as $, agentTypeSchema as A, conversationTitleSchema as B, createConversationMessageBodySchema as C, conversationChildAgentTotalsSchema as D, idempotencyKeySchema as E, briefResourceLabel as F, annotationCard as G, renameConversationResponseSchema as H, conversationBriefSchema as I, readMessageCardRefs as J, messageCardRef as K, parseBriefInput as L, briefCodeChangeSchema as M, briefLinkSchema as N, AGENT_TYPES as O, briefOutcomeStatusSchema as P, MAX_INPUT_ATTACHMENTS as Q, parseStoredBrief as R, createConversationBodySchema as S, forkConversationResponseSchema as T, conversationReadPositionSchema as U, renameConversationBodySchema as V, reviewItemChangeRecordSchema as W, resolveMessageCards as X, removedCardSchema as Y, MAX_ATTACHMENT_BYTES as Z, conversationReportMessageEventSchema as _, conversationActivityPreviewSchema as a, conversationSurfaceSchema as b, conversationAuxiliaryCostsSchema as c, conversationEventHistorySchema as d, messageAttachmentSchema as et, conversationEventPageSchema as f, conversationReportEventSchema as g, conversationReportEventDataSchema as h, actorIdentitySchema as i, formatAgentTypes as j, agentTypeInstructions as k, conversationDetailQuerySchema as l, conversationParamsSchema as m, CONVERSATION_VERSION_HEADER as n, conversationAttachmentParamsSchema as o, conversationEventsQuerySchema as p, messageCardText as q, acceptedConversationMessageSchema as r, conversationAttachmentQuerySchema as s, CONVERSATION_DETAIL_VERSION_HEADER as t, readMessageAttachments as tt, conversationDetailReportSchema as u, conversationReportStatusSchema as v, forkConversationBodySchema as w, conversationUsageSchema as x, conversationSummaryReportSchema as y, CONVERSATION_TITLE_MAX_LENGTH as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { P as briefOutcomeStatusSchema, W as reviewItemChangeRecordSchema, et as messageAttachmentSchema, i as actorIdentitySchema, u as conversationDetailReportSchema, y as conversationSummaryReportSchema } from "./conversation--f85g4zL.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
// src/api/objects/cards.ts
|
|
4
4
|
const MAX_LABEL_CHARS = 256;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as logWarn } from "./logging-
|
|
1
|
+
import { h as logWarn } from "./logging-oYpJYr-S.js";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
3
|
import { renderSystemMessageUpdate } from "@earendil-works/pi-ai";
|
|
4
4
|
// src/chat/conversation-privacy.ts
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import {
|
|
3
|
-
import { E as isTopLevelKind, T as isPersonInput,
|
|
4
|
-
import { E as withSpan, S as setTags, h as logWarn, p as logException } from "./logging-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { f as credentialContextForActor } from "./registry-DBDNUUmz.js";
|
|
2
|
+
import { A as normalizeConversationText, Do as readConversationAutomationRun, Go as notifyAutomationBlocked, No as getDispatchIdForConversation, O as latestConversationMessageSeq, P as upsertConversationMessage, Xs as blockEventAutomation, a as loadProjection, at as getTurnRecord, b as persistConversationMessages, bi as verifyTimerWatchCredentialSubject, cn as getAssistantReplyText, et as saveTurnCheckpoint, j as recordDeliveredAssistantMessage, k as markConversationMessage, ks as blockScheduledAutomation, rt as failTurnRecord, t as commitAcceptedReply, v as hydrateConversationMessages, vn as persistWithRetry } from "./projection-CWXDE0f6.js";
|
|
3
|
+
import { E as isTopLevelKind, T as isPersonInput, _t as nextDetailVersion, a as getConversationStore, k as turnBehavior, o as getDb, r as getConversationEventStore, s as getSqlExecutor } from "./db-DV2ZUb1Y.js";
|
|
4
|
+
import { E as withSpan, S as setTags, h as logWarn, p as logException } from "./logging-oYpJYr-S.js";
|
|
5
|
+
import { tt as readMessageAttachments } from "./conversation--f85g4zL.js";
|
|
6
|
+
import { F as juniorConversations } from "./executor-CjNhwwnj.js";
|
|
7
|
+
import { a as buildDeliveredTurnStatePatch, o as loadPendingMessageCards, r as completeAuthPauseTurn, t as buildTurnThreadContext } from "./thread-context-C4QuZlM8.js";
|
|
8
|
+
import { Bn as AgentRunError, En as supersedeOpenMailboxTurns, Et as resolveConversationDestination, Ln as createWebAuthorization, Vn as executeTurn, an as readParentMessage, gn as completeCancelledConversationTurn, nn as isParentMessageMeta, tn as childAgentTurnOptions } from "./warmup-mTMIatCV.js";
|
|
9
|
+
import { R as buildDeterministicTurnId, _ as ConversationTurnLifecycleService, d as isTurnInputCommitLostError, g as startActiveTurn, h as markTurnFailed, l as getConversationTurnBoundaryError, s as TurnInputCommitLostError, t as getTurnUserMessage } from "./turn-user-message-DNC0eRZ7.js";
|
|
10
|
+
import { f as credentialContextForActor } from "./registry-1pzXmplY.js";
|
|
12
11
|
import { i as getActiveSpan, r as continueTrace } from "./sentry-CPbZjomA.js";
|
|
13
|
-
import { i as measureTurnCompactionWait } from "./agent-runner-
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
12
|
+
import { N as finalizeFailedTurnReplyWithEvent, i as measureTurnCompactionWait } from "./agent-runner-BaLjEjPR.js";
|
|
13
|
+
import { a as getPersistedThreadState, c as coerceThreadConversationState, i as getPersistedSandboxState, s as persistThreadStateById } from "./turn-session-routing-BXaubz2w.js";
|
|
14
|
+
import { n as botConfig } from "./config-DUD-zMvp.js";
|
|
15
|
+
import { B as renderEventBatchInputs, D as getEventBatchDelayMs, M as sourceFromTurnInput, N as turnInputFactsFromConversationMessage, P as legacyWebMailboxMetadataSchema, Q as maybePostAutomatedTurnLimitNotice, R as eventBatchMessageMeta, V as timerWatchCredentialSubject, c as loadReviewItemInput, f as buildSteeringPiMessage, g as withoutSavedSteeringMessages, m as instructionForInputs, p as instructionActorFor, s as eventReviewItemInputs, st as recordFinishedTurnForAutomatedLimit, z as isEventMailboxMetadata } from "./session-stop-BQxgHR4X.js";
|
|
16
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-frzlUvFD.js";
|
|
17
|
+
import { p as instructionProvenanceFor } from "./history-N7IVbUom.js";
|
|
18
|
+
import { s as isEventConversationMessage } from "./prompt-P3eRqO8C.js";
|
|
19
|
+
import { t as readConversationLineage } from "./lineage-BFdIPb3o.js";
|
|
20
20
|
import { isDeepStrictEqual } from "node:util";
|
|
21
21
|
import { createHash } from "node:crypto";
|
|
22
22
|
import { and, eq, isNotNull, isNull } from "drizzle-orm";
|
|
@@ -79,28 +79,13 @@ function getTurnInputSpanAttributes(input, turnStartedAtMs) {
|
|
|
79
79
|
}
|
|
80
80
|
// src/chat/automations/block-run.ts
|
|
81
81
|
/**
|
|
82
|
-
* Find the Automation of a run. The SQL run row lasts as long as the
|
|
83
|
-
* Automation, but a Watch can outlive the dispatch record. The dispatch record
|
|
84
|
-
* covers a run whose row does not link its Conversation yet.
|
|
85
|
-
*/
|
|
86
|
-
async function findRunAutomation(conversationId, dispatchId) {
|
|
87
|
-
const run = await readAutomationExecutionByConversationId({ conversationId });
|
|
88
|
-
if (run) return run;
|
|
89
|
-
const source = dispatchId ? (await getDispatchRecord(dispatchId))?.source : void 0;
|
|
90
|
-
if (!source || !("automationId" in source) || !source.automationId) return;
|
|
91
|
-
return {
|
|
92
|
-
automationId: source.automationId,
|
|
93
|
-
kind: source.kind === "scheduled_automation" ? "scheduled" : "event"
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
82
|
* Block the Automation of a run from a later Turn of the run, such as a Watch
|
|
98
83
|
* Event or child result Turn. The dispatch Turn blocks through its dispatch
|
|
99
84
|
* outcome. Its creator is told when the block is first stored.
|
|
100
85
|
*/
|
|
101
86
|
async function blockRunAutomation(conversationId, blocked) {
|
|
102
87
|
const dispatchId = getDispatchIdForConversation(conversationId);
|
|
103
|
-
const automation = await
|
|
88
|
+
const automation = await readConversationAutomationRun(conversationId);
|
|
104
89
|
if (!automation) {
|
|
105
90
|
logWarn("automation.block.unresolved", { "gen_ai.conversation.id": conversationId });
|
|
106
91
|
return;
|
|
@@ -424,7 +409,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
424
409
|
personInput: isPersonInput(source.kind)
|
|
425
410
|
});
|
|
426
411
|
const webActor = actor.platform === "web" ? actor : void 0;
|
|
427
|
-
const signInActor = behavior.
|
|
412
|
+
const signInActor = behavior.waitsForSignIn ? webActor : void 0;
|
|
428
413
|
const disabledFeatures = signInActor ? [] : ["interactive-auth"];
|
|
429
414
|
const deliverToProvider = postsToProvider && behavior.delivery === "location";
|
|
430
415
|
const sendToParent = async (result) => {
|
|
@@ -642,10 +627,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
642
627
|
}, async (result) => {
|
|
643
628
|
if (stopSignal?.aborted) throw stopSignal.reason ?? new DOMException("Turn cancelled", "AbortError");
|
|
644
629
|
modelFailureCaptureAttempted = result.diagnostics.outcome !== "success";
|
|
645
|
-
const finalized = finalizeFailedTurnReplyWithEvent({
|
|
646
|
-
reply: result,
|
|
647
|
-
logException
|
|
648
|
-
});
|
|
630
|
+
const finalized = finalizeFailedTurnReplyWithEvent({ reply: result });
|
|
649
631
|
const modelFailureReason = finalized.failureReason;
|
|
650
632
|
const reply = finalized.reply;
|
|
651
633
|
modelFailureEventId = finalized.eventId;
|
|
@@ -728,7 +710,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
728
710
|
await scheduleSessionCompletedPluginTasks({
|
|
729
711
|
conversationId: context.conversationId,
|
|
730
712
|
sessionId: turnId
|
|
731
|
-
},
|
|
713
|
+
}, async (message) => {
|
|
732
714
|
try {
|
|
733
715
|
await processPluginTask(message);
|
|
734
716
|
} catch (error) {
|
|
@@ -739,7 +721,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
739
721
|
turnId
|
|
740
722
|
});
|
|
741
723
|
}
|
|
742
|
-
}
|
|
724
|
+
});
|
|
743
725
|
} catch (error) {
|
|
744
726
|
logException(error, "conversation.plugin.session_completion_task.failed", {
|
|
745
727
|
conversationId: context.conversationId,
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { V as escapeXml, a as getRuntimeMetadata, n as botConfig } from "./config-
|
|
3
|
-
import { W as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-
|
|
1
|
+
import { Bn as createUserTokenStore, Gi as parseOAuthStatePayload, Hn as resolvePluginOAuthAccount, Ki as resolveBaseUrl, Qo as postSlackMessage, Wi as formatProviderLabel, Y as getConversationPendingAuth, at as getTurnRecord, d as recordAuthorizationCompleted, ls as getSlackClient, u as recordAuthenticationLinked } from "./projection-CWXDE0f6.js";
|
|
2
|
+
import { V as escapeXml, a as getRuntimeMetadata, n as botConfig } from "./config-DUD-zMvp.js";
|
|
3
|
+
import { W as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-oYpJYr-S.js";
|
|
4
4
|
import { p as parseSlackUserId } from "./actor-D2iXzvlN.js";
|
|
5
|
-
import {
|
|
5
|
+
import { $ as getStateAdapter, H as findUserByVerifiedEmails, I as resolveActorIdentityId, q as upsertLinkedIdentity, rt as acquireActiveLock, s as getSqlExecutor } from "./db-DV2ZUb1Y.js";
|
|
6
6
|
import { i as homeDir } from "./package-discovery-x4AvVhMj.js";
|
|
7
|
-
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-
|
|
8
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
9
|
-
import { t as discoverSkills } from "./skills-
|
|
10
|
-
import { o as finalizeMcpAuthorization } from "./agent-runner-
|
|
11
|
-
import { O as getMcpProviderErrorAttributes, S as putMcpStoredOAuthCredentials, f as deleteMcpAuthSession, g as getMcpAuthSession, v as getMcpStoredOAuthCredentials } from "./service-account-
|
|
12
|
-
import { o as readIdentityById } from "./viewer-
|
|
7
|
+
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-1pzXmplY.js";
|
|
8
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-B1R-nHd3.js";
|
|
9
|
+
import { t as discoverSkills } from "./skills-CPf4vNuC.js";
|
|
10
|
+
import { o as finalizeMcpAuthorization } from "./agent-runner-BaLjEjPR.js";
|
|
11
|
+
import { O as getMcpProviderErrorAttributes, S as putMcpStoredOAuthCredentials, f as deleteMcpAuthSession, g as getMcpAuthSession, v as getMcpStoredOAuthCredentials } from "./service-account-DzQiOmqa.js";
|
|
12
|
+
import { o as readIdentityById } from "./viewer-DKOeHpv3.js";
|
|
13
13
|
import { t as readJuniorSecret } from "./secrets-DHaJ5TTn.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
14
|
+
import { An as wakeAuthorizedTurn, Rn as deleteWebAuthorization, jn as wakePausedTurn } from "./warmup-mTMIatCV.js";
|
|
15
|
+
import { i as lookupSlackUserProfile } from "./users-XCCKn3xW.js";
|
|
16
|
+
import { a as getPersistedThreadState, c as coerceThreadConversationState } from "./turn-session-routing-BXaubz2w.js";
|
|
17
|
+
import { i as readConnectedOAuthTokens, s as htmlCallbackResponse } from "./connections-CDhsqPcC.js";
|
|
17
18
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-DAmfVmJu.js";
|
|
18
19
|
import * as z from "zod";
|
|
19
20
|
import path from "node:path";
|