@zergai/ztc 0.4.1-dev.36919234045 → 0.5.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (678) hide show
  1. package/README.md +390 -44
  2. package/RUST_THIRD_PARTY_LICENSES.txt +1080 -822
  3. package/THIRD_PARTY_NOTICES.md +269 -12
  4. package/bin/zmux-darwin-arm64 +0 -0
  5. package/bin/ztc-audio-darwin-arm64 +0 -0
  6. package/bin/ztc-capture-darwin-arm64 +0 -0
  7. package/bin/ztc-computer-darwin-arm64 +0 -0
  8. package/bin/ztc-llm-darwin-arm64 +0 -0
  9. package/bin/ztc-tts-darwin-arm64 +0 -0
  10. package/bin/ztc-tui-darwin-arm64 +0 -0
  11. package/bin/ztc-zlicky-overlay-darwin-arm64 +0 -0
  12. package/bin/zterm-darwin-arm64 +0 -0
  13. package/dist/App.js +1204 -207
  14. package/dist/agent/agent.d.ts +74 -8
  15. package/dist/agent/agent.js +1035 -182
  16. package/dist/agent/backends/account_rotation.d.ts +4 -0
  17. package/dist/agent/backends/account_rotation.js +8 -2
  18. package/dist/agent/backends/anthropic.d.ts +13 -0
  19. package/dist/agent/backends/anthropic.js +164 -18
  20. package/dist/agent/backends/claude_cli.js +18 -8
  21. package/dist/agent/backends/codex_app_server.d.ts +1 -0
  22. package/dist/agent/backends/codex_app_server.js +55 -3
  23. package/dist/agent/backends/codex_auth.d.ts +1 -0
  24. package/dist/agent/backends/codex_auth.js +67 -13
  25. package/dist/agent/backends/codex_buffered_recovery.d.ts +27 -0
  26. package/dist/agent/backends/codex_buffered_recovery.js +293 -0
  27. package/dist/agent/backends/gemini.js +1 -1
  28. package/dist/agent/backends/http_error.d.ts +26 -0
  29. package/dist/agent/backends/http_error.js +221 -0
  30. package/dist/agent/backends/index.d.ts +8 -2
  31. package/dist/agent/backends/index.js +12 -1
  32. package/dist/agent/backends/openai_compatible.d.ts +3 -4
  33. package/dist/agent/backends/openai_compatible.js +8 -11
  34. package/dist/agent/backends/openai_responses.d.ts +8 -3
  35. package/dist/agent/backends/openai_responses.js +77 -33
  36. package/dist/agent/backends/request_metrics.js +12 -2
  37. package/dist/agent/backends/types.d.ts +108 -6
  38. package/dist/agent/backends/types.js +5 -1
  39. package/dist/agent/backends/zrouter_stream.d.ts +2 -1
  40. package/dist/agent/backends/zrouter_stream.js +26 -12
  41. package/dist/agent/background_registry.d.ts +2 -0
  42. package/dist/agent/background_registry.js +1 -0
  43. package/dist/agent/claim_observation.d.ts +6 -0
  44. package/dist/agent/claim_observation.js +54 -0
  45. package/dist/agent/commands/accounts.js +46 -177
  46. package/dist/agent/commands/attention.d.ts +2 -0
  47. package/dist/agent/commands/attention.js +67 -0
  48. package/dist/agent/commands/auth.js +18 -2
  49. package/dist/agent/commands/board.d.ts +2 -0
  50. package/dist/agent/commands/board.js +169 -0
  51. package/dist/agent/commands/clipboard.js +50 -1
  52. package/dist/agent/commands/compact.js +15 -8
  53. package/dist/agent/commands/desktop.d.ts +2 -0
  54. package/dist/agent/commands/desktop.js +29 -0
  55. package/dist/agent/commands/environment.d.ts +3 -0
  56. package/dist/agent/commands/environment.js +109 -0
  57. package/dist/agent/commands/evidence.d.ts +2 -0
  58. package/dist/agent/commands/evidence.js +9 -0
  59. package/dist/agent/commands/fork.js +4 -3
  60. package/dist/agent/commands/goal.d.ts +33 -1
  61. package/dist/agent/commands/goal.js +174 -14
  62. package/dist/agent/commands/goal_exit.d.ts +36 -0
  63. package/dist/agent/commands/goal_exit.js +120 -0
  64. package/dist/agent/commands/help.js +3 -1
  65. package/dist/agent/commands/history.js +3 -1
  66. package/dist/agent/commands/inbox.d.ts +2 -0
  67. package/dist/agent/commands/inbox.js +148 -0
  68. package/dist/agent/commands/index.js +16 -1
  69. package/dist/agent/commands/input_mode.js +8 -6
  70. package/dist/agent/commands/job.d.ts +2 -0
  71. package/dist/agent/commands/job.js +93 -0
  72. package/dist/agent/commands/keybindings.js +4 -1
  73. package/dist/agent/commands/label.d.ts +2 -0
  74. package/dist/agent/commands/label.js +77 -0
  75. package/dist/agent/commands/layout.d.ts +2 -0
  76. package/dist/agent/commands/layout.js +20 -0
  77. package/dist/agent/commands/mirror.js +16 -1
  78. package/dist/agent/commands/permissions.d.ts +3 -1
  79. package/dist/agent/commands/permissions.js +79 -89
  80. package/dist/agent/commands/plan.js +5 -15
  81. package/dist/agent/commands/provider_selection.js +9 -3
  82. package/dist/agent/commands/rename.js +1 -1
  83. package/dist/agent/commands/resources.d.ts +2 -0
  84. package/dist/agent/commands/resources.js +67 -0
  85. package/dist/agent/commands/rewind.d.ts +3 -0
  86. package/dist/agent/commands/rewind.js +16 -0
  87. package/dist/agent/commands/runbooks.d.ts +2 -0
  88. package/dist/agent/commands/runbooks.js +73 -0
  89. package/dist/agent/commands/runbooks_lazy.d.ts +2 -0
  90. package/dist/agent/commands/runbooks_lazy.js +8 -0
  91. package/dist/agent/commands/sessions.d.ts +1 -1
  92. package/dist/agent/commands/sessions.js +33 -5
  93. package/dist/agent/commands/settings.js +140 -32
  94. package/dist/agent/commands/setup.d.ts +2 -0
  95. package/dist/agent/commands/setup.js +78 -0
  96. package/dist/agent/commands/share.d.ts +2 -0
  97. package/dist/agent/commands/share.js +64 -0
  98. package/dist/agent/commands/status.js +14 -2
  99. package/dist/agent/commands/types.d.ts +81 -7
  100. package/dist/agent/commands/update.js +8 -0
  101. package/dist/agent/commands/usage.d.ts +2 -0
  102. package/dist/agent/commands/usage.js +8 -0
  103. package/dist/agent/factory.d.ts +11 -0
  104. package/dist/agent/factory.js +100 -21
  105. package/dist/agent/loop_policy.d.ts +6 -3
  106. package/dist/agent/loop_policy.js +12 -3
  107. package/dist/agent/measurement_guidance.d.ts +2 -0
  108. package/dist/agent/measurement_guidance.js +5 -0
  109. package/dist/agent/request_encoder.d.ts +8 -1
  110. package/dist/agent/request_encoder.js +95 -23
  111. package/dist/agent/runtime/benchmark_comparison.d.ts +30 -0
  112. package/dist/agent/runtime/benchmark_comparison.js +94 -0
  113. package/dist/agent/runtime/benchmark_contract.d.ts +48 -0
  114. package/dist/agent/runtime/benchmark_contract.js +90 -0
  115. package/dist/agent/runtime/checked_commands.d.ts +32 -0
  116. package/dist/agent/runtime/checked_commands.js +119 -0
  117. package/dist/agent/runtime/command_execution_policy.d.ts +26 -0
  118. package/dist/agent/runtime/command_execution_policy.js +91 -0
  119. package/dist/agent/runtime/command_jobs.d.ts +36 -18
  120. package/dist/agent/runtime/command_jobs.js +151 -13
  121. package/dist/agent/runtime/command_panes.d.ts +59 -0
  122. package/dist/agent/runtime/command_panes.js +398 -0
  123. package/dist/agent/runtime/command_wait.d.ts +19 -0
  124. package/dist/agent/runtime/command_wait.js +167 -0
  125. package/dist/agent/runtime/cpu_benchmark.d.ts +30 -0
  126. package/dist/agent/runtime/cpu_benchmark.js +126 -0
  127. package/dist/agent/runtime/delegated_evidence.d.ts +26 -0
  128. package/dist/agent/runtime/delegated_evidence.js +80 -0
  129. package/dist/agent/runtime/evidence.d.ts +127 -0
  130. package/dist/agent/runtime/evidence.js +468 -0
  131. package/dist/agent/runtime/execution_context.d.ts +7 -0
  132. package/dist/agent/runtime/execution_context.js +39 -3
  133. package/dist/agent/runtime/json_verifier_recipe.d.ts +8 -0
  134. package/dist/agent/runtime/json_verifier_recipe.js +66 -0
  135. package/dist/agent/runtime/measurements.d.ts +110 -0
  136. package/dist/agent/runtime/measurements.js +317 -0
  137. package/dist/agent/runtime/policy.d.ts +4 -0
  138. package/dist/agent/runtime/policy.js +31 -20
  139. package/dist/agent/runtime/provider_native_evidence.d.ts +20 -0
  140. package/dist/agent/runtime/provider_native_evidence.js +86 -0
  141. package/dist/agent/runtime/recovery.d.ts +2 -0
  142. package/dist/agent/runtime/recovery.js +45 -2
  143. package/dist/agent/runtime/remote_broker_transport.d.ts +10 -0
  144. package/dist/agent/runtime/remote_broker_transport.js +84 -0
  145. package/dist/agent/runtime/remote_deletion_receipts.d.ts +3 -0
  146. package/dist/agent/runtime/remote_deletion_receipts.js +43 -0
  147. package/dist/agent/runtime/remote_journal_replay.d.ts +13 -0
  148. package/dist/agent/runtime/remote_journal_replay.js +233 -0
  149. package/dist/agent/runtime/remote_mutation_journal.d.ts +25 -0
  150. package/dist/agent/runtime/remote_mutation_journal.js +208 -0
  151. package/dist/agent/runtime/remote_resource_endpoint.d.ts +7 -0
  152. package/dist/agent/runtime/remote_resource_endpoint.js +6 -0
  153. package/dist/agent/runtime/remote_resource_errors.d.ts +5 -0
  154. package/dist/agent/runtime/remote_resource_errors.js +9 -0
  155. package/dist/agent/runtime/remote_resource_script.d.ts +2 -0
  156. package/dist/agent/runtime/remote_resource_script.js +1009 -0
  157. package/dist/agent/runtime/remote_resources.d.ts +29 -0
  158. package/dist/agent/runtime/remote_resources.js +160 -0
  159. package/dist/agent/runtime/source_verification.d.ts +12 -0
  160. package/dist/agent/runtime/source_verification.js +210 -0
  161. package/dist/agent/runtime/source_verification_contract.d.ts +75 -0
  162. package/dist/agent/runtime/source_verification_contract.js +203 -0
  163. package/dist/agent/runtime/tool_checkpoints.d.ts +11 -0
  164. package/dist/agent/runtime/tool_checkpoints.js +26 -0
  165. package/dist/agent/runtime/tool_effects.d.ts +5 -0
  166. package/dist/agent/runtime/tool_progress.d.ts +12 -0
  167. package/dist/agent/runtime/tool_progress.js +76 -0
  168. package/dist/agent/runtime/tool_runtime.d.ts +16 -1
  169. package/dist/agent/runtime/tool_runtime.js +204 -10
  170. package/dist/agent/runtime/tracing.d.ts +1 -1
  171. package/dist/agent/runtime/verifier_capture.d.ts +9 -0
  172. package/dist/agent/runtime/verifier_capture.js +100 -0
  173. package/dist/agent/runtime/verifier_contract.d.ts +24 -0
  174. package/dist/agent/runtime/verifier_contract.js +41 -0
  175. package/dist/agent/subagent.d.ts +20 -0
  176. package/dist/agent/subagent.js +244 -29
  177. package/dist/agent/tool_response_directory.d.ts +24 -0
  178. package/dist/agent/tool_response_directory.js +61 -0
  179. package/dist/agent/tool_response_source.d.ts +8 -0
  180. package/dist/agent/tool_response_source.js +49 -0
  181. package/dist/agent/tool_response_store.d.ts +74 -3
  182. package/dist/agent/tool_response_store.js +579 -62
  183. package/dist/agent/tools/ask_user.d.ts +3 -1
  184. package/dist/agent/tools/ask_user.js +30 -11
  185. package/dist/agent/tools/background.js +1 -0
  186. package/dist/agent/tools/benchmark_cpu.d.ts +2 -0
  187. package/dist/agent/tools/benchmark_cpu.js +102 -0
  188. package/dist/agent/tools/compare_benchmarks.d.ts +2 -0
  189. package/dist/agent/tools/compare_benchmarks.js +53 -0
  190. package/dist/agent/tools/deferred.js +1 -0
  191. package/dist/agent/tools/delegate.js +18 -2
  192. package/dist/agent/tools/helper_requirements.d.ts +7 -0
  193. package/dist/agent/tools/helper_requirements.js +19 -0
  194. package/dist/agent/tools/index.d.ts +1 -0
  195. package/dist/agent/tools/index.js +3 -0
  196. package/dist/agent/tools/measurement_report.d.ts +22 -0
  197. package/dist/agent/tools/measurement_report.js +190 -0
  198. package/dist/agent/tools/project_context.d.ts +3 -0
  199. package/dist/agent/tools/project_context.js +45 -0
  200. package/dist/agent/tools/recall_tool_response.d.ts +3 -5
  201. package/dist/agent/tools/recall_tool_response.js +19 -29
  202. package/dist/agent/tools/registry.d.ts +1 -0
  203. package/dist/agent/tools/registry.js +23 -0
  204. package/dist/agent/tools/related_sessions.d.ts +2 -0
  205. package/dist/agent/tools/related_sessions.js +156 -0
  206. package/dist/agent/tools/routine.js +13 -3
  207. package/dist/agent/tools/session_evidence.d.ts +3 -0
  208. package/dist/agent/tools/session_evidence.js +72 -0
  209. package/dist/agent/tools/shell.d.ts +4 -3
  210. package/dist/agent/tools/shell.js +174 -47
  211. package/dist/agent/tools/tool_search.js +3 -2
  212. package/dist/agent/tools/types.d.ts +28 -0
  213. package/dist/agent/tools/verify_artifact.d.ts +2 -0
  214. package/dist/agent/tools/verify_artifact.js +60 -0
  215. package/dist/agent/tools/workflow.js +1 -0
  216. package/dist/app/activity.d.ts +6 -1
  217. package/dist/app/activity.js +81 -12
  218. package/dist/app/agent_runner.d.ts +6 -1
  219. package/dist/app/agent_runner.js +34 -19
  220. package/dist/app/command_context.js +76 -3
  221. package/dist/app/controller.d.ts +15 -4
  222. package/dist/app/controller.js +29 -3
  223. package/dist/app/escape_stop.d.ts +11 -0
  224. package/dist/app/escape_stop.js +15 -0
  225. package/dist/app/liveness.d.ts +6 -4
  226. package/dist/app/liveness.js +13 -3
  227. package/dist/app/ordered_transcript.js +43 -4
  228. package/dist/app/prompt_turn.d.ts +14 -0
  229. package/dist/app/prompt_turn.js +53 -0
  230. package/dist/app/recap.d.ts +3 -0
  231. package/dist/app/recap.js +9 -3
  232. package/dist/app/restart.d.ts +3 -2
  233. package/dist/app/restart.js +7 -3
  234. package/dist/app/rewind.d.ts +3 -3
  235. package/dist/app/rewind.js +3 -3
  236. package/dist/app/selection_completion.js +10 -3
  237. package/dist/app/session_manager.d.ts +38 -6
  238. package/dist/app/session_manager.js +252 -54
  239. package/dist/app/session_messages.d.ts +3 -0
  240. package/dist/app/session_messages.js +60 -0
  241. package/dist/app/task_scope_router.d.ts +20 -0
  242. package/dist/app/task_scope_router.js +173 -0
  243. package/dist/app/transcript_window.d.ts +2 -0
  244. package/dist/app/transcript_window.js +4 -0
  245. package/dist/app/workspace_admission_details.d.ts +3 -0
  246. package/dist/app/workspace_admission_details.js +26 -0
  247. package/dist/app/workspace_layout_controller.d.ts +11 -0
  248. package/dist/app/workspace_layout_controller.js +88 -0
  249. package/dist/app/workspace_monitor.d.ts +1 -0
  250. package/dist/app/workspace_monitor.js +216 -0
  251. package/dist/app/workspace_presets.d.ts +29 -0
  252. package/dist/app/workspace_presets.js +192 -0
  253. package/dist/attention/queue.d.ts +37 -0
  254. package/dist/attention/queue.js +183 -0
  255. package/dist/bench/rf_shared.d.ts +2 -0
  256. package/dist/board/binding.d.ts +42 -0
  257. package/dist/board/binding.js +38 -0
  258. package/dist/board/client.d.ts +42 -0
  259. package/dist/board/client.js +60 -0
  260. package/dist/cli.js +1 -1
  261. package/dist/cli_args.js +17 -1
  262. package/dist/cli_main.js +86 -8
  263. package/dist/cli_ratatui.d.ts +183 -16
  264. package/dist/cli_ratatui.js +3916 -1219
  265. package/dist/components/ActivityLine.d.ts +3 -2
  266. package/dist/components/ActivityLine.js +2 -2
  267. package/dist/components/InputArea.d.ts +19 -1
  268. package/dist/components/InputArea.js +264 -190
  269. package/dist/components/MessageList.d.ts +2 -0
  270. package/dist/components/MessageList.js +3 -1
  271. package/dist/components/SingleMessage.d.ts +2 -0
  272. package/dist/components/SingleMessage.js +4 -2
  273. package/dist/components/StatusBar.d.ts +4 -2
  274. package/dist/components/StatusBar.js +3 -1
  275. package/dist/conductor_branch.js +3 -0
  276. package/dist/config/api_retry.d.ts +6 -1
  277. package/dist/config/api_retry.js +19 -1
  278. package/dist/config/message_display.d.ts +1 -0
  279. package/dist/config/message_display.js +17 -2
  280. package/dist/config/permissions.d.ts +21 -0
  281. package/dist/config/permissions.js +89 -0
  282. package/dist/config/types.d.ts +32 -5
  283. package/dist/config.d.ts +4 -2
  284. package/dist/config.js +63 -13
  285. package/dist/context/project_intelligence.d.ts +44 -0
  286. package/dist/context/project_intelligence.js +246 -0
  287. package/dist/desktop/cli_launch.d.ts +8 -0
  288. package/dist/desktop/cli_launch.js +6 -0
  289. package/dist/desktop/cli_shim.d.ts +8 -0
  290. package/dist/desktop/cli_shim.js +120 -0
  291. package/dist/desktop/runtime.d.ts +16 -0
  292. package/dist/desktop/runtime.js +161 -0
  293. package/dist/desktop/worker_launch.d.ts +7 -0
  294. package/dist/desktop/worker_launch.js +7 -0
  295. package/dist/diagnostics/cargo_mutants_selection.d.ts +27 -0
  296. package/dist/diagnostics/cargo_mutants_selection.js +48 -0
  297. package/dist/diagnostics/native_terminal_benchmark.d.ts +58 -0
  298. package/dist/diagnostics/native_terminal_benchmark.js +1247 -0
  299. package/dist/diagnostics/session_evidence_package.d.ts +40 -0
  300. package/dist/diagnostics/session_evidence_package.js +234 -0
  301. package/dist/diagnostics/session_export.d.ts +93 -0
  302. package/dist/diagnostics/session_export.js +634 -0
  303. package/dist/emulation/tool_adapters.js +48 -18
  304. package/dist/emulation/ztc_addendum.d.ts +1 -0
  305. package/dist/emulation/ztc_addendum.js +13 -12
  306. package/dist/environment/service_runner.d.ts +1 -0
  307. package/dist/environment/service_runner.js +68 -0
  308. package/dist/environment/store.d.ts +120 -0
  309. package/dist/environment/store.js +387 -0
  310. package/dist/events.d.ts +40 -1
  311. package/dist/events.js +10 -17
  312. package/dist/goal_contract.d.ts +25 -0
  313. package/dist/goal_contract.js +44 -0
  314. package/dist/headless.d.ts +31 -0
  315. package/dist/headless.js +576 -70
  316. package/dist/headless_cli.js +8 -0
  317. package/dist/headless_cli_args.d.ts +1 -0
  318. package/dist/headless_cli_args.js +1 -0
  319. package/dist/intake/cli.d.ts +1 -0
  320. package/dist/intake/cli.js +33 -0
  321. package/dist/intake/format.d.ts +2 -0
  322. package/dist/intake/format.js +14 -0
  323. package/dist/intake/notifications.d.ts +16 -0
  324. package/dist/intake/notifications.js +132 -0
  325. package/dist/intake/store.d.ts +56 -0
  326. package/dist/intake/store.js +238 -0
  327. package/dist/library.d.ts +8 -0
  328. package/dist/library.js +19 -10
  329. package/dist/mcp/client.d.ts +1 -0
  330. package/dist/mcp/client.js +20 -0
  331. package/dist/modes/builtin/plan.yaml +2 -2
  332. package/dist/modes/handlers.js +1 -1
  333. package/dist/onboarding/first_run.d.ts +3 -0
  334. package/dist/onboarding/first_run.js +28 -24
  335. package/dist/onboarding/setup.d.ts +32 -0
  336. package/dist/onboarding/setup.js +133 -0
  337. package/dist/onboarding/setup_agent_health.d.ts +17 -0
  338. package/dist/onboarding/setup_agent_health.js +79 -0
  339. package/dist/onboarding/setup_environment.d.ts +66 -0
  340. package/dist/onboarding/setup_environment.js +219 -0
  341. package/dist/onboarding/setup_workspace.d.ts +17 -0
  342. package/dist/onboarding/setup_workspace.js +129 -0
  343. package/dist/optimize/adapters/index.d.ts +4 -1
  344. package/dist/optimize/adapters/index.js +7 -0
  345. package/dist/optimize/adapters/kernelbench.js +14 -5
  346. package/dist/optimize/adapters/popcorn.js +3 -2
  347. package/dist/optimize/adapters/profile_benchmark.js +13 -7
  348. package/dist/optimize/adapters/rfbench.js +25 -14
  349. package/dist/optimize/adapters/types.d.ts +3 -0
  350. package/dist/optimize/adapters/zergpod.js +5 -2
  351. package/dist/optimize/baseline.js +10 -21
  352. package/dist/optimize/branch.js +9 -12
  353. package/dist/optimize/combine.js +2 -3
  354. package/dist/optimize/executor.js +34 -48
  355. package/dist/optimize/measurements.d.ts +55 -0
  356. package/dist/optimize/measurements.js +173 -0
  357. package/dist/optimize/results.d.ts +1 -0
  358. package/dist/optimize/results.js +11 -33
  359. package/dist/optimize/tge.js +2 -1
  360. package/dist/panes/initial_input.d.ts +19 -0
  361. package/dist/panes/initial_input.js +206 -0
  362. package/dist/panes/labels.d.ts +16 -0
  363. package/dist/panes/labels.js +42 -0
  364. package/dist/panes/types.d.ts +1 -0
  365. package/dist/panes/ztc_launch.js +7 -0
  366. package/dist/plugin/optimization.d.ts +2 -0
  367. package/dist/plugin/optimization.js +1 -0
  368. package/dist/plugin/runtime.d.ts +2 -0
  369. package/dist/plugin/simulation.d.ts +6 -1
  370. package/dist/plugin/simulation_contract.d.ts +836 -1
  371. package/dist/plugin/simulation_documents.d.ts +22 -0
  372. package/dist/plugin/simulation_documents.js +1 -0
  373. package/dist/plugin/simulation_interventions.d.ts +103 -0
  374. package/dist/plugin/simulation_interventions.js +1 -0
  375. package/dist/plugin/simulation_living.d.ts +1 -0
  376. package/dist/plugin/simulation_living.js +3 -0
  377. package/dist/plugin/simulation_meetings.d.ts +121 -0
  378. package/dist/plugin/simulation_meetings.js +1 -0
  379. package/dist/plugin/simulation_story_review.d.ts +111 -0
  380. package/dist/plugin/simulation_story_review.js +1 -0
  381. package/dist/plugin/simulation_storyteller.d.ts +91 -0
  382. package/dist/plugin/simulation_storyteller.js +1 -0
  383. package/dist/plugin/simulation_structured.d.ts +2 -0
  384. package/dist/plugin/simulation_structured.js +2 -0
  385. package/dist/plugin/simulation_toolkit.d.ts +21 -0
  386. package/dist/plugin/simulation_toolkit.js +24 -0
  387. package/dist/prompts/tool_delegate_task.j2 +1 -1
  388. package/dist/remote-broker/Dockerfile +10 -0
  389. package/dist/remote-broker/archive.py +1227 -0
  390. package/dist/remote-broker/cutover.py +761 -0
  391. package/dist/remote-broker/requirements.txt +5 -0
  392. package/dist/remote-broker/resources.json +6 -0
  393. package/dist/remote-broker/resources.write-staging.example.json +18 -0
  394. package/dist/remote-broker/retained.py +686 -0
  395. package/dist/remote-broker/retained_cleanup.py +550 -0
  396. package/dist/remote-broker/server.py +648 -0
  397. package/dist/remote-broker/worker.py +1007 -0
  398. package/dist/router_auth.d.ts +31 -0
  399. package/dist/router_auth.js +155 -9
  400. package/dist/runbooks/catalog.d.ts +3 -0
  401. package/dist/runbooks/catalog.js +26 -0
  402. package/dist/runbooks/library.d.ts +11 -0
  403. package/dist/runbooks/library.js +95 -0
  404. package/dist/runbooks/package.d.ts +43 -0
  405. package/dist/runbooks/package.js +102 -0
  406. package/dist/session.d.ts +59 -11
  407. package/dist/session.js +483 -33
  408. package/dist/session_handoff.d.ts +25 -0
  409. package/dist/session_handoff.js +322 -0
  410. package/dist/session_handoff_contract.d.ts +89 -0
  411. package/dist/session_handoff_contract.js +179 -0
  412. package/dist/session_media.d.ts +41 -0
  413. package/dist/session_media.js +357 -0
  414. package/dist/session_ownership.d.ts +16 -0
  415. package/dist/session_ownership.js +221 -0
  416. package/dist/session_public.d.ts +10 -2
  417. package/dist/session_public.js +6 -1
  418. package/dist/simulation/dynamic_history.d.ts +42 -0
  419. package/dist/simulation/dynamic_history.js +173 -0
  420. package/dist/simulation/engines/swarm/pane_manager.js +7 -6
  421. package/dist/simulation/inference.d.ts +3 -1
  422. package/dist/simulation/inference.js +19 -1
  423. package/dist/simulation/intervention_generation.d.ts +27 -0
  424. package/dist/simulation/intervention_generation.js +246 -0
  425. package/dist/simulation/intervention_material.d.ts +4 -0
  426. package/dist/simulation/intervention_material.js +81 -0
  427. package/dist/simulation/living/context.d.ts +3130 -0
  428. package/dist/simulation/living/context.js +944 -0
  429. package/dist/simulation/living/definer.d.ts +12 -0
  430. package/dist/simulation/living/definer.js +223 -0
  431. package/dist/simulation/living/definition.d.ts +257 -0
  432. package/dist/simulation/living/definition.js +341 -0
  433. package/dist/simulation/living/frame.d.ts +259 -0
  434. package/dist/simulation/living/frame.js +223 -0
  435. package/dist/simulation/living/identifiers.d.ts +2 -0
  436. package/dist/simulation/living/identifiers.js +12 -0
  437. package/dist/simulation/living/index.d.ts +15 -0
  438. package/dist/simulation/living/index.js +15 -0
  439. package/dist/simulation/living/inference.d.ts +219 -0
  440. package/dist/simulation/living/inference.js +576 -0
  441. package/dist/simulation/living/mechanics.d.ts +54 -0
  442. package/dist/simulation/living/mechanics.js +588 -0
  443. package/dist/simulation/living/model-input.d.ts +25 -0
  444. package/dist/simulation/living/model-input.js +215 -0
  445. package/dist/simulation/living/open-world.d.ts +257 -0
  446. package/dist/simulation/living/open-world.js +102 -0
  447. package/dist/simulation/living/projection.d.ts +7 -0
  448. package/dist/simulation/living/projection.js +31 -0
  449. package/dist/simulation/living/recall.d.ts +17 -0
  450. package/dist/simulation/living/recall.js +25 -0
  451. package/dist/simulation/living/reduce.d.ts +15 -0
  452. package/dist/simulation/living/reduce.js +1853 -0
  453. package/dist/simulation/living/replay.d.ts +6 -0
  454. package/dist/simulation/living/replay.js +22 -0
  455. package/dist/simulation/living/runtime.d.ts +140 -0
  456. package/dist/simulation/living/runtime.js +3020 -0
  457. package/dist/simulation/living/shared-kinds.d.ts +24 -0
  458. package/dist/simulation/living/shared-kinds.js +96 -0
  459. package/dist/simulation/living/types.d.ts +2785 -0
  460. package/dist/simulation/living/types.js +669 -0
  461. package/dist/simulation/llm.d.ts +3 -1
  462. package/dist/simulation/llm.js +90 -30
  463. package/dist/simulation/memory/embedding.d.ts +1 -1
  464. package/dist/simulation/memory/embedding.js +9 -3
  465. package/dist/simulation/memory/filesystem.d.ts +2 -0
  466. package/dist/simulation/memory/filesystem.js +5 -1
  467. package/dist/simulation/memory/filesystem_file_tree.d.ts +4 -1
  468. package/dist/simulation/memory/filesystem_file_tree.js +41 -10
  469. package/dist/simulation/memory/filesystem_invariants.js +1 -2
  470. package/dist/simulation/memory/filesystem_types.d.ts +1 -0
  471. package/dist/simulation/memory/memory.d.ts +2 -0
  472. package/dist/simulation/memory/memory.js +5 -1
  473. package/dist/simulation/orchestration/intent.js +0 -2
  474. package/dist/simulation/orchestration/lifecycle.js +0 -2
  475. package/dist/simulation/plugin_host.d.ts +25 -1
  476. package/dist/simulation/plugin_host.js +334 -17
  477. package/dist/simulation/session_documents.d.ts +20 -0
  478. package/dist/simulation/session_documents.js +62 -0
  479. package/dist/simulation/session_input_validation.d.ts +43 -0
  480. package/dist/simulation/session_input_validation.js +364 -0
  481. package/dist/simulation/session_inputs.d.ts +32 -0
  482. package/dist/simulation/session_inputs.js +154 -0
  483. package/dist/simulation/telemetry.d.ts +11 -14
  484. package/dist/simulation/telemetry.js +177 -54
  485. package/dist/simulation/toolkit/bounded_turns.d.ts +13 -0
  486. package/dist/simulation/toolkit/bounded_turns.js +80 -0
  487. package/dist/simulation/toolkit/dynamic_agents.d.ts +25 -0
  488. package/dist/simulation/toolkit/dynamic_agents.js +218 -0
  489. package/dist/simulation/toolkit/dynamic_digest.d.ts +1 -0
  490. package/dist/simulation/toolkit/dynamic_digest.js +8 -0
  491. package/dist/simulation/toolkit/dynamic_documents.d.ts +7 -0
  492. package/dist/simulation/toolkit/dynamic_documents.js +71 -0
  493. package/dist/simulation/toolkit/dynamic_driver.d.ts +8 -0
  494. package/dist/simulation/toolkit/dynamic_driver.js +269 -0
  495. package/dist/simulation/toolkit/dynamic_game.d.ts +53 -0
  496. package/dist/simulation/toolkit/dynamic_game.js +805 -0
  497. package/dist/simulation/toolkit/dynamic_knowledge.d.ts +15 -0
  498. package/dist/simulation/toolkit/dynamic_knowledge.js +91 -0
  499. package/dist/simulation/toolkit/dynamic_mechanics.d.ts +22 -0
  500. package/dist/simulation/toolkit/dynamic_mechanics.js +910 -0
  501. package/dist/simulation/toolkit/dynamic_meetings.d.ts +239 -0
  502. package/dist/simulation/toolkit/dynamic_meetings.js +350 -0
  503. package/dist/simulation/toolkit/dynamic_progress.d.ts +131 -0
  504. package/dist/simulation/toolkit/dynamic_progress.js +214 -0
  505. package/dist/simulation/toolkit/dynamic_projection.d.ts +9 -0
  506. package/dist/simulation/toolkit/dynamic_projection.js +219 -0
  507. package/dist/simulation/toolkit/dynamic_runtime.d.ts +412 -0
  508. package/dist/simulation/toolkit/dynamic_runtime.js +6536 -0
  509. package/dist/simulation/toolkit/dynamic_state.d.ts +111 -0
  510. package/dist/simulation/toolkit/dynamic_state.js +1967 -0
  511. package/dist/simulation/toolkit/dynamic_story_review.d.ts +508 -0
  512. package/dist/simulation/toolkit/dynamic_story_review.js +333 -0
  513. package/dist/simulation/toolkit/dynamic_storyteller.d.ts +77 -0
  514. package/dist/simulation/toolkit/dynamic_storyteller.js +114 -0
  515. package/dist/simulation/toolkit/dynamic_storyteller_runtime.d.ts +26 -0
  516. package/dist/simulation/toolkit/dynamic_storyteller_runtime.js +126 -0
  517. package/dist/simulation/toolkit/dynamic_world.d.ts +22 -0
  518. package/dist/simulation/toolkit/dynamic_world.js +377 -0
  519. package/dist/simulation/toolkit/structured_output.d.ts +5 -0
  520. package/dist/simulation/toolkit/structured_output.js +321 -0
  521. package/dist/simulation/types/world.d.ts +2 -0
  522. package/dist/simulation/world/artifact_store.js +1 -1
  523. package/dist/simulation/world/memory_manager.d.ts +5 -0
  524. package/dist/simulation/world/memory_manager.js +17 -2
  525. package/dist/simulation/world/state.d.ts +3 -2
  526. package/dist/simulation/world/state.js +15 -5
  527. package/dist/skills/bundled/measurement-validation/SKILL.md +144 -0
  528. package/dist/terminal_attach.d.ts +1 -0
  529. package/dist/terminal_attach.js +113 -0
  530. package/dist/tool_progress.d.ts +3 -0
  531. package/dist/tool_progress.js +27 -0
  532. package/dist/types.d.ts +145 -10
  533. package/dist/types.js +3 -0
  534. package/dist/ui/core/input.d.ts +3 -0
  535. package/dist/ui/core/input_segments.d.ts +18 -1
  536. package/dist/ui/core/input_segments.js +131 -47
  537. package/dist/ui/core/input_state.d.ts +12 -0
  538. package/dist/ui/core/layout_yoga.d.ts +1 -1
  539. package/dist/ui/core/turn_metadata.d.ts +5 -0
  540. package/dist/ui/core/turn_metadata.js +22 -0
  541. package/dist/ui/ink/render.d.ts +2 -1
  542. package/dist/ui/ink/render.js +6 -5
  543. package/dist/ui/ratatui/headless_pane_manager.d.ts +14 -1
  544. package/dist/ui/ratatui/headless_pane_manager.js +293 -104
  545. package/dist/ui/ratatui/index.d.ts +1 -0
  546. package/dist/ui/ratatui/input.d.ts +4 -0
  547. package/dist/ui/ratatui/input.js +15 -0
  548. package/dist/ui/ratatui/ipc_path.d.ts +2 -0
  549. package/dist/ui/ratatui/ipc_path.js +29 -1
  550. package/dist/ui/ratatui/mux_persistence.d.ts +3 -1
  551. package/dist/ui/ratatui/mux_persistence.js +139 -1
  552. package/dist/ui/ratatui/pane_relay.d.ts +1 -1
  553. package/dist/ui/ratatui/pane_relay.js +55 -27
  554. package/dist/ui/ratatui/process.d.ts +17 -1
  555. package/dist/ui/ratatui/process.js +80 -7
  556. package/dist/ui/ratatui/protocol.d.ts +236 -1
  557. package/dist/ui/ratatui/protocol.js +90 -0
  558. package/dist/ui/scrollback.d.ts +2 -1
  559. package/dist/ui/scrollback.js +9 -4
  560. package/dist/ui/stream_typewriter.d.ts +8 -3
  561. package/dist/ui/stream_typewriter.js +30 -1
  562. package/dist/ui/streaming_scrollback.d.ts +1 -0
  563. package/dist/ui/streaming_scrollback.js +1 -1
  564. package/dist/ui/transcript_render_cache.js +10 -0
  565. package/dist/ui/views/activity_line.d.ts +5 -3
  566. package/dist/ui/views/activity_line.js +65 -7
  567. package/dist/ui/views/app.d.ts +6 -3
  568. package/dist/ui/views/app.js +17 -6
  569. package/dist/ui/views/input_area.d.ts +7 -3
  570. package/dist/ui/views/input_area.js +15 -9
  571. package/dist/ui/views/message_list.d.ts +4 -1
  572. package/dist/ui/views/message_list.js +89 -19
  573. package/dist/ui/views/queue_panel.d.ts +3 -1
  574. package/dist/ui/views/queue_panel.js +9 -2
  575. package/dist/ui/views/status_bar.d.ts +4 -2
  576. package/dist/ui/views/status_bar.js +19 -8
  577. package/dist/ui/views/theme.d.ts +2 -0
  578. package/dist/ui/views/theme.js +2 -0
  579. package/dist/ui/widgets/color_panel.js +18 -0
  580. package/dist/ui/widgets/form.js +8 -0
  581. package/dist/ui/widgets/log_view.js +7 -0
  582. package/dist/ui/widgets/navigator_panel.js +8 -0
  583. package/dist/ui/widgets/prompt_viewer.js +2 -0
  584. package/dist/ui/widgets/questionnaire.d.ts +2 -0
  585. package/dist/ui/widgets/questionnaire.js +79 -16
  586. package/dist/ui/widgets/resume_panel.js +9 -0
  587. package/dist/ui/widgets/rewind_panel.d.ts +2 -2
  588. package/dist/ui/widgets/rewind_panel.js +4 -2
  589. package/dist/ui/widgets/select.js +16 -27
  590. package/dist/ui/widgets/settings_panel.js +16 -0
  591. package/dist/ui/widgets/status_line_panel.d.ts +1 -0
  592. package/dist/ui/widgets/status_line_panel.js +30 -4
  593. package/dist/ui/widgets/text_input.d.ts +2 -0
  594. package/dist/ui/widgets/text_input.js +15 -1
  595. package/dist/ui/widgets/types.d.ts +2 -0
  596. package/dist/usage_projection.d.ts +24 -0
  597. package/dist/usage_projection.js +130 -0
  598. package/dist/usage_snapshot.d.ts +36 -0
  599. package/dist/usage_snapshot.js +131 -0
  600. package/dist/utils/assistant_message.d.ts +2 -0
  601. package/dist/utils/assistant_message.js +5 -0
  602. package/dist/utils/atomic_write.d.ts +6 -2
  603. package/dist/utils/atomic_write.js +29 -4
  604. package/dist/utils/checked_shell.d.ts +25 -0
  605. package/dist/utils/checked_shell.js +107 -0
  606. package/dist/utils/compaction.d.ts +3 -0
  607. package/dist/utils/compaction.js +29 -5
  608. package/dist/utils/ephemeral.js +4 -0
  609. package/dist/utils/ephemeral_tools.d.ts +18 -0
  610. package/dist/utils/ephemeral_tools.js +97 -0
  611. package/dist/utils/jev_client.d.ts +4 -0
  612. package/dist/utils/jev_client.js +15 -0
  613. package/dist/utils/router_catalog.d.ts +4 -2
  614. package/dist/utils/router_catalog.js +54 -5
  615. package/dist/utils/sandbox.d.ts +9 -0
  616. package/dist/utils/sandbox.js +118 -15
  617. package/dist/utils/shell.d.ts +7 -0
  618. package/dist/utils/shell.js +98 -34
  619. package/dist/utils/subprocess_env.d.ts +3 -0
  620. package/dist/utils/subprocess_env.js +27 -1
  621. package/dist/web/accounts_mirror.d.ts +3 -1
  622. package/dist/web/accounts_mirror.js +13 -9
  623. package/dist/web/child_publication.d.ts +17 -0
  624. package/dist/web/child_publication.js +45 -0
  625. package/dist/web/mirror_authenticator.d.ts +31 -11
  626. package/dist/web/mirror_authenticator.js +67 -17
  627. package/dist/web/mirror_client.d.ts +31 -4
  628. package/dist/web/mirror_client.js +189 -23
  629. package/dist/web/mirror_stream.d.ts +84 -22
  630. package/dist/web/mirror_stream.js +676 -95
  631. package/dist/web/observer_query_redaction.d.ts +6 -0
  632. package/dist/web/observer_query_redaction.js +58 -0
  633. package/dist/web/pane_registry.d.ts +2 -0
  634. package/dist/web/pane_registry.js +86 -22
  635. package/dist/web/tool_image.d.ts +6 -0
  636. package/dist/web/tool_image.js +17 -0
  637. package/dist/web/view_plugin.d.ts +14 -0
  638. package/dist/web/view_plugin.js +23 -1
  639. package/dist/worker/executor.js +31 -12
  640. package/dist/worker/index.d.ts +1 -0
  641. package/dist/worker/toolsets.js +3 -1
  642. package/dist/worker/types.d.ts +12 -1
  643. package/dist/workflows/registry.js +1 -0
  644. package/dist/workflows/registry_handle.d.ts +2 -0
  645. package/dist/workflows/runtime.d.ts +2 -0
  646. package/dist/workflows/runtime.js +1 -0
  647. package/dist/workspace_agent.d.ts +7 -0
  648. package/dist/workspace_agent.js +36 -0
  649. package/dist/workspace_collision.d.ts +76 -0
  650. package/dist/workspace_collision.js +688 -0
  651. package/dist/workspace_layout.d.ts +18 -0
  652. package/dist/workspace_layout.js +121 -0
  653. package/dist/workspace_runtime.d.ts +44 -0
  654. package/dist/workspace_runtime.js +82 -0
  655. package/dist/workspace_session_context.d.ts +62 -0
  656. package/dist/workspace_session_context.js +160 -0
  657. package/dist/zlm-embed.mjs +26056 -3819
  658. package/dist/zlm.js +1 -0
  659. package/node_modules/@zerg/model-contracts/README.md +12 -0
  660. package/node_modules/@zerg/model-contracts/index.d.ts +2 -0
  661. package/node_modules/@zerg/model-contracts/index.js +4 -1
  662. package/package.json +44 -26
  663. package/packages/model-contracts/README.md +12 -0
  664. package/packages/model-contracts/index.d.ts +2 -0
  665. package/packages/model-contracts/index.js +4 -1
  666. package/remote-broker/Dockerfile +10 -0
  667. package/remote-broker/README.md +308 -0
  668. package/remote-broker/archive.py +1227 -0
  669. package/remote-broker/cutover.py +761 -0
  670. package/remote-broker/requirements.txt +5 -0
  671. package/remote-broker/resources.example.json +6 -0
  672. package/remote-broker/resources.write-staging.example.json +18 -0
  673. package/remote-broker/retained.py +686 -0
  674. package/remote-broker/retained_cleanup.py +550 -0
  675. package/remote-broker/server.py +648 -0
  676. package/scripts/build-remote-broker.mjs +13 -0
  677. package/scripts/ensure-local-packages.mjs +6 -0
  678. package/scripts/node-pty-helpers.mjs +103 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ZTC — Zerg Terminal Client
2
2
 
3
- > **License notice:** ZTC 0.2 is source-available, not open source. Free company
3
+ > **License notice:** ZTC is source-available, not open source. Free company
4
4
  > use is limited to purpose-bound evaluation. Commercial development, ongoing
5
5
  > company engineering, customer work, and other Commercial Use require a
6
6
  > separate commercial license. By exercising a permission in the package
@@ -10,7 +10,7 @@
10
10
  An autonomous AI agent for the terminal. ZTC combines Claude-style conversational coding with native computer control, multi-agent orchestration, and a Voyager-inspired routine system for autonomous operation in graphical applications.
11
11
 
12
12
  ```
13
- ╭─ ZTC v0.2.0-canary.2 ───────────────────────────────────────────────╮
13
+ ╭─ ZTC (illustrative session) ───────────────────────────────────────────────╮
14
14
  │ Provider: Anthropic Model: claude-sonnet-4-20250514 │
15
15
  │ Working directory: ~/projects/my-app Branch: main │
16
16
  ╰───────────────────────────────────────────────────────────────────╯
@@ -30,27 +30,32 @@ An autonomous AI agent for the terminal. ZTC combines Claude-style conversationa
30
30
 
31
31
  ## Quick Start
32
32
 
33
- The ZergAI organization distribution is `@zergai/ztc` for the 0.2 canary.
34
- Install it with `npm install -g @zergai/ztc`. It provides the same `ztc` and `zerg` commands,
35
- license, and package exports; use `@zergai/ztc/<export>` for scoped imports.
36
- Install only one distribution globally because the command names overlap.
37
- Existing stable users can keep the legacy package below; canary releases do not
38
- move `zerg-ztc@latest` from the 0.1 line.
33
+ ZTC is currently in beta. The public npm distribution is `@zergai/ztc`.
34
+ See the [public Quickstart](https://zergai.com/docs/ztc) for install,
35
+ authentication, your first plan, named sessions, platform support, and licensing.
39
36
 
40
37
  ```bash
41
- # Install the 0.2 canary CLI
38
+ # Check the published version and install the public CLI
39
+ npm view @zergai/ztc version
42
40
  npm install -g @zergai/ztc
41
+ ztc --version
43
42
 
44
43
  # Start with a read-only inspection of a real project
45
44
  ztc --cwd /path/to/project --plan
46
45
  ```
47
46
 
47
+ The package provides `ztc` and `zerg`; install only one ZTC distribution globally
48
+ because their command names overlap. Published package versions can differ from
49
+ the source version used during development. Use `ztc --version` to identify your
50
+ installed release. For reproducible installs, use `@zergai/ztc@<version>` with the
51
+ version you selected.
52
+
48
53
  On first launch, choose one authentication route in the welcome message. Then
49
54
  describe the project outcome you want. Review the plan and run `/execute` when
50
55
  you are ready for ZTC to make the proposed changes.
51
56
 
52
57
  Authentication options are Zerg Router browser login (`/auth login`), a provider API key
53
- (`/config key <api-key>`), or Claude Code OAuth (`claude setup-token`, then
58
+ (`/config key <provider> <api-key>`), or Claude Code OAuth (`claude setup-token`, then
54
59
  `/model claude_code`).
55
60
 
56
61
  For browser login at **zergrouter.com**, run `ztc auth login` in your shell or
@@ -92,9 +97,6 @@ in the browser mirror. Run `/help` for the full command list.
92
97
  # Install dependencies and build
93
98
  npm install && npm run build
94
99
 
95
- # On macOS, npm install also creates ZTC Desktop.app in Applications.
96
- # Set ZTC_SKIP_DESKTOP_APP=1 to skip that best-effort launcher install.
97
-
98
100
  # Build native Rust binaries (screen capture, input injection)
99
101
  npm run build:rust
100
102
 
@@ -107,14 +109,14 @@ npm start
107
109
 
108
110
  ### Requirements
109
111
 
110
- - Node.js >= 20
112
+ - Node.js 20.19+ on the 20.x line, or 22.12+
111
113
  - Rust toolchain (for native binaries — `cargo`)
112
114
  - One authentication route: Zerg Router (`/auth login` or `ztc auth login`), provider API key (`/config key`), or Claude Code CLI OAuth (`claude setup-token` + `CLAUDE_CODE_OAUTH_TOKEN`)
113
115
 
114
116
  The JS and headless surfaces support macOS, Linux, and Windows.
115
- Native payload support for the `0.2.0-canary.2` npm prerelease is `darwin-arm64`
117
+ The published beta native payload supports `darwin-arm64`
116
118
  only (`aarch64-apple-darwin`). Interactive TUI, desktop, audio,
117
- and computer-control binaries from this prerelease are supported only on Apple
119
+ and computer-control binaries from this beta are supported only on Apple
118
120
  Silicon macOS. Other platforms may use the JavaScript/headless APIs, but this
119
121
  beta does not claim an interactive native payload for them.
120
122
 
@@ -125,6 +127,8 @@ beta does not claim an interactive native payload for them.
125
127
  - **Streaming responses** with real-time tool execution traces
126
128
  - **Context management** — automatic compaction at configurable thresholds, manual `/compact`
127
129
  - **Session persistence** — auto-save, resume with `ztc resume` or `--resume`, per-project session storage
130
+ - **Ephemeral host tools** — hosts can set `ZTC_EPHEMERAL_TOOL_NAMES` to a comma-separated list of exact tool names whose arguments and results must remain live-memory only. Configure it before startup. These tools keep safe call IDs and omission markers in saved transcripts/evidence; resuming cannot recover their private payloads. This does not retroactively erase existing files or provider-side retention. Embedders may instead supply matching `ToolResponseStoreConfig.ephemeralToolNames` and `SessionRuntimeState.ephemeralToolNames` policies.
131
+ Generic tools can opt in only selected calls with `ZTC_EPHEMERAL_TOOL_RULES`, a JSON array such as `[{"toolName":"app_invoke","argument":"command_id","values":["app.observe","app.act"]}]`. Rules match exact top-level argument values, never patterns or executable expressions; ordinary calls remain durable. Embedders must pass matching `ephemeralToolRules` to the store and session runtime state, and supply call `args` in `ToolResponseStore.put` context. These controls cover persistence, not the live events sent to the owning host, which must sanitize its own logs and UI traces.
128
132
  - **Mux-aware resume** — `ztc resume` restores the saved conversation and, when present, the prior `zmux` layout plus child ZTC panes
129
133
  - **Sub-agent delegation** — spawn isolated agents for context-heavy research
130
134
  - **Plan mode** — read-only codebase exploration, then structured implementation
@@ -145,21 +149,54 @@ beta does not claim an interactive native payload for them.
145
149
  orchestrator registry
146
150
  - **Message bus** — inter-agent communication across panes
147
151
 
148
- ### ZTerm Desktop
152
+ ### ZTC Desktop
153
+
154
+ On Apple Silicon macOS, launch the native desktop surface explicitly:
155
+
156
+ ```bash
157
+ ztc --desktop --cwd /path/to/project
158
+ ```
159
+
160
+ `npm install` installs the CLI; it does not automatically create an application
161
+ bundle. The package includes an optional launcher installer. To create
162
+ `ZTC Desktop.app`, run it explicitly after installing the scoped package:
149
163
 
150
- On macOS, `npm install` creates `ZTC Desktop.app` in `/Applications`
151
- when that directory is writable, otherwise in `~/Applications`. Opening
152
- the app launches `ztc --desktop --cwd "$HOME"` so the native ZTerm
153
- surface starts from your home folder. Set `ZTC_SKIP_DESKTOP_APP=1` to
154
- skip app creation during install, or `ZTC_DESKTOP_APP_DIR=/path` to
155
- install the app bundle somewhere else.
164
+ ```bash
165
+ node "$(npm root -g)/@zergai/ztc/scripts/install-macos-app.mjs"
166
+ ```
156
167
 
157
- The update-capable native renderer is distributed separately as `ZTerm.app`.
158
- After installing its DMG into `/Applications` or `~/Applications`, a normal
159
- `ztc --desktop` launch prefers that bundle over the packaged development binary.
160
- ZTerm checks its signed channel feed at startup, but downloads and installation
161
- remain explicit; a successful update starts its helper only after a forced
162
- session save, then resumes the owning ZTC session with a fresh renderer socket.
168
+ The installer uses `/Applications` when writable, otherwise `~/Applications`.
169
+ `ZTC_DESKTOP_APP_DIR=/path` selects another directory and `ZTC_SKIP_DESKTOP_APP=1`
170
+ skips this optional installer. These variables do not change the npm CLI install.
171
+ Opening the launcher starts `ztc --desktop --cwd "$HOME"`.
172
+
173
+ The native desktop distribution currently uses `ZTerm.app` and its existing
174
+ signed preview/stable channels. An unbundled `ztc --desktop` launch prefers a
175
+ compatible installed renderer in `/Applications` or `~/Applications` over the
176
+ packaged development binary.
177
+
178
+ The bundled ZTC app implementation includes its own Node and matching agent.
179
+ It starts from the app icon without a global Node or ZTC installation and uses
180
+ the CLI's existing accounts, configuration and session stores. Its visible name
181
+ and Finder icon are ZTC; `ZTerm.app`, the bundle identifier and channel trust
182
+ remain compatible with the existing distribution. Signed bundled publication
183
+ and the installed-user upgrade matrix remain pending; older published apps
184
+ retain their renderer-only behavior.
185
+
186
+ From a bundled app session, type `/desktop install-cli` to install an optional
187
+ `ztc` command in `~/.local/bin`, or `/desktop install-cli /path/to/bin` to choose
188
+ another directory. Installation preserves foreign commands and does not edit
189
+ PATH or shell configuration. The command runs that app's agent with the same
190
+ arguments, working directory and profile/config/session selection as the CLI.
191
+ If the app moves, the command reports how to reinstall it. An agent cannot
192
+ request installation on the user's behalf.
193
+
194
+ The native Updates window saves **Check for updates on startup**, enabled by
195
+ default. Downloads and installation require explicit actions. Bundled sessions
196
+ use this app update path instead of npm updates. A successful update starts its
197
+ helper only after a forced session save, then resumes the owning ZTC session
198
+ with a fresh renderer socket. See [desktop release details](packages/zterm/RELEASES.md)
199
+ for the current source implementation and publication gates.
163
200
 
164
201
  ### Voice & Media
165
202
  - **Voice dictation** — native Whisper transcription (Ctrl+R)
@@ -302,6 +339,42 @@ npm run dev -- --no-mux
302
339
 
303
340
  ### Pane Tools
304
341
 
342
+ `/layout orchestrator` opens **Main** in the large left pane, **Decisions** above
343
+ **Status** on the right. Decisions lists pending questions from child panes;
344
+ select one and answer its wizard to resume that child. Escape leaves the request
345
+ pending. Status shows each child's observed task, todo progress, blockers and
346
+ reported or estimated tokens. Missing usage stays unknown. It reads runtime
347
+ state without model calls, refreshes every ten minutes, and accepts `r` for an
348
+ immediate refresh. Use `/layout orchestrator --refresh-ms 30000` to change the
349
+ interval.
350
+
351
+ `/layout pair` opens Main and one new worker. `/layout grid --workers 3` opens
352
+ Main and three new workers (four by default). Opening a preset preserves existing
353
+ pane processes in their earlier window. Launch directly with
354
+ `ztc --layout orchestrator`, `ztc --layout pair`, or
355
+ `ztc --layout grid --layout-workers 3`; use `--layout-refresh-ms` for the launch
356
+ refresh interval. These flags require an interactive workspace.
357
+
358
+ For a project preset, save `.ztc/layouts/review.yaml` and run `/layout review`
359
+ or `ztc --layout review`:
360
+
361
+ ```yaml
362
+ schema_version: 1
363
+ template: orchestrator # orchestrator, pair or grid
364
+ refresh_ms: 600000 # 1–86400000; applies to Status
365
+ titles:
366
+ main: Review Main
367
+ decisions: Review Choices
368
+ status: Review Status
369
+ ```
370
+
371
+ Grid presets also accept `workers: 1` through `32` and `titles.worker` for the
372
+ worker title prefix. Names contain up to 64 letters, digits, underscores or
373
+ hyphens; builtin names are reserved. Invalid files report their filename and
374
+ schema error before starting a child. Named `/layout save`, `restore`, `list`,
375
+ `delete`, `run` and `resume` remain available. Restored monitor commands belong
376
+ to their original parent; open a fresh preset in a new parent.
377
+
305
378
  When running in zmux, the agent gains access to terminal pane management:
306
379
 
307
380
  | Tool | Description |
@@ -316,7 +389,7 @@ When running in zmux, the agent gains access to terminal pane management:
316
389
 
317
390
  Because `zmux` runs in the terminal alternate screen, outer terminal scrollback is not the right primitive once mux is always on. Instead, `zmux` keeps pane-local history and exposes a tmux-style inner scroll mode:
318
391
 
319
- - Mouse wheel scrolls the pane under the pointer by default
392
+ - Mouse wheel scrolls the pane under the pointer by default; `/settings` → Display controls mouse capture and the wheel step (1–20 lines, initially 3)
320
393
  - Drag across transcript text and release to copy it, including in zoomed panes and scrolled history
321
394
  - Panes with scrollable history show a live scrollbar gutter on the right edge
322
395
  - Clicking the scrollbar gutter jumps to that point in history
@@ -422,6 +495,32 @@ its REST, SSE, asset, and media URLs while the proxy strips it upstream.
422
495
 
423
496
  In `zmux` mode the browser mirror can now focus panes, switch layout presets, toggle zoom, create ZTC or shell panes, close panes, and drive pane scroll position through the same mux state machine as the terminal client.
424
497
 
498
+ ### Human Attention
499
+
500
+ `/attention` lists pending approvals, questions, blocked runs, failures, review
501
+ requests and stale requests across the session's panes. Each item shows its
502
+ agent, session, task, blocker, age and next action. Copy the item's ID to act:
503
+
504
+ ```text
505
+ /attention show <ID>
506
+ /attention answer <ID> <answer>
507
+ /attention approve <ID>
508
+ /attention deny <ID> <reason>
509
+ /attention dismiss <ID>
510
+ ```
511
+
512
+ Only the operator can answer or approve requests. Dismiss acknowledges a
513
+ failure, review or stale notice; it cannot dismiss an open approval. Use
514
+ `/attention list 2` for the next page of a large queue.
515
+
516
+ The browser mirror's **Needs you** panel reads the same queue. Selecting an
517
+ item opens its question or approval form. Answering in either the terminal or
518
+ browser clears that exact request from both views. Reloading the browser keeps
519
+ live request ownership; an old answer cannot resolve a newer request. Requests
520
+ from exited panes become stale notices. Idle status keeps failures visible
521
+ until acknowledgement or new work. Oversized forms stay available in their
522
+ originating pane.
523
+
425
524
  ### Conductor Branches
426
525
 
427
526
  Launch the ZTC build from a running Conductor workspace branch:
@@ -528,7 +627,151 @@ resume [id] Resume session (latest or by ID)
528
627
  --list-sessions List saved sessions
529
628
  ```
530
629
 
531
- When a saved session includes `zmux` state, `ztc resume` restores the pane layout, focus, zoom state, and relaunch metadata for child panes as part of the resumed session. Child ZTC panes launched from mux now receive stable session IDs automatically, so nested agent conversations resume too.
630
+ When a saved session includes `zmux` state, `ztc resume` restores the pane layout,
631
+ focus, zoom and launch intent. Restored children remain inactive. Use
632
+ `/layout run <pane-id>` for an ordinary saved process or
633
+ `/layout resume <pane-id>` for its saved agent session. Child ZTC panes keep
634
+ stable session IDs; restoration does not submit a new prompt or start their work.
635
+
636
+ A replacement pane offers a saved task handoff from the same project, with an
637
+ exact `ztc resume <id>` selector, source directory and checkpoint time. The offer
638
+ does not start inference. Explicit resume includes that selected checkpoint in
639
+ the standalone agent's context; a fresh pane starts a separate task. Hosted
640
+ agents with a caller-owned system prompt retain that prompt unchanged.
641
+
642
+ The handoff records the objective, pending corrections, process receipt handles,
643
+ unresolved calls and any recorded blocker. A process exit code does not establish
644
+ task completion, and a historical PID does not establish current ownership.
645
+ Corrections retain their Enter or Tab intent, but resuming does not automatically
646
+ send them or repeat unresolved tools. Inspect uncertain outcomes before continuing.
647
+ Long text has a bounded preview with omission counts; its retained source message
648
+ contains the full correction. The optional web mirror shows the same sourced
649
+ checkpoint. Discovery is bounded, so use the exact session selector for older work
650
+ that falls outside the offered history.
651
+
652
+ The terminal and headless hosts save the exact harness tool call before executing
653
+ it, then save its observed result or error before acknowledging it or continuing
654
+ inference. A required checkpoint write failure stops that dispatch or continuation;
655
+ repair the storage problem and inspect the original call before resuming. A late
656
+ result belongs to its original turn, even when a newer turn has already started.
657
+ Unresolved calls survive compaction and resume as unknown outcomes, without an
658
+ automatic retry. A retained invocation ID cannot dispatch again or be reused for
659
+ different arguments or another tool. This identity check does not deduplicate
660
+ arbitrary commands issued with new IDs. Inspect the original command job or remote operation receipts:
661
+ local cancellation does not establish that an external operation stopped.
662
+ These checkpoints cover process interruption, not power-loss durability. Native
663
+ provider builtins that execute outside the host cannot offer this predispatch
664
+ barrier; harness-dispatched dynamic tools use it.
665
+
666
+ Automatic session pruning is disabled by default. To opt in, set
667
+ `"sessionRetentionCount": 50` in the active profile's `config.json`. At the next
668
+ startup, ZTC keeps the newest 50 unnamed, unowned sessions in the workspace.
669
+ Named sessions and sessions loaded or saved by a running process are retained
670
+ in addition to that count, together with their tool responses. A paused process
671
+ still owns its sessions; ownership ends when the process exits. Set the value
672
+ to `null` or remove it to disable pruning. Zero removes all eligible sessions,
673
+ so use a positive count when you want recent unnamed history to remain.
674
+ Caller-managed `--session-file` storage is excluded from startup pruning.
675
+
676
+ For shared remote files, configure a guarded session in the active profile:
677
+
678
+ ```json
679
+ {
680
+ "remoteResources": [
681
+ {
682
+ "id": "media", "host": "server.example.com", "user": "media", "root": "/data/media",
683
+ "broker": { "url": "https://server.example.com/v1/resources", "tokenEnv": "ZTC_MEDIA_BROKER_TOKEN" }
684
+ }
685
+ ]
686
+ }
687
+ ```
688
+
689
+ Deploy the [immutable resource broker](remote-broker/README.md) first. Configure
690
+ the same broker, resource identity and roots in each participating pane. Supply
691
+ the credential through the named host environment variable. Credentials and
692
+ execution endpoints are never accepted from model tool arguments.
693
+
694
+ Guarded sessions use the `remote_resource` tool for bounded reads, listings,
695
+ file writes, and deletion of files or empty directories. File operations require
696
+ a lease on the configured root; status remains available for inspecting ownership.
697
+ Unrestricted shell, network and plugin tools are blocked. Use normal mode with a
698
+ built-in Router or direct API provider. Subscription/native provider paths and
699
+ plugin hosts are not admitted in guarded sessions. The default transport uses
700
+ authenticated HTTPS RPC and refuses legacy SSH execution. The receiver requires
701
+ a non-root, read-only execution image and policy, with writable data on a separate
702
+ filesystem beneath `/data`. Its workers use an absolute, isolated Python
703
+ interpreter without shell startup or PATH lookup. A host-only numeric loopback
704
+ HTTP exception is available for local development; external endpoints require HTTPS.
705
+
706
+ Run `/resources show` in each pane to display its immutable owner ID, current
707
+ owner, conflicts, lease generation, and up to 100 unresolved operation references
708
+ from each journal (with their total counts). Claim with `/resources claim media 0`
709
+ (use the displayed generation). Transfer with
710
+ `/resources transfer media <generation> <target-owner-id>` after the target pane
711
+ has inspected status. Stop with `/resources stop media <generation>`. These
712
+ commands require user input; chat and queued prompts cannot grant ownership.
713
+ The default lease lasts 900 seconds; claim or transfer accepts a final duration
714
+ from 1 to 3600 seconds. An expired lease requires another confirmed claim.
715
+
716
+ Leases are shared in the broker's persistent state volume, cover overlapping roots and
717
+ symlink aliases, and remain enforced across client reconnects. Stop and handoff
718
+ revoke the former owner's writes. Set `dry_run: true` on a managed operation to
719
+ check its target and ownership before changing files. Removing profile settings
720
+ does not lift a running session's guard; start a new session for local work.
721
+
722
+ Guarded sessions show host-authored deletion receipt reports. Provider narration
723
+ and displayed reasoning are withheld; the agent uses `ask_user` for questions.
724
+ Opaque provider reasoning on tool-call turns is retained for API continuity,
725
+ including saved-history replay, without rendering it as assistant narration. Each deletion
726
+ has a host-generated operation ID and a remote journal entry written before the
727
+ operation. Completion requires a persisted final receipt and verification of the
728
+ exact target's absence, physical resource identity and parent directory. Reports
729
+ state the verification time; later changes can alter that target again.
730
+
731
+ Removed logical file bytes are reported separately from reclaimed quota or free
732
+ space. This broker does not measure attributable quota changes, so reclaimed
733
+ space is shown as unknown. Dry runs, failed operations, pending receipts and
734
+ unverified target state cannot produce a verified completion report. Generic
735
+ shell and native harness sessions receive evidence guidance without this guarded
736
+ receipt enforcement.
737
+
738
+ Writes and deletions persist a client call-to-operation record before dispatch,
739
+ then a remote receipt before the effect. A lost reply, lost acknowledgement,
740
+ pending receipt, or unverified result fences overlapping pathnames and known
741
+ physical target identities. New tool-call IDs, a reconnect, a replacement file,
742
+ another client journal, and ownership transfer do not lift that fence. Independent
743
+ targets remain usable. Repeating an originating tool call never replays its effect.
744
+ A broker rejection proving that the exact request was never admitted releases its
745
+ local reservation without claiming an effect.
746
+
747
+ If a reply is interrupted or uncertain, retain its operation ID. The agent can
748
+ inspect the `remote_resource` `receipt` operation with `receipt_id`; this requires
749
+ the originating owner, resource ID and a current lease. Inspection alone does not
750
+ release admission. The current lease owner can perform confirmed recovery:
751
+
752
+ ```text
753
+ /resources reconcile media <operation-uuid>
754
+ /resources resolve media <operation-uuid> <observation-token>
755
+ ```
756
+
757
+ Review the original receipt and the current target state before typing `resolve`.
758
+ This accepts the inspected current state and releases admission; it neither
759
+ replays an operation nor proves an uncertain earlier effect. A changed target or
760
+ lease generation invalidates the observation token. A request that never reached
761
+ the remote journal gets a durable cancellation record, so a delayed arrival cannot
762
+ mutate the target after recovery. These recovery commands are user-only, and they
763
+ remain available to the current owner after a confirmed transfer. Reads and dry
764
+ runs do not release a fence. External filesystem writers are not serialized by
765
+ the broker lock; inspect changed state before making a new decision.
766
+
767
+ Client records live under `ZTC_CONFIG_DIR/remote-operations` (by default
768
+ `~/.ztc/remote-operations`); a host can supply a separate journal directory. Guarded sessions resolve and pin
769
+ that directory at creation, so changing the working directory cannot drop admission
770
+ records.
771
+ Remote receipts live in the broker's `/state/.ztc/resource-leases/receipts/`.
772
+ Each journal retains at most 10,000 entries and declines new mutations at capacity.
773
+ No automatic pruning removes unresolved evidence. Confirmed host maintenance must
774
+ preserve operation tombstones and call linkage before archiving evidence.
532
775
 
533
776
  ### Modes & Features
534
777
  ```
@@ -577,6 +820,8 @@ When a saved session includes `zmux` state, `ztc resume` restores the pane layou
577
820
 
578
821
  Custom config profiles keep settings and sign-ins separate. Start one with `ztc --profile work`, or switch the running session with `/profile work`. `/profile create work` starts a new profile. Switching keeps the session ID and conversation while rebuilding the agent. A later `ztc resume` restores the session's saved profile unless you specify `--profile`. The default config stays at `~/.ztc/config.json`; custom named configs live at `~/.ztc/profiles/<name>/config.json`. Session history stays shared. Switching does not rewrite settings after the one-time migration described below.
579
822
 
823
+ An expired or unsigned Router profile can be selected in the running session. The agent waits for sign-in, and ZTC shows `/auth login --url <profile-router-origin>` for that profile. The conversation stays available. Invalid settings and mismatched Router origins still roll back the switch.
824
+
580
825
  The source `scripts/ztc-dev` launcher defaults to the `dev` config profile. It uses
581
826
  the same `~/.ztc/profiles/dev/` settings and Router sign-in as `ztc --profile dev`.
582
827
  Set its Router URL and sign in separately when creating that profile; the name
@@ -586,9 +831,15 @@ selects the shared config root. `ztc-dev resume` also selects `dev` unless overr
586
831
 
587
832
  On first use of this release, each existing config profile adopts the new default settings once. Its account registrations, authentication, API keys, and credential-bearing integration settings are retained. Later edits to that profile are kept. New profiles start with the same defaults. The migration writes only the active profile's config file, so switching to an unused profile applies its migration then.
588
833
 
834
+ `/settings display` includes **Prose reading rate**, which defaults to 9 words per second. Enter a positive rate or `off`; with the cap off, **Smooth streaming text** retains the existing smooth or instant display behavior. The cap applies to assistant prose, while reasoning, tool results, and messages containing fenced code retain their existing pacing. A completed answer can finish revealing after the provider stops; the full received answer is already retained in conversation history. New input or stopping clears the previous reveal.
835
+
836
+ Running local shell tools show an observed output count and, when space permits, the latest output line. Their clock measures the selected tool call. After 30 seconds of silence, the activity row adds a quiet-output hint when space permits; silence can mean the command is waiting. These display observations are separate from the final command result.
837
+
589
838
  #### Bottom status line
590
839
 
591
- The terminal status line has independently ordered left and right fields. Values that are unavailable are omitted. In narrow terminals, lower-priority fields are hidden before mode, connection state, or active errors.
840
+ The terminal status line has independently ordered left and right fields. Normal mode is implicit and omitted at every verbosity; Plan and Auto-accept remain visible. The main agent pane is named **Main** until you rename it. A confirmed user stop briefly shows **Stopped by you** while conversation history retains the interruption notice. Values that are unavailable are omitted. In narrow terminals, lower-priority fields are hidden before mode, connection state, or active errors.
841
+
842
+ The native bar shows the configured help chord while its agent is idle; the default is `Ctrl+B ? help`. Prefix, scroll, and search modes keep their own controls. `Ctrl+B ?` opens shortcut and status-marker explanations, and `/help` describes the ZTC status fields. The field editor also explains the selected item.
592
843
 
593
844
  Pick and order the fields on the editor page: press Enter on either field row, run `/settings statusline`, or use `/config statusline edit`.
594
845
 
@@ -598,11 +849,11 @@ Every field paints at one of three verbosities, and the line pane shows the one
598
849
 
599
850
  | Variant | Context left | Queue | Connection | Mode |
600
851
  |---------|--------------|-------|------------|------|
601
- | `raw` | `70%` | `2` | `◉` | `●` |
602
- | `short` | `70% left` | `2 queued` | `◉ connected` | `Normal` |
603
- | `long` | `70% context` | `2 messages queued` | `Connection: connected` | `● Normal` |
852
+ | `raw` | `70%` | `2` | `◉` | omitted |
853
+ | `short` | `70% left` | `2 queued` | `◉ connected` | omitted |
854
+ | `long` | `70% context` | `2 messages queued` | `Connection: connected` | omitted |
604
855
 
605
- `raw` is the datum on its own — the symbol, where the field has one. Fields with nothing to abbreviate, such as a session name, paint the same text at every variant. Each field defaults to whichever variant painted before variants existed, so an untouched config looks exactly as it did; only the fields you change are written to the config, and setting one back to its default drops the entry.
856
+ `raw` is the datum on its own — the symbol, where the field has one. Fields with nothing to abbreviate, such as a session name, paint the same text at every variant. The Mode column above uses default Normal mode; non-default modes retain their icon at `raw` and their name at `short` or `long`. Fields keep their configured order and variants; only the fields you change are written to the config, and setting one back to its default drops the entry.
606
857
 
607
858
  The same settings are available as commands:
608
859
 
@@ -616,7 +867,7 @@ The same settings are available as commands:
616
867
  /config statusline reset
617
868
  ```
618
869
 
619
- Available fields are `mode`, `session-name`, `session-id`, `workspace`, `context-used`, `context-remaining`, `tokens-used`, `queue`, `background`, `provider`, `model`, `provider-model`, `emulation`, `effort`, `reasoning`, `input-mode`, `version`, and `connection`. `/config statusline show` includes the same list with descriptions. These commands follow the active `/config scope`; session-scoped changes stay in the current process.
870
+ Available fields are `mode`, `session-name`, `session-id`, `workspace`, `context-used`, `context-remaining`, `tokens-used`, `cache-hit-rate`, `queue`, `background`, `provider`, `model`, `provider-model`, `emulation`, `effort`, `reasoning`, `input-mode`, `version`, and `connection`. `/config statusline show` includes the same list with descriptions. These commands follow the active `/config scope`; session-scoped changes stay in the current process.
620
871
 
621
872
  ### Codex Providers
622
873
 
@@ -638,6 +889,29 @@ Each login uses the official Codex CLI with its own `CODEX_HOME` under `~/.ztc/a
638
889
 
639
890
  The Accounts panel and `/accounts list` refresh the selected profiles through the official App Server. They show the ChatGPT identity, remaining quota windows, and token activity when OpenAI reports them. A failed quota or usage read is marked stale and retains the last observed value; an expired login needs a new `/accounts login <id>`. A profile whose login cannot be verified does not replace the current active profile. The panel's Refresh button checks again immediately. If an administrator requires keyring-only credentials, Codex may refuse the per-profile file-store setting; that profile will need a supported organization policy before it can be added to this pool.
640
891
 
892
+ Account and model switches require an idle session. An active turn or tool must
893
+ finish before the owner accepts a switch. Idle switches retain the conversation
894
+ and tools; the new model can have different context limits. Explicit account
895
+ selection clears that account's cooldown. Selecting machine-default credentials
896
+ removes the pooled selection; an unavailable login is shown as unavailable.
897
+
898
+ `/usage` queries the literal working directory and reports retained observations
899
+ for its current session, project, and current UTC day. Session and day views
900
+ share that directory scope. Reported tokens and estimates are separate.
901
+ Provider-reported USD includes known zero; missing charges remain unknown.
902
+ These are observed minima, not billing totals: old sessions, retries without
903
+ reports, and evicted receipts can be missing. Each checkpoint retains at most
904
+ 512 receipts within 512 KiB, and the project query reads at most 128 recent
905
+ sessions. Repeated checkpoints do not count the same request twice. Historical
906
+ account attribution remains unknown unless explicitly recorded.
907
+
908
+ Compatible native desktop controls show the configured account and model,
909
+ account health and account-wide quota observations, and these usage scopes.
910
+ The Model button opens the existing model chooser without submitting the draft.
911
+ After changing directories, the usage view stays unknown until observations for
912
+ the new directory load. Published older renderers can lack these controls;
913
+ the terminal commands remain available.
914
+
641
915
  Use `ztc --provider codex_legacy` for the existing direct `chatgpt.com/backend-api/codex` backend backed by `~/.codex/auth.json`. Existing config values with `provider: "codex"` remain supported as a compatibility alias for `codex_legacy`; new configs should use the explicit provider IDs.
642
916
 
643
917
  Both Codex providers default to `gpt-5.6-sol` when no model is pinned. Users with usable `~/.codex/auth.json` and no configured provider now infer `codex_legacy` instead of the older `codex` alias, so status/config output names the legacy path explicitly.
@@ -666,9 +940,13 @@ Optional App Server config:
666
940
  |---------|-------------|
667
941
  | `/clear` | Clear message history |
668
942
  | `/sessions` | List/manage saved sessions |
943
+ | `/rename <name>` | Set a stable session name; `--clear` returns to automatic labels |
944
+ | `/label [pane <id>] ...` | Show, name, pin, group, or tag a session or pane |
669
945
  | `/status` | Show current status |
670
946
  | `/context` | Detailed context window usage |
947
+ | `/usage` | Session, working-directory and UTC-day request observations; unknown values stay explicit |
671
948
  | `/compact [%]` | Compact conversation (default: 50%) |
949
+ | `/evidence` | Inspect retained source observations, interpretations, corrections and availability |
672
950
  | `/retry` | Retry last request |
673
951
 
674
952
  ### Modes
@@ -685,7 +963,9 @@ Optional App Server config:
685
963
  |---------|-------------|
686
964
  | `/shell <cmd>` or `!<cmd>` | Run shell command |
687
965
  | `/cd <path>` | Change directory |
688
- | `/clipboard` | Copy conversation |
966
+ | `/clipboard` | Copy conversation (existing simple formats) |
967
+ | `/clipboard diagnostic markdown` | Copy a bounded diagnostic report with credential redaction |
968
+ | `/clipboard diagnostic jsonl` | Copy versioned diagnostic events for analysis |
689
969
 
690
970
  ### Voice
691
971
  | Command | Description |
@@ -719,7 +999,7 @@ Optional App Server config:
719
999
  |----------|--------|
720
1000
  | `Enter` | Fill a partial completion; run an exact command or model, or submit input |
721
1001
  | `Shift+Enter` | Insert newline |
722
- | `Ctrl+C` | Exit |
1002
+ | `Ctrl+C` | Stop the active run; otherwise clear the draft, or exit when empty |
723
1003
  | `Ctrl+L` | Clear screen |
724
1004
  | `Ctrl+R` | Toggle voice dictation |
725
1005
  | `Ctrl+I` | Paste image from clipboard |
@@ -728,11 +1008,15 @@ Optional App Server config:
728
1008
  | `Ctrl+G` | Open plan file in editor |
729
1009
  | `Ctrl+T` | Toggle task list |
730
1010
  | `Shift+Tab` | Cycle modes |
731
- | `Tab` | Fill the selected completion without running it; reopen a dismissed menu |
1011
+ | `Tab` | Queue a draft after a running turn; otherwise fill completion without running it |
732
1012
  | `Up/Down` | Move between the lines of a multi-line draft; at the first/last line they select a suggestion or browse command history |
733
1013
  | `Home` / `End` | Start / end of the caret's line |
734
1014
  | `Ctrl+Home` / `Ctrl+End` | Start / end of the whole draft |
735
- | `Esc` | Close completion while keeping the draft |
1015
+ | `Esc` | Close the current form, choice or completion; otherwise confirm stopping the active run |
1016
+ | `Esc`, then `Esc` within 2 seconds | Stop that same run, preserving partial output and pending queued work |
1017
+ | `Option+Up` | Open the Ratatui queue editor; its `Esc` removes only the selected entry and `Enter` saves |
1018
+ | `/rewind` | Open the Ratatui history picker to restore a previous prompt explicitly |
1019
+ | `Ctrl+B`, then `?` | Open zmux shortcut help (or use the configured prefix) |
736
1020
  | `Ctrl+A` / `Ctrl+E` | Start / end of the caret's line |
737
1021
  | `Ctrl+U` | Kill to the start of the caret's line (this is also what macOS sends for Cmd+Backspace) |
738
1022
  | `Ctrl+W` | Delete word before cursor |
@@ -762,8 +1046,12 @@ Argument syntax appears as one short usage line instead of selectable chips.
762
1046
  - **search** — Regex code search (ripgrep-style)
763
1047
 
764
1048
  ### Shell & Execution
765
- - **run_command** — Execute shell commands with timeout
1049
+ - **run_command** — Execute shell commands with timeout, or use explicit checked pipelines that retain each stage outcome and gate dependent steps. See [checked execution](docs/checked-execution.md).
766
1050
  - **run_and_monitor** — Long-running command monitoring
1051
+ - **verify_artifact** — Run the registered local `json_assertions` checker against an input JSON artifact and assertion configuration, each at most64KiB. Its retained decision covers only configured artifact assertions; original process/source qualification stays unverified and benchmark eligibility stays unknown. Inspect historical inputs and current/stale applicability with `/evidence`.
1052
+ - **benchmark_cpu** — Measure the registered integer-sum CPU fixture using captured input/config JSON, a fixed host Node runner, monotonic kernel timing and an independent exact integer checker. Input contains 1–1024 integers of absolute value at most 1,000,000. Configuration is `{schema_version:1,variant:"for_loop"|"array_reduce",iterations:1–2048,warmup:0–4,samples:3|5|7|9}`. Each file is at most 64KiB. Requires local execution and source-read permissions; guarded remote sessions cannot invoke it. Eligibility covers only this fixture and its recorded conditions; original execution qualification remains unverified.
1053
+ - **compare_benchmarks** — Compare two original retained `benchmark_cpu` observation IDs. Workload, checker, runner and declared host/runtime/measurement conditions must match; registered programs and source revisions may differ. Missing results, copied output and aliases of one run cannot admit a comparison. Historical timings and deltas remain retained when inputs later become stale. A delta establishes no causal improvement, production/GPU result or plateau.
1054
+ - **measurement_report** — Check reported measurement shape, units, ranks, instrumentation and comparability from retained managed-command observations. Source verification and benchmark eligibility remain unknown. Load `invoke_skill(id="measurement-validation")` for the producer format and smoke workflow.
767
1055
 
768
1056
  ### Development (LSP)
769
1057
  - **goto_definition** — Jump to symbol definition
@@ -802,6 +1090,17 @@ User Input → Agent → Claude API → Tool Use? → Execute → Continue
802
1090
 
803
1091
  Standard ReAct loop with streaming, automatic retry (429/529/5xx), and configurable max iterations.
804
1092
 
1093
+ Transient endpoint failures retain the current inference and its completed tool
1094
+ results. After the initial three attempts, ZTC keeps waiting for recovery until
1095
+ you cancel; it does not resubmit the task. Retry waits use jitter and cap at 30
1096
+ seconds. The retry fields in `/settings` → Behavior can cap the recovery window, set it to
1097
+ `0` for the previous attempt limit, or set Request attempts to `1` to disable
1098
+ Agent-level retries and sustained recovery. Backend transport reconnects retain
1099
+ their separate policy. Permanent errors and inactivity timeouts still stop the request.
1100
+ Partial answer output and dispatched native harness turns are not regenerated.
1101
+ The activity line shows when ZTC is waiting for the endpoint; request diagnostics
1102
+ include HTTP status and bounded, redacted response details.
1103
+
805
1104
  ### Native Binaries (Rust)
806
1105
  - **ztc-computer** — Screen capture (CoreGraphics/X11/Win32), hardware-level input injection (IOHIDPostEvent/CGEvent), process management
807
1106
  - **ztc-ml** — GPU-accelerated ML inference and training (candle framework)
@@ -986,6 +1285,16 @@ const tools = await buildAgentToolsFromDomainAsync('ca_org');
986
1285
 
987
1286
  ## Development
988
1287
 
1288
+ This source checkout reserves ZTC v0.2.0-canary.2. The public npm package and
1289
+ its current published version are described in the Quick Start above.
1290
+
1291
+ Use Node 20 or 22 for development checks. The tested toolchain is Vitest 4.1.11,
1292
+ Vite 6.4.3 and Stryker 9.6.1. After `npm ci`, run `npm run test:toolchain`,
1293
+ `npm run test:simulation` and `npm run test:mutation:compat`. The last command
1294
+ checks that the installed mutation runner still catches changes in a covered
1295
+ simulation module. See [the migration contract](../docs/vitest-migration.md#ztc-terminal-harness-2026-10-02)
1296
+ for the qualified versions and scope.
1297
+
989
1298
  ```bash
990
1299
  npm run build # Compile TypeScript + copy assets
991
1300
  npm run build:rust # Build native Rust binaries
@@ -1011,6 +1320,16 @@ ztc
1011
1320
 
1012
1321
  The `claude_code` provider shells out to `claude -p` with `CLAUDE_CODE_OAUTH_TOKEN` in the environment. This follows Claude Code's own auth/runtime and usage rules, and Claude Code's default system prompt/runtime behavior is intentionally involved. ZTC's prompt is appended to that runtime for context.
1013
1322
 
1323
+ The CLI backend passes explicit model IDs, dated versions, context suffixes and
1324
+ deployment names through as selected, after trimming whitespace. The CLI and
1325
+ account determine availability, and a rejected selection remains an error.
1326
+ The exact legacy `sonnet` and `claude-code-sonnet` choices, or an empty model,
1327
+ retain ZTC's `claude-sonnet-4-5` compatibility mapping; `claude-code-opus` and
1328
+ `claude-code-haiku` map to `opus` and `haiku`. Status and usage model fields
1329
+ describe the requested configuration; they do not attest which model the
1330
+ provider actually served. This backend behavior does not change existing
1331
+ dated-model migrations when loading or setting persistent configuration.
1332
+
1014
1333
  The first implementation is text-only: ZTC tool definitions are not bridged into Claude Code CLI tool calls. A future MCP bridge can expose ZTC tools to Claude Code through official integration surfaces.
1015
1334
 
1016
1335
  ### Environment Variables
@@ -1048,7 +1367,7 @@ unset preserves normal interactive discovery.
1048
1367
 
1049
1368
  ## License
1050
1369
 
1051
- ZTC 0.2 is distributed under the
1370
+ ZTC is distributed under the
1052
1371
  [Zerg Source Available License 1.0](./LICENSE.md). It permits purpose-limited
1053
1372
  evaluation and specified personal, educational, research, nonprofit, and other
1054
1373
  noncommercial use.
@@ -1069,7 +1388,7 @@ the ZTC 0.1.x releases.
1069
1388
 
1070
1389
  ---
1071
1390
 
1072
- Part of the [Zerg](https://github.com/idanbeck/zerg) autonomous AI framework.
1391
+ Part of the [Zerg](https://zergai.com/products/ztc) autonomous AI framework.
1073
1392
 
1074
1393
  ## Updating the npm CLI
1075
1394
 
@@ -1087,3 +1406,30 @@ Existing releases need one ordinary npm upgrade before these commands exist.
1087
1406
 
1088
1407
  See [shared updater policy](https://github.com/Epoch-ML/zerg/blob/development/docs/npm-cli-updates.md)
1089
1408
  for installation safety, channel switching, and packaging details.
1409
+
1410
+ ### Session and pane labels
1411
+
1412
+ Automatic agent labels show the project, branch, task, session identifier and
1413
+ phase. Shell panes follow terminal titles. A manual `/rename` or `/label pane
1414
+ <id> name <name>` stays separate from inference and survives later updates.
1415
+
1416
+ Use `/label project Zerg`, `/label task Release`, `/label group Delivery`, and
1417
+ `/label pin` to organize the current session. Target a shell with, for example,
1418
+ `/label pane 1 group Builds`. `/label unpin` permits closure again. Use
1419
+ `/label group --clear` to remove a tag, `/label auto` to return to an inferred
1420
+ name, and `/label show` to inspect current choices. Names and tags have a
1421
+ 64-character limit. `/sessions` lists pinned sessions first and groups labels.
1422
+
1423
+ Choices persist through normal save and resume. A later parent-pane label takes
1424
+ precedence over an older child-session label during startup. Pane controls require a native
1425
+ renderer advertising `pane_labels_v1`; older renderers explain that an update
1426
+ is needed, and existing `/rename` remains supported. Desktop protocol sessions
1427
+ use ZTC's saved layout; the desktop renderer replays those labels when resumed.
1428
+
1429
+ ## Incoming requests
1430
+
1431
+ Use `/inbox` to review durable requests and receipts. Delivery and acknowledgment
1432
+ do not start work. Use `/inbox run <req-ID>` after reviewing a request, then record
1433
+ its verified outcome separately. Adapters can deliver envelopes without agent
1434
+ startup using `ztc inbox receive --file request.json --json`. See [the intake
1435
+ contract](docs/intake.md) for sources, duplicate delivery and navigation.