@ganglion/xacpx 0.13.0 → 0.14.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 CHANGED
@@ -23,18 +23,12 @@ English · **[中文](./docs/zh/README_zh.md)**
23
23
 
24
24
  If you need to code or work remotely on a temporary basis, `xacpx` gives you a fast, convenient **remote entry point** so you can get things done from WeChat or Feishu anytime, anywhere.
25
25
 
26
- ## Who it's for
27
-
28
- `xacpx` suits users who want lightweight, on-demand multi-agent work. You can watch tasks, send commands, and view results from WeChat, Feishu, or Yuanbao, and manage multiple sessions within the same chat.
29
-
30
- > For everyday use, remember `/ss` first: it creates or reuses an xacpx logical session. If you want to attach to an existing native session of a local agent such as Codex, use `/ssn`; see [docs/native-sessions.md](./docs/native-sessions.md) for advanced details.
26
+ > For everyday use, remember `/ss` first: it creates or reuses an xacpx logical session. If you want to attach to an existing native session of a local agent such as Codex, use `/ssn`; see [native sessions](./docs/native-sessions.md).
31
27
 
32
28
  ## 5-minute quick start
33
29
 
34
30
  ### Prerequisites
35
31
 
36
- Before you start, you need at least:
37
-
38
32
  - Node.js 22+ or Bun
39
33
  - A working agent CLI you intend to use, such as Codex / Claude Code / Gemini / OpenCode
40
34
  - A phone with WeChat, Feishu, or Yuanbao installed
@@ -49,32 +43,25 @@ npm install -g @ganglion/xacpx --registry=https://registry.npmjs.org
49
43
  bun add -g @ganglion/xacpx
50
44
  ```
51
45
 
52
- ### Log in to WeChat
46
+ ### Log in and start
53
47
 
54
48
  ```bash
55
- xacpx login
49
+ xacpx login # shows a QR code; scan it with WeChat
50
+ xacpx start # start the background service
56
51
  ```
57
52
 
58
- The terminal will show a QR code; scan it with WeChat to log in.
59
-
60
- If you want to use Feishu or Yuanbao instead of WeChat, see "Switch / add other channels" below first.
61
-
62
- ### Start the service
63
-
64
- ```bash
65
- xacpx start
66
- ```
53
+ To use Feishu or Yuanbao instead of WeChat, see "Other channels" below first.
67
54
 
68
55
  ### Create your first session in WeChat
69
56
 
70
- Send these two messages in WeChat:
57
+ Send these messages in WeChat:
71
58
 
72
59
  ```text
73
60
  /ss codex -d /absolute/path/to/your/repo
74
61
  /help
75
62
  ```
76
63
 
77
- Then just send plain text, for example:
64
+ Then just send plain text:
78
65
 
79
66
  ```text
80
67
  hello
@@ -82,14 +69,9 @@ hello
82
69
 
83
70
  If everything works, plain text goes into the current session and the agent's reply comes back to WeChat.
84
71
 
85
- ### Switch / add other channels
86
-
87
- WeChat is the built-in default channel. Feishu and Yuanbao are distributed as official plugin packages, and third-party channels follow the same plugin flow. If you can't remember the package names, check the official plugin list first:
72
+ ### Other channels
88
73
 
89
- ```bash
90
- xacpx plugin known
91
- # Install: xacpx plugin add <package>
92
- ```
74
+ WeChat is the built-in default channel. Feishu and Yuanbao are distributed as official plugin packages, and third-party channels follow the same plugin flow. If you can't remember the package names, run `xacpx plugin known` first.
93
75
 
94
76
  ```bash
95
77
  # Feishu
@@ -103,7 +85,7 @@ xacpx channel add yuanbao # enter appKey/appSecret when prompted
103
85
  xacpx restart
104
86
  ```
105
87
 
106
- For full credential configuration, parameters, and management commands such as `enable/disable/rm`, see [docs/channel-management.md](./docs/channel-management.md). If you want to write your own channel plugin, see [docs/plugin-development.md](./docs/plugin-development.md).
88
+ Full credentials, parameters, and management commands (`enable/disable/rm`): [channel-management.md](./docs/channel-management.md). To write your own channel plugin: [plugin-development.md](./docs/plugin-development.md).
107
89
 
108
90
  ## Your everyday workflow
109
91
 
@@ -111,34 +93,16 @@ The most common sequence is just four steps:
111
93
 
112
94
  1. **Start the background service**: `xacpx start`
113
95
  2. **Create or switch sessions**: `/ss ...`, `/use ...`
114
- 3. **Send plain text directly**: let the current session keep working
115
- 4. **Check status or cancel the current task when needed**: `/status`, `/cancel`
116
-
117
- ### 1) Create a session
118
-
119
- The most common command:
120
-
121
- ```text
122
- /ss codex -d /absolute/path/to/your/repo
123
- ```
124
-
125
- It uses `codex`, binds this working directory, and automatically switches to the new session.
126
-
127
- ### 2) Send plain messages
128
-
129
- Any text not starting with `/` is sent to the current session.
130
-
131
- ```text
132
- Fix this recent API timeout issue
133
- ```
96
+ 3. **Send plain text directly**: any text not starting with `/` goes to the current session
97
+ 4. **Check status or cancel when needed**: `/status`, `/cancel`
134
98
 
135
- ### 3) View replies
99
+ ### Reply modes
136
100
 
137
- `xacpx` supports three common reply modes:
101
+ `xacpx` supports three reply modes (switch per session with `/replymode`):
138
102
 
139
103
  - `stream`: stream back intermediate text
140
104
  - `final`: return only the final result
141
- - `verbose`: the default; in addition to streaming text, also shows tool-call summaries
105
+ - `verbose`: the default; streaming text plus tool-call summaries
142
106
 
143
107
  For example, in `verbose` mode you'll see:
144
108
 
@@ -149,466 +113,121 @@ For example, in `verbose` mode you'll see:
149
113
  ✏️ Edit parse-command.ts
150
114
  ```
151
115
 
152
- ### 4) Switch sessions
116
+ ## Command cheat sheet
153
117
 
154
- ```text
155
- /ss
156
- /use backend:codex
157
- ```
158
-
159
- This lets you switch between sessions for different projects and different agents within the same WeChat chat.
160
-
161
- ## Common CLI commands
118
+ The essentials to get going. Full references: **CLI → [cli-reference.md](./docs/cli-reference.md)**, **chat commands → [commands.md](./docs/commands.md)**.
162
119
 
163
- These commands run in a terminal on your computer.
120
+ **Terminal (on the host):**
164
121
 
165
122
  | Command | Description |
166
123
  |------|------|
167
- | `xacpx login` | Log in to WeChat |
168
- | `xacpx logout` | Clear the WeChat login credentials saved on this machine |
169
- | `xacpx run` | Run in the foreground, useful for debugging |
170
- | `xacpx start` | Start the service in the background |
171
- | `xacpx status` | Show background status, PID, config path, and log path |
172
- | `xacpx stop` | Stop the background instance |
173
- | `xacpx restart` | Restart the background instance so channel config changes take effect |
174
- | `xacpx update [--all\|<name>]` | Check and update xacpx and installed plugins; when plugins are installed, it interactively lets you choose what to update |
175
- | `xacpx channel list\|show\|add\|rm\|enable\|disable [--account <id>]` | Manage message channels; `--account <id>` targets one bot when several share a channel (multi-bot) |
176
- | `xacpx plugin list\|add\|update\|remove\|enable\|disable\|doctor\|known` | Manage plugins: list/install/update/remove, toggle, run `doctor`, or list official packages with `known` |
177
- | `xacpx plugin add @ganglion/xacpx-channel-feishu && xacpx channel add feishu` | Install and add the Feishu channel; prompts for Feishu app credentials |
178
- | `xacpx plugin add @ganglion/xacpx-channel-yuanbao && xacpx channel add yuanbao` | Install and add the Yuanbao channel; prompts for Yuanbao appKey/appSecret |
124
+ | `xacpx login` / `logout` | Log in / out of WeChat |
125
+ | `xacpx start` / `stop` / `restart` / `status` | Manage the background service |
126
+ | `xacpx update` | Update xacpx and installed plugins |
179
127
  | `xacpx doctor` | Run environment diagnostics |
180
- | `xacpx version` | Show the current version |
181
- | `xacpx agent list` | List agents registered on this machine |
182
- | `xacpx agent add <name>` | Add an agent from a built-in template; an existing agent of the same name with a different config is not overwritten |
183
- | `xacpx agent rm <name>` | Remove an agent |
184
- | `xacpx workspace list` | List workspaces registered on this machine |
185
- | `xacpx workspace add [name] [--raw]` | Register the current directory as a workspace; without `name`, uses the current directory name, and names with special characters are normalized automatically |
186
- | `xacpx workspace rm <name>` | Remove a workspace |
187
- | `xacpx later list` / `xacpx lt list` | List this machine's pending scheduled tasks in the terminal |
188
- | `xacpx later cancel <id>` / `xacpx lt cancel <id>` | Cancel a pending scheduled task in the terminal |
189
-
190
- The first time you run `xacpx start` or `xacpx run`, if there are no sessions, workspaces, or plugins, the CLI asks whether to register the current directory as a workspace and lets you choose a built-in agent template; after the service starts, it creates the initial acpx session through the normal session-creation flow.
191
-
192
- `workspace` can also be abbreviated as `ws`:
193
-
194
- ```bash
195
- xacpx ws add
196
- xacpx ws list
197
- xacpx ws rm backend
198
- ```
128
+ | `xacpx channel add <name>` | Add a message channel (Feishu / Yuanbao / …) |
129
+ | `xacpx ws add` / `xacpx agent add <name>` | Register a workspace / agent |
199
130
 
200
- ### How to use the `workspace` CLI
201
-
202
- `xacpx workspace` maintains the `workspaces` config in `~/.xacpx/config.json` on your local machine. It's good for registering frequently used project directories in the terminal first, then referencing them directly in WeChat with `--ws <name>`.
131
+ **Chat (in WeChat / Feishu / Yuanbao):**
203
132
 
204
133
  | Command | Description |
205
134
  |------|------|
206
- | `xacpx workspace list` | List registered workspaces and their paths |
207
- | `xacpx workspace add` | Register the current directory as a workspace, defaulting the name to the current directory name (normalized automatically) |
208
- | `xacpx workspace add <name>` | Register the current directory under a specific name (normalized if it contains special characters) |
209
- | `xacpx workspace add [name] --raw` | Keep the original name (including spaces, etc.); later commands must quote it |
210
- | `xacpx workspace rm <name>` | Remove a specific workspace |
211
-
212
- Common usage:
213
-
214
- ```bash
215
- cd /absolute/path/to/backend
216
- xacpx workspace add backend
217
-
218
- cd /absolute/path/to/frontend
219
- xacpx ws add frontend
220
-
221
- xacpx ws list
222
- xacpx ws rm frontend
223
- ```
224
-
225
- Once registered, you can use it directly in WeChat:
226
-
227
- ```text
228
- /ss codex --ws backend
229
- /ss new claude --ws frontend
230
- ```
231
-
232
- Note: `workspace add` always registers the **directory the terminal is currently in**. Without a name, it uses the current directory name as the workspace name. Names containing spaces, Chinese characters, etc. are normalized automatically to `[a-zA-Z0-9._-]+` (for example, the directory `My Project` is saved as `My-Project`), with `-2`, `-3` appended on collisions. To keep the original name, add `--raw`; afterwards `xacpx workspace rm`, `/ws rm`, and `--ws <name>` all need quoting, for example `xacpx workspace rm "My Project"`.
233
-
234
- ### How to use the `agent` CLI
235
-
236
- `xacpx agent` maintains the `agents` config in `~/.xacpx/config.json` on your local machine; `agents` is an equivalent alias.
237
-
238
- | Command | Description |
239
- |------|------|
240
- | `xacpx agent list` | List registered agents |
241
- | `xacpx agent templates` | List the built-in templates you can add |
242
- | `xacpx agent add <name>` | Add an agent from a built-in template, e.g. `kimi`, `opencode` |
243
- | `xacpx agent rm <name>` | Remove a specific agent |
244
-
245
- Common usage:
246
-
247
- ```bash
248
- xacpx agent templates
249
- xacpx agent add kimi
250
- xacpx agents list
251
- xacpx agent rm kimi
252
- ```
253
-
254
- ### How to use `doctor`
255
-
256
- ```bash
257
- xacpx doctor
258
- xacpx doctor --verbose
259
- xacpx doctor --smoke
260
- xacpx doctor --smoke --agent codex --workspace backend
261
- xacpx doctor --fix
262
- ```
263
-
264
- Notes:
265
-
266
- - `--verbose` expands the details of each check
267
- - `--smoke` additionally runs a minimal real transport-level prompt check
268
- - `--agent` / `--workspace` only affect `--smoke`
269
- - Without `--smoke`, the related checks show as `SKIP`
270
- - `--fix` applies safe local repairs (runtime dir permissions, stale locks, invalid state records) and re-checks; state-mutating repairs are withheld while the daemon runs — see [docs/doctor-command.md](docs/doctor-command.md)
271
-
272
- ### How to use `update`
273
-
274
- `xacpx update` checks for and installs new versions of xacpx itself and your installed channel plugins.
275
-
276
- ```bash
277
- xacpx update # interactive: pick what to update
278
- xacpx update --all # update everything (core + all plugins) non-interactively
279
- xacpx update <name> # update a single target (the core, or a specific plugin package)
280
- ```
281
-
282
- Notes:
283
-
284
- - When plugins are installed, the bare `xacpx update` is interactive and lets you choose which targets to update.
285
- - In a non-interactive environment, updating the core or plugins needs explicit confirmation: use `xacpx update --all`, or name the target with `xacpx update <name>`.
286
- - `update` covers the core package and channel plugins; to manage a single plugin's version directly, see `xacpx plugin update <name>` ([docs/plugin-development.md](./docs/plugin-development.md)).
287
- - After updating, run `xacpx restart` so a running daemon loads the new version.
288
- - Cross-package rename migration: this project was renamed `weacpx` → `xacpx`. If you still have the legacy `weacpx` package installed, running `weacpx update` will offer to migrate you across to `xacpx` automatically (you confirm the switch). Already on `xacpx`? Just use `xacpx update` as a normal self-update.
289
-
290
- ## Common chat commands
291
-
292
- These commands are sent in a WeChat or Feishu chat. For the full command reference, see [docs/commands.md](./docs/commands.md).
293
-
294
- ### Agent management
295
-
296
- The default config usually already includes `codex` and `claude`. If you want to use another acpx-supported agent, you can add it from a built-in template with `/agent add <name>`.
297
-
298
- | Command | Description |
299
- |------|------|
300
- | `/agents` | List agents |
301
- | `/agent add gemini` | Add the `Gemini` agent |
302
- | `/agent add opencode` | Add the `OpenCode` agent |
303
- | `/agent rm <name>` | Remove an agent |
304
-
305
- The current built-in templates align with acpx's built-in agents:
306
-
307
- ```text
308
- codex, claude, pi, openclaw, gemini, cursor, copilot, droid,
309
- factory-droid, factorydroid, iflow, kilocode, kimi, kiro,
310
- opencode, qoder, qwen, trae
311
- ```
312
-
313
- These templates only write `driver`; the actual launch command is resolved by acpx. For example, `/agent add kimi` saves `{ "driver": "kimi" }`. For full command docs see [docs/commands.md](./docs/commands.md), and for config fields see [docs/config-reference.md](./docs/config-reference.md).
314
-
315
- ### Workspace management
316
-
317
- | Command | Description |
318
- |------|------|
319
- | `/workspaces` / `/workspace` / `/ws` | List workspaces |
320
- | `/ws new <name> -d <path> [--raw]` | Add a workspace; `path` is an absolute path on your computer, and Windows does not distinguish forward/back slashes; names with special characters such as spaces/Chinese are normalized automatically, and --raw keeps the original name |
321
- | `/workspace rm <name>` | Remove a workspace |
322
-
323
- ### Sessions
324
-
325
- | Command | Description |
326
- |------|------|
327
- | `/sessions` / `/session` / `/ss` | List sessions |
328
- | `/ss <agent> (-d <path> \| --ws <name>)` | Create or reuse your current most-used session |
329
- | `/ss new <agent> (-d <path> \| --ws <name>)` | Force-create a new session |
330
- | `/ssn <agent> (-d <path> \| --ws <name>)` | Attach to an existing native session of a local agent; see [native sessions](./docs/native-sessions.md) |
135
+ | `/ss <agent> -d <path>` | Create or reuse a session in a project directory |
136
+ | `/ss new <agent> --ws <name>` | Force-create a new session |
137
+ | `/ssn <agent> -d <path>` | Attach to a local agent's [native session](./docs/native-sessions.md) |
331
138
  | `/use <alias>` | Switch the current session |
332
- | `/status` | Show the current session status |
333
- | `/mode` / `/mode <id>` | View or set the underlying `acpx` mode |
334
- | `/model` / `/model <id>` | View or switch the session's LLM model (also `/session new --model`, `/agent add --model`) |
335
- | `/replymode` | Show the current reply mode |
336
- | `/replymode stream` | Streaming replies |
337
- | `/replymode verbose` | Streaming + tool-call summaries |
338
- | `/replymode final` | Return only the final result |
339
- | `/replymode reset` | Fall back to the global default reply mode |
340
- | `/session reset` | Reset the current session context |
341
- | `/clear` | Shortcut alias for `/session reset` |
342
- | `/cancel` / `/stop` | Stop the current task |
343
-
344
- We suggest remembering these three first:
345
-
346
- ```text
347
- /ss codex -d /absolute/path/to/repo
348
- /use <alias>
349
- /cancel
350
- ```
351
-
352
- To attach to an existing native session of a local agent such as Codex, use `/ssn codex -d /absolute/path/to/repo`; for full semantics see [docs/native-sessions.md](./docs/native-sessions.md).
353
-
354
- ### Scheduled tasks (/later)
355
-
356
- Have the agent automatically receive a message at some point in the future. **By default it runs in a temporary session created just for that task** (inheriting the agent and workspace of the current session at creation time, with a fresh conversation history, destroyed once finished); adding `--bind` sends it to the current session bound at creation time. When the time comes, the message is delivered as a normal prompt and the result is pushed back to the original chat.
357
-
358
- | Command | Description |
359
- |------|------|
360
- | `/lt <time> <message>` | Create a scheduled task (runs in a temporary session by default; `/later` is a synonym) |
361
- | `/lt --bind <time> <message>` | Send to the current session instead |
362
- | `/lt list` | List globally pending tasks |
363
- | `/lt cancel <id>` | Cancel a pending task |
364
-
365
- The most common examples:
366
-
367
- ```text
368
- /lt in 2h check whether CI passes # temporary session (default)
369
- /lt --bind tomorrow 09:00 review the PR # bound to the current session
370
- /lt list
371
- ```
139
+ | `/status` · `/cancel` | Show status · stop the current task |
140
+ | `/model` · `/mode` | Switch the LLM model · set the acpx mode |
141
+ | `/replymode stream\|verbose\|final` | Change how replies stream |
142
+ | `/lt <time> <message>` | Schedule a one-time future message ([/later](./docs/later-command.md)) |
143
+ | `/dg <agent> <task>` | Delegate a subtask to another agent |
144
+ | `/pm set read` · `/config set <path> <value>` | Permissions · whitelisted config |
372
145
 
373
- Notes:
146
+ ## Multi-agent orchestration & MCP
374
147
 
375
- - Runs in a temporary session by default; `--bind` binds to the current session. The default mode can be changed via the config `later.defaultMode` (`temp` / `bind`, default `temp`)
376
- - Only one-time tasks are supported; the time must be more than 10 seconds and within 7 days from now
377
- - The time format is a fixed whitelist (relative time / today·tomorrow·day-after-tomorrow / weekday + time); natural language is not supported
378
- - In normal conversation, the agent can also create, list, and cancel scheduled tasks via the current session's internal tools (`scheduled_create` / `scheduled_list` / `scheduled_cancel`); routing and permissions are resolved by the daemon from the current chat session, and the external `mcp-stdio` does not expose these tools
379
- - You can also manage pending tasks from the terminal with `xacpx later list` / `xacpx later cancel <id>`; the CLI only lists and cancels, it does not create scheduled tasks
380
- - For full time formats, temporary/bound modes, task status, and limits, see [docs/later-command.md](./docs/later-command.md)
148
+ The current session acts as the coordinator; delegated subtasks (`/dg`, `/tasks`,
149
+ `/task approve`) run as independent worker sessions and need human confirmation by
150
+ default. External MCP hosts such as Codex or Claude Code can drive xacpx's
151
+ orchestration directly by configuring `xacpx mcp-stdio` as a stdio MCP server
152
+ (`delegate_request` / `delegate_batch` support MCP Tasks).
381
153
 
382
- ### Config and permissions
383
-
384
- | Command | Description |
385
- |------|------|
386
- | `/config` | Show the config paths that can be changed via chat commands |
387
- | `/config set <path> <value>` | Change a whitelisted config item |
388
- | `/pm` / `/permission` | Show the current permission mode |
389
- | `/pm set allow` | Switch to `approve-all` |
390
- | `/pm set read` | Switch to `approve-reads` |
391
- | `/pm set deny` | Switch to `deny-all` |
392
- | `/pm auto` | Show the current non-interactive permission policy |
393
- | `/pm auto deny` | Switch to `deny` |
394
- | `/pm auto fail` | Switch to `fail` |
395
-
396
- The most common examples:
397
-
398
- ```text
399
- /config set wechat.replyMode final
400
- /pm set read
401
- /pm auto deny
402
- ```
403
-
404
- > `/config set language en` (or `zh`) switches the xacpx interface language; it otherwise follows your system locale. See [docs/config-reference.md](./docs/config-reference.md).
405
-
406
- ### Multi-agent orchestration
407
-
408
- The README keeps only the most common user-facing commands.
409
-
410
- | Command | Description |
411
- |------|------|
412
- | `/dg <agent> <task>` | Quickly delegate a subtask |
413
- | `/tasks` | List tasks under the current main line |
414
- | `/task <id>` | Show details of a single task |
415
- | `/task approve <id>` | Approve a `needs_confirmation` task |
416
- | `/task cancel <id>` | Cancel a task; cancelling a not-yet-approved task is equivalent to rejecting it |
417
-
418
- The most common examples:
419
-
420
- ```text
421
- /dg claude review the 3 high-risk points of the current plan
422
- /tasks
423
- /task approve task_123
424
- ```
425
-
426
- Notes:
427
-
428
- - The current session is the coordinator session
429
- - What gets delegated out are independent subtask sessions
430
- - Delegation requests initiated by the agent require human confirmation by default
431
- - If you're using an external MCP host (Codex / Claude Code), use `delegate_batch` to dispatch multiple parallel subtasks at once: pass a `tasks` array, a group is created automatically under the hood, and all results are injected back at once with no need to maintain a groupId manually
432
-
433
- If you want to first understand when to delegate and when to dispatch multiple subtasks in parallel, see:
434
-
435
- - [docs/xacpx-group-usage-guide.md](./docs/xacpx-group-usage-guide.md)
436
-
437
-
438
- ### MCP integration: external coordinator
439
-
440
- If you want external MCP hosts such as Codex or Claude Code to use xacpx's multi-agent orchestration directly, you can configure `xacpx mcp-stdio` as a stdio MCP server.
441
-
442
- `delegate_request` supports MCP Tasks: a host that supports this capability can make the delegation request return a native task handle immediately, then get status, results, or cancel the task via `tasks/get` / `tasks/result` / `tasks/cancel`; the worker's `[PROGRESS] ...` output shows up in the `statusMessage` of `tasks/get` / `tasks/list`; in the `input_required` state, `tasks/result` returns a next-step hint and ends this result stream rather than blocking for a long time; after the client calls tools such as `task_get` / `task_approve` / `coordinator_answer_question` per the hint, it continues polling `tasks/get` / `tasks/result`. A host that does not support MCP Tasks can still use the compatibility tools `task_get` / `task_list` / `task_watch` / `task_cancel`.
443
-
444
- The natural-language creation tool for scheduled tasks is an internal capability of the xacpx current session and does not appear in the external `xacpx mcp-stdio` tool list.
445
-
446
- Start the daemon first:
447
-
448
- ```bash
449
- xacpx start
450
- ```
451
-
452
- We recommend keeping the MCP config simple and not binding a workspace in the launch arguments:
453
-
454
- ```json
455
- {
456
- "mcpServers": {
457
- "xacpx": {
458
- "command": "xacpx",
459
- "args": ["mcp-stdio"]
460
- }
461
- }
462
- }
463
- ```
464
-
465
- When an external host calls `delegate_request`, pass `workingDirectory`, and xacpx will make the delegated worker work in that directory:
466
-
467
- ```json
468
- {
469
- "targetAgent": "claude",
470
- "task": "review the risks of this change",
471
- "workingDirectory": "/absolute/path/to/your/repo"
472
- }
473
- ```
474
-
475
- On Windows, if the MCP host won't resolve a `command` with arguments for you, put `node.exe` in `command` and the xacpx script and arguments in `args`:
476
-
477
- ```json
478
- {
479
- "type": "stdio",
480
- "command": "C:\\Program Files\\nodejs\\node.exe",
481
- "args": [
482
- "C:\\path\\to\\xacpx\\dist\\cli.js",
483
- "mcp-stdio"
484
- ]
485
- }
486
- ```
487
-
488
- For more identity rules, `workingDirectory` semantics, the tool list, flow diagrams, and troubleshooting, see [docs/external-mcp.md](./docs/external-mcp.md).
154
+ - When to delegate vs. open a parallel group: [xacpx-group-usage-guide.md](./docs/xacpx-group-usage-guide.md)
155
+ - External MCP setup, identity rules, tool list, troubleshooting: [external-mcp.md](./docs/external-mcp.md)
489
156
 
490
157
  ## Common scenarios
491
158
 
492
- ### Keep watching a local project from your phone
493
-
494
159
  ```text
160
+ # Keep watching a local project from your phone
495
161
  /ss codex -d /absolute/path/to/backend
496
162
  take a look at today's API timeout issue
497
- ```
498
163
 
499
- ### Switch between two projects in the same chat
500
-
501
- ```text
164
+ # Switch between two projects in the same chat
502
165
  /ss codex -d /absolute/path/to/backend
503
166
  /ss new codex -d /absolute/path/to/frontend
504
167
  /ss
505
168
  /use backend:codex
506
- /use frontend:codex
507
- ```
508
169
 
509
- ### Attach to an existing local Codex native session
510
-
511
- ```text
170
+ # Attach to an existing local Codex native session
512
171
  /ssn codex -d /absolute/path/to/backend
513
172
  /ssn 1
514
173
  ```
515
174
 
516
- For more filtering, aliases, and troubleshooting, see [docs/native-sessions.md](./docs/native-sessions.md).
517
-
518
175
  ## Self-hosted relay hub (optional)
519
176
 
520
- If you run several xacpx instances and want to drive them all from one browser dashboard, you can self-host the **relay hub**. Each instance dials out to the hub over WebSocket and registers; you log in to a multi-tenant web dashboard and manage every instance's sessions — chat, scheduled tasks, and orchestration — from one place. Streaming agent replies render as markdown, and the layout works on mobile.
521
-
522
- > Status: the relay packages are built and audited but **not yet published to npm**, so today you deploy from a source checkout. See the full guide for the exact steps.
177
+ If you run several xacpx instances and want to drive them all from one browser dashboard, you can self-host the **relay hub**. Each instance dials out to the hub over WebSocket and registers; you log in to a multi-tenant web dashboard and manage every instance's sessions — chat, scheduled tasks, and orchestration — from one place. The hub ships as an npm package (`@ganglion/xacpx-relay`) with the dashboard **bundled in**, served on a single port, with a single **access token** for both web login and connector pairing.
523
178
 
524
179
  ```bash
525
- # Build the hub server + dashboard from a repo checkout
526
- git clone https://github.com/gadzan/xacpx && cd xacpx && bun install
527
- bun run build:relay && bun run build:relay-web
528
-
529
- # Create the first admin, then start (point --web-root at the built dashboard)
530
- node packages/relay/dist/cli.js init-admin --username admin --db /var/lib/xacpx-relay/relay.db
531
- node packages/relay/dist/cli.js start --db /var/lib/xacpx-relay/relay.db \
532
- --web-root packages/relay-web/dist --host 0.0.0.0
180
+ npm i -g @ganglion/xacpx-relay
181
+ xacpx-relay add token # prints the access token once
182
+ xacpx-relay start # defaults: --host 0.0.0.0 --http-port 8787
183
+
184
+ # On each instance host:
185
+ xacpx plugin add @ganglion/xacpx-channel-relay # requires xacpx >= 0.11.0
186
+ xacpx channel add relay --url wss://relay.example.com --token <access-token> --name my-box
187
+ xacpx restart
533
188
  ```
534
189
 
535
- Full walkthrough — pairing instances, TLS/reverse-proxy, systemd, backups, troubleshooting: **[Self-Hosting the Relay Hub](https://gadzan.github.io/xacpx/guide/relay-self-hosting)** (or [docs/relay-deployment.md](./docs/relay-deployment.md) for the terse runbook).
190
+ Full walkthrough — pairing, TLS/reverse-proxy, systemd, backups, troubleshooting: **[Self-Hosting the Relay Hub](https://gadzan.github.io/xacpx/guide/relay-self-hosting)** (or [relay-deployment.md](./docs/relay-deployment.md) for the terse runbook).
536
191
 
537
192
  ## Config and runtime files
538
193
 
539
- Default file locations:
540
-
541
194
  - Config file: `~/.xacpx/config.json`
542
195
  - State file: `~/.xacpx/state.json`
543
196
  - Runtime log: `~/.xacpx/runtime/app.log`
544
197
 
545
- More runtime files are placed under `~/.xacpx/runtime/`.
546
-
547
- ## FAQ
548
-
549
- ### What if `/ss new` fails?
550
-
551
- If session creation fails in WeChat, the most common cause is not a wrong `xacpx` command format, but that the underlying session was not created successfully.
552
-
553
- You can try these two steps first:
554
-
555
- 1. Confirm in the terminal that the current project directory and the agent itself work
556
- 2. If you're familiar with `acpx`, manually create a session first, then attach to it from WeChat
557
-
558
- For example, you can create a session locally first:
559
-
560
- ```bash
561
- ./node_modules/.bin/acpx --verbose --cwd /absolute/workspace/path codex sessions new --name existing-demo
562
- ```
563
-
564
- Then attach to it from WeChat:
565
-
566
- ```text
567
- /ss attach demo -a codex --ws backend --name existing-demo
568
- ```
569
-
570
- ### What is the `<id>` in `/mode <id>`?
571
-
572
- The valid values for `/mode` depend on the agent you're currently using; `xacpx` does not normalize these values for you.
573
-
574
- Currently the more clearly known values are:
575
-
576
- - `codex`: `plan`
577
- - `cursor`: `agent`, `plan`, `ask`
578
-
579
- If you're unsure whether a value works, check the corresponding agent's docs first; if you get it wrong, you'll usually get an error such as an invalid argument.
198
+ More runtime files are placed under `~/.xacpx/runtime/`. For the full config field reference, see [config-reference.md](./docs/config-reference.md).
580
199
 
581
200
  ## Running from source
582
201
 
583
- If you're using the repo source directly:
584
-
585
202
  ```bash
586
203
  bun install
587
204
  bun run login
588
205
  bun run dev
589
206
  ```
590
207
 
591
- ## More docs
592
-
593
- If what you're about to do is one of the following, you can continue from here:
594
-
595
- ### Installation and configuration
596
-
597
- - Want to configure WeChat, Feishu, Yuanbao, or a third-party plugin channel: [docs/channel-management.md](./docs/channel-management.md)
598
- - Want to write your own channel plugin: [docs/plugin-development.md](./docs/plugin-development.md)
599
- - Want the full config field reference: [docs/config-reference.md](./docs/config-reference.md)
600
- - Want to change config from WeChat: [docs/config-command.md](./docs/config-command.md)
208
+ For development, debugging, and contribution details, see [developments.md](./docs/developments.md).
601
209
 
602
- ### Everyday use
603
-
604
- - Want the full chat-command reference: [docs/commands.md](./docs/commands.md)
605
- - Want to schedule a one-time future message with scheduled tasks (`/later`): [docs/later-command.md](./docs/later-command.md)
606
- - Want to understand when to delegate and when to open a group: [docs/xacpx-group-usage-guide.md](./docs/xacpx-group-usage-guide.md)
607
-
608
- ### Troubleshooting and verification
609
-
610
- - Want to run tests or understand the test layout: [docs/testing.md](./docs/testing.md)
611
-
612
- ### Development and contribution
210
+ ## More docs
613
211
 
614
- - Want to develop, debug, or contribute from source: [docs/developments.md](./docs/developments.md)
212
+ **Install & configure**
213
+ - [channel-management.md](./docs/channel-management.md) — configure WeChat / Feishu / Yuanbao / third-party channels
214
+ - [plugin-development.md](./docs/plugin-development.md) — write your own channel plugin
215
+ - [config-reference.md](./docs/config-reference.md) — full config field reference
216
+ - [config-command.md](./docs/config-command.md) — change config from chat
217
+
218
+ **Everyday use**
219
+ - [cli-reference.md](./docs/cli-reference.md) — full terminal CLI reference
220
+ - [commands.md](./docs/commands.md) — full chat-command reference
221
+ - [later-command.md](./docs/later-command.md) — scheduled tasks (`/later`)
222
+ - [native-sessions.md](./docs/native-sessions.md) — attach to a local agent's native session
223
+ - [xacpx-group-usage-guide.md](./docs/xacpx-group-usage-guide.md) — when to delegate vs. open a group
224
+ - [external-mcp.md](./docs/external-mcp.md) — external MCP coordinator integration
225
+
226
+ **Troubleshoot & verify**
227
+ - [faq.md](./docs/faq.md) — common questions (`/ss new` fails, `/mode <id>`, …)
228
+ - [doctor-command.md](./docs/doctor-command.md) — `xacpx doctor` diagnostics and `--fix`
229
+ - [testing.md](./docs/testing.md) — test layout and how to run tests
230
+
231
+ **Develop & contribute**
232
+ - [developments.md](./docs/developments.md) — develop, debug, or contribute from source
233
+ - [code-wiki.md](./docs/code-wiki.md) — architecture map