@sentry/junior 0.263.0 → 0.265.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/README.md +1 -1
- package/dist/{adapter-BIacI0Bt.js → adapter-cUkPH3Om.js} +1 -1
- package/dist/{admin-C7vUk7s9.js → admin-Cf0rDmWV.js} +1 -1
- package/dist/{agent-runner-BUBas7Yy.js → agent-runner-C6MwHJEs.js} +296 -238
- package/dist/api/schema.d.ts +213 -16
- package/dist/api/schema.js +3 -3
- package/dist/api.js +107 -40
- package/dist/{app-Bo0kB987.d.ts → app-Csbi9dW7.d.ts} +4 -3
- package/dist/app.d.ts +1 -1
- package/dist/app.js +101 -393
- package/dist/{assistant-reply-BFmjgJjD.js → assistant-reply-UPA8vKlC.js} +1 -1
- package/dist/{automation-CWX0qL8U.js → automation-2RbKzpMT.js} +30 -9
- package/dist/{briefs-h55v5lX9.js → briefs-DRjx8kQ9.js} +3 -3
- package/dist/{catalog-runtime-Suf-aLlh.js → catalog-runtime-D3qbJlYz.js} +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/init.js +4 -18
- package/dist/cli/main.js +4 -4
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-DZBCBj1M.js → client-DX34VNtH.js} +3 -8
- package/dist/{config-Dnv8KmNs.js → config-BayQ9hHH.js} +100 -3
- package/dist/{connections-Br0_xv27.js → connections-mpN5Lsnj.js} +11 -10
- package/dist/{conversation-privacy-FY8yc2q3.js → conversation-privacy-frjQCJa9.js} +1 -1
- package/dist/{credential-sync-BvkiyWF5.js → credential-sync-CZmyDNdR.js} +20 -20
- package/dist/{agent-hooks-CqnZfuCt.js → credentialed-C6pKlB1p.js} +3197 -66
- package/dist/{executor-J9k2sp9m.js → executor-CAr7xQr2.js} +10 -300
- package/dist/{images-DV2FlEGL.js → images-B2yA3HWE.js} +2 -2
- package/dist/instrumentation.js +41 -25
- package/dist/{job-queue-B4yTgklN.js → job-queue-Cjo6Yg_b.js} +53 -14
- package/dist/{logging-Dk_FpF36.js → logging-D2QBriUo.js} +19 -32
- package/dist/{message-BzseAFH1.js → message-C9ymnpBS.js} +4 -4
- package/dist/nitro.d.ts +17 -2
- package/dist/nitro.js +26 -27
- package/dist/{oauth-callback-server-bTspTMCC.js → oauth-callback-server-BtMf3TPZ.js} +2 -2
- package/dist/{prompt-CxatQVaj.js → prompt-CvaDdSX3.js} +1 -1
- package/dist/{registry-BFzQFV_y.js → registry-COTeZ2cV.js} +1 -1
- package/dist/{resolve-CnRHib0U.js → resolve-g9PKz9pH.js} +7 -106
- package/dist/{result-DczfmNBa.js → result-COnC42GR.js} +8 -8
- package/dist/{runner-CJd9Wec-.js → runner-BnTNS7x_.js} +10 -10
- package/dist/{sandbox-egress-signals-DUmVkOx4.js → sandbox-egress-signals-C_IIdLFk.js} +1 -1
- package/dist/{schema-QidbykYl.js → schema-D5Amlzkp.js} +44 -3
- package/dist/{sentry-BBUlHih9.js → sentry-MDkYAVPV.js} +3 -6
- package/dist/{service-account-BI2kQDrb.js → service-account-CwvToidT.js} +3 -3
- package/dist/{service-account-x2QZXm4X.js → service-account-YdYftwV2.js} +5 -5
- package/dist/{session-stop-CtyJsnEj.js → session-stop-CpCUy1ZJ.js} +121 -81
- package/dist/{skills-Dbzx9-rS.js → skills-Bb2KaJ3m.js} +2 -2
- package/dist/{spawn-D8WU99UV.js → spawn-mbTcrLb3.js} +2 -2
- package/dist/{store-TKg1HVKx.js → store-CqRnaZSq.js} +3 -3
- package/dist/{store-UlOrW6JC.js → store-DdT74Lvq.js} +18 -9
- package/dist/{task-queue-BRB49H-J.js → task-queue-8XjDIORF.js} +14 -19
- package/dist/{task-runner-C575f2Dd.js → task-runner-6mLmG6g_.js} +46 -28
- package/dist/{tasks-LOItiYgL.js → tasks-DGbrur6x.js} +14 -2075
- package/dist/{thread-state-IDHdZA7R.js → thread-state-D45lz-oC.js} +5 -5
- package/dist/{turn-failure-response-h_LSXJ-M.js → turn-failure-response-CaEPLSBn.js} +7 -7
- package/dist/{turn-lifecycle-Cvi6Sb8Y.js → turn-lifecycle-C35IyRGp.js} +1 -1
- package/dist/{turn-session-routing-5Nyv4fso.js → turn-session-routing-BKx6rfVd.js} +1 -1
- package/dist/{validation-BeTriWC2.js → validation-C0X3CX51.js} +1 -1
- package/dist/{version-BQX_hLDC.js → version-BPHgJwnm.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-DmNRM88V.js → viewer-B2wXNspU.js} +21 -5
- package/dist/{web-input-BHcGXSox.js → web-input-Y6aXvmfa.js} +145 -46
- package/dist/{work-DLJMV02b.js → work-DMbqK0kT.js} +10 -10
- package/dist/{worker-vfG2ESg1.js → worker-B-rDJ3XN.js} +8 -6
- package/package.json +10 -9
- package/dist/profile-Dq5I7TV1.js +0 -582
|
@@ -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 { _ as withScope, 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 } from "./sentry-MDkYAVPV.js";
|
|
2
|
+
import { t as JUNIOR_VERSION } from "./version-BPHgJwnm.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";
|
|
@@ -870,17 +870,8 @@ function getLogContextAttributes() {
|
|
|
870
870
|
/** Return inherited log context filtered to attributes valid for the span operation. */
|
|
871
871
|
function getLogContextAttributesForSpan(op) {
|
|
872
872
|
const attributes = { ...getLogContextAttributes() };
|
|
873
|
-
if (op === "gen_ai.invoke_agent" || op === "gen_ai.execute_tool") {
|
|
874
|
-
delete attributes["gen_ai.request.model"];
|
|
875
|
-
return attributes;
|
|
876
|
-
}
|
|
877
|
-
if (op === "gen_ai.chat" || op === "gen_ai.embeddings") {
|
|
878
|
-
delete attributes["gen_ai.agent.name"];
|
|
879
|
-
delete attributes["gen_ai.request.model"];
|
|
880
|
-
return attributes;
|
|
881
|
-
}
|
|
882
|
-
delete attributes["gen_ai.agent.name"];
|
|
883
873
|
delete attributes["gen_ai.request.model"];
|
|
874
|
+
if (op !== "gen_ai.invoke_agent" && op !== "gen_ai.execute_tool") delete attributes["gen_ai.agent.name"];
|
|
884
875
|
return attributes;
|
|
885
876
|
}
|
|
886
877
|
function createLogContextFromRequest(request, context = {}) {
|
|
@@ -952,7 +943,7 @@ function normalizeSpanAttributes(attributes) {
|
|
|
952
943
|
return normalized;
|
|
953
944
|
}
|
|
954
945
|
function setAttributesOnSpan(span, attributes) {
|
|
955
|
-
|
|
946
|
+
span.setAttributes(normalizeSpanAttributes(attributes));
|
|
956
947
|
}
|
|
957
948
|
/**
|
|
958
949
|
* Emit an informational event with occurrence-specific attributes.
|
|
@@ -1028,25 +1019,21 @@ async function withContext(context, callback) {
|
|
|
1028
1019
|
}
|
|
1029
1020
|
/** Run a callback within a Sentry span and scoped log context. */
|
|
1030
1021
|
async function withSpan(name, op, context, callback, attributes = {}) {
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
throw error;
|
|
1047
|
-
}
|
|
1048
|
-
});
|
|
1049
|
-
});
|
|
1022
|
+
return withLogContext(context, () => startSpan({
|
|
1023
|
+
name,
|
|
1024
|
+
op,
|
|
1025
|
+
attributes: {
|
|
1026
|
+
...getLogContextAttributesForSpan(op),
|
|
1027
|
+
...normalizeSpanAttributes(attributes)
|
|
1028
|
+
}
|
|
1029
|
+
}, async (span) => {
|
|
1030
|
+
try {
|
|
1031
|
+
return await callback((attributes) => setAttributesOnSpan(span, attributes));
|
|
1032
|
+
} catch (error) {
|
|
1033
|
+
if (spanToJSON(span).attributes?.["error.type"] === void 0) span.setAttribute("error.type", error instanceof Error ? error.name : typeof error);
|
|
1034
|
+
throw error;
|
|
1035
|
+
}
|
|
1036
|
+
}));
|
|
1050
1037
|
}
|
|
1051
1038
|
/** Return Sentry-standard trace propagation headers for the active span. */
|
|
1052
1039
|
function getTracePropagationHeaders() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { $ as
|
|
3
|
-
import { P as PARENT_AGENT_TARGET, i as createAgentInvocationForMessage, j as AgentMessageTargetError, o as findChildAgentConversationId, s as getActiveAgentInvocationForConversation } from "./store-
|
|
4
|
-
import { n as enqueueAgentMessageToParent } from "./result-
|
|
5
|
-
import { r as enqueueAgentInvocation } from "./work-
|
|
2
|
+
import { $ as actorFromRun, et as toolInvocationDestination } from "./agent-runner-C6MwHJEs.js";
|
|
3
|
+
import { P as PARENT_AGENT_TARGET, i as createAgentInvocationForMessage, j as AgentMessageTargetError, o as findChildAgentConversationId, s as getActiveAgentInvocationForConversation } from "./store-CqRnaZSq.js";
|
|
4
|
+
import { n as enqueueAgentMessageToParent } from "./result-COnC42GR.js";
|
|
5
|
+
import { r as enqueueAgentInvocation } from "./work-DMbqK0kT.js";
|
|
6
6
|
// src/chat/agent-invocations/message.ts
|
|
7
7
|
var message_exports = /* @__PURE__ */ __exportAll({ bindMessageAgent: () => bindMessageAgent });
|
|
8
8
|
/**
|
package/dist/nitro.d.ts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
import { r as JuniorDashboardOptions } from "./app-
|
|
1
|
+
import { r as JuniorDashboardOptions } from "./app-Csbi9dW7.js";
|
|
2
2
|
import { n as JuniorPluginSet } from "./plugins-B_0Cr0MO.js";
|
|
3
|
+
import { withSentryConfig as withSentryConfig$1 } from "@sentry/nitro";
|
|
4
|
+
type SentryNitroConfig = Parameters<typeof withSentryConfig$1>[0];
|
|
5
|
+
type SentryNitroOptions = NonNullable<Parameters<typeof withSentryConfig$1>[1]>;
|
|
6
|
+
/**
|
|
7
|
+
* Sentry's Nitro config wrapper: source map upload and Nitro request hooks.
|
|
8
|
+
* Junior pins `@sentry/nitro` to the same version as its `@sentry/node`. The
|
|
9
|
+
* SDK keeps one client for each version, so this lets the Nitro hooks use the
|
|
10
|
+
* client that `initSentry()` creates. Apps import it from here, not from
|
|
11
|
+
* `@sentry/nitro`.
|
|
12
|
+
*
|
|
13
|
+
* The build release defaults to the release that `initSentry()` reports, so
|
|
14
|
+
* the uploaded source maps and the runtime events use the same release.
|
|
15
|
+
*/
|
|
16
|
+
export declare function withSentryConfig(config: SentryNitroConfig, options?: SentryNitroOptions): SentryNitroConfig;
|
|
3
17
|
export type JuniorNitroDashboardOptions = JuniorDashboardOptions;
|
|
4
18
|
export interface JuniorPluginModuleReference {
|
|
5
19
|
/** Runtime-safe module that exports a `defineJuniorPlugins(...)` set. */
|
|
@@ -30,4 +44,5 @@ export declare function juniorNitro(options?: JuniorNitroOptions): {
|
|
|
30
44
|
nitro: {
|
|
31
45
|
setup(nitro: unknown): void;
|
|
32
46
|
};
|
|
33
|
-
};
|
|
47
|
+
};
|
|
48
|
+
export {};
|
package/dist/nitro.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { A as JUNIOR_RETENTION_CRON_SCHEDULE, D as JUNIOR_HEARTBEAT_CRON_SCHEDULE, E as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, M as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, O as JUNIOR_HEARTBEAT_ROUTE, j as JUNIOR_RETENTION_ROUTE, k as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE } from "./logging-
|
|
1
|
+
import { A as JUNIOR_RETENTION_CRON_SCHEDULE, D as JUNIOR_HEARTBEAT_CRON_SCHEDULE, E as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, M as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, O as JUNIOR_HEARTBEAT_ROUTE, P as getDeploymentServiceVersion, j as JUNIOR_RETENTION_ROUTE, k as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE } from "./logging-D2QBriUo.js";
|
|
2
2
|
import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-DJBompdd.js";
|
|
3
|
-
import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-
|
|
3
|
+
import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-Cjo6Yg_b.js";
|
|
4
4
|
import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-DOm9Y6qI.js";
|
|
5
|
-
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-
|
|
5
|
+
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-8XjDIORF.js";
|
|
6
6
|
import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-Cf5gVPWP.js";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
|
|
9
|
+
import { withSentryConfig as withSentryConfig$1 } from "@sentry/nitro";
|
|
10
|
+
import { sentryOrchestrionPlugin } from "@sentry/server-utils/orchestrion/rollup";
|
|
9
11
|
// src/build/rolldown-workarounds.ts
|
|
10
12
|
/**
|
|
11
13
|
* Override rolldown's treeshake config so that module side effects survive
|
|
@@ -175,6 +177,25 @@ function injectVirtualConfig(nitro, options = {}) {
|
|
|
175
177
|
};
|
|
176
178
|
}
|
|
177
179
|
// src/nitro.ts
|
|
180
|
+
/**
|
|
181
|
+
* Sentry's Nitro config wrapper: source map upload and Nitro request hooks.
|
|
182
|
+
* Junior pins `@sentry/nitro` to the same version as its `@sentry/node`. The
|
|
183
|
+
* SDK keeps one client for each version, so this lets the Nitro hooks use the
|
|
184
|
+
* client that `initSentry()` creates. Apps import it from here, not from
|
|
185
|
+
* `@sentry/nitro`.
|
|
186
|
+
*
|
|
187
|
+
* The build release defaults to the release that `initSentry()` reports, so
|
|
188
|
+
* the uploaded source maps and the runtime events use the same release.
|
|
189
|
+
*/
|
|
190
|
+
function withSentryConfig(config, options = {}) {
|
|
191
|
+
return withSentryConfig$1(config, {
|
|
192
|
+
...options,
|
|
193
|
+
release: {
|
|
194
|
+
name: getDeploymentServiceVersion(),
|
|
195
|
+
...options.release
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
178
199
|
const DEFAULT_FUNCTION_MAX_DURATION_SECONDS = 300;
|
|
179
200
|
const VERCEL_QUEUE_TRIGGER_TYPE = "queue/v2beta";
|
|
180
201
|
function isPluginModuleReference(value) {
|
|
@@ -198,28 +219,6 @@ function runtimeModuleForResolvedPluginModule(moduleRef) {
|
|
|
198
219
|
specifier: moduleRef.kind === "file" ? moduleRef.importPath.split(path.sep).join("/") : moduleRef.sourceSpecifier
|
|
199
220
|
};
|
|
200
221
|
}
|
|
201
|
-
/**
|
|
202
|
-
* Prevent import-in-the-middle and require-in-the-middle from being
|
|
203
|
-
* externalized so Rolldown bundles them inline.
|
|
204
|
-
*
|
|
205
|
-
* @sentry/node (via @opentelemetry/instrumentation) statically imports these
|
|
206
|
-
* packages. Nitro already lists them in nf3's NonBundleablePackages, which
|
|
207
|
-
* means it externalizes them and relies on traceNodeModules to copy the
|
|
208
|
-
* package directories into the Vercel function output. In practice that trace
|
|
209
|
-
* step fails to materialize the packages at runtime, causing an
|
|
210
|
-
* ERR_MODULE_NOT_FOUND startup crash.
|
|
211
|
-
*
|
|
212
|
-
* Adding them to noExternals overrides the NonBundleablePackages default and
|
|
213
|
-
* forces Rolldown to bundle their CJS code inline. The trade-off is that
|
|
214
|
-
* Node.js ESM loader hooks (hook.mjs) are not active, which limits OTEL
|
|
215
|
-
* auto-instrumentation of modules loaded after initialization. That is an
|
|
216
|
-
* acceptable cost compared to a fatal startup failure.
|
|
217
|
-
*/
|
|
218
|
-
function bundleOpenTelemetryLoaderHooks(nitro) {
|
|
219
|
-
const existing = Array.isArray(nitro.options.noExternals) ? nitro.options.noExternals : [];
|
|
220
|
-
const additions = ["import-in-the-middle", "require-in-the-middle"].filter((pkg) => !existing.includes(pkg));
|
|
221
|
-
if (additions.length > 0) nitro.options.noExternals = [...existing, ...additions];
|
|
222
|
-
}
|
|
223
222
|
function configureVercelDeployment(nitro, options) {
|
|
224
223
|
const defaultMaxDuration = options.maxDuration ?? DEFAULT_FUNCTION_MAX_DURATION_SECONDS;
|
|
225
224
|
const queueTopic = resolveConversationWorkQueueTopic({ topic: options.conversationWorkQueueTopic });
|
|
@@ -274,7 +273,6 @@ function juniorNitro(options = {}) {
|
|
|
274
273
|
return { nitro: { setup(nitro) {
|
|
275
274
|
const cwd = path.resolve(options.cwd ?? nitro.options.rootDir ?? process.cwd());
|
|
276
275
|
const functionMaxDurationSeconds = configureVercelDeployment(nitro, options);
|
|
277
|
-
bundleOpenTelemetryLoaderHooks(nitro);
|
|
278
276
|
applyRolldownTreeshakeWorkaround(nitro);
|
|
279
277
|
const pluginSource = options.plugins;
|
|
280
278
|
const pluginModule = isPluginModuleReference(pluginSource) ? resolvePluginModule(cwd, pluginSource) : void 0;
|
|
@@ -307,6 +305,7 @@ function juniorNitro(options = {}) {
|
|
|
307
305
|
nitro.hooks.hook("rollup:before", (_nitro, config) => {
|
|
308
306
|
const buildConfig = config;
|
|
309
307
|
buildConfig.plugins ??= [];
|
|
308
|
+
buildConfig.plugins.push(sentryOrchestrionPlugin());
|
|
310
309
|
buildConfig.plugins.push({
|
|
311
310
|
name: "junior:copy-build-content",
|
|
312
311
|
async writeBundle() {
|
|
@@ -316,4 +315,4 @@ function juniorNitro(options = {}) {
|
|
|
316
315
|
});
|
|
317
316
|
} } };
|
|
318
317
|
}
|
|
319
|
-
export { juniorNitro };
|
|
318
|
+
export { juniorNitro, withSentryConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
1
|
+
import { n as createUserTokenStore } from "./credentialed-C6pKlB1p.js";
|
|
2
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-CZmyDNdR.js";
|
|
3
3
|
import { createServer } from "node:http";
|
|
4
4
|
// src/chat/local/oauth-callback-server.ts
|
|
5
5
|
const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
|
|
@@ -419,7 +419,7 @@ async function generateBrief(args) {
|
|
|
419
419
|
const EVENT_AUTHOR_ID = "UJRNEVENT";
|
|
420
420
|
/** System Message author for event input. */
|
|
421
421
|
const EVENT_MESSAGE_AUTHOR = {
|
|
422
|
-
fullName: "
|
|
422
|
+
fullName: "System event",
|
|
423
423
|
isBot: true,
|
|
424
424
|
userId: EVENT_AUTHOR_ID,
|
|
425
425
|
userName: "junior-event"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as logWarn, p as logInfo, y as setSpanAttributes } from "./logging-
|
|
1
|
+
import { m as logWarn, p as logInfo, y as setSpanAttributes } from "./logging-D2QBriUo.js";
|
|
2
2
|
import { a as isUserActor, o as parseActorUserId } from "./actor-tlxzqaRe.js";
|
|
3
3
|
import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-DJBompdd.js";
|
|
4
4
|
import path from "node:path";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { T as withSpan, y as setSpanAttributes } from "./logging-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { T as withSpan, y as setSpanAttributes } from "./logging-D2QBriUo.js";
|
|
2
|
+
import { Cn as SANDBOX_WORKSPACE_ROOT, I as getSandboxProvider, M as create, P as isStale, on as sleep, vn as runNonInteractiveCommand, yn as SANDBOX_COMMAND_PATH } from "./credentialed-C6pKlB1p.js";
|
|
3
|
+
import { r as getStateAdapter } from "./adapter-cUkPH3Om.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
import { FileSystem, Sandbox } from "@vercel/sandbox";
|
|
6
5
|
// src/chat/sandbox/resources.ts
|
|
7
6
|
let configuredResources;
|
|
8
7
|
function resourcesFromEnv() {
|
|
@@ -228,97 +227,6 @@ async function postinstall(sandbox, commands, signal, timeoutMs) {
|
|
|
228
227
|
}
|
|
229
228
|
});
|
|
230
229
|
}
|
|
231
|
-
// src/chat/sandbox/workspace.ts
|
|
232
|
-
/** Bind one tool call's cancellation to every sandbox filesystem operation. */
|
|
233
|
-
function bindSandboxFileSystem(fs, signal) {
|
|
234
|
-
if (!signal) return fs;
|
|
235
|
-
return {
|
|
236
|
-
readFile(filePath, options) {
|
|
237
|
-
signal.throwIfAborted();
|
|
238
|
-
return fs.readFile(filePath, {
|
|
239
|
-
...options,
|
|
240
|
-
signal
|
|
241
|
-
});
|
|
242
|
-
},
|
|
243
|
-
writeFile(filePath, content, options) {
|
|
244
|
-
signal.throwIfAborted();
|
|
245
|
-
return fs.writeFile(filePath, content, {
|
|
246
|
-
...options,
|
|
247
|
-
signal
|
|
248
|
-
});
|
|
249
|
-
},
|
|
250
|
-
readdir(filePath) {
|
|
251
|
-
signal.throwIfAborted();
|
|
252
|
-
return fs.readdir(filePath, { signal });
|
|
253
|
-
},
|
|
254
|
-
stat(filePath) {
|
|
255
|
-
signal.throwIfAborted();
|
|
256
|
-
return fs.stat(filePath, { signal });
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
/** Pin Junior's sandbox contract to one Vercel session without SDK replay. */
|
|
261
|
-
function createSandboxSession(sandbox, options) {
|
|
262
|
-
const session = sandbox.currentSession();
|
|
263
|
-
const fileSystem = new FileSystem(session);
|
|
264
|
-
const run = async (operation) => {
|
|
265
|
-
try {
|
|
266
|
-
return await operation();
|
|
267
|
-
} catch (error) {
|
|
268
|
-
if (isSandboxUnavailableError(error)) options?.onUnavailable?.(session.sessionId);
|
|
269
|
-
throw error;
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
return {
|
|
273
|
-
sandboxId: sandbox.name,
|
|
274
|
-
sessionId: session.sessionId,
|
|
275
|
-
fs: {
|
|
276
|
-
readFile: async (filePath, readOptions) => await run(async () => await fileSystem.readFile(filePath, readOptions)),
|
|
277
|
-
writeFile: async (filePath, content, writeOptions) => await run(async () => await fileSystem.writeFile(filePath, content, writeOptions)),
|
|
278
|
-
readdir: async (filePath, readOptions) => await run(async () => await fileSystem.readdir(filePath, readOptions)),
|
|
279
|
-
stat: async (filePath, statOptions) => await run(async () => await fileSystem.stat(filePath, statOptions))
|
|
280
|
-
},
|
|
281
|
-
extendTimeout(duration) {
|
|
282
|
-
return run(async () => await session.extendTimeout(duration));
|
|
283
|
-
},
|
|
284
|
-
mkDir(path) {
|
|
285
|
-
return run(async () => await session.mkDir(path));
|
|
286
|
-
},
|
|
287
|
-
readFileToBuffer(input) {
|
|
288
|
-
return run(async () => await session.readFileToBuffer(input));
|
|
289
|
-
},
|
|
290
|
-
async runCommand(input) {
|
|
291
|
-
const result = await run(async () => await session.runCommand(input));
|
|
292
|
-
const [stdout, stderr] = await Promise.all([run(async () => await result.stdout()), run(async () => await result.stderr())]);
|
|
293
|
-
return {
|
|
294
|
-
exitCode: result.exitCode,
|
|
295
|
-
stdout,
|
|
296
|
-
stderr
|
|
297
|
-
};
|
|
298
|
-
},
|
|
299
|
-
snapshot(options) {
|
|
300
|
-
return run(async () => {
|
|
301
|
-
return { snapshotId: (await session.snapshot(options)).snapshotId };
|
|
302
|
-
});
|
|
303
|
-
},
|
|
304
|
-
stop() {
|
|
305
|
-
return run(async () => await session.stop());
|
|
306
|
-
},
|
|
307
|
-
update(params) {
|
|
308
|
-
return run(async () => await session.update(params));
|
|
309
|
-
},
|
|
310
|
-
writeFiles(files) {
|
|
311
|
-
return run(async () => await session.writeFiles(files));
|
|
312
|
-
}
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
/** Best-effort stop; ignore secondary stop failures during cleanup. */
|
|
316
|
-
async function stopSession(session) {
|
|
317
|
-
if (!session) return;
|
|
318
|
-
try {
|
|
319
|
-
await session.stop();
|
|
320
|
-
} catch {}
|
|
321
|
-
}
|
|
322
230
|
// src/chat/sandbox/snapshot/resolve.ts
|
|
323
231
|
const SNAPSHOT_CACHE_PREFIX = "junior:sandbox_snapshot_profile:v2";
|
|
324
232
|
const SNAPSHOT_LOCK_PREFIX = "junior:sandbox_snapshot_lock";
|
|
@@ -367,15 +275,13 @@ async function build(value, runtime, timeoutMs, signal, prepare) {
|
|
|
367
275
|
"app.sandbox.snapshot.dependency_count": value.dependencyCount
|
|
368
276
|
}, async () => {
|
|
369
277
|
const startedAtMs = Date.now();
|
|
370
|
-
const sandboxCredentials = getVercelSandboxCredentials();
|
|
371
278
|
const resources = getSandboxResources();
|
|
372
|
-
const sandbox =
|
|
373
|
-
|
|
279
|
+
const sandbox = await getSandboxProvider().createSession({
|
|
280
|
+
timeoutMs,
|
|
374
281
|
runtime,
|
|
375
282
|
signal,
|
|
376
|
-
...sandboxCredentials ?? {},
|
|
377
283
|
...resources ? { resources } : void 0
|
|
378
|
-
})
|
|
284
|
+
});
|
|
379
285
|
try {
|
|
380
286
|
await dependencies(sandbox, value.dependencies, signal);
|
|
381
287
|
await postinstall(sandbox, value.postinstall, signal);
|
|
@@ -538,9 +444,4 @@ async function resolve(params) {
|
|
|
538
444
|
};
|
|
539
445
|
});
|
|
540
446
|
}
|
|
541
|
-
|
|
542
|
-
function isMissingError(error) {
|
|
543
|
-
const searchable = error instanceof Error ? error.message.toLowerCase() : String(error).toLowerCase();
|
|
544
|
-
return searchable.includes("snapshot") && (searchable.includes("not found") || searchable.includes("unknown") || searchable.includes("404"));
|
|
545
|
-
}
|
|
546
|
-
export { createSandboxSession as a, postinstall as c, getSandboxResources as d, setSandboxResourceConfig as f, bindSandboxFileSystem as i, setSnapshotSpanAttributes as l, isMissingError as n, stopSession as o, resolve as r, dependencies as s, getCachedSnapshot as t, getSandboxResourceConfig as u };
|
|
447
|
+
export { setSnapshotSpanAttributes as a, setSandboxResourceConfig as c, postinstall as i, resolve as n, getSandboxResourceConfig as o, dependencies as r, getSandboxResources as s, getCachedSnapshot as t };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { Nt as getTurnRecord, Pt as listTurnSummaries } from "./tasks-
|
|
2
|
+
import { Nt as getTurnRecord, Pt as listTurnSummaries } from "./tasks-DGbrur6x.js";
|
|
3
3
|
import { t as createActor } from "./actor-tlxzqaRe.js";
|
|
4
|
-
import { f as credentialContextForActor } from "./registry-
|
|
5
|
-
import {
|
|
6
|
-
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-
|
|
7
|
-
import { C as markAgentInvocationParentMailboxAppended, _ as getLatestAgentInvocationForConversation, a as createAgentInvocationFromLatest, c as getAgentInvocation, d as getAgentInvocationIdForResult, l as getAgentInvocationIdForEvents, p as getAgentInvocationResultMessageId, u as getAgentInvocationIdForMessage, y as isTerminalAgentInvocation } from "./store-
|
|
8
|
-
import { a as EVENT_WAIT_MS, c as isEventMailboxMetadata, l as renderEventBatchText, u as timerWatchCredentialSubject } from "./session-stop-
|
|
9
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
10
|
-
import { r as enqueueAgentInvocation } from "./work-
|
|
4
|
+
import { f as credentialContextForActor } from "./registry-COTeZ2cV.js";
|
|
5
|
+
import { G as listUnreportedSiblingAgents } from "./agent-runner-C6MwHJEs.js";
|
|
6
|
+
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-CvaDdSX3.js";
|
|
7
|
+
import { C as markAgentInvocationParentMailboxAppended, _ as getLatestAgentInvocationForConversation, a as createAgentInvocationFromLatest, c as getAgentInvocation, d as getAgentInvocationIdForResult, l as getAgentInvocationIdForEvents, p as getAgentInvocationResultMessageId, u as getAgentInvocationIdForMessage, y as isTerminalAgentInvocation } from "./store-CqRnaZSq.js";
|
|
8
|
+
import { a as EVENT_WAIT_MS, c as isEventMailboxMetadata, l as renderEventBatchText, u as timerWatchCredentialSubject } from "./session-stop-CpCUy1ZJ.js";
|
|
9
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-DdT74Lvq.js";
|
|
10
|
+
import { r as enqueueAgentInvocation } from "./work-DMbqK0kT.js";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
import { createEventSource, createLocalSource, createWebSource } from "@sentry/junior-plugin-api";
|
|
13
13
|
// src/chat/conversations/web-mailbox.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { A as commitAcceptedReply, F as loadProjection, H as recordAuthorizationCompleted, Ut as persistWithRetry, X as hydrateConversationMessages, Z as persistConversationMessages, at as buildConversationContext, dt as normalizeConversationText, ft as recordDeliveredAssistantMessage, kt as saveTurnCheckpoint, mt as upsertConversationMessage, ut as markConversationMessage, vt as authorizationId } from "./tasks-
|
|
2
|
-
import { f as logException, w as withLogContext, x as setTags } from "./logging-
|
|
3
|
-
import {
|
|
4
|
-
import { f as credentialContextForActor } from "./registry-
|
|
1
|
+
import { A as commitAcceptedReply, F as loadProjection, H as recordAuthorizationCompleted, Ut as persistWithRetry, X as hydrateConversationMessages, Z as persistConversationMessages, at as buildConversationContext, dt as normalizeConversationText, ft as recordDeliveredAssistantMessage, kt as saveTurnCheckpoint, mt as upsertConversationMessage, ut as markConversationMessage, vt as authorizationId } from "./tasks-DGbrur6x.js";
|
|
2
|
+
import { f as logException, w as withLogContext, x as setTags } from "./logging-D2QBriUo.js";
|
|
3
|
+
import { d as getConversationStore, l as getConversationEventStore } from "./viewer-B2wXNspU.js";
|
|
4
|
+
import { f as credentialContextForActor } from "./registry-COTeZ2cV.js";
|
|
5
5
|
import { P as messageCardText } from "./conversation-B0baEwoA.js";
|
|
6
|
-
import { X as markTurnFailed, Z as startActiveTurn } from "./store-
|
|
7
|
-
import { n as getAssistantReplyText } from "./assistant-reply-
|
|
8
|
-
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-
|
|
9
|
-
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
10
|
-
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
11
|
-
import { d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent } from "./turn-failure-response-
|
|
6
|
+
import { X as markTurnFailed, Z as startActiveTurn } from "./store-CqRnaZSq.js";
|
|
7
|
+
import { n as getAssistantReplyText } from "./assistant-reply-UPA8vKlC.js";
|
|
8
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-6mLmG6g_.js";
|
|
9
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-C35IyRGp.js";
|
|
10
|
+
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-D45lz-oC.js";
|
|
11
|
+
import { d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent } from "./turn-failure-response-CaEPLSBn.js";
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
13
|
import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
|
|
14
14
|
// src/chat/local/runner.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as sandboxEgressSignalsResponseSchema } from "./credentialed-C6pKlB1p.js";
|
|
2
2
|
// src/chat/local/sandbox-egress-signals.ts
|
|
3
3
|
const SANDBOX_EGRESS_SIGNALS_PATH = "/api/internal/sandbox-egress/signals";
|
|
4
4
|
const LOCAL_DEV_SERVER_TIMEOUT_MS = 1e3;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as AGENT_INVOCATION_STATUSES, u as juniorDestinationKindSchema } from "./agent-invocations-CxKldAeB.js";
|
|
2
2
|
import { E as conversationUsageSchema, T as conversationSummaryReportSchema, j as conversationChildAgentTotalsSchema, l as conversationAuxiliaryCostsSchema, n as actorIdentitySchema } from "./conversation-B0baEwoA.js";
|
|
3
|
-
import "./automation-
|
|
3
|
+
import "./automation-2RbKzpMT.js";
|
|
4
4
|
import { a as fillUtcHours, c as sumUtcHoursIntoSixHours, i as fillUtcDays } from "./web-message-id-CJSUiksE.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
import { codeChangeStateSchema } from "@sentry/junior-plugin-api";
|
|
6
|
+
import { codeChangeStateSchema, eventMatchSchema } from "@sentry/junior-plugin-api";
|
|
7
7
|
// src/api/schema/common.ts
|
|
8
8
|
/** Stable error body returned by Junior-owned REST endpoints. */
|
|
9
9
|
const apiErrorSchema = z.object({ error: z.string().min(1) }).strict();
|
|
@@ -123,6 +123,47 @@ const conversationChildAgentsReportSchema = z.object({
|
|
|
123
123
|
agents: z.array(conversationChildAgentSchema),
|
|
124
124
|
conversationId: z.string().min(1)
|
|
125
125
|
}).strict();
|
|
126
|
+
// src/api/schema/watch.ts
|
|
127
|
+
/**
|
|
128
|
+
* One active Watch that a Conversation owns: its own, or one that a child agent
|
|
129
|
+
* below it created.
|
|
130
|
+
*
|
|
131
|
+
* Viewers who cannot see private content get the resource type, event types,
|
|
132
|
+
* and times, but not the label, intent, or match filter.
|
|
133
|
+
*/
|
|
134
|
+
const conversationWatchSchema = z.object({
|
|
135
|
+
/** Absent when the Conversation itself created the Watch. */
|
|
136
|
+
childAgent: z.object({
|
|
137
|
+
conversationId: z.string().min(1),
|
|
138
|
+
name: z.string().min(1).optional()
|
|
139
|
+
}).strict().optional(),
|
|
140
|
+
createdAt: z.string().datetime(),
|
|
141
|
+
events: z.array(z.string().min(1)).min(1),
|
|
142
|
+
expiresAt: z.string().datetime(),
|
|
143
|
+
/** Set only for a timer Watch. */
|
|
144
|
+
firesAt: z.string().datetime().optional(),
|
|
145
|
+
id: z.string().min(1),
|
|
146
|
+
intent: z.string().min(1).optional(),
|
|
147
|
+
label: z.string().min(1).optional(),
|
|
148
|
+
match: eventMatchSchema.optional(),
|
|
149
|
+
namespace: z.string().min(1),
|
|
150
|
+
redacted: z.literal(true).optional(),
|
|
151
|
+
resourceType: z.string().min(1)
|
|
152
|
+
}).strict().superRefine((data, context) => {
|
|
153
|
+
if (data.label === void 0 === (data.redacted !== true)) context.addIssue({
|
|
154
|
+
code: "custom",
|
|
155
|
+
message: "watch label must be text or explicitly redacted"
|
|
156
|
+
});
|
|
157
|
+
if (data.redacted && (data.intent || data.match)) context.addIssue({
|
|
158
|
+
code: "custom",
|
|
159
|
+
message: "redacted watches must not expose an intent or match"
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
/** Active Watches that one Conversation owns, oldest first. */
|
|
163
|
+
const conversationWatchesReportSchema = z.object({
|
|
164
|
+
conversationId: z.string().min(1),
|
|
165
|
+
watches: z.array(conversationWatchSchema)
|
|
166
|
+
}).strict();
|
|
126
167
|
// src/api/schema/code.ts
|
|
127
168
|
const codeChangeSummarySchema = z.object({
|
|
128
169
|
closed: z.number().int().nonnegative(),
|
|
@@ -485,4 +526,4 @@ const statsReportSchema = z.object({
|
|
|
485
526
|
windowEnd: z.string(),
|
|
486
527
|
windowStart: z.string()
|
|
487
528
|
}).strict();
|
|
488
|
-
export { activityHours as A, codeChangeSummarySchema as B, personParamsSchema as C, locationDirectoryReportSchema as D, locationDetailReportSchema as E, connectionSchema as F, codeRepositorySummarySchema as G, codePersonReportSchema as H, disconnectConnectionResponseSchema as I,
|
|
529
|
+
export { activityHours as A, codeChangeSummarySchema as B, personParamsSchema as C, locationDirectoryReportSchema as D, locationDetailReportSchema as E, connectionSchema as F, codeRepositorySummarySchema as G, codePersonReportSchema as H, disconnectConnectionResponseSchema as I, conversationChildAgentSchema as J, conversationWatchSchema as K, startConnectionResponseSchema as L, dailyConversationActivitySchema as M, connectionListSchema as N, locationParamsSchema as O, connectionParamsSchema as P, apiErrorSchema as Q, codeActivityDaySchema as R, actorProfileReportSchema as S, locationActivityDayReportSchema as T, codeRepositoryParamsSchema as U, codeOverviewReportSchema as V, codeRepositoryReportSchema as W, stopConversationTurnResponseSchema as X, conversationChildAgentsReportSchema as Y, conversationStatsReportSchema as Z, personalTokenListSchema as _, workspaceBodySchema as a, revokePersonalTokenResponseSchema as b, workspaceRepoSchema as c, serviceAccountListSchema as d, serviceAccountParamsSchema as f, createdPersonalTokenSchema as g, createPersonalTokenBodySchema as h, deleteWorkspaceResponseSchema as i, activitySixHours as j, activityDays as k, workspaceSchema as l, startServiceAccountSignInResponseSchema as m, statsReportSchema as n, workspaceListSchema as o, serviceAccountSchema as p, conversationWatchesReportSchema as q, baselineSnapshotSchema as r, workspaceParamsSchema as s, statSchema as t, disconnectServiceAccountResponseSchema as u, personalTokenMetadataSchema as v, personalSpendReportSchema as w, actorDirectoryReportSchema as x, personalTokenParamsSchema as y, codeChangeSummaryReportSchema as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { captureException, captureMessage, continueTrace, flush, getActiveSpan, getClient, getGlobalScope, getTraceData, init, logger, setTag, setUser, spanToJSON, startInactiveSpan, startSpan,
|
|
2
|
+
import { captureException, captureMessage, continueTrace, flush, getActiveSpan, getClient, getGlobalScope, getTraceData, init, logger, setTag, setUser, spanToJSON, startInactiveSpan, startSpan, withActiveSpan, withScope } from "@sentry/node";
|
|
3
3
|
// src/chat/sentry.ts
|
|
4
4
|
var sentry_exports = /* @__PURE__ */ __exportAll({
|
|
5
5
|
captureException: () => captureException,
|
|
@@ -17,10 +17,7 @@ var sentry_exports = /* @__PURE__ */ __exportAll({
|
|
|
17
17
|
spanToJSON: () => spanToJSON,
|
|
18
18
|
startInactiveSpan: () => startInactiveSpan,
|
|
19
19
|
startSpan: () => startSpan,
|
|
20
|
-
startSpanManual: () => startSpanManual,
|
|
21
|
-
vercelAIIntegration: () => vercelAIIntegration,
|
|
22
20
|
withActiveSpan: () => withActiveSpan,
|
|
23
|
-
withScope: () => withScope
|
|
24
|
-
withStreamedSpan: () => withStreamedSpan
|
|
21
|
+
withScope: () => withScope
|
|
25
22
|
});
|
|
26
|
-
export {
|
|
23
|
+
export { withScope as _, getClient as a, init as c, setTag as d, setUser as f, withActiveSpan as g, startSpan as h, getActiveSpan as i, logger as l, startInactiveSpan as m, captureMessage as n, getGlobalScope as o, spanToJSON as p, continueTrace as r, getTraceData as s, captureException as t, sentry_exports as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
2
|
-
import { t as disconnectStateAdapter } from "./adapter-
|
|
3
|
-
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-D3qbJlYz.js";
|
|
2
|
+
import { t as disconnectStateAdapter } from "./adapter-cUkPH3Om.js";
|
|
3
|
+
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-YdYftwV2.js";
|
|
4
4
|
import { CLI_USAGE } from "./cli/run.js";
|
|
5
5
|
import { createServer } from "node:http";
|
|
6
6
|
// src/cli/service-account.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { m as logWarn, y as setSpanAttributes, z as isRecord } from "./logging-
|
|
2
|
-
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-
|
|
3
|
-
import { i as MUTATION_LOCK_TTL_MS, o as fenceLock, r as getStateAdapter, s as withLock } from "./adapter-
|
|
1
|
+
import { m as logWarn, y as setSpanAttributes, z as isRecord } from "./logging-D2QBriUo.js";
|
|
2
|
+
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-COTeZ2cV.js";
|
|
3
|
+
import { i as MUTATION_LOCK_TTL_MS, o as fenceLock, r as getStateAdapter, s as withLock } from "./adapter-cUkPH3Om.js";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
6
|
import { UnauthorizedError, auth } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
@@ -62,7 +62,7 @@ var McpToolError = class extends Error {
|
|
|
62
62
|
var McpServiceAccountRequiredError = class extends McpToolError {
|
|
63
63
|
provider;
|
|
64
64
|
constructor(provider, displayName) {
|
|
65
|
-
super(`${displayName} is not available yet.
|
|
65
|
+
super(`${displayName} is not available yet. This app uses a shared ${displayName} account for everyone, and an admin must connect it on the dashboard Admin page.`);
|
|
66
66
|
this.name = "McpServiceAccountRequiredError";
|
|
67
67
|
this.provider = provider;
|
|
68
68
|
}
|
|
@@ -348,7 +348,7 @@ function clientMetadata(redirectUrl) {
|
|
|
348
348
|
};
|
|
349
349
|
}
|
|
350
350
|
function reconnectMessage(provider) {
|
|
351
|
-
return `The ${provider} service account is not authorized anymore.
|
|
351
|
+
return `The ${provider} service account is not authorized anymore. An admin must run \`junior service-account connect ${provider}\`.`;
|
|
352
352
|
}
|
|
353
353
|
/**
|
|
354
354
|
* Build the OAuth client provider for a connected service account.
|