zcode-acp-server 0.21.4 → 0.23.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.
Files changed (70) hide show
  1. package/README.md +6 -7
  2. package/dist/cli.d.ts +8 -5
  3. package/dist/cli.d.ts.map +1 -1
  4. package/dist/cli.js +22 -14
  5. package/dist/cli.js.map +1 -1
  6. package/dist/config/user-config.d.ts +48 -0
  7. package/dist/config/user-config.d.ts.map +1 -0
  8. package/dist/config/user-config.js +101 -0
  9. package/dist/config/user-config.js.map +1 -0
  10. package/dist/handlers/session.d.ts +33 -3
  11. package/dist/handlers/session.d.ts.map +1 -1
  12. package/dist/handlers/session.js +152 -9
  13. package/dist/handlers/session.js.map +1 -1
  14. package/dist/i18n.d.ts +2 -0
  15. package/dist/i18n.d.ts.map +1 -1
  16. package/dist/i18n.js +2 -0
  17. package/dist/i18n.js.map +1 -1
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +2 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/remote/config.d.ts +36 -24
  22. package/dist/remote/config.d.ts.map +1 -1
  23. package/dist/remote/config.js +70 -36
  24. package/dist/remote/config.js.map +1 -1
  25. package/dist/remote/hub-server.d.ts +24 -13
  26. package/dist/remote/hub-server.d.ts.map +1 -1
  27. package/dist/remote/hub-server.js +78 -63
  28. package/dist/remote/hub-server.js.map +1 -1
  29. package/dist/server.d.ts +22 -0
  30. package/dist/server.d.ts.map +1 -1
  31. package/dist/server.js +25 -0
  32. package/dist/server.js.map +1 -1
  33. package/dist/tui.d.ts +38 -0
  34. package/dist/tui.d.ts.map +1 -0
  35. package/dist/tui.js +96 -0
  36. package/dist/tui.js.map +1 -0
  37. package/dist/utils.d.ts +8 -0
  38. package/dist/utils.d.ts.map +1 -1
  39. package/dist/utils.js +10 -0
  40. package/dist/utils.js.map +1 -1
  41. package/docs/CLI.md +33 -76
  42. package/docs/REMOTE-CLIENTS.md +26 -20
  43. package/docs/REMOTE.md +62 -23
  44. package/docs/TROUBLESHOOTING.md +5 -1
  45. package/docs/adr/0007-unified-cli-entry-and-bin-pruning.md +2 -0
  46. package/package.json +3 -7
  47. package/dist/repl/App.d.ts +0 -108
  48. package/dist/repl/App.d.ts.map +0 -1
  49. package/dist/repl/App.js +0 -732
  50. package/dist/repl/App.js.map +0 -1
  51. package/dist/repl/history.d.ts +0 -25
  52. package/dist/repl/history.d.ts.map +0 -1
  53. package/dist/repl/history.js +0 -73
  54. package/dist/repl/history.js.map +0 -1
  55. package/dist/repl/hub.d.ts +0 -87
  56. package/dist/repl/hub.d.ts.map +0 -1
  57. package/dist/repl/hub.js +0 -188
  58. package/dist/repl/hub.js.map +0 -1
  59. package/dist/repl/input-buffer.d.ts +0 -77
  60. package/dist/repl/input-buffer.d.ts.map +0 -1
  61. package/dist/repl/input-buffer.js +0 -174
  62. package/dist/repl/input-buffer.js.map +0 -1
  63. package/dist/repl/model.d.ts +0 -312
  64. package/dist/repl/model.d.ts.map +0 -1
  65. package/dist/repl/model.js +0 -674
  66. package/dist/repl/model.js.map +0 -1
  67. package/dist/repl/run.d.ts +0 -12
  68. package/dist/repl/run.d.ts.map +0 -1
  69. package/dist/repl/run.js +0 -1245
  70. package/dist/repl/run.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC/F,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,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).
3
+ *
4
+ * Bare `zcode-acp` spawns the bundled Martty terminal client (npm `martty`:
5
+ * a Node wrapper selecting a per-platform Rust binary from its vendor/ dir)
6
+ * with this package wired in as its ACP agent:
7
+ *
8
+ * martty --agent <node> --agent-arg <dist/index.js>
9
+ *
10
+ * Martty owns the UI; this package stays the protocol bridge. The launcher
11
+ * shares stdio with the child and inherits the environment, and Martty passes
12
+ * its environment through to the spawned agent (verified) — the hub's
13
+ * ZCODE_ACP_RESUME_SESSION boot-resume target (ADR-0017) reaches the bridge,
14
+ * where session/new serves it as a session/load.
15
+ */
16
+ /** Path to Martty's Node wrapper (bin/martty.js), or null when not installed. */
17
+ export declare function resolveMarttyJs(): string | null;
18
+ /** Absolute path of this package's ACP agent entry (dist/index.js). */
19
+ export declare function agentEntryJs(): string;
20
+ /**
21
+ * Martty argv (after the wrapper script) wiring the bridge in as its agent.
22
+ * `process.execPath` avoids PATH/shebang differences across platforms.
23
+ * Pure — exported for unit tests.
24
+ */
25
+ export declare function buildTuiArgs(agentJs: string): string[];
26
+ /**
27
+ * Run the interactive Martty TUI in this terminal. Resolves when Martty exits
28
+ * and mirrors its exit code. Signals aimed at this process are forwarded so a
29
+ * SIGTERM from a supervisor reaches the TUI too (terminal ctrl+c already hits
30
+ * the whole foreground process group).
31
+ */
32
+ export declare function runTui(): Promise<void>;
33
+ /**
34
+ * Headless wiring check (CI / smoke): Martty spawns the bridge, runs the ACP
35
+ * initialize handshake, prints agent info, and exits. True on exit 0.
36
+ */
37
+ export declare function checkTuiRuntime(): Promise<boolean>;
38
+ //# sourceMappingURL=tui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tui.d.ts","sourceRoot":"","sources":["../src/tui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAUH,iFAAiF;AACjF,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAS/C;AAED,uEAAuE;AACvE,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAEtD;AAED;;;;;GAKG;AACH,wBAAsB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAU5C;AAED;;;GAGG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,CAYxD"}
package/dist/tui.js ADDED
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Martty TUI launcher — the interactive CLI surface (ADR-0020).
3
+ *
4
+ * Bare `zcode-acp` spawns the bundled Martty terminal client (npm `martty`:
5
+ * a Node wrapper selecting a per-platform Rust binary from its vendor/ dir)
6
+ * with this package wired in as its ACP agent:
7
+ *
8
+ * martty --agent <node> --agent-arg <dist/index.js>
9
+ *
10
+ * Martty owns the UI; this package stays the protocol bridge. The launcher
11
+ * shares stdio with the child and inherits the environment, and Martty passes
12
+ * its environment through to the spawned agent (verified) — the hub's
13
+ * ZCODE_ACP_RESUME_SESSION boot-resume target (ADR-0017) reaches the bridge,
14
+ * where session/new serves it as a session/load.
15
+ */
16
+ import { spawn } from "node:child_process";
17
+ import { createRequire } from "node:module";
18
+ import path from "node:path";
19
+ import process from "node:process";
20
+ import { fileURLToPath } from "node:url";
21
+ import { warn } from "./utils.js";
22
+ /** Path to Martty's Node wrapper (bin/martty.js), or null when not installed. */
23
+ export function resolveMarttyJs() {
24
+ try {
25
+ // "./bin/martty.js" is outside Martty's exports map, so resolve the
26
+ // package.json (always exported) and walk into the package dir.
27
+ const pkgJson = createRequire(import.meta.url).resolve("martty/package.json");
28
+ return path.join(path.dirname(pkgJson), "bin", "martty.js");
29
+ }
30
+ catch {
31
+ return null;
32
+ }
33
+ }
34
+ /** Absolute path of this package's ACP agent entry (dist/index.js). */
35
+ export function agentEntryJs() {
36
+ return fileURLToPath(new URL("./index.js", import.meta.url));
37
+ }
38
+ /**
39
+ * Martty argv (after the wrapper script) wiring the bridge in as its agent.
40
+ * `process.execPath` avoids PATH/shebang differences across platforms.
41
+ * Pure — exported for unit tests.
42
+ */
43
+ export function buildTuiArgs(agentJs) {
44
+ return ["--agent", process.execPath, "--agent-arg", agentJs];
45
+ }
46
+ /**
47
+ * Run the interactive Martty TUI in this terminal. Resolves when Martty exits
48
+ * and mirrors its exit code. Signals aimed at this process are forwarded so a
49
+ * SIGTERM from a supervisor reaches the TUI too (terminal ctrl+c already hits
50
+ * the whole foreground process group).
51
+ */
52
+ export async function runTui() {
53
+ const marttyJs = resolveMarttyJs();
54
+ if (!marttyJs) {
55
+ throw new Error("martty is not installed — reinstall the zcode-acp-server package");
56
+ }
57
+ const child = spawn(process.execPath, [marttyJs, ...buildTuiArgs(agentEntryJs())], {
58
+ stdio: "inherit",
59
+ });
60
+ const code = await settle(child);
61
+ if (code !== 0)
62
+ process.exitCode = code ?? 1;
63
+ }
64
+ /**
65
+ * Headless wiring check (CI / smoke): Martty spawns the bridge, runs the ACP
66
+ * initialize handshake, prints agent info, and exits. True on exit 0.
67
+ */
68
+ export async function checkTuiRuntime() {
69
+ const marttyJs = resolveMarttyJs();
70
+ if (!marttyJs) {
71
+ warn("tui: martty is not installed — reinstall the zcode-acp-server package");
72
+ return false;
73
+ }
74
+ const child = spawn(process.execPath, [marttyJs, "--check-runtime", ...buildTuiArgs(agentEntryJs())], { stdio: "inherit" });
75
+ return (await settle(child)) === 0;
76
+ }
77
+ /** Resolve on child exit; forward terminal signals while it runs. */
78
+ function settle(child) {
79
+ return new Promise((resolve) => {
80
+ const forward = (sig) => child.kill(sig);
81
+ process.on("SIGINT", forward);
82
+ process.on("SIGTERM", forward);
83
+ child.once("exit", (code) => {
84
+ process.off("SIGINT", forward);
85
+ process.off("SIGTERM", forward);
86
+ resolve(code);
87
+ });
88
+ child.once("error", (err) => {
89
+ process.off("SIGINT", forward);
90
+ process.off("SIGTERM", forward);
91
+ warn(`tui: failed to start martty: ${err.message}`);
92
+ resolve(1);
93
+ });
94
+ });
95
+ }
96
+ //# sourceMappingURL=tui.js.map
@@ -0,0 +1 @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AQ,EAAE,OAAO,CAAC,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAChC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YAC1B,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAChC,IAAI,CAAC,gCAAgC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;YACpD,OAAO,CAAC,CAAC,CAAC,CAAC;QACb,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
package/dist/utils.d.ts CHANGED
@@ -120,6 +120,14 @@ export declare const CONFIG_DISPATCH: Record<string, {
120
120
  export declare function log(msg: string): void;
121
121
  /** Warning — always emitted. For perceivable failures. */
122
122
  export declare function warn(msg: string): void;
123
+ /**
124
+ * Stable identity of an ACP client connection. Each request wraps the
125
+ * connection in a fresh AgentContext, so the wrappers never compare equal —
126
+ * `connectionContext` is the SDK's per-connection root (public at runtime,
127
+ * @internal in the typings, hence the cast). `ctx.client` from a handler is
128
+ * one such wrapper; two requests from the same editor/TUI/app share the root.
129
+ */
130
+ export declare function clientConnectionRoot(client?: unknown): unknown;
123
131
  /**
124
132
  * Compare two semver-like version strings numerically (e.g. "10.0.0" > "2.0.0").
125
133
  * Falls back to lexicographic comparison for non-numeric segments. Used by
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,+CAA+C;AAC/C,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAmBlC,4DAA4D;AAC5D,eAAO,MAAM,UAAU;;;;CAIb,CAAC;AAEX,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB,QAK5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;;;;;;;;;;;;;;;;;;;;;CA0B/C,CAAC;AAEX,iGAAiG;AACjG,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAGhF,CAAC;AAoBF,qEAAqE;AACrE,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAGrC;AAED,0DAA0D;AAC1D,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEtC;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAE9D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAmB5D"}
package/dist/utils.js CHANGED
@@ -134,6 +134,16 @@ export function log(msg) {
134
134
  export function warn(msg) {
135
135
  process.stderr.write(`[zcode-acp] ${msg}\n`);
136
136
  }
137
+ /**
138
+ * Stable identity of an ACP client connection. Each request wraps the
139
+ * connection in a fresh AgentContext, so the wrappers never compare equal —
140
+ * `connectionContext` is the SDK's per-connection root (public at runtime,
141
+ * @internal in the typings, hence the cast). `ctx.client` from a handler is
142
+ * one such wrapper; two requests from the same editor/TUI/app share the root.
143
+ */
144
+ export function clientConnectionRoot(client) {
145
+ return client?.connectionContext;
146
+ }
137
147
  /**
138
148
  * Compare two semver-like version strings numerically (e.g. "10.0.0" > "2.0.0").
139
149
  * Falls back to lexicographic comparison for non-numeric segments. Used by
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAA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AE,CAAC;YACzC,oDAAoD;YACpD,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,EAAE,KAAK,EAAE;YAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAChC,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
package/docs/CLI.md CHANGED
@@ -3,91 +3,48 @@
3
3
  Every surface of this package is available under one command — `zcode-acp` —
4
4
  installed alongside the `zcode-acp-server` bin your editor configures.
5
5
 
6
- ## Interactive REPL
6
+ ## Interactive TUI
7
7
 
8
- Bare `zcode-acp` opens an interactive terminal chat against this same bridge
9
- (built with [Ink](https://github.com/vadimdemedes/ink), the same renderer
10
- Claude Code and Gemini CLI use). Completed messages print once into the
11
- terminal's **native scrollback** — smooth wheel scrolling, text selection,
12
- search, and history that survives exit are all just your terminal, unchanged.
13
- Only a compact dynamic footer ever repaints: the live-turn tail (capped at
14
- half the screen), queued-prompt panel, completion menu, and the prompt box.
8
+ Bare `zcode-acp` opens an interactive terminal chat against this same bridge,
9
+ powered by [Martty](https://github.com/openma-ai/Martty) — a terminal-native
10
+ ACP client bundled as a dependency (ADR-0020). The in-house Ink REPL it
11
+ replaced was removed entirely; the CLI surface is Martty + this bridge, on
12
+ every platform including Windows.
15
13
 
16
14
  ```bash
17
15
  zcode-acp # chat in this directory
16
+ zcode-acp tui # same thing, explicit
18
17
  ```
19
18
 
20
- A startup welcome panel (version, session directory, seeded config, key
21
- hints) lands in scrollback first. Streaming output has code-fence coloring,
22
- dim thinking lines, and live tool rows. The prompt line wraps across rows
23
- with a CJK-aware block cursor — `←`/`→` (or Ctrl-B/Ctrl-F) move inside the
24
- typed text, Backspace/Delete edit at the caret, Ctrl-A/Ctrl-E jump to the
25
- line's ends, Ctrl-U clears the line; completion keeps precedence while its
26
- menu is open. The status row carries a compact plan-quota readout
27
- (`5h 16% · wk 4%`) refreshed every 10 minutes — `/quota` prints the full
28
- card. Pasted or dragged-in content (error logs, file drops) is sanitized and
29
- size-capped before it reaches the editor, so long pastes batch cleanly.
30
- `esc` interrupts a running turn (immediately — the bridge resolves the prompt
31
- as cancelled without waiting for the backend); `Ctrl-C` also interrupts, and
32
- while idle press it twice to quit. `/exit` (or a bare `exit`, shell-style)
33
- leaves; the session itself persists
34
- in the ZCode backend and is available to your editor.
35
-
36
- Sending a follow-up right after an interrupt waits for the backend to finish
37
- the cancelled generation first — a `[上一个回复仍在生成,等待结束后发送…]`
38
- note explains the pause (the Aug-28 app-server accepts mid-generation sends
39
- as steer input but drops them when the old turn ends; the bridge polls until
40
- the session is idle, up to 90s, so the message actually runs).
41
-
42
- Messages typed while a turn is running (or the session is still starting) are
43
- queued, not lost: each shows up in the transcript immediately and a `⏸ queued`
44
- panel above the prompt box lists everything waiting to run. When the current
45
- turn ends the queue drains one prompt at a time — through the same command
46
- parsing as direct submits, so queued `/help` and `/exit` still work.
47
-
48
- `/sessions` lists this project's previous conversations in an 8-row sliding
49
- window (position counter, plus "N newer above / N older below" hints); arrow
50
- keys move over the full list even though only part of it renders. Resuming
51
- loads the most recent tail of the conversation (last 50 messages, turn-aligned)
52
- instead of dumping thousands of lines at once — when older history exists the
53
- note says exactly what was loaded:
54
- `resumed "<title>" — showing last 50 of 1234 messages`.
55
-
56
- The full-width prompt box mirrors the editor's dropdowns: its bottom row shows
57
- the current `model · mode · thought level`, and typing `/` opens an interactive
58
- completion menu — `↑`/`↓` move, `enter` picks the highlighted entry (or `tab` /
59
- `→`; typing the exact form already sends), `esc` dismisses. After picking
60
- `/model`, `/mode`, or `/thought` the same menu lists the config options (the
61
- current one marked `●`) and **enter on a row switches immediately** — no second
62
- confirmation. Argument-free commands (`/exit`, `/help`, `/sessions`, `/new`,
63
- `/compact`, `/mcp`, `/quota`) run on pick as well; every other completion
64
- (skills, plugins) only fills the line, since those usually expect arguments.
65
- The arg-less forms still print a static listing over the same slash-command
66
- path the editor uses. `/help` lists every command the bridge advertises,
67
- including plugin commands. `/new` swaps in a fresh session without leaving
68
- the terminal (the old conversation stays in `/sessions` and in scrollback).
69
-
70
- Submitted prompts are history: `↑`/`↓` (with the completion menu closed)
71
- recall them per project across restarts — the first `↑` stashes the draft
72
- and `↓` past the newest entry restores it. Pasted text folds to a single
73
- line (newlines and tabs become spaces), so a multi-paragraph paste lands in
74
- the box as one prompt instead of firing line-by-line. While a reply streams,
75
- the footer shows a live status row — `⠋ working… (12s · esc to interrupt)` —
76
- so stretches with no streamed output (long tool calls) still visibly tick.
77
-
78
- Unexpected internal errors never take the REPL down silently: they print to
79
- stderr and surface as an `-- error absorbed: …` note in the transcript while
80
- everything keeps running. Only repeated failures within ten seconds trip a
81
- breaker that shuts the UI down cleanly.
82
-
83
- While remote access is enabled, turns started from other clients (the mobile
84
- app, a second editor) render live in the REPL too, and questions or permission
85
- requests answered elsewhere dismiss the local picker automatically.
19
+ The TUI is a full ACP client: streaming output with markdown rendering, tool
20
+ rows that expand/collapse on click, a model picker (`Ctrl-P`), queueing
21
+ (`enter` queues, `Ctrl-Enter` steers the running turn), `!` shell escapes,
22
+ themes (`Ctrl-T`), and native mouse support (wheel scroll, click-select,
23
+ drag-copy). `/resume` lists this project's previous conversations (from the
24
+ bridge's `session/list`) and loads one; `/new` starts fresh. Keys: `esc`
25
+ interrupts a turn and clears the draft, `Ctrl-C` clears then quits, `↑`
26
+ recalls history. `/help` inside the TUI lists everything.
27
+
28
+ Two Martty behaviors worth knowing:
29
+
30
+ - **Resumed sessions keep their context but not their on-screen history.**
31
+ A fresh TUI boot starts a new `session/new`, and `/resume` uses ACP
32
+ `session/resume` — which by protocol design carries no message history —
33
+ so attaching to a session created elsewhere (the editor, the phone app, a
34
+ previous remote window) starts a visually empty transcript (the status
35
+ line notes `resumed <id> — previous transcript was not replayed`). The
36
+ conversation itself is live: your next prompt runs with the full history
37
+ in the backend.
38
+ - **Sessions persist in the ZCode backend** like every other client of this
39
+ bridge — close the TUI any time; the conversation stays available to your
40
+ editor and to `/resume`.
86
41
 
87
42
  Without a TTY (pipes, Windows editor shims — where the bin name is lost from
88
43
  `argv`), bare `zcode-acp` falls back to the stdio server, so editor configs
89
- pointing at either bin name keep working. Ask for the REPL explicitly with
90
- `zcode-acp repl`; without a TTY that errors instead of falling back.
44
+ pointing at either bin name keep working. Ask for the TUI explicitly with
45
+ `zcode-acp tui`; without a TTY that errors instead of falling back.
46
+ `zcode-acp tui --check` runs a headless wiring check (spawn + initialize
47
+ handshake) — that is what CI smoke-tests.
91
48
 
92
49
  ## Quota cards
93
50
 
@@ -46,18 +46,18 @@ ACP editor ────── stdio ──────────┘
46
46
 
47
47
  ## Discovery API
48
48
 
49
- | Endpoint | Auth | Purpose |
50
- | ------------------------------------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
51
- | `GET /api/health` | none | Liveness probe; `200` body `ok`. |
52
- | `GET /api/instances` | required | Registered bridge instances. Add `?probe=1` to verify first. |
53
- | `GET /api/instances/{id}/status` | required | Real-time per-session running status of one bridge. |
54
- | `POST /api/instances/{id}/sessions/{sessionId}/close` | required | Retire a session from remote discovery — see [Closing a session](#closing-a-session). |
55
- | `POST /api/instances/{id}/sessions/{sessionId}/rename` | required | Rename a session — see [Renaming a session](#renaming-a-session). |
56
- | `GET /api/quota` | required | Account-level usage stats — same payload as `account/usage_stats`, no ACP connection needed. |
57
- | `POST /api/upgrade` | required | Trigger the hub's own staleness check — see [Hub self-upgrade](#hub-self-upgrade). |
58
- | `GET /api/projects` | required | Known-project list (remote session-create whitelist) — see below. |
59
- | `GET /api/projects/sessions?workspacePath=` | required | A project's full session store incl. closed ones — see [Resuming a closed session](#resuming-a-closed-session). |
60
- | `POST /api/instances {workspacePath[, sessionId]}` | required | Create a bridge for one known project — a visible terminal REPL (session-create) or one that boots into a closed session (resume, `sessionId`) — see below. |
49
+ | Endpoint | Auth | Purpose |
50
+ | ------------------------------------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
51
+ | `GET /api/health` | none | Liveness probe; `200` body `ok`. |
52
+ | `GET /api/instances` | required | Registered bridge instances. Add `?probe=1` to verify first. |
53
+ | `GET /api/instances/{id}/status` | required | Real-time per-session running status of one bridge. |
54
+ | `POST /api/instances/{id}/sessions/{sessionId}/close` | required | Retire a session from remote discovery — see [Closing a session](#closing-a-session). |
55
+ | `POST /api/instances/{id}/sessions/{sessionId}/rename` | required | Rename a session — see [Renaming a session](#renaming-a-session). |
56
+ | `GET /api/quota` | required | Account-level usage stats — same payload as `account/usage_stats`, no ACP connection needed. |
57
+ | `POST /api/upgrade` | required | Trigger the hub's own staleness check — see [Hub self-upgrade](#hub-self-upgrade). |
58
+ | `GET /api/projects` | required | Known-project list (remote session-create whitelist) — see below. |
59
+ | `GET /api/projects/sessions?workspacePath=` | required | A project's full session store incl. closed ones — see [Resuming a closed session](#resuming-a-closed-session). |
60
+ | `POST /api/instances {workspacePath[, sessionId]}` | required | Create a bridge for one known project — a visible terminal TUI window (session-create) or one that boots into a closed session (resume, `sessionId`) — see below. |
61
61
 
62
62
  HTTP auth: `Authorization: Bearer <token>` or `?token=<token>`.
63
63
 
@@ -161,7 +161,7 @@ POST {hub}/api/instances body {"workspacePath":"/Users/me/proj"}
161
161
  bound, not a security boundary: a token holder can already run any
162
162
  editor-bridge session in an arbitrary cwd; the trust boundary is the
163
163
  token itself.
164
- - On create the hub incubates a VISIBLE interactive REPL in the machine's
164
+ - On create the hub incubates a VISIBLE interactive TUI (Martty) in the machine's
165
165
  terminal (ADR-0016, macOS): the project's owner gets a real local CLI
166
166
  window, and its bridge registers with the hub like any serve instance (it
167
167
  appears in `/api/instances` with `origin:"serve"` — allow up to ~20s for
@@ -190,7 +190,7 @@ POST {hub}/api/instances body {"workspacePath":"/Users/me/proj"}
190
190
  spawn instead of racing a duplicate. A client that wants a HEADLESS attach
191
191
  should not POST at all — attach to the instance id the history listing
192
192
  already returns.
193
- - Lifetime depends on the surface: a terminal-REPL instance lives while its
193
+ - Lifetime depends on the surface: a terminal-TUI instance lives while its
194
194
  window lives (the owner closing it retires the bridge — re-create on
195
195
  demand); the headless fallback exists for remote interest only and exits
196
196
  ~10 minutes after the last client detaches AND the last running turn
@@ -249,16 +249,22 @@ POST {hub}/api/instances body {"workspacePath":"/Users/me/proj",
249
249
  replays and the conversation continues with `session/prompt`, entirely in
250
250
  the client. A cold project (no listing yet) lists first — the listing IS
251
251
  the headless incubator.
252
- - **Resume on the desktop (ADR-0017)**: `POST /api/instances` with the
253
- `sessionId` too — the hub incubates a VISIBLE terminal REPL that boots
254
- straight into that conversation (history replays in the window; the same
252
+ - **Resume on the desktop (ADR-0017, amended by ADR-0020)**: `POST
253
+ /api/instances` with the `sessionId` too — the hub incubates a VISIBLE
254
+ terminal TUI window that boots straight into that conversation (the same
255
255
  terminal/`ZCODE_ACP_HUB_TERMINAL` selection and headless fallback as
256
- session-create). This happens EVEN when a serve bridge is already live
256
+ session-create). The window lands on the right session AND shows the previous
257
+ transcript: the bridge serves the boot `session/new` as a load of the target
258
+ id, replays a chunk-formatted history tail after the response (Martty folds
259
+ those), and incubates the window with a `DSH_TUI_AUTOPROMPT` trigger that
260
+ Martty auto-submits at boot — dropping its welcome banner, which would
261
+ otherwise cover the transcript until the user's first message — and the
262
+ bridge answers with a one-line ack instead of a model turn. This happens EVEN when a serve bridge is already live
257
263
  (the listing incubated one) — the answer is always the NEW instance, the
258
264
  bridge the window runs on; attach to it and `session/load` the same id to
259
265
  follow along in the client (both surfaces then share one bridge, one
260
- backend process). A bogus id still opens the window: the REPL shows the
261
- load failure and falls back to a fresh session. Resuming the same session
266
+ backend process). A bogus id still opens the window: the bridge logs the
267
+ load failure and starts a fresh session instead. Resuming the same session
262
268
  twice pops two windows; only identical concurrent requests share one
263
269
  incubation.
264
270
  - `sessionId` here is the backend store id (`sess_…`), which `session/load`
package/docs/REMOTE.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Remote Access
2
2
 
3
- With `ZCODE_ACP_REMOTE=1` the bridge additionally accepts ACP connections over
4
- WebSocket, so a phone or browser can watch and drive the **same sessions** as
5
- your editor. Zed (or any ACP editor over stdio) remains the primary client and
6
- owns the process: when the editor disconnects, the bridge — and every remote
7
- attachment — exits with it.
3
+ With remote access enabled the bridge additionally accepts ACP connections
4
+ over WebSocket, so a phone or browser can watch and drive the **same
5
+ sessions** as your editor. Zed (or any ACP editor over stdio) remains the
6
+ primary client and owns the process: when the editor disconnects, the bridge —
7
+ and every remote attachment — exits with it.
8
8
 
9
9
  A ready-made client — Android APK plus a self-hostable web build — lives at
10
10
  [william0wang/zcode-acp-remote](https://github.com/william0wang/zcode-acp-remote).
@@ -18,8 +18,45 @@ phone / browser ──WS── tunnel ── hub (127.0.0.1:8377, single entry)
18
18
  Zed ──────── stdio ────────────────┘
19
19
  ```
20
20
 
21
- Enable it per-agent in Zed's settings (Zed merges these into the agent's
22
- environment):
21
+ ## Configuration
22
+
23
+ Remote access is opt-in and requires a token (the endpoint is expected to sit
24
+ behind a public tunnel, so "loopback-only" is never a safe assumption). The
25
+ authoritative source is the global user config file — every bridge, the hub
26
+ daemon and hub-spawned terminal windows read the same file, so behaviour does
27
+ not depend on which process happened to spawn what:
28
+
29
+ `~/.config/zcode-acp/config.json` (`$XDG_CONFIG_HOME` aware):
30
+
31
+ ```json
32
+ {
33
+ "remote": {
34
+ "enabled": true,
35
+ "token": "<a-long-random-secret>",
36
+ "hubPort": 8377,
37
+ "hubHost": "127.0.0.1",
38
+ "bridgePort": 8378,
39
+ "terminal": { "app": "iTerm" }
40
+ }
41
+ }
42
+ ```
43
+
44
+ All fields are optional. Precedence per field: **config file → environment
45
+ variable → built-in default.** The env vars (`ZCODE_ACP_REMOTE`,
46
+ `ZCODE_ACP_REMOTE_TOKEN`, `ZCODE_ACP_HUB_PORT`, `ZCODE_ACP_HUB_HOST`,
47
+ `ZCODE_ACP_REMOTE_PORT`, `ZCODE_ACP_HUB_TERMINAL*`) keep their semantics and
48
+ fill any gap the file leaves, so existing env-only setups keep working.
49
+
50
+ Why a file: the hub is a detached daemon that idle-exits (~10 min) and is
51
+ re-spawned by whichever bridge needs it next — its birth env rotates between
52
+ GUI-launched editors (no shell vars) and interactive shells, so env-carried
53
+ preferences drifted with every rebirth. Terminal preferences are re-read
54
+ live at every remote incubation: edit the file, the next session-create uses
55
+ it, no hub restart. Token/port changes apply when the hub is next (re)born —
56
+ rotate while no hub is running, or kill it and let the next bridge re-spawn.
57
+
58
+ Alternatively, enable it per-agent in Zed's settings (Zed merges these into
59
+ the agent's environment — no config file needed):
23
60
 
24
61
  ```json
25
62
  "agents": {
@@ -73,20 +110,26 @@ directories filtered out), newest activity first. The list gates the POST —
73
110
  paths outside it get 403 (a convenience bound, not a security boundary: a
74
111
  token holder can already drive an editor-bridge session in any cwd; the
75
112
  trust boundary is the token). On create the hub incubates a VISIBLE
76
- interactive REPL in the machine's terminal (ADR-0016, macOS; headless/SSH or
77
- `ZCODE_ACP_HUB_TERMINAL=0` falls back to the detached headless
113
+ interactive TUI window in the machine's terminal (ADR-0016 as amended by
114
+ ADR-0020, macOS; headless/SSH, `remote.terminal.enabled: false` in the config
115
+ file, or `ZCODE_ACP_HUB_TERMINAL=0` falls back to the detached headless
78
116
  `zcode-acp serve`); its bridge registers back within seconds (budget ~20s)
79
117
  and is reachable like any other instance. The hub itself is a background
80
118
  process with no terminal, so nothing is auto-detected: the target terminal
81
- resolves as `ZCODE_ACP_HUB_TERMINAL_COMMAND` → `ZCODE_ACP_HUB_TERMINAL_APP`
82
- (built-in launch recipes for Terminal, iTerm, WezTerm, kitty, Alacritty,
119
+ resolves as `remote.terminal.command` → `remote.terminal.app` from the config
120
+ file (re-read live at every incubation; the `ZCODE_ACP_HUB_TERMINAL_COMMAND`
121
+ → `ZCODE_ACP_HUB_TERMINAL_APP` env vars fill in when the file is silent —
122
+ built-in launch recipes for Terminal, iTerm, WezTerm, kitty, Alacritty,
83
123
  Ghostty; other names pass through to `open -a`) → plain Terminal.app. Warp
84
- cannot execute scripts or commands programmatically (warpdotdev/warp#1917,
85
- #3959) and is deliberately unsupported — it degrades to the headless bridge.
124
+ refuses `.command` files, so `terminal.app: "warp"` (or `"warp-preview"`)
125
+ instead opens `warp://action/new_tab?path=<script>` — its URI scheme executes
126
+ the script as a new tab in Warp's default mode (app/src/uri/mod.rs →
127
+ open_file). Hyper stays unsupported (no programmatic command execution,
128
+ vercel/hyper#3677).
86
129
  Create NEVER reuses a live serve-origin instance (ADR-0016 as amended) —
87
130
  every create incubates its own window, and identical concurrent requests
88
131
  join the same in-flight spawn. A
89
- terminal-REPL instance lives while its window lives; the headless fallback
132
+ terminal-TUI instance lives while its window lives; the headless fallback
90
133
  exits ~10 minutes after the last client detaches and the last turn
91
134
  finishes. Session roots are pinned to the project cwd in both surfaces
92
135
  regardless of what a client sends.
@@ -110,15 +153,11 @@ editor uses — attaching by id joins the conversation's live notification
110
153
  stream, and the hub dedupes sessions shared by several bridges of the same
111
154
  project.
112
155
 
113
- **The local REPL is a hub client too** (ADR-0018). Bare `zcode-acp` in a
114
- shell with the hub env (`ZCODE_ACP_REMOTE_TOKEN` + `ZCODE_ACP_HUB_PORT`)
115
- merges sessions that are live on hub instances into its `/sessions` picker
116
- (marked `live`, `●` while a turn runs) and attaches to them through the hub's
117
- WS proxy as a second ACP client — replay on attach, then live updates, so a
118
- conversation being driven from the phone advances on the desktop in real
119
- time. Without a hub configured or reachable, the picker and resumes behave
120
- exactly as before. Attaching never touches the owning bridge: leaving the
121
- REPL (or `/new`) only detaches this client.
156
+ **The local TUI used to be a hub client too** (ADR-0018, removed with the
157
+ in-house REPL by ADR-0020). The Martty TUI boots its own bridge per window
158
+ and does not merge hub-live sessions into its picker; watching a session
159
+ driven from another client stays a remote-App capability (the hub's WS proxy
160
+ and the `/api` surface are unchanged).
122
161
 
123
162
  Auth is `Authorization: Bearer <token>` or `?token=` (browsers cannot set WS
124
163
  headers); `/api/*` sends `Access-Control-Allow-Origin: *` — the token is the
@@ -405,7 +405,11 @@ requests themselves.
405
405
  `~/.zcode/v2/config.json` marks it `enabled`). The bridge answers the captcha
406
406
  request with `headersApplied:false` and the backend surfaces a clear error;
407
407
  full Start Plan support headless would require solving the Aliyun captcha
408
- outside a browser, which this bridge does not do.
408
+ outside a browser, which this bridge does not do. That boundary is
409
+ deliberate: unofficial clients or proxies that impersonate the desktop app or
410
+ bypass the captcha check won't be shipped or supported here — if the provider
411
+ ever offers an official headless credential path, this bridge will adopt it
412
+ (see #123).
409
413
 
410
414
  ### Interactive TUI / `script` / `expect` fails with `Operation not permitted` under the sandbox
411
415
 
@@ -1,5 +1,7 @@
1
1
  # Unified CLI entry and bin pruning
2
2
 
3
+ > Amended by ADR-0020 (`.zcode/docs/adr/`): bare invocation now launches the Martty TUI — the in-house Ink REPL is deleted; the subcommand surface is unchanged.
4
+
3
5
  The package grew three separate bins (`zcode-acp-server`, `zcode-acp-hub`,
4
6
  `zcode-quota`) plus a planned terminal chat surface. Installing four sibling
5
7
  commands for one tool is noisy, and each new surface would add another. We