acpx 0.5.0 → 0.5.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/{cli-CLRrs6eQ.js → cli-DZjj5kij.js} +4 -4
- package/dist/{cli-CLRrs6eQ.js.map → cli-DZjj5kij.js.map} +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +11 -12
- package/dist/cli.js.map +1 -1
- package/dist/{client-DLTWuu4w.d.ts → client-S8QicFBT.d.ts} +5 -2
- package/dist/{client-DLTWuu4w.d.ts.map → client-S8QicFBT.d.ts.map} +1 -1
- package/dist/{flags-BmubjvOw.js → flags-W3vEVSiS.js} +4 -4
- package/dist/{flags-BmubjvOw.js.map → flags-W3vEVSiS.js.map} +1 -1
- package/dist/{flows-CR7xCmkR.js → flows-CLQYpPh7.js} +5 -5
- package/dist/{flows-CR7xCmkR.js.map → flows-CLQYpPh7.js.map} +1 -1
- package/dist/flows.d.ts +1 -1
- package/dist/flows.js +1 -1
- package/dist/{ipc-DN6M4Ui9.js → ipc-BM335WFg.js} +3 -3
- package/dist/{ipc-DN6M4Ui9.js.map → ipc-BM335WFg.js.map} +1 -1
- package/dist/{jsonrpc-M3y-qzy8.js → jsonrpc-DSxh2w5R.js} +1 -1
- package/dist/{jsonrpc-M3y-qzy8.js.map → jsonrpc-DSxh2w5R.js.map} +1 -1
- package/dist/{output-Di0M9Et8.js → output-C4QhjpM6.js} +2 -2
- package/dist/{output-Di0M9Et8.js.map → output-C4QhjpM6.js.map} +1 -1
- package/dist/{perf-metrics-D9QC81lB.js → perf-metrics-D0um6IR6.js} +22 -2
- package/dist/perf-metrics-D0um6IR6.js.map +1 -0
- package/dist/{prompt-turn-Bt8T3SRR.js → prompt-turn-CbSSNHjk.js} +257 -28
- package/dist/prompt-turn-CbSSNHjk.js.map +1 -0
- package/dist/{render-BL5ynRkN.js → render-Br-kVPK_.js} +3 -3
- package/dist/{render-BL5ynRkN.js.map → render-Br-kVPK_.js.map} +1 -1
- package/dist/runtime.d.ts +3 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +2 -3
- package/dist/runtime.js.map +1 -1
- package/dist/{session-BbN0SBgf.js → session-BiBN0BvM.js} +5 -5
- package/dist/{session-BbN0SBgf.js.map → session-BiBN0BvM.js.map} +1 -1
- package/dist/{types-DXxLBQc3.d.ts → types-Cgigsj1X.d.ts} +1 -1
- package/dist/{types-DXxLBQc3.d.ts.map → types-Cgigsj1X.d.ts.map} +1 -1
- package/package.json +1 -1
- package/dist/agent-registry-DGw0-3Tc.js +0 -54
- package/dist/agent-registry-DGw0-3Tc.js.map +0 -1
- package/dist/perf-metrics-D9QC81lB.js.map +0 -1
- package/dist/prompt-turn-Bt8T3SRR.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as isSessionUpdateNotification } from "./jsonrpc-
|
|
1
|
+
import { B as PermissionPromptUnavailableError, C as isAcpResourceNotFoundError, F as AuthPolicyError, G as SessionNotFoundError, I as ClaudeAcpSessionCreateTimeoutError, K as SessionResolutionError, L as CopilotAcpUnsupportedError, M as AgentDisconnectedError, N as AgentSpawnError, P as AgentStartupError, R as GeminiAcpStartupTimeoutError, S as extractAcpError, U as SessionModeReplayError, W as SessionModelReplayError, g as textPrompt, i as measurePerf, j as SESSION_RECORD_SCHEMA, l as extractRuntimeSessionId, q as SessionResumeRequiredError, r as incrementPerfCounter, u as normalizeRuntimeSessionId, v as formatErrorMessage, y as isAcpQueryClosedBeforeResponseError, z as PermissionDeniedError } from "./perf-metrics-D0um6IR6.js";
|
|
2
|
+
import { r as isSessionUpdateNotification } from "./jsonrpc-DSxh2w5R.js";
|
|
3
3
|
import fs, { statSync } from "node:fs";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
4
5
|
import path from "node:path";
|
|
5
6
|
import fs$1 from "node:fs/promises";
|
|
6
7
|
import os from "node:os";
|
|
@@ -9,6 +10,159 @@ import { Readable, Writable } from "node:stream";
|
|
|
9
10
|
import { ClientSideConnection, PROTOCOL_VERSION } from "@agentclientprotocol/sdk";
|
|
10
11
|
import readline from "node:readline/promises";
|
|
11
12
|
import { randomUUID } from "node:crypto";
|
|
13
|
+
//#region src/agent-registry.ts
|
|
14
|
+
const ACP_ADAPTER_PACKAGE_RANGES = {
|
|
15
|
+
pi: "^0.0.22",
|
|
16
|
+
codex: "^0.11.1",
|
|
17
|
+
claude: "^0.25.0"
|
|
18
|
+
};
|
|
19
|
+
const AGENT_REGISTRY = {
|
|
20
|
+
pi: `npx pi-acp@${ACP_ADAPTER_PACKAGE_RANGES.pi}`,
|
|
21
|
+
openclaw: "openclaw acp",
|
|
22
|
+
codex: `npx @zed-industries/codex-acp@${ACP_ADAPTER_PACKAGE_RANGES.codex}`,
|
|
23
|
+
claude: `npx -y @agentclientprotocol/claude-agent-acp@${ACP_ADAPTER_PACKAGE_RANGES.claude}`,
|
|
24
|
+
gemini: "gemini --acp",
|
|
25
|
+
cursor: "cursor-agent acp",
|
|
26
|
+
copilot: "copilot --acp --stdio",
|
|
27
|
+
droid: "droid exec --output-format acp",
|
|
28
|
+
iflow: "iflow --experimental-acp",
|
|
29
|
+
kilocode: "npx -y @kilocode/cli acp",
|
|
30
|
+
kimi: "kimi acp",
|
|
31
|
+
kiro: "kiro-cli-chat acp",
|
|
32
|
+
opencode: "npx -y opencode-ai acp",
|
|
33
|
+
qoder: "qodercli --acp",
|
|
34
|
+
qwen: "qwen --acp",
|
|
35
|
+
trae: "traecli acp serve"
|
|
36
|
+
};
|
|
37
|
+
const BUILT_IN_AGENT_PACKAGES = {
|
|
38
|
+
codex: {
|
|
39
|
+
packageName: "@zed-industries/codex-acp",
|
|
40
|
+
packageRange: ACP_ADAPTER_PACKAGE_RANGES.codex,
|
|
41
|
+
preferredBinName: "codex-acp",
|
|
42
|
+
fallbackCommand: AGENT_REGISTRY.codex,
|
|
43
|
+
legacyFallbackCommands: []
|
|
44
|
+
},
|
|
45
|
+
claude: {
|
|
46
|
+
packageName: "@agentclientprotocol/claude-agent-acp",
|
|
47
|
+
packageRange: ACP_ADAPTER_PACKAGE_RANGES.claude,
|
|
48
|
+
preferredBinName: "claude-agent-acp",
|
|
49
|
+
fallbackCommand: AGENT_REGISTRY.claude,
|
|
50
|
+
legacyFallbackCommands: [`npm exec @agentclientprotocol/claude-agent-acp@${ACP_ADAPTER_PACKAGE_RANGES.claude}`]
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const AGENT_ALIASES = {
|
|
54
|
+
"factory-droid": "droid",
|
|
55
|
+
factorydroid: "droid"
|
|
56
|
+
};
|
|
57
|
+
const DEFAULT_AGENT_NAME = "codex";
|
|
58
|
+
function normalizeAgentName$1(value) {
|
|
59
|
+
return value.trim().toLowerCase();
|
|
60
|
+
}
|
|
61
|
+
function mergeAgentRegistry(overrides) {
|
|
62
|
+
if (!overrides) return { ...AGENT_REGISTRY };
|
|
63
|
+
const merged = { ...AGENT_REGISTRY };
|
|
64
|
+
for (const [name, command] of Object.entries(overrides)) {
|
|
65
|
+
const normalized = normalizeAgentName$1(name);
|
|
66
|
+
if (!normalized || !command.trim()) continue;
|
|
67
|
+
merged[normalized] = command.trim();
|
|
68
|
+
}
|
|
69
|
+
return merged;
|
|
70
|
+
}
|
|
71
|
+
function resolveAgentCommand(agentName, overrides) {
|
|
72
|
+
const normalized = normalizeAgentName$1(agentName);
|
|
73
|
+
const registry = mergeAgentRegistry(overrides);
|
|
74
|
+
return registry[normalized] ?? registry[AGENT_ALIASES[normalized] ?? normalized] ?? agentName;
|
|
75
|
+
}
|
|
76
|
+
function findBuiltInAgentPackage(agentCommand) {
|
|
77
|
+
const normalized = agentCommand.trim();
|
|
78
|
+
return Object.values(BUILT_IN_AGENT_PACKAGES).find((spec) => spec.fallbackCommand === normalized || spec.legacyFallbackCommands?.includes(normalized));
|
|
79
|
+
}
|
|
80
|
+
function defaultResolvePackageRoot(packageName) {
|
|
81
|
+
const segments = packageName.split("/");
|
|
82
|
+
let cursor = path.dirname(fileURLToPath(import.meta.url));
|
|
83
|
+
while (true) {
|
|
84
|
+
const candidateRoot = path.join(cursor, "node_modules", ...segments);
|
|
85
|
+
const manifestPath = path.join(candidateRoot, "package.json");
|
|
86
|
+
if (fs.existsSync(manifestPath)) try {
|
|
87
|
+
if (JSON.parse(fs.readFileSync(manifestPath, "utf8")).name === packageName) return candidateRoot;
|
|
88
|
+
} catch {}
|
|
89
|
+
const parent = path.dirname(cursor);
|
|
90
|
+
if (parent === cursor) throw new Error(`Built-in agent package not found: ${packageName}`);
|
|
91
|
+
cursor = parent;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function resolvePackageBin(spec, manifest) {
|
|
95
|
+
if (typeof manifest.bin === "string") return manifest.bin;
|
|
96
|
+
if (!manifest.bin || typeof manifest.bin !== "object") return;
|
|
97
|
+
return manifest.bin[spec.preferredBinName] ?? (Object.keys(manifest.bin).length === 1 ? Object.values(manifest.bin)[0] : void 0);
|
|
98
|
+
}
|
|
99
|
+
function defaultResolveNpmCliPath(execPath) {
|
|
100
|
+
const candidate = path.resolve(path.dirname(execPath), "..", "lib", "node_modules", "npm", "bin", "npm-cli.js");
|
|
101
|
+
if (!fs.existsSync(candidate)) throw new Error(`npm CLI not found for execPath: ${execPath}`);
|
|
102
|
+
return candidate;
|
|
103
|
+
}
|
|
104
|
+
function resolveInstalledBuiltInAgentLaunch(agentCommand, options = {}) {
|
|
105
|
+
const spec = findBuiltInAgentPackage(agentCommand);
|
|
106
|
+
if (!spec) return;
|
|
107
|
+
const readFileSync = options.readFileSync ?? fs.readFileSync;
|
|
108
|
+
const existsSync = options.existsSync ?? fs.existsSync;
|
|
109
|
+
const resolvePackageRoot = options.resolvePackageRoot ?? defaultResolvePackageRoot;
|
|
110
|
+
try {
|
|
111
|
+
const packageRoot = resolvePackageRoot(spec.packageName);
|
|
112
|
+
const manifest = JSON.parse(readFileSync(path.join(packageRoot, "package.json"), "utf8"));
|
|
113
|
+
if (manifest.name !== spec.packageName) return;
|
|
114
|
+
const relativeBinPath = resolvePackageBin(spec, manifest);
|
|
115
|
+
if (!relativeBinPath) return;
|
|
116
|
+
const binPath = path.resolve(packageRoot, relativeBinPath);
|
|
117
|
+
if (!existsSync(binPath)) return;
|
|
118
|
+
return {
|
|
119
|
+
source: "installed",
|
|
120
|
+
command: process.execPath,
|
|
121
|
+
args: [binPath],
|
|
122
|
+
packageName: spec.packageName,
|
|
123
|
+
packageRange: spec.packageRange,
|
|
124
|
+
packageVersion: manifest.version,
|
|
125
|
+
binPath
|
|
126
|
+
};
|
|
127
|
+
} catch {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function resolvePackageExecBuiltInAgentLaunch(agentCommand, options = {}) {
|
|
132
|
+
const spec = findBuiltInAgentPackage(agentCommand);
|
|
133
|
+
if (!spec) return;
|
|
134
|
+
const existsSync = options.existsSync ?? fs.existsSync;
|
|
135
|
+
const execPath = options.execPath ?? process.execPath;
|
|
136
|
+
const resolveNpmCliPath = options.resolveNpmCliPath ?? defaultResolveNpmCliPath;
|
|
137
|
+
try {
|
|
138
|
+
const npmCliPath = resolveNpmCliPath(execPath);
|
|
139
|
+
if (!existsSync(npmCliPath)) return;
|
|
140
|
+
return {
|
|
141
|
+
source: "package-exec",
|
|
142
|
+
command: execPath,
|
|
143
|
+
args: [
|
|
144
|
+
npmCliPath,
|
|
145
|
+
"exec",
|
|
146
|
+
"--yes",
|
|
147
|
+
`--package=${spec.packageName}@${spec.packageRange}`,
|
|
148
|
+
"--",
|
|
149
|
+
spec.preferredBinName
|
|
150
|
+
],
|
|
151
|
+
packageName: spec.packageName,
|
|
152
|
+
packageRange: spec.packageRange,
|
|
153
|
+
npmCliPath
|
|
154
|
+
};
|
|
155
|
+
} catch {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function resolveBuiltInAgentLaunch(agentCommand, options = {}) {
|
|
160
|
+
return resolveInstalledBuiltInAgentLaunch(agentCommand, options) ?? resolvePackageExecBuiltInAgentLaunch(agentCommand, options);
|
|
161
|
+
}
|
|
162
|
+
function listBuiltInAgents(overrides) {
|
|
163
|
+
return Object.keys(mergeAgentRegistry(overrides));
|
|
164
|
+
}
|
|
165
|
+
//#endregion
|
|
12
166
|
//#region src/async-control.ts
|
|
13
167
|
var TimeoutError = class extends Error {
|
|
14
168
|
constructor(timeoutMs) {
|
|
@@ -1663,6 +1817,7 @@ const REPLAY_DRAIN_TIMEOUT_MS = 5e3;
|
|
|
1663
1817
|
const DRAIN_POLL_INTERVAL_MS = 20;
|
|
1664
1818
|
const AGENT_CLOSE_TERM_GRACE_MS = 1500;
|
|
1665
1819
|
const AGENT_CLOSE_KILL_GRACE_MS = 1e3;
|
|
1820
|
+
const STARTUP_STDERR_MAX_CHARS = 8192;
|
|
1666
1821
|
function shouldSuppressSdkConsoleError(args) {
|
|
1667
1822
|
if (args.length === 0) return false;
|
|
1668
1823
|
return typeof args[0] === "string" && args[0] === "Error handling request";
|
|
@@ -1825,13 +1980,18 @@ var AcpClient = class {
|
|
|
1825
1980
|
async start() {
|
|
1826
1981
|
if (this.connection && this.agent && isChildProcessRunning(this.agent)) return;
|
|
1827
1982
|
if (this.connection || this.agent) await this.close();
|
|
1828
|
-
const
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
if (
|
|
1834
|
-
|
|
1983
|
+
const configuredCommand = splitCommandLine(this.options.agentCommand);
|
|
1984
|
+
const resolvedBuiltInLaunch = resolveBuiltInAgentLaunch(this.options.agentCommand);
|
|
1985
|
+
const spawnCommand = resolvedBuiltInLaunch?.command ?? configuredCommand.command;
|
|
1986
|
+
let args = resolvedBuiltInLaunch?.args ?? configuredCommand.args;
|
|
1987
|
+
args = await resolveGeminiCommandArgs(spawnCommand, args);
|
|
1988
|
+
if (isQoderAcpCommand(spawnCommand, args)) args = buildQoderAcpCommandArgs(args, this.options);
|
|
1989
|
+
if (resolvedBuiltInLaunch?.source === "installed") this.log(`spawning installed built-in agent ${resolvedBuiltInLaunch.packageName}${resolvedBuiltInLaunch.packageVersion ? `@${resolvedBuiltInLaunch.packageVersion}` : ""} via ${spawnCommand} ${args.join(" ")}`);
|
|
1990
|
+
else if (resolvedBuiltInLaunch?.source === "package-exec") this.log(`spawning built-in agent ${resolvedBuiltInLaunch.packageName}@${resolvedBuiltInLaunch.packageRange} via current Node package exec bridge ${spawnCommand} ${args.join(" ")}`);
|
|
1991
|
+
else this.log(`spawning agent: ${spawnCommand} ${args.join(" ")}`);
|
|
1992
|
+
const geminiAcp = isGeminiAcpCommand(spawnCommand, args);
|
|
1993
|
+
if (isCopilotAcpCommand(spawnCommand, args)) await ensureCopilotAcpSupport(spawnCommand);
|
|
1994
|
+
const spawnedChild = spawn(spawnCommand, args, buildSpawnCommandOptions(spawnCommand, buildAgentSpawnOptions(this.options.cwd, this.options.authCredentials)));
|
|
1835
1995
|
try {
|
|
1836
1996
|
await waitForSpawn$1(spawnedChild);
|
|
1837
1997
|
} catch (error) {
|
|
@@ -1843,7 +2003,9 @@ var AcpClient = class {
|
|
|
1843
2003
|
this.lastAgentExit = void 0;
|
|
1844
2004
|
this.lastKnownPid = child.pid ?? void 0;
|
|
1845
2005
|
this.attachAgentLifecycleObservers(child);
|
|
2006
|
+
const startupStderr = [];
|
|
1846
2007
|
child.stderr.on("data", (chunk) => {
|
|
2008
|
+
this.captureStartupStderr(startupStderr, chunk);
|
|
1847
2009
|
if (!this.options.verbose) return;
|
|
1848
2010
|
process.stderr.write(chunk);
|
|
1849
2011
|
});
|
|
@@ -1881,30 +2043,38 @@ var AcpClient = class {
|
|
|
1881
2043
|
connection.signal.addEventListener("abort", () => {
|
|
1882
2044
|
this.recordAgentExit("connection_close", child.exitCode ?? null, child.signalCode ?? null);
|
|
1883
2045
|
}, { once: true });
|
|
2046
|
+
const startupFailure = this.createStartupFailureWatcher(child, startupStderr);
|
|
1884
2047
|
try {
|
|
1885
|
-
const
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
2048
|
+
const initResult = await Promise.race([(async () => {
|
|
2049
|
+
const initializePromise = connection.initialize({
|
|
2050
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
2051
|
+
clientCapabilities: {
|
|
2052
|
+
fs: {
|
|
2053
|
+
readTextFile: true,
|
|
2054
|
+
writeTextFile: true
|
|
2055
|
+
},
|
|
2056
|
+
terminal: true
|
|
1891
2057
|
},
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
2058
|
+
clientInfo: {
|
|
2059
|
+
name: "acpx",
|
|
2060
|
+
version: "0.1.0"
|
|
2061
|
+
}
|
|
2062
|
+
});
|
|
2063
|
+
const initialized = geminiAcp ? await withTimeout(initializePromise, resolveGeminiAcpStartupTimeoutMs()) : await initializePromise;
|
|
2064
|
+
await this.authenticateIfRequired(connection, initialized.authMethods ?? []);
|
|
2065
|
+
return initialized;
|
|
2066
|
+
})(), startupFailure.promise]);
|
|
2067
|
+
startupFailure.dispose();
|
|
1901
2068
|
this.connection = connection;
|
|
1902
2069
|
this.agent = child;
|
|
1903
2070
|
this.initResult = initResult;
|
|
1904
2071
|
this.log(`initialized protocol version ${initResult.protocolVersion}`);
|
|
1905
2072
|
} catch (error) {
|
|
1906
|
-
|
|
1907
|
-
|
|
2073
|
+
startupFailure.dispose();
|
|
2074
|
+
try {
|
|
2075
|
+
child.kill();
|
|
2076
|
+
} catch {}
|
|
2077
|
+
if (geminiAcp && error instanceof TimeoutError) throw new GeminiAcpStartupTimeoutError(await buildGeminiAcpStartupTimeoutMessage(spawnCommand), {
|
|
1908
2078
|
cause: error,
|
|
1909
2079
|
retryable: true
|
|
1910
2080
|
});
|
|
@@ -2164,6 +2334,65 @@ var AcpClient = class {
|
|
|
2164
2334
|
if (!this.options.verbose) return;
|
|
2165
2335
|
process.stderr.write(`[acpx] ${message}\n`);
|
|
2166
2336
|
}
|
|
2337
|
+
captureStartupStderr(target, chunk) {
|
|
2338
|
+
const text = typeof chunk === "string" ? chunk : chunk.toString("utf8");
|
|
2339
|
+
if (text.length === 0) return;
|
|
2340
|
+
target.push(text);
|
|
2341
|
+
if (target.join("").length - STARTUP_STDERR_MAX_CHARS <= 0) return;
|
|
2342
|
+
const joined = target.join("");
|
|
2343
|
+
target.splice(0, target.length, joined.slice(-STARTUP_STDERR_MAX_CHARS));
|
|
2344
|
+
}
|
|
2345
|
+
summarizeStartupStderr(target) {
|
|
2346
|
+
const joined = target.join("").trim();
|
|
2347
|
+
if (!joined) return;
|
|
2348
|
+
return joined.replace(/\s+/gu, " ").trim().slice(0, STARTUP_STDERR_MAX_CHARS);
|
|
2349
|
+
}
|
|
2350
|
+
createStartupFailureWatcher(child, startupStderr) {
|
|
2351
|
+
let settled = false;
|
|
2352
|
+
let rejectPromise;
|
|
2353
|
+
const cleanup = () => {
|
|
2354
|
+
child.off("error", onError);
|
|
2355
|
+
child.off("exit", onExit);
|
|
2356
|
+
child.off("close", onClose);
|
|
2357
|
+
};
|
|
2358
|
+
const finish = (error) => {
|
|
2359
|
+
if (settled) return;
|
|
2360
|
+
settled = true;
|
|
2361
|
+
cleanup();
|
|
2362
|
+
if (error) rejectPromise(error);
|
|
2363
|
+
};
|
|
2364
|
+
const createError = (params) => new AgentStartupError({
|
|
2365
|
+
agentCommand: this.options.agentCommand,
|
|
2366
|
+
exitCode: params?.exitCode ?? child.exitCode ?? null,
|
|
2367
|
+
signal: params?.signal ?? child.signalCode ?? null,
|
|
2368
|
+
stderrSummary: this.summarizeStartupStderr(startupStderr),
|
|
2369
|
+
cause: params?.cause
|
|
2370
|
+
});
|
|
2371
|
+
const onError = (error) => {
|
|
2372
|
+
finish(createError({ cause: error }));
|
|
2373
|
+
};
|
|
2374
|
+
const onExit = (exitCode, signal) => {
|
|
2375
|
+
finish(createError({
|
|
2376
|
+
exitCode,
|
|
2377
|
+
signal
|
|
2378
|
+
}));
|
|
2379
|
+
};
|
|
2380
|
+
const onClose = (exitCode, signal) => {
|
|
2381
|
+
finish(createError({
|
|
2382
|
+
exitCode,
|
|
2383
|
+
signal
|
|
2384
|
+
}));
|
|
2385
|
+
};
|
|
2386
|
+
return {
|
|
2387
|
+
promise: new Promise((_resolve, reject) => {
|
|
2388
|
+
rejectPromise = reject;
|
|
2389
|
+
child.once("error", onError);
|
|
2390
|
+
child.once("exit", onExit);
|
|
2391
|
+
child.once("close", onClose);
|
|
2392
|
+
}),
|
|
2393
|
+
dispose: () => finish()
|
|
2394
|
+
};
|
|
2395
|
+
}
|
|
2167
2396
|
selectAuthMethod(methods) {
|
|
2168
2397
|
for (const method of methods) {
|
|
2169
2398
|
const envCredential = readEnvCredential(method.id);
|
|
@@ -3118,6 +3347,6 @@ async function runPromptTurn(params) {
|
|
|
3118
3347
|
}
|
|
3119
3348
|
}
|
|
3120
3349
|
//#endregion
|
|
3121
|
-
export { resolveSessionRecord as A, serializeSessionRecordForDisk as B, findGitRepositoryRoot as C, listSessions as D, isoNow$2 as E, sessionBaseDir$1 as F, TimeoutError as H, sessionEventActivePath as I, sessionEventLockPath as L, parseSessionRecord as M, DEFAULT_EVENT_SEGMENT_MAX_BYTES as N, listSessionsForAgent as O, defaultSessionEventLog as P, sessionEventSegmentPath as R, absolutePath as S, findSessionByDirectoryWalk as T, withInterrupt as U, InterruptedError as V, withTimeout as W, recordSessionUpdate as _, applyConversation as a, permissionModeSatisfies as b, setCurrentModelId as c, syncAdvertisedModelState as d, cloneSessionAcpxState as f, recordPromptSubmission as g, recordClientOperation as h, connectAndLoadSession as i, writeSessionRecord as j, normalizeName as k, setDesiredModeId as l, createSessionConversation as m, withConnectedSession as n, applyLifecycleSnapshotToRecord as o, cloneSessionConversation as p, sessionOptionsFromRecord as r, reconcileAgentSessionId as s, runPromptTurn as t, setDesiredModelId as u, trimConversationForRuntime as v, findSession as w, DEFAULT_HISTORY_LIMIT as x, AcpClient as y, assertPersistedKeyPolicy as z };
|
|
3350
|
+
export { resolveSessionRecord as A, serializeSessionRecordForDisk as B, findGitRepositoryRoot as C, listSessions as D, isoNow$2 as E, sessionBaseDir$1 as F, DEFAULT_AGENT_NAME as G, TimeoutError as H, sessionEventActivePath as I, resolveAgentCommand as J, listBuiltInAgents as K, sessionEventLockPath as L, parseSessionRecord as M, DEFAULT_EVENT_SEGMENT_MAX_BYTES as N, listSessionsForAgent as O, defaultSessionEventLog as P, sessionEventSegmentPath as R, absolutePath as S, findSessionByDirectoryWalk as T, withInterrupt as U, InterruptedError as V, withTimeout as W, recordSessionUpdate as _, applyConversation as a, permissionModeSatisfies as b, setCurrentModelId as c, syncAdvertisedModelState as d, cloneSessionAcpxState as f, recordPromptSubmission as g, recordClientOperation as h, connectAndLoadSession as i, writeSessionRecord as j, normalizeName as k, setDesiredModeId as l, createSessionConversation as m, withConnectedSession as n, applyLifecycleSnapshotToRecord as o, cloneSessionConversation as p, normalizeAgentName$1 as q, sessionOptionsFromRecord as r, reconcileAgentSessionId as s, runPromptTurn as t, setDesiredModelId as u, trimConversationForRuntime as v, findSession as w, DEFAULT_HISTORY_LIMIT as x, AcpClient as y, assertPersistedKeyPolicy as z };
|
|
3122
3351
|
|
|
3123
|
-
//# sourceMappingURL=prompt-turn-
|
|
3352
|
+
//# sourceMappingURL=prompt-turn-CbSSNHjk.js.map
|