@openrig/cli 0.7.17 → 0.7.19

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 (986) hide show
  1. package/README.md +7 -6
  2. package/daemon/assets/claude-hook-bridge.cjs +146 -0
  3. package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +1 -1
  4. package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +1 -1
  5. package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
  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/README.md +1 -1
  10. package/daemon/assets/plugins/openrig-core/hooks/claude.json +14 -14
  11. package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +43 -22
  12. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +6 -0
  13. package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +23 -0
  14. package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +1 -1
  15. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +11 -0
  16. package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +95 -7
  17. package/daemon/assets/skills/rigs/SKILL.md +68 -33
  18. package/daemon/assets/skills/rigs/references/installing-for-someone.md +2 -2
  19. package/daemon/context-packs/help/manifest.yaml +1 -1
  20. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  21. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +57 -14
  22. package/daemon/context-packs/reference/getting-started.md +9 -4
  23. package/daemon/context-packs/reference/manifest.yaml +1 -1
  24. package/daemon/context-packs/reference/rig-spec.md +197 -1
  25. package/daemon/context-packs/reference/whats-new.md +187 -15
  26. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  27. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  28. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  29. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  30. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  31. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  33. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  34. package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +23 -0
  35. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  36. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  37. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  38. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  40. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  46. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/mission-slice-sop/SKILL.md +1 -1
  53. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  54. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/openrig-user/SKILL.md +11 -0
  56. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  66. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  68. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  72. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  73. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  74. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  75. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  76. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  77. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  78. package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +95 -7
  79. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  80. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  81. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  82. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  83. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  84. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  85. package/daemon/dist/adapters/claude-code-adapter.d.ts +9 -0
  86. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  87. package/daemon/dist/adapters/claude-code-adapter.js +57 -9
  88. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  89. package/daemon/dist/adapters/claude-resume.d.ts +4 -1
  90. package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
  91. package/daemon/dist/adapters/claude-resume.js +15 -5
  92. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  93. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +5 -0
  94. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  95. package/daemon/dist/adapters/codex-runtime-adapter.js +45 -10
  96. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  97. package/daemon/dist/adapters/kernel-authority.d.ts +8 -1
  98. package/daemon/dist/adapters/kernel-authority.d.ts.map +1 -1
  99. package/daemon/dist/adapters/kernel-authority.js +45 -10
  100. package/daemon/dist/adapters/kernel-authority.js.map +1 -1
  101. package/daemon/dist/adapters/pi-resume.d.ts.map +1 -1
  102. package/daemon/dist/adapters/pi-resume.js +5 -7
  103. package/daemon/dist/adapters/pi-resume.js.map +1 -1
  104. package/daemon/dist/adapters/pi-runner-protocol.d.ts +47 -0
  105. package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -1
  106. package/daemon/dist/adapters/pi-runner-protocol.js.map +1 -1
  107. package/daemon/dist/adapters/pi-runner.d.ts +84 -1
  108. package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
  109. package/daemon/dist/adapters/pi-runner.js +799 -16
  110. package/daemon/dist/adapters/pi-runner.js.map +1 -1
  111. package/daemon/dist/adapters/pi-runtime-adapter.d.ts +7 -1
  112. package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
  113. package/daemon/dist/adapters/pi-runtime-adapter.js +29 -19
  114. package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
  115. package/daemon/dist/adapters/tmux-credential-env.d.ts +4 -0
  116. package/daemon/dist/adapters/tmux-credential-env.d.ts.map +1 -0
  117. package/daemon/dist/adapters/tmux-credential-env.js +14 -0
  118. package/daemon/dist/adapters/tmux-credential-env.js.map +1 -0
  119. package/daemon/dist/adapters/tmux-exec.d.ts.map +1 -1
  120. package/daemon/dist/adapters/tmux-exec.js +4 -3
  121. package/daemon/dist/adapters/tmux-exec.js.map +1 -1
  122. package/daemon/dist/adapters/tmux-server.d.ts +2 -2
  123. package/daemon/dist/adapters/tmux-server.d.ts.map +1 -1
  124. package/daemon/dist/adapters/tmux-server.js +12 -4
  125. package/daemon/dist/adapters/tmux-server.js.map +1 -1
  126. package/daemon/dist/adapters/tmux.d.ts +242 -14
  127. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  128. package/daemon/dist/adapters/tmux.js +966 -34
  129. package/daemon/dist/adapters/tmux.js.map +1 -1
  130. package/daemon/dist/attention-surface.d.ts +4 -1
  131. package/daemon/dist/attention-surface.d.ts.map +1 -1
  132. package/daemon/dist/attention-surface.js.map +1 -1
  133. package/daemon/dist/build-info.js +3 -3
  134. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  135. package/daemon/dist/db/all-migrations.js +14 -0
  136. package/daemon/dist/db/all-migrations.js.map +1 -1
  137. package/daemon/dist/db/migrations/171_claude_auto_mode.d.ts +4 -0
  138. package/daemon/dist/db/migrations/171_claude_auto_mode.d.ts.map +1 -0
  139. package/daemon/dist/db/migrations/171_claude_auto_mode.js +9 -0
  140. package/daemon/dist/db/migrations/171_claude_auto_mode.js.map +1 -0
  141. package/daemon/dist/db/migrations/171_node_input_route.d.ts +4 -0
  142. package/daemon/dist/db/migrations/171_node_input_route.d.ts.map +1 -0
  143. package/daemon/dist/db/migrations/171_node_input_route.js +6 -0
  144. package/daemon/dist/db/migrations/171_node_input_route.js.map +1 -0
  145. package/daemon/dist/db/migrations/171_seat_hook_bridge.d.ts +5 -0
  146. package/daemon/dist/db/migrations/171_seat_hook_bridge.d.ts.map +1 -0
  147. package/daemon/dist/db/migrations/171_seat_hook_bridge.js +25 -0
  148. package/daemon/dist/db/migrations/171_seat_hook_bridge.js.map +1 -0
  149. package/daemon/dist/db/migrations/172_queue_return_route.d.ts +3 -0
  150. package/daemon/dist/db/migrations/172_queue_return_route.d.ts.map +1 -0
  151. package/daemon/dist/db/migrations/172_queue_return_route.js +13 -0
  152. package/daemon/dist/db/migrations/172_queue_return_route.js.map +1 -0
  153. package/daemon/dist/db/migrations/173_node_process_limits.d.ts +4 -0
  154. package/daemon/dist/db/migrations/173_node_process_limits.d.ts.map +1 -0
  155. package/daemon/dist/db/migrations/173_node_process_limits.js +6 -0
  156. package/daemon/dist/db/migrations/173_node_process_limits.js.map +1 -0
  157. package/daemon/dist/db/migrations/174_session_launched_cwd.d.ts +6 -0
  158. package/daemon/dist/db/migrations/174_session_launched_cwd.d.ts.map +1 -0
  159. package/daemon/dist/db/migrations/174_session_launched_cwd.js +8 -0
  160. package/daemon/dist/db/migrations/174_session_launched_cwd.js.map +1 -0
  161. package/daemon/dist/db/migrations/175_core_app_access.d.ts +3 -0
  162. package/daemon/dist/db/migrations/175_core_app_access.d.ts.map +1 -0
  163. package/daemon/dist/db/migrations/175_core_app_access.js +26 -0
  164. package/daemon/dist/db/migrations/175_core_app_access.js.map +1 -0
  165. package/daemon/dist/domain/activity-grants.d.ts.map +1 -1
  166. package/daemon/dist/domain/activity-grants.js +8 -4
  167. package/daemon/dist/domain/activity-grants.js.map +1 -1
  168. package/daemon/dist/domain/agent-activity-store.d.ts +59 -1
  169. package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
  170. package/daemon/dist/domain/agent-activity-store.js +250 -4
  171. package/daemon/dist/domain/agent-activity-store.js.map +1 -1
  172. package/daemon/dist/domain/agent-images/resume-token-discovery.d.ts +10 -0
  173. package/daemon/dist/domain/agent-images/resume-token-discovery.d.ts.map +1 -1
  174. package/daemon/dist/domain/agent-images/resume-token-discovery.js +21 -0
  175. package/daemon/dist/domain/agent-images/resume-token-discovery.js.map +1 -1
  176. package/daemon/dist/domain/applied-launch-observation-store.d.ts +5 -0
  177. package/daemon/dist/domain/applied-launch-observation-store.d.ts.map +1 -1
  178. package/daemon/dist/domain/applied-launch-observation-store.js +57 -21
  179. package/daemon/dist/domain/applied-launch-observation-store.js.map +1 -1
  180. package/daemon/dist/domain/builtin-startup-files.d.ts +26 -12
  181. package/daemon/dist/domain/builtin-startup-files.d.ts.map +1 -1
  182. package/daemon/dist/domain/builtin-startup-files.js +73 -34
  183. package/daemon/dist/domain/builtin-startup-files.js.map +1 -1
  184. package/daemon/dist/domain/claude-activity-hooks.d.ts +4 -2
  185. package/daemon/dist/domain/claude-activity-hooks.d.ts.map +1 -1
  186. package/daemon/dist/domain/claude-activity-hooks.js +5 -3
  187. package/daemon/dist/domain/claude-activity-hooks.js.map +1 -1
  188. package/daemon/dist/domain/claude-auto-mode.d.ts +64 -0
  189. package/daemon/dist/domain/claude-auto-mode.d.ts.map +1 -0
  190. package/daemon/dist/domain/claude-auto-mode.js +114 -0
  191. package/daemon/dist/domain/claude-auto-mode.js.map +1 -0
  192. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +66 -3
  193. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  194. package/daemon/dist/domain/claude-compaction-enforcer.js +214 -10
  195. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  196. package/daemon/dist/domain/claude-continuation-launch.d.ts +5 -1
  197. package/daemon/dist/domain/claude-continuation-launch.d.ts.map +1 -1
  198. package/daemon/dist/domain/claude-continuation-launch.js +51 -2
  199. package/daemon/dist/domain/claude-continuation-launch.js.map +1 -1
  200. package/daemon/dist/domain/claude-core-plugin-env.d.ts +7 -3
  201. package/daemon/dist/domain/claude-core-plugin-env.d.ts.map +1 -1
  202. package/daemon/dist/domain/claude-core-plugin-env.js +11 -8
  203. package/daemon/dist/domain/claude-core-plugin-env.js.map +1 -1
  204. package/daemon/dist/domain/codex-daemon-support.d.ts.map +1 -1
  205. package/daemon/dist/domain/codex-daemon-support.js +6 -1
  206. package/daemon/dist/domain/codex-daemon-support.js.map +1 -1
  207. package/daemon/dist/domain/community-harness-launch-result.d.ts +2 -0
  208. package/daemon/dist/domain/community-harness-launch-result.d.ts.map +1 -1
  209. package/daemon/dist/domain/community-harness-launch-result.js +5 -1
  210. package/daemon/dist/domain/community-harness-launch-result.js.map +1 -1
  211. package/daemon/dist/domain/compaction-restore-notice.d.ts +3 -1
  212. package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
  213. package/daemon/dist/domain/compaction-restore-notice.js +22 -3
  214. package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
  215. package/daemon/dist/domain/configured-account.d.ts +3 -0
  216. package/daemon/dist/domain/configured-account.d.ts.map +1 -0
  217. package/daemon/dist/domain/configured-account.js +10 -0
  218. package/daemon/dist/domain/configured-account.js.map +1 -0
  219. package/daemon/dist/domain/connection-contract.d.ts +91 -0
  220. package/daemon/dist/domain/connection-contract.d.ts.map +1 -1
  221. package/daemon/dist/domain/connection-contract.js +73 -0
  222. package/daemon/dist/domain/connection-contract.js.map +1 -1
  223. package/daemon/dist/domain/context-usage-store.d.ts +5 -0
  224. package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
  225. package/daemon/dist/domain/context-usage-store.js +37 -2
  226. package/daemon/dist/domain/context-usage-store.js.map +1 -1
  227. package/daemon/dist/domain/core-app-access.d.ts +51 -0
  228. package/daemon/dist/domain/core-app-access.d.ts.map +1 -0
  229. package/daemon/dist/domain/core-app-access.js +107 -0
  230. package/daemon/dist/domain/core-app-access.js.map +1 -0
  231. package/daemon/dist/domain/core-app-job.d.ts +411 -0
  232. package/daemon/dist/domain/core-app-job.d.ts.map +1 -0
  233. package/daemon/dist/domain/core-app-job.js +537 -0
  234. package/daemon/dist/domain/core-app-job.js.map +1 -0
  235. package/daemon/dist/domain/current-park-arm.d.ts +4 -0
  236. package/daemon/dist/domain/current-park-arm.d.ts.map +1 -0
  237. package/daemon/dist/domain/current-park-arm.js +14 -0
  238. package/daemon/dist/domain/current-park-arm.js.map +1 -0
  239. package/daemon/dist/domain/current-work.d.ts +6 -1
  240. package/daemon/dist/domain/current-work.d.ts.map +1 -1
  241. package/daemon/dist/domain/current-work.js +41 -8
  242. package/daemon/dist/domain/current-work.js.map +1 -1
  243. package/daemon/dist/domain/cwd-resolution.d.ts +14 -0
  244. package/daemon/dist/domain/cwd-resolution.d.ts.map +1 -1
  245. package/daemon/dist/domain/cwd-resolution.js +28 -3
  246. package/daemon/dist/domain/cwd-resolution.js.map +1 -1
  247. package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
  248. package/daemon/dist/domain/draft-aware-delivery.js +5 -1
  249. package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
  250. package/daemon/dist/domain/errors.d.ts +4 -0
  251. package/daemon/dist/domain/errors.d.ts.map +1 -1
  252. package/daemon/dist/domain/errors.js +7 -0
  253. package/daemon/dist/domain/errors.js.map +1 -1
  254. package/daemon/dist/domain/execution-view.d.ts.map +1 -1
  255. package/daemon/dist/domain/execution-view.js +17 -4
  256. package/daemon/dist/domain/execution-view.js.map +1 -1
  257. package/daemon/dist/domain/existing-rig-restore.d.ts +2 -0
  258. package/daemon/dist/domain/existing-rig-restore.d.ts.map +1 -1
  259. package/daemon/dist/domain/existing-rig-restore.js +1 -0
  260. package/daemon/dist/domain/existing-rig-restore.js.map +1 -1
  261. package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
  262. package/daemon/dist/domain/gateway/operator-delivery-engine.js +107 -3
  263. package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
  264. package/daemon/dist/domain/gateway/participants.d.ts +2 -0
  265. package/daemon/dist/domain/gateway/participants.d.ts.map +1 -1
  266. package/daemon/dist/domain/gateway/participants.js +5 -1
  267. package/daemon/dist/domain/gateway/participants.js.map +1 -1
  268. package/daemon/dist/domain/gateway/slack/capabilities.d.ts +9 -1
  269. package/daemon/dist/domain/gateway/slack/capabilities.d.ts.map +1 -1
  270. package/daemon/dist/domain/gateway/slack/capabilities.js +6 -1
  271. package/daemon/dist/domain/gateway/slack/capabilities.js.map +1 -1
  272. package/daemon/dist/domain/gateway/slack/inbound-admission.js +1 -1
  273. package/daemon/dist/domain/gateway/slack/inbound-admission.js.map +1 -1
  274. package/daemon/dist/domain/gateway/slack/inbound.d.ts +4 -0
  275. package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
  276. package/daemon/dist/domain/gateway/slack/inbound.js +15 -1
  277. package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
  278. package/daemon/dist/domain/gateway/slack/manifest.d.ts +5 -1
  279. package/daemon/dist/domain/gateway/slack/manifest.d.ts.map +1 -1
  280. package/daemon/dist/domain/gateway/slack/manifest.js +12 -3
  281. package/daemon/dist/domain/gateway/slack/manifest.js.map +1 -1
  282. package/daemon/dist/domain/gateway/slack/message.d.ts +2 -0
  283. package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
  284. package/daemon/dist/domain/gateway/slack/message.js +41 -18
  285. package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
  286. package/daemon/dist/domain/gateway/slack/queue-access.d.ts +2 -0
  287. package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
  288. package/daemon/dist/domain/gateway/slack/queue-access.js +1 -0
  289. package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
  290. package/daemon/dist/domain/gateway/slack/settled-asks.d.ts.map +1 -1
  291. package/daemon/dist/domain/gateway/slack/settled-asks.js +6 -5
  292. package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -1
  293. package/daemon/dist/domain/gateway/slack/slack-api.d.ts +1 -0
  294. package/daemon/dist/domain/gateway/slack/slack-api.d.ts.map +1 -1
  295. package/daemon/dist/domain/gateway/slack/slack-api.js +7 -2
  296. package/daemon/dist/domain/gateway/slack/slack-api.js.map +1 -1
  297. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +1 -0
  298. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
  299. package/daemon/dist/domain/gateway/slack/slack-delivery.js +2 -0
  300. package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
  301. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts +4 -0
  302. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
  303. package/daemon/dist/domain/gateway/slack/slack-subsystem.js +26 -2
  304. package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
  305. package/daemon/dist/domain/harness-not-started-notice.d.ts +36 -0
  306. package/daemon/dist/domain/harness-not-started-notice.d.ts.map +1 -0
  307. package/daemon/dist/domain/harness-not-started-notice.js +81 -0
  308. package/daemon/dist/domain/harness-not-started-notice.js.map +1 -0
  309. package/daemon/dist/domain/hook-bridge.d.ts +345 -0
  310. package/daemon/dist/domain/hook-bridge.d.ts.map +1 -0
  311. package/daemon/dist/domain/hook-bridge.js +547 -0
  312. package/daemon/dist/domain/hook-bridge.js.map +1 -0
  313. package/daemon/dist/domain/hosted-wake.d.ts +9 -0
  314. package/daemon/dist/domain/hosted-wake.d.ts.map +1 -1
  315. package/daemon/dist/domain/hosted-wake.js +45 -6
  316. package/daemon/dist/domain/hosted-wake.js.map +1 -1
  317. package/daemon/dist/domain/hot-potato-enforcer.d.ts +1 -1
  318. package/daemon/dist/domain/human-ask-attention.d.ts +10 -0
  319. package/daemon/dist/domain/human-ask-attention.d.ts.map +1 -0
  320. package/daemon/dist/domain/human-ask-attention.js +22 -0
  321. package/daemon/dist/domain/human-ask-attention.js.map +1 -0
  322. package/daemon/dist/domain/input-read-diagnostic.js +1 -1
  323. package/daemon/dist/domain/input-read-diagnostic.js.map +1 -1
  324. package/daemon/dist/domain/instance-initialization.d.ts +2 -0
  325. package/daemon/dist/domain/instance-initialization.d.ts.map +1 -1
  326. package/daemon/dist/domain/instance-initialization.js +2 -1
  327. package/daemon/dist/domain/instance-initialization.js.map +1 -1
  328. package/daemon/dist/domain/member-connection.d.ts +14 -0
  329. package/daemon/dist/domain/member-connection.d.ts.map +1 -0
  330. package/daemon/dist/domain/member-connection.js +34 -0
  331. package/daemon/dist/domain/member-connection.js.map +1 -0
  332. package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts +4 -0
  333. package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts.map +1 -1
  334. package/daemon/dist/domain/mission-control/mission-control-action-log.js +8 -1
  335. package/daemon/dist/domain/mission-control/mission-control-action-log.js.map +1 -1
  336. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +10 -0
  337. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
  338. package/daemon/dist/domain/mission-control/mission-control-write-contract.js +64 -12
  339. package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
  340. package/daemon/dist/domain/model-divergence/current-model-reader.d.ts +3 -1
  341. package/daemon/dist/domain/model-divergence/current-model-reader.d.ts.map +1 -1
  342. package/daemon/dist/domain/model-divergence/current-model-reader.js +32 -7
  343. package/daemon/dist/domain/model-divergence/current-model-reader.js.map +1 -1
  344. package/daemon/dist/domain/native-continuation-notice.d.ts +16 -0
  345. package/daemon/dist/domain/native-continuation-notice.d.ts.map +1 -0
  346. package/daemon/dist/domain/native-continuation-notice.js +79 -0
  347. package/daemon/dist/domain/native-continuation-notice.js.map +1 -0
  348. package/daemon/dist/domain/native-permission-store.d.ts +6 -2
  349. package/daemon/dist/domain/native-permission-store.d.ts.map +1 -1
  350. package/daemon/dist/domain/native-permission-store.js +12 -5
  351. package/daemon/dist/domain/native-permission-store.js.map +1 -1
  352. package/daemon/dist/domain/native-process-lineage.d.ts +16 -0
  353. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
  354. package/daemon/dist/domain/native-process-lineage.js +48 -3
  355. package/daemon/dist/domain/native-process-lineage.js.map +1 -1
  356. package/daemon/dist/domain/native-resume-probe.d.ts +5 -0
  357. package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
  358. package/daemon/dist/domain/native-resume-probe.js +94 -10
  359. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  360. package/daemon/dist/domain/network/network-connector.d.ts.map +1 -1
  361. package/daemon/dist/domain/network/network-connector.js +11 -2
  362. package/daemon/dist/domain/network/network-connector.js.map +1 -1
  363. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  364. package/daemon/dist/domain/node-inventory.js +55 -6
  365. package/daemon/dist/domain/node-inventory.js.map +1 -1
  366. package/daemon/dist/domain/node-launcher.d.ts +14 -0
  367. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  368. package/daemon/dist/domain/node-launcher.js +35 -6
  369. package/daemon/dist/domain/node-launcher.js.map +1 -1
  370. package/daemon/dist/domain/outbox-handler.d.ts +69 -1
  371. package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
  372. package/daemon/dist/domain/outbox-handler.js +337 -3
  373. package/daemon/dist/domain/outbox-handler.js.map +1 -1
  374. package/daemon/dist/domain/park-wake-text.d.ts +18 -0
  375. package/daemon/dist/domain/park-wake-text.d.ts.map +1 -1
  376. package/daemon/dist/domain/park-wake-text.js +44 -0
  377. package/daemon/dist/domain/park-wake-text.js.map +1 -1
  378. package/daemon/dist/domain/parked-query.d.ts.map +1 -1
  379. package/daemon/dist/domain/parked-query.js +3 -1
  380. package/daemon/dist/domain/parked-query.js.map +1 -1
  381. package/daemon/dist/domain/permission-account.d.ts +28 -1
  382. package/daemon/dist/domain/permission-account.d.ts.map +1 -1
  383. package/daemon/dist/domain/permission-account.js +55 -11
  384. package/daemon/dist/domain/permission-account.js.map +1 -1
  385. package/daemon/dist/domain/permission-drift.d.ts +2 -0
  386. package/daemon/dist/domain/permission-drift.d.ts.map +1 -1
  387. package/daemon/dist/domain/permission-drift.js.map +1 -1
  388. package/daemon/dist/domain/pi-compaction-request-store.d.ts +16 -0
  389. package/daemon/dist/domain/pi-compaction-request-store.d.ts.map +1 -0
  390. package/daemon/dist/domain/pi-compaction-request-store.js +40 -0
  391. package/daemon/dist/domain/pi-compaction-request-store.js.map +1 -0
  392. package/daemon/dist/domain/pi-compaction-service.d.ts +82 -0
  393. package/daemon/dist/domain/pi-compaction-service.d.ts.map +1 -0
  394. package/daemon/dist/domain/pi-compaction-service.js +229 -0
  395. package/daemon/dist/domain/pi-compaction-service.js.map +1 -0
  396. package/daemon/dist/domain/policies/idle-gate-qitem.d.ts +3 -0
  397. package/daemon/dist/domain/policies/idle-gate-qitem.d.ts.map +1 -1
  398. package/daemon/dist/domain/policies/idle-gate-qitem.js +15 -0
  399. package/daemon/dist/domain/policies/idle-gate-qitem.js.map +1 -1
  400. package/daemon/dist/domain/policies/parked-owner-consumer.d.ts +6 -1
  401. package/daemon/dist/domain/policies/parked-owner-consumer.d.ts.map +1 -1
  402. package/daemon/dist/domain/policies/parked-owner-consumer.js +28 -1
  403. package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
  404. package/daemon/dist/domain/process-limits.d.ts +47 -0
  405. package/daemon/dist/domain/process-limits.d.ts.map +1 -0
  406. package/daemon/dist/domain/process-limits.js +123 -0
  407. package/daemon/dist/domain/process-limits.js.map +1 -0
  408. package/daemon/dist/domain/process-table.d.ts +24 -0
  409. package/daemon/dist/domain/process-table.d.ts.map +1 -1
  410. package/daemon/dist/domain/process-table.js +60 -4
  411. package/daemon/dist/domain/process-table.js.map +1 -1
  412. package/daemon/dist/domain/proof/judgments.d.ts +7 -0
  413. package/daemon/dist/domain/proof/judgments.d.ts.map +1 -1
  414. package/daemon/dist/domain/proof/judgments.js +27 -1
  415. package/daemon/dist/domain/proof/judgments.js.map +1 -1
  416. package/daemon/dist/domain/ps-projection.d.ts +2 -1
  417. package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
  418. package/daemon/dist/domain/ps-projection.js +6 -1
  419. package/daemon/dist/domain/ps-projection.js.map +1 -1
  420. package/daemon/dist/domain/queue-erasure.d.ts +11 -6
  421. package/daemon/dist/domain/queue-erasure.d.ts.map +1 -1
  422. package/daemon/dist/domain/queue-erasure.js +47 -21
  423. package/daemon/dist/domain/queue-erasure.js.map +1 -1
  424. package/daemon/dist/domain/queue-repository.d.ts +122 -21
  425. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  426. package/daemon/dist/domain/queue-repository.js +448 -101
  427. package/daemon/dist/domain/queue-repository.js.map +1 -1
  428. package/daemon/dist/domain/queue-stuck-sweep.d.ts +5 -0
  429. package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
  430. package/daemon/dist/domain/queue-stuck-sweep.js +74 -13
  431. package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
  432. package/daemon/dist/domain/queue-transition-log.d.ts +5 -3
  433. package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
  434. package/daemon/dist/domain/queue-transition-log.js +9 -6
  435. package/daemon/dist/domain/queue-transition-log.js.map +1 -1
  436. package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
  437. package/daemon/dist/domain/queue-waiting.js +28 -3
  438. package/daemon/dist/domain/queue-waiting.js.map +1 -1
  439. package/daemon/dist/domain/queue-wake-ladder.d.ts +20 -0
  440. package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
  441. package/daemon/dist/domain/queue-wake-ladder.js +264 -25
  442. package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
  443. package/daemon/dist/domain/queue-wake-repository.d.ts +10 -1
  444. package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
  445. package/daemon/dist/domain/queue-wake-repository.js +79 -12
  446. package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
  447. package/daemon/dist/domain/reconciler.d.ts +18 -2
  448. package/daemon/dist/domain/reconciler.d.ts.map +1 -1
  449. package/daemon/dist/domain/reconciler.js +40 -0
  450. package/daemon/dist/domain/reconciler.js.map +1 -1
  451. package/daemon/dist/domain/restore-attempt-receipt.d.ts.map +1 -1
  452. package/daemon/dist/domain/restore-attempt-receipt.js +3 -2
  453. package/daemon/dist/domain/restore-attempt-receipt.js.map +1 -1
  454. package/daemon/dist/domain/restore-check-service.d.ts +10 -0
  455. package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
  456. package/daemon/dist/domain/restore-check-service.js +76 -3
  457. package/daemon/dist/domain/restore-check-service.js.map +1 -1
  458. package/daemon/dist/domain/restore-orchestrator.d.ts +65 -3
  459. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  460. package/daemon/dist/domain/restore-orchestrator.js +311 -55
  461. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  462. package/daemon/dist/domain/restore-plan-preview.d.ts +28 -1
  463. package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
  464. package/daemon/dist/domain/restore-plan-preview.js +17 -5
  465. package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
  466. package/daemon/dist/domain/restore-preconditions.d.ts +24 -0
  467. package/daemon/dist/domain/restore-preconditions.d.ts.map +1 -1
  468. package/daemon/dist/domain/restore-preconditions.js +61 -1
  469. package/daemon/dist/domain/restore-preconditions.js.map +1 -1
  470. package/daemon/dist/domain/restore-topology.d.ts +7 -1
  471. package/daemon/dist/domain/restore-topology.d.ts.map +1 -1
  472. package/daemon/dist/domain/restore-topology.js +21 -0
  473. package/daemon/dist/domain/restore-topology.js.map +1 -1
  474. package/daemon/dist/domain/resume-metadata-refresher.d.ts +2 -3
  475. package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
  476. package/daemon/dist/domain/resume-metadata-refresher.js +6 -25
  477. package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
  478. package/daemon/dist/domain/resume-token-validation.d.ts +3 -1
  479. package/daemon/dist/domain/resume-token-validation.d.ts.map +1 -1
  480. package/daemon/dist/domain/resume-token-validation.js +6 -3
  481. package/daemon/dist/domain/resume-token-validation.js.map +1 -1
  482. package/daemon/dist/domain/return-route.d.ts +73 -0
  483. package/daemon/dist/domain/return-route.d.ts.map +1 -0
  484. package/daemon/dist/domain/return-route.js +124 -0
  485. package/daemon/dist/domain/return-route.js.map +1 -0
  486. package/daemon/dist/domain/rig-expansion-service.js +1 -1
  487. package/daemon/dist/domain/rig-expansion-service.js.map +1 -1
  488. package/daemon/dist/domain/rig-repository.d.ts +12 -0
  489. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  490. package/daemon/dist/domain/rig-repository.js +74 -0
  491. package/daemon/dist/domain/rig-repository.js.map +1 -1
  492. package/daemon/dist/domain/rig-teardown.d.ts +20 -5
  493. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  494. package/daemon/dist/domain/rig-teardown.js +105 -22
  495. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  496. package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
  497. package/daemon/dist/domain/rigspec-codec.js +9 -0
  498. package/daemon/dist/domain/rigspec-codec.js.map +1 -1
  499. package/daemon/dist/domain/rigspec-exporter.d.ts +6 -0
  500. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  501. package/daemon/dist/domain/rigspec-exporter.js +30 -0
  502. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  503. package/daemon/dist/domain/rigspec-instantiator.d.ts +27 -2
  504. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  505. package/daemon/dist/domain/rigspec-instantiator.js +95 -26
  506. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  507. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  508. package/daemon/dist/domain/rigspec-schema.js +44 -1
  509. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  510. package/daemon/dist/domain/rosters.d.ts +23 -0
  511. package/daemon/dist/domain/rosters.d.ts.map +1 -1
  512. package/daemon/dist/domain/rosters.js +37 -5
  513. package/daemon/dist/domain/rosters.js.map +1 -1
  514. package/daemon/dist/domain/runner-channel.d.ts +65 -0
  515. package/daemon/dist/domain/runner-channel.d.ts.map +1 -0
  516. package/daemon/dist/domain/runner-channel.js +348 -0
  517. package/daemon/dist/domain/runner-channel.js.map +1 -0
  518. package/daemon/dist/domain/runner-grant-launch.js +2 -2
  519. package/daemon/dist/domain/runner-permissions.d.ts +26 -3
  520. package/daemon/dist/domain/runner-permissions.d.ts.map +1 -1
  521. package/daemon/dist/domain/runner-permissions.js +160 -39
  522. package/daemon/dist/domain/runner-permissions.js.map +1 -1
  523. package/daemon/dist/domain/runtime-adapter.d.ts +2 -0
  524. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  525. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  526. package/daemon/dist/domain/runtime-switch-materials.d.ts.map +1 -1
  527. package/daemon/dist/domain/runtime-switch-materials.js +4 -3
  528. package/daemon/dist/domain/runtime-switch-materials.js.map +1 -1
  529. package/daemon/dist/domain/scope/mission-parent.d.ts +19 -0
  530. package/daemon/dist/domain/scope/mission-parent.d.ts.map +1 -0
  531. package/daemon/dist/domain/scope/mission-parent.js +134 -0
  532. package/daemon/dist/domain/scope/mission-parent.js.map +1 -0
  533. package/daemon/dist/domain/scope/scope-audit.d.ts.map +1 -1
  534. package/daemon/dist/domain/scope/scope-audit.js +63 -3
  535. package/daemon/dist/domain/scope/scope-audit.js.map +1 -1
  536. package/daemon/dist/domain/scope/types.d.ts +3 -1
  537. package/daemon/dist/domain/scope/types.d.ts.map +1 -1
  538. package/daemon/dist/domain/scope/types.js +5 -1
  539. package/daemon/dist/domain/scope/types.js.map +1 -1
  540. package/daemon/dist/domain/seat-attention-reconciler.d.ts +6 -4
  541. package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  542. package/daemon/dist/domain/seat-attention-reconciler.js +17 -10
  543. package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  544. package/daemon/dist/domain/seat-delivery-guard.d.ts +14 -2
  545. package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
  546. package/daemon/dist/domain/seat-delivery-guard.js +55 -15
  547. package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
  548. package/daemon/dist/domain/seat-handover-service.d.ts +27 -4
  549. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  550. package/daemon/dist/domain/seat-handover-service.js +210 -65
  551. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  552. package/daemon/dist/domain/seat-identity-reconciler.d.ts +12 -4
  553. package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
  554. package/daemon/dist/domain/seat-identity-reconciler.js +92 -17
  555. package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
  556. package/daemon/dist/domain/seat-lifecycle-service.d.ts +31 -6
  557. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  558. package/daemon/dist/domain/seat-lifecycle-service.js +172 -24
  559. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  560. package/daemon/dist/domain/seat-restart-in-place.d.ts +9 -2
  561. package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
  562. package/daemon/dist/domain/seat-restart-in-place.js +38 -3
  563. package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
  564. package/daemon/dist/domain/seat-runtime-switch-service.d.ts +4 -0
  565. package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
  566. package/daemon/dist/domain/seat-runtime-switch-service.js +11 -3
  567. package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
  568. package/daemon/dist/domain/seat-skill-apply.d.ts +1 -1
  569. package/daemon/dist/domain/seat-skill-apply.d.ts.map +1 -1
  570. package/daemon/dist/domain/seat-skill-apply.js +3 -2
  571. package/daemon/dist/domain/seat-skill-apply.js.map +1 -1
  572. package/daemon/dist/domain/seat-status-service.d.ts +4 -0
  573. package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
  574. package/daemon/dist/domain/seat-status-service.js +31 -6
  575. package/daemon/dist/domain/seat-status-service.js.map +1 -1
  576. package/daemon/dist/domain/session-registry.d.ts +5 -1
  577. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  578. package/daemon/dist/domain/session-registry.js +12 -1
  579. package/daemon/dist/domain/session-registry.js.map +1 -1
  580. package/daemon/dist/domain/session-transport.d.ts +56 -4
  581. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  582. package/daemon/dist/domain/session-transport.js +344 -18
  583. package/daemon/dist/domain/session-transport.js.map +1 -1
  584. package/daemon/dist/domain/shared-conversation.d.ts +58 -0
  585. package/daemon/dist/domain/shared-conversation.d.ts.map +1 -0
  586. package/daemon/dist/domain/shared-conversation.js +98 -0
  587. package/daemon/dist/domain/shared-conversation.js.map +1 -0
  588. package/daemon/dist/domain/shared-history-selection.d.ts.map +1 -1
  589. package/daemon/dist/domain/shared-history-selection.js +9 -5
  590. package/daemon/dist/domain/shared-history-selection.js.map +1 -1
  591. package/daemon/dist/domain/slices/slice-indexer.d.ts +1 -1
  592. package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -1
  593. package/daemon/dist/domain/slices/slice-indexer.js +4 -0
  594. package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
  595. package/daemon/dist/domain/startup-orchestrator.d.ts +1 -0
  596. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  597. package/daemon/dist/domain/startup-orchestrator.js +6 -4
  598. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  599. package/daemon/dist/domain/startup-phase-timing.d.ts +19 -0
  600. package/daemon/dist/domain/startup-phase-timing.d.ts.map +1 -0
  601. package/daemon/dist/domain/startup-phase-timing.js +23 -0
  602. package/daemon/dist/domain/startup-phase-timing.js.map +1 -0
  603. package/daemon/dist/domain/successor-session-launcher.d.ts +9 -0
  604. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  605. package/daemon/dist/domain/successor-session-launcher.js +33 -10
  606. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  607. package/daemon/dist/domain/team-operations.d.ts +6 -6
  608. package/daemon/dist/domain/team-operations.d.ts.map +1 -1
  609. package/daemon/dist/domain/team-operations.js +2 -4
  610. package/daemon/dist/domain/team-operations.js.map +1 -1
  611. package/daemon/dist/domain/terminal/herdr-adapter.d.ts +35 -1
  612. package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
  613. package/daemon/dist/domain/terminal/herdr-adapter.js +231 -33
  614. package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
  615. package/daemon/dist/domain/terminal/herdr-app-provider.d.ts +6 -0
  616. package/daemon/dist/domain/terminal/herdr-app-provider.d.ts.map +1 -1
  617. package/daemon/dist/domain/terminal/herdr-app-provider.js +23 -1
  618. package/daemon/dist/domain/terminal/herdr-app-provider.js.map +1 -1
  619. package/daemon/dist/domain/terminal/herdr-sessions.d.ts.map +1 -1
  620. package/daemon/dist/domain/terminal/herdr-sessions.js +2 -1
  621. package/daemon/dist/domain/terminal/herdr-sessions.js.map +1 -1
  622. package/daemon/dist/domain/terminal/rig-viewer-records.d.ts +59 -0
  623. package/daemon/dist/domain/terminal/rig-viewer-records.d.ts.map +1 -0
  624. package/daemon/dist/domain/terminal/rig-viewer-records.js +210 -0
  625. package/daemon/dist/domain/terminal/rig-viewer-records.js.map +1 -0
  626. package/daemon/dist/domain/terminal/terminal-provider.d.ts +2 -0
  627. package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
  628. package/daemon/dist/domain/terminal/terminal-service.d.ts +99 -4
  629. package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
  630. package/daemon/dist/domain/terminal/terminal-service.js +556 -36
  631. package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
  632. package/daemon/dist/domain/terminal/tile-layout.js +1 -1
  633. package/daemon/dist/domain/terminal/tile-layout.js.map +1 -1
  634. package/daemon/dist/domain/terminal/tmux-viewer-guard.d.ts +25 -0
  635. package/daemon/dist/domain/terminal/tmux-viewer-guard.d.ts.map +1 -0
  636. package/daemon/dist/domain/terminal/tmux-viewer-guard.js +70 -0
  637. package/daemon/dist/domain/terminal/tmux-viewer-guard.js.map +1 -0
  638. package/daemon/dist/domain/terminal-policy.js +1 -1
  639. package/daemon/dist/domain/terminal-policy.js.map +1 -1
  640. package/daemon/dist/domain/transcript-grep-worker.d.ts +2 -0
  641. package/daemon/dist/domain/transcript-grep-worker.d.ts.map +1 -0
  642. package/daemon/dist/domain/transcript-grep-worker.js +108 -0
  643. package/daemon/dist/domain/transcript-grep-worker.js.map +1 -0
  644. package/daemon/dist/domain/transcript-grep.d.ts +26 -0
  645. package/daemon/dist/domain/transcript-grep.d.ts.map +1 -0
  646. package/daemon/dist/domain/transcript-grep.js +90 -0
  647. package/daemon/dist/domain/transcript-grep.js.map +1 -0
  648. package/daemon/dist/domain/transcript-store.d.ts +8 -2
  649. package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
  650. package/daemon/dist/domain/transcript-store.js +10 -60
  651. package/daemon/dist/domain/transcript-store.js.map +1 -1
  652. package/daemon/dist/domain/types.d.ts +149 -5
  653. package/daemon/dist/domain/types.d.ts.map +1 -1
  654. package/daemon/dist/domain/types.js.map +1 -1
  655. package/daemon/dist/domain/watchdog-delivery-receipts.d.ts +4 -0
  656. package/daemon/dist/domain/watchdog-delivery-receipts.d.ts.map +1 -1
  657. package/daemon/dist/domain/watchdog-delivery-receipts.js +35 -2
  658. package/daemon/dist/domain/watchdog-delivery-receipts.js.map +1 -1
  659. package/daemon/dist/domain/watchdog-delivery.d.ts +45 -1
  660. package/daemon/dist/domain/watchdog-delivery.d.ts.map +1 -1
  661. package/daemon/dist/domain/watchdog-delivery.js +66 -5
  662. package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
  663. package/daemon/dist/domain/watchdog-history-log.d.ts +12 -0
  664. package/daemon/dist/domain/watchdog-history-log.d.ts.map +1 -1
  665. package/daemon/dist/domain/watchdog-history-log.js +19 -1
  666. package/daemon/dist/domain/watchdog-history-log.js.map +1 -1
  667. package/daemon/dist/domain/watchdog-jobs-repository.d.ts +32 -0
  668. package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
  669. package/daemon/dist/domain/watchdog-jobs-repository.js +79 -0
  670. package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
  671. package/daemon/dist/domain/watchdog-policy-engine.d.ts +22 -3
  672. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  673. package/daemon/dist/domain/watchdog-policy-engine.js +33 -9
  674. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  675. package/daemon/dist/domain/workflow-projector.js +1 -1
  676. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  677. package/daemon/dist/domain/workflow-runtime.d.ts +13 -1
  678. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  679. package/daemon/dist/domain/workflow-runtime.js +68 -9
  680. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  681. package/daemon/dist/domain/workflow-step-trail-log.d.ts +2 -2
  682. package/daemon/dist/domain/workflow-step-trail-log.d.ts.map +1 -1
  683. package/daemon/dist/domain/workflow-step-trail-log.js.map +1 -1
  684. package/daemon/dist/domain/workflow-types.d.ts +3 -1
  685. package/daemon/dist/domain/workflow-types.d.ts.map +1 -1
  686. package/daemon/dist/domain/workflow-types.js.map +1 -1
  687. package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts +7 -1
  688. package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
  689. package/daemon/dist/domain/workspace/default-workspace-scaffold.js +35 -7
  690. package/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
  691. package/daemon/dist/gateway-slack-surface.d.ts +2 -2
  692. package/daemon/dist/gateway-slack-surface.d.ts.map +1 -1
  693. package/daemon/dist/gateway-slack-surface.js +1 -1
  694. package/daemon/dist/gateway-slack-surface.js.map +1 -1
  695. package/daemon/dist/index.d.ts.map +1 -1
  696. package/daemon/dist/index.js +17 -2
  697. package/daemon/dist/index.js.map +1 -1
  698. package/daemon/dist/lib/pane-envelope.d.ts +3 -0
  699. package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
  700. package/daemon/dist/lib/pane-envelope.js +3 -1
  701. package/daemon/dist/lib/pane-envelope.js.map +1 -1
  702. package/daemon/dist/mission-parent-surface.d.ts +2 -0
  703. package/daemon/dist/mission-parent-surface.d.ts.map +1 -0
  704. package/daemon/dist/mission-parent-surface.js +2 -0
  705. package/daemon/dist/mission-parent-surface.js.map +1 -0
  706. package/daemon/dist/routes/activity.d.ts +18 -1
  707. package/daemon/dist/routes/activity.d.ts.map +1 -1
  708. package/daemon/dist/routes/activity.js +150 -9
  709. package/daemon/dist/routes/activity.js.map +1 -1
  710. package/daemon/dist/routes/agent-images.d.ts.map +1 -1
  711. package/daemon/dist/routes/agent-images.js +6 -1
  712. package/daemon/dist/routes/agent-images.js.map +1 -1
  713. package/daemon/dist/routes/attention.d.ts.map +1 -1
  714. package/daemon/dist/routes/attention.js +194 -176
  715. package/daemon/dist/routes/attention.js.map +1 -1
  716. package/daemon/dist/routes/compaction.d.ts.map +1 -1
  717. package/daemon/dist/routes/compaction.js +46 -7
  718. package/daemon/dist/routes/compaction.js.map +1 -1
  719. package/daemon/dist/routes/core-app.d.ts +10 -0
  720. package/daemon/dist/routes/core-app.d.ts.map +1 -0
  721. package/daemon/dist/routes/core-app.js +175 -0
  722. package/daemon/dist/routes/core-app.js.map +1 -0
  723. package/daemon/dist/routes/hook-bridge.d.ts +3 -0
  724. package/daemon/dist/routes/hook-bridge.d.ts.map +1 -0
  725. package/daemon/dist/routes/hook-bridge.js +158 -0
  726. package/daemon/dist/routes/hook-bridge.js.map +1 -0
  727. package/daemon/dist/routes/missions.d.ts.map +1 -1
  728. package/daemon/dist/routes/missions.js +14 -2
  729. package/daemon/dist/routes/missions.js.map +1 -1
  730. package/daemon/dist/routes/queue.d.ts +4 -1
  731. package/daemon/dist/routes/queue.d.ts.map +1 -1
  732. package/daemon/dist/routes/queue.js +239 -38
  733. package/daemon/dist/routes/queue.js.map +1 -1
  734. package/daemon/dist/routes/require-sender-identity.d.ts +4 -3
  735. package/daemon/dist/routes/require-sender-identity.d.ts.map +1 -1
  736. package/daemon/dist/routes/require-sender-identity.js.map +1 -1
  737. package/daemon/dist/routes/restore-check.d.ts.map +1 -1
  738. package/daemon/dist/routes/restore-check.js +1 -0
  739. package/daemon/dist/routes/restore-check.js.map +1 -1
  740. package/daemon/dist/routes/rigspec.d.ts.map +1 -1
  741. package/daemon/dist/routes/rigspec.js +24 -4
  742. package/daemon/dist/routes/rigspec.js.map +1 -1
  743. package/daemon/dist/routes/scope-audit.d.ts.map +1 -1
  744. package/daemon/dist/routes/scope-audit.js +7 -1
  745. package/daemon/dist/routes/scope-audit.js.map +1 -1
  746. package/daemon/dist/routes/seat.d.ts.map +1 -1
  747. package/daemon/dist/routes/seat.js +133 -6
  748. package/daemon/dist/routes/seat.js.map +1 -1
  749. package/daemon/dist/routes/sessions.js +14 -3
  750. package/daemon/dist/routes/sessions.js.map +1 -1
  751. package/daemon/dist/routes/slices.d.ts.map +1 -1
  752. package/daemon/dist/routes/slices.js +21 -2
  753. package/daemon/dist/routes/slices.js.map +1 -1
  754. package/daemon/dist/routes/startup.js +9 -2
  755. package/daemon/dist/routes/startup.js.map +1 -1
  756. package/daemon/dist/routes/terminal.d.ts.map +1 -1
  757. package/daemon/dist/routes/terminal.js +47 -6
  758. package/daemon/dist/routes/terminal.js.map +1 -1
  759. package/daemon/dist/routes/transcripts.d.ts.map +1 -1
  760. package/daemon/dist/routes/transcripts.js +16 -1
  761. package/daemon/dist/routes/transcripts.js.map +1 -1
  762. package/daemon/dist/routes/up.d.ts.map +1 -1
  763. package/daemon/dist/routes/up.js +14 -4
  764. package/daemon/dist/routes/up.js.map +1 -1
  765. package/daemon/dist/routes/watchdog.d.ts.map +1 -1
  766. package/daemon/dist/routes/watchdog.js +21 -3
  767. package/daemon/dist/routes/watchdog.js.map +1 -1
  768. package/daemon/dist/routes/workflow.d.ts.map +1 -1
  769. package/daemon/dist/routes/workflow.js +5 -0
  770. package/daemon/dist/routes/workflow.js.map +1 -1
  771. package/daemon/dist/server.d.ts +5 -0
  772. package/daemon/dist/server.d.ts.map +1 -1
  773. package/daemon/dist/server.js +22 -0
  774. package/daemon/dist/server.js.map +1 -1
  775. package/daemon/dist/startup.d.ts.map +1 -1
  776. package/daemon/dist/startup.js +140 -48
  777. package/daemon/dist/startup.js.map +1 -1
  778. package/daemon/dist/terminal-viewer-guard-surface.d.ts +2 -0
  779. package/daemon/dist/terminal-viewer-guard-surface.d.ts.map +1 -0
  780. package/daemon/dist/terminal-viewer-guard-surface.js +2 -0
  781. package/daemon/dist/terminal-viewer-guard-surface.js.map +1 -0
  782. package/daemon/docs/reference/agent-startup-guide.md +5 -1
  783. package/daemon/docs/reference/claude-status-line.md +3 -2
  784. package/daemon/docs/reference/community-harness-examples/cursor/openrig-cursor-launch +6 -0
  785. package/daemon/docs/reference/community-harness-examples/dsh/README.md +8 -0
  786. package/daemon/docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs +310 -20
  787. package/daemon/docs/reference/community-harness-examples/hermes/openrig-hermes-launch +6 -0
  788. package/daemon/docs/reference/community-harness-examples/openclaw/openrig-openclaw-launch +6 -0
  789. package/daemon/docs/reference/community-harness-examples/openshell/README.md +2 -0
  790. package/daemon/docs/reference/community-harness-examples/pi-tui/openrig-pi-tui-launch +6 -0
  791. package/daemon/docs/reference/community-harness-presets.md +7 -4
  792. package/daemon/docs/reference/core-app.md +212 -0
  793. package/daemon/docs/reference/daemon-http-clients.md +67 -12
  794. package/daemon/docs/reference/getting-started.md +9 -4
  795. package/daemon/docs/reference/harness-runner-contract.md +140 -4
  796. package/daemon/docs/reference/herdr-app.md +6 -0
  797. package/daemon/docs/reference/hosted-members.md +21 -1
  798. package/daemon/docs/reference/quickstart.md +4 -3
  799. package/daemon/docs/reference/rig-spec.md +197 -1
  800. package/daemon/docs/reference/rosters.md +17 -0
  801. package/daemon/docs/reference/sdlc-conventions.md +47 -6
  802. package/daemon/docs/reference/seat-delivery.md +87 -6
  803. package/daemon/docs/reference/slack-app-setup.md +39 -21
  804. package/daemon/docs/reference/terminal-sessions.md +99 -1
  805. package/daemon/docs/reference/whats-new.md +187 -15
  806. package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +23 -0
  807. package/daemon/specs/rigs/launch/factory/guidance/lead-first-move.md +27 -5
  808. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +32 -8
  809. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/startup/context.md +1 -1
  810. package/daemon/specs/rigs/launch/kernel/culture/CULTURE.md +12 -0
  811. package/daemon/specs/rigs/launch/starter/guidance/lead-first-move.md +27 -5
  812. package/dist/acp/connector.js +1 -1
  813. package/dist/acp/connector.js.map +1 -1
  814. package/dist/ask-wake.d.ts.map +1 -1
  815. package/dist/ask-wake.js +8 -1
  816. package/dist/ask-wake.js.map +1 -1
  817. package/dist/build-info.js +3 -3
  818. package/dist/cli-error.d.ts.map +1 -1
  819. package/dist/cli-error.js +7 -1
  820. package/dist/cli-error.js.map +1 -1
  821. package/dist/client.d.ts +2 -1
  822. package/dist/client.d.ts.map +1 -1
  823. package/dist/client.js +3 -2
  824. package/dist/client.js.map +1 -1
  825. package/dist/commands/archive.js +1 -1
  826. package/dist/commands/archive.js.map +1 -1
  827. package/dist/commands/ask.d.ts.map +1 -1
  828. package/dist/commands/ask.js +92 -11
  829. package/dist/commands/ask.js.map +1 -1
  830. package/dist/commands/broadcast.js +9 -5
  831. package/dist/commands/broadcast.js.map +1 -1
  832. package/dist/commands/compact.d.ts +3 -4
  833. package/dist/commands/compact.d.ts.map +1 -1
  834. package/dist/commands/compact.js +76 -16
  835. package/dist/commands/compact.js.map +1 -1
  836. package/dist/commands/config-init-workspace.d.ts.map +1 -1
  837. package/dist/commands/config-init-workspace.js +3 -0
  838. package/dist/commands/config-init-workspace.js.map +1 -1
  839. package/dist/commands/daemon.d.ts.map +1 -1
  840. package/dist/commands/daemon.js +7 -0
  841. package/dist/commands/daemon.js.map +1 -1
  842. package/dist/commands/down.d.ts.map +1 -1
  843. package/dist/commands/down.js +8 -1
  844. package/dist/commands/down.js.map +1 -1
  845. package/dist/commands/export.d.ts.map +1 -1
  846. package/dist/commands/export.js +2 -1
  847. package/dist/commands/export.js.map +1 -1
  848. package/dist/commands/fork.d.ts.map +1 -1
  849. package/dist/commands/fork.js +2 -0
  850. package/dist/commands/fork.js.map +1 -1
  851. package/dist/commands/launch.d.ts.map +1 -1
  852. package/dist/commands/launch.js +11 -3
  853. package/dist/commands/launch.js.map +1 -1
  854. package/dist/commands/ps.d.ts +30 -1
  855. package/dist/commands/ps.d.ts.map +1 -1
  856. package/dist/commands/ps.js +85 -6
  857. package/dist/commands/ps.js.map +1 -1
  858. package/dist/commands/queue.d.ts.map +1 -1
  859. package/dist/commands/queue.js +309 -21
  860. package/dist/commands/queue.js.map +1 -1
  861. package/dist/commands/rig.d.ts +2 -0
  862. package/dist/commands/rig.d.ts.map +1 -1
  863. package/dist/commands/rig.js +36 -2
  864. package/dist/commands/rig.js.map +1 -1
  865. package/dist/commands/roster.d.ts +8 -0
  866. package/dist/commands/roster.d.ts.map +1 -1
  867. package/dist/commands/scope.d.ts.map +1 -1
  868. package/dist/commands/scope.js +346 -9
  869. package/dist/commands/scope.js.map +1 -1
  870. package/dist/commands/seat.d.ts.map +1 -1
  871. package/dist/commands/seat.js +213 -12
  872. package/dist/commands/seat.js.map +1 -1
  873. package/dist/commands/send.d.ts +2 -0
  874. package/dist/commands/send.d.ts.map +1 -1
  875. package/dist/commands/send.js +50 -7
  876. package/dist/commands/send.js.map +1 -1
  877. package/dist/commands/setup.js +2 -2
  878. package/dist/commands/setup.js.map +1 -1
  879. package/dist/commands/slack.d.ts +2 -1
  880. package/dist/commands/slack.d.ts.map +1 -1
  881. package/dist/commands/slack.js +38 -2
  882. package/dist/commands/slack.js.map +1 -1
  883. package/dist/commands/terminal.d.ts +56 -0
  884. package/dist/commands/terminal.d.ts.map +1 -1
  885. package/dist/commands/terminal.js +199 -9
  886. package/dist/commands/terminal.js.map +1 -1
  887. package/dist/commands/transcript.js +1 -1
  888. package/dist/commands/transcript.js.map +1 -1
  889. package/dist/commands/unarchive.js +1 -1
  890. package/dist/commands/unarchive.js.map +1 -1
  891. package/dist/commands/up.d.ts.map +1 -1
  892. package/dist/commands/up.js +3 -0
  893. package/dist/commands/up.js.map +1 -1
  894. package/dist/commands/workflow-follow.d.ts +3 -1
  895. package/dist/commands/workflow-follow.d.ts.map +1 -1
  896. package/dist/commands/workflow-follow.js +25 -6
  897. package/dist/commands/workflow-follow.js.map +1 -1
  898. package/dist/commands/workflow-render.d.ts.map +1 -1
  899. package/dist/commands/workflow-render.js +5 -1
  900. package/dist/commands/workflow-render.js.map +1 -1
  901. package/dist/commands/workflow.d.ts.map +1 -1
  902. package/dist/commands/workflow.js +18 -4
  903. package/dist/commands/workflow.js.map +1 -1
  904. package/dist/daemon-lifecycle.d.ts.map +1 -1
  905. package/dist/daemon-lifecycle.js +12 -0
  906. package/dist/daemon-lifecycle.js.map +1 -1
  907. package/dist/lib/model-observation.d.ts.map +1 -1
  908. package/dist/lib/model-observation.js +9 -3
  909. package/dist/lib/model-observation.js.map +1 -1
  910. package/dist/lib/scope/mission-composition.d.ts +1 -0
  911. package/dist/lib/scope/mission-composition.d.ts.map +1 -1
  912. package/dist/lib/scope/mission-composition.js +14 -0
  913. package/dist/lib/scope/mission-composition.js.map +1 -1
  914. package/dist/lib/scope/scope-audit.d.ts.map +1 -1
  915. package/dist/lib/scope/scope-audit.js +63 -3
  916. package/dist/lib/scope/scope-audit.js.map +1 -1
  917. package/dist/lib/scope/scope-fs.d.ts +10 -0
  918. package/dist/lib/scope/scope-fs.d.ts.map +1 -1
  919. package/dist/lib/scope/scope-fs.js +60 -0
  920. package/dist/lib/scope/scope-fs.js.map +1 -1
  921. package/dist/lib/scope/types.d.ts +3 -1
  922. package/dist/lib/scope/types.d.ts.map +1 -1
  923. package/dist/lib/scope/types.js +5 -1
  924. package/dist/lib/scope/types.js.map +1 -1
  925. package/dist/local-db.d.ts +5 -0
  926. package/dist/local-db.d.ts.map +1 -0
  927. package/dist/local-db.js +23 -0
  928. package/dist/local-db.js.map +1 -0
  929. package/dist/local-origin.d.ts.map +1 -1
  930. package/dist/local-origin.js +2 -17
  931. package/dist/local-origin.js.map +1 -1
  932. package/dist/mcp-server.d.ts.map +1 -1
  933. package/dist/mcp-server.js +138 -24
  934. package/dist/mcp-server.js.map +1 -1
  935. package/dist/restore-packet/packet-writer.d.ts.map +1 -1
  936. package/dist/restore-packet/packet-writer.js +8 -5
  937. package/dist/restore-packet/packet-writer.js.map +1 -1
  938. package/dist/sender-identity.d.ts +18 -6
  939. package/dist/sender-identity.d.ts.map +1 -1
  940. package/dist/sender-identity.js +67 -7
  941. package/dist/sender-identity.js.map +1 -1
  942. package/dist/terminal-window-rex.d.ts +1 -1
  943. package/dist/terminal-window-rex.d.ts.map +1 -1
  944. package/dist/terminal-window-rex.js +3 -2
  945. package/dist/terminal-window-rex.js.map +1 -1
  946. package/dist/terminal-window.d.ts +2 -1
  947. package/dist/terminal-window.d.ts.map +1 -1
  948. package/dist/terminal-window.js +570 -44
  949. package/dist/terminal-window.js.map +1 -1
  950. package/package.json +1 -1
  951. package/tui/dist/daemon-client.d.ts +4 -0
  952. package/tui/dist/daemon-client.d.ts.map +1 -1
  953. package/tui/dist/daemon-client.js +2 -1
  954. package/tui/dist/daemon-client.js.map +1 -1
  955. package/tui/dist/execution/execution-model.d.ts.map +1 -1
  956. package/tui/dist/execution/execution-model.js +22 -5
  957. package/tui/dist/execution/execution-model.js.map +1 -1
  958. package/tui/dist/hydrate.d.ts.map +1 -1
  959. package/tui/dist/hydrate.js +6 -3
  960. package/tui/dist/hydrate.js.map +1 -1
  961. package/tui/dist/navigator.d.ts +1 -1
  962. package/tui/dist/navigator.d.ts.map +1 -1
  963. package/tui/dist/navigator.js +4 -2
  964. package/tui/dist/navigator.js.map +1 -1
  965. package/tui/dist/pulse/render-pulse.d.ts.map +1 -1
  966. package/tui/dist/pulse/render-pulse.js +7 -14
  967. package/tui/dist/pulse/render-pulse.js.map +1 -1
  968. package/tui/dist/render.d.ts.map +1 -1
  969. package/tui/dist/render.js +29 -21
  970. package/tui/dist/render.js.map +1 -1
  971. package/tui/dist/stylize.d.ts.map +1 -1
  972. package/tui/dist/stylize.js +3 -3
  973. package/tui/dist/stylize.js.map +1 -1
  974. package/tui/dist/terminals/terminal-model.d.ts +1 -0
  975. package/tui/dist/terminals/terminal-model.d.ts.map +1 -1
  976. package/tui/dist/terminals/terminal-model.js +4 -2
  977. package/tui/dist/terminals/terminal-model.js.map +1 -1
  978. package/tui/dist/types.d.ts +1 -0
  979. package/tui/dist/types.d.ts.map +1 -1
  980. package/tui/dist/visual-layout.d.ts +3 -0
  981. package/tui/dist/visual-layout.d.ts.map +1 -1
  982. package/tui/dist/visual-layout.js +17 -0
  983. package/tui/dist/visual-layout.js.map +1 -1
  984. package/ui/dist/assets/{index-BvUEh33d.js → index-B-sMy02c.js} +116 -116
  985. package/ui/dist/assets/{index-BX8TUZ0E.css → index-DiN7RwWg.css} +1 -1
  986. package/ui/dist/index.html +2 -2
@@ -2,13 +2,16 @@ import { captureClaudeContinuation } from "./claude-continuation-launch.js";
2
2
  import { observeSolePane } from "./pane-binding-observation.js";
3
3
  import { automaticRestoreOverrides } from "./existing-rig-restore.js";
4
4
  import { restoreRuntimeCompatibilityError } from "./restore-runtime-compatibility.js";
5
- import { leftAttachedReason } from "./restore-plan-preview.js";
5
+ import { leftAttachedReason, restorePermissionSeat } from "./restore-plan-preview.js";
6
+ import { planRestorePermission } from "./permission-account.js";
6
7
  import { assessSnapshotCurrentOccupants, stoppedSnapshotReason } from "./rehydrate-eligibility.js";
7
8
  import { nonInterruptiveNotice, nonInterruptiveSummary } from "../adapters/non-interruptive.js";
8
9
  import { planModelAliasNotice } from "../adapters/yolo-mode.js";
9
10
  import { effortPrecedence, readSeatEffort } from "./seat-effort.js";
11
+ import { createHash } from "node:crypto";
10
12
  import { accessSync, constants, existsSync, mkdirSync, readFileSync, realpathSync, statSync, writeFileSync } from "node:fs";
11
13
  import { dirname, isAbsolute, join } from "node:path";
14
+ import { folderPresent, insideMissingFolder } from "./cwd-resolution.js";
12
15
  import { SEAT_SKILLS_BOOTSTRAP_BLOCK_ID, ensureSeatSkillPlugin, followSeatSkills, hasFollowingSeatSkills, hasSeatSkillRecords, rehydrateSeatSkills, seatSkillPaths, seatSkillPathsForNode, seatCatalogKeptNote, seatSkillReplay, writeSeatSkillCatalog, writeSeatSkillRouter, seatRouterKeptNote } from "./seat-skill-storage.js";
13
16
  import { NativePermissionStore } from "./native-permission-store.js";
14
17
  import { readSeatClaudeMcp } from "./claude-mcp.js";
@@ -16,6 +19,7 @@ import { isLaunchWrapperRuntime, readSeatLaunchWrapper } from "./launch-wrapper.
16
19
  import { resolvePersistedRestorePosture } from "./permission-policy/persisted-restore-posture.js";
17
20
  import { claudeResumeRotation } from "./session-registry.js";
18
21
  import { NO_TERMINAL_LAUNCH_CODES, NOTHING_STOPPED_LAUNCH_CODES } from "./node-launcher.js";
22
+ import { noticeLine } from "../adapters/tmux.js";
19
23
  import { seatRuntimeHome } from "./seat-runtime-home.js";
20
24
  import { readFreshOccupantRelations } from "./fresh-occupant-relation.js";
21
25
  import { assessNativeResumeProbe } from "./native-resume-probe.js";
@@ -31,10 +35,14 @@ import { AppliedLaunchObservationStore } from "./applied-launch-observation-stor
31
35
  import { isShellForeground } from "./shell-classifier.js";
32
36
  import { rebindAndVerifyPaneIdentity } from "./seat-attention-reconciler.js";
33
37
  import { SeatIdentityStore } from "./seat-identity-store.js";
34
- import { SEAT_STARTUP_BLOCKERS, validatePreRestore } from "./restore-preconditions.js";
38
+ import { SEAT_STARTUP_BLOCKERS, resumingConversationSeats, validatePreRestore } from "./restore-preconditions.js";
39
+ import { describePartners, holdsRecordedConversation, pairableConversation } from "./shared-conversation.js";
40
+ import { getNodeInventoryForRigs } from "./node-inventory.js";
35
41
  import { resolveSnapshotRestoreTopology } from "./restore-topology.js";
36
42
  // Only these edge kinds constrain launch order
37
43
  const LAUNCH_DEPENDENCY_KINDS = new Set(["delegates_to", "spawned_by"]);
44
+ /** A subset launch's refusal (selection_changed) for a saved seat no current seat matches by both id and logical id. */
45
+ const SNAPSHOT_SEAT_CHANGED = "A snapshot seat was removed or recreated. Select history for the current seat.";
38
46
  // OPR.0.5.7.1 consumer alignment: the four-way active-occupant ladder lives
39
47
  // in the pure leaf module active-occupant.ts, shared with preview, snapshot
40
48
  // usability, and lifecycle projection. Imported and re-exported here so the
@@ -138,6 +146,14 @@ export function snapshotLaunchOutcome(data, nodeId, runtime, savedRuntime, resum
138
146
  return { kind: "fresh", why: "records no resume source for this seat" };
139
147
  return { kind: "resume" };
140
148
  }
149
+ /** A restored seat's checkpoint file in its working directory, named for the seat, so seats restored into one folder (a
150
+ * run's `--cwd`, or a saved folder they share) each keep their own: the session name made safe for a file name, then the
151
+ * first 8 hex of the SHA-256 of the exact name. Names that become the same safe text (`alpha beta`, `alpha-beta`) or
152
+ * differ only in case (on a case-insensitive filesystem) still get different files; no name is refused. */
153
+ function checkpointFileName(sessionName) {
154
+ const digest = createHash("sha256").update(sessionName).digest("hex").slice(0, 8);
155
+ return `.rigged-checkpoint-${sessionName.replace(/[^A-Za-z0-9._@-]/g, "-")}-${digest}.md`;
156
+ }
141
157
  export class RestoreOrchestrator {
142
158
  db;
143
159
  activeRestores = new Set();
@@ -164,6 +180,7 @@ export class RestoreOrchestrator {
164
180
  routerLineSettings;
165
181
  getDesiredClaudeActivityHooks;
166
182
  appliedLaunchStore;
183
+ harnessNotStartedNotice;
167
184
  constructor(deps) {
168
185
  if (deps.db !== deps.rigRepo.db) {
169
186
  throw new Error("RestoreOrchestrator: rigRepo must share the same db handle");
@@ -205,6 +222,7 @@ export class RestoreOrchestrator {
205
222
  this.freshLaunchAvailable = deps.freshLaunchAvailable;
206
223
  this.seatSkillSelection = deps.seatSkillSelection;
207
224
  this.getDesiredClaudeActivityHooks = deps.getDesiredClaudeActivityHooks;
225
+ this.harnessNotStartedNotice = deps.harnessNotStartedNotice;
208
226
  this.routerLineSettings = deps.routerLineSettings;
209
227
  this.appliedLaunchStore = new AppliedLaunchObservationStore(deps.db);
210
228
  }
@@ -275,14 +293,23 @@ export class RestoreOrchestrator {
275
293
  }
276
294
  this.activeRestores.add(rigId);
277
295
  try {
296
+ const currentRuntimes = Object.fromEntries((this.rigRepo.getRig(rigId)?.nodes ?? []).map((current) => [current.logicalId, current.runtime]));
297
+ // One observation of the seat records for the shared-conversation report, before any restore mutation: the
298
+ // validation and the partner check below name every agent from it, so a stale session this restore then marks
299
+ // detached is not "running" in one warning and "detached" in the other (the maintainer's 3rd review of #3250).
300
+ // The sessions the classification above already found stale are named detached, the status this restore gives them.
301
+ const observed = this.observeConversationRecords(rigId, snapshot.data, opts?.freshLogicalIds, currentRuntimes, classification.stale);
278
302
  const validation = validatePreRestore(snapshot.data, {
279
303
  fsOps: opts?.fsOps,
280
304
  servicesRecord: this.rigRepo.getServicesRecord(rigId),
281
305
  freshLogicalIds: opts?.freshLogicalIds,
282
- currentRuntimes: Object.fromEntries((this.rigRepo.getRig(rigId)?.nodes ?? []).map((current) => [current.logicalId, current.runtime])),
306
+ currentRuntimes,
283
307
  currentCodexProfiles: Object.fromEntries((this.rigRepo.getRig(rigId)?.nodes ?? [])
284
308
  .filter((current) => current.codexConfigProfile !== undefined)
285
309
  .map((current) => [current.logicalId, current.codexConfigProfile])),
310
+ ...(opts?.cwdOverride ? { cwdOverride: opts.cwdOverride } : {}),
311
+ currentStatuses: observed.currentStatuses,
312
+ attachedLogicalIds: observed.attachedLogicalIds,
286
313
  });
287
314
  const topology = resolveSnapshotRestoreTopology(snapshot.data);
288
315
  // A seat that is still a node of this rig but isn't in the snapshot's intended roster isn't started by this restore:
@@ -293,11 +320,13 @@ export class RestoreOrchestrator {
293
320
  const liveNodes = this.rigRepo.getRig(rigId)?.nodes ?? [];
294
321
  const liveNodeIds = new Set(liveNodes.map((current) => current.id));
295
322
  const snapshotNodeIds = new Set(snapshot.data.nodes.map((node) => node.id));
323
+ const intendedLiveIds = new Set(liveNodes.filter(current => topology.intendedRoster.some(intended => intended.logicalId === current.logicalId))
324
+ .map(current => current.id));
296
325
  const narrowedRoster = snapshot.data.topologyRoster?.source === "operator_explicit";
297
326
  const excludedNodes = [
298
327
  ...topology.excludedNodes.map((excluded) => !narrowedRoster && liveNodeIds.has(excluded.nodeId)
299
328
  ? { ...excluded, reason: "current_seat_not_in_intended_roster" } : excluded),
300
- ...(narrowedRoster ? [] : liveNodes.filter((current) => !snapshotNodeIds.has(current.id)).map((current) => ({
329
+ ...(narrowedRoster ? [] : liveNodes.filter((current) => !snapshotNodeIds.has(current.id) && !intendedLiveIds.has(current.id)).map((current) => ({
301
330
  nodeId: current.id, logicalId: current.logicalId, reason: "current_seat_not_in_intended_roster",
302
331
  }))),
303
332
  ];
@@ -395,6 +424,8 @@ export class RestoreOrchestrator {
395
424
  // 5. Execute restore with compensating pattern per node
396
425
  const nodeResults = [];
397
426
  const restoreWarnings = [...validation.warnings];
427
+ const heldLogicalIds = snapshot.data.nodes.filter((node) => heldForStartup.has(node.id)).map((node) => node.logicalId);
428
+ restoreWarnings.push(...this.conversationPartners(rigId, snapshot.data, observed, opts?.freshLogicalIds, currentRuntimes, heldLogicalIds));
398
429
  if (this.rigRepo.getRigNonInterruptive(rigId))
399
430
  restoreWarnings.push(nonInterruptiveSummary(true));
400
431
  else if (opts?.nonInterruptive === false)
@@ -426,6 +457,9 @@ export class RestoreOrchestrator {
426
457
  intendedRoster: topology.intendedRoster,
427
458
  excludedNodes,
428
459
  };
460
+ const notice = await this.noticeBareShells(rigId, `restore attempt ${attemptId}`, nodeResults, restoreWarnings);
461
+ if (notice)
462
+ restoreResult.harnessNotStarted = notice;
429
463
  // 7. Emit restore.completed
430
464
  this.eventBus.emit({ type: "restore.completed", rigId, snapshotId, result: restoreResult });
431
465
  return { ok: true, result: restoreResult };
@@ -476,7 +510,19 @@ export class RestoreOrchestrator {
476
510
  snapshotSelection: selected.selection,
477
511
  targetNodes: intendedNodes
478
512
  .filter((node) => targetIds.has(node.logicalId))
479
- .map((node) => ({ nodeId: node.id, logicalId: node.logicalId })),
513
+ .map((node) => {
514
+ // The permission this launch will start the seat with: restore's own posture rule through the launch's resolver.
515
+ // Only the saved seat itself is read, matched as the launch matches it; a seat recreated under the same name
516
+ // (or none) reads unknown with the launch's own refusal, never the replacement's account.
517
+ const live = rig.nodes.find((candidate) => candidate.id === node.id && candidate.logicalId === node.logicalId);
518
+ if (live && seatProcessOwner(resolveSeatKind(live.binding?.attachmentType)) === "external") {
519
+ return { nodeId: node.id, logicalId: node.logicalId };
520
+ }
521
+ const seat = restorePermissionSeat(rig.rig.name, live ?? { id: node.id, logicalId: node.logicalId, runtime: node.runtime ?? null }, selected.snapshot, node.id);
522
+ return { nodeId: node.id, logicalId: node.logicalId,
523
+ permission: planRestorePermission(this.db, { ...seat, ...(live ? {} : { seatChanged: SNAPSHOT_SEAT_CHANGED }),
524
+ restorePosture: () => this.resolveRestorePosture(seat.nodeId, rigId) }) };
525
+ }),
480
526
  unmatchedIds: logicalIds.filter((id) => !targetIds.has(id) && !targetNodeIds.has(id)),
481
527
  nonTargetEffects,
482
528
  };
@@ -511,7 +557,7 @@ export class RestoreOrchestrator {
511
557
  if (targetNodes.length === 0)
512
558
  return { ok: false, code: "no_matching_nodes", message: `No nodes match logical ids: ${logicalIds.join(", ")}` };
513
559
  if (targetNodes.some(saved => !allNodes.some(current => current.id === saved.id && current.logicalId === saved.logicalId))) {
514
- return { ok: false, code: "selection_changed", message: "A snapshot seat was removed or recreated. Select history for the current seat." };
560
+ return { ok: false, code: "selection_changed", message: SNAPSHOT_SEAT_CHANGED };
515
561
  }
516
562
  if (opts.selectedHistory && (targetNodes.length !== 1 || targetNodes[0].id !== opts.selectedHistory.nodeId
517
563
  || !allNodes.some(node => node.id === opts.selectedHistory.nodeId && node.logicalId === logicalIds[0]))) {
@@ -581,9 +627,12 @@ export class RestoreOrchestrator {
581
627
  isUnknown = true;
582
628
  }
583
629
  }
630
+ // A live session that isn't proven to be a bare shell. Nothing here shows an agent is running in it, so the pane is
631
+ // kept and reported as a live session, never as a running agent.
584
632
  if (isLive) {
585
- if (opts.selectedHistory)
586
- return { ok: false, code: "seat_running", message: "The selected seat is already running; no resume was started." };
633
+ if (opts.selectedHistory) {
634
+ return { ok: false, code: "seat_running", message: "The selected seat has a live session (its agent isn't proven running); no resume was started." };
635
+ }
587
636
  alreadyRunning.push({ nodeId: node.id, logicalId: node.logicalId });
588
637
  continue;
589
638
  }
@@ -643,16 +692,19 @@ export class RestoreOrchestrator {
643
692
  launched.push(result);
644
693
  }
645
694
  // Emit restore.subset_completed for launched targets only
695
+ let harnessNotStarted;
646
696
  if (launched.length > 0) {
647
697
  const subsetResult = {
648
698
  snapshotId: snapshot.id,
649
699
  preRestoreSnapshotId: null,
650
700
  rigResult: rollupRestoreRigResult(launched),
651
701
  nodes: launched,
652
- warnings: subsetWarnings,
702
+ // A copy: the notice below adds its warnings to the launch's result, not to the event already emitted.
703
+ warnings: [...subsetWarnings],
653
704
  snapshotSelection,
654
705
  };
655
- this.eventBus.emit({ type: "restore.subset_completed", rigId, snapshotId: snapshot.id, result: subsetResult });
706
+ const completed = this.eventBus.emit({ type: "restore.subset_completed", rigId, snapshotId: snapshot.id, result: subsetResult });
707
+ harnessNotStarted = await this.noticeBareShells(rigId, `launch attempt ${completed.seq}`, launched, subsetWarnings);
656
708
  }
657
709
  // Emit node.held for non-running held non-targets (tri-state: running/unknown/held)
658
710
  const held = [];
@@ -701,6 +753,7 @@ export class RestoreOrchestrator {
701
753
  unmatchedIds: unmatchedIds.length > 0 ? unmatchedIds : undefined,
702
754
  warnings: subsetWarnings.length > 0 ? subsetWarnings : undefined,
703
755
  snapshotSelection,
756
+ ...(harnessNotStarted ? { harnessNotStarted } : {}),
704
757
  nonTargetEffects: {
705
758
  mode: opts.nonTargetMode,
706
759
  reason: opts.nonTargetMode === "detach_and_hold" ? holdReasonText : null,
@@ -837,6 +890,81 @@ export class RestoreOrchestrator {
837
890
  this.sessionRegistry.updateStatus(sess.id, sess.status);
838
891
  }
839
892
  }
893
+ /**
894
+ * #3218 item 3 (B1 of its review; points 3 to 5 of the maintainer's): the agents this restore resumes, compared with
895
+ * the known agents outside it, with their recorded status (in this rig outside a replacement's selection, kept
896
+ * attached to an external CLI or held for startup, or in another rig), from the same rigs rig restore-check reads: the
897
+ * listed ones, archived rigs left out. Named in the restore's warnings; nothing is refused, stopped or picked, and an
898
+ * inventory that cannot be read says the comparison is unavailable. Every status comes from the one observation taken
899
+ * before the restore changed anything (observeConversationRecords).
900
+ */
901
+ conversationPartners(rigId, data, observed, freshLogicalIds, currentRuntimes, heldLogicalIds) {
902
+ const resuming = resumingConversationSeats(data, { freshLogicalIds, currentRuntimes, currentStatuses: observed.currentStatuses,
903
+ attachedLogicalIds: observed.attachedLogicalIds, heldLogicalIds });
904
+ if (!resuming.some(pairableConversation))
905
+ return [];
906
+ if (observed.inventory === null) {
907
+ return [`Restore pre-validation: the shared-conversation comparison with agents outside this restore is unavailable (${observed.unavailable}).`];
908
+ }
909
+ // Left out: only the seats restore launches. One kept attached to an external CLI (left_attached) stays running
910
+ // with its conversation, and one held for startup keeps its current session: both are compared as agents outside
911
+ // the restore (the maintainer's reviews of #3250).
912
+ const launched = new Set(resolveSnapshotRestoreTopology(data).intendedNodes.map((node) => node.logicalId)
913
+ .filter((logicalId) => !observed.attachedLogicalIds.includes(logicalId) && !heldLogicalIds.includes(logicalId)));
914
+ const others = observed.inventory
915
+ .filter((entry) => !(entry.rigId === rigId && launched.has(entry.logicalId)) && holdsRecordedConversation(entry))
916
+ .map((entry) => ({
917
+ seat: entry.canonicalSessionName ?? `${entry.logicalId}@${entry.rigName}`,
918
+ state: entry.sessionStatus ?? "unknown",
919
+ resumeType: entry.resumeType,
920
+ resumeToken: entry.resumeToken,
921
+ }));
922
+ const rigName = data.rig?.name ?? rigId;
923
+ return describePartners(resuming.map((entry) => ({ ...entry, seat: `${entry.seat}@${rigName}` })), others)
924
+ .map((warning) => `Restore pre-validation: ${warning}`);
925
+ }
926
+ /** The one observation of the seat records the shared-conversation report names (#3250, the maintainer's 3rd
927
+ * review), taken before any restore mutation: the seats kept attached to an external CLI, from their bindings (the
928
+ * record that makes restore leave them running, left_attached, instead of launching them), and, only when this
929
+ * restore would resume a seat with a recorded conversation it can pair (pairableConversation), ONE read of the node inventory of the listed rigs and
930
+ * this rig (an archived rig's restore inclusive): this rig's seats' sessionStatus and the partners' records. A seat of
931
+ * this rig whose current session is recorded running and was found stale by classifyRunningSessions (no tmux session)
932
+ * is named detached, the status this restore gives it before it launches anything, so the report never calls it
933
+ * running. An inventory that cannot be read leaves the partner comparison unavailable; this rig's own statuses then
934
+ * come from a read of this rig alone ("unknown" when that fails too). */
935
+ observeConversationRecords(rigId, data, freshLogicalIds, currentRuntimes, staleSessionIds) {
936
+ const attachedLogicalIds = (this.rigRepo.getRig(rigId)?.nodes ?? [])
937
+ .filter((node) => seatProcessOwner(resolveSeatKind(this.sessionRegistry.getBindingForNode(node.id)?.attachmentType)) === "external")
938
+ .map((node) => node.logicalId);
939
+ if (!resumingConversationSeats(data, { freshLogicalIds, currentRuntimes, attachedLogicalIds }).some(pairableConversation)) {
940
+ return { currentStatuses: {}, attachedLogicalIds, inventory: [] };
941
+ }
942
+ const staleIds = new Set(staleSessionIds);
943
+ // An inventory entry is its node's newest session (node-inventory's ORDER BY id DESC). It is named detached only
944
+ // when that session is a stale one, not when an older session of the node is.
945
+ const newestByNode = new Map();
946
+ for (const session of this.sessionRegistry.getSessionsForRig(rigId)) {
947
+ const newest = newestByNode.get(session.nodeId);
948
+ if (newest === undefined || session.id > newest)
949
+ newestByNode.set(session.nodeId, session.id);
950
+ }
951
+ const staleNodeIds = new Set([...newestByNode].filter(([, sessionId]) => staleIds.has(sessionId)).map(([nodeId]) => nodeId));
952
+ const labelled = (entry) => entry.rigId === rigId && entry.sessionStatus === "running" && staleNodeIds.has(entry.nodeId) ? { ...entry, sessionStatus: "detached" } : entry;
953
+ const statusesOf = (entries) => Object.fromEntries(entries.map((entry) => [entry.logicalId, entry.sessionStatus ?? null]));
954
+ try {
955
+ const byRig = getNodeInventoryForRigs(this.db, new Set([...this.rigRepo.listRigs().map((rig) => rig.id), rigId]));
956
+ const inventory = [...byRig.values()].flat().map(labelled);
957
+ return { currentStatuses: statusesOf(inventory.filter((entry) => entry.rigId === rigId)), attachedLogicalIds, inventory };
958
+ }
959
+ catch (err) {
960
+ let currentStatuses = {};
961
+ try {
962
+ currentStatuses = statusesOf((getNodeInventoryForRigs(this.db, new Set([rigId])).get(rigId) ?? []).map(labelled));
963
+ }
964
+ catch { /* every seat "unknown" */ }
965
+ return { currentStatuses, attachedLogicalIds, inventory: null, unavailable: err instanceof Error ? err.message : String(err) };
966
+ }
967
+ }
840
968
  computeRestorePlan(data) {
841
969
  const nodes = resolveSnapshotRestoreTopology(data).intendedNodes;
842
970
  const edges = data.edges;
@@ -914,6 +1042,9 @@ export class RestoreOrchestrator {
914
1042
  * Preserve prior state so a failed launch or resume can be compensated.
915
1043
  */
916
1044
  async restoreNodeWithCompensation(entry, rigId, snapshotId, data, opts, warnings, preserveStoppedCurrent = false) {
1045
+ // `--cwd`: the seat launches, resumes and gets its guidance and checkpoint in the given directory, for this run only.
1046
+ if (opts?.cwdOverride)
1047
+ entry = { ...entry, node: { ...entry.node, cwd: opts.cwdOverride } };
917
1048
  // Compare against the live logical target without changing saved post-launch inputs.
918
1049
  const node = entry.node;
919
1050
  // Activity-hook restore gaps (#1530) are collected out-of-band: postLaunchRestore
@@ -933,6 +1064,16 @@ export class RestoreOrchestrator {
933
1064
  if (external && seatProcessOwner(resolveSeatKind(external.attachmentType)) === "external") {
934
1065
  return { nodeId, logicalId: node.logicalId, status: "left_attached", error: leftAttachedReason(external.externalSessionName ?? node.logicalId), ...notStarted };
935
1066
  }
1067
+ // A seat's saved directory that isn't on this machine (a workspace restored onto another home) is named plainly, with
1068
+ // the way to launch elsewhere; nothing is refused here, and the launch below goes on as before.
1069
+ const savedCwd = node.cwd ?? liveNode?.cwd;
1070
+ const launchElsewhere = `To launch this rig's seats in another directory for this run: rig up ${data.rig?.name ?? rigId} --existing --cwd <dir>.`;
1071
+ // Where the line is, so that once the launch below has run it can also name the folder the seat started in.
1072
+ let missingCwdAt = -1;
1073
+ // Only a confirmed absence is named missing (folderPresent): a folder that can't be looked into isn't.
1074
+ if (!opts?.cwdOverride && savedCwd && isAbsolute(savedCwd) && opts?.fsOps && !folderPresent(savedCwd) && warnings) {
1075
+ missingCwdAt = warnings.push(`Restore: ${node.logicalId}'s working directory ${savedCwd} doesn't exist on this machine. ${launchElsewhere}`) - 1;
1076
+ }
936
1077
  // OPR.0.5.7.1 (bought ordering blocker, baton 0efd154d): D1 present-map
937
1078
  // ambiguity must be DETECTED before any continuity_state short-circuit —
938
1079
  // a pod node in 'restoring' otherwise returns a silent status "fresh"
@@ -1222,6 +1363,9 @@ export class RestoreOrchestrator {
1222
1363
  const onSessionLaunched = opts?.onSessionLaunched;
1223
1364
  const launchResult = await this.nodeLauncher.launchNode(rigId, node.logicalId, {
1224
1365
  ...launchOpts,
1366
+ // #3253: a restore or resume is a recovery: nothing of the seat runs, so a limit that can't be applied doesn't stop
1367
+ // it. It goes ahead with a structured warning, and the request stays stored for a fresh launch to apply.
1368
+ processLimitsMode: "recovery",
1225
1369
  ...(selectedHistory ? { expectedNodeId: nodeId, beforeEffect: selectedHistory.beforeNative,
1226
1370
  beforeRegistration: selectedHistory.beforeRegistration } : {}),
1227
1371
  ...(savedStartup ? { pluginPaths: pluginPathsOf(savedStartup.projectionEntries) } : {}),
@@ -1250,12 +1394,35 @@ export class RestoreOrchestrator {
1250
1394
  if (launchResult.warnings?.length) {
1251
1395
  warnings?.push(...launchResult.warnings);
1252
1396
  }
1397
+ // Where the seat started, from its own bound pane only (boundPaneFolder): unread, the line names no folder.
1398
+ if (missingCwdAt >= 0 && warnings) {
1399
+ const startedIn = await this.boundPaneFolder(launchResult.sessionName, launchResult.binding.tmuxPane);
1400
+ if (startedIn && startedIn !== savedCwd) {
1401
+ warnings[missingCwdAt] = `Restore: ${node.logicalId}'s working directory ${savedCwd} doesn't exist on this machine, so it started in `
1402
+ + `${startedIn}. ${launchElsewhere}`;
1403
+ }
1404
+ }
1405
+ // A folder given with `--cwd` that isn't on this machine is named the same way. Where the seat started is read now,
1406
+ // before the harness and its startup are replayed, which can change the pane's folder.
1407
+ const givenMissing = opts?.cwdOverride && isAbsolute(opts.cwdOverride) && opts.fsOps && warnings && !folderPresent(opts.cwdOverride)
1408
+ ? opts.cwdOverride : null;
1409
+ const givenStartedIn = givenMissing ? await this.boundPaneFolder(launchResult.sessionName, launchResult.binding.tmuxPane) : null;
1253
1410
  // A selected launch's own blank rolled back after the shell started (postLaunchRestore has many return points).
1254
1411
  const compensation = { ran: false };
1255
1412
  const restored = await this.postLaunchRestore(entry, rigId, data, launchResult.sessionName, launchResult, { ...opts, ...(claudeExecutable ? { claudeExecutable } : {}), ...(claudeLaunch ? { claudeLaunch } : {}), compensation }, warnings, priorState, seatRehydration, resumeSession, activityHookGaps, restoredSkillCatalog);
1256
- const checked = { ...this.checkRestoredGuidance(restored, entry.node, rigId, data, warnings),
1413
+ // Whether it's still missing is decided once the launch has run: a fresh launch creates it, and a restore doesn't, so the
1414
+ // seat's terminal started in tmux's fallback folder.
1415
+ if (givenMissing && warnings && !folderPresent(givenMissing)) {
1416
+ warnings.push(`Restore: ${node.logicalId}'s working directory ${givenMissing}, given with --cwd, doesn't exist on this machine`
1417
+ + (givenStartedIn && givenStartedIn !== givenMissing ? `, so it started in ${givenStartedIn}. ` : ". ") + launchElsewhere);
1418
+ }
1419
+ // Saved inputs stay keyed by the snapshot; the result names the seat that the launcher actually registered.
1420
+ const checked = { ...this.checkRestoredGuidance(restored, entry.node, rigId, data, warnings), nodeId: launchResult.session.nodeId,
1421
+ ...(launchResult.session.nodeId !== node.id ? { intendedNodeId: node.id } : {}),
1257
1422
  ...(activityHookGaps.length > 0 ? { restoreGaps: activityHookGaps } : {}),
1258
- ...(keptPane ? { launchStarted: true } : {}) };
1423
+ ...(keptPane ? { launchStarted: true } : {}),
1424
+ // #3253: the provisional shell's notice, unless a replacement retired it and reported its own (the key is set).
1425
+ ...(launchResult.processLimits && !("processLimits" in restored) ? { processLimits: launchResult.processLimits } : {}) };
1259
1426
  return selectedHistory ? { ...checked, sourceSessionId: selectedHistory.historySessionId, resultSessionId: launchResult.session.id,
1260
1427
  ...(compensation.ran ? { compensated: true } : {}) } : checked;
1261
1428
  }
@@ -1407,6 +1574,7 @@ export class RestoreOrchestrator {
1407
1574
  if (!["resumed", "fresh-primed", "fresh", "rebuilt", "attention_required"].includes(result.status))
1408
1575
  return result;
1409
1576
  let guidance;
1577
+ let guidanceCwd;
1410
1578
  try {
1411
1579
  // The seat was launched in the snapshot node's cwd when set, else the
1412
1580
  // live node's cwd — the same resolved launch directory the hook
@@ -1414,7 +1582,7 @@ export class RestoreOrchestrator {
1414
1582
  // no guidance at all when the snapshot node has no cwd. No "." fallback:
1415
1583
  // when neither cwd exists the old skip is kept, so no guidance file is
1416
1584
  // written into the daemon's own working directory.
1417
- const guidanceCwd = node.cwd
1585
+ guidanceCwd = node.cwd
1418
1586
  ?? this.rigRepo.getRig(rigId)?.nodes.find(current => current.logicalId === node.logicalId)?.cwd;
1419
1587
  guidance = seatGuidance(data.nodeStartupContext?.[node.id] ?? null, guidanceCwd, this.rigRepo.getRigClaudeManagedBlockFile(rigId), existsSync, (path) => readFileSync(path, "utf-8"));
1420
1588
  }
@@ -1441,7 +1609,9 @@ export class RestoreOrchestrator {
1441
1609
  }
1442
1610
  if (missing.length === 0)
1443
1611
  return noted;
1444
- const gap = `${node.logicalId} is running without part of its guidance: ${guidance.targetPath} lacks the OpenRig blocks ${missing.join(", ")}.`;
1612
+ // A saved folder this machine doesn't have got nothing put back (see postLaunchRestore): say why the blocks are missing.
1613
+ const gap = `${node.logicalId} is running without part of its guidance: ${guidance.targetPath} lacks the OpenRig blocks ${missing.join(", ")}`
1614
+ + (insideMissingFolder(guidance.targetPath, guidanceCwd, folderPresent) ? `, because ${guidanceCwd} doesn't exist on this machine.` : ".");
1445
1615
  warnings?.push(`Restore: ${gap}`);
1446
1616
  return { ...noted, guidanceGaps: missing };
1447
1617
  }
@@ -1508,6 +1678,49 @@ export class RestoreOrchestrator {
1508
1678
  }
1509
1679
  return { rolledBack: true, terminalStopped };
1510
1680
  }
1681
+ /** The notice for the seats an attempt positively left as bare shells, each with its own cause. Its warnings join the
1682
+ * attempt's, and a failure to send it is a warning too: it never changes or blocks the attempt's own result. Seats not
1683
+ * positively left as shells stay in the roll call. */
1684
+ async noticeBareShells(rigId, attempt, results, warnings) {
1685
+ const shells = results.filter((n) => n.stage === "harness_not_started");
1686
+ if (shells.length === 0 || !this.harnessNotStartedNotice)
1687
+ return undefined;
1688
+ try {
1689
+ // The launcher finds a seat by its logical id in the live rig, so a seat recreated since the snapshot was launched
1690
+ // under its live node, while its result keeps the snapshot's node id: the notice reads the node the shell is on.
1691
+ const liveNodes = this.rigRepo.getRig(rigId)?.nodes ?? [];
1692
+ const seats = shells.map(({ nodeId, logicalId, error }) => ({ nodeId: liveNodes.find((node) => node.logicalId === logicalId)?.id ?? nodeId,
1693
+ logicalId, ...(error ? { cause: error } : {}) }));
1694
+ const report = await this.harnessNotStartedNotice({ rigId, attempt, seats });
1695
+ for (const warning of report.warnings ?? [])
1696
+ warnings.push(`Restore: ${warning}`);
1697
+ return report;
1698
+ }
1699
+ catch (err) {
1700
+ warnings.push(`Restore: the notice for the seats left as a bare shell wasn't recorded (${err instanceof Error ? err.message : String(err)}).`);
1701
+ return undefined;
1702
+ }
1703
+ }
1704
+ /** Restore left this pane as a bare shell, which the launcher registered as a running session. Mark that session, with
1705
+ * the stage that says no harness started, so nothing counts the shell as a running seat. Nothing is stopped. The node
1706
+ * is the session's own: a seat recreated since the snapshot is launched under its live node. */
1707
+ markHarnessNotStarted(rigId, nodeId, sessionId, error) {
1708
+ this.sessionRegistry.updateStartupStatus(sessionId, "attention_required");
1709
+ this.eventBus.emit({ type: "node.startup_failed", rigId, nodeId, error, sessionId, stage: "harness_not_started" });
1710
+ }
1711
+ /** tmux starts a terminal whose folder is missing in a fallback folder of its own (its server's HOME), which the launch's
1712
+ * record doesn't hold, so the folder a seat started in is read from the seat's own bound pane, in any window. Another
1713
+ * pane's folder is never named: when that pane isn't listed or can't be read, this is null. */
1714
+ async boundPaneFolder(sessionName, pane) {
1715
+ if (!pane)
1716
+ return null;
1717
+ try {
1718
+ return (await this.tmuxAdapter.listPanes(sessionName, true)).find((listed) => listed.id === pane)?.cwd ?? null;
1719
+ }
1720
+ catch {
1721
+ return null;
1722
+ }
1723
+ }
1511
1724
  /** Retire only the provisional session created by this restore attempt. The prior
1512
1725
  * binding must stay cleared while a replacement launch is handed off. */
1513
1726
  async retireProvisionalSession(nodeId, sessionName, launchedSessionId) {
@@ -1677,7 +1890,9 @@ export class RestoreOrchestrator {
1677
1890
  const recoveryRuntime = startupCtx?.runtime
1678
1891
  ?? (!isPodAware && liveRuntime === node.runtime ? node.runtime : null);
1679
1892
  if (resumeRequested && resumeToken && launchResult && recoveryRuntime === "claude-code") {
1680
- const entries = (startupCtx?.projectionEntries ?? []).filter(e => e.category === "runtime_resource" && e.resourceType === "claude_activity_hooks");
1893
+ // The saved hooks resource ships under the install's specs: read it from the running install, as replay does.
1894
+ const entries = (startupCtx?.projectionEntries ?? []).filter(e => e.category === "runtime_resource" && e.resourceType === "claude_activity_hooks")
1895
+ .map((e) => reanchorShippedProjectionEntry(e, undefined, opts?.fsOps?.exists ?? (() => true)));
1681
1896
  if (entries.length > 0 && activityAdapter)
1682
1897
  try {
1683
1898
  const result = await activityAdapter.project({
@@ -1691,10 +1906,16 @@ export class RestoreOrchestrator {
1691
1906
  warnings?.push(`Restore activity hooks: skipped ${skipped}; saved hooks could not be reapplied.`);
1692
1907
  for (const failure of result.failed)
1693
1908
  warnings?.push(`Restore activity hooks: ${failure.error}`);
1909
+ // Saved hooks that couldn't be reapplied are a restore gap, as for the current selection (restoreCurrentActivityHooks),
1910
+ // so the rig doesn't read fully restored. Hooks already in the seat's settings may remain: a failed check writes nothing.
1911
+ const detail = [...result.skipped.map((skipped) => `skipped ${skipped}`), ...result.failed.map((failure) => failure.error)].join("; ");
1912
+ if (detail)
1913
+ activityHookGaps?.push(`claude_activity_hooks: the saved hooks could not be reapplied: ${detail}.`);
1694
1914
  }
1695
1915
  catch (error) {
1696
1916
  // Activity delivery remains best-effort, as on an ordinary fresh launch.
1697
1917
  warnings?.push(`Restore activity hooks: ${error.message}`);
1918
+ activityHookGaps?.push(`claude_activity_hooks: the saved hooks could not be reapplied: ${error.message}.`);
1698
1919
  }
1699
1920
  else if (entries.length === 0) {
1700
1921
  await this.restoreCurrentActivityHooks(node, activityAdapter, launchResult, warnings, activityHookGaps, launchCwd);
@@ -1717,11 +1938,12 @@ export class RestoreOrchestrator {
1717
1938
  // reaches the conversation; no action, skill or plugin runs. Never blocks the resume.
1718
1939
  if (resumeRequested && resumeToken && launchResult) {
1719
1940
  let guidance = null;
1941
+ let guidanceCwd;
1720
1942
  try {
1721
1943
  // Same resolved directory as launchCwd, without its "." fallback:
1722
1944
  // when neither the snapshot nor the live node has a cwd, keep the
1723
1945
  // old skip instead of writing guidance into the daemon's folder.
1724
- const guidanceCwd = node.cwd
1946
+ guidanceCwd = node.cwd
1725
1947
  ?? this.rigRepo.getRig(rigId)?.nodes.find(current => current.logicalId === node.logicalId
1726
1948
  && (!selected || current.id === node.id))?.cwd;
1727
1949
  guidance = seatGuidance(startupCtx, guidanceCwd, this.rigRepo.getRigClaudeManagedBlockFile(rigId), existsSync, (path) => readFileSync(path, "utf-8"));
@@ -1772,6 +1994,11 @@ export class RestoreOrchestrator {
1772
1994
  deliveryHint: "guidance_merge", required: false, appliesOn: ["fresh_start", "restore"] }));
1773
1995
  guidance = { ...guidance, items: guidance.items.filter((item) => !carried.includes(item)) };
1774
1996
  }
1997
+ // A saved folder this machine doesn't have isn't created just to hold the file (insideMissingFolder); a file outside
1998
+ // it, such as a Pi agent folder's own AGENTS.md, is read wherever the seat runs. The check after the launch reports
1999
+ // the blocks the seat lacks.
2000
+ if (guidance && insideMissingFolder(guidance.targetPath, guidanceCwd, folderPresent))
2001
+ guidance = null;
1775
2002
  if (guidance && guidance.items.length > 0) {
1776
2003
  // #2456: a block OpenRig wrote whose source changed since is refreshed too; an edited one, or one with no record, is
1777
2004
  // left as it is and named (the check after the launch carries the names onto the seat's result).
@@ -1903,7 +2130,7 @@ export class RestoreOrchestrator {
1903
2130
  if (!node.cwd) {
1904
2131
  return { nodeId: node.id, logicalId: node.logicalId, status: "failed", error: "Checkpoint available but node has no cwd" };
1905
2132
  }
1906
- const written = this.writeCheckpointFile(node.cwd, checkpoint);
2133
+ const written = this.writeCheckpointFile(node.cwd, sessionName, checkpoint);
1907
2134
  if (written) {
1908
2135
  baseStatus = "rebuilt";
1909
2136
  }
@@ -1967,27 +2194,41 @@ export class RestoreOrchestrator {
1967
2194
  if (this.freshLaunchAvailable && !this.freshLaunchAvailable(rigId, node.id)) {
1968
2195
  const error = `Harness not started: no usable persisted launch recipe for ${node.logicalId}.`;
1969
2196
  warnings?.push(`Restore: ${error}`);
1970
- return { nodeId: node.id, logicalId: node.logicalId, status: "attention_required", error };
2197
+ this.markHarnessNotStarted(rigId, launchResult.session.nodeId, launchResult.session.id, error);
2198
+ return { nodeId: node.id, logicalId: node.logicalId, status: "attention_required", error, stage: "harness_not_started" };
1971
2199
  }
1972
2200
  const retired = await this.retireProvisionalSession(node.id, sessionName, launchResult.session.id);
1973
2201
  if (!retired.ok) {
1974
2202
  warnings?.push(`Restore: ${retired.error}`);
1975
2203
  return { nodeId: node.id, logicalId: node.logicalId, status: "attention_required", error: retired.error };
1976
2204
  }
2205
+ // The retired provisional shell's process-limits line no longer describes the seat: the replacement reports its
2206
+ // own (or none, when it applied the limit), and a replacement that fails to launch runs nothing, so the line
2207
+ // goes before the launch is awaited and the same notice is never printed twice.
2208
+ const staleLimits = launchResult.processLimits ? noticeLine(launchResult.processLimits) : undefined;
2209
+ const stale = staleLimits && warnings ? warnings.lastIndexOf(staleLimits) : -1;
2210
+ if (stale >= 0)
2211
+ warnings.splice(stale, 1);
1977
2212
  const replacementExists = () => this.sessionRegistry.getSessionsForRig(rigId)
1978
2213
  .some((candidate) => candidate.nodeId === node.id
1979
2214
  && candidate.status === "running"
1980
2215
  && candidate.id !== launchResult.session.id);
1981
2216
  try {
1982
- const fresh = await this.freshLaunch(rigId, node.id);
2217
+ // #3253: this replaces the provisional shell of a restore, so it is a recovery too: a limit that can't be
2218
+ // applied doesn't stop the seat, and its notice is the node's. The replacement launches where the provisional
2219
+ // shell did: this run's `--cwd`, else the saved folder.
2220
+ const fresh = await this.freshLaunch(rigId, node.id, { processLimitsMode: "recovery", ...(opts?.cwdOverride ? { cwdOverride: opts.cwdOverride } : {}) });
1983
2221
  if (fresh.warnings?.length)
1984
2222
  warnings?.push(...fresh.warnings);
2223
+ // The replacement's own outcome, also when it applied the limit (no notice): the retired provisional shell's
2224
+ // notice no longer describes the seat (the key is set either way, so the caller doesn't fall back to it).
2225
+ const limits = { processLimits: fresh.processLimits };
1985
2226
  if (fresh.status === "launched") {
1986
- return { nodeId: node.id, logicalId: node.logicalId, status: "fresh-primed" };
2227
+ return { nodeId: node.id, logicalId: node.logicalId, status: "fresh-primed", ...limits };
1987
2228
  }
1988
2229
  if (priorState && !replacementExists())
1989
2230
  this.restoreNodeState(node.id, priorState);
1990
- return { nodeId: node.id, logicalId: node.logicalId, status: fresh.status, error: fresh.error };
2231
+ return { nodeId: node.id, logicalId: node.logicalId, status: fresh.status, error: fresh.error, ...limits };
1991
2232
  }
1992
2233
  catch (err) {
1993
2234
  if (priorState && !replacementExists())
@@ -1996,6 +2237,7 @@ export class RestoreOrchestrator {
1996
2237
  nodeId: node.id,
1997
2238
  logicalId: node.logicalId,
1998
2239
  status: "failed",
2240
+ processLimits: undefined,
1999
2241
  error: `Fresh launch failed: ${err.message}`,
2000
2242
  };
2001
2243
  }
@@ -2003,7 +2245,8 @@ export class RestoreOrchestrator {
2003
2245
  const cause = replayCtx ? `no ${startupRuntime} runtime adapter` : "no startup context";
2004
2246
  const error = `Harness not started: ${cause} for ${node.logicalId}.`;
2005
2247
  warnings?.push(`Restore: ${error}`);
2006
- return { nodeId: node.id, logicalId: node.logicalId, status: "attention_required", error };
2248
+ this.markHarnessNotStarted(rigId, launchResult.session.nodeId, launchResult.session.id, error);
2249
+ return { nodeId: node.id, logicalId: node.logicalId, status: "attention_required", error, stage: "harness_not_started" };
2007
2250
  }
2008
2251
  // Attempt restore-safe startup replay if context available
2009
2252
  if ((data.nodeStartupContext || replayCtx) && opts?.adapters && launchResult) {
@@ -2395,6 +2638,7 @@ export class RestoreOrchestrator {
2395
2638
  let kernelAuthority = false;
2396
2639
  let teamPermissionDefault = false;
2397
2640
  let claudePermissions;
2641
+ let claudeAutoMode;
2398
2642
  let claudeMcp;
2399
2643
  let launchWrapper;
2400
2644
  let codexPermissions;
@@ -2406,6 +2650,7 @@ export class RestoreOrchestrator {
2406
2650
  kernelAuthority = override.kernelAuthority === true;
2407
2651
  teamPermissionDefault = override.teamPermissionDefault === true;
2408
2652
  claudePermissions = override.claudePermissions;
2653
+ claudeAutoMode = override.claudeAutoMode;
2409
2654
  claudeMcp = runtime === "claude-code" ? readSeatClaudeMcp(this.db, nodeId) : undefined;
2410
2655
  launchWrapper = isLaunchWrapperRuntime(runtime) ? readSeatLaunchWrapper(this.db, nodeId) : undefined;
2411
2656
  codexPermissions = override.codexPermissions;
@@ -2435,7 +2680,8 @@ export class RestoreOrchestrator {
2435
2680
  ...(claudeExecutable ? [claudeExecutable] : [])] : tail;
2436
2681
  const mcpTail = claudeMcp === undefined ? guardedTail : [...guardedTail, ...Array(Math.max(0, 9 - guardedTail.length)).fill(undefined), claudeMcp];
2437
2682
  const wrapperTail = launchWrapper?.length ? [...mcpTail, ...Array(Math.max(0, 10 - mcpTail.length)).fill(undefined), launchWrapper] : mcpTail;
2438
- const wrappedTail = claudeLaunch ? [...wrapperTail, ...Array(Math.max(0, 11 - wrapperTail.length)).fill(undefined), claudeLaunch] : wrapperTail;
2683
+ const continuationTail = claudeLaunch ? [...wrapperTail, ...Array(Math.max(0, 11 - wrapperTail.length)).fill(undefined), claudeLaunch] : wrapperTail;
2684
+ const wrappedTail = claudeAutoMode !== undefined ? [...continuationTail, ...Array(Math.max(0, 12 - continuationTail.length)).fill(undefined), claudeAutoMode] : continuationTail;
2439
2685
  if (beforeNative && !beforeNative())
2440
2686
  return { kind: "attention_required", message: "The selected seat, settings or history changed during native preparation; resume was not dispatched." };
2441
2687
  const result = await this.claudeResume.resume(sessionName, resumeType, resumeToken, cwd, resolvedPosture, model, permissionMode, nodeId, ...wrappedTail);
@@ -2531,6 +2777,8 @@ export class RestoreOrchestrator {
2531
2777
  if (this.ompResume?.canResume(resumeType, resumeToken)) {
2532
2778
  const result = await this.ompResume.resume(sessionName, resumeType, resumeToken, cwd, model, resolvedPosture);
2533
2779
  if (result.ok) {
2780
+ for (const note of result.warnings ?? [])
2781
+ warnings?.push(`${sessionName}: ${note}`);
2534
2782
  if (result.appliedLaunch && launchGeneration)
2535
2783
  this.appliedLaunchStore.recordGeneration(launchGeneration, result.appliedLaunch);
2536
2784
  return { kind: "resumed" };
@@ -2558,33 +2806,16 @@ export class RestoreOrchestrator {
2558
2806
  * to reconcile).
2559
2807
  */
2560
2808
  async reconcileNodeRuntimeTruth(rigId, nodeId) {
2561
- // Locate the latest restore attempt for this rig.
2562
- const startedRow = this.db.prepare("SELECT seq, payload FROM events WHERE rig_id = ? AND type = 'restore.started' ORDER BY seq DESC LIMIT 1").get(rigId);
2563
- if (!startedRow) {
2564
- return { ok: false, code: "no_attempt", detail: "No restore.started event recorded for this rig." };
2565
- }
2566
- const attemptId = startedRow.seq;
2567
- // Find the node's most recent post-attempt outcome from the most-recent
2568
- // restore.completed event for this rig. If the latest outcome is not
2569
- // failed or attention_required, the reconciler has nothing to upgrade.
2570
- const completedRow = this.db.prepare("SELECT payload FROM events WHERE rig_id = ? AND type = 'restore.completed' AND seq > ? ORDER BY seq DESC LIMIT 1").get(rigId, attemptId);
2571
- let nodeStatus = null;
2572
- let nodeLogicalId = null;
2573
- if (completedRow) {
2574
- try {
2575
- const parsed = JSON.parse(completedRow.payload);
2576
- const found = parsed.result?.nodes?.find((n) => n.nodeId === nodeId);
2577
- if (found) {
2578
- nodeStatus = found.status;
2579
- nodeLogicalId = found.logicalId;
2580
- }
2581
- }
2582
- catch {
2583
- // payload corruption — treat as no node record found
2584
- }
2585
- }
2809
+ // Locate the node's latest restore attempt and its outcome there. If the
2810
+ // outcome is not failed or attention_required, there is nothing to upgrade.
2811
+ const attempt = this.currentRestoreAttempt(rigId, nodeId);
2812
+ if (!attempt) {
2813
+ return { ok: false, code: "no_attempt", detail: "No restore.started or restore.subset_completed event recorded for this rig." };
2814
+ }
2815
+ const attemptId = attempt.attemptId;
2816
+ const nodeStatus = attempt.status;
2586
2817
  if (!nodeStatus) {
2587
- return { ok: false, code: "node_not_found", detail: `Node ${nodeId} has no record in the latest restore.completed event for rig ${rigId}.` };
2818
+ return { ok: false, code: "node_not_found", detail: `Node ${nodeId} has no record in its latest restore attempt for rig ${rigId}.` };
2588
2819
  }
2589
2820
  if (nodeStatus !== "failed" && nodeStatus !== "attention_required") {
2590
2821
  return { ok: false, code: "outcome_not_upgradable", detail: `Reconciliation only upgrades failed or attention_required; current outcome is ${nodeStatus}.` };
@@ -2687,12 +2918,12 @@ export class RestoreOrchestrator {
2687
2918
  }
2688
2919
  return { ok: false, code: "pane_not_usable", probe: evidence, attemptId, detail: `Pane state is ${probe.status} (${probe.code}); reconciliation requires resumed.` };
2689
2920
  }
2690
- // The checks above awaited native reads. A restore that started since, or a changed binding or expected token,
2691
- // makes this proof one for an older subject, so it can't settle the current outcome.
2692
- const latestStart = this.db.prepare("SELECT seq FROM events WHERE rig_id = ? AND type = 'restore.started' ORDER BY seq DESC LIMIT 1").get(rigId);
2921
+ // The checks above awaited native reads. A restore or subset launch recorded since, or a changed binding or expected
2922
+ // token, makes this proof one for an older subject, so it can't settle the current outcome.
2923
+ const latestAttempt = this.currentRestoreAttempt(rigId, nodeId);
2693
2924
  const latestBinding = this.db.prepare("SELECT tmux_session FROM bindings WHERE node_id = ?").get(nodeId);
2694
2925
  const latestSession = this.db.prepare("SELECT session_name, resume_token FROM sessions WHERE node_id = ? ORDER BY created_at DESC, id DESC LIMIT 1").get(nodeId);
2695
- if (latestStart?.seq !== attemptId || latestBinding?.tmux_session !== sessionName
2926
+ if (latestAttempt?.attemptId !== attemptId || latestBinding?.tmux_session !== sessionName
2696
2927
  || latestSession?.session_name !== sessionName || latestSession.resume_token !== expectedResumeToken) {
2697
2928
  return { ok: false, code: "proof_superseded", attemptId, detail: "A newer restore attempt, binding or resume token was recorded while the live seat was checked, so this proof doesn't settle the current outcome." };
2698
2929
  }
@@ -2705,9 +2936,34 @@ export class RestoreOrchestrator {
2705
2936
  }
2706
2937
  return { ok: true, attemptId, from: fromStatus, to: "operator_recovered", evidence };
2707
2938
  }
2708
- writeCheckpointFile(cwd, checkpoint) {
2939
+ /** A node's latest restore attempt and its outcome there (null when that attempt has no record of it). A full restore's
2940
+ * attempt is its `restore.started`, with the outcome in the `restore.completed` after it. A subset launch
2941
+ * (`rig launch --seats`) records only its `restore.subset_completed`, which is its attempt; a later one that names the
2942
+ * node is the node's latest attempt. */
2943
+ currentRestoreAttempt(rigId, nodeId) {
2944
+ const nodeStatusIn = (payload) => {
2945
+ try {
2946
+ return JSON.parse(payload).result?.nodes?.find((n) => n.nodeId === nodeId)?.status ?? null;
2947
+ }
2948
+ catch {
2949
+ return null; // payload corruption — treat as no node record found
2950
+ }
2951
+ };
2952
+ const started = this.db.prepare("SELECT seq FROM events WHERE rig_id = ? AND type = 'restore.started' ORDER BY seq DESC LIMIT 1").get(rigId);
2953
+ const subsets = this.db.prepare("SELECT seq, payload FROM events WHERE rig_id = ? AND type = 'restore.subset_completed' AND seq > ? ORDER BY seq DESC").all(rigId, started?.seq ?? 0);
2954
+ for (const subset of subsets) {
2955
+ const status = nodeStatusIn(subset.payload);
2956
+ if (status)
2957
+ return { attemptId: subset.seq, status };
2958
+ }
2959
+ if (!started)
2960
+ return null;
2961
+ const completed = this.db.prepare("SELECT payload FROM events WHERE rig_id = ? AND type = 'restore.completed' AND seq > ? ORDER BY seq DESC LIMIT 1").get(rigId, started.seq);
2962
+ return { attemptId: started.seq, status: completed ? nodeStatusIn(completed.payload) : null };
2963
+ }
2964
+ writeCheckpointFile(cwd, sessionName, checkpoint) {
2709
2965
  try {
2710
- const filePath = join(cwd, ".rigged-checkpoint.md");
2966
+ const filePath = join(cwd, checkpointFileName(sessionName));
2711
2967
  const content = [
2712
2968
  "# OpenRig Checkpoint",
2713
2969
  "",