@1agents/acp-service 0.10.12 → 0.11.1
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/src/acp-connection.js +33 -0
- package/dist/src/bridge.js +44 -1
- package/dist/src/capacity-queue.d.ts +3 -1
- package/dist/src/capacity-queue.js +4 -0
- package/dist/src/catalog.js +13 -3
- package/package.json +4 -4
- package/skills/acp-service/SKILL.md +1 -1
- package/vendor/dsh/adapter.d.ts +6 -0
- package/vendor/dsh/adapter.js +23 -0
- package/vendor/dsh/index.js +19 -0
- package/vendor/runtime/README.md +36 -11
- package/vendor/runtime/dist/{agent-registry-DxcyXXqb.js → agent-registry-CsdsVpJb.js} +209 -177
- package/vendor/runtime/dist/agent-registry-CsdsVpJb.js.map +1 -0
- package/vendor/runtime/dist/agent-registry.d.ts +0 -2
- package/vendor/runtime/dist/agent-registry.d.ts.map +1 -1
- package/vendor/runtime/dist/agent-registry.js +1 -1
- package/vendor/runtime/dist/{cli-BKmMxgix.js → cli-B5gQOSDl.js} +33 -14
- package/vendor/runtime/dist/cli-B5gQOSDl.js.map +1 -0
- package/vendor/runtime/dist/cli.d.ts +2 -6
- package/vendor/runtime/dist/cli.d.ts.map +1 -1
- package/vendor/runtime/dist/cli.js +189 -164
- package/vendor/runtime/dist/cli.js.map +1 -1
- package/vendor/runtime/dist/{client-C5zneoBs.d.ts → client-D5y4RXME.d.ts} +4 -12
- package/vendor/runtime/dist/client-D5y4RXME.d.ts.map +1 -0
- package/vendor/runtime/dist/docs-site/CLI.html +19 -21
- package/vendor/runtime/dist/docs-site/VISION.html +3 -2
- package/vendor/runtime/dist/docs-site/agents.html +10 -15
- package/vendor/runtime/dist/docs-site/assets/agents/Apache-2.0.txt +202 -0
- package/vendor/runtime/dist/docs-site/assets/agents/LobeHub-MIT.txt +21 -0
- package/vendor/runtime/dist/docs-site/assets/agents/Mux-AGPL-3.0.txt +661 -0
- package/vendor/runtime/dist/docs-site/assets/agents/README.md +41 -0
- package/vendor/runtime/dist/docs-site/assets/agents/ante.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/antigravity.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/claude.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/codex.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/copilot.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/cursor.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/deepseek-harness.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/devin.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/droid.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/fast-agent.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/fx.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/gemini.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/goose.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/grok-build.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/iflow.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/junie.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/kilocode.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/kimi.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/kiro.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/mcode.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/mux.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/octomind.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/openclaw.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/opencode.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/pi.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/pool.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/qoder.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/qwen.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/trae.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/zeroclaw.png +0 -0
- package/vendor/runtime/dist/docs-site/compare.html +8 -7
- package/vendor/runtime/dist/docs-site/config.html +5 -4
- package/vendor/runtime/dist/docs-site/custom-agents.html +13 -13
- package/vendor/runtime/dist/docs-site/exit-codes.html +4 -3
- package/vendor/runtime/dist/docs-site/flows.html +21 -8
- package/vendor/runtime/dist/docs-site/index.html +7 -6
- package/vendor/runtime/dist/docs-site/install.html +7 -6
- package/vendor/runtime/dist/docs-site/llms.txt +6 -6
- package/vendor/runtime/dist/docs-site/output-formats.html +9 -8
- package/vendor/runtime/dist/docs-site/permissions.html +5 -4
- package/vendor/runtime/dist/docs-site/prompting.html +9 -7
- package/vendor/runtime/dist/docs-site/quickstart.html +5 -4
- package/vendor/runtime/dist/docs-site/releasing.html +9 -8
- package/vendor/runtime/dist/docs-site/runtime-environment.html +28 -5
- package/vendor/runtime/dist/docs-site/runtime-process-lifecycle.html +13 -7
- package/vendor/runtime/dist/docs-site/safe-errors.html +3 -2
- package/vendor/runtime/dist/docs-site/session-control.html +7 -6
- package/vendor/runtime/dist/docs-site/session-watch.html +6 -5
- package/vendor/runtime/dist/docs-site/sessions.html +13 -10
- package/vendor/runtime/dist/docs-site/shared-sessions.html +7 -4
- package/vendor/runtime/dist/{flows-VrII9VKZ.js → flows-CDj5YcTh.js} +136 -68
- package/vendor/runtime/dist/flows-CDj5YcTh.js.map +1 -0
- package/vendor/runtime/dist/flows.d.ts +28 -19
- package/vendor/runtime/dist/flows.d.ts.map +1 -1
- package/vendor/runtime/dist/flows.js +1 -1
- package/vendor/runtime/dist/{invocation-options-DHMZ5Rrb.js → input-file-BsfVGZgn.js} +30 -15
- package/vendor/runtime/dist/input-file-BsfVGZgn.js.map +1 -0
- package/vendor/runtime/dist/{ipc-CNNM5DP_.js → ipc-DfqJsbk6.js} +114 -146
- package/vendor/runtime/dist/ipc-DfqJsbk6.js.map +1 -0
- package/vendor/runtime/dist/{output-DtzXtiBc.js → output-DOIF4iFc.js} +20 -47
- package/vendor/runtime/dist/output-DOIF4iFc.js.map +1 -0
- package/vendor/runtime/dist/{queue-owner-runtime-ehuh3SQU.js → queue-owner-runtime-DHBQbjXo.js} +394 -258
- package/vendor/runtime/dist/queue-owner-runtime-DHBQbjXo.js.map +1 -0
- package/vendor/runtime/dist/runtime.d.ts +37 -36
- package/vendor/runtime/dist/runtime.d.ts.map +1 -1
- package/vendor/runtime/dist/runtime.js +117 -172
- package/vendor/runtime/dist/runtime.js.map +1 -1
- package/vendor/runtime/dist/{session-options-NjpFwf-c.d.ts → session-options-Ci4aw1oD.d.ts} +13 -16
- package/vendor/runtime/dist/session-options-Ci4aw1oD.d.ts.map +1 -0
- package/vendor/runtime/dist/{session-watch-CbKfGRkZ.js → session-watch-DRwFHcWw.js} +5 -6
- package/vendor/runtime/dist/{session-watch-CbKfGRkZ.js.map → session-watch-DRwFHcWw.js.map} +1 -1
- package/vendor/runtime/dist/{watch-BGt4kcE6.js → watch-CUDGkljG.js} +3 -4
- package/vendor/runtime/dist/{watch-BGt4kcE6.js.map → watch-CUDGkljG.js.map} +1 -1
- package/vendor/runtime/package.json +3 -3
- package/vendor/runtime/skills/acpx/SKILL.md +42 -11
- package/vendor/runtime/dist/agent-registry-DxcyXXqb.js.map +0 -1
- package/vendor/runtime/dist/cli-BKmMxgix.js.map +0 -1
- package/vendor/runtime/dist/client-C5zneoBs.d.ts.map +0 -1
- package/vendor/runtime/dist/flows-VrII9VKZ.js.map +0 -1
- package/vendor/runtime/dist/invocation-options-DHMZ5Rrb.js.map +0 -1
- package/vendor/runtime/dist/ipc-CNNM5DP_.js.map +0 -1
- package/vendor/runtime/dist/output-DtzXtiBc.js.map +0 -1
- package/vendor/runtime/dist/queue-owner-runtime-ehuh3SQU.js.map +0 -1
- package/vendor/runtime/dist/session-options-NjpFwf-c.d.ts.map +0 -1
|
@@ -2,7 +2,171 @@ import fs from "node:fs";
|
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { execFile } from "node:child_process";
|
|
5
|
-
|
|
5
|
+
// src/spawn-command-options.ts
|
|
6
|
+
function readWindowsEnvValue(env, key) {
|
|
7
|
+
const matchedKey = Object.keys(env).find((entry) => entry.toUpperCase() === key);
|
|
8
|
+
return matchedKey ? env[matchedKey] : void 0;
|
|
9
|
+
}
|
|
10
|
+
function windowsExecutableExtensions(env) {
|
|
11
|
+
return (readWindowsEnvValue(env, "PATHEXT") ?? ".COM;.EXE;.BAT;.CMD").split(";").map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0);
|
|
12
|
+
}
|
|
13
|
+
function commandCandidates(command, env) {
|
|
14
|
+
if (path.extname(command).length > 0) return [command];
|
|
15
|
+
return windowsExecutableExtensions(env).map((extension) => `${command}${extension}`);
|
|
16
|
+
}
|
|
17
|
+
function commandHasPath(command) {
|
|
18
|
+
return command.includes("/") || command.includes("\\") || path.isAbsolute(command);
|
|
19
|
+
}
|
|
20
|
+
function resolveWindowsPathCommand(command, env, cwd) {
|
|
21
|
+
const candidates = commandCandidates(command, env);
|
|
22
|
+
const pathValue = readWindowsEnvValue(env, "PATH");
|
|
23
|
+
if (!pathValue) return;
|
|
24
|
+
for (const directory of pathValue.split(";")) {
|
|
25
|
+
const resolved = findExistingCommandInDirectory(directory, candidates, cwd);
|
|
26
|
+
if (resolved) return resolved;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function findExistingCommandInDirectory(directory, candidates, cwd) {
|
|
30
|
+
const trimmedDirectory = directory.trim();
|
|
31
|
+
if (trimmedDirectory.length === 0) return;
|
|
32
|
+
return candidates.map((candidate) => fromWorkingDirectory(path.join(trimmedDirectory, candidate), cwd)).find((resolved) => fs.existsSync(resolved));
|
|
33
|
+
}
|
|
34
|
+
function fromWorkingDirectory(value, cwd) {
|
|
35
|
+
return cwd !== void 0 && !path.isAbsolute(value) ? path.resolve(cwd, value) : value;
|
|
36
|
+
}
|
|
37
|
+
function resolveWindowsWrapperToken(token, wrapperPath) {
|
|
38
|
+
const relative = token.match(/%~?dp0%?\s*[\\/]*(.*)$/i)?.[1]?.trim();
|
|
39
|
+
if (!relative) return;
|
|
40
|
+
const candidate = path.resolve(path.dirname(wrapperPath), relative.replace(/[\\/]+/g, path.sep).replace(/^[\\/]+/, ""));
|
|
41
|
+
return path.extname(candidate).toLowerCase() === ".exe" && fs.existsSync(candidate) ? candidate : void 0;
|
|
42
|
+
}
|
|
43
|
+
function resolveWindowsWrapperExecutable(wrapperPath) {
|
|
44
|
+
if (!fs.existsSync(wrapperPath)) return;
|
|
45
|
+
try {
|
|
46
|
+
return [...fs.readFileSync(wrapperPath, "utf8").matchAll(/"([^"\r\n]*)"/g)].map((match) => resolveWindowsWrapperToken(match[1] ?? "", wrapperPath)).find((candidate) => candidate !== void 0);
|
|
47
|
+
} catch {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function resolveWindowsCommand(command, env = process.env, cwd) {
|
|
52
|
+
const candidates = commandCandidates(command, env);
|
|
53
|
+
if (commandHasPath(command)) return candidates.map((candidate) => fromWorkingDirectory(candidate, cwd)).find((candidate) => fs.existsSync(candidate));
|
|
54
|
+
return resolveWindowsPathCommand(command, env, cwd);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Resolve a Windows command to a native executable suitable for direct spawn.
|
|
58
|
+
*
|
|
59
|
+
* Batch and PowerShell shims are intentionally rejected unless they point at a
|
|
60
|
+
* real `.exe` entrypoint. Callers that need shell execution should use the
|
|
61
|
+
* command-specific shell policy instead.
|
|
62
|
+
*/
|
|
63
|
+
function resolveWindowsExecutablePath(command, env = process.env, cwd) {
|
|
64
|
+
const resolved = resolveWindowsCommand(command, env, cwd);
|
|
65
|
+
if (!resolved) return;
|
|
66
|
+
const absolute = path.resolve(resolved);
|
|
67
|
+
const extension = path.extname(absolute).toLowerCase();
|
|
68
|
+
if (extension === ".exe") return absolute;
|
|
69
|
+
if (extension !== ".cmd" && extension !== ".bat" && extension !== ".ps1") return;
|
|
70
|
+
const siblingExecutable = `${absolute.slice(0, -extension.length)}.exe`;
|
|
71
|
+
return fs.existsSync(siblingExecutable) ? siblingExecutable : resolveWindowsWrapperExecutable(absolute);
|
|
72
|
+
}
|
|
73
|
+
function shouldUseWindowsBatchShell(command, platform = process.platform, env = process.env, cwd) {
|
|
74
|
+
if (platform !== "win32") return false;
|
|
75
|
+
const resolvedCommand = resolveWindowsCommand(command, env, cwd) ?? command;
|
|
76
|
+
const ext = path.extname(resolvedCommand).toLowerCase();
|
|
77
|
+
return ext === ".cmd" || ext === ".bat";
|
|
78
|
+
}
|
|
79
|
+
const CMD_META_CHAR_RE = /([()\][%!^"`<>&|;, *?])/gu;
|
|
80
|
+
const CMD_SHIM_RE = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/iu;
|
|
81
|
+
function escapeCmdCommand(value) {
|
|
82
|
+
return value.replace(CMD_META_CHAR_RE, "^$1");
|
|
83
|
+
}
|
|
84
|
+
function escapeCmdArgument(value, doubleEscapeMeta) {
|
|
85
|
+
const escaped = `"${escapeBackslashesForQuoting(value)}"`.replace(CMD_META_CHAR_RE, "^$1");
|
|
86
|
+
return doubleEscapeMeta ? escaped.replace(CMD_META_CHAR_RE, "^$1") : escaped;
|
|
87
|
+
}
|
|
88
|
+
function escapeBackslashesForQuoting(value) {
|
|
89
|
+
let result = "";
|
|
90
|
+
let backslashes = 0;
|
|
91
|
+
for (const char of value) {
|
|
92
|
+
if (char === "\\") {
|
|
93
|
+
backslashes += 1;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
result += "\\".repeat(char === "\"" ? backslashes * 2 + 1 : backslashes) + char;
|
|
97
|
+
backslashes = 0;
|
|
98
|
+
}
|
|
99
|
+
return result + "\\".repeat(backslashes * 2);
|
|
100
|
+
}
|
|
101
|
+
function buildAgentSpawnCommand(command, args, platform = process.platform, env = process.env, cwd) {
|
|
102
|
+
if (!shouldUseWindowsBatchShell(command, platform, env, cwd)) return {
|
|
103
|
+
command,
|
|
104
|
+
args: [...args]
|
|
105
|
+
};
|
|
106
|
+
const resolvedCommand = path.win32.normalize(resolveWindowsCommand(command, env, cwd) ?? command);
|
|
107
|
+
const doubleEscapeMeta = CMD_SHIM_RE.test(resolvedCommand);
|
|
108
|
+
const shellCommand = [escapeCmdCommand(resolvedCommand), ...args.map((arg) => escapeCmdArgument(arg, doubleEscapeMeta))].join(" ");
|
|
109
|
+
return {
|
|
110
|
+
command: readWindowsEnvValue(env, "COMSPEC") ?? "cmd.exe",
|
|
111
|
+
args: [
|
|
112
|
+
"/d",
|
|
113
|
+
"/s",
|
|
114
|
+
"/c",
|
|
115
|
+
`"${shellCommand}"`
|
|
116
|
+
],
|
|
117
|
+
windowsVerbatimArguments: true
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function buildSpawnCommandOptions(command, options, platform = process.platform, env = process.env, cwd) {
|
|
121
|
+
if (!shouldUseWindowsBatchShell(command, platform, env, cwd)) return options;
|
|
122
|
+
return {
|
|
123
|
+
...options,
|
|
124
|
+
shell: true
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function buildTerminalSpawnCommand(command, args) {
|
|
128
|
+
return {
|
|
129
|
+
command,
|
|
130
|
+
args: args ?? [],
|
|
131
|
+
killProcessGroup: false
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function buildTerminalShellSpawnCommand(command, platform = process.platform) {
|
|
135
|
+
if (platform === "win32") return {
|
|
136
|
+
command: "cmd.exe",
|
|
137
|
+
args: [
|
|
138
|
+
"/d",
|
|
139
|
+
"/s",
|
|
140
|
+
"/c",
|
|
141
|
+
command
|
|
142
|
+
],
|
|
143
|
+
killProcessGroup: true
|
|
144
|
+
};
|
|
145
|
+
return {
|
|
146
|
+
command: "/bin/sh",
|
|
147
|
+
args: ["-c", command],
|
|
148
|
+
killProcessGroup: true
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
/** Finds an installed entrypoint without executing it. */
|
|
152
|
+
function resolveInstalledExecutable(command, { env, cwd } = {
|
|
153
|
+
env: process.env,
|
|
154
|
+
cwd: process.cwd()
|
|
155
|
+
}) {
|
|
156
|
+
if (process.platform === "win32") {
|
|
157
|
+
const resolved = resolveWindowsCommand(command, env, cwd);
|
|
158
|
+
return resolved && fs.statSync(resolved, { throwIfNoEntry: false })?.isFile() ? path.resolve(resolved) : void 0;
|
|
159
|
+
}
|
|
160
|
+
return (command.includes("/") ? [path.resolve(cwd, command)] : (env.PATH ?? "").split(path.delimiter).map((directory) => path.resolve(cwd, directory, command))).find((candidate) => {
|
|
161
|
+
try {
|
|
162
|
+
fs.accessSync(candidate, fs.constants.X_OK);
|
|
163
|
+
return fs.statSync(candidate).isFile();
|
|
164
|
+
} catch {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
// src/acp/client-process.ts
|
|
6
170
|
const PROCESS_HELPER_TIMEOUT_MS = 8e3;
|
|
7
171
|
const PROCESS_HELPER_MAX_BUFFER_BYTES = 33554432;
|
|
8
172
|
async function runTimedExecFile(command, args, options = {}) {
|
|
@@ -199,180 +363,22 @@ async function runWslpath(cwd) {
|
|
|
199
363
|
function basenameToken(value) {
|
|
200
364
|
return path.basename(value).toLowerCase().replace(/\.(cmd|exe|bat)$/u, "");
|
|
201
365
|
}
|
|
202
|
-
|
|
203
|
-
//#region src/spawn-command-options.ts
|
|
204
|
-
function readWindowsEnvValue(env, key) {
|
|
205
|
-
const matchedKey = Object.keys(env).find((entry) => entry.toUpperCase() === key);
|
|
206
|
-
return matchedKey ? env[matchedKey] : void 0;
|
|
207
|
-
}
|
|
208
|
-
function windowsExecutableExtensions(env) {
|
|
209
|
-
return (readWindowsEnvValue(env, "PATHEXT") ?? ".COM;.EXE;.BAT;.CMD").split(";").map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0);
|
|
210
|
-
}
|
|
211
|
-
function commandCandidates(command, env) {
|
|
212
|
-
if (path.extname(command).length > 0) return [command];
|
|
213
|
-
return windowsExecutableExtensions(env).map((extension) => `${command}${extension}`);
|
|
214
|
-
}
|
|
215
|
-
function commandHasPath(command) {
|
|
216
|
-
return command.includes("/") || command.includes("\\") || path.isAbsolute(command);
|
|
217
|
-
}
|
|
218
|
-
function resolveWindowsPathCommand(command, env, cwd) {
|
|
219
|
-
const candidates = commandCandidates(command, env);
|
|
220
|
-
const pathValue = readWindowsEnvValue(env, "PATH");
|
|
221
|
-
if (!pathValue) return;
|
|
222
|
-
for (const directory of pathValue.split(";")) {
|
|
223
|
-
const resolved = findExistingCommandInDirectory(directory, candidates, cwd);
|
|
224
|
-
if (resolved) return resolved;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
function findExistingCommandInDirectory(directory, candidates, cwd) {
|
|
228
|
-
const trimmedDirectory = directory.trim();
|
|
229
|
-
if (trimmedDirectory.length === 0) return;
|
|
230
|
-
return candidates.map((candidate) => fromWorkingDirectory(path.join(trimmedDirectory, candidate), cwd)).find((resolved) => fs.existsSync(resolved));
|
|
231
|
-
}
|
|
232
|
-
function fromWorkingDirectory(value, cwd) {
|
|
233
|
-
return cwd !== void 0 && !path.isAbsolute(value) ? path.resolve(cwd, value) : value;
|
|
234
|
-
}
|
|
235
|
-
function resolveWindowsWrapperToken(token, wrapperPath) {
|
|
236
|
-
const relative = token.match(/%~?dp0%?\s*[\\/]*(.*)$/i)?.[1]?.trim();
|
|
237
|
-
if (!relative) return;
|
|
238
|
-
const candidate = path.resolve(path.dirname(wrapperPath), relative.replace(/[\\/]+/g, path.sep).replace(/^[\\/]+/, ""));
|
|
239
|
-
return path.extname(candidate).toLowerCase() === ".exe" && fs.existsSync(candidate) ? candidate : void 0;
|
|
240
|
-
}
|
|
241
|
-
function resolveWindowsWrapperExecutable(wrapperPath) {
|
|
242
|
-
if (!fs.existsSync(wrapperPath)) return;
|
|
243
|
-
try {
|
|
244
|
-
return [...fs.readFileSync(wrapperPath, "utf8").matchAll(/"([^"\r\n]*)"/g)].map((match) => resolveWindowsWrapperToken(match[1] ?? "", wrapperPath)).find((candidate) => candidate !== void 0);
|
|
245
|
-
} catch {
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
function resolveWindowsCommand(command, env = process.env, cwd) {
|
|
250
|
-
const candidates = commandCandidates(command, env);
|
|
251
|
-
if (commandHasPath(command)) return candidates.map((candidate) => fromWorkingDirectory(candidate, cwd)).find((candidate) => fs.existsSync(candidate));
|
|
252
|
-
return resolveWindowsPathCommand(command, env, cwd);
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Resolve a Windows command to a native executable suitable for direct spawn.
|
|
256
|
-
*
|
|
257
|
-
* Batch and PowerShell shims are intentionally rejected unless they point at a
|
|
258
|
-
* real `.exe` entrypoint. Callers that need shell execution should use the
|
|
259
|
-
* command-specific shell policy instead.
|
|
260
|
-
*/
|
|
261
|
-
function resolveWindowsExecutablePath(command, env = process.env, cwd) {
|
|
262
|
-
const resolved = resolveWindowsCommand(command, env, cwd);
|
|
263
|
-
if (!resolved) return;
|
|
264
|
-
const absolute = path.resolve(resolved);
|
|
265
|
-
const extension = path.extname(absolute).toLowerCase();
|
|
266
|
-
if (extension === ".exe") return absolute;
|
|
267
|
-
if (extension !== ".cmd" && extension !== ".bat" && extension !== ".ps1") return;
|
|
268
|
-
const siblingExecutable = `${absolute.slice(0, -extension.length)}.exe`;
|
|
269
|
-
return fs.existsSync(siblingExecutable) ? siblingExecutable : resolveWindowsWrapperExecutable(absolute);
|
|
270
|
-
}
|
|
271
|
-
function shouldUseWindowsBatchShell(command, platform = process.platform, env = process.env, cwd) {
|
|
272
|
-
if (platform !== "win32") return false;
|
|
273
|
-
const resolvedCommand = resolveWindowsCommand(command, env, cwd) ?? command;
|
|
274
|
-
const ext = path.extname(resolvedCommand).toLowerCase();
|
|
275
|
-
return ext === ".cmd" || ext === ".bat";
|
|
276
|
-
}
|
|
277
|
-
const CMD_META_CHAR_RE = /([()\][%!^"`<>&|;, *?])/gu;
|
|
278
|
-
const CMD_SHIM_RE = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/iu;
|
|
279
|
-
function escapeCmdCommand(value) {
|
|
280
|
-
return value.replace(CMD_META_CHAR_RE, "^$1");
|
|
281
|
-
}
|
|
282
|
-
function escapeCmdArgument(value, doubleEscapeMeta) {
|
|
283
|
-
const escaped = `"${escapeBackslashesForQuoting(value)}"`.replace(CMD_META_CHAR_RE, "^$1");
|
|
284
|
-
return doubleEscapeMeta ? escaped.replace(CMD_META_CHAR_RE, "^$1") : escaped;
|
|
285
|
-
}
|
|
286
|
-
function escapeBackslashesForQuoting(value) {
|
|
287
|
-
let result = "";
|
|
288
|
-
let backslashes = 0;
|
|
289
|
-
for (const char of value) {
|
|
290
|
-
if (char === "\\") {
|
|
291
|
-
backslashes += 1;
|
|
292
|
-
continue;
|
|
293
|
-
}
|
|
294
|
-
result += "\\".repeat(char === "\"" ? backslashes * 2 + 1 : backslashes) + char;
|
|
295
|
-
backslashes = 0;
|
|
296
|
-
}
|
|
297
|
-
return result + "\\".repeat(backslashes * 2);
|
|
298
|
-
}
|
|
299
|
-
function buildAgentSpawnCommand(command, args, platform = process.platform, env = process.env, cwd) {
|
|
300
|
-
if (!shouldUseWindowsBatchShell(command, platform, env, cwd)) return {
|
|
301
|
-
command,
|
|
302
|
-
args: [...args]
|
|
303
|
-
};
|
|
304
|
-
const resolvedCommand = path.win32.normalize(resolveWindowsCommand(command, env, cwd) ?? command);
|
|
305
|
-
const doubleEscapeMeta = CMD_SHIM_RE.test(resolvedCommand);
|
|
306
|
-
const shellCommand = [escapeCmdCommand(resolvedCommand), ...args.map((arg) => escapeCmdArgument(arg, doubleEscapeMeta))].join(" ");
|
|
307
|
-
return {
|
|
308
|
-
command: readWindowsEnvValue(env, "COMSPEC") ?? "cmd.exe",
|
|
309
|
-
args: [
|
|
310
|
-
"/d",
|
|
311
|
-
"/s",
|
|
312
|
-
"/c",
|
|
313
|
-
`"${shellCommand}"`
|
|
314
|
-
],
|
|
315
|
-
windowsVerbatimArguments: true
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
function buildSpawnCommandOptions(command, options, platform = process.platform, env = process.env, cwd) {
|
|
319
|
-
if (!shouldUseWindowsBatchShell(command, platform, env, cwd)) return options;
|
|
320
|
-
return {
|
|
321
|
-
...options,
|
|
322
|
-
shell: true
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
function buildTerminalSpawnCommand(command, args) {
|
|
326
|
-
return {
|
|
327
|
-
command,
|
|
328
|
-
args: args ?? [],
|
|
329
|
-
killProcessGroup: false
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
function buildTerminalShellSpawnCommand(command, platform = process.platform) {
|
|
333
|
-
if (platform === "win32") return {
|
|
334
|
-
command: "cmd.exe",
|
|
335
|
-
args: [
|
|
336
|
-
"/d",
|
|
337
|
-
"/s",
|
|
338
|
-
"/c",
|
|
339
|
-
command
|
|
340
|
-
],
|
|
341
|
-
killProcessGroup: true
|
|
342
|
-
};
|
|
343
|
-
return {
|
|
344
|
-
command: "/bin/sh",
|
|
345
|
-
args: ["-c", command],
|
|
346
|
-
killProcessGroup: true
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
/** Finds an installed entrypoint without executing it. */
|
|
350
|
-
function resolveInstalledExecutable(command) {
|
|
351
|
-
if (process.platform === "win32") {
|
|
352
|
-
const resolved = resolveWindowsCommand(command);
|
|
353
|
-
return resolved && fs.statSync(resolved, { throwIfNoEntry: false })?.isFile() ? path.resolve(resolved) : void 0;
|
|
354
|
-
}
|
|
355
|
-
return (command.includes("/") ? [path.resolve(command)] : (process.env.PATH ?? "").split(path.delimiter).map((directory) => path.resolve(directory, command))).find((candidate) => {
|
|
356
|
-
try {
|
|
357
|
-
fs.accessSync(candidate, fs.constants.X_OK);
|
|
358
|
-
return fs.statSync(candidate).isFile();
|
|
359
|
-
} catch {
|
|
360
|
-
return false;
|
|
361
|
-
}
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
//#endregion
|
|
365
|
-
//#region src/agent-registry.ts
|
|
366
|
+
// src/agent-registry.ts
|
|
366
367
|
const ACP_ADAPTER_PACKAGE_RANGES = {
|
|
367
368
|
pi: "^0.0.33",
|
|
368
369
|
codex: "^1.1.5",
|
|
369
|
-
claude: "^0.
|
|
370
|
+
claude: "^0.95.0",
|
|
370
371
|
mux: "^0.28.0"
|
|
371
372
|
};
|
|
372
373
|
const AGENT_DEFINITIONS = {
|
|
373
374
|
pi: {
|
|
374
375
|
name: "Pi",
|
|
375
|
-
argv: [
|
|
376
|
+
argv: [
|
|
377
|
+
"npx",
|
|
378
|
+
`--package=pi-acp@${ACP_ADAPTER_PACKAGE_RANGES.pi}`,
|
|
379
|
+
"--",
|
|
380
|
+
"pi-acp"
|
|
381
|
+
],
|
|
376
382
|
installedArgv: ["pi-acp"],
|
|
377
383
|
requiredCommands: ["pi"],
|
|
378
384
|
package: {
|
|
@@ -390,14 +396,16 @@ const AGENT_DEFINITIONS = {
|
|
|
390
396
|
argv: [
|
|
391
397
|
"npx",
|
|
392
398
|
"-y",
|
|
393
|
-
|
|
399
|
+
`--package=@agentclientprotocol/codex-acp@${ACP_ADAPTER_PACKAGE_RANGES.codex}`,
|
|
400
|
+
"--",
|
|
401
|
+
"codex-acp"
|
|
394
402
|
],
|
|
395
403
|
installedArgv: ["codex-acp"],
|
|
396
404
|
package: {
|
|
397
405
|
packageName: "@agentclientprotocol/codex-acp",
|
|
398
406
|
packageRange: ACP_ADAPTER_PACKAGE_RANGES.codex,
|
|
399
407
|
preferredBinName: "codex-acp",
|
|
400
|
-
legacyFallbackCommands: []
|
|
408
|
+
legacyFallbackCommands: [`npx -y @agentclientprotocol/codex-acp@${ACP_ADAPTER_PACKAGE_RANGES.codex}`]
|
|
401
409
|
},
|
|
402
410
|
packageExecFallback: true
|
|
403
411
|
},
|
|
@@ -406,14 +414,16 @@ const AGENT_DEFINITIONS = {
|
|
|
406
414
|
argv: [
|
|
407
415
|
"npx",
|
|
408
416
|
"-y",
|
|
409
|
-
|
|
417
|
+
`--package=@agentclientprotocol/claude-agent-acp@${ACP_ADAPTER_PACKAGE_RANGES.claude}`,
|
|
418
|
+
"--",
|
|
419
|
+
"claude-agent-acp"
|
|
410
420
|
],
|
|
411
421
|
installedArgv: ["claude-agent-acp"],
|
|
412
422
|
package: {
|
|
413
423
|
packageName: "@agentclientprotocol/claude-agent-acp",
|
|
414
424
|
packageRange: ACP_ADAPTER_PACKAGE_RANGES.claude,
|
|
415
425
|
preferredBinName: "claude-agent-acp",
|
|
416
|
-
legacyFallbackCommands: [`npm exec @agentclientprotocol/claude-agent-acp@${ACP_ADAPTER_PACKAGE_RANGES.claude}`]
|
|
426
|
+
legacyFallbackCommands: [`npx -y @agentclientprotocol/claude-agent-acp@${ACP_ADAPTER_PACKAGE_RANGES.claude}`, `npm exec @agentclientprotocol/claude-agent-acp@${ACP_ADAPTER_PACKAGE_RANGES.claude}`]
|
|
417
427
|
},
|
|
418
428
|
packageExecFallback: true
|
|
419
429
|
},
|
|
@@ -433,6 +443,11 @@ const AGENT_DEFINITIONS = {
|
|
|
433
443
|
"--stdio"
|
|
434
444
|
]
|
|
435
445
|
},
|
|
446
|
+
ante: {
|
|
447
|
+
name: "Ante",
|
|
448
|
+
argv: ["ante", "acp"],
|
|
449
|
+
requiredCommands: ["ante-acp"]
|
|
450
|
+
},
|
|
436
451
|
antigravity: {
|
|
437
452
|
name: "Google Antigravity",
|
|
438
453
|
argv: process.platform === "win32" ? ["agy_acp_server.exe"] : ["agy_acp_server.par", ...process.platform === "linux" ? ["--uid="] : []]
|
|
@@ -441,6 +456,14 @@ const AGENT_DEFINITIONS = {
|
|
|
441
456
|
name: "CodeBuddy Code",
|
|
442
457
|
argv: ["codebuddy", "--acp"]
|
|
443
458
|
},
|
|
459
|
+
"deepseek-harness": {
|
|
460
|
+
name: "DeepSeek Harness",
|
|
461
|
+
argv: [
|
|
462
|
+
"dsh",
|
|
463
|
+
"--profile",
|
|
464
|
+
"acp"
|
|
465
|
+
]
|
|
466
|
+
},
|
|
444
467
|
devin: {
|
|
445
468
|
name: "Devin",
|
|
446
469
|
argv: ["devin", "acp"]
|
|
@@ -466,6 +489,10 @@ const AGENT_DEFINITIONS = {
|
|
|
466
489
|
name: "fx",
|
|
467
490
|
argv: ["fx", "acp"]
|
|
468
491
|
},
|
|
492
|
+
goose: {
|
|
493
|
+
name: "Goose",
|
|
494
|
+
argv: ["goose", "acp"]
|
|
495
|
+
},
|
|
469
496
|
"grok-build": {
|
|
470
497
|
name: "Grok Build",
|
|
471
498
|
argv: [
|
|
@@ -487,7 +514,9 @@ const AGENT_DEFINITIONS = {
|
|
|
487
514
|
argv: [
|
|
488
515
|
"npx",
|
|
489
516
|
"-y",
|
|
490
|
-
"
|
|
517
|
+
"--package=@kilocode/cli",
|
|
518
|
+
"--",
|
|
519
|
+
"kilo",
|
|
491
520
|
"acp"
|
|
492
521
|
],
|
|
493
522
|
installedArgv: ["kilo", "acp"]
|
|
@@ -509,7 +538,9 @@ const AGENT_DEFINITIONS = {
|
|
|
509
538
|
argv: [
|
|
510
539
|
"npx",
|
|
511
540
|
"-y",
|
|
512
|
-
|
|
541
|
+
`--package=mux@${ACP_ADAPTER_PACKAGE_RANGES.mux}`,
|
|
542
|
+
"--",
|
|
543
|
+
"mux",
|
|
513
544
|
"acp"
|
|
514
545
|
],
|
|
515
546
|
installedArgv: ["mux", "acp"]
|
|
@@ -527,7 +558,9 @@ const AGENT_DEFINITIONS = {
|
|
|
527
558
|
argv: [
|
|
528
559
|
"npx",
|
|
529
560
|
"-y",
|
|
530
|
-
"opencode-ai",
|
|
561
|
+
"--package=opencode-ai",
|
|
562
|
+
"--",
|
|
563
|
+
"opencode",
|
|
531
564
|
"acp"
|
|
532
565
|
],
|
|
533
566
|
installedArgv: ["opencode", "acp"]
|
|
@@ -812,7 +845,6 @@ function normalizeRegistryOverride(value) {
|
|
|
812
845
|
if (typeof value === "string") return value.trim() || void 0;
|
|
813
846
|
return value.length > 0 && value[0]?.length ? [...value] : void 0;
|
|
814
847
|
}
|
|
815
|
-
|
|
816
|
-
export { renderArgvIdentity as A, PROCESS_HELPER_MAX_BUFFER_BYTES as C, isChildProcessRunning as D, basenameToken as E, splitCommandLine as F, waitForChildExit as I, waitForSpawn as L, resolveAgentCommandParts as M, resolveAgentSessionCwd as N, isoNow as O, runTimedExecFile as P, resolveWindowsExecutablePath as S, asAbsoluteCwd as T, buildSpawnCommandOptions as _, createAgentRegistry as a, readWindowsEnvValue as b, mergeAgentRegistry as c, resolveAgentCommand as d, resolveBuiltInAgentLaunch as f, buildAgentSpawnCommand as g, resolvePackageExecBuiltInAgentLaunch as h, DEFAULT_AGENT_NAME as i, requireAgentStdio as j, normalizeAgentCommandInput as k, normalizeAgentName as l, resolveInstalledBuiltInAgentLaunch as m, AGENT_REGISTRY as n, findBuiltInAgentPackage as o, resolveCanonicalAgentName as p, BUILT_IN_AGENT_PACKAGES as r, listBuiltInAgents as s, AGENT_ARGV_REGISTRY as t, resolveAgentArgv as u, buildTerminalShellSpawnCommand as v, PROCESS_HELPER_TIMEOUT_MS as w, resolveWindowsCommand as x, buildTerminalSpawnCommand as y };
|
|
848
|
+
export { waitForSpawn as A, renderArgvIdentity as C, runTimedExecFile as D, resolveAgentSessionCwd as E, readWindowsEnvValue as F, resolveInstalledExecutable as I, resolveWindowsCommand as L, buildSpawnCommandOptions as M, buildTerminalShellSpawnCommand as N, splitCommandLine as O, buildTerminalSpawnCommand as P, resolveWindowsExecutablePath as R, normalizeAgentCommandInput as S, resolveAgentCommandParts as T, PROCESS_HELPER_TIMEOUT_MS as _, createAgentRegistry as a, isChildProcessRunning as b, mergeAgentRegistry as c, resolveAgentCommand as d, resolveBuiltInAgentLaunch as f, PROCESS_HELPER_MAX_BUFFER_BYTES as g, resolvePackageExecBuiltInAgentLaunch as h, DEFAULT_AGENT_NAME as i, buildAgentSpawnCommand as j, waitForChildExit as k, normalizeAgentName as l, resolveInstalledBuiltInAgentLaunch as m, AGENT_REGISTRY as n, findBuiltInAgentPackage as o, resolveCanonicalAgentName as p, BUILT_IN_AGENT_PACKAGES as r, listBuiltInAgents as s, AGENT_ARGV_REGISTRY as t, resolveAgentArgv as u, asAbsoluteCwd as v, requireAgentStdio as w, isoNow as x, basenameToken as y };
|
|
817
849
|
|
|
818
|
-
//# sourceMappingURL=agent-registry-
|
|
850
|
+
//# sourceMappingURL=agent-registry-CsdsVpJb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-registry-CsdsVpJb.js","names":[],"sources":["../src/spawn-command-options.ts","../src/acp/client-process.ts","../src/agent-registry.ts"],"sourcesContent":["import { spawn } from \"node:child_process\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nexport function readWindowsEnvValue(env: NodeJS.ProcessEnv, key: string): string | undefined {\n const matchedKey = Object.keys(env).find((entry) => entry.toUpperCase() === key);\n return matchedKey ? env[matchedKey] : undefined;\n}\n\nfunction windowsExecutableExtensions(env: NodeJS.ProcessEnv): string[] {\n return (readWindowsEnvValue(env, \"PATHEXT\") ?? \".COM;.EXE;.BAT;.CMD\")\n .split(\";\")\n .map((value) => value.trim().toLowerCase())\n .filter((value) => value.length > 0);\n}\n\nfunction commandCandidates(command: string, env: NodeJS.ProcessEnv): string[] {\n const commandExtension = path.extname(command);\n if (commandExtension.length > 0) {\n return [command];\n }\n return windowsExecutableExtensions(env).map((extension) => `${command}${extension}`);\n}\n\nfunction commandHasPath(command: string): boolean {\n return command.includes(\"/\") || command.includes(\"\\\\\") || path.isAbsolute(command);\n}\n\nfunction resolveWindowsPathCommand(\n command: string,\n env: NodeJS.ProcessEnv,\n cwd?: string,\n): string | undefined {\n const candidates = commandCandidates(command, env);\n const pathValue = readWindowsEnvValue(env, \"PATH\");\n if (!pathValue) {\n return undefined;\n }\n\n for (const directory of pathValue.split(\";\")) {\n const resolved = findExistingCommandInDirectory(directory, candidates, cwd);\n if (resolved) {\n return resolved;\n }\n }\n\n return undefined;\n}\n\nfunction findExistingCommandInDirectory(\n directory: string,\n candidates: string[],\n cwd?: string,\n): string | undefined {\n const trimmedDirectory = directory.trim();\n if (trimmedDirectory.length === 0) {\n return undefined;\n }\n\n return candidates\n .map((candidate) => fromWorkingDirectory(path.join(trimmedDirectory, candidate), cwd))\n .find((resolved) => fs.existsSync(resolved));\n}\n\nfunction fromWorkingDirectory(value: string, cwd?: string): string {\n return cwd !== undefined && !path.isAbsolute(value) ? path.resolve(cwd, value) : value;\n}\n\nfunction resolveWindowsWrapperToken(token: string, wrapperPath: string): string | undefined {\n const relative = token.match(/%~?dp0%?\\s*[\\\\/]*(.*)$/i)?.[1]?.trim();\n if (!relative) {\n return undefined;\n }\n const candidate = path.resolve(\n path.dirname(wrapperPath),\n relative.replace(/[\\\\/]+/g, path.sep).replace(/^[\\\\/]+/, \"\"),\n );\n return path.extname(candidate).toLowerCase() === \".exe\" && fs.existsSync(candidate)\n ? candidate\n : undefined;\n}\n\nfunction resolveWindowsWrapperExecutable(wrapperPath: string): string | undefined {\n if (!fs.existsSync(wrapperPath)) {\n return undefined;\n }\n\n try {\n const content = fs.readFileSync(wrapperPath, \"utf8\");\n return [...content.matchAll(/\"([^\"\\r\\n]*)\"/g)]\n .map((match) => resolveWindowsWrapperToken(match[1] ?? \"\", wrapperPath))\n .find((candidate): candidate is string => candidate !== undefined);\n } catch {\n // Ignore unreadable wrapper scripts and let callers use their fallback.\n return undefined;\n }\n}\n\nexport function resolveWindowsCommand(\n command: string,\n env: NodeJS.ProcessEnv = process.env,\n cwd?: string,\n): string | undefined {\n const candidates = commandCandidates(command, env);\n\n if (commandHasPath(command)) {\n return candidates\n .map((candidate) => fromWorkingDirectory(candidate, cwd))\n .find((candidate) => fs.existsSync(candidate));\n }\n\n return resolveWindowsPathCommand(command, env, cwd);\n}\n\n/**\n * Resolve a Windows command to a native executable suitable for direct spawn.\n *\n * Batch and PowerShell shims are intentionally rejected unless they point at a\n * real `.exe` entrypoint. Callers that need shell execution should use the\n * command-specific shell policy instead.\n */\nexport function resolveWindowsExecutablePath(\n command: string,\n env: NodeJS.ProcessEnv = process.env,\n cwd?: string,\n): string | undefined {\n const resolved = resolveWindowsCommand(command, env, cwd);\n if (!resolved) {\n return undefined;\n }\n\n const absolute = path.resolve(resolved);\n const extension = path.extname(absolute).toLowerCase();\n if (extension === \".exe\") {\n return absolute;\n }\n if (extension !== \".cmd\" && extension !== \".bat\" && extension !== \".ps1\") {\n return undefined;\n }\n\n const siblingExecutable = `${absolute.slice(0, -extension.length)}.exe`;\n return fs.existsSync(siblingExecutable)\n ? siblingExecutable\n : resolveWindowsWrapperExecutable(absolute);\n}\n\nfunction shouldUseWindowsBatchShell(\n command: string,\n platform: NodeJS.Platform = process.platform,\n env: NodeJS.ProcessEnv = process.env,\n cwd?: string,\n): boolean {\n if (platform !== \"win32\") {\n return false;\n }\n const resolvedCommand = resolveWindowsCommand(command, env, cwd) ?? command;\n const ext = path.extname(resolvedCommand).toLowerCase();\n return ext === \".cmd\" || ext === \".bat\";\n}\n\nexport type AgentSpawnCommand = {\n command: string;\n args: string[];\n windowsVerbatimArguments?: boolean;\n};\n\nconst CMD_META_CHAR_RE = /([()\\][%!^\"`<>&|;, *?])/gu;\nconst CMD_SHIM_RE = /node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/iu;\n\nfunction escapeCmdCommand(value: string): string {\n return value.replace(CMD_META_CHAR_RE, \"^$1\");\n}\n\nfunction escapeCmdArgument(value: string, doubleEscapeMeta: boolean): string {\n const quoted = `\"${escapeBackslashesForQuoting(value)}\"`;\n const escaped = quoted.replace(CMD_META_CHAR_RE, \"^$1\");\n return doubleEscapeMeta ? escaped.replace(CMD_META_CHAR_RE, \"^$1\") : escaped;\n}\n\nfunction escapeBackslashesForQuoting(value: string): string {\n let result = \"\";\n let backslashes = 0;\n for (const char of value) {\n if (char === \"\\\\\") {\n backslashes += 1;\n continue;\n }\n result += \"\\\\\".repeat(char === '\"' ? backslashes * 2 + 1 : backslashes) + char;\n backslashes = 0;\n }\n return result + \"\\\\\".repeat(backslashes * 2);\n}\n\nexport function buildAgentSpawnCommand(\n command: string,\n args: readonly string[],\n platform: NodeJS.Platform = process.platform,\n env: NodeJS.ProcessEnv = process.env,\n cwd?: string,\n): AgentSpawnCommand {\n if (!shouldUseWindowsBatchShell(command, platform, env, cwd)) {\n return { command, args: [...args] };\n }\n const resolvedCommand = path.win32.normalize(resolveWindowsCommand(command, env, cwd) ?? command);\n const doubleEscapeMeta = CMD_SHIM_RE.test(resolvedCommand);\n const shellCommand = [\n escapeCmdCommand(resolvedCommand),\n ...args.map((arg) => escapeCmdArgument(arg, doubleEscapeMeta)),\n ].join(\" \");\n return {\n command: readWindowsEnvValue(env, \"COMSPEC\") ?? \"cmd.exe\",\n args: [\"/d\", \"/s\", \"/c\", `\"${shellCommand}\"`],\n windowsVerbatimArguments: true,\n };\n}\n\nexport function buildSpawnCommandOptions(\n command: string,\n options: Parameters<typeof spawn>[2],\n platform: NodeJS.Platform = process.platform,\n env: NodeJS.ProcessEnv = process.env,\n cwd?: string,\n): Parameters<typeof spawn>[2] {\n if (!shouldUseWindowsBatchShell(command, platform, env, cwd)) {\n return options;\n }\n return {\n ...options,\n shell: true,\n };\n}\n\nexport type TerminalSpawnCommand = {\n command: string;\n args: string[];\n killProcessGroup: boolean;\n};\n\nexport function buildTerminalSpawnCommand(\n command: string,\n args: string[] | undefined,\n): TerminalSpawnCommand {\n return { command, args: args ?? [], killProcessGroup: false };\n}\n\nexport function buildTerminalShellSpawnCommand(\n command: string,\n platform: NodeJS.Platform = process.platform,\n): TerminalSpawnCommand {\n if (platform === \"win32\") {\n return { command: \"cmd.exe\", args: [\"/d\", \"/s\", \"/c\", command], killProcessGroup: true };\n }\n return { command: \"/bin/sh\", args: [\"-c\", command], killProcessGroup: true };\n}\n\n/** Finds an installed entrypoint without executing it. */\nexport function resolveInstalledExecutable(\n command: string,\n { env, cwd }: { env: NodeJS.ProcessEnv; cwd: string } = {\n env: process.env,\n cwd: process.cwd(),\n },\n): string | undefined {\n if (process.platform === \"win32\") {\n const resolved = resolveWindowsCommand(command, env, cwd);\n return resolved && fs.statSync(resolved, { throwIfNoEntry: false })?.isFile()\n ? path.resolve(resolved)\n : undefined;\n }\n const candidates = command.includes(\"/\")\n ? [path.resolve(cwd, command)]\n : (env.PATH ?? \"\")\n .split(path.delimiter)\n .map((directory) => path.resolve(cwd, directory, command));\n return candidates.find((candidate) => {\n try {\n fs.accessSync(candidate, fs.constants.X_OK);\n return fs.statSync(candidate).isFile();\n } catch {\n return false;\n }\n });\n}\n","import { execFile, type ChildProcess, type ChildProcessByStdio } from \"node:child_process\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Readable, Writable } from \"node:stream\";\n\nexport const PROCESS_HELPER_TIMEOUT_MS = 8_000;\nexport const PROCESS_HELPER_MAX_BUFFER_BYTES = 32 * 1024 * 1024;\n\nexport async function runTimedExecFile(\n command: string,\n args: readonly string[],\n options: {\n timeoutMs?: number;\n maxBufferBytes?: number;\n windowsHide?: boolean;\n env?: NodeJS.ProcessEnv;\n } = {},\n): Promise<string> {\n const timeoutMs = Math.max(1, Math.round(options.timeoutMs ?? PROCESS_HELPER_TIMEOUT_MS));\n return await new Promise<string>((resolve, reject) => {\n let settled = false;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const child = execFile(\n command,\n [...args],\n {\n encoding: \"utf8\",\n maxBuffer: options.maxBufferBytes ?? PROCESS_HELPER_MAX_BUFFER_BYTES,\n killSignal: \"SIGKILL\",\n windowsHide: options.windowsHide,\n env: options.env,\n },\n (error, stdout) => {\n if (settled) {\n return;\n }\n settled = true;\n if (timer) {\n clearTimeout(timer);\n }\n if (error) {\n reject(error);\n return;\n }\n resolve(stdout);\n },\n );\n\n timer = setTimeout(() => {\n if (settled) {\n return;\n }\n settled = true;\n const killed = child.kill(\"SIGKILL\");\n child.stdout?.destroy();\n child.stderr?.destroy();\n child.unref();\n reject(\n Object.assign(new Error(`${command} timed out after ${timeoutMs}ms`), {\n code: \"ETIMEDOUT\",\n killed,\n signal: \"SIGKILL\" as const,\n }),\n );\n }, timeoutMs);\n });\n}\n\nexport type CommandParts = {\n command: string;\n args: string[];\n};\n\nexport function normalizeAgentCommandInput(value: string | readonly string[]): {\n agentCommand: string;\n agentArgv?: string[];\n} {\n if (typeof value === \"string\") {\n return { agentCommand: value };\n }\n const parts = toCommandParts([...value]);\n const argv = [parts.command, ...parts.args];\n return {\n agentCommand: renderArgvIdentity(argv),\n agentArgv: argv,\n };\n}\n\nconst IDENTITY_SAFE_ARG_RE = /^[A-Za-z0-9_@%+=:,./^~-]+$/u;\n\nexport function renderArgvIdentity(argv: readonly string[]): string {\n return argv.map((arg) => (IDENTITY_SAFE_ARG_RE.test(arg) ? arg : JSON.stringify(arg))).join(\" \");\n}\n\ntype ResolveSessionCwdOptions = {\n platform?: NodeJS.Platform;\n existsSync?: (filePath: string) => boolean;\n runWslpath?: (cwd: string) => Promise<string>;\n};\n\nexport function isoNow(): string {\n return new Date().toISOString();\n}\n\nexport function waitForSpawn(child: ChildProcess): Promise<void> {\n return new Promise((resolve, reject) => {\n const onSpawn = () => {\n child.off(\"error\", onError);\n resolve();\n };\n const onError = (error: Error) => {\n child.off(\"spawn\", onSpawn);\n reject(error);\n };\n\n child.once(\"spawn\", onSpawn);\n child.once(\"error\", onError);\n });\n}\n\nexport function isChildProcessRunning(child: ChildProcess): boolean {\n return child.exitCode == null && child.signalCode == null;\n}\n\nexport function requireAgentStdio(\n child: ChildProcess,\n): ChildProcessByStdio<Writable, Readable, Readable> {\n if (!child.stdin || !child.stdout || !child.stderr) {\n throw new Error(\"ACP agent must be spawned with piped stdin/stdout/stderr\");\n }\n return child as ChildProcessByStdio<Writable, Readable, Readable>;\n}\n\nexport function waitForChildExit(child: ChildProcess, timeoutMs: number): Promise<boolean> {\n if (!isChildProcessRunning(child)) {\n return Promise.resolve(true);\n }\n\n return new Promise<boolean>((resolve) => {\n let settled = false;\n const timer = setTimeout(\n () => {\n finish(false);\n },\n Math.max(0, timeoutMs),\n );\n\n const finish = (value: boolean) => {\n if (settled) {\n return;\n }\n settled = true;\n child.off(\"close\", onExitLike);\n child.off(\"exit\", onExitLike);\n clearTimeout(timer);\n resolve(value);\n };\n\n const onExitLike = () => {\n finish(true);\n };\n\n child.once(\"close\", onExitLike);\n child.once(\"exit\", onExitLike);\n });\n}\n\nexport function resolveAgentCommandParts(\n value: string,\n argv: readonly string[] | undefined,\n platform: NodeJS.Platform = process.platform,\n): CommandParts {\n if (argv) {\n const parts = toCommandParts([...argv]);\n assertWindowsLaunchableCommand(parts.command, platform);\n return parts;\n }\n if (platform === \"win32\") {\n throw new Error(\n 'Raw agent command strings are not supported on Windows. Configure the agent with an argv array, for example: \"argv\": [\"agent.exe\", \"--acp\"]. Legacy agents.<name>.args arrays are migrated automatically. Existing sessions without saved argv must be closed and recreated.',\n );\n }\n return splitCommandLine(value);\n}\n\nfunction assertWindowsLaunchableCommand(command: string, platform: NodeJS.Platform): void {\n if (platform === \"win32\" && path.extname(command).toLowerCase() === \".sh\") {\n throw new Error(\n `Windows cannot launch shell script executable \"${command}\" directly. Configure an explicit interpreter argv, for example: \"argv\": [\"bash\", \"${command}\"]. acpx does not infer interpreters.`,\n );\n }\n}\n\ntype CommandLineState = {\n current: string;\n quote: \"'\" | '\"' | null;\n escaping: boolean;\n parts: string[];\n hasPart: boolean;\n};\n\nexport function splitCommandLine(value: string): CommandParts {\n const state: CommandLineState = {\n current: \"\",\n quote: null,\n escaping: false,\n parts: [],\n hasPart: false,\n };\n for (const ch of value) {\n readCommandLineChar(state, ch);\n }\n\n if (state.escaping) {\n state.current += \"\\\\\";\n state.hasPart = true;\n }\n if (state.quote) {\n throw new Error(\"Invalid --agent command: unterminated quote\");\n }\n flushCommandLinePart(state);\n return toCommandParts(state.parts);\n}\n\nfunction toCommandParts(parts: string[]): CommandParts {\n if (parts.length === 0 || parts[0] === \"\") {\n throw new Error(\"Invalid --agent command: empty command\");\n }\n return {\n command: parts[0],\n args: parts.slice(1),\n };\n}\n\nfunction readCommandLineChar(state: CommandLineState, ch: string): void {\n if (state.escaping) {\n state.current += ch;\n state.escaping = false;\n state.hasPart = true;\n } else if (ch === \"\\\\\" && state.quote !== \"'\") {\n state.escaping = true;\n } else if (state.quote) {\n if (ch === state.quote) {\n state.quote = null;\n } else {\n state.current += ch;\n }\n state.hasPart = true;\n } else {\n readUnquotedCommandLineChar(state, ch);\n }\n}\n\nfunction readUnquotedCommandLineChar(state: CommandLineState, ch: string): void {\n if (ch === \"'\" || ch === '\"') {\n state.quote = ch;\n state.hasPart = true;\n } else if (/\\s/.test(ch)) {\n flushCommandLinePart(state);\n } else {\n state.current += ch;\n state.hasPart = true;\n }\n}\n\nfunction flushCommandLinePart(state: CommandLineState): void {\n if (state.hasPart) {\n state.parts.push(state.current);\n state.current = \"\";\n state.hasPart = false;\n }\n}\n\nexport function asAbsoluteCwd(cwd: string): string {\n return path.resolve(cwd);\n}\n\nexport async function resolveAgentSessionCwd(\n cwd: string,\n agentCommand: string,\n options: ResolveSessionCwdOptions = {},\n): Promise<string> {\n const resolved = asAbsoluteCwd(cwd);\n if (!shouldTranslateWslWindowsCwd(agentCommand, options)) {\n return resolved;\n }\n\n const translated = (await (options.runWslpath ?? runWslpath)(resolved)).trim();\n if (!translated) {\n throw new Error(`wslpath returned an empty Windows path for cwd: ${resolved}`);\n }\n return translated;\n}\n\nfunction shouldTranslateWslWindowsCwd(\n agentCommand: string,\n options: ResolveSessionCwdOptions,\n): boolean {\n if (!isWsl(options)) {\n return false;\n }\n\n try {\n const { command } = splitCommandLine(agentCommand);\n return isWindowsExecutableCommand(command);\n } catch {\n return false;\n }\n}\n\nfunction isWsl(options: ResolveSessionCwdOptions): boolean {\n const platform = options.platform ?? process.platform;\n if (platform !== \"linux\") {\n return false;\n }\n\n const existsSync = options.existsSync ?? fs.existsSync;\n return existsSync(\"/proc/sys/fs/binfmt_misc/WSLInterop\");\n}\n\nconst WINDOWS_EXECUTABLE_EXTENSION_RE = /\\.(?:exe|cmd|bat)$/u;\n\nfunction isWindowsExecutableCommand(command: string): boolean {\n const normalized = command.toLowerCase();\n return WINDOWS_EXECUTABLE_EXTENSION_RE.test(normalized);\n}\n\nasync function runWslpath(cwd: string): Promise<string> {\n return await runTimedExecFile(\"wslpath\", [\"-w\", cwd]);\n}\n\nexport function basenameToken(value: string): string {\n return path\n .basename(value)\n .toLowerCase()\n .replace(/\\.(cmd|exe|bat)$/u, \"\");\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { splitCommandLine } from \"./acp/client-process.js\";\nimport { resolveInstalledExecutable } from \"./spawn-command-options.js\";\n\n// Changing a range changes the built-in command saved in session records: add the\n// previous command to LEGACY_AGENT_COMMANDS in src/acp/builtin-command-migration.ts.\nconst ACP_ADAPTER_PACKAGE_RANGES = {\n pi: \"^0.0.33\",\n codex: \"^1.1.5\",\n claude: \"^0.95.0\",\n mux: \"^0.28.0\",\n} as const;\n\ntype BuiltInAgentPackageSpec = {\n packageName: string;\n packageRange: string;\n preferredBinName: string;\n fallbackCommand: string;\n legacyFallbackCommands?: string[];\n};\n\ntype BuiltInAgentLaunch = {\n source: \"installed\" | \"package-exec\";\n command: string;\n args: string[];\n packageName: string;\n packageRange: string;\n packageVersion?: string;\n binPath?: string;\n npmCliPath?: string;\n};\n\ntype BuiltInLaunchResolverOptions = {\n existsSync?: (path: string) => boolean;\n readFileSync?: typeof fs.readFileSync;\n resolvePackageRoot?: (packageName: string) => string | undefined;\n execPath?: string;\n resolveNpmCliPath?: (execPath: string) => string;\n};\n\ntype AgentDefinition = {\n name: string;\n argv: string[];\n installedArgv?: string[];\n requiredCommands?: string[];\n package?: Omit<BuiltInAgentPackageSpec, \"fallbackCommand\">;\n packageExecFallback?: boolean;\n};\n\nconst AGENT_DEFINITIONS: Record<string, AgentDefinition> = {\n pi: {\n name: \"Pi\",\n argv: [\"npx\", `--package=pi-acp@${ACP_ADAPTER_PACKAGE_RANGES.pi}`, \"--\", \"pi-acp\"],\n installedArgv: [\"pi-acp\"],\n requiredCommands: [\"pi\"],\n package: {\n packageName: \"pi-acp\",\n packageRange: ACP_ADAPTER_PACKAGE_RANGES.pi,\n preferredBinName: \"pi-acp\",\n },\n },\n openclaw: { name: \"OpenClaw\", argv: [\"openclaw\", \"acp\"] },\n codex: {\n name: \"Codex\",\n argv: [\n \"npx\",\n \"-y\",\n `--package=@agentclientprotocol/codex-acp@${ACP_ADAPTER_PACKAGE_RANGES.codex}`,\n \"--\",\n \"codex-acp\",\n ],\n installedArgv: [\"codex-acp\"],\n package: {\n packageName: \"@agentclientprotocol/codex-acp\",\n packageRange: ACP_ADAPTER_PACKAGE_RANGES.codex,\n preferredBinName: \"codex-acp\",\n legacyFallbackCommands: [\n `npx -y @agentclientprotocol/codex-acp@${ACP_ADAPTER_PACKAGE_RANGES.codex}`,\n ],\n },\n packageExecFallback: true,\n },\n claude: {\n name: \"Claude Code\",\n argv: [\n \"npx\",\n \"-y\",\n `--package=@agentclientprotocol/claude-agent-acp@${ACP_ADAPTER_PACKAGE_RANGES.claude}`,\n \"--\",\n \"claude-agent-acp\",\n ],\n installedArgv: [\"claude-agent-acp\"],\n package: {\n packageName: \"@agentclientprotocol/claude-agent-acp\",\n packageRange: ACP_ADAPTER_PACKAGE_RANGES.claude,\n preferredBinName: \"claude-agent-acp\",\n legacyFallbackCommands: [\n `npx -y @agentclientprotocol/claude-agent-acp@${ACP_ADAPTER_PACKAGE_RANGES.claude}`,\n `npm exec @agentclientprotocol/claude-agent-acp@${ACP_ADAPTER_PACKAGE_RANGES.claude}`,\n ],\n },\n packageExecFallback: true,\n },\n gemini: { name: \"Gemini CLI\", argv: [\"gemini\", \"--acp\"] },\n cursor: { name: \"Cursor\", argv: [\"cursor-agent\", \"acp\"] },\n copilot: { name: \"GitHub Copilot\", argv: [\"copilot\", \"--acp\", \"--stdio\"] },\n ante: { name: \"Ante\", argv: [\"ante\", \"acp\"], requiredCommands: [\"ante-acp\"] },\n antigravity: {\n name: \"Google Antigravity\",\n argv:\n process.platform === \"win32\"\n ? [\"agy_acp_server.exe\"]\n : [\"agy_acp_server.par\", ...(process.platform === \"linux\" ? [\"--uid=\"] : [])],\n },\n codebuddy: { name: \"CodeBuddy Code\", argv: [\"codebuddy\", \"--acp\"] },\n \"deepseek-harness\": { name: \"DeepSeek Harness\", argv: [\"dsh\", \"--profile\", \"acp\"] },\n devin: { name: \"Devin\", argv: [\"devin\", \"acp\"] },\n droid: { name: \"Factory Droid\", argv: [\"droid\", \"exec\", \"--output-format\", \"acp\"] },\n \"fast-agent\": { name: \"Fast Agent\", argv: [\"uvx\", \"fast-agent-mcp\", \"acp\"] },\n fx: { name: \"fx\", argv: [\"fx\", \"acp\"] },\n goose: { name: \"Goose\", argv: [\"goose\", \"acp\"] },\n \"grok-build\": { name: \"Grok Build\", argv: [\"grok\", \"agent\", \"stdio\"] },\n iflow: { name: \"iFlow\", argv: [\"iflow\", \"--experimental-acp\"] },\n junie: { name: \"Junie\", argv: [\"junie\", \"--acp=true\"] },\n kilocode: {\n name: \"Kilo Code\",\n argv: [\"npx\", \"-y\", \"--package=@kilocode/cli\", \"--\", \"kilo\", \"acp\"],\n installedArgv: [\"kilo\", \"acp\"],\n },\n kimi: { name: \"Kimi Code\", argv: [\"kimi\", \"acp\"] },\n kiro: { name: \"Kiro\", argv: [\"kiro-cli-chat\", \"acp\"] },\n mcode: { name: \"MCode\", argv: [\"mcode\", \"acp\"] },\n mux: {\n name: \"Mux\",\n argv: [\"npx\", \"-y\", `--package=mux@${ACP_ADAPTER_PACKAGE_RANGES.mux}`, \"--\", \"mux\", \"acp\"],\n installedArgv: [\"mux\", \"acp\"],\n },\n octomind: { name: \"Octomind\", argv: [\"octomind\", \"acp\", \"developer:general\"] },\n opencode: {\n name: \"OpenCode\",\n argv: [\"npx\", \"-y\", \"--package=opencode-ai\", \"--\", \"opencode\", \"acp\"],\n installedArgv: [\"opencode\", \"acp\"],\n },\n pool: { name: \"Poolside\", argv: [\"pool\", \"acp\"] },\n qoder: { name: \"Qoder\", argv: [\"qodercli\", \"--acp\"] },\n qwen: { name: \"Qwen Code\", argv: [\"qwen\", \"--acp\"] },\n trae: { name: \"Trae\", argv: [\"traecli\", \"acp\", \"serve\"] },\n zeroclaw: { name: \"ZeroClaw\", argv: [\"zeroclaw\", \"acp\"] },\n};\n\nexport const AGENT_ARGV_REGISTRY: Record<string, string[]> = Object.fromEntries(\n Object.entries(AGENT_DEFINITIONS).map(([id, definition]) => [id, [...definition.argv]]),\n);\nexport const AGENT_REGISTRY: Record<string, string> = Object.fromEntries(\n Object.entries(AGENT_DEFINITIONS).map(([id, definition]) => [id, definition.argv.join(\" \")]),\n);\nexport const BUILT_IN_AGENT_PACKAGES: Record<string, BuiltInAgentPackageSpec> = Object.fromEntries(\n Object.entries(AGENT_DEFINITIONS).flatMap(([id, definition]) =>\n definition.packageExecFallback && definition.package\n ? [[id, { ...definition.package, fallbackCommand: definition.argv.join(\" \") }]]\n : [],\n ),\n);\n\nexport type AcpAgentInspection = {\n id: string;\n name: string;\n launch:\n | { kind: \"installed\"; argv: string[] }\n | { kind: \"missing\"; requirements: Array<{ kind: \"command\" | \"package\"; name: string }> };\n};\n\nexport type AcpAgentInspectionOptions = {\n resolveExecutable?: (command: string) => string | undefined;\n resolvePackageRoot?: (packageName: string) => string | undefined;\n};\n\nfunction isPackageExecution(argv: string[]): boolean {\n const command = path.win32\n .basename(argv[0])\n .toLowerCase()\n .replace(/\\.(cmd|exe|bat)$/, \"\");\n if ([\"npx\", \"uvx\", \"npm\", \"pnpm\", \"bunx\"].includes(command)) {\n return true;\n }\n switch (command) {\n case \"bun\":\n return argv[1] === \"x\";\n case \"uv\":\n return argv[1] === \"tool\" && argv[2] === \"run\";\n case \"node\":\n return /(?:npm|npx)-cli\\.js$/u.test(argv[1] ?? \"\");\n default:\n return false;\n }\n}\n\nfunction inspectionDefinition(\n id: string,\n override: string | string[] | undefined,\n): AgentDefinition | undefined {\n const definition = Object.hasOwn(AGENT_DEFINITIONS, id) ? AGENT_DEFINITIONS[id] : undefined;\n if (!override) {\n return definition;\n }\n let argv = override;\n if (typeof argv === \"string\") {\n const parsed = splitCommandLine(argv);\n argv = [parsed.command, ...parsed.args];\n }\n return { name: definition?.name ?? id, argv };\n}\n\nfunction inspectAgent(\n agentId: string,\n override: string | string[] | undefined,\n options: AcpAgentInspectionOptions = {},\n): AcpAgentInspection | undefined {\n const id = resolveCanonicalAgentName(agentId);\n const definition = inspectionDefinition(id, override);\n if (!definition) {\n return undefined;\n }\n const argv = definition.installedArgv ?? definition.argv;\n if (isPackageExecution(argv)) {\n return undefined;\n }\n const spec = definition.package\n ? { ...definition.package, fallbackCommand: definition.argv.join(\" \") }\n : undefined;\n const launch = inspectLaunch(argv, spec, options);\n return {\n id,\n name: definition.name,\n launch: inspectPrerequisites(launch, definition.requiredCommands ?? [], options),\n };\n}\n\nfunction inspectPrerequisites(\n launch: AcpAgentInspection[\"launch\"],\n requiredCommands: string[],\n options: AcpAgentInspectionOptions,\n): AcpAgentInspection[\"launch\"] {\n const resolveExecutable = options.resolveExecutable ?? resolveInstalledExecutable;\n const missingCommands = requiredCommands\n .filter((command) => !resolveExecutable(command))\n .map((name) => ({ kind: \"command\" as const, name }));\n if (missingCommands.length === 0) {\n return launch;\n }\n return {\n kind: \"missing\",\n requirements: [...(launch.kind === \"missing\" ? launch.requirements : []), ...missingCommands],\n };\n}\n\nfunction inspectLaunch(\n argv: string[],\n spec: BuiltInAgentPackageSpec | undefined,\n options: AcpAgentInspectionOptions,\n): AcpAgentInspection[\"launch\"] {\n const command = (options.resolveExecutable ?? resolveInstalledExecutable)(argv[0]);\n if (command) {\n return { kind: \"installed\", argv: [command, ...argv.slice(1)] };\n }\n if (!spec) {\n return { kind: \"missing\", requirements: [{ kind: \"command\", name: argv[0] }] };\n }\n const installed = resolveInstalledBuiltInAgentLaunchForSpec(spec, options);\n return installed\n ? { kind: \"installed\", argv: [installed.command, ...installed.args] }\n : { kind: \"missing\", requirements: [{ kind: \"package\", name: spec.packageName }] };\n}\n\nconst AGENT_ALIASES: Record<string, string> = {\n \"factory-droid\": \"droid\",\n factorydroid: \"droid\",\n claudecode: \"claude\",\n};\n\nexport const DEFAULT_AGENT_NAME = \"codex\";\n\nexport function normalizeAgentName(value: string): string {\n return value.trim().toLowerCase();\n}\n\nexport function resolveCanonicalAgentName(value: string): string {\n const normalized = normalizeAgentName(value);\n return Object.hasOwn(AGENT_ALIASES, normalized) ? AGENT_ALIASES[normalized] : normalized;\n}\n\nfunction findAgentEntry<T>(registry: Record<string, T>, agentName: string): T | undefined {\n const normalized = normalizeAgentName(agentName);\n const canonical = resolveCanonicalAgentName(agentName);\n return Object.hasOwn(registry, normalized)\n ? registry[normalized]\n : Object.hasOwn(registry, canonical)\n ? registry[canonical]\n : undefined;\n}\n\nexport function mergeAgentRegistry(overrides?: Record<string, string>): Record<string, string> {\n if (!overrides) {\n return { ...AGENT_REGISTRY };\n }\n\n const entries = Object.entries(AGENT_REGISTRY);\n for (const [name, command] of Object.entries(overrides)) {\n const normalized = normalizeAgentName(name);\n if (!normalized || !command.trim()) {\n continue;\n }\n entries.push([normalized, command.trim()]);\n }\n return Object.fromEntries(entries);\n}\n\nexport function resolveAgentCommand(agentName: string, overrides?: Record<string, string>): string {\n return findAgentEntry(mergeAgentRegistry(overrides), agentName) ?? agentName;\n}\n\nexport function resolveAgentArgv(agentName: string): string[] | undefined {\n const argv = findAgentEntry(AGENT_ARGV_REGISTRY, agentName);\n return argv ? [...argv] : undefined;\n}\n\nexport function findBuiltInAgentPackage(agentCommand: string): BuiltInAgentPackageSpec | undefined {\n const normalized = agentCommand.trim();\n const builtInAgentPackages = Object.values(BUILT_IN_AGENT_PACKAGES);\n return builtInAgentPackages.find(\n (spec) =>\n spec.fallbackCommand === normalized || spec.legacyFallbackCommands?.includes(normalized),\n );\n}\n\nfunction defaultResolvePackageRoot(packageName: string): string {\n const segments = packageName.split(\"/\");\n let cursor = path.dirname(fileURLToPath(import.meta.url));\n\n while (true) {\n const candidateRoot = path.join(cursor, \"node_modules\", ...segments);\n const manifestPath = path.join(candidateRoot, \"package.json\");\n if (fs.existsSync(manifestPath)) {\n try {\n const parsed = JSON.parse(fs.readFileSync(manifestPath, \"utf8\")) as {\n name?: string;\n };\n if (parsed.name === packageName) {\n return candidateRoot;\n }\n } catch {\n // best effort; keep walking upward\n }\n }\n\n const parent = path.dirname(cursor);\n if (parent === cursor) {\n throw new Error(`Built-in agent package not found: ${packageName}`);\n }\n cursor = parent;\n }\n}\n\nfunction resolvePackageBin(\n spec: BuiltInAgentPackageSpec,\n manifest: {\n bin?: string | Record<string, string>;\n },\n): string | undefined {\n if (typeof manifest.bin === \"string\") {\n return manifest.bin;\n }\n if (!manifest.bin || typeof manifest.bin !== \"object\") {\n return undefined;\n }\n return (\n manifest.bin[spec.preferredBinName] ??\n (Object.keys(manifest.bin).length === 1 ? Object.values(manifest.bin)[0] : undefined)\n );\n}\n\nfunction defaultResolveNpmCliPath(execPath: string): string {\n const candidate = path.resolve(\n path.dirname(execPath),\n \"..\",\n \"lib\",\n \"node_modules\",\n \"npm\",\n \"bin\",\n \"npm-cli.js\",\n );\n if (!fs.existsSync(candidate)) {\n throw new Error(`npm CLI not found for execPath: ${execPath}`);\n }\n return candidate;\n}\n\nexport function resolveInstalledBuiltInAgentLaunch(\n agentCommand: string,\n options: BuiltInLaunchResolverOptions = {},\n): BuiltInAgentLaunch | undefined {\n const spec = findBuiltInAgentPackage(agentCommand);\n if (!spec) {\n return undefined;\n }\n\n return resolveInstalledBuiltInAgentLaunchForSpec(spec, options);\n}\n\nfunction resolveInstalledBuiltInAgentLaunchForSpec(\n spec: BuiltInAgentPackageSpec,\n options: BuiltInLaunchResolverOptions,\n): BuiltInAgentLaunch | undefined {\n const readFileSync = options.readFileSync ?? fs.readFileSync;\n const existsSync = options.existsSync ?? fs.existsSync;\n const resolvePackageRoot = options.resolvePackageRoot ?? defaultResolvePackageRoot;\n\n try {\n const resolved = resolveInstalledBuiltInAgentPackage(spec, {\n readFileSync,\n existsSync,\n resolvePackageRoot,\n });\n if (!resolved) {\n return undefined;\n }\n\n return {\n source: \"installed\",\n command: process.execPath,\n args: [resolved.binPath],\n packageName: spec.packageName,\n packageRange: spec.packageRange,\n packageVersion: resolved.packageVersion,\n binPath: resolved.binPath,\n };\n } catch {\n return undefined;\n }\n}\n\nfunction resolveInstalledBuiltInAgentPackage(\n spec: BuiltInAgentPackageSpec,\n options: Required<\n Pick<BuiltInLaunchResolverOptions, \"readFileSync\" | \"existsSync\" | \"resolvePackageRoot\">\n >,\n): { packageVersion?: string; binPath: string } | undefined {\n const packageRoot = options.resolvePackageRoot(spec.packageName);\n if (!packageRoot) {\n return undefined;\n }\n const manifest = JSON.parse(\n options.readFileSync(path.join(packageRoot, \"package.json\"), \"utf8\"),\n ) as {\n name?: string;\n version?: string;\n bin?: string | Record<string, string>;\n };\n if (manifest.name !== spec.packageName) {\n return undefined;\n }\n\n const relativeBinPath = resolvePackageBin(spec, manifest);\n if (!relativeBinPath) {\n return undefined;\n }\n\n const binPath = path.resolve(packageRoot, relativeBinPath);\n return options.existsSync(binPath) ? { packageVersion: manifest.version, binPath } : undefined;\n}\n\nexport function resolvePackageExecBuiltInAgentLaunch(\n agentCommand: string,\n options: BuiltInLaunchResolverOptions = {},\n): BuiltInAgentLaunch | undefined {\n const spec = findBuiltInAgentPackage(agentCommand);\n if (!spec) {\n return undefined;\n }\n\n const existsSync = options.existsSync ?? fs.existsSync;\n const execPath = options.execPath ?? process.execPath;\n const resolveNpmCliPath = options.resolveNpmCliPath ?? defaultResolveNpmCliPath;\n\n try {\n const npmCliPath = resolveNpmCliPath(execPath);\n if (!existsSync(npmCliPath)) {\n return undefined;\n }\n\n return {\n source: \"package-exec\",\n command: execPath,\n args: [\n npmCliPath,\n \"exec\",\n \"--yes\",\n `--package=${spec.packageName}@${spec.packageRange}`,\n \"--\",\n spec.preferredBinName,\n ],\n packageName: spec.packageName,\n packageRange: spec.packageRange,\n npmCliPath,\n };\n } catch {\n return undefined;\n }\n}\n\nexport function resolveBuiltInAgentLaunch(\n agentCommand: string,\n options: BuiltInLaunchResolverOptions = {},\n): BuiltInAgentLaunch | undefined {\n return (\n resolveInstalledBuiltInAgentLaunch(agentCommand, options) ??\n resolvePackageExecBuiltInAgentLaunch(agentCommand, options)\n );\n}\n\nexport function listBuiltInAgents(overrides?: Record<string, unknown>): string[] {\n return [...new Set([...Object.keys(AGENT_REGISTRY), ...Object.keys(overrides ?? {})])];\n}\n\nexport interface AcpAgentRegistry {\n resolve(agentName: string): string | string[];\n list(): string[];\n}\n\nexport type AcpInspectableAgentRegistry = AcpAgentRegistry & {\n inspect(agentId: string): AcpAgentInspection | undefined;\n};\n\nexport function createAgentRegistry(\n params?: {\n overrides?: Record<string, string | string[]>;\n } & AcpAgentInspectionOptions,\n): AcpInspectableAgentRegistry {\n const overrides = normalizeRegistryOverrides(params?.overrides);\n return {\n resolve(agentName: string) {\n const override = findAgentEntry(overrides, agentName);\n return override ?? resolveAgentArgv(agentName) ?? resolveAgentCommand(agentName);\n },\n list() {\n return listBuiltInAgents(overrides);\n },\n inspect(agentId) {\n const override = findAgentEntry(overrides, agentId);\n return inspectAgent(agentId, override, params);\n },\n };\n}\n\nfunction normalizeRegistryOverrides(\n values: Record<string, string | string[]> | undefined,\n): Record<string, string | string[]> {\n const entries: Array<[string, string | string[]]> = [];\n for (const [name, value] of Object.entries(values ?? {})) {\n const normalizedName = normalizeAgentName(name);\n if (!normalizedName) {\n continue;\n }\n const normalizedValue = normalizeRegistryOverride(value);\n if (normalizedValue) {\n entries.push([normalizedName, normalizedValue]);\n }\n }\n return Object.fromEntries(entries);\n}\n\nfunction normalizeRegistryOverride(value: string | string[]): string | string[] | undefined {\n if (typeof value === \"string\") {\n return value.trim() || undefined;\n }\n return value.length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O,kBAAkB,SAAS;EACpC;EACA,QAAQ,SAAS;GAEf,OAAO,aAAa,SADH,eAAe,WAAW,OACP,GAAG,MAAM;EAC/C;CACF;AACF;AAEA,SAAS,2BACP,QACmC;CACnC,MAAM,UAA8C,CAAC;CACrD,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,UAAU,CAAC,CAAC,GAAG;EACxD,MAAM,iBAAiB,mBAAmB,IAAI;EAC9C,IAAI,CAAC,gBACH;EAEF,MAAM,kBAAkB,0BAA0B,KAAK;EACvD,IAAI,iBACF,QAAQ,KAAK,CAAC,gBAAgB,eAAe,CAAC;CAElD;CACA,OAAO,OAAO,YAAY,OAAO;AACnC;AAEA,SAAS,0BAA0B,OAAyD;CAC1F,IAAI,OAAO,UAAU,UACnB,OAAO,MAAM,KAAK,KAAK,KAAA;CAEzB,OAAO,MAAM,SAAS,KAAK,MAAM,EAAE,EAAE,SAAS,CAAC,GAAG,KAAK,IAAI,KAAA;AAC7D"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
|
-
//#region src/agent-registry.d.ts
|
|
3
2
|
type BuiltInAgentPackageSpec = {
|
|
4
3
|
packageName: string;
|
|
5
4
|
packageRange: string;
|
|
@@ -66,6 +65,5 @@ export type AcpInspectableAgentRegistry = AcpAgentRegistry & {
|
|
|
66
65
|
export declare function createAgentRegistry(params?: {
|
|
67
66
|
overrides?: Record<string, string | string[]>;
|
|
68
67
|
} & AcpAgentInspectionOptions): AcpInspectableAgentRegistry;
|
|
69
|
-
//#endregion
|
|
70
68
|
export {};
|
|
71
69
|
//# sourceMappingURL=agent-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-registry.d.ts","names":[],"sources":["../src/agent-registry.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-registry.d.ts","names":[],"sources":["../src/agent-registry.ts"],"mappings":";KAeK;EACH;EACA;EACA;EACA;EACA;;KAGG;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;KAGG;EACH,cAAc;EACd,sBAAsB,GAAG;EACzB,sBAAsB;EACtB;EACA,qBAAqB;;qBAiHV,qBAAqB;qBAGrB,gBAAgB;qBAGhB,yBAAyB,eAAe;YAQzC;EACV;EACA;EACA;IACM;IAAmB;;IACnB;IAAiB,cAAc;MAAQ;MAA6B;;;;YAGhE;EACV,qBAAqB;EACrB,sBAAsB;;qBA0GX;wBAEG,mBAAmB;wBAInB,0BAA0B;wBAe1B,mBAAmB,YAAY,yBAAyB;wBAgBxD,oBAAoB,mBAAmB,YAAY;wBAInD,iBAAiB;wBAKjB,wBAAwB,uBAAuB;wBAuE/C,mCACd,sBACA,UAAS,+BACR;wBAuEa,qCACd,sBACA,UAAS,+BACR;wBAoCa,0BACd,sBACA,UAAS,+BACR;wBAOa,kBAAkB,YAAY;iBAI7B;EACf,QAAQ;EACR;;YAGU,8BAA8B;EACxC,QAAQ,kBAAkB;;wBAGZ,oBACd;EACE,YAAY;IACV,4BACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as AGENT_ARGV_REGISTRY, n as AGENT_REGISTRY, r as BUILT_IN_AGENT_PACKAGES, i as DEFAULT_AGENT_NAME, a as createAgentRegistry, o as findBuiltInAgentPackage, s as listBuiltInAgents, c as mergeAgentRegistry, l as normalizeAgentName, u as resolveAgentArgv, d as resolveAgentCommand, f as resolveBuiltInAgentLaunch, p as resolveCanonicalAgentName, m as resolveInstalledBuiltInAgentLaunch, h as resolvePackageExecBuiltInAgentLaunch } from "./agent-registry-
|
|
1
|
+
export { t as AGENT_ARGV_REGISTRY, n as AGENT_REGISTRY, r as BUILT_IN_AGENT_PACKAGES, i as DEFAULT_AGENT_NAME, a as createAgentRegistry, o as findBuiltInAgentPackage, s as listBuiltInAgents, c as mergeAgentRegistry, l as normalizeAgentName, u as resolveAgentArgv, d as resolveAgentCommand, f as resolveBuiltInAgentLaunch, p as resolveCanonicalAgentName, m as resolveInstalledBuiltInAgentLaunch, h as resolvePackageExecBuiltInAgentLaunch } from "./agent-registry-CsdsVpJb.js";
|