@sideboard-ai/core 0.1.83 → 0.1.84
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/agents/cursor-runner.cjs +88 -53
- package/dist/agents/cursor-runner.js +93 -56
- package/dist/{agents-3YPUZME7.js → agents-JFXM66QA.js} +7 -7
- package/dist/{agents-4KRD46KG.js → agents-OPTHS4IX.js} +5 -5
- package/dist/{app-settings-MQXL7OUF.js → app-settings-K6RFCRF6.js} +2 -2
- package/dist/{app-settings-GVSOIJLZ.js → app-settings-PEXK5VEX.js} +1 -1
- package/dist/{chunk-IZ7RPF54.js → chunk-5KLC2MWZ.js} +5 -1
- package/dist/{chunk-UHGN4KCL.js → chunk-AY53MPDE.js} +4 -0
- package/dist/{chunk-JMRJ4F5B.js → chunk-BBQ6HXKS.js} +52 -13
- package/dist/{chunk-SEOICVGB.js → chunk-CBJSPTBG.js} +30 -6
- package/dist/{chunk-HBBXS2FR.js → chunk-CKBIQ54F.js} +1 -1
- package/dist/{chunk-YO3CYL6B.js → chunk-I3FRXL7J.js} +1 -1
- package/dist/{chunk-E2MIA7DO.js → chunk-JPHG2KCC.js} +2 -2
- package/dist/{chunk-ERJS3ZDP.js → chunk-NW7MEJHO.js} +2 -2
- package/dist/{chunk-LVTNWH7B.js → chunk-ODZ2ZOA4.js} +2 -2
- package/dist/{chunk-NXXT5SE3.js → chunk-OIEFHOP7.js} +3 -3
- package/dist/{chunk-JW6YFPQE.js → chunk-R753UFSX.js} +24 -9
- package/dist/{chunk-RS54WYYH.js → chunk-UN3LVQB2.js} +2 -2
- package/dist/{chunk-DJFGX4RT.js → chunk-WJ5TINR6.js} +3 -3
- package/dist/{chunk-GD2FM6FN.js → chunk-XW47PL6A.js} +1 -1
- package/dist/{coordinator-prompt-6ICA54JR.js → coordinator-prompt-DOIOSLUN.js} +3 -3
- package/dist/{coordinator-prompt-46JE4NQR.js → coordinator-prompt-RCTIIZ6C.js} +4 -4
- package/dist/{global-workspace-OBRWUPZG.js → global-workspace-33BIG7KK.js} +4 -4
- package/dist/{global-workspace-GSLCEB5E.js → global-workspace-73OAKD3C.js} +5 -5
- package/dist/index.cjs +54 -12
- package/dist/index.js +23 -23
- package/dist/mcp/run-stdio.cjs +54 -12
- package/dist/mcp/run-stdio.js +20 -20
- package/dist/{workspaces-7B3PTEF4.js → workspaces-SRITISKA.js} +6 -6
- package/dist/{workspaces-RJIWQB6J.js → workspaces-WDLY34MX.js} +5 -5
- package/dist/{worktree-HSN5LWY6.js → worktree-SGZVAWOQ.js} +3 -3
- package/dist/{worktree-U3UIID2K.js → worktree-TUAO74SI.js} +2 -2
- package/package.json +1 -1
|
@@ -50,20 +50,38 @@ function pushTurnStderr(tail, line, maxLines = 12) {
|
|
|
50
50
|
tail.push(trimmed);
|
|
51
51
|
while (tail.length > maxLines) tail.shift();
|
|
52
52
|
}
|
|
53
|
+
function looksLikeMinifiedJsDump(line) {
|
|
54
|
+
if (line.length < 200) return false;
|
|
55
|
+
return /yield Promise\.all/.test(line) || /\(0,[A-Za-z$]\.\w+\)/.test(line) || /CURSOR_RIPGREP_PATH/.test(line);
|
|
56
|
+
}
|
|
57
|
+
function looksLikeNestedElectronCrash(line) {
|
|
58
|
+
return /HasCustomHostObject|ElectronInitializeICUandStartNode/i.test(line);
|
|
59
|
+
}
|
|
60
|
+
var NESTED_ELECTRON_SUMMARY = "Cursor local agent crashed at Electron startup (nested Chromium / HasCustomHostObject)";
|
|
61
|
+
var MINIFIED_DUMP_SUMMARY = "Cursor local agent crashed during startup (truncated crash dump)";
|
|
62
|
+
function clipStderr(text, maxChars) {
|
|
63
|
+
const trimmed = text.trim();
|
|
64
|
+
if (trimmed.length <= maxChars) return trimmed;
|
|
65
|
+
return trimmed.slice(0, maxChars);
|
|
66
|
+
}
|
|
53
67
|
function summarizeTurnStderr(tail, maxChars = 500) {
|
|
54
68
|
if (tail.length === 0) return "";
|
|
69
|
+
const cursorStartup = [...tail].reverse().find((line) => /cursor startup failed:/i.test(line));
|
|
70
|
+
if (cursorStartup) return clipStderr(cursorStartup, maxChars);
|
|
71
|
+
if (tail.some(looksLikeNestedElectronCrash)) return NESTED_ELECTRON_SUMMARY;
|
|
55
72
|
const moduleMissing = [...tail].reverse().find((line) => /cannot find module/i.test(line));
|
|
56
|
-
if (moduleMissing)
|
|
57
|
-
|
|
73
|
+
if (moduleMissing) return clipStderr(moduleMissing, maxChars);
|
|
74
|
+
const useful = tail.filter((line) => !looksLikeMinifiedJsDump(line));
|
|
75
|
+
if (useful.length === 0 && tail.some(looksLikeMinifiedJsDump)) {
|
|
76
|
+
return MINIFIED_DUMP_SUMMARY;
|
|
58
77
|
}
|
|
59
|
-
const joined = tail.slice(-6).join("\n").trim();
|
|
60
|
-
|
|
61
|
-
return joined.slice(joined.length - maxChars);
|
|
78
|
+
const joined = (useful.length ? useful : tail).slice(-6).join("\n").trim();
|
|
79
|
+
return clipStderr(joined, maxChars);
|
|
62
80
|
}
|
|
63
81
|
function looksLikeInvalidAgentSession(text) {
|
|
64
82
|
const lower = text.trim().toLowerCase();
|
|
65
83
|
if (!lower) return false;
|
|
66
|
-
return /session not found/.test(lower) || /no conversation found/.test(lower) || /conversation .+ not found/.test(lower) || /thread .+ not found/.test(lower) || /unknown session/.test(lower) || /invalid session/.test(lower) || /session .+ (missing|expired|deleted|gone)/.test(lower) || /cannot resume/.test(lower) || /failed to (load|resume|open) session/.test(lower);
|
|
84
|
+
return /session not found/.test(lower) || /no conversation found/.test(lower) || /conversation .+ not found/.test(lower) || /thread .+ not found/.test(lower) || /unknown session/.test(lower) || /invalid session/.test(lower) || /session .+ (missing|expired|deleted|gone)/.test(lower) || /cannot resume/.test(lower) || /failed to (load|resume|open) session/.test(lower) || /corrupt local agent checkpoint/.test(lower) || /missing root blob/.test(lower) || /\bagent\b.{0,120}\bnot found\b/.test(lower);
|
|
67
85
|
}
|
|
68
86
|
function looksLikeAgentFailureMessage(text) {
|
|
69
87
|
const lower = text.trim().toLowerCase();
|
|
@@ -103,6 +121,12 @@ function humanizeAgentFailDetail(detail) {
|
|
|
103
121
|
if (/context.*(too long|exceed)|prompt is too long|conversation too long/.test(lower)) {
|
|
104
122
|
return `${raw} \u2014 start a new chat or compact context, then retry.`;
|
|
105
123
|
}
|
|
124
|
+
if (/hascustomhostobject|electroninitializeicuandstartnode|nested chromium/i.test(lower)) {
|
|
125
|
+
return `${raw} \u2014 retry the turn; if it keeps failing, pick another agent.`;
|
|
126
|
+
}
|
|
127
|
+
if (/corrupt local agent checkpoint|missing root blob|truncated crash dump/.test(lower)) {
|
|
128
|
+
return `${raw} \u2014 retry the turn (Sideboard will start a fresh Cursor session).`;
|
|
129
|
+
}
|
|
106
130
|
return raw;
|
|
107
131
|
}
|
|
108
132
|
function formatTurnExitError(exitCode, stderrSummary) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isGlobalRepoPath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OIEFHOP7.js";
|
|
4
4
|
import {
|
|
5
5
|
ensureGhPreferOrigin,
|
|
6
6
|
resolveRepoRoot
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XW47PL6A.js";
|
|
8
8
|
import {
|
|
9
9
|
appDataDir
|
|
10
10
|
} from "./chunk-M37RITA6.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureGlobalCoordinatorCwd
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JPHG2KCC.js";
|
|
4
4
|
import {
|
|
5
5
|
allocateTeamName,
|
|
6
6
|
takenSlugsFromThread,
|
|
7
7
|
teamSlugFromName
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XW47PL6A.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveNewThreadOptions,
|
|
11
11
|
resolveThreadDefaults
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-I3FRXL7J.js";
|
|
13
13
|
import {
|
|
14
14
|
createEmptyThread,
|
|
15
15
|
listThreads,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isOrchestratorThread
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OIEFHOP7.js";
|
|
4
4
|
import {
|
|
5
5
|
applyConnectedTeamToCli,
|
|
6
6
|
brightsyMcpServerName,
|
|
@@ -13,16 +13,17 @@ import {
|
|
|
13
13
|
formatUnknownDetail,
|
|
14
14
|
looksLikeAgentFailureMessage,
|
|
15
15
|
parseCursorRunnerLine
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-CBJSPTBG.js";
|
|
17
17
|
import {
|
|
18
18
|
claudeChromeEnabled,
|
|
19
19
|
loadAppSettings,
|
|
20
20
|
resolveAgentExecutable,
|
|
21
21
|
resolveClaudeExecutable
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-I3FRXL7J.js";
|
|
23
23
|
import {
|
|
24
|
+
isStrippedElectronLaunch,
|
|
24
25
|
wrapElectronAsNodeLaunch
|
|
25
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-5KLC2MWZ.js";
|
|
26
27
|
import {
|
|
27
28
|
appDataDir
|
|
28
29
|
} from "./chunk-M37RITA6.js";
|
|
@@ -536,7 +537,12 @@ function applyNodeLaunch(launch, args) {
|
|
|
536
537
|
return { file: launch.file, args, env: launch.env };
|
|
537
538
|
}
|
|
538
539
|
const wrapped = wrapElectronAsNodeLaunch(launch.file, args);
|
|
539
|
-
|
|
540
|
+
if (process.platform === "win32") {
|
|
541
|
+
return { file: wrapped.file, args: wrapped.args, env: launch.env };
|
|
542
|
+
}
|
|
543
|
+
const env = { ...launch.env };
|
|
544
|
+
delete env.ELECTRON_RUN_AS_NODE;
|
|
545
|
+
return { file: wrapped.file, args: wrapped.args, env };
|
|
540
546
|
}
|
|
541
547
|
async function resolveNodeLaunch(scriptPath) {
|
|
542
548
|
if (isAsarPath(scriptPath)) {
|
|
@@ -752,10 +758,19 @@ async function buildInjectedMcpServers(opts) {
|
|
|
752
758
|
function toCursorMcpServers(servers) {
|
|
753
759
|
const out = {};
|
|
754
760
|
for (const s of servers) {
|
|
761
|
+
const env = s.env ? { ...s.env } : void 0;
|
|
762
|
+
if (env) delete env.ELECTRON_RUN_AS_NODE;
|
|
763
|
+
let command = s.command;
|
|
764
|
+
let args = s.args;
|
|
765
|
+
if (process.platform !== "win32" && !isStrippedElectronLaunch(command, args)) {
|
|
766
|
+
const wrapped = wrapElectronAsNodeLaunch(command, args ?? []);
|
|
767
|
+
command = wrapped.file;
|
|
768
|
+
args = wrapped.args;
|
|
769
|
+
}
|
|
755
770
|
out[s.name] = {
|
|
756
|
-
command
|
|
757
|
-
...
|
|
758
|
-
...
|
|
771
|
+
command,
|
|
772
|
+
...args && args.length > 0 ? { args } : {},
|
|
773
|
+
...env && Object.keys(env).length > 0 ? { env } : {}
|
|
759
774
|
};
|
|
760
775
|
}
|
|
761
776
|
return out;
|
|
@@ -1002,7 +1017,7 @@ var claudeAdapter = {
|
|
|
1002
1017
|
);
|
|
1003
1018
|
}
|
|
1004
1019
|
const mode = permissionMode(thread);
|
|
1005
|
-
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-
|
|
1020
|
+
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-73OAKD3C.js");
|
|
1006
1021
|
const isOrchestrator = isOrchestratorThread2(thread);
|
|
1007
1022
|
const injectedServers = await buildInjectedMcpServers({
|
|
1008
1023
|
includeSideboard: true,
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
isGlobalRepoPath
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WJ5TINR6.js";
|
|
6
6
|
import {
|
|
7
7
|
ensureGhPreferOrigin,
|
|
8
8
|
resolveRepoRoot
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CKBIQ54F.js";
|
|
10
10
|
import {
|
|
11
11
|
appDataDir
|
|
12
12
|
} from "./chunk-7MV3RXSC.js";
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
ensureGlobalCoordinatorCwd
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-NW7MEJHO.js";
|
|
6
6
|
import {
|
|
7
7
|
allocateTeamName,
|
|
8
8
|
takenSlugsFromThread,
|
|
9
9
|
teamSlugFromName
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CKBIQ54F.js";
|
|
11
11
|
import {
|
|
12
12
|
createEmptyThread,
|
|
13
13
|
listThreads,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
resolveNewThreadOptions,
|
|
19
19
|
resolveThreadDefaults
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-AY53MPDE.js";
|
|
21
21
|
import {
|
|
22
22
|
globalAgentCwd
|
|
23
23
|
} from "./chunk-7MV3RXSC.js";
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
enrichWorkspacesWithGithub,
|
|
10
10
|
ensureGlobalCoordinatorCwd,
|
|
11
11
|
formatWorkspaceInventory
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-NW7MEJHO.js";
|
|
13
|
+
import "./chunk-CKBIQ54F.js";
|
|
14
14
|
import "./chunk-B3SJXYIJ.js";
|
|
15
15
|
import "./chunk-7FD7COKE.js";
|
|
16
16
|
import "./chunk-AE5VBOFE.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-AY53MPDE.js";
|
|
18
18
|
import "./chunk-NSTQ6QKD.js";
|
|
19
19
|
import "./chunk-KGZBYWZ3.js";
|
|
20
20
|
import "./chunk-7MV3RXSC.js";
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
enrichWorkspacesWithGithub,
|
|
8
8
|
ensureGlobalCoordinatorCwd,
|
|
9
9
|
formatWorkspaceInventory
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-JPHG2KCC.js";
|
|
11
|
+
import "./chunk-XW47PL6A.js";
|
|
12
12
|
import "./chunk-FKOIHGKV.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-I3FRXL7J.js";
|
|
14
|
+
import "./chunk-5KLC2MWZ.js";
|
|
15
15
|
import "./chunk-JT7R45JB.js";
|
|
16
16
|
import "./chunk-FWJYLBO6.js";
|
|
17
17
|
import "./chunk-77WWLBCI.js";
|
|
@@ -16,13 +16,13 @@ import {
|
|
|
16
16
|
orchestratorSessionPoisonedByBuiltins,
|
|
17
17
|
slackCoordinatorSourceRef,
|
|
18
18
|
takenTeamSlugsForOrchestration
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-WJ5TINR6.js";
|
|
20
|
+
import "./chunk-NW7MEJHO.js";
|
|
21
|
+
import "./chunk-CKBIQ54F.js";
|
|
22
22
|
import "./chunk-B3SJXYIJ.js";
|
|
23
23
|
import "./chunk-7FD7COKE.js";
|
|
24
24
|
import "./chunk-AE5VBOFE.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-AY53MPDE.js";
|
|
26
26
|
import "./chunk-NSTQ6QKD.js";
|
|
27
27
|
import "./chunk-KGZBYWZ3.js";
|
|
28
28
|
import {
|
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
orchestratorSessionPoisonedByBuiltins,
|
|
15
15
|
slackCoordinatorSourceRef,
|
|
16
16
|
takenTeamSlugsForOrchestration
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-OIEFHOP7.js";
|
|
18
|
+
import "./chunk-JPHG2KCC.js";
|
|
19
|
+
import "./chunk-XW47PL6A.js";
|
|
20
20
|
import "./chunk-FKOIHGKV.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-I3FRXL7J.js";
|
|
22
|
+
import "./chunk-5KLC2MWZ.js";
|
|
23
23
|
import "./chunk-JT7R45JB.js";
|
|
24
24
|
import "./chunk-FWJYLBO6.js";
|
|
25
25
|
import "./chunk-77WWLBCI.js";
|
package/dist/index.cjs
CHANGED
|
@@ -403,6 +403,9 @@ function wrapElectronAsNodeLaunch(file, args) {
|
|
|
403
403
|
args: ["-c", STRIP_NESTED_ELECTRON_THEN_EXEC, "sh", file, ...args]
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
|
+
function isStrippedElectronLaunch(command, args) {
|
|
407
|
+
return command === "/bin/sh" && Boolean(args?.[1]?.includes("ELECTRON_RUN_AS_NODE") && args[1].includes("unset"));
|
|
408
|
+
}
|
|
406
409
|
var NESTED_ELECTRON_ENV_PREFIXES, STRIP_NESTED_ELECTRON_THEN_EXEC;
|
|
407
410
|
var init_nested_electron_env = __esm({
|
|
408
411
|
"src/hook/nested-electron-env.ts"() {
|
|
@@ -5688,20 +5691,36 @@ function pushTurnStderr(tail, line, maxLines = 12) {
|
|
|
5688
5691
|
tail.push(trimmed);
|
|
5689
5692
|
while (tail.length > maxLines) tail.shift();
|
|
5690
5693
|
}
|
|
5694
|
+
function looksLikeMinifiedJsDump(line) {
|
|
5695
|
+
if (line.length < 200) return false;
|
|
5696
|
+
return /yield Promise\.all/.test(line) || /\(0,[A-Za-z$]\.\w+\)/.test(line) || /CURSOR_RIPGREP_PATH/.test(line);
|
|
5697
|
+
}
|
|
5698
|
+
function looksLikeNestedElectronCrash(line) {
|
|
5699
|
+
return /HasCustomHostObject|ElectronInitializeICUandStartNode/i.test(line);
|
|
5700
|
+
}
|
|
5701
|
+
function clipStderr(text3, maxChars) {
|
|
5702
|
+
const trimmed = text3.trim();
|
|
5703
|
+
if (trimmed.length <= maxChars) return trimmed;
|
|
5704
|
+
return trimmed.slice(0, maxChars);
|
|
5705
|
+
}
|
|
5691
5706
|
function summarizeTurnStderr(tail, maxChars = 500) {
|
|
5692
5707
|
if (tail.length === 0) return "";
|
|
5708
|
+
const cursorStartup = [...tail].reverse().find((line) => /cursor startup failed:/i.test(line));
|
|
5709
|
+
if (cursorStartup) return clipStderr(cursorStartup, maxChars);
|
|
5710
|
+
if (tail.some(looksLikeNestedElectronCrash)) return NESTED_ELECTRON_SUMMARY;
|
|
5693
5711
|
const moduleMissing = [...tail].reverse().find((line) => /cannot find module/i.test(line));
|
|
5694
|
-
if (moduleMissing)
|
|
5695
|
-
|
|
5712
|
+
if (moduleMissing) return clipStderr(moduleMissing, maxChars);
|
|
5713
|
+
const useful = tail.filter((line) => !looksLikeMinifiedJsDump(line));
|
|
5714
|
+
if (useful.length === 0 && tail.some(looksLikeMinifiedJsDump)) {
|
|
5715
|
+
return MINIFIED_DUMP_SUMMARY;
|
|
5696
5716
|
}
|
|
5697
|
-
const joined = tail.slice(-6).join("\n").trim();
|
|
5698
|
-
|
|
5699
|
-
return joined.slice(joined.length - maxChars);
|
|
5717
|
+
const joined = (useful.length ? useful : tail).slice(-6).join("\n").trim();
|
|
5718
|
+
return clipStderr(joined, maxChars);
|
|
5700
5719
|
}
|
|
5701
5720
|
function looksLikeInvalidAgentSession(text3) {
|
|
5702
5721
|
const lower = text3.trim().toLowerCase();
|
|
5703
5722
|
if (!lower) return false;
|
|
5704
|
-
return /session not found/.test(lower) || /no conversation found/.test(lower) || /conversation .+ not found/.test(lower) || /thread .+ not found/.test(lower) || /unknown session/.test(lower) || /invalid session/.test(lower) || /session .+ (missing|expired|deleted|gone)/.test(lower) || /cannot resume/.test(lower) || /failed to (load|resume|open) session/.test(lower);
|
|
5723
|
+
return /session not found/.test(lower) || /no conversation found/.test(lower) || /conversation .+ not found/.test(lower) || /thread .+ not found/.test(lower) || /unknown session/.test(lower) || /invalid session/.test(lower) || /session .+ (missing|expired|deleted|gone)/.test(lower) || /cannot resume/.test(lower) || /failed to (load|resume|open) session/.test(lower) || /corrupt local agent checkpoint/.test(lower) || /missing root blob/.test(lower) || /\bagent\b.{0,120}\bnot found\b/.test(lower);
|
|
5705
5724
|
}
|
|
5706
5725
|
function looksLikeAgentFailureMessage(text3) {
|
|
5707
5726
|
const lower = text3.trim().toLowerCase();
|
|
@@ -5741,6 +5760,12 @@ function humanizeAgentFailDetail(detail) {
|
|
|
5741
5760
|
if (/context.*(too long|exceed)|prompt is too long|conversation too long/.test(lower)) {
|
|
5742
5761
|
return `${raw} \u2014 start a new chat or compact context, then retry.`;
|
|
5743
5762
|
}
|
|
5763
|
+
if (/hascustomhostobject|electroninitializeicuandstartnode|nested chromium/i.test(lower)) {
|
|
5764
|
+
return `${raw} \u2014 retry the turn; if it keeps failing, pick another agent.`;
|
|
5765
|
+
}
|
|
5766
|
+
if (/corrupt local agent checkpoint|missing root blob|truncated crash dump/.test(lower)) {
|
|
5767
|
+
return `${raw} \u2014 retry the turn (Sideboard will start a fresh Cursor session).`;
|
|
5768
|
+
}
|
|
5744
5769
|
return raw;
|
|
5745
5770
|
}
|
|
5746
5771
|
function formatTurnExitError(exitCode, stderrSummary) {
|
|
@@ -5756,11 +5781,13 @@ function formatTurnExitError(exitCode, stderrSummary) {
|
|
|
5756
5781
|
if (looksLikeAgentFailureMessage(raw)) return detail;
|
|
5757
5782
|
return `exit ${code}: ${detail}`;
|
|
5758
5783
|
}
|
|
5759
|
-
var NODE_VERSION_FOOTER;
|
|
5784
|
+
var NODE_VERSION_FOOTER, NESTED_ELECTRON_SUMMARY, MINIFIED_DUMP_SUMMARY;
|
|
5760
5785
|
var init_error_detail = __esm({
|
|
5761
5786
|
"src/agents/error-detail.ts"() {
|
|
5762
5787
|
"use strict";
|
|
5763
5788
|
NODE_VERSION_FOOTER = /^Node\.js v\d+/i;
|
|
5789
|
+
NESTED_ELECTRON_SUMMARY = "Cursor local agent crashed at Electron startup (nested Chromium / HasCustomHostObject)";
|
|
5790
|
+
MINIFIED_DUMP_SUMMARY = "Cursor local agent crashed during startup (truncated crash dump)";
|
|
5764
5791
|
}
|
|
5765
5792
|
});
|
|
5766
5793
|
|
|
@@ -6209,7 +6236,12 @@ function applyNodeLaunch(launch, args) {
|
|
|
6209
6236
|
return { file: launch.file, args, env: launch.env };
|
|
6210
6237
|
}
|
|
6211
6238
|
const wrapped = wrapElectronAsNodeLaunch(launch.file, args);
|
|
6212
|
-
|
|
6239
|
+
if (process.platform === "win32") {
|
|
6240
|
+
return { file: wrapped.file, args: wrapped.args, env: launch.env };
|
|
6241
|
+
}
|
|
6242
|
+
const env = { ...launch.env };
|
|
6243
|
+
delete env.ELECTRON_RUN_AS_NODE;
|
|
6244
|
+
return { file: wrapped.file, args: wrapped.args, env };
|
|
6213
6245
|
}
|
|
6214
6246
|
async function resolveNodeLaunch(scriptPath) {
|
|
6215
6247
|
if (isAsarPath(scriptPath)) {
|
|
@@ -6408,10 +6440,19 @@ async function buildInjectedMcpServers(opts) {
|
|
|
6408
6440
|
function toCursorMcpServers(servers) {
|
|
6409
6441
|
const out = {};
|
|
6410
6442
|
for (const s of servers) {
|
|
6443
|
+
const env = s.env ? { ...s.env } : void 0;
|
|
6444
|
+
if (env) delete env.ELECTRON_RUN_AS_NODE;
|
|
6445
|
+
let command = s.command;
|
|
6446
|
+
let args = s.args;
|
|
6447
|
+
if (process.platform !== "win32" && !isStrippedElectronLaunch(command, args)) {
|
|
6448
|
+
const wrapped = wrapElectronAsNodeLaunch(command, args ?? []);
|
|
6449
|
+
command = wrapped.file;
|
|
6450
|
+
args = wrapped.args;
|
|
6451
|
+
}
|
|
6411
6452
|
out[s.name] = {
|
|
6412
|
-
command
|
|
6413
|
-
...
|
|
6414
|
-
...
|
|
6453
|
+
command,
|
|
6454
|
+
...args && args.length > 0 ? { args } : {},
|
|
6455
|
+
...env && Object.keys(env).length > 0 ? { env } : {}
|
|
6415
6456
|
};
|
|
6416
6457
|
}
|
|
6417
6458
|
return out;
|
|
@@ -6481,6 +6522,7 @@ var init_injected_mcp = __esm({
|
|
|
6481
6522
|
init_app_settings();
|
|
6482
6523
|
init_paths();
|
|
6483
6524
|
init_node_launch();
|
|
6525
|
+
init_nested_electron_env();
|
|
6484
6526
|
import_meta = {};
|
|
6485
6527
|
SIDEBOARD_MCP_ALLOWED_TOOLS = [
|
|
6486
6528
|
"mcp__sideboard",
|
|
@@ -15322,7 +15364,7 @@ var Orchestrator = class {
|
|
|
15322
15364
|
}
|
|
15323
15365
|
let lastStderr = summarizeTurnStderr(stderrTail);
|
|
15324
15366
|
let detail = lastStderr || (exitCode !== 0 ? fallbackTurnFailDetail(assistantText) : "");
|
|
15325
|
-
if (exitCode !== 0 && !assistantText && parts.length === 0 && !this.stoppedTurns.has(threadId) && looksLikeInvalidAgentSession(detail) && this.requireThread(threadId).sessionId && this.requireThread(threadId).agent !== "
|
|
15367
|
+
if (exitCode !== 0 && !assistantText && parts.length === 0 && !this.stoppedTurns.has(threadId) && looksLikeInvalidAgentSession(detail) && this.requireThread(threadId).sessionId && this.requireThread(threadId).agent !== "brightsy") {
|
|
15326
15368
|
updateThread(threadId, { sessionId: null });
|
|
15327
15369
|
pushTurnStderr(
|
|
15328
15370
|
stderrTail,
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
listWorkspaces,
|
|
5
5
|
removeWorkspace,
|
|
6
6
|
syncWorkspacesFromThreads
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ODZ2ZOA4.js";
|
|
8
8
|
import {
|
|
9
9
|
BRIGHTSY_MCP_ALLOWED_TOOLS,
|
|
10
10
|
CLAUDE_MODEL_CATALOG,
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
threadRequestsBrightsyMcp,
|
|
65
65
|
totalTokens,
|
|
66
66
|
writeInjectedMcpConfig
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-R753UFSX.js";
|
|
68
68
|
import {
|
|
69
69
|
CLOUD_COORDINATOR_BUSY_REPLY,
|
|
70
70
|
CLOUD_COORDINATOR_STOPPED_REPLY,
|
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
parseForceStopMessage,
|
|
92
92
|
slackCoordinatorSourceRef,
|
|
93
93
|
takenTeamSlugsForOrchestration
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-OIEFHOP7.js";
|
|
95
95
|
import {
|
|
96
96
|
COORDINATOR_TOOL_PLAYBOOK,
|
|
97
97
|
SLACK_REPLY_FORMATTING,
|
|
@@ -100,7 +100,7 @@ import {
|
|
|
100
100
|
enrichWorkspacesWithGithub,
|
|
101
101
|
ensureGlobalCoordinatorCwd,
|
|
102
102
|
formatWorkspaceInventory
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-JPHG2KCC.js";
|
|
104
104
|
import {
|
|
105
105
|
brightsyConfigPath,
|
|
106
106
|
brightsyMcpServerName,
|
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
parseCursorRunnerLine,
|
|
135
135
|
pushTurnStderr,
|
|
136
136
|
summarizeTurnStderr
|
|
137
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-CBJSPTBG.js";
|
|
138
138
|
import {
|
|
139
139
|
caffeinateHoldPath,
|
|
140
140
|
getCaffeinateHold,
|
|
@@ -210,7 +210,7 @@ import {
|
|
|
210
210
|
worktreeDisplayLabel,
|
|
211
211
|
worktreeDisplayLabelForGroup,
|
|
212
212
|
worktreeNameFromPath
|
|
213
|
-
} from "./chunk-
|
|
213
|
+
} from "./chunk-XW47PL6A.js";
|
|
214
214
|
import {
|
|
215
215
|
ATTACHMENTS_DIR,
|
|
216
216
|
LEGACY_ATTACHMENTS_DIR,
|
|
@@ -279,10 +279,10 @@ import {
|
|
|
279
279
|
updateIntegrationsSettings,
|
|
280
280
|
updateOpencodeSettings,
|
|
281
281
|
writeSecureJson
|
|
282
|
-
} from "./chunk-
|
|
282
|
+
} from "./chunk-I3FRXL7J.js";
|
|
283
283
|
import {
|
|
284
284
|
stripNestedElectronEnv
|
|
285
|
-
} from "./chunk-
|
|
285
|
+
} from "./chunk-5KLC2MWZ.js";
|
|
286
286
|
import {
|
|
287
287
|
writePrivateFile
|
|
288
288
|
} from "./chunk-JT7R45JB.js";
|
|
@@ -1316,9 +1316,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
1316
1316
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
1317
1317
|
);
|
|
1318
1318
|
}
|
|
1319
|
-
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-
|
|
1319
|
+
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-73OAKD3C.js");
|
|
1320
1320
|
if (isGlobalThread2(thread)) {
|
|
1321
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-
|
|
1321
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-RCTIIZ6C.js");
|
|
1322
1322
|
ensureGlobalCoordinatorCwd2(
|
|
1323
1323
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
1324
1324
|
);
|
|
@@ -3833,7 +3833,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
3833
3833
|
return readThread(thread.id) ?? thread;
|
|
3834
3834
|
}
|
|
3835
3835
|
async function listLinearIssues(agent, repoPath) {
|
|
3836
|
-
const { getAdapter: getAdapter2 } = await import("./agents-
|
|
3836
|
+
const { getAdapter: getAdapter2 } = await import("./agents-JFXM66QA.js");
|
|
3837
3837
|
await requireAgent(agent, { requireLinear: true });
|
|
3838
3838
|
const adapter = getAdapter2(agent);
|
|
3839
3839
|
if (!adapter.listLinearIssues) {
|
|
@@ -4376,7 +4376,7 @@ async function adoptThread(input) {
|
|
|
4376
4376
|
messages: input.messages ?? []
|
|
4377
4377
|
});
|
|
4378
4378
|
writeThread(thread);
|
|
4379
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
4379
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-SRITISKA.js");
|
|
4380
4380
|
await ensureWorkspace2(repoPath);
|
|
4381
4381
|
return thread;
|
|
4382
4382
|
}
|
|
@@ -5897,7 +5897,7 @@ var Orchestrator = class {
|
|
|
5897
5897
|
orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
|
|
5898
5898
|
});
|
|
5899
5899
|
}
|
|
5900
|
-
const { autoCleanupOrphansEnabled: autoCleanupOrphansEnabled2 } = await import("./app-settings-
|
|
5900
|
+
const { autoCleanupOrphansEnabled: autoCleanupOrphansEnabled2 } = await import("./app-settings-K6RFCRF6.js");
|
|
5901
5901
|
if (autoCleanupOrphansEnabled2() && shouldRunWorktreeCleanup() && orphans.length > 0) {
|
|
5902
5902
|
await cleanupOrphanWorktrees({ repoPaths });
|
|
5903
5903
|
}
|
|
@@ -6054,7 +6054,7 @@ var Orchestrator = class {
|
|
|
6054
6054
|
}
|
|
6055
6055
|
async finishCreateThread(threadId, prompt) {
|
|
6056
6056
|
await this.runSetupAfterCreate(threadId);
|
|
6057
|
-
const { autoRunAfterSetupEnabled: autoRunAfterSetupEnabled2 } = await import("./app-settings-
|
|
6057
|
+
const { autoRunAfterSetupEnabled: autoRunAfterSetupEnabled2 } = await import("./app-settings-K6RFCRF6.js");
|
|
6058
6058
|
if (autoRunAfterSetupEnabled2()) {
|
|
6059
6059
|
try {
|
|
6060
6060
|
await this.startDev(threadId);
|
|
@@ -6325,7 +6325,7 @@ var Orchestrator = class {
|
|
|
6325
6325
|
}
|
|
6326
6326
|
const isBrightsy = fresh.agent === "brightsy";
|
|
6327
6327
|
const isOrchestration = isOrchestratorThread(fresh);
|
|
6328
|
-
const { autoRenameBranchEnabled: autoRenameBranchEnabled2, getGithubGitAuthMode: getGithubGitAuthMode2 } = await import("./app-settings-
|
|
6328
|
+
const { autoRenameBranchEnabled: autoRenameBranchEnabled2, getGithubGitAuthMode: getGithubGitAuthMode2 } = await import("./app-settings-K6RFCRF6.js");
|
|
6329
6329
|
const gitAuthMode = getGithubGitAuthMode2();
|
|
6330
6330
|
const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
|
|
6331
6331
|
githubSlug: await resolveGithubRepoSlug(fresh.worktreePath).catch(
|
|
@@ -6435,7 +6435,7 @@ var Orchestrator = class {
|
|
|
6435
6435
|
}
|
|
6436
6436
|
let lastStderr = summarizeTurnStderr(stderrTail);
|
|
6437
6437
|
let detail = lastStderr || (exitCode !== 0 ? fallbackTurnFailDetail(assistantText) : "");
|
|
6438
|
-
if (exitCode !== 0 && !assistantText && parts.length === 0 && !this.stoppedTurns.has(threadId) && looksLikeInvalidAgentSession(detail) && this.requireThread(threadId).sessionId && this.requireThread(threadId).agent !== "
|
|
6438
|
+
if (exitCode !== 0 && !assistantText && parts.length === 0 && !this.stoppedTurns.has(threadId) && looksLikeInvalidAgentSession(detail) && this.requireThread(threadId).sessionId && this.requireThread(threadId).agent !== "brightsy") {
|
|
6439
6439
|
updateThread(threadId, { sessionId: null });
|
|
6440
6440
|
pushTurnStderr(
|
|
6441
6441
|
stderrTail,
|
|
@@ -7042,7 +7042,7 @@ var Orchestrator = class {
|
|
|
7042
7042
|
updateThread(thread.id, { title: meta.title });
|
|
7043
7043
|
}
|
|
7044
7044
|
}
|
|
7045
|
-
const { autoArchiveOnMergeEnabled: autoArchiveOnMergeEnabled2 } = await import("./app-settings-
|
|
7045
|
+
const { autoArchiveOnMergeEnabled: autoArchiveOnMergeEnabled2 } = await import("./app-settings-K6RFCRF6.js");
|
|
7046
7046
|
const latest = this.requireThread(thread.id);
|
|
7047
7047
|
if (!shouldAutoArchiveOnPrMerge({
|
|
7048
7048
|
previousPrState: prevState || null,
|
|
@@ -7330,7 +7330,7 @@ var Orchestrator = class {
|
|
|
7330
7330
|
this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
|
|
7331
7331
|
if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
|
|
7332
7332
|
try {
|
|
7333
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
7333
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-SRITISKA.js");
|
|
7334
7334
|
await ensureWorkspace2(thread.repoPath);
|
|
7335
7335
|
} catch {
|
|
7336
7336
|
}
|
|
@@ -7352,7 +7352,7 @@ var Orchestrator = class {
|
|
|
7352
7352
|
await runArchiveScript(thread.repoPath, thread.worktreePath);
|
|
7353
7353
|
} catch {
|
|
7354
7354
|
}
|
|
7355
|
-
const { deleteBranchOnPurgeEnabled: deleteBranchOnPurgeEnabled2 } = await import("./app-settings-
|
|
7355
|
+
const { deleteBranchOnPurgeEnabled: deleteBranchOnPurgeEnabled2 } = await import("./app-settings-K6RFCRF6.js");
|
|
7356
7356
|
const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled2();
|
|
7357
7357
|
await removeWorktree(thread.repoPath, thread.worktreePath, {
|
|
7358
7358
|
deleteBranch: deleteBranch ? thread.branchName : void 0
|
|
@@ -7373,7 +7373,7 @@ var Orchestrator = class {
|
|
|
7373
7373
|
return restored2;
|
|
7374
7374
|
}
|
|
7375
7375
|
if (!existsSync15(thread.worktreePath)) {
|
|
7376
|
-
const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-
|
|
7376
|
+
const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-SGZVAWOQ.js");
|
|
7377
7377
|
const { execa: execa6 } = await import("execa");
|
|
7378
7378
|
const slug = thread.worktreePath.split("/").pop();
|
|
7379
7379
|
const dest = thread.worktreePath;
|
|
@@ -7482,7 +7482,7 @@ async function startOrchestration(opts) {
|
|
|
7482
7482
|
sourceRef: "default",
|
|
7483
7483
|
...createOpts
|
|
7484
7484
|
}).catch(async () => {
|
|
7485
|
-
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-
|
|
7485
|
+
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-SGZVAWOQ.js");
|
|
7486
7486
|
const repo = await resolveRepoRoot2(repoPath);
|
|
7487
7487
|
const def = await resolveDefaultBranch2(repo);
|
|
7488
7488
|
return createThread({
|
|
@@ -8234,7 +8234,7 @@ function withTimeout(promise, ms, label) {
|
|
|
8234
8234
|
async function startMcpServer() {
|
|
8235
8235
|
const orch = getOrchestrator();
|
|
8236
8236
|
try {
|
|
8237
|
-
const { maxConcurrentAgents: maxConcurrentAgents2 } = await import("./app-settings-
|
|
8237
|
+
const { maxConcurrentAgents: maxConcurrentAgents2 } = await import("./app-settings-K6RFCRF6.js");
|
|
8238
8238
|
orch.setMaxConcurrent(maxConcurrentAgents2());
|
|
8239
8239
|
} catch {
|
|
8240
8240
|
}
|
|
@@ -8444,7 +8444,7 @@ async function startMcpServer() {
|
|
|
8444
8444
|
registerLinearTools(server);
|
|
8445
8445
|
if (sideboardMcpProfile() !== "worktree") {
|
|
8446
8446
|
const { getCaffeinateHold: getCaffeinateHold2, setCaffeinateHold: setCaffeinateHold2 } = await import("./caffeinate-hold-EAZNWJBE.js");
|
|
8447
|
-
const { resolveNewThreadOptions: resolveNewThreadOptions2, resolveThreadDefaults: resolveThreadDefaults2 } = await import("./app-settings-
|
|
8447
|
+
const { resolveNewThreadOptions: resolveNewThreadOptions2, resolveThreadDefaults: resolveThreadDefaults2 } = await import("./app-settings-K6RFCRF6.js");
|
|
8448
8448
|
const accountDefaults = resolveThreadDefaults2();
|
|
8449
8449
|
const accountDefaultsHint = `Account defaults: agent=${accountDefaults.agent}, model=${accountDefaults.model?.trim() || "Auto"}, effort=${accountDefaults.effort}`;
|
|
8450
8450
|
server.tool(
|