@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,20 +1,21 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { E as withSpan, S as setTags, h as logWarn, p as logException } from "./logging-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { a as buildDeliveredTurnStatePatch, o as loadPendingMessageCards, r as completeAuthPauseTurn, t as buildTurnThreadContext } from "./thread-context-
|
|
8
|
-
import {
|
|
9
|
-
import { p as
|
|
2
|
+
import { Ii as blockEventAutomation, To as verifyTimerWatchCredentialSubject, Tr as readConversationAutomationRun, Ur as notifyAutomationBlocked, jr as getDispatchIdForConversation, mi as blockScheduledAutomation } from "./credentialed-Dyv8b-lu.js";
|
|
3
|
+
import { A as isTopLevelKind, F as turnBehavior, O as isPersonInput, a as getConversationStore, o as getDb } from "./db-PwSRzWWn.js";
|
|
4
|
+
import { E as withSpan, S as setTags, h as logWarn, p as logException } from "./logging-DNt-qOIO.js";
|
|
5
|
+
import { kt as readMessageAttachments } from "./media-B0pZJ0bG.js";
|
|
6
|
+
import { C as isConversationDeliveryPaused } from "./agent-runner-B5y9MsT-.js";
|
|
7
|
+
import { a as buildDeliveredTurnStatePatch, o as loadPendingMessageCards, r as completeAuthPauseTurn, t as buildTurnThreadContext } from "./thread-context-B8exINEe.js";
|
|
8
|
+
import { Bt as getTurnUserMessage, Ct as isEventMailboxMetadata, E as stopAtAutomatedTurnLimit, Jt as getConversationTurnBoundaryError, Kt as TurnInputCommitLostError, Q as recordChildAgentEnded, St as eventBatchMessageMeta, Tt as timerWatchCredentialSubject, Xt as isTurnInputCommitLostError, _t as resetAutomatedTurnLimit, an as eventInboxItemInputs, d as legacyWebMailboxMetadataSchema, dn as instructionActorFor, en as markTurnFailed, f as childAgentTurnOptions, fn as instructionForInputs, gt as recordFinishedTurnForAutomatedLimit, hn as withoutSavedSteeringMessages, l as sourceFromTurnInput, m as isParentMessageAuthor, mn as turnRequestText, nn as createWebAuthorization, on as loadInboxItemInput, p as commitParentMessageFork, s as getEventBatchDelayMs, tn as startActiveTurn, u as turnInputFactsFromConversationMessage, un as buildSteeringPiMessage, v as supersedeOpenMailboxTurns, vt as AgentRunError, wt as renderEventBatchInputs, yt as executeTurn, zt as completeCancelledConversationTurn } from "./ingest-B0AggUEC.js";
|
|
9
|
+
import { Cn as readParentMessage, Ct as recordDeliveredAssistantMessage, Et as upsertConversationMessage, In as finalizeFailedTurnReplyWithEvent, K as buildDeterministicTurnId, Mt as isEventConversationMessage, Qt as saveTurnCheckpoint, St as normalizeConversationText, X as loadConversationProjection, bt as latestConversationMessageSeq, d as getPersistedThreadState, dr as persistWithRetry, ft as persistConversationMessages, m as coerceThreadConversationState, p as persistThreadStateById, q as commitAcceptedReply, rn as getTurnRecord, tn as failTurnRecord, tr as getAssistantReplyText, u as getPersistedSandboxState, ut as hydrateConversationMessages, wn as getTurnLifecycle, xt as markConversationMessage } from "./turn-membership-DTR3SaKD.js";
|
|
10
|
+
import { p as credentialContextForActor } from "./registry-POH4bZC4.js";
|
|
10
11
|
import { i as getActiveSpan, r as continueTrace } from "./sentry-CPbZjomA.js";
|
|
11
|
-
import {
|
|
12
|
-
import { n as botConfig } from "./config-
|
|
13
|
-
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner
|
|
12
|
+
import { g as measureTurnCompactionWait } from "./warmup-D5hzqTcp.js";
|
|
13
|
+
import { n as botConfig } from "./config-CWbwKj0j.js";
|
|
14
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner--Ke8KSMf.js";
|
|
14
15
|
import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
|
|
15
16
|
import { p as instructionProvenanceFor } from "./history-CYstOMKX.js";
|
|
16
|
-
import {
|
|
17
|
-
import { t as readConversationLineage } from "./lineage-
|
|
17
|
+
import { p as resolveConversationDestination } from "./start-conversation-DbVujrwO.js";
|
|
18
|
+
import { t as readConversationLineage } from "./lineage-BXplQAVH.js";
|
|
18
19
|
import { isDeepStrictEqual } from "node:util";
|
|
19
20
|
import { createHash } from "node:crypto";
|
|
20
21
|
// src/chat/task-execution/turn-telemetry.ts
|
|
@@ -123,13 +124,13 @@ async function commitAssistantMessage(args) {
|
|
|
123
124
|
/**
|
|
124
125
|
* Return the Turn inputs of web Messages, one per non-empty Message, in
|
|
125
126
|
* order. Each one becomes its own prompt content part. A Message that
|
|
126
|
-
* records an answer becomes its
|
|
127
|
+
* records an answer becomes its Inbox item tag. A batch with only
|
|
127
128
|
* attachments keeps one empty input, so the prompt still has an instruction.
|
|
128
129
|
*/
|
|
129
130
|
async function webTurnInputs(messages) {
|
|
130
131
|
const flat = (await mapBounded(messages, async (message) => {
|
|
131
|
-
const
|
|
132
|
-
if (
|
|
132
|
+
const inboxItem = await loadInboxItemInput(message.reviewItemChange);
|
|
133
|
+
if (inboxItem) return [inboxItem];
|
|
133
134
|
const text = message.text.trim();
|
|
134
135
|
return text ? [{
|
|
135
136
|
kind: "person",
|
|
@@ -143,7 +144,7 @@ async function webTurnInputs(messages) {
|
|
|
143
144
|
}
|
|
144
145
|
/**
|
|
145
146
|
* Build the transcript Message for one web mailbox Message. Each web Message
|
|
146
|
-
* keeps its own transcript Message and
|
|
147
|
+
* keeps its own transcript Message and Inbox item change record, so the
|
|
147
148
|
* dashboard shows what each Message did even when several share a Turn.
|
|
148
149
|
*/
|
|
149
150
|
function webConversationMessage(message, author) {
|
|
@@ -173,15 +174,43 @@ function savedTurnInputMessages(conversation, turnMessage, inputMessageIds) {
|
|
|
173
174
|
const saved = (inputMessageIds ?? []).flatMap((id) => conversation.messages.find((message) => message.id === id && message.role === "user") ?? []);
|
|
174
175
|
return saved.some((message) => message.id === turnMessage.id) ? saved : [turnMessage];
|
|
175
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* Render the Turn inputs of one new mailbox batch. A parent batch is the
|
|
179
|
+
* parent's task, as on an Agent invocation. An Event batch also returns the
|
|
180
|
+
* meta of its one saved Message. A web batch returns one transcript Message
|
|
181
|
+
* per input.
|
|
182
|
+
*/
|
|
183
|
+
async function mailboxTurnInputs(batch, fromParent) {
|
|
184
|
+
const messages = batch.map((entry) => entry.message);
|
|
185
|
+
if (fromParent) return {
|
|
186
|
+
eventMeta: {},
|
|
187
|
+
inputs: batch.map(({ message, requestText }) => ({
|
|
188
|
+
kind: "runtime",
|
|
189
|
+
text: message.input.text.trim(),
|
|
190
|
+
...requestText ? { requestText } : void 0
|
|
191
|
+
})),
|
|
192
|
+
webInputMessages: []
|
|
193
|
+
};
|
|
194
|
+
if (isEventMailboxMetadata(messages[0]?.input.metadata)) return {
|
|
195
|
+
eventMeta: eventBatchMessageMeta(messages),
|
|
196
|
+
inputs: renderEventBatchInputs(messages, await eventInboxItemInputs(messages)),
|
|
197
|
+
webInputMessages: []
|
|
198
|
+
};
|
|
199
|
+
return {
|
|
200
|
+
eventMeta: {},
|
|
201
|
+
inputs: await webTurnInputs(messages.map((message) => message.input)),
|
|
202
|
+
webInputMessages: batch.map((entry) => webConversationMessage(entry.message, entry.author))
|
|
203
|
+
};
|
|
204
|
+
}
|
|
176
205
|
// src/chat/task-execution/web-steering.ts
|
|
177
206
|
async function steeringMessageFromWeb(message, actor) {
|
|
178
207
|
const storedAttachments = readMessageAttachments(message.input.attachments);
|
|
179
|
-
const
|
|
208
|
+
const inboxItemInput = await loadInboxItemInput(message.input.reviewItemChange);
|
|
180
209
|
return {
|
|
181
210
|
actor: instructionActorFor(actor),
|
|
182
|
-
...
|
|
211
|
+
...inboxItemInput ? { kind: "runtime" } : void 0,
|
|
183
212
|
provenance: instructionProvenanceFor(actor),
|
|
184
|
-
text:
|
|
213
|
+
text: inboxItemInput?.text ?? message.input.text.trim(),
|
|
185
214
|
timestampMs: message.createdAtMs,
|
|
186
215
|
...storedAttachments.length ? { storedAttachments } : void 0
|
|
187
216
|
};
|
|
@@ -279,7 +308,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
279
308
|
delayMs
|
|
280
309
|
};
|
|
281
310
|
}
|
|
282
|
-
const lifecycle =
|
|
311
|
+
const lifecycle = getTurnLifecycle();
|
|
283
312
|
const isResume = resolved.kind === "resume";
|
|
284
313
|
let turnInputFacts;
|
|
285
314
|
let inputs = [];
|
|
@@ -289,6 +318,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
289
318
|
let startedAtMs = Date.now();
|
|
290
319
|
let inputMessageIds = [];
|
|
291
320
|
let eventMeta = {};
|
|
321
|
+
let fromParent = resolved.kind === "mailbox" && resolved.batch.every((entry) => readParentMessage(entry.message));
|
|
292
322
|
let authorIdentityId;
|
|
293
323
|
let webInputMessages = [];
|
|
294
324
|
const storedConversation = await getConversationStore().get({ conversationId: context.conversationId });
|
|
@@ -302,20 +332,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
302
332
|
if (resolved.kind === "mailbox") {
|
|
303
333
|
const first = resolved.batch[0];
|
|
304
334
|
const messages = resolved.batch.map((entry) => entry.message);
|
|
305
|
-
|
|
306
|
-
if (isEventMailboxMetadata(firstMetadata)) {
|
|
307
|
-
const rendered = await eventReviewItemInputs(messages);
|
|
308
|
-
for (const { message, requestText } of resolved.batch) if (requestText) rendered.set(message.inboundMessageId, {
|
|
309
|
-
kind: "runtime",
|
|
310
|
-
text: message.input.text.trim(),
|
|
311
|
-
requestText
|
|
312
|
-
});
|
|
313
|
-
inputs = renderEventBatchInputs(messages, rendered);
|
|
314
|
-
eventMeta = eventBatchMessageMeta(messages);
|
|
315
|
-
} else {
|
|
316
|
-
inputs = await webTurnInputs(messages.map((message) => message.input));
|
|
317
|
-
webInputMessages = resolved.batch.map((entry) => webConversationMessage(entry.message, entry.author));
|
|
318
|
-
}
|
|
335
|
+
({eventMeta, inputs, webInputMessages} = await mailboxTurnInputs(resolved.batch, fromParent));
|
|
319
336
|
attachments = resolved.batch.flatMap((entry) => readMessageAttachments(entry.message.input.attachments));
|
|
320
337
|
startedAtMs = first.message.createdAtMs;
|
|
321
338
|
userMessageId = first.message.inboundMessageId;
|
|
@@ -332,12 +349,11 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
332
349
|
});
|
|
333
350
|
const savedTurn = isResume ? await getTurnRecord(context.conversationId, turnId) : void 0;
|
|
334
351
|
let savedMessageIsEvent = false;
|
|
335
|
-
let savedParentMessage = false;
|
|
336
352
|
if (isResume) {
|
|
337
353
|
const userMessage = getTurnUserMessage(conversation, turnId);
|
|
338
354
|
if (!userMessage) throw new Error(`Unable to locate the persisted user message for Turn "${turnId}"`);
|
|
339
355
|
savedMessageIsEvent = isEventConversationMessage(userMessage);
|
|
340
|
-
|
|
356
|
+
fromParent = isParentMessageAuthor(userMessage.author);
|
|
341
357
|
turnInputFacts = turnInputFactsFromConversationMessage(userMessage, {
|
|
342
358
|
conversationId: context.conversationId,
|
|
343
359
|
location: storedConversation?.location,
|
|
@@ -347,7 +363,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
347
363
|
});
|
|
348
364
|
const turnInputs = savedTurnInputMessages(conversation, userMessage, await lifecycle.loadInputMessageIds(context.conversationId, turnId));
|
|
349
365
|
userMessageId = userMessage.id;
|
|
350
|
-
inputs = savedMessageIsEvent ? [{
|
|
366
|
+
inputs = savedMessageIsEvent || fromParent ? [{
|
|
351
367
|
kind: "runtime",
|
|
352
368
|
text: userMessage.text,
|
|
353
369
|
...userMessage.meta?.requestText ? { requestText: userMessage.meta.requestText } : void 0
|
|
@@ -365,7 +381,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
365
381
|
const { text } = instructionInputs;
|
|
366
382
|
const instructionActor = instructionActorFor(actor);
|
|
367
383
|
let credentialSubject;
|
|
368
|
-
if (actor.platform === "system") credentialSubject = resolved.kind === "mailbox" ? timerWatchCredentialSubject(context.conversationId, resolved.batch.map((entry) => entry.message)) ?? await verifiedTimerWatchSubject(context.conversationId, sharedDelegatedSubject(resolved.batch),
|
|
384
|
+
if (actor.platform === "system") credentialSubject = resolved.kind === "mailbox" ? timerWatchCredentialSubject(context.conversationId, resolved.batch.map((entry) => entry.message)) ?? await verifiedTimerWatchSubject(context.conversationId, sharedDelegatedSubject(resolved.batch), fromParent) : await verifiedTimerWatchSubject(context.conversationId, savedTurn?.credentialSubject, fromParent);
|
|
369
385
|
const source = sourceFromTurnInput({
|
|
370
386
|
conversationId: context.conversationId,
|
|
371
387
|
source: turnInputFacts.source,
|
|
@@ -464,6 +480,10 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
464
480
|
conversation,
|
|
465
481
|
conversationId: context.conversationId
|
|
466
482
|
});
|
|
483
|
+
await commitParentMessageFork({
|
|
484
|
+
conversationId: context.conversationId,
|
|
485
|
+
inputs: resolved.batch.map((entry) => entry.message)
|
|
486
|
+
});
|
|
467
487
|
await lifecycle.start({
|
|
468
488
|
conversationId: context.conversationId,
|
|
469
489
|
createdAtMs: Date.now(),
|
|
@@ -526,11 +546,9 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
526
546
|
if (stopSignal?.aborted) return await completeCancelledTurn();
|
|
527
547
|
const childTurn = await childAgentTurnOptions({
|
|
528
548
|
conversationId: context.conversationId,
|
|
529
|
-
|
|
530
|
-
inputs: resolved.kind === "mailbox" ? resolved.batch.map((entry) => entry.message) : [],
|
|
531
|
-
savedParentMessage
|
|
549
|
+
fromParent
|
|
532
550
|
});
|
|
533
|
-
const
|
|
551
|
+
const history = await loadConversationProjection({ conversationId: context.conversationId });
|
|
534
552
|
failureCode = "agent_run_failed";
|
|
535
553
|
currentRunId = `conversation-run:${stableHex(turnId, String(startedAtMs))}`;
|
|
536
554
|
setTags({ runId: currentRunId });
|
|
@@ -548,11 +566,11 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
548
566
|
conversation,
|
|
549
567
|
conversationId: context.conversationId,
|
|
550
568
|
excludeMessageIds: inputMessageIds,
|
|
551
|
-
hasHistory:
|
|
569
|
+
hasHistory: history.messages.length > 0,
|
|
552
570
|
turnId
|
|
553
571
|
})
|
|
554
572
|
},
|
|
555
|
-
history
|
|
573
|
+
history,
|
|
556
574
|
...childTurn.run,
|
|
557
575
|
actor,
|
|
558
576
|
credentialContext: credentialContextForActor(actor, credentialSubject),
|
|
@@ -647,17 +665,20 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
647
665
|
surface
|
|
648
666
|
});
|
|
649
667
|
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
668
|
+
if (fromParent) await resetAutomatedTurnLimit({ conversationId: context.conversationId });
|
|
669
|
+
else {
|
|
670
|
+
const automatedTurnLimit = await recordFinishedTurnForAutomatedLimit({
|
|
671
|
+
conversationId: context.conversationId,
|
|
672
|
+
maxTurns: botConfig.maxConsecutiveAutomatedTurns,
|
|
673
|
+
source
|
|
674
|
+
});
|
|
675
|
+
await stopAtAutomatedTurnLimit({
|
|
676
|
+
conversationId: context.conversationId,
|
|
677
|
+
maxTurns: botConfig.maxConsecutiveAutomatedTurns,
|
|
678
|
+
source,
|
|
679
|
+
update: automatedTurnLimit
|
|
680
|
+
});
|
|
681
|
+
}
|
|
661
682
|
completedSuccessfully = reply.diagnostics.outcome === "success";
|
|
662
683
|
return completedSuccessfully ? { outcome: assistantMessageDelivered ? "success" : "no_reply" } : {
|
|
663
684
|
...modelFailureEventId ? { eventId: modelFailureEventId } : void 0,
|
|
@@ -765,6 +786,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
765
786
|
kind: "failed",
|
|
766
787
|
text: failure instanceof Error ? failure.message : String(failure)
|
|
767
788
|
});
|
|
789
|
+
else await recordChildAgentEnded(context.conversationId, "error");
|
|
768
790
|
await acknowledge();
|
|
769
791
|
return { status: "completed" };
|
|
770
792
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Ao as getSlackClient, Xr as postSlackMessage, an as resolveBaseUrl, i as resolvePluginOAuthAccount, in as parseOAuthStatePayload, r as createUserTokenStore, rn as formatProviderLabel, sr as lookupSlackUserProfile } from "./credentialed-Dyv8b-lu.js";
|
|
2
|
+
import { L as acquireActiveLock, i as getRuntimeMetadata, n as botConfig } from "./config-CWbwKj0j.js";
|
|
3
3
|
import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
|
|
4
|
-
import { _ as runBestEffort, h as logWarn, p as logException, q as isNativeIdentityProvider } from "./logging-
|
|
4
|
+
import { _ as runBestEffort, h as logWarn, p as logException, q as isNativeIdentityProvider } from "./logging-DNt-qOIO.js";
|
|
5
5
|
import { p as parseSlackUserId } from "./actor-BsBdxDXQ.js";
|
|
6
|
-
import {
|
|
7
|
-
import { i as getStateAdapter } from "./adapter-
|
|
6
|
+
import { Qt as resolveActorIdentityId, Rt as readIdentityById, in as findUserByVerifiedEmails, ln as upsertLinkedIdentity, s as getSqlExecutor } from "./db-PwSRzWWn.js";
|
|
7
|
+
import { i as getStateAdapter } from "./adapter-CYAvJzZS.js";
|
|
8
8
|
import { i as homeDir } from "./package-discovery-DD9vencX.js";
|
|
9
|
-
import { t as discoverSkills } from "./skills-
|
|
10
|
-
import { d as hasRequiredOAuthScope, n as buildOAuthTokenRequest, r as parseOAuthTokenResponse } from "./registry-
|
|
11
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
12
|
-
import { i as finalizeMcpAuthorization } from "./agent-runner-
|
|
13
|
-
import { O as getMcpProviderErrorAttributes, S as putMcpStoredOAuthCredentials, f as deleteMcpAuthSession, g as getMcpAuthSession, v as getMcpStoredOAuthCredentials } from "./service-account-
|
|
14
|
-
import { d as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { s as readConnectedOAuthTokens, t as escapeHtml, u as htmlCallbackResponse } from "./html-
|
|
18
|
-
import { n as relayLocalOAuthCallback } from "./oauth-relay-
|
|
9
|
+
import { t as discoverSkills } from "./skills-B0jP4whm.js";
|
|
10
|
+
import { d as hasRequiredOAuthScope, n as buildOAuthTokenRequest, r as parseOAuthTokenResponse } from "./registry-POH4bZC4.js";
|
|
11
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-kkE3hvCX.js";
|
|
12
|
+
import { i as finalizeMcpAuthorization } from "./agent-runner-B5y9MsT-.js";
|
|
13
|
+
import { O as getMcpProviderErrorAttributes, S as putMcpStoredOAuthCredentials, f as deleteMcpAuthSession, g as getMcpAuthSession, v as getMcpStoredOAuthCredentials } from "./service-account-o15pZWcJ.js";
|
|
14
|
+
import { Bt as authorizationId, d as getPersistedThreadState, m as coerceThreadConversationState, nt as recordAuthorizationCompleted, qt as getConversationPendingAuth, rn as getTurnRecord, tt as recordAuthenticationLinked } from "./turn-membership-DTR3SaKD.js";
|
|
15
|
+
import { f as readJuniorSecret } from "./vercel-queue-q4z8w5QO.js";
|
|
16
|
+
import { C as wakeAuthorizedTurn, rn as deleteWebAuthorization, w as wakePausedTurn } from "./ingest-B0AggUEC.js";
|
|
17
|
+
import { s as readConnectedOAuthTokens, t as escapeHtml, u as htmlCallbackResponse } from "./html-DidUcRhI.js";
|
|
18
|
+
import { n as relayLocalOAuthCallback } from "./oauth-relay-D-kK0yoN.js";
|
|
19
19
|
import * as z from "zod";
|
|
20
20
|
import path from "node:path";
|
|
21
21
|
import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
|