@openrig/cli 0.7.15 → 0.7.16

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 (402) hide show
  1. package/README.md +5 -5
  2. package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +1 -1
  3. package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +1 -1
  4. package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
  5. package/daemon/assets/plugins/openrig/README.md +26 -7
  6. package/daemon/assets/plugins/openrig/plugin.json +1 -1
  7. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
  8. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
  9. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +4 -1
  10. package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +1 -1
  11. package/daemon/assets/skills/rigs/SKILL.md +105 -30
  12. package/daemon/context-packs/help/manifest.yaml +1 -1
  13. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  14. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +92 -17
  15. package/daemon/context-packs/reference/getting-started.md +9 -8
  16. package/daemon/context-packs/reference/manifest.yaml +4 -1
  17. package/daemon/context-packs/reference/product-journey-sdlc.md +348 -0
  18. package/daemon/context-packs/reference/rig-spec.md +92 -4
  19. package/daemon/context-packs/reference/whats-new.md +210 -5
  20. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  21. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  22. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  23. package/daemon/context-packs/skills/claude-compaction-restore/SKILL.md +4 -1
  24. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  25. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  26. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  27. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  28. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  29. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  30. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  31. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  33. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  34. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  35. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  36. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  37. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  38. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  40. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  46. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  53. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  54. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  56. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  66. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  68. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/seat-continuity-and-handover/SKILL.md +1 -1
  72. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  73. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  74. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  75. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  76. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  77. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  78. package/daemon/dist/adapters/claude-code-adapter.js +6 -3
  79. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  80. package/daemon/dist/adapters/codex-resume.d.ts +2 -0
  81. package/daemon/dist/adapters/codex-resume.d.ts.map +1 -1
  82. package/daemon/dist/adapters/codex-resume.js +28 -11
  83. package/daemon/dist/adapters/codex-resume.js.map +1 -1
  84. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +15 -0
  85. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  86. package/daemon/dist/adapters/codex-runtime-adapter.js +75 -28
  87. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  88. package/daemon/dist/adapters/tmux.d.ts +3 -0
  89. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  90. package/daemon/dist/adapters/tmux.js +16 -2
  91. package/daemon/dist/adapters/tmux.js.map +1 -1
  92. package/daemon/dist/build-info.js +3 -3
  93. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  94. package/daemon/dist/db/all-migrations.js +4 -0
  95. package/daemon/dist/db/all-migrations.js.map +1 -1
  96. package/daemon/dist/db/migrations/167_seat_handover_attempts.d.ts +14 -0
  97. package/daemon/dist/db/migrations/167_seat_handover_attempts.d.ts.map +1 -0
  98. package/daemon/dist/db/migrations/167_seat_handover_attempts.js +54 -0
  99. package/daemon/dist/db/migrations/167_seat_handover_attempts.js.map +1 -0
  100. package/daemon/dist/db/migrations/169_seat_runtime_home_records.d.ts +5 -0
  101. package/daemon/dist/db/migrations/169_seat_runtime_home_records.d.ts.map +1 -0
  102. package/daemon/dist/db/migrations/169_seat_runtime_home_records.js +25 -0
  103. package/daemon/dist/db/migrations/169_seat_runtime_home_records.js.map +1 -0
  104. package/daemon/dist/domain/claim-service.d.ts +1 -3
  105. package/daemon/dist/domain/claim-service.d.ts.map +1 -1
  106. package/daemon/dist/domain/claim-service.js +3 -1
  107. package/daemon/dist/domain/claim-service.js.map +1 -1
  108. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +11 -0
  109. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  110. package/daemon/dist/domain/claude-compaction-enforcer.js +83 -36
  111. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  112. package/daemon/dist/domain/codex-filesystem-preflight.d.ts +33 -0
  113. package/daemon/dist/domain/codex-filesystem-preflight.d.ts.map +1 -0
  114. package/daemon/dist/domain/codex-filesystem-preflight.js +255 -0
  115. package/daemon/dist/domain/codex-filesystem-preflight.js.map +1 -0
  116. package/daemon/dist/domain/codex-member-permissions.d.ts +23 -2
  117. package/daemon/dist/domain/codex-member-permissions.d.ts.map +1 -1
  118. package/daemon/dist/domain/codex-member-permissions.js +55 -9
  119. package/daemon/dist/domain/codex-member-permissions.js.map +1 -1
  120. package/daemon/dist/domain/codex-network-default.d.ts +13 -0
  121. package/daemon/dist/domain/codex-network-default.d.ts.map +1 -1
  122. package/daemon/dist/domain/codex-network-default.js +37 -30
  123. package/daemon/dist/domain/codex-network-default.js.map +1 -1
  124. package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
  125. package/daemon/dist/domain/compaction-restore-notice.js +59 -13
  126. package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
  127. package/daemon/dist/domain/destination-successor.d.ts +3 -0
  128. package/daemon/dist/domain/destination-successor.d.ts.map +1 -0
  129. package/daemon/dist/domain/destination-successor.js +49 -0
  130. package/daemon/dist/domain/destination-successor.js.map +1 -0
  131. package/daemon/dist/domain/health-passive-ceremony.d.ts +3 -0
  132. package/daemon/dist/domain/health-passive-ceremony.d.ts.map +1 -1
  133. package/daemon/dist/domain/health-passive-ceremony.js +45 -4
  134. package/daemon/dist/domain/health-passive-ceremony.js.map +1 -1
  135. package/daemon/dist/domain/hosts/fleet-scopes.d.ts +111 -0
  136. package/daemon/dist/domain/hosts/fleet-scopes.d.ts.map +1 -0
  137. package/daemon/dist/domain/hosts/fleet-scopes.js +231 -0
  138. package/daemon/dist/domain/hosts/fleet-scopes.js.map +1 -0
  139. package/daemon/dist/domain/hosts/read-through.d.ts +1 -1
  140. package/daemon/dist/domain/hosts/read-through.d.ts.map +1 -1
  141. package/daemon/dist/domain/hosts/read-through.js +4 -0
  142. package/daemon/dist/domain/hosts/read-through.js.map +1 -1
  143. package/daemon/dist/domain/native-permission-store.d.ts.map +1 -1
  144. package/daemon/dist/domain/native-permission-store.js +12 -5
  145. package/daemon/dist/domain/native-permission-store.js.map +1 -1
  146. package/daemon/dist/domain/native-process-lineage.d.ts +11 -1
  147. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
  148. package/daemon/dist/domain/native-process-lineage.js +25 -4
  149. package/daemon/dist/domain/native-process-lineage.js.map +1 -1
  150. package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
  151. package/daemon/dist/domain/native-resume-probe.js +31 -15
  152. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  153. package/daemon/dist/domain/node-launcher.d.ts +3 -0
  154. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  155. package/daemon/dist/domain/node-launcher.js +6 -0
  156. package/daemon/dist/domain/node-launcher.js.map +1 -1
  157. package/daemon/dist/domain/permission-account.d.ts.map +1 -1
  158. package/daemon/dist/domain/permission-account.js +8 -6
  159. package/daemon/dist/domain/permission-account.js.map +1 -1
  160. package/daemon/dist/domain/permission-drift.d.ts.map +1 -1
  161. package/daemon/dist/domain/permission-drift.js +1 -1
  162. package/daemon/dist/domain/permission-drift.js.map +1 -1
  163. package/daemon/dist/domain/queue-destination-check.d.ts +2 -0
  164. package/daemon/dist/domain/queue-destination-check.d.ts.map +1 -1
  165. package/daemon/dist/domain/queue-destination-check.js +8 -11
  166. package/daemon/dist/domain/queue-destination-check.js.map +1 -1
  167. package/daemon/dist/domain/queue-repository.d.ts +20 -15
  168. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  169. package/daemon/dist/domain/queue-repository.js +37 -49
  170. package/daemon/dist/domain/queue-repository.js.map +1 -1
  171. package/daemon/dist/domain/queue-transition-log.d.ts +6 -0
  172. package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
  173. package/daemon/dist/domain/queue-transition-log.js +9 -0
  174. package/daemon/dist/domain/queue-transition-log.js.map +1 -1
  175. package/daemon/dist/domain/queue-waiting.d.ts +4 -4
  176. package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
  177. package/daemon/dist/domain/queue-waiting.js +30 -16
  178. package/daemon/dist/domain/queue-waiting.js.map +1 -1
  179. package/daemon/dist/domain/receiver-context.js +1 -1
  180. package/daemon/dist/domain/receiver-context.js.map +1 -1
  181. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  182. package/daemon/dist/domain/restore-orchestrator.js +40 -18
  183. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  184. package/daemon/dist/domain/resume-metadata-refresher.d.ts +17 -4
  185. package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
  186. package/daemon/dist/domain/resume-metadata-refresher.js +60 -14
  187. package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
  188. package/daemon/dist/domain/resume-token-capture.d.ts +6 -0
  189. package/daemon/dist/domain/resume-token-capture.d.ts.map +1 -1
  190. package/daemon/dist/domain/resume-token-capture.js +14 -8
  191. package/daemon/dist/domain/resume-token-capture.js.map +1 -1
  192. package/daemon/dist/domain/rig-edge-ops.js +1 -1
  193. package/daemon/dist/domain/rig-edge-ops.js.map +1 -1
  194. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  195. package/daemon/dist/domain/rigspec-instantiator.js +6 -2
  196. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  197. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  198. package/daemon/dist/domain/rigspec-preflight.js +21 -1
  199. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  200. package/daemon/dist/domain/rosters.d.ts +19 -0
  201. package/daemon/dist/domain/rosters.d.ts.map +1 -1
  202. package/daemon/dist/domain/rosters.js +69 -12
  203. package/daemon/dist/domain/rosters.js.map +1 -1
  204. package/daemon/dist/domain/runtime-adapter.d.ts +15 -0
  205. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  206. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  207. package/daemon/dist/domain/seat-delivery-guard.d.ts +8 -2
  208. package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
  209. package/daemon/dist/domain/seat-delivery-guard.js +38 -3
  210. package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
  211. package/daemon/dist/domain/seat-handover-attempts.d.ts +50 -0
  212. package/daemon/dist/domain/seat-handover-attempts.d.ts.map +1 -0
  213. package/daemon/dist/domain/seat-handover-attempts.js +75 -0
  214. package/daemon/dist/domain/seat-handover-attempts.js.map +1 -0
  215. package/daemon/dist/domain/seat-handover-service.d.ts +64 -1
  216. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  217. package/daemon/dist/domain/seat-handover-service.js +437 -28
  218. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  219. package/daemon/dist/domain/seat-lifecycle-service.d.ts +47 -2
  220. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  221. package/daemon/dist/domain/seat-lifecycle-service.js +48 -2
  222. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  223. package/daemon/dist/domain/seat-runtime-home-record-types.d.ts +16 -0
  224. package/daemon/dist/domain/seat-runtime-home-record-types.d.ts.map +1 -0
  225. package/daemon/dist/domain/seat-runtime-home-record-types.js +2 -0
  226. package/daemon/dist/domain/seat-runtime-home-record-types.js.map +1 -0
  227. package/daemon/dist/domain/seat-runtime-home-record.d.ts +173 -0
  228. package/daemon/dist/domain/seat-runtime-home-record.d.ts.map +1 -0
  229. package/daemon/dist/domain/seat-runtime-home-record.js +317 -0
  230. package/daemon/dist/domain/seat-runtime-home-record.js.map +1 -0
  231. package/daemon/dist/domain/seat-runtime-switch-service.d.ts +7 -0
  232. package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
  233. package/daemon/dist/domain/seat-runtime-switch-service.js +47 -2
  234. package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
  235. package/daemon/dist/domain/seat-skill-storage.d.ts +16 -1
  236. package/daemon/dist/domain/seat-skill-storage.d.ts.map +1 -1
  237. package/daemon/dist/domain/seat-skill-storage.js +178 -1
  238. package/daemon/dist/domain/seat-skill-storage.js.map +1 -1
  239. package/daemon/dist/domain/session-transport.d.ts +1 -0
  240. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  241. package/daemon/dist/domain/session-transport.js +6 -2
  242. package/daemon/dist/domain/session-transport.js.map +1 -1
  243. package/daemon/dist/domain/skill-catalog.d.ts +3 -0
  244. package/daemon/dist/domain/skill-catalog.d.ts.map +1 -1
  245. package/daemon/dist/domain/skill-catalog.js +7 -3
  246. package/daemon/dist/domain/skill-catalog.js.map +1 -1
  247. package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
  248. package/daemon/dist/domain/snapshot-capture.js +5 -0
  249. package/daemon/dist/domain/snapshot-capture.js.map +1 -1
  250. package/daemon/dist/domain/successor-session-launcher.d.ts +16 -0
  251. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  252. package/daemon/dist/domain/successor-session-launcher.js +70 -38
  253. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  254. package/daemon/dist/domain/types.d.ts +34 -1
  255. package/daemon/dist/domain/types.d.ts.map +1 -1
  256. package/daemon/dist/domain/types.js.map +1 -1
  257. package/daemon/dist/domain/user-settings/settings-browser.d.ts.map +1 -1
  258. package/daemon/dist/domain/user-settings/settings-browser.js +3 -1
  259. package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
  260. package/daemon/dist/domain/workflow-exception-escalation.d.ts.map +1 -1
  261. package/daemon/dist/domain/workflow-exception-escalation.js +13 -8
  262. package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -1
  263. package/daemon/dist/domain/workflow-instance-store.d.ts +11 -0
  264. package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
  265. package/daemon/dist/domain/workflow-instance-store.js +35 -0
  266. package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
  267. package/daemon/dist/domain/workflow-projector.d.ts +7 -0
  268. package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
  269. package/daemon/dist/domain/workflow-projector.js +202 -91
  270. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  271. package/daemon/dist/domain/workflow-runtime.d.ts +7 -1
  272. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  273. package/daemon/dist/domain/workflow-runtime.js +116 -26
  274. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  275. package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
  276. package/daemon/dist/lib/pane-envelope.js +12 -7
  277. package/daemon/dist/lib/pane-envelope.js.map +1 -1
  278. package/daemon/dist/routes/compaction.d.ts.map +1 -1
  279. package/daemon/dist/routes/compaction.js +6 -3
  280. package/daemon/dist/routes/compaction.js.map +1 -1
  281. package/daemon/dist/routes/queue.d.ts.map +1 -1
  282. package/daemon/dist/routes/queue.js +44 -27
  283. package/daemon/dist/routes/queue.js.map +1 -1
  284. package/daemon/dist/routes/scopes.d.ts.map +1 -1
  285. package/daemon/dist/routes/scopes.js +102 -19
  286. package/daemon/dist/routes/scopes.js.map +1 -1
  287. package/daemon/dist/routes/seat.d.ts.map +1 -1
  288. package/daemon/dist/routes/seat.js +50 -2
  289. package/daemon/dist/routes/seat.js.map +1 -1
  290. package/daemon/dist/routes/sessions.d.ts.map +1 -1
  291. package/daemon/dist/routes/sessions.js +54 -10
  292. package/daemon/dist/routes/sessions.js.map +1 -1
  293. package/daemon/dist/routes/startup.d.ts.map +1 -1
  294. package/daemon/dist/routes/startup.js +116 -18
  295. package/daemon/dist/routes/startup.js.map +1 -1
  296. package/daemon/dist/routes/transport.d.ts.map +1 -1
  297. package/daemon/dist/routes/transport.js +36 -2
  298. package/daemon/dist/routes/transport.js.map +1 -1
  299. package/daemon/dist/routes/watchdog.d.ts.map +1 -1
  300. package/daemon/dist/routes/watchdog.js +7 -1
  301. package/daemon/dist/routes/watchdog.js.map +1 -1
  302. package/daemon/dist/routes/workflow.d.ts.map +1 -1
  303. package/daemon/dist/routes/workflow.js +22 -4
  304. package/daemon/dist/routes/workflow.js.map +1 -1
  305. package/daemon/dist/startup.d.ts.map +1 -1
  306. package/daemon/dist/startup.js +105 -37
  307. package/daemon/dist/startup.js.map +1 -1
  308. package/daemon/docs/reference/agent-startup-guide.md +87 -0
  309. package/daemon/docs/reference/daemon-http-clients.md +1 -0
  310. package/daemon/docs/reference/developing.md +1 -1
  311. package/daemon/docs/reference/gateway-participants.md +5 -3
  312. package/daemon/docs/reference/getting-started.md +9 -8
  313. package/daemon/docs/reference/quickstart.md +2 -2
  314. package/daemon/docs/reference/rig-spec.md +92 -4
  315. package/daemon/docs/reference/rosters.md +26 -0
  316. package/daemon/docs/reference/seat-delivery.md +7 -1
  317. package/daemon/docs/reference/whats-new.md +210 -5
  318. package/dist/build-info.js +3 -3
  319. package/dist/client.d.ts +7 -3
  320. package/dist/client.d.ts.map +1 -1
  321. package/dist/client.js +11 -2
  322. package/dist/client.js.map +1 -1
  323. package/dist/commands/launch.d.ts.map +1 -1
  324. package/dist/commands/launch.js +8 -0
  325. package/dist/commands/launch.js.map +1 -1
  326. package/dist/commands/mcp.d.ts.map +1 -1
  327. package/dist/commands/mcp.js +18 -1
  328. package/dist/commands/mcp.js.map +1 -1
  329. package/dist/commands/ps.d.ts.map +1 -1
  330. package/dist/commands/ps.js +11 -5
  331. package/dist/commands/ps.js.map +1 -1
  332. package/dist/commands/queue.d.ts.map +1 -1
  333. package/dist/commands/queue.js +6 -2
  334. package/dist/commands/queue.js.map +1 -1
  335. package/dist/commands/roster.d.ts +4 -2
  336. package/dist/commands/roster.d.ts.map +1 -1
  337. package/dist/commands/roster.js +2 -2
  338. package/dist/commands/roster.js.map +1 -1
  339. package/dist/commands/seat.d.ts +2 -0
  340. package/dist/commands/seat.d.ts.map +1 -1
  341. package/dist/commands/seat.js +198 -11
  342. package/dist/commands/seat.js.map +1 -1
  343. package/dist/commands/send.d.ts.map +1 -1
  344. package/dist/commands/send.js +31 -6
  345. package/dist/commands/send.js.map +1 -1
  346. package/dist/commands/walk.d.ts.map +1 -1
  347. package/dist/commands/walk.js +4 -0
  348. package/dist/commands/walk.js.map +1 -1
  349. package/dist/commands/workflow.d.ts.map +1 -1
  350. package/dist/commands/workflow.js +25 -1
  351. package/dist/commands/workflow.js.map +1 -1
  352. package/dist/mcp-http.d.ts +3 -0
  353. package/dist/mcp-http.d.ts.map +1 -1
  354. package/dist/mcp-http.js +13 -0
  355. package/dist/mcp-http.js.map +1 -1
  356. package/dist/mcp-server.d.ts +9 -2
  357. package/dist/mcp-server.d.ts.map +1 -1
  358. package/dist/mcp-server.js +243 -64
  359. package/dist/mcp-server.js.map +1 -1
  360. package/package.json +1 -1
  361. package/tui/dist/commands/registry.d.ts.map +1 -1
  362. package/tui/dist/commands/registry.js +1 -0
  363. package/tui/dist/commands/registry.js.map +1 -1
  364. package/tui/dist/crash-cart/start-daemon.d.ts.map +1 -1
  365. package/tui/dist/crash-cart/start-daemon.js +4 -2
  366. package/tui/dist/crash-cart/start-daemon.js.map +1 -1
  367. package/tui/dist/daemon-client.d.ts +9 -0
  368. package/tui/dist/daemon-client.d.ts.map +1 -1
  369. package/tui/dist/daemon-client.js +40 -0
  370. package/tui/dist/daemon-client.js.map +1 -1
  371. package/tui/dist/hydrate.d.ts +1 -1
  372. package/tui/dist/hydrate.d.ts.map +1 -1
  373. package/tui/dist/hydrate.js +12 -0
  374. package/tui/dist/hydrate.js.map +1 -1
  375. package/tui/dist/main.js +3 -0
  376. package/tui/dist/main.js.map +1 -1
  377. package/tui/dist/page-read.d.ts.map +1 -1
  378. package/tui/dist/page-read.js +2 -1
  379. package/tui/dist/page-read.js.map +1 -1
  380. package/tui/dist/render.d.ts.map +1 -1
  381. package/tui/dist/render.js +4 -1
  382. package/tui/dist/render.js.map +1 -1
  383. package/tui/dist/scopes/fleet-scopes-model.d.ts +73 -0
  384. package/tui/dist/scopes/fleet-scopes-model.d.ts.map +1 -0
  385. package/tui/dist/scopes/fleet-scopes-model.js +102 -0
  386. package/tui/dist/scopes/fleet-scopes-model.js.map +1 -0
  387. package/tui/dist/scopes/scopes-model.d.ts +2 -0
  388. package/tui/dist/scopes/scopes-model.d.ts.map +1 -1
  389. package/tui/dist/scopes/scopes-model.js +7 -4
  390. package/tui/dist/scopes/scopes-model.js.map +1 -1
  391. package/tui/dist/sections.d.ts.map +1 -1
  392. package/tui/dist/sections.js +5 -0
  393. package/tui/dist/sections.js.map +1 -1
  394. package/tui/dist/startup.d.ts +5 -0
  395. package/tui/dist/startup.d.ts.map +1 -1
  396. package/tui/dist/startup.js +12 -0
  397. package/tui/dist/startup.js.map +1 -1
  398. package/tui/dist/state.d.ts.map +1 -1
  399. package/tui/dist/state.js +12 -5
  400. package/tui/dist/state.js.map +1 -1
  401. package/tui/dist/types.d.ts +16 -1
  402. package/tui/dist/types.d.ts.map +1 -1
@@ -1,7 +1,8 @@
1
+ import { randomUUID } from "node:crypto";
1
2
  import { accountHomePlanMatches } from "../lib/account-home-switch.js";
2
3
  import { readFileSync } from "node:fs";
3
4
  import { Command } from "commander";
4
- import { DaemonClient, DaemonTimeoutError, terminalAuthHeaders } from "../client.js";
5
+ import { DaemonClient, DaemonConnectionError, DaemonResponseError, DaemonTimeoutError, terminalAuthHeaders } from "../client.js";
5
6
  import { getDaemonStatus, getDaemonUrl, daemonStatusGuard } from "../daemon-lifecycle.js";
6
7
  import { realDeps } from "./daemon.js";
7
8
  import { shellQuote } from "../cross-host-executor.js";
@@ -238,13 +239,24 @@ function printHumanHandoverResult(result) {
238
239
  }
239
240
  // OPR.0.5.5.5 — the per-source execution record: what actually carried context.
240
241
  if (result.sourceOutcome?.mode === "fork") {
241
- console.log(`Native fork of ${result.sourceOutcome.forkedFrom}: the successor carries the incumbent conversation from its first byte.`);
242
- if (result.sourceOutcome.forkId === "pending")
243
- console.log(`Fork id: PENDING. ${result.sourceOutcome.limit ?? ""}`.trim());
242
+ if (result.sourceOutcome.forkId === "none") {
243
+ // #3044: a recovered fork successor on its parent's or the retiring occupant's conversation is not a distinct fork.
244
+ console.log(`Fork of ${result.sourceOutcome.forkedFrom}: no distinct fork. ${result.sourceOutcome.limit ?? ""}`.trim());
245
+ }
246
+ else {
247
+ console.log(`Native fork of ${result.sourceOutcome.forkedFrom}: the successor carries the incumbent conversation from its first byte.`);
248
+ if (result.sourceOutcome.forkId === "pending")
249
+ console.log(`Fork id: PENDING. ${result.sourceOutcome.limit ?? ""}`.trim());
250
+ // #3044: a recovered fork whose parent couldn't be checked says so.
251
+ else if (result.sourceOutcome.limit)
252
+ console.log(result.sourceOutcome.limit);
253
+ }
244
254
  }
245
255
  else if (result.sourceOutcome?.mode === "rebuild") {
246
256
  const outcome = result.sourceOutcome;
247
- console.log("Rebuild starts a new conversation; durable artifacts carry its context, not a native resume.");
257
+ // #3044: a recovered rebuild successor on the retiring occupant's conversation resumed it (the warning says so).
258
+ if (result.currentStatus?.continuityOutcome !== "resumed")
259
+ console.log("Rebuild starts a new conversation; durable artifacts carry its context, not a native resume.");
248
260
  if (outcome.permissions)
249
261
  console.log(`Codex rebuild permissions: ${outcome.permissions.state}. ${outcome.permissions.detail}`);
250
262
  if (outcome.model) {
@@ -262,6 +274,15 @@ function printHumanHandoverResult(result) {
262
274
  console.log(`Rebuild chain was EMPTY: ${outcome.emptyChainReason}`);
263
275
  }
264
276
  }
277
+ if (result.recoveredFrom) {
278
+ // #2985: the successor was adopted as it runs; the recovery typed nothing into its pane.
279
+ const r = result.recoveredFrom;
280
+ console.log(`Adopted the running successor of the handover that failed at "${r.failedStep}" (${r.failureCode}, ${r.failedAt}); its conversation was kept and nothing was typed into its pane.`);
281
+ if (!result.sideEffects.startupContextDelivered && result.restorePacket?.status !== "unconfirmed" && result.source.mode !== "fork") {
282
+ console.log("The context packet that handover didn't deliver was not delivered now either: the successor started without it.");
283
+ return;
284
+ }
285
+ }
265
286
  if (result.sideEffects.startupContextDelivered) {
266
287
  if (result.source.mode === "rebuild") {
267
288
  console.log("The rebuild priming packet was delivered to the successor.");
@@ -271,7 +292,9 @@ function printHumanHandoverResult(result) {
271
292
  // live successor agent.
272
293
  console.log("The captured startup context (restore packet) was delivered to the successor.");
273
294
  }
274
- console.log("No conversation continuity was carried: the successor started a fresh conversation.");
295
+ // #3044: a recovered successor on the retiring occupant's conversation resumed it (the result's warning says so).
296
+ if (result.currentStatus?.continuityOutcome !== "resumed")
297
+ console.log("No conversation continuity was carried: the successor started a fresh conversation.");
275
298
  }
276
299
  else if (result.restorePacket?.status === "unconfirmed") {
277
300
  // The packet was pasted and Enter pressed: the successor may already be working on it, so don't send it again.
@@ -288,10 +311,13 @@ function printHumanHandoverResult(result) {
288
311
  console.log(`The captured startup context (restore packet) was sent to the successor, but its submission is unconfirmed: ${result.restorePacket.reason}.`);
289
312
  console.log("Check the successor's screen before sending the context again; it may already be working on it.");
290
313
  }
291
- console.log("No conversation continuity was carried: the successor started a fresh conversation.");
314
+ if (result.currentStatus?.continuityOutcome !== "resumed")
315
+ console.log("No conversation continuity was carried: the successor started a fresh conversation.");
292
316
  }
293
317
  else if (result.source.mode === "fork") {
294
- console.log("No packet delivery: fork context rides the native conversation itself.");
318
+ // #3044: a fork recovered on its parent's or the retiring occupant's conversation carries that one, not a fork of it.
319
+ if (!(result.sourceOutcome?.mode === "fork" && result.sourceOutcome.forkId === "none"))
320
+ console.log("No packet delivery: fork context rides the native conversation itself.");
295
321
  }
296
322
  else {
297
323
  // discovered handover: the operator-prepared successor is already live, so no
@@ -485,6 +511,7 @@ Examples:
485
511
  .option("--reason <reason>", "Why the handover is happening")
486
512
  .option("--operator <address>", "Operator initiating the handover")
487
513
  .option("--dry-run", "Plan the handover without changing topology")
514
+ .option("--recover", "Adopt the running successor of a handover that failed after launching it, keeping its conversation (needs --reason; not with --source or --dry-run)")
488
515
  .option("--json", "JSON output for agents")
489
516
  .description("Hand a seat to a successor (two-phase). Pass --dry-run to plan without changing topology.")
490
517
  .addHelpText("after", `
@@ -492,7 +519,8 @@ Examples:
492
519
  rig seat handover spec-writer@openrig-pm --reason context-wall --dry-run
493
520
  rig seat handover spec-writer@openrig-pm --source rebuild --reason context-wall --dry-run --json
494
521
  rig seat handover spec-writer@openrig-pm --source fork:0b0165d7 --reason successor-test --operator orch-lead@openrig-pm --dry-run
495
- rig seat handover spec-writer@openrig-pm --source discovered:01H... --reason mvp-proof --json`)
522
+ rig seat handover spec-writer@openrig-pm --source discovered:01H... --reason mvp-proof --json
523
+ rig seat handover spec-writer@openrig-pm --recover --reason "adopt the successor the failed handover left running"`)
496
524
  .action((seat, opts) => runSeatHandover(seat, opts, getDeps()));
497
525
  // OPR.0.4.3.26 — seat-recovery VIEW retarget. Points an already-attached tmux
498
526
  // client at the seat's canonical session/window. VIEW-ONLY: never mutates
@@ -629,9 +657,21 @@ identity remains unverified; a version number alone cannot clear it.
629
657
  : await client.post(route, body);
630
658
  }
631
659
  catch (err) {
632
- if ((path !== "launch" && path !== "launch-plan" && path !== "continue" && path !== "restart" && path !== "set-cwd") || !(err instanceof DaemonTimeoutError))
660
+ // A record's answer can be lost in more ways than a timeout: a connection lost after the request was sent, or a
661
+ // response that couldn't be read. Each may follow a recorded home, so each keeps the operation id.
662
+ const recordAnswerLost = path === "record-runtime-home" && (err instanceof DaemonConnectionError || err instanceof DaemonResponseError);
663
+ if ((path !== "launch" && path !== "launch-plan" && path !== "continue" && path !== "restart" && path !== "set-cwd"
664
+ && path !== "record-runtime-home") || !(err instanceof DaemonTimeoutError || recordAnswerLost))
633
665
  throw err;
634
- const error = path === "restart" ? {
666
+ const lost = err instanceof DaemonTimeoutError ? "The CLI timed out waiting for the daemon"
667
+ : err instanceof DaemonResponseError ? "The daemon's answer couldn't be read" : "The connection to the daemon was lost";
668
+ const error = path === "record-runtime-home" ? {
669
+ ok: false,
670
+ code: "record_runtime_home_outcome_unknown",
671
+ status: "unknown",
672
+ message: `${lost}; the runtime home may or may not have been recorded.`,
673
+ guidance: `Run the same command again with --operation-id ${String(body["operationId"])}: it returns what was recorded, or records it once.`,
674
+ } : path === "restart" ? {
635
675
  ok: false,
636
676
  code: "restart_outcome_unknown",
637
677
  status: "unknown",
@@ -932,6 +972,97 @@ Examples:
932
972
  }
933
973
  printEffortReport(res.data);
934
974
  });
975
+ cmd
976
+ .command("runtime-home")
977
+ .argument("<seat>", "Canonical session name or logical seat ref")
978
+ .option("--json", "JSON output for agents")
979
+ .description("Show the runtime home a seat's next launch uses, and what a recorded correction is made against")
980
+ .addHelpText("after", `
981
+ Read-only, for Claude Code and Codex seats. Shows the home (CLAUDE_CONFIG_DIR or
982
+ CODEX_HOME) the seat's next launch, restore or resume uses and where it comes from,
983
+ the seat's current occupant generation and original conversation, and the revision
984
+ of its latest recorded home (0 when none). It's configuration: whether the running
985
+ process uses that home isn't checked. Pass these values to record-runtime-home.
986
+ Example:
987
+ rig seat runtime-home dev-impl@my-rig`)
988
+ .action(async (seat, opts) => {
989
+ const deps = getDeps();
990
+ const daemon = await getDaemonStatus(deps.lifecycleDeps);
991
+ if (!daemonStatusGuard(daemon))
992
+ return;
993
+ const client = deps.clientFactory(getDaemonUrl(daemon));
994
+ const res = await client.get(`/api/seat/runtime-home/${encodeURIComponent(seat)}`);
995
+ if (opts.json) {
996
+ console.log(JSON.stringify(res.data, null, 2));
997
+ if (res.status >= 400)
998
+ process.exitCode = res.status >= 500 ? 2 : 1;
999
+ return;
1000
+ }
1001
+ if (res.status >= 400) {
1002
+ printSeatError(res.data, `Seat runtime-home failed (HTTP ${res.status})`);
1003
+ process.exitCode = res.status >= 500 ? 2 : 1;
1004
+ return;
1005
+ }
1006
+ const d = res.data;
1007
+ const s = d["seat"];
1008
+ const record = d["record"];
1009
+ console.log(`${s?.logicalId}@${s?.rigName} (${String(d["runtime"])}): ${String(d["variable"])}=${d["home"] === null ? "(native default)" : String(d["home"])} from ${String(d["source"])}`);
1010
+ const ignored = d["ignored"];
1011
+ if (ignored)
1012
+ console.log(` Ignored ${ignored.source} value (not an absolute path): ${ignored.value}`);
1013
+ console.log(` Occupant generation: ${String(d["occupantGeneration"] ?? "none")}`);
1014
+ console.log(` Original conversation: ${String(d["original"] ?? "none")}`);
1015
+ console.log(` Recorded revision: ${String(d["revision"])}${record ? ` (${record.home}, ${record.recordedAt})` : ""}`);
1016
+ console.log(`To record a different home for this original:\n rig seat record-runtime-home ${shellQuote(seat)} --home <absolute path> --expect-occupant ${String(d["occupantGeneration"] ?? "none")} --expect-original ${String(d["original"] ?? "none")} --expect-revision ${String(d["revision"])} --reason <text>`);
1017
+ });
1018
+ cmd
1019
+ .command("record-runtime-home")
1020
+ .argument("<seat>", "Canonical session name or logical seat ref")
1021
+ .requiredOption("--home <directory>", "Absolute runtime home on the daemon's host (CLAUDE_CONFIG_DIR or CODEX_HOME)")
1022
+ .requiredOption("--expect-occupant <generation>", "The occupant generation you read with runtime-home, or none")
1023
+ .requiredOption("--expect-original <id>", "The original conversation you read with runtime-home, or none")
1024
+ .requiredOption("--expect-revision <n>", "The recorded revision you read with runtime-home (0 when none)")
1025
+ .requiredOption("--reason <text>", "Audit reason")
1026
+ .option("--operation-id <id>", "Reuse to retry safely after an unknown result; generated when omitted")
1027
+ .option("--operator <address>", "Operator recorded on the audit event when no session identity is present")
1028
+ .option("--json", "JSON output for agents")
1029
+ .description("Record the runtime home an existing seat's original conversation lives under, for its next launch")
1030
+ .addHelpText("after", `
1031
+ Records where an existing seat's conversation lives, so its next resume or restore
1032
+ launches from that home without a fresh conversation. Only that home and an audit
1033
+ record change: no running process, pane, login, credential, conversation, model,
1034
+ effort or cwd changes, nothing is copied and nothing is launched.
1035
+
1036
+ It's recorded against the occupant, original conversation and revision you read
1037
+ with rig seat runtime-home. If any of them changed since, nothing is applied and
1038
+ the current values are shown: read them again and decide for the current one.
1039
+
1040
+ It goes where the seat's home is decided today, so its credential handling is
1041
+ unchanged: a seat on an account switch's home keeps that (provider credentials
1042
+ unset at launch) with the new path; any other seat gets its own env value for the
1043
+ home variable, as a seat that declares one in its spec has.
1044
+
1045
+ The result says whether the home exists and whether the original conversation's
1046
+ record was found there. That doesn't show one copy is fresher than another, and
1047
+ whether a running process uses the home isn't checked. A restore review shows the
1048
+ recorded home, and a newer recording changes the review's revision, so a resume
1049
+ reviewed before it doesn't run.
1050
+ Example:
1051
+ rig seat record-runtime-home dev-impl@my-rig --home /home/me/.codex-b \\
1052
+ --expect-occupant 0f3c... --expect-original 019a... --expect-revision 0 --reason "home after recovery"`)
1053
+ .action(async (seat, opts) => {
1054
+ const revision = /^\d+$/.test(opts.expectRevision) ? Number(opts.expectRevision) : Number.NaN;
1055
+ const orNull = (value) => value === "none" ? null : value;
1056
+ const operationId = opts.operationId ?? `runtime-home-${randomUUID()}`;
1057
+ await runLifecycleVerb("record-runtime-home", seat, { home: opts.home, expectedOccupant: orNull(opts.expectOccupant),
1058
+ expectedOriginal: orNull(opts.expectOriginal), expectedRevision: revision, operationId, reason: opts.reason, operator: opts.operator }, opts, data => {
1059
+ const s = data["seat"];
1060
+ const observation = data["observation"];
1061
+ console.log(`Runtime home for ${s?.logicalId}@${s?.rigName}: ${String(data["to"])} (revision ${String(data["revision"])}, ${data["replayed"] ? "already recorded by this operation" : data["changed"] === false ? "same home, recorded" : "recorded"}; next launch).`);
1062
+ console.log(` Home ${observation?.home ?? "unknown"}; original conversation ${observation?.original ?? "unknown"} there. The running process isn't checked.`);
1063
+ console.log(` Operation id: ${operationId}`);
1064
+ });
1065
+ });
935
1066
  cmd
936
1067
  .command("set-model")
937
1068
  .argument("<seat>", "Canonical session name or logical seat ref")
@@ -1508,10 +1639,25 @@ export async function runSeatHandover(seat, opts, deps) {
1508
1639
  process.exitCode = 2;
1509
1640
  return;
1510
1641
  }
1642
+ if (opts.recover === true && (opts.source !== undefined || opts.dryRun === true)) {
1643
+ const message = "--recover adopts the successor the failed handover launched; it takes no --source and has no --dry-run.";
1644
+ const error = { ok: false, code: "invalid_options", message,
1645
+ guidance: `Run: rig seat handover ${seat} --recover --reason "<why>"` };
1646
+ if (opts.json)
1647
+ console.log(JSON.stringify(error, null, 2));
1648
+ else
1649
+ printSeatError(error, message);
1650
+ process.exitCode = 2;
1651
+ return;
1652
+ }
1511
1653
  const daemon = await getDaemonStatus(deps.lifecycleDeps);
1512
1654
  if (!daemonStatusGuard(daemon))
1513
1655
  return; // B8-1b: epistemic-matched
1514
1656
  const client = deps.clientFactory(getDaemonUrl(daemon));
1657
+ if (opts.recover === true) {
1658
+ await runSeatHandoverRecover(seat, opts, client);
1659
+ return;
1660
+ }
1515
1661
  const handoverRoute = `/api/seat/handover/${encodeURIComponent(seat)}`;
1516
1662
  const handoverBody = {
1517
1663
  source: opts.source,
@@ -1565,6 +1711,46 @@ export async function runSeatHandover(seat, opts, deps) {
1565
1711
  printHumanHandoverResult(data);
1566
1712
  }
1567
1713
  }
1714
+ /** #2985 / #2861: `--recover` adopts the running successor of a handover that failed after launching it. The daemon
1715
+ * proves the pane's process is that launch before committing, and types nothing into the pane. */
1716
+ async function runSeatHandoverRecover(seat, opts, client) {
1717
+ let res;
1718
+ try {
1719
+ // The proof waits for the seat's lifecycle lease and, when a first sample can't prove the successor, sleeps 3 s and
1720
+ // samples again before it can commit, so the 5 s default deadline is too short (as for `rig seat set-runtime --recover`).
1721
+ res = await client.post(`/api/seat/handover/${encodeURIComponent(seat)}/recover`, { reason: opts.reason, operator: opts.operator }, { timeoutMs: 60_000 });
1722
+ }
1723
+ catch (err) {
1724
+ // The daemon keeps working when the client stops waiting: the adoption may still commit. One request; no retry.
1725
+ if (!(err instanceof DaemonTimeoutError))
1726
+ throw err;
1727
+ const error = {
1728
+ ok: false,
1729
+ code: "handover_outcome_unknown",
1730
+ status: "unknown",
1731
+ message: "The CLI stopped waiting for the daemon after 60 seconds, so the outcome of the handover recovery is unknown. The daemon may still be working on it.",
1732
+ guidance: `Inspect the seat with: rig seat status ${seat}. Running the recovery again is safe: it types nothing, and finds nothing left to adopt if this one committed. Another handover or a fresh launch ends the running successor.`,
1733
+ };
1734
+ if (opts.json)
1735
+ console.log(JSON.stringify(error, null, 2));
1736
+ else
1737
+ printSeatError(error, error.message);
1738
+ process.exitCode = 1;
1739
+ return;
1740
+ }
1741
+ if (opts.json) {
1742
+ console.log(JSON.stringify(res.data, null, 2));
1743
+ if (res.status >= 400)
1744
+ process.exitCode = res.status >= 500 ? 2 : 1;
1745
+ return;
1746
+ }
1747
+ if (res.status >= 400) {
1748
+ printSeatError(res.data, `Seat handover recovery failed (HTTP ${res.status})`);
1749
+ process.exitCode = res.status >= 500 ? 2 : 1;
1750
+ return;
1751
+ }
1752
+ printHumanHandoverResult(res.data);
1753
+ }
1568
1754
  /**
1569
1755
  * OPR.0.4.3.04 — top-level `rig handover <seat>` verb: the operator-facing
1570
1756
  * surface for the full-cycle handover composer. Same route + behavior as
@@ -1581,6 +1767,7 @@ export function handoverCommand(depsOverride) {
1581
1767
  .option("--reason <reason>", "Why the handover is happening")
1582
1768
  .option("--operator <address>", "Operator initiating the handover")
1583
1769
  .option("--dry-run", "Plan the handover without changing topology")
1770
+ .option("--recover", "Adopt the running successor of a handover that failed after launching it, keeping its conversation (needs --reason; not with --source or --dry-run)")
1584
1771
  .option("--json", "JSON output for agents")
1585
1772
  .description("Hand a seat to a successor: create -> deliver context -> verify continuity -> rebind")
1586
1773
  .addHelpText("after", `