@sentry/junior 0.277.0 → 0.278.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-BtfBHVM5.js → adapter-BXosqTMx.js} +1 -1
- package/dist/{admin-DzAKbZsm.js → admin-Thn7NfOi.js} +1 -1
- package/dist/{agent-invocations-Crs3XHhg.js → agent-invocations-D7c4BQGc.js} +1 -1
- package/dist/{agent-runner-BsYAbniN.js → agent-runner-DE-43MPb.js} +268 -835
- 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 +38 -76
- package/dist/{app-BjEQwNVP.d.ts → app-CHNS-AX2.d.ts} +5 -26
- package/dist/app.d.ts +2 -2
- package/dist/app.js +30 -31
- package/dist/{assistant-reply-NebRGG4G.js → assistant-reply-pauL6qyn.js} +28 -6
- package/dist/{automation-Cql9h2vO.js → automation-DphoTRYl.js} +1 -1
- package/dist/{background-compaction-queue-hh18yCeU.js → background-compaction-queue-CAL4A2y7.js} +2 -2
- package/dist/{briefs-BBo0Eimi.js → briefs-4fyPJJEu.js} +5 -6
- package/dist/{catalog-runtime-DE-F4Awo.js → catalog-runtime-BoOb5oUv.js} +1 -1
- package/dist/cli/chat.js +14 -14
- package/dist/cli/check.js +3 -3
- package/dist/cli/init.js +0 -2
- 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/{client-DZ8HTnYH.js → client-v_OVYuHZ.js} +3 -3
- package/dist/{config-D5uUtrCP.js → config-o2jLRY5J.js} +24 -99
- package/dist/{connections-Do24CGP5.js → connections-RC4NXAx8.js} +10 -10
- package/dist/{conversation-SsASlWL7.js → conversation-CZfyQvdm.js} +51 -104
- package/dist/{conversation-privacy-VuylvlKr.js → conversation-privacy-C23M8KaD.js} +1 -1
- package/dist/{credential-sync-BGQK3pOa.js → credential-sync-Dd0WyNfF.js} +13 -13
- package/dist/{db-DEiwO5Sh.d.ts → db-BjLzDJCt.d.ts} +1 -1
- package/dist/{executor-hPfFTH0C.js → executor-CJfsD0VX.js} +3 -3
- package/dist/instrumentation.js +2 -2
- package/dist/{logging-cI3T1dNc.js → logging-dFaXvBRK.js} +1 -1
- package/dist/{media-DstkkoNP.js → media-DTAA8Qs_.js} +21 -23
- package/dist/{message-DBwsAl7O.js → message-DSwxIZet.js} +22 -28
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-DXrnbplb.js → oauth-callback-server-CDcuCp27.js} +2 -2
- package/dist/{projection-7EFIqzuj.js → projection-BTge9wrH.js} +106 -108
- package/dist/{prompt-oRfGsxd3.js → prompt-DDtCnlHP.js} +1 -1
- package/dist/{registry-Bzefs7kT.js → registry-Cp6CNmtP.js} +1 -1
- package/dist/{resolve-CuiEY_2u.js → resolve-B_7h2cXx.js} +3 -3
- package/dist/{result-DrcUtFaD.js → result-5LBEfnLX.js} +9 -9
- package/dist/{runner-CDE4CZ52.js → runner-C5-S4oq-.js} +11 -11
- package/dist/{sandbox-egress-signals-0tcmGd13.js → sandbox-egress-signals-B4GehT1L.js} +1 -1
- package/dist/{schema-Dzi3lkdP.js → schema-B5fpczDw.js} +67 -4
- package/dist/{schema-B6N2nc6v.d.ts → schema-Tr484cCC.d.ts} +909 -687
- package/dist/{service-account-DIyz_9Uh.js → service-account-BkEv20zf.js} +3 -3
- package/dist/{service-account-BOz9pqOE.js → service-account-Cq_dLrZJ.js} +3 -3
- package/dist/{session-stop-0juF_BP0.js → session-stop-BsS4qFS2.js} +22 -15
- package/dist/{skills-CU5Is147.js → skills-M0BA0_s6.js} +2 -2
- package/dist/{spawn-6C9jHH4b.js → spawn-BO3y7H4d.js} +2 -3
- package/dist/{stop-6FVG1c-r.js → stop-D5R82Wla.js} +255 -64
- package/dist/{store-DtHZviJ1.js → store-BGBzQWNf.js} +9 -16
- package/dist/{store-DKs1WwdB.js → store-CGJZTEVz.js} +3 -3
- package/dist/{task-queue-CcvFQE_p.js → task-queue-UD27ei2U.js} +3 -3
- package/dist/{task-runner-DBkNejLl.js → task-runner-noxjOjkM.js} +7 -7
- package/dist/{thread-state-4hjEIkIq.js → thread-state-BSu6rM6p.js} +4 -4
- package/dist/{turn-failure-response-BZNLydC3.js → turn-failure-response-wahwyPrZ.js} +7 -7
- package/dist/{turn-lifecycle-BhqYjaa4.js → turn-lifecycle-Bo4Trccw.js} +1 -1
- package/dist/{turn-session-routing-jnLOfBHJ.js → turn-session-routing-DnSaaEpn.js} +10 -10
- package/dist/{validation-BUFmsnKs.js → validation-B9-8iKyw.js} +1 -1
- package/dist/{version-DJTk0ZCE.js → version-C7HejFP2.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-WY0RYE4E.js → viewer-DLXajQZE.js} +52 -21
- package/dist/{work-C5AKvXJV.js → work-DRGSlfia.js} +12 -17
- package/dist/{worker-BcYVDVUy.js → worker-BGh5Dwc6.js} +6 -6
- package/migrations/meta/0075_snapshot.json +98 -314
- package/migrations/meta/0076_snapshot.json +98 -314
- package/migrations/meta/_journal.json +1 -1
- package/package.json +4 -4
- package/dist/model-profile-B998sjVd.js +0 -67
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { i as completeObject } from "./client-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-oRfGsxd3.js";
|
|
1
|
+
import { i as completeObject } from "./client-v_OVYuHZ.js";
|
|
2
|
+
import { U as parseBriefInput, c as conversationDetailReportSchema, u as conversationEventPageSchema, z as briefCodeChangeSchema } from "./conversation-CZfyQvdm.js";
|
|
3
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-DDtCnlHP.js";
|
|
5
4
|
import { CLI_USAGE } from "./cli/run.js";
|
|
6
5
|
import path from "node:path";
|
|
7
6
|
import { z } from "zod";
|
|
@@ -267,8 +266,8 @@ async function parseRunOptions(argv) {
|
|
|
267
266
|
* `DATABASE_URL` at import, and `briefs pull` must work with only a token.
|
|
268
267
|
*/
|
|
269
268
|
async function configuredDefaultModelId() {
|
|
270
|
-
const { botConfig } = await import("./config-
|
|
271
|
-
return
|
|
269
|
+
const { botConfig } = await import("./config-o2jLRY5J.js").then((n) => n.r);
|
|
270
|
+
return botConfig.modelId;
|
|
272
271
|
}
|
|
273
272
|
function apiUrl(baseUrl, pathname) {
|
|
274
273
|
const base = new URL(baseUrl);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { t as createPluginCatalogRuntime } from "./registry-
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-Cp6CNmtP.js";
|
|
3
3
|
// src/chat/plugins/catalog-runtime.ts
|
|
4
4
|
var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
|
|
5
5
|
const pluginCatalogRuntime = createPluginCatalogRuntime();
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-
|
|
1
|
+
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-DE-43MPb.js";
|
|
2
2
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -99,10 +99,10 @@ async function loadLocalPluginSet() {
|
|
|
99
99
|
async function configureLocalChatPlugins(pluginSet) {
|
|
100
100
|
const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
|
|
101
101
|
import("../plugins-DOm9Y6qI.js").then((n) => n.o),
|
|
102
|
-
import("../projection-
|
|
103
|
-
import("../catalog-runtime-
|
|
104
|
-
import("../validation-
|
|
105
|
-
import("../viewer-
|
|
102
|
+
import("../projection-BTge9wrH.js").then((n) => n.kn),
|
|
103
|
+
import("../catalog-runtime-BoOb5oUv.js").then((n) => n.t),
|
|
104
|
+
import("../validation-B9-8iKyw.js").then((n) => n.r),
|
|
105
|
+
import("../viewer-DLXajQZE.js").then((n) => n.v)
|
|
106
106
|
]);
|
|
107
107
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
108
108
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -152,18 +152,18 @@ function localDevServerUrl() {
|
|
|
152
152
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
153
153
|
defaultStateAdapterForLocalChat();
|
|
154
154
|
await configureLocalChatPlugins(pluginSet);
|
|
155
|
-
const { setBriefsConfig } = await import("../projection-
|
|
155
|
+
const { setBriefsConfig } = await import("../projection-BTge9wrH.js").then((n) => n.Vn);
|
|
156
156
|
setBriefsConfig({ enabled: true });
|
|
157
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
158
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
157
|
+
const { runLocalAgentTurn } = await import("../runner-C5-S4oq-.js");
|
|
158
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-CDcuCp27.js");
|
|
159
159
|
const { createLocalOAuthState } = await import("../oauth-relay-C6ZAyJgf.js").then((n) => n.t);
|
|
160
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
161
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
162
|
-
const { bindMessageAgent } = await import("../message-
|
|
163
|
-
const { createChildConversationWorker } = await import("../result-
|
|
164
|
-
const { skipInputBeforeConversationStop } = await import("../session-stop-
|
|
160
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-B4GehT1L.js");
|
|
161
|
+
const { bindSpawnAgent } = await import("../spawn-BO3y7H4d.js").then((n) => n.n);
|
|
162
|
+
const { bindMessageAgent } = await import("../message-DSwxIZet.js").then((n) => n.n);
|
|
163
|
+
const { createChildConversationWorker } = await import("../result-5LBEfnLX.js").then((n) => n.i);
|
|
164
|
+
const { skipInputBeforeConversationStop } = await import("../session-stop-BsS4qFS2.js").then((n) => n.r);
|
|
165
165
|
const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
|
|
166
|
-
const { processConversationWork } = await import("../worker-
|
|
166
|
+
const { processConversationWork } = await import("../worker-BGh5Dwc6.js").then((n) => n.n);
|
|
167
167
|
let agentRunner;
|
|
168
168
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
169
169
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
package/dist/cli/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, L as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, M as JUNIOR_HEARTBEAT_ROUTE } from "../logging-
|
|
2
|
-
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { A as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, L as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, M as JUNIOR_HEARTBEAT_ROUTE } from "../logging-dFaXvBRK.js";
|
|
2
|
+
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-Cp6CNmtP.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-M0BA0_s6.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "node:fs/promises";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
package/dist/cli/init.js
CHANGED
package/dist/cli/main.js
CHANGED
|
@@ -25,13 +25,13 @@ async function runChat(argv, pluginSet) {
|
|
|
25
25
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
26
26
|
}
|
|
27
27
|
async function runAdmin(argv) {
|
|
28
|
-
return await (await import("../admin-
|
|
28
|
+
return await (await import("../admin-Thn7NfOi.js")).runAdmin(argv);
|
|
29
29
|
}
|
|
30
30
|
async function runServiceAccount(argv) {
|
|
31
|
-
return await (await import("../service-account-
|
|
31
|
+
return await (await import("../service-account-Cq_dLrZJ.js")).runServiceAccount(argv);
|
|
32
32
|
}
|
|
33
33
|
async function runBriefs(argv) {
|
|
34
|
-
return await (await import("../briefs-
|
|
34
|
+
return await (await import("../briefs-4fyPJJEu.js")).runBriefs(argv);
|
|
35
35
|
}
|
|
36
36
|
function topLevelCommand(argv) {
|
|
37
37
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as getDb } from "../viewer-
|
|
3
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
4
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { Rn as setPlugins, ka as createPluginLogger, zn as validatePlugins } from "../projection-BTge9wrH.js";
|
|
2
|
+
import { S as getDb } from "../viewer-DLXajQZE.js";
|
|
3
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-BoOb5oUv.js";
|
|
4
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-B9-8iKyw.js";
|
|
5
5
|
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-DOm9Y6qI.js";
|
|
6
6
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
7
7
|
import { stderr, stdout } from "node:process";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
3
|
-
import { t as disconnectStateAdapter } from "../adapter-
|
|
4
|
-
import { n as resolve } from "../resolve-
|
|
1
|
+
import { ai as create } from "../projection-BTge9wrH.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-BoOb5oUv.js";
|
|
3
|
+
import { t as disconnectStateAdapter } from "../adapter-BXosqTMx.js";
|
|
4
|
+
import { n as resolve } from "../resolve-B_7h2cXx.js";
|
|
5
5
|
// src/cli/snapshot-create.ts
|
|
6
6
|
const DEFAULT_RUNTIME = "node22";
|
|
7
7
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
package/dist/cli/upgrade.d.ts
CHANGED
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
1
|
+
import { i as getChatConfig } from "../config-o2jLRY5J.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-CJfsD0VX.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-Cp6CNmtP.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-DOm9Y6qI.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
6
6
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-dFaXvBRK.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-C23M8KaD.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";
|
|
@@ -281,7 +281,7 @@ const COMPACTION_SUMMARY_PREFIX = "Another language model started to solve this
|
|
|
281
281
|
/** Return whether text is one of Junior's durable compacted-context markers. */
|
|
282
282
|
function isCompactionSummaryText(text) {
|
|
283
283
|
const normalized = (unwrapCurrentInstruction(text) ?? text).trimStart();
|
|
284
|
-
return normalized.startsWith("Another language model started to solve this problem and produced a summary of its thinking process. You also have access to the state of the tools that were used by that language model. Use this to build on the work that has already been done and avoid duplicating work. Here is the summary produced by the other language model, use the information in this summary to assist with your own analysis:") || normalized.startsWith("Another language model started to solve this problem and produced a summary of its thinking process. You also have access to the state of the tools that were used by that language model. Use this to build on the work that has already been done and avoid duplicating work. Here is the summary produced by the other language model, use the information in this summary to assist with your own analysis:")
|
|
284
|
+
return normalized.startsWith("Another language model started to solve this problem and produced a summary of its thinking process. You also have access to the state of the tools that were used by that language model. Use this to build on the work that has already been done and avoid duplicating work. Here is the summary produced by the other language model, use the information in this summary to assist with your own analysis:") || normalized.startsWith("Another language model started to solve this problem and produced a summary of its thinking process. You also have access to the state of the tools that were used by that language model. Use this to build on the work that has already been done and avoid duplicating work. Here is the summary produced by the other language model, use the information in this summary to assist with your own analysis:");
|
|
285
285
|
}
|
|
286
286
|
/** Return whether model-visible history contains a durable compacted context marker. */
|
|
287
287
|
function hasCompactedConversationContext(messages) {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { C as toOptionalTrimmed, c as resolveGatewayModel } from "./client-
|
|
3
|
-
import { h as logWarn } from "./logging-cI3T1dNc.js";
|
|
4
|
-
import { c as modelProfileSchema, d as parseTurnReasoningLevel, t as DEFAULT_MODEL_PROFILES, u as TURN_REASONING_LEVELS } from "./model-profile-B998sjVd.js";
|
|
2
|
+
import { C as toOptionalTrimmed, c as resolveGatewayModel } from "./client-v_OVYuHZ.js";
|
|
5
3
|
import { AwsClient } from "aws4fetch";
|
|
4
|
+
import { z } from "zod";
|
|
6
5
|
// src/chat/attachments/s3.ts
|
|
7
6
|
function readRequiredSetting(env, name) {
|
|
8
7
|
const value = toOptionalTrimmed(env[name]);
|
|
@@ -133,6 +132,22 @@ function normalizeSlackEmojiName(value) {
|
|
|
133
132
|
const normalized = trimmed.startsWith(":") && trimmed.endsWith(":") ? trimmed.slice(1, -1) : trimmed;
|
|
134
133
|
return SLACK_EMOJI_NAME_RE.test(normalized) ? normalized : null;
|
|
135
134
|
}
|
|
135
|
+
// src/chat/reasoning-level.ts
|
|
136
|
+
const TURN_REASONING_LEVELS = [
|
|
137
|
+
"none",
|
|
138
|
+
"low",
|
|
139
|
+
"medium",
|
|
140
|
+
"high",
|
|
141
|
+
"xhigh"
|
|
142
|
+
];
|
|
143
|
+
/** Validate a configured main-agent reasoning level. */
|
|
144
|
+
function parseTurnReasoningLevel(value) {
|
|
145
|
+
return z.enum(TURN_REASONING_LEVELS).parse(value);
|
|
146
|
+
}
|
|
147
|
+
/** Convert a reasoning level into the Pi Agent setting for a main Turn. */
|
|
148
|
+
function toPiReasoningLevel(level) {
|
|
149
|
+
return level === "none" ? "off" : level;
|
|
150
|
+
}
|
|
136
151
|
// src/chat/config.ts
|
|
137
152
|
var config_exports = /* @__PURE__ */ __exportAll({
|
|
138
153
|
CONVERSATION_WORK_SOFT_YIELD_BUFFER_SECONDS: () => 40,
|
|
@@ -149,7 +164,6 @@ var config_exports = /* @__PURE__ */ __exportAll({
|
|
|
149
164
|
resetRuntimeConfig: () => resetRuntimeConfig,
|
|
150
165
|
restoreRuntimeConfig: () => restoreRuntimeConfig,
|
|
151
166
|
setBotModelConfig: () => setBotModelConfig,
|
|
152
|
-
setProfiles: () => setProfiles,
|
|
153
167
|
setRuntimeLimits: () => setRuntimeLimits,
|
|
154
168
|
setSlackReactionConfig: () => setSlackReactionConfig,
|
|
155
169
|
snapshotRuntimeConfig: () => snapshotRuntimeConfig
|
|
@@ -251,10 +265,10 @@ function parseConversationWorkEnabled(rawValue) {
|
|
|
251
265
|
if (value === "false") return false;
|
|
252
266
|
throw new Error("JUNIOR_CONVERSATION_WORK_ENABLED must be true or false");
|
|
253
267
|
}
|
|
254
|
-
const DEFAULT_MODEL_ID = resolveGatewayModel(
|
|
268
|
+
const DEFAULT_MODEL_ID = resolveGatewayModel("anthropic/claude-opus-5.5").id;
|
|
269
|
+
const DEFAULT_REASONING_LEVEL = "high";
|
|
255
270
|
const DEFAULT_FAST_MODEL_ID = resolveGatewayModel("openai/gpt-6-luna").id;
|
|
256
271
|
const DEFAULT_GUARDIAN_MODEL_ID = resolveGatewayModel("openai/gpt-6-luna").id;
|
|
257
|
-
const DEFAULT_HANDOFF_MODEL_ID = resolveGatewayModel(DEFAULT_MODEL_PROFILES.handoff.modelId).id;
|
|
258
272
|
const DEFAULT_WEB_SEARCH_MODEL_ID = resolveGatewayModel("openai/gpt-6-luna").id;
|
|
259
273
|
const DEFAULT_DECISION_MODEL_ID = "typesafe-ai/jev";
|
|
260
274
|
const DEFAULT_EMBEDDING_MODEL_ID = "openai/text-embedding-3-small";
|
|
@@ -275,73 +289,6 @@ function requireModelId(configName, raw, validate) {
|
|
|
275
289
|
if (!modelId) throw new Error(`${configName} must not be empty`);
|
|
276
290
|
return modelId;
|
|
277
291
|
}
|
|
278
|
-
function parseOptionalProfileDescription(rawDescription, configName, profile) {
|
|
279
|
-
if (rawDescription === void 0) return;
|
|
280
|
-
if (typeof rawDescription !== "string") throw new Error(`${configName}.${profile}.description must be a string when set`);
|
|
281
|
-
const description = toOptionalTrimmed(rawDescription);
|
|
282
|
-
if (!description) throw new Error(`${configName}.${profile}.description must not be empty when set`);
|
|
283
|
-
return description;
|
|
284
|
-
}
|
|
285
|
-
function parseOptionalProfileReasoningLevel(rawReasoningLevel, configName, profile) {
|
|
286
|
-
if (rawReasoningLevel === void 0) return;
|
|
287
|
-
try {
|
|
288
|
-
return parseTurnReasoningLevel(rawReasoningLevel);
|
|
289
|
-
} catch {
|
|
290
|
-
throw new Error(`${configName}.${profile}.reasoningLevel must be one of ${TURN_REASONING_LEVELS.join(", ")}`);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
function parseProfileConfig(rawProfile, configName, profile) {
|
|
294
|
-
if (typeof rawProfile === "string") {
|
|
295
|
-
const modelId = validateGatewayModelId(rawProfile);
|
|
296
|
-
if (!modelId) throw new Error(`${configName}.${profile} must not be empty`);
|
|
297
|
-
return { modelId };
|
|
298
|
-
}
|
|
299
|
-
if (!rawProfile || typeof rawProfile !== "object" || Array.isArray(rawProfile)) throw new Error(`${configName}.${profile} must be a model id string or an object with modelId`);
|
|
300
|
-
const rawModelId = rawProfile.modelId;
|
|
301
|
-
if (typeof rawModelId !== "string") throw new Error(`${configName}.${profile}.modelId must be a model id string`);
|
|
302
|
-
const modelId = validateGatewayModelId(rawModelId);
|
|
303
|
-
if (!modelId) throw new Error(`${configName}.${profile}.modelId must not be empty`);
|
|
304
|
-
const description = parseOptionalProfileDescription(rawProfile.description, configName, profile);
|
|
305
|
-
const reasoningLevel = parseOptionalProfileReasoningLevel(rawProfile.reasoningLevel, configName, profile);
|
|
306
|
-
return {
|
|
307
|
-
modelId,
|
|
308
|
-
...description ? { description } : void 0,
|
|
309
|
-
...reasoningLevel ? { reasoningLevel } : void 0
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
function parseProfileMap(rawProfiles, configName) {
|
|
313
|
-
if (!rawProfiles || typeof rawProfiles !== "object" || Array.isArray(rawProfiles)) throw new Error(`${configName} must be ${configName === "AI_MODEL_PROFILES" ? "a JSON object" : "an object"}`);
|
|
314
|
-
const profiles = {};
|
|
315
|
-
for (const [profile, rawProfile] of Object.entries(rawProfiles)) {
|
|
316
|
-
if (!modelProfileSchema.safeParse(profile).success) throw new Error(`${configName} profile "${profile}" must match ^[a-z][a-z0-9_-]*$`);
|
|
317
|
-
profiles[profile] = parseProfileConfig(rawProfile, configName, profile);
|
|
318
|
-
}
|
|
319
|
-
return profiles;
|
|
320
|
-
}
|
|
321
|
-
function parseProfiles(rawValue, standardModelId, handoffModelId) {
|
|
322
|
-
const profiles = {
|
|
323
|
-
standard: {
|
|
324
|
-
...DEFAULT_MODEL_PROFILES.standard,
|
|
325
|
-
modelId: standardModelId
|
|
326
|
-
},
|
|
327
|
-
handoff: {
|
|
328
|
-
...DEFAULT_MODEL_PROFILES.handoff,
|
|
329
|
-
modelId: handoffModelId
|
|
330
|
-
}
|
|
331
|
-
};
|
|
332
|
-
const trimmed = toOptionalTrimmed(rawValue);
|
|
333
|
-
if (trimmed === void 0) return profiles;
|
|
334
|
-
let parsed;
|
|
335
|
-
try {
|
|
336
|
-
parsed = JSON.parse(trimmed);
|
|
337
|
-
} catch {
|
|
338
|
-
throw new Error("AI_MODEL_PROFILES must be a JSON object");
|
|
339
|
-
}
|
|
340
|
-
return {
|
|
341
|
-
...profiles,
|
|
342
|
-
...parseProfileMap(parsed, "AI_MODEL_PROFILES")
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
292
|
function parseReactionEmoji(envName, rawValue, defaultEmoji) {
|
|
346
293
|
const trimmed = toOptionalTrimmed(rawValue);
|
|
347
294
|
if (trimmed === void 0) return defaultEmoji;
|
|
@@ -349,29 +296,17 @@ function parseReactionEmoji(envName, rawValue, defaultEmoji) {
|
|
|
349
296
|
if (!normalized) throw new Error(`${envName} must be a valid Slack emoji name (for example "eyes" or ":white_check_mark:")`);
|
|
350
297
|
return normalized;
|
|
351
298
|
}
|
|
352
|
-
function warnDeprecatedProfileEnv(env) {
|
|
353
|
-
for (const envName of [
|
|
354
|
-
"AI_MODEL",
|
|
355
|
-
"AI_HANDOFF_MODEL",
|
|
356
|
-
"AI_MODEL_PROFILES"
|
|
357
|
-
]) if (toOptionalTrimmed(env[envName]) !== void 0) logWarn("config.profile_env.deprecated", {
|
|
358
|
-
"app.config.env_name": envName,
|
|
359
|
-
"app.config.replacement": "createApp({ defaultProfile, profiles })"
|
|
360
|
-
});
|
|
361
|
-
}
|
|
362
299
|
function readBotConfig(env, functionMaxDurationSeconds) {
|
|
363
300
|
const maxTurnTimeoutMs = resolveMaxTurnTimeoutMs(functionMaxDurationSeconds);
|
|
364
301
|
const modelId = validateGatewayModelId(env.AI_MODEL) ?? DEFAULT_MODEL_ID;
|
|
365
302
|
const reasoningLevel = toOptionalTrimmed(env.AI_REASONING_LEVEL);
|
|
366
303
|
const fastModelId = validateGatewayModelId(env.AI_FAST_MODEL ?? env.AI_MODEL) ?? DEFAULT_FAST_MODEL_ID;
|
|
367
304
|
const guardianModelId = validateGatewayModelId(env.AI_GUARDIAN_MODEL) ?? DEFAULT_GUARDIAN_MODEL_ID;
|
|
368
|
-
const handoffModelId = validateGatewayModelId(env.AI_HANDOFF_MODEL) ?? DEFAULT_HANDOFF_MODEL_ID;
|
|
369
305
|
return {
|
|
370
306
|
userName: toOptionalTrimmed(env.JUNIOR_BOT_NAME) ?? "junior",
|
|
371
|
-
|
|
372
|
-
profiles: parseProfiles(env.AI_MODEL_PROFILES, modelId, handoffModelId),
|
|
307
|
+
modelId,
|
|
373
308
|
contextWindowTokens: parseOptionalPositiveInteger("AI_MODEL_CONTEXT_WINDOW_TOKENS", env.AI_MODEL_CONTEXT_WINDOW_TOKENS) ?? DEFAULT_MODEL_CONTEXT_WINDOW_TOKENS,
|
|
374
|
-
reasoningLevel: reasoningLevel === void 0 ?
|
|
309
|
+
reasoningLevel: reasoningLevel === void 0 ? DEFAULT_REASONING_LEVEL : parseTurnReasoningLevel(reasoningLevel),
|
|
375
310
|
decisionModelId: toOptionalTrimmed(env.AI_DECISION_MODEL) ?? DEFAULT_DECISION_MODEL_ID,
|
|
376
311
|
fastModelId,
|
|
377
312
|
guardianModelId,
|
|
@@ -423,7 +358,6 @@ function readSqlStatementTimeoutMs(env) {
|
|
|
423
358
|
/** Parse all chat configuration from environment variables. */
|
|
424
359
|
function readChatConfig(env = process.env, functionMaxDurationSeconds = DEFAULT_FUNCTION_MAX_DURATION_SECONDS) {
|
|
425
360
|
const databaseUrl = readDatabaseUrl(env);
|
|
426
|
-
warnDeprecatedProfileEnv(env);
|
|
427
361
|
const resolvedFunctionMaxDurationSeconds = resolveFunctionMaxDurationSeconds(functionMaxDurationSeconds);
|
|
428
362
|
return {
|
|
429
363
|
attachmentStorage: readAttachmentStorageConfig(env),
|
|
@@ -534,6 +468,7 @@ function getRuntimeMetadata() {
|
|
|
534
468
|
}
|
|
535
469
|
/** Apply model overrides from createApp(). */
|
|
536
470
|
function setBotModelConfig(config) {
|
|
471
|
+
if (config.modelId !== void 0) botConfig.modelId = requireModelId("modelId", config.modelId, validateGatewayModelId);
|
|
537
472
|
if (config.decisionModelId !== void 0) botConfig.decisionModelId = requireModelId("decisionModelId", config.decisionModelId, toOptionalTrimmed);
|
|
538
473
|
if (config.embeddingModelId !== void 0) botConfig.embeddingModelId = requireModelId("embeddingModelId", config.embeddingModelId, validateEmbeddingModelId);
|
|
539
474
|
if (config.fastModelId !== void 0) botConfig.fastModelId = requireModelId("fastModelId", config.fastModelId, validateGatewayModelId);
|
|
@@ -543,19 +478,9 @@ function setBotModelConfig(config) {
|
|
|
543
478
|
if (config.visionModelId !== void 0) botConfig.visionModelId = requireModelId("visionModelId", config.visionModelId, validateGatewayModelId);
|
|
544
479
|
if (config.webSearchModelId !== void 0) botConfig.webSearchModelId = requireModelId("webSearchModelId", config.webSearchModelId, validateGatewayModelId);
|
|
545
480
|
}
|
|
546
|
-
/** Apply profiles from createApp(). */
|
|
547
|
-
function setProfiles(profiles, defaultProfile) {
|
|
548
|
-
if (!profiles || !defaultProfile) throw new Error("profiles and defaultProfile must be configured together");
|
|
549
|
-
const configuredProfiles = parseProfileMap(profiles, "profiles");
|
|
550
|
-
const selectedDefault = defaultProfile;
|
|
551
|
-
if (!modelProfileSchema.safeParse(selectedDefault).success) throw new Error(`defaultProfile "${selectedDefault}" must match ^[a-z][a-z0-9_-]*$`);
|
|
552
|
-
if (!Object.hasOwn(configuredProfiles, selectedDefault)) throw new Error(`defaultProfile "${selectedDefault}" is not configured`);
|
|
553
|
-
botConfig.profiles = configuredProfiles;
|
|
554
|
-
botConfig.defaultProfile = selectedDefault;
|
|
555
|
-
}
|
|
556
481
|
/** Apply Slack reaction emoji overrides from createApp() options, validating names. */
|
|
557
482
|
function setSlackReactionConfig(overrides) {
|
|
558
483
|
if (overrides.processingReactionEmoji !== void 0) chatConfig.slack.processingReactionEmoji = parseReactionEmoji("processingReactionEmoji", overrides.processingReactionEmoji, chatConfig.slack.processingReactionEmoji);
|
|
559
484
|
if (overrides.completedReactionEmoji !== void 0) chatConfig.slack.completedReactionEmoji = parseReactionEmoji("completedReactionEmoji", overrides.completedReactionEmoji, chatConfig.slack.completedReactionEmoji);
|
|
560
485
|
}
|
|
561
|
-
export {
|
|
486
|
+
export { toPiReasoningLevel as _, getRuntimeMetadata as a, getSlackClientSecret as c, restoreRuntimeConfig as d, setBotModelConfig as f, TURN_REASONING_LEVELS as g, snapshotRuntimeConfig as h, getChatConfig as i, getSlackSigningSecret as l, setSlackReactionConfig as m, botConfig as n, getSlackBotToken as o, setRuntimeLimits as p, config_exports as r, getSlackClientId as s, DEFAULT_SQL_STATEMENT_TIMEOUT_MS as t, resetRuntimeConfig as u, normalizeSlackEmojiName as v, createS3AttachmentStorage as y };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { C as getSqlExecutor,
|
|
4
|
-
import { u as hasRequiredOAuthScope } from "./registry-
|
|
5
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
6
|
-
import { c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-
|
|
7
|
-
import { r as getStateAdapter } from "./adapter-
|
|
8
|
-
import { l as getVercelConversationWorkQueue } from "./background-compaction-queue-
|
|
9
|
-
import { m as ensureConversationWake, w as requestConversationWork } from "./store-
|
|
10
|
-
import { n as resolveTurnSessionRouting } from "./turn-session-routing-
|
|
1
|
+
import { X as loadTurnCheckpoint, et as failTurnRecord, gi as startOAuthFlow, tt as getTurnRecord } from "./projection-BTge9wrH.js";
|
|
2
|
+
import { n as botConfig } from "./config-o2jLRY5J.js";
|
|
3
|
+
import { C as getSqlExecutor, R as deleteProviderIdentityForSlackUser, y as getConversationEventStore, z as deleteProviderIdentityForUser } from "./viewer-DLXajQZE.js";
|
|
4
|
+
import { u as hasRequiredOAuthScope } from "./registry-Cp6CNmtP.js";
|
|
5
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BoOb5oUv.js";
|
|
6
|
+
import { c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-DE-43MPb.js";
|
|
7
|
+
import { r as getStateAdapter } from "./adapter-BXosqTMx.js";
|
|
8
|
+
import { l as getVercelConversationWorkQueue } from "./background-compaction-queue-CAL4A2y7.js";
|
|
9
|
+
import { m as ensureConversationWake, w as requestConversationWork } from "./store-CGJZTEVz.js";
|
|
10
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-DnSaaEpn.js";
|
|
11
11
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
// src/chat/task-execution/authorized-turn.ts
|