@zergai/ztc 0.4.1-dev.36919234045 → 0.5.1-dev.202611021234

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 (828) hide show
  1. package/README.md +416 -51
  2. package/RUST_THIRD_PARTY_LICENSES.txt +1080 -822
  3. package/THIRD_PARTY_NOTICES.md +274 -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 +1227 -213
  14. package/dist/agent/agent.d.ts +151 -8
  15. package/dist/agent/agent.js +1613 -236
  16. package/dist/agent/backends/account_login.js +3 -1
  17. package/dist/agent/backends/account_rotation.d.ts +4 -0
  18. package/dist/agent/backends/account_rotation.js +8 -2
  19. package/dist/agent/backends/anthropic.d.ts +13 -0
  20. package/dist/agent/backends/anthropic.js +166 -19
  21. package/dist/agent/backends/bedrock.d.ts +20 -0
  22. package/dist/agent/backends/bedrock.js +175 -0
  23. package/dist/agent/backends/claude_cli.js +26 -8
  24. package/dist/agent/backends/codex_app_server.d.ts +1 -0
  25. package/dist/agent/backends/codex_app_server.js +57 -3
  26. package/dist/agent/backends/codex_auth.d.ts +6 -2
  27. package/dist/agent/backends/codex_auth.js +193 -39
  28. package/dist/agent/backends/codex_buffered_recovery.d.ts +27 -0
  29. package/dist/agent/backends/codex_buffered_recovery.js +293 -0
  30. package/dist/agent/backends/gemini.js +1 -1
  31. package/dist/agent/backends/http_error.d.ts +28 -0
  32. package/dist/agent/backends/http_error.js +225 -0
  33. package/dist/agent/backends/index.d.ts +11 -2
  34. package/dist/agent/backends/index.js +28 -1
  35. package/dist/agent/backends/model_pool.d.ts +20 -0
  36. package/dist/agent/backends/model_pool.js +98 -0
  37. package/dist/agent/backends/openai.js +2 -0
  38. package/dist/agent/backends/openai_compatible.d.ts +3 -4
  39. package/dist/agent/backends/openai_compatible.js +16 -14
  40. package/dist/agent/backends/openai_responses.d.ts +21 -5
  41. package/dist/agent/backends/openai_responses.js +167 -58
  42. package/dist/agent/backends/request_metrics.js +12 -2
  43. package/dist/agent/backends/responses_reasoning.d.ts +5 -0
  44. package/dist/agent/backends/responses_reasoning.js +23 -0
  45. package/dist/agent/backends/transport_errors.d.ts +6 -0
  46. package/dist/agent/backends/transport_errors.js +11 -0
  47. package/dist/agent/backends/types.d.ts +131 -6
  48. package/dist/agent/backends/types.js +9 -1
  49. package/dist/agent/backends/zrouter_stream.d.ts +18 -1
  50. package/dist/agent/backends/zrouter_stream.js +185 -26
  51. package/dist/agent/background_registry.d.ts +2 -0
  52. package/dist/agent/background_registry.js +1 -0
  53. package/dist/agent/background_workers.d.ts +68 -0
  54. package/dist/agent/background_workers.js +139 -0
  55. package/dist/agent/claim_observation.d.ts +6 -0
  56. package/dist/agent/claim_observation.js +54 -0
  57. package/dist/agent/commands/accounts.d.ts +9 -1
  58. package/dist/agent/commands/accounts.js +59 -182
  59. package/dist/agent/commands/attention.d.ts +2 -0
  60. package/dist/agent/commands/attention.js +67 -0
  61. package/dist/agent/commands/auth.d.ts +30 -1
  62. package/dist/agent/commands/auth.js +169 -22
  63. package/dist/agent/commands/board.d.ts +2 -0
  64. package/dist/agent/commands/board.js +169 -0
  65. package/dist/agent/commands/clipboard.js +50 -1
  66. package/dist/agent/commands/command_refusal.d.ts +8 -0
  67. package/dist/agent/commands/command_refusal.js +8 -0
  68. package/dist/agent/commands/compact.js +31 -18
  69. package/dist/agent/commands/config.js +386 -80
  70. package/dist/agent/commands/connect.d.ts +20 -0
  71. package/dist/agent/commands/connect.js +150 -0
  72. package/dist/agent/commands/credential_redaction.d.ts +12 -0
  73. package/dist/agent/commands/credential_redaction.js +46 -0
  74. package/dist/agent/commands/credential_status.d.ts +72 -0
  75. package/dist/agent/commands/credential_status.js +181 -0
  76. package/dist/agent/commands/desktop.d.ts +2 -0
  77. package/dist/agent/commands/desktop.js +29 -0
  78. package/dist/agent/commands/direct_credential_prompt.d.ts +71 -0
  79. package/dist/agent/commands/direct_credential_prompt.js +422 -0
  80. package/dist/agent/commands/effort.d.ts +1 -0
  81. package/dist/agent/commands/effort.js +16 -34
  82. package/dist/agent/commands/environment.d.ts +3 -0
  83. package/dist/agent/commands/environment.js +109 -0
  84. package/dist/agent/commands/evidence.d.ts +2 -0
  85. package/dist/agent/commands/evidence.js +9 -0
  86. package/dist/agent/commands/fork.js +4 -3
  87. package/dist/agent/commands/goal.d.ts +33 -5
  88. package/dist/agent/commands/goal.js +220 -22
  89. package/dist/agent/commands/goal_exit.d.ts +36 -0
  90. package/dist/agent/commands/goal_exit.js +120 -0
  91. package/dist/agent/commands/handoff.d.ts +6 -0
  92. package/dist/agent/commands/handoff.js +17 -0
  93. package/dist/agent/commands/help.js +3 -1
  94. package/dist/agent/commands/history.js +3 -1
  95. package/dist/agent/commands/inbox.d.ts +2 -0
  96. package/dist/agent/commands/inbox.js +151 -0
  97. package/dist/agent/commands/index.js +20 -3
  98. package/dist/agent/commands/input_mode.js +8 -6
  99. package/dist/agent/commands/job.d.ts +2 -0
  100. package/dist/agent/commands/job.js +93 -0
  101. package/dist/agent/commands/keybindings.js +6 -2
  102. package/dist/agent/commands/label.d.ts +2 -0
  103. package/dist/agent/commands/label.js +77 -0
  104. package/dist/agent/commands/layout.d.ts +2 -0
  105. package/dist/agent/commands/layout.js +20 -0
  106. package/dist/agent/commands/mirror.js +45 -17
  107. package/dist/agent/commands/model.js +83 -4
  108. package/dist/agent/commands/models.d.ts +1 -1
  109. package/dist/agent/commands/models.js +89 -67
  110. package/dist/agent/commands/openai_compat_wizard.d.ts +3 -2
  111. package/dist/agent/commands/openai_compat_wizard.js +53 -15
  112. package/dist/agent/commands/permissions.d.ts +3 -1
  113. package/dist/agent/commands/permissions.js +79 -89
  114. package/dist/agent/commands/plan.js +5 -15
  115. package/dist/agent/commands/provider_choices.d.ts +56 -0
  116. package/dist/agent/commands/provider_choices.js +72 -3
  117. package/dist/agent/commands/provider_model_defaults.d.ts +7 -0
  118. package/dist/agent/commands/provider_model_defaults.js +11 -0
  119. package/dist/agent/commands/provider_selection.d.ts +27 -2
  120. package/dist/agent/commands/provider_selection.js +151 -10
  121. package/dist/agent/commands/reasoning_page.d.ts +33 -0
  122. package/dist/agent/commands/reasoning_page.js +595 -0
  123. package/dist/agent/commands/reasoning_picker.d.ts +14 -0
  124. package/dist/agent/commands/reasoning_picker.js +99 -0
  125. package/dist/agent/commands/reasoning_settings.d.ts +18 -0
  126. package/dist/agent/commands/reasoning_settings.js +46 -0
  127. package/dist/agent/commands/rename.js +1 -1
  128. package/dist/agent/commands/resources.d.ts +2 -0
  129. package/dist/agent/commands/resources.js +67 -0
  130. package/dist/agent/commands/rewind.d.ts +3 -0
  131. package/dist/agent/commands/rewind.js +16 -0
  132. package/dist/agent/commands/runbooks.d.ts +2 -0
  133. package/dist/agent/commands/runbooks.js +73 -0
  134. package/dist/agent/commands/runbooks_lazy.d.ts +2 -0
  135. package/dist/agent/commands/runbooks_lazy.js +8 -0
  136. package/dist/agent/commands/sessions.d.ts +1 -1
  137. package/dist/agent/commands/sessions.js +33 -5
  138. package/dist/agent/commands/settings.d.ts +2 -0
  139. package/dist/agent/commands/settings.js +791 -258
  140. package/dist/agent/commands/setup.d.ts +2 -0
  141. package/dist/agent/commands/setup.js +78 -0
  142. package/dist/agent/commands/share.d.ts +2 -0
  143. package/dist/agent/commands/share.js +64 -0
  144. package/dist/agent/commands/status.js +27 -46
  145. package/dist/agent/commands/types.d.ts +189 -9
  146. package/dist/agent/commands/update.d.ts +18 -0
  147. package/dist/agent/commands/update.js +58 -91
  148. package/dist/agent/commands/usage.d.ts +2 -0
  149. package/dist/agent/commands/usage.js +8 -0
  150. package/dist/agent/completion_state.d.ts +18 -0
  151. package/dist/agent/completion_state.js +35 -3
  152. package/dist/agent/factory.d.ts +20 -1
  153. package/dist/agent/factory.js +158 -35
  154. package/dist/agent/loop_policy.d.ts +20 -3
  155. package/dist/agent/loop_policy.js +21 -3
  156. package/dist/agent/measurement_guidance.d.ts +2 -0
  157. package/dist/agent/measurement_guidance.js +5 -0
  158. package/dist/agent/request_encoder.d.ts +14 -1
  159. package/dist/agent/request_encoder.js +127 -25
  160. package/dist/agent/result_emit_cap.d.ts +1 -0
  161. package/dist/agent/result_emit_cap.js +1 -0
  162. package/dist/agent/runaway_output.d.ts +32 -0
  163. package/dist/agent/runaway_output.js +80 -0
  164. package/dist/agent/runtime/benchmark_comparison.d.ts +30 -0
  165. package/dist/agent/runtime/benchmark_comparison.js +94 -0
  166. package/dist/agent/runtime/benchmark_contract.d.ts +48 -0
  167. package/dist/agent/runtime/benchmark_contract.js +90 -0
  168. package/dist/agent/runtime/checked_commands.d.ts +32 -0
  169. package/dist/agent/runtime/checked_commands.js +119 -0
  170. package/dist/agent/runtime/command_execution_policy.d.ts +32 -0
  171. package/dist/agent/runtime/command_execution_policy.js +130 -0
  172. package/dist/agent/runtime/command_jobs.d.ts +36 -18
  173. package/dist/agent/runtime/command_jobs.js +151 -13
  174. package/dist/agent/runtime/command_panes.d.ts +59 -0
  175. package/dist/agent/runtime/command_panes.js +398 -0
  176. package/dist/agent/runtime/command_wait.d.ts +19 -0
  177. package/dist/agent/runtime/command_wait.js +167 -0
  178. package/dist/agent/runtime/cpu_benchmark.d.ts +30 -0
  179. package/dist/agent/runtime/cpu_benchmark.js +126 -0
  180. package/dist/agent/runtime/delegated_evidence.d.ts +26 -0
  181. package/dist/agent/runtime/delegated_evidence.js +80 -0
  182. package/dist/agent/runtime/evidence.d.ts +143 -0
  183. package/dist/agent/runtime/evidence.js +518 -0
  184. package/dist/agent/runtime/execution_context.d.ts +7 -0
  185. package/dist/agent/runtime/execution_context.js +44 -4
  186. package/dist/agent/runtime/json_verifier_recipe.d.ts +8 -0
  187. package/dist/agent/runtime/json_verifier_recipe.js +66 -0
  188. package/dist/agent/runtime/measurements.d.ts +110 -0
  189. package/dist/agent/runtime/measurements.js +317 -0
  190. package/dist/agent/runtime/policy.d.ts +4 -0
  191. package/dist/agent/runtime/policy.js +31 -20
  192. package/dist/agent/runtime/provider_native_evidence.d.ts +20 -0
  193. package/dist/agent/runtime/provider_native_evidence.js +86 -0
  194. package/dist/agent/runtime/read_only_command.d.ts +15 -0
  195. package/dist/agent/runtime/read_only_command.js +265 -0
  196. package/dist/agent/runtime/recovery.d.ts +2 -0
  197. package/dist/agent/runtime/recovery.js +9 -2
  198. package/dist/agent/runtime/remote_broker_transport.d.ts +10 -0
  199. package/dist/agent/runtime/remote_broker_transport.js +84 -0
  200. package/dist/agent/runtime/remote_deletion_receipts.d.ts +3 -0
  201. package/dist/agent/runtime/remote_deletion_receipts.js +43 -0
  202. package/dist/agent/runtime/remote_journal_replay.d.ts +13 -0
  203. package/dist/agent/runtime/remote_journal_replay.js +233 -0
  204. package/dist/agent/runtime/remote_mutation_journal.d.ts +25 -0
  205. package/dist/agent/runtime/remote_mutation_journal.js +208 -0
  206. package/dist/agent/runtime/remote_resource_endpoint.d.ts +7 -0
  207. package/dist/agent/runtime/remote_resource_endpoint.js +6 -0
  208. package/dist/agent/runtime/remote_resource_errors.d.ts +5 -0
  209. package/dist/agent/runtime/remote_resource_errors.js +9 -0
  210. package/dist/agent/runtime/remote_resource_script.d.ts +2 -0
  211. package/dist/agent/runtime/remote_resource_script.js +1009 -0
  212. package/dist/agent/runtime/remote_resources.d.ts +29 -0
  213. package/dist/agent/runtime/remote_resources.js +160 -0
  214. package/dist/agent/runtime/source_verification.d.ts +12 -0
  215. package/dist/agent/runtime/source_verification.js +212 -0
  216. package/dist/agent/runtime/source_verification_contract.d.ts +75 -0
  217. package/dist/agent/runtime/source_verification_contract.js +203 -0
  218. package/dist/agent/runtime/tool_checkpoints.d.ts +11 -0
  219. package/dist/agent/runtime/tool_checkpoints.js +30 -0
  220. package/dist/agent/runtime/tool_effects.d.ts +5 -0
  221. package/dist/agent/runtime/tool_progress.d.ts +12 -0
  222. package/dist/agent/runtime/tool_progress.js +76 -0
  223. package/dist/agent/runtime/tool_runtime.d.ts +16 -1
  224. package/dist/agent/runtime/tool_runtime.js +218 -10
  225. package/dist/agent/runtime/tool_scheduler.js +3 -1
  226. package/dist/agent/runtime/tracing.d.ts +1 -1
  227. package/dist/agent/runtime/verifier_capture.d.ts +9 -0
  228. package/dist/agent/runtime/verifier_capture.js +100 -0
  229. package/dist/agent/runtime/verifier_contract.d.ts +24 -0
  230. package/dist/agent/runtime/verifier_contract.js +41 -0
  231. package/dist/agent/subagent.d.ts +24 -0
  232. package/dist/agent/subagent.js +425 -38
  233. package/dist/agent/system_prompt.d.ts +3 -1
  234. package/dist/agent/system_prompt.js +3 -1
  235. package/dist/agent/tool_response_directory.d.ts +24 -0
  236. package/dist/agent/tool_response_directory.js +61 -0
  237. package/dist/agent/tool_response_source.d.ts +8 -0
  238. package/dist/agent/tool_response_source.js +49 -0
  239. package/dist/agent/tool_response_store.d.ts +83 -3
  240. package/dist/agent/tool_response_store.js +618 -65
  241. package/dist/agent/tool_result_parsing.d.ts +2 -0
  242. package/dist/agent/tool_result_parsing.js +1 -0
  243. package/dist/agent/tool_result_presentation.d.ts +21 -0
  244. package/dist/agent/tool_result_presentation.js +237 -0
  245. package/dist/agent/tools/apply_patch.js +130 -42
  246. package/dist/agent/tools/ask_user.d.ts +3 -1
  247. package/dist/agent/tools/ask_user.js +30 -11
  248. package/dist/agent/tools/background.js +1 -0
  249. package/dist/agent/tools/benchmark_cpu.d.ts +2 -0
  250. package/dist/agent/tools/benchmark_cpu.js +102 -0
  251. package/dist/agent/tools/compare_benchmarks.d.ts +2 -0
  252. package/dist/agent/tools/compare_benchmarks.js +53 -0
  253. package/dist/agent/tools/deferred.js +23 -2
  254. package/dist/agent/tools/delegate.js +187 -38
  255. package/dist/agent/tools/edit_view.d.ts +13 -0
  256. package/dist/agent/tools/edit_view.js +134 -0
  257. package/dist/agent/tools/file.js +54 -16
  258. package/dist/agent/tools/helper_requirements.d.ts +7 -0
  259. package/dist/agent/tools/helper_requirements.js +19 -0
  260. package/dist/agent/tools/index.d.ts +1 -0
  261. package/dist/agent/tools/index.js +3 -0
  262. package/dist/agent/tools/measurement_report.d.ts +22 -0
  263. package/dist/agent/tools/measurement_report.js +190 -0
  264. package/dist/agent/tools/project_context.d.ts +3 -0
  265. package/dist/agent/tools/project_context.js +45 -0
  266. package/dist/agent/tools/recall_tool_response.d.ts +9 -5
  267. package/dist/agent/tools/recall_tool_response.js +68 -35
  268. package/dist/agent/tools/registry.d.ts +1 -0
  269. package/dist/agent/tools/registry.js +23 -0
  270. package/dist/agent/tools/related_sessions.d.ts +2 -0
  271. package/dist/agent/tools/related_sessions.js +156 -0
  272. package/dist/agent/tools/routine.js +13 -3
  273. package/dist/agent/tools/screenshot.js +5 -3
  274. package/dist/agent/tools/search.js +18 -9
  275. package/dist/agent/tools/session_evidence.d.ts +3 -0
  276. package/dist/agent/tools/session_evidence.js +72 -0
  277. package/dist/agent/tools/shell.d.ts +5 -4
  278. package/dist/agent/tools/shell.js +219 -54
  279. package/dist/agent/tools/sim_domain_tools.js +7 -1
  280. package/dist/agent/tools/tool_groups.d.ts +34 -0
  281. package/dist/agent/tools/tool_groups.js +112 -0
  282. package/dist/agent/tools/tool_search.js +3 -2
  283. package/dist/agent/tools/types.d.ts +38 -0
  284. package/dist/agent/tools/verify_artifact.d.ts +2 -0
  285. package/dist/agent/tools/verify_artifact.js +60 -0
  286. package/dist/agent/tools/workflow.js +1 -0
  287. package/dist/app/activity.d.ts +6 -1
  288. package/dist/app/activity.js +82 -12
  289. package/dist/app/agent_runner.d.ts +6 -1
  290. package/dist/app/agent_runner.js +47 -23
  291. package/dist/app/ask_user_response.d.ts +6 -0
  292. package/dist/app/ask_user_response.js +26 -0
  293. package/dist/app/command_context.js +85 -6
  294. package/dist/app/controller.d.ts +15 -4
  295. package/dist/app/controller.js +29 -3
  296. package/dist/app/escape_stop.d.ts +11 -0
  297. package/dist/app/escape_stop.js +15 -0
  298. package/dist/app/launch_notices.d.ts +10 -0
  299. package/dist/app/launch_notices.js +20 -0
  300. package/dist/app/liveness.d.ts +6 -4
  301. package/dist/app/liveness.js +13 -3
  302. package/dist/app/ordered_transcript.js +43 -4
  303. package/dist/app/prompt_turn.d.ts +14 -0
  304. package/dist/app/prompt_turn.js +53 -0
  305. package/dist/app/recap.d.ts +3 -0
  306. package/dist/app/recap.js +9 -3
  307. package/dist/app/restart.d.ts +3 -2
  308. package/dist/app/restart.js +7 -3
  309. package/dist/app/rewind.d.ts +3 -3
  310. package/dist/app/rewind.js +3 -3
  311. package/dist/app/selection_completion.d.ts +30 -1
  312. package/dist/app/selection_completion.js +195 -25
  313. package/dist/app/session_manager.d.ts +43 -6
  314. package/dist/app/session_manager.js +298 -62
  315. package/dist/app/session_messages.d.ts +6 -0
  316. package/dist/app/session_messages.js +82 -0
  317. package/dist/app/task_scope_router.d.ts +20 -0
  318. package/dist/app/task_scope_router.js +173 -0
  319. package/dist/app/transcript_window.d.ts +2 -0
  320. package/dist/app/transcript_window.js +4 -0
  321. package/dist/app/workspace_admission_details.d.ts +10 -0
  322. package/dist/app/workspace_admission_details.js +70 -0
  323. package/dist/app/workspace_layout_controller.d.ts +11 -0
  324. package/dist/app/workspace_layout_controller.js +88 -0
  325. package/dist/app/workspace_monitor.d.ts +1 -0
  326. package/dist/app/workspace_monitor.js +216 -0
  327. package/dist/app/workspace_presets.d.ts +29 -0
  328. package/dist/app/workspace_presets.js +192 -0
  329. package/dist/attention/queue.d.ts +37 -0
  330. package/dist/attention/queue.js +183 -0
  331. package/dist/bench/rf_shared.d.ts +2 -0
  332. package/dist/board/binding.d.ts +42 -0
  333. package/dist/board/binding.js +38 -0
  334. package/dist/board/client.d.ts +42 -0
  335. package/dist/board/client.js +60 -0
  336. package/dist/cli.js +1 -1
  337. package/dist/cli_args.js +18 -2
  338. package/dist/cli_main.js +106 -11
  339. package/dist/cli_ratatui.d.ts +277 -18
  340. package/dist/cli_ratatui.js +4518 -1328
  341. package/dist/components/ActivityLine.d.ts +3 -2
  342. package/dist/components/ActivityLine.js +2 -2
  343. package/dist/components/InputArea.d.ts +19 -1
  344. package/dist/components/InputArea.js +264 -190
  345. package/dist/components/MessageList.d.ts +2 -0
  346. package/dist/components/MessageList.js +3 -1
  347. package/dist/components/SingleMessage.d.ts +2 -0
  348. package/dist/components/SingleMessage.js +4 -2
  349. package/dist/components/StatusBar.d.ts +4 -2
  350. package/dist/components/StatusBar.js +3 -1
  351. package/dist/conductor_branch.js +3 -0
  352. package/dist/config/api_retry.d.ts +6 -1
  353. package/dist/config/api_retry.js +19 -1
  354. package/dist/config/compaction.d.ts +2 -1
  355. package/dist/config/compaction.js +2 -1
  356. package/dist/config/defaults.js +20 -48
  357. package/dist/config/message_display.d.ts +1 -0
  358. package/dist/config/message_display.js +17 -2
  359. package/dist/config/permissions.d.ts +21 -0
  360. package/dist/config/permissions.js +89 -0
  361. package/dist/config/provider_api_key_env.d.ts +76 -0
  362. package/dist/config/provider_api_key_env.js +148 -0
  363. package/dist/config/resolved.d.ts +4 -4
  364. package/dist/config/types.d.ts +134 -6
  365. package/dist/config.d.ts +74 -10
  366. package/dist/config.js +317 -77
  367. package/dist/context/project_intelligence.d.ts +44 -0
  368. package/dist/context/project_intelligence.js +246 -0
  369. package/dist/desktop/cli_launch.d.ts +8 -0
  370. package/dist/desktop/cli_launch.js +6 -0
  371. package/dist/desktop/cli_shim.d.ts +8 -0
  372. package/dist/desktop/cli_shim.js +120 -0
  373. package/dist/desktop/runtime.d.ts +16 -0
  374. package/dist/desktop/runtime.js +161 -0
  375. package/dist/desktop/worker_launch.d.ts +7 -0
  376. package/dist/desktop/worker_launch.js +7 -0
  377. package/dist/diagnostics/cargo_mutants_selection.d.ts +27 -0
  378. package/dist/diagnostics/cargo_mutants_selection.js +48 -0
  379. package/dist/diagnostics/native_terminal_benchmark.d.ts +58 -0
  380. package/dist/diagnostics/native_terminal_benchmark.js +1247 -0
  381. package/dist/diagnostics/session_evidence_package.d.ts +40 -0
  382. package/dist/diagnostics/session_evidence_package.js +234 -0
  383. package/dist/diagnostics/session_export.d.ts +94 -0
  384. package/dist/diagnostics/session_export.js +702 -0
  385. package/dist/emulation/catalog.d.ts +2 -0
  386. package/dist/emulation/catalog.js +50 -21
  387. package/dist/emulation/tool_adapters.d.ts +6 -0
  388. package/dist/emulation/tool_adapters.js +78 -18
  389. package/dist/emulation/ztc_addendum.d.ts +23 -0
  390. package/dist/emulation/ztc_addendum.js +50 -12
  391. package/dist/environment/service_runner.d.ts +1 -0
  392. package/dist/environment/service_runner.js +68 -0
  393. package/dist/environment/store.d.ts +120 -0
  394. package/dist/environment/store.js +387 -0
  395. package/dist/events.d.ts +43 -1
  396. package/dist/events.js +10 -17
  397. package/dist/goal_contract.d.ts +25 -0
  398. package/dist/goal_contract.js +44 -0
  399. package/dist/headless.d.ts +66 -1
  400. package/dist/headless.js +783 -82
  401. package/dist/headless_cli.js +14 -0
  402. package/dist/headless_cli_args.d.ts +5 -0
  403. package/dist/headless_cli_args.js +3 -0
  404. package/dist/headless_output_schema.d.ts +46 -0
  405. package/dist/headless_output_schema.js +386 -0
  406. package/dist/headless_trajectory.d.ts +44 -0
  407. package/dist/headless_trajectory.js +113 -0
  408. package/dist/intake/cli.d.ts +1 -0
  409. package/dist/intake/cli.js +33 -0
  410. package/dist/intake/format.d.ts +2 -0
  411. package/dist/intake/format.js +14 -0
  412. package/dist/intake/notifications.d.ts +16 -0
  413. package/dist/intake/notifications.js +132 -0
  414. package/dist/intake/store.d.ts +56 -0
  415. package/dist/intake/store.js +238 -0
  416. package/dist/library.d.ts +14 -3
  417. package/dist/library.js +27 -14
  418. package/dist/lsp/client.js +4 -1
  419. package/dist/lsp/servers.js +2 -0
  420. package/dist/mcp/client.d.ts +1 -0
  421. package/dist/mcp/client.js +20 -0
  422. package/dist/modes/builtin/plan.yaml +2 -2
  423. package/dist/modes/handlers.js +1 -1
  424. package/dist/onboarding/first_run.d.ts +26 -3
  425. package/dist/onboarding/first_run.js +61 -39
  426. package/dist/onboarding/router_tips.d.ts +7 -0
  427. package/dist/onboarding/router_tips.js +38 -0
  428. package/dist/onboarding/setup.d.ts +32 -0
  429. package/dist/onboarding/setup.js +133 -0
  430. package/dist/onboarding/setup_agent_health.d.ts +17 -0
  431. package/dist/onboarding/setup_agent_health.js +79 -0
  432. package/dist/onboarding/setup_environment.d.ts +66 -0
  433. package/dist/onboarding/setup_environment.js +219 -0
  434. package/dist/onboarding/setup_workspace.d.ts +17 -0
  435. package/dist/onboarding/setup_workspace.js +129 -0
  436. package/dist/onboarding/wordmark.d.ts +7 -0
  437. package/dist/onboarding/wordmark.js +14 -0
  438. package/dist/onboarding/zergai_login.d.ts +48 -0
  439. package/dist/onboarding/zergai_login.js +60 -0
  440. package/dist/optimize/adapters/index.d.ts +4 -1
  441. package/dist/optimize/adapters/index.js +7 -0
  442. package/dist/optimize/adapters/kernelbench.js +14 -5
  443. package/dist/optimize/adapters/popcorn.js +3 -2
  444. package/dist/optimize/adapters/profile_benchmark.js +13 -7
  445. package/dist/optimize/adapters/rfbench.js +25 -14
  446. package/dist/optimize/adapters/types.d.ts +3 -0
  447. package/dist/optimize/adapters/zergpod.js +5 -2
  448. package/dist/optimize/baseline.js +10 -21
  449. package/dist/optimize/branch.js +9 -12
  450. package/dist/optimize/combine.js +2 -3
  451. package/dist/optimize/executor.js +34 -48
  452. package/dist/optimize/measurements.d.ts +55 -0
  453. package/dist/optimize/measurements.js +173 -0
  454. package/dist/optimize/results.d.ts +1 -0
  455. package/dist/optimize/results.js +11 -33
  456. package/dist/optimize/tge.js +2 -1
  457. package/dist/panes/initial_input.d.ts +19 -0
  458. package/dist/panes/initial_input.js +206 -0
  459. package/dist/panes/labels.d.ts +16 -0
  460. package/dist/panes/labels.js +42 -0
  461. package/dist/panes/types.d.ts +1 -0
  462. package/dist/panes/ztc_launch.js +7 -0
  463. package/dist/plugin/optimization.d.ts +2 -0
  464. package/dist/plugin/optimization.js +1 -0
  465. package/dist/plugin/runtime.d.ts +2 -0
  466. package/dist/plugin/simulation.d.ts +6 -1
  467. package/dist/plugin/simulation_contract.d.ts +836 -1
  468. package/dist/plugin/simulation_documents.d.ts +22 -0
  469. package/dist/plugin/simulation_documents.js +1 -0
  470. package/dist/plugin/simulation_interventions.d.ts +103 -0
  471. package/dist/plugin/simulation_interventions.js +1 -0
  472. package/dist/plugin/simulation_living.d.ts +1 -0
  473. package/dist/plugin/simulation_living.js +3 -0
  474. package/dist/plugin/simulation_meetings.d.ts +121 -0
  475. package/dist/plugin/simulation_meetings.js +1 -0
  476. package/dist/plugin/simulation_story_review.d.ts +111 -0
  477. package/dist/plugin/simulation_story_review.js +1 -0
  478. package/dist/plugin/simulation_storyteller.d.ts +91 -0
  479. package/dist/plugin/simulation_storyteller.js +1 -0
  480. package/dist/plugin/simulation_structured.d.ts +2 -0
  481. package/dist/plugin/simulation_structured.js +2 -0
  482. package/dist/plugin/simulation_toolkit.d.ts +21 -0
  483. package/dist/plugin/simulation_toolkit.js +24 -0
  484. package/dist/prompts/subagent_worker.j2 +20 -0
  485. package/dist/prompts/tool_delegate_task.j2 +5 -14
  486. package/dist/remote-broker/Dockerfile +10 -0
  487. package/dist/remote-broker/archive.py +1227 -0
  488. package/dist/remote-broker/cutover.py +761 -0
  489. package/dist/remote-broker/requirements.txt +5 -0
  490. package/dist/remote-broker/resources.json +6 -0
  491. package/dist/remote-broker/resources.write-staging.example.json +18 -0
  492. package/dist/remote-broker/retained.py +686 -0
  493. package/dist/remote-broker/retained_cleanup.py +550 -0
  494. package/dist/remote-broker/server.py +648 -0
  495. package/dist/remote-broker/worker.py +1007 -0
  496. package/dist/router_auth.d.ts +66 -1
  497. package/dist/router_auth.js +344 -50
  498. package/dist/runbooks/catalog.d.ts +3 -0
  499. package/dist/runbooks/catalog.js +26 -0
  500. package/dist/runbooks/library.d.ts +11 -0
  501. package/dist/runbooks/library.js +95 -0
  502. package/dist/runbooks/package.d.ts +43 -0
  503. package/dist/runbooks/package.js +102 -0
  504. package/dist/runtime_info.d.ts +19 -6
  505. package/dist/runtime_info.js +64 -28
  506. package/dist/session.d.ts +68 -11
  507. package/dist/session.js +519 -36
  508. package/dist/session_handoff.d.ts +25 -0
  509. package/dist/session_handoff.js +322 -0
  510. package/dist/session_handoff_contract.d.ts +102 -0
  511. package/dist/session_handoff_contract.js +245 -0
  512. package/dist/session_media.d.ts +46 -0
  513. package/dist/session_media.js +358 -0
  514. package/dist/session_ownership.d.ts +16 -0
  515. package/dist/session_ownership.js +221 -0
  516. package/dist/session_public.d.ts +10 -2
  517. package/dist/session_public.js +6 -1
  518. package/dist/simulation/domain_types.d.ts +3 -3
  519. package/dist/simulation/dynamic_history.d.ts +42 -0
  520. package/dist/simulation/dynamic_history.js +173 -0
  521. package/dist/simulation/engines/swarm/pane_manager.js +7 -6
  522. package/dist/simulation/inference.d.ts +3 -1
  523. package/dist/simulation/inference.js +19 -1
  524. package/dist/simulation/intervention_generation.d.ts +27 -0
  525. package/dist/simulation/intervention_generation.js +246 -0
  526. package/dist/simulation/intervention_material.d.ts +4 -0
  527. package/dist/simulation/intervention_material.js +81 -0
  528. package/dist/simulation/living/context.d.ts +3130 -0
  529. package/dist/simulation/living/context.js +944 -0
  530. package/dist/simulation/living/definer.d.ts +12 -0
  531. package/dist/simulation/living/definer.js +223 -0
  532. package/dist/simulation/living/definition.d.ts +257 -0
  533. package/dist/simulation/living/definition.js +341 -0
  534. package/dist/simulation/living/frame.d.ts +259 -0
  535. package/dist/simulation/living/frame.js +223 -0
  536. package/dist/simulation/living/identifiers.d.ts +2 -0
  537. package/dist/simulation/living/identifiers.js +12 -0
  538. package/dist/simulation/living/index.d.ts +15 -0
  539. package/dist/simulation/living/index.js +15 -0
  540. package/dist/simulation/living/inference.d.ts +219 -0
  541. package/dist/simulation/living/inference.js +576 -0
  542. package/dist/simulation/living/mechanics.d.ts +54 -0
  543. package/dist/simulation/living/mechanics.js +588 -0
  544. package/dist/simulation/living/model-input.d.ts +25 -0
  545. package/dist/simulation/living/model-input.js +215 -0
  546. package/dist/simulation/living/open-world.d.ts +257 -0
  547. package/dist/simulation/living/open-world.js +102 -0
  548. package/dist/simulation/living/projection.d.ts +7 -0
  549. package/dist/simulation/living/projection.js +31 -0
  550. package/dist/simulation/living/recall.d.ts +17 -0
  551. package/dist/simulation/living/recall.js +25 -0
  552. package/dist/simulation/living/reduce.d.ts +15 -0
  553. package/dist/simulation/living/reduce.js +1853 -0
  554. package/dist/simulation/living/replay.d.ts +6 -0
  555. package/dist/simulation/living/replay.js +22 -0
  556. package/dist/simulation/living/runtime.d.ts +140 -0
  557. package/dist/simulation/living/runtime.js +3020 -0
  558. package/dist/simulation/living/shared-kinds.d.ts +24 -0
  559. package/dist/simulation/living/shared-kinds.js +96 -0
  560. package/dist/simulation/living/types.d.ts +2785 -0
  561. package/dist/simulation/living/types.js +669 -0
  562. package/dist/simulation/llm.d.ts +3 -1
  563. package/dist/simulation/llm.js +90 -30
  564. package/dist/simulation/memory/embedding.d.ts +1 -1
  565. package/dist/simulation/memory/embedding.js +9 -3
  566. package/dist/simulation/memory/filesystem.d.ts +2 -0
  567. package/dist/simulation/memory/filesystem.js +5 -1
  568. package/dist/simulation/memory/filesystem_file_tree.d.ts +4 -1
  569. package/dist/simulation/memory/filesystem_file_tree.js +41 -10
  570. package/dist/simulation/memory/filesystem_invariants.js +1 -2
  571. package/dist/simulation/memory/filesystem_types.d.ts +1 -0
  572. package/dist/simulation/memory/memory.d.ts +2 -0
  573. package/dist/simulation/memory/memory.js +5 -1
  574. package/dist/simulation/orchestration/intent.js +0 -2
  575. package/dist/simulation/orchestration/lifecycle.js +0 -2
  576. package/dist/simulation/orchestration/world_response.d.ts +2 -2
  577. package/dist/simulation/plugin_host.d.ts +25 -1
  578. package/dist/simulation/plugin_host.js +334 -17
  579. package/dist/simulation/session_documents.d.ts +20 -0
  580. package/dist/simulation/session_documents.js +62 -0
  581. package/dist/simulation/session_input_validation.d.ts +43 -0
  582. package/dist/simulation/session_input_validation.js +364 -0
  583. package/dist/simulation/session_inputs.d.ts +32 -0
  584. package/dist/simulation/session_inputs.js +154 -0
  585. package/dist/simulation/telemetry.d.ts +11 -14
  586. package/dist/simulation/telemetry.js +177 -54
  587. package/dist/simulation/toolkit/bounded_turns.d.ts +13 -0
  588. package/dist/simulation/toolkit/bounded_turns.js +80 -0
  589. package/dist/simulation/toolkit/dynamic_agents.d.ts +25 -0
  590. package/dist/simulation/toolkit/dynamic_agents.js +218 -0
  591. package/dist/simulation/toolkit/dynamic_digest.d.ts +1 -0
  592. package/dist/simulation/toolkit/dynamic_digest.js +8 -0
  593. package/dist/simulation/toolkit/dynamic_documents.d.ts +7 -0
  594. package/dist/simulation/toolkit/dynamic_documents.js +71 -0
  595. package/dist/simulation/toolkit/dynamic_driver.d.ts +8 -0
  596. package/dist/simulation/toolkit/dynamic_driver.js +269 -0
  597. package/dist/simulation/toolkit/dynamic_game.d.ts +53 -0
  598. package/dist/simulation/toolkit/dynamic_game.js +805 -0
  599. package/dist/simulation/toolkit/dynamic_knowledge.d.ts +15 -0
  600. package/dist/simulation/toolkit/dynamic_knowledge.js +91 -0
  601. package/dist/simulation/toolkit/dynamic_mechanics.d.ts +22 -0
  602. package/dist/simulation/toolkit/dynamic_mechanics.js +910 -0
  603. package/dist/simulation/toolkit/dynamic_meetings.d.ts +239 -0
  604. package/dist/simulation/toolkit/dynamic_meetings.js +350 -0
  605. package/dist/simulation/toolkit/dynamic_progress.d.ts +131 -0
  606. package/dist/simulation/toolkit/dynamic_progress.js +214 -0
  607. package/dist/simulation/toolkit/dynamic_projection.d.ts +9 -0
  608. package/dist/simulation/toolkit/dynamic_projection.js +219 -0
  609. package/dist/simulation/toolkit/dynamic_runtime.d.ts +412 -0
  610. package/dist/simulation/toolkit/dynamic_runtime.js +6536 -0
  611. package/dist/simulation/toolkit/dynamic_state.d.ts +111 -0
  612. package/dist/simulation/toolkit/dynamic_state.js +1967 -0
  613. package/dist/simulation/toolkit/dynamic_story_review.d.ts +508 -0
  614. package/dist/simulation/toolkit/dynamic_story_review.js +333 -0
  615. package/dist/simulation/toolkit/dynamic_storyteller.d.ts +77 -0
  616. package/dist/simulation/toolkit/dynamic_storyteller.js +114 -0
  617. package/dist/simulation/toolkit/dynamic_storyteller_runtime.d.ts +26 -0
  618. package/dist/simulation/toolkit/dynamic_storyteller_runtime.js +126 -0
  619. package/dist/simulation/toolkit/dynamic_world.d.ts +22 -0
  620. package/dist/simulation/toolkit/dynamic_world.js +377 -0
  621. package/dist/simulation/toolkit/structured_output.d.ts +5 -0
  622. package/dist/simulation/toolkit/structured_output.js +321 -0
  623. package/dist/simulation/types/world.d.ts +2 -0
  624. package/dist/simulation/world/artifact_store.js +1 -1
  625. package/dist/simulation/world/bootstrap_schema.d.ts +1 -1
  626. package/dist/simulation/world/gm_schema.d.ts +8 -8
  627. package/dist/simulation/world/memory_manager.d.ts +5 -0
  628. package/dist/simulation/world/memory_manager.js +17 -2
  629. package/dist/simulation/world/state.d.ts +3 -2
  630. package/dist/simulation/world/state.js +15 -5
  631. package/dist/skills/bundled/measurement-validation/SKILL.md +144 -0
  632. package/dist/skills/loader.js +3 -1
  633. package/dist/terminal_attach.d.ts +1 -0
  634. package/dist/terminal_attach.js +113 -0
  635. package/dist/tool_progress.d.ts +3 -0
  636. package/dist/tool_progress.js +27 -0
  637. package/dist/types.d.ts +149 -10
  638. package/dist/types.js +3 -0
  639. package/dist/ui/core/input.d.ts +8 -1
  640. package/dist/ui/core/input.js +5 -1
  641. package/dist/ui/core/input_segments.d.ts +22 -1
  642. package/dist/ui/core/input_segments.js +133 -47
  643. package/dist/ui/core/input_state.d.ts +12 -0
  644. package/dist/ui/core/layout_yoga.d.ts +1 -1
  645. package/dist/ui/core/turn_metadata.d.ts +5 -0
  646. package/dist/ui/core/turn_metadata.js +22 -0
  647. package/dist/ui/ink/render.d.ts +2 -1
  648. package/dist/ui/ink/render.js +6 -5
  649. package/dist/ui/ratatui/headless_pane_manager.d.ts +16 -1
  650. package/dist/ui/ratatui/headless_pane_manager.js +306 -106
  651. package/dist/ui/ratatui/index.d.ts +1 -0
  652. package/dist/ui/ratatui/input.d.ts +4 -0
  653. package/dist/ui/ratatui/input.js +16 -0
  654. package/dist/ui/ratatui/ipc_path.d.ts +2 -0
  655. package/dist/ui/ratatui/ipc_path.js +29 -1
  656. package/dist/ui/ratatui/mux_persistence.d.ts +3 -1
  657. package/dist/ui/ratatui/mux_persistence.js +139 -1
  658. package/dist/ui/ratatui/pane_relay.d.ts +1 -1
  659. package/dist/ui/ratatui/pane_relay.js +55 -27
  660. package/dist/ui/ratatui/process.d.ts +17 -1
  661. package/dist/ui/ratatui/process.js +102 -20
  662. package/dist/ui/ratatui/protocol.d.ts +250 -1
  663. package/dist/ui/ratatui/protocol.js +92 -0
  664. package/dist/ui/scrollback.d.ts +19 -1
  665. package/dist/ui/scrollback.js +146 -7
  666. package/dist/ui/stream_typewriter.d.ts +8 -3
  667. package/dist/ui/stream_typewriter.js +30 -1
  668. package/dist/ui/streaming_scrollback.d.ts +1 -0
  669. package/dist/ui/streaming_scrollback.js +1 -1
  670. package/dist/ui/terminal_image.d.ts +129 -0
  671. package/dist/ui/terminal_image.js +516 -0
  672. package/dist/ui/transcript_render_cache.d.ts +4 -4
  673. package/dist/ui/transcript_render_cache.js +17 -4
  674. package/dist/ui/views/activity_line.d.ts +5 -3
  675. package/dist/ui/views/activity_line.js +65 -7
  676. package/dist/ui/views/app.d.ts +11 -4
  677. package/dist/ui/views/app.js +27 -9
  678. package/dist/ui/views/completion_menu.js +18 -10
  679. package/dist/ui/views/input_area.d.ts +6 -3
  680. package/dist/ui/views/input_area.js +15 -9
  681. package/dist/ui/views/message_list.d.ts +11 -1
  682. package/dist/ui/views/message_list.js +262 -61
  683. package/dist/ui/views/queue_panel.d.ts +3 -1
  684. package/dist/ui/views/queue_panel.js +9 -2
  685. package/dist/ui/views/status_bar.d.ts +4 -2
  686. package/dist/ui/views/status_bar.js +26 -9
  687. package/dist/ui/views/theme.d.ts +4 -0
  688. package/dist/ui/views/theme.js +4 -0
  689. package/dist/ui/widgets/color_panel.js +22 -3
  690. package/dist/ui/widgets/form.d.ts +8 -1
  691. package/dist/ui/widgets/form.js +44 -22
  692. package/dist/ui/widgets/index.d.ts +1 -1
  693. package/dist/ui/widgets/index.js +1 -1
  694. package/dist/ui/widgets/log_view.js +11 -3
  695. package/dist/ui/widgets/navigator_panel.js +13 -4
  696. package/dist/ui/widgets/panel_frame.d.ts +2 -0
  697. package/dist/ui/widgets/panel_frame.js +14 -0
  698. package/dist/ui/widgets/prompt_viewer.js +4 -1
  699. package/dist/ui/widgets/questionnaire.d.ts +2 -0
  700. package/dist/ui/widgets/questionnaire.js +82 -19
  701. package/dist/ui/widgets/reasoning_track.d.ts +60 -0
  702. package/dist/ui/widgets/reasoning_track.js +218 -0
  703. package/dist/ui/widgets/resume_panel.js +24 -10
  704. package/dist/ui/widgets/rewind_panel.d.ts +2 -2
  705. package/dist/ui/widgets/rewind_panel.js +8 -18
  706. package/dist/ui/widgets/select.d.ts +90 -4
  707. package/dist/ui/widgets/select.js +316 -157
  708. package/dist/ui/widgets/settings_panel.d.ts +21 -1
  709. package/dist/ui/widgets/settings_panel.js +282 -45
  710. package/dist/ui/widgets/status_line_panel.d.ts +1 -0
  711. package/dist/ui/widgets/status_line_panel.js +36 -9
  712. package/dist/ui/widgets/text_input.d.ts +6 -0
  713. package/dist/ui/widgets/text_input.js +33 -12
  714. package/dist/ui/widgets/types.d.ts +4 -0
  715. package/dist/usage_projection.d.ts +24 -0
  716. package/dist/usage_projection.js +130 -0
  717. package/dist/usage_snapshot.d.ts +36 -0
  718. package/dist/usage_snapshot.js +131 -0
  719. package/dist/utils/assistant_message.d.ts +2 -0
  720. package/dist/utils/assistant_message.js +5 -0
  721. package/dist/utils/atomic_write.d.ts +6 -2
  722. package/dist/utils/atomic_write.js +29 -4
  723. package/dist/utils/checked_shell.d.ts +25 -0
  724. package/dist/utils/checked_shell.js +107 -0
  725. package/dist/utils/compaction.d.ts +26 -3
  726. package/dist/utils/compaction.js +252 -44
  727. package/dist/utils/context.js +1 -0
  728. package/dist/utils/debug_log.d.ts +12 -0
  729. package/dist/utils/debug_log.js +25 -3
  730. package/dist/utils/deepseek.d.ts +3 -1
  731. package/dist/utils/deepseek.js +29 -1
  732. package/dist/utils/docker_target.d.ts +28 -0
  733. package/dist/utils/docker_target.js +89 -0
  734. package/dist/utils/ephemeral.js +6 -0
  735. package/dist/utils/ephemeral_tools.d.ts +18 -0
  736. package/dist/utils/ephemeral_tools.js +97 -0
  737. package/dist/utils/fireworks.d.ts +4 -4
  738. package/dist/utils/fireworks.js +11 -7
  739. package/dist/utils/idle_compaction.d.ts +32 -0
  740. package/dist/utils/idle_compaction.js +113 -0
  741. package/dist/utils/jev_client.d.ts +4 -0
  742. package/dist/utils/jev_client.js +15 -0
  743. package/dist/utils/mid_turn_compaction.d.ts +12 -0
  744. package/dist/utils/mid_turn_compaction.js +17 -0
  745. package/dist/utils/open_url.d.ts +4 -0
  746. package/dist/utils/open_url.js +10 -0
  747. package/dist/utils/openrouter_prices.d.ts +165 -0
  748. package/dist/utils/openrouter_prices.js +313 -0
  749. package/dist/utils/router_catalog.d.ts +17 -2
  750. package/dist/utils/router_catalog.js +84 -8
  751. package/dist/utils/sandbox.d.ts +21 -0
  752. package/dist/utils/sandbox.js +141 -20
  753. package/dist/utils/session_interactivity.d.ts +21 -0
  754. package/dist/utils/session_interactivity.js +28 -0
  755. package/dist/utils/shell.d.ts +14 -0
  756. package/dist/utils/shell.js +137 -37
  757. package/dist/utils/subprocess_env.d.ts +30 -0
  758. package/dist/utils/subprocess_env.js +93 -1
  759. package/dist/utils/tool_output_copies.d.ts +44 -0
  760. package/dist/utils/tool_output_copies.js +196 -0
  761. package/dist/utils/tool_result_message.d.ts +7 -0
  762. package/dist/utils/tool_result_message.js +11 -0
  763. package/dist/utils/tool_trace.d.ts +15 -0
  764. package/dist/utils/tool_trace.js +40 -9
  765. package/dist/web/accounts_mirror.d.ts +3 -1
  766. package/dist/web/accounts_mirror.js +13 -9
  767. package/dist/web/child_publication.d.ts +17 -0
  768. package/dist/web/child_publication.js +45 -0
  769. package/dist/web/event_history_store.d.ts +2 -0
  770. package/dist/web/event_history_store.js +31 -6
  771. package/dist/web/mirror_authenticator.d.ts +31 -11
  772. package/dist/web/mirror_authenticator.js +67 -17
  773. package/dist/web/mirror_client.d.ts +34 -4
  774. package/dist/web/mirror_client.js +189 -23
  775. package/dist/web/mirror_stream.d.ts +95 -22
  776. package/dist/web/mirror_stream.js +699 -98
  777. package/dist/web/observer_query_redaction.d.ts +6 -0
  778. package/dist/web/observer_query_redaction.js +58 -0
  779. package/dist/web/pane_registry.d.ts +2 -0
  780. package/dist/web/pane_registry.js +86 -22
  781. package/dist/web/tool_image.d.ts +6 -0
  782. package/dist/web/tool_image.js +17 -0
  783. package/dist/web/view_plugin.d.ts +14 -0
  784. package/dist/web/view_plugin.js +23 -1
  785. package/dist/worker/executor.js +33 -12
  786. package/dist/worker/index.d.ts +1 -0
  787. package/dist/worker/toolsets.d.ts +1 -1
  788. package/dist/worker/toolsets.js +7 -4
  789. package/dist/worker/types.d.ts +18 -1
  790. package/dist/worker/worker_models.d.ts +17 -0
  791. package/dist/worker/worker_models.js +79 -0
  792. package/dist/workflows/registry.js +1 -0
  793. package/dist/workflows/registry_handle.d.ts +2 -0
  794. package/dist/workflows/runtime.d.ts +2 -0
  795. package/dist/workflows/runtime.js +1 -0
  796. package/dist/workspace_agent.d.ts +7 -0
  797. package/dist/workspace_agent.js +36 -0
  798. package/dist/workspace_collision.d.ts +76 -0
  799. package/dist/workspace_collision.js +688 -0
  800. package/dist/workspace_layout.d.ts +18 -0
  801. package/dist/workspace_layout.js +121 -0
  802. package/dist/workspace_runtime.d.ts +44 -0
  803. package/dist/workspace_runtime.js +82 -0
  804. package/dist/workspace_session_context.d.ts +62 -0
  805. package/dist/workspace_session_context.js +160 -0
  806. package/dist/zlm-embed.mjs +75209 -10127
  807. package/dist/zlm.js +1 -0
  808. package/node_modules/@zerg/model-contracts/README.md +28 -5
  809. package/node_modules/@zerg/model-contracts/index.d.ts +9 -3
  810. package/node_modules/@zerg/model-contracts/index.js +44 -19
  811. package/package.json +55 -25
  812. package/packages/model-contracts/README.md +28 -5
  813. package/packages/model-contracts/index.d.ts +9 -3
  814. package/packages/model-contracts/index.js +44 -19
  815. package/remote-broker/Dockerfile +10 -0
  816. package/remote-broker/README.md +308 -0
  817. package/remote-broker/archive.py +1227 -0
  818. package/remote-broker/cutover.py +761 -0
  819. package/remote-broker/requirements.txt +5 -0
  820. package/remote-broker/resources.example.json +6 -0
  821. package/remote-broker/resources.write-staging.example.json +18 -0
  822. package/remote-broker/retained.py +686 -0
  823. package/remote-broker/retained_cleanup.py +550 -0
  824. package/remote-broker/server.py +648 -0
  825. package/scripts/build-remote-broker.mjs +13 -0
  826. package/scripts/ensure-local-packages.mjs +6 -0
  827. package/scripts/install-macos-app.mjs +10 -1
  828. 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,31 +30,44 @@ 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
42
- npm install -g @zergai/ztc
38
+ # Check the published beta and install the public CLI
39
+ npm view @zergai/ztc@next version
40
+ npm install -g @zergai/ztc@next
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
 
48
- On first launch, choose one authentication route in the welcome message. Then
49
- describe the project outcome you want. Review the plan and run `/execute` when
50
- you are ready for ZTC to make the proposed changes.
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
+
53
+ At launch, until you log in with ZergAI or choose local API keys that reach a
54
+ model, ZTC asks how to reach a model: **Log in with ZergAI (recommended)** or
55
+ **Use your local API keys**. The question needs an answer: typing or Esc only
56
+ reminds you to choose one, and Ctrl+C quits. Choosing ZergAI opens your browser
57
+ to log in. A first login starts on DeepSeek V4.1 Flash on Fireworks; pick any
58
+ other Zerg Router model with `/model zergrouter <provider> <model>`. `/connect`
59
+ asks again any time. Then describe the project outcome you want. Review the
60
+ plan and run `/execute` when you are ready for ZTC to make the proposed changes.
51
61
 
52
62
  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
54
- `/model claude_code`).
63
+ (`/config key <provider>`, which takes the key in a hidden prompt or the name of the
64
+ environment variable that holds it), or Claude Code OAuth (`claude setup-token`, then
65
+ `/model claude_code`). A variable you name is used once it is set; until then ZTC keeps
66
+ using the saved key or the provider's standard variable.
55
67
 
56
68
  For browser login at **zergrouter.com**, run `ztc auth login` in your shell or
57
- `/auth login` inside ZTC. Both use the same flow and credentials. See
69
+ `/auth login` inside ZTC. Both use the same flow and credentials. `/auth cancel`
70
+ (or Esc) stops a login still waiting for approval; in the shell, Ctrl+C does. See
58
71
  [Zerg Router and DeepSeek setup](docs/zerg-router.md) for model selection,
59
72
  Claude Code/Codex emulation, and `ztc "prompt"` or `ztc -p "prompt"` usage.
60
73
 
@@ -92,9 +105,6 @@ in the browser mirror. Run `/help` for the full command list.
92
105
  # Install dependencies and build
93
106
  npm install && npm run build
94
107
 
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
108
  # Build native Rust binaries (screen capture, input injection)
99
109
  npm run build:rust
100
110
 
@@ -107,14 +117,14 @@ npm start
107
117
 
108
118
  ### Requirements
109
119
 
110
- - Node.js >= 20
120
+ - Node.js 20.19+ on the 20.x line, or 22.12+
111
121
  - Rust toolchain (for native binaries — `cargo`)
112
122
  - 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
123
 
114
124
  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`
125
+ The published beta native payload supports `darwin-arm64`
116
126
  only (`aarch64-apple-darwin`). Interactive TUI, desktop, audio,
117
- and computer-control binaries from this prerelease are supported only on Apple
127
+ and computer-control binaries from this beta are supported only on Apple
118
128
  Silicon macOS. Other platforms may use the JavaScript/headless APIs, but this
119
129
  beta does not claim an interactive native payload for them.
120
130
 
@@ -125,6 +135,8 @@ beta does not claim an interactive native payload for them.
125
135
  - **Streaming responses** with real-time tool execution traces
126
136
  - **Context management** — automatic compaction at configurable thresholds, manual `/compact`
127
137
  - **Session persistence** — auto-save, resume with `ztc resume` or `--resume`, per-project session storage
138
+ - **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.
139
+ 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
140
  - **Mux-aware resume** — `ztc resume` restores the saved conversation and, when present, the prior `zmux` layout plus child ZTC panes
129
141
  - **Sub-agent delegation** — spawn isolated agents for context-heavy research
130
142
  - **Plan mode** — read-only codebase exploration, then structured implementation
@@ -145,26 +157,67 @@ beta does not claim an interactive native payload for them.
145
157
  orchestrator registry
146
158
  - **Message bus** — inter-agent communication across panes
147
159
 
148
- ### ZTerm Desktop
160
+ ### ZTC Desktop
161
+
162
+ On Apple Silicon macOS, ZTC also ships as a native desktop app, `ztc.app`,
163
+ from [zergai.com/ztc](https://zergai.com/ztc) or the installer:
164
+
165
+ ```bash
166
+ curl -fsSL https://zergai.com/install/ztc.sh | sh -s -- --preview
167
+ ```
168
+
169
+ The app carries its own Node and matching ZTC agent, so it starts from the
170
+ icon without a global Node or ZTC install, and it uses the same accounts,
171
+ configuration and saved sessions as the CLI. Its title bar names the project
172
+ and branch, and holds the model (click it to choose another), the queue, Stop
173
+ and Updates. Releases are signed, notarized and published in
174
+ [`Epoch-ML/ztc-releases`](https://github.com/Epoch-ML/ztc-releases).
175
+
176
+ From a terminal you can also open the desktop surface explicitly:
149
177
 
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.
178
+ ```bash
179
+ ztc --desktop --cwd /path/to/project
180
+ ```
181
+
182
+ An npm-installed `ztc --desktop` uses a legacy `/Applications/ZTerm.app` (or
183
+ `~/Applications/ZTerm.app`) when one is installed, and otherwise the renderer
184
+ packaged with the CLI. `npm install` does not create an application bundle;
185
+ the package includes an optional launcher installer:
186
+
187
+ ```bash
188
+ node "$(npm root -g)/@zergai/ztc/scripts/install-macos-app.mjs"
189
+ ```
156
190
 
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.
191
+ It creates `ZTC Desktop.app` in `/Applications` when writable, otherwise
192
+ `~/Applications`; `ZTC_DESKTOP_APP_DIR=/path` selects another directory and
193
+ `ZTC_SKIP_DESKTOP_APP=1` skips it. Opening the launcher runs
194
+ `ztc --desktop --cwd "$HOME"` through the package's own launcher.
195
+
196
+ From a desktop session, type `/desktop install-cli` to install an optional
197
+ `ztc` command in `~/.local/bin` (or `/desktop install-cli /path/to/bin`). It
198
+ preserves foreign commands, does not edit PATH or shell configuration, and runs
199
+ that app's agent with the same arguments, directory and profile/config/session
200
+ selection as the CLI. If the app moves, the command says how to reinstall it.
201
+
202
+ **Updates are automatic.** The app checks its signed release feed at startup
203
+ and every 6 hours, downloads and verifies a newer release in the background,
204
+ and installs it when you quit ZTC; it never restarts while you work. Turning
205
+ off **Update ZTC automatically** in the Updates window restores manual
206
+ download and installation. Inside the app, `/update` explains this instead of
207
+ running npm. See [desktop release details](packages/zterm/RELEASES.md) for the
208
+ trust, packaging and publication contract.
163
209
 
164
210
  ### Voice & Media
165
211
  - **Voice dictation** — native Whisper transcription (Ctrl+R)
166
212
  - **TTS synthesis** — multiple backends (macOS say, Parler, OpenAI, ElevenLabs)
167
213
  - **Image support** — paste from clipboard (Ctrl+I), screenshot compression
214
+ - **Images in the transcript** — pasted images, image files the agent reads and
215
+ tool screenshots appear under their message. Ghostty and Kitty show the image
216
+ itself, sent once with the Kitty graphics protocol and placed with its Unicode
217
+ placeholders, so it scrolls into history like text, in zmux or without it.
218
+ Other terminals, tmux, ZTC child panes and ZTC Desktop show a 24-bit
219
+ half-block preview.
220
+ `ZTC_IMAGE_PROTOCOL=kitty` or `=blocks` overrides the detection.
168
221
 
169
222
  ---
170
223
 
@@ -302,6 +355,42 @@ npm run dev -- --no-mux
302
355
 
303
356
  ### Pane Tools
304
357
 
358
+ `/layout orchestrator` opens **Main** in the large left pane, **Decisions** above
359
+ **Status** on the right. Decisions lists pending questions from child panes;
360
+ select one and answer its wizard to resume that child. Escape leaves the request
361
+ pending. Status shows each child's observed task, todo progress, blockers and
362
+ reported or estimated tokens. Missing usage stays unknown. It reads runtime
363
+ state without model calls, refreshes every ten minutes, and accepts `r` for an
364
+ immediate refresh. Use `/layout orchestrator --refresh-ms 30000` to change the
365
+ interval.
366
+
367
+ `/layout pair` opens Main and one new worker. `/layout grid --workers 3` opens
368
+ Main and three new workers (four by default). Opening a preset preserves existing
369
+ pane processes in their earlier window. Launch directly with
370
+ `ztc --layout orchestrator`, `ztc --layout pair`, or
371
+ `ztc --layout grid --layout-workers 3`; use `--layout-refresh-ms` for the launch
372
+ refresh interval. These flags require an interactive workspace.
373
+
374
+ For a project preset, save `.ztc/layouts/review.yaml` and run `/layout review`
375
+ or `ztc --layout review`:
376
+
377
+ ```yaml
378
+ schema_version: 1
379
+ template: orchestrator # orchestrator, pair or grid
380
+ refresh_ms: 600000 # 1–86400000; applies to Status
381
+ titles:
382
+ main: Review Main
383
+ decisions: Review Choices
384
+ status: Review Status
385
+ ```
386
+
387
+ Grid presets also accept `workers: 1` through `32` and `titles.worker` for the
388
+ worker title prefix. Names contain up to 64 letters, digits, underscores or
389
+ hyphens; builtin names are reserved. Invalid files report their filename and
390
+ schema error before starting a child. Named `/layout save`, `restore`, `list`,
391
+ `delete`, `run` and `resume` remain available. Restored monitor commands belong
392
+ to their original parent; open a fresh preset in a new parent.
393
+
305
394
  When running in zmux, the agent gains access to terminal pane management:
306
395
 
307
396
  | Tool | Description |
@@ -316,7 +405,7 @@ When running in zmux, the agent gains access to terminal pane management:
316
405
 
317
406
  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
407
 
319
- - Mouse wheel scrolls the pane under the pointer by default
408
+ - 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
409
  - Drag across transcript text and release to copy it, including in zoomed panes and scrolled history
321
410
  - Panes with scrollable history show a live scrollbar gutter on the right edge
322
411
  - Clicking the scrollbar gutter jumps to that point in history
@@ -422,6 +511,32 @@ its REST, SSE, asset, and media URLs while the proxy strips it upstream.
422
511
 
423
512
  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
513
 
514
+ ### Human Attention
515
+
516
+ `/attention` lists pending approvals, questions, blocked runs, failures, review
517
+ requests and stale requests across the session's panes. Each item shows its
518
+ agent, session, task, blocker, age and next action. Copy the item's ID to act:
519
+
520
+ ```text
521
+ /attention show <ID>
522
+ /attention answer <ID> <answer>
523
+ /attention approve <ID>
524
+ /attention deny <ID> <reason>
525
+ /attention dismiss <ID>
526
+ ```
527
+
528
+ Only the operator can answer or approve requests. Dismiss acknowledges a
529
+ failure, review or stale notice; it cannot dismiss an open approval. Use
530
+ `/attention list 2` for the next page of a large queue.
531
+
532
+ The browser mirror's **Needs you** panel reads the same queue. Selecting an
533
+ item opens its question or approval form. Answering in either the terminal or
534
+ browser clears that exact request from both views. Reloading the browser keeps
535
+ live request ownership; an old answer cannot resolve a newer request. Requests
536
+ from exited panes become stale notices. Idle status keeps failures visible
537
+ until acknowledgement or new work. Oversized forms stay available in their
538
+ originating pane.
539
+
425
540
  ### Conductor Branches
426
541
 
427
542
  Launch the ZTC build from a running Conductor workspace branch:
@@ -528,7 +643,151 @@ resume [id] Resume session (latest or by ID)
528
643
  --list-sessions List saved sessions
529
644
  ```
530
645
 
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.
646
+ When a saved session includes `zmux` state, `ztc resume` restores the pane layout,
647
+ focus, zoom and launch intent. Restored children remain inactive. Use
648
+ `/layout run <pane-id>` for an ordinary saved process or
649
+ `/layout resume <pane-id>` for its saved agent session. Child ZTC panes keep
650
+ stable session IDs; restoration does not submit a new prompt or start their work.
651
+
652
+ A replacement pane offers a saved task handoff from the same project, with an
653
+ exact `ztc resume <id>` selector, source directory and checkpoint time. The offer
654
+ does not start inference. Explicit resume includes that selected checkpoint in
655
+ the standalone agent's context; a fresh pane starts a separate task. Hosted
656
+ agents with a caller-owned system prompt retain that prompt unchanged.
657
+
658
+ The handoff records the objective, pending corrections, process receipt handles,
659
+ unresolved calls and any recorded blocker. A process exit code does not establish
660
+ task completion, and a historical PID does not establish current ownership.
661
+ Corrections retain their Enter or Tab intent, but resuming does not automatically
662
+ send them or repeat unresolved tools. Inspect uncertain outcomes before continuing.
663
+ Long text has a bounded preview with omission counts; its retained source message
664
+ contains the full correction. The optional web mirror shows the same sourced
665
+ checkpoint. Discovery is bounded, so use the exact session selector for older work
666
+ that falls outside the offered history.
667
+
668
+ The terminal and headless hosts save the exact harness tool call before executing
669
+ it, then save its observed result or error before acknowledging it or continuing
670
+ inference. A required checkpoint write failure stops that dispatch or continuation;
671
+ repair the storage problem and inspect the original call before resuming. A late
672
+ result belongs to its original turn, even when a newer turn has already started.
673
+ Unresolved calls survive compaction and resume as unknown outcomes, without an
674
+ automatic retry. A retained invocation ID cannot dispatch again or be reused for
675
+ different arguments or another tool. This identity check does not deduplicate
676
+ arbitrary commands issued with new IDs. Inspect the original command job or remote operation receipts:
677
+ local cancellation does not establish that an external operation stopped.
678
+ These checkpoints cover process interruption, not power-loss durability. Native
679
+ provider builtins that execute outside the host cannot offer this predispatch
680
+ barrier; harness-dispatched dynamic tools use it.
681
+
682
+ Automatic session pruning is disabled by default. To opt in, set
683
+ `"sessionRetentionCount": 50` in the active profile's `config.json`. At the next
684
+ startup, ZTC keeps the newest 50 unnamed, unowned sessions in the workspace.
685
+ Named sessions and sessions loaded or saved by a running process are retained
686
+ in addition to that count, together with their tool responses. A paused process
687
+ still owns its sessions; ownership ends when the process exits. Set the value
688
+ to `null` or remove it to disable pruning. Zero removes all eligible sessions,
689
+ so use a positive count when you want recent unnamed history to remain.
690
+ Caller-managed `--session-file` storage is excluded from startup pruning.
691
+
692
+ For shared remote files, configure a guarded session in the active profile:
693
+
694
+ ```json
695
+ {
696
+ "remoteResources": [
697
+ {
698
+ "id": "media", "host": "server.example.com", "user": "media", "root": "/data/media",
699
+ "broker": { "url": "https://server.example.com/v1/resources", "tokenEnv": "ZTC_MEDIA_BROKER_TOKEN" }
700
+ }
701
+ ]
702
+ }
703
+ ```
704
+
705
+ Deploy the [immutable resource broker](remote-broker/README.md) first. Configure
706
+ the same broker, resource identity and roots in each participating pane. Supply
707
+ the credential through the named host environment variable. Credentials and
708
+ execution endpoints are never accepted from model tool arguments.
709
+
710
+ Guarded sessions use the `remote_resource` tool for bounded reads, listings,
711
+ file writes, and deletion of files or empty directories. File operations require
712
+ a lease on the configured root; status remains available for inspecting ownership.
713
+ Unrestricted shell, network and plugin tools are blocked. Use normal mode with a
714
+ built-in Router or direct API provider. Subscription/native provider paths and
715
+ plugin hosts are not admitted in guarded sessions. The default transport uses
716
+ authenticated HTTPS RPC and refuses legacy SSH execution. The receiver requires
717
+ a non-root, read-only execution image and policy, with writable data on a separate
718
+ filesystem beneath `/data`. Its workers use an absolute, isolated Python
719
+ interpreter without shell startup or PATH lookup. A host-only numeric loopback
720
+ HTTP exception is available for local development; external endpoints require HTTPS.
721
+
722
+ Run `/resources show` in each pane to display its immutable owner ID, current
723
+ owner, conflicts, lease generation, and up to 100 unresolved operation references
724
+ from each journal (with their total counts). Claim with `/resources claim media 0`
725
+ (use the displayed generation). Transfer with
726
+ `/resources transfer media <generation> <target-owner-id>` after the target pane
727
+ has inspected status. Stop with `/resources stop media <generation>`. These
728
+ commands require user input; chat and queued prompts cannot grant ownership.
729
+ The default lease lasts 900 seconds; claim or transfer accepts a final duration
730
+ from 1 to 3600 seconds. An expired lease requires another confirmed claim.
731
+
732
+ Leases are shared in the broker's persistent state volume, cover overlapping roots and
733
+ symlink aliases, and remain enforced across client reconnects. Stop and handoff
734
+ revoke the former owner's writes. Set `dry_run: true` on a managed operation to
735
+ check its target and ownership before changing files. Removing profile settings
736
+ does not lift a running session's guard; start a new session for local work.
737
+
738
+ Guarded sessions show host-authored deletion receipt reports. Provider narration
739
+ and displayed reasoning are withheld; the agent uses `ask_user` for questions.
740
+ Opaque provider reasoning on tool-call turns is retained for API continuity,
741
+ including saved-history replay, without rendering it as assistant narration. Each deletion
742
+ has a host-generated operation ID and a remote journal entry written before the
743
+ operation. Completion requires a persisted final receipt and verification of the
744
+ exact target's absence, physical resource identity and parent directory. Reports
745
+ state the verification time; later changes can alter that target again.
746
+
747
+ Removed logical file bytes are reported separately from reclaimed quota or free
748
+ space. This broker does not measure attributable quota changes, so reclaimed
749
+ space is shown as unknown. Dry runs, failed operations, pending receipts and
750
+ unverified target state cannot produce a verified completion report. Generic
751
+ shell and native harness sessions receive evidence guidance without this guarded
752
+ receipt enforcement.
753
+
754
+ Writes and deletions persist a client call-to-operation record before dispatch,
755
+ then a remote receipt before the effect. A lost reply, lost acknowledgement,
756
+ pending receipt, or unverified result fences overlapping pathnames and known
757
+ physical target identities. New tool-call IDs, a reconnect, a replacement file,
758
+ another client journal, and ownership transfer do not lift that fence. Independent
759
+ targets remain usable. Repeating an originating tool call never replays its effect.
760
+ A broker rejection proving that the exact request was never admitted releases its
761
+ local reservation without claiming an effect.
762
+
763
+ If a reply is interrupted or uncertain, retain its operation ID. The agent can
764
+ inspect the `remote_resource` `receipt` operation with `receipt_id`; this requires
765
+ the originating owner, resource ID and a current lease. Inspection alone does not
766
+ release admission. The current lease owner can perform confirmed recovery:
767
+
768
+ ```text
769
+ /resources reconcile media <operation-uuid>
770
+ /resources resolve media <operation-uuid> <observation-token>
771
+ ```
772
+
773
+ Review the original receipt and the current target state before typing `resolve`.
774
+ This accepts the inspected current state and releases admission; it neither
775
+ replays an operation nor proves an uncertain earlier effect. A changed target or
776
+ lease generation invalidates the observation token. A request that never reached
777
+ the remote journal gets a durable cancellation record, so a delayed arrival cannot
778
+ mutate the target after recovery. These recovery commands are user-only, and they
779
+ remain available to the current owner after a confirmed transfer. Reads and dry
780
+ runs do not release a fence. External filesystem writers are not serialized by
781
+ the broker lock; inspect changed state before making a new decision.
782
+
783
+ Client records live under `ZTC_CONFIG_DIR/remote-operations` (by default
784
+ `~/.ztc/remote-operations`); a host can supply a separate journal directory. Guarded sessions resolve and pin
785
+ that directory at creation, so changing the working directory cannot drop admission
786
+ records.
787
+ Remote receipts live in the broker's `/state/.ztc/resource-leases/receipts/`.
788
+ Each journal retains at most 10,000 entries and declines new mutations at capacity.
789
+ No automatic pruning removes unresolved evidence. Confirmed host maintenance must
790
+ preserve operation tombstones and call linkage before archiving evidence.
532
791
 
533
792
  ### Modes & Features
534
793
  ```
@@ -562,7 +821,8 @@ When a saved session includes `zmux` state, `ztc resume` restores the pane layou
562
821
  | Command | Description |
563
822
  |---------|-------------|
564
823
  | `/config show` | View configuration |
565
- | `/config key <key>` | Set API key |
824
+ | `/config key [provider]` | Add a provider API key in a hidden prompt, or name the variable that holds it; without a provider, pick one first |
825
+ | `/config key <provider> --remove` | Forget the saved key, or stop reading the variable named for it; for `openai_compatible`, both, keeping the endpoint's URL and model |
566
826
  | `/config model <name>` | Set model |
567
827
  | `/config statusline [show|on|off|reset]` | Inspect or toggle the bottom status line |
568
828
  | `/config statusline <left|right> <field,...>` | Set status line fields without opening the editor |
@@ -577,6 +837,8 @@ When a saved session includes `zmux` state, `ztc resume` restores the pane layou
577
837
 
578
838
  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
839
 
840
+ 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.
841
+
580
842
  The source `scripts/ztc-dev` launcher defaults to the `dev` config profile. It uses
581
843
  the same `~/.ztc/profiles/dev/` settings and Router sign-in as `ztc --profile dev`.
582
844
  Set its Router URL and sign in separately when creating that profile; the name
@@ -586,9 +848,15 @@ selects the shared config root. `ztc-dev resume` also selects `dev` unless overr
586
848
 
587
849
  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
850
 
851
+ `/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.
852
+
853
+ 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.
854
+
589
855
  #### Bottom status line
590
856
 
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.
857
+ 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.
858
+
859
+ 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
860
 
593
861
  Pick and order the fields on the editor page: press Enter on either field row, run `/settings statusline`, or use `/config statusline edit`.
594
862
 
@@ -598,11 +866,11 @@ Every field paints at one of three verbosities, and the line pane shows the one
598
866
 
599
867
  | Variant | Context left | Queue | Connection | Mode |
600
868
  |---------|--------------|-------|------------|------|
601
- | `raw` | `70%` | `2` | `◉` | `●` |
602
- | `short` | `70% left` | `2 queued` | `◉ connected` | `Normal` |
603
- | `long` | `70% context` | `2 messages queued` | `Connection: connected` | `● Normal` |
869
+ | `raw` | `70%` | `2` | `◉` | omitted |
870
+ | `short` | `70% left` | `2 queued` | `◉ connected` | omitted |
871
+ | `long` | `70% context` | `2 messages queued` | `Connection: connected` | omitted |
604
872
 
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.
873
+ `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
874
 
607
875
  The same settings are available as commands:
608
876
 
@@ -616,7 +884,7 @@ The same settings are available as commands:
616
884
  /config statusline reset
617
885
  ```
618
886
 
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.
887
+ 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
888
 
621
889
  ### Codex Providers
622
890
 
@@ -638,6 +906,29 @@ Each login uses the official Codex CLI with its own `CODEX_HOME` under `~/.ztc/a
638
906
 
639
907
  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
908
 
909
+ Account and model switches require an idle session. An active turn or tool must
910
+ finish before the owner accepts a switch. Idle switches retain the conversation
911
+ and tools; the new model can have different context limits. Explicit account
912
+ selection clears that account's cooldown. Selecting machine-default credentials
913
+ removes the pooled selection; an unavailable login is shown as unavailable.
914
+
915
+ `/usage` queries the literal working directory and reports retained observations
916
+ for its current session, project, and current UTC day. Session and day views
917
+ share that directory scope. Reported tokens and estimates are separate.
918
+ Provider-reported USD includes known zero; missing charges remain unknown.
919
+ These are observed minima, not billing totals: old sessions, retries without
920
+ reports, and evicted receipts can be missing. Each checkpoint retains at most
921
+ 512 receipts within 512 KiB, and the project query reads at most 128 recent
922
+ sessions. Repeated checkpoints do not count the same request twice. Historical
923
+ account attribution remains unknown unless explicitly recorded.
924
+
925
+ Compatible native desktop controls show the configured account and model,
926
+ account health and account-wide quota observations, and these usage scopes.
927
+ The Model button opens the existing model chooser without submitting the draft.
928
+ After changing directories, the usage view stays unknown until observations for
929
+ the new directory load. Published older renderers can lack these controls;
930
+ the terminal commands remain available.
931
+
641
932
  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
933
 
643
934
  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 +957,14 @@ Optional App Server config:
666
957
  |---------|-------------|
667
958
  | `/clear` | Clear message history |
668
959
  | `/sessions` | List/manage saved sessions |
960
+ | `/handoff` | Show the saved task checkpoint a resumed session started from |
961
+ | `/rename <name>` | Set a stable session name; `--clear` returns to automatic labels |
962
+ | `/label [pane <id>] ...` | Show, name, pin, group, or tag a session or pane |
669
963
  | `/status` | Show current status |
670
964
  | `/context` | Detailed context window usage |
965
+ | `/usage` | Session, working-directory and UTC-day request observations; unknown values stay explicit |
671
966
  | `/compact [%]` | Compact conversation (default: 50%) |
967
+ | `/evidence` | Inspect retained source observations, interpretations, corrections and availability |
672
968
  | `/retry` | Retry last request |
673
969
 
674
970
  ### Modes
@@ -685,7 +981,9 @@ Optional App Server config:
685
981
  |---------|-------------|
686
982
  | `/shell <cmd>` or `!<cmd>` | Run shell command |
687
983
  | `/cd <path>` | Change directory |
688
- | `/clipboard` | Copy conversation |
984
+ | `/clipboard` | Copy conversation (existing simple formats) |
985
+ | `/clipboard diagnostic markdown` | Copy a bounded diagnostic report with credential redaction |
986
+ | `/clipboard diagnostic jsonl` | Copy versioned diagnostic events for analysis |
689
987
 
690
988
  ### Voice
691
989
  | Command | Description |
@@ -719,7 +1017,7 @@ Optional App Server config:
719
1017
  |----------|--------|
720
1018
  | `Enter` | Fill a partial completion; run an exact command or model, or submit input |
721
1019
  | `Shift+Enter` | Insert newline |
722
- | `Ctrl+C` | Exit |
1020
+ | `Ctrl+C` | Stop the active run; otherwise clear the draft, or exit when empty |
723
1021
  | `Ctrl+L` | Clear screen |
724
1022
  | `Ctrl+R` | Toggle voice dictation |
725
1023
  | `Ctrl+I` | Paste image from clipboard |
@@ -728,11 +1026,15 @@ Optional App Server config:
728
1026
  | `Ctrl+G` | Open plan file in editor |
729
1027
  | `Ctrl+T` | Toggle task list |
730
1028
  | `Shift+Tab` | Cycle modes |
731
- | `Tab` | Fill the selected completion without running it; reopen a dismissed menu |
1029
+ | `Tab` | Queue a draft after a running turn; otherwise fill completion without running it |
732
1030
  | `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
1031
  | `Home` / `End` | Start / end of the caret's line |
734
1032
  | `Ctrl+Home` / `Ctrl+End` | Start / end of the whole draft |
735
- | `Esc` | Close completion while keeping the draft |
1033
+ | `Esc` | Close the current form, choice or completion; otherwise confirm stopping the active run |
1034
+ | `Esc`, then `Esc` within 2 seconds | Stop that same run, preserving partial output and pending queued work |
1035
+ | `Option+Up` | Open the Ratatui queue editor; its `Esc` removes only the selected entry and `Enter` saves |
1036
+ | `/rewind` | Open the Ratatui history picker to restore a previous prompt explicitly |
1037
+ | `Ctrl+B`, then `?` | Open zmux shortcut help (or use the configured prefix) |
736
1038
  | `Ctrl+A` / `Ctrl+E` | Start / end of the caret's line |
737
1039
  | `Ctrl+U` | Kill to the start of the caret's line (this is also what macOS sends for Cmd+Backspace) |
738
1040
  | `Ctrl+W` | Delete word before cursor |
@@ -762,8 +1064,12 @@ Argument syntax appears as one short usage line instead of selectable chips.
762
1064
  - **search** — Regex code search (ripgrep-style)
763
1065
 
764
1066
  ### Shell & Execution
765
- - **run_command** — Execute shell commands with timeout
1067
+ - **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
1068
  - **run_and_monitor** — Long-running command monitoring
1069
+ - **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`.
1070
+ - **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.
1071
+ - **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.
1072
+ - **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
1073
 
768
1074
  ### Development (LSP)
769
1075
  - **goto_definition** — Jump to symbol definition
@@ -802,6 +1108,17 @@ User Input → Agent → Claude API → Tool Use? → Execute → Continue
802
1108
 
803
1109
  Standard ReAct loop with streaming, automatic retry (429/529/5xx), and configurable max iterations.
804
1110
 
1111
+ Transient endpoint failures retain the current inference and its completed tool
1112
+ results. After the initial three attempts, ZTC keeps waiting for recovery until
1113
+ you cancel; it does not resubmit the task. Retry waits use jitter and cap at 30
1114
+ seconds. The retry fields in `/settings` → Behavior can cap the recovery window, set it to
1115
+ `0` for the previous attempt limit, or set Request attempts to `1` to disable
1116
+ Agent-level retries and sustained recovery. Backend transport reconnects retain
1117
+ their separate policy. Permanent errors and inactivity timeouts still stop the request.
1118
+ Partial answer output and dispatched native harness turns are not regenerated.
1119
+ The activity line shows when ZTC is waiting for the endpoint; request diagnostics
1120
+ include HTTP status and bounded, redacted response details.
1121
+
805
1122
  ### Native Binaries (Rust)
806
1123
  - **ztc-computer** — Screen capture (CoreGraphics/X11/Win32), hardware-level input injection (IOHIDPostEvent/CGEvent), process management
807
1124
  - **ztc-ml** — GPU-accelerated ML inference and training (candle framework)
@@ -986,6 +1303,16 @@ const tools = await buildAgentToolsFromDomainAsync('ca_org');
986
1303
 
987
1304
  ## Development
988
1305
 
1306
+ This source checkout reserves ZTC v0.2.0-canary.2. The public npm package and
1307
+ its current published version are described in the Quick Start above.
1308
+
1309
+ Use Node 20 or 22 for development checks. The tested toolchain is Vitest 4.1.11,
1310
+ Vite 6.4.3 and Stryker 9.6.1. After `npm ci`, run `npm run test:toolchain`,
1311
+ `npm run test:simulation` and `npm run test:mutation:compat`. The last command
1312
+ checks that the installed mutation runner still catches changes in a covered
1313
+ simulation module. See [the migration contract](../docs/vitest-migration.md#ztc-terminal-harness-2026-10-02)
1314
+ for the qualified versions and scope.
1315
+
989
1316
  ```bash
990
1317
  npm run build # Compile TypeScript + copy assets
991
1318
  npm run build:rust # Build native Rust binaries
@@ -1011,6 +1338,16 @@ ztc
1011
1338
 
1012
1339
  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
1340
 
1341
+ The CLI backend passes explicit model IDs, dated versions, context suffixes and
1342
+ deployment names through as selected, after trimming whitespace. The CLI and
1343
+ account determine availability, and a rejected selection remains an error.
1344
+ The exact legacy `sonnet` and `claude-code-sonnet` choices, or an empty model,
1345
+ retain ZTC's `claude-sonnet-4-5` compatibility mapping; `claude-code-opus` and
1346
+ `claude-code-haiku` map to `opus` and `haiku`. Status and usage model fields
1347
+ describe the requested configuration; they do not attest which model the
1348
+ provider actually served. This backend behavior does not change existing
1349
+ dated-model migrations when loading or setting persistent configuration.
1350
+
1014
1351
  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
1352
 
1016
1353
  ### Environment Variables
@@ -1026,6 +1363,7 @@ unset preserves normal interactive discovery.
1026
1363
  |----------|-------------|
1027
1364
  | `ANTHROPIC_API_KEY` | Anthropic API key for direct API billing |
1028
1365
  | `CLAUDE_CODE_OAUTH_TOKEN` | Claude Code OAuth token from `claude setup-token`; used by `/config provider claude_code` |
1366
+ | `ZTC_NO_BROWSER` | Set to `1` so ZTC never opens a browser (logins, `/mirror`, billing); it prints the URL instead. CI and test runs behave this way already |
1029
1367
  | `ZTC_DEBUG` | Enable debug logging |
1030
1368
  | `ZTC_SUBAGENT_DEBUG` | Log sub-agent execution |
1031
1369
  | `ZTC_DISABLE_AUTO_COMPACT` | Disable automatic compaction |
@@ -1048,7 +1386,7 @@ unset preserves normal interactive discovery.
1048
1386
 
1049
1387
  ## License
1050
1388
 
1051
- ZTC 0.2 is distributed under the
1389
+ ZTC is distributed under the
1052
1390
  [Zerg Source Available License 1.0](./LICENSE.md). It permits purpose-limited
1053
1391
  evaluation and specified personal, educational, research, nonprofit, and other
1054
1392
  noncommercial use.
@@ -1069,7 +1407,7 @@ the ZTC 0.1.x releases.
1069
1407
 
1070
1408
  ---
1071
1409
 
1072
- Part of the [Zerg](https://github.com/idanbeck/zerg) autonomous AI framework.
1410
+ Part of the [Zerg](https://zergai.com/products/ztc) autonomous AI framework.
1073
1411
 
1074
1412
  ## Updating the npm CLI
1075
1413
 
@@ -1087,3 +1425,30 @@ Existing releases need one ordinary npm upgrade before these commands exist.
1087
1425
 
1088
1426
  See [shared updater policy](https://github.com/Epoch-ML/zerg/blob/development/docs/npm-cli-updates.md)
1089
1427
  for installation safety, channel switching, and packaging details.
1428
+
1429
+ ### Session and pane labels
1430
+
1431
+ Automatic agent labels show the project, branch, task, session identifier and
1432
+ phase. Shell panes follow terminal titles. A manual `/rename` or `/label pane
1433
+ <id> name <name>` stays separate from inference and survives later updates.
1434
+
1435
+ Use `/label project Zerg`, `/label task Release`, `/label group Delivery`, and
1436
+ `/label pin` to organize the current session. Target a shell with, for example,
1437
+ `/label pane 1 group Builds`. `/label unpin` permits closure again. Use
1438
+ `/label group --clear` to remove a tag, `/label auto` to return to an inferred
1439
+ name, and `/label show` to inspect current choices. Names and tags have a
1440
+ 64-character limit. `/sessions` lists pinned sessions first and groups labels.
1441
+
1442
+ Choices persist through normal save and resume. A later parent-pane label takes
1443
+ precedence over an older child-session label during startup. Pane controls require a native
1444
+ renderer advertising `pane_labels_v1`; older renderers explain that an update
1445
+ is needed, and existing `/rename` remains supported. Desktop protocol sessions
1446
+ use ZTC's saved layout; the desktop renderer replays those labels when resumed.
1447
+
1448
+ ## Incoming requests
1449
+
1450
+ Use `/inbox` to review durable requests and receipts. Delivery and acknowledgment
1451
+ do not start work. Use `/inbox run <req-ID>` after reviewing a request, then record
1452
+ its verified outcome separately. Adapters can deliver envelopes without agent
1453
+ startup using `ztc inbox receive --file request.json --json`. See [the intake
1454
+ contract](docs/intake.md) for sources, duplicate delivery and navigation.