@sentry/junior 0.300.0 → 0.301.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-S5UkjNK3.js → adapter-CNjGEJO9.js} +1 -1
- package/dist/{admin-UrTniSPO.js → admin-CRJHvCGg.js} +2 -2
- package/dist/{agent-runner-bY4_0UPm.js → agent-runner-H4YhvNBj.js} +32 -93
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +5 -5
- package/dist/api.d.ts +1 -1
- package/dist/api.js +67 -33
- package/dist/{app-D-AcIcCV.d.ts → app-HDZglaIu.d.ts} +3 -3
- package/dist/app.d.ts +1 -1
- package/dist/app.js +36 -34
- package/dist/{automation-Dw82oQ-h.js → automation-Cva5ZOwW.js} +1 -1
- package/dist/{background-compaction-queue-B6U3060-.js → background-compaction-queue-CNrZ3QcU.js} +3 -3
- package/dist/{briefs-DqiwWu-n.js → briefs-x6Mzwxmg.js} +3 -3
- package/dist/{catalog-runtime-D1oYNv04.js → catalog-runtime-BEY6EGRi.js} +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{config-9nHoFiJP.js → config-CmjhyqgB.js} +2 -2
- package/dist/{connections-DZjTN3JC.js → connections-CfIRm0xv.js} +6 -6
- package/dist/{continue-in-slack-Dtv7_U42.js → continue-in-slack-DPoABVkB.js} +6 -6
- package/dist/{conversation-Dyjq2CZ8.js → conversation-BNXfq6Lb.js} +11 -1
- package/dist/{conversation-feed-CcDxlrlQ.js → conversation-feed-CfpyFMHP.js} +1 -1
- package/dist/{conversation-privacy-D-5HTXjS.js → conversation-privacy-0CM0V2qK.js} +1 -1
- package/dist/{conversation-turn-Cxl8WZD7.js → conversation-turn-C0sxyvS-.js} +17 -17
- package/dist/{credential-sync-C49ClwDX.js → credential-sync-tEMKZ_8M.js} +15 -15
- package/dist/{db-2resqBh1.d.ts → db-BdUHQhrC.d.ts} +1 -1
- package/dist/{db-BJNo6fK5.js → db-Czra10QW.js} +4 -4
- package/dist/{executor-DBIaOeJ_.js → executor-D_023K0H.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{lineage-0dereG7H.js → lineage-DmMIE0VL.js} +2 -2
- package/dist/{logging-BIclibct.js → logging-DcjLDDqi.js} +1 -1
- package/dist/{message-dkOl-Iii.js → message-C0JY9RJP.js} +8 -8
- package/dist/{model-input-CLo9TaUd.js → model-input-CBp-p24N.js} +2 -2
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-WmpjfJgQ.js → oauth-callback-server-BRq9QNhU.js} +2 -2
- package/dist/{projection-w_X-zi7v.js → projection-CQNDOi82.js} +167 -45
- package/dist/{prompt-B1Xw46-S.js → prompt-DLUB5m72.js} +4 -4
- package/dist/{registry-BmP5vnlj.js → registry-Dj377ADs.js} +1 -1
- package/dist/{resolve-goo34bJK.js → resolve-DJkh9Fky.js} +3 -3
- package/dist/{result-PVBeU0Wf.js → result-C8iIpDl1.js} +8 -8
- package/dist/{runner-DKrfvNV6.js → runner-DZqrOy8C.js} +9 -9
- package/dist/{sandbox-egress-signals-DsUcqrI0.js → sandbox-egress-signals-CGwH86S9.js} +1 -1
- package/dist/{schema-Dns-sTas.d.ts → schema-CdZFn7Qd.d.ts} +30 -1
- package/dist/{schema-C9iNFz5n.js → schema-DyHXiQKI.js} +12 -4
- package/dist/{service-account-CMAAloAL.js → service-account-D6jGR4a1.js} +3 -3
- package/dist/{service-account-CmowamcB.js → service-account-suY004dx.js} +4 -4
- package/dist/{session-stop-BcAXze8a.js → session-stop-BLmfFI3d.js} +117 -16
- package/dist/{skills-DfsazET6.js → skills-CmNG0dHb.js} +2 -2
- package/dist/{slack-conversation-unfurl-CzQonuWz.js → slack-conversation-unfurl-Bty-DlHe.js} +7 -7
- package/dist/{spawn-C7o0FDDp.js → spawn-CNjkpXpk.js} +6 -6
- package/dist/{state-zSilNpbi.js → state-CEbZuZD6.js} +2 -2
- package/dist/{stop-CFOujp8C.js → stop-Bjy2-K4H.js} +249 -2237
- package/dist/{store-E3x2Fg_F.js → store-DmV4CoNr.js} +5 -5
- package/dist/{store-Dkeis_8o.js → store-Epv6t4vV.js} +9 -9
- package/dist/{task-queue-D-hCqdZW.js → task-queue-AhG1tSXR.js} +3 -3
- package/dist/{task-runner-vohUPLHe.js → task-runner-BMxZI3o7.js} +8 -8
- package/dist/{thread-context-BzvdkgI9.js → thread-context-CXLnbg7g.js} +8 -8
- package/dist/{turn-session-routing-Bo_LxFum.js → turn-session-routing-BD3-jJl7.js} +5 -5
- package/dist/{turn-user-message-D5RnVmxQ.js → turn-user-message-DsUZi9gn.js} +3 -3
- package/dist/{users-2bggndVg.js → users-BxvYclQg.js} +3 -3
- package/dist/{validation-BbWikeSa.js → validation-DOz8X9BU.js} +1 -1
- package/dist/{version-GVBMW2jA.js → version-CGMRmMPK.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-BpxRliyO.js → viewer-H3EsMWtJ.js} +3 -3
- package/dist/{warmup-BW2qwnal.js → warmup-CdU5hR49.js} +47 -25
- package/dist/{worker-Cbd-iuwZ.js → worker-ClphajjD.js} +7 -7
- package/package.json +6 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { At as getConversationWorkStates$1, Bt as recordConversationRetry$1, Dt as dropPendingMessages$1, Et as drainConversationMailbox$1, Ft as listActiveConversationIds$1, Gt as startConversationWork$1, Ht as releaseInboundMessage, It as markConversationWorkEnqueued$1, Jt as takeDeferredConversationMove, Kt as steerWebPendingMessages$1, Mt as hasRunnableConversationWork, Ot as getConversation$1, St as completeConversationWork$1, Ut as requestAnotherSlice$1, Vt as releaseConversationWork$1, Wt as requestConversationWork$1, _t as checkInConversationWork$1, bt as clearExpiredConversationLease$1, ft as ackMessages$1, gt as cancelHumanFacingPendingMessages$1, ht as beginConversationResume$1, kt as getConversationWorkState$1, mt as appendInboundMessage, pt as appendExclusiveInboundMessage, qt as stopConversationWork$1, vt as claimInboundMessage$1, wt as deadLetterAttempt$1, xt as completeConversationStop$1, yt as clearConsumedConversationWake$1, zt as recordAttemptFailure$1 } from "./projection-
|
|
2
|
-
import { p as logException } from "./logging-
|
|
3
|
-
import { a as getConversationStore } from "./db-
|
|
4
|
-
import "./background-compaction-queue-
|
|
1
|
+
import { At as getConversationWorkStates$1, Bt as recordConversationRetry$1, Dt as dropPendingMessages$1, Et as drainConversationMailbox$1, Ft as listActiveConversationIds$1, Gt as startConversationWork$1, Ht as releaseInboundMessage, It as markConversationWorkEnqueued$1, Jt as takeDeferredConversationMove, Kt as steerWebPendingMessages$1, Mt as hasRunnableConversationWork, Ot as getConversation$1, St as completeConversationWork$1, Ut as requestAnotherSlice$1, Vt as releaseConversationWork$1, Wt as requestConversationWork$1, _t as checkInConversationWork$1, bt as clearExpiredConversationLease$1, ft as ackMessages$1, gt as cancelHumanFacingPendingMessages$1, ht as beginConversationResume$1, kt as getConversationWorkState$1, mt as appendInboundMessage, pt as appendExclusiveInboundMessage, qt as stopConversationWork$1, vt as claimInboundMessage$1, wt as deadLetterAttempt$1, xt as completeConversationStop$1, yt as clearConsumedConversationWake$1, zt as recordAttemptFailure$1 } from "./projection-CQNDOi82.js";
|
|
2
|
+
import { p as logException } from "./logging-DcjLDDqi.js";
|
|
3
|
+
import { a as getConversationStore } from "./db-Czra10QW.js";
|
|
4
|
+
import "./background-compaction-queue-CNrZ3QcU.js";
|
|
5
5
|
// src/chat/task-execution/store.ts
|
|
6
6
|
function metadataStore(options) {
|
|
7
7
|
return options.conversationStore ?? getConversationStore();
|
|
@@ -304,7 +304,7 @@ async function runDeferredMove(args) {
|
|
|
304
304
|
const move = await takeDeferredConversationMove(args);
|
|
305
305
|
if (move === void 0) return;
|
|
306
306
|
try {
|
|
307
|
-
const { continueDeferredSlackClick } = await import("./slack-conversation-unfurl-
|
|
307
|
+
const { continueDeferredSlackClick } = await import("./slack-conversation-unfurl-Bty-DlHe.js").then((n) => n.r);
|
|
308
308
|
await continueDeferredSlackClick(move, args.getSlackAdapter);
|
|
309
309
|
} catch (error) {
|
|
310
310
|
logException(error, "slack.continue_here.deferred.failed", { "gen_ai.conversation.id": args.conversationId });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { _ as runBestEffort, h as logWarn } from "./logging-
|
|
4
|
-
import { X as agentTurnTotalTokens, Y as agentTurnCostUsd, o as getDb } from "./db-
|
|
5
|
-
import { d as juniorAutomationVersions, f as juniorAutomations, j as juniorConversations, u as juniorAutomationRuns } from "./executor-
|
|
6
|
-
import { r as getStateAdapter } from "./adapter-
|
|
7
|
-
import { h as credentialSubjectSchema } from "./registry-
|
|
8
|
-
import { u as automationEventCatalog, v as registeredEventTriggerProblems } from "./turn-session-routing-
|
|
9
|
-
import { B as automationTaskColumns, H as automationTaskSchema, M as scheduledAutomationSchema, S as automationVersionSchema, V as automationTaskDescription, k as eventAutomationSchema, z as automationSkillNameSchema } from "./automation-
|
|
1
|
+
import { Da as postSlackMessage, Fi as getDashboardTaskLink, Oi as JUNIOR_THREAD_STATE_TTL_MS, eo as ToolInputError, ma as formatSlackLink, pa as escapeSlackMrkdwnText, w as fallbackShortTitle, wa as openSlackDirectMessage } from "./projection-CQNDOi82.js";
|
|
2
|
+
import { n as botConfig } from "./config-CmjhyqgB.js";
|
|
3
|
+
import { _ as runBestEffort, h as logWarn } from "./logging-DcjLDDqi.js";
|
|
4
|
+
import { X as agentTurnTotalTokens, Y as agentTurnCostUsd, o as getDb } from "./db-Czra10QW.js";
|
|
5
|
+
import { d as juniorAutomationVersions, f as juniorAutomations, j as juniorConversations, u as juniorAutomationRuns } from "./executor-D_023K0H.js";
|
|
6
|
+
import { r as getStateAdapter } from "./adapter-CNjGEJO9.js";
|
|
7
|
+
import { h as credentialSubjectSchema } from "./registry-Dj377ADs.js";
|
|
8
|
+
import { u as automationEventCatalog, v as registeredEventTriggerProblems } from "./turn-session-routing-BD3-jJl7.js";
|
|
9
|
+
import { B as automationTaskColumns, H as automationTaskSchema, M as scheduledAutomationSchema, S as automationVersionSchema, V as automationTaskDescription, k as eventAutomationSchema, z as automationSkillNameSchema } from "./automation-Cva5ZOwW.js";
|
|
10
10
|
import * as z from "zod";
|
|
11
11
|
import { createHash } from "node:crypto";
|
|
12
12
|
import { and, asc, count, desc, eq, gte, inArray, isNotNull, isNull, lte, max, ne, or, sql } from "drizzle-orm";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as logWarn } from "./logging-
|
|
2
|
-
import { C as verifyQueueMessage, E as getQueueProvider, S as signQueueMessage, w as queueCallback, x as QUEUE_SIGNATURE_MAX_AGE_MS } from "./background-compaction-queue-
|
|
1
|
+
import { h as logWarn } from "./logging-DcjLDDqi.js";
|
|
2
|
+
import { C as verifyQueueMessage, E as getQueueProvider, S as signQueueMessage, w as queueCallback, x as QUEUE_SIGNATURE_MAX_AGE_MS } from "./background-compaction-queue-CNrZ3QcU.js";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
// src/chat/plugins/task-queue.ts
|
|
@@ -60,7 +60,7 @@ function pluginTaskCallback() {
|
|
|
60
60
|
maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
|
|
61
61
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
62
62
|
run: async (message) => {
|
|
63
|
-
const { processPluginTask } = await import("./task-runner-
|
|
63
|
+
const { processPluginTask } = await import("./task-runner-BMxZI3o7.js").then((n) => n.r);
|
|
64
64
|
await processPluginTask(message);
|
|
65
65
|
},
|
|
66
66
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import {
|
|
3
|
-
import { E as withSpan } from "./logging-
|
|
2
|
+
import { Bi as createPluginState, Dn as instructionTextForProjection, In as stripRuntimeTurnContext, Mn as isToolResultMessage, Oo as createPluginConversationEvents, Pn as normalizeToolNameFromResult, Sn as getPiMessageRole, _o as createPluginLogger, fr as getPlugins, go as createPluginModelCostRecorder, hr as coreTaskRegistrations, io as createPluginModel, jn as isToolResultError, ro as createPluginEmbedder, st as getTurnRecord, v as hydrateConversationMessages, ys as createPluginCache } from "./projection-CQNDOi82.js";
|
|
3
|
+
import { E as withSpan } from "./logging-DcjLDDqi.js";
|
|
4
4
|
import { v as parseSlackMessageTs } from "./actor-D2iXzvlN.js";
|
|
5
|
-
import { a as getConversationStore, o as getDb } from "./db-
|
|
5
|
+
import { a as getConversationStore, o as getDb } from "./db-Czra10QW.js";
|
|
6
6
|
import { m as sameActorIdentity } from "./history-IjdmO_r6.js";
|
|
7
|
-
import { r as getStateAdapter } from "./adapter-
|
|
8
|
-
import { i as readActorIdentity } from "./viewer-
|
|
9
|
-
import { a as getPersistedThreadState, c as coerceThreadConversationState, t as resolveConversationRouting } from "./turn-session-routing-
|
|
10
|
-
import { c as getDispatchRecord } from "./store-
|
|
11
|
-
import { i as pluginTaskParamsSchema, r as pluginTaskId, s as sendVercelPluginTask } from "./task-queue-
|
|
7
|
+
import { r as getStateAdapter } from "./adapter-CNjGEJO9.js";
|
|
8
|
+
import { i as readActorIdentity } from "./viewer-H3EsMWtJ.js";
|
|
9
|
+
import { a as getPersistedThreadState, c as coerceThreadConversationState, t as resolveConversationRouting } from "./turn-session-routing-BD3-jJl7.js";
|
|
10
|
+
import { c as getDispatchRecord } from "./store-Epv6t4vV.js";
|
|
11
|
+
import { i as pluginTaskParamsSchema, r as pluginTaskId, s as sendVercelPluginTask } from "./task-queue-AhG1tSXR.js";
|
|
12
12
|
import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
|
|
13
13
|
// src/chat/plugins/task-runner.ts
|
|
14
14
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { E as buildConversationContext, X as clearPendingAuth,
|
|
2
|
-
import { B as ProviderError, G as getProviderErrorUserMessage, U as findProviderError, W as getProviderErrorAttributes } from "./config-
|
|
3
|
-
import { G as isRecord, b as setSpanAttributes, t as buildTurnFailureResponse } from "./logging-
|
|
4
|
-
import { o as getDb, r as getConversationEventStore } from "./db-
|
|
5
|
-
import { H as readMessageCardRefs, U as removedCardSchema, W as resolveMessageCards } from "./conversation-
|
|
6
|
-
import { S as listChildMessages, m as markTurnCompleted, n as getTurnUserMessageId, p as markTurnClosed, x as isAgentInvocationResult } from "./turn-user-message-
|
|
7
|
-
import { _ as getConversationWorkState } from "./store-
|
|
8
|
-
import { a as getPersistedThreadState, c as coerceThreadConversationState, s as persistThreadStateById } from "./turn-session-routing-
|
|
1
|
+
import { E as buildConversationContext, X as clearPendingAuth, ds as listConversationAnnotations, j as markConversationMessage, v as hydrateConversationMessages } from "./projection-CQNDOi82.js";
|
|
2
|
+
import { B as ProviderError, G as getProviderErrorUserMessage, U as findProviderError, W as getProviderErrorAttributes } from "./config-CmjhyqgB.js";
|
|
3
|
+
import { G as isRecord, b as setSpanAttributes, t as buildTurnFailureResponse } from "./logging-DcjLDDqi.js";
|
|
4
|
+
import { o as getDb, r as getConversationEventStore } from "./db-Czra10QW.js";
|
|
5
|
+
import { H as readMessageCardRefs, U as removedCardSchema, W as resolveMessageCards } from "./conversation-BNXfq6Lb.js";
|
|
6
|
+
import { S as listChildMessages, m as markTurnCompleted, n as getTurnUserMessageId, p as markTurnClosed, x as isAgentInvocationResult } from "./turn-user-message-DsUZi9gn.js";
|
|
7
|
+
import { _ as getConversationWorkState } from "./store-DmV4CoNr.js";
|
|
8
|
+
import { a as getPersistedThreadState, c as coerceThreadConversationState, s as persistThreadStateById } from "./turn-session-routing-BD3-jJl7.js";
|
|
9
9
|
// src/chat/conversations/pending-cards.ts
|
|
10
10
|
/**
|
|
11
11
|
* Add the cards that tool results selected since the last visible assistant
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { G as isRecord, K as toOptionalNumber, q as toOptionalString } from "./logging-
|
|
3
|
-
import { o as getDb } from "./db-
|
|
4
|
-
import { r as getStateAdapter } from "./adapter-
|
|
1
|
+
import { Oi as JUNIOR_THREAD_STATE_TTL_MS, b as persistConversationMessages, bs as createDurableLocationConfigurationService, eo as ToolInputError } from "./projection-CQNDOi82.js";
|
|
2
|
+
import { G as isRecord, K as toOptionalNumber, q as toOptionalString } from "./logging-DcjLDDqi.js";
|
|
3
|
+
import { o as getDb } from "./db-Czra10QW.js";
|
|
4
|
+
import { r as getStateAdapter } from "./adapter-CNjGEJO9.js";
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { agentEventMatchSchema, anyResourceMatchFields, describeEventTrigger, eventTriggerChoices, eventTriggerProblems, normalizeEventIdentifier, normalizeEventMatch } from "@sentry/junior-plugin-api";
|
|
7
7
|
// src/chat/events/catalog.ts
|
|
@@ -338,7 +338,7 @@ function slackSourceForDestination(args) {
|
|
|
338
338
|
* Reads parent Conversations when this Conversation has no Destination.
|
|
339
339
|
*/
|
|
340
340
|
async function resolveConversationRouting(args) {
|
|
341
|
-
const conversationStore = args.conversationStore ?? (await import("./db-
|
|
341
|
+
const conversationStore = args.conversationStore ?? (await import("./db-Czra10QW.js").then((n) => n.n)).getConversationStore();
|
|
342
342
|
const chain = await loadConversationChain(args.conversationId, conversationStore);
|
|
343
343
|
let destination;
|
|
344
344
|
let source;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Yt as readInboundMessageSender } from "./projection-
|
|
1
|
+
import { Yt as readInboundMessageSender } from "./projection-CQNDOi82.js";
|
|
2
2
|
import { v as parseSlackMessageTs } from "./actor-D2iXzvlN.js";
|
|
3
|
-
import { r as getConversationEventStore, s as getSqlExecutor } from "./db-
|
|
4
|
-
import { g as juniorAgentInvocations } from "./executor-
|
|
3
|
+
import { r as getConversationEventStore, s as getSqlExecutor } from "./db-Czra10QW.js";
|
|
4
|
+
import { g as juniorAgentInvocations } from "./executor-D_023K0H.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { inArray } from "drizzle-orm";
|
|
7
7
|
// src/chat/state/turn-id.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as getConversationStore } from "./db-
|
|
3
|
-
import { r as getStateAdapter } from "./adapter-
|
|
1
|
+
import { Ko as SlackActionError, Xo as getSlackClient, rs as withSlackRetries, ts as runWithSlackInstallationToken } from "./projection-CQNDOi82.js";
|
|
2
|
+
import { a as getConversationStore } from "./db-Czra10QW.js";
|
|
3
|
+
import { r as getStateAdapter } from "./adapter-CNjGEJO9.js";
|
|
4
4
|
import * as z from "zod";
|
|
5
5
|
// src/chat/slack/channel.ts
|
|
6
6
|
const replySubtypeSchema = z.object({ subtype: z.string().optional() });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
2
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BEY6EGRi.js";
|
|
3
3
|
import { isDeepStrictEqual } from "node:util";
|
|
4
4
|
// src/chat/plugins/validation.ts
|
|
5
5
|
var validation_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
var version = "0.
|
|
2
|
+
var version = "0.301.0";
|
|
3
3
|
// src/version.ts
|
|
4
4
|
/** Installed Junior package version, or `unknown` when package metadata is unavailable. */
|
|
5
5
|
const JUNIOR_VERSION = typeof version === "string" && version.trim() ? version : "unknown";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as JUNIOR_VERSION } from "./version-
|
|
1
|
+
export { t as JUNIOR_VERSION } from "./version-CGMRmMPK.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { H as GOOGLE_IDENTITY_PROVIDER, W as normalizeIdentityEmail } from "./logging-
|
|
2
|
-
import { H as clearCachedUser, M as findActorIdentityId, U as readCachedUserByEmail, o as getDb } from "./db-
|
|
3
|
-
import { M as juniorIdentities, N as juniorUsers } from "./executor-
|
|
1
|
+
import { H as GOOGLE_IDENTITY_PROVIDER, W as normalizeIdentityEmail } from "./logging-DcjLDDqi.js";
|
|
2
|
+
import { H as clearCachedUser, M as findActorIdentityId, U as readCachedUserByEmail, o as getDb } from "./db-Czra10QW.js";
|
|
3
|
+
import { M as juniorIdentities, N as juniorUsers } from "./executor-D_023K0H.js";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
5
5
|
import { and, asc, eq, inArray, isNotNull } from "drizzle-orm";
|
|
6
6
|
import { identitySchema, userSchema } from "@sentry/junior-plugin-api";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { n as captureMessage, u as sentry_exports, v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { $ as loadTurnCheckpoint, Cn as getTerminalAssistantMessages,
|
|
3
|
-
import { D as resolveGatewayModel, _ as TURN_REASONING_LEVELS, i as getChatConfig, n as botConfig, q as isProviderRetryError } from "./config-
|
|
4
|
-
import { E as withSpan, h as logWarn, m as logInfo, x as setSpanStatus } from "./logging-
|
|
2
|
+
import { $ as loadTurnCheckpoint, Cn as getTerminalAssistantMessages, H as PluginCredentialFailureError, K as AuthorizationFlowDisabledError, Lo as FORK_INSTRUCTIONS, Ro as loadForkHistory, Un as escapeClosingTags, X as clearPendingAuth, _o as createPluginLogger, at as failTurnRecord, et as lostWorkerBeforeFirstSave, fn as NO_REPLY_TOOL_NAME, fr as getPlugins, in as REPLY_TOOL_NAME, j as markConversationMessage, nt as saveTurnCheckpoint, on as readTurnAnswer, qn as renderTag, rn as isTurnExecutionLimitExceededError, rt as abandonTurnRecord, s as openConversationProjection, st as getTurnRecord, tt as pauseLostWorkerTurn, un as getAssistantReplyText, v as hydrateConversationMessages, vn as REPORT_BLOCKED_TOOL_NAME, yi as listWatches, ys as createPluginCache } from "./projection-CQNDOi82.js";
|
|
3
|
+
import { D as resolveGatewayModel, _ as TURN_REASONING_LEVELS, i as getChatConfig, n as botConfig, q as isProviderRetryError } from "./config-CmjhyqgB.js";
|
|
4
|
+
import { E as withSpan, h as logWarn, m as logInfo, x as setSpanStatus } from "./logging-DcjLDDqi.js";
|
|
5
5
|
import { o as isUserActor } from "./actor-D2iXzvlN.js";
|
|
6
|
-
import { C as isPersonInput, D as conversationKindFromRow, E as turnBehavior, a as getConversationStore, et as rootConversationIsArchived, j as SYSTEM_IDENTITY_ID, o as getDb, r as getConversationEventStore, s as getSqlExecutor, w as isTopLevelKind, y as userMessageQueries } from "./db-
|
|
7
|
-
import { g as juniorAgentInvocations, h as juniorAgentBindings, j as juniorConversations, w as juniorConversationEvents } from "./executor-
|
|
6
|
+
import { C as isPersonInput, D as conversationKindFromRow, E as turnBehavior, a as getConversationStore, et as rootConversationIsArchived, j as SYSTEM_IDENTITY_ID, o as getDb, r as getConversationEventStore, s as getSqlExecutor, w as isTopLevelKind, y as userMessageQueries } from "./db-Czra10QW.js";
|
|
7
|
+
import { g as juniorAgentInvocations, h as juniorAgentBindings, j as juniorConversations, w as juniorConversationEvents } from "./executor-D_023K0H.js";
|
|
8
8
|
import { d as contextProvenance, m as sameActorIdentity, u as agentInstructionProvenance } from "./history-IjdmO_r6.js";
|
|
9
|
-
import { r as getStateAdapter } from "./adapter-
|
|
10
|
-
import { p as credentialContextSchema } from "./registry-
|
|
11
|
-
import { u as completeText } from "./prompt-
|
|
12
|
-
import { A as agentTypeInstructions, j as agentTypeSchema } from "./conversation-
|
|
13
|
-
import { C as getAuthPausedConversationTurnId, E as listActiveMailboxTurns, F as isEventMailboxMetadata, T as listActiveMailboxTurnSources, X as maybePostAutomatedTurnLimitNotice, at as
|
|
14
|
-
import { T as getTurnRequestDeadline, b as sendCacheWarmup, l as getVercelConversationWorkQueue } from "./background-compaction-queue-
|
|
15
|
-
import { A as getAgentInvocationResultMessageId, C as ownAgentInvocation, I as getUnnamedAgentConversationId, N as getChildAgentLockName, O as getAgentInvocationIdForResult, P as getNamedAgentConversationId, R as buildDeterministicTurnId, S as listChildMessages, T as getAgentInvocationId, _ as ConversationTurnLifecycleService, b as hasAgentInvocationReply, d as isTurnInputCommitLostError, j as getAgentInvocationTurnId, k as getAgentInvocationMessageId, l as getConversationTurnBoundaryError, p as markTurnClosed, s as TurnInputCommitLostError, t as getTurnUserMessage, w as readChildMessageSender } from "./turn-user-message-
|
|
16
|
-
import { D as stopConversationWork, _ as getConversationWorkState, h as ensureConversationWake, m as dropPendingMessages, r as appendAndEnqueueInboundMessage, v as getConversationWorkStates, w as requestConversationWork } from "./store-
|
|
17
|
-
import { a as getPersistedThreadState, c as coerceThreadConversationState, i as getPersistedSandboxState, n as resolveTurnSessionRouting, s as persistThreadStateById } from "./turn-session-routing-
|
|
9
|
+
import { r as getStateAdapter } from "./adapter-CNjGEJO9.js";
|
|
10
|
+
import { p as credentialContextSchema } from "./registry-Dj377ADs.js";
|
|
11
|
+
import { u as completeText } from "./prompt-DLUB5m72.js";
|
|
12
|
+
import { A as agentTypeInstructions, j as agentTypeSchema } from "./conversation-BNXfq6Lb.js";
|
|
13
|
+
import { C as getAuthPausedConversationTurnId, E as listActiveMailboxTurns, F as isEventMailboxMetadata, T as listActiveMailboxTurnSources, X as maybePostAutomatedTurnLimitNotice, at as conversationSubtree, ct as systemPromptHash, f as buildSteeringPiMessage, g as withoutSavedSteeringMessages, i as resumeStoppedConversationTree, it as resetAutomatedTurnLimit, m as instructionForInputs, n as isSkippedAfterConversationStop, ot as conversationSubtreeColumns, r as markConversationsStopped, rt as recordFinishedTurnForAutomatedLimit, st as buildDeploymentSystemPrompt, t as getConversationStoppedAtMs } from "./session-stop-BLmfFI3d.js";
|
|
14
|
+
import { T as getTurnRequestDeadline, b as sendCacheWarmup, l as getVercelConversationWorkQueue } from "./background-compaction-queue-CNrZ3QcU.js";
|
|
15
|
+
import { A as getAgentInvocationResultMessageId, C as ownAgentInvocation, I as getUnnamedAgentConversationId, N as getChildAgentLockName, O as getAgentInvocationIdForResult, P as getNamedAgentConversationId, R as buildDeterministicTurnId, S as listChildMessages, T as getAgentInvocationId, _ as ConversationTurnLifecycleService, b as hasAgentInvocationReply, d as isTurnInputCommitLostError, j as getAgentInvocationTurnId, k as getAgentInvocationMessageId, l as getConversationTurnBoundaryError, p as markTurnClosed, s as TurnInputCommitLostError, t as getTurnUserMessage, w as readChildMessageSender } from "./turn-user-message-DsUZi9gn.js";
|
|
16
|
+
import { D as stopConversationWork, _ as getConversationWorkState, h as ensureConversationWake, m as dropPendingMessages, r as appendAndEnqueueInboundMessage, v as getConversationWorkStates, w as requestConversationWork } from "./store-DmV4CoNr.js";
|
|
17
|
+
import { a as getPersistedThreadState, c as coerceThreadConversationState, i as getPersistedSandboxState, n as resolveTurnSessionRouting, s as persistThreadStateById } from "./turn-session-routing-BD3-jJl7.js";
|
|
18
18
|
import { C as isAgentInvocationResultEventType, b as AGENT_PARENT_MESSAGE_EVENT_TYPE, n as AGENT_INVOCATION_PARENT_MAILBOX_STATUSES, t as AGENT_INVOCATION_MAILBOX_STATUSES, v as AGENT_INVOCATION_EVENT_NAMESPACE } from "./statuses-Hn-HsOph.js";
|
|
19
19
|
import * as z from "zod";
|
|
20
20
|
import { streamSimple } from "@earendil-works/pi-ai/compat";
|
|
@@ -322,7 +322,7 @@ const REFRESHED_READ_FRACTION = .9;
|
|
|
322
322
|
const BREAKER_OUTCOMES_MAX = 20;
|
|
323
323
|
const BREAKER_MAX_MISSES = 10;
|
|
324
324
|
const BREAKER_OUTCOMES_TTL_MS = 360 * MINUTE_MS;
|
|
325
|
-
const BREAKER_OPEN_TTL_MS =
|
|
325
|
+
const BREAKER_OPEN_TTL_MS = 30 * MINUTE_MS;
|
|
326
326
|
const breakerOutcomesKey = (provider) => `${KEY_PREFIX}:breaker:${provider}:outcomes`;
|
|
327
327
|
const breakerOpenKey = (provider) => `${KEY_PREFIX}:breaker:${provider}:open`;
|
|
328
328
|
const providerOf = (modelId) => modelId.split("/")[0] ?? "";
|
|
@@ -383,8 +383,27 @@ function warmupTooLate(cacheExpiresAtMs) {
|
|
|
383
383
|
async function breakerOpen(state, modelId) {
|
|
384
384
|
return await state.get(breakerOpenKey(providerOf(modelId))) === true;
|
|
385
385
|
}
|
|
386
|
+
/** Report whether each warmed provider's breaker is open. */
|
|
387
|
+
async function breakerStates(state) {
|
|
388
|
+
return Promise.all(Object.keys(CACHE_TTL_MS).map(async (provider) => ({
|
|
389
|
+
provider,
|
|
390
|
+
open: await state.get(breakerOpenKey(provider)) === true
|
|
391
|
+
})));
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Close a provider's breaker so warming starts again, and forget its recent
|
|
395
|
+
* outcomes so old misses cannot reopen it. Returns false for a provider that
|
|
396
|
+
* is not warmed.
|
|
397
|
+
*/
|
|
398
|
+
async function closeBreaker(state, provider) {
|
|
399
|
+
if (!Object.hasOwn(CACHE_TTL_MS, provider)) return false;
|
|
400
|
+
await state.delete(breakerOutcomesKey(provider));
|
|
401
|
+
await state.delete(breakerOpenKey(provider));
|
|
402
|
+
return true;
|
|
403
|
+
}
|
|
386
404
|
async function countOutcome(state, modelId, miss) {
|
|
387
405
|
const provider = providerOf(modelId);
|
|
406
|
+
if (await breakerOpen(state, modelId)) return;
|
|
388
407
|
await state.appendToList(breakerOutcomesKey(provider), miss ? 1 : 0, {
|
|
389
408
|
maxLength: BREAKER_OUTCOMES_MAX,
|
|
390
409
|
ttlMs: BREAKER_OUTCOMES_TTL_MS
|
|
@@ -392,15 +411,18 @@ async function countOutcome(state, modelId, miss) {
|
|
|
392
411
|
if (!miss) return;
|
|
393
412
|
const outcomes = await state.getList(breakerOutcomesKey(provider));
|
|
394
413
|
const misses = outcomes.filter((outcome) => outcome === 1).length;
|
|
395
|
-
if (misses >= BREAKER_MAX_MISSES && await state.setIfNotExists(breakerOpenKey(provider), true, BREAKER_OPEN_TTL_MS))
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
"
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
414
|
+
if (misses >= BREAKER_MAX_MISSES && await state.setIfNotExists(breakerOpenKey(provider), true, BREAKER_OPEN_TTL_MS)) {
|
|
415
|
+
await state.delete(breakerOutcomesKey(provider));
|
|
416
|
+
captureMessage("Cache warming stopped: too many warmups missed the cache", {
|
|
417
|
+
level: "error",
|
|
418
|
+
fingerprint: ["cache_warming.breaker.opened", provider],
|
|
419
|
+
tags: { "gen_ai.request.model": modelId },
|
|
420
|
+
extra: {
|
|
421
|
+
"app.cache_warming.misses": misses,
|
|
422
|
+
"app.cache_warming.outcomes": outcomes.length
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
}
|
|
404
426
|
}
|
|
405
427
|
/**
|
|
406
428
|
* Send one warmup: the same request with a one-token output limit. Count its
|
|
@@ -3690,4 +3712,4 @@ async function runCacheWarmup(message) {
|
|
|
3690
3712
|
}, startedAtMs, warm);
|
|
3691
3713
|
}, attributes);
|
|
3692
3714
|
}
|
|
3693
|
-
export { AgentDepthLimitError as $, readChildConversationSender as A,
|
|
3715
|
+
export { AgentDepthLimitError as $, readChildConversationSender as A, GAP_SEGMENTS as At, endActiveAgentInvocations as B, listPendingAgentInvocationMailboxAppends as C, deleteWebAuthorization as Ct, sendsResultToParent as D, breakerStates as Dt, reportReplacedWithoutOpenWork as E, executeTurn as Et, parentMessageText as F, gapHistogramReport as Ft, stopChildAgent as G, enqueueAgentInvocation as H, readLastParentMessageAtMs as I, gapSegment as It, cancelSignInWait as J, stopChildAgentsBelow as K, readParentMessage as L, childAgentTurnOptions as M, MINUTE_MS as Mt, isParentMessageMeta as N, MIN_WARMUP_PREFIX_TOKENS as Nt, childAgentInput as O, closeBreaker as Ot, logDroppedParentMessage as P, NO_REPLY_GAP_MS as Pt, createAgentInvocationFromLatest as Q, createAgentInvocationWorker as R, listOpenAgentInvocations as S, createWebAuthorization as St, markAgentInvocationParentMailboxAppended as T, AgentRunError as Tt, resolveAgentInvocationId as U, endAgentInvocationsOfStoppedWork as V, dropOwnUnreadLoopReplies as W, recordSubagentEnded as X, completeCancelledConversationTurn as Y, createAgentInvocationForMessage as Z, getAgentInvocation as _, getTurnAuthorization as _t, segmentGapsKey as a, findChildAgentConversationId as at, isTerminalAgentInvocation as b, isAttemptInterrupt as bt, listConversationWork as c, CHILD_AGENT_RESULTS as ct, listChildAgents as d, supersedeOpenMailboxTurns as dt, AgentInvocationLimitError as et, listDescendantAgents as f, supersedeTurnForInput as ft, getActiveAgentInvocationForConversation as g, wakePausedTurn as gt, TERMINAL_AGENT_INVOCATION_STATUSES as h, wakeAuthorizedTurn as ht, createCacheWarmingRecorder as i, AgentNameInUseError as it, routeChildInput as j, IDLE_HORIZON_MS as jt, getChildAgentInputSender as k, connectedState as kt, readLastUserMessageAtByConversation as l, PARENT_AGENT_TARGET as lt, NON_TERMINAL_AGENT_INVOCATION_STATUSES as m, getPausedTurnRequest as mt, GLOBAL_GAPS_MAX as n, AgentMessageQueueFullError as nt, warmup_exports as o, getAgentBinding as ot, listUnreportedSiblingAgents as p, createPausedTurns as pt, stopChildAgentsOf as q, GLOBAL_GAPS_TTL_MS as r, AgentMessageTargetError as rt, isConversationWorkDone as s, CHILD_AGENT_KINDS as st, CONVERSATION_STATE_TTL_MS as t, AgentMessagePausedError as tt, listAgentRelatives as u, agentNameSchema as ut, getChildAgentLabel as v, canJoinTurn as vt, listPendingAgentInvocationResults as w, getWebAuthorization as wt, listAgentInvocationsForConversation as x, selectAttemptMessages as xt, getLatestAgentInvocationForConversation as y, canShareTurn as yt, createAndEnqueueAgentInvocation as z };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { Ct as countPendingConversationMessages, Nt as isFinalAttempt, Pt as isInvalidConversationRecordError, jt as hasConversationStop } from "./projection-
|
|
3
|
-
import { i as getChatConfig, q as isProviderRetryError } from "./config-
|
|
4
|
-
import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-
|
|
5
|
-
import { t as getConversationStoppedAtMs } from "./session-stop-
|
|
6
|
-
import { bt as isAttemptInterrupt, xt as selectAttemptMessages } from "./warmup-
|
|
7
|
-
import { T as getTurnRequestDeadline, f as ConversationQueueMessageRejectedError, h as nudgeIdempotencyKey } from "./background-compaction-queue-
|
|
8
|
-
import { C as requestAnotherSlice, S as releaseConversationWork, T as startConversationWork, _ as getConversationWorkState, b as recordAttemptFailure, c as clearConsumedConversationWake, d as completeConversationWork, f as deadLetterAttempt, h as ensureConversationWake, i as beginConversationResume, o as checkInConversationWork, p as drainConversationMailbox, t as ackMessages, u as completeConversationStop, x as recordConversationRetry } from "./store-
|
|
2
|
+
import { Ct as countPendingConversationMessages, Nt as isFinalAttempt, Pt as isInvalidConversationRecordError, jt as hasConversationStop } from "./projection-CQNDOi82.js";
|
|
3
|
+
import { i as getChatConfig, q as isProviderRetryError } from "./config-CmjhyqgB.js";
|
|
4
|
+
import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-DcjLDDqi.js";
|
|
5
|
+
import { t as getConversationStoppedAtMs } from "./session-stop-BLmfFI3d.js";
|
|
6
|
+
import { bt as isAttemptInterrupt, xt as selectAttemptMessages } from "./warmup-CdU5hR49.js";
|
|
7
|
+
import { T as getTurnRequestDeadline, f as ConversationQueueMessageRejectedError, h as nudgeIdempotencyKey } from "./background-compaction-queue-CNrZ3QcU.js";
|
|
8
|
+
import { C as requestAnotherSlice, S as releaseConversationWork, T as startConversationWork, _ as getConversationWorkState, b as recordAttemptFailure, c as clearConsumedConversationWake, d as completeConversationWork, f as deadLetterAttempt, h as ensureConversationWake, i as beginConversationResume, o as checkInConversationWork, p as drainConversationMailbox, t as ackMessages, u as completeConversationStop, x as recordConversationRetry } from "./store-DmV4CoNr.js";
|
|
9
9
|
// src/chat/task-execution/lost-lease.ts
|
|
10
10
|
/**
|
|
11
11
|
* Count a slice that lost its Conversation Lease as a failed attempt, then
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.301.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@vercel/functions": "^3.6.0",
|
|
75
75
|
"@vercel/oidc": "^3.4.1",
|
|
76
76
|
"@vercel/queue": "^0.2.0",
|
|
77
|
-
"@vercel/sandbox": "
|
|
77
|
+
"@vercel/sandbox": "4.0.0",
|
|
78
78
|
"ai": "^7.0.153",
|
|
79
79
|
"aws4fetch": "^1.0.20",
|
|
80
80
|
"better-auth": "^1.7.14",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"web-push": "^3.6.7",
|
|
97
97
|
"yaml": "^2.9.0",
|
|
98
98
|
"zod": "^4.6.7",
|
|
99
|
-
"@sentry/junior-plugin-api": "0.
|
|
99
|
+
"@sentry/junior-plugin-api": "0.301.0"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
102
|
"bullmq": "^6.5.0",
|
|
@@ -132,9 +132,9 @@
|
|
|
132
132
|
"typescript": "^7.0.2",
|
|
133
133
|
"vercel": "^54.4.0",
|
|
134
134
|
"vitest": "^4.1.12",
|
|
135
|
-
"@sentry/junior-github": "0.
|
|
136
|
-
"@sentry/junior-
|
|
137
|
-
"@sentry/junior-
|
|
135
|
+
"@sentry/junior-github": "0.301.0",
|
|
136
|
+
"@sentry/junior-memory": "0.301.0",
|
|
137
|
+
"@sentry/junior-testing": "0.0.0"
|
|
138
138
|
},
|
|
139
139
|
"scripts": {
|
|
140
140
|
"build": "tsdown",
|