zcode-acp-server 0.73.0 → 0.75.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 (48) hide show
  1. package/README.md +1 -1
  2. package/dist/bin/quota.d.ts.map +1 -1
  3. package/dist/bin/quota.js +11 -6
  4. package/dist/bin/quota.js.map +1 -1
  5. package/dist/code-fingerprint.json +1 -1
  6. package/dist/config/user-config.d.ts +5 -1
  7. package/dist/config/user-config.d.ts.map +1 -1
  8. package/dist/config/user-config.js +1 -0
  9. package/dist/config/user-config.js.map +1 -1
  10. package/dist/handlers/replay.d.ts.map +1 -1
  11. package/dist/handlers/replay.js +7 -0
  12. package/dist/handlers/replay.js.map +1 -1
  13. package/dist/handlers/session.d.ts +16 -0
  14. package/dist/handlers/session.d.ts.map +1 -1
  15. package/dist/handlers/session.js +21 -14
  16. package/dist/handlers/session.js.map +1 -1
  17. package/dist/quota/cliproxy/client.d.ts.map +1 -1
  18. package/dist/quota/cliproxy/client.js +10 -4
  19. package/dist/quota/cliproxy/client.js.map +1 -1
  20. package/dist/quota/opencode-go/client.d.ts +28 -7
  21. package/dist/quota/opencode-go/client.d.ts.map +1 -1
  22. package/dist/quota/opencode-go/client.js +39 -7
  23. package/dist/quota/opencode-go/client.js.map +1 -1
  24. package/dist/quota/opencode-go/config.d.ts +12 -7
  25. package/dist/quota/opencode-go/config.d.ts.map +1 -1
  26. package/dist/quota/opencode-go/config.js +12 -7
  27. package/dist/quota/opencode-go/config.js.map +1 -1
  28. package/dist/quota/opencode-go/format.js +1 -1
  29. package/dist/quota/opencode-go/format.js.map +1 -1
  30. package/dist/quota/opencode-go/index.d.ts +18 -10
  31. package/dist/quota/opencode-go/index.d.ts.map +1 -1
  32. package/dist/quota/opencode-go/index.js +105 -63
  33. package/dist/quota/opencode-go/index.js.map +1 -1
  34. package/dist/quota/opencode-go/parse.d.ts +10 -0
  35. package/dist/quota/opencode-go/parse.d.ts.map +1 -1
  36. package/dist/quota/opencode-go/parse.js +41 -0
  37. package/dist/quota/opencode-go/parse.js.map +1 -1
  38. package/dist/remote/hub-server.d.ts.map +1 -1
  39. package/dist/remote/hub-server.js +68 -26
  40. package/dist/remote/hub-server.js.map +1 -1
  41. package/dist/remote/session-close-endpoint.d.ts +8 -0
  42. package/dist/remote/session-close-endpoint.d.ts.map +1 -1
  43. package/dist/remote/session-close-endpoint.js +62 -4
  44. package/dist/remote/session-close-endpoint.js.map +1 -1
  45. package/docs/BACKLOG.md +34 -0
  46. package/docs/CLI.md +31 -28
  47. package/docs/adr/0006-remote-session-close.md +14 -0
  48. package/package.json +1 -1
@@ -20,6 +20,14 @@
20
20
  */
21
21
  import type { IncomingMessage, ServerResponse } from "node:http";
22
22
  import type { ZcodeAcpServer } from "../server.js";
23
+ /**
24
+ * Force close: how long to wait for the cancelled turn(s) to settle before
25
+ * evicting the resident runtime anyway (the eviction kills any generation
26
+ * that ignored the stop pair). Test hook override via the setter below.
27
+ */
28
+ export declare let forceSettleMs: number;
29
+ /** Test hook: shrink the force-close settle bound so tests don't sleep. */
30
+ export declare function setForceSettleMsForTests(ms: number): void;
23
31
  export interface ServeTerminateDecision {
24
32
  /** Terminate this bridge once the close response has flushed. */
25
33
  terminate: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"session-close-endpoint.d.ts","sourceRoot":"","sources":["../../src/remote/session-close-endpoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAsBnD,MAAM,WAAW,sBAAsB;IACrC,iEAAiE;IACjE,SAAS,EAAE,OAAO,CAAC;IACnB,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,MAAM,EACvB,GAA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G;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,cAAc,GACrB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAWxE"}
@@ -19,6 +19,7 @@
19
19
  * one stays gone. A running turn is the one case we CAN observe and reject.
20
20
  */
21
21
  import process from "node:process";
22
+ import { cancelSessionTurns } from "../handlers/session.js";
22
23
  import { log } from "../utils.js";
23
24
  import { stopPollersForSession } from "../workflow/poller.js";
24
25
  function sendText(res, code, message) {
@@ -37,6 +38,36 @@ function sendJson(res, code, body) {
37
38
  }
38
39
  /** Grace before the bridge exits itself when the TUI group signal missed. */
39
40
  const SELF_EXIT_MS = 1_500;
41
+ /**
42
+ * Force close: how long to wait for the cancelled turn(s) to settle before
43
+ * evicting the resident runtime anyway (the eviction kills any generation
44
+ * that ignored the stop pair). Test hook override via the setter below.
45
+ */
46
+ export let forceSettleMs = 3_000;
47
+ /** Test hook: shrink the force-close settle bound so tests don't sleep. */
48
+ export function setForceSettleMsForTests(ms) {
49
+ forceSettleMs = ms;
50
+ }
51
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
52
+ const MAX_CLOSE_BODY_BYTES = 256;
53
+ /**
54
+ * Read the optional close body without trusting Content-Type (the hub's
55
+ * forward-and-relay proxy pipes bytes through without forwarding headers).
56
+ * Empty body → undefined; anything malformed throws for the 400 path.
57
+ */
58
+ async function readCloseBody(req) {
59
+ const chunks = [];
60
+ let size = 0;
61
+ for await (const chunk of req) {
62
+ size += chunk.length;
63
+ if (size > MAX_CLOSE_BODY_BYTES)
64
+ throw new Error("body too large");
65
+ chunks.push(chunk);
66
+ }
67
+ if (chunks.length === 0)
68
+ return undefined;
69
+ return JSON.parse(Buffer.concat(chunks).toString("utf8"));
70
+ }
40
71
  /**
41
72
  * Should closing a session TERMINATE this bridge? Only for remote-incubated
42
73
  * instances (ZCODE_ACP_REMOTE_ORIGIN=serve, ADR-0016): their CLI was spawned
@@ -129,8 +160,18 @@ function terminateAfterFlush(decision, res) {
129
160
  run();
130
161
  }
131
162
  async function handleClose(server, req, res, sessionId) {
132
- // Consume any request body so the client's connection drains cleanly.
133
- req.resume();
163
+ // Optional JSON body: {force: true} stops an in-flight turn before closing
164
+ // (an explicit terminate gesture — the desktop's End session). Absent body
165
+ // keeps the plain ADR-0006 contract.
166
+ let body;
167
+ try {
168
+ body = await readCloseBody(req);
169
+ }
170
+ catch {
171
+ sendText(res, 400, "invalid body");
172
+ return;
173
+ }
174
+ const force = body?.force === true;
134
175
  // An empty REMOTE-created placeholder (no turn yet) has no summary but IS
135
176
  // advertised by discovery — it must be closable too, or it blocks the
136
177
  // last-close CLI termination forever (advertisedSessionCount never drops).
@@ -139,10 +180,27 @@ async function handleClose(server, req, res, sessionId) {
139
180
  return;
140
181
  }
141
182
  const zcodeSid = server.resolveSid(sessionId);
142
- if (zcodeSid && [...server.pendingTurns.values()].some((t) => t.zcodeSid === zcodeSid)) {
143
- sendText(res, 409, "session is running — cancel the turn first");
183
+ const running = zcodeSid !== undefined &&
184
+ [...server.pendingTurns.values()].some((t) => t.zcodeSid === zcodeSid);
185
+ if (running && !force) {
186
+ sendText(res, 409, 'session is running — cancel the turn first (or send {"force":true})');
144
187
  return;
145
188
  }
189
+ if (running && zcodeSid !== undefined) {
190
+ // Force close (ADR-0006 amendment): ESC semantics without a client
191
+ // connection — flag the turns cancelled, fire the stop pair, then give
192
+ // them a bounded window to settle (the stop's terminal event persists
193
+ // partial output cleanly) before the runtime eviction below proceeds
194
+ // regardless. The eviction kills any generation that ignored the stop.
195
+ cancelSessionTurns(server, zcodeSid);
196
+ log(`remote: force close cancelling in-flight turn(s) for ${zcodeSid}`);
197
+ const deadline = Date.now() + forceSettleMs;
198
+ while (Date.now() < deadline) {
199
+ if (![...server.pendingTurns.values()].some((t) => t.zcodeSid === zcodeSid))
200
+ break;
201
+ await sleep(50);
202
+ }
203
+ }
146
204
  server.sessionSummaries.delete(sessionId);
147
205
  server.remoteCreatedSessions.delete(sessionId);
148
206
  // Workflow-run progress pollers address this session's journal — stop them
@@ -1 +1 @@
1
- {"version":3,"file":"session-close-endpoint.js","sourceRoot":"","sources":["../../src/remote/session-close-endpoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,OAAO,MAAM,cAAc,CAAC;AAGnC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,SAAS,QAAQ,CAAC,GAAmB,EAAE,IAAY,EAAE,OAAe;IAClE,IAAI,GAAG,CAAC,aAAa;QAAE,OAAO;IAC9B,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,CAAC;IACtD,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC;AAED,SAAS,QAAQ,CAAC,GAAmB,EAAE,IAAY,EAAE,IAA6B;IAChF,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACrC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE;QAClB,cAAc,EAAE,kBAAkB;QAClC,gBAAgB,EAAE,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC;KAC7C,CAAC,CAAC;IACH,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC;AAED,6EAA6E;AAC7E,MAAM,YAAY,GAAG,KAAK,CAAC;AAS3B;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CACpC,eAAuB,EACvB,MAA4E,OAAO,CAAC,GAAG;IAEvF,IAAI,CAAC,GAAG,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IACxE,IAAI,eAAe,GAAG,CAAC;QAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAA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ionStartedAt`,
110
110
  permission `approvalMode`, `session/read` `contentProfile`).
111
111
 
112
+ **3.16.1 sync (2026-10-19, commit `0a1fc56d` — checkout synced, protocol
113
+ surface audited, no bridge action)**: first CLI bump since 3.14 — app-server
114
+ `0.16.9` → `0.17.0` (source root 3.15.1 → 3.16.1; 4,502 files, mostly desktop
115
+ E2E/UI). The desktop on this machine is 3.15.3 (still bundles the 0.16.9-era
116
+ `zcode.cjs`) — nothing changes for a running bridge today; this note covers the
117
+ next desktop update. Protocol drift is small and additive except ONE param
118
+ removal: `session/list` dropped `includeArchived` and now filters `deleted`
119
+ rows itself (plus parent-chain ownership proofs for explicit `sessionIds`
120
+ queries — `listSessions` rewrite). The bridge never sends `includeArchived`
121
+ and applies its own tasks-index tombstone filter, so both are no-ops here.
122
+ Additive surface: `additionalDirectories` (optional) on `session/create` +
123
+ `session/resume`; `toolSearchMode` (default `"off"`) + `additionalDirectories`
124
+ on the `session/requestRuntimePreferences` RESULT schema — the bridge's
125
+ three-field auto-reply (`src/backend/client.ts`) still validates: the schema
126
+ stays `.strict()`, every sent key is known, new fields carry defaults; new
127
+ `provider/refreshRegistry` method (worker rebuilds its in-process registry
128
+ from the Environment's config store — a host-side companion to
129
+ `provider/updateAccountConfig`, which is unchanged); MCP server `alwaysLoad`;
130
+ runtime capability `historyFirst`. Verified zero-diff on every Gotchas-cited
131
+ behavior file: the provider bootstrap quartet (`provider-runtime-env.ts`,
132
+ `runtime-paths.ts`, `zcode-builtin-provider-config-source.ts`,
133
+ `registry-service.ts`), `model-catalog-port.ts` (the `values.at(-1)`
134
+ default-level rule), `session-mode-port.ts`, `execution-state.ts`, the
135
+ setModel/resume schemas, and the runtime-headers path. `server-operations.ts`
136
+ moved 238 lines but no hunk touches the stop/compact/send-busy turn loop
137
+ (`sendPrompt`'s `activeAbortController`, compact's `state.updated` swallow,
138
+ the `-32010` window) — hunks are listSessions, createWithProjection,
139
+ activateSessionForResume, background-turn allowlist, runtime-prefs resolution.
140
+ `session-flow.ts` (+31/−9) is Highspeed selection queueing (queue items keep
141
+ only the ordinary selection; execution bundles stay in-memory) — internal v4
142
+ queue mechanics, the v4 stop path is untouched. Model-selection persistence
143
+ semantics unchanged (`ensureSessionPersisted` / `restorePersistedModelSelection`;
144
+ `turn-model.ts` adds Highspeed/off-peak capture, not persistence).
145
+
112
146
  **3.14.0 audit (2026-09-20, app-server 0.16.9 — live-probed end to end)**: the
113
147
  dynamic-workflow family (ten model tools led by `CreateWorkflow`) is OFF by
114
148
  default headless and enabled per PROCESS via
package/docs/CLI.md CHANGED
@@ -96,42 +96,45 @@ node dist/cli.js quota -w
96
96
 
97
97
  ## Opencode Go setup
98
98
 
99
- Opencode Go has no JSON API for subscription usage — the CLI scrapes the
100
- authenticated dashboard at `opencode.ai/workspace/<id>/go`, so it needs your
101
- browser `auth` cookie. Credentials are read from three sources, **merged
102
- field-by-field, highest precedence first**:
103
-
104
- - **Our config file** (`~/.config/zcode-acp/config.json`, `quota` section —
105
- the preferred home):
99
+ Two credential sources drive the Go usage card — **picked automatically,
100
+ cookies preferred** (they report usage in 0.1-percent steps; the API key
101
+ reports integer percents but never expires and needs no browser):
102
+
103
+ - **API key** (recommended, cookie-free): at
104
+ [opencode.ai/console](https://opencode.ai/console) → **Keys** → Add Service
105
+ Account → Add API Key (query permissions suffice), then either:
106
+ - config file (`~/.config/zcode-acp/config.json`, `quota` section):
107
+ ```json
108
+ { "quota": { "opencodeGoApiKey": "oc_sk_your_key" } }
109
+ ```
110
+ - or environment variable:
111
+ ```bash
112
+ export OPENCODE_GO_API_KEY="oc_sk_your_key"
113
+ ```
114
+ - **Console cookies** (higher precision, expires with the browser session):
115
+ `opencode.ai` console login → browser DevTools (F12) → Application →
116
+ Cookies → copy the `auth` cookie value and the `__Host-console_session`
117
+ value, plus the `wrk_…` workspace id from the console URL, into any of the
118
+ three merged sources (highest precedence first):
106
119
  ```json
107
120
  { "quota": {
108
121
  "opencodeGoWorkspaceId": "wrk_your_workspace_id",
109
- "opencodeGoAuthCookie": "Fe26.2**your_cookie_value"
110
- } }
122
+ "opencodeGoAuthCookie": "Fe26.2**your_cookie_value",
123
+ "opencodeGoSessionToken": "st_your_session_token" } }
111
124
  ```
112
- - **Environment variables** (override the legacy file below):
113
125
  ```bash
114
126
  export OPENCODE_GO_WORKSPACE_ID="wrk_your_workspace_id"
115
127
  export OPENCODE_GO_AUTH_COOKIE="Fe26.2**your_cookie_value"
128
+ export OPENCODE_GO_SESSION_TOKEN="st_your_session_token"
116
129
  ```
117
- - **Legacy config file**: `~/.pi/agent/opencode-go.json` — same convention as
118
- the `@beyona/pi-zai-usage` Pi extension, kept so existing setups keep
119
- working unchanged.
120
- ```json
121
- { "workspaceId": "wrk_your_workspace_id", "authCookie": "Fe26.2**your_cookie_value" }
122
- ```
123
-
124
- How to get the values:
125
-
126
- 1. **Workspace ID** — open `https://opencode.ai`, navigate to your Go
127
- workspace, and copy the `wrk_…` id from the URL
128
- (`https://opencode.ai/workspace/<wrk_…>/go`).
129
- 2. **Auth cookie** — open browser DevTools (F12) → Application → Cookies →
130
- `opencode.ai` → copy the value of the cookie named `auth` (it starts with
131
- `Fe26.2**`).
132
-
133
- Without credentials, the default multi-provider mode silently shows GLM only
134
- (no error). Running `zcode-acp quota go` without credentials prints a setup hint.
130
+ The legacy `~/.pi/agent/opencode-go.json` file
131
+ (`{ workspaceId, authCookie, sessionToken }`, the `@beyona/pi-zai-usage`
132
+ convention) still works as the lowest-precedence source.
133
+
134
+ When both are configured and the cookies expire (the console API answers
135
+ 400/401/403), the card seamlessly falls back to the API key. Without any
136
+ credentials, the default multi-provider mode silently shows GLM only (no
137
+ error); `zcode-acp quota go` without credentials prints a setup hint.
135
138
 
136
139
  ## Ollama Cloud setup
137
140
 
@@ -26,6 +26,20 @@ in-use signal, a pending turn, is rejected outright (409). A bridge-restart
26
26
  auto-resume alone does not resurrect a closed session — `registerSession`
27
27
  writes a summary with `hasActivity` unset.
28
28
 
29
+ Amendment (2026-10-20) — force close. The 409 guard protects conversations
30
+ from a mere list refresh, but it also blocks the client that MEANT to
31
+ terminate: a desktop user pressing "End session" on a running conversation
32
+ got the refusal and no path to act on it (observed live: the session kept
33
+ generating until the user walked to the hosting CLI window and stopped it
34
+ there). A close body `{"force":true}` now opts an explicit gesture through:
35
+ the bridge applies ESC semantics without a client connection (flag the
36
+ session's in-flight turns cancelled, fire the stop pair), waits a bounded
37
+ ~3s for them to settle so the stop's terminal event persists partial output,
38
+ then proceeds with the eviction regardless — the `session/close` runtime
39
+ eviction already documented as the drain gate's kill escalation finishes any
40
+ generation that ignored the stop. Plain close keeps the refuse-when-running
41
+ contract; nothing changes for clients that send no body.
42
+
29
43
  The hub stays a router (ADR-0002): the POST is forwarded by instance id and
30
44
  session id only; the running guard and retirement semantics live in the
31
45
  bridge. One implementation note for future write proxies: aborting the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zcode-acp-server",
3
- "version": "0.73.0",
3
+ "version": "0.75.0",
4
4
  "description": "Agent Client Protocol (ACP) server bridging headless ZCode to editors like Zed and JetBrains.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",