acpx 0.2.0 → 0.3.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/README.md +8 -4
- package/dist/{acp-jsonrpc-CGT_1Mel.js → acp-jsonrpc-BNHXq7qK.js} +2 -2
- package/dist/{acp-jsonrpc-CGT_1Mel.js.map → acp-jsonrpc-BNHXq7qK.js.map} +1 -1
- package/dist/cli.js +49 -36
- package/dist/cli.js.map +1 -1
- package/dist/{output-BgMdEq3x.js → output-BmkPP7qE.js} +3 -6
- package/dist/{output-BgMdEq3x.js.map → output-BmkPP7qE.js.map} +1 -1
- package/dist/{output-render-Cvz0eKSb.js → output-render-DEAaMxg8.js} +5 -6
- package/dist/{output-render-Cvz0eKSb.js.map → output-render-DEAaMxg8.js.map} +1 -1
- package/dist/{queue-ipc-C8StWiZt.js → queue-ipc-EQLpBMKv.js} +133 -98
- package/dist/queue-ipc-EQLpBMKv.js.map +1 -0
- package/dist/rolldown-runtime-CiIaOW0V.js +13 -0
- package/dist/{runtime-session-id-B03l5p1Q.js → runtime-session-id-C544sPPL.js} +2 -3
- package/dist/{runtime-session-id-B03l5p1Q.js.map → runtime-session-id-C544sPPL.js.map} +1 -1
- package/dist/{session-C6nyqSfk.js → session-C2Q8ktsN.js} +244 -80
- package/dist/session-C2Q8ktsN.js.map +1 -0
- package/package.json +5 -3
- package/skills/acpx/SKILL.md +7 -4
- package/dist/queue-ipc-C8StWiZt.js.map +0 -1
- package/dist/rolldown-runtime-CjeV3_4I.js +0 -18
- package/dist/session-C6nyqSfk.js.map +0 -1
package/README.md
CHANGED
|
@@ -139,7 +139,7 @@ acpx codex --file - "extra context" # explicit stdin + appended args
|
|
|
139
139
|
acpx codex --no-wait 'draft test migration plan' # enqueue without waiting if session is busy
|
|
140
140
|
acpx codex cancel # cooperative cancel of in-flight prompt
|
|
141
141
|
acpx codex set-mode auto # session/set_mode (adapter-defined mode id)
|
|
142
|
-
acpx codex set
|
|
142
|
+
acpx codex set thought_level high # codex compatibility alias -> reasoning_effort
|
|
143
143
|
acpx exec 'summarize this repo' # default agent shortcut (codex)
|
|
144
144
|
acpx codex exec 'what does this repo do?' # one-shot, no saved session
|
|
145
145
|
|
|
@@ -285,15 +285,19 @@ Built-ins:
|
|
|
285
285
|
| `openclaw` | native (`openclaw acp`) | [OpenClaw ACP bridge](https://github.com/openclaw/openclaw) |
|
|
286
286
|
| `codex` | [codex-acp](https://github.com/zed-industries/codex-acp) | [Codex CLI](https://codex.openai.com) |
|
|
287
287
|
| `claude` | [claude-agent-acp](https://github.com/zed-industries/claude-agent-acp) | [Claude Code](https://claude.ai/code) |
|
|
288
|
-
| `gemini` | native (`gemini --
|
|
288
|
+
| `gemini` | native (`gemini --acp`) | [Gemini CLI](https://github.com/google/gemini-cli) |
|
|
289
289
|
| `cursor` | native (`cursor-agent acp`) | [Cursor CLI](https://cursor.com/docs/cli/acp) |
|
|
290
290
|
| `copilot` | native (`copilot --acp --stdio`) | [GitHub Copilot CLI](https://docs.github.com/copilot/how-tos/copilot-chat/use-copilot-chat-in-the-command-line) |
|
|
291
|
+
| `droid` | native (`droid exec --output-format acp`) | [Factory Droid](https://www.factory.ai) |
|
|
292
|
+
| `iflow` | native (`iflow --experimental-acp`) | [iFlow CLI](https://github.com/iflow-ai/iflow-cli) |
|
|
293
|
+
| `kilocode` | `npx -y @kilocode/cli acp` | [Kilocode](https://kilocode.ai) |
|
|
291
294
|
| `kimi` | native (`kimi acp`) | [Kimi CLI](https://github.com/MoonshotAI/kimi-cli) |
|
|
292
|
-
| `opencode` | `npx -y opencode-ai acp` | [OpenCode](https://opencode.ai) |
|
|
293
295
|
| `kiro` | native (`kiro-cli acp`) | [Kiro CLI](https://kiro.dev) |
|
|
294
|
-
| `
|
|
296
|
+
| `opencode` | `npx -y opencode-ai acp` | [OpenCode](https://opencode.ai) |
|
|
295
297
|
| `qwen` | native (`qwen --acp`) | [Qwen Code](https://github.com/QwenLM/qwen-code) |
|
|
296
298
|
|
|
299
|
+
`factory-droid` and `factorydroid` also resolve to the built-in `droid` adapter.
|
|
300
|
+
|
|
297
301
|
Additional built-in agent docs live in [agents/README.md](agents/README.md).
|
|
298
302
|
|
|
299
303
|
Use `--agent` as an escape hatch for custom ACP servers:
|
|
@@ -49,7 +49,7 @@ function parseJsonRpcErrorMessage(message) {
|
|
|
49
49
|
if (!errorRecord || typeof errorRecord.message !== "string") return;
|
|
50
50
|
return errorRecord.message;
|
|
51
51
|
}
|
|
52
|
-
|
|
53
52
|
//#endregion
|
|
54
53
|
export { parsePromptStopReason as i, isSessionUpdateNotification as n, parseJsonRpcErrorMessage as r, isAcpJsonRpcMessage as t };
|
|
55
|
-
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=acp-jsonrpc-BNHXq7qK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acp-jsonrpc-
|
|
1
|
+
{"version":3,"file":"acp-jsonrpc-BNHXq7qK.js","names":[],"sources":["../src/acp-jsonrpc.ts"],"sourcesContent":["import type { AnyMessage } from \"@agentclientprotocol/sdk\";\n\ntype JsonRpcId = string | number | null;\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return null;\n }\n return value as Record<string, unknown>;\n}\n\nfunction hasValidId(value: unknown): value is JsonRpcId {\n return (\n value === null ||\n typeof value === \"string\" ||\n (typeof value === \"number\" && Number.isFinite(value))\n );\n}\n\nfunction isErrorObject(value: unknown): value is { code: number; message: string } {\n const record = asRecord(value);\n return (\n !!record &&\n typeof record.code === \"number\" &&\n Number.isFinite(record.code) &&\n typeof record.message === \"string\"\n );\n}\n\nfunction hasResultOrError(value: Record<string, unknown>): boolean {\n const hasResult = Object.hasOwn(value, \"result\");\n const hasError = Object.hasOwn(value, \"error\");\n if (hasResult && hasError) {\n return false;\n }\n if (!hasResult && !hasError) {\n return false;\n }\n if (hasError && !isErrorObject(value.error)) {\n return false;\n }\n return true;\n}\n\nexport function isAcpJsonRpcMessage(value: unknown): value is AnyMessage {\n const record = asRecord(value);\n if (!record || record.jsonrpc !== \"2.0\") {\n return false;\n }\n\n const hasMethod = typeof record.method === \"string\" && record.method.length > 0;\n const hasId = Object.hasOwn(record, \"id\");\n\n if (hasMethod && !hasId) {\n // Notification\n return true;\n }\n\n if (hasMethod && hasId) {\n // Request\n return hasValidId(record.id);\n }\n\n if (!hasMethod && hasId) {\n // Response\n if (!hasValidId(record.id)) {\n return false;\n }\n return hasResultOrError(record);\n }\n\n return false;\n}\n\nexport function isJsonRpcNotification(message: AnyMessage): boolean {\n return (\n Object.hasOwn(message, \"method\") &&\n typeof (message as { method?: unknown }).method === \"string\" &&\n !Object.hasOwn(message, \"id\")\n );\n}\n\nexport function isSessionUpdateNotification(message: AnyMessage): boolean {\n return (\n isJsonRpcNotification(message) && (message as { method?: unknown }).method === \"session/update\"\n );\n}\n\nexport function parsePromptStopReason(message: AnyMessage): string | undefined {\n if (!Object.hasOwn(message, \"id\") || !Object.hasOwn(message, \"result\")) {\n return undefined;\n }\n const record = asRecord((message as { result?: unknown }).result);\n if (!record) {\n return undefined;\n }\n return typeof record.stopReason === \"string\" ? record.stopReason : undefined;\n}\n\nexport function parseJsonRpcErrorMessage(message: AnyMessage): string | undefined {\n if (!Object.hasOwn(message, \"error\")) {\n return undefined;\n }\n const errorRecord = asRecord((message as { error?: unknown }).error);\n if (!errorRecord || typeof errorRecord.message !== \"string\") {\n return undefined;\n }\n return errorRecord.message;\n}\n"],"mappings":";AAIA,SAAS,SAAS,OAAgD;AAChE,KAAI,CAAC,SAAS,OAAO,UAAU,YAAY,MAAM,QAAQ,MAAM,CAC7D,QAAO;AAET,QAAO;;AAGT,SAAS,WAAW,OAAoC;AACtD,QACE,UAAU,QACV,OAAO,UAAU,YAChB,OAAO,UAAU,YAAY,OAAO,SAAS,MAAM;;AAIxD,SAAS,cAAc,OAA4D;CACjF,MAAM,SAAS,SAAS,MAAM;AAC9B,QACE,CAAC,CAAC,UACF,OAAO,OAAO,SAAS,YACvB,OAAO,SAAS,OAAO,KAAK,IAC5B,OAAO,OAAO,YAAY;;AAI9B,SAAS,iBAAiB,OAAyC;CACjE,MAAM,YAAY,OAAO,OAAO,OAAO,SAAS;CAChD,MAAM,WAAW,OAAO,OAAO,OAAO,QAAQ;AAC9C,KAAI,aAAa,SACf,QAAO;AAET,KAAI,CAAC,aAAa,CAAC,SACjB,QAAO;AAET,KAAI,YAAY,CAAC,cAAc,MAAM,MAAM,CACzC,QAAO;AAET,QAAO;;AAGT,SAAgB,oBAAoB,OAAqC;CACvE,MAAM,SAAS,SAAS,MAAM;AAC9B,KAAI,CAAC,UAAU,OAAO,YAAY,MAChC,QAAO;CAGT,MAAM,YAAY,OAAO,OAAO,WAAW,YAAY,OAAO,OAAO,SAAS;CAC9E,MAAM,QAAQ,OAAO,OAAO,QAAQ,KAAK;AAEzC,KAAI,aAAa,CAAC,MAEhB,QAAO;AAGT,KAAI,aAAa,MAEf,QAAO,WAAW,OAAO,GAAG;AAG9B,KAAI,CAAC,aAAa,OAAO;AAEvB,MAAI,CAAC,WAAW,OAAO,GAAG,CACxB,QAAO;AAET,SAAO,iBAAiB,OAAO;;AAGjC,QAAO;;AAGT,SAAgB,sBAAsB,SAA8B;AAClE,QACE,OAAO,OAAO,SAAS,SAAS,IAChC,OAAQ,QAAiC,WAAW,YACpD,CAAC,OAAO,OAAO,SAAS,KAAK;;AAIjC,SAAgB,4BAA4B,SAA8B;AACxE,QACE,sBAAsB,QAAQ,IAAK,QAAiC,WAAW;;AAInF,SAAgB,sBAAsB,SAAyC;AAC7E,KAAI,CAAC,OAAO,OAAO,SAAS,KAAK,IAAI,CAAC,OAAO,OAAO,SAAS,SAAS,CACpE;CAEF,MAAM,SAAS,SAAU,QAAiC,OAAO;AACjE,KAAI,CAAC,OACH;AAEF,QAAO,OAAO,OAAO,eAAe,WAAW,OAAO,aAAa,KAAA;;AAGrE,SAAgB,yBAAyB,SAAyC;AAChF,KAAI,CAAC,OAAO,OAAO,SAAS,QAAQ,CAClC;CAEF,MAAM,cAAc,SAAU,QAAgC,MAAM;AACpE,KAAI,CAAC,eAAe,OAAO,YAAY,YAAY,SACjD;AAEF,QAAO,YAAY"}
|
package/dist/cli.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as OUTPUT_FORMATS, C as exitCodeForOutputErrorCode, D as AUTH_POLICIES, E as normalizeOutputError,
|
|
3
|
-
import { a as findGitRepositoryRoot, c as flushPerfMetricsCapture,
|
|
4
|
-
import { t as formatPromptSessionBannerLine } from "./output-render-
|
|
2
|
+
import { A as OUTPUT_FORMATS, C as exitCodeForOutputErrorCode, D as AUTH_POLICIES, E as normalizeOutputError, I as textPrompt, M as PromptInputValidationError, N as mergePromptSourceWithText, O as EXIT_CODES, P as parsePromptSource, k as NON_INTERACTIVE_PERMISSION_POLICIES } from "./queue-ipc-EQLpBMKv.js";
|
|
3
|
+
import { a as findGitRepositoryRoot, c as flushPerfMetricsCapture, l as installPerfMetricsCapture, o as findSession, r as runSessionQueueOwner, s as findSessionByDirectoryWalk, u as InterruptedError } from "./session-C2Q8ktsN.js";
|
|
4
|
+
import { t as formatPromptSessionBannerLine } from "./output-render-DEAaMxg8.js";
|
|
5
5
|
import { readFileSync, realpathSync } from "node:fs";
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
7
|
import fs$1 from "node:fs/promises";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { Command, CommanderError, InvalidArgumentError } from "commander";
|
|
10
10
|
import os from "node:os";
|
|
11
|
-
|
|
12
11
|
//#region src/agent-registry.ts
|
|
13
12
|
const ACP_ADAPTER_PACKAGE_RANGES = {
|
|
14
13
|
pi: "^0.0.22",
|
|
@@ -20,15 +19,21 @@ const AGENT_REGISTRY = {
|
|
|
20
19
|
openclaw: "openclaw acp",
|
|
21
20
|
codex: `npx @zed-industries/codex-acp@${ACP_ADAPTER_PACKAGE_RANGES.codex}`,
|
|
22
21
|
claude: `npx -y @zed-industries/claude-agent-acp@${ACP_ADAPTER_PACKAGE_RANGES.claude}`,
|
|
23
|
-
gemini: "gemini --
|
|
22
|
+
gemini: "gemini --acp",
|
|
24
23
|
cursor: "cursor-agent acp",
|
|
25
24
|
copilot: "copilot --acp --stdio",
|
|
25
|
+
droid: "droid exec --output-format acp",
|
|
26
|
+
iflow: "iflow --experimental-acp",
|
|
27
|
+
kilocode: "npx -y @kilocode/cli acp",
|
|
26
28
|
kimi: "kimi acp",
|
|
27
|
-
opencode: "npx -y opencode-ai acp",
|
|
28
29
|
kiro: "kiro-cli acp",
|
|
29
|
-
|
|
30
|
+
opencode: "npx -y opencode-ai acp",
|
|
30
31
|
qwen: "qwen --acp"
|
|
31
32
|
};
|
|
33
|
+
const AGENT_ALIASES = {
|
|
34
|
+
"factory-droid": "droid",
|
|
35
|
+
factorydroid: "droid"
|
|
36
|
+
};
|
|
32
37
|
const DEFAULT_AGENT_NAME = "codex";
|
|
33
38
|
function normalizeAgentName(value) {
|
|
34
39
|
return value.trim().toLowerCase();
|
|
@@ -45,12 +50,12 @@ function mergeAgentRegistry(overrides) {
|
|
|
45
50
|
}
|
|
46
51
|
function resolveAgentCommand(agentName, overrides) {
|
|
47
52
|
const normalized = normalizeAgentName(agentName);
|
|
48
|
-
|
|
53
|
+
const registry = mergeAgentRegistry(overrides);
|
|
54
|
+
return registry[normalized] ?? registry[AGENT_ALIASES[normalized] ?? normalized] ?? agentName;
|
|
49
55
|
}
|
|
50
56
|
function listBuiltInAgents(overrides) {
|
|
51
57
|
return Object.keys(mergeAgentRegistry(overrides));
|
|
52
58
|
}
|
|
53
|
-
|
|
54
59
|
//#endregion
|
|
55
60
|
//#region src/cli/flags.ts
|
|
56
61
|
function parseOutputFormat$1(value) {
|
|
@@ -145,7 +150,7 @@ function resolveGlobalFlags(command, config) {
|
|
|
145
150
|
nonInteractivePermissions: opts.nonInteractivePermissions ?? config.nonInteractivePermissions,
|
|
146
151
|
jsonStrict,
|
|
147
152
|
timeout: opts.timeout ?? config.timeoutMs,
|
|
148
|
-
ttl: opts.ttl ?? config.ttlMs ??
|
|
153
|
+
ttl: opts.ttl ?? config.ttlMs ?? 3e5,
|
|
149
154
|
verbose,
|
|
150
155
|
format,
|
|
151
156
|
model: typeof opts.model === "string" ? parseNonEmptyValue("Model", opts.model) : void 0,
|
|
@@ -168,14 +173,13 @@ function resolveOutputPolicy(format, jsonStrict) {
|
|
|
168
173
|
function resolveAgentInvocation(explicitAgentName, globalFlags, config) {
|
|
169
174
|
const override = globalFlags.agent?.trim();
|
|
170
175
|
if (override && explicitAgentName) throw new InvalidArgumentError("Do not combine positional agent with --agent override");
|
|
171
|
-
const agentName = explicitAgentName ?? config.defaultAgent ??
|
|
176
|
+
const agentName = explicitAgentName ?? config.defaultAgent ?? "codex";
|
|
172
177
|
return {
|
|
173
178
|
agentName,
|
|
174
179
|
agentCommand: override && override.length > 0 ? override : resolveAgentCommand(agentName, config.agents),
|
|
175
180
|
cwd: path.resolve(globalFlags.cwd)
|
|
176
181
|
};
|
|
177
182
|
}
|
|
178
|
-
|
|
179
183
|
//#endregion
|
|
180
184
|
//#region src/mcp-servers.ts
|
|
181
185
|
function asRecord$1(value) {
|
|
@@ -278,7 +282,6 @@ function parseOptionalMcpServers(value, sourcePath, fieldName = "mcpServers") {
|
|
|
278
282
|
if (value === void 0) return;
|
|
279
283
|
return parseMcpServers(value, sourcePath, fieldName);
|
|
280
284
|
}
|
|
281
|
-
|
|
282
285
|
//#endregion
|
|
283
286
|
//#region src/config.ts
|
|
284
287
|
const DEFAULT_TIMEOUT_MS = void 0;
|
|
@@ -415,7 +418,7 @@ async function loadResolvedConfig(cwd) {
|
|
|
415
418
|
const [globalResult, projectResult] = await Promise.all([readConfigFile(globalPath), readConfigFile(projectPath)]);
|
|
416
419
|
const globalConfig = globalResult.config;
|
|
417
420
|
const projectConfig = projectResult.config;
|
|
418
|
-
const defaultAgent = parseDefaultAgent(projectConfig?.defaultAgent, projectPath) ?? parseDefaultAgent(globalConfig?.defaultAgent, globalPath) ??
|
|
421
|
+
const defaultAgent = parseDefaultAgent(projectConfig?.defaultAgent, projectPath) ?? parseDefaultAgent(globalConfig?.defaultAgent, globalPath) ?? "codex";
|
|
419
422
|
const defaultPermissions = parsePermissionMode(projectConfig?.defaultPermissions, projectPath) ?? parsePermissionMode(globalConfig?.defaultPermissions, globalPath) ?? DEFAULT_PERMISSION_MODE;
|
|
420
423
|
const nonInteractivePermissions = parseNonInteractivePermissionPolicy(projectConfig?.nonInteractivePermissions, projectPath) ?? parseNonInteractivePermissionPolicy(globalConfig?.nonInteractivePermissions, globalPath) ?? DEFAULT_NON_INTERACTIVE_PERMISSION_POLICY;
|
|
421
424
|
const authPolicy = parseAuthPolicy(projectConfig?.authPolicy, projectPath) ?? parseAuthPolicy(globalConfig?.authPolicy, globalPath) ?? DEFAULT_AUTH_POLICY;
|
|
@@ -499,7 +502,6 @@ async function initGlobalConfigFile() {
|
|
|
499
502
|
created: true
|
|
500
503
|
};
|
|
501
504
|
}
|
|
502
|
-
|
|
503
505
|
//#endregion
|
|
504
506
|
//#region src/queue-owner-env.ts
|
|
505
507
|
function asRecord(value) {
|
|
@@ -534,7 +536,6 @@ async function runQueueOwnerFromEnv(env) {
|
|
|
534
536
|
if (!payload) throw new Error("missing ACPX_QUEUE_OWNER_PAYLOAD");
|
|
535
537
|
await runSessionQueueOwner(parseQueueOwnerPayload(payload));
|
|
536
538
|
}
|
|
537
|
-
|
|
538
539
|
//#endregion
|
|
539
540
|
//#region src/version.ts
|
|
540
541
|
const UNKNOWN_VERSION = "0.0.0-unknown";
|
|
@@ -575,7 +576,6 @@ function getAcpxVersion() {
|
|
|
575
576
|
cachedVersion = resolveAcpxVersion();
|
|
576
577
|
return cachedVersion;
|
|
577
578
|
}
|
|
578
|
-
|
|
579
579
|
//#endregion
|
|
580
580
|
//#region src/cli-core.ts
|
|
581
581
|
var NoSessionError = class extends Error {
|
|
@@ -601,17 +601,22 @@ async function readPromptInputFromStdin() {
|
|
|
601
601
|
return data;
|
|
602
602
|
}
|
|
603
603
|
async function readPrompt(promptParts, filePath, cwd) {
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
604
|
+
try {
|
|
605
|
+
if (filePath) {
|
|
606
|
+
const prompt = mergePromptSourceWithText(filePath === "-" ? await readPromptInputFromStdin() : await fs$1.readFile(path.resolve(cwd, filePath), "utf8"), promptParts.join(" "));
|
|
607
|
+
if (prompt.length === 0) throw new InvalidArgumentError("Prompt from --file is empty");
|
|
608
|
+
return prompt;
|
|
609
|
+
}
|
|
610
|
+
const joined = promptParts.join(" ").trim();
|
|
611
|
+
if (joined.length > 0) return textPrompt(joined);
|
|
612
|
+
if (process.stdin.isTTY) throw new InvalidArgumentError("Prompt is required (pass as argument, --file, or pipe via stdin)");
|
|
613
|
+
const prompt = parsePromptSource(await readPromptInputFromStdin());
|
|
614
|
+
if (prompt.length === 0) throw new InvalidArgumentError("Prompt from stdin is empty");
|
|
607
615
|
return prompt;
|
|
616
|
+
} catch (error) {
|
|
617
|
+
if (error instanceof PromptInputValidationError) throw new InvalidArgumentError(error.message);
|
|
618
|
+
throw error;
|
|
608
619
|
}
|
|
609
|
-
const joined = promptParts.join(" ").trim();
|
|
610
|
-
if (joined.length > 0) return textPrompt(joined);
|
|
611
|
-
if (process.stdin.isTTY) throw new InvalidArgumentError("Prompt is required (pass as argument, --file, or pipe via stdin)");
|
|
612
|
-
const prompt = parsePromptSource(await readPromptInputFromStdin());
|
|
613
|
-
if (prompt.length === 0) throw new InvalidArgumentError("Prompt from stdin is empty");
|
|
614
|
-
return prompt;
|
|
615
620
|
}
|
|
616
621
|
function applyPermissionExitCode(result) {
|
|
617
622
|
const stats = result.permissionStats;
|
|
@@ -623,25 +628,33 @@ function emitJsonResult(format, payload) {
|
|
|
623
628
|
process.stdout.write(`${JSON.stringify(payload)}\n`);
|
|
624
629
|
return true;
|
|
625
630
|
}
|
|
631
|
+
function isCodexAgentInvocation(agent) {
|
|
632
|
+
if (agent.agentName === "codex") return true;
|
|
633
|
+
return /\bcodex-acp\b/.test(agent.agentCommand);
|
|
634
|
+
}
|
|
635
|
+
function resolveCompatibleConfigId(agent, configId) {
|
|
636
|
+
if (isCodexAgentInvocation(agent) && configId === "thought_level") return "reasoning_effort";
|
|
637
|
+
return configId;
|
|
638
|
+
}
|
|
626
639
|
let sessionModulePromise;
|
|
627
640
|
let outputModulePromise;
|
|
628
641
|
let outputRenderModulePromise;
|
|
629
642
|
let queueIpcModulePromise;
|
|
630
643
|
let skillflagModulePromise;
|
|
631
644
|
function loadSessionModule() {
|
|
632
|
-
sessionModulePromise ??= import("./session-
|
|
645
|
+
sessionModulePromise ??= import("./session-C2Q8ktsN.js").then((n) => n.t);
|
|
633
646
|
return sessionModulePromise;
|
|
634
647
|
}
|
|
635
648
|
function loadOutputModule() {
|
|
636
|
-
outputModulePromise ??= import("./output-
|
|
649
|
+
outputModulePromise ??= import("./output-BmkPP7qE.js");
|
|
637
650
|
return outputModulePromise;
|
|
638
651
|
}
|
|
639
652
|
function loadOutputRenderModule() {
|
|
640
|
-
outputRenderModulePromise ??= import("./output-render-
|
|
653
|
+
outputRenderModulePromise ??= import("./output-render-DEAaMxg8.js").then((n) => n.n);
|
|
641
654
|
return outputRenderModulePromise;
|
|
642
655
|
}
|
|
643
656
|
function loadQueueIpcModule() {
|
|
644
|
-
queueIpcModulePromise ??= import("./queue-ipc-
|
|
657
|
+
queueIpcModulePromise ??= import("./queue-ipc-EQLpBMKv.js").then((n) => n.r);
|
|
645
658
|
return queueIpcModulePromise;
|
|
646
659
|
}
|
|
647
660
|
function loadSkillflagModule() {
|
|
@@ -829,10 +842,11 @@ async function handleSetMode(explicitAgentName, modeId, flags, command, config)
|
|
|
829
842
|
async function handleSetConfigOption(explicitAgentName, configId, value, flags, command, config) {
|
|
830
843
|
const globalFlags = resolveGlobalFlags(command, config);
|
|
831
844
|
const agent = resolveAgentInvocation(explicitAgentName, globalFlags, config);
|
|
845
|
+
const resolvedConfigId = resolveCompatibleConfigId(agent, configId);
|
|
832
846
|
const { setSessionConfigOption } = await loadSessionModule();
|
|
833
847
|
const result = await setSessionConfigOption({
|
|
834
848
|
sessionId: (await findRoutedSessionOrThrow(agent.agentCommand, agent.agentName, agent.cwd, resolveSessionNameFromFlags(flags, command))).acpxRecordId,
|
|
835
|
-
configId,
|
|
849
|
+
configId: resolvedConfigId,
|
|
836
850
|
value,
|
|
837
851
|
mcpServers: config.mcpServers,
|
|
838
852
|
nonInteractivePermissions: globalFlags.nonInteractivePermissions,
|
|
@@ -1184,7 +1198,7 @@ function registerSessionsCommand(parent, explicitAgentName, config) {
|
|
|
1184
1198
|
sessionsCommand.command("show").description("Show session metadata for current cwd").argument("[name]", "Session name", parseSessionName).action(async function(name) {
|
|
1185
1199
|
await handleSessionsShow(explicitAgentName, name, this, config);
|
|
1186
1200
|
});
|
|
1187
|
-
sessionsCommand.command("history").description("Show recent session history entries").argument("[name]", "Session name", parseSessionName).option("--limit <count>", "Maximum number of entries to show (default: 20)", parseHistoryLimit,
|
|
1201
|
+
sessionsCommand.command("history").description("Show recent session history entries").argument("[name]", "Session name", parseSessionName).option("--limit <count>", "Maximum number of entries to show (default: 20)", parseHistoryLimit, 20).action(async function(name, flags) {
|
|
1188
1202
|
await handleSessionsHistory(explicitAgentName, name, flags, this, config);
|
|
1189
1203
|
});
|
|
1190
1204
|
sessionsCommand.command("read").description("Read full session history").argument("[name]", "Session name", parseSessionName).option("--tail <count>", "Show only the last N entries instead of all history", parseHistoryLimit).action(async function(name, flags) {
|
|
@@ -1413,7 +1427,7 @@ Examples:
|
|
|
1413
1427
|
acpx codex exec "what does this repo do"
|
|
1414
1428
|
acpx codex cancel
|
|
1415
1429
|
acpx codex set-mode plan
|
|
1416
|
-
acpx codex set
|
|
1430
|
+
acpx codex set thought_level high
|
|
1417
1431
|
acpx codex -s backend "fix the API"
|
|
1418
1432
|
acpx codex sessions
|
|
1419
1433
|
acpx codex sessions new --name backend
|
|
@@ -1439,7 +1453,7 @@ Examples:
|
|
|
1439
1453
|
defaultCode: "USAGE",
|
|
1440
1454
|
origin: "cli"
|
|
1441
1455
|
});
|
|
1442
|
-
|
|
1456
|
+
await emitRequestedError(error, normalized, requestedOutputPolicy);
|
|
1443
1457
|
process.exit(exitCodeForOutputErrorCode(normalized.code));
|
|
1444
1458
|
}
|
|
1445
1459
|
if (error instanceof InterruptedError) process.exit(EXIT_CODES.INTERRUPTED);
|
|
@@ -1452,7 +1466,6 @@ Examples:
|
|
|
1452
1466
|
flushPerfMetricsCapture();
|
|
1453
1467
|
}
|
|
1454
1468
|
}
|
|
1455
|
-
|
|
1456
1469
|
//#endregion
|
|
1457
1470
|
//#region src/cli.ts
|
|
1458
1471
|
function isCliEntrypoint(argv) {
|
|
@@ -1466,7 +1479,7 @@ function isCliEntrypoint(argv) {
|
|
|
1466
1479
|
}
|
|
1467
1480
|
}
|
|
1468
1481
|
if (isCliEntrypoint(process.argv)) main(process.argv);
|
|
1469
|
-
|
|
1470
1482
|
//#endregion
|
|
1471
1483
|
export { formatPromptSessionBannerLine, parseAllowedTools, parseMaxTurns, parseTtlSeconds };
|
|
1484
|
+
|
|
1472
1485
|
//# sourceMappingURL=cli.js.map
|