@sideboard-ai/core 0.1.115 → 0.1.117
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 +96 -60
- package/dist/agents/cursor-runner.js +10 -9
- package/dist/{agents-3X3EFCQY.js → agents-GUEKGV7V.js} +6 -6
- package/dist/{agents-AHAFC6FR.js → agents-OCGAZCKT.js} +5 -5
- package/dist/{chunk-66XTXHR3.js → chunk-4CDCTYTM.js} +61 -11
- package/dist/{chunk-XOYQ7LNQ.js → chunk-4NAW5BAQ.js} +3 -3
- package/dist/{chunk-4OJMZ6P2.js → chunk-4WV7C7WP.js} +3 -3
- package/dist/{chunk-DCNR7NAL.js → chunk-5X7GRP5W.js} +49 -24
- package/dist/{chunk-MZ6HJ7VL.js → chunk-74YJHND6.js} +48 -23
- package/dist/{chunk-ZRCX43LS.js → chunk-BKVDZV7X.js} +2 -2
- package/dist/{chunk-A4VZXJEJ.js → chunk-HPAWHIZ3.js} +4 -1
- package/dist/{chunk-SLU5JVKD.js → chunk-NZBDVBCP.js} +23 -2
- package/dist/{chunk-KYOTBZ6S.js → chunk-RG737OWT.js} +4 -1
- package/dist/{chunk-K3TIQXOH.js → chunk-U3IVCVLH.js} +2 -2
- package/dist/{chunk-FZCIQYNQ.js → chunk-VGPLXQIH.js} +1 -1
- package/dist/chunk-VHX673DI.js +32 -0
- package/dist/{chunk-ZMROW673.js → chunk-WCU3FHEI.js} +1 -1
- package/dist/{chunk-7WC5UWEB.js → chunk-X3NIPGQT.js} +1 -1
- package/dist/{chunk-ZYEFCSZJ.js → chunk-XTZQL7OU.js} +1 -1
- package/dist/{chunk-C6OBY6IC.js → chunk-YJ2WV5TZ.js} +54 -10
- package/dist/{coordinator-prompt-4KCALEKD.js → coordinator-prompt-QMV6YEP5.js} +3 -3
- package/dist/{coordinator-prompt-FML4I5AR.js → coordinator-prompt-XCBHAOGE.js} +3 -3
- package/dist/cursor-recover-NOQYOFRF.js +76 -0
- package/dist/{cursor-recover-JBTIDARH.js → cursor-recover-QSLWEZNA.js} +12 -7
- package/dist/{global-workspace-CSWABOG5.js → global-workspace-SBKXKQFS.js} +4 -4
- package/dist/{global-workspace-H4YNASM6.js → global-workspace-Z37MNYU6.js} +4 -4
- package/dist/index.cjs +369 -240
- package/dist/index.d.cts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +14 -10
- package/dist/mcp/run-stdio.cjs +359 -237
- package/dist/mcp/run-stdio.js +9 -9
- package/dist/{orchestrator-GKLYKLRC.js → orchestrator-4PKR6AZJ.js} +7 -7
- package/dist/{orchestrator-TXASYNHT.js → orchestrator-MKTZYWTI.js} +8 -8
- package/dist/{thread-store-OEALWU7Y.js → thread-store-JR235AWK.js} +3 -1
- package/dist/{thread-store-LPTBVW5C.js → thread-store-PMH3BMB6.js} +3 -1
- package/dist/{workspaces-HJ3EVATC.js → workspaces-C3TJJFY3.js} +5 -5
- package/dist/{workspaces-QG6PGFQR.js → workspaces-M4OICPWF.js} +5 -5
- package/dist/{worktree-IW3BX26B.js → worktree-7AEKZSEX.js} +2 -2
- package/dist/{worktree-OTFQO2W7.js → worktree-MRSTQ32S.js} +2 -2
- package/package.json +1 -1
- package/dist/cursor-recover-ZUJG6XRQ.js +0 -42
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
// src/agents/cursor-runner.ts
|
|
5
5
|
var import_sdk = require("@cursor/sdk");
|
|
6
6
|
var import_node_fs10 = require("fs");
|
|
7
|
-
var import_node_path11 = require("path");
|
|
8
7
|
var import_node_readline2 = require("readline");
|
|
9
8
|
|
|
10
9
|
// src/hook/nested-electron-env.ts
|
|
@@ -24,62 +23,32 @@ var STRIP_NESTED_ELECTRON_THEN_EXEC = [
|
|
|
24
23
|
'exec "$@"'
|
|
25
24
|
].join("; ");
|
|
26
25
|
|
|
27
|
-
// src/store/paths.ts
|
|
28
|
-
var import_node_path4 = require("path");
|
|
29
|
-
var import_node_os2 = require("os");
|
|
30
|
-
var import_node_path5 = require("path");
|
|
31
|
-
var import_node_fs4 = require("fs");
|
|
32
|
-
|
|
33
|
-
// src/hook/settings.ts
|
|
34
|
-
var import_node_fs3 = require("fs");
|
|
35
|
-
var import_node_os = require("os");
|
|
36
|
-
var import_node_path3 = require("path");
|
|
37
|
-
var import_smol_toml = require("smol-toml");
|
|
38
|
-
|
|
39
|
-
// src/hook/convention-setup.ts
|
|
40
|
-
var import_node_fs = require("fs");
|
|
41
|
-
var import_node_path = require("path");
|
|
42
|
-
|
|
43
|
-
// src/hook/cursor-worktrees.ts
|
|
44
|
-
var import_node_fs2 = require("fs");
|
|
45
|
-
var import_node_path2 = require("path");
|
|
46
|
-
var import_execa = require("execa");
|
|
47
|
-
var import_node_readline = require("readline");
|
|
48
|
-
|
|
49
|
-
// src/store/paths.ts
|
|
50
|
-
function appDataDir() {
|
|
51
|
-
const override = process.env.SIDEBOARD_APP_DATA?.trim();
|
|
52
|
-
const base = override ? override : process.platform === "darwin" ? (0, import_node_path5.join)((0, import_node_os2.homedir)(), "Library", "Application Support", "sideboard") : process.platform === "win32" ? (0, import_node_path5.join)(process.env.APPDATA ?? (0, import_node_path5.join)((0, import_node_os2.homedir)(), "AppData", "Roaming"), "sideboard") : (0, import_node_path5.join)((0, import_node_os2.homedir)(), ".local", "share", "sideboard");
|
|
53
|
-
(0, import_node_fs4.mkdirSync)(base, { recursive: true });
|
|
54
|
-
return base;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
26
|
// src/agents/cursor-ripgrep.ts
|
|
58
|
-
var
|
|
27
|
+
var import_node_fs5 = require("fs");
|
|
59
28
|
var import_node_module = require("module");
|
|
60
|
-
var
|
|
29
|
+
var import_node_path5 = require("path");
|
|
61
30
|
|
|
62
31
|
// src/agents/node-launch.ts
|
|
63
|
-
var
|
|
64
|
-
var
|
|
65
|
-
var
|
|
32
|
+
var import_node_fs4 = require("fs");
|
|
33
|
+
var import_node_os2 = require("os");
|
|
34
|
+
var import_node_path4 = require("path");
|
|
66
35
|
|
|
67
36
|
// src/git/run.ts
|
|
68
|
-
var
|
|
37
|
+
var import_execa = require("execa");
|
|
69
38
|
|
|
70
39
|
// src/agents/path.ts
|
|
71
|
-
var
|
|
40
|
+
var import_node_fs = require("fs");
|
|
72
41
|
var import_node_child_process = require("child_process");
|
|
73
|
-
var
|
|
74
|
-
var
|
|
42
|
+
var import_node_os = require("os");
|
|
43
|
+
var import_node_path = require("path");
|
|
75
44
|
|
|
76
45
|
// src/git/stale-lock.ts
|
|
77
|
-
var
|
|
78
|
-
var
|
|
46
|
+
var import_node_fs2 = require("fs");
|
|
47
|
+
var import_node_path2 = require("path");
|
|
79
48
|
|
|
80
49
|
// src/agents/packaged-runtime.ts
|
|
81
|
-
var
|
|
82
|
-
var
|
|
50
|
+
var import_node_fs3 = require("fs");
|
|
51
|
+
var import_node_path3 = require("path");
|
|
83
52
|
function electronResourcesPath() {
|
|
84
53
|
const resources = process.resourcesPath;
|
|
85
54
|
if (typeof resources !== "string" || !resources) return null;
|
|
@@ -88,14 +57,14 @@ function electronResourcesPath() {
|
|
|
88
57
|
function packagedCursorRuntimeDir() {
|
|
89
58
|
const resources = electronResourcesPath();
|
|
90
59
|
if (!resources) return null;
|
|
91
|
-
const dir = (0,
|
|
92
|
-
if (!(0,
|
|
60
|
+
const dir = (0, import_node_path3.join)(resources, "cursor-runtime");
|
|
61
|
+
if (!(0, import_node_fs3.existsSync)((0, import_node_path3.join)(dir, "core-dist", "agents", "cursor-runner.js"))) return null;
|
|
93
62
|
return dir;
|
|
94
63
|
}
|
|
95
64
|
function packagedCursorRipgrepCandidate(platformPkg, binName) {
|
|
96
65
|
const dir = packagedCursorRuntimeDir();
|
|
97
66
|
if (!dir) return null;
|
|
98
|
-
return (0,
|
|
67
|
+
return (0, import_node_path3.join)(dir, "node_modules", platformPkg, "bin", binName);
|
|
99
68
|
}
|
|
100
69
|
|
|
101
70
|
// src/agents/node-launch.ts
|
|
@@ -107,7 +76,7 @@ function unpackedAsarPath(filePath) {
|
|
|
107
76
|
if (!isAsarPath(filePath)) return null;
|
|
108
77
|
const unpacked = filePath.replace(/\.asar(?=[/\\])/, ".asar.unpacked");
|
|
109
78
|
if (unpacked === filePath) return null;
|
|
110
|
-
return (0,
|
|
79
|
+
return (0, import_node_fs4.existsSync)(unpacked) ? unpacked : null;
|
|
111
80
|
}
|
|
112
81
|
function nodeReadableScriptPath(scriptPath) {
|
|
113
82
|
return unpackedAsarPath(scriptPath) ?? scriptPath;
|
|
@@ -123,21 +92,21 @@ function platformRipgrepPackage() {
|
|
|
123
92
|
}
|
|
124
93
|
function usableRipgrepPath(candidate) {
|
|
125
94
|
const raw = candidate?.trim();
|
|
126
|
-
if (!raw || !(0,
|
|
95
|
+
if (!raw || !(0, import_node_path5.isAbsolute)(raw)) return null;
|
|
127
96
|
const readable = nodeReadableScriptPath(raw);
|
|
128
|
-
if (!(0,
|
|
97
|
+
if (!(0, import_node_fs5.existsSync)(readable) || isAsarPath(readable)) return null;
|
|
129
98
|
return readable;
|
|
130
99
|
}
|
|
131
100
|
function walkForBundledRipgrep(startFile) {
|
|
132
101
|
if (!startFile) return null;
|
|
133
102
|
const pkg = platformRipgrepPackage();
|
|
134
103
|
const name = rgBinaryName();
|
|
135
|
-
let dir = (0,
|
|
136
|
-
const root = (0,
|
|
104
|
+
let dir = (0, import_node_path5.dirname)((0, import_node_path5.resolve)(startFile));
|
|
105
|
+
const root = (0, import_node_path5.parse)(dir).root;
|
|
137
106
|
while (dir !== root) {
|
|
138
|
-
const hit = usableRipgrepPath((0,
|
|
107
|
+
const hit = usableRipgrepPath((0, import_node_path5.join)(dir, "node_modules", pkg, "bin", name));
|
|
139
108
|
if (hit) return hit;
|
|
140
|
-
const next = (0,
|
|
109
|
+
const next = (0, import_node_path5.dirname)(dir);
|
|
141
110
|
if (next === dir) break;
|
|
142
111
|
dir = next;
|
|
143
112
|
}
|
|
@@ -147,7 +116,7 @@ function requireResolveBundledRipgrep(fromFile) {
|
|
|
147
116
|
try {
|
|
148
117
|
const req = (0, import_node_module.createRequire)(fromFile);
|
|
149
118
|
const pkgJson = req.resolve(`${platformRipgrepPackage()}/package.json`);
|
|
150
|
-
return usableRipgrepPath((0,
|
|
119
|
+
return usableRipgrepPath((0, import_node_path5.join)((0, import_node_path5.dirname)(pkgJson), "bin", rgBinaryName()));
|
|
151
120
|
} catch {
|
|
152
121
|
return null;
|
|
153
122
|
}
|
|
@@ -172,6 +141,51 @@ function ensureCursorRipgrepPath(opts) {
|
|
|
172
141
|
return path;
|
|
173
142
|
}
|
|
174
143
|
|
|
144
|
+
// src/agents/cursor-store.ts
|
|
145
|
+
var import_node_path11 = require("path");
|
|
146
|
+
|
|
147
|
+
// src/store/paths.ts
|
|
148
|
+
var import_node_path9 = require("path");
|
|
149
|
+
var import_node_os4 = require("os");
|
|
150
|
+
var import_node_path10 = require("path");
|
|
151
|
+
var import_node_fs9 = require("fs");
|
|
152
|
+
|
|
153
|
+
// src/hook/settings.ts
|
|
154
|
+
var import_node_fs8 = require("fs");
|
|
155
|
+
var import_node_os3 = require("os");
|
|
156
|
+
var import_node_path8 = require("path");
|
|
157
|
+
var import_smol_toml = require("smol-toml");
|
|
158
|
+
|
|
159
|
+
// src/hook/convention-setup.ts
|
|
160
|
+
var import_node_fs6 = require("fs");
|
|
161
|
+
var import_node_path6 = require("path");
|
|
162
|
+
|
|
163
|
+
// src/hook/cursor-worktrees.ts
|
|
164
|
+
var import_node_fs7 = require("fs");
|
|
165
|
+
var import_node_path7 = require("path");
|
|
166
|
+
var import_execa2 = require("execa");
|
|
167
|
+
var import_node_readline = require("readline");
|
|
168
|
+
|
|
169
|
+
// src/store/paths.ts
|
|
170
|
+
function appDataDir() {
|
|
171
|
+
const override = process.env.SIDEBOARD_APP_DATA?.trim();
|
|
172
|
+
const base = override ? override : process.platform === "darwin" ? (0, import_node_path10.join)((0, import_node_os4.homedir)(), "Library", "Application Support", "sideboard") : process.platform === "win32" ? (0, import_node_path10.join)(process.env.APPDATA ?? (0, import_node_path10.join)((0, import_node_os4.homedir)(), "AppData", "Roaming"), "sideboard") : (0, import_node_path10.join)((0, import_node_os4.homedir)(), ".local", "share", "sideboard");
|
|
173
|
+
(0, import_node_fs9.mkdirSync)(base, { recursive: true });
|
|
174
|
+
return base;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// src/agents/cursor-store.ts
|
|
178
|
+
var CURSOR_SDK_STORE_DIR = "cursor-sdk-store";
|
|
179
|
+
function cursorSdkStoreDir(threadId) {
|
|
180
|
+
const root = (0, import_node_path11.join)(appDataDir(), CURSOR_SDK_STORE_DIR);
|
|
181
|
+
const id = sanitizeCursorStoreSegment(threadId);
|
|
182
|
+
if (!id) return root;
|
|
183
|
+
return (0, import_node_path11.join)(root, "threads", id);
|
|
184
|
+
}
|
|
185
|
+
function sanitizeCursorStoreSegment(threadId) {
|
|
186
|
+
return (threadId ?? "").trim().replace(/[^a-zA-Z0-9._-]/g, "_");
|
|
187
|
+
}
|
|
188
|
+
|
|
175
189
|
// src/agents/cursor-session.ts
|
|
176
190
|
function cursorErrorMessage(err) {
|
|
177
191
|
if (err instanceof Error) return err.message.trim();
|
|
@@ -187,7 +201,8 @@ function isUnresumableCursorSession(err) {
|
|
|
187
201
|
if (name === "AgentNotFoundError") return true;
|
|
188
202
|
const lower = cursorErrorMessage(err).toLowerCase();
|
|
189
203
|
if (!lower) return false;
|
|
190
|
-
return /corrupt local agent checkpoint/.test(lower) || /missing root blob/.test(lower) || /\bagent\b.{0,120}\bnot found\b/.test(lower) ||
|
|
204
|
+
return /corrupt local agent checkpoint/.test(lower) || /missing root blob/.test(lower) || /\bagent\b.{0,120}\bnot found\b/.test(lower) || // Shared JSONL last-write-wins: `Run run-… not found for agent agent-…`
|
|
205
|
+
/\brun\b.{0,80}\bnot found for agent\b/.test(lower) || /cannot resume/.test(lower);
|
|
191
206
|
}
|
|
192
207
|
function cursorSessionRecoveryMessage(err, agentId) {
|
|
193
208
|
const detail = cursorErrorMessage(err) || "unresumable session";
|
|
@@ -399,7 +414,7 @@ function cursorSdkMessageToEvents(msg) {
|
|
|
399
414
|
if (msg.type === "tool_call" && msg.call_id && msg.name) {
|
|
400
415
|
const normalized = normalizeCursorToolCall(msg.name, msg.args);
|
|
401
416
|
if (msg.status === "running") {
|
|
402
|
-
|
|
417
|
+
const events = [
|
|
403
418
|
{
|
|
404
419
|
type: "tool_use",
|
|
405
420
|
id: msg.call_id,
|
|
@@ -407,6 +422,16 @@ function cursorSdkMessageToEvents(msg) {
|
|
|
407
422
|
input: normalized.input
|
|
408
423
|
}
|
|
409
424
|
];
|
|
425
|
+
const live = unwrapCursorToolResult(msg.result);
|
|
426
|
+
if (live) {
|
|
427
|
+
events.push({
|
|
428
|
+
type: "tool_result",
|
|
429
|
+
id: msg.call_id,
|
|
430
|
+
content: live,
|
|
431
|
+
partial: true
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
return events;
|
|
410
435
|
}
|
|
411
436
|
if (msg.status === "completed" || msg.status === "error") {
|
|
412
437
|
return [
|
|
@@ -467,6 +492,17 @@ function nestedUpdateToEvents(update, parentId) {
|
|
|
467
492
|
isError: cursorToolResultIsError(void 0, update.toolCall.result),
|
|
468
493
|
parentId
|
|
469
494
|
});
|
|
495
|
+
} else {
|
|
496
|
+
const live = unwrapCursorToolResult(update.toolCall.result);
|
|
497
|
+
if (live) {
|
|
498
|
+
events.push({
|
|
499
|
+
type: "tool_result",
|
|
500
|
+
id: update.callId,
|
|
501
|
+
content: live,
|
|
502
|
+
partial: true,
|
|
503
|
+
parentId
|
|
504
|
+
});
|
|
505
|
+
}
|
|
470
506
|
}
|
|
471
507
|
return events;
|
|
472
508
|
}
|
|
@@ -560,8 +596,8 @@ function modelSelection(model, opts) {
|
|
|
560
596
|
}
|
|
561
597
|
return params.length > 0 ? { id, params } : { id };
|
|
562
598
|
}
|
|
563
|
-
function localAgentStore() {
|
|
564
|
-
const root = (
|
|
599
|
+
function localAgentStore(threadId) {
|
|
600
|
+
const root = cursorSdkStoreDir(threadId);
|
|
565
601
|
(0, import_node_fs10.mkdirSync)(root, { recursive: true });
|
|
566
602
|
return new import_sdk.JsonlLocalAgentStore(root);
|
|
567
603
|
}
|
|
@@ -620,7 +656,7 @@ async function main() {
|
|
|
620
656
|
fast: Boolean(req.fast)
|
|
621
657
|
});
|
|
622
658
|
const mode = req.planMode ? "plan" : "agent";
|
|
623
|
-
const store = localAgentStore();
|
|
659
|
+
const store = localAgentStore(req.threadId);
|
|
624
660
|
const local = withCursorLocalHangGuards({ cwd: req.cwd, store });
|
|
625
661
|
const mcpServers = req.mcpServers && Object.keys(req.mcpServers).length > 0 ? req.mcpServers : void 0;
|
|
626
662
|
const createOpts = {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
cursorSdkStoreDir
|
|
4
|
+
} from "../chunk-VHX673DI.js";
|
|
2
5
|
import {
|
|
3
6
|
createAgentStreamCoalescer
|
|
4
7
|
} from "../chunk-AXQ4ZWHK.js";
|
|
@@ -7,19 +10,16 @@ import {
|
|
|
7
10
|
cursorSdkMessageToEvents,
|
|
8
11
|
ensureCursorRipgrepPath,
|
|
9
12
|
formatUnknownDetail
|
|
10
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-NZBDVBCP.js";
|
|
11
14
|
import {
|
|
12
15
|
dropNestedElectronEnvFromProcess
|
|
13
16
|
} from "../chunk-4TR3HZFT.js";
|
|
14
|
-
import
|
|
15
|
-
appDataDir
|
|
16
|
-
} from "../chunk-QZQEXME2.js";
|
|
17
|
+
import "../chunk-QZQEXME2.js";
|
|
17
18
|
import "../chunk-DVM4ID64.js";
|
|
18
19
|
|
|
19
20
|
// src/agents/cursor-runner.ts
|
|
20
21
|
import { Agent, CursorAgentError, JsonlLocalAgentStore } from "@cursor/sdk";
|
|
21
22
|
import { mkdirSync } from "fs";
|
|
22
|
-
import { join } from "path";
|
|
23
23
|
import { createInterface } from "readline";
|
|
24
24
|
|
|
25
25
|
// src/agents/cursor-session.ts
|
|
@@ -37,7 +37,8 @@ function isUnresumableCursorSession(err) {
|
|
|
37
37
|
if (name === "AgentNotFoundError") return true;
|
|
38
38
|
const lower = cursorErrorMessage(err).toLowerCase();
|
|
39
39
|
if (!lower) return false;
|
|
40
|
-
return /corrupt local agent checkpoint/.test(lower) || /missing root blob/.test(lower) || /\bagent\b.{0,120}\bnot found\b/.test(lower) ||
|
|
40
|
+
return /corrupt local agent checkpoint/.test(lower) || /missing root blob/.test(lower) || /\bagent\b.{0,120}\bnot found\b/.test(lower) || // Shared JSONL last-write-wins: `Run run-… not found for agent agent-…`
|
|
41
|
+
/\brun\b.{0,80}\bnot found for agent\b/.test(lower) || /cannot resume/.test(lower);
|
|
41
42
|
}
|
|
42
43
|
function cursorSessionRecoveryMessage(err, agentId) {
|
|
43
44
|
const detail = cursorErrorMessage(err) || "unresumable session";
|
|
@@ -116,8 +117,8 @@ function modelSelection(model, opts) {
|
|
|
116
117
|
}
|
|
117
118
|
return params.length > 0 ? { id, params } : { id };
|
|
118
119
|
}
|
|
119
|
-
function localAgentStore() {
|
|
120
|
-
const root =
|
|
120
|
+
function localAgentStore(threadId) {
|
|
121
|
+
const root = cursorSdkStoreDir(threadId);
|
|
121
122
|
mkdirSync(root, { recursive: true });
|
|
122
123
|
return new JsonlLocalAgentStore(root);
|
|
123
124
|
}
|
|
@@ -176,7 +177,7 @@ async function main() {
|
|
|
176
177
|
fast: Boolean(req.fast)
|
|
177
178
|
});
|
|
178
179
|
const mode = req.planMode ? "plan" : "agent";
|
|
179
|
-
const store = localAgentStore();
|
|
180
|
+
const store = localAgentStore(req.threadId);
|
|
180
181
|
const local = withCursorLocalHangGuards({ cwd: req.cwd, store });
|
|
181
182
|
const mcpServers = req.mcpServers && Object.keys(req.mcpServers).length > 0 ? req.mcpServers : void 0;
|
|
182
183
|
const createOpts = {
|
|
@@ -28,25 +28,25 @@ import {
|
|
|
28
28
|
resolveCursorModelId,
|
|
29
29
|
resolveLoginCommand,
|
|
30
30
|
resolveQuotaFallbackAgent
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-YJ2WV5TZ.js";
|
|
32
32
|
import "./chunk-EKIDHL2T.js";
|
|
33
33
|
import {
|
|
34
34
|
ORCHESTRATOR_AGENT_KINDS,
|
|
35
35
|
assertOrchestratorCapableAgent,
|
|
36
36
|
coerceOrchestratorAgent,
|
|
37
37
|
isOrchestratorCapableAgent
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import "./chunk-
|
|
38
|
+
} from "./chunk-4WV7C7WP.js";
|
|
39
|
+
import "./chunk-X3NIPGQT.js";
|
|
40
40
|
import {
|
|
41
41
|
cursorSdkMessageToEvents,
|
|
42
42
|
parseCursorRunnerLine
|
|
43
|
-
} from "./chunk-
|
|
44
|
-
import "./chunk-
|
|
43
|
+
} from "./chunk-NZBDVBCP.js";
|
|
44
|
+
import "./chunk-VGPLXQIH.js";
|
|
45
45
|
import "./chunk-FKOIHGKV.js";
|
|
46
46
|
import "./chunk-4NR5FL46.js";
|
|
47
47
|
import "./chunk-4TR3HZFT.js";
|
|
48
48
|
import "./chunk-JT7R45JB.js";
|
|
49
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-HPAWHIZ3.js";
|
|
50
50
|
import "./chunk-77WWLBCI.js";
|
|
51
51
|
import "./chunk-QZQEXME2.js";
|
|
52
52
|
import {
|
|
@@ -32,18 +32,18 @@ import {
|
|
|
32
32
|
resolveCursorModelId,
|
|
33
33
|
resolveLoginCommand,
|
|
34
34
|
resolveQuotaFallbackAgent
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-4CDCTYTM.js";
|
|
36
36
|
import "./chunk-YMRT2DU6.js";
|
|
37
37
|
import {
|
|
38
38
|
ORCHESTRATOR_AGENT_KINDS,
|
|
39
39
|
assertOrchestratorCapableAgent,
|
|
40
40
|
coerceOrchestratorAgent,
|
|
41
41
|
isOrchestratorCapableAgent
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
42
|
+
} from "./chunk-4NAW5BAQ.js";
|
|
43
|
+
import "./chunk-XTZQL7OU.js";
|
|
44
|
+
import "./chunk-WCU3FHEI.js";
|
|
45
45
|
import "./chunk-B3SJXYIJ.js";
|
|
46
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-RG737OWT.js";
|
|
47
47
|
import {
|
|
48
48
|
conductorBundledBinDir,
|
|
49
49
|
enrichPathWithNpmGlobalBin,
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
} from "./chunk-YMRT2DU6.js";
|
|
10
10
|
import {
|
|
11
11
|
isOrchestratorThread
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4NAW5BAQ.js";
|
|
13
13
|
import {
|
|
14
14
|
codexUnattendedGitConfigArgs,
|
|
15
15
|
mergeAgentGitAuthEnv,
|
|
16
16
|
resolveAgentGitAuthEnv,
|
|
17
17
|
resolveCodexGitWritableRoots
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-WCU3FHEI.js";
|
|
19
19
|
import {
|
|
20
20
|
enrichPathWithNpmGlobalBin,
|
|
21
21
|
isConductorBundledCli,
|
|
@@ -237,7 +237,7 @@ function summarizeTurnStderr(tail, maxChars = 500) {
|
|
|
237
237
|
function looksLikeInvalidAgentSession(text) {
|
|
238
238
|
const lower = text.trim().toLowerCase();
|
|
239
239
|
if (!lower) return false;
|
|
240
|
-
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);
|
|
240
|
+
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) || /\brun\b.{0,80}\bnot found for agent\b/.test(lower);
|
|
241
241
|
}
|
|
242
242
|
function looksLikeRetryableRunnerCrash(text) {
|
|
243
243
|
if (looksLikeAgentFailureMessage(text)) return false;
|
|
@@ -1007,6 +1007,30 @@ function applyAgentEvent(parts, event) {
|
|
|
1007
1007
|
if (event.type === "tool_result") {
|
|
1008
1008
|
const existing = parts.findIndex((p) => p.type === "tool" && p.id === event.id);
|
|
1009
1009
|
const fromResult = parseDiffStat(event.content);
|
|
1010
|
+
if (event.partial) {
|
|
1011
|
+
if (existing < 0) {
|
|
1012
|
+
return [
|
|
1013
|
+
...parts,
|
|
1014
|
+
{
|
|
1015
|
+
type: "tool",
|
|
1016
|
+
id: event.id,
|
|
1017
|
+
name: "tool",
|
|
1018
|
+
description: "tool",
|
|
1019
|
+
status: event.isError ? "error" : "running",
|
|
1020
|
+
result: event.content,
|
|
1021
|
+
...event.parentId ? { parentId: event.parentId } : {}
|
|
1022
|
+
}
|
|
1023
|
+
];
|
|
1024
|
+
}
|
|
1025
|
+
return parts.map((p, i) => {
|
|
1026
|
+
if (i !== existing || p.type !== "tool") return p;
|
|
1027
|
+
if (p.status === "done" || p.status === "error") return p;
|
|
1028
|
+
return {
|
|
1029
|
+
...p,
|
|
1030
|
+
result: event.content ?? p.result
|
|
1031
|
+
};
|
|
1032
|
+
});
|
|
1033
|
+
}
|
|
1010
1034
|
if (existing < 0) {
|
|
1011
1035
|
return [
|
|
1012
1036
|
...parts,
|
|
@@ -1889,7 +1913,7 @@ var claudeAdapter = {
|
|
|
1889
1913
|
);
|
|
1890
1914
|
}
|
|
1891
1915
|
const mode = permissionMode(thread);
|
|
1892
|
-
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-
|
|
1916
|
+
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-Z37MNYU6.js");
|
|
1893
1917
|
const isOrchestrator = isOrchestratorThread2(thread);
|
|
1894
1918
|
const injectedServers = await buildInjectedMcpServers({
|
|
1895
1919
|
includeSideboard: true,
|
|
@@ -2352,13 +2376,22 @@ var codexAdapter = {
|
|
|
2352
2376
|
const events = [
|
|
2353
2377
|
{ type: "tool_use", id: item.id, name: "Bash", input }
|
|
2354
2378
|
];
|
|
2355
|
-
|
|
2379
|
+
const finished = type === "item.completed" || item.status === "completed" || item.status === "failed";
|
|
2380
|
+
const output = typeof item.aggregated_output === "string" && item.aggregated_output ? item.aggregated_output : void 0;
|
|
2381
|
+
if (finished) {
|
|
2356
2382
|
events.push({
|
|
2357
2383
|
type: "tool_result",
|
|
2358
2384
|
id: item.id,
|
|
2359
|
-
content:
|
|
2385
|
+
content: output,
|
|
2360
2386
|
isError: item.status === "failed"
|
|
2361
2387
|
});
|
|
2388
|
+
} else if (output) {
|
|
2389
|
+
events.push({
|
|
2390
|
+
type: "tool_result",
|
|
2391
|
+
id: item.id,
|
|
2392
|
+
content: output,
|
|
2393
|
+
partial: true
|
|
2394
|
+
});
|
|
2362
2395
|
}
|
|
2363
2396
|
return events.length === 1 ? events[0] : events;
|
|
2364
2397
|
}
|
|
@@ -2579,7 +2612,7 @@ function cursorSdkMessageToEvents(msg) {
|
|
|
2579
2612
|
if (msg.type === "tool_call" && msg.call_id && msg.name) {
|
|
2580
2613
|
const normalized = normalizeCursorToolCall(msg.name, msg.args);
|
|
2581
2614
|
if (msg.status === "running") {
|
|
2582
|
-
|
|
2615
|
+
const events = [
|
|
2583
2616
|
{
|
|
2584
2617
|
type: "tool_use",
|
|
2585
2618
|
id: msg.call_id,
|
|
@@ -2587,6 +2620,16 @@ function cursorSdkMessageToEvents(msg) {
|
|
|
2587
2620
|
input: normalized.input
|
|
2588
2621
|
}
|
|
2589
2622
|
];
|
|
2623
|
+
const live = unwrapCursorToolResult(msg.result);
|
|
2624
|
+
if (live) {
|
|
2625
|
+
events.push({
|
|
2626
|
+
type: "tool_result",
|
|
2627
|
+
id: msg.call_id,
|
|
2628
|
+
content: live,
|
|
2629
|
+
partial: true
|
|
2630
|
+
});
|
|
2631
|
+
}
|
|
2632
|
+
return events;
|
|
2590
2633
|
}
|
|
2591
2634
|
if (msg.status === "completed" || msg.status === "error") {
|
|
2592
2635
|
return [
|
|
@@ -2811,6 +2854,7 @@ var cursorAdapter = {
|
|
|
2811
2854
|
const req = {
|
|
2812
2855
|
prompt,
|
|
2813
2856
|
cwd: thread.worktreePath,
|
|
2857
|
+
threadId: thread.id,
|
|
2814
2858
|
agentId,
|
|
2815
2859
|
model: thread.model,
|
|
2816
2860
|
effort: thread.effort,
|
|
@@ -3056,13 +3100,16 @@ var opencodeAdapter = {
|
|
|
3056
3100
|
);
|
|
3057
3101
|
const events = [{ type: "tool_use", id, name, input }];
|
|
3058
3102
|
const output = state?.output;
|
|
3059
|
-
|
|
3103
|
+
const finished = state?.status === "completed" || state?.status === "error" || state?.status === "failed";
|
|
3104
|
+
const running = state?.status === "running" || state?.status === "in_progress" || state?.status === "pending";
|
|
3105
|
+
if (output != null || finished) {
|
|
3060
3106
|
const content = typeof output === "string" ? output : output != null ? JSON.stringify(output) : formatUnknownDetail(state?.error) || void 0;
|
|
3061
3107
|
events.push({
|
|
3062
3108
|
type: "tool_result",
|
|
3063
3109
|
id,
|
|
3064
3110
|
content,
|
|
3065
|
-
isError: state?.status === "error" || state?.status === "failed"
|
|
3111
|
+
isError: state?.status === "error" || state?.status === "failed",
|
|
3112
|
+
...running && !finished ? { partial: true } : {}
|
|
3066
3113
|
});
|
|
3067
3114
|
}
|
|
3068
3115
|
return events.length === 1 ? events[0] : events;
|
|
@@ -3097,14 +3144,17 @@ var opencodeAdapter = {
|
|
|
3097
3144
|
withEventParentId({ type: "tool_use", id, name, input }, parentId)
|
|
3098
3145
|
];
|
|
3099
3146
|
const output = state?.output ?? part.output;
|
|
3100
|
-
|
|
3147
|
+
const finished = state?.status === "completed" || state?.status === "error" || state?.status === "failed";
|
|
3148
|
+
const running = state?.status === "running" || state?.status === "in_progress" || state?.status === "pending";
|
|
3149
|
+
if (output != null || finished) {
|
|
3101
3150
|
nested.push(
|
|
3102
3151
|
withEventParentId(
|
|
3103
3152
|
{
|
|
3104
3153
|
type: "tool_result",
|
|
3105
3154
|
id,
|
|
3106
3155
|
content: typeof output === "string" ? output : output != null ? JSON.stringify(output) : void 0,
|
|
3107
|
-
isError: state?.status === "error" || state?.status === "failed"
|
|
3156
|
+
isError: state?.status === "error" || state?.status === "failed",
|
|
3157
|
+
...running && !finished ? { partial: true } : {}
|
|
3108
3158
|
},
|
|
3109
3159
|
parentId
|
|
3110
3160
|
)
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
ensureGlobalCoordinatorCwd
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XTZQL7OU.js";
|
|
6
6
|
import {
|
|
7
7
|
allocateTeamName,
|
|
8
8
|
takenSlugsFromThread,
|
|
9
9
|
teamSlugFromName
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-WCU3FHEI.js";
|
|
11
11
|
import {
|
|
12
12
|
createEmptyThread,
|
|
13
13
|
listThreads,
|
|
14
14
|
updateThread,
|
|
15
15
|
writeThread
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-RG737OWT.js";
|
|
17
17
|
import {
|
|
18
18
|
resolveNewThreadOptions,
|
|
19
19
|
resolveThreadDefaults
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureGlobalCoordinatorCwd
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-X3NIPGQT.js";
|
|
4
4
|
import {
|
|
5
5
|
allocateTeamName,
|
|
6
6
|
takenSlugsFromThread,
|
|
7
7
|
teamSlugFromName
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-VGPLXQIH.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveNewThreadOptions,
|
|
11
11
|
resolveThreadDefaults
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
listThreads,
|
|
16
16
|
updateThread,
|
|
17
17
|
writeThread
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-HPAWHIZ3.js";
|
|
19
19
|
import {
|
|
20
20
|
globalAgentCwd
|
|
21
21
|
} from "./chunk-QZQEXME2.js";
|