@sentry/junior 0.206.0 → 0.208.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/{agent-C9yuiZUF.js → agent-BfxfHsf1.js} +375 -346
- package/dist/{agent-hooks-DNjlz2A-.js → agent-hooks-CuGjLjmR.js} +224 -97
- package/dist/{agent-runner-E67lFrDG.js → agent-runner-Dz1PMKP0.js} +9 -9
- package/dist/api/schema.d.ts +39 -39
- package/dist/api/schema.js +2 -2
- package/dist/api.d.ts +1 -1
- package/dist/api.js +154 -154
- package/dist/{app-AxGmJHwK.d.ts → app-DfNrn_gS.d.ts} +2 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +185 -183
- package/dist/{auth-pause-state-MVZ6xvEK.js → auth-pause-state-Bjoh8wCy.js} +7 -7
- package/dist/{briefs-CvJFQvhJ.js → briefs-q_onrGmf.js} +3 -3
- package/dist/{catalog-runtime-TBR8n4e1.js → catalog-runtime-D8YUMNhb.js} +1 -1
- package/dist/{checkpoint-BY47jJCB.js → checkpoint-FKMcINix.js} +8 -8
- package/dist/cli/chat.js +13 -13
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +1 -1
- package/dist/cli/plugins.js +3 -3
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-ceE7NtvC.js → client-bRyPqwAV.js} +4 -4
- package/dist/{config-CIE83sR2.js → config-EtF2uEaW.js} +6 -6
- package/dist/{context-B45_WqVX.js → context-Bplcgypl.js} +13 -13
- package/dist/{conversation-privacy-Auyq26XQ.js → conversation-privacy-whGaV2TG.js} +1 -1
- package/dist/{credential-sync-BO33aNQd.js → credential-sync-DM-EE1ey.js} +21 -21
- package/dist/{db-BeyXKJOI.d.ts → db-D74z7BZH.d.ts} +1 -1
- package/dist/{execution-stats-SiS2FLcv.js → execution-stats-C-f8zwMU.js} +77 -77
- package/dist/{executor-BfbYPW63.js → executor-BW5qp0jC.js} +43 -14
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-CyTc24Es.js → job-queue-BIHNIEIX.js} +1 -1
- package/dist/{logging-D37bayDc.js → logging-sNS84Yuu.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-BtfOeHTZ.js → oauth-callback-server-Co6D_yXP.js} +2 -2
- package/dist/{pending-auth-BPUzcs7n.js → pending-auth-CRJCt9Ux.js} +2 -2
- package/dist/{profile-CSixooTi.js → profile-BfLMVhWo.js} +4 -4
- package/dist/{prompt-3gqNY1Ka.js → prompt-x-0ZtTyb.js} +14 -14
- package/dist/{registry-DiR0-xRg.js → registry-Cyww_jnC.js} +2 -2
- package/dist/{resolve-Bn5q__9b.js → resolve-BApIFQXX.js} +2 -2
- package/dist/{runner-DFx3dIJH.js → runner-C9okx4GL.js} +10 -10
- package/dist/{sandbox-egress-signals-bwvjihxA.js → sandbox-egress-signals-BHfx0esj.js} +1 -1
- package/dist/{schema-8GXFfclK.js → schema-CwTeb-BF.js} +39 -39
- package/dist/{skills-BhM5qyCF.js → skills-DhL_wXEp.js} +2 -2
- package/dist/{spawn-Dk0PqdH6.js → spawn-msnzfE8_.js} +2 -2
- package/dist/{stats-DKRP4rsY.js → stats-Cq5w_Awk.js} +292 -268
- package/dist/{store-C5qxF2ac.d.ts → store-Det8MQ9g.d.ts} +1 -1
- package/dist/{task-queue-CdpTvu4R.js → task-queue-JfmWmpjS.js} +3 -3
- package/dist/{task-runner-alpjVSxQ.js → task-runner-Cm0gXoLH.js} +15 -15
- package/dist/{thread-state-CRK7aA41.js → thread-state-lw2QwQ-y.js} +5 -5
- package/dist/{turn-execution-XtyzIHog.js → turn-execution-C7K6lQp1.js} +3 -3
- package/dist/{turn-lifecycle-VbwZLfBv.js → turn-lifecycle-DVlJLwB0.js} +1 -1
- package/dist/{usage-D4A48Bdl.js → usage-BMuAlKIW.js} +2 -2
- package/dist/{validation-jn_46o4U.js → validation-BI-r3iQA.js} +1 -1
- package/dist/{version-DcfJxB4z.js → version-s6smK6lP.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{web-authorization-CsfLSfEs.js → web-authorization-C9MxPvXX.js} +1 -1
- package/dist/{web-input-BPp_sc7t.js → web-input-CwVlaLd0.js} +7 -109
- package/dist/{work-Di-ubSGg.js → work-BK0W1QAt.js} +9 -9
- package/dist/{worker-Cu_D5Mr8.js → worker-D-WWKHQD.js} +5 -5
- package/migrations/0041_automation_outcomes_backfill.sql +27 -0
- package/migrations/meta/0041_snapshot.json +3516 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -5
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-
|
|
2
|
-
import { t as buildTurnFailureResponse } from "./logging-
|
|
3
|
-
import { _ as parseSlackMessageTs } from "./context-
|
|
4
|
-
import { Q as hydrateConversationMessages, lt as markConversationMessage } from "./checkpoint-
|
|
5
|
-
import { Kt as buildDeterministicTurnId } from "./stats-
|
|
6
|
-
import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-
|
|
7
|
-
import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
1
|
+
import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-bRyPqwAV.js";
|
|
2
|
+
import { t as buildTurnFailureResponse } from "./logging-sNS84Yuu.js";
|
|
3
|
+
import { _ as parseSlackMessageTs } from "./context-Bplcgypl.js";
|
|
4
|
+
import { Q as hydrateConversationMessages, lt as markConversationMessage } from "./checkpoint-FKMcINix.js";
|
|
5
|
+
import { Kt as buildDeterministicTurnId } from "./stats-Cq5w_Awk.js";
|
|
6
|
+
import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-CRJCt9Ux.js";
|
|
7
|
+
import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-lw2QwQ-y.js";
|
|
8
8
|
//#region src/chat/runtime/delivered-turn-state.ts
|
|
9
9
|
/** Build state after destination delivery or intentional no-reply completion. */
|
|
10
10
|
function buildDeliveredTurnStatePatch(args) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as completeObject } from "./client-
|
|
1
|
+
import { r as completeObject } from "./client-bRyPqwAV.js";
|
|
2
2
|
import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
|
|
3
3
|
import { N as parseBriefInput, d as conversationDetailReportSchema, k as briefCodeChangeSchema, p as conversationEventPageSchema } from "./conversation-AA4R1VUn.js";
|
|
4
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
4
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-x-0ZtTyb.js";
|
|
5
5
|
import { CLI_USAGE } from "./cli/run.js";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -269,7 +269,7 @@ async function parseRunOptions(argv) {
|
|
|
269
269
|
* `DATABASE_URL` at import, and `briefs pull` must work with only a token.
|
|
270
270
|
*/
|
|
271
271
|
async function configuredDefaultModelId() {
|
|
272
|
-
const { botConfig } = await import("./config-
|
|
272
|
+
const { botConfig } = await import("./config-EtF2uEaW.js").then((n) => n.r);
|
|
273
273
|
return defaultModelId(botConfig);
|
|
274
274
|
}
|
|
275
275
|
function apiUrl(baseUrl, pathname) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { t as createPluginCatalogRuntime } from "./registry-
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-Cyww_jnC.js";
|
|
3
3
|
//#region src/chat/plugins/catalog-runtime.ts
|
|
4
4
|
var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
|
|
5
5
|
const pluginCatalogRuntime = createPluginCatalogRuntime();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-
|
|
2
|
-
import { _ as setSpanAttributes, f as logWarn, o as getActiveTraceId, t as buildTurnFailureResponse, u as logException } from "./logging-
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
4
|
-
import { _ as parseSlackMessageTs, f as toStoredSlackActor } from "./context-
|
|
5
|
-
import {
|
|
1
|
+
import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-bRyPqwAV.js";
|
|
2
|
+
import { _ as setSpanAttributes, f as logWarn, o as getActiveTraceId, t as buildTurnFailureResponse, u as logException } from "./logging-sNS84Yuu.js";
|
|
3
|
+
import { n as botConfig } from "./config-EtF2uEaW.js";
|
|
4
|
+
import { _ as parseSlackMessageTs, f as toStoredSlackActor } from "./context-Bplcgypl.js";
|
|
5
|
+
import { Bt as authenticationUnlinkedEvent, Ht as getConversationEventStore, Jt as withConversationEventLock, Kt as getSqlExecutor, Lt as JUNIOR_NATIVE_EVENT_NAMESPACE, Qt as bindProviderConversation, Rt as agentsInstructionsUpdatedEvent, Wt as getConversationStore, Yt as sanitizePostgresJson, qt as createSqlConversationEventStore, zt as authenticationLinkedEvent } from "./agent-hooks-CuGjLjmR.js";
|
|
6
6
|
import { G as instructionProvenanceFor, I as agentHistoryItemSchema, U as contextProvenance, W as instructionActors } from "./conversation-AA4R1VUn.js";
|
|
7
|
-
import { c as generateShortTitle, o as ToolInputError, s as fallbackShortTitle, t as addAgentTurnUsage } from "./usage-
|
|
8
|
-
import { A as sleep, D as fenceLock, M as SANDBOX_REPOS_ROOT, P as SANDBOX_WORKSPACE_ROOT, T as MUTATION_LOCK_TTL_MS, k as withLock, w as getStateAdapter } from "./profile-
|
|
7
|
+
import { c as generateShortTitle, o as ToolInputError, s as fallbackShortTitle, t as addAgentTurnUsage } from "./usage-BMuAlKIW.js";
|
|
8
|
+
import { A as sleep, D as fenceLock, M as SANDBOX_REPOS_ROOT, P as SANDBOX_WORKSPACE_ROOT, T as MUTATION_LOCK_TTL_MS, k as withLock, w as getStateAdapter } from "./profile-BfLMVhWo.js";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { isDeepStrictEqual } from "node:util";
|
|
11
11
|
import { z } from "zod";
|
|
@@ -2135,7 +2135,7 @@ async function upsertTurnRecordLocked(args, fence) {
|
|
|
2135
2135
|
const turnSource = args.source ?? existingRecord?.source;
|
|
2136
2136
|
const dispatchId = args.dispatchId ?? existingRecord?.dispatchId;
|
|
2137
2137
|
const hasProviderLocation = Boolean(conversation?.location) || args.destination?.platform === "slack";
|
|
2138
|
-
const publishExternally = dispatchId || turnSource ? hasProviderLocation && (Boolean(dispatchId) || turnSource?.kind === "slack" || turnSource?.kind === "
|
|
2138
|
+
const publishExternally = dispatchId || turnSource ? hasProviderLocation && (Boolean(dispatchId) || turnSource?.kind === "slack" || turnSource?.kind === "event") : existingRecord?.publishExternally ?? false;
|
|
2139
2139
|
return await setStoredRecord({
|
|
2140
2140
|
actor: existingRecord?.actor ?? args.actor,
|
|
2141
2141
|
fence,
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as executeAgentRun } from "../agent-
|
|
2
|
-
import { t as createAgentRunner } from "../agent-runner-
|
|
1
|
+
import { t as executeAgentRun } from "../agent-BfxfHsf1.js";
|
|
2
|
+
import { t as createAgentRunner } from "../agent-runner-Dz1PMKP0.js";
|
|
3
3
|
import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -101,10 +101,10 @@ async function loadLocalPluginSet() {
|
|
|
101
101
|
async function configureLocalChatPlugins(pluginSet) {
|
|
102
102
|
const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
|
|
103
103
|
import("../plugins-egKWjgue.js").then((n) => n.o),
|
|
104
|
-
import("../agent-hooks-
|
|
105
|
-
import("../catalog-runtime-
|
|
106
|
-
import("../validation-
|
|
107
|
-
import("../agent-hooks-
|
|
104
|
+
import("../agent-hooks-CuGjLjmR.js").then((n) => n.t),
|
|
105
|
+
import("../catalog-runtime-D8YUMNhb.js").then((n) => n.t),
|
|
106
|
+
import("../validation-BI-r3iQA.js").then((n) => n.r),
|
|
107
|
+
import("../agent-hooks-CuGjLjmR.js").then((n) => n.Vt)
|
|
108
108
|
]);
|
|
109
109
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
110
110
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -156,16 +156,16 @@ async function prepareLocalChatRun(io, pluginSet) {
|
|
|
156
156
|
await configureLocalChatPlugins(pluginSet);
|
|
157
157
|
const { setExperimentalFeatures } = await import("../experimental-CIXf7Uye.js").then((n) => n.t);
|
|
158
158
|
setExperimentalFeatures({ subagents: true });
|
|
159
|
-
const { setBriefsConfig } = await import("../agent-hooks-
|
|
159
|
+
const { setBriefsConfig } = await import("../agent-hooks-CuGjLjmR.js").then((n) => n.m);
|
|
160
160
|
setBriefsConfig({ enabled: true });
|
|
161
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
162
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
161
|
+
const { runLocalAgentTurn } = await import("../runner-C9okx4GL.js");
|
|
162
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-Co6D_yXP.js");
|
|
163
163
|
const { createLocalOAuthState } = await import("../oauth-relay-CdCnu80W.js").then((n) => n.t);
|
|
164
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
165
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
166
|
-
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-
|
|
164
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-BHfx0esj.js");
|
|
165
|
+
const { bindSpawnAgent } = await import("../spawn-msnzfE8_.js").then((n) => n.n);
|
|
166
|
+
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-BK0W1QAt.js").then((n) => n.a);
|
|
167
167
|
const { createLocalConversationWork } = await import("../conversation-work-C6y3T5Hx.js");
|
|
168
|
-
const { processConversationWork } = await import("../worker-
|
|
168
|
+
const { processConversationWork } = await import("../worker-D-WWKHQD.js").then((n) => n.n);
|
|
169
169
|
let agentRunner;
|
|
170
170
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
171
171
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
package/dist/cli/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as JUNIOR_HEARTBEAT_ROUTE, j as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-
|
|
2
|
-
import { d as parseInlinePluginManifest, f as parsePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { E as JUNIOR_HEARTBEAT_ROUTE, j as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-sNS84Yuu.js";
|
|
2
|
+
import { d as parseInlinePluginManifest, f as parsePluginManifest } from "../registry-Cyww_jnC.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-DhL_wXEp.js";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import fs from "node:fs/promises";
|
package/dist/cli/main.js
CHANGED
|
@@ -25,7 +25,7 @@ async function runChat(argv, pluginSet) {
|
|
|
25
25
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
26
26
|
}
|
|
27
27
|
async function runBriefs(argv) {
|
|
28
|
-
return await (await import("../briefs-
|
|
28
|
+
return await (await import("../briefs-q_onrGmf.js")).runBriefs(argv);
|
|
29
29
|
}
|
|
30
30
|
function topLevelCommand(argv) {
|
|
31
31
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
3
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { Gt as getDb, bt as createPluginLogger, d as setPlugins, f as validatePlugins } from "../agent-hooks-CuGjLjmR.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-D8YUMNhb.js";
|
|
3
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-BI-r3iQA.js";
|
|
4
4
|
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-egKWjgue.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
|
|
6
6
|
import { stderr, stdout } from "node:process";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
2
|
-
import { S as disconnectStateAdapter, t as create } from "../profile-
|
|
3
|
-
import { r as resolve } from "../resolve-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-D8YUMNhb.js";
|
|
2
|
+
import { S as disconnectStateAdapter, t as create } from "../profile-BfLMVhWo.js";
|
|
3
|
+
import { r as resolve } from "../resolve-BApIFQXX.js";
|
|
4
4
|
//#region src/cli/snapshot-create.ts
|
|
5
5
|
const DEFAULT_RUNTIME = "node22";
|
|
6
6
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
package/dist/cli/upgrade.d.ts
CHANGED
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
1
|
+
import { a as getChatConfig } from "../config-EtF2uEaW.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-BW5qp0jC.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-Cyww_jnC.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-egKWjgue.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as withSpan, f as logWarn, h as serializeGenAiAttribute, i as extractGenAiUsageAttributes, p as normalizeGenAiFinishReason, u as logException } from "./logging-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { C as withSpan, f as logWarn, h as serializeGenAiAttribute, i as extractGenAiUsageAttributes, p as normalizeGenAiFinishReason, u as logException } from "./logging-sNS84Yuu.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-whGaV2TG.js";
|
|
3
3
|
import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
|
|
4
4
|
import { stream as streamAnthropic, streamSimple as streamSimpleAnthropic } from "@earendil-works/pi-ai/api/anthropic-messages";
|
|
5
5
|
import { createGatewayProvider } from "@ai-sdk/gateway";
|
|
@@ -82,7 +82,7 @@ const TIMEOUT_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
|
82
82
|
"ECONNABORTED",
|
|
83
83
|
"ESOCKETTIMEDOUT"
|
|
84
84
|
]);
|
|
85
|
-
const CONTENT_POLICY_PATTERN = /\b(?:content|safety)[ _-]?policy\b|\b(?:content|safety) (?:filter|violation)\b|\bmoderation (?:blocked|rejected|refused)\b/i;
|
|
85
|
+
const CONTENT_POLICY_PATTERN = /\b(?:content|safety|usage)[ _-]?policy\b|\b(?:content|safety) (?:filter|violation)\b|\bmoderation (?:blocked|rejected|refused)\b/i;
|
|
86
86
|
const QUOTA_PATTERN = /insufficient.?quota|quota exceeded|usage limit|available balance|out of budget|billing (?:limit|quota|error)|payment required/i;
|
|
87
87
|
const AUTH_PATTERN = /unauthenticated|invalid.?api.?key|no api key|authentication (?:failed|error|required)|(?:invalid|missing|expired|revoked).{0,24}\bcredentials?\b|\bcredentials?\b.{0,24}(?:invalid|missing|expired|revoked)|\bno\b.{0,16}\bcredentials?\b/i;
|
|
88
88
|
const PERMISSION_PATTERN = /permission denied|forbidden|not authorized|authorization (?:failed|required|denied)/i;
|
|
@@ -210,7 +210,7 @@ function getProviderErrorUserMessage(error) {
|
|
|
210
210
|
case "content_policy": return "The model provider blocked this request under its content policy. Please revise the request and try again.";
|
|
211
211
|
case "invalid_request": return "The model provider rejected this request as invalid. Please revise the request or ask an administrator to check the model configuration.";
|
|
212
212
|
case "invalid_response": return "The model provider returned an invalid response. Please try again.";
|
|
213
|
-
default: return "";
|
|
213
|
+
default: return "The model provider returned an error. Please try again.";
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
/** Return safe structured fields for terminal failure telemetry. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { o as resolveGatewayModel, w as toOptionalTrimmed } from "./client-
|
|
3
|
-
import { f as logWarn } from "./logging-
|
|
2
|
+
import { o as resolveGatewayModel, w as toOptionalTrimmed } from "./client-bRyPqwAV.js";
|
|
3
|
+
import { f as logWarn } from "./logging-sNS84Yuu.js";
|
|
4
4
|
import { c as TURN_REASONING_LEVELS, l as parseTurnReasoningLevel, o as modelProfileSchema } from "./model-profile-CZmVoGdX.js";
|
|
5
5
|
import { getModel } from "@earendil-works/pi-ai/compat";
|
|
6
6
|
//#region src/chat/slack/emoji.ts
|
|
@@ -43,12 +43,12 @@ const MAX_SLICES_PER_TURN = 100;
|
|
|
43
43
|
const MAX_TOOL_CALLS_PER_TURN = 250;
|
|
44
44
|
/**
|
|
45
45
|
* Max consecutive automated turns before event wakes stop until a user message.
|
|
46
|
-
* Resource-event CI watches and event-
|
|
46
|
+
* Resource-event CI watches and event-automation loops are the common runaway paths.
|
|
47
47
|
* Sentry telemetry has no direct instrumentation for how long real automated
|
|
48
48
|
* chains run (only failure paths on the notice are logged, and those show zero
|
|
49
49
|
* hits in the last 30d), so this is sized qualitatively: it stays well under
|
|
50
50
|
* the runaway CI-watch-loop range noted for maxToolCallsPerTurn (hundreds of
|
|
51
|
-
* tool calls) while giving multi-phase event-
|
|
51
|
+
* tool calls) while giving multi-phase event-automation/scheduled-automation work enough
|
|
52
52
|
* headroom to avoid pausing on legitimate longer-running automation.
|
|
53
53
|
*/
|
|
54
54
|
const MAX_CONSECUTIVE_AUTOMATED_TURNS = 25;
|
|
@@ -126,10 +126,10 @@ function parseCrossActorMidRunMode(rawValue) {
|
|
|
126
126
|
throw new Error("JUNIOR_CROSS_ACTOR_MID_RUN_MODE must be follow_up or steer");
|
|
127
127
|
}
|
|
128
128
|
const DEFAULT_MODEL_ID = getModel("vercel-ai-gateway", "xai/grok-4.5").id;
|
|
129
|
-
const DEFAULT_FAST_MODEL_ID = getModel("vercel-ai-gateway", "
|
|
129
|
+
const DEFAULT_FAST_MODEL_ID = getModel("vercel-ai-gateway", "openai/gpt-5.6-luna").id;
|
|
130
130
|
const DEFAULT_GUARDIAN_MODEL_ID = getModel("vercel-ai-gateway", "openai/gpt-5.6-luna").id;
|
|
131
131
|
const DEFAULT_HANDOFF_MODEL_ID = getModel("vercel-ai-gateway", "openai/gpt-5.6-sol").id;
|
|
132
|
-
const DEFAULT_WEB_SEARCH_MODEL_ID = getModel("vercel-ai-gateway", "openai/gpt-5.
|
|
132
|
+
const DEFAULT_WEB_SEARCH_MODEL_ID = getModel("vercel-ai-gateway", "openai/gpt-5.6-luna").id;
|
|
133
133
|
const DEFAULT_EMBEDDING_MODEL_ID = "openai/text-embedding-3-small";
|
|
134
134
|
const DEFAULT_IMAGE_GENERATION_MODEL_ID = "google/gemini-3-pro-image";
|
|
135
135
|
function validateGatewayModelId(raw) {
|
|
@@ -209,22 +209,22 @@ const slackDirectCredentialSubjectBindingSchema = z.object({
|
|
|
209
209
|
channelId: z.string().min(1),
|
|
210
210
|
signature: z.string().min(1)
|
|
211
211
|
}).strict();
|
|
212
|
-
const
|
|
213
|
-
type: z.literal("scheduled-
|
|
212
|
+
const scheduledAutomationCredentialSubjectBindingSchema = z.object({
|
|
213
|
+
type: z.literal("scheduled-automation"),
|
|
214
214
|
plugin: z.string().min(1),
|
|
215
215
|
taskId: exactNonBlankStringSchema,
|
|
216
216
|
signature: z.string().min(1)
|
|
217
217
|
}).strict();
|
|
218
|
-
const
|
|
219
|
-
type: z.literal("event-
|
|
218
|
+
const eventAutomationCredentialSubjectBindingSchema = z.object({
|
|
219
|
+
type: z.literal("event-automation"),
|
|
220
220
|
plugin: z.string().min(1),
|
|
221
221
|
taskId: exactNonBlankStringSchema,
|
|
222
222
|
signature: z.string().min(1)
|
|
223
223
|
}).strict();
|
|
224
224
|
z.discriminatedUnion("type", [
|
|
225
225
|
slackDirectCredentialSubjectBindingSchema,
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
scheduledAutomationCredentialSubjectBindingSchema,
|
|
227
|
+
eventAutomationCredentialSubjectBindingSchema
|
|
228
228
|
]);
|
|
229
229
|
const credentialUserActorSchema = z.object({
|
|
230
230
|
type: z.literal("user"),
|
|
@@ -244,21 +244,21 @@ const credentialSubjectSchema = z.discriminatedUnion("allowedWhen", [
|
|
|
244
244
|
z.object({
|
|
245
245
|
type: z.literal("user"),
|
|
246
246
|
userId: exactActorIdSchema,
|
|
247
|
-
allowedWhen: z.literal("scheduled-
|
|
247
|
+
allowedWhen: z.literal("scheduled-automation"),
|
|
248
248
|
taskId: exactNonBlankStringSchema,
|
|
249
|
-
binding:
|
|
249
|
+
binding: scheduledAutomationCredentialSubjectBindingSchema
|
|
250
250
|
}).strict().refine((subject) => subject.binding.taskId === subject.taskId, {
|
|
251
|
-
message: "Scheduled
|
|
251
|
+
message: "Scheduled automation credential subject requires task binding",
|
|
252
252
|
path: ["binding"]
|
|
253
253
|
}),
|
|
254
254
|
z.object({
|
|
255
255
|
type: z.literal("user"),
|
|
256
256
|
userId: exactActorIdSchema,
|
|
257
|
-
allowedWhen: z.literal("event-
|
|
257
|
+
allowedWhen: z.literal("event-automation"),
|
|
258
258
|
taskId: exactNonBlankStringSchema,
|
|
259
|
-
binding:
|
|
259
|
+
binding: eventAutomationCredentialSubjectBindingSchema
|
|
260
260
|
}).strict().refine((subject) => subject.binding.taskId === subject.taskId, {
|
|
261
|
-
message: "Event
|
|
261
|
+
message: "Event automation credential subject requires task binding",
|
|
262
262
|
path: ["binding"]
|
|
263
263
|
})
|
|
264
264
|
]);
|
|
@@ -275,7 +275,7 @@ const credentialContextSchema = z.union([z.object({ actor: credentialUserActorSc
|
|
|
275
275
|
* - system actor → `{ actor: systemActor, subject? }`
|
|
276
276
|
*
|
|
277
277
|
* They only diverge when a system run carries an explicit delegated `subject`
|
|
278
|
-
* (scheduled/event-
|
|
278
|
+
* (scheduled/event-automation creator credentials). Callers should set `actor` first,
|
|
279
279
|
* then derive this — do not hand-build parallel shapes.
|
|
280
280
|
*/
|
|
281
281
|
function credentialContextForActor(actor, subject) {
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { N as getMcpProviderErrorAttributes, Y as createUserTokenStore, a as deleteMcpAuthSession, d as putMcpStoredOAuthCredentials, h as resolvePluginOAuthAccount, i as finalizeMcpAuthorization, l as getMcpAuthSession, u as getMcpStoredOAuthCredentials, y as lookupSlackUserProfile } from "./agent-
|
|
2
|
-
import { m as escapeXml } from "./client-
|
|
3
|
-
import { L as toOptionalString, S as withLogContext, d as logInfo, f as logWarn, m as runBestEffort, u as logException, y as setTags } from "./logging-
|
|
4
|
-
import { a as getChatConfig, h as normalizeSlackEmojiName, n as botConfig, o as getRuntimeMetadata } from "./config-
|
|
1
|
+
import { N as getMcpProviderErrorAttributes, Y as createUserTokenStore, a as deleteMcpAuthSession, d as putMcpStoredOAuthCredentials, h as resolvePluginOAuthAccount, i as finalizeMcpAuthorization, l as getMcpAuthSession, u as getMcpStoredOAuthCredentials, y as lookupSlackUserProfile } from "./agent-BfxfHsf1.js";
|
|
2
|
+
import { m as escapeXml } from "./client-bRyPqwAV.js";
|
|
3
|
+
import { L as toOptionalString, S as withLogContext, d as logInfo, f as logWarn, m as runBestEffort, u as logException, y as setTags } from "./logging-sNS84Yuu.js";
|
|
4
|
+
import { a as getChatConfig, h as normalizeSlackEmojiName, n as botConfig, o as getRuntimeMetadata } from "./config-EtF2uEaW.js";
|
|
5
5
|
import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
|
|
6
|
-
import { _ as parseSlackMessageTs, g as parseSlackUserId, l as isUserActor, s as createSlackResumeActor } from "./context-
|
|
7
|
-
import {
|
|
6
|
+
import { _ as parseSlackMessageTs, g as parseSlackUserId, l as isUserActor, s as createSlackResumeActor } from "./context-Bplcgypl.js";
|
|
7
|
+
import { G as isDmChannel, H as getHeaderString, K as normalizeSlackConversationId, Kt as getSqlExecutor, Nt as buildSentryConversationUrl, U as getSlackClient, Wt as getConversationStore, mt as getDashboardConversationLink, nn as upsertIdentity, o as getPluginSlackConversationLink, on as requireSlackDestination, rn as upsertLinkedIdentity, z as SlackActionError } from "./agent-hooks-CuGjLjmR.js";
|
|
8
8
|
import { i as homeDir } from "./package-discovery-7a9YqLhE.js";
|
|
9
|
-
import { l as hasRequiredOAuthScope, n as buildOAuthTokenRequest, r as parseOAuthTokenResponse } from "./registry-
|
|
10
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
11
|
-
import { t as discoverSkills } from "./skills-
|
|
12
|
-
import { P as commitAcceptedReply, Q as hydrateConversationMessages, R as loadProjection, U as recordAuthenticationLinked, W as recordAuthorizationCompleted, d as persistWithRetry, dt as recordDeliveredAssistantMessage, ft as turnHasReply, i as abandonTurnRecord, it as buildConversationContext, lt as markConversationMessage, m as buildTurnErrorResponse, n as loadTurnCheckpoint, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord, u as recordTurnSummary } from "./checkpoint-
|
|
13
|
-
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-
|
|
14
|
-
import { Pt as requestConversationWork, c as parseSlackThreadId, d as resolveSlackChannelIdFromThreadId, l as readSlackRawMessageContext, u as resolveSlackChannelIdFromMessage, wt as ensureConversationWake } from "./stats-
|
|
15
|
-
import { a as isPendingAuthLatestRequest, f as CooperativeTurnYieldError, g as isCooperativeTurnYieldError, i as getConversationPendingAuth, r as clearPendingAuth, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-
|
|
16
|
-
import { a as parseOAuthStatePayload, c as escapeSlackMrkdwnText, d as normalizeSlackStatusText, f as truncateStatusText, g as removeReactionFromMessage, h as postSlackMessage, i as formatProviderLabel, l as formatSlackLink, o as resolveBaseUrl, p as addReactionToMessage, u as normalizeSlackReplyMarkdown, v as RetryableDeliveryError } from "./agent-runner-
|
|
9
|
+
import { l as hasRequiredOAuthScope, n as buildOAuthTokenRequest, r as parseOAuthTokenResponse } from "./registry-Cyww_jnC.js";
|
|
10
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-D8YUMNhb.js";
|
|
11
|
+
import { t as discoverSkills } from "./skills-DhL_wXEp.js";
|
|
12
|
+
import { P as commitAcceptedReply, Q as hydrateConversationMessages, R as loadProjection, U as recordAuthenticationLinked, W as recordAuthorizationCompleted, d as persistWithRetry, dt as recordDeliveredAssistantMessage, ft as turnHasReply, i as abandonTurnRecord, it as buildConversationContext, lt as markConversationMessage, m as buildTurnErrorResponse, n as loadTurnCheckpoint, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord, u as recordTurnSummary } from "./checkpoint-FKMcINix.js";
|
|
13
|
+
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-BfLMVhWo.js";
|
|
14
|
+
import { Pt as requestConversationWork, c as parseSlackThreadId, d as resolveSlackChannelIdFromThreadId, l as readSlackRawMessageContext, u as resolveSlackChannelIdFromMessage, wt as ensureConversationWake } from "./stats-Cq5w_Awk.js";
|
|
15
|
+
import { a as isPendingAuthLatestRequest, f as CooperativeTurnYieldError, g as isCooperativeTurnYieldError, i as getConversationPendingAuth, r as clearPendingAuth, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-CRJCt9Ux.js";
|
|
16
|
+
import { a as parseOAuthStatePayload, c as escapeSlackMrkdwnText, d as normalizeSlackStatusText, f as truncateStatusText, g as removeReactionFromMessage, h as postSlackMessage, i as formatProviderLabel, l as formatSlackLink, o as resolveBaseUrl, p as addReactionToMessage, u as normalizeSlackReplyMarkdown, v as RetryableDeliveryError } from "./agent-runner-Dz1PMKP0.js";
|
|
17
17
|
import { t as getVercelConversationWorkQueue } from "./vercel-queue-DIkVcfK4.js";
|
|
18
|
-
import { a as getTurnRequestDeadline } from "./job-queue-
|
|
19
|
-
import { i as resolveTurnSessionRouting, n as scheduleSessionCompletedPluginTasks } from "./task-runner-
|
|
20
|
-
import { n as getTurnLifecycle } from "./turn-lifecycle-
|
|
21
|
-
import { n as executeTurn, t as AgentRunError } from "./turn-execution-
|
|
22
|
-
import { c as configValueSchema, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-
|
|
23
|
-
import { a as requireTurnFailureEventId, c as getTurnUserMessageId, d as buildDeliveredTurnStatePatch, l as getTurnUserReplyAttachmentContext, n as persistAuthPauseTurnState, o as getInterruptionMarker, r as finalizeFailedTurnReplyWithEvent, s as getTurnUserMessage, u as getTurnUserSlackMessageTs } from "./auth-pause-state-
|
|
18
|
+
import { a as getTurnRequestDeadline } from "./job-queue-BIHNIEIX.js";
|
|
19
|
+
import { i as resolveTurnSessionRouting, n as scheduleSessionCompletedPluginTasks } from "./task-runner-Cm0gXoLH.js";
|
|
20
|
+
import { n as getTurnLifecycle } from "./turn-lifecycle-DVlJLwB0.js";
|
|
21
|
+
import { n as executeTurn, t as AgentRunError } from "./turn-execution-C7K6lQp1.js";
|
|
22
|
+
import { c as configValueSchema, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-lw2QwQ-y.js";
|
|
23
|
+
import { a as requireTurnFailureEventId, c as getTurnUserMessageId, d as buildDeliveredTurnStatePatch, l as getTurnUserReplyAttachmentContext, n as persistAuthPauseTurnState, o as getInterruptionMarker, r as finalizeFailedTurnReplyWithEvent, s as getTurnUserMessage, u as getTurnUserSlackMessageTs } from "./auth-pause-state-Bjoh8wCy.js";
|
|
24
24
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-CdCnu80W.js";
|
|
25
|
-
import { n as deleteWebAuthorization } from "./web-authorization-
|
|
25
|
+
import { n as deleteWebAuthorization } from "./web-authorization-C9MxPvXX.js";
|
|
26
26
|
import path from "node:path";
|
|
27
27
|
import { z } from "zod";
|
|
28
28
|
import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
|