acpx 0.1.15 → 0.2.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 +50 -16
- package/dist/acp-jsonrpc-CGT_1Mel.js +55 -0
- package/dist/acp-jsonrpc-CGT_1Mel.js.map +1 -0
- package/dist/cli.d.ts +93 -86
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +1275 -8138
- package/dist/cli.js.map +1 -0
- package/dist/output-BgMdEq3x.js +572 -0
- package/dist/output-BgMdEq3x.js.map +1 -0
- package/dist/output-render-Cvz0eKSb.js +140 -0
- package/dist/output-render-Cvz0eKSb.js.map +1 -0
- package/dist/queue-ipc-C8StWiZt.js +1571 -0
- package/dist/queue-ipc-C8StWiZt.js.map +1 -0
- package/dist/rolldown-runtime-CjeV3_4I.js +18 -0
- package/dist/runtime-session-id-B03l5p1Q.js +32 -0
- package/dist/runtime-session-id-B03l5p1Q.js.map +1 -0
- package/dist/session-C6nyqSfk.js +3738 -0
- package/dist/session-C6nyqSfk.js.map +1 -0
- package/package.json +58 -50
- package/skills/acpx/SKILL.md +11 -4
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ Your agents love acpx! 🤖❤️ They hate having to scrape characters from a P
|
|
|
18
18
|
|
|
19
19
|
`acpx` is a headless CLI client for the [Agent Client Protocol (ACP)](https://agentclientprotocol.com), so AI agents and orchestrators can talk to coding agents over a structured protocol instead of PTY scraping.
|
|
20
20
|
|
|
21
|
-
One command surface for
|
|
21
|
+
One command surface for Pi, OpenClaw ACP, Codex, Claude, and other ACP-compatible agents. Built for agent-to-agent communication over the command line.
|
|
22
22
|
|
|
23
23
|
- **Persistent sessions**: multi-turn conversations that survive across invocations, scoped per repo
|
|
24
24
|
- **Named sessions**: run parallel workstreams in the same repo (`-s backend`, `-s frontend`)
|
|
@@ -71,7 +71,7 @@ reading stale state from the previous run.
|
|
|
71
71
|
|
|
72
72
|
## Quick setup — tell your agent about acpx
|
|
73
73
|
|
|
74
|
-
Copy the block below and paste it into your
|
|
74
|
+
Copy the block below and paste it into your Pi, OpenClaw, Claude Code, or similar agent harness. It will install acpx, read the skill reference, and know how to use ACP for all future coding agent tasks.
|
|
75
75
|
|
|
76
76
|
```text
|
|
77
77
|
I want you to use acpx to run coding agents over the Agent Client Protocol
|
|
@@ -120,11 +120,12 @@ Session state lives in `~/.acpx/` either way. Global install is a little faster,
|
|
|
120
120
|
|
|
121
121
|
The only prerequisite is the underlying coding agent you want to use:
|
|
122
122
|
|
|
123
|
+
- `acpx pi` -> Pi Coding Agent: https://github.com/mariozechner/pi
|
|
124
|
+
- `acpx openclaw` -> OpenClaw ACP bridge: https://github.com/openclaw/openclaw
|
|
123
125
|
- `acpx codex` -> Codex CLI: https://codex.openai.com
|
|
124
126
|
- `acpx claude` -> Claude Code: https://claude.ai/code
|
|
125
|
-
|
|
126
|
-
-
|
|
127
|
-
- `acpx pi` -> Pi Coding Agent: https://github.com/mariozechner/pi
|
|
127
|
+
|
|
128
|
+
Additional built-in agent docs live in [agents/README.md](agents/README.md).
|
|
128
129
|
|
|
129
130
|
## Usage examples
|
|
130
131
|
|
|
@@ -137,13 +138,13 @@ acpx codex --file prompt.md # prompt from file
|
|
|
137
138
|
acpx codex --file - "extra context" # explicit stdin + appended args
|
|
138
139
|
acpx codex --no-wait 'draft test migration plan' # enqueue without waiting if session is busy
|
|
139
140
|
acpx codex cancel # cooperative cancel of in-flight prompt
|
|
140
|
-
acpx codex set-mode
|
|
141
|
+
acpx codex set-mode auto # session/set_mode (adapter-defined mode id)
|
|
141
142
|
acpx codex set approval_policy conservative # session/set_config_option
|
|
142
143
|
acpx exec 'summarize this repo' # default agent shortcut (codex)
|
|
143
144
|
acpx codex exec 'what does this repo do?' # one-shot, no saved session
|
|
144
145
|
|
|
145
146
|
acpx codex sessions new --name api # create named session
|
|
146
|
-
acpx codex -s api 'implement
|
|
147
|
+
acpx codex -s api 'implement token pagination' # prompt in named session
|
|
147
148
|
acpx codex sessions new --name docs # create another named session
|
|
148
149
|
acpx codex -s docs 'rewrite API docs' # parallel work in another named session
|
|
149
150
|
|
|
@@ -161,10 +162,20 @@ acpx codex status # local process status for current session
|
|
|
161
162
|
|
|
162
163
|
acpx config show # show resolved config (global + project)
|
|
163
164
|
acpx config init # create ~/.acpx/config.json template
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Main landing harness examples:
|
|
164
168
|
|
|
169
|
+
```bash
|
|
170
|
+
acpx pi 'review recent changes'
|
|
171
|
+
acpx openclaw exec 'summarize active session state' # built-in OpenClaw ACP bridge
|
|
172
|
+
acpx codex 'fix the failing typecheck'
|
|
165
173
|
acpx claude 'refactor auth middleware' # built-in claude agent
|
|
166
|
-
|
|
174
|
+
```
|
|
167
175
|
|
|
176
|
+
Additional supported harnesses and their specific notes are documented in [agents/README.md](agents/README.md).
|
|
177
|
+
|
|
178
|
+
```bash
|
|
168
179
|
acpx my-agent 'review this patch' # unknown name -> raw command
|
|
169
180
|
acpx --agent './bin/dev-acp --profile ci' 'run checks' # --agent escape hatch
|
|
170
181
|
```
|
|
@@ -268,13 +279,22 @@ Session-control JSON payloads (`sessions new|ensure`, `status`) may also include
|
|
|
268
279
|
|
|
269
280
|
Built-ins:
|
|
270
281
|
|
|
271
|
-
| Agent | Adapter | Wraps
|
|
272
|
-
| ---------- | ---------------------------------------------------------------------- |
|
|
273
|
-
| `
|
|
274
|
-
| `
|
|
275
|
-
| `
|
|
276
|
-
| `
|
|
277
|
-
| `
|
|
282
|
+
| Agent | Adapter | Wraps |
|
|
283
|
+
| ---------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
284
|
+
| `pi` | [pi-acp](https://github.com/svkozak/pi-acp) | [Pi Coding Agent](https://github.com/mariozechner/pi) |
|
|
285
|
+
| `openclaw` | native (`openclaw acp`) | [OpenClaw ACP bridge](https://github.com/openclaw/openclaw) |
|
|
286
|
+
| `codex` | [codex-acp](https://github.com/zed-industries/codex-acp) | [Codex CLI](https://codex.openai.com) |
|
|
287
|
+
| `claude` | [claude-agent-acp](https://github.com/zed-industries/claude-agent-acp) | [Claude Code](https://claude.ai/code) |
|
|
288
|
+
| `gemini` | native (`gemini --experimental-acp`) | [Gemini CLI](https://github.com/google/gemini-cli) |
|
|
289
|
+
| `cursor` | native (`cursor-agent acp`) | [Cursor CLI](https://cursor.com/docs/cli/acp) |
|
|
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
|
+
| `kimi` | native (`kimi acp`) | [Kimi CLI](https://github.com/MoonshotAI/kimi-cli) |
|
|
292
|
+
| `opencode` | `npx -y opencode-ai acp` | [OpenCode](https://opencode.ai) |
|
|
293
|
+
| `kiro` | native (`kiro-cli acp`) | [Kiro CLI](https://kiro.dev) |
|
|
294
|
+
| `kilocode` | `npx -y @kilocode/cli acp` | [Kilocode](https://kilocode.ai) |
|
|
295
|
+
| `qwen` | native (`qwen --acp`) | [Qwen Code](https://github.com/QwenLM/qwen-code) |
|
|
296
|
+
|
|
297
|
+
Additional built-in agent docs live in [agents/README.md](agents/README.md).
|
|
278
298
|
|
|
279
299
|
Use `--agent` as an escape hatch for custom ACP servers:
|
|
280
300
|
|
|
@@ -282,6 +302,19 @@ Use `--agent` as an escape hatch for custom ACP servers:
|
|
|
282
302
|
acpx --agent ./my-custom-acp-server 'do something'
|
|
283
303
|
```
|
|
284
304
|
|
|
305
|
+
For repo-local OpenClaw checkouts, override the built-in command in config so `acpx openclaw ...`
|
|
306
|
+
spawns the ACP bridge directly without `pnpm` wrapper noise:
|
|
307
|
+
|
|
308
|
+
```json
|
|
309
|
+
{
|
|
310
|
+
"agents": {
|
|
311
|
+
"openclaw": {
|
|
312
|
+
"command": "env OPENCLAW_HIDE_BANNER=1 OPENCLAW_SUPPRESS_NOTES=1 node scripts/run-node.mjs acp --url ws://127.0.0.1:18789 --token-file ~/.openclaw/gateway.token --session agent:main:main"
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
```
|
|
317
|
+
|
|
285
318
|
## Session behavior
|
|
286
319
|
|
|
287
320
|
- Prompt commands require an existing saved session record (created via `sessions new` or `sessions ensure`).
|
|
@@ -297,6 +330,7 @@ acpx --agent ./my-custom-acp-server 'do something'
|
|
|
297
330
|
- `--no-wait` submits to that queue and returns immediately.
|
|
298
331
|
- `cancel` sends cooperative `session/cancel` to the running queue owner process and returns success when no prompt is running (`nothing to cancel`).
|
|
299
332
|
- `set-mode` and `set` route through queue-owner IPC when active, otherwise they reconnect directly to apply `session/set_mode` and `session/set_config_option`.
|
|
333
|
+
- `<mode>` values for `set-mode` are adapter-defined; unsupported values are rejected by the adapter (commonly `Invalid params`).
|
|
300
334
|
- `exec` is always one-shot and does not reuse saved sessions.
|
|
301
335
|
- Session metadata is stored under `~/.acpx/sessions/`.
|
|
302
336
|
- Each successful prompt appends lightweight turn history previews (`role`, `timestamp`, `textPreview`) to session metadata.
|
|
@@ -305,7 +339,7 @@ acpx --agent ./my-custom-acp-server 'do something'
|
|
|
305
339
|
|
|
306
340
|
## Full CLI reference
|
|
307
341
|
|
|
308
|
-
See
|
|
342
|
+
See [docs/CLI.md](docs/CLI.md).
|
|
309
343
|
|
|
310
344
|
## License
|
|
311
345
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//#region src/acp-jsonrpc.ts
|
|
2
|
+
function asRecord(value) {
|
|
3
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
4
|
+
return value;
|
|
5
|
+
}
|
|
6
|
+
function hasValidId(value) {
|
|
7
|
+
return value === null || typeof value === "string" || typeof value === "number" && Number.isFinite(value);
|
|
8
|
+
}
|
|
9
|
+
function isErrorObject(value) {
|
|
10
|
+
const record = asRecord(value);
|
|
11
|
+
return !!record && typeof record.code === "number" && Number.isFinite(record.code) && typeof record.message === "string";
|
|
12
|
+
}
|
|
13
|
+
function hasResultOrError(value) {
|
|
14
|
+
const hasResult = Object.hasOwn(value, "result");
|
|
15
|
+
const hasError = Object.hasOwn(value, "error");
|
|
16
|
+
if (hasResult && hasError) return false;
|
|
17
|
+
if (!hasResult && !hasError) return false;
|
|
18
|
+
if (hasError && !isErrorObject(value.error)) return false;
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
function isAcpJsonRpcMessage(value) {
|
|
22
|
+
const record = asRecord(value);
|
|
23
|
+
if (!record || record.jsonrpc !== "2.0") return false;
|
|
24
|
+
const hasMethod = typeof record.method === "string" && record.method.length > 0;
|
|
25
|
+
const hasId = Object.hasOwn(record, "id");
|
|
26
|
+
if (hasMethod && !hasId) return true;
|
|
27
|
+
if (hasMethod && hasId) return hasValidId(record.id);
|
|
28
|
+
if (!hasMethod && hasId) {
|
|
29
|
+
if (!hasValidId(record.id)) return false;
|
|
30
|
+
return hasResultOrError(record);
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
function isJsonRpcNotification(message) {
|
|
35
|
+
return Object.hasOwn(message, "method") && typeof message.method === "string" && !Object.hasOwn(message, "id");
|
|
36
|
+
}
|
|
37
|
+
function isSessionUpdateNotification(message) {
|
|
38
|
+
return isJsonRpcNotification(message) && message.method === "session/update";
|
|
39
|
+
}
|
|
40
|
+
function parsePromptStopReason(message) {
|
|
41
|
+
if (!Object.hasOwn(message, "id") || !Object.hasOwn(message, "result")) return;
|
|
42
|
+
const record = asRecord(message.result);
|
|
43
|
+
if (!record) return;
|
|
44
|
+
return typeof record.stopReason === "string" ? record.stopReason : void 0;
|
|
45
|
+
}
|
|
46
|
+
function parseJsonRpcErrorMessage(message) {
|
|
47
|
+
if (!Object.hasOwn(message, "error")) return;
|
|
48
|
+
const errorRecord = asRecord(message.error);
|
|
49
|
+
if (!errorRecord || typeof errorRecord.message !== "string") return;
|
|
50
|
+
return errorRecord.message;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
//#endregion
|
|
54
|
+
export { parsePromptStopReason as i, isSessionUpdateNotification as n, parseJsonRpcErrorMessage as r, isAcpJsonRpcMessage as t };
|
|
55
|
+
//# sourceMappingURL=acp-jsonrpc-CGT_1Mel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acp-jsonrpc-CGT_1Mel.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;;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.d.ts
CHANGED
|
@@ -1,124 +1,131 @@
|
|
|
1
|
-
|
|
2
|
-
import { AgentCapabilities, SessionConfigOption } from
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { AgentCapabilities, SessionConfigOption } from "@agentclientprotocol/sdk";
|
|
3
3
|
|
|
4
|
+
//#region src/types.d.ts
|
|
4
5
|
type SessionEventLog = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
active_path: string;
|
|
7
|
+
segment_count: number;
|
|
8
|
+
max_segment_bytes: number;
|
|
9
|
+
max_segments: number;
|
|
10
|
+
last_write_at?: string;
|
|
11
|
+
last_write_error?: string | null;
|
|
11
12
|
};
|
|
12
13
|
declare const SESSION_RECORD_SCHEMA: "acpx.session.v1";
|
|
13
14
|
type SessionMessageImage = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
source: string;
|
|
16
|
+
size?: {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
} | null;
|
|
19
20
|
};
|
|
20
21
|
type SessionUserContent = {
|
|
21
|
-
|
|
22
|
+
Text: string;
|
|
22
23
|
} | {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
Mention: {
|
|
25
|
+
uri: string;
|
|
26
|
+
content: string;
|
|
27
|
+
};
|
|
27
28
|
} | {
|
|
28
|
-
|
|
29
|
+
Image: SessionMessageImage;
|
|
29
30
|
};
|
|
30
31
|
type SessionToolUse = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
raw_input: string;
|
|
35
|
+
input: unknown;
|
|
36
|
+
is_input_complete: boolean;
|
|
37
|
+
thought_signature?: string | null;
|
|
37
38
|
};
|
|
38
39
|
type SessionToolResultContent = {
|
|
39
|
-
|
|
40
|
+
Text: string;
|
|
40
41
|
} | {
|
|
41
|
-
|
|
42
|
+
Image: SessionMessageImage;
|
|
42
43
|
};
|
|
43
44
|
type SessionToolResult = {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
tool_use_id: string;
|
|
46
|
+
tool_name: string;
|
|
47
|
+
is_error: boolean;
|
|
48
|
+
content: SessionToolResultContent;
|
|
49
|
+
output?: unknown;
|
|
49
50
|
};
|
|
50
51
|
type SessionAgentContent = {
|
|
51
|
-
|
|
52
|
+
Text: string;
|
|
52
53
|
} | {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
Thinking: {
|
|
55
|
+
text: string;
|
|
56
|
+
signature?: string | null;
|
|
57
|
+
};
|
|
57
58
|
} | {
|
|
58
|
-
|
|
59
|
+
RedactedThinking: string;
|
|
59
60
|
} | {
|
|
60
|
-
|
|
61
|
+
ToolUse: SessionToolUse;
|
|
61
62
|
};
|
|
62
63
|
type SessionUserMessage = {
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
id: string;
|
|
65
|
+
content: SessionUserContent[];
|
|
65
66
|
};
|
|
66
67
|
type SessionAgentMessage = {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
content: SessionAgentContent[];
|
|
69
|
+
tool_results: Record<string, SessionToolResult>;
|
|
70
|
+
reasoning_details?: unknown;
|
|
70
71
|
};
|
|
71
72
|
type SessionMessage = {
|
|
72
|
-
|
|
73
|
+
User: SessionUserMessage;
|
|
73
74
|
} | {
|
|
74
|
-
|
|
75
|
+
Agent: SessionAgentMessage;
|
|
75
76
|
} | "Resume";
|
|
76
77
|
type SessionTokenUsage = {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
input_tokens?: number;
|
|
79
|
+
output_tokens?: number;
|
|
80
|
+
cache_creation_input_tokens?: number;
|
|
81
|
+
cache_read_input_tokens?: number;
|
|
81
82
|
};
|
|
82
83
|
type SessionAcpxState = {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
current_mode_id?: string;
|
|
85
|
+
desired_mode_id?: string;
|
|
86
|
+
available_commands?: string[];
|
|
87
|
+
config_options?: SessionConfigOption[];
|
|
86
88
|
};
|
|
87
89
|
type SessionRecord = {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
90
|
+
schema: typeof SESSION_RECORD_SCHEMA;
|
|
91
|
+
acpxRecordId: string;
|
|
92
|
+
acpSessionId: string;
|
|
93
|
+
agentSessionId?: string;
|
|
94
|
+
agentCommand: string;
|
|
95
|
+
cwd: string;
|
|
96
|
+
name?: string;
|
|
97
|
+
createdAt: string;
|
|
98
|
+
lastUsedAt: string;
|
|
99
|
+
lastSeq: number;
|
|
100
|
+
lastRequestId?: string;
|
|
101
|
+
eventLog: SessionEventLog;
|
|
102
|
+
closed?: boolean;
|
|
103
|
+
closedAt?: string;
|
|
104
|
+
pid?: number;
|
|
105
|
+
agentStartedAt?: string;
|
|
106
|
+
lastPromptAt?: string;
|
|
107
|
+
lastAgentExitCode?: number | null;
|
|
108
|
+
lastAgentExitSignal?: NodeJS.Signals | null;
|
|
109
|
+
lastAgentExitAt?: string;
|
|
110
|
+
lastAgentDisconnectReason?: string;
|
|
111
|
+
protocolVersion?: number;
|
|
112
|
+
agentCapabilities?: AgentCapabilities;
|
|
113
|
+
title?: string | null;
|
|
114
|
+
messages: SessionMessage[];
|
|
115
|
+
updated_at: string;
|
|
116
|
+
cumulative_token_usage: SessionTokenUsage;
|
|
117
|
+
request_token_usage: Record<string, SessionTokenUsage>;
|
|
118
|
+
acpx?: SessionAcpxState;
|
|
117
119
|
};
|
|
118
|
-
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/cli/flags.d.ts
|
|
119
122
|
declare function parseTtlSeconds(value: string): number;
|
|
120
|
-
|
|
123
|
+
declare function parseAllowedTools(value: string): string[];
|
|
124
|
+
declare function parseMaxTurns(value: string): number;
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/cli/output-render.d.ts
|
|
121
127
|
type SessionConnectionStatus = "connected" | "needs reconnect";
|
|
122
128
|
declare function formatPromptSessionBannerLine(record: SessionRecord, currentCwd: string, connectionStatus?: SessionConnectionStatus): string;
|
|
123
|
-
|
|
124
|
-
export { formatPromptSessionBannerLine, parseTtlSeconds };
|
|
129
|
+
//#endregion
|
|
130
|
+
export { formatPromptSessionBannerLine, parseAllowedTools, parseMaxTurns, parseTtlSeconds };
|
|
131
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","names":[],"sources":["../src/types.ts","../src/cli/flags.ts","../src/cli/output-render.ts"],"mappings":";;;;KAyGY,eAAA;EACV,WAAA;EACA,aAAA;EACA,iBAAA;EACA,YAAA;EACA,aAAA;EACA,gBAAA;AAAA;AAAA,cAmEW,qBAAA;AAAA,KACD,mBAAA;EACV,MAAA;EACA,IAAA;IACE,KAAA;IACA,MAAA;EAAA;AAAA;AAAA,KAIQ,kBAAA;EAEN,IAAA;AAAA;EAGA,OAAA;IACE,GAAA;IACA,OAAA;EAAA;AAAA;EAIF,KAAA,EAAO,mBAAA;AAAA;AAAA,KAGD,cAAA;EACV,EAAA;EACA,IAAA;EACA,SAAA;EACA,KAAA;EACA,iBAAA;EACA,iBAAA;AAAA;AAAA,KAGU,wBAAA;EAEN,IAAA;AAAA;EAGA,KAAA,EAAO,mBAAA;AAAA;AAAA,KAGD,iBAAA;EACV,WAAA;EACA,SAAA;EACA,QAAA;EACA,OAAA,EAAS,wBAAA;EACT,MAAA;AAAA;AAAA,KAGU,mBAAA;EAEN,IAAA;AAAA;EAGA,QAAA;IACE,IAAA;IACA,SAAA;EAAA;AAAA;EAIF,gBAAA;AAAA;EAGA,OAAA,EAAS,cAAA;AAAA;AAAA,KAGH,kBAAA;EACV,EAAA;EACA,OAAA,EAAS,kBAAA;AAAA;AAAA,KAGC,mBAAA;EACV,OAAA,EAAS,mBAAA;EACT,YAAA,EAAc,MAAA,SAAe,iBAAA;EAC7B,iBAAA;AAAA;AAAA,KAGU,cAAA;EAEN,IAAA,EAAM,kBAAA;AAAA;EAGN,KAAA,EAAO,mBAAA;AAAA;AAAA,KAID,iBAAA;EACV,YAAA;EACA,aAAA;EACA,2BAAA;EACA,uBAAA;AAAA;AAAA,KAWU,gBAAA;EACV,eAAA;EACA,eAAA;EACA,kBAAA;EACA,cAAA,GAAiB,mBAAA;AAAA;AAAA,KAGP,aAAA;EACV,MAAA,SAAe,qBAAA;EACf,YAAA;EACA,YAAA;EACA,cAAA;EACA,YAAA;EACA,GAAA;EACA,IAAA;EACA,SAAA;EACA,UAAA;EACA,OAAA;EACA,aAAA;EACA,QAAA,EAAU,eAAA;EACV,MAAA;EACA,QAAA;EACA,GAAA;EACA,cAAA;EACA,YAAA;EACA,iBAAA;EACA,mBAAA,GAAsB,MAAA,CAAO,OAAA;EAC7B,eAAA;EACA,yBAAA;EACA,eAAA;EACA,iBAAA,GAAoB,iBAAA;EACpB,KAAA;EACA,QAAA,EAAU,cAAA;EACV,UAAA;EACA,sBAAA,EAAwB,iBAAA;EACxB,mBAAA,EAAqB,MAAA,SAAe,iBAAA;EACpC,IAAA,GAAO,gBAAA;AAAA;;;iBCvNO,eAAA,CAAgB,KAAA;AAAA,iBAgChB,iBAAA,CAAkB,KAAA;AAAA,iBAgBlB,aAAA,CAAc,KAAA;;;KClIzB,uBAAA;AAAA,iBAkJW,6BAAA,CACd,MAAA,EAAQ,aAAA,EACR,UAAA,UACA,gBAAA,GAAkB,uBAAA"}
|