acpx 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -3
- package/dist/{cli-CxsS1XQp.js → cli-D52eGvxU.js} +5 -4
- package/dist/cli-D52eGvxU.js.map +1 -0
- package/dist/cli.d.ts +2 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +84 -25
- package/dist/cli.js.map +1 -1
- package/dist/{client-DwNyFauq.d.ts → client-BeKvumq9.d.ts} +4 -3
- package/dist/client-BeKvumq9.d.ts.map +1 -0
- package/dist/{flags-Bjq_XQ4-.js → flags---9OR06b.js} +36 -9
- package/dist/flags---9OR06b.js.map +1 -0
- package/dist/{flows-Db_LZKu9.js → flows-CYfjwbn2.js} +14 -4
- package/dist/flows-CYfjwbn2.js.map +1 -0
- package/dist/flows.d.ts +6 -2
- package/dist/flows.d.ts.map +1 -1
- package/dist/flows.js +1 -1
- package/dist/{live-checkpoint-ClPCSdrW.js → live-checkpoint-CBecfnSH.js} +226 -20
- package/dist/live-checkpoint-CBecfnSH.js.map +1 -0
- package/dist/{output-CjdF5rHk.js → output-CzN8vLdE.js} +150 -18
- package/dist/output-CzN8vLdE.js.map +1 -0
- package/dist/runtime.d.ts +18 -14
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +34 -11
- package/dist/runtime.js.map +1 -1
- package/dist/{session-options-jkYbBxGE.d.ts → session-options-CTdZvr68.d.ts} +4 -2
- package/dist/session-options-CTdZvr68.d.ts.map +1 -0
- package/package.json +27 -27
- package/skills/acpx/SKILL.md +10 -7
- package/dist/cli-CxsS1XQp.js.map +0 -1
- package/dist/client-DwNyFauq.d.ts.map +0 -1
- package/dist/flags-Bjq_XQ4-.js.map +0 -1
- package/dist/flows-Db_LZKu9.js.map +0 -1
- package/dist/live-checkpoint-ClPCSdrW.js.map +0 -1
- package/dist/output-CjdF5rHk.js.map +0 -1
- package/dist/session-options-jkYbBxGE.d.ts.map +0 -1
|
@@ -430,10 +430,10 @@ function exitCodeForOutputErrorCode(code) {
|
|
|
430
430
|
//#endregion
|
|
431
431
|
//#region src/agent-registry.ts
|
|
432
432
|
const ACP_ADAPTER_PACKAGE_RANGES = {
|
|
433
|
-
pi: "^0.0.
|
|
434
|
-
codex: "^
|
|
435
|
-
claude: "^0.
|
|
436
|
-
mux: "^0.
|
|
433
|
+
pi: "^0.0.31",
|
|
434
|
+
codex: "^1.1.5",
|
|
435
|
+
claude: "^0.60.0",
|
|
436
|
+
mux: "^0.28.0"
|
|
437
437
|
};
|
|
438
438
|
const AGENT_REGISTRY = {
|
|
439
439
|
pi: `npx pi-acp@${ACP_ADAPTER_PACKAGE_RANGES.pi}`,
|
|
@@ -452,9 +452,78 @@ const AGENT_REGISTRY = {
|
|
|
452
452
|
kiro: "kiro-cli-chat acp",
|
|
453
453
|
mux: `npx -y mux@${ACP_ADAPTER_PACKAGE_RANGES.mux} acp`,
|
|
454
454
|
opencode: "npx -y opencode-ai acp",
|
|
455
|
+
pool: "pool acp",
|
|
455
456
|
qoder: "qodercli --acp",
|
|
456
457
|
qwen: "qwen --acp",
|
|
457
|
-
trae: "traecli acp serve"
|
|
458
|
+
trae: "traecli acp serve",
|
|
459
|
+
zeroclaw: "zeroclaw acp"
|
|
460
|
+
};
|
|
461
|
+
const AGENT_ARGV_REGISTRY = {
|
|
462
|
+
pi: ["npx", `pi-acp@${ACP_ADAPTER_PACKAGE_RANGES.pi}`],
|
|
463
|
+
openclaw: ["openclaw", "acp"],
|
|
464
|
+
codex: [
|
|
465
|
+
"npx",
|
|
466
|
+
"-y",
|
|
467
|
+
`@agentclientprotocol/codex-acp@${ACP_ADAPTER_PACKAGE_RANGES.codex}`
|
|
468
|
+
],
|
|
469
|
+
claude: [
|
|
470
|
+
"npx",
|
|
471
|
+
"-y",
|
|
472
|
+
`@agentclientprotocol/claude-agent-acp@${ACP_ADAPTER_PACKAGE_RANGES.claude}`
|
|
473
|
+
],
|
|
474
|
+
gemini: ["gemini", "--acp"],
|
|
475
|
+
cursor: ["cursor-agent", "acp"],
|
|
476
|
+
copilot: [
|
|
477
|
+
"copilot",
|
|
478
|
+
"--acp",
|
|
479
|
+
"--stdio"
|
|
480
|
+
],
|
|
481
|
+
droid: [
|
|
482
|
+
"droid",
|
|
483
|
+
"exec",
|
|
484
|
+
"--output-format",
|
|
485
|
+
"acp"
|
|
486
|
+
],
|
|
487
|
+
"fast-agent": [
|
|
488
|
+
"uvx",
|
|
489
|
+
"fast-agent-mcp",
|
|
490
|
+
"acp"
|
|
491
|
+
],
|
|
492
|
+
"grok-build": [
|
|
493
|
+
"grok",
|
|
494
|
+
"agent",
|
|
495
|
+
"stdio"
|
|
496
|
+
],
|
|
497
|
+
iflow: ["iflow", "--experimental-acp"],
|
|
498
|
+
kilocode: [
|
|
499
|
+
"npx",
|
|
500
|
+
"-y",
|
|
501
|
+
"@kilocode/cli",
|
|
502
|
+
"acp"
|
|
503
|
+
],
|
|
504
|
+
kimi: ["kimi", "acp"],
|
|
505
|
+
kiro: ["kiro-cli-chat", "acp"],
|
|
506
|
+
mux: [
|
|
507
|
+
"npx",
|
|
508
|
+
"-y",
|
|
509
|
+
`mux@${ACP_ADAPTER_PACKAGE_RANGES.mux}`,
|
|
510
|
+
"acp"
|
|
511
|
+
],
|
|
512
|
+
opencode: [
|
|
513
|
+
"npx",
|
|
514
|
+
"-y",
|
|
515
|
+
"opencode-ai",
|
|
516
|
+
"acp"
|
|
517
|
+
],
|
|
518
|
+
pool: ["pool", "acp"],
|
|
519
|
+
qoder: ["qodercli", "--acp"],
|
|
520
|
+
qwen: ["qwen", "--acp"],
|
|
521
|
+
trae: [
|
|
522
|
+
"traecli",
|
|
523
|
+
"acp",
|
|
524
|
+
"serve"
|
|
525
|
+
],
|
|
526
|
+
zeroclaw: ["zeroclaw", "acp"]
|
|
458
527
|
};
|
|
459
528
|
const BUILT_IN_AGENT_PACKAGES = {
|
|
460
529
|
codex: {
|
|
@@ -480,6 +549,10 @@ const DEFAULT_AGENT_NAME = "codex";
|
|
|
480
549
|
function normalizeAgentName$1(value) {
|
|
481
550
|
return value.trim().toLowerCase();
|
|
482
551
|
}
|
|
552
|
+
function resolveCanonicalAgentName(value) {
|
|
553
|
+
const normalized = normalizeAgentName$1(value);
|
|
554
|
+
return AGENT_ALIASES[normalized] ?? normalized;
|
|
555
|
+
}
|
|
483
556
|
function mergeAgentRegistry(overrides) {
|
|
484
557
|
if (!overrides) return { ...AGENT_REGISTRY };
|
|
485
558
|
const merged = { ...AGENT_REGISTRY };
|
|
@@ -495,6 +568,11 @@ function resolveAgentCommand(agentName, overrides) {
|
|
|
495
568
|
const registry = mergeAgentRegistry(overrides);
|
|
496
569
|
return registry[normalized] ?? registry[AGENT_ALIASES[normalized] ?? normalized] ?? agentName;
|
|
497
570
|
}
|
|
571
|
+
function resolveAgentArgv(agentName) {
|
|
572
|
+
const normalized = normalizeAgentName$1(agentName);
|
|
573
|
+
const argv = AGENT_ARGV_REGISTRY[normalized] ?? AGENT_ARGV_REGISTRY[resolveCanonicalAgentName(agentName)];
|
|
574
|
+
return argv ? [...argv] : void 0;
|
|
575
|
+
}
|
|
498
576
|
function findBuiltInAgentPackage(agentCommand) {
|
|
499
577
|
const normalized = agentCommand.trim();
|
|
500
578
|
return Object.values(BUILT_IN_AGENT_PACKAGES).find((spec) => spec.fallbackCommand === normalized || spec.legacyFallbackCommands?.includes(normalized));
|
|
@@ -593,7 +671,7 @@ function resolveBuiltInAgentLaunch(agentCommand, options = {}) {
|
|
|
593
671
|
return resolveInstalledBuiltInAgentLaunch(agentCommand, options) ?? resolvePackageExecBuiltInAgentLaunch(agentCommand, options);
|
|
594
672
|
}
|
|
595
673
|
function listBuiltInAgents(overrides) {
|
|
596
|
-
return Object.keys(
|
|
674
|
+
return [.../* @__PURE__ */ new Set([...Object.keys(AGENT_REGISTRY), ...Object.keys(overrides ?? {})])];
|
|
597
675
|
}
|
|
598
676
|
//#endregion
|
|
599
677
|
//#region src/async-control.ts
|
|
@@ -972,6 +1050,7 @@ function serializeSessionRecordForDisk(record) {
|
|
|
972
1050
|
acp_session_id: canonical.acpSessionId,
|
|
973
1051
|
agent_session_id: normalizeRuntimeSessionId(canonical.agentSessionId),
|
|
974
1052
|
agent_command: canonical.agentCommand,
|
|
1053
|
+
agent_argv: canonical.agentArgv,
|
|
975
1054
|
cwd: canonical.cwd,
|
|
976
1055
|
name: canonical.name,
|
|
977
1056
|
created_at: canonical.createdAt,
|
|
@@ -1006,6 +1085,50 @@ function serializeSessionRecordForDisk(record) {
|
|
|
1006
1085
|
};
|
|
1007
1086
|
}
|
|
1008
1087
|
//#endregion
|
|
1088
|
+
//#region src/acp/builtin-command-migration.ts
|
|
1089
|
+
const LEGACY_AGENT_COMMANDS = {
|
|
1090
|
+
pi: [
|
|
1091
|
+
"npx pi-acp",
|
|
1092
|
+
"npx pi-acp@^0.0.22",
|
|
1093
|
+
"npx pi-acp@^0.0.26"
|
|
1094
|
+
],
|
|
1095
|
+
codex: [
|
|
1096
|
+
"npx @zed-industries/codex-acp",
|
|
1097
|
+
"npx @zed-industries/codex-acp@^0.9.5",
|
|
1098
|
+
"npx @zed-industries/codex-acp@^0.10.0",
|
|
1099
|
+
"npx @zed-industries/codex-acp@^0.11.1",
|
|
1100
|
+
"npx @zed-industries/codex-acp@^0.12.0",
|
|
1101
|
+
"npx -y @agentclientprotocol/codex-acp@^0.0.44",
|
|
1102
|
+
"npx -y @agentclientprotocol/codex-acp@^1.1.4"
|
|
1103
|
+
],
|
|
1104
|
+
claude: [
|
|
1105
|
+
"npx @zed-industries/claude-agent-acp",
|
|
1106
|
+
"npx -y @zed-industries/claude-agent-acp",
|
|
1107
|
+
"npx -y @zed-industries/claude-agent-acp@^0.21.0",
|
|
1108
|
+
"npx -y @zed-industries/claude-agent-acp@^0.23.1",
|
|
1109
|
+
"npx -y @zed-industries/claude-agent-acp@^0.24.2",
|
|
1110
|
+
"npx -y @zed-industries/claude-agent-acp@^0.25.0",
|
|
1111
|
+
"npx -y @zed-industries/claude-agent-acp@^0.31.0",
|
|
1112
|
+
"npx -y @agentclientprotocol/claude-agent-acp@^0.36.1",
|
|
1113
|
+
"npx -y @agentclientprotocol/claude-agent-acp@^0.37.0",
|
|
1114
|
+
"npm exec @agentclientprotocol/claude-agent-acp@^0.36.1",
|
|
1115
|
+
"npm exec @agentclientprotocol/claude-agent-acp@^0.37.0"
|
|
1116
|
+
],
|
|
1117
|
+
gemini: ["gemini", "gemini --experimental-acp"],
|
|
1118
|
+
kiro: ["kiro-cli acp"],
|
|
1119
|
+
mux: ["npx -y mux@^0.27.0 acp"],
|
|
1120
|
+
opencode: ["npx opencode-ai"]
|
|
1121
|
+
};
|
|
1122
|
+
function currentArgv(name) {
|
|
1123
|
+
const argv = AGENT_ARGV_REGISTRY[name];
|
|
1124
|
+
return argv ? [...argv] : void 0;
|
|
1125
|
+
}
|
|
1126
|
+
function resolveAgentArgvForCommand(agentCommand) {
|
|
1127
|
+
for (const [name, command] of Object.entries(AGENT_REGISTRY)) if (command === agentCommand) return currentArgv(name);
|
|
1128
|
+
for (const [name, spec] of Object.entries(BUILT_IN_AGENT_PACKAGES)) if ((spec.legacyFallbackCommands ?? []).includes(agentCommand)) return currentArgv(name);
|
|
1129
|
+
for (const [name, commands] of Object.entries(LEGACY_AGENT_COMMANDS)) if (commands.includes(agentCommand)) return currentArgv(name);
|
|
1130
|
+
}
|
|
1131
|
+
//#endregion
|
|
1009
1132
|
//#region src/session/persistence/parse.ts
|
|
1010
1133
|
function asRecord$4(value) {
|
|
1011
1134
|
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
@@ -1017,6 +1140,12 @@ function hasOwn$1(source, key) {
|
|
|
1017
1140
|
function isStringArray(value) {
|
|
1018
1141
|
return Array.isArray(value) && value.every((entry) => typeof entry === "string");
|
|
1019
1142
|
}
|
|
1143
|
+
function parseOptionalAgentArgv(value) {
|
|
1144
|
+
return isStringArray(value) && value.length > 0 && value[0]?.length > 0 ? value : void 0;
|
|
1145
|
+
}
|
|
1146
|
+
function parsePersistedAgentArgv(record) {
|
|
1147
|
+
return parseOptionalAgentArgv(record.agent_argv) ?? (typeof record.agent_command === "string" ? resolveAgentArgvForCommand(record.agent_command) : void 0);
|
|
1148
|
+
}
|
|
1020
1149
|
function hasModelConfigOption(options) {
|
|
1021
1150
|
if (!Array.isArray(options)) return false;
|
|
1022
1151
|
return options.some((entry) => {
|
|
@@ -1394,6 +1523,7 @@ function parseSessionRecord(raw) {
|
|
|
1394
1523
|
acpSessionId: record.acp_session_id,
|
|
1395
1524
|
agentSessionId: normalizeRuntimeSessionId(record.agent_session_id),
|
|
1396
1525
|
agentCommand: record.agent_command,
|
|
1526
|
+
agentArgv: parsePersistedAgentArgv(record),
|
|
1397
1527
|
cwd: record.cwd,
|
|
1398
1528
|
name: optionals.name,
|
|
1399
1529
|
createdAt: record.created_at,
|
|
@@ -1589,6 +1719,11 @@ function assertPersistedKeyPolicy(value) {
|
|
|
1589
1719
|
throw new Error(`Persisted key policy violation (expected snake_case keys): ${violations.join(", ")}`);
|
|
1590
1720
|
}
|
|
1591
1721
|
//#endregion
|
|
1722
|
+
//#region src/session/persistence/atomic-write.ts
|
|
1723
|
+
function createAtomicWriteTempPath(filePath, createUniqueId = randomUUID) {
|
|
1724
|
+
return `${filePath}.${process.pid}.${Date.now()}.${createUniqueId()}.tmp`;
|
|
1725
|
+
}
|
|
1726
|
+
//#endregion
|
|
1592
1727
|
//#region src/session/persistence/index.ts
|
|
1593
1728
|
const SESSION_INDEX_SCHEMA = "acpx.session-index.v1";
|
|
1594
1729
|
function asRecord$3(value) {
|
|
@@ -1657,7 +1792,7 @@ async function readSessionIndex(sessionDir) {
|
|
|
1657
1792
|
}
|
|
1658
1793
|
async function writeSessionIndex(sessionDir, index) {
|
|
1659
1794
|
const filePath = sessionIndexPath(sessionDir);
|
|
1660
|
-
const tempFile =
|
|
1795
|
+
const tempFile = createAtomicWriteTempPath(filePath);
|
|
1661
1796
|
const payload = JSON.stringify({
|
|
1662
1797
|
schema: SESSION_INDEX_SCHEMA,
|
|
1663
1798
|
files: [...index.files].toSorted(),
|
|
@@ -1728,7 +1863,7 @@ async function writeSessionRecord(record) {
|
|
|
1728
1863
|
const persisted = serializeSessionRecordForDisk(record);
|
|
1729
1864
|
assertPersistedKeyPolicy(persisted);
|
|
1730
1865
|
const file = sessionFilePath(record.acpxRecordId);
|
|
1731
|
-
const tempFile =
|
|
1866
|
+
const tempFile = createAtomicWriteTempPath(file);
|
|
1732
1867
|
const payload = JSON.stringify(persisted, null, 2);
|
|
1733
1868
|
await fs$1.writeFile(tempFile, `${payload}\n`, "utf8");
|
|
1734
1869
|
await fs$1.rename(tempFile, file);
|
|
@@ -2394,6 +2529,36 @@ function shouldUseWindowsBatchShell(command, platform = process.platform, env =
|
|
|
2394
2529
|
const ext = path.extname(resolvedCommand).toLowerCase();
|
|
2395
2530
|
return ext === ".cmd" || ext === ".bat";
|
|
2396
2531
|
}
|
|
2532
|
+
const CMD_META_CHAR_RE = /([()\][%!^"`<>&|;, *?])/gu;
|
|
2533
|
+
const CMD_BACKSLASH_QUOTE_RE = /(?=(\\+?)?)\1"/gu;
|
|
2534
|
+
const CMD_TRAILING_BACKSLASH_RE = /(?=(\\+?)?)\1$/gu;
|
|
2535
|
+
const CMD_SHIM_RE = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/iu;
|
|
2536
|
+
function escapeCmdCommand(value) {
|
|
2537
|
+
return value.replace(CMD_META_CHAR_RE, "^$1");
|
|
2538
|
+
}
|
|
2539
|
+
function escapeCmdArgument(value, doubleEscapeMeta) {
|
|
2540
|
+
const escaped = `"${value.replace(CMD_BACKSLASH_QUOTE_RE, "$1$1\\\"").replace(CMD_TRAILING_BACKSLASH_RE, "$1$1")}"`.replace(CMD_META_CHAR_RE, "^$1");
|
|
2541
|
+
return doubleEscapeMeta ? escaped.replace(CMD_META_CHAR_RE, "^$1") : escaped;
|
|
2542
|
+
}
|
|
2543
|
+
function buildAgentSpawnCommand(command, args, platform = process.platform, env = process.env) {
|
|
2544
|
+
if (!shouldUseWindowsBatchShell(command, platform, env)) return {
|
|
2545
|
+
command,
|
|
2546
|
+
args: [...args]
|
|
2547
|
+
};
|
|
2548
|
+
const resolvedCommand = path.win32.normalize(resolveWindowsCommand(command, env) ?? command);
|
|
2549
|
+
const doubleEscapeMeta = CMD_SHIM_RE.test(resolvedCommand);
|
|
2550
|
+
const shellCommand = [escapeCmdCommand(resolvedCommand), ...args.map((arg) => escapeCmdArgument(arg, doubleEscapeMeta))].join(" ");
|
|
2551
|
+
return {
|
|
2552
|
+
command: readWindowsEnvValue(env, "COMSPEC") ?? "cmd.exe",
|
|
2553
|
+
args: [
|
|
2554
|
+
"/d",
|
|
2555
|
+
"/s",
|
|
2556
|
+
"/c",
|
|
2557
|
+
`"${shellCommand}"`
|
|
2558
|
+
],
|
|
2559
|
+
windowsVerbatimArguments: true
|
|
2560
|
+
};
|
|
2561
|
+
}
|
|
2397
2562
|
function buildSpawnCommandOptions(command, options, platform = process.platform, env = process.env) {
|
|
2398
2563
|
if (!shouldUseWindowsBatchShell(command, platform, env)) return options;
|
|
2399
2564
|
return {
|
|
@@ -2471,6 +2636,19 @@ function getAcpxVersion() {
|
|
|
2471
2636
|
//#endregion
|
|
2472
2637
|
//#region src/acp/client-process.ts
|
|
2473
2638
|
const execFileAsync = promisify(execFile);
|
|
2639
|
+
function normalizeAgentCommandInput(value) {
|
|
2640
|
+
if (typeof value === "string") return { agentCommand: value };
|
|
2641
|
+
const parts = toCommandParts([...value]);
|
|
2642
|
+
const argv = [parts.command, ...parts.args];
|
|
2643
|
+
return {
|
|
2644
|
+
agentCommand: renderArgvIdentity(argv),
|
|
2645
|
+
agentArgv: argv
|
|
2646
|
+
};
|
|
2647
|
+
}
|
|
2648
|
+
const IDENTITY_SAFE_ARG_RE = /^[A-Za-z0-9_@%+=:,./^~-]+$/u;
|
|
2649
|
+
function renderArgvIdentity(argv) {
|
|
2650
|
+
return argv.map((arg) => IDENTITY_SAFE_ARG_RE.test(arg) ? arg : JSON.stringify(arg)).join(" ");
|
|
2651
|
+
}
|
|
2474
2652
|
function isoNow$1() {
|
|
2475
2653
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
2476
2654
|
}
|
|
@@ -2517,6 +2695,18 @@ function waitForChildExit(child, timeoutMs) {
|
|
|
2517
2695
|
child.once("exit", onExitLike);
|
|
2518
2696
|
});
|
|
2519
2697
|
}
|
|
2698
|
+
function resolveAgentCommandParts(value, argv, platform = process.platform) {
|
|
2699
|
+
if (argv) {
|
|
2700
|
+
const parts = toCommandParts([...argv]);
|
|
2701
|
+
assertWindowsLaunchableCommand(parts.command, platform);
|
|
2702
|
+
return parts;
|
|
2703
|
+
}
|
|
2704
|
+
if (platform === "win32") throw new Error("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.");
|
|
2705
|
+
return splitCommandLine(value);
|
|
2706
|
+
}
|
|
2707
|
+
function assertWindowsLaunchableCommand(command, platform) {
|
|
2708
|
+
if (platform === "win32" && path.extname(command).toLowerCase() === ".sh") throw new Error(`Windows cannot launch shell script executable "${command}" directly. Configure an explicit interpreter argv, for example: "argv": ["bash", "${command}"]. acpx does not infer interpreters.`);
|
|
2709
|
+
}
|
|
2520
2710
|
function splitCommandLine(value) {
|
|
2521
2711
|
const parts = [];
|
|
2522
2712
|
let current = "";
|
|
@@ -2543,8 +2733,10 @@ function splitCommandLine(value) {
|
|
|
2543
2733
|
}
|
|
2544
2734
|
if (quote) throw new Error("Invalid --agent command: unterminated quote");
|
|
2545
2735
|
if (hasPart) parts.push(current);
|
|
2546
|
-
|
|
2547
|
-
|
|
2736
|
+
return toCommandParts(parts);
|
|
2737
|
+
}
|
|
2738
|
+
function toCommandParts(parts) {
|
|
2739
|
+
if (parts.length === 0 || parts[0] === "") throw new Error("Invalid --agent command: empty command");
|
|
2548
2740
|
return {
|
|
2549
2741
|
command: parts[0],
|
|
2550
2742
|
args: parts.slice(1)
|
|
@@ -3719,8 +3911,8 @@ function resolveClientInfo(devinAcp) {
|
|
|
3719
3911
|
function resolveClientCapabilities(params) {
|
|
3720
3912
|
const baseCapabilities = {
|
|
3721
3913
|
fs: {
|
|
3722
|
-
readTextFile:
|
|
3723
|
-
writeTextFile:
|
|
3914
|
+
readTextFile: params.fs,
|
|
3915
|
+
writeTextFile: params.fs
|
|
3724
3916
|
},
|
|
3725
3917
|
terminal: params.terminal
|
|
3726
3918
|
};
|
|
@@ -3927,11 +4119,15 @@ var AcpClient = class {
|
|
|
3927
4119
|
if (options.permissionMode) this.options.permissionMode = options.permissionMode;
|
|
3928
4120
|
if (options.nonInteractivePermissions !== void 0) this.options.nonInteractivePermissions = options.nonInteractivePermissions;
|
|
3929
4121
|
if (Object.prototype.hasOwnProperty.call(options, "permissionPolicy")) this.options.permissionPolicy = options.permissionPolicy;
|
|
3930
|
-
|
|
4122
|
+
this.updateClientCapabilityPreferences(options);
|
|
3931
4123
|
this.refreshRuntimePermissionPolicy(shouldRefreshPermissionPolicy);
|
|
3932
4124
|
if (options.suppressSdkConsoleErrors !== void 0) this.options.suppressSdkConsoleErrors = options.suppressSdkConsoleErrors;
|
|
3933
4125
|
if (options.verbose !== void 0) this.options.verbose = options.verbose;
|
|
3934
4126
|
}
|
|
4127
|
+
updateClientCapabilityPreferences(options) {
|
|
4128
|
+
if (options.fs !== void 0) this.options.fs = options.fs;
|
|
4129
|
+
if (options.terminal !== void 0) this.options.terminal = options.terminal;
|
|
4130
|
+
}
|
|
3935
4131
|
refreshRuntimePermissionPolicy(enabled) {
|
|
3936
4132
|
if (!enabled) return;
|
|
3937
4133
|
this.filesystem.updatePermissionPolicy(this.options.permissionMode, this.options.nonInteractivePermissions);
|
|
@@ -3980,7 +4176,7 @@ var AcpClient = class {
|
|
|
3980
4176
|
});
|
|
3981
4177
|
}
|
|
3982
4178
|
async resolveAgentLaunchPlan() {
|
|
3983
|
-
const configuredCommand =
|
|
4179
|
+
const configuredCommand = resolveAgentCommandParts(this.options.agentCommand, this.options.agentArgv);
|
|
3984
4180
|
const resolvedBuiltInLaunch = resolveBuiltInAgentLaunch(this.options.agentCommand);
|
|
3985
4181
|
const spawnCommand = resolvedBuiltInLaunch?.command ?? configuredCommand.command;
|
|
3986
4182
|
let args = resolvedBuiltInLaunch?.args ?? configuredCommand.args;
|
|
@@ -4019,7 +4215,11 @@ var AcpClient = class {
|
|
|
4019
4215
|
}
|
|
4020
4216
|
}
|
|
4021
4217
|
async spawnAgentProcess(plan) {
|
|
4022
|
-
const
|
|
4218
|
+
const spawnCommand = buildAgentSpawnCommand(plan.spawnCommand, plan.args, process.platform, plan.spawnOptions.env);
|
|
4219
|
+
const spawnedChild = spawn(spawnCommand.command, spawnCommand.args, {
|
|
4220
|
+
...plan.spawnOptions,
|
|
4221
|
+
windowsVerbatimArguments: spawnCommand.windowsVerbatimArguments
|
|
4222
|
+
});
|
|
4023
4223
|
try {
|
|
4024
4224
|
await waitForSpawn$1(spawnedChild);
|
|
4025
4225
|
} catch (error) {
|
|
@@ -4082,6 +4282,7 @@ var AcpClient = class {
|
|
|
4082
4282
|
protocolVersion: PROTOCOL_VERSION,
|
|
4083
4283
|
clientCapabilities: resolveClientCapabilities({
|
|
4084
4284
|
devinAcp: launch.devinAcp,
|
|
4285
|
+
fs: this.options.fs !== false,
|
|
4085
4286
|
terminal: this.options.terminal !== false
|
|
4086
4287
|
}),
|
|
4087
4288
|
clientInfo: resolveClientInfo(launch.devinAcp)
|
|
@@ -4141,7 +4342,7 @@ var AcpClient = class {
|
|
|
4141
4342
|
}
|
|
4142
4343
|
async createSession(cwd = this.options.cwd) {
|
|
4143
4344
|
const connection = this.getConnection();
|
|
4144
|
-
const { command, args } =
|
|
4345
|
+
const { command, args } = resolveAgentCommandParts(this.options.agentCommand, this.options.agentArgv);
|
|
4145
4346
|
const claudeAcp = isClaudeAcpCommand(command, args);
|
|
4146
4347
|
const sessionCwd = await resolveAgentSessionCwd(cwd, this.options.agentCommand);
|
|
4147
4348
|
let result;
|
|
@@ -4587,7 +4788,7 @@ var AcpClient = class {
|
|
|
4587
4788
|
};
|
|
4588
4789
|
}
|
|
4589
4790
|
isGrokBuildAcpCommand() {
|
|
4590
|
-
const { command, args } =
|
|
4791
|
+
const { command, args } = resolveAgentCommandParts(this.options.agentCommand, this.options.agentArgv);
|
|
4591
4792
|
return command.replace(/\\/g, "/").split("/").pop()?.replace(/\.(cmd|exe|ps1)$/iu, "").toLowerCase() === "grok" && args[0] === "agent" && args[1] === "stdio";
|
|
4592
4793
|
}
|
|
4593
4794
|
async authenticateIfRequired(connection, methods) {
|
|
@@ -5979,6 +6180,7 @@ async function withConnectedSession(options) {
|
|
|
5979
6180
|
const record = await options.loadRecord(options.sessionRecordId);
|
|
5980
6181
|
const client = options.createClient?.({
|
|
5981
6182
|
agentCommand: record.agentCommand,
|
|
6183
|
+
agentArgv: record.agentArgv,
|
|
5982
6184
|
cwd: absolutePath(record.cwd),
|
|
5983
6185
|
mcpServers: options.mcpServers,
|
|
5984
6186
|
permissionMode: options.permissionMode ?? "approve-reads",
|
|
@@ -5986,11 +6188,13 @@ async function withConnectedSession(options) {
|
|
|
5986
6188
|
onPermissionRequest: options.onPermissionRequest,
|
|
5987
6189
|
authCredentials: options.authCredentials,
|
|
5988
6190
|
authPolicy: options.authPolicy,
|
|
6191
|
+
fs: options.fs,
|
|
5989
6192
|
terminal: options.terminal,
|
|
5990
6193
|
verbose: options.verbose,
|
|
5991
6194
|
sessionOptions: sessionOptionsFromRecord(record)
|
|
5992
6195
|
}) ?? new AcpClient({
|
|
5993
6196
|
agentCommand: record.agentCommand,
|
|
6197
|
+
agentArgv: record.agentArgv,
|
|
5994
6198
|
cwd: absolutePath(record.cwd),
|
|
5995
6199
|
mcpServers: options.mcpServers,
|
|
5996
6200
|
permissionMode: options.permissionMode ?? "approve-reads",
|
|
@@ -5998,6 +6202,7 @@ async function withConnectedSession(options) {
|
|
|
5998
6202
|
onPermissionRequest: options.onPermissionRequest,
|
|
5999
6203
|
authCredentials: options.authCredentials,
|
|
6000
6204
|
authPolicy: options.authPolicy,
|
|
6205
|
+
fs: options.fs,
|
|
6001
6206
|
terminal: options.terminal,
|
|
6002
6207
|
verbose: options.verbose,
|
|
6003
6208
|
sessionOptions: sessionOptionsFromRecord(record)
|
|
@@ -6035,7 +6240,8 @@ async function withConnectedSession(options) {
|
|
|
6035
6240
|
resumed,
|
|
6036
6241
|
loadError
|
|
6037
6242
|
});
|
|
6038
|
-
|
|
6243
|
+
const now = isoNow$2();
|
|
6244
|
+
record.lastUsedAt = now;
|
|
6039
6245
|
record.closed = false;
|
|
6040
6246
|
record.closedAt = void 0;
|
|
6041
6247
|
record.protocolVersion = client.initializeResult?.protocolVersion;
|
|
@@ -6151,6 +6357,6 @@ var LiveSessionCheckpoint = class {
|
|
|
6151
6357
|
}
|
|
6152
6358
|
};
|
|
6153
6359
|
//#endregion
|
|
6154
|
-
export {
|
|
6360
|
+
export { createAtomicWriteTempPath as $, SESSION_RECORD_SCHEMA as $t, REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE as A, withInterrupt as At, permissionModeSatisfies as B, isRetryablePromptError as Bt, mergeSessionOptions as C, isPromptInput as Ct, applyLifecycleSnapshotToRecord as D, textPrompt as Dt, applyConversation as E, promptToDisplayText as Et, modelStateFromConfigOptions as F, resolveAgentArgv as Ft, findSessionByDirectoryWalk as G, AUTH_POLICIES as Gt, absolutePath as H, extractAcpError as Ht, normalizeAgentCommandInput as I, resolveAgentCommand as It, listSessionsForAgent as J, OUTPUT_ERROR_CODES as Jt, isoNow$2 as K, EXIT_CODES as Kt, renderArgvIdentity as L, resolveCanonicalAgentName as Lt, RequestedModelUnsupportedError as M, DEFAULT_AGENT_NAME as Mt, assertRequestedModelSupported as N, listBuiltInAgents as Nt, reconcileAgentSessionId as O, InterruptedError as Ot, isRequestedModelUnsupportedError as P, normalizeAgentName$1 as Pt, writeSessionRecord as Q, PERMISSION_POLICY_ACTIONS as Qt, splitCommandLine as R, exitCodeForOutputErrorCode as Rt, advertisedModelState as S, PromptInputValidationError as St, sessionOptionsFromRecord as T, parsePromptSource as Tt, findGitRepositoryRoot as U, isAcpResourceNotFoundError as Ut, DEFAULT_HISTORY_LIMIT as V, normalizeOutputError as Vt, findSession as W, toAcpErrorPayload as Wt, pruneSessions as X, OUTPUT_FORMATS as Xt, normalizeName as Y, OUTPUT_ERROR_ORIGINS as Yt, resolveSessionRecord as Z, PERMISSION_MODES as Zt, createSessionConversation as _, sessionEventSegmentPath as _t, applyRequestedModelIfAdvertised as a, recordPerfDuration as at, recordSessionUpdate as b, parseJsonRpcErrorMessage as bt, setCurrentModelId as c, startPerfTimer as ct, setDesiredModelId as d, normalizeRuntimeSessionId as dt, AcpxOperationalError as en, assertPersistedKeyPolicy as et, syncAdvertisedModelState as f, DEFAULT_EVENT_SEGMENT_MAX_BYTES as ft, cloneSessionConversation as g, sessionEventLockPath as gt, cloneSessionAcpxState as h, sessionEventActivePath as ht, connectAndLoadSession as i, measurePerf as it, REQUESTED_MODEL_UNSUPPORTED_REASONS as j, withTimeout as jt, AcpClient as k, TimeoutError as kt, setDesiredConfigOption as l, parseSessionRecord as lt, applyConfigOptionsToState as m, sessionBaseDir$1 as mt, runPromptTurn as n, QueueConnectionError as nn, getPerfMetricsSnapshot as nt, currentModelIdFromSetModelResponse as o, resetPerfMetrics as ot, applyConfigOptionsToRecord as p, defaultSessionEventLog as pt, listSessions as q, NON_INTERACTIVE_PERMISSION_POLICIES as qt, withConnectedSession as r, QueueProtocolError as rn, incrementPerfCounter as rt, clearDesiredConfigOption as s, setPerfGauge as st, LiveSessionCheckpoint as t, AgentSpawnError as tn, formatPerfMetric as tt, setDesiredModeId as u, serializeSessionRecordForDisk as ut, recordClientOperation as v, extractSessionUpdateNotification as vt, persistSessionOptions as w, mergePromptSourceWithText as wt, trimConversationForRuntime as x, parsePromptStopReason as xt, recordPromptSubmission as y, isAcpJsonRpcMessage as yt, getAcpxVersion as z, formatErrorMessage as zt };
|
|
6155
6361
|
|
|
6156
|
-
//# sourceMappingURL=live-checkpoint-
|
|
6362
|
+
//# sourceMappingURL=live-checkpoint-CBecfnSH.js.map
|