@jr2/orchestrator 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. package/console/components/app.ts +55 -15
  2. package/console/components/bottom-drawer.ts +259 -0
  3. package/console/components/drawer.ts +14 -6
  4. package/console/components/fleet.ts +36 -13
  5. package/console/components/machine-pane.ts +61 -5
  6. package/console/components/nav.ts +54 -8
  7. package/console/conversation.ts +161 -0
  8. package/console/login.ts +123 -0
  9. package/console/main.ts +600 -60
  10. package/console/store.ts +611 -64
  11. package/console/style.css +231 -0
  12. package/docs/agents-block.md +2 -2
  13. package/docs/concepts/agents-and-turns.md +86 -9
  14. package/docs/concepts/architecture.md +41 -28
  15. package/docs/concepts/callers-and-hooks.md +205 -0
  16. package/docs/concepts/charts.md +7 -5
  17. package/docs/concepts/composition.md +10 -1
  18. package/docs/concepts/converge.md +4 -2
  19. package/docs/concepts/durable-runs.md +43 -16
  20. package/docs/concepts/effects.md +50 -22
  21. package/docs/concepts/gates.md +95 -25
  22. package/docs/concepts/machines-and-workflows.md +5 -4
  23. package/docs/concepts/pools-and-sources.md +187 -11
  24. package/docs/concepts/secrets-and-trust.md +73 -33
  25. package/docs/concepts/the-menu.md +11 -0
  26. package/docs/concepts/workspaces.md +6 -5
  27. package/docs/get-started/a-model-decides.md +14 -13
  28. package/docs/get-started/an-agent-in-a-sandbox.md +43 -34
  29. package/docs/get-started/connect-a-model.md +1 -1
  30. package/docs/get-started/create-an-instance.md +17 -14
  31. package/docs/guides/add-tools-to-the-sandbox.md +55 -11
  32. package/docs/guides/answer-a-gate-from-a-forge.md +304 -0
  33. package/docs/guides/answer-a-gate.md +74 -37
  34. package/docs/guides/bind-open-parts.md +24 -8
  35. package/docs/guides/call-an-mcp-tool-from-a-machine.md +572 -0
  36. package/docs/guides/cancel-a-run.md +26 -16
  37. package/docs/guides/fix-a-failed-converge.md +18 -6
  38. package/docs/guides/give-a-caller-a-scope.md +203 -0
  39. package/docs/guides/give-an-agent-mcp-tools.md +422 -0
  40. package/docs/guides/iterate-on-a-machine-on-kind.md +10 -9
  41. package/docs/guides/let-an-agent-write-a-chart.md +9 -6
  42. package/docs/guides/look-inside-a-sandbox.md +101 -31
  43. package/docs/guides/open-the-console.md +63 -14
  44. package/docs/guides/read-a-conversation.md +225 -0
  45. package/docs/guides/run-a-chart-by-name.md +17 -16
  46. package/docs/guides/run-one-worker-per-item.md +15 -9
  47. package/docs/guides/set-an-agents-access-and-dials.md +2 -0
  48. package/docs/guides/start-a-run-for-each-alert.md +290 -0
  49. package/docs/guides/start-a-run-from-a-run.md +18 -16
  50. package/docs/guides/start-a-run.md +24 -18
  51. package/docs/guides/steer-an-agent.md +332 -0
  52. package/docs/guides/use-a-hosted-provider.md +1 -1
  53. package/docs/guides/watch-a-run.md +127 -121
  54. package/docs/guides/write-a-hook-kind.md +238 -0
  55. package/docs/guides/write-a-tool-as-an-mcp-server.md +351 -0
  56. package/docs/guides/write-a-workflow.md +17 -7
  57. package/docs/llms.txt +81 -15
  58. package/docs/reference/authoring-surface/agent.md +1 -1
  59. package/docs/reference/authoring-surface/answer.md +1 -1
  60. package/docs/reference/authoring-surface/arg.md +1 -1
  61. package/docs/reference/authoring-surface/basic.md +1 -1
  62. package/docs/reference/authoring-surface/bearer.md +1 -1
  63. package/docs/reference/authoring-surface/branchname.md +1 -1
  64. package/docs/reference/authoring-surface/carry.md +23 -0
  65. package/docs/reference/authoring-surface/chartschema.md +1 -1
  66. package/docs/reference/authoring-surface/chartschemafor.md +1 -1
  67. package/docs/reference/authoring-surface/command.md +1 -1
  68. package/docs/reference/authoring-surface/customize.md +4 -1
  69. package/docs/reference/authoring-surface/defineconfig.md +1 -1
  70. package/docs/reference/authoring-surface/defineevent.md +1 -1
  71. package/docs/reference/authoring-surface/dispatch.md +5 -4
  72. package/docs/reference/authoring-surface/fail.md +1 -1
  73. package/docs/reference/authoring-surface/file.md +1 -1
  74. package/docs/reference/authoring-surface/frompick.md +1 -1
  75. package/docs/reference/authoring-surface/gate.md +118 -0
  76. package/docs/reference/authoring-surface/group-agents.md +15 -0
  77. package/docs/reference/authoring-surface/group-charts.md +16 -0
  78. package/docs/reference/authoring-surface/group-composition.md +25 -0
  79. package/docs/reference/authoring-surface/group-config.md +17 -0
  80. package/docs/reference/authoring-surface/group-effects.md +48 -0
  81. package/docs/reference/authoring-surface/group-failure.md +13 -0
  82. package/docs/reference/authoring-surface/group-gates.md +16 -0
  83. package/docs/reference/authoring-surface/group-machine-and-events.md +15 -0
  84. package/docs/reference/authoring-surface/group-steering.md +12 -0
  85. package/docs/reference/authoring-surface/group-types-these-signatures-name.md +137 -0
  86. package/docs/reference/authoring-surface/group-workspaces-and-repos.md +15 -0
  87. package/docs/reference/authoring-surface/http.md +1 -1
  88. package/docs/reference/authoring-surface/isfailure.md +1 -1
  89. package/docs/reference/authoring-surface/isready.md +1 -1
  90. package/docs/reference/authoring-surface/jr2setup.md +13 -3
  91. package/docs/reference/authoring-surface/mcp.md +107 -0
  92. package/docs/reference/authoring-surface/open.md +5 -3
  93. package/docs/reference/authoring-surface/openbody.md +1 -1
  94. package/docs/reference/authoring-surface/paramsof.md +1 -1
  95. package/docs/reference/authoring-surface/pool.md +77 -9
  96. package/docs/reference/authoring-surface/push.md +1 -1
  97. package/docs/reference/authoring-surface/readyof.md +1 -1
  98. package/docs/reference/authoring-surface/reread.md +19 -0
  99. package/docs/reference/authoring-surface/secret.md +1 -1
  100. package/docs/reference/authoring-surface/sentby.md +1 -1
  101. package/docs/reference/authoring-surface/skip.md +22 -0
  102. package/docs/reference/authoring-surface/source.md +56 -1
  103. package/docs/reference/authoring-surface/steer.md +93 -0
  104. package/docs/reference/authoring-surface/text.md +1 -1
  105. package/docs/reference/authoring-surface/type-agentdefinition.md +14 -1
  106. package/docs/reference/authoring-surface/type-agentmcpserver.md +54 -0
  107. package/docs/reference/authoring-surface/type-anyframepath.md +1 -1
  108. package/docs/reference/authoring-surface/type-anyworktreepath.md +1 -1
  109. package/docs/reference/authoring-surface/type-binding.md +1 -1
  110. package/docs/reference/authoring-surface/type-caller.md +40 -0
  111. package/docs/reference/authoring-surface/type-callerrecord.md +32 -0
  112. package/docs/reference/authoring-surface/type-carry.md +19 -0
  113. package/docs/reference/authoring-surface/type-chainlink.md +3 -3
  114. package/docs/reference/authoring-surface/type-commandoutput.md +1 -1
  115. package/docs/reference/authoring-surface/type-customize.md +16 -1
  116. package/docs/reference/authoring-surface/type-delivered.md +17 -0
  117. package/docs/reference/authoring-surface/type-deliveredevent.md +18 -0
  118. package/docs/reference/authoring-surface/type-dispatchdefinition.md +4 -3
  119. package/docs/reference/authoring-surface/type-dispatchoutput.md +1 -1
  120. package/docs/reference/authoring-surface/type-effectbinding.md +12 -2
  121. package/docs/reference/authoring-surface/type-framepath.md +1 -1
  122. package/docs/reference/authoring-surface/type-gatebinding.md +15 -0
  123. package/docs/reference/authoring-surface/type-gatehooks.md +12 -0
  124. package/docs/reference/authoring-surface/type-gatelook.md +37 -0
  125. package/docs/reference/authoring-surface/type-gateoutcome.md +32 -0
  126. package/docs/reference/authoring-surface/type-gatereply.md +19 -0
  127. package/docs/reference/authoring-surface/type-gateslot.md +21 -0
  128. package/docs/reference/authoring-surface/type-gateslotinput.md +13 -0
  129. package/docs/reference/authoring-surface/type-gateslotparts.md +18 -0
  130. package/docs/reference/authoring-surface/type-gateslots.md +12 -0
  131. package/docs/reference/authoring-surface/type-gatetypesat.md +13 -0
  132. package/docs/reference/authoring-surface/type-hostinjectedinput.md +1 -1
  133. package/docs/reference/authoring-surface/type-httpoutput.md +1 -1
  134. package/docs/reference/authoring-surface/type-jr2config.md +37 -2
  135. package/docs/reference/authoring-surface/type-lateroutcome.md +1 -1
  136. package/docs/reference/authoring-surface/type-lends.md +5 -1
  137. package/docs/reference/authoring-surface/type-lookoutput.md +14 -0
  138. package/docs/reference/authoring-surface/type-mcpcalloutput.md +78 -0
  139. package/docs/reference/authoring-surface/type-mcpnotreturned.md +42 -0
  140. package/docs/reference/authoring-surface/type-mcpoptions.md +47 -0
  141. package/docs/reference/authoring-surface/type-mcpoutput.md +50 -0
  142. package/docs/reference/authoring-surface/type-mcpreadoutput.md +53 -0
  143. package/docs/reference/authoring-surface/type-mcpremoteserver.md +50 -0
  144. package/docs/reference/authoring-surface/type-mcpserver.md +41 -0
  145. package/docs/reference/authoring-surface/type-mcpstdioserver.md +42 -0
  146. package/docs/reference/authoring-surface/type-namedsecret.md +4 -4
  147. package/docs/reference/authoring-surface/type-openbodydeclaration.md +1 -1
  148. package/docs/reference/authoring-surface/type-openbodyoutput.md +1 -1
  149. package/docs/reference/authoring-surface/type-poolnextinput.md +1 -1
  150. package/docs/reference/authoring-surface/type-poolspec.md +11 -6
  151. package/docs/reference/authoring-surface/type-pushoutput.md +1 -1
  152. package/docs/reference/authoring-surface/type-pushsourcespec.md +38 -0
  153. package/docs/reference/authoring-surface/type-readsourcespec.md +47 -0
  154. package/docs/reference/authoring-surface/type-reposlot.md +1 -1
  155. package/docs/reference/authoring-surface/type-reread.md +18 -0
  156. package/docs/reference/authoring-surface/type-runsconfig.md +41 -0
  157. package/docs/reference/authoring-surface/type-sender.md +26 -1
  158. package/docs/reference/authoring-surface/type-sendercallerfield.md +14 -0
  159. package/docs/reference/authoring-surface/type-size.md +1 -1
  160. package/docs/reference/authoring-surface/type-skip.md +19 -0
  161. package/docs/reference/authoring-surface/type-sourcehooks.md +23 -0
  162. package/docs/reference/authoring-surface/type-sourcein.md +25 -0
  163. package/docs/reference/authoring-surface/type-sourcereply.md +18 -0
  164. package/docs/reference/authoring-surface/type-sourcespec.md +16 -7
  165. package/docs/reference/authoring-surface/type-sourceverdict.md +49 -0
  166. package/docs/reference/authoring-surface/type-standingpoolmachine.md +12 -0
  167. package/docs/reference/authoring-surface/type-standingpoolspec.md +51 -0
  168. package/docs/reference/authoring-surface/type-steerargs.md +20 -0
  169. package/docs/reference/authoring-surface/type-thinkinglevel.md +1 -1
  170. package/docs/reference/authoring-surface/type-usercontainer.md +1 -1
  171. package/docs/reference/authoring-surface/type-workspaced.md +1 -1
  172. package/docs/reference/authoring-surface/type-worktreefound.md +3 -3
  173. package/docs/reference/authoring-surface/type-worktreeinput.md +1 -1
  174. package/docs/reference/authoring-surface/type-worktreeoptions.md +1 -1
  175. package/docs/reference/authoring-surface/type-worktreeoutput.md +1 -1
  176. package/docs/reference/authoring-surface/type-worktreepath.md +1 -1
  177. package/docs/reference/authoring-surface/type-worktreeready.md +1 -1
  178. package/docs/reference/authoring-surface/type-worktreerefused.md +4 -4
  179. package/docs/reference/authoring-surface/workspace.md +1 -1
  180. package/docs/reference/authoring-surface/worktree.md +1 -1
  181. package/docs/reference/authoring-surface.md +88 -167
  182. package/docs/reference/cli.md +413 -74
  183. package/docs/reference/config.md +235 -2
  184. package/docs/reference/decisions/0002-duplex-streaming-actor.md +71 -11
  185. package/docs/reference/decisions/0005-sandbox-pod-composition.md +14 -10
  186. package/docs/reference/decisions/0006-agent-control-surface.md +4 -4
  187. package/docs/reference/decisions/0007-durable-machine-state.md +1 -1
  188. package/docs/reference/decisions/0009-cli-and-instance-interface.md +150 -49
  189. package/docs/reference/decisions/0010-bdd-acceptance-tests.md +5 -3
  190. package/docs/reference/decisions/0011-workflow-defined-events.md +256 -12
  191. package/docs/reference/decisions/0012-workspace-wrapper-machine.md +9 -2
  192. package/docs/reference/decisions/0013-the-agent-reaches-its-machine-through-a-container-it-cannot-read.md +20 -14
  193. package/docs/reference/decisions/0014-observation-is-open-run-state-is-not.md +53 -27
  194. package/docs/reference/decisions/0015-authoring-surface-absorbs-the-mechanism.md +18 -14
  195. package/docs/reference/decisions/0017-pool-over-a-source-port.md +226 -12
  196. package/docs/reference/decisions/0018-instance-agents-are-definitions-jr2-assembles-the-harness.md +15 -7
  197. package/docs/reference/decisions/0019-one-converging-command-against-the-current-context.md +32 -18
  198. package/docs/reference/decisions/0021-workspace-continuity-is-a-lease-that-answers-back.md +14 -1
  199. package/docs/reference/decisions/0022-observation-is-a-level-triggered-feed.md +4 -4
  200. package/docs/reference/decisions/0023-the-harness-prints-the-conversation.md +116 -34
  201. package/docs/reference/decisions/0024-an-agents-turn-ends-with-the-state-that-asked-for-it.md +38 -37
  202. package/docs/reference/decisions/0025-cancel-ends-a-run-stop-parks-it.md +10 -5
  203. package/docs/reference/decisions/0027-the-harness-is-jr2s-own-server-flue-retires-the-wire-stays.md +7 -6
  204. package/docs/reference/decisions/0028-what-an-agent-may-do-to-the-workspace-is-part-of-its-definition.md +23 -7
  205. package/docs/reference/decisions/0029-a-menu-is-fixed-for-a-conversation-and-a-turn-is-told-its-allowed-picks.md +18 -10
  206. package/docs/reference/decisions/0030-a-snapshot-names-the-machine-it-was-written-under.md +3 -2
  207. package/docs/reference/decisions/0031-menu-only-agents-run-on-the-instance-harness.md +23 -18
  208. package/docs/reference/decisions/0032-the-console-unlocks-with-a-callers-credential.md +101 -0
  209. package/docs/reference/decisions/0033-a-machine-declares-the-input-that-starts-it.md +4 -3
  210. package/docs/reference/decisions/0034-the-console-renders-with-preact-and-the-server-erases-the-types.md +6 -6
  211. package/docs/reference/decisions/0037-an-instance-builds-its-sandbox-images-jr2-injects-the-harness.md +5 -4
  212. package/docs/reference/decisions/0049-a-machine-carries-its-parts-and-composes-by-invoke.md +19 -19
  213. package/docs/reference/decisions/0050-what-code-names-config-declares-what-the-cli-names-discovery-finds.md +6 -1
  214. package/docs/reference/decisions/0054-the-kit-ships-machines-and-a-shipped-machine-leaves-its-parts-open.md +55 -40
  215. package/docs/reference/decisions/0055-a-release-is-a-pushed-tag-and-the-publish-guard-is-the-credential.md +14 -13
  216. package/docs/reference/decisions/0057-a-turn-is-its-frame-its-dials-and-whether-it-continues.md +7 -0
  217. package/docs/reference/decisions/0058-a-harness-answers-the-orchestrator-alone.md +13 -7
  218. package/docs/reference/decisions/0059-a-harness-holds-stand-ins-and-the-custodian-holds-the-keys.md +38 -30
  219. package/docs/reference/decisions/0062-jr2-briefs-the-agent-on-its-seat-never-on-its-task.md +64 -17
  220. package/docs/reference/decisions/0063-the-orchestrator-watches-the-cluster.md +2 -1
  221. package/docs/reference/decisions/0064-a-workspace-waits-for-capacity.md +2 -2
  222. package/docs/reference/decisions/0065-a-persist-survives-a-crash-and-history-is-kept-for-a-set-time.md +109 -0
  223. package/docs/reference/decisions/0066-a-model-tier-runs-a-real-model-and-a-change-to-what-it-reads-runs-the-tier.md +51 -23
  224. package/docs/reference/decisions/0067-an-effect-is-an-actor-slot-and-runs-at-most-once-unless-marked-idempotent.md +94 -54
  225. package/docs/reference/decisions/0068-an-effector-holds-an-effects-secrets-and-signs-its-wire.md +101 -47
  226. package/docs/reference/decisions/0069-the-orchestrator-is-a-kit-image-and-an-instance-publishes-its-assembly.md +32 -9
  227. package/docs/reference/decisions/0070-a-machine-lends-its-parts-to-a-chart.md +17 -13
  228. package/docs/reference/decisions/0071-a-run-starts-a-run-through-a-dispatch-effect.md +56 -30
  229. package/docs/reference/decisions/0072-the-docs-ship-inside-the-kit-and-an-instances-agents-md-indexes-them.md +35 -25
  230. package/docs/reference/decisions/0075-a-machine-cuts-a-worktree-and-the-workspace-only-clones.md +4 -3
  231. package/docs/reference/decisions/0076-an-agents-control-credential-lives-only-where-no-workspace-code-runs.md +37 -10
  232. package/docs/reference/decisions/0078-a-caller-comes-from-one-authenticator-seam-and-acts-within-its-scopes.md +285 -0
  233. package/docs/reference/decisions/0079-an-agent-holds-mcp-tools-a-machine-calls-them-as-an-effect-and-the-machine-is-the-approval.md +198 -0
  234. package/docs/reference/decisions.md +6 -4
  235. package/docs/reference/glossary.md +96 -42
  236. package/docs/reference/hooks.md +1077 -0
  237. package/docs/reference/http-api.md +976 -149
  238. package/docs/why.md +2 -1
  239. package/package.json +10 -3
  240. package/src/actor.ts +36 -10
  241. package/src/agent.ts +50 -0
  242. package/src/assembly-checks.ts +530 -4
  243. package/src/callers.ts +245 -0
  244. package/src/chart.ts +52 -7
  245. package/src/config.ts +550 -1
  246. package/src/conversations.ts +453 -0
  247. package/src/custodian.ts +8 -2
  248. package/src/customize.ts +143 -4
  249. package/src/dispatch-effect.ts +142 -26
  250. package/src/durability.ts +2 -0
  251. package/src/duration.ts +20 -0
  252. package/src/effect-checks.ts +2 -1
  253. package/src/effect.ts +60 -7
  254. package/src/effector-wire.ts +272 -27
  255. package/src/gate-brand.ts +16 -0
  256. package/src/gate.ts +634 -48
  257. package/src/harness-client.ts +10 -4
  258. package/src/held-secrets.ts +72 -23
  259. package/src/holds.ts +2 -2
  260. package/src/hook-kinds/discord.ts +92 -0
  261. package/src/hook-kinds/door.ts +107 -0
  262. package/src/hook-kinds/github.ts +89 -0
  263. package/src/hook-kinds/gitlab.ts +72 -0
  264. package/src/hook-kinds/hook.ts +7 -0
  265. package/src/hook-kinds/index.ts +465 -0
  266. package/src/hook-kinds/slack.ts +151 -0
  267. package/src/hook-kinds/webhook.ts +113 -0
  268. package/src/hooks.ts +506 -0
  269. package/src/http-effect.ts +76 -38
  270. package/src/http.ts +889 -94
  271. package/src/index.ts +16 -5
  272. package/src/instance.ts +196 -26
  273. package/src/internal.ts +22 -3
  274. package/src/machine-doc.ts +26 -1
  275. package/src/mcp-effect.ts +424 -0
  276. package/src/mount-digest.ts +41 -7
  277. package/src/names.ts +64 -2
  278. package/src/notices.ts +138 -10
  279. package/src/open-body.ts +25 -11
  280. package/src/open-effect.ts +17 -4
  281. package/src/open.ts +4 -2
  282. package/src/parts.ts +87 -9
  283. package/src/party.ts +2 -1
  284. package/src/pick.ts +2 -2
  285. package/src/pool.ts +1142 -163
  286. package/src/registration.ts +203 -13
  287. package/src/run-host.ts +1509 -171
  288. package/src/run-list.ts +191 -0
  289. package/src/sandbox-kube.ts +53 -5
  290. package/src/secret-placement.ts +239 -33
  291. package/src/server.ts +53 -4
  292. package/src/setup.ts +72 -32
  293. package/src/snapshot-store.ts +565 -48
  294. package/src/steer.ts +111 -0
  295. package/src/stub-harness.ts +6 -2
  296. package/src/tokens.ts +263 -22
  297. package/src/wire.ts +17 -0
  298. package/src/workspace.ts +50 -6
  299. package/src/worktree.ts +3 -3
  300. package/docs/reference/decisions/0032-the-console-unlocks-with-the-instance-token.md +0 -61
  301. package/docs/reference/decisions/0065-a-persist-survives-a-crash-and-history-is-a-week.md +0 -65
@@ -7,7 +7,7 @@ description: "Every jr2 command: its synopsis, its arguments, flags and env vars
7
7
 
8
8
  The `jr2` binary: orchestrate agentic workflows ([ADR-0009](decisions/0009-cli-and-instance-interface.md)). `jr2 --help` prints the same table as this page, and `jr2 <command> --help` prints one command.
9
9
 
10
- Commands: [`version`](#version), [`init`](#init), [`check`](#check), [`up`](#up), [`down`](#down), [`gc`](#gc), [`kit push`](#kit-push), [`run`](#run), [`runs`](#runs), [`status`](#status), [`logs`](#logs), [`send`](#send).
10
+ Commands: [`version`](#version), [`init`](#init), [`check`](#check), [`up`](#up), [`down`](#down), [`gc`](#gc), [`kit push`](#kit-push), [`run`](#run), [`runs`](#runs), [`workflows`](#workflows), [`gates`](#gates), [`status`](#status), [`watch`](#watch), [`logs`](#logs), [`send`](#send), [`steer`](#steer), [`whoami`](#whoami), [`hooks`](#hooks), [`caller token`](#caller-token), [`caller rotate`](#caller-rotate), [`workspace ls`](#workspace-ls), [`workspace shell`](#workspace-shell), [`workspace forward`](#workspace-forward), [`workspace rm`](#workspace-rm), [`completion`](#completion).
11
11
 
12
12
  <a id="global-options"></a>
13
13
 
@@ -17,10 +17,10 @@ These address the deployment; each lists the verbs that take it ([ADR-0019](deci
17
17
 
18
18
  | Flag | Variable | Description | Taken by |
19
19
  | --- | --- | --- | --- |
20
- | `-n, --namespace <ns>` | | the deployment's namespace (default: the config's `name`, then the Instance folder's name) | [`version`](#version), [`up`](#up), [`down`](#down), [`run`](#run), [`runs`](#runs), [`status`](#status), [`logs`](#logs), [`send`](#send) |
21
- | `--context <ctx>` | | the kube context (default: kubectl's current context) | [`version`](#version), [`up`](#up), [`down`](#down), [`gc`](#gc), [`run`](#run), [`runs`](#runs), [`status`](#status), [`logs`](#logs), [`send`](#send) |
22
- | `--url <u>` | `JR2_URL` | attach to a specific orchestrator (skips kube entirely) | [`version`](#version), [`run`](#run), [`runs`](#runs), [`status`](#status), [`logs`](#logs), [`send`](#send) |
23
- | | `JR2_TOKEN` | the Instance token to send: with `--url` / `JR2_URL` the only one, and otherwise used in place of the one read from the cluster | [`run`](#run), [`runs`](#runs), [`status`](#status), [`logs`](#logs), [`send`](#send) |
20
+ | `-n, --namespace <ns>` | | the deployment's namespace (default: the config's `name`, then the Instance folder's name) | [`version`](#version), [`up`](#up), [`down`](#down), [`run`](#run), [`runs`](#runs), [`workflows`](#workflows), [`gates`](#gates), [`status`](#status), [`watch`](#watch), [`logs`](#logs), [`send`](#send), [`steer`](#steer), [`whoami`](#whoami), [`hooks`](#hooks), [`caller token`](#caller-token), [`caller rotate`](#caller-rotate), [`workspace ls`](#workspace-ls), [`workspace shell`](#workspace-shell), [`workspace forward`](#workspace-forward), [`workspace rm`](#workspace-rm) |
21
+ | `--context <ctx>` | | the kube context (default: kubectl's current context) | [`version`](#version), [`up`](#up), [`down`](#down), [`gc`](#gc), [`run`](#run), [`runs`](#runs), [`workflows`](#workflows), [`gates`](#gates), [`status`](#status), [`watch`](#watch), [`logs`](#logs), [`send`](#send), [`steer`](#steer), [`whoami`](#whoami), [`hooks`](#hooks), [`caller token`](#caller-token), [`caller rotate`](#caller-rotate), [`workspace ls`](#workspace-ls), [`workspace shell`](#workspace-shell), [`workspace forward`](#workspace-forward), [`workspace rm`](#workspace-rm) |
22
+ | `--url <u>` | `JR2_URL` | attach to a specific orchestrator (skips kube entirely) | [`version`](#version), [`run`](#run), [`runs`](#runs), [`workflows`](#workflows), [`gates`](#gates), [`status`](#status), [`watch`](#watch), [`logs`](#logs), [`send`](#send), [`steer`](#steer), [`whoami`](#whoami), [`hooks`](#hooks) |
23
+ | | `JR2_TOKEN` | the Caller's credential to send, which makes the CLI that Caller: with `--url` / `JR2_URL` the only one, and otherwise used in place of the Instance token read from the cluster | [`run`](#run), [`runs`](#runs), [`workflows`](#workflows), [`gates`](#gates), [`status`](#status), [`watch`](#watch), [`logs`](#logs), [`send`](#send), [`steer`](#steer), [`whoami`](#whoami), [`hooks`](#hooks) |
24
24
 
25
25
  ## Commands
26
26
 
@@ -44,18 +44,16 @@ Also spelled `jr2 --version`.
44
44
  | --- | --- |
45
45
  | `--local` | report what runs here and skip the cluster |
46
46
  | `--json` | print the one report object on stdout instead of the table |
47
- | `--url <u>` | attach to a specific orchestrator (skips kube entirely) |
48
- | `-n, --namespace <ns>` | the deployment's namespace (default: the config's `name`, then the Instance folder's name) |
49
- | `--context <ctx>` | the kube context (default: kubectl's current context) |
47
+
48
+ Also takes `--url <u>`, `-n, --namespace <ns>`, `--context <ctx>`, `JR2_URL`: see [Global options](#global-options).
50
49
 
51
50
  **Environment**
52
51
 
53
52
  | Variable | Description |
54
53
  | --- | --- |
55
- | `JR2_URL` | the orchestrator to attach to, when `--url` is not given |
56
54
  | `JR2_HANDOFF_FROM` | set by the global `jr2` that handed off to this one, which the report names |
57
55
 
58
- **Output**: report, a table on stdout, or the one report object with `--json`. See [Output](#output).
56
+ **Output**: report, a table or lines on stdout, or their JSON with `--json`, where the verb has it. See [Output](#output).
59
57
 
60
58
  **Decisions**: [ADR-0009](decisions/0009-cli-and-instance-interface.md), [ADR-0056](decisions/0056-a-global-jr2-hands-off-to-the-instances-own-and-an-instance-has-one-kit-version.md).
61
59
 
@@ -97,7 +95,7 @@ jr2 check
97
95
 
98
96
  Typecheck this instance and load its workflows, as `jr2 up` does first, with no cluster.
99
97
 
100
- Runs the check that `jr2 up` runs before it stages the Assembly, and exits 1 with the same refusal: a type error, a module that refuses to load (a refusal of `createMachine`, `defineEvent` or `workspace()`), an Open part, a Chart file, a dispatch, an Effect secret or a Size.
98
+ Runs the check that `jr2 up` runs before it stages the Assembly, and exits 1 with its refusal: a type error, a module that refuses to load (`createMachine`, `defineEvent` or `workspace()`), an Open part, a Chart file, a dispatch, an Effect secret or a Size.
101
99
 
102
100
  Reads no kube context and writes no file, so an Assistant runs it before it gives a change to the user.
103
101
 
@@ -117,7 +115,7 @@ Converge the current kube context to this instance.
117
115
 
118
116
  Reads each `git.credentials` token from the env var it names, after the Instance's .env.
119
117
 
120
- Before the cluster work, sets the text between the jr2-docs markers in AGENTS.md to the docs index of the Kit version, and changes nothing outside them; a folder with no markers is left alone.
118
+ Before the cluster work, sets the text between the jr2-docs markers in AGENTS.md to the docs index of the Kit version, and nothing else; a folder with no markers is left alone.
121
119
 
122
120
  **Flags**
123
121
 
@@ -125,9 +123,9 @@ Before the cluster work, sets the text between the jr2-docs markers in AGENTS.md
125
123
  | --- | --- |
126
124
  | `--yes` | answer the questions non-interactively: confirm first-time setup, and take the recommended git ssh key source (for CI) |
127
125
  | `--force` | build every image again, even one already built or deployed |
128
- | `--skip-provider-preflight` | do not run the provider preflight: no check pod checks the models, so a check that fails when the model works does not stop the converge |
129
- | `-n, --namespace <ns>` | the deployment's namespace (default: the config's `name`, then the Instance folder's name) |
130
- | `--context <ctx>` | the kube context (default: kubectl's current context) |
126
+ | `--skip-provider-preflight` | do not run the provider preflight: no check pod checks the models or reads an MCP server's tool list, so a check that fails while the model or server works does not stop the converge |
127
+
128
+ Also takes `-n, --namespace <ns>`, `--context <ctx>`: see [Global options](#global-options).
131
129
 
132
130
  **Environment**
133
131
 
@@ -157,8 +155,8 @@ Remove the instance from the cluster.
157
155
  | --- | --- |
158
156
  | `--all` | also uninstall the per-cluster operator |
159
157
  | `--yes` | do not ask for confirmation (for CI) |
160
- | `-n, --namespace <ns>` | the deployment's namespace (default: the config's `name`, then the Instance folder's name) |
161
- | `--context <ctx>` | the kube context (default: kubectl's current context) |
158
+
159
+ Also takes `-n, --namespace <ns>`, `--context <ctx>`: see [Global options](#global-options).
162
160
 
163
161
  **Output**: activity, activity on stderr only. See [Output](#output).
164
162
 
@@ -180,7 +178,8 @@ Remove jr2's images that no live instance names, and Repo resources no Machine b
180
178
  | --- | --- |
181
179
  | `--dry-run` | print what would be removed, and remove nothing |
182
180
  | `--repo-ttl <ttl>` | how long since a run last attached before an unbound Repo is garbage (default: 7d) |
183
- | `--context <ctx>` | the kube context (default: kubectl's current context) |
181
+
182
+ Also takes `--context <ctx>`: see [Global options](#global-options).
184
183
 
185
184
  **Output**: activity, activity on stderr only. See [Output](#output).
186
185
 
@@ -196,7 +195,7 @@ jr2 kit push <registry>
196
195
 
197
196
  Mirror the published kit images into a registry.
198
197
 
199
- The v0.6.0 kit images (harness, operator, orchestrator) from their canonical home, and the Custodian's pinned Envoy from its own, for a cluster whose `kitRegistry` names the registry.
198
+ The v0.7.0 kit images (harness, operator, orchestrator) from their canonical home, and the Custodian's pinned Envoy from its own, for a cluster whose `kitRegistry` names it.
200
199
 
201
200
  **Arguments**
202
201
 
@@ -213,7 +212,8 @@ The v0.6.0 kit images (harness, operator, orchestrator) from their canonical hom
213
212
  ### `jr2 run`
214
213
 
215
214
  ```sh
216
- jr2 run <workflow> [--input <json>] [--detach] [--url <u>] [-n <ns>] [--context <ctx>]
215
+ jr2 run <workflow> [--input <json>] [--detach] [--drop-held] [--url <u>] [-n <ns>]
216
+ [--context <ctx>]
217
217
  ```
218
218
 
219
219
  Start a run; stream activity, print terminal result.
@@ -224,6 +224,8 @@ A Chart that the door refuses prints one line for each rule that it fails.
224
224
 
225
225
  Exits 0 only for a run that ended done, and 1 for every other end: failed, error, cancelled, lost, drifted, or parked before it settled; a failed run prints its reason.
226
226
 
227
+ A standing Workflow: jr2 starts its run, so `jr2 run` only resumes a paused one, prints the new run, and returns.
228
+
227
229
  **Arguments**
228
230
 
229
231
  | Argument | Required | Description |
@@ -236,32 +238,54 @@ Exits 0 only for a run that ended done, and 1 for every other end: failed, error
236
238
  | --- | --- |
237
239
  | `--input <json>` | the run's input, as a JSON object (default: {}) |
238
240
  | `--detach` | print the runId and return, and do not stream |
239
- | `--url <u>` | attach to a specific orchestrator (skips kube entirely) |
240
- | `-n, --namespace <ns>` | the deployment's namespace (default: the config's `name`, then the Instance folder's name) |
241
- | `--context <ctx>` | the kube context (default: kubectl's current context) |
241
+ | `--drop-held` | resume a paused standing Workflow with no held item: its held items are not carried |
242
242
 
243
- **Environment**
244
-
245
- | Variable | Description |
246
- | --- | --- |
247
- | `JR2_URL` | the orchestrator to attach to, when `--url` is not given |
248
- | `JR2_TOKEN` | the Instance token to send: with `--url` / `JR2_URL` the only one, and otherwise used in place of the one read from the cluster |
243
+ Also takes `--url <u>`, `-n, --namespace <ns>`, `--context <ctx>`, `JR2_URL`, `JR2_TOKEN`: see [Global options](#global-options).
249
244
 
250
245
  **Output**: result, one JSON result on stdout, and activity on stderr. See [Output](#output).
251
246
 
252
- **Decisions**: [ADR-0009](decisions/0009-cli-and-instance-interface.md), [ADR-0070](decisions/0070-a-machine-lends-its-parts-to-a-chart.md), [ADR-0073](decisions/0073-a-machine-fails-a-run-with-fail-and-an-uncaught-failure-ends-it-failed.md).
247
+ **Decisions**: [ADR-0009](decisions/0009-cli-and-instance-interface.md), [ADR-0017](decisions/0017-pool-over-a-source-port.md), [ADR-0070](decisions/0070-a-machine-lends-its-parts-to-a-chart.md), [ADR-0073](decisions/0073-a-machine-fails-a-run-with-fail-and-an-uncaught-failure-ends-it-failed.md).
253
248
 
254
249
  <a id="runs"></a>
255
250
 
256
251
  ### `jr2 runs`
257
252
 
258
253
  ```sh
259
- jr2 runs [--workflows] [--url <u>] [-n <ns>] [--context <ctx>]
254
+ jr2 runs [--status <s>] [--workflow <name>] [--since <when>] [--url <u>] [-n <ns>]
255
+ [--context <ctx>]
260
256
  ```
261
257
 
262
- List live runs; "placing" names the Workspaces that wait for capacity, and "status `<runId>`" says why.
258
+ List runs, newest first (live by default); "placing" names the Workspaces that wait for capacity, and "status `<runId>`" says why.
259
+
260
+ Each run is a summary: runId, workflow, status, reason, startedBy, startedAt, endedAt, assembly, openGates; an ended run is listed while jr2 keeps it (runs.retain).
261
+
262
+ `jr2 workflows` lists the Workflows that a run can start.
263
263
 
264
- The Workflows a run can start on stderr, each with its origin (machine, chart file, chart) and a Chart wrapper's Charts under it; --workflows prints that listing as the result.
264
+ **Flags**
265
+
266
+ | Flag | Description |
267
+ | --- | --- |
268
+ | `--status <s>` | live (the default), ended, all, or a comma list such as done,failed,drifted |
269
+ | `--workflow <name>` | only the runs of this Workflow |
270
+ | `--since <when>` | only the runs that started since: a duration (2h, 7d) or an ISO-8601 time |
271
+
272
+ Also takes `--url <u>`, `-n, --namespace <ns>`, `--context <ctx>`, `JR2_URL`, `JR2_TOKEN`: see [Global options](#global-options).
273
+
274
+ **Output**: result, one JSON result on stdout, and activity on stderr. See [Output](#output).
275
+
276
+ **Decisions**: [ADR-0009](decisions/0009-cli-and-instance-interface.md), [ADR-0030](decisions/0030-a-snapshot-names-the-machine-it-was-written-under.md), [ADR-0064](decisions/0064-a-workspace-waits-for-capacity.md), [ADR-0065](decisions/0065-a-persist-survives-a-crash-and-history-is-kept-for-a-set-time.md).
277
+
278
+ <a id="workflows"></a>
279
+
280
+ ### `jr2 workflows`
281
+
282
+ ```sh
283
+ jr2 workflows [--json] [--url <u>] [-n <ns>] [--context <ctx>]
284
+ ```
285
+
286
+ List the Workflows that a run can start, each with its origin: machine, chart file or chart.
287
+
288
+ A Chart wrapper's named Charts indent under it; an unrunnable one says why.
265
289
 
266
290
  A runtime Chart has no verb: PUT or DELETE /workflows/`<wrapper>`/charts/`<name>` with the Instance token (an MCP or curl), then `jr2 run <wrapper>/<name>` starts it.
267
291
 
@@ -269,21 +293,41 @@ A runtime Chart has no verb: PUT or DELETE /workflows/`<wrapper>`/charts/`<name>
269
293
 
270
294
  | Flag | Description |
271
295
  | --- | --- |
272
- | `--workflows` | print the Workflow listing as the JSON result instead |
273
- | `--url <u>` | attach to a specific orchestrator (skips kube entirely) |
274
- | `-n, --namespace <ns>` | the deployment's namespace (default: the config's `name`, then the Instance folder's name) |
275
- | `--context <ctx>` | the kube context (default: kubectl's current context) |
296
+ | `--json` | print the listing (GET /workflows) as the one report object instead of the tree |
276
297
 
277
- **Environment**
298
+ Also takes `--url <u>`, `-n, --namespace <ns>`, `--context <ctx>`, `JR2_URL`, `JR2_TOKEN`: see [Global options](#global-options).
278
299
 
279
- | Variable | Description |
300
+ **Output**: report, a table or lines on stdout, or their JSON with `--json`, where the verb has it. See [Output](#output).
301
+
302
+ **Decisions**: [ADR-0009](decisions/0009-cli-and-instance-interface.md), [ADR-0070](decisions/0070-a-machine-lends-its-parts-to-a-chart.md).
303
+
304
+ <a id="gates"></a>
305
+
306
+ ### `jr2 gates`
307
+
308
+ ```sh
309
+ jr2 gates [--workflow <name>] [--url <u>] [-n <ns>] [--context <ctx>]
310
+ ```
311
+
312
+ List the open Gates that this Caller may answer, across the live runs, oldest first.
313
+
314
+ Each Gate is an entry: runId, workflow, gate, path, accepts, acceptsNow, meta, openedAt, and hook (the Hook kinds that it hears); never a run's context.
315
+
316
+ Needs the answer scope; a scope that names single Gates ({ workflow, gates }) lists only those Gates.
317
+
318
+ `jr2 send <runId> --gate <gate> --event <name>` answers one.
319
+
320
+ **Flags**
321
+
322
+ | Flag | Description |
280
323
  | --- | --- |
281
- | `JR2_URL` | the orchestrator to attach to, when `--url` is not given |
282
- | `JR2_TOKEN` | the Instance token to send: with `--url` / `JR2_URL` the only one, and otherwise used in place of the one read from the cluster |
324
+ | `--workflow <name>` | only the Gates of this Workflow's runs |
325
+
326
+ Also takes `--url <u>`, `-n, --namespace <ns>`, `--context <ctx>`, `JR2_URL`, `JR2_TOKEN`: see [Global options](#global-options).
283
327
 
284
328
  **Output**: result, one JSON result on stdout, and activity on stderr. See [Output](#output).
285
329
 
286
- **Decisions**: [ADR-0009](decisions/0009-cli-and-instance-interface.md), [ADR-0064](decisions/0064-a-workspace-waits-for-capacity.md), [ADR-0070](decisions/0070-a-machine-lends-its-parts-to-a-chart.md).
330
+ **Decisions**: [ADR-0009](decisions/0009-cli-and-instance-interface.md), [ADR-0011](decisions/0011-workflow-defined-events.md), [ADR-0078](decisions/0078-a-caller-comes-from-one-authenticator-seam-and-acts-within-its-scopes.md).
287
331
 
288
332
  <a id="status"></a>
289
333
 
@@ -308,56 +352,75 @@ A failed run prints its reason beside the result: failed: `<reason>`.
308
352
  | Flag | Description |
309
353
  | --- | --- |
310
354
  | `--json` | print the one report object on stdout instead of the table (without a runId) |
311
- | `--url <u>` | attach to a specific orchestrator (skips kube entirely) |
312
- | `-n, --namespace <ns>` | the deployment's namespace (default: the config's `name`, then the Instance folder's name) |
313
- | `--context <ctx>` | the kube context (default: kubectl's current context) |
314
355
 
315
- **Environment**
356
+ Also takes `--url <u>`, `-n, --namespace <ns>`, `--context <ctx>`, `JR2_URL`, `JR2_TOKEN`: see [Global options](#global-options).
316
357
 
317
- | Variable | Description |
358
+ **Output**: `jr2 status <runId>`: result, one JSON result on stdout, and activity on stderr; `jr2 bare status`: report, a table or lines on stdout, or their JSON with `--json`, where the verb has it. See [Output](#output).
359
+
360
+ **Decisions**: [ADR-0048](decisions/0048-the-orchestrator-boots-without-its-repos.md), [ADR-0051](decisions/0051-a-repo-is-a-slot-on-the-workspace-and-a-cache-on-the-node.md), [ADR-0073](decisions/0073-a-machine-fails-a-run-with-fail-and-an-uncaught-failure-ends-it-failed.md).
361
+
362
+ <a id="watch"></a>
363
+
364
+ ### `jr2 watch`
365
+
366
+ ```sh
367
+ jr2 watch <runId> [--json] [--url <u>] [-n <ns>] [--context <ctx>]
368
+ ```
369
+
370
+ Follow a run's feed to its end, with the lines that `jr2 run` prints while it is attached.
371
+
372
+ On attach it prints where the run is now; an ended run prints its last status once.
373
+
374
+ **Arguments**
375
+
376
+ | Argument | Required | Description |
377
+ | --- | --- | --- |
378
+ | `runId` | yes | the run, or a unique prefix of its id |
379
+
380
+ **Flags**
381
+
382
+ | Flag | Description |
318
383
  | --- | --- |
319
- | `JR2_URL` | the orchestrator to attach to, when `--url` is not given |
320
- | `JR2_TOKEN` | the Instance token to send: with `--url` / `JR2_URL` the only one, and otherwise used in place of the one read from the cluster |
384
+ | `--json` | print each status as one JSON line, and the other events on stderr |
321
385
 
322
- **Output**: `jr2 status <runId>`: result, one JSON result on stdout, and activity on stderr; `jr2 bare status`: report, a table on stdout, or the one report object with `--json`. See [Output](#output).
386
+ Also takes `--url <u>`, `-n, --namespace <ns>`, `--context <ctx>`, `JR2_URL`, `JR2_TOKEN`: see [Global options](#global-options).
323
387
 
324
- **Decisions**: [ADR-0048](decisions/0048-the-orchestrator-boots-without-its-repos.md), [ADR-0051](decisions/0051-a-repo-is-a-slot-on-the-workspace-and-a-cache-on-the-node.md), [ADR-0073](decisions/0073-a-machine-fails-a-run-with-fail-and-an-uncaught-failure-ends-it-failed.md).
388
+ **Output**: report, a table or lines on stdout, or their JSON with `--json`, where the verb has it. See [Output](#output).
389
+
390
+ **Decisions**: [ADR-0009](decisions/0009-cli-and-instance-interface.md), [ADR-0022](decisions/0022-observation-is-a-level-triggered-feed.md).
325
391
 
326
392
  <a id="logs"></a>
327
393
 
328
394
  ### `jr2 logs`
329
395
 
330
396
  ```sh
331
- jr2 logs <runId> [-f] [--url <u>] [-n <ns>] [--context <ctx>]
397
+ jr2 logs <runId> [agent] [-f] [--url <u>] [-n <ns>] [--context <ctx>]
332
398
  ```
333
399
 
334
- Replay a run's status; -f to follow until it settles.
400
+ Print a run's conversations as the Harness prints them, every Agent interleaved by time, or one Agent.
401
+
402
+ Each line is `[<agent>] [<instance id>] [<label>] <text>`; Menu-only Agents too; a Working tool's result is never in it.
403
+
404
+ Reads what the Orchestrator keeps of each conversation, so it works after the Sandbox is gone, while jr2 keeps the run (runs.retain); pod logs stay `kubectl logs`.
335
405
 
336
406
  **Arguments**
337
407
 
338
408
  | Argument | Required | Description |
339
409
  | --- | --- | --- |
340
410
  | `runId` | yes | the run, or a unique prefix of its id |
411
+ | `agent` | no | one Agent slot, as `jr2 steer <runId>` lists it, or an Agent name (default: every Agent) |
341
412
 
342
413
  **Flags**
343
414
 
344
415
  | Flag | Description |
345
416
  | --- | --- |
346
- | `-f, --follow` | follow until the run settles |
347
- | `--url <u>` | attach to a specific orchestrator (skips kube entirely) |
348
- | `-n, --namespace <ns>` | the deployment's namespace (default: the config's `name`, then the Instance folder's name) |
349
- | `--context <ctx>` | the kube context (default: kubectl's current context) |
417
+ | `-f, --follow` | print each new entry as it is kept, until the run is not live and no conversation is open |
350
418
 
351
- **Environment**
419
+ Also takes `--url <u>`, `-n, --namespace <ns>`, `--context <ctx>`, `JR2_URL`, `JR2_TOKEN`: see [Global options](#global-options).
352
420
 
353
- | Variable | Description |
354
- | --- | --- |
355
- | `JR2_URL` | the orchestrator to attach to, when `--url` is not given |
356
- | `JR2_TOKEN` | the Instance token to send: with `--url` / `JR2_URL` the only one, and otherwise used in place of the one read from the cluster |
421
+ **Output**: report, a table or lines on stdout, or their JSON with `--json`, where the verb has it. See [Output](#output).
357
422
 
358
- **Output**: result, one JSON result on stdout, and activity on stderr. See [Output](#output).
359
-
360
- **Decisions**: [ADR-0009](decisions/0009-cli-and-instance-interface.md).
423
+ **Decisions**: [ADR-0009](decisions/0009-cli-and-instance-interface.md), [ADR-0023](decisions/0023-the-harness-prints-the-conversation.md), [ADR-0065](decisions/0065-a-persist-survives-a-crash-and-history-is-kept-for-a-set-time.md).
361
424
 
362
425
  <a id="send"></a>
363
426
 
@@ -389,20 +452,296 @@ With `--gate <gate>`, `--event <name>`, `--input <json>`: deliver a workflow eve
389
452
  | `--gate <gate>` | the open gate to deliver the event to |
390
453
  | `--input <json>` | the event's input, as a JSON object (with --gate) |
391
454
  | `--keep` | with --event CANCEL: keep the Workspaces for inspection until the idle timeout |
392
- | `--url <u>` | attach to a specific orchestrator (skips kube entirely) |
393
- | `-n, --namespace <ns>` | the deployment's namespace (default: the config's `name`, then the Instance folder's name) |
394
- | `--context <ctx>` | the kube context (default: kubectl's current context) |
395
455
 
396
- **Environment**
456
+ Also takes `--url <u>`, `-n, --namespace <ns>`, `--context <ctx>`, `JR2_URL`, `JR2_TOKEN`: see [Global options](#global-options).
397
457
 
398
- | Variable | Description |
458
+ **Output**: activity, activity on stderr only. See [Output](#output).
459
+
460
+ **Decisions**: [ADR-0009](decisions/0009-cli-and-instance-interface.md), [ADR-0011](decisions/0011-workflow-defined-events.md), [ADR-0013](decisions/0013-the-agent-reaches-its-machine-through-a-container-it-cannot-read.md), [ADR-0025](decisions/0025-cancel-ends-a-run-stop-parks-it.md).
461
+
462
+ <a id="steer"></a>
463
+
464
+ ### `jr2 steer`
465
+
466
+ ```sh
467
+ jr2 steer <runId> [agent] [text] [--url <u>] [-n <ns>] [--context <ctx>]
468
+ ```
469
+
470
+ Send a Steering message to one Agent of a live run, or list the Agent slots that can hear one.
471
+
472
+ An open Turn of the slot hears it at its next step boundary; else, or when that Turn ends first, the slot's next Turn in its Machine instance hears it.
473
+
474
+ With a runId alone it prints the run's Agent slots, each with open and steerable; `jr2 status` prints the messages sent to the run, in `steering`.
475
+
476
+ Needs the steer scope for the run's Workflow.
477
+
478
+ **Arguments**
479
+
480
+ | Argument | Required | Description |
481
+ | --- | --- | --- |
482
+ | `runId` | yes | the run, or a unique prefix of its id |
483
+ | `agent` | no | the Agent slot, as the run's list names it |
484
+ | `text` | no | the message, at most 16 KiB |
485
+
486
+ Also takes `--url <u>`, `-n, --namespace <ns>`, `--context <ctx>`, `JR2_URL`, `JR2_TOKEN`: see [Global options](#global-options).
487
+
488
+ **Output**: `jr2 steer <runId> <agent> <text>`: activity, activity on stderr only; `jr2 steer <runId>`: result, one JSON result on stdout, and activity on stderr. See [Output](#output).
489
+
490
+ **Decisions**: [ADR-0002](decisions/0002-duplex-streaming-actor.md), [ADR-0062](decisions/0062-jr2-briefs-the-agent-on-its-seat-never-on-its-task.md), [ADR-0078](decisions/0078-a-caller-comes-from-one-authenticator-seam-and-acts-within-its-scopes.md).
491
+
492
+ <a id="whoami"></a>
493
+
494
+ ### `jr2 whoami`
495
+
496
+ ```sh
497
+ jr2 whoami [--url <u>] [-n <ns>] [--context <ctx>]
498
+ ```
499
+
500
+ Print the Caller this credential is: how jr2 knows it, its name, what it may do, and whom it acts for.
501
+
502
+ On a kube context the Caller is token/instance, on behalf of the kube user; with --url and JR2_TOKEN it is that token's Caller.
503
+
504
+ Needs no scope, so a credential that may do nothing still sees why.
505
+
506
+ Also takes `--url <u>`, `-n, --namespace <ns>`, `--context <ctx>`, `JR2_URL`, `JR2_TOKEN`: see [Global options](#global-options).
507
+
508
+ **Output**: result, one JSON result on stdout, and activity on stderr. See [Output](#output).
509
+
510
+ **Decisions**: [ADR-0078](decisions/0078-a-caller-comes-from-one-authenticator-seam-and-acts-within-its-scopes.md).
511
+
512
+ <a id="hooks"></a>
513
+
514
+ ### `jr2 hooks`
515
+
516
+ ```sh
517
+ jr2 hooks <name> [--limit <n>] [--url <u>] [-n <ns>] [--context <ctx>]
518
+ ```
519
+
520
+ Print a Hook's log: each delivery that jr2 keeps (runs.retain), newest first, and what the door did with it.
521
+
522
+ A line is a handshake, a delivery and its outcome, a repeat (seen), a payload the parse refused (with zod's issues), a request the kind could not read, or a failed follow-up post.
523
+
524
+ Needs the Instance token: no scope opens it.
525
+
526
+ **Arguments**
527
+
528
+ | Argument | Required | Description |
529
+ | --- | --- | --- |
530
+ | `name` | yes | the Hook, as `hooks` in jr2.config.ts names it |
531
+
532
+ **Flags**
533
+
534
+ | Flag | Description |
535
+ | --- | --- |
536
+ | `--limit <n>` | how many lines, newest first (default 50, at most 1000) |
537
+
538
+ Also takes `--url <u>`, `-n, --namespace <ns>`, `--context <ctx>`, `JR2_URL`, `JR2_TOKEN`: see [Global options](#global-options).
539
+
540
+ **Output**: result, one JSON result on stdout, and activity on stderr. See [Output](#output).
541
+
542
+ **Decisions**: [ADR-0011](decisions/0011-workflow-defined-events.md), [ADR-0078](decisions/0078-a-caller-comes-from-one-authenticator-seam-and-acts-within-its-scopes.md).
543
+
544
+ <a id="caller-token"></a>
545
+
546
+ ### `jr2 caller token`
547
+
548
+ ```sh
549
+ jr2 caller token <name> [-n <ns>] [--context <ctx>]
550
+ ```
551
+
552
+ Print a named Caller token's value, read from its Secret over the kube API.
553
+
554
+ `jr2 up` makes the value once, for each name that `callers.tokens` declares.
555
+
556
+ **Arguments**
557
+
558
+ | Argument | Required | Description |
559
+ | --- | --- | --- |
560
+ | `name` | yes | the named Caller token, as `callers.tokens` declares it |
561
+
562
+ Also takes `-n, --namespace <ns>`, `--context <ctx>`: see [Global options](#global-options).
563
+
564
+ **Output**: value, one value alone on stdout, for `$(…)`, and activity on stderr. See [Output](#output).
565
+
566
+ **Decisions**: [ADR-0078](decisions/0078-a-caller-comes-from-one-authenticator-seam-and-acts-within-its-scopes.md).
567
+
568
+ <a id="caller-rotate"></a>
569
+
570
+ ### `jr2 caller rotate`
571
+
572
+ ```sh
573
+ jr2 caller rotate <name> [-n <ns>] [--context <ctx>]
574
+ ```
575
+
576
+ Make a new value for a named Caller token; the old value stops working.
577
+
578
+ Returns when the Orchestrator has loaded the new digest (about a minute), so the old value is then refused; after 150s it fails, and the old value works until the load.
579
+
580
+ Prints no value: `jr2 caller token <name>` prints the new one.
581
+
582
+ **Arguments**
583
+
584
+ | Argument | Required | Description |
585
+ | --- | --- | --- |
586
+ | `name` | yes | the named Caller token, as `callers.tokens` declares it |
587
+
588
+ Also takes `-n, --namespace <ns>`, `--context <ctx>`: see [Global options](#global-options).
589
+
590
+ **Output**: activity, activity on stderr only. See [Output](#output).
591
+
592
+ **Decisions**: [ADR-0078](decisions/0078-a-caller-comes-from-one-authenticator-seam-and-acts-within-its-scopes.md).
593
+
594
+ <a id="workspace-ls"></a>
595
+
596
+ ### `jr2 workspace ls`
597
+
598
+ ```sh
599
+ jr2 workspace ls [run] [--json] [-n <ns>] [--context <ctx>]
600
+ ```
601
+
602
+ List the Workspaces: handle, Sandbox name, Workflow, phase, age, and whether a run holds it.
603
+
604
+ Reads the Sandbox CRs over the kube API, with no Orchestrator: kube RBAC is the gate.
605
+
606
+ A handle is `<run-prefix>`/<workspace path>, or the Sandbox's name.
607
+
608
+ Held: the run's Lease marked it (a live run, or one that an Orchestrator crash left); released: its run is over; idle: no Lease renewed it for the idle timeout.
609
+
610
+ **Arguments**
611
+
612
+ | Argument | Required | Description |
613
+ | --- | --- | --- |
614
+ | `run` | no | only the Workspaces of this run, or of a prefix of its id |
615
+
616
+ **Flags**
617
+
618
+ | Flag | Description |
399
619
  | --- | --- |
400
- | `JR2_URL` | the orchestrator to attach to, when `--url` is not given |
401
- | `JR2_TOKEN` | the Instance token to send: with `--url` / `JR2_URL` the only one, and otherwise used in place of the one read from the cluster |
620
+ | `--json` | print the one report object on stdout instead of the table |
621
+
622
+ Also takes `-n, --namespace <ns>`, `--context <ctx>`: see [Global options](#global-options).
623
+
624
+ **Output**: report, a table or lines on stdout, or their JSON with `--json`, where the verb has it. See [Output](#output).
625
+
626
+ **Decisions**: [ADR-0009](decisions/0009-cli-and-instance-interface.md), [ADR-0012](decisions/0012-workspace-wrapper-machine.md), [ADR-0021](decisions/0021-workspace-continuity-is-a-lease-that-answers-back.md).
627
+
628
+ <a id="workspace-shell"></a>
629
+
630
+ ### `jr2 workspace shell`
631
+
632
+ ```sh
633
+ jr2 workspace shell <ws> [-- cmd] [--user] [-n <ns>] [--context <ctx>]
634
+ ```
635
+
636
+ A shell in the Workspace as its Agents work: started by the Harness's spawner in the Agents' Landlock domain, with the Workspace's granted Stand-ins and its folder.
637
+
638
+ It never reaches the control Stand-in or a Stand-in that the Workspace does not grant.
639
+
640
+ `jr2 workspace shell <ws> -- git status` runs one command with no terminal: Ctrl-C ends jr2, and the command gets the end of its input but no signal, so one that ignores it (a dev server) runs on.
641
+
642
+ **Arguments**
643
+
644
+ | Argument | Required | Description |
645
+ | --- | --- | --- |
646
+ | `ws` | yes | the Workspace: `<run-prefix>`/`<path>`, or its Sandbox's name |
647
+ | `-- cmd` | no | one command to run in place of a shell |
648
+
649
+ **Flags**
650
+
651
+ | Flag | Description |
652
+ | --- | --- |
653
+ | `--user` | a shell in the User Container (`kubectl exec -c user`), which needs a shell in its image |
654
+
655
+ Also takes `-n, --namespace <ns>`, `--context <ctx>`: see [Global options](#global-options).
402
656
 
403
657
  **Output**: activity, activity on stderr only. See [Output](#output).
404
658
 
405
- **Decisions**: [ADR-0009](decisions/0009-cli-and-instance-interface.md), [ADR-0011](decisions/0011-workflow-defined-events.md), [ADR-0013](decisions/0013-the-agent-reaches-its-machine-through-a-container-it-cannot-read.md), [ADR-0025](decisions/0025-cancel-ends-a-run-stop-parks-it.md).
659
+ **Decisions**: [ADR-0009](decisions/0009-cli-and-instance-interface.md), [ADR-0076](decisions/0076-an-agents-control-credential-lives-only-where-no-workspace-code-runs.md).
660
+
661
+ <a id="workspace-forward"></a>
662
+
663
+ ### `jr2 workspace forward`
664
+
665
+ ```sh
666
+ jr2 workspace forward <ws> <port> [--stdio] [-n <ns>] [--context <ctx>]
667
+ ```
668
+
669
+ Forward a local port to a port in the Workspace's pod; prints 127.0.0.1:`<port>` and holds it until Ctrl-C.
670
+
671
+ Ssh: Host *.jr2 with ProxyCommand jr2 workspace forward %h 22 --stdio -n `<ns>`, then ssh <sandbox name>.jr2.
672
+
673
+ There is no Service for the User Container: the forward goes through the kube API.
674
+
675
+ **Arguments**
676
+
677
+ | Argument | Required | Description |
678
+ | --- | --- | --- |
679
+ | `ws` | yes | the Workspace: `<run-prefix>`/`<path>`, its Sandbox's name, or `<name>`.jr2 |
680
+ | `port` | yes | the port in the Sandbox pod |
681
+
682
+ **Flags**
683
+
684
+ | Flag | Description |
685
+ | --- | --- |
686
+ | `--stdio` | carry one connection on stdin and stdout, for an ssh ProxyCommand |
687
+
688
+ Also takes `-n, --namespace <ns>`, `--context <ctx>`: see [Global options](#global-options).
689
+
690
+ **Output**: value, one value alone on stdout, for `$(…)`, and activity on stderr. See [Output](#output).
691
+
692
+ **Decisions**: [ADR-0005](decisions/0005-sandbox-pod-composition.md), [ADR-0009](decisions/0009-cli-and-instance-interface.md).
693
+
694
+ <a id="workspace-rm"></a>
695
+
696
+ ### `jr2 workspace rm`
697
+
698
+ ```sh
699
+ jr2 workspace rm <ws> [-n <ns>] [--context <ctx>]
700
+ ```
701
+
702
+ Remove a Sandbox that no run holds: released, or idle past its idle timeout.
703
+
704
+ Refuses the Sandbox of a live run: cancel the run first; there is no --force.
705
+
706
+ The keepalive's age is read on the API server's clock.
707
+
708
+ **Arguments**
709
+
710
+ | Argument | Required | Description |
711
+ | --- | --- | --- |
712
+ | `ws` | yes | the Workspace: `<run-prefix>`/`<path>`, or its Sandbox's name |
713
+
714
+ Also takes `-n, --namespace <ns>`, `--context <ctx>`: see [Global options](#global-options).
715
+
716
+ **Output**: activity, activity on stderr only. See [Output](#output).
717
+
718
+ **Decisions**: [ADR-0009](decisions/0009-cli-and-instance-interface.md), [ADR-0021](decisions/0021-workspace-continuity-is-a-lease-that-answers-back.md).
719
+
720
+ <a id="completion"></a>
721
+
722
+ ### `jr2 completion`
723
+
724
+ ```sh
725
+ jr2 completion <shell>
726
+ ```
727
+
728
+ Print the shell completion script.
729
+
730
+ The script asks this jr2 for each completion, so the verbs and flags are the command table's.
731
+
732
+ It completes Workspace handles, live run ids, Workflow names and a run's Agent slots too; a lookup that takes more than 2 s offers nothing.
733
+
734
+ Bash: source <(jr2 completion bash); zsh: source <(jr2 completion zsh); fish: jr2 completion fish | source.
735
+
736
+ **Arguments**
737
+
738
+ | Argument | Required | Description |
739
+ | --- | --- | --- |
740
+ | `shell` | yes | bash, zsh or fish |
741
+
742
+ **Output**: value, one value alone on stdout, for `$(…)`, and activity on stderr. See [Output](#output).
743
+
744
+ **Decisions**: [ADR-0009](decisions/0009-cli-and-instance-interface.md).
406
745
 
407
746
  <a id="run-ids"></a>
408
747
 
@@ -420,7 +759,7 @@ The Instance's .env is loaded before any verb; a variable already set in the env
420
759
 
421
760
  ## Output
422
761
 
423
- Result verbs (kit push, run, runs, status `<runId>`, logs) print one JSON result on stdout and activity on stderr, so `jr2 run … | jq` yields the result; report verbs (version, bare status) print a table on stdout, or the one object with --json; activity verbs (init, check, up, down, gc, send) print activity alone.
762
+ Result verbs (kit push, run, runs, gates, status `<runId>`, steer `<runId>`, whoami, hooks) print one JSON result on stdout and activity on stderr, so `jr2 run … | jq` yields the result; report verbs (version, workflows, bare status, watch, logs, workspace ls) print a table or lines on stdout, or their JSON with --json (watch: one JSON line for each status; logs has no --json); activity verbs (init, check, up, down, gc, send, steer `<runId>` `<agent>` `<text>`, caller rotate, workspace shell, workspace rm) print activity alone; value verbs (caller token, workspace forward, completion) print one value alone on stdout, for `$(…)`, and activity on stderr.
424
763
 
425
764
  <a id="exit-codes"></a>
426
765