@sentry/junior 0.247.0 → 0.248.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-BGwaqDMs.js → admin-BlHz8fGl.js} +1 -1
- package/dist/{agent-hooks-C72ByH0C.js → agent-hooks-DWCHBPYw.js} +24 -11
- package/dist/{agent-runner-DsAFAKKs.js → agent-runner-CnlFtbzb.js} +224 -89
- package/dist/api/schema.d.ts +171 -3
- package/dist/api/schema.js +3 -3
- package/dist/api.js +218 -155
- package/dist/{app-4t4mPTdS.d.ts → app-B0gT1Slp.d.ts} +3 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +27 -27
- package/dist/{assistant-reply-ChOzcTBS.js → assistant-reply-BxCi7V4v.js} +1 -1
- package/dist/{briefs-Dc7qZrhc.js → briefs-CdkIl79U.js} +4 -4
- package/dist/{catalog-runtime-DS1k7fUG.js → catalog-runtime-CTBsdSam.js} +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-BVnfNd3D.js → client-CWQtbizj.js} +2 -2
- package/dist/{config-CgWvImQL.js → config-aitDvTQm.js} +16 -9
- package/dist/{conversation-CYsbVFLx.js → conversation-Cjo9tHGm.js} +15 -1
- package/dist/{conversation-privacy-D3TdVM9H.js → conversation-privacy-BsqXHVBz.js} +1 -1
- package/dist/{credential-sync-DLw3jkv-.js → credential-sync-DqZF735a.js} +14 -14
- package/dist/{executor-DQazjeGA.js → executor-oIZAkQZb.js} +2 -2
- package/dist/{images-C3e5E-p_.js → images-Dzh3RBXY.js} +3 -3
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-BEUqRhjC.js → job-queue-DyA2AEnY.js} +1 -1
- package/dist/{logging-CZEc8_v4.js → logging-OpC2jwiV.js} +1 -1
- package/dist/{message-BIJa7lKh.js → message-EyMrVXEf.js} +3 -3
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-R9OSdLP1.js → oauth-callback-server-ClDv9Z5Y.js} +2 -2
- package/dist/{pending-auth-Oo5AQhaf.js → pending-auth-D_nf121N.js} +2 -2
- package/dist/{profile-aVLDAirh.js → profile-Dfg76pvk.js} +4 -4
- package/dist/{prompt-ZG1UCxjF.js → prompt-C7bRJ2vg.js} +1 -1
- package/dist/{registry-CtaDOOM5.js → registry-fpIZHoqE.js} +1 -1
- package/dist/{resolve-Bdw4hu7s.js → resolve-LMCZhQVg.js} +2 -2
- package/dist/{result-DNgmkASh.js → result-C1ZCRPLx.js} +7 -7
- package/dist/{runner-BUSScEu5.js → runner-DNZMviFH.js} +10 -10
- package/dist/{sandbox-egress-signals-E9r8bf9G.js → sandbox-egress-signals-Dcc-mwkl.js} +1 -1
- package/dist/{schema-tyd6hALh.js → schema-BRZsYL5-.js} +4 -3
- package/dist/{session-stop-CAhBfBUT.js → session-stop-dyvsZDB0.js} +11 -11
- package/dist/{skills-DQy-mmBC.js → skills-BgGiQt5Y.js} +2 -2
- package/dist/{spawn-DQ_MVWZ6.js → spawn-CpqxMPWE.js} +2 -2
- package/dist/{store-DjLA8GKs.js → store-OMQAFrJG.js} +6 -6
- package/dist/{task-queue-BT2h_t8I.js → task-queue-SWsXPSp-.js} +3 -3
- package/dist/{task-runner-CiPepjIB.js → task-runner-BOxv7shv.js} +10 -10
- package/dist/{tasks-DMmRrIVl.js → tasks-DREdnhVP.js} +49 -16
- package/dist/{thread-state-ehZYGpX9.js → thread-state-BoNCtSwk.js} +6 -6
- package/dist/{turn-failure-response-D7J10z7l.js → turn-failure-response-C6jrCPjc.js} +8 -8
- package/dist/{turn-lifecycle-Buswqs90.js → turn-lifecycle-cQFsZFOU.js} +1 -1
- package/dist/{turn-session-routing-Bw-yiSb4.js → turn-session-routing-Ba12fwXz.js} +1 -1
- package/dist/{validation-DTguegIe.js → validation-Dmfh2cTj.js} +1 -1
- package/dist/{version-BrZSE5du.js → version-ByV7nGOn.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-BlAozHer.js → viewer-CX41TWYr.js} +3 -3
- package/dist/{web-authorization-DwyTlkAg.js → web-authorization-rDLlKIS0.js} +6 -6
- package/dist/{web-input-DSYxI7Wi.js → web-input-Bn9HHZEo.js} +28 -28
- package/dist/{work-CRBXkJoU.js → work-CvFoEpRT.js} +10 -10
- package/dist/{worker-BVJKM9Ja.js → worker-CI5B63vk.js} +5 -5
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as sandboxEgressSignalsResponseSchema } from "./agent-runner-
|
|
1
|
+
import { At as sandboxEgressSignalsResponseSchema } from "./agent-runner-CnlFtbzb.js";
|
|
2
2
|
//#region src/chat/local/sandbox-egress-signals.ts
|
|
3
3
|
const SANDBOX_EGRESS_SIGNALS_PATH = "/api/internal/sandbox-egress/signals";
|
|
4
4
|
const LOCAL_DEV_SERVER_TIMEOUT_MS = 1e3;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as AGENT_INVOCATION_STATUSES, u as juniorDestinationKindSchema } from "./agent-invocations-D_YoNnAn.js";
|
|
2
|
-
import { D as conversationUsageSchema, E as conversationSummaryReportSchema, l as conversationAuxiliaryCostsSchema, n as actorIdentitySchema, w as conversationStatsItemSchema } from "./conversation-
|
|
2
|
+
import { D as conversationUsageSchema, E as conversationSummaryReportSchema, M as conversationChildAgentTotalsSchema, l as conversationAuxiliaryCostsSchema, n as actorIdentitySchema, w as conversationStatsItemSchema } from "./conversation-Cjo9tHGm.js";
|
|
3
3
|
import "./automation-gznOMaQ2.js";
|
|
4
4
|
import { a as fillUtcHours, c as sumUtcHoursIntoSixHours, i as fillUtcDays } from "./web-message-id-xPI_EFSC.js";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -33,11 +33,12 @@ const stopConversationTurnResponseSchema = z.object({
|
|
|
33
33
|
* One direct child agent of a Conversation, from agent invocation records.
|
|
34
34
|
*
|
|
35
35
|
* Viewers who cannot see private content get the status, time, and usage, but
|
|
36
|
-
* not the name, task, title, or error. Usage covers the child Conversation
|
|
37
|
-
*
|
|
36
|
+
* not the name, task, title, or error. Usage covers the child Conversation and
|
|
37
|
+
* all its own child agents, like the detail of that child Conversation.
|
|
38
38
|
*/
|
|
39
39
|
const conversationChildAgentSchema = z.object({
|
|
40
40
|
auxiliaryCosts: conversationAuxiliaryCostsSchema.optional(),
|
|
41
|
+
childAgentTotals: conversationChildAgentTotalsSchema.optional(),
|
|
41
42
|
conversationId: z.string().min(1),
|
|
42
43
|
cumulativeDurationMs: z.number(),
|
|
43
44
|
cumulativeUsage: conversationUsageSchema.optional(),
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { d as logException, f as logInfo, p as logWarn } from "./logging-
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
4
|
-
import { f as getSqlExecutor, u as getConversationStore } from "./viewer-
|
|
2
|
+
import { d as logException, f as logInfo, p as logWarn } from "./logging-OpC2jwiV.js";
|
|
3
|
+
import { n as botConfig } from "./config-aitDvTQm.js";
|
|
4
|
+
import { f as getSqlExecutor, u as getConversationStore } from "./viewer-CX41TWYr.js";
|
|
5
5
|
import { s as juniorConversations } from "./agent-invocations-D_YoNnAn.js";
|
|
6
|
-
import "./executor-
|
|
7
|
-
import { p as credentialSubjectSchema } from "./registry-
|
|
8
|
-
import { V as postSlackMessage,
|
|
9
|
-
import {
|
|
10
|
-
import { w as getStateAdapter } from "./profile-
|
|
11
|
-
import { r as sanitizeAssistantText } from "./assistant-reply-
|
|
12
|
-
import { r as EVENT_AUTHOR_ID } from "./prompt-
|
|
13
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
6
|
+
import "./executor-oIZAkQZb.js";
|
|
7
|
+
import { p as credentialSubjectSchema } from "./registry-fpIZHoqE.js";
|
|
8
|
+
import { V as postSlackMessage, _t as isToolResultError, ht as isAssistantMessage, vt as isToolResultMessage, wt as ToolInputError, yt as normalizeToolNameFromResult } from "./tasks-DREdnhVP.js";
|
|
9
|
+
import { nt as verifyTimerWatchCredentialSubject, rt as JUNIOR_THREAD_STATE_TTL_MS, u as getPlugins } from "./agent-hooks-DWCHBPYw.js";
|
|
10
|
+
import { w as getStateAdapter } from "./profile-Dfg76pvk.js";
|
|
11
|
+
import { r as sanitizeAssistantText } from "./assistant-reply-BxCi7V4v.js";
|
|
12
|
+
import { r as EVENT_AUTHOR_ID } from "./prompt-C7bRJ2vg.js";
|
|
13
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-OMQAFrJG.js";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
import { eq, inArray } from "drizzle-orm";
|
|
16
16
|
import { eventMatchSchema, normalizeEventIdentifier, objectTypeSchema } from "@sentry/junior-plugin-api";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { p as logWarn } from "./logging-
|
|
2
|
+
import { p as logWarn } from "./logging-OpC2jwiV.js";
|
|
3
3
|
import { s as skillRoots } from "./package-discovery-BVvSnQBB.js";
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-CTBsdSam.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import fs from "node:fs/promises";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { Bt as toolInvocationDestination, zt as actorFromRun } from "./agent-runner-
|
|
3
|
-
import { n as createAndEnqueueAgentInvocation } from "./work-
|
|
2
|
+
import { Bt as toolInvocationDestination, zt as actorFromRun } from "./agent-runner-CnlFtbzb.js";
|
|
3
|
+
import { n as createAndEnqueueAgentInvocation } from "./work-CvFoEpRT.js";
|
|
4
4
|
//#region src/chat/agent-invocations/spawn.ts
|
|
5
5
|
var spawn_exports = /* @__PURE__ */ __exportAll({ bindSpawnAgent: () => bindSpawnAgent });
|
|
6
6
|
/** Bind a Run's Actor and credentials to new Agent invocations. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { I as isRecord, L as toOptionalNumber, R as toOptionalString } from "./logging-
|
|
2
|
-
import { i as getChatConfig } from "./config-
|
|
1
|
+
import { I as isRecord, L as toOptionalNumber, R as toOptionalString } from "./logging-OpC2jwiV.js";
|
|
2
|
+
import { i as getChatConfig } from "./config-aitDvTQm.js";
|
|
3
3
|
import { s as parseStoredSlackActor } from "./actor-BTtLaeWy.js";
|
|
4
|
-
import { F as sameDestination, N as parseDestination, u as getConversationStore } from "./viewer-
|
|
5
|
-
import {
|
|
6
|
-
import { C as getDefaultRedisStateAdapterFor, w as getStateAdapter } from "./profile-
|
|
7
|
-
import "./job-queue-
|
|
4
|
+
import { F as sameDestination, N as parseDestination, u as getConversationStore } from "./viewer-CX41TWYr.js";
|
|
5
|
+
import { rt as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-DWCHBPYw.js";
|
|
6
|
+
import { C as getDefaultRedisStateAdapterFor, w as getStateAdapter } from "./profile-Dfg76pvk.js";
|
|
7
|
+
import "./job-queue-DyA2AEnY.js";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
10
10
|
import { destinationSchema } from "@sentry/junior-plugin-api";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as logWarn } from "./logging-
|
|
2
|
-
import { c as QUEUE_SIGNATURE_MAX_AGE_MS, d as createVercelQueueClient, l as signQueueMessage, p as runWithTurnRequestDeadline, u as verifyQueueMessage } from "./job-queue-
|
|
1
|
+
import { p as logWarn } from "./logging-OpC2jwiV.js";
|
|
2
|
+
import { c as QUEUE_SIGNATURE_MAX_AGE_MS, d as createVercelQueueClient, l as signQueueMessage, p as runWithTurnRequestDeadline, u as verifyQueueMessage } from "./job-queue-DyA2AEnY.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
import { handleCallback, registerDevConsumer } from "@vercel/queue";
|
|
@@ -115,7 +115,7 @@ function pluginTaskCallback() {
|
|
|
115
115
|
maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
|
|
116
116
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
117
117
|
run: async (message) => {
|
|
118
|
-
const { processPluginTask } = await import("./task-runner-
|
|
118
|
+
const { processPluginTask } = await import("./task-runner-BOxv7shv.js").then((n) => n.r);
|
|
119
119
|
await processPluginTask(message);
|
|
120
120
|
},
|
|
121
121
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { h as runBestEffort, p as logWarn } from "./logging-
|
|
2
|
+
import { h as runBestEffort, p as logWarn } from "./logging-OpC2jwiV.js";
|
|
3
3
|
import { g as parseSlackMessageTs } from "./actor-BTtLaeWy.js";
|
|
4
|
-
import { C as agentTurnTotalTokens, S as agentTurnCostUsd, d as getDb, r as readActorIdentity, u as getConversationStore } from "./viewer-
|
|
4
|
+
import { C as agentTurnTotalTokens, S as agentTurnCostUsd, d as getDb, r as readActorIdentity, u as getConversationStore } from "./viewer-CX41TWYr.js";
|
|
5
5
|
import { s as juniorConversations } from "./agent-invocations-D_YoNnAn.js";
|
|
6
|
-
import { c as juniorAutomationExecutions } from "./executor-
|
|
6
|
+
import { c as juniorAutomationExecutions } from "./executor-oIZAkQZb.js";
|
|
7
7
|
import { p as sameActorIdentity } from "./history-Nte1oVed.js";
|
|
8
|
-
import { p as credentialSubjectSchema } from "./registry-
|
|
9
|
-
import {
|
|
10
|
-
import { ct as
|
|
11
|
-
import { w as getStateAdapter } from "./profile-
|
|
12
|
-
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
13
|
-
import { t as resolveConversationRouting } from "./turn-session-routing-
|
|
14
|
-
import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-
|
|
8
|
+
import { p as credentialSubjectSchema } from "./registry-fpIZHoqE.js";
|
|
9
|
+
import { Gt as hydrateConversationMessages, M as formatSlackLink, Q as getTurnRecord, V as postSlackMessage, Zt as fallbackShortTitle, _t as isToolResultError, a as readScheduledAutomation, g as getEventAutomation, j as escapeSlackMrkdwnText, mt as instructionTextForProjection, u as blockEventAutomation, ut as getPiMessageRole, vt as isToolResultMessage, xt as stripRuntimeTurnContext, yt as normalizeToolNameFromResult, z as openSlackDirectMessage } from "./tasks-DREdnhVP.js";
|
|
10
|
+
import { ct as createPluginState, dt as createPluginLogger, lt as createPluginEmbedder, ot as getDashboardTaskLink, p as coreTaskRegistrations, rt as JUNIOR_THREAD_STATE_TTL_MS, u as getPlugins, ut as createPluginModel, xt as createPluginConversationEvents } from "./agent-hooks-DWCHBPYw.js";
|
|
11
|
+
import { w as getStateAdapter } from "./profile-Dfg76pvk.js";
|
|
12
|
+
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-BoNCtSwk.js";
|
|
13
|
+
import { t as resolveConversationRouting } from "./turn-session-routing-Ba12fwXz.js";
|
|
14
|
+
import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-SWsXPSp-.js";
|
|
15
15
|
import { z } from "zod";
|
|
16
16
|
import { createHash } from "node:crypto";
|
|
17
17
|
import { and, asc, count, desc, eq, gte, inArray, lte, max, or, sql } from "drizzle-orm";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { d as unwrapCurrentInstruction, f as escapeXml, i as completeText, o as resolveGatewayModel } from "./client-
|
|
2
|
-
import { d as logException, o as getActiveTraceId, p as logWarn, s as getLogContextAttributes, t as buildTurnFailureResponse, v as setSpanAttributes } from "./logging-
|
|
1
|
+
import { d as unwrapCurrentInstruction, f as escapeXml, i as completeText, o as resolveGatewayModel } from "./client-CWQtbizj.js";
|
|
2
|
+
import { d as logException, o as getActiveTraceId, p as logWarn, s as getLogContextAttributes, t as buildTurnFailureResponse, v as setSpanAttributes } from "./logging-OpC2jwiV.js";
|
|
3
3
|
import { n as captureMessage } from "./sentry-CgWZM_kV.js";
|
|
4
|
-
import { n as botConfig, v as normalizeSlackEmojiName } from "./config-
|
|
4
|
+
import { n as botConfig, v as normalizeSlackEmojiName } from "./config-aitDvTQm.js";
|
|
5
5
|
import { c as toStoredSlackActor, f as parseSlackUserId, g as parseSlackMessageTs } from "./actor-BTtLaeWy.js";
|
|
6
|
-
import { c as getConversationEventStore, f as getSqlExecutor, m as withConversationEventLock, p as createSqlConversationEventStore, u as getConversationStore, v as startLocationThread, x as addAgentTurnUsage, y as bindProviderConversation } from "./viewer-
|
|
7
|
-
import { a as juniorSchedulerRuns, o as juniorSchedulerTasks, s as juniorAutomationVersions, u as juniorEventAutomations } from "./executor-
|
|
6
|
+
import { c as getConversationEventStore, f as getSqlExecutor, m as withConversationEventLock, p as createSqlConversationEventStore, u as getConversationStore, v as startLocationThread, x as addAgentTurnUsage, y as bindProviderConversation } from "./viewer-CX41TWYr.js";
|
|
7
|
+
import { a as juniorSchedulerRuns, o as juniorSchedulerTasks, s as juniorAutomationVersions, u as juniorEventAutomations } from "./executor-oIZAkQZb.js";
|
|
8
8
|
import { d as instructionActors, f as instructionProvenanceFor, n as agentHistoryItemSchema, u as contextProvenance } from "./history-Nte1oVed.js";
|
|
9
|
-
import { p as credentialSubjectSchema } from "./registry-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { D as fenceLock, O as withLock, T as MUTATION_LOCK_TTL_MS, k as sleep, w as getStateAdapter } from "./profile-
|
|
9
|
+
import { p as credentialSubjectSchema } from "./registry-fpIZHoqE.js";
|
|
10
|
+
import { Kt as withSlackRetries, Lt as SlackActionError, Qt as authenticationUnlinkedEvent, Vt as getSlackClient, Wt as normalizeSlackConversationId, Xt as agentsInstructionsUpdatedEvent, Yt as JUNIOR_NATIVE_EVENT_NAMESPACE, Zt as authenticationLinkedEvent, n as applyPluginFormatMarkdown } from "./agent-hooks-DWCHBPYw.js";
|
|
11
|
+
import { G as messageCardRef } from "./conversation-Cjo9tHGm.js";
|
|
12
|
+
import { D as fenceLock, O as withLock, T as MUTATION_LOCK_TTL_MS, k as sleep, w as getStateAdapter } from "./profile-Dfg76pvk.js";
|
|
13
13
|
import { A as eventAutomationSchema, D as scheduledRunSchema, E as scheduledAutomationSchema, S as automationVersionSchema } from "./automation-gznOMaQ2.js";
|
|
14
14
|
import { isDeepStrictEqual } from "node:util";
|
|
15
15
|
import { z } from "zod";
|
|
@@ -1422,18 +1422,45 @@ var TurnToolCallLimitExceededError = class extends Error {
|
|
|
1422
1422
|
this.name = "TurnToolCallLimitExceededError";
|
|
1423
1423
|
}
|
|
1424
1424
|
};
|
|
1425
|
+
/** Terminal failure when one turn spends past its cost budget. */
|
|
1426
|
+
var TurnBudgetExceededError = class extends Error {
|
|
1427
|
+
constructor(maxCostUsd) {
|
|
1428
|
+
super(`Agent turn exceeded execution limit ($${maxCostUsd} budget)`);
|
|
1429
|
+
this.name = "TurnBudgetExceededError";
|
|
1430
|
+
}
|
|
1431
|
+
};
|
|
1425
1432
|
function isDirectTurnExecutionLimitError(error) {
|
|
1426
|
-
return error instanceof TurnSliceLimitExceededError || error instanceof TurnToolCallLimitExceededError;
|
|
1433
|
+
return error instanceof TurnSliceLimitExceededError || error instanceof TurnToolCallLimitExceededError || error instanceof TurnBudgetExceededError;
|
|
1427
1434
|
}
|
|
1428
1435
|
/** True when a turn hit a hard execution limit, including one Error.cause wrap. */
|
|
1429
1436
|
function isTurnExecutionLimitExceededError(error) {
|
|
1430
1437
|
if (isDirectTurnExecutionLimitError(error)) return true;
|
|
1431
1438
|
return error instanceof Error && isDirectTurnExecutionLimitError(error.cause);
|
|
1432
1439
|
}
|
|
1433
|
-
/**
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1440
|
+
/**
|
|
1441
|
+
* Why tools are disabled once a turn is out of budget. Junior blocks the call
|
|
1442
|
+
* with the same message as a tool that `disableTools` disabled. The tool list
|
|
1443
|
+
* stays the same, so the provider cache stays valid.
|
|
1444
|
+
*/
|
|
1445
|
+
const TURN_LIMIT_DISABLED_REASON = "This Turn used its execution budget, so all tools are disabled. Reply now with what you finished, what is left, and how to continue.";
|
|
1446
|
+
/**
|
|
1447
|
+
* Check tool calls against the turn limits for one slice.
|
|
1448
|
+
*
|
|
1449
|
+
* The first model step past a limit gets `wrap_up`: its tool calls are blocked
|
|
1450
|
+
* so the model replies with its progress. Any later step that calls tools gets
|
|
1451
|
+
* `stop`, which ends the turn. `wrappedUp` is true when an earlier slice of the
|
|
1452
|
+
* turn already wrapped up.
|
|
1453
|
+
*/
|
|
1454
|
+
function createTurnLimitGate(wrappedUp) {
|
|
1455
|
+
let wrapUpStep;
|
|
1456
|
+
return ({ assistantMessage, overLimit }) => {
|
|
1457
|
+
if (assistantMessage === wrapUpStep) return "wrap_up";
|
|
1458
|
+
if (wrappedUp) return "stop";
|
|
1459
|
+
if (!overLimit) return "allow";
|
|
1460
|
+
wrappedUp = true;
|
|
1461
|
+
wrapUpStep = assistantMessage;
|
|
1462
|
+
return "wrap_up";
|
|
1463
|
+
};
|
|
1437
1464
|
}
|
|
1438
1465
|
/** Explain a terminal turn execution limit with actionable recovery guidance. */
|
|
1439
1466
|
function buildTurnLimitResponse(eventId) {
|
|
@@ -1584,6 +1611,7 @@ const storedTurnRecordSchema = z.object({
|
|
|
1584
1611
|
historyVersion: z.number().int().nonnegative().optional(),
|
|
1585
1612
|
errorMessage: z.string().optional(),
|
|
1586
1613
|
cumulativeToolCallCount: z.number().int().nonnegative().optional(),
|
|
1614
|
+
turnLimitWrappedUp: z.boolean().optional(),
|
|
1587
1615
|
turnStartSeq: seqCursorSchema.optional(),
|
|
1588
1616
|
runtimeContext: z.array(piMessageSchema).optional()
|
|
1589
1617
|
}).strip();
|
|
@@ -1680,6 +1708,7 @@ function materializeTurnRecord(stored, piProjection, turnStartMessageIndex, runt
|
|
|
1680
1708
|
channelName: runtimeMetrics?.channelName,
|
|
1681
1709
|
credentialSubject: stored.credentialSubject,
|
|
1682
1710
|
cumulativeToolCallCount: stored.cumulativeToolCallCount,
|
|
1711
|
+
turnLimitWrappedUp: stored.turnLimitWrappedUp,
|
|
1683
1712
|
cumulativeUsage: runtimeMetrics?.cumulativeUsage,
|
|
1684
1713
|
dispatchId: stored.dispatchId,
|
|
1685
1714
|
dispatchOutcome: stored.dispatchOutcome,
|
|
@@ -1750,6 +1779,7 @@ function buildStoredRecord(args) {
|
|
|
1750
1779
|
actor: args.actor,
|
|
1751
1780
|
credentialSubject: args.credentialSubject,
|
|
1752
1781
|
cumulativeToolCallCount: args.cumulativeToolCallCount,
|
|
1782
|
+
turnLimitWrappedUp: args.turnLimitWrappedUp,
|
|
1753
1783
|
dispatchId: args.dispatchId,
|
|
1754
1784
|
dispatchOutcome: args.dispatchOutcome,
|
|
1755
1785
|
errorMessage: args.errorMessage,
|
|
@@ -1826,6 +1856,7 @@ async function updateTurnState(args) {
|
|
|
1826
1856
|
...definedProps$1({
|
|
1827
1857
|
credentialSubject: args.existing.credentialSubject,
|
|
1828
1858
|
cumulativeToolCallCount: args.existing.cumulativeToolCallCount,
|
|
1859
|
+
turnLimitWrappedUp: args.existing.turnLimitWrappedUp,
|
|
1829
1860
|
dispatchId: args.existing.dispatchId,
|
|
1830
1861
|
dispatchOutcome: args.existing.dispatchOutcome,
|
|
1831
1862
|
errorMessage: args.errorMessage ?? args.existing.errorMessage,
|
|
@@ -1900,6 +1931,7 @@ async function upsertTurnRecordLocked(args, fence) {
|
|
|
1900
1931
|
...definedProps$1({
|
|
1901
1932
|
credentialSubject: existingRecord?.credentialSubject ?? args.credentialSubject,
|
|
1902
1933
|
cumulativeToolCallCount: args.cumulativeToolCallCount ?? existingRecord?.cumulativeToolCallCount,
|
|
1934
|
+
turnLimitWrappedUp: args.turnLimitWrappedUp ?? existingRecord?.turnLimitWrappedUp,
|
|
1903
1935
|
dispatchId,
|
|
1904
1936
|
dispatchOutcome: args.dispatchOutcome ?? existingRecord?.dispatchOutcome,
|
|
1905
1937
|
errorMessage: args.errorMessage,
|
|
@@ -2083,7 +2115,8 @@ function sharedWrite(args, latest) {
|
|
|
2083
2115
|
surface: args.surface ?? latest?.surface,
|
|
2084
2116
|
traceId: getActiveTraceId() ?? latest?.traceId,
|
|
2085
2117
|
turnStartMessageIndex: args.turnStartMessageIndex ?? latest?.turnStartMessageIndex,
|
|
2086
|
-
cumulativeToolCallCount: args.cumulativeToolCallCount ?? latest?.cumulativeToolCallCount
|
|
2118
|
+
cumulativeToolCallCount: args.cumulativeToolCallCount ?? latest?.cumulativeToolCallCount,
|
|
2119
|
+
turnLimitWrappedUp: args.turnLimitWrappedUp ?? latest?.turnLimitWrappedUp
|
|
2087
2120
|
})
|
|
2088
2121
|
};
|
|
2089
2122
|
}
|
|
@@ -3304,4 +3337,4 @@ async function saveScheduledAutomationInLock(db, task, current) {
|
|
|
3304
3337
|
await writeScheduledAutomation(db, requireStoredTask(task), current);
|
|
3305
3338
|
}
|
|
3306
3339
|
//#endregion
|
|
3307
|
-
export { listTurnSummaries as $,
|
|
3340
|
+
export { listTurnSummaries as $, appendThreadContextMessages as $t, requireAutomationRevision as A, loadProjection as At, postSlackEphemeralMessage as B, recordMcpProviderConnected as Bt, eventAutomationRunLimitReason as C, TURN_CONTEXT_TAG as Ct, sameDefinitionValue as D, loadConnectedMcpProviders as Dt, readAutomationVersion as E, commitMessages as Et, slackMention as F, recordAttachmentsDelivered as Ft, slackExternalRefIdSchema as G, hydrateConversationMessages as Gt, removeReactionFromMessage as H, recordToolExecutionStarted as Ht, truncateStatusText as I, recordAuthenticationLinked as It, saveTurnCheckpoint as J, persistConversationMessageSummaries as Jt, continuableMessages as K, persistConversationMessages as Kt, addReactionToMessage as L, recordAuthorizationCompleted as Lt, formatSlackLink as M, loadTurnRoute as Mt, normalizeSlackReplyMarkdown as N, openConversationProjection as Nt, AutomationConflictError as O, loadConversationProjection as Ot, normalizeSlackStatusText as P, recordAgentsInstructionsUpdated as Pt, getTurnRecord as Q, resolveTaskTitle as Qt, getSlackMessagePermalink as R, recordAuthorizationRequested as Rt, admitEventAutomationRun as S, trimTrailingAssistantMessages as St, listAutomationVersions as T, commitAcceptedReply as Tt, uploadFilesToConversation as U, recordTurnRoute as Ut, postSlackMessage as V, recordSubscribedReplyRoute as Vt, slackEntitySchema as W, appendConversationMessages as Wt, completeTurnRecord as X, settleConversationTitleWork as Xt, abandonTurnRecord as Y, resolveConversationTitle as Yt, failTurnRecord as Z, fallbackShortTitle as Zt, listDeletedEventAutomationsCreatedBy as _, isToolResultError as _t, readScheduledAutomation as a, markConversationMessage as an, TurnToolCallLimitExceededError as at, saveEventAutomation as b, retainRuntimeTurnContext as bt, scheduledRunId as c, turnHasReply as cn, isTurnExecutionLimitExceededError as ct, collectEventAutomationMatchKeys as d, getAgentContextCompactionTriggerTokens as dn, getTerminalAssistantMessages as dt, buildConversationContext as en, recordTurnSummary as et, createEventAutomation as f, getAgentContextInputLimitTokens as fn, getUserMessageInstructionText as ft, getEventAutomation as g, isContinuablePiBoundary as gt, findMatchingEventAutomations as h, isAssistantMessage as ht, parseScheduledAutomationRow as i, isHumanConversationMessage as in, TurnSliceLimitExceededError as it, escapeSlackMrkdwnText as j, loadTurnProjection as jt, automationRevision as k, loadLastModelProfile as kt, withScheduledAutomationLock as l, upsertConversationMessage as ln, extractAssistantText as lt, eventAutomationBelongsToUser as m, piMessageFromHistoryItem as mn, instructionTextForProjection as mt, listScheduledAutomations as n, estimateConversationContextTokens as nn, TURN_LIMIT_DISABLED_REASON as nt, saveScheduledAutomation as o, normalizeConversationText as on, buildTurnErrorResponse as ot, deleteEventAutomation as p, historyItemFromPiMessage as pn, hasRuntimeTurnContext as pt, loadTurnCheckpoint as q, projectConversationMessages as qt, listScheduledAutomationsForTeam as r, getConversationMessageSlackTs as rn, TurnBudgetExceededError as rt, saveScheduledAutomationInLock as s, recordDeliveredAssistantMessage as sn, createTurnLimitGate as st, createScheduledAutomation as t, createConversationMemoryService as tn, persistWithRetry as tt, blockEventAutomation as u, estimateTextTokens as un, getPiMessageRole as ut, listEventAutomationsForTeam as v, isToolResultMessage as vt, automationDefinition as w, ToolInputError as wt, setEventAutomationStatus as x, stripRuntimeTurnContext as xt, parseEventAutomationRow as y, normalizeToolNameFromResult as yt, openSlackDirectMessage as z, recordGuardianActionReviewed as zt };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { I as isRecord, L as toOptionalNumber, R as toOptionalString } from "./logging-
|
|
2
|
-
import { d as getDb } from "./viewer-
|
|
1
|
+
import { I as isRecord, L as toOptionalNumber, R as toOptionalString } from "./logging-OpC2jwiV.js";
|
|
2
|
+
import { d as getDb } from "./viewer-CX41TWYr.js";
|
|
3
3
|
import { d as juniorDestinations } from "./agent-invocations-D_YoNnAn.js";
|
|
4
|
-
import { d as juniorLocationConfigurations } from "./executor-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { w as getStateAdapter } from "./profile-
|
|
4
|
+
import { d as juniorLocationConfigurations } from "./executor-oIZAkQZb.js";
|
|
5
|
+
import { Kt as persistConversationMessages } from "./tasks-DREdnhVP.js";
|
|
6
|
+
import { rt as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-DWCHBPYw.js";
|
|
7
|
+
import { w as getStateAdapter } from "./profile-Dfg76pvk.js";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
10
10
|
import { and, eq, sql } from "drizzle-orm";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { _ as getProviderErrorUserMessage, g as getProviderErrorAttributes, h as findProviderError, p as ProviderError } from "./client-
|
|
2
|
-
import { I as isRecord, t as buildTurnFailureResponse } from "./logging-
|
|
1
|
+
import { _ as getProviderErrorUserMessage, g as getProviderErrorAttributes, h as findProviderError, p as ProviderError } from "./client-CWQtbizj.js";
|
|
2
|
+
import { I as isRecord, t as buildTurnFailureResponse } from "./logging-OpC2jwiV.js";
|
|
3
3
|
import { g as parseSlackMessageTs } from "./actor-BTtLaeWy.js";
|
|
4
|
-
import { c as getConversationEventStore, d as getDb } from "./viewer-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { J as
|
|
8
|
-
import { r as clearPendingAuth, u as buildDeterministicTurnId } from "./pending-auth-
|
|
4
|
+
import { c as getConversationEventStore, d as getDb } from "./viewer-CX41TWYr.js";
|
|
5
|
+
import { Gt as hydrateConversationMessages, an as markConversationMessage } from "./tasks-DREdnhVP.js";
|
|
6
|
+
import { Mt as listConversationAnnotations } from "./agent-hooks-DWCHBPYw.js";
|
|
7
|
+
import { J as removedCardSchema, Y as resolveMessageCards, q as readMessageCardRefs } from "./conversation-Cjo9tHGm.js";
|
|
8
|
+
import { r as clearPendingAuth, u as buildDeterministicTurnId } from "./pending-auth-D_nf121N.js";
|
|
9
9
|
import { d as markTurnCompleted, u as markTurnClosed } from "./oauth-authorization-BA4Dt6a7.js";
|
|
10
|
-
import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
10
|
+
import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-BoNCtSwk.js";
|
|
11
11
|
//#region src/chat/conversations/pending-cards.ts
|
|
12
12
|
/** Select undelivered cards and load their latest saved facts. */
|
|
13
13
|
async function loadPendingMessageCards(conversationId) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as getConversationEventStore } from "./viewer-
|
|
1
|
+
import { c as getConversationEventStore } from "./viewer-CX41TWYr.js";
|
|
2
2
|
//#region src/chat/conversations/turn-lifecycle.ts
|
|
3
3
|
/** Persist correlated turn lifecycle facts with retry-safe terminal exclusion. */
|
|
4
4
|
var ConversationTurnLifecycleService = class {
|
|
@@ -34,7 +34,7 @@ function slackSourceForDestination(args) {
|
|
|
34
34
|
* Reads parent Conversations when this Conversation has no Destination.
|
|
35
35
|
*/
|
|
36
36
|
async function resolveConversationRouting(args) {
|
|
37
|
-
const conversationStore = args.conversationStore ?? (await import("./viewer-
|
|
37
|
+
const conversationStore = args.conversationStore ?? (await import("./viewer-CX41TWYr.js").then((n) => n.s)).getConversationStore();
|
|
38
38
|
const chain = await loadConversationChain(args.conversationId, conversationStore);
|
|
39
39
|
let destination;
|
|
40
40
|
let source;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
2
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-CTBsdSam.js";
|
|
3
3
|
import { isDeepStrictEqual } from "node:util";
|
|
4
4
|
//#region src/chat/plugins/validation.ts
|
|
5
5
|
var validation_exports = /* @__PURE__ */ __exportAll({
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
1
|
+
import { t as JUNIOR_VERSION } from "./version-ByV7nGOn.js";
|
|
2
2
|
export { JUNIOR_VERSION };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { F as normalizeIdentityEmail } from "./logging-
|
|
3
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
+
import { F as normalizeIdentityEmail } from "./logging-OpC2jwiV.js";
|
|
3
|
+
import { i as getChatConfig } from "./config-aitDvTQm.js";
|
|
4
4
|
import { d as parseSlackTeamId, o as parseActorUserId, u as parseSlackChannelReferenceId } from "./actor-BTtLaeWy.js";
|
|
5
5
|
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, o as conversationReadColumns, s as juniorConversations } from "./agent-invocations-D_YoNnAn.js";
|
|
6
|
-
import { _ as juniorConversationEvents, f as juniorConversationParticipants, g as juniorConversationMetrics, h as CONVERSATION_METRICS, p as juniorConversationBindings, t as createJuniorSqlExecutor, y as juniorConversationAnnotations } from "./executor-
|
|
6
|
+
import { _ as juniorConversationEvents, f as juniorConversationParticipants, g as juniorConversationMetrics, h as CONVERSATION_METRICS, p as juniorConversationBindings, t as createJuniorSqlExecutor, y as juniorConversationAnnotations } from "./executor-oIZAkQZb.js";
|
|
7
7
|
import { c as newConversationEventSchema, l as encodeHistoryPayload, m as usageSchema, o as decodeStoredConversationEvent, r as conversationEventDataSchema, s as historyReplacementSchema } from "./history-Nte1oVed.js";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
import { and, asc, desc, eq, gt, gte, inArray, isNull, lt, lte, ne, or, sql } from "drizzle-orm";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as getConversationEventStore } from "./viewer-
|
|
2
|
-
import { Q as getTurnRecord, Z as failTurnRecord, q as loadTurnCheckpoint } from "./tasks-
|
|
3
|
-
import { w as getStateAdapter } from "./profile-
|
|
4
|
-
import { a as getVercelConversationWorkQueue } from "./job-queue-
|
|
5
|
-
import { m as ensureConversationWake, w as requestConversationWork } from "./store-
|
|
6
|
-
import { n as resolveTurnSessionRouting } from "./turn-session-routing-
|
|
1
|
+
import { c as getConversationEventStore } from "./viewer-CX41TWYr.js";
|
|
2
|
+
import { Q as getTurnRecord, Z as failTurnRecord, q as loadTurnCheckpoint } from "./tasks-DREdnhVP.js";
|
|
3
|
+
import { w as getStateAdapter } from "./profile-Dfg76pvk.js";
|
|
4
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-DyA2AEnY.js";
|
|
5
|
+
import { m as ensureConversationWake, w as requestConversationWork } from "./store-OMQAFrJG.js";
|
|
6
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-Ba12fwXz.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
//#region src/chat/task-execution/authorized-turn.ts
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { A as resolveSlackChannelIdFromMessage, B as effectiveTaskOutcomes, C as renderBlockText, D as storeAttachment, Ft as createUserTokenStore, It as buildSteeringPiMessage, Lt as withoutSavedSteeringMessages, M as getConversationInfo, N as listThreadReplies, O as parseSlackThreadId, Rt as RetryableDeliveryError, S as renderAttachmentText, Ut as shouldEmitDevAgentTrace, Vt as AuthorizationFlowDisabledError, a as buildAuthPauseResponse, h as latestProgressStatus, j as resolveSlackChannelIdFromThreadId, k as readSlackRawMessageContext, m as PluginCredentialFailureError, n as executeAgentRun, r as createContextCompactor, t as createAgentRunner, z as eventAutomationTriggerAvailable } from "./agent-runner-
|
|
2
|
-
import { f as escapeXml, i as completeText, r as completeObject, v as isProviderRetryError } from "./client-
|
|
3
|
-
import { C as withLogContext, I as isRecord, L as toOptionalNumber, R as toOptionalString, _ as setSentryUser, b as setTags, d as logException, f as logInfo, n as createChatSdkLogger, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, u as logError, v as setSpanAttributes, w as withSpan } from "./logging-
|
|
4
|
-
import { c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName } from "./config-
|
|
1
|
+
import { A as resolveSlackChannelIdFromMessage, B as effectiveTaskOutcomes, C as renderBlockText, D as storeAttachment, Ft as createUserTokenStore, It as buildSteeringPiMessage, Lt as withoutSavedSteeringMessages, M as getConversationInfo, N as listThreadReplies, O as parseSlackThreadId, Rt as RetryableDeliveryError, S as renderAttachmentText, Ut as shouldEmitDevAgentTrace, Vt as AuthorizationFlowDisabledError, a as buildAuthPauseResponse, h as latestProgressStatus, j as resolveSlackChannelIdFromThreadId, k as readSlackRawMessageContext, m as PluginCredentialFailureError, n as executeAgentRun, r as createContextCompactor, t as createAgentRunner, z as eventAutomationTriggerAvailable } from "./agent-runner-CnlFtbzb.js";
|
|
2
|
+
import { f as escapeXml, i as completeText, r as completeObject, v as isProviderRetryError } from "./client-CWQtbizj.js";
|
|
3
|
+
import { C as withLogContext, I as isRecord, L as toOptionalNumber, R as toOptionalString, _ as setSentryUser, b as setTags, d as logException, f as logInfo, n as createChatSdkLogger, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, u as logError, v as setSpanAttributes, w as withSpan } from "./logging-OpC2jwiV.js";
|
|
4
|
+
import { c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName } from "./config-aitDvTQm.js";
|
|
5
5
|
import { o as modelIdForProfile, r as defaultModelId } from "./model-profile-BwU8mqwD.js";
|
|
6
6
|
import { a as isUserActor, g as parseSlackMessageTs, i as isActorUserId, l as parseSlackChannelId, n as createSlackActor, o as parseActorUserId, r as createSlackResumeActor, t as createActor } from "./actor-BTtLaeWy.js";
|
|
7
|
-
import { M as createSlackDestination, P as requireSlackDestination, c as getConversationEventStore, d as getDb, f as getSqlExecutor, u as getConversationStore } from "./viewer-
|
|
7
|
+
import { M as createSlackDestination, P as requireSlackDestination, c as getConversationEventStore, d as getDb, f as getSqlExecutor, u as getConversationStore } from "./viewer-CX41TWYr.js";
|
|
8
8
|
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers } from "./agent-invocations-D_YoNnAn.js";
|
|
9
|
-
import { c as juniorAutomationExecutions, o as juniorSchedulerTasks, u as juniorEventAutomations } from "./executor-
|
|
9
|
+
import { c as juniorAutomationExecutions, o as juniorSchedulerTasks, u as juniorEventAutomations } from "./executor-oIZAkQZb.js";
|
|
10
10
|
import { f as instructionProvenanceFor } from "./history-Nte1oVed.js";
|
|
11
|
-
import { d as credentialContextForActor } from "./registry-
|
|
12
|
-
import { $ as listTurnSummaries, $t as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { E as acquireActiveLock, O as withLock, T as MUTATION_LOCK_TTL_MS, w as getStateAdapter } from "./profile-
|
|
16
|
-
import { a as wasPendingAuthStopped, c as getThreadStopDecision, l as buildDeterministicAssistantMessageId, o as decideSubscribedThreadReply, r as clearPendingAuth, s as getSubscribedReplyPreflightDecision, u as buildDeterministicTurnId } from "./pending-auth-
|
|
11
|
+
import { d as credentialContextForActor } from "./registry-fpIZHoqE.js";
|
|
12
|
+
import { $ as listTurnSummaries, $t as appendThreadContextMessages, At as loadProjection, D as sameDefinitionValue, Et as commitMessages, Gt as hydrateConversationMessages, H as removeReactionFromMessage, I as truncateStatusText, J as saveTurnCheckpoint, Jt as persistConversationMessageSummaries, Kt as persistConversationMessages, L as addReactionToMessage, Lt as recordAuthorizationCompleted, M as formatSlackLink, N as normalizeSlackReplyMarkdown, Ot as loadConversationProjection, P as normalizeSlackStatusText, Q as getTurnRecord, St as trimTrailingAssistantMessages, T as listAutomationVersions, Tt as commitAcceptedReply, V as postSlackMessage, Vt as recordSubscribedReplyRoute, X as completeTurnRecord, Y as abandonTurnRecord, Yt as resolveConversationTitle, Z as failTurnRecord, Zt as fallbackShortTitle, _ as listDeletedEventAutomationsCreatedBy, a as readScheduledAutomation, an as markConversationMessage, cn as turnHasReply, en as buildConversationContext, et as recordTurnSummary, g as getEventAutomation, i as parseScheduledAutomationRow, in as isHumanConversationMessage, j as escapeSlackMrkdwnText, l as withScheduledAutomationLock, ln as upsertConversationMessage, m as eventAutomationBelongsToUser, nn as estimateConversationContextTokens, on as normalizeConversationText, ot as buildTurnErrorResponse, p as deleteEventAutomation, q as loadTurnCheckpoint, rn as getConversationMessageSlackTs, s as saveScheduledAutomationInLock, sn as recordDeliveredAssistantMessage, tn as createConversationMemoryService, tt as persistWithRetry, w as automationDefinition, y as parseEventAutomationRow } from "./tasks-DREdnhVP.js";
|
|
13
|
+
import { Bt as getHeaderString, Dt as readAttachmentVisionSummary, Gt as runWithSlackInstallationToken, It as lookupSlackUser, Lt as SlackActionError, Ot as recordSlackAttachment, Rt as downloadPrivateSlackFile, Tt as getSlackFileId, Ut as isDmChannel, V as cancelSubscriptions, Vt as getSlackClient, Wt as normalizeSlackConversationId, at as getDashboardObjectIconLink, it as getDashboardConversationLink, nt as verifyTimerWatchCredentialSubject, o as getPluginSlackConversationLink, rt as JUNIOR_THREAD_STATE_TTL_MS, wt as buildSentryConversationUrl } from "./agent-hooks-DWCHBPYw.js";
|
|
14
|
+
import { F as readMessageAttachments, R as isVisionImageMediaType } from "./conversation-Cjo9tHGm.js";
|
|
15
|
+
import { E as acquireActiveLock, O as withLock, T as MUTATION_LOCK_TTL_MS, w as getStateAdapter } from "./profile-Dfg76pvk.js";
|
|
16
|
+
import { a as wasPendingAuthStopped, c as getThreadStopDecision, l as buildDeterministicAssistantMessageId, o as decideSubscribedThreadReply, r as clearPendingAuth, s as getSubscribedReplyPreflightDecision, u as buildDeterministicTurnId } from "./pending-auth-D_nf121N.js";
|
|
17
17
|
import { a as TurnInputDeferredError, c as isTurnInputCommitLostError, d as markTurnCompleted, f as markTurnFailed, i as TurnInputCommitLostError, l as isTurnInputDeferredError, n as ConversationTurnBoundaryError, o as getConversationTurnBoundaryError, p as startActiveTurn, r as CooperativeTurnYieldError, s as isCooperativeTurnYieldError, u as markTurnClosed } from "./oauth-authorization-BA4Dt6a7.js";
|
|
18
|
-
import { n as getAssistantReplyText } from "./assistant-reply-
|
|
19
|
-
import { A as recordFinishedTurnForAutomatedLimit, F as finishedRunReply, P as deliversFinalText, R as runDispatchOutcome, c as timerWatchCredentialSubject, i as skipInputBeforeConversationStop, k as maybePostAutomatedTurnLimitNotice, l as getEventCatalog, s as isEventMailboxMetadata, v as automationEventCatalog } from "./session-stop-
|
|
20
|
-
import { a as EVENT_SYSTEM_ACTOR, o as isEventConversationMessage } from "./prompt-
|
|
21
|
-
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-
|
|
22
|
-
import { E as stopConversationWork, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, n as appendAndEnqueueExclusiveInboundMessage, r as appendAndEnqueueInboundMessage, w as requestConversationWork } from "./store-
|
|
18
|
+
import { n as getAssistantReplyText } from "./assistant-reply-BxCi7V4v.js";
|
|
19
|
+
import { A as recordFinishedTurnForAutomatedLimit, F as finishedRunReply, P as deliversFinalText, R as runDispatchOutcome, c as timerWatchCredentialSubject, i as skipInputBeforeConversationStop, k as maybePostAutomatedTurnLimitNotice, l as getEventCatalog, s as isEventMailboxMetadata, v as automationEventCatalog } from "./session-stop-dyvsZDB0.js";
|
|
20
|
+
import { a as EVENT_SYSTEM_ACTOR, o as isEventConversationMessage } from "./prompt-C7bRJ2vg.js";
|
|
21
|
+
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-DyA2AEnY.js";
|
|
22
|
+
import { E as stopConversationWork, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, n as appendAndEnqueueExclusiveInboundMessage, r as appendAndEnqueueInboundMessage, w as requestConversationWork } from "./store-OMQAFrJG.js";
|
|
23
23
|
import { l as automationListQuerySchema } from "./automation-gznOMaQ2.js";
|
|
24
24
|
import { r as isExperimentalFeatureEnabled } from "./experimental-Qn9rKLgx.js";
|
|
25
25
|
import { c as sumUtcHoursIntoSixHours, m as healthReportSchema, t as webMessageId } from "./web-message-id-xPI_EFSC.js";
|
|
26
|
-
import { C as readAutomationExecutionHours, D as readAutomationExecutions, E as readAutomationExecutionSummaries, O as readAutomationRuns, S as readAutomationExecutionDays, T as readAutomationExecutionStatusHours, _ as markDispatchFailed, a as confirmDispatchMailboxAppend, b as emptyAutomationRunWindows, c as getDispatchInputMessageId, f as isTerminalDispatchStatus, g as markDispatchCompleted, h as markDispatchBlocked, i as claimDispatchMailboxAppend, l as getDispatchRecord, m as markDispatchAwaitingResume, n as scheduleSessionCompletedPluginTasks, s as getDispatchConversationId, t as processPluginTask, u as getDispatchTurnId, v as markDispatchRunning, w as readAutomationExecutionStatusDays, x as readAutomationExecutionByConversationId } from "./task-runner-
|
|
27
|
-
import { a as withAgentInvocationResultActors, c as resolveMailboxTurnWork, f as joinMailboxText, i as startAgentInvocationsForChildInput, l as sourceFromTurnInput, o as getAuthPausedConversationTurnId, s as getEventBatchDelayMs, t as enqueueAgentInvocationResult, u as turnInputFactsFromConversationMessage } from "./result-
|
|
28
|
-
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
29
|
-
import { i as resolveAgentInvocationId, o as AgentRunError, s as executeTurn, t as createAgentInvocationWorker } from "./work-
|
|
30
|
-
import { a as persistThreadState, c as configValueSchema, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-
|
|
31
|
-
import { a as getPausedTurnRequest, c as getTurnAuthorization, i as createPausedTurns, n as deleteWebAuthorization, s as wakePausedTurn, t as createWebAuthorization } from "./web-authorization-
|
|
32
|
-
import { n as resolveTurnSessionRouting } from "./turn-session-routing-
|
|
33
|
-
import { t as bindMessageAgent } from "./message-
|
|
34
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
35
|
-
import { a as persistAuthPauseTurnState, c as getTurnUserSlackMessageTs, d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, n as getAgentTurnDiagnosticsAttributes, o as getTurnUserMessage, r as requireTurnFailureEventId, s as getTurnUserReplyAttachmentContext, t as finalizeFailedTurnReplyWithEvent, u as getInterruptionMarker } from "./turn-failure-response-
|
|
36
|
-
import { r as storeInputImages } from "./images-
|
|
26
|
+
import { C as readAutomationExecutionHours, D as readAutomationExecutions, E as readAutomationExecutionSummaries, O as readAutomationRuns, S as readAutomationExecutionDays, T as readAutomationExecutionStatusHours, _ as markDispatchFailed, a as confirmDispatchMailboxAppend, b as emptyAutomationRunWindows, c as getDispatchInputMessageId, f as isTerminalDispatchStatus, g as markDispatchCompleted, h as markDispatchBlocked, i as claimDispatchMailboxAppend, l as getDispatchRecord, m as markDispatchAwaitingResume, n as scheduleSessionCompletedPluginTasks, s as getDispatchConversationId, t as processPluginTask, u as getDispatchTurnId, v as markDispatchRunning, w as readAutomationExecutionStatusDays, x as readAutomationExecutionByConversationId } from "./task-runner-BOxv7shv.js";
|
|
27
|
+
import { a as withAgentInvocationResultActors, c as resolveMailboxTurnWork, f as joinMailboxText, i as startAgentInvocationsForChildInput, l as sourceFromTurnInput, o as getAuthPausedConversationTurnId, s as getEventBatchDelayMs, t as enqueueAgentInvocationResult, u as turnInputFactsFromConversationMessage } from "./result-C1ZCRPLx.js";
|
|
28
|
+
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-cQFsZFOU.js";
|
|
29
|
+
import { i as resolveAgentInvocationId, o as AgentRunError, s as executeTurn, t as createAgentInvocationWorker } from "./work-CvFoEpRT.js";
|
|
30
|
+
import { a as persistThreadState, c as configValueSchema, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-BoNCtSwk.js";
|
|
31
|
+
import { a as getPausedTurnRequest, c as getTurnAuthorization, i as createPausedTurns, n as deleteWebAuthorization, s as wakePausedTurn, t as createWebAuthorization } from "./web-authorization-rDLlKIS0.js";
|
|
32
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-Ba12fwXz.js";
|
|
33
|
+
import { t as bindMessageAgent } from "./message-EyMrVXEf.js";
|
|
34
|
+
import { t as bindSpawnAgent } from "./spawn-CpqxMPWE.js";
|
|
35
|
+
import { a as persistAuthPauseTurnState, c as getTurnUserSlackMessageTs, d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, n as getAgentTurnDiagnosticsAttributes, o as getTurnUserMessage, r as requireTurnFailureEventId, s as getTurnUserReplyAttachmentContext, t as finalizeFailedTurnReplyWithEvent, u as getInterruptionMarker } from "./turn-failure-response-C6jrCPjc.js";
|
|
36
|
+
import { r as storeInputImages } from "./images-Dzh3RBXY.js";
|
|
37
37
|
import { z } from "zod";
|
|
38
38
|
import { createHash } from "node:crypto";
|
|
39
39
|
import { and, asc, count, desc, eq, exists, inArray, ne, or, sql } from "drizzle-orm";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { $ as getAgentInvocation, G as recordSubagentStarted, H as stopChildAgentsOf, Ht as readBlockedReport, It as buildSteeringPiMessage, J as createAgentInvocation, Lt as withoutSavedSteeringMessages, Q as getActiveAgentInvocationForConversation, Vt as AuthorizationFlowDisabledError, W as recordSubagentEnded, at as getAgentInvocationTurnId, ct as isTerminalAgentInvocation, dt as markAgentInvocationMailboxAppended, gt as reportReplacedAgentInvocation, ht as markAgentInvocationSteered, m as PluginCredentialFailureError, mt as markAgentInvocationRunning, pt as markAgentInvocationPaused, q as completeAgentInvocation, rt as getAgentInvocationMessageId, st as getLatestAgentInvocationForConversation } from "./agent-runner-
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
4
|
-
import { c as getConversationEventStore, u as getConversationStore } from "./viewer-
|
|
2
|
+
import { $ as getAgentInvocation, G as recordSubagentStarted, H as stopChildAgentsOf, Ht as readBlockedReport, It as buildSteeringPiMessage, J as createAgentInvocation, Lt as withoutSavedSteeringMessages, Q as getActiveAgentInvocationForConversation, Vt as AuthorizationFlowDisabledError, W as recordSubagentEnded, at as getAgentInvocationTurnId, ct as isTerminalAgentInvocation, dt as markAgentInvocationMailboxAppended, gt as reportReplacedAgentInvocation, ht as markAgentInvocationSteered, m as PluginCredentialFailureError, mt as markAgentInvocationRunning, pt as markAgentInvocationPaused, q as completeAgentInvocation, rt as getAgentInvocationMessageId, st as getLatestAgentInvocationForConversation } from "./agent-runner-CnlFtbzb.js";
|
|
3
|
+
import { n as botConfig } from "./config-aitDvTQm.js";
|
|
4
|
+
import { c as getConversationEventStore, u as getConversationStore } from "./viewer-CX41TWYr.js";
|
|
5
5
|
import { f as instructionProvenanceFor, p as sameActorIdentity } from "./history-Nte1oVed.js";
|
|
6
|
-
import {
|
|
6
|
+
import { J as saveTurnCheckpoint, Nt as openConversationProjection, Q as getTurnRecord, Y as abandonTurnRecord, Z as failTurnRecord, ct as isTurnExecutionLimitExceededError, dt as getTerminalAssistantMessages } from "./tasks-DREdnhVP.js";
|
|
7
7
|
import { c as isTurnInputCommitLostError, i as TurnInputCommitLostError, o as getConversationTurnBoundaryError } from "./oauth-authorization-BA4Dt6a7.js";
|
|
8
|
-
import { n as getAssistantReplyText } from "./assistant-reply-
|
|
9
|
-
import { A as recordFinishedTurnForAutomatedLimit, j as resetAutomatedTurnLimit, k as maybePostAutomatedTurnLimitNotice } from "./session-stop-
|
|
10
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
11
|
-
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
12
|
-
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-
|
|
8
|
+
import { n as getAssistantReplyText } from "./assistant-reply-BxCi7V4v.js";
|
|
9
|
+
import { A as recordFinishedTurnForAutomatedLimit, j as resetAutomatedTurnLimit, k as maybePostAutomatedTurnLimitNotice } from "./session-stop-dyvsZDB0.js";
|
|
10
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-OMQAFrJG.js";
|
|
11
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-cQFsZFOU.js";
|
|
12
|
+
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-BoNCtSwk.js";
|
|
13
13
|
import { isDeepStrictEqual } from "node:util";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
//#region src/chat/runtime/turn-execution.ts
|
|
@@ -474,7 +474,7 @@ function createAgentInvocationWorker(agentRunner, options = {}) {
|
|
|
474
474
|
await acknowledge();
|
|
475
475
|
return { status: "completed" };
|
|
476
476
|
}
|
|
477
|
-
if (!context.attempt.isFinalAttempt) throw runError;
|
|
477
|
+
if (!context.attempt.isFinalAttempt && !isTurnExecutionLimitExceededError(runError)) throw runError;
|
|
478
478
|
await finish(await completeAgentInvocation({
|
|
479
479
|
invocationId: invocation.invocationId,
|
|
480
480
|
errorMessage: runError instanceof Error ? runError.message : "Agent invocation failed",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { v as isProviderRetryError } from "./client-
|
|
3
|
-
import { C as withLogContext, d as logException, f as logInfo, p as logWarn } from "./logging-
|
|
4
|
-
import { i as getChatConfig } from "./config-
|
|
5
|
-
import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-
|
|
6
|
-
import { C as requestAnotherSlice, M as isInvalidConversationRecordError, T as startConversationWork, b as recordConversationRetry, d as countPendingConversationMessages, f as deadLetterAttempt, g as getConversationWorkState, i as beginConversationResume, j as isFinalAttempt, k as hasConversationStop, l as completeConversationStop, m as ensureConversationWake, o as checkInConversationWork, p as drainConversationMailbox, s as clearConsumedConversationWake, t as ackMessages, u as completeConversationWork, x as releaseConversationWork, y as recordAttemptFailure } from "./store-
|
|
2
|
+
import { v as isProviderRetryError } from "./client-CWQtbizj.js";
|
|
3
|
+
import { C as withLogContext, d as logException, f as logInfo, p as logWarn } from "./logging-OpC2jwiV.js";
|
|
4
|
+
import { i as getChatConfig } from "./config-aitDvTQm.js";
|
|
5
|
+
import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-DyA2AEnY.js";
|
|
6
|
+
import { C as requestAnotherSlice, M as isInvalidConversationRecordError, T as startConversationWork, b as recordConversationRetry, d as countPendingConversationMessages, f as deadLetterAttempt, g as getConversationWorkState, i as beginConversationResume, j as isFinalAttempt, k as hasConversationStop, l as completeConversationStop, m as ensureConversationWake, o as checkInConversationWork, p as drainConversationMailbox, s as clearConsumedConversationWake, t as ackMessages, u as completeConversationWork, x as releaseConversationWork, y as recordAttemptFailure } from "./store-OMQAFrJG.js";
|
|
7
7
|
//#region src/chat/task-execution/worker.ts
|
|
8
8
|
var worker_exports = /* @__PURE__ */ __exportAll({
|
|
9
9
|
CONVERSATION_WORK_DEFER_DELAY_MS: () => CONVERSATION_WORK_DEFER_DELAY_MS,
|