@sentry/junior 0.296.0 → 0.298.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/{admin-z_lgDi-z.js → admin-BF3DbYGf.js} +2 -2
- package/dist/{agent-runner-HoQiUKLL.js → agent-runner-Q9GkoerG.js} +407 -1895
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +7 -7
- package/dist/api.d.ts +1 -1
- package/dist/api.js +38 -267
- package/dist/{app-C75Ft-A_.d.ts → app-DOg_mCtV.d.ts} +7 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +64 -44
- package/dist/attempt-selection-ClP3MMPr.js +61 -0
- package/dist/{automation-yJX3C7i3.js → automation-Cn8qmbdr.js} +1 -1
- package/dist/{background-compaction-queue-Cre1wFt9.js → background-compaction-queue-BZhGFOK6.js} +4 -88
- package/dist/{briefs-BXECHduJ.js → briefs-CQrCRF6-.js} +3 -3
- package/dist/{catalog-runtime-CpCmlD9L.js → catalog-runtime-DZeD2WbL.js} +1 -1
- package/dist/cli/chat.js +19 -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 +4 -4
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{config-CCPHvTqx.js → config-BOByVnxe.js} +2 -2
- package/dist/{connections-B5pWh8e2.js → connections-BNN5cJam.js} +6 -6
- package/dist/{conversation-CMkSmi02.js → conversation-DCkzvxqB.js} +51 -17
- package/dist/{conversation-feed-BVAOga0H.js → conversation-feed-CMA12Rjs.js} +1 -1
- package/dist/{conversation-privacy-CZD5soDW.js → conversation-privacy-C0eRxsgb.js} +1 -1
- package/dist/conversation-turn-D9qvcDX6.js +805 -0
- package/dist/{credential-sync-DwLkIvXI.js → credential-sync-B_iUpxGL.js} +14 -13
- package/dist/{db-C1M1y-bh.js → db-CoMNr2Zm.js} +43 -15
- package/dist/{db-B3iyr_Or.d.ts → db-DoMcnYol.d.ts} +13 -1
- package/dist/{executor-DUSEwXaO.js → executor-C-m8VrzX.js} +14 -6
- package/dist/instrumentation.js +2 -2
- package/dist/{logging-D0svFM8r.js → logging-CJTi5niy.js} +1 -1
- package/dist/{message-BFnIwKpx.js → message-Q6_5DAWR.js} +15 -13
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -2
- package/dist/{session-stop-hYNTNpVf.js → notification-Bv25xbj0.js} +11 -930
- package/dist/{oauth-callback-server-BXRtD6Fk.js → oauth-callback-server-CH5XAyo-.js} +2 -2
- package/dist/{projection-B6VS7kbo.js → projection-BgwEE36_.js} +333 -106
- package/dist/{prompt-CD11tfG8.js → prompt-DXc9DYT9.js} +4 -4
- package/dist/prompt-input-BUr4J9RO.js +1424 -0
- package/dist/{registry-CHewwYEo.js → registry-9XwqSnM-.js} +1 -1
- package/dist/reporting-window-DopzcOHh.js +137 -0
- package/dist/{resolve-1owMH4qo.js → resolve-DUIAbcRL.js} +3 -3
- package/dist/result-C2Vn8QGn.js +463 -0
- package/dist/{runner-BtWvJslp.js → runner-CXGtw-Mc.js} +9 -8
- package/dist/{sandbox-egress-signals-ByftwJVt.js → sandbox-egress-signals-Di3S_dO7.js} +1 -1
- package/dist/{schema-Ct1Zf2xy.d.ts → schema-BnbZ-rKv.d.ts} +14 -107
- package/dist/{schema-D2iGyYIp.js → schema-Dyp7racy.js} +11 -48
- package/dist/{service-account-BZEuMKdo.js → service-account-DM3KBBeG.js} +3 -3
- package/dist/{service-account-DLoeoHww.js → service-account-GzAMUQ8a.js} +3 -3
- package/dist/session-stop-D4i7e6iT.js +181 -0
- package/dist/{skills-DXgd5Inh.js → skills-DCK9SD_l.js} +2 -2
- package/dist/{spawn-YeqlNDv8.js → spawn-6cX6xE9G.js} +6 -5
- package/dist/{state-C3CbtD_m.js → state-CSuA2J1V.js} +2 -2
- package/dist/{stop-Cze_pEL8.js → stop-Dh2DfwpK.js} +66 -159
- package/dist/{store-CZ9vqR4P.js → store-B1zepKG8.js} +11 -4
- package/dist/{task-runner-CMiNGsER.js → store-DrA17Fbz.js} +939 -1593
- package/dist/task-queue-D1rXWfFN.js +89 -0
- package/dist/task-runner-CT4M8oDz.js +291 -0
- package/dist/thread-context-DnqUkbzN.js +248 -0
- package/dist/turn-cancel-l460pfGW.js +201 -0
- package/dist/turn-session-routing-VXDVXLRl.js +380 -0
- package/dist/{turn-failure-response-pXhZ2wMK.js → turn-user-message-BSPmkm7X.js} +181 -392
- package/dist/turn-wake-DVFVXyhX.js +161 -0
- package/dist/{reporting-window-B3Ze-Qnt.js → user-input-request-CXNIov9n.js} +24 -143
- package/dist/{validation-Du7NdkOR.js → validation-zxAJBDDy.js} +1 -1
- package/dist/{version-EN3Wnq-R.js → version-DcZ40a0g.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-Agxi_o5c.js → viewer-CgiGjW10.js} +3 -3
- package/dist/warmup-CwKbxQLl.js +2698 -0
- package/dist/{worker-BALVdWbv.js → worker-CbDUzaBA.js} +20 -8
- package/migrations/0102_code_change_last_activity.sql +1 -0
- package/migrations/0103_agent_invocation_fork.sql +8 -0
- package/migrations/meta/0102_snapshot.json +4502 -0
- package/migrations/meta/0103_snapshot.json +4509 -0
- package/migrations/meta/_journal.json +14 -0
- package/package.json +4 -4
- package/dist/result-CEqQFrEf.js +0 -305
- package/dist/result-event-type-DD6BAgT7.js +0 -11
- package/dist/warmup-CY2ArYag.js +0 -2017
- package/dist/work-EA98F0ia.js +0 -768
|
@@ -28,6 +28,8 @@ declare const messageAttachmentSchema: z.ZodObject<{
|
|
|
28
28
|
type MessageAttachment = z.output<typeof messageAttachmentSchema>;
|
|
29
29
|
/** True when an Event type names an agent invocation result. */
|
|
30
30
|
declare function isAgentInvocationResultEventType(eventType: string): boolean;
|
|
31
|
+
/** Event type of the `reply` that ends a child agent's Turn. */
|
|
32
|
+
declare const AGENT_REPLY_EVENT_TYPE = "agent.reply";
|
|
31
33
|
/**
|
|
32
34
|
* Build the retry-stable Message id shared by web ingress and browser sends.
|
|
33
35
|
* Keep the existing hash and prefix so retries still address stored Messages.
|
|
@@ -162,82 +164,6 @@ declare const messageCardRefSchema: z.ZodObject<{
|
|
|
162
164
|
type MessageCardRef = z.output<typeof messageCardRefSchema>;
|
|
163
165
|
/** Resolve current saved facts without fetching providers or changing history. */
|
|
164
166
|
declare function resolveMessageCards(refs: readonly MessageCardRef[], annotations: readonly ConversationAnnotation[]): OwnedObjectAnnotation[];
|
|
165
|
-
declare const boardColumnSchema: z.ZodEnum<{
|
|
166
|
-
done: "done";
|
|
167
|
-
in_progress: "in_progress";
|
|
168
|
-
planned: "planned";
|
|
169
|
-
ready: "ready";
|
|
170
|
-
}>;
|
|
171
|
-
declare const boardCardSchema: z.ZodObject<{
|
|
172
|
-
key: z.ZodString;
|
|
173
|
-
column: z.ZodEnum<{
|
|
174
|
-
done: "done";
|
|
175
|
-
in_progress: "in_progress";
|
|
176
|
-
planned: "planned";
|
|
177
|
-
ready: "ready";
|
|
178
|
-
}>;
|
|
179
|
-
objectType: z.ZodEnum<{
|
|
180
|
-
code_change: "code_change";
|
|
181
|
-
task: "task";
|
|
182
|
-
}>;
|
|
183
|
-
title: z.ZodString;
|
|
184
|
-
label: z.ZodString;
|
|
185
|
-
url: z.ZodOptional<z.ZodString>;
|
|
186
|
-
status: z.ZodString;
|
|
187
|
-
updatedAt: z.ZodString;
|
|
188
|
-
conversation: z.ZodObject<{
|
|
189
|
-
conversationId: z.ZodString;
|
|
190
|
-
title: z.ZodOptional<z.ZodString>;
|
|
191
|
-
rootTitle: z.ZodOptional<z.ZodString>;
|
|
192
|
-
}, z.core.$strict>;
|
|
193
|
-
participants: z.ZodArray<z.ZodObject<{
|
|
194
|
-
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
195
|
-
email: z.ZodOptional<z.ZodString>;
|
|
196
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
197
|
-
slackUserId: z.ZodOptional<z.ZodString>;
|
|
198
|
-
slackUserName: z.ZodOptional<z.ZodString>;
|
|
199
|
-
}, z.core.$strict>>;
|
|
200
|
-
working: z.ZodBoolean;
|
|
201
|
-
needsViewer: z.ZodBoolean;
|
|
202
|
-
}, z.core.$strict>;
|
|
203
|
-
declare const boardReportSchema: z.ZodObject<{
|
|
204
|
-
cards: z.ZodArray<z.ZodObject<{
|
|
205
|
-
key: z.ZodString;
|
|
206
|
-
column: z.ZodEnum<{
|
|
207
|
-
done: "done";
|
|
208
|
-
in_progress: "in_progress";
|
|
209
|
-
planned: "planned";
|
|
210
|
-
ready: "ready";
|
|
211
|
-
}>;
|
|
212
|
-
objectType: z.ZodEnum<{
|
|
213
|
-
code_change: "code_change";
|
|
214
|
-
task: "task";
|
|
215
|
-
}>;
|
|
216
|
-
title: z.ZodString;
|
|
217
|
-
label: z.ZodString;
|
|
218
|
-
url: z.ZodOptional<z.ZodString>;
|
|
219
|
-
status: z.ZodString;
|
|
220
|
-
updatedAt: z.ZodString;
|
|
221
|
-
conversation: z.ZodObject<{
|
|
222
|
-
conversationId: z.ZodString;
|
|
223
|
-
title: z.ZodOptional<z.ZodString>;
|
|
224
|
-
rootTitle: z.ZodOptional<z.ZodString>;
|
|
225
|
-
}, z.core.$strict>;
|
|
226
|
-
participants: z.ZodArray<z.ZodObject<{
|
|
227
|
-
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
228
|
-
email: z.ZodOptional<z.ZodString>;
|
|
229
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
230
|
-
slackUserId: z.ZodOptional<z.ZodString>;
|
|
231
|
-
slackUserName: z.ZodOptional<z.ZodString>;
|
|
232
|
-
}, z.core.$strict>>;
|
|
233
|
-
working: z.ZodBoolean;
|
|
234
|
-
needsViewer: z.ZodBoolean;
|
|
235
|
-
}, z.core.$strict>>;
|
|
236
|
-
doneWindowHours: z.ZodNumber;
|
|
237
|
-
}, z.core.$strict>;
|
|
238
|
-
type BoardColumn = z.output<typeof boardColumnSchema>;
|
|
239
|
-
type BoardCard = z.output<typeof boardCardSchema>;
|
|
240
|
-
type BoardReport = z.output<typeof boardReportSchema>;
|
|
241
167
|
declare const dailyConversationActivitySchema: z.ZodObject<{
|
|
242
168
|
active: z.ZodNumber;
|
|
243
169
|
conversations: z.ZodNumber;
|
|
@@ -304,6 +230,7 @@ declare const codeRepositorySummarySchema: z.ZodObject<{
|
|
|
304
230
|
declare const codeChangeSummaryReportSchema: z.ZodObject<{
|
|
305
231
|
closedAt: z.ZodOptional<z.ZodString>;
|
|
306
232
|
id: z.ZodString;
|
|
233
|
+
lastActivityAt: z.ZodOptional<z.ZodString>;
|
|
307
234
|
mergedAt: z.ZodOptional<z.ZodString>;
|
|
308
235
|
number: z.ZodNumber;
|
|
309
236
|
openedAt: z.ZodString;
|
|
@@ -339,6 +266,7 @@ declare const codeOverviewReportSchema: z.ZodObject<{
|
|
|
339
266
|
changes: z.ZodArray<z.ZodObject<{
|
|
340
267
|
closedAt: z.ZodOptional<z.ZodString>;
|
|
341
268
|
id: z.ZodString;
|
|
269
|
+
lastActivityAt: z.ZodOptional<z.ZodString>;
|
|
342
270
|
mergedAt: z.ZodOptional<z.ZodString>;
|
|
343
271
|
number: z.ZodNumber;
|
|
344
272
|
openedAt: z.ZodString;
|
|
@@ -404,6 +332,7 @@ declare const codeRepositoryReportSchema: z.ZodObject<{
|
|
|
404
332
|
changes: z.ZodArray<z.ZodObject<{
|
|
405
333
|
closedAt: z.ZodOptional<z.ZodString>;
|
|
406
334
|
id: z.ZodString;
|
|
335
|
+
lastActivityAt: z.ZodOptional<z.ZodString>;
|
|
407
336
|
mergedAt: z.ZodOptional<z.ZodString>;
|
|
408
337
|
number: z.ZodNumber;
|
|
409
338
|
openedAt: z.ZodString;
|
|
@@ -464,6 +393,7 @@ declare const codePersonReportSchema: z.ZodObject<{
|
|
|
464
393
|
changes: z.ZodArray<z.ZodObject<{
|
|
465
394
|
closedAt: z.ZodOptional<z.ZodString>;
|
|
466
395
|
id: z.ZodString;
|
|
396
|
+
lastActivityAt: z.ZodOptional<z.ZodString>;
|
|
467
397
|
mergedAt: z.ZodOptional<z.ZodString>;
|
|
468
398
|
number: z.ZodNumber;
|
|
469
399
|
openedAt: z.ZodString;
|
|
@@ -795,7 +725,6 @@ declare const conversationSummaryReportSchema: z.ZodObject<{
|
|
|
795
725
|
archivedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
796
726
|
pinnedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
797
727
|
pinPosition: z.ZodOptional<z.ZodNumber>;
|
|
798
|
-
unread: z.ZodOptional<z.ZodBoolean>;
|
|
799
728
|
channel: z.ZodOptional<z.ZodString>;
|
|
800
729
|
channelName: z.ZodOptional<z.ZodString>;
|
|
801
730
|
channelNameRedacted: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1515,6 +1444,8 @@ declare const conversationAgentTreeNodeSchema: z.ZodObject<{
|
|
|
1515
1444
|
thread: "thread";
|
|
1516
1445
|
}>;
|
|
1517
1446
|
label: z.ZodString;
|
|
1447
|
+
agentType: z.ZodOptional<z.ZodString>;
|
|
1448
|
+
fork: z.ZodOptional<z.ZodLiteral<true>>;
|
|
1518
1449
|
}, z.core.$strict>;
|
|
1519
1450
|
type ConversationAgentTreeNode = z.infer<typeof conversationAgentTreeNodeSchema>;
|
|
1520
1451
|
declare const conversationEventPageSchema: z.ZodObject<{
|
|
@@ -1936,7 +1867,6 @@ declare const conversationDetailReportSchema: z.ZodObject<{
|
|
|
1936
1867
|
archivedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1937
1868
|
pinnedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1938
1869
|
pinPosition: z.ZodOptional<z.ZodNumber>;
|
|
1939
|
-
unread: z.ZodOptional<z.ZodBoolean>;
|
|
1940
1870
|
channel: z.ZodOptional<z.ZodString>;
|
|
1941
1871
|
channelName: z.ZodOptional<z.ZodString>;
|
|
1942
1872
|
channelNameRedacted: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -2064,6 +1994,8 @@ declare const conversationDetailReportSchema: z.ZodObject<{
|
|
|
2064
1994
|
thread: "thread";
|
|
2065
1995
|
}>;
|
|
2066
1996
|
label: z.ZodString;
|
|
1997
|
+
agentType: z.ZodOptional<z.ZodString>;
|
|
1998
|
+
fork: z.ZodOptional<z.ZodLiteral<true>>;
|
|
2067
1999
|
}, z.core.$strict>>>;
|
|
2068
2000
|
autoArchive: z.ZodOptional<z.ZodBoolean>;
|
|
2069
2001
|
canFork: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -3042,7 +2974,6 @@ declare const conversationDetailWithMailboxReportSchema: z.ZodObject<{
|
|
|
3042
2974
|
archivedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3043
2975
|
pinnedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3044
2976
|
pinPosition: z.ZodOptional<z.ZodNumber>;
|
|
3045
|
-
unread: z.ZodOptional<z.ZodBoolean>;
|
|
3046
2977
|
channel: z.ZodOptional<z.ZodString>;
|
|
3047
2978
|
channelName: z.ZodOptional<z.ZodString>;
|
|
3048
2979
|
channelNameRedacted: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -3170,6 +3101,8 @@ declare const conversationDetailWithMailboxReportSchema: z.ZodObject<{
|
|
|
3170
3101
|
thread: "thread";
|
|
3171
3102
|
}>;
|
|
3172
3103
|
label: z.ZodString;
|
|
3104
|
+
agentType: z.ZodOptional<z.ZodString>;
|
|
3105
|
+
fork: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3173
3106
|
}, z.core.$strict>>>;
|
|
3174
3107
|
autoArchive: z.ZodOptional<z.ZodBoolean>;
|
|
3175
3108
|
canFork: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -4310,23 +4243,12 @@ type ContinueConversationInSlackResponse = z.infer<typeof continueConversationIn
|
|
|
4310
4243
|
*
|
|
4311
4244
|
* `lastReadSeq` is the event sequence of the last transcript row the viewer
|
|
4312
4245
|
* saw. Reports only move it forward: the server keeps the highest value it
|
|
4313
|
-
* receives.
|
|
4314
|
-
* viewer's own latest Message.
|
|
4246
|
+
* receives. It is never before the viewer's own latest Message.
|
|
4315
4247
|
*/
|
|
4316
4248
|
declare const conversationReadPositionSchema: z.ZodObject<{
|
|
4317
4249
|
lastReadSeq: z.ZodNumber;
|
|
4318
4250
|
}, z.core.$strict>;
|
|
4319
4251
|
type ConversationReadPosition = z.infer<typeof conversationReadPositionSchema>;
|
|
4320
|
-
/**
|
|
4321
|
-
* The reply to a read report: the stored read position and whether Junior's
|
|
4322
|
-
* latest visible reply is still after it. The dashboard clears the unread
|
|
4323
|
-
* flag from this, so it does not refetch the feed after each report.
|
|
4324
|
-
*/
|
|
4325
|
-
declare const conversationReadReportSchema: z.ZodObject<{
|
|
4326
|
-
lastReadSeq: z.ZodNumber;
|
|
4327
|
-
unreadReply: z.ZodBoolean;
|
|
4328
|
-
}, z.core.$strict>;
|
|
4329
|
-
type ConversationReadReport = z.infer<typeof conversationReadReportSchema>;
|
|
4330
4252
|
/**
|
|
4331
4253
|
* The unread rows to summarize: every event after `afterSeq`, through
|
|
4332
4254
|
* `throughSeq`. The dashboard sends the range from when the Conversation
|
|
@@ -4391,19 +4313,6 @@ declare const conversationSubscriptionResponseSchema: z.ZodObject<{
|
|
|
4391
4313
|
}, z.core.$strict>;
|
|
4392
4314
|
type ConversationSubscriptionBody = z.infer<typeof conversationSubscriptionBodySchema>;
|
|
4393
4315
|
type ConversationSubscriptionResponse = z.infer<typeof conversationSubscriptionResponseSchema>;
|
|
4394
|
-
/** Mark one Conversation read or unread for the signed-in viewer. */
|
|
4395
|
-
declare const markConversationUnreadBodySchema: z.ZodObject<{
|
|
4396
|
-
unread: z.ZodBoolean;
|
|
4397
|
-
}, z.core.$strict>;
|
|
4398
|
-
type MarkConversationUnreadBody = z.infer<typeof markConversationUnreadBodySchema>;
|
|
4399
|
-
/**
|
|
4400
|
-
* Whether Junior's latest visible reply is after the viewer's read position
|
|
4401
|
-
* once the change is stored.
|
|
4402
|
-
*/
|
|
4403
|
-
declare const conversationUnreadSchema: z.ZodObject<{
|
|
4404
|
-
unreadReply: z.ZodBoolean;
|
|
4405
|
-
}, z.core.$strict>;
|
|
4406
|
-
type ConversationUnread = z.infer<typeof conversationUnreadSchema>;
|
|
4407
4316
|
/**
|
|
4408
4317
|
* Longest outline item text. The outline previews each message, so the
|
|
4409
4318
|
* server cuts the text and does not send whole messages.
|
|
@@ -4950,7 +4859,6 @@ declare const actorProfileReportSchema: z.ZodObject<{
|
|
|
4950
4859
|
archivedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
4951
4860
|
pinnedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
4952
4861
|
pinPosition: z.ZodOptional<z.ZodNumber>;
|
|
4953
|
-
unread: z.ZodOptional<z.ZodBoolean>;
|
|
4954
4862
|
channel: z.ZodOptional<z.ZodString>;
|
|
4955
4863
|
channelName: z.ZodOptional<z.ZodString>;
|
|
4956
4864
|
channelNameRedacted: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -5386,7 +5294,6 @@ declare const locationDetailReportSchema: z.ZodObject<{
|
|
|
5386
5294
|
archivedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5387
5295
|
pinnedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5388
5296
|
pinPosition: z.ZodOptional<z.ZodNumber>;
|
|
5389
|
-
unread: z.ZodOptional<z.ZodBoolean>;
|
|
5390
5297
|
channel: z.ZodOptional<z.ZodString>;
|
|
5391
5298
|
channelName: z.ZodOptional<z.ZodString>;
|
|
5392
5299
|
channelNameRedacted: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -7867,4 +7774,4 @@ declare const versionsSchema: z.ZodObject<{
|
|
|
7867
7774
|
spend: z.ZodString;
|
|
7868
7775
|
}, z.core.$strict>;
|
|
7869
7776
|
type Versions = z.output<typeof versionsSchema>;
|
|
7870
|
-
export { AutomationVersionList as $,
|
|
7777
|
+
export { AutomationVersionList as $, codeChangeSummarySchema as $i, ConversationDeliveryResponse as $n, steerConversationPendingMessagesBodySchema as $r, isWithinNotificationSchedule as $t, runtimeInfoReportSchema as A, conversationDetailReportSchema as Ai, personParamsSchema as An, ConversationAutoArchive as Ar, workspaceListSchema as At, replyTimeSegmentsReportSchema as B, createConversationMessageBodySchema as Bi, CONVERSATION_TITLE_MAX_LENGTH as Bn, ConversationPendingMessage as Br, personalTokenMetadataSchema as Bt, healthReportSchema as C, isAgentInvocationResultEventType as Ca, ConversationUsage as Ci, ActorTotalsReport as Cn, ConversationStatsItem as Cr, scheduledAutomationSummarySchema as Ct, pluginPackageContentReportSchema as D, MessageAttachment as Da, conversationActivityPreviewSchema as Di, PersonalSpendReport as Dn, conversationStatsReportSchema as Dr, baselineSnapshotSchema as Dt, pluginPackageContentItemReportSchema as E, MAX_INPUT_IMAGE_BYTES as Ea, acceptedConversationMessageSchema as Ei, PersonParams as En, GuardianStats as Er, WorkspaceReport as Et, StatsReport as F, conversationParamsSchema as Fi, conversationWatchesReportSchema as Fn, ConversationFeed as Fr, userCustomizationSchema as Ft, AutomationList as G, CodeActivityDay as Gi, CONVERSATION_OUTLINE_TEXT_LENGTH as Gn, cancelConversationPendingMessagesBodySchema as Gr, serviceAccountParamsSchema as Gt, AutomationExecution as H, forkConversationResponseSchema as Hi, RenameConversationResponse as Hn, ConversationPendingMessagesReport as Hr, revokePersonalTokenResponseSchema as Ht, statSchema as I, conversationReportEventDataSchema as Ii, ConversationChildAgent as In, ConversationFeedItem as Ir, PersonalTokenMetadata as It, AutomationRunList as J, CodePersonReport as Ji, ConversationSubscriptionBody as Jn, conversationPendingAuthorizationSchema as Jr, NotificationSettings as Jt, AutomationListQuery as K, CodeChangeSummaryReport as Ki, ConversationOutline as Kn, cancelConversationPendingMessagesResponseSchema as Kr, serviceAccountSchema as Kt, statsReportSchema as L, conversationReportEventSchema as Li, ConversationChildAgentsReport as Ln, conversationFeedSchema as Lr, createPersonalTokenBodySchema as Lt, skillReportSchema as M, conversationEventPageSchema as Mi, ConversationWatch as Mn, archiveConversationResponseSchema as Mr, workspaceRepoSchema as Mt, skillReportsSchema as N, conversationEventsQuerySchema as Ni, ConversationWatchesReport as Nn, archiveDoneConversationsResponseSchema as Nr, workspaceSchema as Nt, pluginSchema as O, INLINE_VIDEO_TYPES as Oa, conversationAuxiliaryCostsSchema as Oi, actorDirectoryReportSchema as On, ArchiveConversationBody as Or, deleteWorkspaceResponseSchema as Ot, StatReport as P, conversationFeedQuerySchema as Pi, conversationWatchSchema as Pn, conversationAutoArchiveSchema as Pr, USER_CUSTOMIZATION_MAX_CHARS as Pt, AutomationUpdate as Q, codeChangeSummaryReportSchema as Qi, ConversationDeliveryBody as Qn, conversationUnchangedDetailWithMailboxSchema as Qr, NotificationSchedule as Qt, ReplyTimeHistogram as R, conversationSummaryReportSchema as Ri, conversationChildAgentSchema as Rn, CancelConversationPendingMessagesBody as Rr, createdPersonalTokenSchema as Rt, SkillReports as S, AGENT_REPLY_EVENT_TYPE as Sa, ConversationTurnFailureReason as Si, ActorSummaryReport as Sn, ConversationMetricDay as Sr, eventAutomationSummarySchema as St, pluginOperationalReportSchema as T, MAX_INPUT_IMAGES as Ta, CreateConversationMessageBody as Ti, PeopleActivityDayReport as Tn, GuardianMetricDay as Tr, WorkspaceListReport as Tt, AutomationExecutionList as U, conversationTurnFailureCodeSchema as Ui, renameConversationBodySchema as Un, SteerConversationPendingMessagesBody as Ur, disconnectServiceAccountResponseSchema as Ut, AutomationEdit as V, forkConversationBodySchema as Vi, RenameConversationBody as Vn, ConversationPendingMessageDelivery as Vr, personalTokenParamsSchema as Vt, AutomationExecutionStatusDay as W, conversationTurnFailureReasonSchema as Wi, renameConversationResponseSchema as Wn, SteerConversationPendingMessagesResponse as Wr, serviceAccountListSchema as Wt, AutomationScheduleIntent as X, CodeRepositorySummary as Xi, conversationSubscriptionBodySchema as Xn, conversationPendingMessageSchema as Xr, testNotificationResponseSchema as Xt, AutomationRunWindows as Y, CodeRepositoryReport as Yi, ConversationSubscriptionResponse as Yn, conversationPendingMessageDeliverySchema as Yr, notificationSettingsSchema as Yt, AutomationSummary as Z, codeActivityDaySchema as Zi, conversationSubscriptionResponseSchema as Zn, conversationPendingMessagesReportSchema as Zr, DEFAULT_NOTIFICATION_SCHEDULE as Zt, PluginPackageContentReport as _, UserInputRequest as _a, ConversationReportStatus as _i, locationParamsSchema as _n, ContinueConversationInSlackResponse as _r, automationUpdateSchema as _t, ReviewItemPayload as a, ConversationChildAgentTotals as aa, ConversationActivityPreview as ai, startConnectionResponseSchema as an, ReorderPinnedConversationsResponse as ar, automationExecutionSchema as at, SkillDetailReport as b, normalizeUserInputAnswer as ba, ConversationSurface as bi, ActorDirectoryWindows as bn, StopConversationTurnResponse as br, automationVersionParamsSchema as bt, reviewItemListSchema as c, dailyConversationActivitySchema as ca, ConversationCost as ci, LocationActivityDayReport as cn, reorderPinnedConversationsBodySchema as cr, automationListQuerySchema as ct, ReviewItemChangeRecord as d, resolveMessageCards as da, ConversationEventPage as di, LocationDirectoryReport as dn, ConversationCatchUpBody as dr, automationRunListSchema as dt, codeOverviewReportSchema as ea, steerConversationPendingMessagesResponseSchema as ei, notificationScheduleSchema as en, conversationDeliveryBodySchema as er, ListedAutomationVersion as et, HealthReport as f, AutomationTask as fa, ConversationModelUsage as fi, LocationParams as fn, conversationCatchUpBodySchema as fr, automationRunSchema as ft, PluginPackageContentItemReport as g, UserInputField as ga, ConversationReportMessageEvent as gi, locationDirectoryReportSchema as gn, ContinueConversationInSlackBody as gr, automationSummarySchema as gt, PluginOperationalReportFeed as h, UserInputAnswer as ha, ConversationReportEventData as hi, locationDetailReportSchema as hn, conversationReadPositionSchema as hr, automationSchedulePreviewSchema as ht, ReviewItemActionBody as i, codeRepositorySummarySchema as ia, CONVERSATION_VERSION_HEADER as ii, disconnectConnectionResponseSchema as in, ReorderPinnedConversationsBody as ir, automationExecutionListSchema as it, skillDetailReportSchema as j, conversationEventHistorySchema as ji, personalSpendReportSchema as jn, archiveConversationBodySchema as jr, workspaceParamsSchema as jt, pluginsSchema as k, INPUT_IMAGE_TYPES as ka, conversationDetailQuerySchema as ki, actorProfileReportSchema as kn, ArchiveConversationResponse as kr, workspaceBodySchema as kt, reviewItemSchema as l, MessageCard as la, ConversationDetailReport as li, LocationActorSummaryReport as ln, reorderPinnedConversationsResponseSchema as lr, automationListSchema as lt, PluginOperationalReport as m, USER_INPUT_NOTE as ma, ConversationReportEvent as mi, locationActivityDayReportSchema as mn, ConversationReadPosition as mr, automationScheduleIntentSchema as mt, Versions as n, codeRepositoryParamsSchema as na, ActorIdentity as ni, connectionParamsSchema as nn, PinConversationBody as nr, automationEditSchema as nt, reviewItemActionSchema as o, conversationChildAgentTotalsSchema as oa, ConversationAgentTreeNode as oi, ApiError as on, pinConversationBodySchema as or, automationExecutionStatusDaySchema as ot, Plugin as p, AutomationCard as pa, ConversationParams as pi, LocationSummaryReport as pn, conversationCatchUpSchema as pr, automationRunWindowsSchema as pt, AutomationRun as q, CodeOverviewReport as qi, conversationOutlineSchema as qn, conversationDetailWithMailboxReportSchema as qr, startServiceAccountSignInResponseSchema as qt, versionsSchema as r, codeRepositoryReportSchema as ra, CONVERSATION_DETAIL_VERSION_HEADER as ri, connectionSchema as rn, PinConversationResponse as rr, automationEventCatalogSchema as rt, reviewItemCountSchema as s, DailyConversationActivity as sa, ConversationAuxiliaryCosts as si, apiErrorSchema as sn, pinConversationResponseSchema as sr, automationExecutionStatusSchema as st, OwnedObjectAnnotation$1 as t, codePersonReportSchema as ta, AcceptedConversationMessage as ti, connectionListSchema as tn, conversationDeliveryResponseSchema as tr, automationEditErrorSchema as tt, reviewItemWaitingConversationsSchema as u, messageCardText as ua, ConversationEventHistory as ui, LocationDetailReport as un, ConversationCatchUp as ur, automationParamsSchema as ut, Plugins as v, buttonUserInputField as va, ConversationSourceTask as vi, ActorActivityDayReport as vn, continueConversationInSlackBodySchema as vr, automationVersionActivateSchema as vt, pluginOperationalReportFeedSchema as w, InputImage as wa, CreateConversationBody as wi, ActorWindowMetrics as wn, ConversationStatsReport as wr, BaselineSnapshotReport as wt, SkillReport as x, webMessageId as xa, ConversationTurnFailureCode as xi, ActorProfileReport as xn, stopConversationTurnResponseSchema as xr, automationVersionSchema as xt, RuntimeInfoReport as y, isEmptyUserInputAnswer as ya, ConversationSummaryReport as yi, ActorDirectoryReport as yn, continueConversationInSlackResponseSchema as yr, automationVersionListSchema as yt, ReplyTimeSegmentsReport as z, createConversationBodySchema as zi, conversationChildAgentsReportSchema as zn, CancelConversationPendingMessagesResponse as zr, personalTokenListSchema as zt };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { r as notificationScheduleSchema } from "./schedule-cP0AACm1.js";
|
|
2
|
-
import { E as conversationChildAgentTotalsSchema, i as actorIdentitySchema, s as conversationAuxiliaryCostsSchema, x as conversationUsageSchema, y as conversationSummaryReportSchema } from "./conversation-
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
2
|
+
import { E as conversationChildAgentTotalsSchema, i as actorIdentitySchema, s as conversationAuxiliaryCostsSchema, x as conversationUsageSchema, y as conversationSummaryReportSchema } from "./conversation-DCkzvxqB.js";
|
|
3
|
+
import { p as AGENT_INVOCATION_STATUSES, s as userInputRequestSchema } from "./user-input-request-CXNIov9n.js";
|
|
4
|
+
import { i as fillUtcHours, r as fillUtcDays, s as sumUtcHoursIntoSixHours } from "./reporting-window-DopzcOHh.js";
|
|
5
|
+
import "./automation-Cn8qmbdr.js";
|
|
6
|
+
import "./conversation-feed-CMA12Rjs.js";
|
|
6
7
|
import { t as isPushServiceEndpoint } from "./push-endpoint-CO-nomUd.js";
|
|
7
8
|
import * as z from "zod";
|
|
8
9
|
import { codeChangeStateSchema, eventMatchSchema } from "@sentry/junior-plugin-api";
|
|
@@ -50,14 +51,6 @@ const conversationSubscriptionResponseSchema = z.object({
|
|
|
50
51
|
archivedAt: z.string().datetime().nullable(),
|
|
51
52
|
subscribed: z.boolean()
|
|
52
53
|
}).strict();
|
|
53
|
-
// src/api/schema/conversation-unread.ts
|
|
54
|
-
/** Mark one Conversation read or unread for the signed-in viewer. */
|
|
55
|
-
const markConversationUnreadBodySchema = z.object({ unread: z.boolean() }).strict();
|
|
56
|
-
/**
|
|
57
|
-
* Whether Junior's latest visible reply is after the viewer's read position
|
|
58
|
-
* once the change is stored.
|
|
59
|
-
*/
|
|
60
|
-
const conversationUnreadSchema = z.object({ unreadReply: z.boolean() }).strict();
|
|
61
54
|
// src/api/schema/conversation-archive.ts
|
|
62
55
|
/**
|
|
63
56
|
* Archive or restore one conversation. `applyToChildren` applies to a child
|
|
@@ -274,41 +267,6 @@ const conversationWatchesReportSchema = z.object({
|
|
|
274
267
|
conversationId: z.string().min(1),
|
|
275
268
|
watches: z.array(conversationWatchSchema)
|
|
276
269
|
}).strict();
|
|
277
|
-
// src/api/schema/board.ts
|
|
278
|
-
const boardColumnSchema = z.enum([
|
|
279
|
-
"planned",
|
|
280
|
-
"in_progress",
|
|
281
|
-
"ready",
|
|
282
|
-
"done"
|
|
283
|
-
]);
|
|
284
|
-
const boardCardSchema = z.object({
|
|
285
|
-
/** Stable card id. One object gives one card. */
|
|
286
|
-
key: z.string().min(1),
|
|
287
|
-
column: boardColumnSchema,
|
|
288
|
-
objectType: z.enum(["task", "code_change"]),
|
|
289
|
-
title: z.string().min(1),
|
|
290
|
-
/** Short object reference, such as `getsentry/junior#42`. */
|
|
291
|
-
label: z.string().min(1),
|
|
292
|
-
url: z.string().url().optional(),
|
|
293
|
-
status: z.string().min(1),
|
|
294
|
-
/** When the card last changed. A Done card uses its finish time. */
|
|
295
|
-
updatedAt: z.string(),
|
|
296
|
-
conversation: z.object({
|
|
297
|
-
conversationId: z.string().min(1),
|
|
298
|
-
title: z.string().optional(),
|
|
299
|
-
/** Root title when the card comes from a Thread. */
|
|
300
|
-
rootTitle: z.string().optional()
|
|
301
|
-
}).strict(),
|
|
302
|
-
participants: z.array(actorIdentitySchema),
|
|
303
|
-
/** A Turn runs in the Conversation of the card or in one of its Tasks. */
|
|
304
|
-
working: z.boolean(),
|
|
305
|
-
/** The Conversation has an open review item that needs the viewer. */
|
|
306
|
-
needsViewer: z.boolean()
|
|
307
|
-
}).strict();
|
|
308
|
-
const boardReportSchema = z.object({
|
|
309
|
-
cards: z.array(boardCardSchema),
|
|
310
|
-
doneWindowHours: z.number().int().positive()
|
|
311
|
-
}).strict();
|
|
312
270
|
// src/api/schema/code.ts
|
|
313
271
|
const codeChangeSummarySchema = z.object({
|
|
314
272
|
closed: z.number().int().nonnegative(),
|
|
@@ -343,6 +301,11 @@ const codeRepositorySummarySchema = z.object({
|
|
|
343
301
|
const codeChangeSummaryReportSchema = z.object({
|
|
344
302
|
closedAt: z.string().optional(),
|
|
345
303
|
id: z.string().uuid(),
|
|
304
|
+
/**
|
|
305
|
+
* Latest push, review, or comment by a person. Absent when the code
|
|
306
|
+
* plugin has seen no activity; readers fall back to `openedAt`.
|
|
307
|
+
*/
|
|
308
|
+
lastActivityAt: z.string().optional(),
|
|
346
309
|
mergedAt: z.string().optional(),
|
|
347
310
|
number: z.number().int().positive(),
|
|
348
311
|
openedAt: z.string(),
|
|
@@ -881,4 +844,4 @@ const versionsSchema = z.object({
|
|
|
881
844
|
/** The viewer's rolling model spend. */
|
|
882
845
|
spend: z.string().min(1)
|
|
883
846
|
}).strict();
|
|
884
|
-
export { codeActivityDaySchema as $, revokePersonalTokenResponseSchema as A,
|
|
847
|
+
export { codeActivityDaySchema as $, revokePersonalTokenResponseSchema as A, conversationCatchUpSchema as At, activityDays as B, serviceAccountSchema as C, conversationDeliveryBodySchema as Ct, personalTokenListSchema as D, reorderPinnedConversationsBodySchema as Dt, createdPersonalTokenSchema as E, pinConversationResponseSchema as Et, personalSpendReportSchema as F, pushSubscriptionBodySchema as G, activitySixHours as H, locationActivityDayReportSchema as I, connectionListSchema as J, pushSubscriptionDeleteBodySchema as K, locationDetailReportSchema as L, actorProfileReportSchema as M, avatarParamsSchema as N, personalTokenMetadataSchema as O, reorderPinnedConversationsResponseSchema as Ot, personParamsSchema as P, startConnectionResponseSchema as Q, locationDirectoryReportSchema as R, serviceAccountParamsSchema as S, conversationSubscriptionResponseSchema as St, createPersonalTokenBodySchema as T, pinConversationBodySchema as Tt, dailyConversationActivitySchema as U, activityHours as V, notificationSettingsSchema as W, connectionSchema as X, connectionParamsSchema as Y, disconnectConnectionResponseSchema as Z, reviewItemParamsSchema as _, archiveConversationBodySchema as _t, replyTimeSegmentsReportSchema as a, codeRepositoryReportSchema as at, disconnectServiceAccountResponseSchema as b, conversationAutoArchiveSchema as bt, workspaceBodySchema as c, conversationWatchesReportSchema as ct, workspaceRepoSchema as d, continueConversationInSlackBodySchema as dt, codeChangeSummaryReportSchema as et, workspaceSchema as f, continueConversationInSlackResponseSchema as ft, reviewItemListSchema as g, conversationOutlineSchema as gt, reviewItemListQuerySchema as h, CONVERSATION_OUTLINE_TEXT_LENGTH as ht, statsReportSchema as i, codeRepositoryParamsSchema as it, actorDirectoryReportSchema as j, personalTokenParamsSchema as k, conversationCatchUpBodySchema as kt, workspaceListSchema as l, conversationChildAgentSchema as lt, reviewItemCountSchema as m, conversationStatsReportSchema as mt, versionsSchema as n, codeOverviewReportSchema as nt, baselineSnapshotSchema as o, codeRepositorySummarySchema as ot, reviewItemActionSchema as p, stopConversationTurnResponseSchema as pt, testNotificationResponseSchema as q, statSchema as r, codePersonReportSchema as rt, deleteWorkspaceResponseSchema as s, conversationWatchSchema as st, versionsQuerySchema as t, codeChangeSummarySchema as tt, workspaceParamsSchema as u, conversationChildAgentsReportSchema as ut, reviewItemSchema as v, archiveConversationResponseSchema as vt, startServiceAccountSignInResponseSchema as w, conversationDeliveryResponseSchema as wt, serviceAccountListSchema as x, conversationSubscriptionBodySchema as xt, reviewItemWaitingConversationsSchema as y, archiveDoneConversationsResponseSchema as yt, locationParamsSchema as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
2
|
-
import { r as disconnectStateAdapter } from "./state-
|
|
3
|
-
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-DZeD2WbL.js";
|
|
2
|
+
import { r as disconnectStateAdapter } from "./state-CSuA2J1V.js";
|
|
3
|
+
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-GzAMUQ8a.js";
|
|
4
4
|
import { CLI_USAGE } from "./cli/run.js";
|
|
5
5
|
import { createServer } from "node:http";
|
|
6
6
|
// src/cli/service-account.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { G as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-
|
|
2
|
-
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-
|
|
1
|
+
import { G as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-CJTi5niy.js";
|
|
2
|
+
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-9XwqSnM-.js";
|
|
3
3
|
import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
|
|
4
|
-
import { a as getStateAdapter, n as readEncryptedState, t as createEncryptedState } from "./state-
|
|
4
|
+
import { a as getStateAdapter, n as readEncryptedState, t as createEncryptedState } from "./state-CSuA2J1V.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
import { UnauthorizedError, auth } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
+
import { M as normalizeConversationText, ti as cancelSubscriptions, x as toStoredConversationMessage } from "./projection-BgwEE36_.js";
|
|
3
|
+
import { et as nextDetailVersion, r as getConversationEventStore, s as getSqlExecutor, w as isPersonInput } from "./db-CoMNr2Zm.js";
|
|
4
|
+
import { A as juniorConversations } from "./executor-C-m8VrzX.js";
|
|
5
|
+
import { _ as getEventBatchDelayMs, s as instructionForInputs, t as eventReviewItemInputs } from "./prompt-input-BUr4J9RO.js";
|
|
6
|
+
import { a as renderEventBatchInputs, i as isEventMailboxMetadata, r as eventBatchMessageMeta } from "./notification-Bv25xbj0.js";
|
|
7
|
+
import { and, eq, inArray, isNull, lt, lte, or, sql } from "drizzle-orm";
|
|
8
|
+
// src/chat/conversations/sql/subtree.ts
|
|
9
|
+
/** Columns of the `conversation_subtree` table that `conversationSubtree` returns. */
|
|
10
|
+
const conversationSubtreeColumns = {
|
|
11
|
+
conversationId: sql`conversation_subtree.conversation_id`,
|
|
12
|
+
scopeConversationId: sql`conversation_subtree.scope_conversation_id`
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Return a joinable `conversation_subtree` table. It maps each selected
|
|
16
|
+
* Conversation to itself and to each descendant child Conversation at any
|
|
17
|
+
* depth. Reports use it so that a total for a Conversation always includes the
|
|
18
|
+
* work of all its child agents.
|
|
19
|
+
*
|
|
20
|
+
* A descendant must have the same root as the selected Conversation. Thus a
|
|
21
|
+
* Conversation that has no valid root gets only its own work.
|
|
22
|
+
*/
|
|
23
|
+
function conversationSubtree(conversationIds) {
|
|
24
|
+
const selectedIds = sql.join(conversationIds.map((conversationId) => sql`${conversationId}`), sql`, `);
|
|
25
|
+
return sql`(
|
|
26
|
+
with recursive tree(scope_conversation_id, conversation_id, root_conversation_id) as (
|
|
27
|
+
select selected.conversation_id, selected.conversation_id, selected.root_conversation_id
|
|
28
|
+
from junior_conversations selected
|
|
29
|
+
where selected.conversation_id in (${selectedIds})
|
|
30
|
+
union
|
|
31
|
+
select tree.scope_conversation_id, child.conversation_id, child.root_conversation_id
|
|
32
|
+
from junior_conversations child
|
|
33
|
+
join tree
|
|
34
|
+
on child.parent_conversation_id = tree.conversation_id
|
|
35
|
+
and (child.root_conversation_id || '') = tree.root_conversation_id
|
|
36
|
+
)
|
|
37
|
+
select scope_conversation_id, conversation_id from tree
|
|
38
|
+
) conversation_subtree`;
|
|
39
|
+
}
|
|
40
|
+
// src/chat/conversations/session-stop.ts
|
|
41
|
+
var session_stop_exports = /* @__PURE__ */ __exportAll({
|
|
42
|
+
getConversationStoppedAtMs: () => getConversationStoppedAtMs,
|
|
43
|
+
isSkippedAfterConversationStop: () => isSkippedAfterConversationStop,
|
|
44
|
+
isWatchEvent: () => isWatchEvent,
|
|
45
|
+
markConversationsStopped: () => markConversationsStopped,
|
|
46
|
+
resumeStoppedConversationTree: () => resumeStoppedConversationTree,
|
|
47
|
+
skipInputAfterConversationStop: () => skipInputAfterConversationStop
|
|
48
|
+
});
|
|
49
|
+
/** Skip reason on the Message that saves Events for a stopped Conversation. */
|
|
50
|
+
const STOPPED_CONVERSATION_SKIP_REASON = "stopped conversation";
|
|
51
|
+
/**
|
|
52
|
+
* Stop each Conversation until a person sends it input or its parent gives
|
|
53
|
+
* it new work. With `cancelWatches`, an agent stopped them, so their Watches
|
|
54
|
+
* end first: a Watch delivers under its lock, so every Event of a cancelled
|
|
55
|
+
* Watch was received before the stop. A Conversation that already stopped
|
|
56
|
+
* later keeps that stop, so a retried or cascaded stop does not move it back.
|
|
57
|
+
*/
|
|
58
|
+
async function markConversationsStopped(conversationIds, options) {
|
|
59
|
+
if (conversationIds.length === 0) return;
|
|
60
|
+
if (options.cancelWatches) for (const conversationId of conversationIds) await cancelSubscriptions({
|
|
61
|
+
conversationId,
|
|
62
|
+
state: options.state
|
|
63
|
+
});
|
|
64
|
+
const stoppedAt = new Date(options.nowMs ?? Date.now());
|
|
65
|
+
await getSqlExecutor().db().update(juniorConversations).set({
|
|
66
|
+
stoppedAt,
|
|
67
|
+
detailVersion: nextDetailVersion
|
|
68
|
+
}).where(and(inArray(juniorConversations.conversationId, [...conversationIds]), or(isNull(juniorConversations.stoppedAt), lt(juniorConversations.stoppedAt, stoppedAt))));
|
|
69
|
+
}
|
|
70
|
+
/** Return when a Conversation stopped, or undefined when it is not stopped. */
|
|
71
|
+
async function getConversationStoppedAtMs(conversationId) {
|
|
72
|
+
const [row] = await getSqlExecutor().db().select({ stoppedAt: juniorConversations.stoppedAt }).from(juniorConversations).where(eq(juniorConversations.conversationId, conversationId)).limit(1);
|
|
73
|
+
return row?.stoppedAt?.getTime();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* End the stop of a Conversation and of the child agents below it, for new
|
|
77
|
+
* work sent at `sentAtMs`. Nothing changes for work sent at or before the
|
|
78
|
+
* stop, so the input that a stop drops does not undo it.
|
|
79
|
+
* Only Conversations that stopped no later than this Conversation change, so
|
|
80
|
+
* a later stop of one child agent stays in effect.
|
|
81
|
+
*/
|
|
82
|
+
async function resumeStoppedConversationTree(conversationId, sentAtMs) {
|
|
83
|
+
const stoppedAtMs = await getConversationStoppedAtMs(conversationId);
|
|
84
|
+
if (stoppedAtMs === void 0 || sentAtMs <= stoppedAtMs) return;
|
|
85
|
+
await getSqlExecutor().db().update(juniorConversations).set({
|
|
86
|
+
stoppedAt: null,
|
|
87
|
+
detailVersion: nextDetailVersion
|
|
88
|
+
}).where(and(inArray(juniorConversations.conversationId, sql`(select ${conversationSubtreeColumns.conversationId} from ${conversationSubtree([conversationId])})`), lte(juniorConversations.stoppedAt, new Date(stoppedAtMs))));
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Apply a session stop to automated input. Input from a person always runs.
|
|
92
|
+
* When a person sent it after the stop, the Conversation and its child agents
|
|
93
|
+
* stop no more. Input from a parent tool call also runs. While the
|
|
94
|
+
* Conversation is stopped, its Watch Events are saved as one Message and
|
|
95
|
+
* start no Turn, and other Events received at or before the stop are
|
|
96
|
+
* dropped. Returns the work to run, with only the Events that are left, or
|
|
97
|
+
* the finished result when nothing is left.
|
|
98
|
+
*/
|
|
99
|
+
async function skipInputAfterConversationStop(context) {
|
|
100
|
+
const messages = context.attempt.messages;
|
|
101
|
+
const personInput = messages.filter((message) => isPersonInput(message.source));
|
|
102
|
+
if (personInput.length > 0) {
|
|
103
|
+
await resumeStoppedConversationTree(context.conversationId, Math.max(...personInput.map((message) => message.createdAtMs)));
|
|
104
|
+
return { context };
|
|
105
|
+
}
|
|
106
|
+
if (messages.length === 0 || !messages.every(isEventInput)) return { context };
|
|
107
|
+
const stoppedAtMs = await getConversationStoppedAtMs(context.conversationId);
|
|
108
|
+
if (stoppedAtMs === void 0) return { context };
|
|
109
|
+
const saved = messages.filter(isWatchEvent);
|
|
110
|
+
const live = messages.filter((message) => !isSkippedAfterConversationStop(message, stoppedAtMs));
|
|
111
|
+
if (live.length > 0 && saved.length > 0) {
|
|
112
|
+
const delayMs = Math.max(getEventBatchDelayMs(messages), getEventBatchDelayMs(live));
|
|
113
|
+
if (delayMs > 0) return { skipped: {
|
|
114
|
+
status: "deferred",
|
|
115
|
+
delayMs
|
|
116
|
+
} };
|
|
117
|
+
}
|
|
118
|
+
if (saved.length > 0) await saveStoppedConversationEvents(context.conversationId, saved);
|
|
119
|
+
if (live.length === messages.length) return { context };
|
|
120
|
+
if (live.length > 0) return { context: {
|
|
121
|
+
...context,
|
|
122
|
+
attempt: {
|
|
123
|
+
...context.attempt,
|
|
124
|
+
messages: live
|
|
125
|
+
}
|
|
126
|
+
} };
|
|
127
|
+
await context.attempt.ack();
|
|
128
|
+
return { skipped: { status: "completed" } };
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Return whether a session stop at `stoppedAtMs` keeps one Event from
|
|
132
|
+
* starting a Turn: a Watch Event is saved, and another Event received at or
|
|
133
|
+
* before the stop is dropped. Input from a person is never skipped.
|
|
134
|
+
*/
|
|
135
|
+
function isSkippedAfterConversationStop(message, stoppedAtMs) {
|
|
136
|
+
return stoppedAtMs !== void 0 && isEventInput(message) && (isWatchEvent(message) || message.receivedAtMs <= stoppedAtMs);
|
|
137
|
+
}
|
|
138
|
+
function isEventInput(message) {
|
|
139
|
+
return message.source === "event" && isEventMailboxMetadata(message.input.metadata);
|
|
140
|
+
}
|
|
141
|
+
/** Return whether a Watch delivered this input. Agent input has none. */
|
|
142
|
+
function isWatchEvent(message) {
|
|
143
|
+
const metadata = message.input.metadata;
|
|
144
|
+
return isEventMailboxMetadata(metadata) && metadata.event.subscriptionId !== void 0;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Save Events as the one Message that a Turn would save for them. The append
|
|
148
|
+
* is idempotent by Message id, so a retried batch saves nothing new. The
|
|
149
|
+
* Message takes the id of the first saved Event, so when an ack is lost and
|
|
150
|
+
* the retry carries more Events to save, the extra Events are deduplicated
|
|
151
|
+
* away.
|
|
152
|
+
*/
|
|
153
|
+
async function saveStoppedConversationEvents(conversationId, messages) {
|
|
154
|
+
const first = messages[0];
|
|
155
|
+
const { text } = instructionForInputs(renderEventBatchInputs(messages, await eventReviewItemInputs(messages)).map((input) => ({
|
|
156
|
+
kind: "runtime",
|
|
157
|
+
text: input
|
|
158
|
+
})));
|
|
159
|
+
const stored = toStoredConversationMessage({
|
|
160
|
+
id: first.inboundMessageId,
|
|
161
|
+
role: "user",
|
|
162
|
+
text: normalizeConversationText(text),
|
|
163
|
+
createdAtMs: first.createdAtMs,
|
|
164
|
+
...first.input.authorIdentityId ? { authorIdentityId: first.input.authorIdentityId } : void 0,
|
|
165
|
+
meta: {
|
|
166
|
+
replied: false,
|
|
167
|
+
skippedReason: STOPPED_CONVERSATION_SKIP_REASON,
|
|
168
|
+
...eventBatchMessageMeta(messages)
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
const { createdAtMs, ...data } = stored;
|
|
172
|
+
await getConversationEventStore().append(conversationId, [{
|
|
173
|
+
idempotencyKey: `message:${stored.messageId}`,
|
|
174
|
+
createdAtMs,
|
|
175
|
+
data: {
|
|
176
|
+
type: "message",
|
|
177
|
+
...data
|
|
178
|
+
}
|
|
179
|
+
}]);
|
|
180
|
+
}
|
|
181
|
+
export { session_stop_exports as a, conversationSubtreeColumns as c, resumeStoppedConversationTree as i, isSkippedAfterConversationStop as n, skipInputAfterConversationStop as o, markConversationsStopped as r, conversationSubtree as s, getConversationStoppedAtMs as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { h as logWarn } from "./logging-
|
|
2
|
+
import { h as logWarn } from "./logging-CJTi5niy.js";
|
|
3
3
|
import { s as skillRoots } from "./package-discovery-DJhGdS4c.js";
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-DZeD2WbL.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import * as z from "zod";
|
|
7
7
|
import fs from "node:fs/promises";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { O as conversationKindFromRow, o as getDb } from "./db-
|
|
4
|
-
import { A as juniorConversations } from "./executor-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { n as botConfig } from "./config-BOByVnxe.js";
|
|
3
|
+
import { O as conversationKindFromRow, o as getDb } from "./db-CoMNr2Zm.js";
|
|
4
|
+
import { A as juniorConversations } from "./executor-C-m8VrzX.js";
|
|
5
|
+
import { Ft as actorFromRun, It as toolInvocationDestination } from "./agent-runner-Q9GkoerG.js";
|
|
6
|
+
import { A as AgentDepthLimitError, v as createAndEnqueueAgentInvocation } from "./warmup-CwKbxQLl.js";
|
|
7
7
|
import { desc, eq, sql } from "drizzle-orm";
|
|
8
8
|
// src/chat/conversations/lineage.ts
|
|
9
9
|
/**
|
|
@@ -61,6 +61,7 @@ function bindSpawnAgent(run, options) {
|
|
|
61
61
|
actor,
|
|
62
62
|
...input.name ? { agentName: input.name } : void 0,
|
|
63
63
|
...input.agentType ? { agentType: input.agentType } : void 0,
|
|
64
|
+
...input.fork ? { fork: true } : void 0,
|
|
64
65
|
...run.credentialContext ? { credentialContext: run.credentialContext } : void 0,
|
|
65
66
|
destination: toolInvocationDestination(run),
|
|
66
67
|
idempotencyKey: `${run.turnId}:${call.toolCallId}`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
-
import { h as logWarn } from "./logging-
|
|
1
|
+
import { i as getChatConfig } from "./config-BOByVnxe.js";
|
|
2
|
+
import { h as logWarn } from "./logging-CJTi5niy.js";
|
|
3
3
|
import { t as ACTIVE_LOCK_TTL_MS } from "./locks-D-0h111u.js";
|
|
4
4
|
import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
|
|
5
5
|
import { createMemoryState } from "@chat-adapter/state-memory";
|