@openrig/cli 0.7.22 → 0.7.24

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 (1187) hide show
  1. package/README.md +7 -7
  2. package/daemon/assets/claude-hook-bridge.cjs +575 -6
  3. package/daemon/assets/claude-hook-bridge.d.cts +5 -0
  4. package/daemon/assets/claude-permission-policies.cjs +4 -3
  5. package/daemon/assets/guidance/openrig-context-entry.md +1 -0
  6. package/daemon/assets/onboarding/01-world-and-purpose.md +2 -1
  7. package/daemon/assets/onboarding/02-self-and-competent-action.md +6 -0
  8. package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +4 -3
  9. package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +3 -2
  10. package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
  11. package/daemon/assets/plugins/openrig/README.md +64 -9
  12. package/daemon/assets/plugins/openrig/hooks/claude.json +39 -0
  13. package/daemon/assets/plugins/openrig/hooks/codex.json +27 -0
  14. package/daemon/assets/plugins/openrig/hooks/scripts/claude-hook-bridge.cjs +715 -0
  15. package/daemon/assets/plugins/openrig/plugin.json +1 -1
  16. package/daemon/assets/plugins/openrig/scripts/run-rig.cjs +30 -0
  17. package/daemon/assets/plugins/openrig/skills/working-with-an-openrig-team/SKILL.md +71 -9
  18. package/daemon/assets/plugins/openrig-codex/.agents/plugins/marketplace.json +15 -0
  19. package/daemon/assets/plugins/openrig-codex/.codex-plugin/plugin.json +42 -0
  20. package/daemon/assets/plugins/openrig-codex/LICENSE +200 -0
  21. package/daemon/assets/plugins/openrig-codex/assets/logo.svg +1 -0
  22. package/daemon/assets/plugins/openrig-codex/hooks/codex.json +27 -0
  23. package/daemon/assets/plugins/openrig-codex/hooks/scripts/claude-hook-bridge.cjs +715 -0
  24. package/daemon/assets/plugins/openrig-codex/skills/working-with-an-openrig-team/SKILL.md +175 -0
  25. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
  26. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
  27. package/daemon/assets/plugins/openrig-core/README.md +10 -2
  28. package/daemon/assets/plugins/openrig-core/hooks/claude.json +9 -0
  29. package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +50 -0
  30. package/daemon/assets/plugins/openrig-core/hooks/scripts/compaction-restore-bridge.cjs +3 -1
  31. package/daemon/assets/plugins/openrig-core/hooks/scripts/permission-answer.cjs +270 -0
  32. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +24 -6
  33. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +11 -8
  34. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +76 -10
  35. package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +1 -1
  36. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +4 -2
  37. package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +191 -25
  38. package/daemon/assets/skills/rigs/SKILL.md +136 -26
  39. package/daemon/context-packs/help/manifest.yaml +1 -1
  40. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  41. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +128 -18
  42. package/daemon/context-packs/reference/acp-agents.md +11 -3
  43. package/daemon/context-packs/reference/getting-started.md +144 -13
  44. package/daemon/context-packs/reference/manifest.yaml +1 -1
  45. package/daemon/context-packs/reference/rig-spec.md +201 -3
  46. package/daemon/context-packs/reference/tmux-servers.md +43 -2
  47. package/daemon/context-packs/reference/whats-new.md +186 -12
  48. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/claude-compaction-restore/scripts/precompact-hook.mjs +11 -8
  53. package/daemon/context-packs/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +76 -10
  54. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  56. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +1 -1
  59. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +3 -3
  60. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  66. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  68. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  72. package/daemon/context-packs/skills/core/working-with-an-openrig-team/SKILL.md +71 -9
  73. package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
  74. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  75. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  76. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  77. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  78. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  79. package/daemon/context-packs/skills/openrig-user/SKILL.md +4 -2
  80. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  81. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  82. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  83. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  84. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  85. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  86. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  87. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  88. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  89. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  90. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  91. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  92. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  93. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  94. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  95. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  96. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  97. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  98. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  99. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  100. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  101. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  102. package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +191 -25
  103. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  104. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  105. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  106. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  107. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  108. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  109. package/daemon/dist/adapters/claude-code-adapter.d.ts +24 -2
  110. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  111. package/daemon/dist/adapters/claude-code-adapter.js +312 -45
  112. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  113. package/daemon/dist/adapters/claude-resume-launch.d.ts +3 -0
  114. package/daemon/dist/adapters/claude-resume-launch.d.ts.map +1 -1
  115. package/daemon/dist/adapters/claude-resume-launch.js +5 -0
  116. package/daemon/dist/adapters/claude-resume-launch.js.map +1 -1
  117. package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
  118. package/daemon/dist/adapters/claude-resume.js +66 -24
  119. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  120. package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts +22 -0
  121. package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
  122. package/daemon/dist/adapters/community-harness-runtime-adapter.js +72 -20
  123. package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
  124. package/daemon/dist/adapters/pi-community-runtime-adapter.d.ts +9 -0
  125. package/daemon/dist/adapters/pi-community-runtime-adapter.d.ts.map +1 -1
  126. package/daemon/dist/adapters/pi-community-runtime-adapter.js +6 -0
  127. package/daemon/dist/adapters/pi-community-runtime-adapter.js.map +1 -1
  128. package/daemon/dist/adapters/pi-runtime-adapter.d.ts +3 -0
  129. package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
  130. package/daemon/dist/adapters/pi-runtime-adapter.js +9 -3
  131. package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
  132. package/daemon/dist/adapters/seat-slice.d.ts +19 -0
  133. package/daemon/dist/adapters/seat-slice.d.ts.map +1 -0
  134. package/daemon/dist/adapters/seat-slice.js +29 -0
  135. package/daemon/dist/adapters/seat-slice.js.map +1 -0
  136. package/daemon/dist/adapters/shell-quote.d.ts +1 -0
  137. package/daemon/dist/adapters/shell-quote.d.ts.map +1 -1
  138. package/daemon/dist/adapters/shell-quote.js +6 -0
  139. package/daemon/dist/adapters/shell-quote.js.map +1 -1
  140. package/daemon/dist/adapters/tmux.d.ts +84 -17
  141. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  142. package/daemon/dist/adapters/tmux.js +355 -78
  143. package/daemon/dist/adapters/tmux.js.map +1 -1
  144. package/daemon/dist/build-info.js +3 -3
  145. package/daemon/dist/conversation-key-surface.d.ts +2 -0
  146. package/daemon/dist/conversation-key-surface.d.ts.map +1 -0
  147. package/daemon/dist/conversation-key-surface.js +5 -0
  148. package/daemon/dist/conversation-key-surface.js.map +1 -0
  149. package/daemon/dist/daemon-shutdown.d.ts +8 -0
  150. package/daemon/dist/daemon-shutdown.d.ts.map +1 -1
  151. package/daemon/dist/daemon-shutdown.js +15 -2
  152. package/daemon/dist/daemon-shutdown.js.map +1 -1
  153. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  154. package/daemon/dist/db/all-migrations.js +32 -0
  155. package/daemon/dist/db/all-migrations.js.map +1 -1
  156. package/daemon/dist/db/migrate.d.ts +15 -1
  157. package/daemon/dist/db/migrate.d.ts.map +1 -1
  158. package/daemon/dist/db/migrate.js +41 -6
  159. package/daemon/dist/db/migrate.js.map +1 -1
  160. package/daemon/dist/db/migrations/179_community_harness_runtime_switches.d.ts +14 -0
  161. package/daemon/dist/db/migrations/179_community_harness_runtime_switches.d.ts.map +1 -0
  162. package/daemon/dist/db/migrations/179_community_harness_runtime_switches.js +54 -0
  163. package/daemon/dist/db/migrations/179_community_harness_runtime_switches.js.map +1 -0
  164. package/daemon/dist/db/migrations/179_remote_control_observations.d.ts +10 -0
  165. package/daemon/dist/db/migrations/179_remote_control_observations.d.ts.map +1 -0
  166. package/daemon/dist/db/migrations/179_remote_control_observations.js +20 -0
  167. package/daemon/dist/db/migrations/179_remote_control_observations.js.map +1 -0
  168. package/daemon/dist/db/migrations/180_session_stop_attempt.d.ts +5 -0
  169. package/daemon/dist/db/migrations/180_session_stop_attempt.d.ts.map +1 -0
  170. package/daemon/dist/db/migrations/180_session_stop_attempt.js +7 -0
  171. package/daemon/dist/db/migrations/180_session_stop_attempt.js.map +1 -0
  172. package/daemon/dist/db/migrations/181_node_keep_alive.d.ts +8 -0
  173. package/daemon/dist/db/migrations/181_node_keep_alive.d.ts.map +1 -0
  174. package/daemon/dist/db/migrations/181_node_keep_alive.js +26 -0
  175. package/daemon/dist/db/migrations/181_node_keep_alive.js.map +1 -0
  176. package/daemon/dist/db/migrations/182_queue_items_blocked_on_index.d.ts +7 -0
  177. package/daemon/dist/db/migrations/182_queue_items_blocked_on_index.d.ts.map +1 -0
  178. package/daemon/dist/db/migrations/182_queue_items_blocked_on_index.js +11 -0
  179. package/daemon/dist/db/migrations/182_queue_items_blocked_on_index.js.map +1 -0
  180. package/daemon/dist/db/migrations/183_queue_items_scan_indexes.d.ts +8 -0
  181. package/daemon/dist/db/migrations/183_queue_items_scan_indexes.d.ts.map +1 -0
  182. package/daemon/dist/db/migrations/183_queue_items_scan_indexes.js +13 -0
  183. package/daemon/dist/db/migrations/183_queue_items_scan_indexes.js.map +1 -0
  184. package/daemon/dist/db/migrations/184_network_requests.d.ts +11 -0
  185. package/daemon/dist/db/migrations/184_network_requests.d.ts.map +1 -0
  186. package/daemon/dist/db/migrations/184_network_requests.js +32 -0
  187. package/daemon/dist/db/migrations/184_network_requests.js.map +1 -0
  188. package/daemon/dist/db/migrations/185_seat_cold_starts.d.ts +9 -0
  189. package/daemon/dist/db/migrations/185_seat_cold_starts.d.ts.map +1 -0
  190. package/daemon/dist/db/migrations/185_seat_cold_starts.js +19 -0
  191. package/daemon/dist/db/migrations/185_seat_cold_starts.js.map +1 -0
  192. package/daemon/dist/db/migrations/186_queue_relayed_answers.d.ts +3 -0
  193. package/daemon/dist/db/migrations/186_queue_relayed_answers.d.ts.map +1 -0
  194. package/daemon/dist/db/migrations/186_queue_relayed_answers.js +5 -0
  195. package/daemon/dist/db/migrations/186_queue_relayed_answers.js.map +1 -0
  196. package/daemon/dist/db/migrations/189_rig_seat_slice.d.ts +5 -0
  197. package/daemon/dist/db/migrations/189_rig_seat_slice.d.ts.map +1 -0
  198. package/daemon/dist/db/migrations/189_rig_seat_slice.js +7 -0
  199. package/daemon/dist/db/migrations/189_rig_seat_slice.js.map +1 -0
  200. package/daemon/dist/db/migrations/190_queue_transfer_staging.d.ts +3 -0
  201. package/daemon/dist/db/migrations/190_queue_transfer_staging.d.ts.map +1 -0
  202. package/daemon/dist/db/migrations/190_queue_transfer_staging.js +20 -0
  203. package/daemon/dist/db/migrations/190_queue_transfer_staging.js.map +1 -0
  204. package/daemon/dist/db/migrations/191_network_binding_providers.d.ts +3 -0
  205. package/daemon/dist/db/migrations/191_network_binding_providers.d.ts.map +1 -0
  206. package/daemon/dist/db/migrations/191_network_binding_providers.js +27 -0
  207. package/daemon/dist/db/migrations/191_network_binding_providers.js.map +1 -0
  208. package/daemon/dist/db/migrations/194_workflow_run_title.d.ts +4 -0
  209. package/daemon/dist/db/migrations/194_workflow_run_title.d.ts.map +1 -0
  210. package/daemon/dist/db/migrations/194_workflow_run_title.js +6 -0
  211. package/daemon/dist/db/migrations/194_workflow_run_title.js.map +1 -0
  212. package/daemon/dist/db/migrations/195_workflow_start_operations.d.ts +4 -0
  213. package/daemon/dist/db/migrations/195_workflow_start_operations.d.ts.map +1 -0
  214. package/daemon/dist/db/migrations/195_workflow_start_operations.js +13 -0
  215. package/daemon/dist/db/migrations/195_workflow_start_operations.js.map +1 -0
  216. package/daemon/dist/db/migrations/196_queue_item_evidence_ref_roots.d.ts +5 -0
  217. package/daemon/dist/db/migrations/196_queue_item_evidence_ref_roots.d.ts.map +1 -0
  218. package/daemon/dist/db/migrations/196_queue_item_evidence_ref_roots.js +7 -0
  219. package/daemon/dist/db/migrations/196_queue_item_evidence_ref_roots.js.map +1 -0
  220. package/daemon/dist/db/migrations/199_queue_items_native_permission_index.d.ts +9 -0
  221. package/daemon/dist/db/migrations/199_queue_items_native_permission_index.d.ts.map +1 -0
  222. package/daemon/dist/db/migrations/199_queue_items_native_permission_index.js +14 -0
  223. package/daemon/dist/db/migrations/199_queue_items_native_permission_index.js.map +1 -0
  224. package/daemon/dist/domain/activity-taxonomy.d.ts +3 -0
  225. package/daemon/dist/domain/activity-taxonomy.d.ts.map +1 -1
  226. package/daemon/dist/domain/activity-taxonomy.js.map +1 -1
  227. package/daemon/dist/domain/agent-activity-store.d.ts +17 -0
  228. package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
  229. package/daemon/dist/domain/agent-activity-store.js +101 -45
  230. package/daemon/dist/domain/agent-activity-store.js.map +1 -1
  231. package/daemon/dist/domain/agent-manifest.d.ts.map +1 -1
  232. package/daemon/dist/domain/agent-manifest.js +14 -0
  233. package/daemon/dist/domain/agent-manifest.js.map +1 -1
  234. package/daemon/dist/domain/background-process-evidence.d.ts +23 -0
  235. package/daemon/dist/domain/background-process-evidence.d.ts.map +1 -0
  236. package/daemon/dist/domain/background-process-evidence.js +81 -0
  237. package/daemon/dist/domain/background-process-evidence.js.map +1 -0
  238. package/daemon/dist/domain/chat-repository.d.ts +1 -1
  239. package/daemon/dist/domain/chat-repository.d.ts.map +1 -1
  240. package/daemon/dist/domain/chat-repository.js +2 -2
  241. package/daemon/dist/domain/chat-repository.js.map +1 -1
  242. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +46 -8
  243. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  244. package/daemon/dist/domain/claude-compaction-enforcer.js +66 -20
  245. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  246. package/daemon/dist/domain/codex-member-permissions.d.ts +35 -0
  247. package/daemon/dist/domain/codex-member-permissions.d.ts.map +1 -1
  248. package/daemon/dist/domain/codex-member-permissions.js +106 -1
  249. package/daemon/dist/domain/codex-member-permissions.js.map +1 -1
  250. package/daemon/dist/domain/community-harness-presets.d.ts +9 -0
  251. package/daemon/dist/domain/community-harness-presets.d.ts.map +1 -1
  252. package/daemon/dist/domain/community-harness-presets.js +25 -1
  253. package/daemon/dist/domain/community-harness-presets.js.map +1 -1
  254. package/daemon/dist/domain/compaction-restore-notice.d.ts +12 -1
  255. package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
  256. package/daemon/dist/domain/compaction-restore-notice.js +130 -2
  257. package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
  258. package/daemon/dist/domain/continuity-policy-materializer.d.ts.map +1 -1
  259. package/daemon/dist/domain/continuity-policy-materializer.js +11 -3
  260. package/daemon/dist/domain/continuity-policy-materializer.js.map +1 -1
  261. package/daemon/dist/domain/core-app-job.d.ts +4 -4
  262. package/daemon/dist/domain/core-app-job.d.ts.map +1 -1
  263. package/daemon/dist/domain/core-app-job.js +4 -59
  264. package/daemon/dist/domain/core-app-job.js.map +1 -1
  265. package/daemon/dist/domain/current-work.d.ts +43 -4
  266. package/daemon/dist/domain/current-work.d.ts.map +1 -1
  267. package/daemon/dist/domain/current-work.js +52 -3
  268. package/daemon/dist/domain/current-work.js.map +1 -1
  269. package/daemon/dist/domain/escalation-owner.d.ts +3 -0
  270. package/daemon/dist/domain/escalation-owner.d.ts.map +1 -1
  271. package/daemon/dist/domain/escalation-owner.js +9 -3
  272. package/daemon/dist/domain/escalation-owner.js.map +1 -1
  273. package/daemon/dist/domain/execution-candidate-reader.d.ts +3 -0
  274. package/daemon/dist/domain/execution-candidate-reader.d.ts.map +1 -1
  275. package/daemon/dist/domain/execution-candidate-reader.js +8 -2
  276. package/daemon/dist/domain/execution-candidate-reader.js.map +1 -1
  277. package/daemon/dist/domain/existing-rig-restore.d.ts +2 -0
  278. package/daemon/dist/domain/existing-rig-restore.d.ts.map +1 -1
  279. package/daemon/dist/domain/existing-rig-restore.js +11 -1
  280. package/daemon/dist/domain/existing-rig-restore.js.map +1 -1
  281. package/daemon/dist/domain/feed/attention-aggregator.d.ts +5 -5
  282. package/daemon/dist/domain/feed/attention-aggregator.d.ts.map +1 -1
  283. package/daemon/dist/domain/feed/attention-aggregator.js +10 -4
  284. package/daemon/dist/domain/feed/attention-aggregator.js.map +1 -1
  285. package/daemon/dist/domain/files/path-safety.d.ts +7 -0
  286. package/daemon/dist/domain/files/path-safety.d.ts.map +1 -1
  287. package/daemon/dist/domain/files/path-safety.js +23 -0
  288. package/daemon/dist/domain/files/path-safety.js.map +1 -1
  289. package/daemon/dist/domain/frontmatter.d.ts.map +1 -1
  290. package/daemon/dist/domain/frontmatter.js +4 -2
  291. package/daemon/dist/domain/frontmatter.js.map +1 -1
  292. package/daemon/dist/domain/gateway/destination-resolver.d.ts +3 -0
  293. package/daemon/dist/domain/gateway/destination-resolver.d.ts.map +1 -1
  294. package/daemon/dist/domain/gateway/destination-resolver.js +9 -0
  295. package/daemon/dist/domain/gateway/destination-resolver.js.map +1 -1
  296. package/daemon/dist/domain/gateway/human-quiet-windows.d.ts.map +1 -1
  297. package/daemon/dist/domain/gateway/human-quiet-windows.js +2 -1
  298. package/daemon/dist/domain/gateway/human-quiet-windows.js.map +1 -1
  299. package/daemon/dist/domain/gateway/slack/inbound.d.ts +6 -1
  300. package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
  301. package/daemon/dist/domain/gateway/slack/inbound.js +53 -9
  302. package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
  303. package/daemon/dist/domain/gateway/slack/message.d.ts +4 -4
  304. package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
  305. package/daemon/dist/domain/gateway/slack/message.js +20 -7
  306. package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
  307. package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts +4 -0
  308. package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts.map +1 -1
  309. package/daemon/dist/domain/gateway/slack/outbound-driver.js +1 -0
  310. package/daemon/dist/domain/gateway/slack/outbound-driver.js.map +1 -1
  311. package/daemon/dist/domain/gateway/slack/queue-access.d.ts +9 -1
  312. package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
  313. package/daemon/dist/domain/gateway/slack/queue-access.js +2 -0
  314. package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
  315. package/daemon/dist/domain/gateway/slack/settled-asks.d.ts.map +1 -1
  316. package/daemon/dist/domain/gateway/slack/settled-asks.js +15 -2
  317. package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -1
  318. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +10 -19
  319. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
  320. package/daemon/dist/domain/gateway/slack/slack-delivery.js +64 -40
  321. package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
  322. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts +3 -13
  323. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
  324. package/daemon/dist/domain/gateway/slack/slack-subsystem.js +70 -22
  325. package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
  326. package/daemon/dist/domain/harness-not-started-notice.d.ts +5 -2
  327. package/daemon/dist/domain/harness-not-started-notice.d.ts.map +1 -1
  328. package/daemon/dist/domain/harness-not-started-notice.js +46 -15
  329. package/daemon/dist/domain/harness-not-started-notice.js.map +1 -1
  330. package/daemon/dist/domain/health-detectors.d.ts +4 -0
  331. package/daemon/dist/domain/health-detectors.d.ts.map +1 -1
  332. package/daemon/dist/domain/health-detectors.js +4 -1
  333. package/daemon/dist/domain/health-detectors.js.map +1 -1
  334. package/daemon/dist/domain/health-diagnosis.d.ts.map +1 -1
  335. package/daemon/dist/domain/health-diagnosis.js +14 -9
  336. package/daemon/dist/domain/health-diagnosis.js.map +1 -1
  337. package/daemon/dist/domain/health-passive-ceremony.d.ts +2 -0
  338. package/daemon/dist/domain/health-passive-ceremony.d.ts.map +1 -1
  339. package/daemon/dist/domain/health-passive-ceremony.js +71 -13
  340. package/daemon/dist/domain/health-passive-ceremony.js.map +1 -1
  341. package/daemon/dist/domain/history-query.d.ts +1 -1
  342. package/daemon/dist/domain/history-query.d.ts.map +1 -1
  343. package/daemon/dist/domain/history-query.js +1 -2
  344. package/daemon/dist/domain/history-query.js.map +1 -1
  345. package/daemon/dist/domain/hosts/read-through.d.ts +1 -1
  346. package/daemon/dist/domain/hosts/read-through.d.ts.map +1 -1
  347. package/daemon/dist/domain/hosts/read-through.js +9 -2
  348. package/daemon/dist/domain/hosts/read-through.js.map +1 -1
  349. package/daemon/dist/domain/hot-potato-enforcer.d.ts +3 -3
  350. package/daemon/dist/domain/hot-potato-enforcer.d.ts.map +1 -1
  351. package/daemon/dist/domain/hot-potato-enforcer.js +2 -2
  352. package/daemon/dist/domain/hot-potato-enforcer.js.map +1 -1
  353. package/daemon/dist/domain/human-questions.d.ts +1 -1
  354. package/daemon/dist/domain/human-questions.d.ts.map +1 -1
  355. package/daemon/dist/domain/human-questions.js +2 -0
  356. package/daemon/dist/domain/human-questions.js.map +1 -1
  357. package/daemon/dist/domain/input-read-diagnostic.js +1 -1
  358. package/daemon/dist/domain/input-read-diagnostic.js.map +1 -1
  359. package/daemon/dist/domain/keep-alive-supervisor.d.ts +178 -0
  360. package/daemon/dist/domain/keep-alive-supervisor.d.ts.map +1 -0
  361. package/daemon/dist/domain/keep-alive-supervisor.js +523 -0
  362. package/daemon/dist/domain/keep-alive-supervisor.js.map +1 -0
  363. package/daemon/dist/domain/managed-restore-read-access.d.ts +18 -0
  364. package/daemon/dist/domain/managed-restore-read-access.d.ts.map +1 -1
  365. package/daemon/dist/domain/managed-restore-read-access.js +41 -1
  366. package/daemon/dist/domain/managed-restore-read-access.js.map +1 -1
  367. package/daemon/dist/domain/mission-control/audit-browse.d.ts +1 -1
  368. package/daemon/dist/domain/mission-control/audit-browse.d.ts.map +1 -1
  369. package/daemon/dist/domain/mission-control/audit-browse.js +3 -6
  370. package/daemon/dist/domain/mission-control/audit-browse.js.map +1 -1
  371. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.d.ts +6 -0
  372. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.d.ts.map +1 -1
  373. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.js +38 -9
  374. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.js.map +1 -1
  375. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
  376. package/daemon/dist/domain/mission-control/mission-control-write-contract.js +50 -5
  377. package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
  378. package/daemon/dist/domain/mutation-trace.d.ts +28 -0
  379. package/daemon/dist/domain/mutation-trace.d.ts.map +1 -0
  380. package/daemon/dist/domain/mutation-trace.js +38 -0
  381. package/daemon/dist/domain/mutation-trace.js.map +1 -0
  382. package/daemon/dist/domain/native-resume-probe.d.ts +35 -3
  383. package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
  384. package/daemon/dist/domain/native-resume-probe.js +84 -17
  385. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  386. package/daemon/dist/domain/network/hub-client.d.ts +30 -1
  387. package/daemon/dist/domain/network/hub-client.d.ts.map +1 -1
  388. package/daemon/dist/domain/network/hub-client.js +62 -9
  389. package/daemon/dist/domain/network/hub-client.js.map +1 -1
  390. package/daemon/dist/domain/network/network-bindings.d.ts +52 -2
  391. package/daemon/dist/domain/network/network-bindings.d.ts.map +1 -1
  392. package/daemon/dist/domain/network/network-bindings.js +217 -23
  393. package/daemon/dist/domain/network/network-bindings.js.map +1 -1
  394. package/daemon/dist/domain/network/network-connector.d.ts +9 -1
  395. package/daemon/dist/domain/network/network-connector.d.ts.map +1 -1
  396. package/daemon/dist/domain/network/network-connector.js +95 -7
  397. package/daemon/dist/domain/network/network-connector.js.map +1 -1
  398. package/daemon/dist/domain/network/network-installations.d.ts.map +1 -1
  399. package/daemon/dist/domain/network/network-installations.js +22 -7
  400. package/daemon/dist/domain/network/network-installations.js.map +1 -1
  401. package/daemon/dist/domain/network/network-provider-removal.d.ts +9 -0
  402. package/daemon/dist/domain/network/network-provider-removal.d.ts.map +1 -0
  403. package/daemon/dist/domain/network/network-provider-removal.js +75 -0
  404. package/daemon/dist/domain/network/network-provider-removal.js.map +1 -0
  405. package/daemon/dist/domain/network/network-requests.d.ts +60 -0
  406. package/daemon/dist/domain/network/network-requests.d.ts.map +1 -0
  407. package/daemon/dist/domain/network/network-requests.js +502 -0
  408. package/daemon/dist/domain/network/network-requests.js.map +1 -0
  409. package/daemon/dist/domain/node-inventory.d.ts +26 -0
  410. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  411. package/daemon/dist/domain/node-inventory.js +87 -7
  412. package/daemon/dist/domain/node-inventory.js.map +1 -1
  413. package/daemon/dist/domain/node-launcher.d.ts +2 -2
  414. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  415. package/daemon/dist/domain/node-launcher.js +9 -7
  416. package/daemon/dist/domain/node-launcher.js.map +1 -1
  417. package/daemon/dist/domain/occupant-invalidator.d.ts +1 -1
  418. package/daemon/dist/domain/occupant-invalidator.d.ts.map +1 -1
  419. package/daemon/dist/domain/occupant-invalidator.js +1 -1
  420. package/daemon/dist/domain/occupant-invalidator.js.map +1 -1
  421. package/daemon/dist/domain/outbox-handler.d.ts +11 -0
  422. package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
  423. package/daemon/dist/domain/outbox-handler.js +20 -0
  424. package/daemon/dist/domain/outbox-handler.js.map +1 -1
  425. package/daemon/dist/domain/pane-cutover.d.ts +36 -9
  426. package/daemon/dist/domain/pane-cutover.d.ts.map +1 -1
  427. package/daemon/dist/domain/pane-cutover.js +82 -13
  428. package/daemon/dist/domain/pane-cutover.js.map +1 -1
  429. package/daemon/dist/domain/parked-query.d.ts +6 -0
  430. package/daemon/dist/domain/parked-query.d.ts.map +1 -1
  431. package/daemon/dist/domain/parked-query.js +14 -4
  432. package/daemon/dist/domain/parked-query.js.map +1 -1
  433. package/daemon/dist/domain/policies/seat-pool.d.ts +13 -0
  434. package/daemon/dist/domain/policies/seat-pool.d.ts.map +1 -1
  435. package/daemon/dist/domain/policies/seat-pool.js +18 -3
  436. package/daemon/dist/domain/policies/seat-pool.js.map +1 -1
  437. package/daemon/dist/domain/profile-resolver.d.ts +7 -1
  438. package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
  439. package/daemon/dist/domain/profile-resolver.js +7 -0
  440. package/daemon/dist/domain/profile-resolver.js.map +1 -1
  441. package/daemon/dist/domain/progress/progress-indexer.d.ts.map +1 -1
  442. package/daemon/dist/domain/progress/progress-indexer.js +11 -0
  443. package/daemon/dist/domain/progress/progress-indexer.js.map +1 -1
  444. package/daemon/dist/domain/project-lifecycle-compiler.d.ts.map +1 -1
  445. package/daemon/dist/domain/project-lifecycle-compiler.js +4 -1
  446. package/daemon/dist/domain/project-lifecycle-compiler.js.map +1 -1
  447. package/daemon/dist/domain/projection-planner.d.ts +17 -3
  448. package/daemon/dist/domain/projection-planner.d.ts.map +1 -1
  449. package/daemon/dist/domain/projection-planner.js +9 -1
  450. package/daemon/dist/domain/projection-planner.js.map +1 -1
  451. package/daemon/dist/domain/proof/judgments.d.ts +3 -0
  452. package/daemon/dist/domain/proof/judgments.d.ts.map +1 -1
  453. package/daemon/dist/domain/proof/judgments.js +13 -3
  454. package/daemon/dist/domain/proof/judgments.js.map +1 -1
  455. package/daemon/dist/domain/proof/source-watch.js +4 -4
  456. package/daemon/dist/domain/proof/source-watch.js.map +1 -1
  457. package/daemon/dist/domain/provider/claude-interruption.d.ts +6 -0
  458. package/daemon/dist/domain/provider/claude-interruption.d.ts.map +1 -1
  459. package/daemon/dist/domain/provider/claude-interruption.js +18 -0
  460. package/daemon/dist/domain/provider/claude-interruption.js.map +1 -1
  461. package/daemon/dist/domain/ps-projection.d.ts +8 -1
  462. package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
  463. package/daemon/dist/domain/ps-projection.js +11 -3
  464. package/daemon/dist/domain/ps-projection.js.map +1 -1
  465. package/daemon/dist/domain/queue-destination-check.d.ts +8 -0
  466. package/daemon/dist/domain/queue-destination-check.d.ts.map +1 -1
  467. package/daemon/dist/domain/queue-destination-check.js +17 -4
  468. package/daemon/dist/domain/queue-destination-check.js.map +1 -1
  469. package/daemon/dist/domain/queue-erasure.d.ts +3 -0
  470. package/daemon/dist/domain/queue-erasure.d.ts.map +1 -1
  471. package/daemon/dist/domain/queue-erasure.js +2 -2
  472. package/daemon/dist/domain/queue-erasure.js.map +1 -1
  473. package/daemon/dist/domain/queue-owner.d.ts +5 -0
  474. package/daemon/dist/domain/queue-owner.d.ts.map +1 -1
  475. package/daemon/dist/domain/queue-owner.js +16 -8
  476. package/daemon/dist/domain/queue-owner.js.map +1 -1
  477. package/daemon/dist/domain/queue-recorded-graph.d.ts +32 -0
  478. package/daemon/dist/domain/queue-recorded-graph.d.ts.map +1 -0
  479. package/daemon/dist/domain/queue-recorded-graph.js +84 -0
  480. package/daemon/dist/domain/queue-recorded-graph.js.map +1 -0
  481. package/daemon/dist/domain/queue-repository.d.ts +94 -5
  482. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  483. package/daemon/dist/domain/queue-repository.js +491 -39
  484. package/daemon/dist/domain/queue-repository.js.map +1 -1
  485. package/daemon/dist/domain/queue-retention.d.ts +1 -1
  486. package/daemon/dist/domain/queue-retention.d.ts.map +1 -1
  487. package/daemon/dist/domain/queue-retention.js +4 -0
  488. package/daemon/dist/domain/queue-retention.js.map +1 -1
  489. package/daemon/dist/domain/queue-stuck-sweep.d.ts +23 -3
  490. package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
  491. package/daemon/dist/domain/queue-stuck-sweep.js +661 -22
  492. package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
  493. package/daemon/dist/domain/queue-transfer-export.d.ts +75 -0
  494. package/daemon/dist/domain/queue-transfer-export.d.ts.map +1 -0
  495. package/daemon/dist/domain/queue-transfer-export.js +158 -0
  496. package/daemon/dist/domain/queue-transfer-export.js.map +1 -0
  497. package/daemon/dist/domain/queue-transfer-format.d.ts +15 -0
  498. package/daemon/dist/domain/queue-transfer-format.d.ts.map +1 -0
  499. package/daemon/dist/domain/queue-transfer-format.js +32 -0
  500. package/daemon/dist/domain/queue-transfer-format.js.map +1 -0
  501. package/daemon/dist/domain/queue-transfer-parse.d.ts +40 -0
  502. package/daemon/dist/domain/queue-transfer-parse.d.ts.map +1 -0
  503. package/daemon/dist/domain/queue-transfer-parse.js +131 -0
  504. package/daemon/dist/domain/queue-transfer-parse.js.map +1 -0
  505. package/daemon/dist/domain/queue-transfer-review.d.ts +22 -0
  506. package/daemon/dist/domain/queue-transfer-review.d.ts.map +1 -0
  507. package/daemon/dist/domain/queue-transfer-review.js +81 -0
  508. package/daemon/dist/domain/queue-transfer-review.js.map +1 -0
  509. package/daemon/dist/domain/queue-transfer-staging.d.ts +79 -0
  510. package/daemon/dist/domain/queue-transfer-staging.d.ts.map +1 -0
  511. package/daemon/dist/domain/queue-transfer-staging.js +67 -0
  512. package/daemon/dist/domain/queue-transfer-staging.js.map +1 -0
  513. package/daemon/dist/domain/queue-transition-log.d.ts +6 -0
  514. package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
  515. package/daemon/dist/domain/queue-transition-log.js +1 -1
  516. package/daemon/dist/domain/queue-transition-log.js.map +1 -1
  517. package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
  518. package/daemon/dist/domain/queue-waiting.js +7 -0
  519. package/daemon/dist/domain/queue-waiting.js.map +1 -1
  520. package/daemon/dist/domain/queue-wake-ladder.d.ts +4 -0
  521. package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
  522. package/daemon/dist/domain/queue-wake-ladder.js +181 -24
  523. package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
  524. package/daemon/dist/domain/reconciler.d.ts +27 -2
  525. package/daemon/dist/domain/reconciler.d.ts.map +1 -1
  526. package/daemon/dist/domain/reconciler.js +184 -16
  527. package/daemon/dist/domain/reconciler.js.map +1 -1
  528. package/daemon/dist/domain/refusal-trace.d.ts +15 -0
  529. package/daemon/dist/domain/refusal-trace.d.ts.map +1 -0
  530. package/daemon/dist/domain/refusal-trace.js +23 -0
  531. package/daemon/dist/domain/refusal-trace.js.map +1 -0
  532. package/daemon/dist/domain/rehydrate-eligibility.d.ts +8 -0
  533. package/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
  534. package/daemon/dist/domain/rehydrate-eligibility.js +61 -9
  535. package/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
  536. package/daemon/dist/domain/relayed-answers.d.ts +80 -0
  537. package/daemon/dist/domain/relayed-answers.d.ts.map +1 -0
  538. package/daemon/dist/domain/relayed-answers.js +8 -0
  539. package/daemon/dist/domain/relayed-answers.js.map +1 -0
  540. package/daemon/dist/domain/remote-control-observations.d.ts +50 -0
  541. package/daemon/dist/domain/remote-control-observations.d.ts.map +1 -0
  542. package/daemon/dist/domain/remote-control-observations.js +72 -0
  543. package/daemon/dist/domain/remote-control-observations.js.map +1 -0
  544. package/daemon/dist/domain/restore-attempt-receipt.d.ts.map +1 -1
  545. package/daemon/dist/domain/restore-attempt-receipt.js +8 -2
  546. package/daemon/dist/domain/restore-attempt-receipt.js.map +1 -1
  547. package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
  548. package/daemon/dist/domain/restore-check-service.js +5 -2
  549. package/daemon/dist/domain/restore-check-service.js.map +1 -1
  550. package/daemon/dist/domain/restore-orchestrator.d.ts +70 -6
  551. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  552. package/daemon/dist/domain/restore-orchestrator.js +387 -51
  553. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  554. package/daemon/dist/domain/return-route.d.ts +13 -2
  555. package/daemon/dist/domain/return-route.d.ts.map +1 -1
  556. package/daemon/dist/domain/return-route.js +30 -1
  557. package/daemon/dist/domain/return-route.js.map +1 -1
  558. package/daemon/dist/domain/rig-lifecycle-service.d.ts +1 -0
  559. package/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
  560. package/daemon/dist/domain/rig-lifecycle-service.js +27 -3
  561. package/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
  562. package/daemon/dist/domain/rig-mode/operating-posture.d.ts.map +1 -1
  563. package/daemon/dist/domain/rig-mode/operating-posture.js +23 -4
  564. package/daemon/dist/domain/rig-mode/operating-posture.js.map +1 -1
  565. package/daemon/dist/domain/rig-repository.d.ts +21 -3
  566. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  567. package/daemon/dist/domain/rig-repository.js +67 -2
  568. package/daemon/dist/domain/rig-repository.js.map +1 -1
  569. package/daemon/dist/domain/rig-teardown.d.ts +52 -9
  570. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  571. package/daemon/dist/domain/rig-teardown.js +184 -32
  572. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  573. package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
  574. package/daemon/dist/domain/rigspec-codec.js +12 -0
  575. package/daemon/dist/domain/rigspec-codec.js.map +1 -1
  576. package/daemon/dist/domain/rigspec-exporter.d.ts +14 -0
  577. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  578. package/daemon/dist/domain/rigspec-exporter.js +56 -14
  579. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  580. package/daemon/dist/domain/rigspec-instantiator.d.ts +34 -3
  581. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  582. package/daemon/dist/domain/rigspec-instantiator.js +195 -40
  583. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  584. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  585. package/daemon/dist/domain/rigspec-preflight.js +26 -3
  586. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  587. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  588. package/daemon/dist/domain/rigspec-schema.js +30 -4
  589. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  590. package/daemon/dist/domain/roster-ready-notice.d.ts +11 -0
  591. package/daemon/dist/domain/roster-ready-notice.d.ts.map +1 -0
  592. package/daemon/dist/domain/roster-ready-notice.js +35 -0
  593. package/daemon/dist/domain/roster-ready-notice.js.map +1 -0
  594. package/daemon/dist/domain/rosters.d.ts +1 -0
  595. package/daemon/dist/domain/rosters.d.ts.map +1 -1
  596. package/daemon/dist/domain/rosters.js +5 -4
  597. package/daemon/dist/domain/rosters.js.map +1 -1
  598. package/daemon/dist/domain/runner-permissions.d.ts +140 -5
  599. package/daemon/dist/domain/runner-permissions.d.ts.map +1 -1
  600. package/daemon/dist/domain/runner-permissions.js +593 -16
  601. package/daemon/dist/domain/runner-permissions.js.map +1 -1
  602. package/daemon/dist/domain/runtime-adapter.d.ts +3 -1
  603. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  604. package/daemon/dist/domain/runtime-exit.d.ts +79 -0
  605. package/daemon/dist/domain/runtime-exit.d.ts.map +1 -0
  606. package/daemon/dist/domain/runtime-exit.js +301 -0
  607. package/daemon/dist/domain/runtime-exit.js.map +1 -0
  608. package/daemon/dist/domain/runtime-switch-materials.d.ts +4 -1
  609. package/daemon/dist/domain/runtime-switch-materials.d.ts.map +1 -1
  610. package/daemon/dist/domain/runtime-switch-materials.js +66 -13
  611. package/daemon/dist/domain/runtime-switch-materials.js.map +1 -1
  612. package/daemon/dist/domain/scope/attestation-lineage.generated.js +2 -2
  613. package/daemon/dist/domain/scope/attestation-lineage.generated.js.map +1 -1
  614. package/daemon/dist/domain/scope/logical-checkbox.d.ts.map +1 -1
  615. package/daemon/dist/domain/scope/logical-checkbox.js +18 -0
  616. package/daemon/dist/domain/scope/logical-checkbox.js.map +1 -1
  617. package/daemon/dist/domain/scope/scaffold-placeholder.js +2 -2
  618. package/daemon/dist/domain/scope/scaffold-placeholder.js.map +1 -1
  619. package/daemon/dist/domain/seat-activity-service.d.ts +4 -0
  620. package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
  621. package/daemon/dist/domain/seat-activity-service.js +24 -5
  622. package/daemon/dist/domain/seat-activity-service.js.map +1 -1
  623. package/daemon/dist/domain/seat-attention-reconciler.d.ts +7 -0
  624. package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  625. package/daemon/dist/domain/seat-attention-reconciler.js +152 -65
  626. package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  627. package/daemon/dist/domain/seat-cold-start.d.ts +150 -0
  628. package/daemon/dist/domain/seat-cold-start.d.ts.map +1 -0
  629. package/daemon/dist/domain/seat-cold-start.js +371 -0
  630. package/daemon/dist/domain/seat-cold-start.js.map +1 -0
  631. package/daemon/dist/domain/seat-delivery-guard.d.ts +11 -2
  632. package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
  633. package/daemon/dist/domain/seat-delivery-guard.js +34 -6
  634. package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
  635. package/daemon/dist/domain/seat-handover-service.d.ts +5 -2
  636. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  637. package/daemon/dist/domain/seat-handover-service.js +30 -6
  638. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  639. package/daemon/dist/domain/seat-identity-reconciler.d.ts +31 -0
  640. package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
  641. package/daemon/dist/domain/seat-identity-reconciler.js +218 -29
  642. package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
  643. package/daemon/dist/domain/seat-identity-store.d.ts +5 -3
  644. package/daemon/dist/domain/seat-identity-store.d.ts.map +1 -1
  645. package/daemon/dist/domain/seat-identity-store.js +7 -3
  646. package/daemon/dist/domain/seat-identity-store.js.map +1 -1
  647. package/daemon/dist/domain/seat-launch-environment.d.ts +8 -0
  648. package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
  649. package/daemon/dist/domain/seat-launch-environment.js +37 -5
  650. package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
  651. package/daemon/dist/domain/seat-lifecycle-service.d.ts +54 -1
  652. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  653. package/daemon/dist/domain/seat-lifecycle-service.js +220 -30
  654. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  655. package/daemon/dist/domain/seat-pool-executor.d.ts +174 -0
  656. package/daemon/dist/domain/seat-pool-executor.d.ts.map +1 -0
  657. package/daemon/dist/domain/seat-pool-executor.js +1241 -0
  658. package/daemon/dist/domain/seat-pool-executor.js.map +1 -0
  659. package/daemon/dist/domain/seat-pool-registration.d.ts +93 -0
  660. package/daemon/dist/domain/seat-pool-registration.d.ts.map +1 -0
  661. package/daemon/dist/domain/seat-pool-registration.js +149 -0
  662. package/daemon/dist/domain/seat-pool-registration.js.map +1 -0
  663. package/daemon/dist/domain/seat-pool-slots.d.ts +66 -0
  664. package/daemon/dist/domain/seat-pool-slots.d.ts.map +1 -1
  665. package/daemon/dist/domain/seat-pool-slots.js +101 -0
  666. package/daemon/dist/domain/seat-pool-slots.js.map +1 -1
  667. package/daemon/dist/domain/seat-restart-in-place.d.ts +15 -0
  668. package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
  669. package/daemon/dist/domain/seat-restart-in-place.js +54 -2
  670. package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
  671. package/daemon/dist/domain/seat-runtime-home-record.d.ts +8 -0
  672. package/daemon/dist/domain/seat-runtime-home-record.d.ts.map +1 -1
  673. package/daemon/dist/domain/seat-runtime-home-record.js +1 -1
  674. package/daemon/dist/domain/seat-runtime-home-record.js.map +1 -1
  675. package/daemon/dist/domain/seat-runtime-switch-service.d.ts +2 -1
  676. package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
  677. package/daemon/dist/domain/seat-runtime-switch-service.js +68 -20
  678. package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
  679. package/daemon/dist/domain/session-registry.d.ts +22 -3
  680. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  681. package/daemon/dist/domain/session-registry.js +38 -6
  682. package/daemon/dist/domain/session-registry.js.map +1 -1
  683. package/daemon/dist/domain/session-transport.d.ts +18 -2
  684. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  685. package/daemon/dist/domain/session-transport.js +73 -39
  686. package/daemon/dist/domain/session-transport.js.map +1 -1
  687. package/daemon/dist/domain/skill-catalog.d.ts.map +1 -1
  688. package/daemon/dist/domain/skill-catalog.js +24 -10
  689. package/daemon/dist/domain/skill-catalog.js.map +1 -1
  690. package/daemon/dist/domain/slices/slice-indexer.d.ts +55 -0
  691. package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -1
  692. package/daemon/dist/domain/slices/slice-indexer.js +259 -50
  693. package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
  694. package/daemon/dist/domain/startup-orchestrator.d.ts +6 -2
  695. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  696. package/daemon/dist/domain/startup-orchestrator.js +118 -30
  697. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  698. package/daemon/dist/domain/startup-proof.d.ts +6 -0
  699. package/daemon/dist/domain/startup-proof.d.ts.map +1 -1
  700. package/daemon/dist/domain/startup-proof.js +11 -0
  701. package/daemon/dist/domain/startup-proof.js.map +1 -1
  702. package/daemon/dist/domain/startup-submission-evidence.d.ts +3 -0
  703. package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
  704. package/daemon/dist/domain/startup-submission-evidence.js +36 -3
  705. package/daemon/dist/domain/startup-submission-evidence.js.map +1 -1
  706. package/daemon/dist/domain/stream-reader-actions.d.ts +23 -0
  707. package/daemon/dist/domain/stream-reader-actions.d.ts.map +1 -1
  708. package/daemon/dist/domain/stream-reader-actions.js +43 -0
  709. package/daemon/dist/domain/stream-reader-actions.js.map +1 -1
  710. package/daemon/dist/domain/successor-session-launcher.d.ts +24 -3
  711. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  712. package/daemon/dist/domain/successor-session-launcher.js +54 -23
  713. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  714. package/daemon/dist/domain/terminal/earlier-tile-attach-0723.d.ts +2 -0
  715. package/daemon/dist/domain/terminal/earlier-tile-attach-0723.d.ts.map +1 -0
  716. package/daemon/dist/domain/terminal/earlier-tile-attach-0723.js +48 -0
  717. package/daemon/dist/domain/terminal/earlier-tile-attach-0723.js.map +1 -0
  718. package/daemon/dist/domain/terminal/herdr-adapter.d.ts +2 -0
  719. package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
  720. package/daemon/dist/domain/terminal/herdr-adapter.js +2 -0
  721. package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
  722. package/daemon/dist/domain/terminal/rex-agent-status.d.ts.map +1 -1
  723. package/daemon/dist/domain/terminal/rex-agent-status.js +5 -2
  724. package/daemon/dist/domain/terminal/rex-agent-status.js.map +1 -1
  725. package/daemon/dist/domain/terminal/scope-task-terminal-view.d.ts +2 -1
  726. package/daemon/dist/domain/terminal/scope-task-terminal-view.d.ts.map +1 -1
  727. package/daemon/dist/domain/terminal/scope-task-terminal-view.js +80 -38
  728. package/daemon/dist/domain/terminal/scope-task-terminal-view.js.map +1 -1
  729. package/daemon/dist/domain/terminal/terminal-provider.d.ts +2 -0
  730. package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
  731. package/daemon/dist/domain/terminal/terminal-service.d.ts +3 -0
  732. package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
  733. package/daemon/dist/domain/terminal/terminal-service.js +30 -26
  734. package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
  735. package/daemon/dist/domain/terminal/tile-attach.d.ts +31 -3
  736. package/daemon/dist/domain/terminal/tile-attach.d.ts.map +1 -1
  737. package/daemon/dist/domain/terminal/tile-attach.js +95 -4
  738. package/daemon/dist/domain/terminal/tile-attach.js.map +1 -1
  739. package/daemon/dist/domain/terminal/view-composer.d.ts +2 -0
  740. package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -1
  741. package/daemon/dist/domain/terminal/view-composer.js +4 -2
  742. package/daemon/dist/domain/terminal/view-composer.js.map +1 -1
  743. package/daemon/dist/domain/topology-trace.d.ts +40 -0
  744. package/daemon/dist/domain/topology-trace.d.ts.map +1 -0
  745. package/daemon/dist/domain/topology-trace.js +106 -0
  746. package/daemon/dist/domain/topology-trace.js.map +1 -0
  747. package/daemon/dist/domain/transcript-redaction.d.ts +10 -8
  748. package/daemon/dist/domain/transcript-redaction.d.ts.map +1 -1
  749. package/daemon/dist/domain/transcript-redaction.js +51 -22
  750. package/daemon/dist/domain/transcript-redaction.js.map +1 -1
  751. package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
  752. package/daemon/dist/domain/transcript-store.js +12 -1
  753. package/daemon/dist/domain/transcript-store.js.map +1 -1
  754. package/daemon/dist/domain/types.d.ts +111 -9
  755. package/daemon/dist/domain/types.d.ts.map +1 -1
  756. package/daemon/dist/domain/types.js +6 -2
  757. package/daemon/dist/domain/types.js.map +1 -1
  758. package/daemon/dist/domain/user-settings/settings-browser.d.ts.map +1 -1
  759. package/daemon/dist/domain/user-settings/settings-browser.js +2 -0
  760. package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
  761. package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
  762. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  763. package/daemon/dist/domain/user-settings/settings-store.js +13 -0
  764. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  765. package/daemon/dist/domain/watchdog-jobs-repository.d.ts +5 -3
  766. package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
  767. package/daemon/dist/domain/watchdog-jobs-repository.js +6 -1
  768. package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
  769. package/daemon/dist/domain/watchdog-policy-engine.d.ts +8 -1
  770. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  771. package/daemon/dist/domain/watchdog-policy-engine.js +6 -2
  772. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  773. package/daemon/dist/domain/whoami-service.d.ts +11 -0
  774. package/daemon/dist/domain/whoami-service.d.ts.map +1 -1
  775. package/daemon/dist/domain/whoami-service.js +13 -0
  776. package/daemon/dist/domain/whoami-service.js.map +1 -1
  777. package/daemon/dist/domain/workflow-instance-store.d.ts +2 -0
  778. package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
  779. package/daemon/dist/domain/workflow-instance-store.js +11 -2
  780. package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
  781. package/daemon/dist/domain/workflow-projector.d.ts +3 -1
  782. package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
  783. package/daemon/dist/domain/workflow-projector.js +58 -10
  784. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  785. package/daemon/dist/domain/workflow-reconciliation.d.ts.map +1 -1
  786. package/daemon/dist/domain/workflow-reconciliation.js +9 -0
  787. package/daemon/dist/domain/workflow-reconciliation.js.map +1 -1
  788. package/daemon/dist/domain/workflow-run-title.d.ts +4 -0
  789. package/daemon/dist/domain/workflow-run-title.d.ts.map +1 -0
  790. package/daemon/dist/domain/workflow-run-title.js +5 -0
  791. package/daemon/dist/domain/workflow-run-title.js.map +1 -0
  792. package/daemon/dist/domain/workflow-runtime.d.ts +3 -0
  793. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  794. package/daemon/dist/domain/workflow-runtime.js +48 -3
  795. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  796. package/daemon/dist/domain/workflow-spec-cache.d.ts +2 -2
  797. package/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
  798. package/daemon/dist/domain/workflow-spec-cache.js +20 -1
  799. package/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
  800. package/daemon/dist/domain/workflow-types.d.ts +15 -0
  801. package/daemon/dist/domain/workflow-types.d.ts.map +1 -1
  802. package/daemon/dist/domain/workflow-types.js +4 -0
  803. package/daemon/dist/domain/workflow-types.js.map +1 -1
  804. package/daemon/dist/domain/workspace/project-read.d.ts +10 -0
  805. package/daemon/dist/domain/workspace/project-read.d.ts.map +1 -1
  806. package/daemon/dist/domain/workspace/project-read.js +34 -2
  807. package/daemon/dist/domain/workspace/project-read.js.map +1 -1
  808. package/daemon/dist/index.d.ts.map +1 -1
  809. package/daemon/dist/index.js +7 -1
  810. package/daemon/dist/index.js.map +1 -1
  811. package/daemon/dist/queue-transfer-export-surface.d.ts +33 -0
  812. package/daemon/dist/queue-transfer-export-surface.d.ts.map +1 -0
  813. package/daemon/dist/queue-transfer-export-surface.js +13 -0
  814. package/daemon/dist/queue-transfer-export-surface.js.map +1 -0
  815. package/daemon/dist/queue-transfer-staging-surface.d.ts +86 -0
  816. package/daemon/dist/queue-transfer-staging-surface.d.ts.map +1 -0
  817. package/daemon/dist/queue-transfer-staging-surface.js +91 -0
  818. package/daemon/dist/queue-transfer-staging-surface.js.map +1 -0
  819. package/daemon/dist/routes/activity.d.ts.map +1 -1
  820. package/daemon/dist/routes/activity.js +105 -2
  821. package/daemon/dist/routes/activity.js.map +1 -1
  822. package/daemon/dist/routes/compaction.d.ts.map +1 -1
  823. package/daemon/dist/routes/compaction.js +33 -11
  824. package/daemon/dist/routes/compaction.js.map +1 -1
  825. package/daemon/dist/routes/context-packs.d.ts.map +1 -1
  826. package/daemon/dist/routes/context-packs.js +23 -1
  827. package/daemon/dist/routes/context-packs.js.map +1 -1
  828. package/daemon/dist/routes/events.js +7 -4
  829. package/daemon/dist/routes/events.js.map +1 -1
  830. package/daemon/dist/routes/network.d.ts +2 -0
  831. package/daemon/dist/routes/network.d.ts.map +1 -1
  832. package/daemon/dist/routes/network.js +62 -1
  833. package/daemon/dist/routes/network.js.map +1 -1
  834. package/daemon/dist/routes/ps.js +12 -1
  835. package/daemon/dist/routes/ps.js.map +1 -1
  836. package/daemon/dist/routes/queue.d.ts.map +1 -1
  837. package/daemon/dist/routes/queue.js +219 -77
  838. package/daemon/dist/routes/queue.js.map +1 -1
  839. package/daemon/dist/routes/require-sender-identity.d.ts +15 -0
  840. package/daemon/dist/routes/require-sender-identity.d.ts.map +1 -1
  841. package/daemon/dist/routes/require-sender-identity.js +57 -8
  842. package/daemon/dist/routes/require-sender-identity.js.map +1 -1
  843. package/daemon/dist/routes/rigs.js +2 -0
  844. package/daemon/dist/routes/rigs.js.map +1 -1
  845. package/daemon/dist/routes/seat.d.ts.map +1 -1
  846. package/daemon/dist/routes/seat.js +18 -5
  847. package/daemon/dist/routes/seat.js.map +1 -1
  848. package/daemon/dist/routes/sessions.d.ts.map +1 -1
  849. package/daemon/dist/routes/sessions.js +14 -0
  850. package/daemon/dist/routes/sessions.js.map +1 -1
  851. package/daemon/dist/routes/slices.d.ts.map +1 -1
  852. package/daemon/dist/routes/slices.js +16 -7
  853. package/daemon/dist/routes/slices.js.map +1 -1
  854. package/daemon/dist/routes/startup.d.ts.map +1 -1
  855. package/daemon/dist/routes/startup.js +49 -4
  856. package/daemon/dist/routes/startup.js.map +1 -1
  857. package/daemon/dist/routes/stream.d.ts.map +1 -1
  858. package/daemon/dist/routes/stream.js +28 -1
  859. package/daemon/dist/routes/stream.js.map +1 -1
  860. package/daemon/dist/routes/terminal-ws.js +28 -2
  861. package/daemon/dist/routes/terminal-ws.js.map +1 -1
  862. package/daemon/dist/routes/terminal.d.ts.map +1 -1
  863. package/daemon/dist/routes/terminal.js +3 -2
  864. package/daemon/dist/routes/terminal.js.map +1 -1
  865. package/daemon/dist/routes/transport.d.ts.map +1 -1
  866. package/daemon/dist/routes/transport.js +14 -2
  867. package/daemon/dist/routes/transport.js.map +1 -1
  868. package/daemon/dist/routes/up.js +2 -0
  869. package/daemon/dist/routes/up.js.map +1 -1
  870. package/daemon/dist/routes/workflow.d.ts.map +1 -1
  871. package/daemon/dist/routes/workflow.js +57 -44
  872. package/daemon/dist/routes/workflow.js.map +1 -1
  873. package/daemon/dist/server.d.ts +7 -0
  874. package/daemon/dist/server.d.ts.map +1 -1
  875. package/daemon/dist/server.js +25 -1
  876. package/daemon/dist/server.js.map +1 -1
  877. package/daemon/dist/startup.d.ts +3 -0
  878. package/daemon/dist/startup.d.ts.map +1 -1
  879. package/daemon/dist/startup.js +166 -12
  880. package/daemon/dist/startup.js.map +1 -1
  881. package/daemon/dist/terminal/TerminalSessionBroker.d.ts +10 -0
  882. package/daemon/dist/terminal/TerminalSessionBroker.d.ts.map +1 -1
  883. package/daemon/dist/terminal/TerminalSessionBroker.js +63 -4
  884. package/daemon/dist/terminal/TerminalSessionBroker.js.map +1 -1
  885. package/daemon/dist/topology-trace-surface.d.ts +2 -0
  886. package/daemon/dist/topology-trace-surface.d.ts.map +1 -0
  887. package/daemon/dist/topology-trace-surface.js +2 -0
  888. package/daemon/dist/topology-trace-surface.js.map +1 -0
  889. package/daemon/dist/transcript-redaction-surface.d.ts +2 -0
  890. package/daemon/dist/transcript-redaction-surface.d.ts.map +1 -0
  891. package/daemon/dist/transcript-redaction-surface.js +2 -0
  892. package/daemon/dist/transcript-redaction-surface.js.map +1 -0
  893. package/daemon/docs/reference/acp-agents.md +11 -3
  894. package/daemon/docs/reference/agent-spec.md +25 -2
  895. package/daemon/docs/reference/agent-startup-guide.md +13 -1
  896. package/daemon/docs/reference/agent-state-taxonomy.md +35 -1
  897. package/daemon/docs/reference/checked-seat-stop.md +11 -1
  898. package/daemon/docs/reference/claude-status-line.md +7 -0
  899. package/daemon/docs/reference/community-harness-examples/cursor/cursor.yaml +3 -1
  900. package/daemon/docs/reference/community-harness-presets.md +27 -2
  901. package/daemon/docs/reference/daemon-http-clients.md +177 -18
  902. package/daemon/docs/reference/developing.md +3 -2
  903. package/daemon/docs/reference/gateway-participants.md +6 -0
  904. package/daemon/docs/reference/getting-started.md +144 -13
  905. package/daemon/docs/reference/harness-runner-contract.md +72 -0
  906. package/daemon/docs/reference/hosted-members.md +133 -0
  907. package/daemon/docs/reference/inventory-request-diagnostics.md +22 -0
  908. package/daemon/docs/reference/network-connector.md +141 -4
  909. package/daemon/docs/reference/project-workspace.md +11 -2
  910. package/daemon/docs/reference/queue-erasure.md +1 -1
  911. package/daemon/docs/reference/queue-transfer-export.md +38 -0
  912. package/daemon/docs/reference/queue-transfer-staging.md +39 -0
  913. package/daemon/docs/reference/quickstart.md +4 -4
  914. package/daemon/docs/reference/refocus-channel.md +53 -2
  915. package/daemon/docs/reference/rig-bundle.md +11 -1
  916. package/daemon/docs/reference/rig-spec.md +201 -3
  917. package/daemon/docs/reference/rosters.md +18 -3
  918. package/daemon/docs/reference/sdlc-conventions.md +1 -1
  919. package/daemon/docs/reference/seat-delivery.md +21 -4
  920. package/daemon/docs/reference/seat-node-targeting.md +10 -0
  921. package/daemon/docs/reference/seat-pools.md +182 -0
  922. package/daemon/docs/reference/slack-app-setup.md +15 -0
  923. package/daemon/docs/reference/terminal-sessions.md +127 -13
  924. package/daemon/docs/reference/tmux-servers.md +43 -2
  925. package/daemon/docs/reference/whats-new.md +186 -12
  926. package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +1 -1
  927. package/daemon/specs/agents/shared/skills/core/working-with-an-openrig-team/SKILL.md +71 -9
  928. package/daemon/specs/rigs/launch/factory/guidance/lead-first-move.md +4 -1
  929. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +2 -1
  930. package/daemon/specs/rigs/launch/starter/guidance/lead-first-move.md +4 -1
  931. package/dist/bin-wrapper.d.ts.map +1 -1
  932. package/dist/bin-wrapper.js +24 -5
  933. package/dist/bin-wrapper.js.map +1 -1
  934. package/dist/build-info.js +3 -3
  935. package/dist/client.d.ts +6 -1
  936. package/dist/client.d.ts.map +1 -1
  937. package/dist/client.js +7 -1
  938. package/dist/client.js.map +1 -1
  939. package/dist/commands/add.js +1 -1
  940. package/dist/commands/add.js.map +1 -1
  941. package/dist/commands/agent.js +1 -1
  942. package/dist/commands/agent.js.map +1 -1
  943. package/dist/commands/broadcast.d.ts.map +1 -1
  944. package/dist/commands/broadcast.js +87 -8
  945. package/dist/commands/broadcast.js.map +1 -1
  946. package/dist/commands/bundle.d.ts.map +1 -1
  947. package/dist/commands/bundle.js +18 -4
  948. package/dist/commands/bundle.js.map +1 -1
  949. package/dist/commands/chatroom.d.ts +3 -0
  950. package/dist/commands/chatroom.d.ts.map +1 -1
  951. package/dist/commands/chatroom.js +7 -1
  952. package/dist/commands/chatroom.js.map +1 -1
  953. package/dist/commands/config.d.ts.map +1 -1
  954. package/dist/commands/config.js +2 -1
  955. package/dist/commands/config.js.map +1 -1
  956. package/dist/commands/create.d.ts.map +1 -1
  957. package/dist/commands/create.js +6 -2
  958. package/dist/commands/create.js.map +1 -1
  959. package/dist/commands/daemon.d.ts.map +1 -1
  960. package/dist/commands/daemon.js +18 -15
  961. package/dist/commands/daemon.js.map +1 -1
  962. package/dist/commands/down.d.ts.map +1 -1
  963. package/dist/commands/down.js +12 -1
  964. package/dist/commands/down.js.map +1 -1
  965. package/dist/commands/exec.d.ts.map +1 -1
  966. package/dist/commands/exec.js +22 -13
  967. package/dist/commands/exec.js.map +1 -1
  968. package/dist/commands/expand.js +1 -1
  969. package/dist/commands/expand.js.map +1 -1
  970. package/dist/commands/export.d.ts.map +1 -1
  971. package/dist/commands/export.js +5 -1
  972. package/dist/commands/export.js.map +1 -1
  973. package/dist/commands/fork.js +1 -1
  974. package/dist/commands/fork.js.map +1 -1
  975. package/dist/commands/gateway.d.ts +4 -0
  976. package/dist/commands/gateway.d.ts.map +1 -1
  977. package/dist/commands/gateway.js +37 -0
  978. package/dist/commands/gateway.js.map +1 -1
  979. package/dist/commands/grow.d.ts.map +1 -1
  980. package/dist/commands/grow.js +9 -4
  981. package/dist/commands/grow.js.map +1 -1
  982. package/dist/commands/import.js +1 -1
  983. package/dist/commands/import.js.map +1 -1
  984. package/dist/commands/mcp.d.ts.map +1 -1
  985. package/dist/commands/mcp.js +57 -22
  986. package/dist/commands/mcp.js.map +1 -1
  987. package/dist/commands/network.d.ts +2 -3
  988. package/dist/commands/network.d.ts.map +1 -1
  989. package/dist/commands/network.js +102 -4
  990. package/dist/commands/network.js.map +1 -1
  991. package/dist/commands/parked.d.ts.map +1 -1
  992. package/dist/commands/parked.js +12 -6
  993. package/dist/commands/parked.js.map +1 -1
  994. package/dist/commands/provider.d.ts.map +1 -1
  995. package/dist/commands/provider.js +3 -2
  996. package/dist/commands/provider.js.map +1 -1
  997. package/dist/commands/ps.d.ts +13 -1
  998. package/dist/commands/ps.d.ts.map +1 -1
  999. package/dist/commands/ps.js +65 -29
  1000. package/dist/commands/ps.js.map +1 -1
  1001. package/dist/commands/queue-export.d.ts +3 -0
  1002. package/dist/commands/queue-export.d.ts.map +1 -0
  1003. package/dist/commands/queue-export.js +67 -0
  1004. package/dist/commands/queue-export.js.map +1 -0
  1005. package/dist/commands/queue-import.d.ts +4 -0
  1006. package/dist/commands/queue-import.d.ts.map +1 -0
  1007. package/dist/commands/queue-import.js +47 -0
  1008. package/dist/commands/queue-import.js.map +1 -0
  1009. package/dist/commands/queue.d.ts +3 -1
  1010. package/dist/commands/queue.d.ts.map +1 -1
  1011. package/dist/commands/queue.js +79 -7
  1012. package/dist/commands/queue.js.map +1 -1
  1013. package/dist/commands/reconcile-session.js +1 -1
  1014. package/dist/commands/reconcile-session.js.map +1 -1
  1015. package/dist/commands/restore.js +1 -1
  1016. package/dist/commands/restore.js.map +1 -1
  1017. package/dist/commands/rig.js +2 -2
  1018. package/dist/commands/rig.js.map +1 -1
  1019. package/dist/commands/roster.js +1 -1
  1020. package/dist/commands/roster.js.map +1 -1
  1021. package/dist/commands/scope.d.ts.map +1 -1
  1022. package/dist/commands/scope.js +30 -18
  1023. package/dist/commands/scope.js.map +1 -1
  1024. package/dist/commands/seat.d.ts.map +1 -1
  1025. package/dist/commands/seat.js +75 -18
  1026. package/dist/commands/seat.js.map +1 -1
  1027. package/dist/commands/send.d.ts.map +1 -1
  1028. package/dist/commands/send.js +15 -3
  1029. package/dist/commands/send.js.map +1 -1
  1030. package/dist/commands/skill.js +1 -1
  1031. package/dist/commands/skill.js.map +1 -1
  1032. package/dist/commands/start.d.ts +14 -0
  1033. package/dist/commands/start.d.ts.map +1 -1
  1034. package/dist/commands/start.js +57 -7
  1035. package/dist/commands/start.js.map +1 -1
  1036. package/dist/commands/terminal.d.ts.map +1 -1
  1037. package/dist/commands/terminal.js +20 -4
  1038. package/dist/commands/terminal.js.map +1 -1
  1039. package/dist/commands/up.d.ts.map +1 -1
  1040. package/dist/commands/up.js +2 -1
  1041. package/dist/commands/up.js.map +1 -1
  1042. package/dist/commands/whoami.d.ts.map +1 -1
  1043. package/dist/commands/whoami.js +6 -0
  1044. package/dist/commands/whoami.js.map +1 -1
  1045. package/dist/commands/workflow-follow.d.ts.map +1 -1
  1046. package/dist/commands/workflow-follow.js +37 -34
  1047. package/dist/commands/workflow-follow.js.map +1 -1
  1048. package/dist/commands/workflow-render.d.ts +1 -1
  1049. package/dist/commands/workflow-render.d.ts.map +1 -1
  1050. package/dist/commands/workflow-render.js +2 -7
  1051. package/dist/commands/workflow-render.js.map +1 -1
  1052. package/dist/commands/workflow.d.ts.map +1 -1
  1053. package/dist/commands/workflow.js +26 -2
  1054. package/dist/commands/workflow.js.map +1 -1
  1055. package/dist/config-store.d.ts +2 -1
  1056. package/dist/config-store.d.ts.map +1 -1
  1057. package/dist/config-store.js +14 -1
  1058. package/dist/config-store.js.map +1 -1
  1059. package/dist/cross-host-executor.d.ts +3 -0
  1060. package/dist/cross-host-executor.d.ts.map +1 -1
  1061. package/dist/cross-host-executor.js +5 -0
  1062. package/dist/cross-host-executor.js.map +1 -1
  1063. package/dist/daemon-auto-start.d.ts.map +1 -1
  1064. package/dist/daemon-auto-start.js +1 -0
  1065. package/dist/daemon-auto-start.js.map +1 -1
  1066. package/dist/daemon-lifecycle.d.ts +30 -1
  1067. package/dist/daemon-lifecycle.d.ts.map +1 -1
  1068. package/dist/daemon-lifecycle.js +135 -38
  1069. package/dist/daemon-lifecycle.js.map +1 -1
  1070. package/dist/daemon-start-lock.d.ts +38 -3
  1071. package/dist/daemon-start-lock.d.ts.map +1 -1
  1072. package/dist/daemon-start-lock.js +201 -48
  1073. package/dist/daemon-start-lock.js.map +1 -1
  1074. package/dist/lib/bundle-source.d.ts +4 -0
  1075. package/dist/lib/bundle-source.d.ts.map +1 -1
  1076. package/dist/lib/bundle-source.js +14 -2
  1077. package/dist/lib/bundle-source.js.map +1 -1
  1078. package/dist/lib/context-git.js +2 -2
  1079. package/dist/lib/context-git.js.map +1 -1
  1080. package/dist/lib/frontmatter.d.ts.map +1 -1
  1081. package/dist/lib/frontmatter.js +4 -2
  1082. package/dist/lib/frontmatter.js.map +1 -1
  1083. package/dist/lib/scope/attestation-lineage.js +2 -2
  1084. package/dist/lib/scope/attestation-lineage.js.map +1 -1
  1085. package/dist/lib/scope/logical-checkbox.d.ts.map +1 -1
  1086. package/dist/lib/scope/logical-checkbox.js +18 -0
  1087. package/dist/lib/scope/logical-checkbox.js.map +1 -1
  1088. package/dist/lib/scope/progress-edit.d.ts.map +1 -1
  1089. package/dist/lib/scope/progress-edit.js +11 -1
  1090. package/dist/lib/scope/progress-edit.js.map +1 -1
  1091. package/dist/lib/scope/scaffold-placeholder.js +2 -2
  1092. package/dist/lib/scope/scaffold-placeholder.js.map +1 -1
  1093. package/dist/lib/terminal-cell.d.ts +5 -0
  1094. package/dist/lib/terminal-cell.d.ts.map +1 -0
  1095. package/dist/lib/terminal-cell.js +22 -0
  1096. package/dist/lib/terminal-cell.js.map +1 -0
  1097. package/dist/lib/topology-trace.d.ts +3 -34
  1098. package/dist/lib/topology-trace.d.ts.map +1 -1
  1099. package/dist/lib/topology-trace.js +3 -97
  1100. package/dist/lib/topology-trace.js.map +1 -1
  1101. package/dist/local-db.d.ts +2 -0
  1102. package/dist/local-db.d.ts.map +1 -1
  1103. package/dist/local-db.js +14 -11
  1104. package/dist/local-db.js.map +1 -1
  1105. package/dist/mcp-caller-resolver.d.ts +36 -0
  1106. package/dist/mcp-caller-resolver.d.ts.map +1 -0
  1107. package/dist/mcp-caller-resolver.js +82 -0
  1108. package/dist/mcp-caller-resolver.js.map +1 -0
  1109. package/dist/mcp-http.d.ts +44 -3
  1110. package/dist/mcp-http.d.ts.map +1 -1
  1111. package/dist/mcp-http.js +228 -48
  1112. package/dist/mcp-http.js.map +1 -1
  1113. package/dist/mcp-server.d.ts +28 -1
  1114. package/dist/mcp-server.d.ts.map +1 -1
  1115. package/dist/mcp-server.js +219 -52
  1116. package/dist/mcp-server.js.map +1 -1
  1117. package/dist/mcp-surface.d.ts +3 -2
  1118. package/dist/mcp-surface.d.ts.map +1 -1
  1119. package/dist/node-support.d.ts.map +1 -1
  1120. package/dist/node-support.js +10 -0
  1121. package/dist/node-support.js.map +1 -1
  1122. package/dist/release-surface/extract-surface.d.ts.map +1 -1
  1123. package/dist/release-surface/extract-surface.js +38 -20
  1124. package/dist/release-surface/extract-surface.js.map +1 -1
  1125. package/dist/release-surface/generate.d.ts.map +1 -1
  1126. package/dist/release-surface/generate.js +3 -0
  1127. package/dist/release-surface/generate.js.map +1 -1
  1128. package/dist/release-surface/surface-diff.d.ts +1 -0
  1129. package/dist/release-surface/surface-diff.d.ts.map +1 -1
  1130. package/dist/release-surface/surface-diff.js +19 -18
  1131. package/dist/release-surface/surface-diff.js.map +1 -1
  1132. package/dist/remote-host-ops.d.ts +3 -0
  1133. package/dist/remote-host-ops.d.ts.map +1 -1
  1134. package/dist/remote-host-ops.js +15 -1
  1135. package/dist/remote-host-ops.js.map +1 -1
  1136. package/dist/restore-packet/redaction.d.ts +4 -26
  1137. package/dist/restore-packet/redaction.d.ts.map +1 -1
  1138. package/dist/restore-packet/redaction.js +19 -63
  1139. package/dist/restore-packet/redaction.js.map +1 -1
  1140. package/dist/terminal-orca.d.ts +7 -0
  1141. package/dist/terminal-orca.d.ts.map +1 -0
  1142. package/dist/terminal-orca.js +239 -0
  1143. package/dist/terminal-orca.js.map +1 -0
  1144. package/package.json +3 -3
  1145. package/scripts/check-abi.mjs +15 -0
  1146. package/tui/dist/attention/attention-model.d.ts.map +1 -1
  1147. package/tui/dist/attention/attention-model.js +8 -4
  1148. package/tui/dist/attention/attention-model.js.map +1 -1
  1149. package/tui/dist/connected-assistants.d.ts +1 -1
  1150. package/tui/dist/connected-assistants.d.ts.map +1 -1
  1151. package/tui/dist/connected-assistants.js +3 -1
  1152. package/tui/dist/connected-assistants.js.map +1 -1
  1153. package/tui/dist/crash-cart/start-daemon.d.ts +20 -0
  1154. package/tui/dist/crash-cart/start-daemon.d.ts.map +1 -1
  1155. package/tui/dist/crash-cart/start-daemon.js +56 -0
  1156. package/tui/dist/crash-cart/start-daemon.js.map +1 -1
  1157. package/tui/dist/daemon-client.d.ts +4 -0
  1158. package/tui/dist/daemon-client.d.ts.map +1 -1
  1159. package/tui/dist/daemon-client.js +12 -8
  1160. package/tui/dist/daemon-client.js.map +1 -1
  1161. package/tui/dist/health/health-model.d.ts.map +1 -1
  1162. package/tui/dist/health/health-model.js +2 -0
  1163. package/tui/dist/health/health-model.js.map +1 -1
  1164. package/tui/dist/hydrate.d.ts +3 -1
  1165. package/tui/dist/hydrate.d.ts.map +1 -1
  1166. package/tui/dist/hydrate.js +44 -27
  1167. package/tui/dist/hydrate.js.map +1 -1
  1168. package/tui/dist/live.d.ts +5 -1
  1169. package/tui/dist/live.d.ts.map +1 -1
  1170. package/tui/dist/live.js +20 -2
  1171. package/tui/dist/live.js.map +1 -1
  1172. package/tui/dist/main.js +29 -10
  1173. package/tui/dist/main.js.map +1 -1
  1174. package/tui/dist/pulse/pulse-model.d.ts.map +1 -1
  1175. package/tui/dist/pulse/pulse-model.js +3 -2
  1176. package/tui/dist/pulse/pulse-model.js.map +1 -1
  1177. package/tui/dist/render.d.ts +2 -0
  1178. package/tui/dist/render.d.ts.map +1 -1
  1179. package/tui/dist/render.js +47 -14
  1180. package/tui/dist/render.js.map +1 -1
  1181. package/tui/dist/types.d.ts +10 -4
  1182. package/tui/dist/types.d.ts.map +1 -1
  1183. package/ui/dist/assets/index-Chh-NS8Z.css +32 -0
  1184. package/ui/dist/assets/index-DG_7XFcL.js +628 -0
  1185. package/ui/dist/index.html +2 -2
  1186. package/ui/dist/assets/index-B-sMy02c.js +0 -623
  1187. package/ui/dist/assets/index-DiN7RwWg.css +0 -32
@@ -0,0 +1,523 @@
1
+ import { ulid } from "ulid";
2
+ import { launchStatusIsRunning } from "./restore-orchestrator.js";
3
+ import { automaticRestoreInProgress } from "./existing-rig-restore.js";
4
+ import { resolveSeatKind, seatProcessOwner } from "./seat-kinds.js";
5
+ /**
6
+ * Keep-alive supervisor (#2940). A seat that declares `keep_alive` is relaunched when it falls while the daemon runs,
7
+ * and left alone when it was stopped on purpose. Started by startup.ts after the boot reconcile and the kernel boot, and
8
+ * stopped first during graceful shutdown. Inert while no seat declares keep_alive.
9
+ *
10
+ * Each tick, for each keep_alive seat of a rig that isn't archived:
11
+ * - it skips a seat with no session, a claimed session or a seat attached from outside; a seat whose latest session
12
+ * carries a stop request (a seat stop or a rig down, which also ends its incident); a rig whose restore is running;
13
+ * and a seat whose recovery ran out;
14
+ * - it reconciles the seat alone, asking for proof of absence, then acts only on a fall proven by absence: the latest
15
+ * session `detached` with no stop request, or the incident's own failed launch in any status, proven gone. Anything
16
+ * the reconcile couldn't settle on a session that decides the fall (the latest one and the seat's sessions under its
17
+ * tmux name, and the incident's own; never a claimed one, which is its owner's) leaves the seat as it was, and the
18
+ * tick does nothing for it: a probe that proves nothing, such as an unreachable tmux socket or a probe error; a row
19
+ * tmux still shows; a recorded process still running, or one an unreadable process table can't check. A tmux socket
20
+ * a reboot's /tmp cleanup removed is the exception when the seat's process recorded for its latest session is
21
+ * proven gone: as `rig down` does, the reconcile starts an empty server and probes again.
22
+ * An `exited` session without a stop request ended cleanly or by an internal action, and is left as it is;
23
+ * - it relaunches through the existing one-seat launch (`launchSingleNode` with `keepAlive`), which under the seat's
24
+ * lifecycle lease refuses if a stop was recorded meanwhile, or if the daemon began shutting down while the launch
25
+ * waited for the lease. It never asks for a fresh start.
26
+ *
27
+ * The budget is durable, in `node_keep_alive_budget`: an attempt is counted, with its event, in one transaction before
28
+ * its launch starts, so a daemon restart mid-launch still counts it, and nothing resets on a restart or because a launch
29
+ * returned. Every session a launch leaves behind is recorded as the incident's, whatever the outcome, so it is never
30
+ * taken for a person's start. Attempts are spaced by a growing wait; when they run out, or a launch outcome needs a
31
+ * person (a terminal status or refusal, a failed launch whose session was left running, a survivor that isn't the seat's
32
+ * latest session or whose harness isn't started), the incident is exhausted once, with its event, and the seat shows
33
+ * attention until someone starts or stops it. A launch refused because the daemon is shutting down gives its attempt
34
+ * back only when it started nothing that remains: it stopped before its first effect, or every shell it started was
35
+ * stopped (tmux confirmed it) and the seat's prior state put back. A refused launch whose stop wasn't confirmed keeps its
36
+ * attempt: the session it may have left running is recorded as the incident's and reported, and the incident waits for
37
+ * a person.
38
+ *
39
+ * A session counts as a recovered agent only once its harness's startup has completed (`startup_status` 'ready'): a
40
+ * bare shell, its harness not started, or a startup still running is never marked recovered, never starts or completes
41
+ * the stable period, and never ends an incident or resets its budget. It waits, and recovers once its startup completes
42
+ * (a person who brings the agent up in the pane and clears its attention).
43
+ *
44
+ * An incident ends when a tick has seen the recovered session run for the stable period, when a person's stop of the
45
+ * seat is confirmed (a request still pending keeps it), or when a person starts it (a session that is neither the
46
+ * incident's fallen nor its launched one). An automatic restore at daemon start isn't a person's start: the session it
47
+ * launches for a seat in an incident is recorded as the incident's as it is registered (`keepAliveIncidentAdopts`), so
48
+ * the incident and its budget carry on, also when that restore replaces its provisional shell with a fresh launch from
49
+ * the seat's recipe (the replacement's session is the one adopted); in an exhausted incident it ends the incident only
50
+ * once a tick has seen it run for the stable period. The other exception is a launch whose outcome was never written
51
+ * (the daemon stopped in the middle of it): a session created after that attempt began is taken as that launch's, so the
52
+ * restart never resets the budget. The stable period counts only what a tick saw: a recovered seat that falls while the
53
+ * daemon was down, without a tick having seen it run for the stable period, stays in its incident.
54
+ *
55
+ * Concurrency and shutdown follow the watchdog scheduler: one tick at a time, seats in sequence; stop() prevents any new
56
+ * attempt at once and waits a bounded time for the tick in flight. A shutdown writes nothing to sessions.
57
+ */
58
+ export const KEEP_ALIVE_DEFAULTS = {
59
+ /** Attempts per incident. */
60
+ attempts: 2,
61
+ /** The wait before the 2nd attempt; it doubles for each later one. */
62
+ backoffMs: 30_000,
63
+ /** How long a recovered seat runs before its incident ends and the budget is whole again. */
64
+ stableMs: 10 * 60_000,
65
+ tickIntervalMs: 30_000,
66
+ /** How long stop() waits for a tick in flight: short, within the daemon's 10 s shutdown budget. */
67
+ stopWaitMs: 2_000,
68
+ };
69
+ /** Launch refusals that a retry can't change: the seat waits for a person. */
70
+ const TERMINAL_REFUSALS = new Set(["stop_requested", "selection_changed", "no_matching_nodes", "no_usable_snapshot"]);
71
+ /** Launch statuses that started nothing a retry could fix, or left the seat for a person to decide. */
72
+ const TERMINAL_STATUSES = new Set(["awaiting-decision", "attention_required", "left_attached"]);
73
+ export class KeepAliveSupervisor {
74
+ db;
75
+ eventBus;
76
+ reconciler;
77
+ restoreOrchestrator;
78
+ adapters;
79
+ fsOps;
80
+ attempts;
81
+ backoffMs;
82
+ stableMs;
83
+ tickIntervalMs;
84
+ stopWaitMs;
85
+ now;
86
+ setTimer;
87
+ clearTimer;
88
+ onTickError;
89
+ sessionsHaveStopAttempt = null;
90
+ timer = null;
91
+ inflight = null;
92
+ stopping = false;
93
+ started = false;
94
+ constructor(deps) {
95
+ this.db = deps.db;
96
+ this.eventBus = deps.eventBus;
97
+ this.reconciler = deps.reconciler;
98
+ this.restoreOrchestrator = deps.restoreOrchestrator;
99
+ this.adapters = deps.adapters;
100
+ this.fsOps = deps.fsOps;
101
+ this.attempts = deps.attempts ?? KEEP_ALIVE_DEFAULTS.attempts;
102
+ this.backoffMs = deps.backoffMs ?? KEEP_ALIVE_DEFAULTS.backoffMs;
103
+ this.stableMs = deps.stableMs ?? KEEP_ALIVE_DEFAULTS.stableMs;
104
+ this.tickIntervalMs = deps.tickIntervalMs ?? KEEP_ALIVE_DEFAULTS.tickIntervalMs;
105
+ this.stopWaitMs = deps.stopWaitMs ?? KEEP_ALIVE_DEFAULTS.stopWaitMs;
106
+ this.now = deps.now ?? (() => new Date());
107
+ this.setTimer = deps.setTimer ?? ((cb, ms) => setTimeout(cb, ms));
108
+ this.clearTimer = deps.clearTimer ?? ((handle) => clearTimeout(handle));
109
+ this.onTickError = deps.onTickError ?? ((err) => console.error("[keep-alive] tick error", err));
110
+ }
111
+ start() {
112
+ if (this.started)
113
+ return;
114
+ this.started = true;
115
+ this.stopping = false;
116
+ this.scheduleNextTick();
117
+ }
118
+ /** No new attempt starts once this is called; a tick in flight is waited for at most `stopWaitMs`. Idempotent. */
119
+ async stop() {
120
+ this.stopping = true;
121
+ if (!this.started)
122
+ return;
123
+ if (this.timer) {
124
+ this.clearTimer(this.timer);
125
+ this.timer = null;
126
+ }
127
+ if (this.inflight) {
128
+ let bound = null;
129
+ await Promise.race([
130
+ this.inflight.catch(() => undefined),
131
+ new Promise((resolve) => { bound = this.setTimer(resolve, this.stopWaitMs); }),
132
+ ]);
133
+ if (bound)
134
+ this.clearTimer(bound);
135
+ }
136
+ this.started = false;
137
+ }
138
+ isRunning() {
139
+ return this.started && !this.stopping;
140
+ }
141
+ /** Run one tick and wait for it. Exposed for tests; the timer loop calls it in production. */
142
+ async runTickNow() {
143
+ if (this.inflight) {
144
+ await this.inflight;
145
+ return;
146
+ }
147
+ this.inflight = this.tick();
148
+ try {
149
+ await this.inflight;
150
+ }
151
+ finally {
152
+ this.inflight = null;
153
+ }
154
+ }
155
+ scheduleNextTick() {
156
+ if (this.stopping)
157
+ return;
158
+ this.timer = this.setTimer(() => {
159
+ void this.runTickNow()
160
+ .catch((err) => this.onTickError(err))
161
+ .finally(() => this.scheduleNextTick());
162
+ }, this.tickIntervalMs);
163
+ }
164
+ async tick() {
165
+ if (this.stopping)
166
+ return;
167
+ const seats = this.db.prepare(`SELECT n.id AS nodeId, n.rig_id AS rigId, n.logical_id AS logicalId
168
+ FROM nodes n JOIN rigs r ON r.id = n.rig_id
169
+ WHERE n.keep_alive = 1 AND r.archived_at IS NULL
170
+ ORDER BY n.rig_id, n.created_at`).all();
171
+ for (const seat of seats) {
172
+ if (this.stopping)
173
+ return;
174
+ try {
175
+ await this.superviseSeat(seat);
176
+ }
177
+ catch (err) {
178
+ this.onTickError(err);
179
+ }
180
+ }
181
+ }
182
+ async superviseSeat(seat) {
183
+ const latest = this.latestSession(seat.nodeId);
184
+ if (!latest || latest.origin === "claimed" || this.attachedFromOutside(seat.nodeId))
185
+ return;
186
+ let budget = this.readBudget(seat.nodeId);
187
+ if (latest.flag === 1) {
188
+ // A seat stop or a rig down: the seat stays down, and its incident, if any, ends once the stop is confirmed. An
189
+ // exhausted seat a person stopped stops asking for attention, and a later start begins clean. A request still
190
+ // pending keeps the incident as it is: a checked stop whose kill proves to have had no effect puts the request
191
+ // back, and the seat was never stopped.
192
+ if (budget && latest.stop_attempt === null)
193
+ this.endIncident(seat.nodeId);
194
+ return;
195
+ }
196
+ if (this.restoreInProgress(seat.rigId))
197
+ return;
198
+ if (budget && !inIncident(latest.id, budget)) {
199
+ if (launchOutcomeLost(budget, latest)) {
200
+ // The last attempt's launch never wrote its outcome (the daemon stopped in the middle of it), and this session
201
+ // came after that attempt began: it is that launch's, so the restart never resets the budget.
202
+ this.db.prepare("UPDATE node_keep_alive_budget SET launched_session_id = ?, last_outcome = 'adopted', updated_at = ? WHERE node_id = ? AND incident_id = ?").run(latest.id, this.now().toISOString(), seat.nodeId, budget.incident_id);
203
+ budget = { ...budget, launched_session_id: latest.id, last_outcome: "adopted" };
204
+ }
205
+ else {
206
+ // A person started the seat: its incident is over, whatever state it was in, and a later fall opens a new one.
207
+ this.endIncident(seat.nodeId);
208
+ budget = null;
209
+ }
210
+ }
211
+ // An exhausted incident waits for a person, save for the session an automatic restore brought back into it: a tick
212
+ // that sees that session run for the stable period ends the incident, below.
213
+ if (budget?.exhausted_at && !(budget.last_outcome === "adopted" && latest.id === budget.launched_session_id))
214
+ return;
215
+ const reconciled = await this.reconciler.reconcile(seat.rigId, { nodeIds: [seat.nodeId], absenceProof: "positive" });
216
+ if (this.stopping)
217
+ return;
218
+ // A probe that proved nothing, a detached session tmux still shows, or a recorded process still running: no proven
219
+ // fall, so nothing is done for the seat.
220
+ if (reconciled?.undetermined?.some((entry) => entry.sessionId === latest.id)
221
+ || reconciled?.unseen?.some((entry) => entry.sessionId === latest.id)
222
+ || reconciled?.errors?.some((entry) => entry.sessionId === latest.id))
223
+ return;
224
+ const current = this.latestSession(seat.nodeId);
225
+ // Something else moved the seat meanwhile (a start, a stop): the next tick looks again.
226
+ if (!current || current.id !== latest.id || current.flag === 1)
227
+ return;
228
+ const open = !!budget && !budget.recovered_at && budget.attempts > 0;
229
+ if (current.status === "running") {
230
+ if (!budget || current.id !== budget.launched_session_id)
231
+ return;
232
+ // A session running is a recovered agent only once its harness's startup has completed. A bare shell (its harness
233
+ // not started) or a startup still running recovers nothing and ends nothing: the incident and its budget stay as
234
+ // they are, and the stable period counts only from a tick that sees the startup complete.
235
+ const started = current.startup_status === "ready";
236
+ if (budget.exhausted_at) {
237
+ // An automatic restore's session in an exhausted incident: the first tick that sees it running with its harness
238
+ // started begins its stable period, and one that sees it so after that period ends the incident.
239
+ if (!started) {
240
+ if (budget.recovered_at) {
241
+ this.db.prepare("UPDATE node_keep_alive_budget SET recovered_at = NULL, updated_at = ? WHERE node_id = ? AND incident_id = ?")
242
+ .run(this.now().toISOString(), seat.nodeId, budget.incident_id);
243
+ }
244
+ }
245
+ else if (!budget.recovered_at) {
246
+ const at = this.now().toISOString();
247
+ this.db.prepare("UPDATE node_keep_alive_budget SET recovered_at = ?, updated_at = ? WHERE node_id = ? AND incident_id = ?")
248
+ .run(at, at, seat.nodeId, budget.incident_id);
249
+ }
250
+ else if (this.ranStable(budget)) {
251
+ this.endIncident(seat.nodeId);
252
+ }
253
+ }
254
+ else if (open) {
255
+ // Only a launch's own session counts. One whose outcome the daemon lost to a restart, an automatic restore's, or
256
+ // one whose launch returned before its startup completed recovers once its harness has started; one a failed
257
+ // launch left behind is a pane without its agent, and waits for a person.
258
+ if (budget.last_outcome === "adopted" || budget.last_outcome === "recovered") {
259
+ if (started)
260
+ this.markRecovered(seat, budget, current.id, "running");
261
+ }
262
+ else {
263
+ this.markExhausted(seat, budget, "failed", `${budget.last_error ?? "the launch failed"}; the failed launch left its session running`);
264
+ }
265
+ }
266
+ else if (started && this.ranStable(budget)) {
267
+ this.endIncident(seat.nodeId);
268
+ }
269
+ return;
270
+ }
271
+ // An automatic restore's session that fell keeps its exhausted incident waiting for a person.
272
+ if (budget?.exhausted_at)
273
+ return;
274
+ // A fall is a session the reconcile proved absent. A probe that proved nothing or a recorded process still running
275
+ // leaves it as it was above. An open incident's own failed launch counts as down whatever status it left, once the
276
+ // reconcile proved it gone.
277
+ const ownFailedLaunch = open && current.id === budget.launched_session_id;
278
+ if (current.status !== "detached" && !ownFailedLaunch)
279
+ return;
280
+ // A retry needs positive absence. The reconcile covers this seat alone, so anything it couldn't settle on any of the
281
+ // seat's sessions (a probe that proved nothing, a row tmux still shows, a recorded process still running or one the
282
+ // process table couldn't check, an error) leaves the seat as it is. A claimed session is the exception: released, it
283
+ // runs on in its owner's tmux, and it would hold the seat back forever.
284
+ const claimed = this.claimedSessions(seat.nodeId);
285
+ const unsettled = (entries) => !!entries?.some((entry) => !claimed.has(entry.sessionId));
286
+ if (unsettled(reconciled?.undetermined) || unsettled(reconciled?.unseen) || unsettled(reconciled?.errors)
287
+ || !reconciled?.provenAbsent?.includes(current.id))
288
+ return;
289
+ if (budget && budget.attempts >= this.attempts) {
290
+ this.markExhausted(seat, budget, undefined, budget.last_error ?? "the recovery attempts ran out");
291
+ return;
292
+ }
293
+ if (budget && budget.attempts >= 1 && budget.last_attempt_at
294
+ && this.now().getTime() < Date.parse(budget.last_attempt_at) + this.backoffMs * 2 ** (budget.attempts - 1)) {
295
+ return;
296
+ }
297
+ if (this.stopping)
298
+ return;
299
+ const attempt = this.recordAttempt(seat, budget, current.id);
300
+ let result = null;
301
+ let thrown = null;
302
+ try {
303
+ result = await this.restoreOrchestrator.launchSingleNode(seat.rigId, seat.logicalId, {
304
+ ...(this.adapters ? { adapters: this.adapters } : {}), ...(this.fsOps ? { fsOps: this.fsOps } : {}),
305
+ keepAlive: { shouldContinue: () => !this.stopping },
306
+ });
307
+ }
308
+ catch (err) {
309
+ thrown = err instanceof Error ? err.message : String(err);
310
+ }
311
+ this.recordOutcome(seat, budget, attempt, current.id, result, thrown);
312
+ }
313
+ recordOutcome(seat, before, budget, fallenId, result, thrown) {
314
+ if (thrown !== null)
315
+ return this.recordFailure(seat, budget, fallenId, "failed", thrown);
316
+ if (!result.ok) {
317
+ if (result.code === "shutting_down") {
318
+ // The daemon began shutting down. A launch that stopped before its first effect, or whose shells were stopped
319
+ // (tmux confirmed it) with the seat's prior state put back, started nothing that remains: the attempt is given
320
+ // back, and the next daemon start finds the incident as it was. A stop that wasn't confirmed may have left its
321
+ // session running: the attempt stays counted, and that session is recorded as the incident's and reported.
322
+ const own = (result.launched ?? []).filter((entry) => entry.nodeId === seat.nodeId || entry.intendedNodeId === seat.nodeId);
323
+ const left = own.find((entry) => !entry.notStarted && !entry.compensated);
324
+ if (!left)
325
+ return this.revertAttempt(seat, before, budget);
326
+ return this.recordFailure(seat, budget, fallenId, "shutting_down", left.error ?? result.message ?? "the launch was refused for a shutdown");
327
+ }
328
+ const error = result.message ?? result.code ?? "the launch was refused";
329
+ return TERMINAL_REFUSALS.has(result.code ?? "")
330
+ ? this.markExhausted(seat, budget, result.code, error)
331
+ : this.recordFailure(seat, budget, fallenId, result.code ?? "failed", error);
332
+ }
333
+ if (result.alreadyRunning?.some((entry) => entry.nodeId === seat.nodeId)) {
334
+ // A live session survived. When it is the seat's latest session nothing is down: the incident closes and the
335
+ // attempt isn't spent. An older session still running behind a fallen latest one is a state a relaunch can't
336
+ // fix: the seat waits for a person, so the same fall doesn't open a new incident on every tick.
337
+ const latest = this.latestSession(seat.nodeId);
338
+ if (latest?.status === "running") {
339
+ if (latest.startup_status === "ready")
340
+ return this.endIncident(seat.nodeId);
341
+ // A live session whose harness's startup hasn't completed (a bare shell) isn't a running agent: the seat waits for
342
+ // a person rather than the budget being reset on it.
343
+ return this.markExhausted(seat, budget, "already_running", `the seat's latest session '${latest.session_name}' is running, but its harness's startup hasn't completed (startup status '${latest.startup_status ?? "unknown"}')`);
344
+ }
345
+ const live = this.db.prepare("SELECT session_name FROM sessions WHERE node_id = ? AND status = 'running' ORDER BY created_at DESC, id DESC LIMIT 1").get(seat.nodeId);
346
+ return this.markExhausted(seat, budget, "already_running", `an older session${live ? ` '${live.session_name}'` : ""} is still running behind the seat's latest session, which fell`);
347
+ }
348
+ const launched = result.launched?.find((entry) => entry.nodeId === seat.nodeId);
349
+ if (!launched)
350
+ return this.recordFailure(seat, budget, fallenId, "failed", "the launch reported no outcome for this seat");
351
+ const error = launched.error ?? `the launch ended '${launched.status}'`;
352
+ if (TERMINAL_STATUSES.has(launched.status))
353
+ return this.markExhausted(seat, budget, launched.status, error);
354
+ if (launchStatusIsRunning(launched.status)) {
355
+ // A running status counts only with a new session running: a launch can report one without starting anything
356
+ // (a seat whose continuity recovery is in progress), and then the seat is still down.
357
+ const after = this.latestSession(seat.nodeId);
358
+ if (after && after.id !== fallenId && after.status === "running") {
359
+ // Recovered only once the harness's startup has completed. One still starting is recorded as the launch's, and a
360
+ // tick marks it recovered once it has; one left as a bare shell (its startup didn't complete) is a failed launch
361
+ // that left its session running, and waits for a person.
362
+ if (after.startup_status === "ready")
363
+ return this.markRecovered(seat, budget, after.id, launched.status);
364
+ if (after.startup_status === "pending") {
365
+ this.db.prepare("UPDATE node_keep_alive_budget SET launched_session_id = ?, last_outcome = 'recovered', updated_at = ? WHERE node_id = ? AND incident_id = ?").run(after.id, this.now().toISOString(), seat.nodeId, budget.incident_id);
366
+ return;
367
+ }
368
+ return this.recordFailure(seat, budget, fallenId, launched.status, `the launch reported '${launched.status}' but its harness's startup didn't complete (startup status '${after.startup_status ?? "unknown"}')`);
369
+ }
370
+ return this.recordFailure(seat, budget, fallenId, launched.status, `the launch reported '${launched.status}' but started no session`);
371
+ }
372
+ return this.recordFailure(seat, budget, fallenId, launched.status, error);
373
+ }
374
+ /** A failed attempt, or one whose effect is unknown: it stays counted, and the next waits for its turn. The last
375
+ * allowed attempt failing exhausts the incident, and so does a failed launch that left its new session running (its
376
+ * pane kept without the agent): a relaunch would collide with it, so the seat waits for a person. */
377
+ recordFailure(seat, budget, fallenId, status, error) {
378
+ const after = this.latestSession(seat.nodeId);
379
+ if (after && after.id !== fallenId && after.status === "running") {
380
+ return this.markExhausted(seat, budget, status, `${error}; the failed launch left its session running`);
381
+ }
382
+ // A session the failed launch left behind stays this incident's, so it isn't taken for a person's start.
383
+ const launchedId = after && after.id !== fallenId ? after.id : budget.launched_session_id;
384
+ this.db.prepare("UPDATE node_keep_alive_budget SET last_error = ?, launched_session_id = ?, last_outcome = 'failed', updated_at = ? WHERE node_id = ? AND incident_id = ?").run(error, launchedId, this.now().toISOString(), seat.nodeId, budget.incident_id);
385
+ if (budget.attempts >= this.attempts)
386
+ this.markExhausted(seat, budget, status, error);
387
+ }
388
+ /** Count an attempt and persist its event, in one transaction, before its launch starts. Its outcome is unwritten
389
+ * (`last_outcome` NULL) until the launch returns. */
390
+ recordAttempt(seat, budget, fallenId) {
391
+ const at = this.now().toISOString();
392
+ const next = budget
393
+ ? { ...budget, attempts: budget.attempts + 1, last_attempt_at: at, fallen_session_id: fallenId, recovered_at: null,
394
+ exhausted_at: null, last_outcome: null }
395
+ : {
396
+ incident_id: ulid(), fallen_session_id: fallenId, launched_session_id: null, attempts: 1, last_attempt_at: at,
397
+ last_error: null, exhausted_at: null, recovered_at: null, last_outcome: null,
398
+ };
399
+ this.persist(() => {
400
+ this.db.prepare(`INSERT INTO node_keep_alive_budget
401
+ (node_id, incident_id, fallen_session_id, launched_session_id, attempts, last_attempt_at, last_error, exhausted_at,
402
+ recovered_at, last_outcome, updated_at)
403
+ VALUES (?, ?, ?, ?, ?, ?, ?, NULL, NULL, NULL, ?)
404
+ ON CONFLICT(node_id) DO UPDATE SET incident_id = excluded.incident_id, fallen_session_id = excluded.fallen_session_id,
405
+ launched_session_id = excluded.launched_session_id, attempts = excluded.attempts, last_attempt_at = excluded.last_attempt_at,
406
+ last_error = excluded.last_error, exhausted_at = NULL, recovered_at = NULL, last_outcome = NULL,
407
+ updated_at = excluded.updated_at`).run(seat.nodeId, next.incident_id, next.fallen_session_id, next.launched_session_id, next.attempts, at, next.last_error, at);
408
+ return { type: "seat.keep_alive.attempted", rigId: seat.rigId, nodeId: seat.nodeId, logicalId: seat.logicalId,
409
+ incidentId: next.incident_id, attempts: next.attempts };
410
+ });
411
+ return next;
412
+ }
413
+ /** Put back what an attempt that started nothing replaced. Only that attempt's own write is undone (the row still
414
+ * holds its incident, count and time); the attempted event stays, as it was emitted. */
415
+ revertAttempt(seat, before, attempt) {
416
+ const match = "node_id = ? AND incident_id = ? AND attempts = ? AND last_attempt_at = ?";
417
+ const keys = [seat.nodeId, attempt.incident_id, attempt.attempts, attempt.last_attempt_at];
418
+ if (!before || before.incident_id !== attempt.incident_id) {
419
+ this.db.prepare(`DELETE FROM node_keep_alive_budget WHERE ${match}`).run(...keys);
420
+ return;
421
+ }
422
+ this.db.prepare(`UPDATE node_keep_alive_budget SET fallen_session_id = ?, launched_session_id = ?, attempts = ?, last_attempt_at = ?,
423
+ last_error = ?, exhausted_at = ?, recovered_at = ?, last_outcome = ?, updated_at = ?
424
+ WHERE ${match}`).run(before.fallen_session_id, before.launched_session_id, before.attempts, before.last_attempt_at, before.last_error, before.exhausted_at, before.recovered_at, before.last_outcome, this.now().toISOString(), ...keys);
425
+ }
426
+ markRecovered(seat, budget, sessionId, status) {
427
+ const at = this.now().toISOString();
428
+ this.persist(() => {
429
+ this.db.prepare(`UPDATE node_keep_alive_budget SET recovered_at = ?, launched_session_id = ?, last_error = NULL, last_outcome = 'recovered',
430
+ updated_at = ? WHERE node_id = ? AND incident_id = ?`).run(at, sessionId, at, seat.nodeId, budget.incident_id);
431
+ return { type: "seat.keep_alive.recovered", rigId: seat.rigId, nodeId: seat.nodeId, logicalId: seat.logicalId,
432
+ incidentId: budget.incident_id, attempts: budget.attempts, status };
433
+ });
434
+ }
435
+ /** The incident waits for a person: marked once, with its event; later calls change nothing. A session the launch
436
+ * left behind is recorded as the incident's in the same write, so it is never taken for a person's start. */
437
+ markExhausted(seat, budget, status, error) {
438
+ const at = this.now().toISOString();
439
+ const after = this.latestSession(seat.nodeId);
440
+ const launchedId = after && after.id !== budget.fallen_session_id ? after.id : budget.launched_session_id;
441
+ this.persist(() => {
442
+ const changed = this.db.prepare(`UPDATE node_keep_alive_budget SET exhausted_at = ?, last_error = ?, launched_session_id = ?, last_outcome = 'exhausted',
443
+ updated_at = ? WHERE node_id = ? AND incident_id = ? AND exhausted_at IS NULL`).run(at, error, launchedId, at, seat.nodeId, budget.incident_id).changes;
444
+ if (!changed)
445
+ return null;
446
+ return { type: "seat.keep_alive.exhausted", rigId: seat.rigId, nodeId: seat.nodeId, logicalId: seat.logicalId,
447
+ incidentId: budget.incident_id, attempts: budget.attempts, ...(status ? { status } : {}), lastError: error };
448
+ });
449
+ }
450
+ /** Whether the incident's recovered session, which this tick sees running, has run for the stable period since it
451
+ * recovered. Only a tick that sees it running ends the incident, so a daemon restart alone never makes a recovery
452
+ * stable: a recovered seat that falls before a tick has seen that keeps its incident. */
453
+ ranStable(budget) {
454
+ return !!budget.recovered_at && this.now().getTime() - Date.parse(budget.recovered_at) >= this.stableMs;
455
+ }
456
+ endIncident(nodeId) {
457
+ this.db.prepare("DELETE FROM node_keep_alive_budget WHERE node_id = ?").run(nodeId);
458
+ }
459
+ /** Run the writes and persist the event they return in one transaction, then notify subscribers. */
460
+ persist(write) {
461
+ const persisted = this.db.transaction(() => {
462
+ const event = write();
463
+ return event ? this.eventBus.persistWithinTransaction(event) : null;
464
+ })();
465
+ if (persisted)
466
+ this.eventBus.notifySubscribers(persisted);
467
+ }
468
+ restoreInProgress(rigId) {
469
+ return automaticRestoreInProgress(this.db, rigId) || (this.restoreOrchestrator.restoreInProgress?.(rigId) ?? false);
470
+ }
471
+ latestSession(nodeId) {
472
+ this.sessionsHaveStopAttempt ??= this.db.prepare("PRAGMA table_info(sessions)").all()
473
+ .some((column) => column.name === "stop_attempt");
474
+ return this.db.prepare(`SELECT id, session_name, status, origin, intentionally_stopped AS flag,
475
+ ${this.sessionsHaveStopAttempt ? "stop_attempt" : "NULL AS stop_attempt"}, created_at, startup_status
476
+ FROM sessions WHERE node_id = ? ORDER BY created_at DESC, id DESC LIMIT 1`).get(nodeId) ?? null;
477
+ }
478
+ /** The seat's claimed sessions, released ones included. Each is its owner's: its tmux session may run on under its
479
+ * owner, and it says nothing about this seat's own. */
480
+ claimedSessions(nodeId) {
481
+ const rows = this.db.prepare("SELECT id FROM sessions WHERE node_id = ? AND origin = 'claimed'").all(nodeId);
482
+ return new Set(rows.map((row) => row.id));
483
+ }
484
+ attachedFromOutside(nodeId) {
485
+ const binding = this.db.prepare("SELECT attachment_type FROM bindings WHERE node_id = ?").get(nodeId);
486
+ return seatProcessOwner(resolveSeatKind(binding?.attachment_type)) === "external";
487
+ }
488
+ readBudget(nodeId) {
489
+ return this.db.prepare(`SELECT incident_id, fallen_session_id, launched_session_id, attempts, last_attempt_at, last_error, exhausted_at, recovered_at,
490
+ last_outcome
491
+ FROM node_keep_alive_budget WHERE node_id = ?`).get(nodeId) ?? null;
492
+ }
493
+ }
494
+ /** #2940: an automatic restore at daemon start is not a person's start. The session it launches for a seat in a
495
+ * keep_alive incident becomes the incident's (`adopted`), so the budget carries on: an open incident takes it as its
496
+ * recovery once its harness's startup has completed, and an exhausted one keeps waiting for a person until a tick has
497
+ * seen that session run, started, for the stable period, which ends the incident. Either way the stable period counts
498
+ * from a tick that sees it running with its harness started. Called as the restore registers each session, its
499
+ * recipe-backed fresh replacement's included, so the last one registered is the incident's; never throws, so it can't
500
+ * fail a restore. */
501
+ export function keepAliveIncidentAdopts(db, nodeId, sessionId, now = new Date()) {
502
+ try {
503
+ db.prepare(`UPDATE node_keep_alive_budget SET launched_session_id = ?, last_outcome = 'adopted', recovered_at = NULL, updated_at = ?
504
+ WHERE node_id = ?`).run(sessionId, now.toISOString(), nodeId);
505
+ }
506
+ catch {
507
+ // A database without the budget table has no incident to keep.
508
+ }
509
+ }
510
+ /** Whether a session belongs to the budget's incident: the one that fell, or one a recovery launched. */
511
+ function inIncident(sessionId, budget) {
512
+ return sessionId === budget.fallen_session_id || sessionId === budget.launched_session_id;
513
+ }
514
+ /** Whether a session unknown to the incident is its last launch's own, cut off before the outcome was written: that
515
+ * outcome is still unwritten and the session was created when the attempt began or later (to the second, the
516
+ * precision of a session's creation time). */
517
+ function launchOutcomeLost(budget, session) {
518
+ if (budget.last_outcome !== null || budget.exhausted_at || budget.attempts < 1 || !budget.last_attempt_at)
519
+ return false;
520
+ const created = Date.parse(/(?:[zZ]|[+-]\d\d:?\d\d)$/.test(session.created_at) ? session.created_at : `${session.created_at.replace(" ", "T")}Z`);
521
+ return Number.isFinite(created) && created >= Math.floor(Date.parse(budget.last_attempt_at) / 1000) * 1000;
522
+ }
523
+ //# sourceMappingURL=keep-alive-supervisor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keep-alive-supervisor.js","sourceRoot":"","sources":["../../src/domain/keep-alive-supervisor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,OAAO,EAAE,qBAAqB,EAA2B,MAAM,2BAA2B,CAAC;AAE3F,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,O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AI,EAAE;IAChH,IAAI,CAAC;QACH,EAAE,CAAC,OAAO,CACR;yBACmB,CACpB,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,+DAA+D;IACjE,CAAC;AACH,CAAC;AAED,yGAAyG;AACzG,SAAS,UAAU,CAAC,SAAiB,EAAE,MAAc;IACnD,OAAO,SAAS,KAAK,MAAM,CAAC,iBAAiB,IAAI,SAAS,KAAK,MAAM,CAAC,mBAAmB,CAAC;AAC5F,CAAC;AAED;;+CAE+C;AAC/C,SAAS,iBAAiB,CAAC,MAAc,EAAE,OAAsB;IAC/D,IAAI,MAAM,CAAC,YAAY,KAAK,IAAI,IAAI,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe;QAAE,OAAO,KAAK,CAAC;IACxH,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IAClJ,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;AAC7G,CAAC"}
@@ -13,6 +13,24 @@ export type RestoreReadPolicy = Pick<RestoreReadContext, "extraInstructionFile"
13
13
  /** The configured extra instruction file as the restore request names it: trimmed, or none when blank. The enforcer's
14
14
  * resolver reads the setting through this too, so the grant and the request name the same file. */
15
15
  export declare function postCompactExtraSetting(value: string | null | undefined): string | null;
16
+ /** Where Claude's PreCompact hook writes restore packets: the OpenRig home's runtime folder, created owner-only.
17
+ * OPENRIG_COMPACTION_OUT_ROOT overrides it. The read grant and the enforcer's restore request name it through this, and a
18
+ * launch whose grant covers it hands it to the seat's hooks in OPENRIG_COMPACTION_PACKET_ROOT. */
19
+ export declare function compactionPacketRoot(openrigHome: string): string;
20
+ /** The launch variable that names the packet folder a seat's launch grants it reads in. `restore-from-jsonl.mjs` writes
21
+ * the seat's packets there. A seat without it (launched before packets moved into the OpenRig home, or with no packet
22
+ * grant) gets them beside its restore maps in its launch project, which it reads without a grant. It's set by the
23
+ * launch, not a setting, and its value is absolute, so the seat writes where the grant names whatever its working
24
+ * directory. */
25
+ export declare const COMPACTION_PACKET_ROOT_ENV = "OPENRIG_COMPACTION_PACKET_ROOT";
26
+ /** The packet variable for a launch whose one --settings value, as sent, grants this conversation's packet files in the
27
+ * packet folder at every spelling; otherwise none. Read from the arguments actually sent: a relaunch that keeps the
28
+ * running Claude's arguments keeps that Claude's grant, which may predate the folder. A --settings file reads as no
29
+ * grant, so that seat gets its packets in its launch project, which needs none. */
30
+ export declare function compactionPacketLaunchEnv(args: readonly string[], context: {
31
+ openrigHome: string | null | undefined;
32
+ nativeSessionId: string;
33
+ }): Record<string, string>;
16
34
  /** Merge seat-local restore reads into the launch's ONE settings value. Native
17
35
  * deny/ask rules still win; nothing is written to shared project/user settings.
18
36
  * Arbitrary operator-selected sources keep their ordinary permission checks. */
@@ -1 +1 @@
1
- {"version":3,"file":"managed-restore-read-access.d.ts","sourceRoot":"","sources":["../../src/domain/managed-restore-read-access.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,MAAM,CAAC;IACxB,6HAA6H;IAC7H,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,4GAA4G;IAC5G,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,+FAA+F;AAC/F,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,kBAAkB,EAAE,sBAAsB,GAAG,iBAAiB,CAAC,CAAC;AAErG;oGACoG;AACpG,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAEvF;AA2BD;;gFAEgF;AAChF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAmC7F"}
1
+ {"version":3,"file":"managed-restore-read-access.d.ts","sourceRoot":"","sources":["../../src/domain/managed-restore-read-access.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,MAAM,CAAC;IACxB,6HAA6H;IAC7H,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,4GAA4G;IAC5G,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,+FAA+F;AAC/F,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,kBAAkB,EAAE,sBAAsB,GAAG,iBAAiB,CAAC,CAAC;AAErG;oGACoG;AACpG,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAEvF;AAED;;mGAEmG;AACnG,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;;iBAIiB;AACjB,eAAO,MAAM,0BAA0B,mCAAmC,CAAC;AAE3E;;;oFAGoF;AACpF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE;IAAE,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWvK;AAgCD;;gFAEgF;AAChF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAoC7F"}