@sentry/junior 0.311.0 → 0.313.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-B1wujchl.js → adapter-CYAvJzZS.js} +1 -1
- package/dist/{adapter-context-G2M0y6rP.js → adapter-context-CVsHoVSf.js} +2 -2
- package/dist/{admin-DCiBhUT1.js → admin-Cyhb4TwZ.js} +1 -1
- package/dist/{agent-runner-BVHPUIc8.js → agent-runner-B5y9MsT-.js} +3487 -3493
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +6 -6
- package/dist/api.d.ts +2 -2
- package/dist/api.js +294 -311
- package/dist/{app-Cw5Vy6H6.d.ts → app-DA8-hCMj.d.ts} +2 -9
- package/dist/app.d.ts +1 -1
- package/dist/app.js +336 -604
- package/dist/{background-compaction-queue-CJDnWVOJ.js → background-compaction-queue-iZXadLV3.js} +60 -85
- package/dist/{catalog-runtime-DMY3VV-D.js → catalog-runtime-kkE3hvCX.js} +1 -1
- package/dist/channel-access-mt7K6dPh.js +221 -0
- package/dist/cli/chat.js +18 -19
- package/dist/cli/check.js +3 -3
- package/dist/cli/init.js +0 -1
- package/dist/cli/main.js +3 -7
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/run.d.ts +1 -2
- package/dist/cli/run.js +1 -2
- 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-BrXDQefC.js → config-CWbwKj0j.js} +59 -27
- package/dist/{continue-in-slack-DNXSC9So.js → continue-in-slack-CxyFzdlF.js} +7 -8
- package/dist/{conversation-feed-DkinDu5o.js → conversation-feed-BEXLD3Me.js} +86 -21
- package/dist/{conversation-privacy-DxttrKb9.js → conversation-privacy-BrMiDN61.js} +1 -1
- package/dist/{conversation-turn-DWw7Xhdr.js → conversation-turn-B35eu0uz.js} +78 -56
- package/dist/{credential-sync-Bk8wGb8Y.js → credential-sync-DWTOEQrm.js} +15 -15
- package/dist/{projection-Cns7XwWa.js → credentialed-Dyv8b-lu.js} +16306 -20732
- package/dist/{db-7ETESH44.d.ts → db-DYGcXYl3.d.ts} +11 -6
- package/dist/{db-DTxzH7u5.js → db-PwSRzWWn.js} +181 -100
- package/dist/{executor-DqTiYj9S.js → executor-CgWyWfYz.js} +117 -99
- package/dist/{html-B9Sl4Axb.js → html-DidUcRhI.js} +6 -6
- package/dist/ingest-B0AggUEC.js +7931 -0
- package/dist/{install-Sg4ePfLl.js → install-2urLLXNt.js} +2 -2
- package/dist/instrumentation.js +3 -3
- package/dist/{lineage-BHAMpNKr.js → lineage-BXplQAVH.js} +2 -2
- package/dist/{stop-CYsfc0Ed.js → list-DyIyReSV.js} +709 -475
- package/dist/{logging-FjclQsXu.js → logging-DNt-qOIO.js} +1 -1
- package/dist/{schedule-BLJ476XQ.js → media-B0pZJ0bG.js} +1058 -11
- package/dist/{message-CJ7_RL50.js → message-Z5YKC-Af.js} +35 -28
- package/dist/{model-input-CMLh4Cwq.js → model-input-BhPJYdSV.js} +3 -3
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +4 -3
- package/dist/{oauth-callback-server-RVcbiDjL.js → oauth-callback-server-ByvDdcdY.js} +2 -2
- package/dist/{oauth-relay-Bu9kkaQu.js → oauth-relay-D-kK0yoN.js} +1 -1
- package/dist/{registry-BPwuOP2O.js → registry-POH4bZC4.js} +1 -1
- package/dist/reporting-window-C4dbzDiR.js +124 -0
- package/dist/request-deadline-BUiRYQYj.js +24 -0
- package/dist/{resolve-BK29bBry.js → resolve-CWtBNSKP.js} +3 -3
- package/dist/{runner-BcAE-cJm.js → runner-CsZ_VRxp.js} +14 -16
- package/dist/{sandbox-egress-signals-C-q0go5b.js → sandbox-egress-signals-FbCk1FkN.js} +1 -1
- package/dist/{schema-DYcJeV7d.d.ts → schema-DBf18QPS.d.ts} +2773 -3630
- package/dist/{schema-BLgSZXcL.js → schema-DojR2uCL.js} +106 -121
- package/dist/{service-account-iJoCtkHR.js → service-account-CDYb9hfX.js} +3 -3
- package/dist/{service-account-gN0zqf0S.js → service-account-o15pZWcJ.js} +5 -5
- package/dist/{skills-BoZ80epJ.js → skills-B0jP4whm.js} +2 -2
- package/dist/{slack-conversation-unfurl-CogYrITA.js → slack-conversation-unfurl-D26t9kBC.js} +9 -9
- package/dist/{spawn-Dk92r7mX.js → spawn-BjljgExZ.js} +14 -32
- package/dist/start-conversation-DbVujrwO.js +755 -0
- package/dist/{state-DH3Cmgp3.js → state-BTawTCme.js} +4 -4
- package/dist/statuses-BKwqCPhj.js +69 -0
- package/dist/store-CjXrp-Up.js +492 -0
- package/dist/task-queue-Cwlatjz3.js +90 -0
- package/dist/task-runner--Ke8KSMf.js +1432 -0
- package/dist/{thread-context-BW2BsQbH.js → thread-context-B8exINEe.js} +6 -7
- package/dist/turn-membership-DTR3SaKD.js +5859 -0
- package/dist/{validation-DrJd0nnq.js → validation-Ce0qbMlT.js} +1 -1
- package/dist/{task-queue-C_zldF5J.js → vercel-queue-q4z8w5QO.js} +93 -172
- package/dist/{version-CNKZ8owc.js → version-DFh4n9nr.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{warmup-BWdHew2H.js → warmup-D5hzqTcp.js} +4853 -13605
- package/dist/web-message-id-C6P83ans.js +10 -0
- package/dist/{worker-t9qpu_Zx.js → worker-CDg9Lbpg.js} +20 -7
- package/migrations/0143_todos.sql +14 -0
- package/migrations/0144_inbox_items.sql +32 -0
- package/migrations/0145_todo_changed_by_agent.sql +1 -0
- package/migrations/0146_inbox_item_subject_title_parts.sql +1 -0
- package/migrations/0147_inbox_snooze_wake_reason.sql +1 -0
- package/migrations/0148_authorization_request_index.sql +1 -0
- package/migrations/0149_conversation_metadata.sql +10 -0
- package/migrations/0150_conversation_metadata_fill.sql +39 -0
- package/migrations/0151_conversation_search_index.sql +1 -0
- package/migrations/0152_inbox_item_legacy_automation_keys.sql +21 -0
- package/migrations/0153_artifact_expiry.sql +1 -0
- package/migrations/0154_artifact_permanent_sha_index.sql +1 -0
- package/migrations/0155_artifact_drop_public_sha_index.sql +3 -0
- package/migrations/0156_conversation_kind_lead.sql +6 -0
- package/migrations/0157_conversation_lead_actor_index.sql +1 -0
- package/migrations/0158_keep_legacy_archive_columns.sql +5 -0
- package/migrations/0159_conversation_embeddings_fk_validate.sql +5 -0
- package/migrations/meta/0143_snapshot.json +6434 -0
- package/migrations/meta/0144_snapshot.json +6434 -0
- package/migrations/meta/0145_snapshot.json +6440 -0
- package/migrations/meta/0146_snapshot.json +6446 -0
- package/migrations/meta/0147_snapshot.json +6452 -0
- package/migrations/meta/0148_snapshot.json +6474 -0
- package/migrations/meta/0149_snapshot.json +6490 -0
- package/migrations/meta/0150_snapshot.json +6490 -0
- package/migrations/meta/0151_snapshot.json +6505 -0
- package/migrations/meta/0152_snapshot.json +6505 -0
- package/migrations/meta/0153_snapshot.json +6511 -0
- package/migrations/meta/0154_snapshot.json +6533 -0
- package/migrations/meta/0155_snapshot.json +6511 -0
- package/migrations/meta/0156_snapshot.json +6511 -0
- package/migrations/meta/0157_snapshot.json +6527 -0
- package/migrations/meta/0158_snapshot.json +6515 -0
- package/migrations/meta/0159_snapshot.json +6515 -0
- package/migrations/meta/_journal.json +120 -1
- package/package.json +6 -6
- package/skills/design-automation-skill/SKILL.md +108 -0
- package/dist/briefs-BDjnug6Y.js +0 -395
- package/dist/conversation-ca__NDQW.js +0 -1063
- package/dist/prompt-CDqcsDYC.js +0 -910
- package/dist/store-DmmMIrQi.js +0 -335
- package/dist/task-runner-C7oCJQIx.js +0 -294
- package/dist/turn-session-routing-Xh_2nSQe.js +0 -261
- package/dist/web-message-id-Ch5dPq-a.js +0 -306
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import "./
|
|
1
|
+
import { Dt as inputFileSchema, Jt as inboxItemRequestSchema, U as conversationAuxiliaryCostsSchema, Y as conversationParamsSchema, at as idempotencyKeySchema, et as conversationSummaryReportSchema, nt as conversationUsageSchema, s as notificationScheduleSchema, st as conversationChildAgentTotalsSchema, z as actorIdentitySchema } from "./media-B0pZJ0bG.js";
|
|
2
|
+
import { m as TODO_STATUSES, r as AGENT_INVOCATION_STATUSES } from "./statuses-BKwqCPhj.js";
|
|
3
|
+
import "./conversation-feed-BEXLD3Me.js";
|
|
4
|
+
import { i as fillUtcHours, r as fillUtcDays, s as sumUtcHoursIntoSixHours } from "./reporting-window-C4dbzDiR.js";
|
|
5
5
|
import { t as isPushServiceEndpoint } from "./push-endpoint-CO-nomUd.js";
|
|
6
6
|
import * as z from "zod";
|
|
7
7
|
import { codeChangeSizeSchema, codeChangeStateSchema, eventMatchSchema, objectTypeSchema, ownedObjectAnnotationSchema } from "@sentry/junior-plugin-api";
|
|
8
|
+
// src/api/schema/conversation-fork.ts
|
|
9
|
+
/** Body of a request to fork a Conversation at one assistant reply. */
|
|
10
|
+
const forkConversationBodySchema = z.object({
|
|
11
|
+
/** Assistant reply that ends the copied history. */
|
|
12
|
+
messageId: z.string().min(1).max(500),
|
|
13
|
+
idempotencyKey: z.string().trim().min(1).max(200),
|
|
14
|
+
/** Start a hidden, read-only Quick question about this reply text. */
|
|
15
|
+
quickQuestion: z.object({ quote: z.string().trim().min(1).max(4e3) }).strict().optional()
|
|
16
|
+
}).strict();
|
|
17
|
+
/** The Conversation that a fork made. */
|
|
18
|
+
const forkConversationResponseSchema = z.object({ conversationId: z.string() }).strict();
|
|
8
19
|
// src/api/schema/conversation-attachment-upload.ts
|
|
9
20
|
/**
|
|
10
21
|
* Ask to upload one file for a Message. `conversationId` names an existing
|
|
@@ -40,56 +51,11 @@ const conversationCatchUpSchema = z.object({
|
|
|
40
51
|
needsYou: z.string().min(1).optional(),
|
|
41
52
|
summary: z.string().min(1)
|
|
42
53
|
}).strict();
|
|
43
|
-
// src/api/schema/conversation-pin.ts
|
|
44
|
-
/** Pin or unpin one Conversation for the signed-in viewer. */
|
|
45
|
-
const pinConversationBodySchema = z.object({ pinned: z.boolean() }).strict();
|
|
46
|
-
/** The viewer's pin time after the change, or null when unpinned. */
|
|
47
|
-
const pinConversationResponseSchema = z.object({ pinnedAt: z.string().datetime().nullable() }).strict();
|
|
48
|
-
/**
|
|
49
|
-
* The viewer's full Pinned order, first to last. Each pin takes its index as
|
|
50
|
-
* its new place.
|
|
51
|
-
*/
|
|
52
|
-
const reorderPinnedConversationsBodySchema = z.object({ conversationIds: z.array(z.string().min(1)).min(1).max(500).refine((ids) => new Set(ids).size === ids.length, { message: "Each Conversation can appear once." }) }).strict();
|
|
53
|
-
/** The pinned Conversations that got a new place, in order. */
|
|
54
|
-
const reorderPinnedConversationsResponseSchema = z.object({ conversationIds: z.array(z.string()) }).strict();
|
|
55
54
|
// src/api/schema/conversation-delivery.ts
|
|
56
55
|
/** Pause or resume Delivery of a root's Event Turn replies to its Location. */
|
|
57
56
|
const conversationDeliveryBodySchema = z.object({ paused: z.boolean() }).strict();
|
|
58
57
|
/** The Delivery state after the change. */
|
|
59
58
|
const conversationDeliveryResponseSchema = z.object({ paused: z.boolean() }).strict();
|
|
60
|
-
// src/api/schema/conversation-subscription.ts
|
|
61
|
-
/** Subscribe to or unsubscribe from one Conversation for the viewer. */
|
|
62
|
-
const conversationSubscriptionBodySchema = z.object({ subscribed: z.boolean() }).strict();
|
|
63
|
-
/**
|
|
64
|
-
* The viewer's subscription after the change. `archivedAt` is set when the
|
|
65
|
-
* viewer was the last subscriber, so the unsubscribe archived the
|
|
66
|
-
* Conversation for everyone.
|
|
67
|
-
*/
|
|
68
|
-
const conversationSubscriptionResponseSchema = z.object({
|
|
69
|
-
archivedAt: z.string().datetime().nullable(),
|
|
70
|
-
subscribed: z.boolean()
|
|
71
|
-
}).strict();
|
|
72
|
-
/** Invite one mentioned person, by Slack user id, to a public Conversation. */
|
|
73
|
-
const conversationInviteBodySchema = z.object({ slackUserId: z.string().min(1).max(64) }).strict();
|
|
74
|
-
/** `added` is false when the person was already a Participant. */
|
|
75
|
-
const conversationInviteResponseSchema = z.object({ added: z.boolean() }).strict();
|
|
76
|
-
// src/api/schema/conversation-archive.ts
|
|
77
|
-
/**
|
|
78
|
-
* Archive or restore one conversation. `applyToChildren` applies to a child
|
|
79
|
-
* only: archive refuses while a descendant is unarchived unless it is true,
|
|
80
|
-
* and restore also restores the descendants archived with the child when it
|
|
81
|
-
* is true. A root archive is per viewer and writes no child rows.
|
|
82
|
-
*/
|
|
83
|
-
const archiveConversationBodySchema = z.object({
|
|
84
|
-
applyToChildren: z.boolean().optional(),
|
|
85
|
-
archived: z.boolean(),
|
|
86
|
-
lastSeenAt: z.string().datetime()
|
|
87
|
-
}).strict();
|
|
88
|
-
const archiveConversationResponseSchema = z.object({ archivedAt: z.string().datetime().nullable() }).strict();
|
|
89
|
-
/** Viewer's auto-archive choice for one conversation. */
|
|
90
|
-
const conversationAutoArchiveSchema = z.object({ autoArchive: z.boolean() }).strict();
|
|
91
|
-
/** Result of archiving all of the viewer's done conversations once. */
|
|
92
|
-
const archiveDoneConversationsResponseSchema = z.object({ archived: z.number().int().nonnegative() }).strict();
|
|
93
59
|
// src/api/schema/conversation-outline.ts
|
|
94
60
|
/**
|
|
95
61
|
* Longest outline item text and reply. The outline previews each message,
|
|
@@ -136,15 +102,8 @@ const conversationMetricDaySchema = z.object({
|
|
|
136
102
|
inputTokens: z.number().optional(),
|
|
137
103
|
/** Conversation cost split to `mergedCodeChanges`. */
|
|
138
104
|
mergedCodeChangeCostUsd: z.number().optional(),
|
|
139
|
-
/** Code changes merged in this bucket.
|
|
105
|
+
/** Code changes merged in this bucket. */
|
|
140
106
|
mergedCodeChanges: z.number().optional(),
|
|
141
|
-
/** Conversation cost of `outcomes`. */
|
|
142
|
-
outcomeCostUsd: z.number().optional(),
|
|
143
|
-
/**
|
|
144
|
-
* Merged code changes, plus root Conversations without code changes
|
|
145
|
-
* whose latest Brief is `done` or `answered`.
|
|
146
|
-
*/
|
|
147
|
-
outcomes: z.number().optional(),
|
|
148
107
|
tokens: z.number().optional()
|
|
149
108
|
}).strict();
|
|
150
109
|
const guardianMetricDaySchema = z.object({
|
|
@@ -175,25 +134,6 @@ const conversationStatsReportSchema = z.object({
|
|
|
175
134
|
windowEnd: z.string(),
|
|
176
135
|
windowStart: z.string()
|
|
177
136
|
}).strict();
|
|
178
|
-
// src/api/schema/conversation-stop.ts
|
|
179
|
-
/** One queued web message from the viewer that a stop removed. */
|
|
180
|
-
const stoppedConversationMessageSchema = z.object({
|
|
181
|
-
inboundMessageId: z.string().min(1),
|
|
182
|
-
text: z.string().min(1)
|
|
183
|
-
}).strict();
|
|
184
|
-
/**
|
|
185
|
-
* Result of stopping the active Turn.
|
|
186
|
-
*
|
|
187
|
-
* `stoppedInboundMessageIds` lists every queued human message the stop
|
|
188
|
-
* removes. `stoppedMessages` holds only the viewer's own web text, so the
|
|
189
|
-
* dashboard can return it to the composer.
|
|
190
|
-
*/
|
|
191
|
-
const stopConversationTurnResponseSchema = z.object({
|
|
192
|
-
conversationId: z.string().min(1),
|
|
193
|
-
status: z.enum(["no_work", "requested"]),
|
|
194
|
-
stoppedInboundMessageIds: z.array(z.string().min(1)),
|
|
195
|
-
stoppedMessages: z.array(stoppedConversationMessageSchema)
|
|
196
|
-
}).strict();
|
|
197
137
|
// src/api/schema/object-link.ts
|
|
198
138
|
/** The most links that one object request may resolve. */
|
|
199
139
|
const MAX_OBJECT_LINKS = 20;
|
|
@@ -303,8 +243,8 @@ const conversationWatchesReportSchema = z.object({
|
|
|
303
243
|
}).strict();
|
|
304
244
|
/** Route params that name one Watch of one Conversation. */
|
|
305
245
|
const watchParamsSchema = conversationParamsSchema.extend({ watchId: z.string().min(1) }).strict();
|
|
306
|
-
// src/api/schema/
|
|
307
|
-
const
|
|
246
|
+
// src/api/schema/todos.ts
|
|
247
|
+
const todoAssigneeSchema = z.discriminatedUnion("kind", [
|
|
308
248
|
z.object({ kind: z.literal("self") }).strict(),
|
|
309
249
|
z.object({
|
|
310
250
|
kind: z.literal("agent"),
|
|
@@ -317,16 +257,16 @@ const planItemAssigneeSchema = z.discriminatedUnion("kind", [
|
|
|
317
257
|
}).strict()
|
|
318
258
|
]);
|
|
319
259
|
/**
|
|
320
|
-
* One
|
|
260
|
+
* One To-do of a Conversation. Viewers who cannot see private content
|
|
321
261
|
* get the status, assignee kind, and times, but not the title, notes, or
|
|
322
262
|
* names.
|
|
323
263
|
*/
|
|
324
|
-
const
|
|
264
|
+
const conversationTodoSchema = z.object({
|
|
325
265
|
id: z.number().int().positive(),
|
|
326
266
|
title: z.string().min(1).optional(),
|
|
327
267
|
notes: z.string().min(1).optional(),
|
|
328
|
-
status: z.enum(
|
|
329
|
-
assignee:
|
|
268
|
+
status: z.enum(TODO_STATUSES),
|
|
269
|
+
assignee: todoAssigneeSchema,
|
|
330
270
|
/** Name of the person who made the latest change. */
|
|
331
271
|
changedBy: z.string().min(1).optional(),
|
|
332
272
|
redacted: z.literal(true).optional(),
|
|
@@ -334,22 +274,18 @@ const conversationPlanItemSchema = z.object({
|
|
|
334
274
|
}).strict().superRefine((data, context) => {
|
|
335
275
|
if (data.title === void 0 === (data.redacted !== true)) context.addIssue({
|
|
336
276
|
code: "custom",
|
|
337
|
-
message: "
|
|
277
|
+
message: "To-do title must be text or explicitly redacted"
|
|
338
278
|
});
|
|
339
279
|
});
|
|
340
|
-
/** The open
|
|
341
|
-
const
|
|
280
|
+
/** The open To-dos of one Conversation, then the latest closed ones. */
|
|
281
|
+
const conversationTodosReportSchema = z.object({
|
|
342
282
|
conversationId: z.string().min(1),
|
|
343
|
-
|
|
344
|
-
}).strict();
|
|
345
|
-
/** Route parameters of one
|
|
346
|
-
const
|
|
347
|
-
/** Status that a person can set on a
|
|
348
|
-
const
|
|
349
|
-
"pending",
|
|
350
|
-
"done",
|
|
351
|
-
"cancelled"
|
|
352
|
-
]) }).strict();
|
|
283
|
+
todos: z.array(conversationTodoSchema)
|
|
284
|
+
}).strict();
|
|
285
|
+
/** Route parameters of one To-do. */
|
|
286
|
+
const todoParamsSchema = conversationParamsSchema.extend({ todoId: z.coerce.number().int().positive() }).strict();
|
|
287
|
+
/** Status that a person can set on a To-do. */
|
|
288
|
+
const todoStatusBodySchema = z.object({ status: z.enum(TODO_STATUSES) }).strict();
|
|
353
289
|
// src/api/schema/code.ts
|
|
354
290
|
const codeChangeSummarySchema = z.object({
|
|
355
291
|
closed: z.number().int().nonnegative(),
|
|
@@ -628,6 +564,13 @@ const locationDetailReportSchema = locationSummaryReportSchema.extend({
|
|
|
628
564
|
windowEnd: z.string(),
|
|
629
565
|
windowStart: z.string()
|
|
630
566
|
}).strict();
|
|
567
|
+
// src/api/schema/lead.ts
|
|
568
|
+
/** The viewer's Lead. Messages to it use the Conversation message route. */
|
|
569
|
+
const leadSchema = z.object({
|
|
570
|
+
conversationId: z.string().min(1),
|
|
571
|
+
/** The Conversations that the Lead has an active Watch on. */
|
|
572
|
+
watchedConversationIds: z.array(z.string().min(1))
|
|
573
|
+
}).strict();
|
|
631
574
|
// src/api/schema/person.ts
|
|
632
575
|
const personParamsSchema = z.object({ email: z.string().trim().min(1) }).strict();
|
|
633
576
|
/**
|
|
@@ -940,9 +883,9 @@ const updateGatewayProvidersBodySchema = z.object({ enabled: z.array(providerSlu
|
|
|
940
883
|
// src/api/schema/inbox-snooze.ts
|
|
941
884
|
const conversationRowSchema = z.object({
|
|
942
885
|
conversationId: z.string().min(1),
|
|
943
|
-
|
|
886
|
+
inboxItemId: z.string().min(1).optional()
|
|
944
887
|
}).strict();
|
|
945
|
-
const itemRowSchema = z.object({
|
|
888
|
+
const itemRowSchema = z.object({ inboxItemId: z.string().min(1) }).strict();
|
|
946
889
|
/**
|
|
947
890
|
* The Inbox row of a snooze: one Conversation, one item in it, or one item
|
|
948
891
|
* on its own.
|
|
@@ -979,17 +922,39 @@ const inboxSnoozeResourceQuerySchema = z.object({ url: z.string().url().max(2e3)
|
|
|
979
922
|
const INBOX_SNOOZE_MAX_TRIGGERS = 30;
|
|
980
923
|
const snoozeUntil = {
|
|
981
924
|
triggers: z.array(inboxSnoozeTriggerSchema).min(1).max(30).optional(),
|
|
925
|
+
/**
|
|
926
|
+
* No time and no Event: the snooze lasts until the item closes, so it
|
|
927
|
+
* waits until someone else handles it, or the viewer wakes it.
|
|
928
|
+
*/
|
|
929
|
+
untilClosed: z.literal(true).optional(),
|
|
982
930
|
wakeAt: z.string().datetime().optional()
|
|
983
931
|
};
|
|
984
932
|
/**
|
|
985
933
|
* `POST /api/inbox/snoozes` body: hide the row's open items from the viewer
|
|
986
|
-
* until `wakeAt` or one of `triggers` fires, whichever is first
|
|
987
|
-
* item in the row shows by
|
|
934
|
+
* until `wakeAt` or one of `triggers` fires, whichever is first, or with
|
|
935
|
+
* `untilClosed`, until each item closes. A later item in the row shows by
|
|
936
|
+
* itself.
|
|
988
937
|
*/
|
|
989
|
-
const inboxSnoozeCreateSchema = z.union([conversationRowSchema.extend(snoozeUntil).strict(), itemRowSchema.extend(snoozeUntil).strict()]).refine((body) => body.wakeAt !== void 0 || body.triggers !== void 0, { message: "Set wakeAt, triggers, or both." });
|
|
938
|
+
const inboxSnoozeCreateSchema = z.union([conversationRowSchema.extend(snoozeUntil).strict(), itemRowSchema.extend(snoozeUntil).strict()]).refine((body) => body.untilClosed === true !== (body.wakeAt !== void 0 || body.triggers !== void 0), { message: "Set wakeAt, triggers, or both, or set untilClosed alone." });
|
|
990
939
|
/** The items that a snooze hid from the viewer, one snooze each. */
|
|
991
|
-
const inboxSnoozeSchema = z.object({
|
|
992
|
-
|
|
940
|
+
const inboxSnoozeSchema = z.object({ inboxItemIds: z.array(z.string().min(1)).min(1) }).strict();
|
|
941
|
+
/**
|
|
942
|
+
* Why the viewer's snooze of an item woke: its time came, or an Event on
|
|
943
|
+
* `resource`, such as `getsentry/junior#12`. `phrase` says how the Event
|
|
944
|
+
* reads after the resource's name, where its source says.
|
|
945
|
+
*/
|
|
946
|
+
const inboxSnoozeWakeSchema = z.discriminatedUnion("kind", [z.object({ kind: z.literal("time") }).strict(), z.object({
|
|
947
|
+
eventType: z.string().min(1),
|
|
948
|
+
kind: z.literal("event"),
|
|
949
|
+
phrase: z.string().min(1).optional(),
|
|
950
|
+
resource: z.string().min(1)
|
|
951
|
+
}).strict()]);
|
|
952
|
+
/**
|
|
953
|
+
* `DELETE /api/inbox/snoozes/wakes` body: the viewer opened these items, so
|
|
954
|
+
* they no longer show why their snoozes woke.
|
|
955
|
+
*/
|
|
956
|
+
const inboxSnoozeWakesClearSchema = z.object({ inboxItemIds: z.array(z.string().min(1)).min(1).max(100) }).strict();
|
|
957
|
+
// src/api/schema/inbox-item.ts
|
|
993
958
|
const answerSchema = z.object({
|
|
994
959
|
other: z.string().max(4e3).optional(),
|
|
995
960
|
requestId: z.string().min(1),
|
|
@@ -1002,8 +967,8 @@ const personSchema = z.object({
|
|
|
1002
967
|
email: z.string().min(1),
|
|
1003
968
|
userId: z.string().min(1)
|
|
1004
969
|
}).strict();
|
|
1005
|
-
/** One
|
|
1006
|
-
const
|
|
970
|
+
/** One Inbox item as the viewer sees it. */
|
|
971
|
+
const inboxItemSchema = z.object({
|
|
1007
972
|
/**
|
|
1008
973
|
* Names the Conversation that owns the item when it is not
|
|
1009
974
|
* `rootConversationId`, such as a child agent's Thread title.
|
|
@@ -1026,6 +991,11 @@ const reviewItemSchema = z.object({
|
|
|
1026
991
|
closedBy: personSchema.optional(),
|
|
1027
992
|
conversationIds: z.array(z.string().min(1)),
|
|
1028
993
|
createdAt: z.string().datetime(),
|
|
994
|
+
/**
|
|
995
|
+
* Set when the viewer snoozed the open item, and the snooze has not
|
|
996
|
+
* woken. It stays open for the other people it is for.
|
|
997
|
+
*/
|
|
998
|
+
snoozedByViewer: z.literal(true).optional(),
|
|
1029
999
|
id: z.string().min(1),
|
|
1030
1000
|
kind: z.enum(["notice", "action"]),
|
|
1031
1001
|
/** People that the title, body, and question mention. */
|
|
@@ -1055,7 +1025,7 @@ const reviewItemSchema = z.object({
|
|
|
1055
1025
|
title: z.string().min(1)
|
|
1056
1026
|
}).strict())
|
|
1057
1027
|
}).strict().optional(),
|
|
1058
|
-
request:
|
|
1028
|
+
request: inboxItemRequestSchema.optional(),
|
|
1059
1029
|
/**
|
|
1060
1030
|
* The top of the owner Conversation's tree that the viewer can see, at
|
|
1061
1031
|
* any depth: the owner when it is a root, or when the viewer cannot see
|
|
@@ -1082,11 +1052,26 @@ const reviewItemSchema = z.object({
|
|
|
1082
1052
|
*/
|
|
1083
1053
|
resource: inboxSnoozeResourceSchema.optional(),
|
|
1084
1054
|
title: z.string().min(1).optional(),
|
|
1055
|
+
/**
|
|
1056
|
+
* A code change title split by Conventional Commits, as the plugin
|
|
1057
|
+
* that owns the code change parsed it.
|
|
1058
|
+
*/
|
|
1059
|
+
titleParts: z.object({
|
|
1060
|
+
breaking: z.boolean().optional(),
|
|
1061
|
+
scope: z.string().min(1).optional(),
|
|
1062
|
+
text: z.string().min(1),
|
|
1063
|
+
type: z.string().min(1).optional()
|
|
1064
|
+
}).strict().optional(),
|
|
1085
1065
|
url: z.string().min(1).optional()
|
|
1086
1066
|
}).strict().optional(),
|
|
1087
1067
|
title: z.string().min(1),
|
|
1088
1068
|
updatedAt: z.string().datetime(),
|
|
1089
|
-
visibility: z.enum(["public", "private"])
|
|
1069
|
+
visibility: z.enum(["public", "private"]),
|
|
1070
|
+
/**
|
|
1071
|
+
* Why the viewer's snooze of the open item woke. Only that viewer sees
|
|
1072
|
+
* it, until they open or act on the item.
|
|
1073
|
+
*/
|
|
1074
|
+
wake: inboxSnoozeWakeSchema.optional()
|
|
1090
1075
|
}).strict();
|
|
1091
1076
|
/**
|
|
1092
1077
|
* Inbox list filters. The list has the open items that the viewer can
|
|
@@ -1094,7 +1079,7 @@ const reviewItemSchema = z.object({
|
|
|
1094
1079
|
* dismissed items, after the open ones. `status` lists closed items instead,
|
|
1095
1080
|
* with the same visibility.
|
|
1096
1081
|
*/
|
|
1097
|
-
const
|
|
1082
|
+
const inboxItemListQuerySchema = z.object({
|
|
1098
1083
|
conversationId: z.string().min(1).optional(),
|
|
1099
1084
|
/** `nextCursor` of the page before. */
|
|
1100
1085
|
cursor: z.string().min(1).max(1e3).optional(),
|
|
@@ -1136,15 +1121,15 @@ const reviewItemListQuerySchema = z.object({
|
|
|
1136
1121
|
* The first page of a search, or of a list that includes archived items,
|
|
1137
1122
|
* also has the newest archived matches.
|
|
1138
1123
|
*/
|
|
1139
|
-
const
|
|
1140
|
-
items: z.array(
|
|
1124
|
+
const inboxItemListSchema = z.object({
|
|
1125
|
+
items: z.array(inboxItemSchema),
|
|
1141
1126
|
/** Set when more archived items match than the list shows. */
|
|
1142
1127
|
moreArchived: z.boolean().optional(),
|
|
1143
1128
|
/** Set when more open items follow. Pass it as `cursor` to read them. */
|
|
1144
1129
|
nextCursor: z.string().min(1).optional()
|
|
1145
1130
|
}).strict();
|
|
1146
|
-
/** `GET /api/
|
|
1147
|
-
const
|
|
1131
|
+
/** `GET /api/inbox-items/count` query. */
|
|
1132
|
+
const inboxItemCountQuerySchema = z.object({
|
|
1148
1133
|
/**
|
|
1149
1134
|
* Extra counts, comma separated. `automations` counts the viewer's
|
|
1150
1135
|
* Automations that need attention, and `snoozed` their snoozed rows.
|
|
@@ -1152,10 +1137,10 @@ const reviewItemCountQuerySchema = z.object({
|
|
|
1152
1137
|
include: z.string().default("").transform((value) => [...new Set(value.split(",").filter(Boolean))]).pipe(z.array(z.enum(["automations", "snoozed"]))) }).strict();
|
|
1153
1138
|
/**
|
|
1154
1139
|
* The counts behind the Inbox badge, which shows `needsViewer`, and behind
|
|
1155
|
-
* the Inbox entries. An Automation alert is
|
|
1140
|
+
* the Inbox entries. An Automation alert is an Inbox item, so
|
|
1156
1141
|
* `needsViewer` counts it.
|
|
1157
1142
|
*/
|
|
1158
|
-
const
|
|
1143
|
+
const inboxItemCountSchema = z.object({
|
|
1159
1144
|
/**
|
|
1160
1145
|
* The viewer's own Automations that need attention, as the Automations
|
|
1161
1146
|
* entry counts them (`scope=attention&owner=me`). Only with
|
|
@@ -1168,7 +1153,7 @@ const reviewItemCountSchema = z.object({
|
|
|
1168
1153
|
decisions: z.number().int().nonnegative(),
|
|
1169
1154
|
/**
|
|
1170
1155
|
* Open action items assigned to the viewer as a User
|
|
1171
|
-
* (`
|
|
1156
|
+
* (`inboxItemNeedsUser`). Notices and items for Everyone do not count.
|
|
1172
1157
|
*/
|
|
1173
1158
|
needsViewer: z.number().int().nonnegative(),
|
|
1174
1159
|
/**
|
|
@@ -1182,7 +1167,7 @@ const reviewItemCountSchema = z.object({
|
|
|
1182
1167
|
* is the newest such item; `count` is how many there are; `waitingSince` is
|
|
1183
1168
|
* when the oldest was added.
|
|
1184
1169
|
*/
|
|
1185
|
-
const
|
|
1170
|
+
const inboxItemWaitingConversationsSchema = z.object({ conversations: z.array(z.object({
|
|
1186
1171
|
conversationId: z.string().min(1),
|
|
1187
1172
|
/** Open items that need the viewer, newest first. */
|
|
1188
1173
|
items: z.array(z.object({
|
|
@@ -1193,9 +1178,9 @@ const reviewItemWaitingConversationsSchema = z.object({ conversations: z.array(z
|
|
|
1193
1178
|
/** When the oldest of those items was added: when the wait began. */
|
|
1194
1179
|
waitingSince: z.string().datetime()
|
|
1195
1180
|
}).strict()) }).strict();
|
|
1196
|
-
const
|
|
1197
|
-
/** One person action on
|
|
1198
|
-
const
|
|
1181
|
+
const inboxItemParamsSchema = z.object({ id: z.string().min(1) }).strict();
|
|
1182
|
+
/** One person action on an Inbox item. */
|
|
1183
|
+
const inboxItemActionSchema = z.discriminatedUnion("action", [
|
|
1199
1184
|
z.object({ action: z.literal("take") }).strict(),
|
|
1200
1185
|
z.object({ action: z.literal("dismiss") }).strict(),
|
|
1201
1186
|
z.object({
|
|
@@ -1289,9 +1274,9 @@ const versionsSchema = z.object({
|
|
|
1289
1274
|
* can record which inputs moved it.
|
|
1290
1275
|
*/
|
|
1291
1276
|
conversations: z.string().min(1),
|
|
1292
|
-
/** Open
|
|
1293
|
-
|
|
1277
|
+
/** Open Inbox items that need the viewer. */
|
|
1278
|
+
inboxItems: z.string().min(1),
|
|
1294
1279
|
/** The viewer's rolling model spend. */
|
|
1295
1280
|
spend: z.string().min(1)
|
|
1296
1281
|
}).strict();
|
|
1297
|
-
export {
|
|
1282
|
+
export { mentionablePersonSchema as $, conversationStatsReportSchema as $t, cacheHealthQuerySchema as A, codePersonReportSchema as At, serviceAccountParamsSchema as B, todoStatusBodySchema as Bt, inboxSnoozeResourceQuerySchema as C, IDLE_CHANGE_DAYS as Ct, inboxSnoozeWakesClearSchema as D, codeChangeSummaryReportSchema as Dt, inboxSnoozeSubjectSchema as E, codeChangeSearchReportSchema as Et, cacheWarmingSavingsRefillResponseSchema as F, mentionableCodeChangeSchema as Ft, personalTokenListSchema as G, conversationChildAgentsReportSchema as Gt, startServiceAccountSignInResponseSchema as H, conversationWatchesReportSchema as Ht, cacheWarmingSavingsReportSchema as I, personCodeQuerySchema as It, revokePersonalTokenResponseSchema as J, MAX_OBJECT_LINKS as Jt, personalTokenMetadataSchema as K, continueConversationInSlackBodySchema as Kt, closeCacheWarmingBreakerResponseSchema as L, conversationTodoSchema as Lt, cacheWarmingBreakerListSchema as M, codeRepositoryQuerySchema as Mt, cacheWarmingBreakerParamsSchema as N, codeRepositoryReportSchema as Nt, gatewayProvidersSchema as O, codeChangeSummarySchema as Ot, cacheWarmingSavingsQuerySchema as P, codeRepositorySummarySchema as Pt, avatarParamsSchema as Q, objectLinksReportSchema as Qt, disconnectServiceAccountResponseSchema as R, conversationTodosReportSchema as Rt, inboxSnoozeCreateSchema as S, startConnectionResponseSchema as St, inboxSnoozeSchema as T, codeChangeSearchQuerySchema as Tt, createPersonalTokenBodySchema as U, watchParamsSchema as Ut, serviceAccountSchema as V, conversationWatchSchema as Vt, createdPersonalTokenSchema as W, conversationChildAgentSchema as Wt, actorDirectoryReportSchema as X, attachObjectLinkResponseSchema as Xt, PERSON_CARD_RECENT_LIMIT as Y, attachObjectLinkBodySchema as Yt, actorProfileReportSchema as Z, objectLinksQuerySchema as Zt, inboxItemListSchema as _, testNotificationResponseSchema as _t, statsReportSchema as a, conversationCatchUpSchema as an, leadSchema as at, inboxItemWaitingConversationsSchema as b, connectionSchema as bt, workspaceBodySchema as c, createAttachmentUploadBodySchema as cn, locationDirectoryReportSchema as ct, workspaceRepoSchema as d, activityHours as dt, CONVERSATION_OUTLINE_TEXT_LENGTH as en, peopleSearchQuerySchema as et, workspaceSchema as f, activitySixHours as ft, inboxItemListQuerySchema as g, pushSubscriptionDeleteBodySchema as gt, inboxItemCountSchema as h, pushSubscriptionBodySchema as ht, statSchema as i, conversationCatchUpBodySchema as in, personalSpendReportSchema as it, cacheHealthReportSchema as j, codeRepositoryParamsSchema as jt, updateGatewayProvidersBodySchema as k, codeOverviewReportSchema as kt, workspaceListSchema as l, forkConversationBodySchema as ln, locationParamsSchema as lt, inboxItemCountQuerySchema as m, notificationSettingsSchema as mt, versionsQuerySchema as n, conversationDeliveryBodySchema as nn, personCardReportSchema as nt, baselineSnapshotSchema as o, attachmentUploadParamsSchema as on, locationActivityDayReportSchema as ot, inboxItemActionSchema as p, dailyConversationActivitySchema as pt, personalTokenParamsSchema as q, continueConversationInSlackResponseSchema as qt, versionsSchema as r, conversationDeliveryResponseSchema as rn, personParamsSchema as rt, deleteWorkspaceResponseSchema as s, attachmentUploadSchema as sn, locationDetailReportSchema as st, VERSIONS_CONVERSATION_LIMIT as t, conversationOutlineSchema as tn, peopleSearchReportSchema as tt, workspaceParamsSchema as u, forkConversationResponseSchema as un, activityDays as ut, inboxItemParamsSchema as v, connectionListSchema as vt, inboxSnoozeResourceSchema as w, codeActivityDaySchema as wt, INBOX_SNOOZE_MAX_TRIGGERS as x, disconnectConnectionResponseSchema as xt, inboxItemSchema as y, connectionParamsSchema as yt, serviceAccountListSchema as z, todoParamsSchema as zt };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-
|
|
2
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
3
|
-
import { n as disconnectStateAdapter } from "./adapter-
|
|
1
|
+
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-o15pZWcJ.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-kkE3hvCX.js";
|
|
3
|
+
import { n as disconnectStateAdapter } from "./adapter-CYAvJzZS.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,8 +1,8 @@
|
|
|
1
|
-
import { b as setSpanAttributes, h as logWarn } from "./logging-
|
|
2
|
-
import { i as resolvePluginHeaderEnvRefs, l as fetchWithBoundedOAuthErrorBodies } from "./registry-
|
|
3
|
-
import { i as getStateAdapter } from "./adapter-
|
|
4
|
-
import {
|
|
5
|
-
import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-
|
|
1
|
+
import { b as setSpanAttributes, h as logWarn } from "./logging-DNt-qOIO.js";
|
|
2
|
+
import { i as resolvePluginHeaderEnvRefs, l as fetchWithBoundedOAuthErrorBodies } from "./registry-POH4bZC4.js";
|
|
3
|
+
import { i as getStateAdapter } from "./adapter-CYAvJzZS.js";
|
|
4
|
+
import { I as MUTATION_LOCK_TTL_MS, R as fenceLock, n as botConfig, z as withLock } from "./config-CWbwKj0j.js";
|
|
5
|
+
import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-BTawTCme.js";
|
|
6
6
|
import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
|
|
7
7
|
import * as z from "zod";
|
|
8
8
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
2
|
import { s as skillRoots } from "./package-discovery-DD9vencX.js";
|
|
3
|
-
import { h as logWarn } from "./logging-
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
3
|
+
import { h as logWarn } from "./logging-DNt-qOIO.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-kkE3hvCX.js";
|
|
5
5
|
import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
|
|
6
6
|
import * as z from "zod";
|
|
7
7
|
import path from "node:path";
|
package/dist/{slack-conversation-unfurl-CogYrITA.js → slack-conversation-unfurl-D26t9kBC.js}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import {
|
|
2
|
+
import { It as readActorIdentity, V as getConversationIdByProviderConversation, a as getConversationStore, o as getDb, s as getSqlExecutor, vn as readConversationAccessFromSql } from "./db-PwSRzWWn.js";
|
|
3
3
|
import { _ as slackUserIdSchema, b as slackMessageTsSchema, f as parseSlackTeamId, g as slackTeamIdSchema, h as slackChannelIdSchema, m as slackBotIdSchema, n as createSlackActor, p as parseSlackUserId, s as parseActorUserId, u as parseSlackChannelId } from "./actor-BsBdxDXQ.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
import {
|
|
10
|
-
import "./
|
|
4
|
+
import { Bo as getWorkspaceTeamId, Ni as parseDashboardConversationLink, Qr as unfurlSlackLinks, Yr as postSlackEphemeralMessage, ai as escapeSlackMrkdwnText, oi as formatSlackLink, or as lookupSlackBot, sr as lookupSlackUserProfile } from "./credentialed-Dyv8b-lu.js";
|
|
5
|
+
import { P as createCache, n as botConfig } from "./config-CWbwKj0j.js";
|
|
6
|
+
import { E as withSpan } from "./logging-DNt-qOIO.js";
|
|
7
|
+
import { t as runWithSlackInstallation } from "./adapter-context-CVsHoVSf.js";
|
|
8
|
+
import { a as isMovableToSlack, i as continueConversationInSlack, n as alreadyContinuesInSlackMessage, t as BUSY } from "./continue-in-slack-CxyFzdlF.js";
|
|
9
|
+
import { t as checkSlackChannelReadAccess } from "./channel-access-mt7K6dPh.js";
|
|
10
|
+
import { ln as deferConversationMove } from "./turn-membership-DTR3SaKD.js";
|
|
11
11
|
import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
|
|
12
12
|
import * as z from "zod";
|
|
13
13
|
// src/chat/ingress/workspace-membership.ts
|
|
@@ -153,7 +153,7 @@ function parseContinueHereValue(raw) {
|
|
|
153
153
|
}
|
|
154
154
|
async function previewBlocks(args) {
|
|
155
155
|
const title = args.conversation.title ?? "Untitled conversation";
|
|
156
|
-
const summary =
|
|
156
|
+
const summary = args.conversation.summary?.trim();
|
|
157
157
|
const shortSummary = summary && summary.length > MAX_SUMMARY_CHARS ? `${summary.slice(0, 299)}…` : summary;
|
|
158
158
|
return [{
|
|
159
159
|
type: "section",
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
4
|
-
import { t as readConversationLineage } from "./lineage-
|
|
5
|
-
import {
|
|
6
|
-
import { Br as getAgentInvocationId, Fn as createAndEnqueueAgentInvocation, Hr as getUnnamedAgentConversationId, Vr as getAgentInvocationMessageId, Yn as getAgentInvocation, ar as getAgentBinding, tr as AgentDepthLimitError } from "./warmup-BWdHew2H.js";
|
|
2
|
+
import { A as actorFromRun, j as toolInvocationDestination } from "./agent-runner-B5y9MsT-.js";
|
|
3
|
+
import { n as botConfig } from "./config-CWbwKj0j.js";
|
|
4
|
+
import { t as readConversationLineage } from "./lineage-BXplQAVH.js";
|
|
5
|
+
import { G as AgentDepthLimitError, W as spawnChildAgent, bt as getAgentInvocationId, g as createAndEnqueueAgentInvocation, rt as getAgentInvocation } from "./ingest-B0AggUEC.js";
|
|
7
6
|
// src/chat/agent-invocations/spawn.ts
|
|
8
7
|
var spawn_exports = /* @__PURE__ */ __exportAll({ bindSpawnAgent: () => bindSpawnAgent });
|
|
9
8
|
/**
|
|
@@ -15,24 +14,6 @@ async function assertCanStartChildAgent(conversationId, maxAgentDepth) {
|
|
|
15
14
|
const root = lineage[0];
|
|
16
15
|
if (!root || root.parentConversationId || lineage.length - 1 > maxAgentDepth) throw new AgentDepthLimitError(maxAgentDepth);
|
|
17
16
|
}
|
|
18
|
-
/**
|
|
19
|
-
* Return the child of a spawn that already ran without an agent invocation.
|
|
20
|
-
* Its idempotency key keys the task in the child's mailbox. A spawn with an
|
|
21
|
-
* agent invocation replays through that row instead.
|
|
22
|
-
*/
|
|
23
|
-
async function findSpawnedChildAgent(args) {
|
|
24
|
-
const invocationId = getAgentInvocationId(args.parentConversationId, args.idempotencyKey);
|
|
25
|
-
if (await getAgentInvocation(invocationId)) return;
|
|
26
|
-
const childConversationId = args.agentName ? (await getAgentBinding({
|
|
27
|
-
name: args.agentName,
|
|
28
|
-
parentConversationId: args.parentConversationId
|
|
29
|
-
}))?.childConversationId : getUnnamedAgentConversationId(invocationId);
|
|
30
|
-
if (!childConversationId) return;
|
|
31
|
-
return (await getConversationWorkState({
|
|
32
|
-
conversationId: childConversationId,
|
|
33
|
-
state: args.state
|
|
34
|
-
}))?.execution.inboundMessageIds.includes(getAgentInvocationMessageId(invocationId)) ? childConversationId : void 0;
|
|
35
|
-
}
|
|
36
17
|
/** Bind a Run's Actor and credentials to new Agent invocations. */
|
|
37
18
|
function bindSpawnAgent(run, options) {
|
|
38
19
|
const actor = actorFromRun(run);
|
|
@@ -41,15 +22,8 @@ function bindSpawnAgent(run, options) {
|
|
|
41
22
|
call.signal?.throwIfAborted();
|
|
42
23
|
await assertCanStartChildAgent(run.conversationId, options.maxAgentDepth ?? botConfig.maxAgentDepth);
|
|
43
24
|
const idempotencyKey = `${run.turnId}:${call.toolCallId}`;
|
|
44
|
-
const spawned = await findSpawnedChildAgent({
|
|
45
|
-
...input.name ? { agentName: input.name } : void 0,
|
|
46
|
-
idempotencyKey,
|
|
47
|
-
parentConversationId: run.conversationId,
|
|
48
|
-
state: options.state
|
|
49
|
-
});
|
|
50
|
-
if (spawned) return { childConversationId: spawned };
|
|
51
25
|
const queue = typeof options.queue === "function" ? options.queue() : options.queue;
|
|
52
|
-
|
|
26
|
+
const createInput = {
|
|
53
27
|
actor,
|
|
54
28
|
...input.name ? { agentName: input.name } : void 0,
|
|
55
29
|
...input.agentType ? { agentType: input.agentType } : void 0,
|
|
@@ -63,10 +37,18 @@ function bindSpawnAgent(run, options) {
|
|
|
63
37
|
parentToolCallId: call.toolCallId,
|
|
64
38
|
...input.reasoningLevel ? { reasoningLevel: input.reasoningLevel } : void 0,
|
|
65
39
|
...input.title ? { title: input.title } : void 0
|
|
66
|
-
}
|
|
40
|
+
};
|
|
41
|
+
if (await getAgentInvocation(getAgentInvocationId(run.conversationId, idempotencyKey))) return { childConversationId: (await createAndEnqueueAgentInvocation(createInput, {
|
|
67
42
|
...options,
|
|
68
43
|
queue
|
|
69
44
|
})).childConversationId };
|
|
45
|
+
return await spawnChildAgent({
|
|
46
|
+
...createInput,
|
|
47
|
+
parentTurnId: run.turnId
|
|
48
|
+
}, {
|
|
49
|
+
...options,
|
|
50
|
+
queue
|
|
51
|
+
});
|
|
70
52
|
};
|
|
71
53
|
}
|
|
72
54
|
export { spawn_exports as n, bindSpawnAgent as t };
|