@sentry/junior 0.209.0 → 0.210.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-B_tHeZp6.js → agent-DKboUiLS.js} +34 -25
- package/dist/{agent-hooks-DDJGkqlR.js → agent-hooks-4I-C-LhZ.js} +8 -8
- package/dist/{agent-runner-CPBSl1Xv.js → agent-runner-DgqYKBZm.js} +5 -5
- package/dist/api.js +15 -15
- package/dist/{app-DfNrn_gS.d.ts → app-gyu3D9Gn.d.ts} +2 -0
- package/dist/app.d.ts +1 -1
- package/dist/app.js +64 -31
- package/dist/{auth-pause-state-BZqtr-GX.js → auth-pause-state-3wQ2cGwW.js} +6 -6
- package/dist/{briefs-ZLRkWQQn.js → briefs-DsJVC55W.js} +3 -3
- package/dist/{catalog-runtime-D89PJa84.js → catalog-runtime-D11j6L4T.js} +1 -1
- package/dist/{checkpoint-DBX1KyOb.js → checkpoint-CHdApjyQ.js} +6 -6
- package/dist/cli/chat.js +13 -13
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +3 -3
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-7_NmRtoz.js → client-CuyBdpWp.js} +2 -2
- package/dist/{config-BPGL4uP-.js → config-DoMOvr4Z.js} +2 -2
- package/dist/{conversation-privacy-CgtRvwq8.js → conversation-privacy-Dxiz_d9l.js} +1 -1
- package/dist/{credential-sync-DCYT7j8m.js → credential-sync-6WRLsSQy.js} +32 -23
- package/dist/{execution-stats-CyehCrCF.js → execution-stats-D7Q3Mo8Y.js} +4 -4
- package/dist/{executor-ctvBB7kO.js → executor-BR-u7Eiz.js} +277 -21
- package/dist/instrumentation.js +3 -3
- package/dist/{job-queue-C1lIZ7DE.js → job-queue-FcjDDzOt.js} +1 -1
- package/dist/{logging-CHzH6JFD.js → logging-GTB-Z6hs.js} +2 -2
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-DQvCkP93.js → oauth-callback-server-CuLHQpGM.js} +2 -2
- package/dist/{pending-auth-D6c_jWmW.js → pending-auth-DZKNc2-v.js} +2 -2
- package/dist/{profile-DPAFjrER.js → profile-DEoalaoa.js} +4 -4
- package/dist/{prompt-x-0ZtTyb.js → prompt-Calvr7V2.js} +3 -3
- package/dist/{registry-vUqDWPNS.js → registry-wMxSBovn.js} +1 -1
- package/dist/{resolve-CToO52ls.js → resolve-C0ds-bvC.js} +2 -2
- package/dist/{runner-D3KdCdDY.js → runner-BoK9ACgc.js} +9 -9
- package/dist/{sandbox-egress-signals-C_zy8cZG.js → sandbox-egress-signals-CnzazNxY.js} +1 -1
- package/dist/{sentry-CD3SdJl-.js → sentry-CgWZM_kV.js} +3 -2
- package/dist/{skills-BszTHE4F.js → skills-CbGNcUOh.js} +2 -2
- package/dist/{spawn-v7JJowIu.js → spawn-Dm3kRFmC.js} +2 -2
- package/dist/{stats-t0wuykQW.js → stats-DROv84Z6.js} +13 -9
- package/dist/{task-queue-TyHaXCpO.js → task-queue-BUAVtd2X.js} +3 -3
- package/dist/{task-runner-DVDa7fAI.js → task-runner-ByBGnm9Q.js} +7 -7
- package/dist/{thread-state-DB_913ic.js → thread-state-BTFCRXKk.js} +5 -5
- package/dist/{turn-execution-BRd4mQlB.js → turn-execution-BXKiBFtp.js} +3 -3
- package/dist/{turn-lifecycle-CoNJoE-n.js → turn-lifecycle-Bu7HgoE6.js} +1 -1
- package/dist/{usage-D5t1yT3R.js → usage-DJ2WBjfc.js} +2 -2
- package/dist/{validation-sI1EnNoM.js → validation-ZZEOV02h.js} +1 -1
- package/dist/{version-BrgX_LoI.js → version-Cf7Fwr1w.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{web-authorization-BNCTTM5f.js → web-authorization-D74eDSAs.js} +1 -1
- package/dist/{web-input-NEbUfS0Q.js → web-input-c6W_exA0.js} +4 -4
- package/dist/{work-Dv5SHQ4C.js → work-zBMuzR-T.js} +9 -9
- package/dist/{worker-1GzySfPG.js → worker-C-9UqHKm.js} +9 -6
- package/package.json +4 -4
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-GTB-Z6hs.js";
|
|
2
|
+
import { d as parseInlinePluginManifest, f as parsePluginManifest } from "../registry-wMxSBovn.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-CbGNcUOh.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
|
@@ -4,7 +4,7 @@ import { pathToFileURL } from "node:url";
|
|
|
4
4
|
//#region src/cli/main.ts
|
|
5
5
|
const SENTRY_FLUSH_TIMEOUT_MS = 2e3;
|
|
6
6
|
async function flushSentry() {
|
|
7
|
-
await (await import("../sentry-
|
|
7
|
+
await (await import("../sentry-CgWZM_kV.js").then((n) => n.u)).flush(SENTRY_FLUSH_TIMEOUT_MS);
|
|
8
8
|
}
|
|
9
9
|
async function initSentry() {
|
|
10
10
|
(await import("../instrumentation.js")).initSentry();
|
|
@@ -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-DsJVC55W.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 { Gt as getDb, bt as createPluginLogger, d as setPlugins, f as validatePlugins } from "../agent-hooks-
|
|
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-4I-C-LhZ.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-D11j6L4T.js";
|
|
3
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-ZZEOV02h.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-D11j6L4T.js";
|
|
2
|
+
import { S as disconnectStateAdapter, t as create } from "../profile-DEoalaoa.js";
|
|
3
|
+
import { r as resolve } from "../resolve-C0ds-bvC.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.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-DoMOvr4Z.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-BR-u7Eiz.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-wMxSBovn.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-GTB-Z6hs.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-Dxiz_d9l.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";
|
|
@@ -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-CuyBdpWp.js";
|
|
3
|
+
import { f as logWarn } from "./logging-GTB-Z6hs.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
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { N as getMcpProviderErrorAttributes,
|
|
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, X 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-DKboUiLS.js";
|
|
2
|
+
import { m as escapeXml } from "./client-CuyBdpWp.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-GTB-Z6hs.js";
|
|
4
|
+
import { a as getChatConfig, h as normalizeSlackEmojiName, n as botConfig, o as getRuntimeMetadata } from "./config-DoMOvr4Z.js";
|
|
5
5
|
import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
|
|
6
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-
|
|
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-4I-C-LhZ.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-wMxSBovn.js";
|
|
10
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-D11j6L4T.js";
|
|
11
|
+
import { t as discoverSkills } from "./skills-CbGNcUOh.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-CHdApjyQ.js";
|
|
13
|
+
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-DEoalaoa.js";
|
|
14
|
+
import { Pt as requestConversationWork, c as parseSlackThreadId, d as resolveSlackChannelIdFromThreadId, l as readSlackRawMessageContext, u as resolveSlackChannelIdFromMessage, wt as ensureConversationWake } from "./stats-DROv84Z6.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-DZKNc2-v.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-DgqYKBZm.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-FcjDDzOt.js";
|
|
19
|
+
import { i as resolveTurnSessionRouting, n as scheduleSessionCompletedPluginTasks } from "./task-runner-ByBGnm9Q.js";
|
|
20
|
+
import { n as getTurnLifecycle } from "./turn-lifecycle-Bu7HgoE6.js";
|
|
21
|
+
import { n as executeTurn, t as AgentRunError } from "./turn-execution-BXKiBFtp.js";
|
|
22
|
+
import { c as configValueSchema, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-BTFCRXKk.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-3wQ2cGwW.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-D74eDSAs.js";
|
|
26
26
|
import path from "node:path";
|
|
27
27
|
import { z } from "zod";
|
|
28
28
|
import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
|
|
@@ -963,7 +963,7 @@ async function handleResumeFailure(args) {
|
|
|
963
963
|
eventId
|
|
964
964
|
});
|
|
965
965
|
}
|
|
966
|
-
function buildResumedRun(args, statusSession, delivery) {
|
|
966
|
+
function buildResumedRun(args, statusSession, delivery, postIntentAcknowledgment) {
|
|
967
967
|
const savedRun = args.run;
|
|
968
968
|
if (!savedRun) throw new TypeError("Slack resume requires a saved Run");
|
|
969
969
|
if (!savedRun.source) throw new TypeError("Slack resume requires a Run Source");
|
|
@@ -992,7 +992,10 @@ function buildResumedRun(args, statusSession, delivery) {
|
|
|
992
992
|
locationConfiguration: persistedLocationConfiguration
|
|
993
993
|
},
|
|
994
994
|
onEvent: async (event) => {
|
|
995
|
-
if (event.type === "status")
|
|
995
|
+
if (event.type === "status") {
|
|
996
|
+
statusSession.update({ text: event.text });
|
|
997
|
+
if (event.intentAcknowledgment) await postIntentAcknowledgment(event.text);
|
|
998
|
+
}
|
|
996
999
|
await priorOnEvent?.(event);
|
|
997
1000
|
},
|
|
998
1001
|
...savedRun.dispatch?.outcomes?.length === 0 ? void 0 : { delivery },
|
|
@@ -1175,7 +1178,13 @@ async function resumeSlackTurnInContext(args) {
|
|
|
1175
1178
|
};
|
|
1176
1179
|
const deliveryState = await getDeliveryConversation();
|
|
1177
1180
|
assistantMessageDelivered = turnHasReply(deliveryState.conversation, sessionId);
|
|
1178
|
-
|
|
1181
|
+
let intentAcknowledgmentPosted = false;
|
|
1182
|
+
const postIntentAcknowledgment = async (text) => {
|
|
1183
|
+
if (intentAcknowledgmentPosted || runArgs.run?.dispatch?.outcomes?.length === 0) return;
|
|
1184
|
+
intentAcknowledgmentPosted = true;
|
|
1185
|
+
await postSlackMessageBestEffort(runArgs.channelId, runArgs.threadTs, text, runArgs.conversationId, runArgs.run?.dispatch?.replyAttribution);
|
|
1186
|
+
};
|
|
1187
|
+
const run = buildResumedRun(runArgs, status, deliverAssistantMessage, postIntentAcknowledgment);
|
|
1179
1188
|
if (runArgs.inputMessageIds?.length) await turnLifecycle.start({
|
|
1180
1189
|
conversationId: runArgs.conversationId,
|
|
1181
1190
|
turnId: runArgs.turnId,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { f as logWarn } from "./logging-
|
|
2
|
-
import { Gt as getDb } from "./agent-hooks-
|
|
3
|
-
import { s as juniorAutomationExecutions, w as juniorConversations } from "./executor-
|
|
4
|
-
import { n as agentTurnCostUsd, r as agentTurnTotalTokens } from "./usage-
|
|
1
|
+
import { f as logWarn } from "./logging-GTB-Z6hs.js";
|
|
2
|
+
import { Gt as getDb } from "./agent-hooks-4I-C-LhZ.js";
|
|
3
|
+
import { s as juniorAutomationExecutions, w as juniorConversations } from "./executor-BR-u7Eiz.js";
|
|
4
|
+
import { n as agentTurnCostUsd, r as agentTurnTotalTokens } from "./usage-DJ2WBjfc.js";
|
|
5
5
|
import { and, asc, count, desc, eq, gte, inArray, lte, max, or, sql } from "drizzle-orm";
|
|
6
6
|
//#region src/api/conversations/aggregate.ts
|
|
7
7
|
function usageTokenValue(source, field) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./config-
|
|
1
|
+
import { g as startSpanManual } from "./sentry-CgWZM_kV.js";
|
|
2
|
+
import "./config-DoMOvr4Z.js";
|
|
3
3
|
import { n as juniorDestinations, r as timestamptz } from "./destinations-BeBiJeEM.js";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
import { getTableColumns, sql } from "drizzle-orm";
|
|
@@ -7,6 +7,7 @@ import { bigint, boolean, check, date, doublePrecision, foreignKey, index, integ
|
|
|
7
7
|
import { Pool } from "@neondatabase/serverless";
|
|
8
8
|
import { drizzle } from "drizzle-orm/neon-serverless";
|
|
9
9
|
import { migrate } from "drizzle-orm/neon-serverless/migrator";
|
|
10
|
+
import { SpanKind } from "@opentelemetry/api";
|
|
10
11
|
import pg from "pg";
|
|
11
12
|
import { drizzle as drizzle$1 } from "drizzle-orm/node-postgres";
|
|
12
13
|
import { migrate as migrate$1 } from "drizzle-orm/node-postgres/migrator";
|
|
@@ -535,28 +536,273 @@ const juniorSqlSchema = {
|
|
|
535
536
|
//#endregion
|
|
536
537
|
//#region src/db/tracing.ts
|
|
537
538
|
const traced = Symbol("junior.db.traced");
|
|
538
|
-
const
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
539
|
+
const MAX_QUERY_TEXT_LENGTH = 1e4;
|
|
540
|
+
const MAX_QUERY_SUMMARY_LENGTH = 255;
|
|
541
|
+
const SQL_OPERATIONS = /* @__PURE__ */ new Set([
|
|
542
|
+
"ALTER",
|
|
543
|
+
"ANALYZE",
|
|
544
|
+
"BEGIN",
|
|
545
|
+
"CALL",
|
|
546
|
+
"COMMIT",
|
|
547
|
+
"COPY",
|
|
548
|
+
"CREATE",
|
|
549
|
+
"DELETE",
|
|
550
|
+
"DROP",
|
|
551
|
+
"EXPLAIN",
|
|
552
|
+
"GRANT",
|
|
553
|
+
"INSERT",
|
|
554
|
+
"MERGE",
|
|
555
|
+
"RELEASE",
|
|
556
|
+
"REVOKE",
|
|
557
|
+
"ROLLBACK",
|
|
558
|
+
"SAVEPOINT",
|
|
559
|
+
"SELECT",
|
|
560
|
+
"SET",
|
|
561
|
+
"SHOW",
|
|
562
|
+
"TRUNCATE",
|
|
563
|
+
"UPDATE",
|
|
564
|
+
"VACUUM"
|
|
565
|
+
]);
|
|
566
|
+
const SQL_IDENTIFIER = String.raw`(?:(?:U&)?"(?:""|[^"])*"|[A-Za-z_][A-Za-z0-9_$]*)(?:\.(?:(?:U&)?"(?:""|[^"])*"|[A-Za-z_][A-Za-z0-9_$]*))*`;
|
|
567
|
+
function targetPattern(prefix) {
|
|
568
|
+
return new RegExp(`${prefix}(${SQL_IDENTIFIER})`, "i");
|
|
569
|
+
}
|
|
570
|
+
const SQL_TARGET = {
|
|
571
|
+
ALTER: targetPattern(String.raw`\bALTER\s+TABLE\s+`),
|
|
572
|
+
CALL: targetPattern(String.raw`\bCALL\s+`),
|
|
573
|
+
CREATE: targetPattern(String.raw`\bCREATE\s+(?:OR\s+REPLACE\s+)?(?:TABLE|VIEW)\s+(?:IF\s+NOT\s+EXISTS\s+)?`),
|
|
574
|
+
DELETE: targetPattern(String.raw`\bDELETE\s+FROM\s+`),
|
|
575
|
+
DROP: targetPattern(String.raw`\bDROP\s+(?:TABLE|VIEW)\s+(?:IF\s+EXISTS\s+)?`),
|
|
576
|
+
INSERT: targetPattern(String.raw`\bINSERT\s+INTO\s+`),
|
|
577
|
+
MERGE: targetPattern(String.raw`\bMERGE\s+INTO\s+`),
|
|
578
|
+
SELECT: targetPattern(String.raw`\bFROM\s+`),
|
|
579
|
+
TRUNCATE: targetPattern(String.raw`\bTRUNCATE\s+(?:TABLE\s+)?`),
|
|
580
|
+
UPDATE: targetPattern(String.raw`\bUPDATE\s+`)
|
|
581
|
+
};
|
|
582
|
+
function queryText(query) {
|
|
583
|
+
if (typeof query === "string") return query;
|
|
584
|
+
if (!query || typeof query !== "object" || !("text" in query)) return;
|
|
585
|
+
return typeof query.text === "string" ? query.text : void 0;
|
|
586
|
+
}
|
|
587
|
+
function safeSqlText(text) {
|
|
588
|
+
let safe = "";
|
|
589
|
+
for (let index = 0; index < text.length;) {
|
|
590
|
+
if (text.startsWith("--", index)) {
|
|
591
|
+
const end = text.indexOf("\n", index + 2);
|
|
592
|
+
safe += " ";
|
|
593
|
+
index = end === -1 ? text.length : end;
|
|
594
|
+
continue;
|
|
595
|
+
}
|
|
596
|
+
if (text.startsWith("/*", index)) {
|
|
597
|
+
let depth = 1;
|
|
598
|
+
index += 2;
|
|
599
|
+
while (index < text.length && depth > 0) if (text.startsWith("/*", index)) {
|
|
600
|
+
depth += 1;
|
|
601
|
+
index += 2;
|
|
602
|
+
} else if (text.startsWith("*/", index)) {
|
|
603
|
+
depth -= 1;
|
|
604
|
+
index += 2;
|
|
605
|
+
} else index += 1;
|
|
606
|
+
safe += " ";
|
|
607
|
+
continue;
|
|
608
|
+
}
|
|
609
|
+
const dollarTag = /^\$(?:[A-Za-z_][A-Za-z0-9_]*)?\$/.exec(text.slice(index))?.[0];
|
|
610
|
+
if (dollarTag) {
|
|
611
|
+
const end = text.indexOf(dollarTag, index + dollarTag.length);
|
|
612
|
+
index = end === -1 ? text.length : end + dollarTag.length;
|
|
613
|
+
safe += "?";
|
|
614
|
+
continue;
|
|
615
|
+
}
|
|
616
|
+
const identifierPrefix = /^(?:U&)?"/i.exec(text.slice(index))?.[0];
|
|
617
|
+
if (identifierPrefix) {
|
|
618
|
+
let end = index + identifierPrefix.length;
|
|
619
|
+
while (end < text.length) {
|
|
620
|
+
if (text[end] !== "\"") {
|
|
621
|
+
end += 1;
|
|
622
|
+
continue;
|
|
623
|
+
}
|
|
624
|
+
if (text[end + 1] === "\"") {
|
|
625
|
+
end += 2;
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
end += 1;
|
|
629
|
+
break;
|
|
630
|
+
}
|
|
631
|
+
safe += text.slice(index, end);
|
|
632
|
+
index = end;
|
|
633
|
+
continue;
|
|
634
|
+
}
|
|
635
|
+
const stringPrefix = /^(?:E|U&|B|X)?'/i.exec(text.slice(index))?.[0];
|
|
636
|
+
if (stringPrefix) {
|
|
637
|
+
const supportsBackslashEscapes = /^E'/i.test(stringPrefix);
|
|
638
|
+
let end = index + stringPrefix.length;
|
|
639
|
+
while (end < text.length) {
|
|
640
|
+
if (supportsBackslashEscapes && text[end] === "\\") {
|
|
641
|
+
end += 2;
|
|
642
|
+
continue;
|
|
643
|
+
}
|
|
644
|
+
if (text[end] !== "'") {
|
|
645
|
+
end += 1;
|
|
646
|
+
continue;
|
|
647
|
+
}
|
|
648
|
+
if (text[end + 1] === "'") {
|
|
649
|
+
end += 2;
|
|
650
|
+
continue;
|
|
651
|
+
}
|
|
652
|
+
end += 1;
|
|
653
|
+
break;
|
|
654
|
+
}
|
|
655
|
+
safe += "?";
|
|
656
|
+
index = end;
|
|
657
|
+
continue;
|
|
658
|
+
}
|
|
659
|
+
const token = /^(?:TRUE|FALSE|NULL|0x[\da-f_]+|0b[01_]+|0o[0-7_]+|\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?[\d_]+)?)(?![A-Za-z0-9_$])/i.exec(text.slice(index))?.[0];
|
|
660
|
+
const previous = text[index - 1];
|
|
661
|
+
if (token && (!previous || !/[A-Za-z0-9_$]/.test(previous))) {
|
|
662
|
+
safe += "?";
|
|
663
|
+
index += token.length;
|
|
664
|
+
continue;
|
|
665
|
+
}
|
|
666
|
+
safe += text[index];
|
|
667
|
+
index += 1;
|
|
668
|
+
}
|
|
669
|
+
return safe;
|
|
542
670
|
}
|
|
543
|
-
|
|
544
|
-
|
|
671
|
+
function normalizeQueryText(text) {
|
|
672
|
+
return safeSqlText(text.slice(0, MAX_QUERY_TEXT_LENGTH)).replace(/\s+/g, " ").trim().slice(0, MAX_QUERY_TEXT_LENGTH);
|
|
673
|
+
}
|
|
674
|
+
function operationFromText(text) {
|
|
675
|
+
const tokens = /(?:U&)?"(?:""|[^"])*"|[A-Za-z_][A-Za-z0-9_$]*|[()]/gi;
|
|
676
|
+
let depth = 0;
|
|
677
|
+
for (const match of text.matchAll(tokens)) {
|
|
678
|
+
const token = match[0];
|
|
679
|
+
if (token === "(") depth += 1;
|
|
680
|
+
else if (token === ")") depth = Math.max(0, depth - 1);
|
|
681
|
+
else if (depth === 0 && !token.includes("\"")) {
|
|
682
|
+
if (SQL_OPERATIONS.has(token.toUpperCase())) return {
|
|
683
|
+
index: match.index,
|
|
684
|
+
name: token
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
function targetFromOperation(operation, text) {
|
|
690
|
+
if (operation.toUpperCase() !== "SELECT") return SQL_TARGET[operation.toUpperCase()]?.exec(text)?.[1];
|
|
691
|
+
const tokens = /(?:U&)?"(?:""|[^"])*"|[A-Za-z_][A-Za-z0-9_$]*|[()]/gi;
|
|
692
|
+
let depth = 0;
|
|
693
|
+
for (const match of text.matchAll(tokens)) {
|
|
694
|
+
const token = match[0];
|
|
695
|
+
if (token === "(") depth += 1;
|
|
696
|
+
else if (token === ")") depth = Math.max(0, depth - 1);
|
|
697
|
+
else if (depth === 0 && token.toUpperCase() === "FROM") {
|
|
698
|
+
const targetText = text.slice(match.index + token.length).trimStart();
|
|
699
|
+
return new RegExp(`^(${SQL_IDENTIFIER})`, "i").exec(targetText)?.[1];
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
function querySummary(operation, target) {
|
|
704
|
+
if (!operation) return void 0;
|
|
705
|
+
const summary = target ? `${operation} ${target}` : operation;
|
|
706
|
+
return summary.length <= MAX_QUERY_SUMMARY_LENGTH ? summary : operation;
|
|
707
|
+
}
|
|
708
|
+
function detailsFromQuery(args) {
|
|
709
|
+
const rawText = queryText(args[0]);
|
|
710
|
+
if (!rawText) return {};
|
|
711
|
+
const text = normalizeQueryText(rawText);
|
|
712
|
+
const operationMatch = operationFromText(text);
|
|
713
|
+
const operation = operationMatch?.name;
|
|
714
|
+
const operationText = operationMatch ? text.slice(operationMatch.index) : "";
|
|
715
|
+
const target = operation ? targetFromOperation(operation, operationText) : void 0;
|
|
716
|
+
const summary = querySummary(operation, target);
|
|
717
|
+
const isCall = operation?.toUpperCase() === "CALL";
|
|
718
|
+
return {
|
|
719
|
+
collection: isCall ? void 0 : target,
|
|
720
|
+
operation,
|
|
721
|
+
storedProcedure: isCall ? target : void 0,
|
|
722
|
+
summary,
|
|
723
|
+
text: text || void 0
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
function connectionAttributes(connectionString) {
|
|
727
|
+
try {
|
|
728
|
+
const url = new URL(connectionString);
|
|
729
|
+
const namespace = decodeURIComponent(url.pathname.replace(/^\//, ""));
|
|
730
|
+
const port = url.port ? Number(url.port) : void 0;
|
|
731
|
+
return {
|
|
732
|
+
...namespace ? { "db.namespace": namespace } : void 0,
|
|
733
|
+
...url.hostname ? { "server.address": url.hostname } : void 0,
|
|
734
|
+
...port && port !== 5432 ? { "server.port": port } : void 0
|
|
735
|
+
};
|
|
736
|
+
} catch {
|
|
737
|
+
return {};
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
function responseStatusCode(error) {
|
|
741
|
+
if (!error || typeof error !== "object" || !("code" in error)) return;
|
|
742
|
+
return typeof error.code === "string" || typeof error.code === "number" ? String(error.code) : void 0;
|
|
743
|
+
}
|
|
744
|
+
function errorType(error) {
|
|
745
|
+
return responseStatusCode(error) ?? (error instanceof Error ? error.name : typeof error);
|
|
746
|
+
}
|
|
747
|
+
function markFailed(span, error) {
|
|
748
|
+
const statusCode = responseStatusCode(error);
|
|
749
|
+
span.setAttribute("error.type", statusCode ?? errorType(error));
|
|
750
|
+
if (statusCode && /^[0-9A-Z]{5}$/i.test(statusCode)) span.setAttribute("db.response.status_code", statusCode);
|
|
751
|
+
span.setStatus({ code: 2 });
|
|
752
|
+
}
|
|
753
|
+
/** Add OpenTelemetry database client spans to an owned PostgreSQL query client. */
|
|
754
|
+
function traceQueries(client, options) {
|
|
545
755
|
if (client[traced]) return client;
|
|
546
756
|
client[traced] = true;
|
|
547
757
|
const query = client.query.bind(client);
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
758
|
+
const connection = connectionAttributes(options.connectionString);
|
|
759
|
+
client.query = ((...originalArgs) => {
|
|
760
|
+
const details = detailsFromQuery(originalArgs);
|
|
761
|
+
const args = [...originalArgs];
|
|
762
|
+
const callbackIndex = typeof args.at(-1) === "function" ? args.length - 1 : void 0;
|
|
763
|
+
return startSpanManual({
|
|
764
|
+
name: details.summary ?? details.operation ?? "postgresql",
|
|
552
765
|
op: "db.query",
|
|
766
|
+
kind: SpanKind.CLIENT,
|
|
553
767
|
onlyIfParent: true,
|
|
554
768
|
attributes: {
|
|
555
769
|
"db.system.name": "postgresql",
|
|
556
|
-
...
|
|
557
|
-
"
|
|
770
|
+
...connection,
|
|
771
|
+
...details.operation ? { "db.operation.name": details.operation } : void 0,
|
|
772
|
+
...details.summary ? { "db.query.summary": details.summary } : void 0,
|
|
773
|
+
...details.text ? { "db.query.text": details.text } : void 0,
|
|
774
|
+
...details.storedProcedure ? { "db.stored_procedure.name": details.storedProcedure } : void 0,
|
|
775
|
+
...details.collection ? { "db.collection.name": details.collection } : void 0,
|
|
776
|
+
"app.db.driver": options.driver
|
|
777
|
+
}
|
|
778
|
+
}, (span, finish) => {
|
|
779
|
+
if (callbackIndex !== void 0) {
|
|
780
|
+
const callback = args[callbackIndex];
|
|
781
|
+
args[callbackIndex] = ((error, ...callbackArgs) => {
|
|
782
|
+
if (error) markFailed(span, error);
|
|
783
|
+
finish();
|
|
784
|
+
return callback(error, ...callbackArgs);
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
try {
|
|
788
|
+
const result = query(...args);
|
|
789
|
+
if (callbackIndex !== void 0) return result;
|
|
790
|
+
if (result && typeof result === "object" && "then" in result) return Promise.resolve(result).then((value) => {
|
|
791
|
+
finish();
|
|
792
|
+
return value;
|
|
793
|
+
}, (error) => {
|
|
794
|
+
markFailed(span, error);
|
|
795
|
+
finish();
|
|
796
|
+
throw error;
|
|
797
|
+
});
|
|
798
|
+
finish();
|
|
799
|
+
return result;
|
|
800
|
+
} catch (error) {
|
|
801
|
+
markFailed(span, error);
|
|
802
|
+
finish();
|
|
803
|
+
throw error;
|
|
558
804
|
}
|
|
559
|
-
}
|
|
805
|
+
});
|
|
560
806
|
});
|
|
561
807
|
return client;
|
|
562
808
|
}
|
|
@@ -564,10 +810,12 @@ function traceQueries(client, driver) {
|
|
|
564
810
|
//#region src/db/neon.ts
|
|
565
811
|
var NeonExecutor = class {
|
|
566
812
|
pool;
|
|
813
|
+
connectionString;
|
|
567
814
|
transactionClient = new AsyncLocalStorage();
|
|
568
815
|
savepointId = 0;
|
|
569
|
-
constructor(pool) {
|
|
816
|
+
constructor(pool, connectionString) {
|
|
570
817
|
this.pool = pool;
|
|
818
|
+
this.connectionString = connectionString;
|
|
571
819
|
}
|
|
572
820
|
db() {
|
|
573
821
|
return drizzle(this.queryClient(), { schema: juniorSqlSchema });
|
|
@@ -648,7 +896,10 @@ var NeonExecutor = class {
|
|
|
648
896
|
await this.pool.end();
|
|
649
897
|
}
|
|
650
898
|
queryClient() {
|
|
651
|
-
return traceQueries(this.transactionClient.getStore() ?? this.pool,
|
|
899
|
+
return traceQueries(this.transactionClient.getStore() ?? this.pool, {
|
|
900
|
+
connectionString: this.connectionString,
|
|
901
|
+
driver: "neon"
|
|
902
|
+
});
|
|
652
903
|
}
|
|
653
904
|
};
|
|
654
905
|
/** Create the shared Neon-backed Junior SQL executor. */
|
|
@@ -657,17 +908,19 @@ function createNeonJuniorSqlExecutor(args) {
|
|
|
657
908
|
connectionString: args.connectionString,
|
|
658
909
|
max: 3,
|
|
659
910
|
statement_timeout: args.statementTimeoutMs
|
|
660
|
-
}));
|
|
911
|
+
}), args.connectionString);
|
|
661
912
|
}
|
|
662
913
|
//#endregion
|
|
663
914
|
//#region src/db/postgres.ts
|
|
664
915
|
const { Pool: Pool$1 } = pg;
|
|
665
916
|
var PostgresExecutor = class {
|
|
666
917
|
pool;
|
|
918
|
+
connectionString;
|
|
667
919
|
transactionClient = new AsyncLocalStorage();
|
|
668
920
|
savepointId = 0;
|
|
669
|
-
constructor(pool) {
|
|
921
|
+
constructor(pool, connectionString) {
|
|
670
922
|
this.pool = pool;
|
|
923
|
+
this.connectionString = connectionString;
|
|
671
924
|
}
|
|
672
925
|
db() {
|
|
673
926
|
return drizzle$1(this.queryClient(), { schema: juniorSqlSchema });
|
|
@@ -748,7 +1001,10 @@ var PostgresExecutor = class {
|
|
|
748
1001
|
await this.pool.end();
|
|
749
1002
|
}
|
|
750
1003
|
queryClient() {
|
|
751
|
-
return traceQueries(this.transactionClient.getStore() ?? this.pool,
|
|
1004
|
+
return traceQueries(this.transactionClient.getStore() ?? this.pool, {
|
|
1005
|
+
connectionString: this.connectionString,
|
|
1006
|
+
driver: "postgres"
|
|
1007
|
+
});
|
|
752
1008
|
}
|
|
753
1009
|
};
|
|
754
1010
|
/** Create the shared Node Postgres-backed Junior SQL executor. */
|
|
@@ -758,7 +1014,7 @@ function createPostgresJuniorSqlExecutor(args) {
|
|
|
758
1014
|
connectionString: args.connectionString,
|
|
759
1015
|
max: 3,
|
|
760
1016
|
statement_timeout: args.statementTimeoutMs
|
|
761
|
-
}));
|
|
1017
|
+
}), args.connectionString);
|
|
762
1018
|
}
|
|
763
1019
|
//#endregion
|
|
764
1020
|
//#region src/db/executor.ts
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as getDeploymentServiceVersion, N as getDeploymentTelemetryAttributes } from "./logging-
|
|
2
|
-
import {
|
|
3
|
-
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-
|
|
1
|
+
import { M as getDeploymentServiceVersion, N as getDeploymentTelemetryAttributes } from "./logging-GTB-Z6hs.js";
|
|
2
|
+
import { _ as vercelAIIntegration, a as getClient, b as withStreamedSpan, c as init, o as getGlobalScope } from "./sentry-CgWZM_kV.js";
|
|
3
|
+
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-Dxiz_d9l.js";
|
|
4
4
|
import { t as consumePrivateTraceResultMarker } from "./private-trace-result-BLvBjy_e.js";
|
|
5
5
|
//#region src/chat/sentry-payload-filter.ts
|
|
6
6
|
const PAYLOAD_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getChatConfig } from "./config-
|
|
1
|
+
import { a as getChatConfig } from "./config-DoMOvr4Z.js";
|
|
2
2
|
import { a as signQueueMessage, i as QUEUE_SIGNATURE_MAX_AGE_MS, o as verifyQueueMessage, s as createVercelQueueClient } from "./vercel-queue-DIkVcfK4.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as setTag, f as setUser, h as startSpan, i as getActiveSpan, l as logger, n as captureMessage, p as spanToJSON, s as getTraceData, t as captureException,
|
|
2
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
1
|
+
import { d as setTag, f as setUser, h as startSpan, i as getActiveSpan, l as logger, n as captureMessage, p as spanToJSON, s as getTraceData, t as captureException, y as withScope } from "./sentry-CgWZM_kV.js";
|
|
2
|
+
import { t as JUNIOR_VERSION } from "./version-Cf7Fwr1w.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { styleText } from "node:util";
|
|
5
5
|
import { ConfigError, configureSync, getConfig, getLogger } from "@logtape/logtape";
|
package/dist/nitro.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as JuniorDashboardOptions } from "./app-
|
|
1
|
+
import { n as JuniorDashboardOptions } from "./app-gyu3D9Gn.js";
|
|
2
2
|
import { n as JuniorPluginSet } from "./plugins-BI9A1vKA.js";
|
|
3
3
|
//#region src/nitro.d.ts
|
|
4
4
|
export type JuniorNitroDashboardOptions = JuniorDashboardOptions;
|
package/dist/nitro.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, D as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, E as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_RETENTION_CRON_SCHEDULE, T as JUNIOR_HEARTBEAT_CRON_SCHEDULE, k as JUNIOR_RETENTION_ROUTE, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "./logging-
|
|
1
|
+
import { A as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, D as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, E as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_RETENTION_CRON_SCHEDULE, T as JUNIOR_HEARTBEAT_CRON_SCHEDULE, k as JUNIOR_RETENTION_ROUTE, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "./logging-GTB-Z6hs.js";
|
|
2
2
|
import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-7a9YqLhE.js";
|
|
3
3
|
import { n as resolveConversationWorkQueueTopic } from "./vercel-queue-DIkVcfK4.js";
|
|
4
|
-
import { t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-
|
|
4
|
+
import { t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-FcjDDzOt.js";
|
|
5
5
|
import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-egKWjgue.js";
|
|
6
|
-
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-
|
|
6
|
+
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-BUAVtd2X.js";
|
|
7
7
|
import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-BKGOXca2.js";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
1
|
+
import { X as createUserTokenStore } from "./agent-DKboUiLS.js";
|
|
2
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-6WRLsSQy.js";
|
|
3
3
|
import { createServer } from "node:http";
|
|
4
4
|
//#region src/chat/local/oauth-callback-server.ts
|
|
5
5
|
const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as abandonTurnRecord, yt as extractAssistantText } from "./checkpoint-
|
|
2
|
-
import { qt as buildDeterministicTurnId } from "./stats-
|
|
1
|
+
import { i as abandonTurnRecord, yt as extractAssistantText } from "./checkpoint-CHdApjyQ.js";
|
|
2
|
+
import { qt as buildDeterministicTurnId } from "./stats-DROv84Z6.js";
|
|
3
3
|
//#region src/chat/runtime/turn.ts
|
|
4
4
|
/** Classified Slack turn failure carrying the owning Sentry capture outward. */
|
|
5
5
|
var ConversationTurnBoundaryError = class extends Error {
|