toolroll 0.9.134 → 0.9.135

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 (277) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/acp-check-repo-schema.js +52 -0
  3. package/dist/acp-check.js +1 -1
  4. package/dist/acp-client.js +3 -3
  5. package/dist/acp-inspect.js +2 -1
  6. package/dist/agent-detect.js +1 -1
  7. package/dist/agent-fence.js +4 -4
  8. package/dist/agent-thread/chat-turn.js +2 -2
  9. package/dist/agent-thread/direct-host.js +2 -2
  10. package/dist/agent-thread/fence.js +2 -2
  11. package/dist/agent-thread/git-workspace.js +2 -2
  12. package/dist/agent-thread/guards.js +1 -1
  13. package/dist/agent-thread/providers.js +1 -1
  14. package/dist/agent-thread/ship.js +2 -2
  15. package/dist/approval-decision.js +1 -0
  16. package/dist/approval-password.js +1 -1
  17. package/dist/approval-summary.js +1 -1
  18. package/dist/attest.js +1 -1
  19. package/dist/batch-checks.js +2 -2
  20. package/dist/boot-identity.js +1 -1
  21. package/dist/bounded-spawn.js +2 -2
  22. package/dist/browser/{chunk-agents-live-view.e97fbf607cb8075aad7a48664556d11ea41469785f82384b5171b76c524f71e2.js → chunk-agents-live-view.9f4367c89c6366769a567e729ac9181ccaa898bf3a168d3dc618f3cface887c7.js} +4 -4
  23. package/dist/browser/chunk-agents-live-view.9f4367c89c6366769a567e729ac9181ccaa898bf3a168d3dc618f3cface887c7.js.br +0 -0
  24. package/dist/browser/chunk-agents-live-view.9f4367c89c6366769a567e729ac9181ccaa898bf3a168d3dc618f3cface887c7.js.gz +0 -0
  25. package/dist/browser/chunk-bundle.ac5952c82c76e2efcdcf5a097c4fa235d6f1045dcc36d02ee921ff4be976a46a.js +2 -0
  26. package/dist/browser/chunk-bundle.ac5952c82c76e2efcdcf5a097c4fa235d6f1045dcc36d02ee921ff4be976a46a.js.br +0 -0
  27. package/dist/browser/chunk-bundle.ac5952c82c76e2efcdcf5a097c4fa235d6f1045dcc36d02ee921ff4be976a46a.js.gz +0 -0
  28. package/dist/browser/chunk-chat-parts.2a0b0b723508c5c48379f6a3d441f07a18c8b91ed64fd018962931c5ae43331e.js +4 -0
  29. package/dist/browser/chunk-chat-parts.2a0b0b723508c5c48379f6a3d441f07a18c8b91ed64fd018962931c5ae43331e.js.br +0 -0
  30. package/dist/browser/chunk-chat-parts.2a0b0b723508c5c48379f6a3d441f07a18c8b91ed64fd018962931c5ae43331e.js.gz +0 -0
  31. package/dist/browser/{chunk-core.64343d638685133eb96578bfb35bf560f329d0743ac5deda720ae27f5699c9d9.js → chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js} +12 -12
  32. package/dist/browser/chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js.br +0 -0
  33. package/dist/browser/chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js.gz +0 -0
  34. package/dist/browser/{chunk-flow-view.264e801af330461985aadcab42bc4ac4e036ba124394a7b5a100f2cd1edf89f0.js → chunk-flow-view.f5d74c7f072b739a7a0ed86ff35cafa7b8a041233372d1eeaab9eb941ddfc11e.js} +7 -7
  35. package/dist/browser/chunk-flow-view.f5d74c7f072b739a7a0ed86ff35cafa7b8a041233372d1eeaab9eb941ddfc11e.js.br +0 -0
  36. package/dist/browser/chunk-flow-view.f5d74c7f072b739a7a0ed86ff35cafa7b8a041233372d1eeaab9eb941ddfc11e.js.gz +0 -0
  37. package/dist/browser/chunk-flows-extra-view.01ebf93780b729363eda11ba21c764fe593bcd3e684aa833c9b86147f780fd41.js +4 -0
  38. package/dist/browser/chunk-flows-extra-view.01ebf93780b729363eda11ba21c764fe593bcd3e684aa833c9b86147f780fd41.js.br +0 -0
  39. package/dist/browser/chunk-flows-extra-view.01ebf93780b729363eda11ba21c764fe593bcd3e684aa833c9b86147f780fd41.js.gz +0 -0
  40. package/dist/browser/chunk-pages-bundle.e18059f0cb4fbb63e3698971d4c1830ad0945c3645235babc93010cd0b725c1d.js +6 -0
  41. package/dist/browser/chunk-pages-bundle.e18059f0cb4fbb63e3698971d4c1830ad0945c3645235babc93010cd0b725c1d.js.br +0 -0
  42. package/dist/browser/chunk-pages-bundle.e18059f0cb4fbb63e3698971d4c1830ad0945c3645235babc93010cd0b725c1d.js.gz +0 -0
  43. package/dist/browser/chunk-result-view.fc6a6494b316aa786807b7d17035c59defae1bfb0c03bf9c3795679b3a35dd77.js +2 -0
  44. package/dist/browser/chunk-result-view.fc6a6494b316aa786807b7d17035c59defae1bfb0c03bf9c3795679b3a35dd77.js.br +0 -0
  45. package/dist/browser/chunk-result-view.fc6a6494b316aa786807b7d17035c59defae1bfb0c03bf9c3795679b3a35dd77.js.gz +0 -0
  46. package/dist/browser/chunk-settings-view.6dd3a64ded7bd8c047650270918dfb455c9a514a5a40b84c7eb5f443f76fe66f.js +20 -0
  47. package/dist/browser/chunk-settings-view.6dd3a64ded7bd8c047650270918dfb455c9a514a5a40b84c7eb5f443f76fe66f.js.br +0 -0
  48. package/dist/browser/chunk-settings-view.6dd3a64ded7bd8c047650270918dfb455c9a514a5a40b84c7eb5f443f76fe66f.js.gz +0 -0
  49. package/dist/browser/{chunk-shared.85e1b9e0838ccc819e7b8368f80dd5240dda90f53ea2974a256a8fa4122ba2fb.js → chunk-shared.02c0b692de21a9bb80d1761aa887d8532431171945c02e663884c9f45b796753.js} +2 -2
  50. package/dist/browser/chunk-shared.02c0b692de21a9bb80d1761aa887d8532431171945c02e663884c9f45b796753.js.br +0 -0
  51. package/dist/browser/chunk-shared.02c0b692de21a9bb80d1761aa887d8532431171945c02e663884c9f45b796753.js.gz +0 -0
  52. package/dist/browser/chunk-shared.0874336833f8101a63b169d8c2e55ca0f281e43e65d4bd6604555c791ea9dd87.js +2 -0
  53. package/dist/browser/chunk-shared.0874336833f8101a63b169d8c2e55ca0f281e43e65d4bd6604555c791ea9dd87.js.br +0 -0
  54. package/dist/browser/chunk-shared.0874336833f8101a63b169d8c2e55ca0f281e43e65d4bd6604555c791ea9dd87.js.gz +0 -0
  55. package/dist/browser/chunk-shared.2413dd78f32995fbca67f51ac8c21baf4727cd64f185ea739aa2a058e569b0ed.js +2 -0
  56. package/dist/browser/chunk-shared.2413dd78f32995fbca67f51ac8c21baf4727cd64f185ea739aa2a058e569b0ed.js.br +0 -0
  57. package/dist/browser/chunk-shared.2413dd78f32995fbca67f51ac8c21baf4727cd64f185ea739aa2a058e569b0ed.js.gz +0 -0
  58. package/dist/browser/{chunk-shared.26f6cbfdeb9bcd63231f23dbf96cacb39b78324aeed2503e86109efa89fa27db.js → chunk-shared.26bb0114998968cccb7bae5f6ffa8979ddecfafd8bc18bb6985760f6bcc030e6.js} +3 -3
  59. package/dist/browser/chunk-shared.26bb0114998968cccb7bae5f6ffa8979ddecfafd8bc18bb6985760f6bcc030e6.js.br +0 -0
  60. package/dist/browser/chunk-shared.26bb0114998968cccb7bae5f6ffa8979ddecfafd8bc18bb6985760f6bcc030e6.js.gz +0 -0
  61. package/dist/browser/chunk-shared.6d0b8728b3e309886cfb6eaf596d3f20592939e521bb60bb090824f34da6b086.js +2 -0
  62. package/dist/browser/chunk-shared.6d0b8728b3e309886cfb6eaf596d3f20592939e521bb60bb090824f34da6b086.js.br +0 -0
  63. package/dist/browser/chunk-shared.6d0b8728b3e309886cfb6eaf596d3f20592939e521bb60bb090824f34da6b086.js.gz +0 -0
  64. package/dist/browser/chunk-shared.c3e5be1c5f441e94905a4bc2005d816d2a0b0e4108bae43e37ec274a911c6847.js +2 -0
  65. package/dist/browser/chunk-shared.c3e5be1c5f441e94905a4bc2005d816d2a0b0e4108bae43e37ec274a911c6847.js.br +0 -0
  66. package/dist/browser/chunk-shared.c3e5be1c5f441e94905a4bc2005d816d2a0b0e4108bae43e37ec274a911c6847.js.gz +0 -0
  67. package/dist/browser/chunk-shared.d1f25785c8c168cc75aa99c4be8ca56abfc5eafa3490f8817ff15e61cb901915.js +2 -0
  68. package/dist/browser/chunk-shared.d1f25785c8c168cc75aa99c4be8ca56abfc5eafa3490f8817ff15e61cb901915.js.br +0 -0
  69. package/dist/browser/chunk-shared.d1f25785c8c168cc75aa99c4be8ca56abfc5eafa3490f8817ff15e61cb901915.js.gz +0 -0
  70. package/dist/browser/{chunk-shared.5b47ca221b8b77b26ce8006f0569c981df2b905005cebe9fc54444d4906d436e.js → chunk-shared.fd5f2699d3b0017797e5b5e1e1d92eb98818740ebf20a95364bbb7deea0c8242.js} +3 -3
  71. package/dist/browser/chunk-shared.fd5f2699d3b0017797e5b5e1e1d92eb98818740ebf20a95364bbb7deea0c8242.js.br +0 -0
  72. package/dist/browser/chunk-shared.fd5f2699d3b0017797e5b5e1e1d92eb98818740ebf20a95364bbb7deea0c8242.js.gz +0 -0
  73. package/dist/browser/{chunk-sonner.160372eb4f9455847ca83e8ff5d983c6b3010ef0dc2eaf541e2eaceaac3b994c.js → chunk-sonner.2472e1da55de10b11dc002c80a840966061e817c47793f5e216f1af6c6dbedff.js} +1 -1
  74. package/dist/browser/chunk-sonner.2472e1da55de10b11dc002c80a840966061e817c47793f5e216f1af6c6dbedff.js.br +0 -0
  75. package/dist/browser/chunk-sonner.2472e1da55de10b11dc002c80a840966061e817c47793f5e216f1af6c6dbedff.js.gz +0 -0
  76. package/dist/browser/chunk-task-view.bbeddc793a5e8a6d1f66b6cc5f0ce1da18414137e85c49ccd07be0e20f61ac12.js +2 -0
  77. package/dist/browser/chunk-task-view.bbeddc793a5e8a6d1f66b6cc5f0ce1da18414137e85c49ccd07be0e20f61ac12.js.br +0 -0
  78. package/dist/browser/chunk-task-view.bbeddc793a5e8a6d1f66b6cc5f0ce1da18414137e85c49ccd07be0e20f61ac12.js.gz +0 -0
  79. package/dist/browser/chunk-team-chat.c3255a5a1d94e39d559c07438c4690543602b1552b2c2bf57b8791d7f989141d.js +2 -0
  80. package/dist/browser/chunk-team-chat.c3255a5a1d94e39d559c07438c4690543602b1552b2c2bf57b8791d7f989141d.js.br +0 -0
  81. package/dist/browser/chunk-team-chat.c3255a5a1d94e39d559c07438c4690543602b1552b2c2bf57b8791d7f989141d.js.gz +0 -0
  82. package/dist/browser/manifest.json +194 -194
  83. package/dist/browser/workspace.3043c4a6df23ed1c0c8be3fb816fa9410a2ab99053eb54476f22a1735c03ca97.css +4 -0
  84. package/dist/browser/workspace.3043c4a6df23ed1c0c8be3fb816fa9410a2ab99053eb54476f22a1735c03ca97.css.br +0 -0
  85. package/dist/browser/workspace.3043c4a6df23ed1c0c8be3fb816fa9410a2ab99053eb54476f22a1735c03ca97.css.gz +0 -0
  86. package/dist/browser/{workspace.efd01c3aaf8e07c4a64194e2bfbd7aee4f7fa515f2acebdfdd90af1badba8ce7.js → workspace.aebb60d4e5ef4509a80cfaccf0af5f7246867ec7531a1734dd8e28c59594950e.js} +4 -4
  87. package/dist/browser/workspace.aebb60d4e5ef4509a80cfaccf0af5f7246867ec7531a1734dd8e28c59594950e.js.br +0 -0
  88. package/dist/browser/workspace.aebb60d4e5ef4509a80cfaccf0af5f7246867ec7531a1734dd8e28c59594950e.js.gz +0 -0
  89. package/dist/browser-open.js +1 -1
  90. package/dist/build-review.js +2 -2
  91. package/dist/builder.js +21 -14
  92. package/dist/canvas-capture.js +2 -2
  93. package/dist/canvas-freshness.js +1 -1
  94. package/dist/central-recovery-stage.js +1 -1
  95. package/dist/chat-actions.js +3 -3
  96. package/dist/chat-decide.js +8 -4
  97. package/dist/cli-help.js +8 -7
  98. package/dist/cli.js +2 -2
  99. package/dist/companion/bonjour.js +1 -1
  100. package/dist/companion/daemon.js +1 -1
  101. package/dist/companion/passkey-gate.js +1 -1
  102. package/dist/companion/reads.js +1 -1
  103. package/dist/companion/store.js +1 -1
  104. package/dist/companion/webauthn.js +1 -1
  105. package/dist/companion/work.js +1 -1
  106. package/dist/container-state.js +2 -2
  107. package/dist/containment.js +2 -2
  108. package/dist/contracts/chat-actions.js +1 -1
  109. package/dist/contracts/console-api.js +1 -1
  110. package/dist/contracts/engine-api.js +1 -1
  111. package/dist/controller-supervisor.js +2 -2
  112. package/dist/credential-broker.js +1 -1
  113. package/dist/demo.js +2 -2
  114. package/dist/easy-start.js +1 -1
  115. package/dist/egress.js +1 -1
  116. package/dist/engine-handoff.js +1 -1
  117. package/dist/engine-reads.js +1 -1
  118. package/dist/evals.js +2 -2
  119. package/dist/exec.js +4 -4
  120. package/dist/fast-owner-schema.js +33 -0
  121. package/dist/fast-start.js +1 -1
  122. package/dist/flow-unattended.js +2 -2
  123. package/dist/github-import.js +1 -1
  124. package/dist/github-read.js +1 -1
  125. package/dist/install-mode.js +2 -3
  126. package/dist/invoke.js +9 -7
  127. package/dist/laptop-background.js +1 -1
  128. package/dist/lead-capabilities.js +1 -1
  129. package/dist/live-backup-change.js +2 -2
  130. package/dist/live-backup.js +2 -2
  131. package/dist/live-terminal.js +3 -3
  132. package/dist/local-checks.js +1 -1
  133. package/dist/local-landing.js +22 -3
  134. package/dist/local-owner.js +1 -1
  135. package/dist/machine-identity.js +1 -1
  136. package/dist/model-catalog.js +8 -5
  137. package/dist/model-choices.js +3 -3
  138. package/dist/model-routing.js +1 -1
  139. package/dist/models-cli.js +2 -2
  140. package/dist/names.js +1 -1
  141. package/dist/onboard.js +1 -1
  142. package/dist/operate-remote-arguments.js +1 -1
  143. package/dist/operate.js +33 -16
  144. package/dist/orphan-sweep.js +1 -1
  145. package/dist/owner-mode.js +4 -0
  146. package/dist/peek-cli.js +2 -2
  147. package/dist/phase-routing.js +1 -1
  148. package/dist/pi-build.js +1 -1
  149. package/dist/plane-review.js +1 -1
  150. package/dist/planner-source.js +2 -2
  151. package/dist/planner.js +1 -1
  152. package/dist/pre-run-phase.js +1 -1
  153. package/dist/presence-hold.js +1 -1
  154. package/dist/process-liveness.js +1 -1
  155. package/dist/process-tree.js +1 -1
  156. package/dist/project-tools.js +2 -2
  157. package/dist/prompt.js +1 -1
  158. package/dist/proposal.js +1 -1
  159. package/dist/protected-storage.js +2 -2
  160. package/dist/provider-home.js +1 -1
  161. package/dist/provider-limits.js +1 -1
  162. package/dist/provider.js +2 -2
  163. package/dist/public-access.js +1 -1
  164. package/dist/pull-request-flow.js +2 -2
  165. package/dist/read-executor.js +1 -1
  166. package/dist/release-adapters.js +2 -2
  167. package/dist/release-carry.js +3 -3
  168. package/dist/release-resume.js +2 -2
  169. package/dist/release-start.js +1 -0
  170. package/dist/result-follow-ups.js +2 -2
  171. package/dist/review-switch.js +1 -1
  172. package/dist/route-change.js +25 -3
  173. package/dist/run-closeout.js +2 -2
  174. package/dist/runner.js +1 -1
  175. package/dist/sandbox-launch.js +2 -2
  176. package/dist/sandbox-runtime.js +1 -1
  177. package/dist/scope.js +1 -1
  178. package/dist/scout-browser.js +1 -1
  179. package/dist/serve.js +3 -3
  180. package/dist/server/chat.js +1 -1
  181. package/dist/server/direct-chat.js +1 -1
  182. package/dist/server/engine-api.js +1 -1
  183. package/dist/server/http.js +1 -1
  184. package/dist/server/one-time-secret.js +1 -1
  185. package/dist/server/route-table.js +1 -1
  186. package/dist/server/runtime.js +1 -1
  187. package/dist/server/settings-phone.js +1 -1
  188. package/dist/server/settings-section-table.js +1 -1
  189. package/dist/server/settings-sections.js +1 -1
  190. package/dist/server/settings.js +2 -1
  191. package/dist/server/task-view-data.js +3 -3
  192. package/dist/server/task-views.js +1 -1
  193. package/dist/server/tasks.js +5 -5
  194. package/dist/server/terminals.js +1 -1
  195. package/dist/settings-data.js +1 -1
  196. package/dist/settings-proofs.js +1 -1
  197. package/dist/shared-deps.js +4 -4
  198. package/dist/sign-in-page.js +2 -2
  199. package/dist/ssr-workspace.js +88 -88
  200. package/dist/staged-runtimes.js +1 -1
  201. package/dist/status-probe.js +2 -2
  202. package/dist/stop-proof.js +2 -2
  203. package/dist/storage-sweep-child.js +2 -2
  204. package/dist/storage-sweep-process.js +1 -1
  205. package/dist/storage.js +2 -2
  206. package/dist/store-baseline.js +5 -33
  207. package/dist/store.js +19 -14
  208. package/dist/subscription-usage.js +3 -3
  209. package/dist/surface.js +1 -1
  210. package/dist/test-temp.js +1 -1
  211. package/dist/tool-broker.js +1 -1
  212. package/dist/toolroll-update.js +3 -3
  213. package/dist/tui/darwin-arm64/toolroll-tui +0 -0
  214. package/dist/tui/darwin-x64/toolroll-tui +0 -0
  215. package/dist/tui/linux-arm64/toolroll-tui +0 -0
  216. package/dist/tui/linux-x64/toolroll-tui +0 -0
  217. package/dist/tui-launch.js +1 -1
  218. package/dist/welcome-facts.js +1 -1
  219. package/package.json +1 -1
  220. package/dist/browser/chunk-agents-live-view.e97fbf607cb8075aad7a48664556d11ea41469785f82384b5171b76c524f71e2.js.br +0 -0
  221. package/dist/browser/chunk-agents-live-view.e97fbf607cb8075aad7a48664556d11ea41469785f82384b5171b76c524f71e2.js.gz +0 -0
  222. package/dist/browser/chunk-bundle.48f442a2868e9b77e9f54c5b77f1bba629ccd1615de8a2f62619b811783314f6.js +0 -2
  223. package/dist/browser/chunk-bundle.48f442a2868e9b77e9f54c5b77f1bba629ccd1615de8a2f62619b811783314f6.js.br +0 -0
  224. package/dist/browser/chunk-bundle.48f442a2868e9b77e9f54c5b77f1bba629ccd1615de8a2f62619b811783314f6.js.gz +0 -0
  225. package/dist/browser/chunk-chat-parts.1669e6985c5c0c11eea6792ea177ea4c9f7e7ebf27bd3b31742feb6a26d5b2a5.js +0 -4
  226. package/dist/browser/chunk-chat-parts.1669e6985c5c0c11eea6792ea177ea4c9f7e7ebf27bd3b31742feb6a26d5b2a5.js.br +0 -0
  227. package/dist/browser/chunk-chat-parts.1669e6985c5c0c11eea6792ea177ea4c9f7e7ebf27bd3b31742feb6a26d5b2a5.js.gz +0 -0
  228. package/dist/browser/chunk-core.64343d638685133eb96578bfb35bf560f329d0743ac5deda720ae27f5699c9d9.js.br +0 -0
  229. package/dist/browser/chunk-core.64343d638685133eb96578bfb35bf560f329d0743ac5deda720ae27f5699c9d9.js.gz +0 -0
  230. package/dist/browser/chunk-flow-view.264e801af330461985aadcab42bc4ac4e036ba124394a7b5a100f2cd1edf89f0.js.br +0 -0
  231. package/dist/browser/chunk-flow-view.264e801af330461985aadcab42bc4ac4e036ba124394a7b5a100f2cd1edf89f0.js.gz +0 -0
  232. package/dist/browser/chunk-flows-extra-view.6761503a97e1f17b474703ff5687a8682c54f9db1715e0a9762a979030a1b036.js +0 -4
  233. package/dist/browser/chunk-flows-extra-view.6761503a97e1f17b474703ff5687a8682c54f9db1715e0a9762a979030a1b036.js.br +0 -0
  234. package/dist/browser/chunk-flows-extra-view.6761503a97e1f17b474703ff5687a8682c54f9db1715e0a9762a979030a1b036.js.gz +0 -0
  235. package/dist/browser/chunk-pages-bundle.365da73d009e3ced30b55bca7107f548dc832f7a9f52926d3dcd68aa5596da11.js +0 -6
  236. package/dist/browser/chunk-pages-bundle.365da73d009e3ced30b55bca7107f548dc832f7a9f52926d3dcd68aa5596da11.js.br +0 -0
  237. package/dist/browser/chunk-pages-bundle.365da73d009e3ced30b55bca7107f548dc832f7a9f52926d3dcd68aa5596da11.js.gz +0 -0
  238. package/dist/browser/chunk-result-view.d4dc562a1a6a52a1497e25300d5f80c220952ceb5bb719ca32ef8dc1e74a4124.js +0 -2
  239. package/dist/browser/chunk-result-view.d4dc562a1a6a52a1497e25300d5f80c220952ceb5bb719ca32ef8dc1e74a4124.js.br +0 -0
  240. package/dist/browser/chunk-result-view.d4dc562a1a6a52a1497e25300d5f80c220952ceb5bb719ca32ef8dc1e74a4124.js.gz +0 -0
  241. package/dist/browser/chunk-settings-view.ff302e1c5faf5486c96e5fc96fa32492da4153e6e19997ce7b718adab21bf3b7.js +0 -20
  242. package/dist/browser/chunk-settings-view.ff302e1c5faf5486c96e5fc96fa32492da4153e6e19997ce7b718adab21bf3b7.js.br +0 -0
  243. package/dist/browser/chunk-settings-view.ff302e1c5faf5486c96e5fc96fa32492da4153e6e19997ce7b718adab21bf3b7.js.gz +0 -0
  244. package/dist/browser/chunk-shared.152678a803cfb6dee935162fbbbdb38d031d80f1d32ce48610f37bc1c8621e49.js +0 -2
  245. package/dist/browser/chunk-shared.152678a803cfb6dee935162fbbbdb38d031d80f1d32ce48610f37bc1c8621e49.js.br +0 -0
  246. package/dist/browser/chunk-shared.152678a803cfb6dee935162fbbbdb38d031d80f1d32ce48610f37bc1c8621e49.js.gz +0 -0
  247. package/dist/browser/chunk-shared.26f6cbfdeb9bcd63231f23dbf96cacb39b78324aeed2503e86109efa89fa27db.js.br +0 -0
  248. package/dist/browser/chunk-shared.26f6cbfdeb9bcd63231f23dbf96cacb39b78324aeed2503e86109efa89fa27db.js.gz +0 -0
  249. package/dist/browser/chunk-shared.4e21c6b33b9a525e63c360d20a1830f1a26c5021f5d218f2300f21ff840af27e.js +0 -2
  250. package/dist/browser/chunk-shared.4e21c6b33b9a525e63c360d20a1830f1a26c5021f5d218f2300f21ff840af27e.js.br +0 -0
  251. package/dist/browser/chunk-shared.4e21c6b33b9a525e63c360d20a1830f1a26c5021f5d218f2300f21ff840af27e.js.gz +0 -0
  252. package/dist/browser/chunk-shared.5b47ca221b8b77b26ce8006f0569c981df2b905005cebe9fc54444d4906d436e.js.br +0 -0
  253. package/dist/browser/chunk-shared.5b47ca221b8b77b26ce8006f0569c981df2b905005cebe9fc54444d4906d436e.js.gz +0 -0
  254. package/dist/browser/chunk-shared.85e1b9e0838ccc819e7b8368f80dd5240dda90f53ea2974a256a8fa4122ba2fb.js.br +0 -0
  255. package/dist/browser/chunk-shared.85e1b9e0838ccc819e7b8368f80dd5240dda90f53ea2974a256a8fa4122ba2fb.js.gz +0 -0
  256. package/dist/browser/chunk-shared.a326d625dea5cda744678a73b38c0cb2688721c9228e26d262279ecd5c2d7d11.js +0 -2
  257. package/dist/browser/chunk-shared.a326d625dea5cda744678a73b38c0cb2688721c9228e26d262279ecd5c2d7d11.js.br +0 -0
  258. package/dist/browser/chunk-shared.a326d625dea5cda744678a73b38c0cb2688721c9228e26d262279ecd5c2d7d11.js.gz +0 -0
  259. package/dist/browser/chunk-shared.e906e9c8c0859e000616dbc382f88597447f30205c92b7cb9a8e2351f3ef2722.js +0 -2
  260. package/dist/browser/chunk-shared.e906e9c8c0859e000616dbc382f88597447f30205c92b7cb9a8e2351f3ef2722.js.br +0 -0
  261. package/dist/browser/chunk-shared.e906e9c8c0859e000616dbc382f88597447f30205c92b7cb9a8e2351f3ef2722.js.gz +0 -0
  262. package/dist/browser/chunk-shared.f6354151d62439f2d78f5d17cf9bc44f35b4da37685beb77467d98dd9cc6f1e4.js +0 -2
  263. package/dist/browser/chunk-shared.f6354151d62439f2d78f5d17cf9bc44f35b4da37685beb77467d98dd9cc6f1e4.js.br +0 -0
  264. package/dist/browser/chunk-shared.f6354151d62439f2d78f5d17cf9bc44f35b4da37685beb77467d98dd9cc6f1e4.js.gz +0 -0
  265. package/dist/browser/chunk-sonner.160372eb4f9455847ca83e8ff5d983c6b3010ef0dc2eaf541e2eaceaac3b994c.js.br +0 -0
  266. package/dist/browser/chunk-sonner.160372eb4f9455847ca83e8ff5d983c6b3010ef0dc2eaf541e2eaceaac3b994c.js.gz +0 -0
  267. package/dist/browser/chunk-task-view.325b506afc26b25147b2e90cec5ad1392d50e6150a7fb33c81a996daa99bb05a.js +0 -2
  268. package/dist/browser/chunk-task-view.325b506afc26b25147b2e90cec5ad1392d50e6150a7fb33c81a996daa99bb05a.js.br +0 -0
  269. package/dist/browser/chunk-task-view.325b506afc26b25147b2e90cec5ad1392d50e6150a7fb33c81a996daa99bb05a.js.gz +0 -0
  270. package/dist/browser/chunk-team-chat.d560bcc5d819e63133d377b8a6f10f901356e680771f19d4fe1af044adfffb22.js +0 -2
  271. package/dist/browser/chunk-team-chat.d560bcc5d819e63133d377b8a6f10f901356e680771f19d4fe1af044adfffb22.js.br +0 -0
  272. package/dist/browser/chunk-team-chat.d560bcc5d819e63133d377b8a6f10f901356e680771f19d4fe1af044adfffb22.js.gz +0 -0
  273. package/dist/browser/workspace.ac1270b58f672fa920535348cc582f5fc68247b341d6fc8ec733b25336f2b9cc.css +0 -4
  274. package/dist/browser/workspace.ac1270b58f672fa920535348cc582f5fc68247b341d6fc8ec733b25336f2b9cc.css.br +0 -0
  275. package/dist/browser/workspace.ac1270b58f672fa920535348cc582f5fc68247b341d6fc8ec733b25336f2b9cc.css.gz +0 -0
  276. package/dist/browser/workspace.efd01c3aaf8e07c4a64194e2bfbd7aee4f7fa515f2acebdfdd90af1badba8ce7.js.br +0 -0
  277. package/dist/browser/workspace.efd01c3aaf8e07c4a64194e2bfbd7aee4f7fa515f2acebdfdd90af1badba8ce7.js.gz +0 -0
@@ -1,5 +1,5 @@
1
- import{spawn}from"node:child_process";import{randomBytes}from"node:crypto";import{chmodSync,existsSync,mkdirSync,readFileSync,renameSync,writeFileSync}from"node:fs";import{tmpdir}from"node:os";import{dirname,join}from"node:path";import{resolveExecutable}from"./attest.js";import{codingEnvironment}from"./agent-thread/providers.js";import{readCodexLimits}from"./codex-limits.js";import{claudeLimitsOf,geminiLimitsOf}from"./provider-limits.js";import{billingOf}from"./spend.js";import{directChatRunning}from"./plan-limits-demand.js";const CLAUDE_STALE_MS=30*6e4,GEMINI_STALE_MS=15*6e4;function subscriptionStatusPath(databaseFile){return join(dirname(databaseFile),".toolroll-run","subscription-status.json")}export function readStoredGeminiStatus(databaseFile){const path=subscriptionStatusPath(databaseFile);if(!existsSync(path))return null;try{const parsed=JSON.parse(readFileSync(path,"utf8"));return!parsed||typeof parsed!="object"||!parsed.gemini?null:parsed.gemini}catch{return null}}function writeStoredGeminiStatus(databaseFile,gemini){const path=subscriptionStatusPath(databaseFile);mkdirSync(dirname(path),{recursive:!0,mode:448});const tmp=`${path}.${process.pid}.${randomBytes(4).toString("hex")}.tmp`;writeFileSync(tmp,JSON.stringify({version:1,gemini},null,2)+`
1
+ import{spawn}from"node:child_process";import{randomBytes}from"node:crypto";import{chmodSync,existsSync,mkdirSync,readFileSync,renameSync,writeFileSync}from"node:fs";import{tmpdir}from"node:os";import{dirname,join}from"node:path";import{resolveExecutable}from"./attest.js";import{runnerPathOf}from"./acp-inspect.js";import{codingEnvironment}from"./agent-thread/providers.js";import{readCodexLimits}from"./codex-limits.js";import{parseAgyCatalog,recordAgyCatalog}from"./model-catalog.js";import{claudeLimitsOf,geminiLimitsOf}from"./provider-limits.js";import{billingOf}from"./spend.js";import{directChatRunning}from"./plan-limits-demand.js";const CLAUDE_STALE_MS=30*6e4,GEMINI_STALE_MS=15*6e4;function subscriptionStatusPath(databaseFile){return join(dirname(databaseFile),".toolroll-run","subscription-status.json")}export function readStoredGeminiStatus(databaseFile){const path=subscriptionStatusPath(databaseFile);if(!existsSync(path))return null;try{const parsed=JSON.parse(readFileSync(path,"utf8"));return!parsed||typeof parsed!="object"||!parsed.gemini?null:parsed.gemini}catch{return null}}function writeStoredGeminiStatus(databaseFile,gemini){const path=subscriptionStatusPath(databaseFile);mkdirSync(dirname(path),{recursive:!0,mode:448});const tmp=`${path}.${process.pid}.${randomBytes(4).toString("hex")}.tmp`;writeFileSync(tmp,JSON.stringify({version:1,gemini},null,2)+`
2
2
  `,{mode:384}),chmodSync(tmp,384),renameSync(tmp,path)}function readClaudeLimits(options={}){return new Promise(resolve=>{const bin=options.command??resolveExecutable("claude");if(!bin){resolve(null);return}const env=codingEnvironment();for(const key of["ANTHROPIC_API_KEY","ANTHROPIC_AUTH_TOKEN","CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_VERTEX"])delete env[key];let settled=!1,buffered="",found=null,child;try{child=spawn(bin,["-p",".","--model","haiku","--max-turns","1","--output-format","stream-json","--verbose","--setting-sources","","--strict-mcp-config","--mcp-config",'{"mcpServers":{}}'],{cwd:tmpdir(),env,shell:!1,windowsHide:!0,stdio:["ignore","pipe","ignore"]})}catch{resolve(null);return}const finish=reading=>{if(!settled){settled=!0,clearTimeout(timer);try{child.kill("SIGTERM")}catch{}resolve(reading)}},timer=setTimeout(()=>finish(found),options.timeoutMs??15e3);child.once("error",()=>finish(null)),child.once("exit",()=>finish(found)),child.stdout?.setEncoding("utf8"),child.stdout?.on("data",chunk=>{buffered+=chunk;let nl;for(;(nl=buffered.indexOf(`
3
- `))!==-1;){const line=buffered.slice(0,nl).trim();if(buffered=buffered.slice(nl+1),!!line)try{const reading=claudeLimitsOf(JSON.parse(line));if(reading!==null){found=reading,finish(reading);return}}catch{}}})})}async function readGeminiSubscription(options={}){const status={connected:!1,provider:"antigravity",topModel:null,modelCount:0,observedAt:(options.now??new Date).toISOString(),note:null},bin=options.command??resolveExecutable("agy");if(!bin)return{...status,note:"Install Antigravity CLI (agy)",limits:null};const models=await readAgyCommand(bin,["models"],options.timeoutMs),modelLines=models.out.replace(/\r/g,`
3
+ `))!==-1;){const line=buffered.slice(0,nl).trim();if(buffered=buffered.slice(nl+1),!!line)try{const reading=claudeLimitsOf(JSON.parse(line));if(reading!==null){found=reading,finish(reading);return}}catch{}}})})}export async function readGeminiSubscription(options={}){const status={connected:!1,provider:"antigravity",topModel:null,modelCount:0,observedAt:(options.now??new Date).toISOString(),note:null},bin=options.command??resolveExecutable("agy",runnerPathOf());if(!bin)return{...status,note:"Install Antigravity CLI (agy)",limits:null};const models=await readAgyCommand(bin,["models"],options.timeoutMs),modelLines=models.out.replace(/\r/g,`
4
4
  `).replace(/\x1b\[[0-9;]*[A-Za-z]/g,"").split(`
5
- `).map(line=>line.trim()).filter(line=>/^gemini-/i.test(line));if(models.code!==0||modelLines.length===0)return{...status,note:models.note??"Sign in with `agy acp --login`",limits:null};status.connected=!0,status.modelCount=modelLines.length,status.topModel=modelLines.some(line=>/gemini-4-neon/i.test(line))?"Gemini 4 Neon":modelLines[0]?.split(/\s{2,}/)[1]??modelLines[0]?.split(/\s+/)[0]??null;const usage=await readAgyCommand(bin,["usage","--json"],options.timeoutMs);let limits=null;if(usage.code===0)try{limits=geminiLimitsOf(JSON.parse(usage.out))}catch{}return{...status,limits,note:limits===null?usage.note??"Usage unavailable. Sign in to Antigravity or update agy to 1.5.23 or later.":null}}function readAgyCommand(bin,args,timeoutMs=12e3){return new Promise(resolve=>{let child;try{child=spawn(bin,args,{cwd:tmpdir(),env:codingEnvironment(),shell:!1,windowsHide:!0,stdio:["ignore","pipe","ignore"]})}catch{resolve({code:null,out:"",note:"Could not start agy"});return}let settled=!1,out="",bytes=0;const finish=(code,note)=>{if(!settled){settled=!0,clearTimeout(timer);try{child.kill("SIGTERM")}catch{}resolve({code,out:code===0?out:"",note})}},timer=setTimeout(()=>finish(null,"Timed out checking Gemini"),timeoutMs);child.stdout?.setEncoding("utf8"),child.stdout?.on("data",chunk=>{if(bytes+=Buffer.byteLength(chunk),bytes>256*1024){finish(null,"Gemini usage response was too large");return}settled||(out+=chunk)}),child.once("error",()=>finish(null,"Could not run agy")),child.once("close",code=>finish(code,null))})}function claudeNeedsRefresh(store,now){if(billingOf("claude")!=="subscription")return!1;const recent=new Date(now.getTime()-6*36e5).toISOString();if(store.handle.prepare("SELECT 1 AS live FROM run WHERE provider = 'claude' AND outcome IS NULL AND started_at > ? LIMIT 1").get(recent)!==void 0||directChatRunning(store,"claude",now))return!1;const rows=store.providerLimits().filter(one=>one.provider==="claude");return rows.length===0?!0:rows.some(one=>{const expired=one.resetsAt!==null&&Date.parse(one.resetsAt)<=now.getTime(),stale=now.getTime()-Date.parse(one.observedAt)>CLAUDE_STALE_MS;return expired||stale})}function geminiNeedsRefresh(databaseFile,now){if(databaseFile===null)return!1;const stored=readStoredGeminiStatus(databaseFile);return stored===null?!0:now.getTime()-Date.parse(stored.observedAt)>GEMINI_STALE_MS}export async function refreshSubscriptions(store,databaseFile,options={}){const readers=options.readers??{},gate=(read,otherwise)=>options.stillWanted?.()===!1?otherwise():read(),now=options.now??new Date,shouldCodex=options.skipCodex!==!0&&billingOf("codex")==="subscription",shouldClaude=options.forceClaude===!0||claudeNeedsRefresh(store,now),readGemini=(options.forceGemini===!0||geminiNeedsRefresh(databaseFile,now))&&options.stillWanted?.()!==!1,[codex,claude,gemini]=await Promise.all([shouldCodex?gate(()=>(readers.codex??(()=>readCodexLimits()))(),()=>Promise.resolve(null)):Promise.resolve(null),shouldClaude?gate(()=>(readers.claude??(()=>readClaudeLimits()))(),()=>Promise.resolve(null)):Promise.resolve(null),readGemini?(readers.gemini??(at=>readGeminiSubscription({now:at})))(now):Promise.resolve((databaseFile!==null?readStoredGeminiStatus(databaseFile):null)??{connected:!1,provider:"antigravity",topModel:null,modelCount:0,observedAt:now.toISOString(),note:null})]);if(codex!==null&&store.recordProviderLimits(codex,now),claude!==null&&store.recordProviderLimits(claude,now),readGemini&&(gemini.limits&&store.recordProviderLimits(gemini.limits,now),databaseFile!==null)){const{connected,provider,topModel,modelCount,observedAt,note}=gemini;writeStoredGeminiStatus(databaseFile,{connected,provider,topModel,modelCount,observedAt,note})}return{claude,codex,gemini,refreshedAt:now.toISOString()}}
5
+ `).map(line=>line.trim()).filter(line=>/^gemini-/i.test(line));if(models.code!==0||modelLines.length===0)return{...status,note:models.note??"Sign in with `agy acp --login`",limits:null};status.connected=!0;const parsedModels=parseAgyCatalog(models.out);parsedModels.length>0&&(status.models=parsedModels),status.modelCount=modelLines.length,status.topModel=modelLines.some(line=>/gemini-4-neon/i.test(line))?"Gemini 4 Neon":modelLines[0]?.split(/\s{2,}/)[1]??modelLines[0]?.split(/\s+/)[0]??null;const usage=await readAgyCommand(bin,["usage","--json"],options.timeoutMs);let limits=null;if(usage.code===0)try{limits=geminiLimitsOf(JSON.parse(usage.out))}catch{}return{...status,limits,note:limits===null?usage.note??"Usage unavailable. Sign in to Antigravity or update agy to 1.5.23 or later.":null}}function readAgyCommand(bin,args,timeoutMs=12e3){return new Promise(resolve=>{let child;try{child=spawn(bin,args,{cwd:tmpdir(),env:codingEnvironment(),shell:!1,windowsHide:!0,stdio:["ignore","pipe","ignore"]})}catch{resolve({code:null,out:"",note:"Could not start agy"});return}let settled=!1,out="",bytes=0;const finish=(code,note)=>{if(!settled){settled=!0,clearTimeout(timer);try{child.kill("SIGTERM")}catch{}resolve({code,out:code===0?out:"",note})}},timer=setTimeout(()=>finish(null,"Timed out checking Gemini"),timeoutMs);child.stdout?.setEncoding("utf8"),child.stdout?.on("data",chunk=>{if(bytes+=Buffer.byteLength(chunk),bytes>256*1024){finish(null,"Gemini usage response was too large");return}settled||(out+=chunk)}),child.once("error",()=>finish(null,"Could not run agy")),child.once("close",code=>finish(code,null))})}function claudeNeedsRefresh(store,now){if(billingOf("claude")!=="subscription")return!1;const recent=new Date(now.getTime()-6*36e5).toISOString();if(store.handle.prepare("SELECT 1 AS live FROM run WHERE provider = 'claude' AND outcome IS NULL AND started_at > ? LIMIT 1").get(recent)!==void 0||directChatRunning(store,"claude",now))return!1;const rows=store.providerLimits().filter(one=>one.provider==="claude");return rows.length===0?!0:rows.some(one=>{const expired=one.resetsAt!==null&&Date.parse(one.resetsAt)<=now.getTime(),stale=now.getTime()-Date.parse(one.observedAt)>CLAUDE_STALE_MS;return expired||stale})}function geminiNeedsRefresh(databaseFile,now){if(databaseFile===null)return!1;const stored=readStoredGeminiStatus(databaseFile);return stored===null?!0:now.getTime()-Date.parse(stored.observedAt)>GEMINI_STALE_MS}export async function refreshSubscriptions(store,databaseFile,options={}){const readers=options.readers??{},gate=(read,otherwise)=>options.stillWanted?.()===!1?otherwise():read(),now=options.now??new Date,shouldCodex=options.skipCodex!==!0&&billingOf("codex")==="subscription",shouldClaude=options.forceClaude===!0||claudeNeedsRefresh(store,now),readGemini=(options.forceGemini===!0||geminiNeedsRefresh(databaseFile,now))&&options.stillWanted?.()!==!1,[codex,claude,gemini]=await Promise.all([shouldCodex?gate(()=>(readers.codex??(()=>readCodexLimits()))(),()=>Promise.resolve(null)):Promise.resolve(null),shouldClaude?gate(()=>(readers.claude??(()=>readClaudeLimits()))(),()=>Promise.resolve(null)):Promise.resolve(null),readGemini?(readers.gemini??(at=>readGeminiSubscription({now:at})))(now):Promise.resolve((databaseFile!==null?readStoredGeminiStatus(databaseFile):null)??{connected:!1,provider:"antigravity",topModel:null,modelCount:0,observedAt:now.toISOString(),note:null})]);if(codex!==null&&store.recordProviderLimits(codex,now),claude!==null&&store.recordProviderLimits(claude,now),readGemini&&(gemini.limits&&store.recordProviderLimits(gemini.limits,now),gemini.models&&gemini.models.length>0&&recordAgyCatalog(gemini.models,store),databaseFile!==null)){const{connected,provider,topModel,modelCount,models,observedAt,note}=gemini;writeStoredGeminiStatus(databaseFile,{connected,provider,topModel,modelCount,...models?{models}:{},observedAt,note})}return{claude,codex,gemini,refreshedAt:now.toISOString()}}
package/dist/surface.js CHANGED
@@ -1 +1 @@
1
- import{KNOWLEDGE_DESCRIPTORS}from"./knowledge-cli.js";import{MEMORY_DESCRIPTORS}from"./memory-cli.js";import{CARD_DESCRIPTOR}from"./card-cli.js";import{FLAKY_DESCRIPTORS}from"./flaky-cli.js";import{MODELS_DESCRIPTORS}from"./models-cli.js";import{MAP_DESCRIPTORS}from"./code-map-cli.js";import{FLOWS_DESCRIPTORS}from"./flows-cli.js";import{commandEntries}from"./contracts/cli.js";export const SURFACE_NOTES={authority:"documentation is not permission; legacy entries remain advisory",flags:"flags are intended per command and may use a global parser vocabulary",reasons:"curated, not exhaustive — the runtime `reason` field is the truth; ignore tokens you do not recognize",database:"local database commands wait up to 15 seconds for another writer; an exhausted wait returns database-busy and names the selected file"},SURFACE_SCHEMA_VERSION=1;const jsonFlag={name:"json",takesValue:!1,meaning:"answer with one machine envelope on stdout"},keyFlag={name:"key",takesValue:!0,meaning:"idempotency key — retry with the same key to get the first answer back"},dbFlag={name:"db",takesValue:!0,meaning:"path to the database file (defaults to the installation's)"},repoFlag={name:"repo",takesValue:!0,meaning:"which repository (repeatable where a command watches several)"},operator=(invocation,synopsis)=>({invocation,synopsis,audience:"operator",agentMayInvoke:!1,mutation:"unkeyed"}),operatorRead=(invocation,synopsis)=>({invocation,synopsis,audience:"operator",agentMayInvoke:!1,mutation:"none"}),GUIDE_ROWS=[{invocation:"",envelopeCommand:"scan",synopsis:"report what is in flight (the no-verb default; scans below the working directory or the connected repositories)",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"path",required:!1,meaning:"directories to scan instead of the connected set"}],flags:[jsonFlag,{name:"all",takesValue:!1,meaning:"ignore connected repos; scan everything discoverable"},{name:"local",takesValue:!1,meaning:"branches only — no network"}]},{invocation:"pulls",synopsis:"report what is waiting on a person",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag]},{invocation:"graph",synopsis:"report which work graph is already here",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag]},{invocation:"repos",synopsis:"list connected repositories",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag]},operator("proposals","what coordinators proposed over the MCP gateway — list, confirm <id> [--yes], dismiss <id>; confirming runs the plane's own door under your password"),operator("chat","talk to your lead: one conversation across every project; --say sends one message; --follow enables crew updates and --no-follow pauses them; proposals keep their approval requirements"),{invocation:"repos add",synopsis:"add a project: a Git repository, in the console at once; the lead adds with its token; --remote records or replaces its trusted remote",audience:"agent",agentMayInvoke:!0,mutation:"unkeyed",positionals:[{name:"path",required:!1,meaning:"the repository (default: the one you are in)"}],flags:[jsonFlag,{name:"token",takesValue:!0,meaning:"the lead token (or TOOLROLL_LEAD_TOKEN)"},{name:"remote",takesValue:!0,meaning:"an HTTPS or SSH URL without credentials whose main may complete landed work; replaces a different recorded one (owner or an instance operator's lead only)"}],notableReasons:["not-git","unavailable","refused","locked"]},{invocation:"repos remove",synopsis:"remove a project from the console and the builder; its tasks and results stay saved",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",positionals:[{name:"path",required:!0,meaning:"the repository"}],flags:[jsonFlag,{name:"token",takesValue:!0,meaning:"the lead token (or TOOLROLL_LEAD_TOKEN)"}],notableReasons:["refused","locked"]},operator("repos add-from-github","preview, clone from GitHub, and connect - the console onboarding ceremony as a CLI verb"),{invocation:"contract",synopsis:"the machine contract: envelope version + capability tokens; --commands dumps this guide",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,{name:"commands",takesValue:!1,meaning:"dump the declared command guide"}]},...["list","install","update","rollback","remove","validate"].map(verb=>({invocation:`plugin ${verb}`,synopsis:{list:"list installed plug-ins",install:"install skills from a GitHub URL or folder",update:"update GitHub plug-ins or reload local folders",rollback:"restore a plug-in's previous version",remove:"remove a plug-in from the active library",validate:"validate a local folder without installing it"}[verb],audience:verb==="list"||verb==="validate"?"agent":"operator",agentMayInvoke:verb==="list"||verb==="validate",mutation:verb==="list"||verb==="validate"?"none":"unkeyed",flags:[jsonFlag,dbFlag],...verb==="list"?{}:{positionals:[{name:verb==="install"?"github-url|folder":verb==="validate"?"folder":"id",required:verb!=="update",meaning:"plug-in source or installed id"}]}})),{invocation:"skills list",synopsis:"name the guides this exact binary serves",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag]},{invocation:"skills get",synopsis:"print one guide's markdown (raw on stdout; --json wraps it)",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"name",required:!0,meaning:"a guide name from `skills list`"}],flags:[jsonFlag],notableReasons:["unknown-skill","usage"]},{invocation:"skills install",synopsis:"install or refresh this binary's Toolroll guides for Claude Code; without --claude-code, write the repository-local Agent Skills entry",audience:"operator",agentMayInvoke:!1,mutation:"identity-idempotent",flags:[jsonFlag,{name:"claude-code",takesValue:!1,meaning:"install the user-level Claude Code skill"},{name:"dir",takesValue:!0,meaning:"skill directory (default: ~/.claude/skills/toolroll)"},{name:"yes",takesValue:!1,meaning:"write the previewed files"},{name:"repo",takesValue:!0,meaning:"repository for the existing project-local install"},{name:"write-context",takesValue:!1,meaning:"also add the managed AGENTS.md block for a project-local install"}],notableReasons:["unconfirmed","foreign-file","usage"]},operator("link","put toolroll on PATH"),operator("unlink","take it off PATH"),operator("update","update to the latest release: verified provenance, drained work, backup, rehearsal, health check, automatic restore; --rollback undoes it"),{invocation:"release",synopsis:"release Toolroll itself from a branch: gate the exact commit, wait for the owner's approval, check, complete, deploy, merge, tag, publish, Homebrew; rerun to resume",audience:"operator",agentMayInvoke:!1,mutation:"unkeyed",positionals:[{name:"branch",required:!0,meaning:"the pushed branch with an open pull request"}],flags:[jsonFlag,{name:"repo",takesValue:!0,meaning:"the gate checkout the release check runs in (default: this checkout)"},{name:"new",takesValue:!1,meaning:"release a new commit on the branch, setting the earlier unfinished release aside"},{name:"limit",takesValue:!0,meaning:"<step>=<minutes>: one waiting step's time limit"},{name:"tap",takesValue:!0,meaning:"the Homebrew tap, owner/name"},{name:"release-gate",takesValue:!0,meaning:"<id>: show why an update pause left before a deployment's swap is safe to lift"},{name:"yes",takesValue:!1,meaning:"with --release-gate: lift that one pause once it is proved; with --recover-deploy: recover"},{name:"recover-deploy",takesValue:!1,meaning:"put back a deployment that stopped half way: stop only its own proved leftovers, restart the previous service, lift the pause"},{name:"stage",takesValue:!0,meaning:"with --recover-deploy: the deployment's staging folder"}],notableReasons:["usage","ambiguous","drift","timeout","check-failed","ci-failed","tree-mismatch","conflict","mixed-runtime","gate-held","after-swap"]},operator("demo","a seeded throwaway sandbox"),...KNOWLEDGE_DESCRIPTORS.map(spec=>({invocation:`knowledge ${spec.action}`,synopsis:spec.synopsis,audience:"audience"in spec?spec.audience:"agent",agentMayInvoke:!("audience"in spec),mutation:spec.mutation,flags:spec.flags,...spec.takesQuery?{positionals:[{name:"query",required:!0,meaning:"search text or source file for impact"}]}:{}})),...MEMORY_DESCRIPTORS.map(spec=>({invocation:`memory ${spec.action}`,synopsis:spec.synopsis,audience:"audience"in spec?spec.audience:"agent",agentMayInvoke:!("audience"in spec),mutation:spec.mutation,flags:spec.flags,...spec.takesQuery?{positionals:[{name:"query",required:!0,meaning:"search text, a decision id, or the decision sentence"}]}:{}})),{invocation:CARD_DESCRIPTOR.invocation,synopsis:CARD_DESCRIPTOR.synopsis,audience:"agent",agentMayInvoke:!0,mutation:"none",flags:CARD_DESCRIPTOR.flags,positionals:[{name:"source",required:!0,meaning:"which data to show"}]},{invocation:"card list",synopsis:"list registered declarative TUI panels (~/.toolroll/panels.toml) and their live card previews (read only)",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,{name:"list",takesValue:!1,meaning:"list registered declarative panels"}]},{invocation:"card remove",synopsis:"remove a declarative TUI panel from ~/.toolroll/panels.toml by id",audience:"operator",agentMayInvoke:!1,mutation:"identity-idempotent",positionals:[{name:"id",required:!0,meaning:"panel id slug to remove"}],flags:[jsonFlag,{name:"remove",takesValue:!0,meaning:"panel id slug to remove"}]},...FLAKY_DESCRIPTORS.map(spec=>({invocation:`flaky ${spec.action}`,synopsis:spec.synopsis,audience:"agent",agentMayInvoke:!0,mutation:spec.mutation,flags:spec.flags,...spec.takesQuery?{positionals:[{name:"identity",required:!0,meaning:"a row's key from flaky list"}]}:{}})),...FLOWS_DESCRIPTORS.map(spec=>({invocation:`flows ${spec.action}`,synopsis:spec.synopsis,audience:"audience"in spec?spec.audience:"agent",agentMayInvoke:!("audience"in spec),mutation:spec.mutation,flags:spec.flags,..."positionals"in spec?{positionals:spec.positionals.map(name=>({name,required:!0,meaning:name==="flow"?"a flow id from flows list":name==="card"?"a card id from flows show":name==="on|off"?"on signs the grant, off revokes it":"a trigger id from flows show, or for trigger add its settings as JSON, a JSON file, or -"}))}:{}})),...MAP_DESCRIPTORS.map(spec=>({invocation:spec.action===""?"map":`map ${spec.action}`,synopsis:spec.synopsis,audience:"audience"in spec?spec.audience:"agent",agentMayInvoke:!("audience"in spec),mutation:spec.mutation,flags:spec.flags,...spec.positional===null?{}:{positionals:[{name:"target",required:!0,meaning:spec.positional}]}})),...MODELS_DESCRIPTORS.map(spec=>({invocation:`models ${spec.action}`,synopsis:spec.synopsis,audience:"agent",agentMayInvoke:!0,mutation:spec.mutation,flags:spec.flags,...spec.takesQuery?{positionals:[{name:"target",required:!0,meaning:"positional"in spec?spec.positional:"the CLI to update, or on/off"}]}:{}})),{invocation:"status",synopsis:"running work, queued reasons, results to review, the latest release check and plan windows",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"health",synopsis:"recent server latency, event-loop delay, SQLite writes and live streams from the saved connection; instance operators only",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,{name:"profile",takesValue:!0,meaning:"saved server connection"}]},{invocation:"integrations",synopsis:"every integration as Connected, Not set up or Broken, with its last success and error, what uses it and what to do; --saved skips new checks; never a secret",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag,{name:"saved",takesValue:!1,meaning:"show the last checks without checking again"}]},{invocation:"ready",synopsis:"what could be dispatched right now (rows carry reservedFor)",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"brief",synopsis:"the lead's catch-up from the local database; --history selects the older operational report",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"gaps",synopsis:"requirement gaps blocking dispatch",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag,repoFlag]},{invocation:"grants",synopsis:"list authority grants",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"audit",synopsis:"what people did on this server with their API tokens, newest first: when, who, which token, from the CLI (api) or an agent (mcp), the command or tool, the project and the outcome (ok, refused, error); an approver sees everyone in their projects, anyone else only themselves",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag,{name:"person",takesValue:!0,meaning:"only this person's actions"},{name:"token",takesValue:!0,meaning:"only actions with the token of this name (on the server's own machine)"},{name:"token-name",takesValue:!0,meaning:"the same, where --token would be a credential (remotely)"},{name:"source",takesValue:!0,meaning:"api (the CLI) or mcp (an agent)"},{name:"since",takesValue:!0,meaning:"only the last N days, as Nd (7d)"},{name:"limit",takesValue:!0,meaning:"actions per page (default 20, at most 100)"},{name:"cursor",takesValue:!0,meaning:"the nextCursor of the previous page"}]},{invocation:"sync",synopsis:"refresh external-tracker mirrors and deliver write-backs — safe to run; fails closed",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",flags:[jsonFlag,dbFlag,repoFlag],notableReasons:["no-op","external"]},{invocation:"task add",synopsis:"queue work",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"title",required:!0,meaning:"one line of what to do"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"id",takesValue:!0,meaning:"choose the task id"},{name:"repo",takesValue:!0,meaning:"which repository the task belongs to"},{name:"report",takesValue:!1,meaning:"a scout task: the deliverable is a report, never a branch"},{name:"replaces",takesValue:!0,meaning:'the task this one replaces: it is cancelled and reads "Replaced by <id>"'},{name:"token",takesValue:!0,meaning:"a lead token: filed as the lead, so it pings nobody"},{name:"checks",takesValue:!0,meaning:`quick|full|off: this task's checks, overriding the project's level ("skip the tests" is off)`}],notableReasons:["duplicate","usage","unknown-task","unauthenticated"]},{invocation:"task new",synopsis:"start a small task at a terminal: shows the exact terms, then Build now? is your approval",audience:"operator",agentMayInvoke:!1,mutation:"unkeyed",positionals:[{name:"words",required:!1,meaning:"what should change"}],flags:[dbFlag,{name:"repo",takesValue:!0,meaning:"the project"},{name:"as",takesValue:!0,meaning:"the approver"},{name:"token",takesValue:!0,meaning:"their password"},{name:"from",takesValue:!0,meaning:"a github.com issue or pull request of this project: quoted, then filed for your approval"},{name:"preview",takesValue:!1,meaning:"the terminal UI's own: the exact terms, nothing started"},{name:"build",takesValue:!0,meaning:"the terminal UI's own: Build on those terms"},{name:"digest",takesValue:!0,meaning:"the terms the person read"}],notableReasons:["person-only","usage"]},{invocation:"task keep",synopsis:"a fast start that grew: propose a plan for its exact commit, for you to approve",audience:"operator",agentMayInvoke:!1,mutation:"unkeyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,{name:"as",takesValue:!0,meaning:"the approver"},{name:"token",takesValue:!0,meaning:"their password"}],notableReasons:["usage","refused"]},{invocation:"task ask",synopsis:"hand a task to a person: one message saying why, and the task is theirs",audience:"agent",agentMayInvoke:!0,mutation:"unkeyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,{name:"person",takesValue:!0,meaning:"who to ask (someone who can see the task's project)"},{name:"why",takesValue:!0,meaning:"what they need to do, one line"},{name:"token",takesValue:!0,meaning:"the lead token (or TOOLROLL_LEAD_TOKEN)"}],notableReasons:["unknown-task","unknown-person","unplaced","unauthenticated"]},{invocation:"task checks",synopsis:"run checks on the task's latest result, on its exact commit, now; a pass upgrades its status and a failure stays visible",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",positionals:[{name:"task",required:!0,meaning:"any version of the task"}],flags:[jsonFlag,dbFlag,{name:"level",takesValue:!0,meaning:"quick (default) or full"}],notableReasons:["no-result","no-check","checks-failed"]},{invocation:"task ship",synopsis:"the task's pull request checks as last observed for its head: each check's state and how long it took",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"task",required:!0,meaning:"any version of the task"}],flags:[jsonFlag,dbFlag],notableReasons:["unknown-task","no-pull-request"]},{invocation:"task ready",synopsis:"Can I merge? The task's checklist from Toolroll's records, each blocker with the act that clears it (Run checks, Retry, Ask the agent to fix)",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"task",required:!0,meaning:"any version of the task"}],flags:[jsonFlag,dbFlag],notableReasons:["unknown-task"]},{invocation:"task add-tests",synopsis:"file a small task to write tests for the task's latest change; it waits for approval like any task",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",positionals:[{name:"task",required:!0,meaning:"any version of the task"}],flags:[jsonFlag,dbFlag],notableReasons:["no-result"]},{invocation:"task list",synopsis:"a page of saved task status",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag,{name:"state",takesValue:!0,meaning:"queued|running|done|failed|cancelled"},{name:"view",takesValue:!0,meaning:"all|needs-you|running|completed|archived"},{name:"limit",takesValue:!0,meaning:"page size, 1–100; default 40"},{name:"cursor",takesValue:!0,meaning:"nextCursor from the previous response"},{name:"repo",takesValue:!0,meaning:"filter to one project"}]},{invocation:"task show",synopsis:"one task in full",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag],notableReasons:["unknown-task"]},{invocation:"check-progress",synopsis:"current or final approved check progress",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"run",required:!0,meaning:"the build run"}],flags:[jsonFlag,dbFlag],notableReasons:["unknown-run","no-progress"]},{invocation:"task wait",synopsis:"wait for the current attempt to finish or need a person",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,{name:"timeout",takesValue:!0,meaning:"stop waiting after this many seconds"}],notableReasons:["unknown-task","timeout","failed","needs-person"]},{invocation:"project show",synopsis:"show the saved local project and optional credential-file reference",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"project use",synopsis:"select an exact saved checkout; grants no project or execution authority",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",positionals:[{name:"path",required:!0,meaning:"exact saved project checkout path"}],flags:[jsonFlag,dbFlag,{name:"token-file",takesValue:!0,meaning:"optional existing scoped coordinator credential file; saves only its path"}]},...["complete","revise"].map(action=>({invocation:`task ${action}`,synopsis:action==="complete"?"mark the exact inspected result complete; checks and permissions remain unchanged":"request a same-task revision using explicit feedback; existing approval terms apply",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",positionals:[{name:"task",required:!0,meaning:"task or assignment id"}],flags:[jsonFlag,dbFlag,{name:"token-env",takesValue:!0,meaning:"scoped coordinator credential environment variable"},{name:"token-file",takesValue:!0,meaning:"scoped coordinator credential file; defaults to selected project reference"},...action==="complete"?[{name:"digest",takesValue:!0,meaning:"exact receipt from assignment show; required for JSON or scoped agents"},{name:"pull-request",takesValue:!1,meaning:"also open the result's pull request from that commit, as the console's Complete does; an approver's sign-in (--as/--token), never a scoped credential; refuses with pull-requests-off and the setup command"},{name:"run",takesValue:!0,meaning:"the terminal's local owner: the exact build of the result read; required there with --digest"},{name:"checked",takesValue:!1,meaning:"the terminal's local owner: you checked the result yourself; required when it owes your own check"},{name:"reason",takesValue:!0,meaning:"the terminal's local owner: why you accept a result whose requirement isn't shown; required for an exception"}]:[{name:"feedback",takesValue:!0,meaning:"specific requested change"},{name:"run",takesValue:!0,meaning:"exact result run; defaults to current result"},{name:"source",takesValue:!0,meaning:"exact scope digest; defaults to current terms"},{name:"key",takesValue:!0,meaning:"32 hexadecimal characters for exact replay; defaults to a stable feedback identity"}]]})),{invocation:"task merge",synopsis:"merge the task's pull request once its checks pass — the console's Merge, behind the approver's password; the project's method (squash by default), branch deleted, recorded in the ledger",audience:"operator",agentMayInvoke:!1,mutation:"identity-idempotent",positionals:[{name:"task",required:!0,meaning:"any version of the task"}],flags:[jsonFlag,dbFlag,{name:"as",takesValue:!0,meaning:"the approver merging"},{name:"token",takesValue:!0,meaning:"their password"},{name:"anyway",takesValue:!1,meaning:"merge a Quick or Off result without waiting for its full check"}],notableReasons:["usage","not-an-approver","full-checks"]},...["show","updates","claim","check","brief","inbox","ack"].map(action=>({invocation:`assignment ${action}`,synopsis:action==="show"?"read the root, current work, owner and exact receipt":action==="updates"?"read the history of handoffs sent to people after a cursor; delivers nothing — receive updates with assignment inbox":action==="claim"?`record lead ownership; with the lead token the task reads "<the lead's name> is on it" and leaves Needs you until done, handed over, or 2 hours idle; grants no approval or execution authority`:action==="brief"?"catch up from current assignments and project knowledge in the local database":action==="inbox"?"receive or replay a saved batch of lead status updates":action==="ack"?"acknowledge delivery of an inbox batch; leaves task completion unchanged":"acknowledge the exact ready receipt as its lead; accepts no proof and deploys nothing",audience:"agent",agentMayInvoke:!0,mutation:action==="claim"||action==="check"||action==="inbox"||action==="ack"?"identity-idempotent":"none",...["show","claim","check"].includes(action)?{positionals:[{name:"task",required:!0,meaning:"any task in the assignment's existing correction chain"}]}:{},flags:[jsonFlag,dbFlag,{name:"token-env",takesValue:!0,meaning:"explicit environment variable containing a coordinator token; required for claim/check/inbox/ack unless token-file is used"},{name:"token-file",takesValue:!0,meaning:"explicit coordinator token file; cannot be combined with token-env"},...action==="updates"?[{name:"after",takesValue:!0,meaning:"last processed admitted update cursor; defaults to 0"},{name:"limit",takesValue:!0,meaning:"page size from 1 to 100; defaults to 50"}]:[],...action==="check"?[{name:"digest",takesValue:!0,meaning:"exact current receipt digest from assignment show"}]:[],...action==="brief"?[{name:"repo",takesValue:!0,meaning:"project to include within the credential's access"},{name:"limit",takesValue:!0,meaning:"assignment count from 1 to 25; defaults to 10"}]:[],...action==="inbox"||action==="ack"?[{name:"consumer",takesValue:!0,meaning:"stable lowercase name for this lead's delivery cursor"}]:[],...action==="inbox"?[{name:"limit",takesValue:!0,meaning:"batch size from 1 to 100; defaults to 10"}]:[],...action==="ack"?[{name:"batch",takesValue:!0,meaning:"exact batch ID returned by assignment inbox"}]:[]]})),operator("task state","set a task's state by hand — an operator correction, not a workflow step (--replaced-by <id> with cancelled)"),operator("lead token","mint the lead's credential behind your password (--revoke ends it): its own work pings nobody"),{invocation:"lead say",synopsis:"as the lead: one short message in its person's chat under the lead's name (Settings → Lead); several within two minutes are one message",audience:"agent",agentMayInvoke:!0,mutation:"unkeyed",positionals:[{name:"text",required:!0,meaning:"one short line in plain words"}],flags:[jsonFlag,dbFlag,{name:"task",takesValue:!0,meaning:"the task it is about"},{name:"token",takesValue:!0,meaning:"the lead token (or TOOLROLL_LEAD_TOKEN)"}],notableReasons:["usage","unknown-task","unauthenticated"]},{invocation:"task block",synopsis:"make one task wait for another",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the waiting task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"on",takesValue:!0,meaning:"the blocker's id"}],notableReasons:["unknown-task"]},{invocation:"task unblock",synopsis:"stop waiting",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the waiting task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"on",takesValue:!0,meaning:"the blocker's id"}],notableReasons:["unknown-task"]},{invocation:"task next",synopsis:"move a task to the front of ITS queue (scheduling only; approval still required)",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"undo",takesValue:!1,meaning:"back to filing order"}],notableReasons:["unknown-task","claimed"]},operator("task steer","one credentialed note for the task's agent — a running Claude build gets it in seconds, another running build reads it when it next checks for notes, otherwise the next attempt does; --now pauses the running Claude build first; steering speaks with the operator's voice"),{invocation:"task log",synopsis:"tail a task's live or finished agent output (--follow, --sub, --lines)",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,{name:"follow",takesValue:!1,meaning:"stream appended output while running"},{name:"sub",takesValue:!1,meaning:"read subagent helper output"},{name:"lines",takesValue:!0,meaning:"maximum trailing lines to display"}],notableReasons:["unknown-task","usage"]},{invocation:"task send",synopsis:"send a live message or steering note directly to a task's agent",audience:"operator",agentMayInvoke:!1,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"},{name:"note",required:!0,meaning:"message for the agent"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"note",takesValue:!0,meaning:"message text (optional if given positionally)"}],notableReasons:["unknown-task","task-finished","usage"]},{invocation:"task handoff",synopsis:"hand a task's live worktree and compact Handoff Packet to another coding agent",audience:"operator",agentMayInvoke:!1,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"to",takesValue:!0,meaning:"target agent provider (claude, codex, gemini, ...)"},{name:"model",takesValue:!0,meaning:"optional target model id"},{name:"note",takesValue:!0,meaning:"handoff instructions for the receiving agent"}],notableReasons:["unknown-task","invalid-agent","task-finished","usage"]},{invocation:"task attach",synopsis:"attach to a task's active run, worktree status, and live output stream",audience:"operator",agentMayInvoke:!1,mutation:"none",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,{name:"lines",takesValue:!0,meaning:"initial trailing lines to display"}],notableReasons:["unknown-task","usage"]},operator("task pause","stop a running Claude build's current turn and keep the build (--run <id> names the attempt): its next note continues it; never a stop"),operator("task continue","resume a paused Claude build where it stopped, without a note (--run <id> names the attempt)"),{invocation:"task assign",synopsis:"reserve a task for one worker, or return it to the shared queue",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"runner",takesValue:!0,meaning:"the worker to reserve for"},{name:"anyone",takesValue:!1,meaning:"back to the shared queue"}],notableReasons:["unknown-task","claimed"]},{invocation:"task scope",synopsis:"state what success is; approval binds to this exact statement",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"goal",takesValue:!0,meaning:"what success is"},{name:"not",takesValue:!0,meaning:"explicitly out of scope"},{name:"touches",takesValue:!0,meaning:"comma-separated paths this may change"},{name:"budget-usd",takesValue:!0,meaning:"spend ceiling for the build"}],notableReasons:["unknown-task"]},{invocation:"task plan",synopsis:"ask for a plan document (a planning session drafts; a person approves)",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"provider",takesValue:!0,meaning:"pin which provider plans THIS task (plan phase only)"},{name:"model",takesValue:!0,meaning:"the pinned plan model, riding --provider"},{name:"digest",takesValue:!0,meaning:"the terminal's local owner: the exact planning source read; required there, and --provider/--model are refused"},{name:"incident",takesValue:!0,meaning:"the terminal's local owner: plan again after this planning incident (the plan failed its checks)"}],notableReasons:["unknown-task"]},{invocation:"task hold",synopsis:"park a task with a reason",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"reason",takesValue:!0,meaning:"why it waits"},{name:"until",takesValue:!0,meaning:"ISO time to resurface"}],notableReasons:["unknown-task","held"]},{invocation:"task unhold",synopsis:"release a hold",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag],notableReasons:["unknown-task","not-yours"]},{invocation:"task require",synopsis:"name the capabilities a task needs before dispatch",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"require",takesValue:!0,meaning:"comma-separated capability keys"}],notableReasons:["unknown-task"]},operator("task approve","the yes — nothing builds without one; binds to the scope digest"),operator("task requeue","exit a stall: incidents resolved, strikes cleared, queued again"),operator("task regate","explicitly rerun the approved check on the last exact commit — no agent or automatic retry"),{invocation:"task review",synopsis:"read a task's compact result packet with --brief, or a run's automatic findings without it",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"id",required:!0,meaning:"task id with --brief; run id otherwise"}],flags:[jsonFlag,dbFlag,{name:"brief",takesValue:!1,meaning:"saved conclusion, changed files, checks, findings, screenshots, plan and next actions; missing fields say not recorded"},{name:"run",takesValue:!0,meaning:"with --brief, select an exact finished attempt instead of the latest"},{name:"all",takesValue:!1,meaning:"include LOW findings within the compact packet's limit; extra findings are counted"},{name:"token",takesValue:!0,meaning:"the lead token (or TOOLROLL_LEAD_TOKEN)"}],notableReasons:["usage","unauthenticated","not-found"]},{...operator("task accept",`accept a result: --finish (or --digest <receipt>) is exactly task complete's completion of the exact receipt; --despite "<reason>" records an acceptance with limitations and never completes; a bare call refuses`),positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,{name:"finish",takesValue:!1,meaning:"accept the result and finish the task: task complete's exact-receipt completion; --json and scoped agents pass --digest"},{name:"digest",takesValue:!0,meaning:"the exact receipt from assignment show; accepts and finishes exactly that result"},{name:"despite",takesValue:!0,meaning:"accept with this reason, without finishing; never combines with --finish or --digest (--note is its alias)"}],notableReasons:["usage","unknown-task","no-run","not-ready"]},{...operator("task land","put accepted work on the project's own branch when it has no pull requests: bare shows exactly what lands where; --yes --key <preview-key> lands it as one new commit on top; --undo reverts that commit with a new one"),positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,{name:"into",takesValue:!0,meaning:"land on this branch instead of the recorded one (the yes records it)"},{name:"undo",takesValue:!1,meaning:"revert the landing with a new commit on the branch"},{name:"yes",takesValue:!1,meaning:"land it; needs --key"},{name:"key",takesValue:!0,meaning:"the key the bare call showed: what lands is what you read"}],notableReasons:["usage","not-complete","checks","dirty","moved","occupied","stale"]},operator("task repair","inspect or approve a repair draft; --yes starts the repair a failed check is waiting for, under the normal plan approval"),operatorRead("task handover","where a task stands, from Toolroll's records: revision, decisions, rejected approaches, open findings, checks and the next action"),operator("task before-after","before-and-after evidence: read it, save a failing result, or rerun the same check on the latest commit with no agent"),operator("task failing-first","ask a bug fix's next attempt to write a failing test first (on|off); shown in the result as the agent's report"),operatorRead("finding list","findings still waiting on someone, or every finding of --task <id>"),operatorRead("finding show","one finding: its text, evidence and how it stands"),operator("finding send","send a finding to the task that owns the code; the owner must accept it or reject it with a reason"),operator("finding resend","send an answered finding back, one more round; past the limit it goes to a person"),operator("finding close","a person's decision on a finding"),operatorRead("captures list","what providers said when attempts failed, the ones mentioning limits first; nothing routes on these"),operatorRead("captures show","one saved provider failure"),operatorRead("captures export","one saved provider failure as a fixture"),operator("captures mark","a person's reading of a capture: exhausted or not-exhausted"),operator("task route","which configured agents plan, build and repair this task; phase and size changes require renewed approval"),operator("task reopen","resume external work its tracker closed and has been SEEN open again"),operator("task stop","stop ONE exact live attempt (--run <id>): durable before any process is signalled, answers 'stopping' until its own processes are established gone; work, branch, and evidence preserved; no strike, no retry"),{...operator("task archive","put tasks away (a person's act): out of every list, count and nudge, history and approvals kept; nothing claims, approves or dispatches them until restored"),positionals:[{name:"id",required:!0,meaning:"one or more tasks (any version: the whole family goes)"}],flags:[jsonFlag,dbFlag,{name:"reason",takesValue:!0,meaning:"why, shown on the task page"}],notableReasons:["unknown-task","not-an-approver"]},{...operator("task restore","bring put-away tasks back exactly as they were (a person's act)"),positionals:[{name:"id",required:!0,meaning:"one or more put-away tasks"}],flags:[jsonFlag,dbFlag],notableReasons:["unknown-task","not-an-approver"]},{...operator("task tidy","Put away old tasks: --preview lists what would go and why (read-only), --apply --digest <d> puts away exactly that list (a person's act)"),flags:[jsonFlag,dbFlag,{name:"preview",takesValue:!1,meaning:"show the list and the digest; changes nothing"},{name:"apply",takesValue:!1,meaning:"put away exactly the previewed list (needs --digest)"},{name:"digest",takesValue:!0,meaning:"the digest --preview printed"},{name:"days",takesValue:!0,meaning:"also finished tasks untouched this many days (1–365, default 14)"},{name:"except",takesValue:!0,meaning:"comma-separated tasks from the list to leave out"}],notableReasons:["usage","not-an-approver","empty"]},operator("run settle","have Toolroll check again whether a finished run stopped: it looks at this computer's processes itself, stops only leftovers proven the run's, and settles the run when none is left (nobody vouches; --why is ignored)"),operator("task resume","resume the exact stopped attempt (--run <id>): refuses until it is quiescent, lifts only that stop's hold, approves nothing — the next pass re-proves the scope and inherits the draft with fresh proof"),{invocation:"claim",synopsis:"take one ready, approved task; answers with a lease",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"runner",takesValue:!0,meaning:"your registered worker name"},{name:"token",takesValue:!0,meaning:"the worker's token"},{name:"ttl",takesValue:!0,meaning:"lease seconds"}],notableReasons:["held","fenced","unapproved","reserved","external","claimed","not-ready","closed"]},{invocation:"heartbeat",synopsis:"still working; extends the lease",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",positionals:[{name:"lease",required:!0,meaning:"the lease id"}],flags:[jsonFlag,dbFlag],notableReasons:["not-leased","fenced","closed"]},{invocation:"worker release",synopsis:"done with it; fenced if superseded",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",positionals:[{name:"lease",required:!0,meaning:"the lease id"}],flags:[jsonFlag,dbFlag],notableReasons:["not-leased","fenced"]},{invocation:"reap",synopsis:"release every lease that ran out",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",flags:[jsonFlag,dbFlag]},{invocation:"tick",synopsis:"one unattended pass: claim, build in a leased worktree, commit to a branch — never pushes",audience:"agent",agentMayInvoke:!0,mutation:"unkeyed",flags:[jsonFlag,dbFlag,repoFlag,{name:"runner",takesValue:!0,meaning:"your registered worker name"},{name:"token",takesValue:!0,meaning:"the worker's token"},{name:"max",takesValue:!0,meaning:"tasks this pass (default 1)"},{name:"base",takesValue:!0,meaning:"base ref for first attempts"}],notableReasons:["empty","fenced"]},{invocation:"build",synopsis:"build one claimed task directly (the piece tick automates)",audience:"agent",agentMayInvoke:!0,mutation:"unkeyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,repoFlag],notableReasons:["not-leased","unapproved"]},{invocation:"reconcile",synopsis:"recover what the last stretch left behind — safe to repeat",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",flags:[jsonFlag,dbFlag,repoFlag]},{invocation:"runner list",synopsis:"registered workers",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"coordinator list",synopsis:"MCP filing credentials and their limits",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"approver list",synopsis:"who can say yes (names only)",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"cap list",synopsis:"recorded capabilities",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag,repoFlag]},{invocation:"outbox list",synopsis:"queued notifications",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"incident list",synopsis:"open incidents",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"config show",synopsis:"phase and spend configuration",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag,repoFlag]},{invocation:"setup show",synopsis:"installation setup",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"verify show",synopsis:"the repository's check level, its approved full and quick commands, and a suggested quick command",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag,repoFlag]},{invocation:"intake show",synopsis:"intake configuration",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"providers",synopsis:"which agent providers this binary can drive, and their transports; --report records this machine's readiness under its runner",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,{name:"report",takesValue:!1,meaning:"record readiness observations under --runner"},{name:"runner",takesValue:!0,meaning:"the registered worker name reporting"},{name:"token",takesValue:!0,meaning:"that worker's token"}]},{invocation:"template list",synopsis:"work templates: tasks and scheduled flows",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"template show",synopsis:"one template",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"name",required:!0,meaning:"the template"}],flags:[jsonFlag,dbFlag]},{invocation:"webhook status",synopsis:"connected messaging services",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"publish status",synopsis:"publication and merge-grant state",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},operator("approver add","mint the credential that lets a person say yes"),operator("runner register","register a worker bound to its repositories; its token is shown once"),operator("runner retire","retire a worker"),operator("runner bind","replace which repositories a worker may build in"),operator("runner capacity","set how many tasks a worker runs at once; running work carries on, the new number applies at the next claim"),operator("project checks","show or set a project's batch checks (--batch on|off, off by default): results that finish within 10 minutes share one full check on a temporary batch commit; nothing is merged into a real branch"),operator("project check-access","show or set how far a project's checks reach: sandboxed (the default), with model and GitHub sign-ins, or not sandboxed; an instance operator widens it with a password typed now"),operator("project concurrency","set how many of a project's tasks build at once (default 2, never past the worker's capacity); running work carries on"),operator("coordinator mint","mint the MCP filing credential — repo-bound, rate-limited, token shown once"),operator("coordinator revoke","revoke an MCP filing credential"),operator("mcp","serve the MCP gateway over stdio — the coordinator credential is the only key it accepts"),operator("cap add","record a capability"),operator("outbox deliver","deliver queued notifications"),operator("peek","watch live agents in the terminal — one pane per open run; --tmux opens a window per run"),operator("incident resolve","resolve an incident"),operator("decide","read and ANSWER parked decisions — answering is a person's act"),operatorRead("keys status","which provider API keys are stored — never the values"),operator("keys set","store a provider's API key as a private file — piped or --key-file, never on the command line"),operator("keys clear","remove a stored provider key (kept only as a fallback; a subscription-mode provider is unaffected)"),operatorRead("keys verify","check a stored key against its provider live — spends no tokens"),operator("keys auth","choose subscription vs API key for a provider (subscription is the default; the key is kept as fallback)"),operatorRead("people list","everyone who can sign in, their standing, and the open invites"),operator("people invite","mint a single-use sign-in link for one person — their powers are pinned when you mint, never after"),operator("people projects","set a person's project access — selected project, all projects, or no projects"),operator("people revoke","end a person's access — their sessions, invites, and signed modes end with them; history stays"),operator("tokens create","make one of your API tokens: --name, --access read|act, --days 30|90|365, optional --projects a,b; your password at the prompt or --password-stdin; the token is shown once"),operatorRead("tokens list","your API tokens: name, access, projects, made, last used, expiry — never a secret; your password at the prompt or --password-stdin"),operator("tokens revoke","end one of your API tokens now, by name or id; your password at the prompt or --password-stdin"),operator("tokens rotate","replace one of your API tokens on the same terms; the old one works 10 more minutes (--overlap), then stops; the new one is shown once"),operatorRead("mode show","the repository's operating mode, in full — or 'locked' when none is signed"),operator("mode set","sign a per-repository operating mode (password ceremony; standard or hands-off, always expiring)"),operator("publish merge","say yes to ONE waiting merge — it fires only when CI is seen green on the exact commit you authorized"),operator("publish refire","recover a merge whose issued call went silent — re-enters the full merge road, never auto-retried"),operatorRead("review show","whether a project's finished builds get one automatic review"),operator("review on","one automatic review of each finished build whose check passes; only HIGH findings send it back, once"),operator("review off","finished builds go straight to the person, unreviewed"),operatorRead("chat-approval show","whether your own taps in your paired chat approve plans and merges: all projects and each project's own setting"),operator("chat-approval on","let your paired chat approve plans and merges in all your projects or one (--repo); lasting, with limits; previews until --yes"),operator("chat-approval off","stop approving from chat for all your projects or one (--repo); one step"),operator("mode revoke","revoke a repository's mode — one click, every act it covered falls back to its own ceremony"),operator("config set","set phase or spend configuration"),operator("config clear","clear phase or spend configuration"),operatorRead("thread list","your own interactive agent threads: each one's title, project and where it stands"),operatorRead("thread show","one of your threads: its latest turn, its end and its Ship, in Toolroll's words"),operator("thread end","end one of your threads for good (its agent stops; its work can still be shipped for a week)"),operator("thread remove","remove one of your threads' working copy (refused while its agent may run or a Ship is open)"),operator("thread ship","ship one of your threads' committed work: shows its terms, asks, then takes your password typed now"),operator("thread save","save one of your threads' committed work as the branch toolroll/code-<id> in its project (no pull request, no merge); says the git merge that puts it on your branch"),operator("setup clear","clear installation setup"),operator("verify set",'approve the one shell command the plane re-runs after every future commit (--quick "<cmd>" approves the fast check Quick runs); --self-heal binds one approved-setup replay when a required project executable is missing'),operator("verify clear","revoke a repository's approved verification command; --level quick revokes only the quick command"),operator("verify level","set a project's checks after each build: quick (the approved quick command), full, or off — an approver's act, in the ledger"),operator("intake grant","grant an intake source"),operator("intake run","run intake now"),operator("intake preview","preview what intake would file"),operator("intake pr-comments","intake review comments from a pull request"),operator("intake clear","clear intake configuration"),operator("webhook primary","choose which service receives alerts"),operator("bridge","the Telegram bridge (pairing, tokens, the follower)"),operator("enroll","grant a repository authority (backends, dispatch) — its own explicit yes"),operator("revoke","take an authority grant back"),operator("publish","the publication pass: push built branches, open pull requests, sweep merges"),operator("publish grant","grant publication or auto-merge authority"),operator("publish revoke","take a publication grant back"),operator("publish unblock","lift a repair's merge hold"),operator("publish rearm","re-arm a refused merge after fixing the named cause"),operator("serve","the operations console (HTTP)"),operatorRead("serve check-public","is this server ready on its --public-url? checks the URL, --allow-host, the console on --port, the certificate, HSTS and the proxy, and names each problem; sends no credentials"),operator("watch","the unattended loop, kept running"),operator("up","console + worker + browser, one command"),operator("onboard","add this repository, report signed-in agents, install or --remove the operator skill (--yes), offer the starter flows (--starter <ids>), and print the handoff"),operator("daemon","install the loop under the OS service manager"),operator("background on","keep this computer's Toolroll running: a login item that starts `up --laptop` when you log in; hands over from the `up` this terminal runs and puts everything back if the service doesn't answer (--port)"),operator("background off","stop running in the background: unloads and removes only Toolroll's own login item"),operatorRead("background show","whether Toolroll runs in the background here, whether it is running now, and any other service on this database"),operator("stop","stop this computer's Toolroll after its running work is saved: the background service (until the next login), or the `up` running in a terminal"),operator("open","open this computer's Toolroll at a terminal, signed in: the terminal UI, or the browser with --web (starts it first when it isn't running); never prints a sign-in link"),{...operatorRead("welcome","the three steps to a first result (agent, project, first task) as the console's welcome shows them; at a terminal it walks them one at a time"),flags:[jsonFlag,dbFlag]},{...operator("welcome sample","add the sample project (a tiny repository with one function and its test) in your projects folder, as this computer's password-free owner at a terminal: the console welcome's Try a sample project; takes no folder or name"),flags:[jsonFlag,dbFlag]},operator("password set","set this computer's first password, typed twice at your own terminal (never a flag, file or environment variable); every session signs in again and local mode stays on"),operator("password reset","reset a forgotten password at the computer running Toolroll, typed twice at your own terminal (the one approver, or --as <name>); every session of that account ends and a saved first password that no longer works is removed. Anyone who can run commands as you on this computer can do this, as they could read the saved file"),{...operatorRead("doctor","check that Toolroll's service holds no key, token or password a build could read; names what it finds and the steps to fix it, never a value, and changes nothing"),flags:[jsonFlag]}],REMOTE_NO=["plugin list","plugin install","plugin update","plugin rollback","plugin remove","plugin validate","task new","task keep","","pulls","graph","repos","repos add","repos remove","repos add-from-github","contract","skills list","skills get","skills install","link","unlink","update","release","demo","chat","project show","project use","brief","lead token","lead say","health","assignment show","assignment updates","assignment claim","assignment check","assignment brief","assignment inbox","assignment ack","claim","heartbeat","worker release","reap","tick","build","reconcile","runner register","runner retire","runner bind","runner capacity","coordinator mint","coordinator revoke","mcp","outbox deliver","peek","serve","serve check-public","watch","up","onboard","daemon","background on","background off","background show","stop","open","welcome","welcome sample","password set","password reset","doctor","bridge","setup show","setup clear","providers","keys status","keys set","keys clear","keys verify","keys auth","models check","models update","models watch","models results","models suggestions","models accept","models dismiss","models turn-off","models keep","models try","models stop","map on","map off","map holdout end","map report","thread list","thread show","thread end","thread remove","thread ship","thread save","publish","publish status","publish merge","publish refire","publish unblock","publish rearm","publish grant","publish revoke","enroll","revoke","flows import","flows trigger check","flows script save","flows browser","memory propose","card list","card remove"],REMOTE_FOLLOW_THROUGH=["task handover","task before-after","task failing-first","finding list","finding show","finding send","finding resend","finding close","captures list","captures show","captures export","captures mark"],REMOTE_STEP_UP=["proposals","decide","task regate","task approve","task accept","task merge","run settle","task archive","task restore","task tidy","task land","knowledge apply","memory decide","memory retire","memory apply","memory tidy","memory restore","memory unmerge","flows card approve","flows card send-back","flows script approve","flows unattended","approver list","approver add","people list","people invite","people projects","people revoke","tokens create","tokens list","tokens revoke","tokens rotate","mode show","mode set","mode revoke","chat-approval on","review on","review off","config set","config clear","verify set","verify clear","verify level","project checks","project check-access","project concurrency","intake grant","intake clear","webhook primary"],REMOTE_YES=["status","integrations","ready","gaps","grants","sync","audit","task add","task ask","task checks","task ship","task ready","task add-tests","task list","task show","check-progress","task wait","task complete","task revise","task state","task block","task unblock","task next","task steer","task pause","task continue","task assign","task scope","task plan","task hold","task unhold","task require","task requeue","task review","task repair","task route","task reopen","task stop","task resume","task log","task send","task handoff","task attach","runner list","coordinator list","cap list","cap add","outbox list","incident list","incident resolve","config show","verify show","intake show","intake run","intake preview","intake pr-comments","template list","template show","webhook status","review show","chat-approval show","chat-approval off","knowledge search","knowledge impact","knowledge refresh","map","map area","map file","map search","map refresh","memory search","memory decisions","memory show","memory review","memory status","flaky list","flaky show","card","flows list","flows show","flows export","flows create","flows edit","flows trigger add","flows trigger pause","flows trigger resume","flows trigger remove","flows card add","flows archive","models status","models list"];export const REMOTE_POLICY=new Map([...REMOTE_NO.map(invocation=>[invocation,"no"]),...REMOTE_FOLLOW_THROUGH.map(invocation=>[invocation,"no"]),...REMOTE_STEP_UP.map(invocation=>[invocation,"step-up"]),...REMOTE_YES.map(invocation=>[invocation,"yes"])]),REMOTE_POLICY_COUNT=REMOTE_NO.length+REMOTE_FOLLOW_THROUGH.length+REMOTE_STEP_UP.length+REMOTE_YES.length;const LOCAL_ALLOW={"plugin list":"read","plugin validate":"read","plugin install":"skill-library","plugin update":"skill-library","plugin rollback":"skill-library","plugin remove":"skill-library",pulls:"read",graph:"read",repos:"read",map:"read","map area":"read","map file":"read","map search":"read",status:"read",ready:"read",gaps:"read",contract:"read","skills list":"read","skills get":"read","flaky list":"read","flaky show":"read",card:"read","memory review":"read","memory status":"read","memory decisions":"read","memory show":"read","memory apply":"memory-review","memory tidy":"memory-review","memory restore":"memory-review","memory unmerge":"memory-review","task list":"read","task show":"read","task state":"read","task wait":"read","check-progress":"read","review show":"read",welcome:"read","task add":"file-task","task new":"build-now",chat:"lead-send","task steer":"lead-send","task approve":"approve-plan",decide:"answer-question","task stop":"stop-run","task pause":"pause-run","task hold":"pause-run","task resume":"resume-run","task continue":"resume-run","task unhold":"resume-run","task complete":"complete-task","task accept":"complete-task","task land":"land-task","task plan":"request-plan","task requeue":"retry-build","task revise":"request-revision","task archive":"archive-task","task restore":"archive-task","repos add":"add-project","welcome sample":"add-project","models suggestions":"read","models turn-off":"routing-turn-off","models dismiss":"dismiss-suggestion","models stop":"trial-stop","map on":"code-map-switch","map off":"code-map-switch","task send":"lead-send","task handoff":"change-task-agents","config set":"change-models","config clear":"change-models"};export const LOCAL_POLICY=new Map(GUIDE_ROWS.map(row=>[row.invocation,Object.prototype.hasOwnProperty.call(LOCAL_ALLOW,row.invocation)?{local:"allow",act:LOCAL_ALLOW[row.invocation]}:{local:"deny"}])),LOCAL_ALLOWED_INVOCATIONS=Object.keys(LOCAL_ALLOW),COMMAND_ENTRIES=commandEntries(GUIDE_ROWS.map(row=>({...row,remote:REMOTE_POLICY.get(row.invocation)??"no"}))),GUIDE_INVOCATIONS=GUIDE_ROWS.map(row=>row.invocation),COMMAND_GUIDE=COMMAND_ENTRIES.map(entry=>entry.guide);
1
+ import{KNOWLEDGE_DESCRIPTORS}from"./knowledge-cli.js";import{MEMORY_DESCRIPTORS}from"./memory-cli.js";import{CARD_DESCRIPTOR}from"./card-cli.js";import{FLAKY_DESCRIPTORS}from"./flaky-cli.js";import{MODELS_DESCRIPTORS}from"./models-cli.js";import{MAP_DESCRIPTORS}from"./code-map-cli.js";import{FLOWS_DESCRIPTORS}from"./flows-cli.js";import{commandEntries}from"./contracts/cli.js";export const SURFACE_NOTES={authority:"documentation is not permission; legacy entries remain advisory",flags:"flags are intended per command and may use a global parser vocabulary",reasons:"curated, not exhaustive — the runtime `reason` field is the truth; ignore tokens you do not recognize",database:"local database commands wait up to 15 seconds for another writer; an exhausted wait returns database-busy and names the selected file"},SURFACE_SCHEMA_VERSION=1;const jsonFlag={name:"json",takesValue:!1,meaning:"answer with one machine envelope on stdout"},keyFlag={name:"key",takesValue:!0,meaning:"idempotency key — retry with the same key to get the first answer back"},dbFlag={name:"db",takesValue:!0,meaning:"path to the database file (defaults to the installation's)"},repoFlag={name:"repo",takesValue:!0,meaning:"which repository (repeatable where a command watches several)"},operator=(invocation,synopsis)=>({invocation,synopsis,audience:"operator",agentMayInvoke:!1,mutation:"unkeyed"}),operatorRead=(invocation,synopsis)=>({invocation,synopsis,audience:"operator",agentMayInvoke:!1,mutation:"none"}),GUIDE_ROWS=[{invocation:"",envelopeCommand:"scan",synopsis:"report what is in flight (the no-verb default; scans below the working directory or the connected repositories)",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"path",required:!1,meaning:"directories to scan instead of the connected set"}],flags:[jsonFlag,{name:"all",takesValue:!1,meaning:"ignore connected repos; scan everything discoverable"},{name:"local",takesValue:!1,meaning:"branches only — no network"}]},{invocation:"pulls",synopsis:"report what is waiting on a person",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag]},{invocation:"graph",synopsis:"report which work graph is already here",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag]},{invocation:"repos",synopsis:"list connected repositories",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag]},operator("proposals","what coordinators proposed over the MCP gateway — list, confirm <id> [--yes], dismiss <id>; confirming runs the plane's own door under your password"),operator("chat","talk to your lead: one conversation across every project; --say sends one message; --follow enables crew updates and --no-follow pauses them; proposals keep their approval requirements"),{invocation:"repos add",synopsis:"add a project: a Git repository, in the console at once; the lead adds with its token; --remote records or replaces its trusted remote",audience:"agent",agentMayInvoke:!0,mutation:"unkeyed",positionals:[{name:"path",required:!1,meaning:"the repository (default: the one you are in)"}],flags:[jsonFlag,{name:"token",takesValue:!0,meaning:"the lead token (or TOOLROLL_LEAD_TOKEN)"},{name:"remote",takesValue:!0,meaning:"an HTTPS or SSH URL without credentials whose main may complete landed work; replaces a different recorded one (owner or an instance operator's lead only)"}],notableReasons:["not-git","unavailable","refused","locked"]},{invocation:"repos remove",synopsis:"remove a project from the console and the builder; its tasks and results stay saved",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",positionals:[{name:"path",required:!0,meaning:"the repository"}],flags:[jsonFlag,{name:"token",takesValue:!0,meaning:"the lead token (or TOOLROLL_LEAD_TOKEN)"}],notableReasons:["refused","locked"]},operator("repos add-from-github","preview, clone from GitHub, and connect - the console onboarding ceremony as a CLI verb"),{invocation:"contract",synopsis:"the machine contract: envelope version + capability tokens; --commands dumps this guide",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,{name:"commands",takesValue:!1,meaning:"dump the declared command guide"}]},...["list","install","update","rollback","remove","validate"].map(verb=>({invocation:`plugin ${verb}`,synopsis:{list:"list installed plug-ins",install:"install skills from a GitHub URL or folder",update:"update GitHub plug-ins or reload local folders",rollback:"restore a plug-in's previous version",remove:"remove a plug-in from the active library",validate:"validate a local folder without installing it"}[verb],audience:verb==="list"||verb==="validate"?"agent":"operator",agentMayInvoke:verb==="list"||verb==="validate",mutation:verb==="list"||verb==="validate"?"none":"unkeyed",flags:[jsonFlag,dbFlag],...verb==="list"?{}:{positionals:[{name:verb==="install"?"github-url|folder":verb==="validate"?"folder":"id",required:verb!=="update",meaning:"plug-in source or installed id"}]}})),{invocation:"skills list",synopsis:"name the guides this exact binary serves",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag]},{invocation:"skills get",synopsis:"print one guide's markdown (raw on stdout; --json wraps it)",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"name",required:!0,meaning:"a guide name from `skills list`"}],flags:[jsonFlag],notableReasons:["unknown-skill","usage"]},{invocation:"skills install",synopsis:"install or refresh this binary's Toolroll guides for Claude Code; without --claude-code, write the repository-local Agent Skills entry",audience:"operator",agentMayInvoke:!1,mutation:"identity-idempotent",flags:[jsonFlag,{name:"claude-code",takesValue:!1,meaning:"install the user-level Claude Code skill"},{name:"dir",takesValue:!0,meaning:"skill directory (default: ~/.claude/skills/toolroll)"},{name:"yes",takesValue:!1,meaning:"write the previewed files"},{name:"repo",takesValue:!0,meaning:"repository for the existing project-local install"},{name:"write-context",takesValue:!1,meaning:"also add the managed AGENTS.md block for a project-local install"}],notableReasons:["unconfirmed","foreign-file","usage"]},operator("link","put toolroll on PATH"),operator("unlink","take it off PATH"),operator("update","update to the latest release: verified provenance, drained work, backup, rehearsal, health check, automatic restore; --rollback undoes it"),{invocation:"release",synopsis:"release Toolroll itself from a branch: gate the exact commit, wait for the owner's approval, check, complete, deploy, merge, tag, publish, Homebrew; rerun to resume",audience:"operator",agentMayInvoke:!1,mutation:"unkeyed",positionals:[{name:"branch",required:!0,meaning:"the pushed branch with an open pull request"}],flags:[jsonFlag,{name:"repo",takesValue:!0,meaning:"the gate checkout the release check runs in (default: this checkout)"},{name:"new",takesValue:!1,meaning:"release a new commit on the branch, setting the earlier unfinished release aside"},{name:"limit",takesValue:!0,meaning:"<step>=<minutes>: one waiting step's time limit"},{name:"tap",takesValue:!0,meaning:"the Homebrew tap, owner/name"},{name:"release-gate",takesValue:!0,meaning:"<id>: show why an update pause left before a deployment's swap is safe to lift"},{name:"yes",takesValue:!1,meaning:"with --release-gate: lift that one pause once it is proved; with --recover-deploy: recover"},{name:"recover-deploy",takesValue:!1,meaning:"put back a deployment that stopped half way: stop only its own proved leftovers, restart the previous service, lift the pause"},{name:"stage",takesValue:!0,meaning:"with --recover-deploy: the deployment's staging folder"}],notableReasons:["usage","ambiguous","drift","timeout","check-failed","ci-failed","tree-mismatch","conflict","mixed-runtime","gate-held","after-swap"]},operator("demo","a seeded throwaway sandbox"),...KNOWLEDGE_DESCRIPTORS.map(spec=>({invocation:`knowledge ${spec.action}`,synopsis:spec.synopsis,audience:"audience"in spec?spec.audience:"agent",agentMayInvoke:!("audience"in spec),mutation:spec.mutation,flags:spec.flags,...spec.takesQuery?{positionals:[{name:"query",required:!0,meaning:"search text or source file for impact"}]}:{}})),...MEMORY_DESCRIPTORS.map(spec=>({invocation:`memory ${spec.action}`,synopsis:spec.synopsis,audience:"audience"in spec?spec.audience:"agent",agentMayInvoke:!("audience"in spec),mutation:spec.mutation,flags:spec.flags,...spec.takesQuery?{positionals:[{name:"query",required:!0,meaning:"search text, a decision id, or the decision sentence"}]}:{}})),{invocation:CARD_DESCRIPTOR.invocation,synopsis:CARD_DESCRIPTOR.synopsis,audience:"agent",agentMayInvoke:!0,mutation:"none",flags:CARD_DESCRIPTOR.flags,positionals:[{name:"source",required:!0,meaning:"which data to show"}]},{invocation:"card list",synopsis:"list registered declarative TUI panels (~/.toolroll/panels.toml) and their live card previews (read only)",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,{name:"list",takesValue:!1,meaning:"list registered declarative panels"}]},{invocation:"card remove",synopsis:"remove a declarative TUI panel from ~/.toolroll/panels.toml by id",audience:"operator",agentMayInvoke:!1,mutation:"identity-idempotent",positionals:[{name:"id",required:!0,meaning:"panel id slug to remove"}],flags:[jsonFlag,{name:"remove",takesValue:!0,meaning:"panel id slug to remove"}]},...FLAKY_DESCRIPTORS.map(spec=>({invocation:`flaky ${spec.action}`,synopsis:spec.synopsis,audience:"agent",agentMayInvoke:!0,mutation:spec.mutation,flags:spec.flags,...spec.takesQuery?{positionals:[{name:"identity",required:!0,meaning:"a row's key from flaky list"}]}:{}})),...FLOWS_DESCRIPTORS.map(spec=>({invocation:`flows ${spec.action}`,synopsis:spec.synopsis,audience:"audience"in spec?spec.audience:"agent",agentMayInvoke:!("audience"in spec),mutation:spec.mutation,flags:spec.flags,..."positionals"in spec?{positionals:spec.positionals.map(name=>({name,required:!0,meaning:name==="flow"?"a flow id from flows list":name==="card"?"a card id from flows show":name==="on|off"?"on signs the grant, off revokes it":"a trigger id from flows show, or for trigger add its settings as JSON, a JSON file, or -"}))}:{}})),...MAP_DESCRIPTORS.map(spec=>({invocation:spec.action===""?"map":`map ${spec.action}`,synopsis:spec.synopsis,audience:"audience"in spec?spec.audience:"agent",agentMayInvoke:!("audience"in spec),mutation:spec.mutation,flags:spec.flags,...spec.positional===null?{}:{positionals:[{name:"target",required:!0,meaning:spec.positional}]}})),...MODELS_DESCRIPTORS.map(spec=>({invocation:`models ${spec.action}`,synopsis:spec.synopsis,audience:"agent",agentMayInvoke:!0,mutation:spec.mutation,flags:spec.flags,...spec.takesQuery?{positionals:[{name:"target",required:!0,meaning:"positional"in spec?spec.positional:"the CLI to update, or on/off"}]}:{}})),{invocation:"status",synopsis:"running work, queued reasons, results to review, the latest release check and plan windows",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"health",synopsis:"recent server latency, event-loop delay, SQLite writes and live streams from the saved connection; instance operators only",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,{name:"profile",takesValue:!0,meaning:"saved server connection"}]},{invocation:"integrations",synopsis:"every integration as Connected, Not set up or Broken, with its last success and error, what uses it and what to do; --saved skips new checks; never a secret",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag,{name:"saved",takesValue:!1,meaning:"show the last checks without checking again"}]},{invocation:"ready",synopsis:"what could be dispatched right now (rows carry reservedFor)",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"brief",synopsis:"the lead's catch-up from the local database; --history selects the older operational report",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"gaps",synopsis:"requirement gaps blocking dispatch",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag,repoFlag]},{invocation:"grants",synopsis:"list authority grants",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"audit",synopsis:"what people did on this server with their API tokens, newest first: when, who, which token, from the CLI (api) or an agent (mcp), the command or tool, the project and the outcome (ok, refused, error); an approver sees everyone in their projects, anyone else only themselves",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag,{name:"person",takesValue:!0,meaning:"only this person's actions"},{name:"token",takesValue:!0,meaning:"only actions with the token of this name (on the server's own machine)"},{name:"token-name",takesValue:!0,meaning:"the same, where --token would be a credential (remotely)"},{name:"source",takesValue:!0,meaning:"api (the CLI) or mcp (an agent)"},{name:"since",takesValue:!0,meaning:"only the last N days, as Nd (7d)"},{name:"limit",takesValue:!0,meaning:"actions per page (default 20, at most 100)"},{name:"cursor",takesValue:!0,meaning:"the nextCursor of the previous page"}]},{invocation:"sync",synopsis:"refresh external-tracker mirrors and deliver write-backs — safe to run; fails closed",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",flags:[jsonFlag,dbFlag,repoFlag],notableReasons:["no-op","external"]},{invocation:"task add",synopsis:"queue work",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"title",required:!0,meaning:"one line of what to do"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"goal",takesValue:!0,meaning:"what to accomplish; also the manual-review acceptance criterion"},{name:"body",takesValue:!0,meaning:"alias for --goal"},{name:"plan",takesValue:!1,meaning:"request a plan before coding"},{name:"just-code",takesValue:!1,meaning:"skip planning"},{name:"backend",takesValue:!0,meaning:"external tracker (title only)"},{name:"id",takesValue:!0,meaning:"choose the task id"},{name:"repo",takesValue:!0,meaning:"which repository the task belongs to"},{name:"report",takesValue:!1,meaning:"a scout task: the deliverable is a report, never a branch"},{name:"replaces",takesValue:!0,meaning:'the task this one replaces: it is cancelled and reads "Replaced by <id>"'},{name:"token",takesValue:!0,meaning:"a lead token: filed as the lead, so it pings nobody"},{name:"checks",takesValue:!0,meaning:`quick|full|off: this task's checks, overriding the project's level ("skip the tests" is off)`}],notableReasons:["duplicate","usage","unknown-task","unauthenticated"]},{invocation:"task new",synopsis:"start a small task at a terminal: shows the exact terms, then Build now? is your approval",audience:"operator",agentMayInvoke:!1,mutation:"unkeyed",positionals:[{name:"words",required:!1,meaning:"what should change"}],flags:[dbFlag,{name:"repo",takesValue:!0,meaning:"the project"},{name:"as",takesValue:!0,meaning:"the approver"},{name:"token",takesValue:!0,meaning:"their password"},{name:"from",takesValue:!0,meaning:"a github.com issue or pull request of this project: quoted, then filed for your approval"},{name:"preview",takesValue:!1,meaning:"the terminal UI's own: the exact terms, nothing started"},{name:"build",takesValue:!0,meaning:"the terminal UI's own: Build on those terms"},{name:"digest",takesValue:!0,meaning:"the terms the person read"}],notableReasons:["person-only","usage"]},{invocation:"task keep",synopsis:"a fast start that grew: propose a plan for its exact commit, for you to approve",audience:"operator",agentMayInvoke:!1,mutation:"unkeyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,{name:"as",takesValue:!0,meaning:"the approver"},{name:"token",takesValue:!0,meaning:"their password"}],notableReasons:["usage","refused"]},{invocation:"task ask",synopsis:"hand a task to a person: one message saying why, and the task is theirs",audience:"agent",agentMayInvoke:!0,mutation:"unkeyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,{name:"person",takesValue:!0,meaning:"who to ask (someone who can see the task's project)"},{name:"why",takesValue:!0,meaning:"what they need to do, one line"},{name:"token",takesValue:!0,meaning:"the lead token (or TOOLROLL_LEAD_TOKEN)"}],notableReasons:["unknown-task","unknown-person","unplaced","unauthenticated"]},{invocation:"task checks",synopsis:"run checks on the task's latest result, on its exact commit, now; a pass upgrades its status and a failure stays visible",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",positionals:[{name:"task",required:!0,meaning:"any version of the task"}],flags:[jsonFlag,dbFlag,{name:"level",takesValue:!0,meaning:"quick (default) or full"}],notableReasons:["no-result","no-check","checks-failed"]},{invocation:"task ship",synopsis:"the task's pull request checks as last observed for its head: each check's state and how long it took",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"task",required:!0,meaning:"any version of the task"}],flags:[jsonFlag,dbFlag],notableReasons:["unknown-task","no-pull-request"]},{invocation:"task ready",synopsis:"Can I merge? The task's checklist from Toolroll's records, each blocker with the act that clears it (Run checks, Retry, Ask the agent to fix)",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"task",required:!0,meaning:"any version of the task"}],flags:[jsonFlag,dbFlag],notableReasons:["unknown-task"]},{invocation:"task add-tests",synopsis:"file a small task to write tests for the task's latest change; it waits for approval like any task",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",positionals:[{name:"task",required:!0,meaning:"any version of the task"}],flags:[jsonFlag,dbFlag],notableReasons:["no-result"]},{invocation:"task list",synopsis:"a page of saved task status",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag,{name:"state",takesValue:!0,meaning:"queued|running|done|failed|cancelled"},{name:"view",takesValue:!0,meaning:"all|needs-you|running|completed|archived"},{name:"limit",takesValue:!0,meaning:"page size, 1–100; default 40"},{name:"cursor",takesValue:!0,meaning:"nextCursor from the previous response"},{name:"repo",takesValue:!0,meaning:"filter to one project"}]},{invocation:"task show",synopsis:"one task in full",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag],notableReasons:["unknown-task"]},{invocation:"check-progress",synopsis:"current or final approved check progress",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"run",required:!0,meaning:"the build run"}],flags:[jsonFlag,dbFlag],notableReasons:["unknown-run","no-progress"]},{invocation:"task wait",synopsis:"wait for the current attempt to finish or need a person",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,{name:"timeout",takesValue:!0,meaning:"stop waiting after this many seconds"}],notableReasons:["unknown-task","timeout","failed","needs-person"]},{invocation:"project show",synopsis:"show the saved local project and optional credential-file reference",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"project use",synopsis:"select an exact saved checkout; grants no project or execution authority",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",positionals:[{name:"path",required:!0,meaning:"exact saved project checkout path"}],flags:[jsonFlag,dbFlag,{name:"token-file",takesValue:!0,meaning:"optional existing scoped coordinator credential file; saves only its path"}]},...["complete","revise"].map(action=>({invocation:`task ${action}`,synopsis:action==="complete"?"mark the exact inspected result complete; checks and permissions remain unchanged":"request a same-task revision using explicit feedback; existing approval terms apply",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",positionals:[{name:"task",required:!0,meaning:"task or assignment id"}],flags:[jsonFlag,dbFlag,{name:"token-env",takesValue:!0,meaning:"scoped coordinator credential environment variable"},{name:"token-file",takesValue:!0,meaning:"scoped coordinator credential file; defaults to selected project reference"},...action==="complete"?[{name:"digest",takesValue:!0,meaning:"exact receipt from assignment show; required for JSON or scoped agents"},{name:"pull-request",takesValue:!1,meaning:"also open the result's pull request from that commit, as the console's Complete does; an approver's sign-in (--as/--token), never a scoped credential; refuses with pull-requests-off and the setup command"},{name:"run",takesValue:!0,meaning:"the terminal's local owner: the exact build of the result read; required there with --digest"},{name:"checked",takesValue:!1,meaning:"the terminal's local owner: you checked the result yourself; required when it owes your own check"},{name:"reason",takesValue:!0,meaning:"the terminal's local owner: why you accept a result whose requirement isn't shown; required for an exception"}]:[{name:"feedback",takesValue:!0,meaning:"specific requested change"},{name:"run",takesValue:!0,meaning:"exact result run; defaults to current result"},{name:"source",takesValue:!0,meaning:"exact scope digest; defaults to current terms"},{name:"key",takesValue:!0,meaning:"32 hexadecimal characters for exact replay; defaults to a stable feedback identity"}]]})),{invocation:"task merge",synopsis:"merge the task's pull request once its checks pass — the console's Merge, behind the approver's password; the project's method (squash by default), branch deleted, recorded in the ledger",audience:"operator",agentMayInvoke:!1,mutation:"identity-idempotent",positionals:[{name:"task",required:!0,meaning:"any version of the task"}],flags:[jsonFlag,dbFlag,{name:"as",takesValue:!0,meaning:"the approver merging"},{name:"token",takesValue:!0,meaning:"their password"},{name:"anyway",takesValue:!1,meaning:"merge a Quick or Off result without waiting for its full check"}],notableReasons:["usage","not-an-approver","full-checks"]},...["show","updates","claim","check","brief","inbox","ack"].map(action=>({invocation:`assignment ${action}`,synopsis:action==="show"?"read the root, current work, owner and exact receipt":action==="updates"?"read the history of handoffs sent to people after a cursor; delivers nothing — receive updates with assignment inbox":action==="claim"?`record lead ownership; with the lead token the task reads "<the lead's name> is on it" and leaves Needs you until done, handed over, or 2 hours idle; grants no approval or execution authority`:action==="brief"?"catch up from current assignments and project knowledge in the local database":action==="inbox"?"receive or replay a saved batch of lead status updates":action==="ack"?"acknowledge delivery of an inbox batch; leaves task completion unchanged":"acknowledge the exact ready receipt as its lead; accepts no proof and deploys nothing",audience:"agent",agentMayInvoke:!0,mutation:action==="claim"||action==="check"||action==="inbox"||action==="ack"?"identity-idempotent":"none",...["show","claim","check"].includes(action)?{positionals:[{name:"task",required:!0,meaning:"any task in the assignment's existing correction chain"}]}:{},flags:[jsonFlag,dbFlag,{name:"token-env",takesValue:!0,meaning:"explicit environment variable containing a coordinator token; required for claim/check/inbox/ack unless token-file is used"},{name:"token-file",takesValue:!0,meaning:"explicit coordinator token file; cannot be combined with token-env"},...action==="updates"?[{name:"after",takesValue:!0,meaning:"last processed admitted update cursor; defaults to 0"},{name:"limit",takesValue:!0,meaning:"page size from 1 to 100; defaults to 50"}]:[],...action==="check"?[{name:"digest",takesValue:!0,meaning:"exact current receipt digest from assignment show"}]:[],...action==="brief"?[{name:"repo",takesValue:!0,meaning:"project to include within the credential's access"},{name:"limit",takesValue:!0,meaning:"assignment count from 1 to 25; defaults to 10"}]:[],...action==="inbox"||action==="ack"?[{name:"consumer",takesValue:!0,meaning:"stable lowercase name for this lead's delivery cursor"}]:[],...action==="inbox"?[{name:"limit",takesValue:!0,meaning:"batch size from 1 to 100; defaults to 10"}]:[],...action==="ack"?[{name:"batch",takesValue:!0,meaning:"exact batch ID returned by assignment inbox"}]:[]]})),operator("task state","set a task's state by hand — an operator correction, not a workflow step (--replaced-by <id> with cancelled)"),operator("lead token","mint the lead's credential behind your password (--revoke ends it): its own work pings nobody"),{invocation:"lead say",synopsis:"as the lead: one short message in its person's chat under the lead's name (Settings → Lead); several within two minutes are one message",audience:"agent",agentMayInvoke:!0,mutation:"unkeyed",positionals:[{name:"text",required:!0,meaning:"one short line in plain words"}],flags:[jsonFlag,dbFlag,{name:"task",takesValue:!0,meaning:"the task it is about"},{name:"token",takesValue:!0,meaning:"the lead token (or TOOLROLL_LEAD_TOKEN)"}],notableReasons:["usage","unknown-task","unauthenticated"]},{invocation:"task block",synopsis:"make one task wait for another",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the waiting task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"on",takesValue:!0,meaning:"the blocker's id"}],notableReasons:["unknown-task"]},{invocation:"task unblock",synopsis:"stop waiting",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the waiting task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"on",takesValue:!0,meaning:"the blocker's id"}],notableReasons:["unknown-task"]},{invocation:"task next",synopsis:"move a task to the front of ITS queue (scheduling only; approval still required)",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"undo",takesValue:!1,meaning:"back to filing order"}],notableReasons:["unknown-task","claimed"]},operator("task steer","one credentialed note for the task's agent — a running Claude build gets it in seconds, another running build reads it when it next checks for notes, otherwise the next attempt does; --now pauses the running Claude build first; steering speaks with the operator's voice"),{invocation:"task log",synopsis:"tail a task's live or finished agent output (--follow, --sub, --lines)",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,{name:"follow",takesValue:!1,meaning:"stream appended output while running"},{name:"sub",takesValue:!1,meaning:"read subagent helper output"},{name:"lines",takesValue:!0,meaning:"maximum trailing lines to display"}],notableReasons:["unknown-task","usage"]},{invocation:"task send",synopsis:"send a live message or steering note directly to a task's agent",audience:"operator",agentMayInvoke:!1,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"},{name:"note",required:!0,meaning:"message for the agent"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"note",takesValue:!0,meaning:"message text (optional if given positionally)"}],notableReasons:["unknown-task","task-finished","usage"]},{invocation:"task handoff",synopsis:"hand a task's live worktree and compact Handoff Packet to another coding agent",audience:"operator",agentMayInvoke:!1,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"to",takesValue:!0,meaning:"target agent provider (claude, codex, gemini, ...)"},{name:"model",takesValue:!0,meaning:"optional target model id"},{name:"note",takesValue:!0,meaning:"handoff instructions for the receiving agent"}],notableReasons:["unknown-task","invalid-agent","task-finished","usage"]},{invocation:"task attach",synopsis:"attach to a task's active run, worktree status, and live output stream",audience:"operator",agentMayInvoke:!1,mutation:"none",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,{name:"lines",takesValue:!0,meaning:"initial trailing lines to display"}],notableReasons:["unknown-task","usage"]},operator("task pause","stop a running Claude build's current turn and keep the build (--run <id> names the attempt): its next note continues it; never a stop"),operator("task continue","resume a paused Claude build where it stopped, without a note (--run <id> names the attempt)"),{invocation:"task assign",synopsis:"reserve a task for one worker, or return it to the shared queue",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"runner",takesValue:!0,meaning:"the worker to reserve for"},{name:"anyone",takesValue:!1,meaning:"back to the shared queue"}],notableReasons:["unknown-task","claimed"]},{invocation:"task scope",synopsis:"state what success is; approval binds to this exact statement",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"goal",takesValue:!0,meaning:"what success is"},{name:"acceptance",takesValue:!0,meaning:"required: <statement>|<evidence,kinds> (check,screenshot,changed-path,manual-review); separate criteria with semicolons"},{name:"not",takesValue:!0,meaning:"explicitly out of scope"},{name:"touches",takesValue:!0,meaning:"comma-separated paths this may change"},{name:"budget-usd",takesValue:!0,meaning:"spend ceiling for the build"}],notableReasons:["unknown-task"]},{invocation:"task plan",synopsis:"ask for a plan document (a planning session drafts; a person approves)",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"provider",takesValue:!0,meaning:"pin which provider plans THIS task (plan phase only)"},{name:"model",takesValue:!0,meaning:"the pinned plan model, riding --provider"},{name:"digest",takesValue:!0,meaning:"the terminal's local owner: the exact planning source read; required there, and --provider/--model are refused"},{name:"incident",takesValue:!0,meaning:"the terminal's local owner: plan again after this planning incident (the plan failed its checks)"}],notableReasons:["unknown-task"]},{invocation:"task hold",synopsis:"park a task with a reason",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"reason",takesValue:!0,meaning:"why it waits"},{name:"until",takesValue:!0,meaning:"ISO time to resurface"}],notableReasons:["unknown-task","held"]},{invocation:"task unhold",synopsis:"release a hold",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag],notableReasons:["unknown-task","not-yours"]},{invocation:"task require",synopsis:"name the capabilities a task needs before dispatch",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"require",takesValue:!0,meaning:"comma-separated capability keys"}],notableReasons:["unknown-task"]},operator("task approve","the yes — nothing builds without one; binds to the scope digest"),operator("task requeue","exit a stall: incidents resolved, strikes cleared, queued again"),operator("task regate","explicitly rerun the approved check on the last exact commit — no agent or automatic retry"),{invocation:"task review",synopsis:"read a task's compact result packet with --brief, or a run's automatic findings without it",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"id",required:!0,meaning:"task id with --brief; run id otherwise"}],flags:[jsonFlag,dbFlag,{name:"brief",takesValue:!1,meaning:"saved conclusion, changed files, checks, findings, screenshots, plan and next actions; missing fields say not recorded"},{name:"run",takesValue:!0,meaning:"with --brief, select an exact finished attempt instead of the latest"},{name:"all",takesValue:!1,meaning:"include LOW findings within the compact packet's limit; extra findings are counted"},{name:"token",takesValue:!0,meaning:"the lead token (or TOOLROLL_LEAD_TOKEN)"}],notableReasons:["usage","unauthenticated","not-found"]},{...operator("task accept",`accept a result: --finish (or --digest <receipt>) is exactly task complete's completion of the exact receipt; --despite "<reason>" records an acceptance with limitations and never completes; a bare call refuses`),positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,{name:"finish",takesValue:!1,meaning:"accept the result and finish the task: task complete's exact-receipt completion; --json and scoped agents pass --digest"},{name:"digest",takesValue:!0,meaning:"the exact receipt from assignment show; accepts and finishes exactly that result"},{name:"despite",takesValue:!0,meaning:"accept with this reason, without finishing; never combines with --finish or --digest (--note is its alias)"}],notableReasons:["usage","unknown-task","no-run","not-ready"]},{...operator("task land","put accepted work on the project's own branch when it has no pull requests: bare shows exactly what lands where; --yes --key <preview-key> lands it as one new commit on top; --undo reverts that commit with a new one"),positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,{name:"into",takesValue:!0,meaning:"land on this branch instead of the recorded one (the yes records it)"},{name:"undo",takesValue:!1,meaning:"revert the landing with a new commit on the branch"},{name:"yes",takesValue:!1,meaning:"land it; needs --key"},{name:"key",takesValue:!0,meaning:"the key the bare call showed: what lands is what you read"}],notableReasons:["usage","not-complete","checks","dirty","moved","occupied","stale"]},operator("task repair","inspect or approve a repair draft; --yes starts the repair a failed check is waiting for, under the normal plan approval"),operatorRead("task handover","where a task stands, from Toolroll's records: revision, decisions, rejected approaches, open findings, checks and the next action"),operator("task before-after","before-and-after evidence: read it, save a failing result, or rerun the same check on the latest commit with no agent"),operator("task failing-first","ask a bug fix's next attempt to write a failing test first (on|off); shown in the result as the agent's report"),operatorRead("finding list","findings still waiting on someone, or every finding of --task <id>"),operatorRead("finding show","one finding: its text, evidence and how it stands"),operator("finding send","send a finding to the task that owns the code; the owner must accept it or reject it with a reason"),operator("finding resend","send an answered finding back, one more round; past the limit it goes to a person"),operator("finding close","a person's decision on a finding"),operatorRead("captures list","what providers said when attempts failed, the ones mentioning limits first; nothing routes on these"),operatorRead("captures show","one saved provider failure"),operatorRead("captures export","one saved provider failure as a fixture"),operator("captures mark","a person's reading of a capture: exhausted or not-exhausted"),operator("task route","which configured agents plan, build and repair this task; phase and size changes require renewed approval"),operator("task reopen","resume external work its tracker closed and has been SEEN open again"),operator("task stop","stop ONE exact live attempt (--run <id>): durable before any process is signalled, answers 'stopping' until its own processes are established gone; work, branch, and evidence preserved; no strike, no retry"),{...operator("task archive","put tasks away (a person's act): out of every list, count and nudge, history and approvals kept; nothing claims, approves or dispatches them until restored"),positionals:[{name:"id",required:!0,meaning:"one or more tasks (any version: the whole family goes)"}],flags:[jsonFlag,dbFlag,{name:"reason",takesValue:!0,meaning:"why, shown on the task page"}],notableReasons:["unknown-task","not-an-approver"]},{...operator("task restore","bring put-away tasks back exactly as they were (a person's act)"),positionals:[{name:"id",required:!0,meaning:"one or more put-away tasks"}],flags:[jsonFlag,dbFlag],notableReasons:["unknown-task","not-an-approver"]},{...operator("task tidy","Put away old tasks: --preview lists what would go and why (read-only), --apply --digest <d> puts away exactly that list (a person's act)"),flags:[jsonFlag,dbFlag,{name:"preview",takesValue:!1,meaning:"show the list and the digest; changes nothing"},{name:"apply",takesValue:!1,meaning:"put away exactly the previewed list (needs --digest)"},{name:"digest",takesValue:!0,meaning:"the digest --preview printed"},{name:"days",takesValue:!0,meaning:"also finished tasks untouched this many days (1–365, default 14)"},{name:"except",takesValue:!0,meaning:"comma-separated tasks from the list to leave out"}],notableReasons:["usage","not-an-approver","empty"]},operator("run settle","have Toolroll check again whether a finished run stopped: it looks at this computer's processes itself, stops only leftovers proven the run's, and settles the run when none is left (nobody vouches; --why is ignored)"),operator("task resume","resume the exact stopped attempt (--run <id>): refuses until it is quiescent, lifts only that stop's hold, approves nothing — the next pass re-proves the scope and inherits the draft with fresh proof"),{invocation:"claim",synopsis:"take one ready, approved task; answers with a lease",audience:"agent",agentMayInvoke:!0,mutation:"keyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,keyFlag,{name:"runner",takesValue:!0,meaning:"your registered worker name"},{name:"token",takesValue:!0,meaning:"the worker's token"},{name:"ttl",takesValue:!0,meaning:"lease seconds"}],notableReasons:["held","fenced","unapproved","reserved","external","claimed","not-ready","closed"]},{invocation:"heartbeat",synopsis:"still working; extends the lease",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",positionals:[{name:"lease",required:!0,meaning:"the lease id"}],flags:[jsonFlag,dbFlag],notableReasons:["not-leased","fenced","closed"]},{invocation:"worker release",synopsis:"done with it; fenced if superseded",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",positionals:[{name:"lease",required:!0,meaning:"the lease id"}],flags:[jsonFlag,dbFlag],notableReasons:["not-leased","fenced"]},{invocation:"reap",synopsis:"release every lease that ran out",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",flags:[jsonFlag,dbFlag]},{invocation:"tick",synopsis:"one unattended pass: claim, build in a leased worktree, commit to a branch — never pushes",audience:"agent",agentMayInvoke:!0,mutation:"unkeyed",flags:[jsonFlag,dbFlag,repoFlag,{name:"runner",takesValue:!0,meaning:"your registered worker name"},{name:"token",takesValue:!0,meaning:"the worker's token"},{name:"max",takesValue:!0,meaning:"tasks this pass (default 1)"},{name:"base",takesValue:!0,meaning:"base ref for first attempts"}],notableReasons:["empty","fenced"]},{invocation:"build",synopsis:"build one claimed task directly (the piece tick automates)",audience:"agent",agentMayInvoke:!0,mutation:"unkeyed",positionals:[{name:"id",required:!0,meaning:"the task"}],flags:[jsonFlag,dbFlag,repoFlag],notableReasons:["not-leased","unapproved"]},{invocation:"reconcile",synopsis:"recover what the last stretch left behind — safe to repeat",audience:"agent",agentMayInvoke:!0,mutation:"identity-idempotent",flags:[jsonFlag,dbFlag,repoFlag]},{invocation:"runner list",synopsis:"registered workers",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"coordinator list",synopsis:"MCP filing credentials and their limits",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"approver list",synopsis:"who can say yes (names only)",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"cap list",synopsis:"recorded capabilities",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag,repoFlag]},{invocation:"outbox list",synopsis:"queued notifications",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"incident list",synopsis:"open incidents",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"config show",synopsis:"phase and spend configuration",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag,repoFlag]},{invocation:"setup show",synopsis:"installation setup",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"verify show",synopsis:"the repository's check level, its approved full and quick commands, and a suggested quick command",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag,repoFlag]},{invocation:"intake show",synopsis:"intake configuration",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"providers",synopsis:"which agent providers this binary can drive, and their transports; --report records this machine's readiness under its runner",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,{name:"report",takesValue:!1,meaning:"record readiness observations under --runner"},{name:"runner",takesValue:!0,meaning:"the registered worker name reporting"},{name:"token",takesValue:!0,meaning:"that worker's token"}]},{invocation:"template list",synopsis:"work templates: tasks and scheduled flows",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"template show",synopsis:"one template",audience:"agent",agentMayInvoke:!0,mutation:"none",positionals:[{name:"name",required:!0,meaning:"the template"}],flags:[jsonFlag,dbFlag]},{invocation:"webhook status",synopsis:"connected messaging services",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},{invocation:"publish status",synopsis:"publication and merge-grant state",audience:"agent",agentMayInvoke:!0,mutation:"none",flags:[jsonFlag,dbFlag]},operator("approver add","mint the credential that lets a person say yes"),operator("runner register","register a worker bound to its repositories; its token is shown once"),operator("runner retire","retire a worker"),operator("runner bind","replace which repositories a worker may build in"),operator("runner capacity","set how many tasks a worker runs at once; running work carries on, the new number applies at the next claim"),operator("project checks","show or set a project's batch checks (--batch on|off, off by default): results that finish within 10 minutes share one full check on a temporary batch commit; nothing is merged into a real branch"),operator("project check-access","show or set how far a project's checks reach: sandboxed (the default), with model and GitHub sign-ins, or not sandboxed; an instance operator widens it with a password typed now"),operator("project concurrency","set how many of a project's tasks build at once (default 2, never past the worker's capacity); running work carries on"),operator("coordinator mint","mint the MCP filing credential — repo-bound, rate-limited, token shown once"),operator("coordinator revoke","revoke an MCP filing credential"),operator("mcp","serve the MCP gateway over stdio — the coordinator credential is the only key it accepts"),operator("cap add","record a capability"),operator("outbox deliver","deliver queued notifications"),operator("peek","watch live agents in the terminal — one pane per open run; --tmux opens a window per run"),operator("incident resolve","resolve an incident"),operator("decide","read and ANSWER parked decisions — answering is a person's act"),operatorRead("keys status","which provider API keys are stored — never the values"),operator("keys set","store a provider's API key as a private file — piped or --key-file, never on the command line"),operator("keys clear","remove a stored provider key (kept only as a fallback; a subscription-mode provider is unaffected)"),operatorRead("keys verify","check a stored key against its provider live — spends no tokens"),operator("keys auth","choose subscription vs API key for a provider (subscription is the default; the key is kept as fallback)"),operatorRead("people list","everyone who can sign in, their standing, and the open invites"),operator("people invite","mint a single-use sign-in link for one person — their powers are pinned when you mint, never after"),operator("people projects","set a person's project access — selected project, all projects, or no projects"),operator("people revoke","end a person's access — their sessions, invites, and signed modes end with them; history stays"),operator("tokens create","make one of your API tokens: --name, --access read|act, --days 30|90|365, optional --projects a,b; your password at the prompt or --password-stdin; the token is shown once"),operatorRead("tokens list","your API tokens: name, access, projects, made, last used, expiry — never a secret; your password at the prompt or --password-stdin"),operator("tokens revoke","end one of your API tokens now, by name or id; your password at the prompt or --password-stdin"),operator("tokens rotate","replace one of your API tokens on the same terms; the old one works 10 more minutes (--overlap), then stops; the new one is shown once"),operatorRead("mode show","the repository's operating mode, in full — or 'locked' when none is signed"),operator("mode set","sign a per-repository operating mode (password ceremony; standard or hands-off, always expiring)"),operator("publish merge","say yes to ONE waiting merge — it fires only when CI is seen green on the exact commit you authorized"),operator("publish refire","recover a merge whose issued call went silent — re-enters the full merge road, never auto-retried"),operatorRead("review show","whether a project's finished builds get one automatic review"),operator("review on","one automatic review of each finished build whose check passes; only HIGH findings send it back, once"),operator("review off","finished builds go straight to the person, unreviewed"),operatorRead("chat-approval show","whether your own taps in your paired chat approve plans and merges: all projects and each project's own setting"),operator("chat-approval on","let your paired chat approve plans and merges in all your projects or one (--repo); lasting, with limits; previews until --yes"),operator("chat-approval off","stop approving from chat for all your projects or one (--repo); one step"),operator("mode revoke","revoke a repository's mode — one click, every act it covered falls back to its own ceremony"),operator("config set","set phase or spend configuration"),operator("config clear","clear phase or spend configuration"),operatorRead("thread list","your own interactive agent threads: each one's title, project and where it stands"),operatorRead("thread show","one of your threads: its latest turn, its end and its Ship, in Toolroll's words"),operator("thread end","end one of your threads for good (its agent stops; its work can still be shipped for a week)"),operator("thread remove","remove one of your threads' working copy (refused while its agent may run or a Ship is open)"),operator("thread ship","ship one of your threads' committed work: shows its terms, asks, then takes your password typed now"),operator("thread save","save one of your threads' committed work as the branch toolroll/code-<id> in its project (no pull request, no merge); says the git merge that puts it on your branch"),operator("setup clear","clear installation setup"),operator("verify set",'approve the one shell command the plane re-runs after every future commit (--quick "<cmd>" approves the fast check Quick runs); --self-heal binds one approved-setup replay when a required project executable is missing'),operator("verify clear","revoke a repository's approved verification command; --level quick revokes only the quick command"),operator("verify level","set a project's checks after each build: quick (the approved quick command), full, or off — an approver's act, in the ledger"),operator("intake grant","grant an intake source"),operator("intake run","run intake now"),operator("intake preview","preview what intake would file"),operator("intake pr-comments","intake review comments from a pull request"),operator("intake clear","clear intake configuration"),operator("webhook primary","choose which service receives alerts"),operator("bridge","the Telegram bridge (pairing, tokens, the follower)"),operator("enroll","grant a repository authority (backends, dispatch) — its own explicit yes"),operator("revoke","take an authority grant back"),operator("publish","the publication pass: push built branches, open pull requests, sweep merges"),operator("publish grant","grant publication or auto-merge authority"),operator("publish revoke","take a publication grant back"),operator("publish unblock","lift a repair's merge hold"),operator("publish rearm","re-arm a refused merge after fixing the named cause"),operator("serve","the operations console (HTTP)"),operatorRead("serve check-public","is this server ready on its --public-url? checks the URL, --allow-host, the console on --port, the certificate, HSTS and the proxy, and names each problem; sends no credentials"),operator("watch","the unattended loop, kept running"),operator("up","console + worker + browser, one command"),operator("onboard","add this repository, report signed-in agents, install or --remove the operator skill (--yes), offer the starter flows (--starter <ids>), and print the handoff"),operator("daemon","install the loop under the OS service manager"),operator("background on","keep this computer's Toolroll running: a login item that starts `up --laptop` when you log in; hands over from the `up` this terminal runs and puts everything back if the service doesn't answer (--port)"),operator("background off","stop running in the background: unloads and removes only Toolroll's own login item"),operatorRead("background show","whether Toolroll runs in the background here, whether it is running now, and any other service on this database"),operator("stop","stop this computer's Toolroll after its running work is saved: the background service (until the next login), or the `up` running in a terminal"),operator("open","open this computer's Toolroll at a terminal, signed in: the terminal UI, or the browser with --web (starts it first when it isn't running); never prints a sign-in link"),{...operatorRead("welcome","the three steps to a first result (agent, project, first task) as the console's welcome shows them; at a terminal it walks them one at a time"),flags:[jsonFlag,dbFlag]},{...operator("welcome sample","add the sample project (a tiny repository with one function and its test) in your projects folder, as this computer's password-free owner at a terminal: the console welcome's Try a sample project; takes no folder or name"),flags:[jsonFlag,dbFlag]},operator("password set","set this computer's first password, typed twice at your own terminal (never a flag, file or environment variable); every session signs in again and local mode stays on"),operator("password reset","reset a forgotten password at the computer running Toolroll, typed twice at your own terminal (the one approver, or --as <name>); every session of that account ends and a saved first password that no longer works is removed. Anyone who can run commands as you on this computer can do this, as they could read the saved file"),{...operatorRead("doctor","check that Toolroll's service holds no key, token or password a build could read; names what it finds and the steps to fix it, never a value, and changes nothing"),flags:[jsonFlag]}],REMOTE_NO=["plugin list","plugin install","plugin update","plugin rollback","plugin remove","plugin validate","task new","task keep","","pulls","graph","repos","repos add","repos remove","repos add-from-github","contract","skills list","skills get","skills install","link","unlink","update","release","demo","chat","project show","project use","brief","lead token","lead say","health","assignment show","assignment updates","assignment claim","assignment check","assignment brief","assignment inbox","assignment ack","claim","heartbeat","worker release","reap","tick","build","reconcile","runner register","runner retire","runner bind","runner capacity","coordinator mint","coordinator revoke","mcp","outbox deliver","peek","serve","serve check-public","watch","up","onboard","daemon","background on","background off","background show","stop","open","welcome","welcome sample","password set","password reset","doctor","bridge","setup show","setup clear","providers","keys status","keys set","keys clear","keys verify","keys auth","models check","models update","models watch","models results","models suggestions","models accept","models dismiss","models turn-off","models keep","models try","models stop","map on","map off","map holdout end","map report","thread list","thread show","thread end","thread remove","thread ship","thread save","publish","publish status","publish merge","publish refire","publish unblock","publish rearm","publish grant","publish revoke","enroll","revoke","flows import","flows trigger check","flows script save","flows browser","memory propose","card list","card remove"],REMOTE_FOLLOW_THROUGH=["task handover","task before-after","task failing-first","finding list","finding show","finding send","finding resend","finding close","captures list","captures show","captures export","captures mark"],REMOTE_STEP_UP=["proposals","decide","task regate","task approve","task accept","task merge","run settle","task archive","task restore","task tidy","task land","knowledge apply","memory decide","memory retire","memory apply","memory tidy","memory restore","memory unmerge","flows card approve","flows card send-back","flows script approve","flows unattended","approver list","approver add","people list","people invite","people projects","people revoke","tokens create","tokens list","tokens revoke","tokens rotate","mode show","mode set","mode revoke","chat-approval on","review on","review off","config set","config clear","verify set","verify clear","verify level","project checks","project check-access","project concurrency","intake grant","intake clear","webhook primary"],REMOTE_YES=["status","integrations","ready","gaps","grants","sync","audit","task add","task ask","task checks","task ship","task ready","task add-tests","task list","task show","check-progress","task wait","task complete","task revise","task state","task block","task unblock","task next","task steer","task pause","task continue","task assign","task scope","task plan","task hold","task unhold","task require","task requeue","task review","task repair","task route","task reopen","task stop","task resume","task log","task send","task handoff","task attach","runner list","coordinator list","cap list","cap add","outbox list","incident list","incident resolve","config show","verify show","intake show","intake run","intake preview","intake pr-comments","template list","template show","webhook status","review show","chat-approval show","chat-approval off","knowledge search","knowledge impact","knowledge refresh","map","map area","map file","map search","map refresh","memory search","memory decisions","memory show","memory review","memory status","flaky list","flaky show","card","flows list","flows show","flows export","flows create","flows edit","flows trigger add","flows trigger pause","flows trigger resume","flows trigger remove","flows card add","flows archive","models status","models list"];export const REMOTE_POLICY=new Map([...REMOTE_NO.map(invocation=>[invocation,"no"]),...REMOTE_FOLLOW_THROUGH.map(invocation=>[invocation,"no"]),...REMOTE_STEP_UP.map(invocation=>[invocation,"step-up"]),...REMOTE_YES.map(invocation=>[invocation,"yes"])]),REMOTE_POLICY_COUNT=REMOTE_NO.length+REMOTE_FOLLOW_THROUGH.length+REMOTE_STEP_UP.length+REMOTE_YES.length;const LOCAL_ALLOW={"plugin list":"read","plugin validate":"read","plugin install":"skill-library","plugin update":"skill-library","plugin rollback":"skill-library","plugin remove":"skill-library",pulls:"read",graph:"read",repos:"read",map:"read","map area":"read","map file":"read","map search":"read",status:"read",ready:"read",gaps:"read",contract:"read","skills list":"read","skills get":"read","flaky list":"read","flaky show":"read",card:"read","memory review":"read","memory status":"read","memory decisions":"read","memory show":"read","memory apply":"memory-review","memory tidy":"memory-review","memory restore":"memory-review","memory unmerge":"memory-review","task list":"read","task show":"read","task state":"read","task wait":"read","check-progress":"read","review show":"read",welcome:"read","task add":"file-task","task new":"build-now",chat:"lead-send","task steer":"lead-send","task approve":"approve-plan",decide:"answer-question","task stop":"stop-run","task pause":"pause-run","task hold":"pause-run","task resume":"resume-run","task continue":"resume-run","task unhold":"resume-run","task complete":"complete-task","task accept":"complete-task","task land":"land-task","task plan":"request-plan","task requeue":"retry-build","task revise":"request-revision","task archive":"archive-task","task restore":"archive-task","repos add":"add-project","welcome sample":"add-project","models suggestions":"read","models turn-off":"routing-turn-off","models dismiss":"dismiss-suggestion","models stop":"trial-stop","map on":"code-map-switch","map off":"code-map-switch","task send":"lead-send","task handoff":"change-task-agents","config set":"change-models","config clear":"change-models"};export const LOCAL_POLICY=new Map(GUIDE_ROWS.map(row=>[row.invocation,Object.prototype.hasOwnProperty.call(LOCAL_ALLOW,row.invocation)?{local:"allow",act:LOCAL_ALLOW[row.invocation]}:{local:"deny"}])),LOCAL_ALLOWED_INVOCATIONS=Object.keys(LOCAL_ALLOW),COMMAND_ENTRIES=commandEntries(GUIDE_ROWS.map(row=>({...row,remote:REMOTE_POLICY.get(row.invocation)??"no"}))),GUIDE_INVOCATIONS=GUIDE_ROWS.map(row=>row.invocation),COMMAND_GUIDE=COMMAND_ENTRIES.map(entry=>entry.guide);
package/dist/test-temp.js CHANGED
@@ -1 +1 @@
1
- import{execFile}from"node:child_process";import{lstatSync,readFileSync,readdirSync}from"node:fs";import{rm}from"node:fs/promises";import{tmpdir}from"node:os";import{dirname,join,resolve}from"node:path";const DAY_MS=864e5;export const OWNER_FILE=".toolroll-temp-owner";const TEST_TEMP_PREFIXES=["so-","standing-orders-","toolroll-","no-wt","epoch","cancel-floor","attest-","budgets-","chat-v66-","check-levels-","coding-context-","console-url-","console-v2-","e2-attest-","flow-goal-","flow-scratch","flows-chat-","invoke-attest-","knowledge-test-","learning-","peek-","phone-origin-","proposal-repo-","race-","refresh-migration-","refresh-refusal-","release-check-","shared-chat-","skills-test-","task-status-surfaces-","template-repo-","template-test-","v14-migrate-","v17-migrate-","watch-anchor-","needs-you-","deps-lock-","deps-state-","upgrade-fresh-","upgrade-path-","deploy-restore-","result-review-","one-result-page-","deploy-before-swap-","one-vocabulary-","accept-finishes-","lead-promises-","lead-people-","sizing-repo-","batch-checks-","deps-identity-","playwright_chromiumdev_profile-","playwright_firefoxdev_profile-","playwright-artifacts-"];export function tempOwner(path){try{const parsed=JSON.parse(readFileSync(join(path,OWNER_FILE),"utf8")),startedAt=typeof parsed.startedAt=="string"?Date.parse(parsed.startedAt):NaN;return Number.isSafeInteger(parsed.pid)&&Number(parsed.pid)>1&&Number.isFinite(startedAt)?{pid:Number(parsed.pid),startedAt}:null}catch{return null}}export function isTestTemp(name){return TEST_TEMP_PREFIXES.some(prefix=>name.startsWith(prefix))}export function tempRoots(){const roots=[tmpdir()];return process.platform!=="win32"&&!roots.includes("/tmp")&&roots.push("/tmp"),roots}function touchedAt(path){let newest=lstatSync(path).mtimeMs,names=[];try{names=readdirSync(path)}catch{return newest}for(const name of names)try{newest=Math.max(newest,lstatSync(join(path,name)).mtimeMs)}catch{}return newest}export function testTempFolders(roots,now){const all=[],seen=new Set;for(const root of roots){let names=[];try{names=readdirSync(root)}catch{continue}for(const name of names){if(!isTestTemp(name))continue;const path=join(root,name);try{const stat=lstatSync(path),key=`${stat.dev}:${stat.ino}`;if(seen.has(key)||stat.isSymbolicLink())continue;seen.add(key),all.push({path,touchedAt:stat.isDirectory()?touchedAt(path):stat.mtimeMs})}catch{}}}return{all,stale:all.filter(one=>now.getTime()-one.touchedAt>DAY_MS)}}export async function removeStaleTestTemp(roots,now,options={}){const removed=[],failed=[],stale=testTempFolders(roots,now).stale,max=options.max??1/0,inside=new Set(roots.map(root=>resolve(root)));for(const one of stale){if(removed.length+failed.length>=max)return{removed,failed,more:!0};await nextTurn();try{const stat=lstatSync(one.path);if(stat.isSymbolicLink()||!inside.has(resolve(dirname(one.path)))||now.getTime()-(stat.isDirectory()?touchedAt(one.path):stat.mtimeMs)<=DAY_MS)continue;const owner=stat.isDirectory()?tempOwner(one.path):null;if(owner!==null&&(options.ownerAlive??(()=>!1))(owner)||options.spare?.(one.path)===!0)continue;await removeTree(one.path),removed.push(one.path)}catch{failed.push(one.path)}}return{removed,failed,more:!1}}const nextTurn=()=>new Promise(resolve2=>setImmediate(resolve2));async function removeTree(path){try{await rm(path,{recursive:!0,force:!0,maxRetries:3});return}catch{}process.platform!=="win32"&&await new Promise(resolve2=>execFile("chmod",["-R","u+w",path],{timeout:12e4},()=>resolve2())),await rm(path,{recursive:!0,force:!0,maxRetries:3})}
1
+ import{execFile}from"node:child_process";import{lstatSync,readFileSync,readdirSync}from"node:fs";import{rm}from"node:fs/promises";import{tmpdir}from"node:os";import{dirname,join,resolve}from"node:path";import{withoutLeadTokenEnv}from"./names.js";const DAY_MS=864e5;export const OWNER_FILE=".toolroll-temp-owner";const TEST_TEMP_PREFIXES=["so-","standing-orders-","toolroll-","no-wt","epoch","cancel-floor","attest-","budgets-","chat-v66-","check-levels-","coding-context-","console-url-","console-v2-","e2-attest-","flow-goal-","flow-scratch","flows-chat-","invoke-attest-","knowledge-test-","learning-","peek-","phone-origin-","proposal-repo-","race-","refresh-migration-","refresh-refusal-","release-check-","shared-chat-","skills-test-","task-status-surfaces-","template-repo-","template-test-","v14-migrate-","v17-migrate-","watch-anchor-","needs-you-","deps-lock-","deps-state-","upgrade-fresh-","upgrade-path-","deploy-restore-","result-review-","one-result-page-","deploy-before-swap-","one-vocabulary-","accept-finishes-","lead-promises-","lead-people-","sizing-repo-","batch-checks-","deps-identity-","playwright_chromiumdev_profile-","playwright_firefoxdev_profile-","playwright-artifacts-"];export function tempOwner(path){try{const parsed=JSON.parse(readFileSync(join(path,OWNER_FILE),"utf8")),startedAt=typeof parsed.startedAt=="string"?Date.parse(parsed.startedAt):NaN;return Number.isSafeInteger(parsed.pid)&&Number(parsed.pid)>1&&Number.isFinite(startedAt)?{pid:Number(parsed.pid),startedAt}:null}catch{return null}}export function isTestTemp(name){return TEST_TEMP_PREFIXES.some(prefix=>name.startsWith(prefix))}export function tempRoots(){const roots=[tmpdir()];return process.platform!=="win32"&&!roots.includes("/tmp")&&roots.push("/tmp"),roots}function touchedAt(path){let newest=lstatSync(path).mtimeMs,names=[];try{names=readdirSync(path)}catch{return newest}for(const name of names)try{newest=Math.max(newest,lstatSync(join(path,name)).mtimeMs)}catch{}return newest}export function testTempFolders(roots,now){const all=[],seen=new Set;for(const root of roots){let names=[];try{names=readdirSync(root)}catch{continue}for(const name of names){if(!isTestTemp(name))continue;const path=join(root,name);try{const stat=lstatSync(path),key=`${stat.dev}:${stat.ino}`;if(seen.has(key)||stat.isSymbolicLink())continue;seen.add(key),all.push({path,touchedAt:stat.isDirectory()?touchedAt(path):stat.mtimeMs})}catch{}}}return{all,stale:all.filter(one=>now.getTime()-one.touchedAt>DAY_MS)}}export async function removeStaleTestTemp(roots,now,options={}){const removed=[],failed=[],stale=testTempFolders(roots,now).stale,max=options.max??1/0,inside=new Set(roots.map(root=>resolve(root)));for(const one of stale){if(removed.length+failed.length>=max)return{removed,failed,more:!0};await nextTurn();try{const stat=lstatSync(one.path);if(stat.isSymbolicLink()||!inside.has(resolve(dirname(one.path)))||now.getTime()-(stat.isDirectory()?touchedAt(one.path):stat.mtimeMs)<=DAY_MS)continue;const owner=stat.isDirectory()?tempOwner(one.path):null;if(owner!==null&&(options.ownerAlive??(()=>!1))(owner)||options.spare?.(one.path)===!0)continue;await removeTree(one.path),removed.push(one.path)}catch{failed.push(one.path)}}return{removed,failed,more:!1}}const nextTurn=()=>new Promise(resolve2=>setImmediate(resolve2));async function removeTree(path){try{await rm(path,{recursive:!0,force:!0,maxRetries:3});return}catch{}process.platform!=="win32"&&await new Promise(resolve2=>execFile("chmod",["-R","u+w",path],{timeout:12e4,env:withoutLeadTokenEnv(process.env)},()=>resolve2())),await rm(path,{recursive:!0,force:!0,maxRetries:3})}
@@ -1,4 +1,4 @@
1
- import{spawn}from"node:child_process";import{randomBytes,timingSafeEqual}from"node:crypto";import{createServer}from"node:http";import{accessSync,constants,existsSync,realpathSync}from"node:fs";import{delimiter,isAbsolute,resolve,sep}from"node:path";const BODY_LIMIT=4*1024*1024,ANSWER_LIMIT=32*1024*1024,STOP_GRACE_MS=2e3,rpcError=(id,message,code=-32e3)=>({jsonrpc:"2.0",id:id??null,error:{code,message}}),isRequest=message=>typeof message.method=="string"&&message.id!==void 0&&message.id!==null;function limitList(message,actions){if(actions===void 0||message===null||typeof message!="object"||message.result===null||typeof message.result!="object")return message;const result=message.result;return{...message,result:{...result,...Array.isArray(result.tools)?{tools:result.tools.filter(one=>one!==null&&typeof one=="object"&&actions.includes(String(one.name)))}:{},...Object.fromEntries(["resources","resourceTemplates","prompts"].filter(key=>Array.isArray(result[key])).map(key=>[key,[]]))}}}const RESEARCH_METHODS=new Set(["initialize","ping","notifications/initialized","notifications/cancelled","tools/list","resources/list","resources/templates/list","prompts/list"]);function refused(message,actions){if(actions===void 0||RESEARCH_METHODS.has(String(message.method)))return null;const name=message.params?.name;return message.method==="tools/call"&&typeof name=="string"&&actions.includes(name)?null:rpcError(message.id,"This step may only read: that action is not available.",-32601)}export const SERVER_ENV=["PATH","HOME","USER","LANG","TMPDIR","SHELL","TERM","NODE_EXTRA_CA_CERTS","SSL_CERT_FILE","SSL_CERT_DIR",...["HTTP_PROXY","HTTPS_PROXY","NO_PROXY","ALL_PROXY"].flatMap(name=>[name,name.toLowerCase()])];export function serverEnv(base,omit,pass,values){const env={};for(const[name,value]of Object.entries(base))value!==void 0&&(SERVER_ENV.includes(name)||name.startsWith("LC_"))&&(env[name]=value);for(const name of omit)delete env[name];return Object.assign(env,pass,values)}export function workspaceBytes(command,args,cwd,path,untrusted){if(untrusted.length===0)return null;const base=cwd??process.cwd(),fold=process.platform==="darwin"||process.platform==="win32"?one=>one.toLowerCase():one=>one,real=one=>{try{return fold(realpathSync.native(one))}catch{return fold(resolve(one))}},roots=untrusted.map(real),within=one=>{const at=real(one);return roots.some(root=>at===root||at.startsWith(`${root}${sep}`))},mentions=arg=>{const text=fold(arg);return roots.some(root=>text.includes(root))||untrusted.some(root=>text.includes(fold(root)))},located=command.includes("/")||command.includes(sep)?resolve(base,command):(path??"").split(delimiter).filter(Boolean).map(dir=>resolve(base,dir,command)).find(one=>{try{return accessSync(one,constants.X_OK),!0}catch{return!1}})??null;if(located!==null&&within(located))return located;if(!isAbsolute(command)&&(command.includes("/")||command.includes(sep)))return`${command} (a relative path)`;for(const arg of args){if(mentions(arg))return`${arg} (names what this build writes)`;for(const piece of[arg,...arg.startsWith("-")&&arg.includes("=")?[arg.slice(arg.indexOf("=")+1)]:[]]){if(piece.startsWith("./")||piece.startsWith("../"))return`${piece} (a relative path)`;const candidate=resolve(base,piece);if((isAbsolute(piece)||existsSync(candidate))&&within(candidate))return candidate}}return null}class LocalServer{tool;options;child=null;initialized=!1;buffer="";next=1;pending=new Map;refusal=null;constructor(tool,options){this.tool=tool,this.options=options}pid(){return this.child?.pid??null}start(){const env=serverEnv(this.options.env??process.env,this.options.omitEnv??[],this.options.pass??{},this.tool.values),planted=workspaceBytes(this.tool.spec.command,this.tool.spec.args,this.options.cwd,env.PATH,this.options.untrusted??[]);if(planted!==null)return this.refusal=`The tool's server would run ${planted}, inside what this build can write, so it was not started.`,null;const wrap=this.options.wrap?.()??null;if(wrap===null){const why=this.options.unwrapped?.()??null;if(why!==null)return this.refusal=why,null}const{file,args,env:sandboxEnv}=wrap===null?{file:this.tool.spec.command,args:[...this.tool.spec.args],env:void 0}:wrap(this.tool.spec.command,this.tool.spec.args,this.options.cwd),child=spawn(file,args,{env:{...env,...sandboxEnv},...this.options.cwd===void 0?{}:{cwd:this.options.cwd},stdio:["pipe","pipe","ignore"],detached:process.platform!=="win32"});this.child=child,this.initialized=!1,child.stdout?.setEncoding("utf8"),child.stdout?.on("data",chunk=>this.read(chunk));const gone=why=>{if(this.child===child){this.child=null;for(const[,waiting]of this.pending)waiting.done(rpcError(waiting.id,why));this.pending.clear()}};return child.on("error",error=>gone(`The tool could not start: ${error.message}.`)),child.on("exit",code=>gone(`The tool stopped (exit ${code??"signal"}).`)),child.stdin?.on("error",()=>{}),child}read(chunk){this.buffer+=chunk;for(let end=this.buffer.indexOf(`
1
+ import{spawn}from"node:child_process";import{randomBytes,timingSafeEqual}from"node:crypto";import{createServer}from"node:http";import{accessSync,constants,existsSync,realpathSync}from"node:fs";import{delimiter,isAbsolute,resolve,sep}from"node:path";import{withoutLeadTokenEnv}from"./names.js";const BODY_LIMIT=4*1024*1024,ANSWER_LIMIT=32*1024*1024,STOP_GRACE_MS=2e3,rpcError=(id,message,code=-32e3)=>({jsonrpc:"2.0",id:id??null,error:{code,message}}),isRequest=message=>typeof message.method=="string"&&message.id!==void 0&&message.id!==null;function limitList(message,actions){if(actions===void 0||message===null||typeof message!="object"||message.result===null||typeof message.result!="object")return message;const result=message.result;return{...message,result:{...result,...Array.isArray(result.tools)?{tools:result.tools.filter(one=>one!==null&&typeof one=="object"&&actions.includes(String(one.name)))}:{},...Object.fromEntries(["resources","resourceTemplates","prompts"].filter(key=>Array.isArray(result[key])).map(key=>[key,[]]))}}}const RESEARCH_METHODS=new Set(["initialize","ping","notifications/initialized","notifications/cancelled","tools/list","resources/list","resources/templates/list","prompts/list"]);function refused(message,actions){if(actions===void 0||RESEARCH_METHODS.has(String(message.method)))return null;const name=message.params?.name;return message.method==="tools/call"&&typeof name=="string"&&actions.includes(name)?null:rpcError(message.id,"This step may only read: that action is not available.",-32601)}export const SERVER_ENV=["PATH","HOME","USER","LANG","TMPDIR","SHELL","TERM","NODE_EXTRA_CA_CERTS","SSL_CERT_FILE","SSL_CERT_DIR",...["HTTP_PROXY","HTTPS_PROXY","NO_PROXY","ALL_PROXY"].flatMap(name=>[name,name.toLowerCase()])];export function serverEnv(base,omit,pass,values){const env={};for(const[name,value]of Object.entries(base))value!==void 0&&(SERVER_ENV.includes(name)||name.startsWith("LC_"))&&(env[name]=value);for(const name of omit)delete env[name];return withoutLeadTokenEnv(Object.assign(env,pass,values))}export function workspaceBytes(command,args,cwd,path,untrusted){if(untrusted.length===0)return null;const base=cwd??process.cwd(),fold=process.platform==="darwin"||process.platform==="win32"?one=>one.toLowerCase():one=>one,real=one=>{try{return fold(realpathSync.native(one))}catch{return fold(resolve(one))}},roots=untrusted.map(real),within=one=>{const at=real(one);return roots.some(root=>at===root||at.startsWith(`${root}${sep}`))},mentions=arg=>{const text=fold(arg);return roots.some(root=>text.includes(root))||untrusted.some(root=>text.includes(fold(root)))},located=command.includes("/")||command.includes(sep)?resolve(base,command):(path??"").split(delimiter).filter(Boolean).map(dir=>resolve(base,dir,command)).find(one=>{try{return accessSync(one,constants.X_OK),!0}catch{return!1}})??null;if(located!==null&&within(located))return located;if(!isAbsolute(command)&&(command.includes("/")||command.includes(sep)))return`${command} (a relative path)`;for(const arg of args){if(mentions(arg))return`${arg} (names what this build writes)`;for(const piece of[arg,...arg.startsWith("-")&&arg.includes("=")?[arg.slice(arg.indexOf("=")+1)]:[]]){if(piece.startsWith("./")||piece.startsWith("../"))return`${piece} (a relative path)`;const candidate=resolve(base,piece);if((isAbsolute(piece)||existsSync(candidate))&&within(candidate))return candidate}}return null}class LocalServer{tool;options;child=null;initialized=!1;buffer="";next=1;pending=new Map;refusal=null;constructor(tool,options){this.tool=tool,this.options=options}pid(){return this.child?.pid??null}start(){const env=serverEnv(this.options.env??process.env,this.options.omitEnv??[],this.options.pass??{},this.tool.values),planted=workspaceBytes(this.tool.spec.command,this.tool.spec.args,this.options.cwd,env.PATH,this.options.untrusted??[]);if(planted!==null)return this.refusal=`The tool's server would run ${planted}, inside what this build can write, so it was not started.`,null;const wrap=this.options.wrap?.()??null;if(wrap===null){const why=this.options.unwrapped?.()??null;if(why!==null)return this.refusal=why,null}const{file,args,env:sandboxEnv}=wrap===null?{file:this.tool.spec.command,args:[...this.tool.spec.args],env:void 0}:wrap(this.tool.spec.command,this.tool.spec.args,this.options.cwd),child=spawn(file,args,{env:withoutLeadTokenEnv({...env,...sandboxEnv}),...this.options.cwd===void 0?{}:{cwd:this.options.cwd},stdio:["pipe","pipe","ignore"],detached:process.platform!=="win32"});this.child=child,this.initialized=!1,child.stdout?.setEncoding("utf8"),child.stdout?.on("data",chunk=>this.read(chunk));const gone=why=>{if(this.child===child){this.child=null;for(const[,waiting]of this.pending)waiting.done(rpcError(waiting.id,why));this.pending.clear()}};return child.on("error",error=>gone(`The tool could not start: ${error.message}.`)),child.on("exit",code=>gone(`The tool stopped (exit ${code??"signal"}).`)),child.stdin?.on("error",()=>{}),child}read(chunk){this.buffer+=chunk;for(let end=this.buffer.indexOf(`
2
2
  `);end>=0;end=this.buffer.indexOf(`
3
3
  `)){const line=this.buffer.slice(0,end).trim();this.buffer=this.buffer.slice(end+1);let message;try{message=JSON.parse(line)}catch{continue}if(message===null||typeof message!="object")continue;if(isRequest(message)){this.write(rpcError(message.id,"Not supported in an unattended build.",-32601));continue}const waiting=typeof message.id=="number"?this.pending.get(message.id):void 0;waiting!==void 0&&(this.pending.delete(message.id),waiting.done({...message,id:waiting.id}))}}write(message){try{this.child?.stdin?.write(`${JSON.stringify(message)}
4
4
  `)}catch{}}send(message){if(message.method==="initialize"&&this.initialized&&this.stop(),this.child===null&&this.start()===null)return Promise.resolve(isRequest(message)?rpcError(message.id,this.refusal??"The tool could not start."):null);if(message.method==="initialize"&&(this.initialized=!0),!isRequest(message))return typeof message.method=="string"&&this.write(message),Promise.resolve(null);const id=this.next++;return new Promise(resolve2=>{this.pending.set(id,{id:message.id,done:resolve2}),this.write({...message,id})})}stop(){const child=this.child;if(child===null)return;this.child=null;for(const[,waiting]of this.pending)waiting.done(rpcError(waiting.id,"The tool was stopped."));this.pending.clear();const signal=name=>{try{child.pid!==void 0&&process.platform!=="win32"?process.kill(-child.pid,name):child.kill(name)}catch{}};signal("SIGTERM"),child.exitCode===null&&child.signalCode===null&&setTimeout(()=>signal("SIGKILL"),STOP_GRACE_MS).unref()}}async function relayWeb(tool,request,body){const spec=tool.spec,headers={"content-type":"application/json",accept:"application/json, text/event-stream"};for(const name of["mcp-session-id","mcp-protocol-version","last-event-id"]){const value=request.headers[name];typeof value=="string"&&(headers[name]=value)}spec.bearer!==null&&tool.values[spec.bearer]&&(headers.authorization=`Bearer ${tool.values[spec.bearer]}`);for(const[header,secret]of Object.entries(spec.headerSecrets))tool.values[secret]&&(headers[header]=tool.values[secret]);try{const response=await fetch(spec.url,{method:request.method??"POST",headers,redirect:"error",...request.method==="POST"?{body}:{}}),text=(await response.text()).slice(0,ANSWER_LIMIT);return{status:response.status,type:response.headers.get("content-type")??"application/json",body:text,session:response.headers.get("mcp-session-id")}}catch{let id=null;try{id=JSON.parse(body).id??null}catch{id=null}return{status:200,type:"application/json",body:JSON.stringify(rpcError(id,"The tool's server could not be reached."))}}}function limitAnswer(answer,actions){if(actions===void 0||!answer.type.includes("text/event-stream")&&jsonOf(answer.body)===void 0)return answer;const limit=text=>{try{const parsed=JSON.parse(text);return JSON.stringify(Array.isArray(parsed)?parsed.map(one=>limitList(one,actions)):limitList(parsed,actions))}catch{return JSON.stringify(rpcError(null,"The tool returned an invalid response."))}},body=answer.type.includes("text/event-stream")?answer.body.split(/\r?\n\r?\n/).map(event=>{const lines=event.split(/\r?\n/),data=lines.filter(line=>line.startsWith("data:")).map(line=>line.slice(5).replace(/^ /,""));return data.length===0?event:[...lines.filter(line=>!line.startsWith("data:")),`data: ${limit(data.join(`