acpx 0.12.1 → 0.13.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.
Files changed (35) hide show
  1. package/README.md +64 -375
  2. package/dist/{cli-pKoIEH5O.js → cli-_7Sei6dD.js} +5 -4
  3. package/dist/cli-_7Sei6dD.js.map +1 -0
  4. package/dist/cli.d.ts +2 -2
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +72 -19
  7. package/dist/cli.js.map +1 -1
  8. package/dist/{client-CFo_9MIo.d.ts → client-CxNllqui.d.ts} +17 -3
  9. package/dist/client-CxNllqui.d.ts.map +1 -0
  10. package/dist/{flags-CjeFX5ki.js → flags-Ds6FzmHG.js} +36 -9
  11. package/dist/flags-Ds6FzmHG.js.map +1 -0
  12. package/dist/{flows-Cym6H3vg.js → flows-fzH0GKYF.js} +14 -4
  13. package/dist/flows-fzH0GKYF.js.map +1 -0
  14. package/dist/flows.d.ts +6 -2
  15. package/dist/flows.d.ts.map +1 -1
  16. package/dist/flows.js +1 -1
  17. package/dist/{live-checkpoint-DQp4JSHD.js → live-checkpoint-BSIrfgVo.js} +560 -196
  18. package/dist/live-checkpoint-BSIrfgVo.js.map +1 -0
  19. package/dist/{output-fNqTAsFQ.js → output-BZQE0gI1.js} +74 -11
  20. package/dist/output-BZQE0gI1.js.map +1 -0
  21. package/dist/runtime.d.ts +106 -19
  22. package/dist/runtime.d.ts.map +1 -1
  23. package/dist/runtime.js +631 -158
  24. package/dist/runtime.js.map +1 -1
  25. package/dist/{session-options-C4uYkKDy.d.ts → session-options-DwRDODlr.d.ts} +28 -3
  26. package/dist/session-options-DwRDODlr.d.ts.map +1 -0
  27. package/package.json +19 -19
  28. package/skills/acpx/SKILL.md +5 -2
  29. package/dist/cli-pKoIEH5O.js.map +0 -1
  30. package/dist/client-CFo_9MIo.d.ts.map +0 -1
  31. package/dist/flags-CjeFX5ki.js.map +0 -1
  32. package/dist/flows-Cym6H3vg.js.map +0 -1
  33. package/dist/live-checkpoint-DQp4JSHD.js.map +0 -1
  34. package/dist/output-fNqTAsFQ.js.map +0 -1
  35. package/dist/session-options-C4uYkKDy.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,425 +1,114 @@
1
+ # acpx 🤝 — Agents talking to agents, minus the terminal séance
2
+
1
3
  <p align="center">
2
4
  <img src="acpx_banner.svg" alt="acpx banner" width="100%" />
3
5
  </p>
4
6
 
5
- # acpx
6
-
7
- [![npm version](https://img.shields.io/npm/v/acpx.svg)](https://www.npmjs.com/package/acpx)
8
- [![npm downloads](https://img.shields.io/npm/dm/acpx.svg)](https://www.npmjs.com/package/acpx)
9
- [![CI](https://github.com/openclaw/acpx/actions/workflows/ci.yml/badge.svg)](https://github.com/openclaw/acpx/actions/workflows/ci.yml)
10
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
- [![Node.js](https://img.shields.io/node/v/acpx.svg)](https://nodejs.org)
12
-
13
- > ⚠️ `acpx` is in alpha and the CLI/runtime interfaces are likely to change. Anything you build downstream of this might break until it stabilizes.
14
-
15
- > ACP coverage status: see [ACP Spec Coverage Roadmap](docs/2026-02-19-acp-coverage-roadmap.md).
16
-
17
- Your agents love acpx! 🤖❤️ They hate having to scrape characters from a PTY session 😤
18
-
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
-
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
-
23
- - **Persistent sessions**: multi-turn conversations that survive across invocations, scoped per repo
24
- - **Named sessions**: run parallel workstreams in the same repo (`-s backend`, `-s frontend`)
25
- - **Prompt queueing**: submit prompts while one is already running, they execute in order
26
- - **Cooperative cancel command**: `cancel` sends ACP `session/cancel` via queue IPC without tearing down session state
27
- - **Soft-close lifecycle**: close sessions without deleting history from disk
28
- - **Queue owner TTL**: keep queue owners alive briefly for follow-up prompts (`--ttl`)
29
- - **Fire-and-forget**: `--no-wait` queues a prompt and returns immediately
30
- - **Graceful cancel**: `Ctrl+C` sends ACP `session/cancel` before force-kill fallback
31
- - **Session controls**: `set-mode` and `set <key> <value>` for `session/set_mode` and `session/set_config_option`
32
- - **Crash reconnect**: dead agent processes are detected and sessions are resumed or reloaded automatically
33
- - **Prompt from file/stdin**: `--file <path>` or piped stdin for prompt content
34
- - **Config files**: global + project JSON config with `acpx config show|init`
35
- - **Session inspect/history**: `sessions show` and `sessions history --limit <n>`
36
- - **Session export/import**: move portable session archives between machines
37
- - **Local status checks**: `status` reports running/idle/dead/no-session, pid, uptime, last prompt
38
- - **Client methods**: stable `fs/*` and `terminal/*` handlers with permission controls and cwd sandboxing
39
- - **Auth handshake**: stable `authenticate` support via env/config credentials
40
- - **Structured output**: typed ACP messages (thinking, tool calls, diffs) instead of ANSI scraping
41
- - **Any ACP agent**: built-in registry + `--agent` escape hatch for custom servers
42
- - **One-shot mode**: `exec` for stateless fire-and-forget tasks
43
- - **Compare across agents**: `acpx compare pi openclaw codex 'fix the bug'` runs the same one-shot prompt against multiple ACP-compatible agents and summarizes timing, token usage, permissions, and final output side by side
44
- - **Experimental flows**: `flow run <file>` for TypeScript workflow modules over multiple prompts
45
- - **Runtime-owned flow actions**: shell-backed action steps can prepare workspaces and other deterministic mechanics outside the agent turn
46
- - **Flow workspace isolation**: `acp` nodes can target an explicit per-step cwd, so flows can keep agent work inside disposable worktrees
47
-
48
- ```bash
49
- $ acpx codex sessions new
50
- $ acpx codex "find the flaky test and fix it"
51
-
52
- [thinking] Investigating test suite for flaky failures
53
-
54
- [tool] Run npm test -- --reporter=verbose (running)
55
- [tool] Run npm test -- --reporter=verbose (completed)
56
- output:
57
- ✓ auth.login (0.8s)
58
- ✗ checkout.submit (timed out after 5000ms)
59
- ✓ cart.add (0.3s)
60
-
61
- [thinking] Found it — checkout.submit has a race condition in the async setup
62
-
63
- [tool] Edit src/checkout.test.ts (completed)
64
- output:
65
- Success. Updated 1 file.
7
+ [![CI](https://img.shields.io/github/actions/workflow/status/openclaw/acpx/ci.yml?branch=main&style=flat-square&label=ci)](https://github.com/openclaw/acpx/actions/workflows/ci.yml)
8
+ [![npm](https://img.shields.io/npm/v/acpx?style=flat-square)](https://www.npmjs.com/package/acpx)
9
+ [![Node.js](https://img.shields.io/node/v/acpx?style=flat-square)](https://nodejs.org/)
10
+ [![License](https://img.shields.io/github/license/openclaw/acpx?style=flat-square)](LICENSE)
11
+ [![npm downloads](https://img.shields.io/npm/dm/acpx?style=flat-square)](https://www.npmjs.com/package/acpx)
66
12
 
67
- [tool] Run npm test -- checkout.submit (completed)
68
- output:
69
- ✓ checkout.submit (0.4s)
70
-
71
- Fixed: added `await` to the setup hook in checkout.submit. The test was
72
- reading stale state from the previous run.
13
+ `acpx` is a headless command-line client for the [Agent Client Protocol (ACP)](https://agentclientprotocol.com). It gives agents, orchestrators, and developers one structured interface for persistent sessions, one-shot runs, permissions, and machine-readable output across ACP-compatible coding agents.
73
14
 
15
+ ```console
16
+ $ acpx codex sessions new
17
+ <session-id>
18
+ $ acpx codex "summarize this repository"
19
+ [tool] Read README.md (completed)
20
+ This repository contains ...
74
21
  [done] end_turn
75
22
  ```
76
23
 
77
- ## Quick setup — tell your agent about acpx
78
-
79
- 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.
80
-
81
- ```text
82
- I want you to use acpx to run coding agents over the Agent Client Protocol
83
- (ACP) instead of scraping PTY sessions. Please do the following:
84
-
85
- 1. Install acpx globally (recommended) or use npx:
86
- npm install -g acpx@latest
87
-
88
- Or without installing:
89
- npx acpx@latest
90
-
91
- 2. For Pi or OpenClaw, use the reference URL below. For Codex-style skill
92
- installation, install the acpx skill so you have the full reference
93
- available:
94
- npx acpx@latest --skill install acpx --agent codex --scope user
95
- Use --agent claude for Claude Code. For another harness not listed by
96
- --skill install --help, use the reference URL below instead.
97
-
98
- 3. Read the acpx skill reference so you know every command, flag, and
99
- workflow pattern:
100
- https://raw.githubusercontent.com/openclaw/acpx/main/skills/acpx/SKILL.md
101
-
102
- 4. If you need the full CLI reference with all options and examples:
103
- https://raw.githubusercontent.com/openclaw/acpx/main/docs/CLI.md
104
-
105
- From now on, when you need to delegate work to a coding agent, use acpx
106
- instead of spawning raw terminal sessions. For example:
107
- npx acpx@latest codex "fix the failing tests"
108
- npx acpx@latest claude "refactor the auth module"
109
- npx acpx@latest codex exec "one-shot: summarize this repo"
110
- ```
24
+ > [!NOTE]
25
+ > `acpx` is pre-1.0. Treat its CLI and runtime interfaces as evolving.
111
26
 
112
27
  ## Install
113
28
 
114
- ```bash
115
- npm install -g acpx@latest
116
- ```
117
-
118
- Or run without installing:
29
+ Install the published npm package globally:
119
30
 
120
31
  ```bash
121
- npx acpx@latest codex "fix the tests"
122
- ```
123
-
124
- Session state lives in `~/.acpx/` either way. Global install is a little faster, but `npx acpx@latest` works fine.
125
-
126
- ## Agent prerequisites
127
-
128
- `acpx` auto-downloads ACP adapters with `npx` on first use. You do not need to install adapter packages manually.
129
-
130
- The only prerequisite is the underlying coding agent you want to use:
131
-
132
- - `acpx pi` -> Pi Coding Agent: https://github.com/mariozechner/pi
133
- - `acpx openclaw` -> OpenClaw ACP bridge: https://github.com/openclaw/openclaw
134
- - `acpx codex` -> Codex CLI: https://codex.openai.com
135
- - `acpx claude` -> Claude Code: https://claude.ai/code
136
-
137
- Additional built-in agent docs live in [agents/README.md](agents/README.md).
138
-
139
- ## Usage examples
140
-
141
- ```bash
142
- acpx codex sessions new # create a session (explicit) for this project dir
143
- acpx codex 'fix the tests' # implicit prompt (routes via directory-walk)
144
- acpx codex prompt 'fix the tests' # explicit prompt subcommand
145
- echo 'fix flaky tests' | acpx codex # prompt from stdin
146
- acpx codex --file prompt.md # prompt from file
147
- acpx codex --file - "extra context" # explicit stdin + appended args
148
- acpx codex --no-wait 'draft test migration plan' # enqueue without waiting if session is busy
149
- acpx codex cancel # cooperative cancel of in-flight prompt
150
- acpx codex set-mode auto # session/set_mode (adapter-defined mode id)
151
- acpx codex set model gpt-5.6-sol # select the advertised base model
152
- acpx codex set reasoning_effort max # set the advertised reasoning effort
153
- acpx exec 'summarize this repo' # default agent shortcut (codex)
154
- acpx codex exec 'what does this repo do?' # one-shot, no saved session
155
-
156
- acpx codex sessions new --name api # create named session
157
- acpx codex -s api 'implement token pagination' # prompt in named session
158
- acpx codex sessions new --name docs # create another named session
159
- acpx codex -s docs 'rewrite API docs' # parallel work in another named session
160
-
161
- acpx codex sessions # list sessions for codex command
162
- acpx codex sessions list # explicit list
163
- acpx codex sessions show # inspect cwd session metadata
164
- acpx codex sessions history # show recent turn history
165
- acpx codex sessions new # create fresh cwd-scoped default session
166
- acpx codex sessions new --name api # create fresh named session
167
- acpx codex sessions ensure # return existing scoped session or create one
168
- acpx codex sessions ensure --name api # ensure named scoped session
169
- acpx codex sessions close # close cwd-scoped default session
170
- acpx codex sessions close api # close cwd-scoped named session
171
- acpx codex status # local process status for current session
172
-
173
- acpx config show # show resolved config (global + project)
174
- acpx config init # create ~/.acpx/config.json template
175
- ```
176
-
177
- Main landing harness examples:
178
-
179
- ```bash
180
- acpx pi 'review recent changes'
181
- acpx openclaw exec 'summarize active session state' # built-in OpenClaw ACP bridge
182
- acpx codex 'fix the failing typecheck'
183
- acpx claude 'refactor auth middleware' # built-in claude agent
184
- ```
185
-
186
- Additional supported harnesses and their specific notes are documented in [agents/README.md](agents/README.md).
187
-
188
- ```bash
189
- acpx my-agent 'review this patch' # unknown name -> raw command
190
- acpx --agent './bin/dev-acp --profile ci' 'run checks' # --agent escape hatch
32
+ npm install -g acpx@latest
191
33
  ```
192
34
 
193
- ## Practical scenarios
35
+ `acpx` requires Node.js 22.13 or newer. To try it without a global install, prefix a command with `npx acpx@latest` instead. See the [install guide](docs/install.md) for adapter prerequisites, updates, and source builds.
194
36
 
195
- ```bash
196
- # Review a PR in a dedicated session and auto-approve permissions
197
- acpx --cwd ~/repos/shop --approve-all codex -s pr-842 \
198
- 'Review PR #842 for regressions and propose a minimal fix'
199
-
200
- # Keep parallel streams for the same repo
201
- acpx codex -s bugfix 'isolate flaky checkout test'
202
- acpx codex -s release 'draft release notes from recent commits'
203
- ```
37
+ ## Quick start
204
38
 
205
- ## Global options in practice
39
+ Install and authenticate the coding agent you want to use, then create a session in your project and send it a prompt:
206
40
 
207
41
  ```bash
208
- acpx --approve-all codex 'apply the patch and run tests'
209
- acpx --approve-reads codex 'inspect repo structure and suggest plan' # default mode
210
- acpx --deny-all codex 'explain what you can do without tool access'
211
- acpx --non-interactive-permissions fail codex 'fail instead of deny in non-TTY'
212
- acpx --policy '{"escalate":["execute"],"defaultAction":"deny"}' --format json codex exec 'ask before shell'
213
-
214
- acpx --cwd ~/repos/backend codex 'review recent auth changes'
215
- acpx --format text codex 'summarize your findings'
216
- acpx --format json codex exec 'review changed files'
217
- acpx --format json --json-strict codex exec 'machine-safe JSON only'
218
- acpx flow run ./my-flow.ts --input-file ./flow-input.json
219
- acpx --timeout 1800 flow run ./my-flow.ts
220
- acpx --format quiet codex 'final recommendation only'
221
- acpx --suppress-reads codex exec 'show tool activity without dumping file bodies'
222
-
223
- acpx --timeout 90 codex 'investigate intermittent test timeout'
224
- acpx --ttl 30 codex 'keep queue owner alive for quick follow-ups'
225
- acpx --verbose codex 'debug why adapter startup is failing'
42
+ acpx codex sessions new
43
+ acpx codex "find the slowest test and explain why"
226
44
  ```
227
45
 
228
- ## Flows
46
+ The session is scoped to the current repository and persists across invocations. Creating sessions explicitly prevents automation from starting an unexpected conversation. The [quickstart](docs/quickstart.md) continues with named sessions, one-shot runs, history, and JSON output.
229
47
 
230
- `acpx flow run <file>` executes a TypeScript flow module through the `acpx/flows`
231
- runtime and persists run state under `~/.acpx/flows/runs/`.
48
+ ## Choose an agent
232
49
 
233
- Flows are for multi-step ACP work where one prompt is not enough:
50
+ Use the same command shape with the built-in launch profiles:
234
51
 
235
- - `acp` steps keep model-shaped work in ACP
236
- - `decision()` and `decisionEdge()` wrap constrained-choice ACP branching without adding a new node type
237
- - `action` steps handle deterministic mechanics like shell commands or GitHub calls
238
- - `compute` steps do local routing or shaping
239
- - `checkpoint` steps pause for something outside the runtime
52
+ | Agent | Command |
53
+ | ----------------- | ---------------------------- |
54
+ | Codex | `acpx codex …` |
55
+ | Claude Code | `acpx claude …` |
56
+ | Gemini CLI | `acpx gemini …` |
57
+ | OpenClaw | `acpx openclaw …` |
58
+ | Custom ACP server | `acpx --agent '<command>' …` |
240
59
 
241
- The source tree includes flow examples under [examples/flows/README.md](examples/flows/README.md):
60
+ The upstream agent must be installed and authenticated when its adapter does not provide that itself. See [built-in agents](docs/agents.md) for every supported profile and [custom agents](docs/custom-agents.md) for registry configuration.
242
61
 
243
- - small examples such as `echo`, `branch`, `shell`, `workdir`, and `two-turn`
244
- - a larger PR-triage example under [examples/flows/pr-triage/README.md](examples/flows/pr-triage/README.md)
245
- - a replay viewer under [examples/flows/replay-viewer/README.md](examples/flows/replay-viewer/README.md) for inspecting saved run bundles in the browser
62
+ ## Sessions and one-shot runs
246
63
 
247
- Example runs:
64
+ Persistent sessions keep context between prompts, support parallel named workstreams, and queue follow-up prompts when a turn is already running. Use `exec` when you want a stateless run with no saved session.
248
65
 
249
66
  ```bash
250
- acpx flow run ./my-flow.ts --input-file ./flow-input.json
251
-
252
- acpx flow run examples/flows/branch.flow.ts \
253
- --input-json '{"task":"FIX: add a regression test for the reconnect bug"}'
254
-
255
- acpx flow run examples/flows/pr-triage/pr-triage.flow.ts \
256
- --input-json '{"repo":"openclaw/acpx","prNumber":150}'
67
+ acpx codex sessions new --name backend
68
+ acpx codex -s backend "trace the checkout timeout"
69
+ acpx codex exec "summarize this repository"
257
70
  ```
258
71
 
259
- The PR-triage example is only an example workflow. It can comment on or close
260
- real GitHub PRs if you run it against a live repository.
261
-
262
- ## Configuration files
263
-
264
- `acpx` reads config in this order (later wins):
265
-
266
- 1. global: `~/.acpx/config.json`
267
- 2. project: `<cwd>/.acpxrc.json`
268
-
269
- CLI flags always win over config values.
270
-
271
- Use `--mcp-config <path>` to load only the `mcpServers` array from an external JSON file without
272
- writing a project config file. Relative paths resolve from `--cwd`.
72
+ Session state lives under `~/.acpx/`. The [sessions guide](docs/sessions.md) covers scope, queue ownership, reconnects, export/import, cancellation, and cleanup.
273
73
 
274
- Supported keys:
74
+ ## Automation and permissions
275
75
 
276
- ```json
277
- {
278
- "defaultAgent": "codex",
279
- "defaultPermissions": "approve-all",
280
- "nonInteractivePermissions": "deny",
281
- "authPolicy": "skip",
282
- "ttl": 300,
283
- "timeout": null,
284
- "format": "text",
285
- "agents": {
286
- "my-custom": { "command": "./bin/my-acp-server", "args": ["acp"] }
287
- },
288
- "auth": {
289
- "my_auth_method_id": "credential-value"
290
- }
291
- }
292
- ```
76
+ Text output is the default. `--format json` emits NDJSON ACP events for automation, while `--format quiet` prints only the final assistant text. Output events retain structured thinking, tool calls, diffs, and completion state instead of terminal escape sequences.
293
77
 
294
- Use `acpx config show` to inspect the resolved result and `acpx config init` to create the global template.
78
+ Permission modes range from read approval to explicit deny or approve-all policies. Use `--cwd` to set the session scope and filesystem boundary. Global and project JSON configuration can provide defaults; command-line flags take precedence.
295
79
 
296
- For ACP `authenticate` handshakes, use either config `auth` entries or explicit
297
- `ACPX_AUTH_<METHOD_ID>` environment variables such as `ACPX_AUTH_OPENAI_API_KEY`.
298
- Ambient provider env vars such as `OPENAI_API_KEY` are still passed through to
299
- child agents, but they do not trigger ACP auth-method selection on their own.
80
+ - [Output formats](docs/output-formats.md)
81
+ - [Permissions](docs/permissions.md)
82
+ - [Configuration](docs/config.md)
83
+ - [Exit codes](docs/exit-codes.md)
300
84
 
301
- ## Output formats
85
+ ## Flows and embedding
302
86
 
303
- ```bash
304
- # text (default): human-readable stream with tool updates
305
- acpx codex 'review this PR'
87
+ For multi-step work, `acpx flow run` executes TypeScript workflows that combine ACP turns with deterministic actions, decisions, computation, and checkpoints. The package also exports `acpx/runtime` and `acpx/flows` for applications that need session and workflow primitives without shelling out.
306
88
 
307
- # json: NDJSON events, useful for automation
308
- acpx --format json codex exec 'review this PR' \
309
- | jq -r 'select(.type=="tool_call") | [.status, .title] | @tsv'
89
+ Start with the [flows guide](docs/flows.md), then use the [examples](examples/flows/README.md) and [architecture notes](docs/2026-03-25-acpx-flows-architecture.md) for deeper integrations.
310
90
 
311
- # json-strict: suppresses non-JSON stderr output (requires --format json)
312
- acpx --format json --json-strict codex exec 'review this PR'
91
+ ## Documentation
313
92
 
314
- # quiet: final assistant text on stdout; one structured stderr line on failure
315
- acpx --format quiet codex 'give me a 3-line summary'
93
+ - [CLI reference](docs/CLI.md) commands, flags, and behavior
94
+ - [Prompting](docs/prompting.md) arguments, stdin, files, and queueing
95
+ - [Session controls](docs/session-control.md) — cancel, modes, options, and status
96
+ - [Compare agents](docs/compare.md) — run one prompt across multiple agents
97
+ - [ACP coverage](docs/2026-02-19-acp-coverage-roadmap.md) — implemented protocol methods
98
+ - [Vision](VISION.md) — project scope and design principles
316
99
 
317
- # suppress read payloads while keeping the selected output format
318
- acpx --suppress-reads codex exec 'inspect the repo and report tool usage'
319
- ```
100
+ The full documentation is also available at [acpx.sh](https://acpx.sh/).
320
101
 
321
- - `text`: human-readable stream with assistant text and tool updates
322
- - `json`: raw ACP NDJSON stream for automation
323
- - `quiet`: final assistant text on stdout; failed prompts emit one structured `[acpx] error:` line on stderr
324
- - `--suppress-reads`: replace raw read-file contents with `[read output suppressed]` in `text` and `json` output
325
-
326
- JSON events include a stable envelope for correlation:
327
-
328
- ```json
329
- {
330
- "eventVersion": 1,
331
- "sessionId": "abc123",
332
- "requestId": "req-42",
333
- "seq": 7,
334
- "stream": "prompt",
335
- "type": "tool_call"
336
- }
337
- ```
338
-
339
- Session-control JSON payloads (`sessions new|ensure`, `status`) always include
340
- `acpxRecordId` and `acpxSessionId`. They include `agentSessionId` only when the
341
- adapter exposes a provider-native session ID. The text/quiet session id is the
342
- local acpx record id; do not assume it can be passed to the native provider CLI
343
- unless `agentSessionId` is present.
344
-
345
- ## Built-in agents and custom servers
346
-
347
- Built-ins:
348
-
349
- | Agent | Adapter | Wraps |
350
- | ------------ | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
351
- | `pi` | [pi-acp](https://github.com/svkozak/pi-acp) | [Pi Coding Agent](https://github.com/mariozechner/pi) |
352
- | `openclaw` | native (`openclaw acp`) | [OpenClaw ACP bridge](https://github.com/openclaw/openclaw) |
353
- | `codex` | [codex-acp](https://github.com/agentclientprotocol/codex-acp) | [Codex CLI](https://codex.openai.com) |
354
- | `claude` | [claude-agent-acp](https://github.com/agentclientprotocol/claude-agent-acp) | [Claude Code](https://claude.ai/code) |
355
- | `gemini` | native (`gemini --acp`) | [Gemini CLI](https://github.com/google/gemini-cli) |
356
- | `cursor` | native (`cursor-agent acp`) | [Cursor CLI](https://cursor.com/docs/cli/acp) |
357
- | `copilot` | native (`copilot --acp --stdio`) | [GitHub Copilot CLI](https://docs.github.com/copilot/how-tos/copilot-chat/use-copilot-chat-in-the-command-line) |
358
- | `droid` | native (`droid exec --output-format acp`) | [Factory Droid](https://www.factory.ai) |
359
- | `fast-agent` | `uvx fast-agent-mcp acp` | [fast-agent](https://fast-agent.ai) |
360
- | `grok-build` | native (`grok agent stdio`) | [Grok Build](https://docs.x.ai/build/overview) |
361
- | `iflow` | native (`iflow --experimental-acp`) | [iFlow CLI](https://github.com/iflow-ai/iflow-cli) |
362
- | `kilocode` | `npx -y @kilocode/cli acp` | [Kilocode](https://kilocode.ai) |
363
- | `kimi` | native (`kimi acp`) | [Kimi CLI](https://github.com/MoonshotAI/kimi-cli) |
364
- | `kiro` | native (`kiro-cli-chat acp`) | [Kiro CLI](https://kiro.dev) |
365
- | `mux` | `mux acp` via an ACPX-owned npm range | [Mux](https://mux.coder.com) |
366
- | `opencode` | `npx -y opencode-ai acp` | [OpenCode](https://opencode.ai) |
367
- | `qoder` | native (`qodercli --acp`) | [Qoder CLI](https://docs.qoder.com/cli/acp) |
368
- | `qwen` | native (`qwen --acp`) | [Qwen Code](https://github.com/QwenLM/qwen-code) |
369
- | `trae` | native (`traecli acp serve`) | [Trae CLI](https://docs.trae.cn/cli) |
370
-
371
- `factory-droid` and `factorydroid` also resolve to the built-in `droid` adapter.
372
-
373
- Additional built-in agent docs live in [agents/README.md](agents/README.md).
374
-
375
- Use `--agent` as an escape hatch for custom ACP servers:
102
+ ## Development
376
103
 
377
104
  ```bash
378
- acpx --agent ./my-custom-acp-server 'do something'
379
- ```
380
-
381
- For repo-local OpenClaw checkouts, override the built-in command in config so `acpx openclaw ...`
382
- spawns the ACP bridge directly without `pnpm` wrapper noise:
383
-
384
- ```json
385
- {
386
- "agents": {
387
- "openclaw": {
388
- "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"
389
- }
390
- }
391
- }
105
+ pnpm install --frozen-lockfile
106
+ pnpm run check
107
+ pnpm run check:docs
392
108
  ```
393
109
 
394
- ## Session behavior
395
-
396
- - Prompt commands require an existing saved session record (created via `sessions new` or `sessions ensure`).
397
- - Prompts route by walking up from `cwd` (or `--cwd`) to the nearest git root (inclusive) and selecting the nearest active session matching `(agent command, dir, optional name)`.
398
- - If no git root is found, prompts only match an exact `cwd` session (no parent-directory walk).
399
- - `-s <name>` selects a parallel named session during that directory walk.
400
- - `sessions new [--name <name>]` creates a fresh session for that scope and soft-closes the prior one.
401
- - `sessions ensure [--name <name>]` is idempotent: it returns an existing scoped session or creates one when missing.
402
- - `sessions close [name]` soft-closes the session: queue owner/processes are terminated, record is kept with `closed: true`.
403
- - `sessions list` uses agent-side ACP `session/list` when available; use
404
- `--cursor`, `--filter-cwd`, or `--local` for pagination, cwd filtering, or
405
- saved-record inspection.
406
- - Auto-resume for cwd scope skips sessions marked closed.
407
- - Prompt submissions are queue-aware per session. If a prompt is already running, new prompts are queued and drained by the running `acpx` process.
408
- - Queue owners use an idle TTL (default 300s). `--ttl <seconds>` overrides it; `--ttl 0` keeps owners alive indefinitely.
409
- - `--no-wait` submits to that queue and returns immediately.
410
- - `cancel` sends cooperative `session/cancel` to the running queue owner process and returns success when no prompt is running (`nothing to cancel`).
411
- - `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`.
412
- - `<mode>` values for `set-mode` are adapter-defined; unsupported values are rejected by the adapter (commonly `Invalid params`).
413
- - `exec` is always one-shot and does not reuse saved sessions.
414
- - Session metadata is stored under `~/.acpx/sessions/`.
415
- - Each successful prompt appends lightweight turn history previews (`role`, `timestamp`, `textPreview`) to session metadata.
416
- - `Ctrl+C` during a running turn sends ACP `session/cancel` and waits briefly for `stopReason=cancelled` before force-killing if needed.
417
- - If a saved session pid is dead on the next prompt, `acpx` respawns the agent, attempts `session/resume` when advertised or `session/load` otherwise, and transparently falls back to `session/new` if reconnecting fails.
418
-
419
- ## Full CLI reference
420
-
421
- See [docs/CLI.md](docs/CLI.md).
110
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution and review guidance.
422
111
 
423
112
  ## License
424
113
 
425
- MIT
114
+ MIT. See [LICENSE](LICENSE).
@@ -1,6 +1,6 @@
1
- import { R as permissionModeSatisfies } from "./live-checkpoint-DQp4JSHD.js";
2
- import { _ as resolveGlobalFlags, a as hasExplicitPermissionModeFlag, g as resolveAgentInvocation, v as resolveOutputPolicy, x as loadPermissionPolicySpec, y as resolvePermissionMode } from "./flags-CjeFX5ki.js";
3
- import { c as validateFlowDefinition, h as isDefinedFlow, o as FlowRunner } from "./flows-Cym6H3vg.js";
1
+ import { V as permissionModeSatisfies } from "./live-checkpoint-BSIrfgVo.js";
2
+ import { S as loadPermissionPolicySpec, _ as resolveGlobalFlags, a as hasExplicitPermissionModeFlag, g as resolveAgentInvocation, v as resolveOutputPolicy, y as resolvePermissionMode } from "./flags-Ds6FzmHG.js";
3
+ import { c as validateFlowDefinition, h as isDefinedFlow, o as FlowRunner } from "./flows-fzH0GKYF.js";
4
4
  import { fileURLToPath, pathToFileURL } from "node:url";
5
5
  import path from "node:path";
6
6
  import { InvalidArgumentError } from "commander";
@@ -36,6 +36,7 @@ async function handleFlowRun(flowFile, flags, command, config) {
36
36
  permissionPolicy,
37
37
  authCredentials: config.auth,
38
38
  authPolicy: globalFlags.authPolicy,
39
+ fs: globalFlags.fs,
39
40
  timeoutMs: globalFlags.timeout,
40
41
  ttlMs: globalFlags.ttl,
41
42
  verbose: globalFlags.verbose,
@@ -194,4 +195,4 @@ function printFlowRunResult(result, globalFlags) {
194
195
  //#endregion
195
196
  export { handleFlowRun };
196
197
 
197
- //# sourceMappingURL=cli-pKoIEH5O.js.map
198
+ //# sourceMappingURL=cli-_7Sei6dD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-_7Sei6dD.js","names":[],"sources":["../src/flows/cli.ts"],"sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { InvalidArgumentError, type Command } from \"commander\";\nimport type { ResolvedAcpxConfig } from \"../cli/config.js\";\nimport {\n hasExplicitPermissionModeFlag,\n resolveAgentInvocation,\n resolveGlobalFlags,\n resolveOutputPolicy,\n resolvePermissionMode,\n type GlobalFlags,\n} from \"../cli/flags.js\";\nimport { type FlowDefinition, FlowRunner } from \"../flows.js\";\nimport { loadPermissionPolicySpec } from \"../permission-policy.js\";\nimport { permissionModeSatisfies } from \"../permissions.js\";\nimport type { PermissionMode } from \"../types.js\";\nimport { isDefinedFlow } from \"./authoring.js\";\nimport { validateFlowDefinition } from \"./graph.js\";\n\ntype FlowRunFlags = {\n inputJson?: string;\n inputFile?: string;\n defaultAgent?: string;\n};\n\nconst FLOW_RUNTIME_SPECIFIER = \"acpx/flows\";\nconst TEXT_MODULE_EXTENSIONS = new Set([\".js\", \".mjs\", \".cjs\", \".ts\", \".tsx\", \".mts\", \".cts\"]);\n\nexport async function handleFlowRun(\n flowFile: string,\n flags: FlowRunFlags,\n command: Command,\n config: ResolvedAcpxConfig,\n): Promise<void> {\n const globalFlags = resolveGlobalFlags(command, config);\n const permissionMode = resolvePermissionMode(globalFlags, config.defaultPermissions);\n const permissionPolicy = await resolveFlowPermissionPolicy(globalFlags);\n const outputPolicy = resolveOutputPolicy(globalFlags.format, globalFlags.jsonStrict === true);\n const input = await readFlowInput(flags);\n const flowPath = path.resolve(flowFile);\n const flow = await loadFlowModule(flowPath);\n assertFlowPermissionRequirements(flow, permissionMode, globalFlags);\n\n const runner = new FlowRunner({\n resolveAgent: (profile?: string) => {\n return resolveAgentInvocation(profile ?? flags.defaultAgent, globalFlags, config);\n },\n permissionMode,\n mcpServers: config.mcpServers,\n nonInteractivePermissions: globalFlags.nonInteractivePermissions,\n permissionPolicy,\n authCredentials: config.auth,\n authPolicy: globalFlags.authPolicy,\n fs: globalFlags.fs,\n timeoutMs: globalFlags.timeout,\n ttlMs: globalFlags.ttl,\n verbose: globalFlags.verbose,\n suppressSdkConsoleErrors: outputPolicy.suppressSdkConsoleErrors,\n sessionOptions: {\n model: globalFlags.model,\n allowedTools: globalFlags.allowedTools,\n maxTurns: globalFlags.maxTurns,\n },\n });\n\n const result = await runner.run(flow, input, {\n flowPath,\n });\n\n printFlowRunResult(result, globalFlags);\n}\n\nasync function resolveFlowPermissionPolicy(globalFlags: GlobalFlags) {\n try {\n return await loadPermissionPolicySpec(globalFlags.permissionPolicy, globalFlags.cwd);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new InvalidArgumentError(`Invalid permission policy: ${message}`);\n }\n}\n\nfunction assertFlowPermissionRequirements(\n flow: FlowDefinition,\n permissionMode: PermissionMode,\n globalFlags: GlobalFlags,\n): void {\n const permissions = flow.permissions;\n if (!permissions) {\n return;\n }\n\n if (permissions.requireExplicitGrant && !hasExplicitPermissionModeFlag(globalFlags)) {\n throw new InvalidArgumentError(\n buildFlowPermissionFailureMessage(flow, permissions.requiredMode, permissions.reason, true),\n );\n }\n\n if (!permissionModeSatisfies(permissionMode, permissions.requiredMode)) {\n throw new InvalidArgumentError(\n buildFlowPermissionFailureMessage(flow, permissions.requiredMode, permissions.reason, false),\n );\n }\n}\n\nfunction buildFlowPermissionFailureMessage(\n flow: FlowDefinition,\n requiredMode: PermissionMode,\n reason?: string,\n explicit = false,\n): string {\n return [\n explicit\n ? `Flow \"${flow.name}\" requires an explicit ${requiredMode} grant.`\n : `Flow \"${flow.name}\" requires permission mode ${requiredMode}.`,\n `Rerun with --${requiredMode}.`,\n ...(reason ? [`Reason: ${reason}`] : []),\n ].join(\" \");\n}\n\nasync function readFlowInput(flags: FlowRunFlags): Promise<unknown> {\n if (flags.inputJson && flags.inputFile) {\n throw new InvalidArgumentError(\"Use only one of --input-json or --input-file\");\n }\n\n if (flags.inputJson) {\n return parseJsonInput(flags.inputJson, \"--input-json\");\n }\n\n if (flags.inputFile) {\n const inputPath = path.resolve(flags.inputFile);\n const payload = await fs.readFile(inputPath, \"utf8\");\n return parseJsonInput(payload, \"--input-file\");\n }\n\n return {};\n}\n\nasync function loadFlowModule(flowPath: string): Promise<FlowDefinition> {\n const extension = path.extname(flowPath).toLowerCase();\n const prepared = await prepareFlowModuleImport(flowPath, extension);\n try {\n const module = await loadFlowRuntimeModule(prepared.flowUrl, extension);\n\n const candidate = findFlowDefinition(module);\n if (!candidate) {\n throw new Error(\n `Flow module must export default defineFlow({...}) from \"acpx/flows\": ${flowPath}`,\n );\n }\n validateFlowDefinition(candidate);\n return candidate;\n } finally {\n await prepared.cleanup?.();\n }\n}\n\nasync function prepareFlowModuleImport(\n flowPath: string,\n extension: string,\n): Promise<{\n flowUrl: string;\n cleanup?: () => Promise<void>;\n}> {\n const flowUrl = pathToFileURL(flowPath).href;\n if (!TEXT_MODULE_EXTENSIONS.has(extension)) {\n return { flowUrl };\n }\n\n const source = await fs.readFile(flowPath, \"utf8\");\n if (!source.includes(FLOW_RUNTIME_SPECIFIER)) {\n return { flowUrl };\n }\n\n const runtimeSpecifier = resolveFlowRuntimeImportSpecifier();\n const rewritten = source.replaceAll(\n /([\"'])acpx\\/flows\\1/g,\n (_match, quote: string) => `${quote}${runtimeSpecifier}${quote}`,\n );\n if (rewritten === source) {\n return { flowUrl };\n }\n\n const tempPath = path.join(path.dirname(flowPath), `.acpx-flow-load-${randomUUID()}${extension}`);\n await fs.writeFile(tempPath, rewritten, \"utf8\");\n return {\n flowUrl: pathToFileURL(tempPath).href,\n cleanup: async () => {\n await fs.rm(tempPath, { force: true });\n },\n };\n}\n\nfunction resolveFlowRuntimeImportSpecifier(): string {\n const selfPath = fileURLToPath(import.meta.url);\n let runtimePath: string;\n\n if (selfPath.endsWith(`${path.sep}src${path.sep}flows${path.sep}cli.ts`)) {\n runtimePath = fileURLToPath(new URL(\"../flows.ts\", import.meta.url));\n } else if (selfPath.endsWith(`${path.sep}src${path.sep}flows${path.sep}cli.js`)) {\n runtimePath = fileURLToPath(new URL(\"../flows.js\", import.meta.url));\n } else {\n runtimePath = fileURLToPath(new URL(\"./flows.js\", import.meta.url));\n }\n return runtimePath.replaceAll(path.sep, \"/\");\n}\n\nasync function loadFlowRuntimeModule(\n flowUrl: string,\n extension: string,\n): Promise<{\n default?: unknown;\n \"module.exports\"?: unknown;\n}> {\n if (extension === \".ts\" || extension === \".tsx\" || extension === \".cts\") {\n const { register } = (await import(\"tsx/cjs/api\")) as {\n register: (options: { namespace: string }) => {\n require: (\n specifier: string,\n parentURL: string,\n ) => {\n default?: unknown;\n \"module.exports\"?: unknown;\n };\n unregister: () => void;\n };\n };\n const loader = register({ namespace: randomUUID() });\n try {\n return loader.require(flowUrl, import.meta.url);\n } finally {\n loader.unregister();\n }\n }\n\n if (extension === \".mts\") {\n const { register } = (await import(\"tsx/esm/api\")) as {\n register: (options: { namespace: string }) => {\n import: (\n specifier: string,\n parentURL: string,\n ) => Promise<{\n default?: unknown;\n \"module.exports\"?: unknown;\n }>;\n unregister: () => Promise<void>;\n };\n };\n const loader = register({ namespace: randomUUID() });\n try {\n return await loader.import(flowUrl, import.meta.url);\n } finally {\n await loader.unregister();\n }\n }\n\n return (await import(flowUrl)) as {\n default?: unknown;\n \"module.exports\"?: unknown;\n };\n}\n\nfunction findFlowDefinition(module: {\n default?: unknown;\n \"module.exports\"?: unknown;\n}): FlowDefinition | null {\n const candidates = [\n module.default,\n module[\"module.exports\"],\n getNestedDefault(module.default),\n getNestedDefault(module[\"module.exports\"]),\n ];\n\n for (const candidate of candidates) {\n if (isDefinedFlow(candidate)) {\n return candidate;\n }\n }\n\n return null;\n}\n\nfunction getNestedDefault(value: unknown): unknown {\n if (!value || typeof value !== \"object\" || !(\"default\" in value)) {\n return null;\n }\n return (value as { default?: unknown }).default ?? null;\n}\n\nfunction parseJsonInput(raw: string, label: string): unknown {\n try {\n return JSON.parse(raw);\n } catch (error) {\n throw new InvalidArgumentError(\n `${label} must contain valid JSON: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n}\n\nfunction printFlowRunResult(\n result: Awaited<ReturnType<FlowRunner[\"run\"]>>,\n globalFlags: GlobalFlags,\n): void {\n const payload = {\n action: \"flow_run_result\",\n runId: result.state.runId,\n flowName: result.state.flowName,\n runTitle: result.state.runTitle,\n flowPath: result.state.flowPath,\n status: result.state.status,\n currentNode: result.state.currentNode,\n currentNodeType: result.state.currentNodeType,\n currentNodeStartedAt: result.state.currentNodeStartedAt,\n lastHeartbeatAt: result.state.lastHeartbeatAt,\n statusDetail: result.state.statusDetail,\n waitingOn: result.state.waitingOn,\n runDir: result.runDir,\n outputs: result.state.outputs,\n sessionBindings: result.state.sessionBindings,\n };\n\n if (globalFlags.format === \"json\") {\n process.stdout.write(`${JSON.stringify(payload)}\\n`);\n return;\n }\n\n if (globalFlags.format === \"quiet\") {\n process.stdout.write(`${result.state.runId}\\n`);\n return;\n }\n\n process.stdout.write(`runId: ${payload.runId}\\n`);\n process.stdout.write(`flow: ${payload.flowName}\\n`);\n if (payload.runTitle) {\n process.stdout.write(`title: ${payload.runTitle}\\n`);\n }\n process.stdout.write(`status: ${payload.status}\\n`);\n process.stdout.write(`runDir: ${payload.runDir}\\n`);\n if (payload.currentNode) {\n process.stdout.write(`currentNode: ${payload.currentNode}\\n`);\n }\n if (payload.statusDetail) {\n process.stdout.write(`statusDetail: ${payload.statusDetail}\\n`);\n }\n if (payload.waitingOn) {\n process.stdout.write(`waitingOn: ${payload.waitingOn}\\n`);\n }\n process.stdout.write(`${JSON.stringify(payload.outputs, null, 2)}\\n`);\n}\n"],"mappings":";;;;;;;;;AA2BA,MAAM,yBAAyB;AAC/B,MAAM,yCAAyB,IAAI,IAAI;CAAC;CAAO;CAAQ;CAAQ;CAAO;CAAQ;CAAQ;AAAM,CAAC;AAE7F,eAAsB,cACpB,UACA,OACA,SACA,QACe;CACf,MAAM,cAAc,mBAAmB,SAAS,MAAM;CACtD,MAAM,iBAAiB,sBAAsB,aAAa,OAAO,kBAAkB;CACnF,MAAM,mBAAmB,MAAM,4BAA4B,WAAW;CACtE,MAAM,eAAe,oBAAoB,YAAY,QAAQ,YAAY,eAAe,IAAI;CAC5F,MAAM,QAAQ,MAAM,cAAc,KAAK;CACvC,MAAM,WAAW,KAAK,QAAQ,QAAQ;CACtC,MAAM,OAAO,MAAM,eAAe,QAAQ;CAC1C,iCAAiC,MAAM,gBAAgB,WAAW;CA4BlE,mBAAmB,MAJE,IAtBF,WAAW;EAC5B,eAAe,YAAqB;GAClC,OAAO,uBAAuB,WAAW,MAAM,cAAc,aAAa,MAAM;EAClF;EACA;EACA,YAAY,OAAO;EACnB,2BAA2B,YAAY;EACvC;EACA,iBAAiB,OAAO;EACxB,YAAY,YAAY;EACxB,IAAI,YAAY;EAChB,WAAW,YAAY;EACvB,OAAO,YAAY;EACnB,SAAS,YAAY;EACrB,0BAA0B,aAAa;EACvC,gBAAgB;GACd,OAAO,YAAY;GACnB,cAAc,YAAY;GAC1B,UAA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 @@
1
- import { f as SessionRecord } from "./session-options-C4uYkKDy.js";
1
+ import { _ as SessionRecord } from "./session-options-DwRDODlr.js";
2
2
  import { Command } from "commander";
3
3
  //#region src/cli/flags.d.ts
4
4
  declare function parseTtlSeconds(value: string): number;
@@ -6,7 +6,7 @@ declare function parseAllowedTools(value: string): string[];
6
6
  declare function parseMaxTurns(value: string): number;
7
7
  //#endregion
8
8
  //#region src/cli/output/render.d.ts
9
- type SessionConnectionStatus = "connected" | "needs reconnect";
9
+ type SessionConnectionStatus = "connected" | "starting" | "needs reconnect";
10
10
  declare function formatPromptSessionBannerLine(record: SessionRecord, currentCwd: string, connectionStatus?: SessionConnectionStatus): string;
11
11
  //#endregion
12
12
  export { formatPromptSessionBannerLine, parseAllowedTools, parseMaxTurns, parseTtlSeconds };
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","names":[],"sources":["../src/cli/flags.ts","../src/cli/output/render.ts"],"mappings":";;;iBAgKgB,gBAAgB;iBAkDhB,kBAAkB;iBAgBlB,cAAc;;;KChNzB;iBAwLW,8BACd,QAAQ,eACR,oBACA,mBAAkB"}
1
+ {"version":3,"file":"cli.d.ts","names":[],"sources":["../src/cli/flags.ts","../src/cli/output/render.ts"],"mappings":";;;iBAyKgB,gBAAgB;iBAsDhB,kBAAkB;iBAgBlB,cAAc;;;KC7NzB;iBAkMW,8BACd,QAAQ,eACR,oBACA,mBAAkB"}