@sentry/junior 0.257.0 → 0.258.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/{actor-BTtLaeWy.js → actor-tlxzqaRe.js} +3 -6
- package/dist/{admin-DgIkm6Vy.js → admin-My1SLGVO.js} +2 -3
- package/dist/{agent-hooks-BjtTzvru.js → agent-hooks-BJ_5mlRH.js} +69 -109
- package/dist/{agent-invocations-Bdu3ROfo.js → agent-invocations-Qfz7dWgU.js} +6 -12
- package/dist/{agent-runner-D7OboVb3.js → agent-runner-DGsFQw72.js} +261 -458
- package/dist/api/schema.d.ts +414 -448
- package/dist/api/schema.js +5 -5
- package/dist/api.d.ts +2 -12
- package/dist/api.js +94 -158
- package/dist/{app-BsU5QNBd.d.ts → app-PX2H1PxU.d.ts} +21 -44
- package/dist/app.d.ts +3 -3
- package/dist/app.js +204 -321
- package/dist/{assistant-reply-CbTPebzL.js → assistant-reply-H1M-91oF.js} +3 -5
- package/dist/{automation-CHdlHVZP.js → automation-DWBFBenG.js} +6 -11
- package/dist/{briefs-oLOldnDM.js → briefs-vYoK85rJ.js} +8 -11
- package/dist/{cadence-D00SCzT1.js → cadence-R7Em4RjE.js} +1 -2
- package/dist/{catalog-runtime-CZzhGQ7F.js → catalog-runtime-BN4DVxco.js} +3 -4
- package/dist/cli/chat.d.ts +2 -4
- package/dist/cli/chat.js +22 -24
- package/dist/cli/check.d.ts +1 -3
- package/dist/cli/check.js +4 -5
- package/dist/cli/env.d.ts +1 -3
- package/dist/cli/env.js +1 -2
- package/dist/cli/init.d.ts +1 -3
- package/dist/cli/init.js +3 -3
- package/dist/cli/main.d.ts +1 -3
- package/dist/cli/main.js +4 -5
- package/dist/cli/plugins.d.ts +2 -4
- package/dist/cli/plugins.js +7 -8
- package/dist/cli/run.d.ts +1 -2
- package/dist/cli/run.js +1 -2
- package/dist/cli/snapshot-create.d.ts +1 -3
- package/dist/cli/snapshot-create.js +4 -5
- package/dist/cli/upgrade.d.ts +3 -6
- package/dist/cli/upgrade.js +11 -17
- package/dist/{client-D8HnkOQX.js → client-DbyHuMFU.js} +9 -16
- package/dist/{config-CJRnWK9H.js → config-_WO_AjCB.js} +18 -15
- package/dist/{connections-ClYrKzpX.js → connections-ag_1JOhB.js} +14 -19
- package/dist/{conversation-CKNLYBJt.js → conversation-DjN3mlog.js} +8 -15
- package/dist/{conversation-privacy-C8b1nphZ.js → conversation-privacy-DHP_xnVj.js} +2 -3
- package/dist/{conversation-work-C6y3T5Hx.js → conversation-work-BaT_T6EB.js} +1 -2
- package/dist/{credential-sync-BXfohNmJ.js → credential-sync-B-CPX_ag.js} +23 -28
- package/dist/{db-Ca9Nt5ci.d.ts → db-BnRqQ7G5.d.ts} +1 -1
- package/dist/{executor-Do0THDRR.js → executor-RvG6kVe1.js} +30 -52
- package/dist/{experimental-CQIvMUO7.js → experimental-BNK1l1jv.js} +2 -4
- package/dist/{history-9pO1Zd4Y.js → history-AY8rs-FR.js} +5 -9
- package/dist/{history-DvqWZlYX.d.ts → history-BgI33Kie.d.ts} +12 -20
- package/dist/{images-BN_BiBXF.js → images-C2J_bj2g.js} +5 -6
- package/dist/instrumentation.d.ts +1 -3
- package/dist/instrumentation.js +6 -8
- package/dist/{job-queue-B6SV9uVa.js → job-queue-DVe37it2.js} +6 -12
- package/dist/{logging-CWxiIuCF.js → logging-DsHONhVm.js} +7 -12
- package/dist/{message-TUOdbSBW.js → message-DyitL8no.js} +5 -6
- package/dist/{model-profile-BwU8mqwD.js → model-profile-Bg8EoCKD.js} +2 -4
- package/dist/nitro.d.ts +3 -5
- package/dist/nitro.js +12 -17
- package/dist/{oauth-authorization-BA4Dt6a7.js → oauth-authorization-djQn5Nhy.js} +2 -4
- package/dist/{oauth-callback-server-Dj5UJODo.js → oauth-callback-server-CDby-pCn.js} +3 -4
- package/dist/{oauth-relay-CdCnu80W.js → oauth-relay-CTygMkNx.js} +2 -3
- package/dist/{package-discovery-BVvSnQBB.js → package-discovery-DJBompdd.js} +17 -21
- package/dist/{pending-auth-s_QFribU.js → pending-auth-D8J1uJUS.js} +37 -28
- package/dist/{plugin-module-CVvEUSMH.js → plugin-module-Cf5gVPWP.js} +1 -2
- package/dist/{plugins-CjfUP5gJ.d.ts → plugins-B11Mfkmv.d.ts} +0 -4
- package/dist/{plugins-egKWjgue.js → plugins-DOm9Y6qI.js} +2 -3
- package/dist/{private-trace-result-BLvBjy_e.js → private-trace-result-CE7_lEdq.js} +1 -2
- package/dist/{profile-h-72wM78.js → profile-DpYjfKke.js} +16 -28
- package/dist/{prompt-DyoEj9c2.js → prompt-xgpyMtg7.js} +5 -9
- package/dist/{queue-B5SnqRln.d.ts → queue-C37RbDVc.d.ts} +0 -2
- package/dist/{registry-sLTr-sV9.js → registry-Du566MtJ.js} +16 -29
- package/dist/{resolve-ncQPZROQ.js → resolve-ClCIgh8E.js} +7 -12
- package/dist/{result-C883vngT.js → result-BBbKA61B.js} +13 -17
- package/dist/{rolldown-runtime-B4FMCO8f.js → rolldown-runtime-nwUcYXjP.js} +1 -2
- package/dist/{runner-CzYImdOF.js → runner-CCuqFSqx.js} +12 -13
- package/dist/{sandbox-egress-signals-CZbMINHI.js → sandbox-egress-signals-DY1mbKF4.js} +2 -3
- package/dist/{schema-Dy69D4Ge.js → schema-DrMh3NtR.js} +15 -26
- package/dist/{sentry-CgWZM_kV.js → sentry-BBUlHih9.js} +2 -3
- package/dist/{session-stop-CQjKd4a2.js → session-stop-CIoFiwwe.js} +23 -33
- package/dist/{skills-C22SLruK.js → skills-DyQBLIrK.js} +9 -9
- package/dist/{spawn-DY9CLXDL.js → spawn-Dqfeo7XP.js} +4 -5
- package/dist/{store-DoewL5mG.d.ts → store-CG0VJyye.d.ts} +0 -14
- package/dist/{store-DXFIQy-G.js → store-DJLwq4x8.js} +13 -15
- package/dist/{task-queue-B17vV0La.js → task-queue-BzW4MaWU.js} +5 -7
- package/dist/{task-runner-DUjvzYXj.js → task-runner-D3qJh4fK.js} +22 -26
- package/dist/{tasks-D_WIJtvO.js → tasks-CEXKTASS.js} +62 -78
- package/dist/{thread-state-Ch4yuCqG.js → thread-state-W3f6kAtz.js} +13 -19
- package/dist/{turn-failure-response-C5nBKC4S.js → turn-failure-response-CWx7aNIh.js} +16 -22
- package/dist/{turn-lifecycle-CO-ylUmV.js → turn-lifecycle-C9JFst7-.js} +2 -3
- package/dist/{turn-session-routing-B3LWooK5.js → turn-session-routing-CUxtfpr7.js} +2 -3
- package/dist/{validation-CXYxaNYx.js → validation-BHRxa5G4.js} +3 -4
- package/dist/vercel.d.ts +1 -3
- package/dist/vercel.js +1 -2
- package/dist/{version-BcdZy2zg.js → version-C0U6rHg0.js} +3 -5
- package/dist/{version-CnXZ614E.d.ts → version-Cc2OFd9G.d.ts} +0 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -2
- package/dist/{viewer-DSZXygMU.js → viewer-CGvvRqKp.js} +26 -57
- package/dist/{web-input-B9Bv0_lR.js → web-input-Keb5GRWj.js} +98 -155
- package/dist/{web-message-id-xPI_EFSC.js → web-message-id-CJSUiksE.js} +3 -6
- package/dist/{work-nAfDSUFP.js → work-DRcsJ3hV.js} +14 -16
- package/dist/{worker-vGXZ6XFT.js → worker-Cjo-QqPq.js} +7 -8
- package/package.json +7 -6
package/dist/nitro.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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-
|
|
2
|
-
import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-
|
|
3
|
-
import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-
|
|
4
|
-
import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-
|
|
5
|
-
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-
|
|
6
|
-
import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-
|
|
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-DsHONhVm.js";
|
|
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-DVe37it2.js";
|
|
4
|
+
import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-DOm9Y6qI.js";
|
|
5
|
+
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-BzW4MaWU.js";
|
|
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
|
-
|
|
9
|
+
// src/build/rolldown-workarounds.ts
|
|
10
10
|
/**
|
|
11
11
|
* Override rolldown's treeshake config so that module side effects survive
|
|
12
12
|
* bundling.
|
|
@@ -28,15 +28,13 @@ function applyRolldownTreeshakeWorkaround(nitro) {
|
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
//#region src/build/glob-to-regex.ts
|
|
31
|
+
// src/build/glob-to-regex.ts
|
|
33
32
|
/** Convert a simple file glob (supporting `*` wildcards) into a RegExp. */
|
|
34
33
|
function globToRegex(pattern) {
|
|
35
34
|
const escaped = pattern.replace(/[\\^$+?.()|[\]{}]/g, "\\$&").replace(/\*/g, ".*");
|
|
36
35
|
return new RegExp(`^${escaped}$`);
|
|
37
36
|
}
|
|
38
|
-
|
|
39
|
-
//#region src/build/copy-build-content.ts
|
|
37
|
+
// src/build/copy-build-content.ts
|
|
40
38
|
const DASHBOARD_PACKAGE_NAME = "@sentry/junior-dashboard";
|
|
41
39
|
const JUNIOR_PACKAGE_NAME = "@sentry/junior";
|
|
42
40
|
const DASHBOARD_ASSET_NAMES = ["client.js", "tailwind.css"];
|
|
@@ -93,7 +91,7 @@ function parseIncludePattern(pattern) {
|
|
|
93
91
|
const normalized = pattern.trim().replace(/^node_modules\//, "");
|
|
94
92
|
const parts = normalized.split("/");
|
|
95
93
|
if (!normalized || path.isAbsolute(normalized) || parts.some((part) => !part || part === "." || part === "..")) throw new Error(`includeFiles entry "${pattern}" must be a package subpath pattern`);
|
|
96
|
-
const packagePartCount = parts[0]
|
|
94
|
+
const packagePartCount = parts[0]?.startsWith("@") ?? false ? 2 : 1;
|
|
97
95
|
const pkgName = parts.slice(0, packagePartCount).join("/");
|
|
98
96
|
const subpath = parts.slice(packagePartCount).join("/");
|
|
99
97
|
if (!pkgName || !isValidPackageName(pkgName) || !subpath) throw new Error(`includeFiles entry "${pattern}" must include a package subpath`);
|
|
@@ -140,8 +138,7 @@ function nodeModulesRelativePath(sourcePath) {
|
|
|
140
138
|
if (nodeModulesIndex === -1 || nodeModulesIndex === parts.length - 1) return null;
|
|
141
139
|
return path.join("node_modules", ...parts.slice(nodeModulesIndex + 1));
|
|
142
140
|
}
|
|
143
|
-
|
|
144
|
-
//#region src/build/virtual-config.ts
|
|
141
|
+
// src/build/virtual-config.ts
|
|
145
142
|
function renderRuntimePluginImport(module) {
|
|
146
143
|
if (module.exportName === "default") return `import juniorRuntimePluginSet from ${JSON.stringify(module.specifier)};`;
|
|
147
144
|
return `import { ${module.exportName} as juniorRuntimePluginSet } from ${JSON.stringify(module.specifier)};`;
|
|
@@ -177,8 +174,7 @@ function injectVirtualConfig(nitro, options = {}) {
|
|
|
177
174
|
});
|
|
178
175
|
};
|
|
179
176
|
}
|
|
180
|
-
|
|
181
|
-
//#region src/nitro.ts
|
|
177
|
+
// src/nitro.ts
|
|
182
178
|
const DEFAULT_FUNCTION_MAX_DURATION_SECONDS = 300;
|
|
183
179
|
const VERCEL_QUEUE_TRIGGER_TYPE = "queue/v2beta";
|
|
184
180
|
function isPluginModuleReference(value) {
|
|
@@ -320,5 +316,4 @@ function juniorNitro(options = {}) {
|
|
|
320
316
|
});
|
|
321
317
|
} } };
|
|
322
318
|
}
|
|
323
|
-
//#endregion
|
|
324
319
|
export { juniorNitro };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/chat/runtime/turn.ts
|
|
2
2
|
/** Classified Slack turn failure carrying the owning Sentry capture outward. */
|
|
3
3
|
var ConversationTurnBoundaryError = class extends Error {
|
|
4
4
|
eventId;
|
|
@@ -89,11 +89,9 @@ function markTurnFailed(args) {
|
|
|
89
89
|
skippedReason: "reply failed"
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
|
|
93
|
-
//#region src/chat/oauth-authorization.ts
|
|
92
|
+
// src/chat/oauth-authorization.ts
|
|
94
93
|
/** Build the stable event identity shared by authorization request and completion. */
|
|
95
94
|
function authorizationId(args) {
|
|
96
95
|
return `${args.sessionId}:${args.kind}:${args.provider}`;
|
|
97
96
|
}
|
|
98
|
-
//#endregion
|
|
99
97
|
export { TurnInputDeferredError as a, isTurnInputCommitLostError as c, markTurnCompleted as d, markTurnFailed as f, TurnInputCommitLostError as i, isTurnInputDeferredError as l, ConversationTurnBoundaryError as n, getConversationTurnBoundaryError as o, startActiveTurn as p, CooperativeTurnYieldError as r, isCooperativeTurnYieldError as s, authorizationId as t, markTurnClosed as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
1
|
+
import { Lt as createUserTokenStore } from "./agent-runner-DGsFQw72.js";
|
|
2
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-B-CPX_ag.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;
|
|
6
6
|
const LOCAL_OAUTH_CALLBACK_TIMEOUT_MS = 6e4;
|
|
7
7
|
function decodeProvider(value) {
|
|
@@ -126,5 +126,4 @@ async function startLocalOAuthCallbackServer() {
|
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
|
-
//#endregion
|
|
130
129
|
export { startLocalOAuthCallbackServer };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { randomBytes } from "node:crypto";
|
|
4
4
|
import { SignJWT, jwtVerify } from "jose";
|
|
5
|
-
|
|
5
|
+
// src/chat/local/oauth-relay.ts
|
|
6
6
|
var oauth_relay_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
createLocalOAuthState: () => createLocalOAuthState,
|
|
8
8
|
relayLocalOAuthCallback: () => relayLocalOAuthCallback
|
|
@@ -58,5 +58,4 @@ async function relayLocalOAuthCallback(request) {
|
|
|
58
58
|
url.searchParams.set("jr_local_relay", "complete");
|
|
59
59
|
return Response.redirect(url, 302);
|
|
60
60
|
}
|
|
61
|
-
//#endregion
|
|
62
61
|
export { relayLocalOAuthCallback as n, oauth_relay_exports as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import fs, { statSync } from "node:fs";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
-
|
|
6
|
+
// src/package-resolution.ts
|
|
7
7
|
function isDirectory$1(targetPath) {
|
|
8
8
|
try {
|
|
9
9
|
return statSync(targetPath).isDirectory();
|
|
@@ -51,9 +51,9 @@ function isValidPackageSegment(segment) {
|
|
|
51
51
|
/** Return whether a string is shaped like an npm package name. */
|
|
52
52
|
function isValidPackageName(packageName) {
|
|
53
53
|
if (!packageName || packageName.includes("\\") || path.isAbsolute(packageName)) return false;
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
return
|
|
54
|
+
const [scopeOrName = "", name, ...rest] = packageName.split("/");
|
|
55
|
+
if (scopeOrName.startsWith("@")) return name !== void 0 && rest.length === 0 && scopeOrName.length > 1 && isValidPackageSegment(scopeOrName.slice(1)) && isValidPackageSegment(name);
|
|
56
|
+
return name === void 0 && isValidPackageSegment(scopeOrName);
|
|
57
57
|
}
|
|
58
58
|
function findPackageRoot(entryPath) {
|
|
59
59
|
let dir = path.dirname(entryPath);
|
|
@@ -106,8 +106,7 @@ function resolvePackageLocation(cwd, packageName, options) {
|
|
|
106
106
|
function resolvePackageDir(cwd, packageName) {
|
|
107
107
|
return resolvePackageLocation(cwd, packageName)?.dir;
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
//#region src/chat/discovery.ts
|
|
109
|
+
// src/chat/discovery.ts
|
|
111
110
|
var discovery_exports = /* @__PURE__ */ __exportAll({
|
|
112
111
|
builtInSkillsDir: () => builtInSkillsDir,
|
|
113
112
|
dataDir: () => dataDir,
|
|
@@ -252,7 +251,6 @@ function resolveHomeDir(cwd = process.cwd(), options) {
|
|
|
252
251
|
const directApp = path.resolve(resolvedCwd, "app");
|
|
253
252
|
if (pathExists(directApp) && hasAnyDataMarkers(directApp)) return directApp;
|
|
254
253
|
const candidates = resolveCandidateAppDirs(resolvedCwd, options?.projectRoots);
|
|
255
|
-
if (candidates.length === 0) return directApp;
|
|
256
254
|
candidates.sort((left, right) => {
|
|
257
255
|
const leftScore = scoreAppCandidate(left);
|
|
258
256
|
const rightScore = scoreAppCandidate(right);
|
|
@@ -262,11 +260,11 @@ function resolveHomeDir(cwd = process.cwd(), options) {
|
|
|
262
260
|
if (leftDistance !== rightDistance) return leftDistance - rightDistance;
|
|
263
261
|
return left.localeCompare(right);
|
|
264
262
|
});
|
|
265
|
-
return candidates[0];
|
|
263
|
+
return candidates[0] ?? directApp;
|
|
266
264
|
}
|
|
267
|
-
function
|
|
268
|
-
if (subdir === "data") return
|
|
269
|
-
return
|
|
265
|
+
function resolveContentRoot(subdir) {
|
|
266
|
+
if (subdir === "data") return homeDir();
|
|
267
|
+
return path.join(homeDir(), subdir);
|
|
270
268
|
}
|
|
271
269
|
/** Return the built-in skills directory in source and packaged builds. */
|
|
272
270
|
function builtInSkillsDir() {
|
|
@@ -278,7 +276,7 @@ function builtInSkillsDir() {
|
|
|
278
276
|
}
|
|
279
277
|
/** Return the data directory (same as homeDir). */
|
|
280
278
|
function dataDir() {
|
|
281
|
-
return
|
|
279
|
+
return resolveContentRoot("data");
|
|
282
280
|
}
|
|
283
281
|
/** Return the path to the SOUL.md file. */
|
|
284
282
|
function soulPath() {
|
|
@@ -294,23 +292,23 @@ function descriptionPath() {
|
|
|
294
292
|
}
|
|
295
293
|
/** Return the skills directory path. */
|
|
296
294
|
function skillsDir() {
|
|
297
|
-
return
|
|
295
|
+
return resolveContentRoot("skills");
|
|
298
296
|
}
|
|
299
297
|
/** Return the plugins directory path. */
|
|
300
298
|
function pluginsDir() {
|
|
301
|
-
return
|
|
299
|
+
return resolveContentRoot("plugins");
|
|
302
300
|
}
|
|
303
301
|
/** Return all unique data root directories. */
|
|
304
302
|
function dataRoots() {
|
|
305
|
-
return unique(
|
|
303
|
+
return unique([resolveContentRoot("data")]);
|
|
306
304
|
}
|
|
307
305
|
/** Return all unique skill root directories. */
|
|
308
306
|
function skillRoots() {
|
|
309
|
-
return unique([builtInSkillsDir(),
|
|
307
|
+
return unique([builtInSkillsDir(), resolveContentRoot("skills")]);
|
|
310
308
|
}
|
|
311
309
|
/** Return all unique plugin root directories. */
|
|
312
310
|
function pluginRoots() {
|
|
313
|
-
return unique(
|
|
311
|
+
return unique([resolveContentRoot("plugins")]);
|
|
314
312
|
}
|
|
315
313
|
/** Return candidate paths where SOUL.md might be found. */
|
|
316
314
|
function soulPathCandidates() {
|
|
@@ -339,8 +337,7 @@ function listReferenceFiles() {
|
|
|
339
337
|
return [];
|
|
340
338
|
}
|
|
341
339
|
}
|
|
342
|
-
|
|
343
|
-
//#region src/chat/plugins/package-discovery.ts
|
|
340
|
+
// src/chat/plugins/package-discovery.ts
|
|
344
341
|
function normalizeForGlob(targetPath) {
|
|
345
342
|
return targetPath.split(path.sep).join("/");
|
|
346
343
|
}
|
|
@@ -451,5 +448,4 @@ function discoverInstalledPluginPackageContent(cwd = process.cwd(), options) {
|
|
|
451
448
|
tracingIncludes: uniqueStringsInOrder(tracingIncludes)
|
|
452
449
|
};
|
|
453
450
|
}
|
|
454
|
-
//#endregion
|
|
455
451
|
export { listReferenceFiles as a, soulPathCandidates as c, resolvePackageDir as d, homeDir as i, worldPathCandidates as l, normalizePluginPackageNames as n, pluginRoots as o, discovery_exports as r, skillRoots as s, discoverInstalledPluginPackageContent as t, isValidPackageName as u };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { v as isProviderRetryError } from "./client-
|
|
2
|
-
import { J as abandonTurnRecord, ln as estimateTextTokens } from "./tasks-
|
|
3
|
-
import { r as isExperimentalFeatureEnabled } from "./experimental-
|
|
1
|
+
import { v as isProviderRetryError } from "./client-DbyHuMFU.js";
|
|
2
|
+
import { J as abandonTurnRecord, ln as estimateTextTokens } from "./tasks-CEXKTASS.js";
|
|
3
|
+
import { r as isExperimentalFeatureEnabled } from "./experimental-BNK1l1jv.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
5
|
+
// src/chat/state/turn-id.ts
|
|
6
6
|
/** Build a stable turn identifier from a message ID. */
|
|
7
7
|
function buildDeterministicTurnId(messageId) {
|
|
8
8
|
return `turn_${messageId.replace(/[^a-zA-Z0-9_-]/g, "_")}`;
|
|
@@ -11,8 +11,7 @@ function buildDeterministicTurnId(messageId) {
|
|
|
11
11
|
function buildDeterministicAssistantMessageId(turnId) {
|
|
12
12
|
return `${turnId}:assistant:1`;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
//#region src/chat/services/subscribed-reply-router-policy.ts
|
|
14
|
+
// src/chat/services/subscribed-reply-router-policy.ts
|
|
16
15
|
/**
|
|
17
16
|
* Passive subscribed-thread reply router policy.
|
|
18
17
|
*
|
|
@@ -64,8 +63,20 @@ Assess conversation floor ownership and whether the latest message continues wor
|
|
|
64
63
|
- Use low confidence only for genuinely ambiguous floor ownership. Do not lower confidence merely because the assistant was addressed implicitly.
|
|
65
64
|
- Keep the reason to one concise sentence under 160 characters grounded in floor ownership or continuity.`;
|
|
66
65
|
}
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
// src/chat/services/subscribed-decision.ts
|
|
67
|
+
/** Why the subscribed-thread router chose to reply or stay silent. */
|
|
68
|
+
const SubscribedReplyReason = {
|
|
69
|
+
ThreadOptOut: "thread_opt_out",
|
|
70
|
+
ExplicitMention: "explicit_mention",
|
|
71
|
+
DirectedFollowUp: "directed_follow_up",
|
|
72
|
+
DirectedToOtherParty: "directed_to_other_party",
|
|
73
|
+
EmptyMessage: "empty_message",
|
|
74
|
+
Classifier: "llm_classifier",
|
|
75
|
+
SideConversation: "side_conversation",
|
|
76
|
+
LowConfidence: "low_confidence",
|
|
77
|
+
ClassifierError: "classifier_error",
|
|
78
|
+
PassiveDisabled: "passive_disabled"
|
|
79
|
+
};
|
|
69
80
|
const replyDecisionSchema = z.object({
|
|
70
81
|
should_reply: z.boolean().describe("Whether Junior should respond to this thread message."),
|
|
71
82
|
should_unsubscribe: z.boolean().describe("Whether Junior should unsubscribe from this thread because the user clearly asked it to stop participating."),
|
|
@@ -131,13 +142,13 @@ function getThreadStopDecision(args) {
|
|
|
131
142
|
if (hasBangStop(rawText, text)) return {
|
|
132
143
|
shouldReply: false,
|
|
133
144
|
shouldUnsubscribe: true,
|
|
134
|
-
reason:
|
|
145
|
+
reason: SubscribedReplyReason.ThreadOptOut,
|
|
135
146
|
reasonDetail: "!stop"
|
|
136
147
|
};
|
|
137
148
|
if (isBareStop(rawText, text)) return {
|
|
138
149
|
shouldReply: false,
|
|
139
150
|
shouldUnsubscribe: true,
|
|
140
|
-
reason:
|
|
151
|
+
reason: SubscribedReplyReason.ThreadOptOut,
|
|
141
152
|
reasonDetail: "stop"
|
|
142
153
|
};
|
|
143
154
|
}
|
|
@@ -167,7 +178,7 @@ function parseTranscriptMessages(conversationContext) {
|
|
|
167
178
|
const lines = conversationContext.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
|
|
168
179
|
for (const line of lines) {
|
|
169
180
|
const match = line.match(TRANSCRIPT_MESSAGE_LINE_RE);
|
|
170
|
-
if (!match) continue;
|
|
181
|
+
if (!match?.[1]) continue;
|
|
171
182
|
const role = match[1].toLowerCase();
|
|
172
183
|
if (role !== "assistant" && role !== "user") continue;
|
|
173
184
|
messages.push({
|
|
@@ -279,7 +290,7 @@ function getSubscribedReplyPreflightDecision(args) {
|
|
|
279
290
|
if (!leadingOtherPartyAddress) return;
|
|
280
291
|
return {
|
|
281
292
|
shouldReply: false,
|
|
282
|
-
reason:
|
|
293
|
+
reason: SubscribedReplyReason.DirectedToOtherParty,
|
|
283
294
|
reasonDetail: leadingOtherPartyAddress
|
|
284
295
|
};
|
|
285
296
|
}
|
|
@@ -303,26 +314,26 @@ async function decideSubscribedThreadReply(args) {
|
|
|
303
314
|
if (preflightDecision) return preflightDecision;
|
|
304
315
|
if (!text && !args.input.hasAttachments) return {
|
|
305
316
|
shouldReply: false,
|
|
306
|
-
reason:
|
|
317
|
+
reason: SubscribedReplyReason.EmptyMessage
|
|
307
318
|
};
|
|
308
319
|
if (args.input.isExplicitMention) return {
|
|
309
320
|
shouldReply: true,
|
|
310
|
-
reason:
|
|
321
|
+
reason: SubscribedReplyReason.ExplicitMention
|
|
311
322
|
};
|
|
312
323
|
if (!isExperimentalFeatureEnabled("passive-routing")) return {
|
|
313
324
|
shouldReply: false,
|
|
314
|
-
reason:
|
|
325
|
+
reason: SubscribedReplyReason.PassiveDisabled,
|
|
315
326
|
reasonDetail: "passive-routing"
|
|
316
327
|
};
|
|
317
328
|
if (!args.input.hasAttachments && isAcknowledgmentOnly(text)) return {
|
|
318
329
|
shouldReply: false,
|
|
319
|
-
reason:
|
|
330
|
+
reason: SubscribedReplyReason.SideConversation,
|
|
320
331
|
reasonDetail: "acknowledgment"
|
|
321
332
|
};
|
|
322
333
|
const evidence = buildRouterEvidence(args.input);
|
|
323
334
|
if (evidence.assistantWasLastSpeaker && evidence.humanMessagesSinceLastAssistant === 0 && !evidence.currentMessageHasAttachments && (evidence.currentMessageHasDirectedFollowUpCue || evidence.currentMessageIsTerseClarification)) return {
|
|
324
335
|
shouldReply: true,
|
|
325
|
-
reason:
|
|
336
|
+
reason: SubscribedReplyReason.DirectedFollowUp,
|
|
326
337
|
reasonDetail: evidence.currentMessageIsTerseClarification ? "immediate terse clarification" : "immediate directed follow-up cue"
|
|
327
338
|
};
|
|
328
339
|
try {
|
|
@@ -348,33 +359,33 @@ async function decideSubscribedThreadReply(args) {
|
|
|
348
359
|
if (parsed.confidence < ROUTER_CONFIDENCE_THRESHOLD) return {
|
|
349
360
|
...result.costUsd !== void 0 ? { costUsd: result.costUsd } : void 0,
|
|
350
361
|
shouldReply: false,
|
|
351
|
-
reason:
|
|
362
|
+
reason: SubscribedReplyReason.LowConfidence,
|
|
352
363
|
reasonDetail: `${parsed.confidence.toFixed(2)}: ${reason}`
|
|
353
364
|
};
|
|
354
365
|
return {
|
|
355
366
|
...result.costUsd !== void 0 ? { costUsd: result.costUsd } : void 0,
|
|
356
367
|
shouldReply: false,
|
|
357
368
|
shouldUnsubscribe: true,
|
|
358
|
-
reason:
|
|
369
|
+
reason: SubscribedReplyReason.ThreadOptOut,
|
|
359
370
|
reasonDetail: reason
|
|
360
371
|
};
|
|
361
372
|
}
|
|
362
373
|
if (!parsed.should_reply) return {
|
|
363
374
|
...result.costUsd !== void 0 ? { costUsd: result.costUsd } : void 0,
|
|
364
375
|
shouldReply: false,
|
|
365
|
-
reason:
|
|
376
|
+
reason: SubscribedReplyReason.SideConversation,
|
|
366
377
|
reasonDetail: reason
|
|
367
378
|
};
|
|
368
379
|
if (parsed.confidence < ROUTER_CONFIDENCE_THRESHOLD) return {
|
|
369
380
|
...result.costUsd !== void 0 ? { costUsd: result.costUsd } : void 0,
|
|
370
381
|
shouldReply: false,
|
|
371
|
-
reason:
|
|
382
|
+
reason: SubscribedReplyReason.LowConfidence,
|
|
372
383
|
reasonDetail: `${parsed.confidence.toFixed(2)}: ${reason}`
|
|
373
384
|
};
|
|
374
385
|
return {
|
|
375
386
|
...result.costUsd !== void 0 ? { costUsd: result.costUsd } : void 0,
|
|
376
387
|
shouldReply: true,
|
|
377
|
-
reason:
|
|
388
|
+
reason: SubscribedReplyReason.Classifier,
|
|
378
389
|
reasonDetail: reason
|
|
379
390
|
};
|
|
380
391
|
} catch (error) {
|
|
@@ -382,12 +393,11 @@ async function decideSubscribedThreadReply(args) {
|
|
|
382
393
|
args.logClassifierFailure(error, args.input);
|
|
383
394
|
return {
|
|
384
395
|
shouldReply: false,
|
|
385
|
-
reason:
|
|
396
|
+
reason: SubscribedReplyReason.ClassifierError
|
|
386
397
|
};
|
|
387
398
|
}
|
|
388
399
|
}
|
|
389
|
-
|
|
390
|
-
//#region src/chat/services/pending-auth.ts
|
|
400
|
+
// src/chat/services/pending-auth.ts
|
|
391
401
|
const AUTH_LINK_REUSE_WINDOW_MS = 6e5;
|
|
392
402
|
/** Decide whether the same agent-run session can reuse its fresh auth link. */
|
|
393
403
|
function canReusePendingAuthLink(args) {
|
|
@@ -425,9 +435,8 @@ function wasPendingAuthStopped(conversation, pendingAuth) {
|
|
|
425
435
|
const message = conversation.messages[index];
|
|
426
436
|
if (message?.role !== "user") continue;
|
|
427
437
|
if (buildDeterministicTurnId(message.id) === pendingAuth.sessionId) return false;
|
|
428
|
-
if (message.meta?.skippedReason?.startsWith(
|
|
438
|
+
if (message.meta?.skippedReason?.startsWith(`${SubscribedReplyReason.ThreadOptOut}:`)) return true;
|
|
429
439
|
}
|
|
430
440
|
return false;
|
|
431
441
|
}
|
|
432
|
-
|
|
433
|
-
export { wasPendingAuthStopped as a, getThreadStopDecision as c, getConversationPendingAuth as i, buildDeterministicAssistantMessageId as l, canReusePendingAuthLink as n, decideSubscribedThreadReply as o, clearPendingAuth as r, getSubscribedReplyPreflightDecision as s, abandonReplacedPendingAuth as t, buildDeterministicTurnId as u };
|
|
442
|
+
export { wasPendingAuthStopped as a, getSubscribedReplyPreflightDecision as c, buildDeterministicTurnId as d, getConversationPendingAuth as i, getThreadStopDecision as l, canReusePendingAuthLink as n, SubscribedReplyReason as o, clearPendingAuth as r, decideSubscribedThreadReply as s, abandonReplacedPendingAuth as t, buildDeterministicAssistantMessageId as u };
|
|
@@ -2,7 +2,7 @@ import { createRequire } from "node:module";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { statSync } from "node:fs";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
|
-
|
|
5
|
+
// src/plugin-module.ts
|
|
6
6
|
const PLUGIN_MODULE_EXTENSIONS = [
|
|
7
7
|
"",
|
|
8
8
|
".ts",
|
|
@@ -77,5 +77,4 @@ async function loadAppPluginSet(cwd, importModule) {
|
|
|
77
77
|
}
|
|
78
78
|
return await loadPluginSetFromModule(pluginModule, importModule);
|
|
79
79
|
}
|
|
80
|
-
//#endregion
|
|
81
80
|
export { loadPluginSetFromModule as n, resolvePluginModule as r, loadAppPluginSet as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PluginMcpConfig, PluginRegistration, PluginRuntimePostinstallCommand } from "@sentry/junior-plugin-api";
|
|
2
|
-
//#region src/chat/plugins/types.d.ts
|
|
3
2
|
interface PluginOAuthConfig {
|
|
4
3
|
clientIdEnv: string;
|
|
5
4
|
clientSecretEnv: string;
|
|
@@ -75,8 +74,6 @@ interface PluginManifestConfig {
|
|
|
75
74
|
commandFlags?: string[] | null;
|
|
76
75
|
} | null;
|
|
77
76
|
}
|
|
78
|
-
//#endregion
|
|
79
|
-
//#region src/plugins.d.ts
|
|
80
77
|
type JuniorPluginInput = PluginRegistration | string;
|
|
81
78
|
interface JuniorPluginSetOptions {
|
|
82
79
|
/** Install-level manifest overrides applied before validation. */
|
|
@@ -93,5 +90,4 @@ interface JuniorPluginSet {
|
|
|
93
90
|
}
|
|
94
91
|
/** Define package-name plugins and JS plugin definitions for one app. */
|
|
95
92
|
declare function defineJuniorPlugins(inputs: JuniorPluginInput[], options?: JuniorPluginSetOptions): JuniorPluginSet;
|
|
96
|
-
//#endregion
|
|
97
93
|
export { defineJuniorPlugins as i, JuniorPluginSet as n, JuniorPluginSetOptions as r, JuniorPluginInput as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
+
// src/plugins.ts
|
|
3
3
|
var plugins_exports = /* @__PURE__ */ __exportAll({
|
|
4
4
|
defineJuniorPlugins: () => defineJuniorPlugins,
|
|
5
5
|
pluginCatalogConfigFromEnv: () => pluginCatalogConfigFromEnv,
|
|
@@ -95,5 +95,4 @@ function pluginRuntimeRegistrationsFromPluginSet(pluginSet) {
|
|
|
95
95
|
function pluginCliRegistrationsFromPluginSet(pluginSet) {
|
|
96
96
|
return pluginSet?.registrations.filter((plugin) => plugin.cli) ?? [];
|
|
97
97
|
}
|
|
98
|
-
//#endregion
|
|
99
98
|
export { pluginRuntimeRegistrationsFromPluginSet as a, pluginCliRegistrationsFromPluginSet as i, pluginCatalogConfigFromEnv as n, plugins_exports as o, pluginCatalogConfigFromPluginSet as r, defineJuniorPlugins as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
|
|
2
|
+
// src/chat/tool-support/private-trace-result.ts
|
|
3
3
|
const PRIVATE_TRACE_RESULT_ATTRIBUTE = "gen_ai.tool.call.result.exposure";
|
|
4
4
|
const privateTraceResultToken = randomUUID();
|
|
5
5
|
/** Mark one tool result as an adapter-approved private trace projection. */
|
|
@@ -12,5 +12,4 @@ function consumePrivateTraceResultMarker(attributes) {
|
|
|
12
12
|
delete attributes[PRIVATE_TRACE_RESULT_ATTRIBUTE];
|
|
13
13
|
return projected;
|
|
14
14
|
}
|
|
15
|
-
//#endregion
|
|
16
15
|
export { privateTraceResultAttributes as n, consumePrivateTraceResultMarker as t };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { S as toOptionalTrimmed } from "./client-
|
|
2
|
-
import { b as setSpanStatus, y as setSpanAttributes } from "./logging-
|
|
3
|
-
import { i as getChatConfig } from "./config-
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
1
|
+
import { S as toOptionalTrimmed } from "./client-DbyHuMFU.js";
|
|
2
|
+
import { b as setSpanStatus, y as setSpanAttributes } from "./logging-DsHONhVm.js";
|
|
3
|
+
import { i as getChatConfig } from "./config-_WO_AjCB.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BN4DVxco.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { createMemoryState } from "@chat-adapter/state-memory";
|
|
7
7
|
import { createRedisState } from "@chat-adapter/state-redis";
|
|
8
8
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
9
|
-
|
|
9
|
+
// src/chat/sandbox/paths.ts
|
|
10
10
|
function normalizeWorkspaceRoot(input) {
|
|
11
11
|
const candidate = (input ?? "").trim();
|
|
12
12
|
if (!candidate) return "/vercel/sandbox";
|
|
@@ -28,8 +28,7 @@ function sandboxSkillPathResolution(skillName) {
|
|
|
28
28
|
const skillDir = sandboxSkillDir(skillName);
|
|
29
29
|
return `Resolve relative paths in this skill against ${skillDir}. For bash commands from this skill, cd to ${skillDir} first or use absolute paths.`;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
//#region src/chat/sleep.ts
|
|
31
|
+
// src/chat/sleep.ts
|
|
33
32
|
/** Wait for a duration, rejecting with the owning signal reason when cancelled. */
|
|
34
33
|
function sleep(ms, signal) {
|
|
35
34
|
if (!signal) return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -49,8 +48,7 @@ function sleep(ms, signal) {
|
|
|
49
48
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
50
49
|
});
|
|
51
50
|
}
|
|
52
|
-
|
|
53
|
-
//#region src/chat/state/locks.ts
|
|
51
|
+
// src/chat/state/locks.ts
|
|
54
52
|
const ACTIVE_LOCK_TTL_MS = 9e4;
|
|
55
53
|
const MUTATION_LOCK_TTL_MS = 1e4;
|
|
56
54
|
/**
|
|
@@ -98,8 +96,7 @@ async function withLock(state, key, run, options = {}) {
|
|
|
98
96
|
async function fenceLock(state, lock, ttlMs = MUTATION_LOCK_TTL_MS) {
|
|
99
97
|
if (!await state.extendLock(lock, ttlMs)) throw new Error(`Lock ownership was lost before write for ${lock.threadId}`);
|
|
100
98
|
}
|
|
101
|
-
|
|
102
|
-
//#region src/chat/state/adapter.ts
|
|
99
|
+
// src/chat/state/adapter.ts
|
|
103
100
|
const ACTIVE_LOCK_HEARTBEAT_MS = 3e4;
|
|
104
101
|
let stateAdapter;
|
|
105
102
|
let redisStateAdapter;
|
|
@@ -316,8 +313,7 @@ async function disconnectStateAdapter() {
|
|
|
316
313
|
redisStateAdapter = void 0;
|
|
317
314
|
}
|
|
318
315
|
}
|
|
319
|
-
|
|
320
|
-
//#region src/chat/sandbox/noninteractive-command.ts
|
|
316
|
+
// src/chat/sandbox/noninteractive-command.ts
|
|
321
317
|
const NON_INTERACTIVE_ENV = {
|
|
322
318
|
CI: "1",
|
|
323
319
|
TERM: "dumb",
|
|
@@ -382,8 +378,7 @@ async function runNonInteractiveCommand(sandbox, input) {
|
|
|
382
378
|
};
|
|
383
379
|
return await sandbox.runCommand(command);
|
|
384
380
|
}
|
|
385
|
-
|
|
386
|
-
//#region src/chat/sandbox/credentials.ts
|
|
381
|
+
// src/chat/sandbox/credentials.ts
|
|
387
382
|
/**
|
|
388
383
|
* Resolve explicit Vercel Sandbox credentials, or return undefined to let
|
|
389
384
|
* the SDK read ambient Vercel auth from its own environment detection.
|
|
@@ -398,8 +393,7 @@ function getVercelSandboxCredentials() {
|
|
|
398
393
|
projectId
|
|
399
394
|
};
|
|
400
395
|
}
|
|
401
|
-
|
|
402
|
-
//#region src/chat/sandbox/http-error-details.ts
|
|
396
|
+
// src/chat/sandbox/http-error-details.ts
|
|
403
397
|
const DEFAULT_PREVIEW_LIMIT = 512;
|
|
404
398
|
function toTrimmedString(value, maxChars) {
|
|
405
399
|
if (typeof value !== "string") return;
|
|
@@ -458,8 +452,7 @@ function extractHttpErrorDetails(error, options = {}) {
|
|
|
458
452
|
searchableText
|
|
459
453
|
};
|
|
460
454
|
}
|
|
461
|
-
|
|
462
|
-
//#region src/chat/sandbox/snapshot/not-ready-error.ts
|
|
455
|
+
// src/chat/sandbox/snapshot/not-ready-error.ts
|
|
463
456
|
/** Report that a Workspace snapshot is not ready to use. */
|
|
464
457
|
var WorkspaceSnapshotNotReadyError = class extends Error {
|
|
465
458
|
workspaceName;
|
|
@@ -487,8 +480,7 @@ function isWorkspaceSnapshotNotReadyError(error) {
|
|
|
487
480
|
function workspaceSnapshotNotReadyUserMessage(error) {
|
|
488
481
|
return `The ${error.workspaceName} workspace is still preparing its sandbox. Wait for that preparation to finish, then try again.`;
|
|
489
482
|
}
|
|
490
|
-
|
|
491
|
-
//#region src/chat/sandbox/errors.ts
|
|
483
|
+
// src/chat/sandbox/errors.ts
|
|
492
484
|
const SANDBOX_ERROR_FIELDS = [{
|
|
493
485
|
sourceKey: "sandboxId",
|
|
494
486
|
attributeKey: "sandbox_id",
|
|
@@ -617,8 +609,7 @@ function throwSandboxOperationError(action, error, includeMissingPath = false) {
|
|
|
617
609
|
setSpanStatus("error");
|
|
618
610
|
throw new Error(details.summary ? `${action} failed (${details.summary})` : `${action} failed`, { cause: error });
|
|
619
611
|
}
|
|
620
|
-
|
|
621
|
-
//#region src/chat/sandbox/docker.ts
|
|
612
|
+
// src/chat/sandbox/docker.ts
|
|
622
613
|
/** Docker daemon config for Vercel sandbox guests (nested containers). */
|
|
623
614
|
const DOCKER_DAEMON_JSON = `{
|
|
624
615
|
"storage-driver": "overlay2",
|
|
@@ -714,8 +705,7 @@ async function ensureDockerDaemon(sandbox, signal) {
|
|
|
714
705
|
signal
|
|
715
706
|
});
|
|
716
707
|
}
|
|
717
|
-
|
|
718
|
-
//#region src/chat/sandbox/runtime-dependencies.ts
|
|
708
|
+
// src/chat/sandbox/runtime-dependencies.ts
|
|
719
709
|
const GLOBAL_RUNTIME_DEPENDENCIES = [
|
|
720
710
|
{
|
|
721
711
|
type: "system",
|
|
@@ -762,8 +752,7 @@ const GLOBAL_RUNTIME_POSTINSTALL = [{
|
|
|
762
752
|
].join("\n")],
|
|
763
753
|
sudo: true
|
|
764
754
|
}];
|
|
765
|
-
|
|
766
|
-
//#region src/chat/sandbox/snapshot/profile.ts
|
|
755
|
+
// src/chat/sandbox/snapshot/profile.ts
|
|
767
756
|
const VERSION = 1;
|
|
768
757
|
const DEFAULT_FLOATING_MAX_AGE_MS = 6048e5;
|
|
769
758
|
function isExactNpmVersion(version) {
|
|
@@ -852,5 +841,4 @@ function isStale(profile, createdAtMs) {
|
|
|
852
841
|
const maxAgeMs = floatingMaxAgeMs();
|
|
853
842
|
return maxAgeMs === 0 || Date.now() - createdAtMs > maxAgeMs;
|
|
854
843
|
}
|
|
855
|
-
//#endregion
|
|
856
844
|
export { SANDBOX_DATA_ROOT as A, getDefaultRedisStateAdapterFor as C, fenceLock as D, acquireActiveLock as E, sandboxSkillFile as F, sandboxSkillPathResolution as I, SANDBOX_SKILLS_ROOT as M, SANDBOX_WORKSPACE_ROOT as N, withLock as O, sandboxSkillDir as P, disconnectStateAdapter as S, MUTATION_LOCK_TTL_MS as T, workspaceSnapshotNotReadyUserMessage as _, isAbortError as a, buildNonInteractiveShellScript as b, isSandboxCommandStreamInterruptedError as c, isSnapshottingError as d, throwSandboxOperationError as f, isWorkspaceSnapshotNotReadyError as g, getWorkspaceSnapshotNotReadyError as h, ensureDockerDaemon as i, SANDBOX_REPOS_ROOT as j, sleep as k, isSandboxMissingError as l, WorkspaceSnapshotNotReadyError as m, hash as n, isAlreadyExistsError as o, wrapSandboxSetupError as p, isStale as r, isSandboxApiTransientError as s, create as t, isSandboxUnavailableError as u, getVercelSandboxCredentials as v, getStateAdapter as w, runNonInteractiveCommand as x, buildCommandScript as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { H as conversationBriefSchema, U as parseBriefInput, V as briefOutcomeStatusSchema } from "./conversation-
|
|
1
|
+
import { H as conversationBriefSchema, U as parseBriefInput, V as briefOutcomeStatusSchema } from "./conversation-DjN3mlog.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
|
|
3
|
+
// src/chat/briefs/generate.ts
|
|
4
4
|
const MAX_INPUT_CHARS = 6e4;
|
|
5
5
|
const MAX_MESSAGE_TEXT_CHARS = 4e3;
|
|
6
6
|
const MAX_TOOL_TEXT_CHARS = 1500;
|
|
@@ -406,8 +406,7 @@ async function generateBrief(args) {
|
|
|
406
406
|
throughIndex: args.throughIndex
|
|
407
407
|
};
|
|
408
408
|
}
|
|
409
|
-
|
|
410
|
-
//#region src/chat/events/actor.ts
|
|
409
|
+
// src/chat/events/actor.ts
|
|
411
410
|
/**
|
|
412
411
|
* System author ID stamped on event mailbox messages.
|
|
413
412
|
*
|
|
@@ -439,8 +438,7 @@ const EVENT_SYSTEM_ACTOR = {
|
|
|
439
438
|
function isEventConversationMessage(message) {
|
|
440
439
|
return Boolean(message.meta?.eventType) || message.author?.userId === "UJRNEVENT";
|
|
441
440
|
}
|
|
442
|
-
|
|
443
|
-
//#region src/chat/briefs/event-entries.ts
|
|
441
|
+
// src/chat/briefs/event-entries.ts
|
|
444
442
|
const TOOL_TEXT_LIMIT = 1500;
|
|
445
443
|
function actorIdentityKey(actor) {
|
|
446
444
|
const slackUserId = actor?.slackUserId?.trim();
|
|
@@ -527,8 +525,7 @@ function briefEntriesFromReportEvents(events) {
|
|
|
527
525
|
}
|
|
528
526
|
return entries;
|
|
529
527
|
}
|
|
530
|
-
|
|
531
|
-
//#region src/chat/briefs/prompt.ts
|
|
528
|
+
// src/chat/briefs/prompt.ts
|
|
532
529
|
const BRIEF_PROMPT = `You write one durable Brief for a Junior Conversation.
|
|
533
530
|
|
|
534
531
|
Use only facts supported by the supplied entries, evidence, or previous Brief. Do not invent names, ids, numbers, outcomes, choices, owners, or links.
|
|
@@ -548,5 +545,4 @@ Rules:
|
|
|
548
545
|
- Cite a URL only when its exact full string occurs in an entry, evidence, or the previous Brief. Return cited URLs in urls. Core adds code changes and resources separately.
|
|
549
546
|
- Keep the summary under 600 characters, intent under 400 characters, outcome text under 600 characters, and each other string under 400 characters.
|
|
550
547
|
`;
|
|
551
|
-
//#endregion
|
|
552
548
|
export { EVENT_SYSTEM_ACTOR as a, EVENT_MESSAGE_AUTHOR as i, briefEntriesFromReportEvents as n, isEventConversationMessage as o, EVENT_AUTHOR_ID as r, generateBrief as s, BRIEF_PROMPT as t };
|