zcode-app-cli 3.14.5-34 → 3.15.3-36

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 (75) hide show
  1. package/README.md +13 -2
  2. package/bin/zcode.js +9 -0
  3. package/docs/CONFIGURATION.md +36 -5
  4. package/docs/CONFIGURATION.zh-CN.md +29 -3
  5. package/docs/PROVIDER_CONFIG.md +25 -0
  6. package/docs/PROVIDER_CONFIG.zh-CN.md +20 -0
  7. package/package.json +5 -3
  8. package/vendor/cli-config.cjs +88 -0
  9. package/vendor/extraction.json +24 -6
  10. package/vendor/node_modules/@zcode/tui/dist/index.js +533 -98
  11. package/vendor/packages/browser-use-plugin/README.md +1 -1
  12. package/vendor/packages/browser-use-plugin/docs/api.json +1 -1
  13. package/vendor/packages/browser-use-plugin/docs/overview.md +6 -6
  14. package/vendor/packages/browser-use-plugin/docs/playwright.md +3 -3
  15. package/vendor/packages/browser-use-plugin/docs/workflow.md +2 -2
  16. package/vendor/packages/browser-use-plugin/scripts/browser-client.mjs +5 -7
  17. package/vendor/packages/browser-use-plugin/scripts/build.mjs +0 -1
  18. package/vendor/packages/browser-use-plugin/skills/control-browser/SKILL.md +9 -9
  19. package/vendor/packages/bundled-skills/skills/dynamic-workflows/SKILL.md +760 -687
  20. package/vendor/packages/bundled-skills/skills/dynamic-workflows/examples.md +310 -1
  21. package/vendor/packages/bundled-skills/skills/dynamic-workflows/patterns.md +336 -4
  22. package/vendor/packages/documents-plugin/.zcode-plugin/plugin.json +2 -2
  23. package/vendor/packages/documents-plugin/package.json +2 -2
  24. package/vendor/packages/documents-plugin/skills/docx/LICENSE.txt +10 -10
  25. package/vendor/packages/node-repl-host/.zcode-plugin/plugin.json +1 -1
  26. package/vendor/packages/node-repl-host/dist/mcp/server.js +116 -48
  27. package/vendor/packages/node-repl-host/package.json +1 -1
  28. package/vendor/packages/node-repl-host/scripts/build.mjs +4 -4
  29. package/vendor/packages/pdf-plugin/.zcode-plugin/plugin.json +2 -2
  30. package/vendor/packages/pdf-plugin/package.json +2 -2
  31. package/vendor/packages/pdf-plugin/skills/pdf/LICENSE.txt +10 -10
  32. package/vendor/packages/pdf-plugin/skills/pdf/references/resume-altacv.tex +1 -1
  33. package/vendor/packages/plugin-creator-plugin/skills/plugin-creator/SKILL.md +1 -1
  34. package/vendor/packages/plugin-creator-plugin/skills/plugin-creator/references/plugin-json-spec.md +1 -1
  35. package/vendor/packages/presentations-plugin/.zcode-plugin/plugin.json +2 -2
  36. package/vendor/packages/presentations-plugin/package.json +2 -2
  37. package/vendor/packages/presentations-plugin/skills/pptx/LICENSE.txt +10 -10
  38. package/vendor/packages/restore-legacy-sessions-plugin/skills/restore-legacy-sessions/SKILL.md +1 -1
  39. package/vendor/packages/spreadsheets-plugin/.zcode-plugin/plugin.json +2 -2
  40. package/vendor/packages/spreadsheets-plugin/package.json +2 -2
  41. package/vendor/packages/spreadsheets-plugin/skills/xlsx/LICENSE.txt +10 -10
  42. package/vendor/packages/visualize-plugin/.zcode-plugin/plugin.json +10 -0
  43. package/vendor/packages/visualize-plugin/package.json +8 -0
  44. package/vendor/packages/visualize-plugin/skills/visualize/LICENSE.md +5 -0
  45. package/vendor/packages/visualize-plugin/skills/visualize/SKILL.md +277 -0
  46. package/vendor/packages/visualize-plugin/skills/visualize/assets/calendar.js +273 -0
  47. package/vendor/packages/visualize-plugin/skills/visualize/assets/runtime-manifest.json +16 -0
  48. package/vendor/packages/visualize-plugin/skills/visualize/assets/standalone-host-bridge.js +256 -0
  49. package/vendor/packages/visualize-plugin/skills/visualize/assets/standalone-shell.js +183 -0
  50. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/d3-7.9.0.min.js +2 -0
  51. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/d3-7.9.0.min.js.LICENSE +13 -0
  52. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/floating-ui-core-1.7.3.min.js +1 -0
  53. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/floating-ui-core-1.7.3.min.js.LICENSE +20 -0
  54. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/floating-ui-dom-1.7.4.min.js +1 -0
  55. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/floating-ui-dom-1.7.4.min.js.LICENSE +20 -0
  56. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/lucide-1.17.0.js +19521 -0
  57. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/lucide-1.17.0.js.LICENSE +43 -0
  58. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/manifest.json +57 -0
  59. package/vendor/packages/visualize-plugin/skills/visualize/assets/visualize.css +1222 -0
  60. package/vendor/packages/visualize-plugin/skills/visualize/assets/visualize.html +517 -0
  61. package/vendor/packages/visualize-plugin/skills/visualize/examples/calendar.html +10 -0
  62. package/vendor/packages/visualize-plugin/skills/visualize/references/api.md +128 -0
  63. package/vendor/packages/visualize-plugin/skills/visualize/references/styles.md +3 -0
  64. package/vendor/packages/visualize-plugin/skills/visualize/scripts/render.py +248 -0
  65. package/vendor/packages/visualize-plugin/skills/visualize/scripts/vendor.py +56 -0
  66. package/vendor/packages/visualize-plugin/skills/visualize/tweak.md +62 -0
  67. package/vendor/packages/visualize-plugin/skills/visualize/widgets/calendar.md +90 -0
  68. package/vendor/packages/zcode-cua-plugin/.zcode-plugin/plugin.json +1 -1
  69. package/vendor/packages/zcode-cua-plugin/docs/computer-use.md +1 -1
  70. package/vendor/packages/zcode-cua-plugin/package.json +1 -1
  71. package/vendor/packages/zcode-cua-plugin/scripts/computer-use-client.mjs +35 -41
  72. package/vendor/packages/zcode-guide-plugin/skills/zcode-configuration-guide/SKILL.md +2 -2
  73. package/vendor/provider/zcode-builtin.json +96 -1
  74. package/vendor/zcode.cjs +1622 -1425
  75. package/zcode-runtime.lock.json +3 -3
package/README.md CHANGED
@@ -140,7 +140,7 @@ multi-line editor; slash-command, unified `@` workspace/Plugin references and
140
140
  session events; `/mode`, `/model`, `/resume`, `/plugins` and other upstream
141
141
  slash commands; searchable model and reasoning-effort selectors, plus MCP and
142
142
  workflow panels; status-bar-only Shift+Tab mode cycling
143
- (`build` → `edit` → `yolo`), independent `/plan` toggling with an input-border indicator, Ctrl+N model and empty-prompt Tab effort
143
+ (`build` → `edit` → `guarded` → `yolo`), independent `/plan` toggling with an input-border indicator, Ctrl+N model and empty-prompt Tab effort
144
144
  cycling; structured session-goal status in the right side of the turn footer;
145
145
  animated active-turn timer with a static `ZCODE_TUI_REDUCED_MOTION=1`
146
146
  fallback; responsive context-remaining and session-token metrics.
@@ -308,7 +308,8 @@ picker to return to input selection, then `Esc` again to close rewind.
308
308
  /queue pause|resume pause or resume automatic draft submission
309
309
  /edit-message rewind to an earlier question and edit it
310
310
  /retry rewind to an earlier question and send it again
311
- /workflows inspect workflow progress, artifacts and recovery
311
+ /workflows inspect, tune and save workflow runs
312
+ /workflows saved list saved definitions and start a new run
312
313
  /tasks inspect and manage background tasks
313
314
  /tasks message <id> <text> send guidance to a running background agent
314
315
  /tasks resume <id> [text] resume a stopped or failed background agent
@@ -325,6 +326,16 @@ picker to return to input selection, then `Esc` again to close rewind.
325
326
  runtime's own `/clear` is an alias of `/new` and starts a fresh session, so it
326
327
  is forwarded to the runtime unchanged.
327
328
 
329
+ Workflow creation and saved-workflow startup require the native workflow mode
330
+ to be enabled explicitly: start the CLI with `--workflow-mode alwaysOn` or
331
+ `--workflow-mode onDemand` (the runtime default is `disabled`). During a
332
+ workflow approval, `Change concurrency` and, when supported, `Change default
333
+ model` apply only to that workflow. From `/workflows`, `Adjust concurrency`
334
+ changes a live run in place without replaying or restarting it. `Save workflow`
335
+ writes the run's actual script to `.zcode/workflows`; `/workflows saved` starts
336
+ a new run from that definition and validates its arguments through the native
337
+ runtime.
338
+
328
339
  `/queue` manages local next-turn drafts and pauses automatic sending while its
329
340
  picker is open. Inputs already accepted by the runtime cannot be edited here.
330
341
  `/queue pause` persists across turns until `/queue resume`. Moving a draft to
package/bin/zcode.js CHANGED
@@ -918,6 +918,7 @@ async function requestAppServer(request) {
918
918
  if (envelope?.error) throw new AppServerRequestError(envelope.error.message?.trim() || "App-server request failed.", envelope.error.code, envelope.error.data);
919
919
  if (code !== 0) throw processError(stderr.trim() || `App-server exited with status ${code}.`, code);
920
920
  if (!envelope || !("result" in envelope)) throw new Error(stderr.trim() || "App-server did not return a response envelope.");
921
+ if (stderr) request.onStderr?.(stderr);
921
922
  return envelope.result;
922
923
  } finally {
923
924
  if (forceTerminationTimer) clearTimeout(forceTerminationTimer);
@@ -1935,12 +1936,20 @@ async function main(args) {
1935
1936
  process.once("SIGINT", onPluginSigint);
1936
1937
  process.once("SIGTERM", onPluginSigterm);
1937
1938
  if (process.platform !== "win32") process.once("SIGHUP", onPluginSighup);
1939
+ const builtinProviderWarnings = /* @__PURE__ */ new Set();
1938
1940
  let pluginCommand;
1939
1941
  try {
1940
1942
  pluginCommand = await runPluginCommand(args, {
1941
1943
  request: async ({ method, params, signal, workingDirectory }) => await requestAppServer({
1942
1944
  method,
1943
1945
  params,
1946
+ onStderr: (stderr) => {
1947
+ for (const line of stderr.split(/\r?\n/u)) {
1948
+ if (!line.startsWith("ZCode Built-in: ignoring unavailable ZCODE_BUILTIN_PROVIDER_CONFIG_FILE ") || builtinProviderWarnings.has(line)) continue;
1949
+ builtinProviderWarnings.add(line);
1950
+ process.stderr.write(`${line}\n`);
1951
+ }
1952
+ },
1944
1953
  signal: signal ?? pluginAbortController.signal,
1945
1954
  transport: {
1946
1955
  args: [runtimePath, "app-server"],
@@ -200,7 +200,7 @@ Plugin controls remain under `plugins`, hook declarations under
200
200
  These paths distinguish the packaged CLI from the upstream application. The
201
201
  source references below are pinned to upstream
202
202
  [`29628c9` / `v3.14.3`](https://github.com/zai-org/ZCode/tree/29628c9acdb81b703bbd4080c207a0e7ce5e276e).
203
- This package's runtime lock selects the separate Desktop 3.14.4 artifact; the
203
+ This package's runtime lock selects the separate Desktop 3.15.1 artifact; the
204
204
  public source snapshot is not an assertion of that artifact's build commit.
205
205
 
206
206
  | Client / source | User MCP file | JSON path |
@@ -425,10 +425,27 @@ there is no need to write upstream capability values into every personal model.
425
425
 
426
426
  ## Permission and planning state
427
427
 
428
- The CLI follows Desktop's three selectable permission modes: `build` (ask before
429
- changes), `edit` (edit automatically), and `yolo` (full access). `/mode` opens the
430
- picker; Shift+Tab cycles these three options. The internal `auto` value is not a
431
- menu option.
428
+ The CLI exposes four permission modes: `build` (ask before changes), `edit`
429
+ (edit automatically), `guarded` (autonomous mode; confirm risky commands), and
430
+ `yolo` (full access). `/mode` opens the picker; Shift+Tab cycles these four options.
431
+ Use `/mode guarded` or start with `--mode guarded` to enable autonomous mode.
432
+ Risk assessment and confirmation are handled by the native runtime, including
433
+ for child agents and workflows. The internal `auto` value is not a menu option.
434
+
435
+ ### Workflow mode
436
+
437
+ Workflow features follow the native runtime's `--workflow-mode` setting. The
438
+ default is `disabled`; use `--workflow-mode alwaysOn` or
439
+ `--workflow-mode onDemand` to create, tune, or start workflows. `/workflows`
440
+ inspects live runs, changes concurrency in place, and saves the current script;
441
+ `/workflows saved` lists project and global definitions and starts a new run
442
+ from a definition rather than replaying old progress.
443
+
444
+ In runtime 3.15.1, risk confirmations are single-use: the picker offers only
445
+ **Allow once** and **Deny**, never a project or session-wide grant. Guarded is a
446
+ rule-based confirmation policy, not a sandbox or a guarantee that every
447
+ potentially destructive command will be recognized. Planning restrictions still
448
+ take precedence when Plan is enabled.
432
449
 
433
450
  `/plan` toggles planning independently. `/plan on` and `/plan off` set it
434
451
  explicitly. Changing permissions keeps the Plan switch unchanged; toggling Plan
@@ -582,6 +599,20 @@ terminal application is used as both the sender and click target. Exact tab or
582
599
  pane restoration remains terminal-dependent; use the default `auto` setting so
583
600
  OSC-capable terminals can preserve their native session behavior.
584
601
 
602
+ DEC focus reporting is enabled in every TUI mode and notification setting, and
603
+ also drives cursor visibility: while another pane or terminal window has focus,
604
+ ZCode hides the hardware cursor so multiplexer splits (tmux panes, split
605
+ terminal windows) only show a live cursor in the focused session. Focus is
606
+ last-known — if the TUI restarts mid-session (display-mode switch, suspended
607
+ login) while another pane takes focus, the cursor can reappear until the next
608
+ focus change. Terminals that do not report focus keep the cursor visible.
609
+ tmux only forwards focus events when `focus-events` is enabled:
610
+
611
+ ```tmux
612
+ # ~/.tmux.conf
613
+ set -g focus-events on
614
+ ```
615
+
585
616
  Open the interactive settings picker inside the TUI (both commands are
586
617
  equivalent):
587
618
 
@@ -173,7 +173,7 @@ MCP 服务器按名称合并。当前 runtime 中,**同名服务器的用户
173
173
 
174
174
  下面区分本发行包与上游应用。源码引用固定在上游
175
175
  [`29628c9` / `v3.14.3`](https://github.com/zai-org/ZCode/tree/29628c9acdb81b703bbd4080c207a0e7ce5e276e)。
176
- 本项目 runtime lock 选择的是独立发布的 Desktop 3.14.4 产物,不能据此认定该产物
176
+ 本项目 runtime lock 选择的是独立发布的 Desktop 3.15.1 产物,不能据此认定该产物
177
177
  由这个公开源码提交构建。
178
178
 
179
179
  | 客户端/配置源 | 用户级 MCP 文件 | JSON 路径 |
@@ -361,10 +361,24 @@ Anthropic 兼容接口使用 `anthropic-messages`,Chat Completions 使用
361
361
 
362
362
  ## 权限模式与计划状态
363
363
 
364
- CLI 与桌面端一样提供三种权限模式:`build`(变更前确认)、`edit`(自动编辑)、
365
- `yolo`(完全访问)。`/mode` 打开选择器,Shift+Tab 在三种模式间循环。
364
+ CLI 提供四种权限模式:`build`(变更前确认)、`edit`(自动编辑)、
365
+ `guarded`(自主模式,风险指令执行前确认)、`yolo`(完全访问)。
366
+ `/mode` 打开选择器,Shift+Tab 在四种模式间循环。
367
+ 使用 `/mode guarded` 或启动参数 `--mode guarded` 开启自主模式。
368
+ 风险判定和确认由原生 runtime 负责,子代理和工作流也保留该保护。
366
369
  底层的 `auto` 值不作为菜单选项。
367
370
 
371
+ ### 工作流模式
372
+
373
+ 工作流能力由原生 runtime 的 `--workflow-mode` 控制。默认值是 `disabled`;使用
374
+ `--workflow-mode alwaysOn` 或 `--workflow-mode onDemand` 才能创建、调整和启动工作流。
375
+ `/workflows` 可查看运行中的工作流、原地调整并发或保存当前脚本;`/workflows saved`
376
+ 列出项目级和全局已保存定义,并从定义启动一个新的 run,而不是回放旧进度。
377
+
378
+ runtime 3.15.1 的风险确认只允许本次授权:选择器仅提供 **Allow once** 和 **Deny**,
379
+ 不会提供项目或会话级永久放行。自主模式是基于规则的确认策略,不是沙箱,
380
+ 也不保证识别所有潜在破坏性指令。Plan 开启时,计划模式的执行限制仍然优先。
381
+
368
382
  `/plan` 独立切换计划开关,也可以用 `/plan on`、`/plan off` 明确指定状态。
369
383
  切换权限不会改变 Plan 开关,切换 Plan 也不会改变权限。验证由原生 runtime 负责,
370
384
  包括 Plan 与进行中的 Goal 不可同时开启的限制。
@@ -488,6 +502,18 @@ macOS 的 `terminal-notifier`、Linux 的 `notify-send` 或 Windows 的 `SnoreTo
488
502
  macOS 会将检测到的终端 App 用作发送者和点击目标。能否恢复精确的标签页或窗格取决于终端;
489
503
  默认 `auto` 可以保留支持 OSC 的终端原生行为。
490
504
 
505
+ DEC 焦点报告在任何 TUI 模式和通知设置下都会启用,同时驱动光标可见性:
506
+ 当其他窗格或终端窗口获得焦点时,ZCode 会隐藏硬件光标,使多路复用器分屏
507
+ (tmux 窗格、拆分终端窗口)只在获得焦点的会话中显示活动光标。
508
+ 焦点状态为“最后已知”——若 TUI 在会话中重启(显示模式切换、挂起的登录)期间
509
+ 其他窗格获得焦点,光标可能重新出现,直到下一次焦点变化。
510
+ 不支持焦点报告的终端会保持光标可见。tmux 只有在启用 `focus-events` 时才会转发焦点事件:
511
+
512
+ ```tmux
513
+ # ~/.tmux.conf
514
+ set -g focus-events on
515
+ ```
516
+
491
517
  在 TUI 中打开设置:
492
518
 
493
519
  ```text
@@ -12,6 +12,31 @@ for the `mcp.servers` structure and HTTP/stdio examples.
12
12
  provider schema. It is valid JSON without comments. This reference explains the
13
13
  fields, alternatives and restrictions that cannot be expressed as JSON comments.
14
14
 
15
+ ## Built-in catalog environment overrides
16
+
17
+ The CLI normally discovers its bundled catalog at `vendor/provider/zcode-builtin.json`
18
+ and initializes a separate active snapshot. It does not require
19
+ `ZCODE_BUILTIN_PROVIDER_CONFIG_FILE` to be set.
20
+
21
+ A valid override is preserved. Blank override values are treated as unset. If an
22
+ inherited override points to a missing, unreadable or invalid built-in release,
23
+ the CLI warns and recovers using a validated bundled catalog, preserving the
24
+ personal provider path and normal active-snapshot initialization. A valid
25
+ `ZCODE_BUILTIN_PROVIDER_BUNDLED_CONFIG_FILE` is preferred during recovery;
26
+ otherwise the runtime discovers the packaged catalog. If no valid fallback is
27
+ available, the original startup failure is not hidden. Recovery does not modify
28
+ the invalid override file.
29
+
30
+ On older CLI versions, remove a stale override for a single invocation:
31
+
32
+ ```sh
33
+ env -u ZCODE_BUILTIN_PROVIDER_CONFIG_FILE zcode plugins marketplace update <marketplace>
34
+ ```
35
+
36
+ If this resolves the failure, remove or correct the inherited path in the shell
37
+ or host launcher that sets it. Do not copy the bundled catalog into arbitrary
38
+ Desktop-version cache directories.
39
+
15
40
  ## Using the example
16
41
 
17
42
  The example deliberately contains three different model configurations:
@@ -11,6 +11,26 @@ ZCode 桌面端与 CLI 共用 `~/.zcode/v2/provider_config.json`,文件名使
11
11
  它是可以解析的标准 JSON,不包含注释;各字段的含义、可选值及互斥关系由本文说明。
12
12
  本文的“智能配置”对应英文界面的 **Smart configuration**。
13
13
 
14
+ ## 内置目录环境变量覆盖
15
+
16
+ CLI 默认自动发现 `vendor/provider/zcode-builtin.json`,并初始化独立的 active 快照,
17
+ 不需要设置 `ZCODE_BUILTIN_PROVIDER_CONFIG_FILE`。
18
+
19
+ 有效的覆盖路径保持不变;空字符串或纯空白按未设置处理。继承的覆盖路径指向不存在、
20
+ 不可读或无效的 built-in release 时,CLI 会告警,并使用已验证的 bundled 目录恢复,
21
+ 保留个人 provider 路径及正常的 active 快照初始化。恢复时优先使用有效的
22
+ `ZCODE_BUILTIN_PROVIDER_BUNDLED_CONFIG_FILE`,否则由 runtime 自动发现包内目录。
23
+ 没有有效 fallback 时,不会掩盖原有启动失败;恢复过程也不会修改无效覆盖文件。
24
+
25
+ 旧版 CLI 可在单次调用中移除失效的覆盖变量:
26
+
27
+ ```sh
28
+ env -u ZCODE_BUILTIN_PROVIDER_CONFIG_FILE zcode plugins marketplace update <marketplace>
29
+ ```
30
+
31
+ 若这样可以恢复,请检查并移除或修正 shell、宿主启动器注入的旧路径,不要将 bundled
32
+ 目录手动复制到任意 Desktop 版本的缓存目录。
33
+
14
34
  ## 使用示例文件
15
35
 
16
36
  示例包含三种用途不同的模型:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zcode-app-cli",
3
- "version": "3.14.5-34",
3
+ "version": "3.15.3-36",
4
4
  "description": "Unofficial terminal client for the ZCode agent runtime",
5
5
  "keywords": [
6
6
  "agent",
@@ -60,7 +60,9 @@
60
60
  "sync:local": "bun run build && bun scripts/sync-runtime.ts --app /Applications/ZCode.app",
61
61
  "check": "bun run build && bun scripts/check-runtime.ts",
62
62
  "check:oauth-callback": "bun scripts/smoke-oauth-callback.ts",
63
- "check:tui": "bun scripts/smoke-tui.ts && bun scripts/smoke-tui-features.ts && bun scripts/smoke-tui-clear.ts && bun scripts/smoke-tui-session-title.ts && bun scripts/smoke-tui-pressure.ts && bun scripts/smoke-tui-widths.ts && bun scripts/smoke-tui-fullscreen.ts && bun scripts/smoke-tui-fullscreen-switch.ts && bun scripts/smoke-tui-fullscreen-layout.ts",
63
+ "check:tui": "bun scripts/smoke-tui.ts && bun scripts/smoke-tui-features.ts && bun scripts/smoke-tui-clear.ts && bun scripts/smoke-tui-session-title.ts && bun scripts/smoke-tui-pressure.ts && bun scripts/smoke-tui-widths.ts && bun scripts/smoke-tui-fullscreen.ts && bun scripts/smoke-tui-fullscreen-switch.ts && bun scripts/smoke-tui-fullscreen-layout.ts && bun run check:tui:focus",
64
+ "check:tui:focus": "bun scripts/smoke-tui-focus.ts regular off always && bun scripts/smoke-tui-focus.ts fullscreen off always && bun scripts/smoke-tui-focus.ts regular bel unfocused && bun scripts/smoke-tui-focus.ts fullscreen bel unfocused && bun scripts/smoke-tui-focus.ts fullscreen off always built",
65
+ "check:tui:focus:manual": "bun scripts/manual-tui-focus.ts",
64
66
  "check:tui-scenarios": "bun run test:tui",
65
67
  "test": "bun run test:unit",
66
68
  "test:all": "bun run test:unit && bun run test:tui && bun run test:runtime && bun run test:node",
@@ -70,7 +72,7 @@
70
72
  "test:node": "node --test test/node/*.test.cjs",
71
73
  "test:tui": "bun run test:tui:component && bun run test:tui:e2e",
72
74
  "test:tui:component": "bun test test/tui/scenario-http.test.ts test/tui/scenario-runtime.test.ts test/tui/scenario-shell.test.ts test/tui/scenario-workspace.test.ts test/tui/terminal-screen.test.ts",
73
- "test:tui:e2e": "bun test test/tui/allowlisted-shell.test.ts test/tui/dynamic-workflows.test.ts test/tui/http-mock.test.ts test/tui/input-actions.test.ts test/tui/model-resume.test.ts test/tui/permission-request-queue.test.ts test/tui/run-scenario.test.ts test/tui/runtime-refresh.test.ts test/tui/session-rename.test.ts test/tui/terminal-session.test.ts test/tui/write-and-diff.test.ts",
75
+ "test:tui:e2e": "bun test test/tui/allowlisted-shell.test.ts test/tui/dynamic-workflows.test.ts test/tui/http-mock.test.ts test/tui/input-actions.test.ts test/tui/model-resume.test.ts test/tui/permission-request-queue.test.ts test/tui/run-scenario.test.ts test/tui/runtime-refresh.test.ts test/tui/session-rename.test.ts test/tui/startup.test.ts test/tui/terminal-session.test.ts test/tui/write-and-diff.test.ts",
74
76
  "test:tui:host": "bun test test/tui/scenario-mountx.test.ts",
75
77
  "test:tui:manual": "bun scripts/tui-scenario.ts --manual",
76
78
  "test:tui-scenario": "bun scripts/tui-scenario.ts",
@@ -182,6 +182,92 @@ async function sendTuiBackgroundTaskMessage(app, bridge, input) {
182
182
  });
183
183
  }
184
184
  //#endregion
185
+ //#region src/runtime-workflow-bridge.ts
186
+ async function startTuiSavedWorkflow(app, input) {
187
+ if (app.runtime?.config?.dynamicWorkflowEnabled !== true) return {
188
+ ok: false,
189
+ reason: "workflow_disabled",
190
+ message: "Restart with --workflow-mode alwaysOn or onDemand to run workflows."
191
+ };
192
+ if (input.scope !== "project" && input.scope !== "global") throw new Error("Choose project or global workflow scope.");
193
+ if (!app.startSavedWorkflow) return {
194
+ ok: false,
195
+ reason: "unsupported"
196
+ };
197
+ return await app.startSavedWorkflow(input);
198
+ }
199
+ function createTuiWorkflowManagement(deps) {
200
+ const workspace = {
201
+ workspacePath: deps.cwd,
202
+ workspaceKey: deps.cwd
203
+ };
204
+ const scope = (value) => {
205
+ if (value !== "project" && value !== "global") throw new Error("Choose project or global workflow scope.");
206
+ return value;
207
+ };
208
+ const ownedTask = async (runId) => {
209
+ const task = await deps.port.getTask(runId);
210
+ return task?.parentSessionId === deps.sessionId ? task : void 0;
211
+ };
212
+ return {
213
+ retuneWorkflowConcurrency: async (input) => {
214
+ if (input.maxConcurrency !== null && (!Number.isSafeInteger(input.maxConcurrency) || input.maxConcurrency < 1)) throw new Error("Concurrency must be a positive integer or null for the default.");
215
+ const task = await ownedTask(input.runId);
216
+ if (!task) return {
217
+ ok: false,
218
+ reason: "not_found"
219
+ };
220
+ const status = task.runStatus ?? task.status;
221
+ if (status !== "running" && status !== "pending") return {
222
+ ok: false,
223
+ reason: "not_live"
224
+ };
225
+ if (!deps.port.retuneConcurrency) return {
226
+ ok: false,
227
+ reason: "unsupported"
228
+ };
229
+ return await deps.port.retuneConcurrency(input);
230
+ },
231
+ listSavedWorkflows: async () => {
232
+ const results = await Promise.all(["project", "global"].map(async (value) => {
233
+ const result = await deps.native.list({
234
+ workspace,
235
+ scope: value
236
+ });
237
+ return {
238
+ workflows: result.workflows ?? [],
239
+ invalid: result.invalid ?? []
240
+ };
241
+ }));
242
+ return {
243
+ workflows: results.flatMap((result) => result.workflows),
244
+ invalid: results.flatMap((result) => result.invalid)
245
+ };
246
+ },
247
+ readSavedWorkflow: async (input) => {
248
+ return await deps.native.read({
249
+ workspace,
250
+ name: input.name,
251
+ scope: scope(input.scope)
252
+ });
253
+ },
254
+ saveWorkflowRun: async (input) => {
255
+ if (!await ownedTask(input.runId)) return {
256
+ ok: false,
257
+ reason: "not_found"
258
+ };
259
+ return await deps.native.save({ deps: { sessionStore: deps.sessionStore } }, {
260
+ workspace,
261
+ runId: input.runId,
262
+ name: input.name,
263
+ scope: scope(input.scope),
264
+ meta: { description: input.description },
265
+ overwrite: input.overwrite === true
266
+ });
267
+ }
268
+ };
269
+ }
270
+ //#endregion
185
271
  //#region src/runtime-background-restore.ts
186
272
  const maximumReminderLength = 4e3;
187
273
  async function restoreSessionChildren(app, sessionId, queries) {
@@ -942,6 +1028,7 @@ async function migrateLegacyProviders(options) {
942
1028
  exports.appServerRegistryOptions = appServerRegistryOptions;
943
1029
  exports.assertSessionModelReady = assertSessionModelReady;
944
1030
  exports.browserOpenCommand = browserOpenCommand;
1031
+ exports.createTuiWorkflowManagement = createTuiWorkflowManagement;
945
1032
  exports.exchangeBigmodelOAuthCode = exchangeBigmodelOAuthCode;
946
1033
  exports.inspectRuntimeConfiguration = inspectRuntimeConfiguration;
947
1034
  exports.installSqliteWriteRecovery = installSqliteWriteRecovery;
@@ -954,4 +1041,5 @@ exports.readTuiRuntimeProjection = readTuiRuntimeProjection;
954
1041
  exports.restoreTuiBackgroundTasks = restoreTuiBackgroundTasks;
955
1042
  exports.sendTuiBackgroundTaskMessage = sendTuiBackgroundTaskMessage;
956
1043
  exports.sqliteRecoveryStats = sqliteRecoveryStats;
1044
+ exports.startTuiSavedWorkflow = startTuiSavedWorkflow;
957
1045
  exports.writeConfigurationDoctor = writeConfigurationDoctor;
@@ -1,9 +1,9 @@
1
1
  {
2
- "appVersion": "3.14.5",
2
+ "appVersion": "3.15.3",
3
3
  "cliVersion": "0.16.9",
4
- "extractedAt": "2026-10-11T04:05:50.928Z",
5
- "sha512": "FNqGJ+XVyUxIdZ7bxppph4R5M9kFS0zL64ztpItZV933eKVuVxtpZ3BnLMRpwIXouPGrLIDw8zSTrctiUgbmbA==",
6
- "source": "https://cdn-zcode.z.ai/zcode/electron/releases/3.14.5/linux-x64/ZCode-3.14.5-linux-x64.deb",
4
+ "extractedAt": "2026-10-16T01:44:21.858Z",
5
+ "sha512": "9RigUj20tjuaskzBt2sgWLtIuUaIET67x5joShRIgwLlbFcO/oWt1eemrlLn5ZskXUMzcUHtUTCKU8+mHF7kQQ==",
6
+ "source": "https://cdn-zcode.z.ai/zcode/electron/releases/3.15.3/linux-x64/ZCode-3.15.3-linux-x64.deb",
7
7
  "runtimeCapabilities": {
8
8
  "schemaVersion": 1,
9
9
  "cli": {
@@ -81,6 +81,9 @@
81
81
  "surface": {
82
82
  "type": "string"
83
83
  },
84
+ "workflow-mode": {
85
+ "type": "string"
86
+ },
84
87
  "all": {
85
88
  "type": "boolean"
86
89
  },
@@ -101,6 +104,11 @@
101
104
  }
102
105
  },
103
106
  "runtimePatches": [
107
+ {
108
+ "id": "tui-workflow-management",
109
+ "requirement": "required",
110
+ "status": "applied"
111
+ },
104
112
  {
105
113
  "id": "tui-workflow-reducer",
106
114
  "requirement": "optional",
@@ -121,6 +129,11 @@
121
129
  "requirement": "required",
122
130
  "status": "applied"
123
131
  },
132
+ {
133
+ "id": "builtin-provider-env-recovery",
134
+ "requirement": "required",
135
+ "status": "applied"
136
+ },
124
137
  {
125
138
  "id": "configuration-diagnostics",
126
139
  "requirement": "required",
@@ -136,6 +149,11 @@
136
149
  "requirement": "optional",
137
150
  "status": "applied"
138
151
  },
152
+ {
153
+ "id": "resolved-context-window",
154
+ "requirement": "required",
155
+ "status": "applied"
156
+ },
139
157
  {
140
158
  "id": "tui-bridge",
141
159
  "requirement": "required",
@@ -169,7 +187,7 @@
169
187
  {
170
188
  "id": "http-no-content",
171
189
  "requirement": "required",
172
- "status": "applied"
190
+ "status": "already_present"
173
191
  },
174
192
  {
175
193
  "id": "network-retry-classification",
@@ -209,7 +227,7 @@
209
227
  {
210
228
  "id": "bigmodel-oauth",
211
229
  "requirement": "required",
212
- "status": "applied"
230
+ "status": "already_present"
213
231
  },
214
232
  {
215
233
  "id": "browser-url-opening",