zcode-acp-server 0.77.0 → 0.78.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 (39) hide show
  1. package/README.md +22 -22
  2. package/README.zh-CN.md +16 -16
  3. package/dist/code-fingerprint.json +2 -2
  4. package/dist/config/account-provider.d.ts +13 -0
  5. package/dist/config/account-provider.d.ts.map +1 -1
  6. package/dist/config/account-provider.js +119 -2
  7. package/dist/config/account-provider.js.map +1 -1
  8. package/dist/handlers/authenticate.d.ts +17 -0
  9. package/dist/handlers/authenticate.d.ts.map +1 -0
  10. package/dist/handlers/authenticate.js +25 -0
  11. package/dist/handlers/authenticate.js.map +1 -0
  12. package/dist/handlers/replay.d.ts +9 -0
  13. package/dist/handlers/replay.d.ts.map +1 -1
  14. package/dist/handlers/replay.js +28 -7
  15. package/dist/handlers/replay.js.map +1 -1
  16. package/dist/handlers/session.d.ts.map +1 -1
  17. package/dist/handlers/session.js +20 -3
  18. package/dist/handlers/session.js.map +1 -1
  19. package/dist/i18n.d.ts +3 -0
  20. package/dist/i18n.d.ts.map +1 -1
  21. package/dist/i18n.js +4 -0
  22. package/dist/i18n.js.map +1 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +5 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/remote/hub-server.d.ts.map +1 -1
  27. package/dist/remote/hub-server.js +98 -1
  28. package/dist/remote/hub-server.js.map +1 -1
  29. package/dist/remote/session-close-endpoint.d.ts.map +1 -1
  30. package/dist/remote/session-close-endpoint.js +25 -7
  31. package/dist/remote/session-close-endpoint.js.map +1 -1
  32. package/dist/server.d.ts +8 -0
  33. package/dist/server.d.ts.map +1 -1
  34. package/dist/server.js +17 -5
  35. package/dist/server.js.map +1 -1
  36. package/docs/REMOTE-CLIENTS.md +36 -4
  37. package/docs/REPLAY-GUIDE.md +5 -0
  38. package/docs/TROUBLESHOOTING.md +6 -2
  39. package/package.json +1 -1
package/README.md CHANGED
@@ -193,27 +193,27 @@ before any config would be readable.
193
193
  Every `ZCODE_ACP_*` preference variable in this table has a config-file
194
194
  field (see [User config file](#user-config-file)); the file value wins.
195
195
 
196
- | Variable | Default | Purpose |
197
- | ---------------------------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
198
- | `ZCODE_BIN` | _(auto-discovered)_ | Path to the ZCode CLI binary or its `.cjs` entry. Resolution order: this variable → `zcode` on `PATH` → the desktop-app bundle |
199
- | `ZCODE_NODE` | _(discovered)_ | Explicit Node binary to run `ZCODE_BIN` with (must support `node:sqlite`) |
200
- | `ZCODE_PROVIDER` | _(first enabled)_ | Pin the provider id from `config.json` (e.g. `builtin:zai-coding-plan`). Credentials are read from that provider only, and the model dropdown lists only its models. Unset keeps the default "first enabled provider wins". Set together with `ZCODE_MODEL` to pin the exact model: each new session is switched to `ZCODE_PROVIDER`/`ZCODE_MODEL` right after it is created, and session creation fails if the backend refuses that pair. |
201
- | `ZCODE_HOME` | `~/.zcode` | Directory that replaces `~/.zcode` as the ZCode data root. Everything the bridge reads from there follows it: credentials/provider config (`<dir>/v2/config.json`), the lazy-session alias store (`<dir>/v2/acp-lazy-sessions.json`), the desktop app's settings and tasks index (`<dir>/v2/setting.json`, `<dir>/v2/tasks-index.sqlite`), user skills (`<dir>/skills`), and the CLI config with plugin/skill/MCP enablement (`<dir>/cli/config.json` + plugin cache). Set it before starting the bridge — the credentials and tasks-index paths are resolved once at startup. |
202
- | `ZCODE_MODEL` | _(from config)_ | Override the active model id |
203
- | `ZCODE_DISALLOWED_TOOLS` | _(Cron tools)_ | Space- or comma-separated tool names removed from every session the bridge creates or resumes (sent as the backend's per-session `toolDenylist` — a registry-level removal, so the tools are neither offered to the model nor executable), merged with the built-in default that disallows `CronCreate CronList CronUpdate CronDelete` (the bridge cannot serve the backend's `automation/*` client requests, so those tools are advertised-but-broken — see #192). Rule forms like `Bash(git *)` remove the whole tool. A backend too old for `toolDenylist` gets one warning and runs without the policy. |
204
- | `ZCODE_ENABLE_AUTOMATION_TOOLS` | _(unset)_ | Set to `1` to stop disallowing the Cron* tools — only useful for a host that actually implements the backend's `automation/*` port. |
205
- | `ZCODE_ACP_AUTO_COMPACT_THRESHOLD` | _(unset)_ | Absolute token count that triggers automatic context compaction. After each successful turn (`end_turn`), if `contextUsed >= threshold`, the server invokes `session/compact` to free up context before the next prompt. Set to `0` or leave unset to disable (default). Example: `240000` triggers compaction at 240K tokens. The compaction target itself is decided by the ZCode backend. |
206
- | `ZCODE_ACP_QUOTA_AUTO_RESUME` | `1` | Wait out GLM usage-cap exhaustion (business codes 1308 …) and continue automatically: a quota-stopped `/auto` goal loop re-enters its rounds after the window reset, and quota-stopped workflow runs are resumed from the journal once the quota card reports the reset. Set `0` to restore pause-for-a-human. The bridge performs the wait (timers + a periodic journal scan), so it works while the editor/app is asleep or detached. |
207
- | `ZCODE_ACP_MODE` | `yolo` | Mode a newly created session starts in. Values are the backend's own modes — `plan`, `build`, `edit`, `yolo`, `auto`. Unset keeps `yolo` (unrestricted), the bridge's historical default. Only affects session creation; the mode dropdown still switches it per session. |
208
- | `ZCODE_ACP_DEBUG` | _(unset)_ | Set to `1` to enable verbose diagnostic logs (event flow, probe loops, status updates). Default is quiet — only warnings (backend pipe errors, command/permission failures, lock timeouts) are emitted. Enable this when diagnosing bridge issues; the logs appear in `Zed.log` prefixed with `[zcode-acp]`. |
209
- | `ZCODE_ACP_REMOTE` | _(unset)_ | Set to `1` to enable [remote access](#remote-access) — serve the same sessions to additional ACP clients over WebSocket. |
210
- | `ZCODE_ACP_REMOTE_TOKEN` | _(unset)_ | Auth token for remote access. **Mandatory** when `ZCODE_ACP_REMOTE=1`; remote stays disabled without it. |
211
- | `ZCODE_ACP_HUB_PORT` | `8377` | Port of the machine-level hub daemon. Map exactly this one port in your tunnel. |
212
- | `ZCODE_ACP_HUB_HOST` | `127.0.0.1` | Hub bind address. `0.0.0.0` exposes a token-only, unencrypted surface — only for a containerized tunnel agent on a private interface (see [Remote Access](#remote-access)). |
213
- | `ZCODE_ACP_REMOTE_PORT` | `8378` | First loopback port for the bridge's ACP endpoint. Each bridge (each editor window) auto-increments to the next free port. |
214
- | `ZCODE_ACP_SANDBOX` | _(unset)_ | Set to `1` to confine the agent's file writes with a macOS Seatbelt sandbox globally; per-project, set `"enabled": true` in `<workspace>/.zcode/acp/sandbox.json` instead (see [Sandbox](#sandbox)). |
215
- | `ZCODE_ACP_LANG` | _(inherited)_ | Language of the bridge's user-facing strings (popups, status/hint lines, command menu descriptions): `zh` or `en`. When unset, the bridge inherits the ZCode app's language (`localePreference`/`locale` in `~/.zcode/v2/setting.json`), then falls back to the `LC_ALL`/`LC_MESSAGES`/`LANG` locale, defaulting to English. |
216
- | `ZCODE_ACP_SHOW_COMPLETION_STATUS` | `1` | Emit successful turn-end status as assistant text. Set `0` or `false` to omit it; `session.showCompletionStatus` overrides the env. Error and cancellation warnings remain visible. |
196
+ | Variable | Default | Purpose |
197
+ | ---------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
198
+ | `ZCODE_BIN` | _(auto-discovered)_ | Path to the ZCode CLI binary or its `.cjs` entry. Resolution order: this variable → `zcode` on `PATH` → the desktop-app bundle |
199
+ | `ZCODE_NODE` | _(discovered)_ | Explicit Node binary to run `ZCODE_BIN` with (must support `node:sqlite`) |
200
+ | `ZCODE_PROVIDER` | _(first enabled)_ | Pin the provider id from `config.json` (e.g. `builtin:zai-coding-plan`). Credentials are read from that provider only, and the model dropdown lists only its models. Unset keeps the default "first enabled provider wins". Set together with `ZCODE_MODEL` to pin the exact model: each new session is switched to `ZCODE_PROVIDER`/`ZCODE_MODEL` right after it is created, and session creation fails if the backend refuses that pair. |
201
+ | `ZCODE_HOME` | `~/.zcode` | Directory that replaces `~/.zcode` as the ZCode data root. Everything the bridge reads from there follows it: credentials/provider config (`<dir>/v2/config.json`), the lazy-session alias store (`<dir>/v2/acp-lazy-sessions.json`), the desktop app's settings and tasks index (`<dir>/v2/setting.json`, `<dir>/v2/tasks-index.sqlite`), user skills (`<dir>/skills`), and the CLI config with plugin/skill/MCP enablement (`<dir>/cli/config.json` + plugin cache). Set it before starting the bridge — the credentials and tasks-index paths are resolved once at startup. |
202
+ | `ZCODE_MODEL` | _(from config)_ | Override the active model id |
203
+ | `ZCODE_DISALLOWED_TOOLS` | _(Cron tools)_ | Space- or comma-separated tool names removed from every session the bridge creates or resumes (sent as the backend's per-session `toolDenylist` — a registry-level removal, so the tools are neither offered to the model nor executable), merged with the built-in default that disallows `CronCreate CronList CronUpdate CronDelete` (the bridge cannot serve the backend's `automation/*` client requests, so those tools are advertised-but-broken — see #192). Rule forms like `Bash(git *)` remove the whole tool. Matching is by exact tool name — no wildcards (`mcp__*` matches nothing); list MCP tools by their full `mcp__<server>__<tool>` name. A backend too old for `toolDenylist` gets one warning and runs without the policy. |
204
+ | `ZCODE_ENABLE_AUTOMATION_TOOLS` | _(unset)_ | Set to `1` to stop disallowing the Cron* tools — only useful for a host that actually implements the backend's `automation/*` port. |
205
+ | `ZCODE_ACP_AUTO_COMPACT_THRESHOLD` | _(unset)_ | Absolute token count that triggers automatic context compaction. After each successful turn (`end_turn`), if `contextUsed >= threshold`, the server invokes `session/compact` to free up context before the next prompt. Set to `0` or leave unset to disable (default). Example: `240000` triggers compaction at 240K tokens. The compaction target itself is decided by the ZCode backend. |
206
+ | `ZCODE_ACP_QUOTA_AUTO_RESUME` | `1` | Wait out GLM usage-cap exhaustion (business codes 1308 …) and continue automatically: a quota-stopped `/auto` goal loop re-enters its rounds after the window reset, and quota-stopped workflow runs are resumed from the journal once the quota card reports the reset. Set `0` to restore pause-for-a-human. The bridge performs the wait (timers + a periodic journal scan), so it works while the editor/app is asleep or detached. |
207
+ | `ZCODE_ACP_MODE` | `yolo` | Mode a newly created session starts in. Values are the backend's own modes — `plan`, `build`, `edit`, `yolo`, `auto`. Unset keeps `yolo` (unrestricted), the bridge's historical default. Only affects session creation; the mode dropdown still switches it per session. |
208
+ | `ZCODE_ACP_DEBUG` | _(unset)_ | Set to `1` to enable verbose diagnostic logs (event flow, probe loops, status updates). Default is quiet — only warnings (backend pipe errors, command/permission failures, lock timeouts) are emitted. Enable this when diagnosing bridge issues; the logs appear in `Zed.log` prefixed with `[zcode-acp]`. |
209
+ | `ZCODE_ACP_REMOTE` | _(unset)_ | Set to `1` to enable [remote access](#remote-access) — serve the same sessions to additional ACP clients over WebSocket. |
210
+ | `ZCODE_ACP_REMOTE_TOKEN` | _(unset)_ | Auth token for remote access. **Mandatory** when `ZCODE_ACP_REMOTE=1`; remote stays disabled without it. |
211
+ | `ZCODE_ACP_HUB_PORT` | `8377` | Port of the machine-level hub daemon. Map exactly this one port in your tunnel. |
212
+ | `ZCODE_ACP_HUB_HOST` | `127.0.0.1` | Hub bind address. `0.0.0.0` exposes a token-only, unencrypted surface — only for a containerized tunnel agent on a private interface (see [Remote Access](#remote-access)). |
213
+ | `ZCODE_ACP_REMOTE_PORT` | `8378` | First loopback port for the bridge's ACP endpoint. Each bridge (each editor window) auto-increments to the next free port. |
214
+ | `ZCODE_ACP_SANDBOX` | _(unset)_ | Set to `1` to confine the agent's file writes with a macOS Seatbelt sandbox globally; per-project, set `"enabled": true` in `<workspace>/.zcode/acp/sandbox.json` instead (see [Sandbox](#sandbox)). |
215
+ | `ZCODE_ACP_LANG` | _(inherited)_ | Language of the bridge's user-facing strings (popups, status/hint lines, command menu descriptions): `zh` or `en`. When unset, the bridge inherits the ZCode app's language (`localePreference`/`locale` in `~/.zcode/v2/setting.json`), then falls back to the `LC_ALL`/`LC_MESSAGES`/`LANG` locale, defaulting to English. |
216
+ | `ZCODE_ACP_SHOW_COMPLETION_STATUS` | `1` | Emit successful turn-end status as assistant text. Set `0` or `false` to omit it; `session.showCompletionStatus` overrides the env. Error and cancellation warnings remain visible. |
217
217
 
218
218
  ## Sandbox
219
219
 
@@ -353,7 +353,7 @@ Thanks to everyone who has contributed (updated automatically from the
353
353
  <a href="https://github.com/william0wang/zcode-acp/graphs/contributors">
354
354
  <!-- release-please re-stamps &v= on every release: the new URL busts the
355
355
  contrib.rocks and GitHub camo image caches. -->
356
- <img src="https://contrib.rocks/image?repo=william0wang/zcode-acp&v=0.77.0" alt="Contributors" /> <!-- x-release-please-version -->
356
+ <img src="https://contrib.rocks/image?repo=william0wang/zcode-acp&v=0.78.0" alt="Contributors" /> <!-- x-release-please-version -->
357
357
  </a>
358
358
 
359
359
  ## Related Projects
package/README.zh-CN.md CHANGED
@@ -137,22 +137,22 @@ ZCode CLI 内置于桌面应用中,默认不会加到 `PATH`。用 `ZCODE_BIN`
137
137
  下表中所有 `ZCODE_ACP_*` 偏好类变量都有对应的配置文件字段(见
138
138
  [用户配置文件](#用户配置文件)),文件值优先。
139
139
 
140
- | 变量 | 默认值 | 用途 |
141
- | ---------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
142
- | `ZCODE_BIN` | `zcode` | ZCode CLI 二进制文件路径或其 `.cjs` 入口 |
143
- | `ZCODE_NODE` | _(自动发现)_ | 显式指定运行 `ZCODE_BIN` 的 Node 二进制(必须支持 `node:sqlite`) |
144
- | `ZCODE_MODEL` | _(来自 config) | 覆盖当前使用的模型 id |
145
- | `ZCODE_DISALLOWED_TOOLS` | _(Cron 工具)_ | 以空格或逗号分隔的工具名,从桥接层创建或恢复的每个会话中移除(作为后端的会话级 `toolDenylist` 下发——注册表层面的移除,工具既不会提供给模型也无法执行),并与内置默认值合并——默认禁用 `CronCreate CronList CronUpdate CronDelete`(桥接层无法应答后端的 `automation/*` 客户端请求,这些工具对模型可见但必然失败,见 #192)。`Bash(git *)` 这类规则形式会移除整个工具。后端过旧不认 `toolDenylist` 时告警一次并在无策略下运行。 |
146
- | `ZCODE_ENABLE_AUTOMATION_TOOLS` | _(未设置) | 设为 `1` 取消对 Cron* 工具的默认禁用——仅对真正实现了后端 `automation/*` 端口的宿主有意义。 |
147
- | `ZCODE_ACP_AUTO_COMPACT_THRESHOLD` | _(未设置) | 触发自动压缩的绝对 token 阈值。每次回合成功完成后(`end_turn`),若 `contextUsed >= 阈值`,服务端会自动调用 `session/compact` 压缩上下文,为下一个 prompt 腾出空间。设为 `0` 或不设置则禁用(默认)。例如 `240000` 表示上下文达 24 万 token 时触发压缩。压缩目标由 ZCode 后端决定。 |
148
- | `ZCODE_ACP_DEBUG` | _(未设置) | 设为 `1` 可开启详细诊断日志(事件流、探测循环、状态更新)。默认安静——只输出警告类日志(后端管道错误、命令/权限失败、锁等待超时)。诊断桥接问题时开启;日志出现在 `Zed.log` 中,前缀为 `[zcode-acp]`。 |
149
- | `ZCODE_ACP_REMOTE` | _(未设置)_ | 设为 `1` 启用[远程访问](#远程访问)——通过 WebSocket 向更多 ACP 客户端提供相同会话。 |
150
- | `ZCODE_ACP_REMOTE_TOKEN` | _(未设置)_ | 远程访问的鉴权 token。启用 `ZCODE_ACP_REMOTE=1` 时**必填**;缺失则远程保持禁用。 |
151
- | `ZCODE_ACP_HUB_PORT` | `8377` | 机器级 `zcode-acp-hub` 的端口。隧道只映射这一个端口。 |
152
- | `ZCODE_ACP_HUB_HOST` | `127.0.0.1` | hub 绑定地址。`0.0.0.0` 会暴露仅 token 保护的明文面——只用于容器化隧道 agent 所在的私网接口(见[远程访问](#远程访问))。 |
153
- | `ZCODE_ACP_REMOTE_PORT` | `8378` | bridge ACP 端点的起始回环端口。每个 bridge(每个编辑器窗口)自动递增取下一个空闲端口。 |
154
- | `ZCODE_ACP_SANDBOX` | _(未设置)_ | 设为 `1` 全局启用 macOS Seatbelt 沙箱限制 Agent 的文件写入;项目级则在 `<工作区>/.zcode/acp/sandbox.json` 里设 `"enabled": true`(见[沙箱](#沙箱))。 |
155
- | `ZCODE_ACP_LANG` | _(继承)_ | 桥的用户可见文案(弹窗、状态/提示行、命令菜单描述)语言:`zh` 或 `en`。未设置时继承 ZCode APP 的语言设置(`~/.zcode/v2/setting.json` 的 `localePreference`/`locale`),再退回 `LC_ALL`/`LC_MESSAGES`/`LANG` 区域设置,默认英文。 |
140
+ | 变量 | 默认值 | 用途 |
141
+ | ---------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
142
+ | `ZCODE_BIN` | `zcode` | ZCode CLI 二进制文件路径或其 `.cjs` 入口 |
143
+ | `ZCODE_NODE` | _(自动发现)_ | 显式指定运行 `ZCODE_BIN` 的 Node 二进制(必须支持 `node:sqlite`) |
144
+ | `ZCODE_MODEL` | _(来自 config) | 覆盖当前使用的模型 id |
145
+ | `ZCODE_DISALLOWED_TOOLS` | _(Cron 工具)_ | 以空格或逗号分隔的工具名,从桥接层创建或恢复的每个会话中移除(作为后端的会话级 `toolDenylist` 下发——注册表层面的移除,工具既不会提供给模型也无法执行),并与内置默认值合并——默认禁用 `CronCreate CronList CronUpdate CronDelete`(桥接层无法应答后端的 `automation/*` 客户端请求,这些工具对模型可见但必然失败,见 #192)。`Bash(git *)` 这类规则形式会移除整个工具。匹配按精确工具名进行,不支持通配符(`mcp__*` 不会命中任何工具);MCP 工具需写完整名称 `mcp__<server>__<tool>`。后端过旧不认 `toolDenylist` 时告警一次并在无策略下运行。 |
146
+ | `ZCODE_ENABLE_AUTOMATION_TOOLS` | _(未设置) | 设为 `1` 取消对 Cron* 工具的默认禁用——仅对真正实现了后端 `automation/*` 端口的宿主有意义。 |
147
+ | `ZCODE_ACP_AUTO_COMPACT_THRESHOLD` | _(未设置) | 触发自动压缩的绝对 token 阈值。每次回合成功完成后(`end_turn`),若 `contextUsed >= 阈值`,服务端会自动调用 `session/compact` 压缩上下文,为下一个 prompt 腾出空间。设为 `0` 或不设置则禁用(默认)。例如 `240000` 表示上下文达 24 万 token 时触发压缩。压缩目标由 ZCode 后端决定。 |
148
+ | `ZCODE_ACP_DEBUG` | _(未设置) | 设为 `1` 可开启详细诊断日志(事件流、探测循环、状态更新)。默认安静——只输出警告类日志(后端管道错误、命令/权限失败、锁等待超时)。诊断桥接问题时开启;日志出现在 `Zed.log` 中,前缀为 `[zcode-acp]`。 |
149
+ | `ZCODE_ACP_REMOTE` | _(未设置)_ | 设为 `1` 启用[远程访问](#远程访问)——通过 WebSocket 向更多 ACP 客户端提供相同会话。 |
150
+ | `ZCODE_ACP_REMOTE_TOKEN` | _(未设置)_ | 远程访问的鉴权 token。启用 `ZCODE_ACP_REMOTE=1` 时**必填**;缺失则远程保持禁用。 |
151
+ | `ZCODE_ACP_HUB_PORT` | `8377` | 机器级 `zcode-acp-hub` 的端口。隧道只映射这一个端口。 |
152
+ | `ZCODE_ACP_HUB_HOST` | `127.0.0.1` | hub 绑定地址。`0.0.0.0` 会暴露仅 token 保护的明文面——只用于容器化隧道 agent 所在的私网接口(见[远程访问](#远程访问))。 |
153
+ | `ZCODE_ACP_REMOTE_PORT` | `8378` | bridge ACP 端点的起始回环端口。每个 bridge(每个编辑器窗口)自动递增取下一个空闲端口。 |
154
+ | `ZCODE_ACP_SANDBOX` | _(未设置)_ | 设为 `1` 全局启用 macOS Seatbelt 沙箱限制 Agent 的文件写入;项目级则在 `<工作区>/.zcode/acp/sandbox.json` 里设 `"enabled": true`(见[沙箱](#沙箱))。 |
155
+ | `ZCODE_ACP_LANG` | _(继承)_ | 桥的用户可见文案(弹窗、状态/提示行、命令菜单描述)语言:`zh` 或 `en`。未设置时继承 ZCode APP 的语言设置(`~/.zcode/v2/setting.json` 的 `localePreference`/`locale`),再退回 `LC_ALL`/`LC_MESSAGES`/`LANG` 区域设置,默认英文。 |
156
156
 
157
157
  ## 沙箱
158
158
 
@@ -1,4 +1,4 @@
1
1
  {
2
- "fingerprint": "b40f0708d0cbc346cfb0d94ea40da1b34d8e713c99235728bcd0cb60ee81bd75",
3
- "fileCount": 129
2
+ "fingerprint": "b8f341b7e3c5eb5cdad2dc04f97cfc445ea3a7a7581887f9f656eacbc64c3970",
3
+ "fileCount": 130
4
4
  }
@@ -36,6 +36,10 @@ export interface BuiltinProviderRule {
36
36
  mode?: string;
37
37
  accountType?: string;
38
38
  };
39
+ api?: {
40
+ type?: string;
41
+ baseUrl?: string;
42
+ };
39
43
  };
40
44
  }
41
45
  export interface BuiltinTable {
@@ -84,6 +88,15 @@ export declare function configProviderIdFor(providerId: string): string;
84
88
  export declare function codingPlanRequestAuthFor(accountProviderId: string | undefined): {
85
89
  apiKey: string;
86
90
  } | null;
91
+ /**
92
+ * Whether any usable ZCode credential exists — the `authenticate` method's
93
+ * readiness check (#344). True when a manual coding-plan key sits in
94
+ * provider_config.json, a bridge account is saved, the merged config.json
95
+ * view holds any provider key, or the desktop ladder found an entitlement.
96
+ * False means the editor user gets the actionable sign-in error instead of a
97
+ * silent success that dies on the first turn.
98
+ */
99
+ export declare function zcodeCredentialsPresent(): boolean;
87
100
  /** The `provider/updateAccountConfig` payload (schema-verified shape). */ export interface AccountProviderPayload {
88
101
  revision: string;
89
102
  basedOnZCodeBuiltinRevision: string;
@@ -1 +1 @@
1
- {"version":3,"file":"account-provider.d.ts","sourceRoot":"","sources":["../../src/config/account-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAQH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAQzD,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3B,M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;GAMG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAiB/D;AAED,+EAA+E;AAC/E,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAuB9D;AAsOD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CACtC,iBAAiB,EAAE,MAAM,GAAG,SAAS,GACpC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA+B3B;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,IAAI,OAAO,CAcjD;AAED,0EAA0E,CAAC,MAAM,WAAW,sBAAsB;IAChH,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B,EAAE,MAAM,CAAC;IACpC,SAAS,EAAE,MAAM,CACf,MAAM,EACN;QAAE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,OAAO,CAAA;SAAE,CAAA;KAAE,CAC5E,CAAC;IACF,MAAM,EAAE,MAAM,CACZ,MAAM,EACN;QACE,YAAY,EAAE,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAC;QAClE,QAAQ,EAAE,OAAO,CAAC;QAClB,OAAO,EAAE,OAAO,CAAC;KAClB,CACF,CAAC;CACH;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,IAAI,sBAAsB,GAAG,IAAI,CA6B1E;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,MAAM,MAAM,GACnB,OAAO,CAAC,OAAO,CAAC,CA2BlB"}
@@ -29,7 +29,7 @@ import os from "node:os";
29
29
  import path from "node:path";
30
30
  import { readCredentialStoreSync } from "../backend/credential-store.js";
31
31
  import { BUILTIN_PROVIDER_ENV, builtinProviderEnv } from "../backend/resolve.js";
32
- import { log, warn, ZCODE_CREDS_PATH } from "../utils.js";
32
+ import { log, warn, zcodePersonalProviderPath, ZCODE_CREDS_PATH } from "../utils.js";
33
33
  import { bridgeOverlays, readCredentialConfig } from "./bridge-accounts.js";
34
34
  /** The bundled provider-table file the CLI boots from. */
35
35
  const PROVIDER_CONFIG_NAME = "zcode-builtin.json";
@@ -195,15 +195,101 @@ function storeIndividualCodingPlanKey(accountProviderId) {
195
195
  * installed catalog is unusable gains nothing. They never count as a
196
196
  * verdict, so an account for one family leaves source 3 open for the other.
197
197
  *
198
+ * Manual plan keys from provider_config.json (`zhipu-coding-plan-api-key`
199
+ * rules, #344) sit at the source-2 tier — see manualCodingPlanKeys below.
200
+ *
198
201
  * Verified 2026-09 against the desktop's own pushed account snapshot: sources
199
202
  * 1+2 produced exactly its entitlement set (bigmodel individual true, every
200
203
  * zai/start/team plan false); source 3 restores the same outcome on fresh
201
204
  * desktop-only layouts (verified 2026-10 against a real store).
202
205
  */
206
+ /**
207
+ * Manual coding-plan api keys from provider_config.json (#344).
208
+ *
209
+ * The desktop's Settings → Model Provider → "Use API key" flow writes the plan
210
+ * key as a personal rule with access type `zhipu-coding-plan-api-key`, while
211
+ * an OAuth login writes NO legacy config.json key at all — so a 3.12+
212
+ * desktop-only machine had no entitlement source the ladder above could read:
213
+ * every account model switch failed with "Provider Registry 中不存在 Model"
214
+ * and the reporter had to copy the key into config.json by hand. These rules
215
+ * are the same tier as config.json's builtin entries — an explicit user key,
216
+ * not a verdict — so they ADD to the ladder without arming sawVerdict, and a
217
+ * coding-plan-cache `unavailable` verdict (about the ACCOUNT plan, not manual
218
+ * keys) does not suppress them.
219
+ *
220
+ * The family comes from the rule's api.baseUrl (the official coding-plan
221
+ * endpoints; the rule id itself — e.g. `zai-api` — is user-chosen and carries
222
+ * no family promise). Upstream plans to fold this access type back into
223
+ * plain `api-key` (todo-157, domain-gated) — matching then moves to the
224
+ * baseUrl alone, which this already reads.
225
+ */
226
+ function manualCodingPlanKeys() {
227
+ const families = codingPlanFamiliesByBaseUrl();
228
+ const out = new Map();
229
+ for (const rule of readPersonalProviderRules()) {
230
+ if (rule.enabled === false)
231
+ continue;
232
+ if (rule.config?.access?.type !== "zhipu-coding-plan-api-key")
233
+ continue;
234
+ const apiKey = rule.config.access.apiKey?.trim();
235
+ const baseUrl = rule.config.api?.baseUrl?.replace(/\/+$/, "");
236
+ const family = baseUrl ? families.get(baseUrl) : undefined;
237
+ if (!apiKey || !family)
238
+ continue;
239
+ out.set(`builtin:${family}-coding-plan`, apiKey);
240
+ }
241
+ return out;
242
+ }
243
+ let personalRulesCache = null;
244
+ /**
245
+ * Personal provider rules, memoized by the same stat key as the builtin table
246
+ * — the runtime-headers path re-reads these before every model request.
247
+ */
248
+ function readPersonalProviderRules() {
249
+ const file = zcodePersonalProviderPath();
250
+ try {
251
+ const { ino, size, mtimeMs, ctimeMs } = statSync(file);
252
+ const key = `${file}\0${ino}:${size}:${mtimeMs}:${ctimeMs}`;
253
+ if (personalRulesCache?.key !== key) {
254
+ const parsed = JSON.parse(readFileSync(file, "utf8"));
255
+ personalRulesCache = { key, rules: parsed.config?.providerConfigRules?.providerRules ?? [] };
256
+ }
257
+ return personalRulesCache.rules;
258
+ }
259
+ catch {
260
+ return []; // absent (pre-3.12 desktop / hermetic HOME) — nothing to add
261
+ }
262
+ }
263
+ /**
264
+ * baseUrl → family for the OFFICIAL individual coding-plan endpoints. Derived
265
+ * from the installed table (a zhipu-account rule's api.baseUrl IS its family's
266
+ * coding-plan endpoint), with the frozen official pair as the table-absent
267
+ * fallback (headless Linux): api.z.ai → zai, open.bigmodel.cn → bigmodel —
268
+ * the same endpoints the shipped table carries.
269
+ */
270
+ function codingPlanFamiliesByBaseUrl() {
271
+ const out = new Map([
272
+ ["https://api.z.ai/api/anthropic", "zai"],
273
+ ["https://open.bigmodel.cn/api/anthropic", "bigmodel"],
274
+ ]);
275
+ for (const rule of readBuiltinTable()?.table.config?.providerConfigRules?.providerRules ?? []) {
276
+ if (rule.config?.access?.type !== "zhipu-account")
277
+ continue;
278
+ if (rule.config?.access?.mode !== "individual-coding-plan")
279
+ continue;
280
+ const family = rule.config?.access?.accountType;
281
+ const baseUrl = rule.config?.api?.baseUrl?.replace(/\/+$/, "");
282
+ if (family && baseUrl)
283
+ out.set(baseUrl, family);
284
+ }
285
+ return out;
286
+ }
203
287
  function entitledBuiltinProviders() {
204
288
  const out = desktopEntitledBuiltinProviders();
205
289
  for (const family of Object.keys(bridgeOverlays()))
206
290
  out.add(`builtin:${family}-coding-plan`);
291
+ for (const legacyId of manualCodingPlanKeys().keys())
292
+ out.add(legacyId);
207
293
  return out;
208
294
  }
209
295
  /** Sources 1-4 above, read from the raw desktop files only. */
@@ -315,11 +401,42 @@ export function codingPlanRequestAuthFor(accountProviderId) {
315
401
  return { apiKey };
316
402
  }
317
403
  catch {
318
- // unreadable/absent config — the store decides
404
+ // unreadable/absent config — the manual key or the store decides
319
405
  }
406
+ // The desktop's own manual plan key (#344): 3.12+ writes it to
407
+ // provider_config.json, never config.json — rank it above the encrypted
408
+ // store (a fresh-install account key) but below the bridge's own setups.
409
+ const manual = manualCodingPlanKeys().get(legacyId);
410
+ if (manual)
411
+ return { apiKey: manual };
320
412
  const stored = storeIndividualCodingPlanKey(accountProviderId);
321
413
  return stored ? { apiKey: stored } : null;
322
414
  }
415
+ /**
416
+ * Whether any usable ZCode credential exists — the `authenticate` method's
417
+ * readiness check (#344). True when a manual coding-plan key sits in
418
+ * provider_config.json, a bridge account is saved, the merged config.json
419
+ * view holds any provider key, or the desktop ladder found an entitlement.
420
+ * False means the editor user gets the actionable sign-in error instead of a
421
+ * silent success that dies on the first turn.
422
+ */
423
+ export function zcodeCredentialsPresent() {
424
+ if (manualCodingPlanKeys().size > 0)
425
+ return true;
426
+ if (Object.keys(bridgeOverlays()).length > 0)
427
+ return true;
428
+ try {
429
+ const cfg = readCredentialConfig(ZCODE_CREDS_PATH);
430
+ for (const entry of Object.values(cfg.provider ?? {})) {
431
+ if (entry?.options?.apiKey?.trim())
432
+ return true;
433
+ }
434
+ }
435
+ catch {
436
+ // unreadable desktop config — the ladder below still speaks
437
+ }
438
+ return desktopEntitledBuiltinProviders().size > 0;
439
+ }
323
440
  /**
324
441
  * Build the account snapshot: every coding-plan provider the bundled table
325
442
  * declares, with entitlement taken from config.json's enabled builtin plans.
@@ -1 +1 @@
1
- {"version":3,"file":"account-provider.js","sourceRoot":"","sources":["../../src/config/account-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5E,0DAA0D;AAC1D,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAkBlD;;;;;;;;;;;;GAYG;AACH,SAAS,gBAAgB;IACvB,MAAM,QAAQ,GAAG,kBAAkB,EAAE,CAAC,oBAAoB,CAAC,CAAC;IAC5D,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,IAAI,EAAE,CAAC;IAC1D,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAC5B,MAAM,OAAO,GACX,OAAO,CAAC,QAAQ,KAAK,OAAO;QAC1B,CAAC,CAAC,IAAI,CAAC,IAAI,CACP,OAAO,CAAC,GAAG,CAAC,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QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,iCAAiC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACpF,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The `authenticate` agent method (#344).
3
+ *
4
+ * initialize advertises one authMethod (`zcode-credentials`), and editors
5
+ * that take the declaration seriously call the method on sign-in — Xcode 27
6
+ * did and the missing handler answered -32601 ("Your request couldn't be
7
+ * completed"); Zed tolerates the gap, which is why this went unnoticed. The
8
+ * bridge cannot drive an interactive login (credentials come from the ZCode
9
+ * desktop app or `zcode-acp setup`, never the editor), so the method is a
10
+ * readiness check: credentials present → `{}` (signed in as far as this
11
+ * agent is concerned); absent → an error whose message says how to get them.
12
+ */
13
+ import type * as acp from "@agentclientprotocol/sdk";
14
+ /** The authMethod id initialize advertises (server.ts authMethods). */
15
+ export declare const ZCODE_AUTH_METHOD_ID = "zcode-credentials";
16
+ export declare function authenticate(params: acp.AuthenticateRequest): acp.AuthenticateResponse;
17
+ //# sourceMappingURL=authenticate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authenticate.d.ts","sourceRoot":"","sources":["../../src/handlers/authenticate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAMrD,uEAAuE;AACvE,eAAO,MAAM,oBAAoB,sBAAsB,CAAC;AAExD,wBAAgB,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,mBAAmB,GAAG,GAAG,CAAC,oBAAoB,CAKtF"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The `authenticate` agent method (#344).
3
+ *
4
+ * initialize advertises one authMethod (`zcode-credentials`), and editors
5
+ * that take the declaration seriously call the method on sign-in — Xcode 27
6
+ * did and the missing handler answered -32601 ("Your request couldn't be
7
+ * completed"); Zed tolerates the gap, which is why this went unnoticed. The
8
+ * bridge cannot drive an interactive login (credentials come from the ZCode
9
+ * desktop app or `zcode-acp setup`, never the editor), so the method is a
10
+ * readiness check: credentials present → `{}` (signed in as far as this
11
+ * agent is concerned); absent → an error whose message says how to get them.
12
+ */
13
+ import { RequestError } from "@agentclientprotocol/sdk";
14
+ import { zcodeCredentialsPresent } from "../config/account-provider.js";
15
+ import { messages } from "../i18n.js";
16
+ /** The authMethod id initialize advertises (server.ts authMethods). */
17
+ export const ZCODE_AUTH_METHOD_ID = "zcode-credentials";
18
+ export function authenticate(params) {
19
+ if (params.methodId !== ZCODE_AUTH_METHOD_ID)
20
+ throw new RequestError(-32602, messages().authErrUnknownMethod(params.methodId));
21
+ if (!zcodeCredentialsPresent())
22
+ throw new RequestError(-32000, messages().authErrNoCredentials);
23
+ return {};
24
+ }
25
+ //# sourceMappingURL=authenticate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../../src/handlers/authenticate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,uEAAuE;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AAExD,MAAM,UAAU,YAAY,CAAC,MAA+B;IAC1D,IAAI,MAAM,CAAC,QAAQ,KAAK,oBAAoB;QAC1C,MAAM,IAAI,YAAY,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,oBAAoB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IACnF,IAAI,CAAC,uBAAuB,EAAE;QAAE,MAAM,IAAI,YAAY,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,oBAAoB,CAAC,CAAC;IAChG,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -74,6 +74,15 @@ export declare function sliceBefore(messages: ZcodeMessage[], before: string, li
74
74
  * in `_meta` (ADR-0003). Returns null when absent/non-finite = full replay.
75
75
  */
76
76
  export declare function readTailLimit(params: acp.LoadSessionRequest): number | null;
77
+ /**
78
+ * Read the load intent from `session/load`'s `_meta.zcode.intent`:
79
+ * "auto" marks a CLIENT-AUTOMATIC replay (a reconnect ladder re-attaching its
80
+ * own tab after it missed the remote-close broadcast); "user" — the default
81
+ * when the field is absent or misspelled, so old clients need no change — is
82
+ * a human picking the session. An auto load of a remotely closed conversation
83
+ * must not resurrect it (see loadSession's retirement gate).
84
+ */
85
+ export declare function readLoadIntent(params: acp.LoadSessionRequest): "auto" | "user";
77
86
  /** Tuning knobs for fetchMessages; unset means the hydration defaults. */
78
87
  export interface FetchMessagesOptions {
79
88
  /** Per-read RPC timeout. */
@@ -1 +1 @@
1
- {"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../src/handlers/replay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,qBAAqB,CAAC;AAI7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAInD,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC,2EAA2E;AAC3E,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,8EAA8E;AAC9E,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;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AAC,YAAY,GACnB,OAAO,CAAC;IAAE,UAAU,EAAE,UAAU,CAAA;CAAE,CAAC,CAerC"}
@@ -153,6 +153,18 @@ export function readTailLimit(params) {
153
153
  return null;
154
154
  return clampLimit(raw);
155
155
  }
156
+ /**
157
+ * Read the load intent from `session/load`'s `_meta.zcode.intent`:
158
+ * "auto" marks a CLIENT-AUTOMATIC replay (a reconnect ladder re-attaching its
159
+ * own tab after it missed the remote-close broadcast); "user" — the default
160
+ * when the field is absent or misspelled, so old clients need no change — is
161
+ * a human picking the session. An auto load of a remotely closed conversation
162
+ * must not resurrect it (see loadSession's retirement gate).
163
+ */
164
+ export function readLoadIntent(params) {
165
+ const zcode = params._meta?.zcode;
166
+ return zcode?.intent === "auto" ? "auto" : "user";
167
+ }
156
168
  /**
157
169
  * Drop duplicate entries the backend can return for the same message id
158
170
  * (observed in live session/messages payloads: the same id appears at
@@ -406,6 +418,9 @@ export async function replayMessages(cx, acpSid, messages, opts = {}) {
406
418
  const info = m.info ?? {};
407
419
  const role = info.role;
408
420
  const mid = info.id ?? `hist_${randomUUID().slice(0, 12)}`;
421
+ // Only a message that also emits a text chunk under `mid` should key its
422
+ // tool cards to that id (see the tool branch below).
423
+ const carriesText = (m.parts ?? []).some((p) => p?.type === "text" && Boolean(p.text));
409
424
  for (const p of m.parts ?? []) {
410
425
  if (!p || typeof p !== "object")
411
426
  continue;
@@ -498,13 +513,19 @@ export async function replayMessages(cx, acpSid, messages, opts = {}) {
498
513
  status: st.status ?? "completed",
499
514
  ...(content.length > 0 ? { content } : {}),
500
515
  ...(histToolName ? { _meta: { claudeCode: { toolName: histToolName } } } : {}),
501
- // Key the card to its own history message so clients group it
502
- // with that message's text — their id-less-card fallback now
503
- // mints a separate card message (right for live sub-agent cards,
504
- // wrong for stored per-message tool parts). The SDK's ToolCall
505
- // type predates the field (upstream ACP added messageId to
506
- // tool_call); the spread keeps the rest of the literal checked.
507
- ...{ messageId: mid },
516
+ // Key the card to its history message ONLY when that message also
517
+ // carries text: clients then group the card with the text they
518
+ // build under the same id. A prose-less tool-only step message
519
+ // (the common shape — the backend stores one tool part per
520
+ // message) must stay id-less: stamping `mid` makes clients mint one
521
+ // bare card message per backend message, un-merging a run of
522
+ // adjacent calls into one-by-one cards, while the same calls live
523
+ // (no messageId on live tool_calls) coalesce into one run card.
524
+ // Id-less replayed cards ride that live fallback — appended to a
525
+ // trailing run of cards — so replay matches the live rendering.
526
+ // The SDK's ToolCall type predates the field (upstream ACP added
527
+ // messageId to tool_call); the spread keeps the literal checked.
528
+ ...(carriesText ? { messageId: mid } : {}),
508
529
  }),
509
530
  });
510
531
  }