@openrig/cli 0.7.0 → 0.7.2

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 (1379) hide show
  1. package/README.md +9 -8
  2. package/daemon/assets/claude-statusline-context.cjs +13 -3
  3. package/daemon/assets/guidance/openrig-seat-skills.md +1 -0
  4. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
  5. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
  6. package/daemon/assets/plugins/openrig-core/hooks/claude.json +11 -11
  7. package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +9 -8
  8. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus-health.cjs +2 -2
  9. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +9 -6
  10. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +1 -1
  11. package/daemon/assets/plugins/openrig-core/skills/delegating-work/SKILL.md +1 -1
  12. package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +13 -8
  13. package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +19 -4
  14. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +254 -52
  15. package/daemon/assets/skills/rigs/SKILL.md +42 -10
  16. package/daemon/context-packs/help/help.md +6 -0
  17. package/daemon/context-packs/help/manifest.yaml +1 -1
  18. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  19. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +271 -38
  20. package/daemon/context-packs/reference/acp-agents.md +77 -0
  21. package/daemon/context-packs/reference/getting-started.md +145 -14
  22. package/daemon/context-packs/reference/manifest.yaml +6 -3
  23. package/daemon/context-packs/reference/rig-spec.md +175 -5
  24. package/daemon/context-packs/reference/whats-new.md +275 -113
  25. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  26. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  27. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  28. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  29. package/daemon/context-packs/skills/claude-compaction-restore/scripts/precompact-hook.mjs +1 -1
  30. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  31. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  33. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  34. package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +19 -4
  35. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  36. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  37. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  38. package/daemon/context-packs/skills/core/openrig-herdr/SKILL.md +18 -3
  39. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  40. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/core/openrig-software-factory/references/worked-example.md +2 -2
  43. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  46. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/delegating-work/SKILL.md +1 -1
  51. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/forming-an-openrig-mental-model/SKILL.md +13 -8
  53. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  54. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  56. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/openrig-user/SKILL.md +254 -52
  58. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  66. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  68. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/process/agent-browser/LICENSE.txt +201 -0
  72. package/daemon/context-packs/skills/process/agent-browser/OPENRIG.md +13 -29
  73. package/daemon/context-packs/skills/process/agent-browser/SKILL.md +7 -7
  74. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +3 -1
  75. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  76. package/daemon/context-packs/skills/process/dogfood/LICENSE.txt +201 -0
  77. package/daemon/context-packs/skills/process/dogfood/SKILL.md +6 -2
  78. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +3 -1
  79. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  80. package/daemon/context-packs/skills/process/systematic-debugging/LICENSE.txt +21 -0
  81. package/daemon/context-packs/skills/process/systematic-debugging/SKILL.md +6 -2
  82. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +3 -1
  83. package/daemon/context-packs/skills/process/test-driven-development/LICENSE.txt +21 -0
  84. package/daemon/context-packs/skills/process/test-driven-development/SKILL.md +5 -1
  85. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +3 -1
  86. package/daemon/context-packs/skills/process/verification-before-completion/LICENSE.txt +21 -0
  87. package/daemon/context-packs/skills/process/verification-before-completion/SKILL.md +5 -1
  88. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +3 -1
  89. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  90. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  91. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  92. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  93. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  94. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  95. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  96. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  97. package/daemon/dist/adapters/claude-code-adapter.d.ts +4 -0
  98. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  99. package/daemon/dist/adapters/claude-code-adapter.js +138 -41
  100. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  101. package/daemon/dist/adapters/claude-resume.d.ts +9 -1
  102. package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
  103. package/daemon/dist/adapters/claude-resume.js +37 -11
  104. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  105. package/daemon/dist/adapters/codex-resume.d.ts +10 -4
  106. package/daemon/dist/adapters/codex-resume.d.ts.map +1 -1
  107. package/daemon/dist/adapters/codex-resume.js +59 -14
  108. package/daemon/dist/adapters/codex-resume.js.map +1 -1
  109. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +54 -16
  110. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  111. package/daemon/dist/adapters/codex-runtime-adapter.js +664 -117
  112. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  113. package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts +25 -2
  114. package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
  115. package/daemon/dist/adapters/community-harness-runtime-adapter.js +122 -9
  116. package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
  117. package/daemon/dist/adapters/compose-services-adapter.d.ts +16 -0
  118. package/daemon/dist/adapters/compose-services-adapter.d.ts.map +1 -1
  119. package/daemon/dist/adapters/compose-services-adapter.js +46 -2
  120. package/daemon/dist/adapters/compose-services-adapter.js.map +1 -1
  121. package/daemon/dist/adapters/kernel-authority.d.ts +1 -1
  122. package/daemon/dist/adapters/kernel-authority.d.ts.map +1 -1
  123. package/daemon/dist/adapters/kernel-authority.js +13 -2
  124. package/daemon/dist/adapters/kernel-authority.js.map +1 -1
  125. package/daemon/dist/adapters/pi-runner.d.ts +11 -0
  126. package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
  127. package/daemon/dist/adapters/pi-runner.js +81 -31
  128. package/daemon/dist/adapters/pi-runner.js.map +1 -1
  129. package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
  130. package/daemon/dist/adapters/pi-runtime-adapter.js +9 -6
  131. package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
  132. package/daemon/dist/adapters/stub-runtime-adapter.d.ts.map +1 -1
  133. package/daemon/dist/adapters/stub-runtime-adapter.js +9 -5
  134. package/daemon/dist/adapters/stub-runtime-adapter.js.map +1 -1
  135. package/daemon/dist/adapters/tmux-server.d.ts +3 -0
  136. package/daemon/dist/adapters/tmux-server.d.ts.map +1 -1
  137. package/daemon/dist/adapters/tmux-server.js +11 -2
  138. package/daemon/dist/adapters/tmux-server.js.map +1 -1
  139. package/daemon/dist/adapters/tmux.d.ts +53 -4
  140. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  141. package/daemon/dist/adapters/tmux.js +225 -40
  142. package/daemon/dist/adapters/tmux.js.map +1 -1
  143. package/daemon/dist/adapters/yolo-mode.d.ts +7 -0
  144. package/daemon/dist/adapters/yolo-mode.d.ts.map +1 -1
  145. package/daemon/dist/adapters/yolo-mode.js +8 -0
  146. package/daemon/dist/adapters/yolo-mode.js.map +1 -1
  147. package/daemon/dist/attention-surface.d.ts +14 -0
  148. package/daemon/dist/attention-surface.d.ts.map +1 -1
  149. package/daemon/dist/attention-surface.js.map +1 -1
  150. package/daemon/dist/build-info.js +3 -3
  151. package/daemon/dist/codex-auth-surface.d.ts +2 -0
  152. package/daemon/dist/codex-auth-surface.d.ts.map +1 -0
  153. package/daemon/dist/codex-auth-surface.js +2 -0
  154. package/daemon/dist/codex-auth-surface.js.map +1 -0
  155. package/daemon/dist/daemon-db-path.d.ts +6 -0
  156. package/daemon/dist/daemon-db-path.d.ts.map +1 -1
  157. package/daemon/dist/daemon-db-path.js +98 -1
  158. package/daemon/dist/daemon-db-path.js.map +1 -1
  159. package/daemon/dist/daemon-shutdown.d.ts.map +1 -1
  160. package/daemon/dist/daemon-shutdown.js +4 -2
  161. package/daemon/dist/daemon-shutdown.js.map +1 -1
  162. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  163. package/daemon/dist/db/all-migrations.js +28 -0
  164. package/daemon/dist/db/all-migrations.js.map +1 -1
  165. package/daemon/dist/db/migrations/124_context_usage_watchdog_units.d.ts +4 -0
  166. package/daemon/dist/db/migrations/124_context_usage_watchdog_units.d.ts.map +1 -0
  167. package/daemon/dist/db/migrations/124_context_usage_watchdog_units.js +9 -0
  168. package/daemon/dist/db/migrations/124_context_usage_watchdog_units.js.map +1 -0
  169. package/daemon/dist/db/migrations/125_node_advisor.d.ts +3 -0
  170. package/daemon/dist/db/migrations/125_node_advisor.d.ts.map +1 -0
  171. package/daemon/dist/db/migrations/125_node_advisor.js +8 -0
  172. package/daemon/dist/db/migrations/125_node_advisor.js.map +1 -0
  173. package/daemon/dist/db/migrations/127_operation_correlation.d.ts +3 -0
  174. package/daemon/dist/db/migrations/127_operation_correlation.d.ts.map +1 -0
  175. package/daemon/dist/db/migrations/127_operation_correlation.js +10 -0
  176. package/daemon/dist/db/migrations/127_operation_correlation.js.map +1 -0
  177. package/daemon/dist/db/migrations/128_terminal_policy.d.ts +3 -0
  178. package/daemon/dist/db/migrations/128_terminal_policy.d.ts.map +1 -0
  179. package/daemon/dist/db/migrations/128_terminal_policy.js +37 -0
  180. package/daemon/dist/db/migrations/128_terminal_policy.js.map +1 -0
  181. package/daemon/dist/db/migrations/129_stream_dispositions.d.ts +10 -0
  182. package/daemon/dist/db/migrations/129_stream_dispositions.d.ts.map +1 -0
  183. package/daemon/dist/db/migrations/129_stream_dispositions.js +35 -0
  184. package/daemon/dist/db/migrations/129_stream_dispositions.js.map +1 -0
  185. package/daemon/dist/db/migrations/130_stream_subscriptions.d.ts +11 -0
  186. package/daemon/dist/db/migrations/130_stream_subscriptions.d.ts.map +1 -0
  187. package/daemon/dist/db/migrations/130_stream_subscriptions.js +33 -0
  188. package/daemon/dist/db/migrations/130_stream_subscriptions.js.map +1 -0
  189. package/daemon/dist/db/migrations/131_stream_retention_floor.d.ts +8 -0
  190. package/daemon/dist/db/migrations/131_stream_retention_floor.d.ts.map +1 -0
  191. package/daemon/dist/db/migrations/131_stream_retention_floor.js +20 -0
  192. package/daemon/dist/db/migrations/131_stream_retention_floor.js.map +1 -0
  193. package/daemon/dist/db/migrations/132_seat_runtime_switches.d.ts +10 -0
  194. package/daemon/dist/db/migrations/132_seat_runtime_switches.d.ts.map +1 -0
  195. package/daemon/dist/db/migrations/132_seat_runtime_switches.js +46 -0
  196. package/daemon/dist/db/migrations/132_seat_runtime_switches.js.map +1 -0
  197. package/daemon/dist/db/migrations/133_stream_reader_actions.d.ts +8 -0
  198. package/daemon/dist/db/migrations/133_stream_reader_actions.d.ts.map +1 -0
  199. package/daemon/dist/db/migrations/133_stream_reader_actions.js +25 -0
  200. package/daemon/dist/db/migrations/133_stream_reader_actions.js.map +1 -0
  201. package/daemon/dist/db/migrations/134_claude_token_readings.d.ts +3 -0
  202. package/daemon/dist/db/migrations/134_claude_token_readings.d.ts.map +1 -0
  203. package/daemon/dist/db/migrations/134_claude_token_readings.js +21 -0
  204. package/daemon/dist/db/migrations/134_claude_token_readings.js.map +1 -0
  205. package/daemon/dist/db/migrations/135_seat_identity_process_evidence.d.ts +3 -0
  206. package/daemon/dist/db/migrations/135_seat_identity_process_evidence.d.ts.map +1 -0
  207. package/daemon/dist/db/migrations/135_seat_identity_process_evidence.js +16 -0
  208. package/daemon/dist/db/migrations/135_seat_identity_process_evidence.js.map +1 -0
  209. package/daemon/dist/db/migrations/136_node_launch_recipe.d.ts +9 -0
  210. package/daemon/dist/db/migrations/136_node_launch_recipe.d.ts.map +1 -0
  211. package/daemon/dist/db/migrations/136_node_launch_recipe.js +11 -0
  212. package/daemon/dist/db/migrations/136_node_launch_recipe.js.map +1 -0
  213. package/daemon/dist/db/migrations/138_node_claude_token_ref.d.ts +3 -0
  214. package/daemon/dist/db/migrations/138_node_claude_token_ref.d.ts.map +1 -0
  215. package/daemon/dist/db/migrations/138_node_claude_token_ref.js +8 -0
  216. package/daemon/dist/db/migrations/138_node_claude_token_ref.js.map +1 -0
  217. package/daemon/dist/db/migrations/139_node_claude_permissions.d.ts +3 -0
  218. package/daemon/dist/db/migrations/139_node_claude_permissions.d.ts.map +1 -0
  219. package/daemon/dist/db/migrations/139_node_claude_permissions.js +5 -0
  220. package/daemon/dist/db/migrations/139_node_claude_permissions.js.map +1 -0
  221. package/daemon/dist/domain/active-occupant.d.ts +3 -0
  222. package/daemon/dist/domain/active-occupant.d.ts.map +1 -1
  223. package/daemon/dist/domain/active-occupant.js +6 -2
  224. package/daemon/dist/domain/active-occupant.js.map +1 -1
  225. package/daemon/dist/domain/activity-taxonomy.d.ts +3 -0
  226. package/daemon/dist/domain/activity-taxonomy.d.ts.map +1 -1
  227. package/daemon/dist/domain/activity-taxonomy.js.map +1 -1
  228. package/daemon/dist/domain/agent-activity-store.d.ts +6 -2
  229. package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
  230. package/daemon/dist/domain/agent-activity-store.js +13 -4
  231. package/daemon/dist/domain/agent-activity-store.js.map +1 -1
  232. package/daemon/dist/domain/agent-manifest.d.ts.map +1 -1
  233. package/daemon/dist/domain/agent-manifest.js +14 -2
  234. package/daemon/dist/domain/agent-manifest.js.map +1 -1
  235. package/daemon/dist/domain/bootstrap-orchestrator.d.ts +3 -0
  236. package/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
  237. package/daemon/dist/domain/bootstrap-orchestrator.js +35 -6
  238. package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
  239. package/daemon/dist/domain/builtin-startup-files.d.ts.map +1 -1
  240. package/daemon/dist/domain/builtin-startup-files.js +2 -0
  241. package/daemon/dist/domain/builtin-startup-files.js.map +1 -1
  242. package/daemon/dist/domain/bundle-behaviour.d.ts.map +1 -1
  243. package/daemon/dist/domain/bundle-behaviour.js +28 -1
  244. package/daemon/dist/domain/bundle-behaviour.js.map +1 -1
  245. package/daemon/dist/domain/claim-service.d.ts +19 -1
  246. package/daemon/dist/domain/claim-service.d.ts.map +1 -1
  247. package/daemon/dist/domain/claim-service.js +68 -20
  248. package/daemon/dist/domain/claim-service.js.map +1 -1
  249. package/daemon/dist/domain/classification-attempts.d.ts +4 -1
  250. package/daemon/dist/domain/classification-attempts.d.ts.map +1 -1
  251. package/daemon/dist/domain/classification-attempts.js +10 -1
  252. package/daemon/dist/domain/classification-attempts.js.map +1 -1
  253. package/daemon/dist/domain/classification-sources.d.ts +38 -0
  254. package/daemon/dist/domain/classification-sources.d.ts.map +1 -1
  255. package/daemon/dist/domain/classification-sources.js +24 -1
  256. package/daemon/dist/domain/classification-sources.js.map +1 -1
  257. package/daemon/dist/domain/claude-activity-hooks.d.ts +2 -2
  258. package/daemon/dist/domain/claude-activity-hooks.d.ts.map +1 -1
  259. package/daemon/dist/domain/claude-activity-hooks.js +8 -7
  260. package/daemon/dist/domain/claude-activity-hooks.js.map +1 -1
  261. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +133 -8
  262. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  263. package/daemon/dist/domain/claude-compaction-enforcer.js +513 -64
  264. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  265. package/daemon/dist/domain/claude-core-plugin-env.d.ts +4 -1
  266. package/daemon/dist/domain/claude-core-plugin-env.d.ts.map +1 -1
  267. package/daemon/dist/domain/claude-core-plugin-env.js +23 -12
  268. package/daemon/dist/domain/claude-core-plugin-env.js.map +1 -1
  269. package/daemon/dist/domain/claude-credential-precedence.d.ts +33 -0
  270. package/daemon/dist/domain/claude-credential-precedence.d.ts.map +1 -0
  271. package/daemon/dist/domain/claude-credential-precedence.js +62 -0
  272. package/daemon/dist/domain/claude-credential-precedence.js.map +1 -0
  273. package/daemon/dist/domain/claude-managed-launch.d.ts +44 -5
  274. package/daemon/dist/domain/claude-managed-launch.d.ts.map +1 -1
  275. package/daemon/dist/domain/claude-managed-launch.js +159 -39
  276. package/daemon/dist/domain/claude-managed-launch.js.map +1 -1
  277. package/daemon/dist/domain/claude-permission-rules.d.ts +10 -0
  278. package/daemon/dist/domain/claude-permission-rules.d.ts.map +1 -0
  279. package/daemon/dist/domain/claude-permission-rules.js +41 -0
  280. package/daemon/dist/domain/claude-permission-rules.js.map +1 -0
  281. package/daemon/dist/domain/claude-seat-token.d.ts +30 -0
  282. package/daemon/dist/domain/claude-seat-token.d.ts.map +1 -0
  283. package/daemon/dist/domain/claude-seat-token.js +78 -0
  284. package/daemon/dist/domain/claude-seat-token.js.map +1 -0
  285. package/daemon/dist/domain/codex-auth.d.ts +148 -0
  286. package/daemon/dist/domain/codex-auth.d.ts.map +1 -0
  287. package/daemon/dist/domain/codex-auth.js +506 -0
  288. package/daemon/dist/domain/codex-auth.js.map +1 -0
  289. package/daemon/dist/domain/codex-daemon-support.d.ts +2 -1
  290. package/daemon/dist/domain/codex-daemon-support.d.ts.map +1 -1
  291. package/daemon/dist/domain/codex-daemon-support.js +3 -2
  292. package/daemon/dist/domain/codex-daemon-support.js.map +1 -1
  293. package/daemon/dist/domain/codex-git-add-dirs.d.ts +1 -1
  294. package/daemon/dist/domain/codex-git-add-dirs.d.ts.map +1 -1
  295. package/daemon/dist/domain/codex-network-default.d.ts +2 -1
  296. package/daemon/dist/domain/codex-network-default.d.ts.map +1 -1
  297. package/daemon/dist/domain/codex-network-default.js +3 -2
  298. package/daemon/dist/domain/codex-network-default.js.map +1 -1
  299. package/daemon/dist/domain/codex-owned-plugin-trust.d.ts +26 -0
  300. package/daemon/dist/domain/codex-owned-plugin-trust.d.ts.map +1 -0
  301. package/daemon/dist/domain/codex-owned-plugin-trust.js +187 -0
  302. package/daemon/dist/domain/codex-owned-plugin-trust.js.map +1 -0
  303. package/daemon/dist/domain/codex-rebuild-permissions.d.ts +54 -0
  304. package/daemon/dist/domain/codex-rebuild-permissions.d.ts.map +1 -0
  305. package/daemon/dist/domain/codex-rebuild-permissions.js +134 -0
  306. package/daemon/dist/domain/codex-rebuild-permissions.js.map +1 -0
  307. package/daemon/dist/domain/codex-team-workspace.d.ts +5 -0
  308. package/daemon/dist/domain/codex-team-workspace.d.ts.map +1 -1
  309. package/daemon/dist/domain/codex-team-workspace.js +37 -0
  310. package/daemon/dist/domain/codex-team-workspace.js.map +1 -1
  311. package/daemon/dist/domain/community-harness-first-input.d.ts +7 -0
  312. package/daemon/dist/domain/community-harness-first-input.d.ts.map +1 -0
  313. package/daemon/dist/domain/community-harness-first-input.js +16 -0
  314. package/daemon/dist/domain/community-harness-first-input.js.map +1 -0
  315. package/daemon/dist/domain/community-harness-launch-result.d.ts +33 -0
  316. package/daemon/dist/domain/community-harness-launch-result.d.ts.map +1 -0
  317. package/daemon/dist/domain/community-harness-launch-result.js +93 -0
  318. package/daemon/dist/domain/community-harness-launch-result.js.map +1 -0
  319. package/daemon/dist/domain/community-harness-presets.d.ts +29 -2
  320. package/daemon/dist/domain/community-harness-presets.d.ts.map +1 -1
  321. package/daemon/dist/domain/community-harness-presets.js +51 -5
  322. package/daemon/dist/domain/community-harness-presets.js.map +1 -1
  323. package/daemon/dist/domain/compaction-restore-notice.d.ts +6 -0
  324. package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -0
  325. package/daemon/dist/domain/compaction-restore-notice.js +27 -0
  326. package/daemon/dist/domain/compaction-restore-notice.js.map +1 -0
  327. package/daemon/dist/domain/composer-prompts.d.ts +5 -2
  328. package/daemon/dist/domain/composer-prompts.d.ts.map +1 -1
  329. package/daemon/dist/domain/composer-prompts.js +2 -2
  330. package/daemon/dist/domain/composer-prompts.js.map +1 -1
  331. package/daemon/dist/domain/context-monitor.d.ts.map +1 -1
  332. package/daemon/dist/domain/context-monitor.js +2 -1
  333. package/daemon/dist/domain/context-monitor.js.map +1 -1
  334. package/daemon/dist/domain/context-packs/seat-recap-store.d.ts +14 -0
  335. package/daemon/dist/domain/context-packs/seat-recap-store.d.ts.map +1 -1
  336. package/daemon/dist/domain/context-packs/seat-recap-store.js +57 -1
  337. package/daemon/dist/domain/context-packs/seat-recap-store.js.map +1 -1
  338. package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
  339. package/daemon/dist/domain/context-usage-store.js +6 -1
  340. package/daemon/dist/domain/context-usage-store.js.map +1 -1
  341. package/daemon/dist/domain/continuity-policy-materializer.d.ts +1 -0
  342. package/daemon/dist/domain/continuity-policy-materializer.d.ts.map +1 -1
  343. package/daemon/dist/domain/continuity-policy-materializer.js +2 -0
  344. package/daemon/dist/domain/continuity-policy-materializer.js.map +1 -1
  345. package/daemon/dist/domain/current-work.d.ts +15 -4
  346. package/daemon/dist/domain/current-work.d.ts.map +1 -1
  347. package/daemon/dist/domain/current-work.js +26 -13
  348. package/daemon/dist/domain/current-work.js.map +1 -1
  349. package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
  350. package/daemon/dist/domain/draft-aware-delivery.js +1 -1
  351. package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
  352. package/daemon/dist/domain/execution-view.d.ts.map +1 -1
  353. package/daemon/dist/domain/execution-view.js +12 -8
  354. package/daemon/dist/domain/execution-view.js.map +1 -1
  355. package/daemon/dist/domain/footprint-choice.d.ts +41 -0
  356. package/daemon/dist/domain/footprint-choice.d.ts.map +1 -0
  357. package/daemon/dist/domain/footprint-choice.js +42 -0
  358. package/daemon/dist/domain/footprint-choice.js.map +1 -0
  359. package/daemon/dist/domain/gateway/delivery-rules-engine.d.ts +3 -0
  360. package/daemon/dist/domain/gateway/delivery-rules-engine.d.ts.map +1 -1
  361. package/daemon/dist/domain/gateway/delivery-rules-engine.js +1 -1
  362. package/daemon/dist/domain/gateway/delivery-rules-engine.js.map +1 -1
  363. package/daemon/dist/domain/gateway/human-registry.d.ts +32 -0
  364. package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
  365. package/daemon/dist/domain/gateway/human-registry.js +71 -4
  366. package/daemon/dist/domain/gateway/human-registry.js.map +1 -1
  367. package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
  368. package/daemon/dist/domain/gateway/operator-delivery-engine.js +3 -1
  369. package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
  370. package/daemon/dist/domain/gateway/slack/inbound.d.ts +1 -0
  371. package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
  372. package/daemon/dist/domain/gateway/slack/inbound.js +58 -9
  373. package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
  374. package/daemon/dist/domain/gateway/slack/message.d.ts +6 -1
  375. package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
  376. package/daemon/dist/domain/gateway/slack/message.js +15 -6
  377. package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
  378. package/daemon/dist/domain/gateway/slack/queue-access.d.ts +7 -0
  379. package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
  380. package/daemon/dist/domain/gateway/slack/queue-access.js +14 -2
  381. package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
  382. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +1 -3
  383. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
  384. package/daemon/dist/domain/gateway/slack/slack-delivery.js +22 -22
  385. package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
  386. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
  387. package/daemon/dist/domain/gateway/slack/slack-subsystem.js +8 -7
  388. package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
  389. package/daemon/dist/domain/generated-file-hygiene.js +1 -1
  390. package/daemon/dist/domain/generated-file-hygiene.js.map +1 -1
  391. package/daemon/dist/domain/graph-projection.d.ts +3 -0
  392. package/daemon/dist/domain/graph-projection.d.ts.map +1 -1
  393. package/daemon/dist/domain/graph-projection.js +2 -0
  394. package/daemon/dist/domain/graph-projection.js.map +1 -1
  395. package/daemon/dist/domain/health-diagnosis.d.ts.map +1 -1
  396. package/daemon/dist/domain/health-diagnosis.js +14 -6
  397. package/daemon/dist/domain/health-diagnosis.js.map +1 -1
  398. package/daemon/dist/domain/hot-potato-enforcer.d.ts +1 -1
  399. package/daemon/dist/domain/human-questions.d.ts +2 -0
  400. package/daemon/dist/domain/human-questions.d.ts.map +1 -1
  401. package/daemon/dist/domain/human-questions.js +5 -0
  402. package/daemon/dist/domain/human-questions.js.map +1 -1
  403. package/daemon/dist/domain/kernel-boot.d.ts +5 -1
  404. package/daemon/dist/domain/kernel-boot.d.ts.map +1 -1
  405. package/daemon/dist/domain/kernel-boot.js +34 -4
  406. package/daemon/dist/domain/kernel-boot.js.map +1 -1
  407. package/daemon/dist/domain/managed-blocks.d.ts +32 -1
  408. package/daemon/dist/domain/managed-blocks.d.ts.map +1 -1
  409. package/daemon/dist/domain/managed-blocks.js +109 -11
  410. package/daemon/dist/domain/managed-blocks.js.map +1 -1
  411. package/daemon/dist/domain/managed-restore-read-access.d.ts +20 -0
  412. package/daemon/dist/domain/managed-restore-read-access.d.ts.map +1 -0
  413. package/daemon/dist/domain/managed-restore-read-access.js +77 -0
  414. package/daemon/dist/domain/managed-restore-read-access.js.map +1 -0
  415. package/daemon/dist/domain/markdown-address.d.ts.map +1 -1
  416. package/daemon/dist/domain/markdown-address.js +21 -2
  417. package/daemon/dist/domain/markdown-address.js.map +1 -1
  418. package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts +1 -1
  419. package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts.map +1 -1
  420. package/daemon/dist/domain/mission-control/mission-control-action-log.js +3 -0
  421. package/daemon/dist/domain/mission-control/mission-control-action-log.js.map +1 -1
  422. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +24 -3
  423. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
  424. package/daemon/dist/domain/mission-control/mission-control-write-contract.js +121 -8
  425. package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
  426. package/daemon/dist/domain/model-divergence/current-model-reader.d.ts +2 -0
  427. package/daemon/dist/domain/model-divergence/current-model-reader.d.ts.map +1 -1
  428. package/daemon/dist/domain/model-divergence/current-model-reader.js +7 -0
  429. package/daemon/dist/domain/model-divergence/current-model-reader.js.map +1 -1
  430. package/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts +10 -1
  431. package/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts.map +1 -1
  432. package/daemon/dist/domain/model-divergence/model-divergence-monitor.js +42 -6
  433. package/daemon/dist/domain/model-divergence/model-divergence-monitor.js.map +1 -1
  434. package/daemon/dist/domain/native-permission-store.d.ts +7 -2
  435. package/daemon/dist/domain/native-permission-store.d.ts.map +1 -1
  436. package/daemon/dist/domain/native-permission-store.js +13 -8
  437. package/daemon/dist/domain/native-permission-store.js.map +1 -1
  438. package/daemon/dist/domain/native-process-lineage.d.ts +3 -0
  439. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
  440. package/daemon/dist/domain/native-process-lineage.js +60 -2
  441. package/daemon/dist/domain/native-process-lineage.js.map +1 -1
  442. package/daemon/dist/domain/native-resume-probe-evidence.d.ts +19 -0
  443. package/daemon/dist/domain/native-resume-probe-evidence.d.ts.map +1 -0
  444. package/daemon/dist/domain/native-resume-probe-evidence.js +37 -0
  445. package/daemon/dist/domain/native-resume-probe-evidence.js.map +1 -0
  446. package/daemon/dist/domain/native-resume-probe.d.ts +9 -0
  447. package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
  448. package/daemon/dist/domain/native-resume-probe.js +174 -44
  449. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  450. package/daemon/dist/domain/node-inventory.d.ts +53 -1
  451. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  452. package/daemon/dist/domain/node-inventory.js +137 -45
  453. package/daemon/dist/domain/node-inventory.js.map +1 -1
  454. package/daemon/dist/domain/node-launcher.d.ts +11 -0
  455. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  456. package/daemon/dist/domain/node-launcher.js +49 -8
  457. package/daemon/dist/domain/node-launcher.js.map +1 -1
  458. package/daemon/dist/domain/occupant-invalidator.d.ts +16 -4
  459. package/daemon/dist/domain/occupant-invalidator.d.ts.map +1 -1
  460. package/daemon/dist/domain/occupant-invalidator.js +25 -5
  461. package/daemon/dist/domain/occupant-invalidator.js.map +1 -1
  462. package/daemon/dist/domain/operation-correlation.d.ts +78 -0
  463. package/daemon/dist/domain/operation-correlation.d.ts.map +1 -0
  464. package/daemon/dist/domain/operation-correlation.js +54 -0
  465. package/daemon/dist/domain/operation-correlation.js.map +1 -0
  466. package/daemon/dist/domain/parent-session-env.d.ts +1 -1
  467. package/daemon/dist/domain/parent-session-env.d.ts.map +1 -1
  468. package/daemon/dist/domain/parent-session-env.js +3 -1
  469. package/daemon/dist/domain/parent-session-env.js.map +1 -1
  470. package/daemon/dist/domain/parked-query.d.ts +3 -0
  471. package/daemon/dist/domain/parked-query.d.ts.map +1 -1
  472. package/daemon/dist/domain/parked-query.js +1 -0
  473. package/daemon/dist/domain/parked-query.js.map +1 -1
  474. package/daemon/dist/domain/permission-account.d.ts +31 -0
  475. package/daemon/dist/domain/permission-account.d.ts.map +1 -0
  476. package/daemon/dist/domain/permission-account.js +116 -0
  477. package/daemon/dist/domain/permission-account.js.map +1 -0
  478. package/daemon/dist/domain/permission-drift.d.ts.map +1 -1
  479. package/daemon/dist/domain/permission-drift.js +11 -7
  480. package/daemon/dist/domain/permission-drift.js.map +1 -1
  481. package/daemon/dist/domain/pod-bundle-assembler.d.ts +1 -0
  482. package/daemon/dist/domain/pod-bundle-assembler.d.ts.map +1 -1
  483. package/daemon/dist/domain/pod-bundle-assembler.js +25 -0
  484. package/daemon/dist/domain/pod-bundle-assembler.js.map +1 -1
  485. package/daemon/dist/domain/policies/artifact-pool-helpers.d.ts +7 -0
  486. package/daemon/dist/domain/policies/artifact-pool-helpers.d.ts.map +1 -1
  487. package/daemon/dist/domain/policies/artifact-pool-helpers.js +8 -4
  488. package/daemon/dist/domain/policies/artifact-pool-helpers.js.map +1 -1
  489. package/daemon/dist/domain/policies/context-usage-threshold.d.ts.map +1 -1
  490. package/daemon/dist/domain/policies/context-usage-threshold.js +109 -21
  491. package/daemon/dist/domain/policies/context-usage-threshold.js.map +1 -1
  492. package/daemon/dist/domain/policies/edge-artifact-required.d.ts +6 -1
  493. package/daemon/dist/domain/policies/edge-artifact-required.d.ts.map +1 -1
  494. package/daemon/dist/domain/policies/edge-artifact-required.js +18 -13
  495. package/daemon/dist/domain/policies/edge-artifact-required.js.map +1 -1
  496. package/daemon/dist/domain/policies/mode-scheduled-end.d.ts +2 -0
  497. package/daemon/dist/domain/policies/mode-scheduled-end.d.ts.map +1 -1
  498. package/daemon/dist/domain/policies/mode-scheduled-end.js +5 -1
  499. package/daemon/dist/domain/policies/mode-scheduled-end.js.map +1 -1
  500. package/daemon/dist/domain/policies/parked-owner-consumer.d.ts +8 -0
  501. package/daemon/dist/domain/policies/parked-owner-consumer.d.ts.map +1 -1
  502. package/daemon/dist/domain/policies/parked-owner-consumer.js +15 -1
  503. package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
  504. package/daemon/dist/domain/policies/periodic-reminder.d.ts +10 -0
  505. package/daemon/dist/domain/policies/periodic-reminder.d.ts.map +1 -1
  506. package/daemon/dist/domain/policies/periodic-reminder.js +11 -6
  507. package/daemon/dist/domain/policies/periodic-reminder.js.map +1 -1
  508. package/daemon/dist/domain/policies/types.d.ts +25 -0
  509. package/daemon/dist/domain/policies/types.d.ts.map +1 -1
  510. package/daemon/dist/domain/policies/workflow-keepalive.d.ts +6 -1
  511. package/daemon/dist/domain/policies/workflow-keepalive.d.ts.map +1 -1
  512. package/daemon/dist/domain/policies/workflow-keepalive.js +11 -5
  513. package/daemon/dist/domain/policies/workflow-keepalive.js.map +1 -1
  514. package/daemon/dist/domain/profile-resolution-worker.d.ts +7 -0
  515. package/daemon/dist/domain/profile-resolution-worker.d.ts.map +1 -0
  516. package/daemon/dist/domain/profile-resolution-worker.js +83 -0
  517. package/daemon/dist/domain/profile-resolution-worker.js.map +1 -0
  518. package/daemon/dist/domain/profile-resolver.d.ts +6 -0
  519. package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
  520. package/daemon/dist/domain/profile-resolver.js +14 -2
  521. package/daemon/dist/domain/profile-resolver.js.map +1 -1
  522. package/daemon/dist/domain/project-classifier.d.ts +7 -0
  523. package/daemon/dist/domain/project-classifier.d.ts.map +1 -1
  524. package/daemon/dist/domain/project-classifier.js +26 -0
  525. package/daemon/dist/domain/project-classifier.js.map +1 -1
  526. package/daemon/dist/domain/proof/judgments.d.ts +7 -4
  527. package/daemon/dist/domain/proof/judgments.d.ts.map +1 -1
  528. package/daemon/dist/domain/proof/judgments.js +12 -8
  529. package/daemon/dist/domain/proof/judgments.js.map +1 -1
  530. package/daemon/dist/domain/proof/source-watch.d.ts +6 -1
  531. package/daemon/dist/domain/proof/source-watch.d.ts.map +1 -1
  532. package/daemon/dist/domain/proof/source-watch.js +241 -35
  533. package/daemon/dist/domain/proof/source-watch.js.map +1 -1
  534. package/daemon/dist/domain/provider/claude-auth-status-reader.d.ts +12 -0
  535. package/daemon/dist/domain/provider/claude-auth-status-reader.d.ts.map +1 -1
  536. package/daemon/dist/domain/provider/claude-auth-status-reader.js +4 -4
  537. package/daemon/dist/domain/provider/claude-auth-status-reader.js.map +1 -1
  538. package/daemon/dist/domain/provider/claude-seat-switch.d.ts +32 -0
  539. package/daemon/dist/domain/provider/claude-seat-switch.d.ts.map +1 -0
  540. package/daemon/dist/domain/provider/claude-seat-switch.js +136 -0
  541. package/daemon/dist/domain/provider/claude-seat-switch.js.map +1 -0
  542. package/daemon/dist/domain/provider/claude-token-usage.d.ts +34 -0
  543. package/daemon/dist/domain/provider/claude-token-usage.d.ts.map +1 -0
  544. package/daemon/dist/domain/provider/claude-token-usage.js +168 -0
  545. package/daemon/dist/domain/provider/claude-token-usage.js.map +1 -0
  546. package/daemon/dist/domain/provider/provider-account-readings.d.ts +7 -6
  547. package/daemon/dist/domain/provider/provider-account-readings.d.ts.map +1 -1
  548. package/daemon/dist/domain/provider/provider-account-readings.js +31 -10
  549. package/daemon/dist/domain/provider/provider-account-readings.js.map +1 -1
  550. package/daemon/dist/domain/provider/provider-collect.d.ts +3 -0
  551. package/daemon/dist/domain/provider/provider-collect.d.ts.map +1 -1
  552. package/daemon/dist/domain/provider/provider-collect.js +3 -2
  553. package/daemon/dist/domain/provider/provider-collect.js.map +1 -1
  554. package/daemon/dist/domain/provider/provider-seat-accounts.d.ts +1 -1
  555. package/daemon/dist/domain/provider/provider-seat-accounts.d.ts.map +1 -1
  556. package/daemon/dist/domain/provider/provider-seat-accounts.js +29 -2
  557. package/daemon/dist/domain/provider/provider-seat-accounts.js.map +1 -1
  558. package/daemon/dist/domain/provider/provider-service-impl.d.ts +38 -4
  559. package/daemon/dist/domain/provider/provider-service-impl.d.ts.map +1 -1
  560. package/daemon/dist/domain/provider/provider-service-impl.js +147 -5
  561. package/daemon/dist/domain/provider/provider-service-impl.js.map +1 -1
  562. package/daemon/dist/domain/provider/provider-service.d.ts +109 -4
  563. package/daemon/dist/domain/provider/provider-service.d.ts.map +1 -1
  564. package/daemon/dist/domain/provider/provider-signals.d.ts +3 -0
  565. package/daemon/dist/domain/provider/provider-signals.d.ts.map +1 -1
  566. package/daemon/dist/domain/provider/provider-signals.js +7 -2
  567. package/daemon/dist/domain/provider/provider-signals.js.map +1 -1
  568. package/daemon/dist/domain/provider/provider-types.d.ts +61 -5
  569. package/daemon/dist/domain/provider/provider-types.d.ts.map +1 -1
  570. package/daemon/dist/domain/provider/reactive-tap.d.ts +4 -0
  571. package/daemon/dist/domain/provider/reactive-tap.d.ts.map +1 -1
  572. package/daemon/dist/domain/provider/reactive-tap.js +3 -0
  573. package/daemon/dist/domain/provider/reactive-tap.js.map +1 -1
  574. package/daemon/dist/domain/provider/subscription-move-report.d.ts +86 -0
  575. package/daemon/dist/domain/provider/subscription-move-report.d.ts.map +1 -0
  576. package/daemon/dist/domain/provider/subscription-move-report.js +227 -0
  577. package/daemon/dist/domain/provider/subscription-move-report.js.map +1 -0
  578. package/daemon/dist/domain/provider/usage-across-hosts.d.ts.map +1 -1
  579. package/daemon/dist/domain/provider/usage-across-hosts.js +8 -2
  580. package/daemon/dist/domain/provider/usage-across-hosts.js.map +1 -1
  581. package/daemon/dist/domain/provider/usage-windows.d.ts +2 -0
  582. package/daemon/dist/domain/provider/usage-windows.d.ts.map +1 -1
  583. package/daemon/dist/domain/provider/usage-windows.js +4 -0
  584. package/daemon/dist/domain/provider/usage-windows.js.map +1 -1
  585. package/daemon/dist/domain/ps-projection.d.ts +6 -35
  586. package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
  587. package/daemon/dist/domain/ps-projection.js +14 -55
  588. package/daemon/dist/domain/ps-projection.js.map +1 -1
  589. package/daemon/dist/domain/queue-owner.d.ts +15 -3
  590. package/daemon/dist/domain/queue-owner.d.ts.map +1 -1
  591. package/daemon/dist/domain/queue-owner.js +38 -5
  592. package/daemon/dist/domain/queue-owner.js.map +1 -1
  593. package/daemon/dist/domain/queue-pickup.d.ts +5 -2
  594. package/daemon/dist/domain/queue-pickup.d.ts.map +1 -1
  595. package/daemon/dist/domain/queue-pickup.js +19 -2
  596. package/daemon/dist/domain/queue-pickup.js.map +1 -1
  597. package/daemon/dist/domain/queue-repository.d.ts +72 -24
  598. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  599. package/daemon/dist/domain/queue-repository.js +346 -102
  600. package/daemon/dist/domain/queue-repository.js.map +1 -1
  601. package/daemon/dist/domain/queue-retention.d.ts +18 -0
  602. package/daemon/dist/domain/queue-retention.d.ts.map +1 -1
  603. package/daemon/dist/domain/queue-retention.js +79 -0
  604. package/daemon/dist/domain/queue-retention.js.map +1 -1
  605. package/daemon/dist/domain/queue-stuck-sweep.d.ts +16 -3
  606. package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
  607. package/daemon/dist/domain/queue-stuck-sweep.js +87 -11
  608. package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
  609. package/daemon/dist/domain/queue-wait-backoff.d.ts +3 -0
  610. package/daemon/dist/domain/queue-wait-backoff.d.ts.map +1 -1
  611. package/daemon/dist/domain/queue-wait-backoff.js +9 -0
  612. package/daemon/dist/domain/queue-wait-backoff.js.map +1 -1
  613. package/daemon/dist/domain/queue-waiting.d.ts +2 -0
  614. package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
  615. package/daemon/dist/domain/queue-waiting.js.map +1 -1
  616. package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
  617. package/daemon/dist/domain/queue-wake-ladder.js +108 -34
  618. package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
  619. package/daemon/dist/domain/queue-wake-repository.d.ts +3 -0
  620. package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
  621. package/daemon/dist/domain/queue-wake-repository.js +5 -1
  622. package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
  623. package/daemon/dist/domain/reconciler.d.ts +23 -0
  624. package/daemon/dist/domain/reconciler.d.ts.map +1 -1
  625. package/daemon/dist/domain/reconciler.js +44 -1
  626. package/daemon/dist/domain/reconciler.js.map +1 -1
  627. package/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
  628. package/daemon/dist/domain/rehydrate-eligibility.js +2 -3
  629. package/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
  630. package/daemon/dist/domain/restore-guidance.d.ts +7 -0
  631. package/daemon/dist/domain/restore-guidance.d.ts.map +1 -1
  632. package/daemon/dist/domain/restore-guidance.js +20 -8
  633. package/daemon/dist/domain/restore-guidance.js.map +1 -1
  634. package/daemon/dist/domain/restore-orchestrator.d.ts +39 -2
  635. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  636. package/daemon/dist/domain/restore-orchestrator.js +266 -35
  637. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  638. package/daemon/dist/domain/restore-plan-preview.d.ts +7 -2
  639. package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
  640. package/daemon/dist/domain/restore-plan-preview.js +28 -7
  641. package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
  642. package/daemon/dist/domain/restore-policy.d.ts +4 -0
  643. package/daemon/dist/domain/restore-policy.d.ts.map +1 -1
  644. package/daemon/dist/domain/restore-policy.js +11 -0
  645. package/daemon/dist/domain/restore-policy.js.map +1 -1
  646. package/daemon/dist/domain/resume-metadata-refresher.d.ts +11 -2
  647. package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
  648. package/daemon/dist/domain/resume-metadata-refresher.js +32 -14
  649. package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
  650. package/daemon/dist/domain/resume-token-capture.d.ts +5 -1
  651. package/daemon/dist/domain/resume-token-capture.d.ts.map +1 -1
  652. package/daemon/dist/domain/resume-token-capture.js +3 -1
  653. package/daemon/dist/domain/resume-token-capture.js.map +1 -1
  654. package/daemon/dist/domain/rig-edge-ops.d.ts +58 -0
  655. package/daemon/dist/domain/rig-edge-ops.d.ts.map +1 -0
  656. package/daemon/dist/domain/rig-edge-ops.js +113 -0
  657. package/daemon/dist/domain/rig-edge-ops.js.map +1 -0
  658. package/daemon/dist/domain/rig-expansion-service.d.ts.map +1 -1
  659. package/daemon/dist/domain/rig-expansion-service.js +1 -0
  660. package/daemon/dist/domain/rig-expansion-service.js.map +1 -1
  661. package/daemon/dist/domain/rig-name-override.d.ts +14 -0
  662. package/daemon/dist/domain/rig-name-override.d.ts.map +1 -0
  663. package/daemon/dist/domain/rig-name-override.js +38 -0
  664. package/daemon/dist/domain/rig-name-override.js.map +1 -0
  665. package/daemon/dist/domain/rig-repository.d.ts +28 -3
  666. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  667. package/daemon/dist/domain/rig-repository.js +261 -2
  668. package/daemon/dist/domain/rig-repository.js.map +1 -1
  669. package/daemon/dist/domain/rig-status-compose.d.ts +1 -1
  670. package/daemon/dist/domain/rig-status-compose.d.ts.map +1 -1
  671. package/daemon/dist/domain/rig-status-compose.js +3 -1
  672. package/daemon/dist/domain/rig-status-compose.js.map +1 -1
  673. package/daemon/dist/domain/rig-teardown.d.ts +20 -1
  674. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  675. package/daemon/dist/domain/rig-teardown.js +81 -9
  676. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  677. package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
  678. package/daemon/dist/domain/rigspec-codec.js +14 -0
  679. package/daemon/dist/domain/rigspec-codec.js.map +1 -1
  680. package/daemon/dist/domain/rigspec-exporter.d.ts +3 -0
  681. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  682. package/daemon/dist/domain/rigspec-exporter.js +29 -0
  683. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  684. package/daemon/dist/domain/rigspec-instantiator.d.ts +71 -3
  685. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  686. package/daemon/dist/domain/rigspec-instantiator.js +424 -48
  687. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  688. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  689. package/daemon/dist/domain/rigspec-preflight.js +15 -2
  690. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  691. package/daemon/dist/domain/rigspec-schema.d.ts +3 -0
  692. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  693. package/daemon/dist/domain/rigspec-schema.js +90 -3
  694. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  695. package/daemon/dist/domain/running-name-guard.d.ts.map +1 -1
  696. package/daemon/dist/domain/running-name-guard.js +2 -1
  697. package/daemon/dist/domain/running-name-guard.js.map +1 -1
  698. package/daemon/dist/domain/runtime-adapter.d.ts +37 -2
  699. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  700. package/daemon/dist/domain/runtime-adapter.js +5 -1
  701. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  702. package/daemon/dist/domain/runtime-switch-materials.d.ts +77 -0
  703. package/daemon/dist/domain/runtime-switch-materials.d.ts.map +1 -0
  704. package/daemon/dist/domain/runtime-switch-materials.js +253 -0
  705. package/daemon/dist/domain/runtime-switch-materials.js.map +1 -0
  706. package/daemon/dist/domain/scope/scope-approve.d.ts +1 -1
  707. package/daemon/dist/domain/scope/scope-view-projection.d.ts +6 -0
  708. package/daemon/dist/domain/scope/scope-view-projection.d.ts.map +1 -1
  709. package/daemon/dist/domain/scope/scope-view-projection.js +26 -10
  710. package/daemon/dist/domain/scope/scope-view-projection.js.map +1 -1
  711. package/daemon/dist/domain/seat-activity-service.d.ts +8 -2
  712. package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
  713. package/daemon/dist/domain/seat-activity-service.js +30 -5
  714. package/daemon/dist/domain/seat-activity-service.js.map +1 -1
  715. package/daemon/dist/domain/seat-attention-reconciler.d.ts +27 -2
  716. package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  717. package/daemon/dist/domain/seat-attention-reconciler.js +91 -8
  718. package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  719. package/daemon/dist/domain/seat-delivery-guard.d.ts +20 -1
  720. package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
  721. package/daemon/dist/domain/seat-delivery-guard.js +66 -11
  722. package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
  723. package/daemon/dist/domain/seat-handover-service.d.ts +8 -0
  724. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  725. package/daemon/dist/domain/seat-handover-service.js +75 -5
  726. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  727. package/daemon/dist/domain/seat-identity-store.d.ts +11 -1
  728. package/daemon/dist/domain/seat-identity-store.d.ts.map +1 -1
  729. package/daemon/dist/domain/seat-identity-store.js +29 -4
  730. package/daemon/dist/domain/seat-identity-store.js.map +1 -1
  731. package/daemon/dist/domain/seat-launch-additions.d.ts +115 -0
  732. package/daemon/dist/domain/seat-launch-additions.d.ts.map +1 -0
  733. package/daemon/dist/domain/seat-launch-additions.js +439 -0
  734. package/daemon/dist/domain/seat-launch-additions.js.map +1 -0
  735. package/daemon/dist/domain/seat-launch-environment.d.ts +6 -1
  736. package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
  737. package/daemon/dist/domain/seat-launch-environment.js +9 -5
  738. package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
  739. package/daemon/dist/domain/seat-lifecycle-service.d.ts +98 -7
  740. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  741. package/daemon/dist/domain/seat-lifecycle-service.js +261 -25
  742. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  743. package/daemon/dist/domain/seat-restart-in-place.d.ts +9 -2
  744. package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
  745. package/daemon/dist/domain/seat-restart-in-place.js +27 -7
  746. package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
  747. package/daemon/dist/domain/seat-runtime-dir.d.ts +17 -0
  748. package/daemon/dist/domain/seat-runtime-dir.d.ts.map +1 -0
  749. package/daemon/dist/domain/seat-runtime-dir.js +27 -0
  750. package/daemon/dist/domain/seat-runtime-dir.js.map +1 -0
  751. package/daemon/dist/domain/seat-runtime-home.d.ts +42 -0
  752. package/daemon/dist/domain/seat-runtime-home.d.ts.map +1 -0
  753. package/daemon/dist/domain/seat-runtime-home.js +89 -0
  754. package/daemon/dist/domain/seat-runtime-home.js.map +1 -0
  755. package/daemon/dist/domain/seat-runtime-switch-service.d.ts +220 -0
  756. package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -0
  757. package/daemon/dist/domain/seat-runtime-switch-service.js +593 -0
  758. package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -0
  759. package/daemon/dist/domain/seat-skill-apply.d.ts +139 -0
  760. package/daemon/dist/domain/seat-skill-apply.d.ts.map +1 -0
  761. package/daemon/dist/domain/seat-skill-apply.js +221 -0
  762. package/daemon/dist/domain/seat-skill-apply.js.map +1 -0
  763. package/daemon/dist/domain/seat-skill-storage.d.ts +295 -0
  764. package/daemon/dist/domain/seat-skill-storage.d.ts.map +1 -0
  765. package/daemon/dist/domain/seat-skill-storage.js +850 -0
  766. package/daemon/dist/domain/seat-skill-storage.js.map +1 -0
  767. package/daemon/dist/domain/seat-skills-pointer.d.ts +5 -0
  768. package/daemon/dist/domain/seat-skills-pointer.d.ts.map +1 -0
  769. package/daemon/dist/domain/seat-skills-pointer.js +15 -0
  770. package/daemon/dist/domain/seat-skills-pointer.js.map +1 -0
  771. package/daemon/dist/domain/seat-status-service.d.ts +40 -0
  772. package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
  773. package/daemon/dist/domain/seat-status-service.js +59 -3
  774. package/daemon/dist/domain/seat-status-service.js.map +1 -1
  775. package/daemon/dist/domain/seat-structural-activity-service.d.ts +3 -0
  776. package/daemon/dist/domain/seat-structural-activity-service.d.ts.map +1 -1
  777. package/daemon/dist/domain/seat-structural-activity-service.js +6 -0
  778. package/daemon/dist/domain/seat-structural-activity-service.js.map +1 -1
  779. package/daemon/dist/domain/service-orchestrator.d.ts +7 -0
  780. package/daemon/dist/domain/service-orchestrator.d.ts.map +1 -1
  781. package/daemon/dist/domain/service-orchestrator.js +4 -0
  782. package/daemon/dist/domain/service-orchestrator.js.map +1 -1
  783. package/daemon/dist/domain/session-registry.d.ts +4 -0
  784. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  785. package/daemon/dist/domain/session-registry.js +13 -0
  786. package/daemon/dist/domain/session-registry.js.map +1 -1
  787. package/daemon/dist/domain/session-transport.d.ts +71 -22
  788. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  789. package/daemon/dist/domain/session-transport.js +376 -93
  790. package/daemon/dist/domain/session-transport.js.map +1 -1
  791. package/daemon/dist/domain/skill-catalog.d.ts +16 -0
  792. package/daemon/dist/domain/skill-catalog.d.ts.map +1 -1
  793. package/daemon/dist/domain/skill-catalog.js +15 -6
  794. package/daemon/dist/domain/skill-catalog.js.map +1 -1
  795. package/daemon/dist/domain/skill-discovery.d.ts +17 -2
  796. package/daemon/dist/domain/skill-discovery.d.ts.map +1 -1
  797. package/daemon/dist/domain/skill-discovery.js +44 -5
  798. package/daemon/dist/domain/skill-discovery.js.map +1 -1
  799. package/daemon/dist/domain/snapshot-capture.d.ts +4 -1
  800. package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
  801. package/daemon/dist/domain/snapshot-capture.js +4 -1
  802. package/daemon/dist/domain/snapshot-capture.js.map +1 -1
  803. package/daemon/dist/domain/snapshot-repository.d.ts +4 -3
  804. package/daemon/dist/domain/snapshot-repository.d.ts.map +1 -1
  805. package/daemon/dist/domain/snapshot-repository.js +6 -5
  806. package/daemon/dist/domain/snapshot-repository.js.map +1 -1
  807. package/daemon/dist/domain/startup-orchestrator.d.ts +29 -2
  808. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  809. package/daemon/dist/domain/startup-orchestrator.js +279 -25
  810. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  811. package/daemon/dist/domain/startup-submission-evidence.d.ts +1 -0
  812. package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
  813. package/daemon/dist/domain/startup-submission-evidence.js +1 -0
  814. package/daemon/dist/domain/startup-submission-evidence.js.map +1 -1
  815. package/daemon/dist/domain/stream-dispositions.d.ts +51 -0
  816. package/daemon/dist/domain/stream-dispositions.d.ts.map +1 -0
  817. package/daemon/dist/domain/stream-dispositions.js +112 -0
  818. package/daemon/dist/domain/stream-dispositions.js.map +1 -0
  819. package/daemon/dist/domain/stream-reader-actions.d.ts +49 -0
  820. package/daemon/dist/domain/stream-reader-actions.d.ts.map +1 -0
  821. package/daemon/dist/domain/stream-reader-actions.js +104 -0
  822. package/daemon/dist/domain/stream-reader-actions.js.map +1 -0
  823. package/daemon/dist/domain/stream-store.d.ts +22 -0
  824. package/daemon/dist/domain/stream-store.d.ts.map +1 -1
  825. package/daemon/dist/domain/stream-store.js +49 -6
  826. package/daemon/dist/domain/stream-store.js.map +1 -1
  827. package/daemon/dist/domain/stream-subscriptions.d.ts +94 -0
  828. package/daemon/dist/domain/stream-subscriptions.d.ts.map +1 -0
  829. package/daemon/dist/domain/stream-subscriptions.js +160 -0
  830. package/daemon/dist/domain/stream-subscriptions.js.map +1 -0
  831. package/daemon/dist/domain/successor-session-launcher.d.ts +41 -1
  832. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  833. package/daemon/dist/domain/successor-session-launcher.js +63 -5
  834. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  835. package/daemon/dist/domain/terminal/herdr-adapter.d.ts +8 -28
  836. package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
  837. package/daemon/dist/domain/terminal/herdr-adapter.js +117 -64
  838. package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
  839. package/daemon/dist/domain/terminal/herdr-sessions.d.ts +9 -0
  840. package/daemon/dist/domain/terminal/herdr-sessions.d.ts.map +1 -0
  841. package/daemon/dist/domain/terminal/herdr-sessions.js +23 -0
  842. package/daemon/dist/domain/terminal/herdr-sessions.js.map +1 -0
  843. package/daemon/dist/domain/terminal/rex-adapter.d.ts +42 -0
  844. package/daemon/dist/domain/terminal/rex-adapter.d.ts.map +1 -0
  845. package/daemon/dist/domain/terminal/rex-adapter.js +228 -0
  846. package/daemon/dist/domain/terminal/rex-adapter.js.map +1 -0
  847. package/daemon/dist/domain/terminal/rex-layout.d.ts +26 -0
  848. package/daemon/dist/domain/terminal/rex-layout.d.ts.map +1 -0
  849. package/daemon/dist/domain/terminal/rex-layout.js +21 -0
  850. package/daemon/dist/domain/terminal/rex-layout.js.map +1 -0
  851. package/daemon/dist/domain/terminal/rex-transport.d.ts +43 -0
  852. package/daemon/dist/domain/terminal/rex-transport.d.ts.map +1 -0
  853. package/daemon/dist/domain/terminal/rex-transport.js +176 -0
  854. package/daemon/dist/domain/terminal/rex-transport.js.map +1 -0
  855. package/daemon/dist/domain/terminal/terminal-provider.d.ts +15 -0
  856. package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
  857. package/daemon/dist/domain/terminal/terminal-service.d.ts +14 -5
  858. package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
  859. package/daemon/dist/domain/terminal/terminal-service.js +51 -27
  860. package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
  861. package/daemon/dist/domain/terminal/tile-attach.d.ts +2 -0
  862. package/daemon/dist/domain/terminal/tile-attach.d.ts.map +1 -0
  863. package/daemon/dist/domain/terminal/tile-attach.js +42 -0
  864. package/daemon/dist/domain/terminal/tile-attach.js.map +1 -0
  865. package/daemon/dist/domain/terminal/tile-layout.d.ts +32 -0
  866. package/daemon/dist/domain/terminal/tile-layout.d.ts.map +1 -0
  867. package/daemon/dist/domain/terminal/tile-layout.js +36 -0
  868. package/daemon/dist/domain/terminal/tile-layout.js.map +1 -0
  869. package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -1
  870. package/daemon/dist/domain/terminal/view-composer.js +11 -6
  871. package/daemon/dist/domain/terminal/view-composer.js.map +1 -1
  872. package/daemon/dist/domain/terminal-policy.d.ts +80 -0
  873. package/daemon/dist/domain/terminal-policy.d.ts.map +1 -0
  874. package/daemon/dist/domain/terminal-policy.js +117 -0
  875. package/daemon/dist/domain/terminal-policy.js.map +1 -0
  876. package/daemon/dist/domain/terminal-seat.d.ts +9 -0
  877. package/daemon/dist/domain/terminal-seat.d.ts.map +1 -0
  878. package/daemon/dist/domain/terminal-seat.js +37 -0
  879. package/daemon/dist/domain/terminal-seat.js.map +1 -0
  880. package/daemon/dist/domain/topology-converge.d.ts +25 -2
  881. package/daemon/dist/domain/topology-converge.d.ts.map +1 -1
  882. package/daemon/dist/domain/topology-converge.js +14 -1
  883. package/daemon/dist/domain/topology-converge.js.map +1 -1
  884. package/daemon/dist/domain/types.d.ts +119 -2
  885. package/daemon/dist/domain/types.d.ts.map +1 -1
  886. package/daemon/dist/domain/types.js.map +1 -1
  887. package/daemon/dist/domain/urgent-line.d.ts +4 -0
  888. package/daemon/dist/domain/urgent-line.d.ts.map +1 -0
  889. package/daemon/dist/domain/urgent-line.js +7 -0
  890. package/daemon/dist/domain/urgent-line.js.map +1 -0
  891. package/daemon/dist/domain/usage-series.d.ts.map +1 -1
  892. package/daemon/dist/domain/usage-series.js +6 -2
  893. package/daemon/dist/domain/usage-series.js.map +1 -1
  894. package/daemon/dist/domain/user-settings/settings-browser.js +2 -2
  895. package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
  896. package/daemon/dist/domain/user-settings/settings-store.d.ts +3 -1
  897. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  898. package/daemon/dist/domain/user-settings/settings-store.js +73 -1
  899. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  900. package/daemon/dist/domain/view-projector.d.ts.map +1 -1
  901. package/daemon/dist/domain/view-projector.js +2 -1
  902. package/daemon/dist/domain/view-projector.js.map +1 -1
  903. package/daemon/dist/domain/wake-recovery.d.ts +16 -0
  904. package/daemon/dist/domain/wake-recovery.d.ts.map +1 -0
  905. package/daemon/dist/domain/wake-recovery.js +31 -0
  906. package/daemon/dist/domain/wake-recovery.js.map +1 -0
  907. package/daemon/dist/domain/watchdog-delivery.js +1 -1
  908. package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
  909. package/daemon/dist/domain/watchdog-job-update.d.ts +21 -0
  910. package/daemon/dist/domain/watchdog-job-update.d.ts.map +1 -0
  911. package/daemon/dist/domain/watchdog-job-update.js +143 -0
  912. package/daemon/dist/domain/watchdog-job-update.js.map +1 -0
  913. package/daemon/dist/domain/watchdog-jobs-repository.d.ts +63 -7
  914. package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
  915. package/daemon/dist/domain/watchdog-jobs-repository.js +190 -21
  916. package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
  917. package/daemon/dist/domain/watchdog-policy-engine.d.ts +23 -0
  918. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  919. package/daemon/dist/domain/watchdog-policy-engine.js +46 -13
  920. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  921. package/daemon/dist/domain/workflow-exception-escalation.d.ts.map +1 -1
  922. package/daemon/dist/domain/workflow-exception-escalation.js +7 -3
  923. package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -1
  924. package/daemon/dist/domain/workflow-projector.d.ts +5 -2
  925. package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
  926. package/daemon/dist/domain/workflow-projector.js +16 -7
  927. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  928. package/daemon/dist/domain/workflow-runtime.d.ts +8 -2
  929. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  930. package/daemon/dist/domain/workflow-runtime.js +30 -7
  931. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  932. package/daemon/dist/domain/workspace/project-read.d.ts +2 -0
  933. package/daemon/dist/domain/workspace/project-read.d.ts.map +1 -1
  934. package/daemon/dist/domain/workspace/project-read.js +10 -1
  935. package/daemon/dist/domain/workspace/project-read.js.map +1 -1
  936. package/daemon/dist/index.d.ts.map +1 -1
  937. package/daemon/dist/index.js +7 -1
  938. package/daemon/dist/index.js.map +1 -1
  939. package/daemon/dist/lib/pane-envelope.d.ts +5 -0
  940. package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
  941. package/daemon/dist/lib/pane-envelope.js +8 -1
  942. package/daemon/dist/lib/pane-envelope.js.map +1 -1
  943. package/daemon/dist/router-line-surface.d.ts +2 -0
  944. package/daemon/dist/router-line-surface.d.ts.map +1 -0
  945. package/daemon/dist/router-line-surface.js +3 -0
  946. package/daemon/dist/router-line-surface.js.map +1 -0
  947. package/daemon/dist/routes/activity.d.ts.map +1 -1
  948. package/daemon/dist/routes/activity.js +15 -0
  949. package/daemon/dist/routes/activity.js.map +1 -1
  950. package/daemon/dist/routes/agent-images.d.ts.map +1 -1
  951. package/daemon/dist/routes/agent-images.js +19 -2
  952. package/daemon/dist/routes/agent-images.js.map +1 -1
  953. package/daemon/dist/routes/attention.d.ts.map +1 -1
  954. package/daemon/dist/routes/attention.js +30 -3
  955. package/daemon/dist/routes/attention.js.map +1 -1
  956. package/daemon/dist/routes/bootstrap-failure-response.js +2 -2
  957. package/daemon/dist/routes/bootstrap-failure-response.js.map +1 -1
  958. package/daemon/dist/routes/bundles.js +1 -1
  959. package/daemon/dist/routes/bundles.js.map +1 -1
  960. package/daemon/dist/routes/compaction.d.ts.map +1 -1
  961. package/daemon/dist/routes/compaction.js +31 -10
  962. package/daemon/dist/routes/compaction.js.map +1 -1
  963. package/daemon/dist/routes/context-packs.d.ts.map +1 -1
  964. package/daemon/dist/routes/context-packs.js +22 -0
  965. package/daemon/dist/routes/context-packs.js.map +1 -1
  966. package/daemon/dist/routes/hosts.d.ts.map +1 -1
  967. package/daemon/dist/routes/hosts.js +2 -0
  968. package/daemon/dist/routes/hosts.js.map +1 -1
  969. package/daemon/dist/routes/mission-control.d.ts.map +1 -1
  970. package/daemon/dist/routes/mission-control.js +7 -3
  971. package/daemon/dist/routes/mission-control.js.map +1 -1
  972. package/daemon/dist/routes/projects.d.ts.map +1 -1
  973. package/daemon/dist/routes/projects.js +59 -12
  974. package/daemon/dist/routes/projects.js.map +1 -1
  975. package/daemon/dist/routes/proof.js +2 -2
  976. package/daemon/dist/routes/proof.js.map +1 -1
  977. package/daemon/dist/routes/provider.d.ts.map +1 -1
  978. package/daemon/dist/routes/provider.js +170 -3
  979. package/daemon/dist/routes/provider.js.map +1 -1
  980. package/daemon/dist/routes/queue.d.ts.map +1 -1
  981. package/daemon/dist/routes/queue.js +154 -13
  982. package/daemon/dist/routes/queue.js.map +1 -1
  983. package/daemon/dist/routes/require-sender-identity.d.ts +10 -8
  984. package/daemon/dist/routes/require-sender-identity.d.ts.map +1 -1
  985. package/daemon/dist/routes/require-sender-identity.js +13 -11
  986. package/daemon/dist/routes/require-sender-identity.js.map +1 -1
  987. package/daemon/dist/routes/rigs.d.ts.map +1 -1
  988. package/daemon/dist/routes/rigs.js +77 -10
  989. package/daemon/dist/routes/rigs.js.map +1 -1
  990. package/daemon/dist/routes/rigspec.d.ts.map +1 -1
  991. package/daemon/dist/routes/rigspec.js +38 -12
  992. package/daemon/dist/routes/rigspec.js.map +1 -1
  993. package/daemon/dist/routes/runtime-switch-custody.d.ts +21 -0
  994. package/daemon/dist/routes/runtime-switch-custody.d.ts.map +1 -0
  995. package/daemon/dist/routes/runtime-switch-custody.js +55 -0
  996. package/daemon/dist/routes/runtime-switch-custody.js.map +1 -0
  997. package/daemon/dist/routes/scope-approve.js +2 -2
  998. package/daemon/dist/routes/scope-approve.js.map +1 -1
  999. package/daemon/dist/routes/scopes.d.ts.map +1 -1
  1000. package/daemon/dist/routes/scopes.js +30 -7
  1001. package/daemon/dist/routes/scopes.js.map +1 -1
  1002. package/daemon/dist/routes/seat.d.ts.map +1 -1
  1003. package/daemon/dist/routes/seat.js +109 -10
  1004. package/daemon/dist/routes/seat.js.map +1 -1
  1005. package/daemon/dist/routes/sessions.d.ts.map +1 -1
  1006. package/daemon/dist/routes/sessions.js +14 -0
  1007. package/daemon/dist/routes/sessions.js.map +1 -1
  1008. package/daemon/dist/routes/skills.d.ts.map +1 -1
  1009. package/daemon/dist/routes/skills.js +54 -1
  1010. package/daemon/dist/routes/skills.js.map +1 -1
  1011. package/daemon/dist/routes/startup.js +15 -5
  1012. package/daemon/dist/routes/startup.js.map +1 -1
  1013. package/daemon/dist/routes/stream.d.ts.map +1 -1
  1014. package/daemon/dist/routes/stream.js +86 -14
  1015. package/daemon/dist/routes/stream.js.map +1 -1
  1016. package/daemon/dist/routes/terminal.d.ts.map +1 -1
  1017. package/daemon/dist/routes/terminal.js +20 -11
  1018. package/daemon/dist/routes/terminal.js.map +1 -1
  1019. package/daemon/dist/routes/transport.d.ts.map +1 -1
  1020. package/daemon/dist/routes/transport.js +55 -5
  1021. package/daemon/dist/routes/transport.js.map +1 -1
  1022. package/daemon/dist/routes/up.js +5 -0
  1023. package/daemon/dist/routes/up.js.map +1 -1
  1024. package/daemon/dist/routes/watchdog.d.ts +1 -0
  1025. package/daemon/dist/routes/watchdog.d.ts.map +1 -1
  1026. package/daemon/dist/routes/watchdog.js +52 -3
  1027. package/daemon/dist/routes/watchdog.js.map +1 -1
  1028. package/daemon/dist/routes/workflow.d.ts.map +1 -1
  1029. package/daemon/dist/routes/workflow.js +24 -13
  1030. package/daemon/dist/routes/workflow.js.map +1 -1
  1031. package/daemon/dist/seat-recap-store-surface.d.ts +1 -1
  1032. package/daemon/dist/seat-recap-store-surface.d.ts.map +1 -1
  1033. package/daemon/dist/seat-recap-store-surface.js +1 -1
  1034. package/daemon/dist/seat-recap-store-surface.js.map +1 -1
  1035. package/daemon/dist/server.d.ts +4 -0
  1036. package/daemon/dist/server.d.ts.map +1 -1
  1037. package/daemon/dist/server.js +5 -1
  1038. package/daemon/dist/server.js.map +1 -1
  1039. package/daemon/dist/skill-loadout-surface.d.ts +2 -0
  1040. package/daemon/dist/skill-loadout-surface.d.ts.map +1 -1
  1041. package/daemon/dist/skill-loadout-surface.js +2 -0
  1042. package/daemon/dist/skill-loadout-surface.js.map +1 -1
  1043. package/daemon/dist/startup.d.ts +5 -0
  1044. package/daemon/dist/startup.d.ts.map +1 -1
  1045. package/daemon/dist/startup.js +160 -49
  1046. package/daemon/dist/startup.js.map +1 -1
  1047. package/daemon/dist/terminal/TerminalSessionBroker.d.ts.map +1 -1
  1048. package/daemon/dist/terminal/TerminalSessionBroker.js +14 -2
  1049. package/daemon/dist/terminal/TerminalSessionBroker.js.map +1 -1
  1050. package/daemon/docs/reference/a2a-agents.md +343 -0
  1051. package/daemon/docs/reference/acp-agents.md +77 -0
  1052. package/daemon/docs/reference/agent-spec.md +7 -5
  1053. package/daemon/docs/reference/agent-startup-guide.md +46 -0
  1054. package/daemon/docs/reference/agent-state-taxonomy.md +27 -2
  1055. package/daemon/docs/reference/checked-seat-stop.md +11 -0
  1056. package/daemon/docs/reference/community-harness-examples/cursor/cursor.yaml +13 -0
  1057. package/daemon/docs/reference/community-harness-examples/cursor/openrig-cursor-launch +68 -0
  1058. package/daemon/docs/reference/community-harness-examples/hermes/config.yaml.example +18 -0
  1059. package/daemon/docs/reference/community-harness-examples/hermes/hermes.yaml +12 -0
  1060. package/daemon/docs/reference/community-harness-examples/hermes/openrig-hermes-launch +34 -0
  1061. package/daemon/docs/reference/community-harness-examples/openclaw/openclaw-gateway.yaml +15 -0
  1062. package/daemon/docs/reference/community-harness-examples/openclaw/openclaw.yaml +16 -0
  1063. package/daemon/docs/reference/community-harness-examples/openclaw/openrig-openclaw-launch +70 -0
  1064. package/daemon/docs/reference/community-harness-presets.md +194 -0
  1065. package/daemon/docs/reference/getting-started.md +145 -14
  1066. package/daemon/docs/reference/health-diagnosis.md +13 -0
  1067. package/daemon/docs/reference/help.md +6 -0
  1068. package/daemon/docs/reference/keeping-a-watch.md +21 -0
  1069. package/daemon/docs/reference/operation-correlation.md +9 -0
  1070. package/daemon/docs/reference/project-workspace.md +24 -0
  1071. package/daemon/docs/reference/publishing-a-rig-bundle.md +11 -0
  1072. package/daemon/docs/reference/quickstart.md +1 -1
  1073. package/daemon/docs/reference/refocus-channel.md +6 -4
  1074. package/daemon/docs/reference/rig-spec.md +175 -5
  1075. package/daemon/docs/reference/sdlc-conventions.md +3 -1
  1076. package/daemon/docs/reference/seat-delivery.md +89 -7
  1077. package/daemon/docs/reference/slack-app-setup.md +4 -2
  1078. package/daemon/docs/reference/stream-classifier-worker.md +28 -0
  1079. package/daemon/docs/reference/telemetry.md +3 -0
  1080. package/daemon/docs/reference/terminal-sessions.md +141 -0
  1081. package/daemon/docs/reference/topology-naming.md +1 -1
  1082. package/daemon/docs/reference/whats-new.md +275 -113
  1083. package/daemon/specs/agents/shared/runtime/claude-settings.fragment.json +0 -3
  1084. package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +19 -4
  1085. package/daemon/specs/agents/shared/skills/core/openrig-herdr/SKILL.md +18 -3
  1086. package/daemon/specs/agents/shared/skills/core/openrig-software-factory/references/worked-example.md +2 -2
  1087. package/daemon/specs/agents/shared/skills/process/agent-browser/LICENSE.txt +201 -0
  1088. package/daemon/specs/agents/shared/skills/process/agent-browser/OPENRIG.md +13 -29
  1089. package/daemon/specs/agents/shared/skills/process/agent-browser/SKILL.md +7 -7
  1090. package/daemon/specs/agents/shared/skills/process/dogfood/LICENSE.txt +201 -0
  1091. package/daemon/specs/agents/shared/skills/process/dogfood/SKILL.md +6 -2
  1092. package/daemon/specs/agents/shared/skills/process/systematic-debugging/LICENSE.txt +21 -0
  1093. package/daemon/specs/agents/shared/skills/process/systematic-debugging/SKILL.md +6 -2
  1094. package/daemon/specs/agents/shared/skills/process/test-driven-development/LICENSE.txt +21 -0
  1095. package/daemon/specs/agents/shared/skills/process/test-driven-development/SKILL.md +5 -1
  1096. package/daemon/specs/agents/shared/skills/process/verification-before-completion/LICENSE.txt +21 -0
  1097. package/daemon/specs/agents/shared/skills/process/verification-before-completion/SKILL.md +5 -1
  1098. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +53 -10
  1099. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/startup/context.md +3 -0
  1100. package/daemon/specs/rigs/launch/kernel/agents/queue/worker/guidance/role.md +12 -0
  1101. package/daemon/specs/rigs/launch/kernel/agents/queue/worker/startup/context.md +3 -1
  1102. package/daemon/specs/rigs/launch/secrets-manager/secrets-manager.compose.yaml +1 -1
  1103. package/dist/acp/connector.d.ts +72 -0
  1104. package/dist/acp/connector.d.ts.map +1 -0
  1105. package/dist/acp/connector.js +218 -0
  1106. package/dist/acp/connector.js.map +1 -0
  1107. package/dist/acp/json-rpc-stdio.d.ts +53 -0
  1108. package/dist/acp/json-rpc-stdio.d.ts.map +1 -0
  1109. package/dist/acp/json-rpc-stdio.js +141 -0
  1110. package/dist/acp/json-rpc-stdio.js.map +1 -0
  1111. package/dist/acp/run-processes.d.ts +10 -0
  1112. package/dist/acp/run-processes.d.ts.map +1 -0
  1113. package/dist/acp/run-processes.js +33 -0
  1114. package/dist/acp/run-processes.js.map +1 -0
  1115. package/dist/build-info.js +3 -3
  1116. package/dist/client.d.ts +15 -2
  1117. package/dist/client.d.ts.map +1 -1
  1118. package/dist/client.js +30 -8
  1119. package/dist/client.js.map +1 -1
  1120. package/dist/commands/acp.d.ts +11 -0
  1121. package/dist/commands/acp.d.ts.map +1 -0
  1122. package/dist/commands/acp.js +198 -0
  1123. package/dist/commands/acp.js.map +1 -0
  1124. package/dist/commands/attach.js +1 -1
  1125. package/dist/commands/attach.js.map +1 -1
  1126. package/dist/commands/auth.d.ts +3 -0
  1127. package/dist/commands/auth.d.ts.map +1 -1
  1128. package/dist/commands/auth.js +41 -11
  1129. package/dist/commands/auth.js.map +1 -1
  1130. package/dist/commands/capture.d.ts.map +1 -1
  1131. package/dist/commands/capture.js +8 -0
  1132. package/dist/commands/capture.js.map +1 -1
  1133. package/dist/commands/chatroom.d.ts.map +1 -1
  1134. package/dist/commands/chatroom.js +6 -0
  1135. package/dist/commands/chatroom.js.map +1 -1
  1136. package/dist/commands/compact-plan.d.ts +2 -0
  1137. package/dist/commands/compact-plan.d.ts.map +1 -1
  1138. package/dist/commands/compact-plan.js +38 -3
  1139. package/dist/commands/compact-plan.js.map +1 -1
  1140. package/dist/commands/compact.js +1 -1
  1141. package/dist/commands/compact.js.map +1 -1
  1142. package/dist/commands/config.d.ts.map +1 -1
  1143. package/dist/commands/config.js +7 -1
  1144. package/dist/commands/config.js.map +1 -1
  1145. package/dist/commands/context.d.ts.map +1 -1
  1146. package/dist/commands/context.js +29 -23
  1147. package/dist/commands/context.js.map +1 -1
  1148. package/dist/commands/create.js +2 -2
  1149. package/dist/commands/create.js.map +1 -1
  1150. package/dist/commands/daemon.d.ts.map +1 -1
  1151. package/dist/commands/daemon.js +2 -0
  1152. package/dist/commands/daemon.js.map +1 -1
  1153. package/dist/commands/down.d.ts +5 -1
  1154. package/dist/commands/down.d.ts.map +1 -1
  1155. package/dist/commands/down.js +93 -5
  1156. package/dist/commands/down.js.map +1 -1
  1157. package/dist/commands/edge.d.ts +4 -0
  1158. package/dist/commands/edge.d.ts.map +1 -0
  1159. package/dist/commands/edge.js +135 -0
  1160. package/dist/commands/edge.js.map +1 -0
  1161. package/dist/commands/env.d.ts.map +1 -1
  1162. package/dist/commands/env.js +3 -0
  1163. package/dist/commands/env.js.map +1 -1
  1164. package/dist/commands/export.d.ts +1 -0
  1165. package/dist/commands/export.d.ts.map +1 -1
  1166. package/dist/commands/export.js +98 -0
  1167. package/dist/commands/export.js.map +1 -1
  1168. package/dist/commands/fork.d.ts.map +1 -1
  1169. package/dist/commands/fork.js +19 -2
  1170. package/dist/commands/fork.js.map +1 -1
  1171. package/dist/commands/gateway.d.ts.map +1 -1
  1172. package/dist/commands/gateway.js +2 -1
  1173. package/dist/commands/gateway.js.map +1 -1
  1174. package/dist/commands/grow.js +2 -2
  1175. package/dist/commands/grow.js.map +1 -1
  1176. package/dist/commands/health.js +1 -1
  1177. package/dist/commands/health.js.map +1 -1
  1178. package/dist/commands/launch.js +2 -2
  1179. package/dist/commands/launch.js.map +1 -1
  1180. package/dist/commands/mcp.d.ts.map +1 -1
  1181. package/dist/commands/mcp.js +113 -1
  1182. package/dist/commands/mcp.js.map +1 -1
  1183. package/dist/commands/project-worker.d.ts +25 -1
  1184. package/dist/commands/project-worker.d.ts.map +1 -1
  1185. package/dist/commands/project-worker.js +9 -7
  1186. package/dist/commands/project-worker.js.map +1 -1
  1187. package/dist/commands/project.d.ts +2 -0
  1188. package/dist/commands/project.d.ts.map +1 -1
  1189. package/dist/commands/project.js +70 -2
  1190. package/dist/commands/project.js.map +1 -1
  1191. package/dist/commands/proof.d.ts.map +1 -1
  1192. package/dist/commands/proof.js +33 -2
  1193. package/dist/commands/proof.js.map +1 -1
  1194. package/dist/commands/provider.d.ts.map +1 -1
  1195. package/dist/commands/provider.js +273 -24
  1196. package/dist/commands/provider.js.map +1 -1
  1197. package/dist/commands/ps.d.ts +12 -1
  1198. package/dist/commands/ps.d.ts.map +1 -1
  1199. package/dist/commands/ps.js +50 -47
  1200. package/dist/commands/ps.js.map +1 -1
  1201. package/dist/commands/queue.d.ts +4 -2
  1202. package/dist/commands/queue.d.ts.map +1 -1
  1203. package/dist/commands/queue.js +178 -45
  1204. package/dist/commands/queue.js.map +1 -1
  1205. package/dist/commands/reconcile-session.d.ts.map +1 -1
  1206. package/dist/commands/reconcile-session.js +6 -0
  1207. package/dist/commands/reconcile-session.js.map +1 -1
  1208. package/dist/commands/scope.d.ts.map +1 -1
  1209. package/dist/commands/scope.js +5 -2
  1210. package/dist/commands/scope.js.map +1 -1
  1211. package/dist/commands/seat.d.ts +2 -0
  1212. package/dist/commands/seat.d.ts.map +1 -1
  1213. package/dist/commands/seat.js +336 -11
  1214. package/dist/commands/seat.js.map +1 -1
  1215. package/dist/commands/send.d.ts.map +1 -1
  1216. package/dist/commands/send.js +62 -55
  1217. package/dist/commands/send.js.map +1 -1
  1218. package/dist/commands/setup.d.ts +24 -0
  1219. package/dist/commands/setup.d.ts.map +1 -1
  1220. package/dist/commands/setup.js +160 -7
  1221. package/dist/commands/setup.js.map +1 -1
  1222. package/dist/commands/skill.d.ts.map +1 -1
  1223. package/dist/commands/skill.js +137 -3
  1224. package/dist/commands/skill.js.map +1 -1
  1225. package/dist/commands/start.d.ts.map +1 -1
  1226. package/dist/commands/start.js +18 -25
  1227. package/dist/commands/start.js.map +1 -1
  1228. package/dist/commands/status.d.ts.map +1 -1
  1229. package/dist/commands/status.js +4 -1
  1230. package/dist/commands/status.js.map +1 -1
  1231. package/dist/commands/stream-outcome.d.ts +742 -0
  1232. package/dist/commands/stream-outcome.d.ts.map +1 -0
  1233. package/dist/commands/stream-outcome.js +118 -0
  1234. package/dist/commands/stream-outcome.js.map +1 -0
  1235. package/dist/commands/stream.d.ts.map +1 -1
  1236. package/dist/commands/stream.js +86 -2
  1237. package/dist/commands/stream.js.map +1 -1
  1238. package/dist/commands/terminal.d.ts +5 -0
  1239. package/dist/commands/terminal.d.ts.map +1 -1
  1240. package/dist/commands/terminal.js +42 -11
  1241. package/dist/commands/terminal.js.map +1 -1
  1242. package/dist/commands/topology-default-agent.d.ts +2 -2
  1243. package/dist/commands/topology-default-agent.d.ts.map +1 -1
  1244. package/dist/commands/topology-default-agent.js +5 -3
  1245. package/dist/commands/topology-default-agent.js.map +1 -1
  1246. package/dist/commands/up.d.ts.map +1 -1
  1247. package/dist/commands/up.js +82 -31
  1248. package/dist/commands/up.js.map +1 -1
  1249. package/dist/commands/watchdog.d.ts.map +1 -1
  1250. package/dist/commands/watchdog.js +80 -5
  1251. package/dist/commands/watchdog.js.map +1 -1
  1252. package/dist/commands/workflow-errors.js +1 -1
  1253. package/dist/commands/workflow-errors.js.map +1 -1
  1254. package/dist/commands/workflow-render.js +4 -4
  1255. package/dist/commands/workflow-render.js.map +1 -1
  1256. package/dist/commands/workflow.d.ts.map +1 -1
  1257. package/dist/commands/workflow.js +34 -15
  1258. package/dist/commands/workflow.js.map +1 -1
  1259. package/dist/config-store.d.ts +15 -1
  1260. package/dist/config-store.d.ts.map +1 -1
  1261. package/dist/config-store.js +86 -4
  1262. package/dist/config-store.js.map +1 -1
  1263. package/dist/daemon-lifecycle.d.ts +4 -0
  1264. package/dist/daemon-lifecycle.d.ts.map +1 -1
  1265. package/dist/daemon-lifecycle.js +73 -21
  1266. package/dist/daemon-lifecycle.js.map +1 -1
  1267. package/dist/decisions/decisions.d.ts +203 -0
  1268. package/dist/decisions/decisions.d.ts.map +1 -0
  1269. package/dist/decisions/decisions.js +374 -0
  1270. package/dist/decisions/decisions.js.map +1 -0
  1271. package/dist/decisions/stream-consumer.d.ts +255 -0
  1272. package/dist/decisions/stream-consumer.d.ts.map +1 -0
  1273. package/dist/decisions/stream-consumer.js +282 -0
  1274. package/dist/decisions/stream-consumer.js.map +1 -0
  1275. package/dist/decisions/templates.d.ts +8 -0
  1276. package/dist/decisions/templates.d.ts.map +1 -0
  1277. package/dist/decisions/templates.js +34 -0
  1278. package/dist/decisions/templates.js.map +1 -0
  1279. package/dist/fresh-seat-command.d.ts +18 -0
  1280. package/dist/fresh-seat-command.d.ts.map +1 -0
  1281. package/dist/fresh-seat-command.js +36 -0
  1282. package/dist/fresh-seat-command.js.map +1 -0
  1283. package/dist/front-door.d.ts +4 -0
  1284. package/dist/front-door.d.ts.map +1 -1
  1285. package/dist/front-door.js +8 -4
  1286. package/dist/front-door.js.map +1 -1
  1287. package/dist/host-bindings.d.ts.map +1 -1
  1288. package/dist/host-bindings.js +16 -9
  1289. package/dist/host-bindings.js.map +1 -1
  1290. package/dist/index.d.ts +2 -0
  1291. package/dist/index.d.ts.map +1 -1
  1292. package/dist/index.js +4 -0
  1293. package/dist/index.js.map +1 -1
  1294. package/dist/lazy-program.d.ts.map +1 -1
  1295. package/dist/lazy-program.js +2 -0
  1296. package/dist/lazy-program.js.map +1 -1
  1297. package/dist/lib/codex-auth.d.ts +1 -147
  1298. package/dist/lib/codex-auth.d.ts.map +1 -1
  1299. package/dist/lib/codex-auth.js +2 -505
  1300. package/dist/lib/codex-auth.js.map +1 -1
  1301. package/dist/lib/run-on-host.d.ts +29 -0
  1302. package/dist/lib/run-on-host.d.ts.map +1 -0
  1303. package/dist/lib/run-on-host.js +69 -0
  1304. package/dist/lib/run-on-host.js.map +1 -0
  1305. package/dist/lib/seat-activity.d.ts +17 -0
  1306. package/dist/lib/seat-activity.d.ts.map +1 -0
  1307. package/dist/lib/seat-activity.js +29 -0
  1308. package/dist/lib/seat-activity.js.map +1 -0
  1309. package/dist/local-daemon-owner.d.ts +4 -0
  1310. package/dist/local-daemon-owner.d.ts.map +1 -1
  1311. package/dist/local-daemon-owner.js +1 -1
  1312. package/dist/local-daemon-owner.js.map +1 -1
  1313. package/dist/mcp-http.d.ts +42 -0
  1314. package/dist/mcp-http.d.ts.map +1 -0
  1315. package/dist/mcp-http.js +232 -0
  1316. package/dist/mcp-http.js.map +1 -0
  1317. package/dist/mcp-server.d.ts +30 -2
  1318. package/dist/mcp-server.d.ts.map +1 -1
  1319. package/dist/mcp-server.js +1163 -436
  1320. package/dist/mcp-server.js.map +1 -1
  1321. package/dist/seat-launch-additions-lines.d.ts +11 -0
  1322. package/dist/seat-launch-additions-lines.d.ts.map +1 -0
  1323. package/dist/seat-launch-additions-lines.js +14 -0
  1324. package/dist/seat-launch-additions-lines.js.map +1 -0
  1325. package/dist/terminal-window-rex.d.ts +6 -0
  1326. package/dist/terminal-window-rex.d.ts.map +1 -0
  1327. package/dist/terminal-window-rex.js +129 -0
  1328. package/dist/terminal-window-rex.js.map +1 -0
  1329. package/dist/terminal-window.d.ts +3 -1
  1330. package/dist/terminal-window.d.ts.map +1 -1
  1331. package/dist/terminal-window.js +68 -28
  1332. package/dist/terminal-window.js.map +1 -1
  1333. package/package.json +1 -1
  1334. package/tui/dist/attention/attention-model.d.ts +3 -1
  1335. package/tui/dist/attention/attention-model.d.ts.map +1 -1
  1336. package/tui/dist/attention/attention-model.js +68 -1
  1337. package/tui/dist/attention/attention-model.js.map +1 -1
  1338. package/tui/dist/commands/registry.d.ts.map +1 -1
  1339. package/tui/dist/commands/registry.js +3 -1
  1340. package/tui/dist/commands/registry.js.map +1 -1
  1341. package/tui/dist/config/config-model.d.ts.map +1 -1
  1342. package/tui/dist/config/config-model.js +2 -0
  1343. package/tui/dist/config/config-model.js.map +1 -1
  1344. package/tui/dist/daemon-client.d.ts +22 -3
  1345. package/tui/dist/daemon-client.d.ts.map +1 -1
  1346. package/tui/dist/daemon-client.js +9 -4
  1347. package/tui/dist/daemon-client.js.map +1 -1
  1348. package/tui/dist/hydrate.d.ts.map +1 -1
  1349. package/tui/dist/hydrate.js +13 -7
  1350. package/tui/dist/hydrate.js.map +1 -1
  1351. package/tui/dist/live.d.ts.map +1 -1
  1352. package/tui/dist/live.js +6 -4
  1353. package/tui/dist/live.js.map +1 -1
  1354. package/tui/dist/main.js +15 -1
  1355. package/tui/dist/main.js.map +1 -1
  1356. package/tui/dist/render.d.ts.map +1 -1
  1357. package/tui/dist/render.js +10 -3
  1358. package/tui/dist/render.js.map +1 -1
  1359. package/tui/dist/terminals/open-window.d.ts +9 -5
  1360. package/tui/dist/terminals/open-window.d.ts.map +1 -1
  1361. package/tui/dist/terminals/open-window.js +29 -12
  1362. package/tui/dist/terminals/open-window.js.map +1 -1
  1363. package/tui/dist/terminals/terminal-model.d.ts +2 -1
  1364. package/tui/dist/terminals/terminal-model.d.ts.map +1 -1
  1365. package/tui/dist/terminals/terminal-model.js +5 -4
  1366. package/tui/dist/terminals/terminal-model.js.map +1 -1
  1367. package/tui/dist/topology/fixture.js +1 -1
  1368. package/tui/dist/topology/fixture.js.map +1 -1
  1369. package/tui/dist/topology/glyphs.js +1 -1
  1370. package/tui/dist/topology/glyphs.js.map +1 -1
  1371. package/tui/dist/topology/graph-types.d.ts +1 -0
  1372. package/tui/dist/topology/graph-types.d.ts.map +1 -1
  1373. package/tui/dist/types.d.ts +25 -0
  1374. package/tui/dist/types.d.ts.map +1 -1
  1375. package/tui/dist/usage/usage-model.d.ts.map +1 -1
  1376. package/tui/dist/usage/usage-model.js +5 -3
  1377. package/tui/dist/usage/usage-model.js.map +1 -1
  1378. package/ui/dist/assets/{index-CVgod3Pm.js → index-DLP1ipGq.js} +92 -92
  1379. package/ui/dist/index.html +1 -1
@@ -1,4 +1,6 @@
1
+ import { TerminalPolicyRefusal } from "./terminal-policy.js";
1
2
  import { DeliveryGuardError } from "./seat-delivery-guard.js";
3
+ import { postCompactExtraSetting } from "./managed-restore-read-access.js";
2
4
  import * as fs from "node:fs";
3
5
  import { randomUUID } from "node:crypto";
4
6
  import * as os from "node:os";
@@ -23,10 +25,19 @@ import * as path from "node:path";
23
25
  * session must drop below threshold before another auto-compact can
24
26
  * fire. The dedup window still blocks immediate flaps; the threshold
25
27
  * crossing rule prevents one high-usage session from receiving
26
- * /compact every 60s. State is intentionally NOT persisted; daemon
27
- * restart resets the window which is the safer-failure direction
28
- * (might re-compact once on restart in rare cases, won't lock out
29
- * forever).
28
+ * /compact every 60s. This window is intentionally NOT persisted; daemon
29
+ * restart resets it, which is the safer-failure direction (might
30
+ * re-compact once on restart in rare cases, won't lock out forever).
31
+ * - Restart: each attempt's record (COMPACTION-STATE.json, beside its map)
32
+ * says what the daemon last did for it, so a restarted daemon resumes an
33
+ * owed restore and waits on an open preparation instead of starting a
34
+ * second one (`recoverAfterRestart`). A prompt or /compact is marked in
35
+ * flight at its write, so a restart never sends it again. A restart between
36
+ * a post-compact stage's send and its record can send that one stage again.
37
+ * - A /compact whose outcome is unknown owes its restore steps, with or
38
+ * without a restart. Its text may wait unsubmitted in the input box, where
39
+ * any Enter would submit it, so each step goes only into an empty box and
40
+ * is held, visibly, while the box holds text or can't be read.
30
41
  * - Definite pre-write prep failures retry at most three times. Uncertain
31
42
  * delivery never replays. Unfinished preparation stops visibly until an
32
43
  * explicit retry; it cannot arm a delayed compact after its deadline.
@@ -184,7 +195,7 @@ function resolvePostCompactExtra(sessionName, openrigHome, globalPath) {
184
195
  }
185
196
  return { filePath: perSeatPath, ignoredWrongSeat: false };
186
197
  }
187
- const trimmed = globalPath?.trim();
198
+ const trimmed = postCompactExtraSetting(globalPath);
188
199
  if (!trimmed)
189
200
  return { filePath: null, ignoredWrongSeat: false };
190
201
  const global = readExtraDeclaredSeat(trimmed);
@@ -235,7 +246,8 @@ export function buildPostCompactRestorePrompt(input) {
235
246
  // refused at the source. Tell the seat NOT to seek it out (it is not its state).
236
247
  pieces.push("A post-compaction instruction file declaring a DIFFERENT seat was present and has been IGNORED — it is not yours; do NOT read or follow it. Rely on the per-seat marker and the JSONL transcript for restore.");
237
248
  }
238
- pieces.push("Load/read the claude-compaction-restore skill, follow the marker's restoreInstruction and postCompactInstruction when present, read your newest restore map and use the restore packet as a lookup, then reply with: restored from packet at <path>; resumed at step <X>.");
249
+ const restoreMap = input.attemptMapPath ? "this preparation attempt's restore map" : "your newest restore map";
250
+ pieces.push(`Load/read the claude-compaction-restore skill, follow the marker's restoreInstruction and postCompactInstruction when present, read ${restoreMap} and use the restore packet as a lookup, then reply with: restored from packet at <path>; resumed at step <X>.`);
239
251
  pieces.push(`During this restore, read ${path.join(input.openrigHome, "plugins", "openrig-core", "skills", "refocusing", "SKILL.md")} and consume the current topology and work traces delivered with this restore request, if present; do not rerun Python just to duplicate a delivered trace. Missing trace delivery is a named gap. Read required notes and full sources with the native file-read tool; a pointer, compact summary or truncated extract is not a full source read. Name any missing source, the current user outcome, and your next action from the files you actually read, not from the compact summary.`);
240
252
  return pieces.join(" ");
241
253
  }
@@ -257,6 +269,43 @@ export function buildPostCompactTurnBoundaryPrompt() {
257
269
  "Do not restore yet; the next normal user message will contain the restore instructions.",
258
270
  ].join(" ");
259
271
  }
272
+ /** The file, beside an attempt's restore map, where the daemon records what it last did for that attempt. The agent
273
+ * never writes it. A restarted daemon reads it to pick the attempt up again. */
274
+ export const COMPACTION_RECORD_FILE = "COMPACTION-STATE.json";
275
+ /** How old a record may be for a restarted daemon to resume it. An older open record isn't resumed: it reads as
276
+ * stranded, so whoever reaches the seat is told its restore may still be owed. Operational, not measured. */
277
+ export const RESTART_RECOVERY_WINDOW_MS_DEFAULT = 6 * 60 * 60_000;
278
+ /** This daemon process. A record this process wrote is its own state, never something to recover. */
279
+ const DAEMON_PROCESS_ID = randomUUID();
280
+ const RECORD_PHASES = new Set(["preparing", "turn_boundary", "restore_prompt", "compliance_prompt", "compact_uncertain", "done", "ended"]);
281
+ const RECORD_DELIVERIES = new Set(["pending", "not_sent", "delivered", "uncertain"]);
282
+ /** A record only in the shape this daemon writes. Any other (a newer daemon's after a rollback, a damaged file) is ignored,
283
+ * so it can't hold up a seat's compaction. */
284
+ function readCompactionRecord(file) {
285
+ try {
286
+ const r = JSON.parse(fs.readFileSync(file, "utf8"));
287
+ const text = (v) => typeof v === "string";
288
+ const textOrNull = (v) => v === null || typeof v === "string";
289
+ const carry = r.restoreCarry;
290
+ const valid = text(r.daemon) && text(r.attemptId) && text(r.session) && textOrNull(r.occupantGeneration)
291
+ && (r.mode === "automatic" || r.mode === "manual") && RECORD_PHASES.has(r.phase) && RECORD_DELIVERIES.has(r.delivery)
292
+ && (r.deadlineAt === null || Number.isFinite(r.deadlineAt)) && Number.isInteger(r.sends) && r.sends >= 0 && r.sends <= PREP_SEND_ATTEMPTS_MAX
293
+ && text(r.mapPath) && text(r.marker) && text(r.compactInstruction) && textOrNull(r.preparationRoot) && Number.isFinite(r.updatedAt)
294
+ && (r.operatorInitiated === undefined || typeof r.operatorInitiated === "boolean") && (r.compactSending === undefined || r.compactSending === true)
295
+ && (r.uncertainCompact === undefined || r.uncertainCompact === true)
296
+ && (carry === undefined || (typeof carry === "object" && carry !== null && textOrNull(carry.mapPath) && textOrNull(carry.compactInstruction)
297
+ && (carry.skipMap === undefined || (text(carry.skipMap?.mapPath) && text(carry.skipMap?.marker)))));
298
+ return valid ? r : null;
299
+ }
300
+ catch {
301
+ return null;
302
+ }
303
+ }
304
+ /** Input-box readings that hold nothing typed: an owed step after an uncertain /compact may go in. A harness suggestion isn't input. */
305
+ const INPUT_BOX_CLEAR = new Set(["empty", "likely-suggestion"]);
306
+ function strandedSummary(record) {
307
+ return { attemptId: record.attemptId, mapPath: record.mapPath, phase: record.phase, recordedAt: new Date(record.updatedAt).toISOString() };
308
+ }
260
309
  export class ClaudeCompactionEnforcer {
261
310
  settingsStore;
262
311
  sessionTransport;
@@ -285,9 +334,26 @@ export class ClaudeCompactionEnforcer {
285
334
  // unknown). At drain we compare it to the LIVE generation; a mismatch = a successor inheriting a
286
335
  // retired-generation stage → refuse. Injected resolver (atom-B's currentOccupantTenure by session).
287
336
  pendingStageGeneration = new Map();
337
+ /** Each seat's current attempt record, as last written beside its map. */
338
+ records = new Map();
339
+ /** Seats whose records this daemon has already looked for after starting. */
340
+ recovered = new Set();
341
+ /** Open records too old to resume: the seat's restore may still be owed. */
342
+ stranded = new Map();
343
+ /** Seats whose owed restore steps follow a /compact whose outcome is unknown: its text may wait unsubmitted in the input
344
+ * box, where any Enter would submit it, so each step goes only into an empty box. */
345
+ afterUncertainCompact = new Set();
346
+ /** What the input box last read for such a seat, before an owed step (absent until the first check). */
347
+ lastInputBox = new Map();
348
+ restartRecoveryWindowMs;
349
+ daemonInstance;
288
350
  resolveOccupantGeneration;
289
351
  onPostRestoreComplete;
352
+ onRestoreDeliveryFailure;
353
+ terminalPolicies;
290
354
  constructor(settingsStore, sessionTransport, opts) {
355
+ this.onRestoreDeliveryFailure = opts?.onRestoreDeliveryFailure;
356
+ this.terminalPolicies = opts?.terminalPolicies;
291
357
  this.settingsStore = settingsStore;
292
358
  this.sessionTransport = sessionTransport;
293
359
  this.dedupWindowMs = opts?.dedupWindowMs ?? DEDUP_WINDOW_MS_DEFAULT;
@@ -299,6 +365,8 @@ export class ClaudeCompactionEnforcer {
299
365
  this.sleep = opts?.sleep ?? (ms => new Promise(resolve => setTimeout(resolve, ms)));
300
366
  this.postCompactSendWaitMs = opts?.postCompactSendWaitMs ?? POST_COMPACT_SEND_WAIT_MS_DEFAULT;
301
367
  this.compactSendIdleWaitMs = opts?.compactSendIdleWaitMs ?? 1000;
368
+ this.restartRecoveryWindowMs = opts?.restartRecoveryWindowMs ?? RESTART_RECOVERY_WINDOW_MS_DEFAULT;
369
+ this.daemonInstance = opts?.daemonInstance ?? DAEMON_PROCESS_ID;
302
370
  this.resolveOccupantGeneration = opts?.resolveOccupantGeneration;
303
371
  this.onPostRestoreComplete = opts?.onPostRestoreComplete;
304
372
  }
@@ -318,23 +386,75 @@ export class ClaudeCompactionEnforcer {
318
386
  */
319
387
  observedCompaction(sessionName) {
320
388
  const owed = this.pendingPostCompactRestore.get(sessionName);
389
+ const held = this.getOwedRestore(sessionName);
390
+ if (held?.held)
391
+ return { stage: owed === "compliance_prompt" ? "restoring" : owed === "restore_prompt" ? "compacted" : "compacting", detail: held.detail };
321
392
  if (owed === "compliance_prompt")
322
393
  return { stage: "restoring", detail: "mid-restore: the restore request was sent and the post-restore audit is still owed" };
323
394
  if (owed === "restore_prompt")
324
395
  return { stage: "compacted", detail: "compacted, with its restore not yet requested" };
325
- if (owed === "turn_boundary")
326
- return { stage: "compacting", detail: "being compacted: /compact was submitted and the post-compaction steps haven't started" };
327
396
  const attempt = this.pendingPreCompactPrep.get(sessionName);
328
- if (attempt?.status === "sending" || attempt?.status === "waiting")
329
- return { stage: "preparing", detail: "preparing for a managed compaction: /compact hasn't been sent yet" };
397
+ if (owed === "turn_boundary") {
398
+ return { stage: "compacting", detail: attempt?.compact === "uncertain"
399
+ ? "possibly being compacted: /compact may have been submitted (its result was lost) and the post-compaction steps haven't started"
400
+ : "being compacted: /compact was submitted and the post-compaction steps haven't started" };
401
+ }
402
+ if (attempt?.status === "sending" || attempt?.status === "waiting") {
403
+ return { stage: "preparing", detail: `preparing for a managed compaction: /compact hasn't been sent yet${attempt.supersedes
404
+ ? `; it replaces a compaction from before an OpenRig restart whose restore steps may still have been owed (map ${attempt.supersedes.mapPath})` : ""}` };
405
+ }
330
406
  if (attempt?.status === "compact-sent")
331
407
  return { stage: "compacting", detail: "being compacted: /compact was submitted and the post-compaction steps haven't started" };
408
+ if (this.stranded.has(sessionName)) {
409
+ return { stage: "compacted", detail: "compacted before an OpenRig restart, with its restore steps possibly still owed: the record is too old for OpenRig to resume them" };
410
+ }
332
411
  return null;
333
412
  }
334
- /** True while a post-compact stage (turn boundary, restore or audit) is still owed to this seat. */
335
- hasPendingPostCompactStage(sessionName) {
413
+ /** True while a post-compact stage (turn boundary, restore or audit) is still owed to this seat. Given the seat, a
414
+ * restarted daemon first picks up a stage its predecessor recorded (`recoverAfterRestart`). */
415
+ hasPendingPostCompactStage(sessionName, seat) {
416
+ if (seat)
417
+ this.recoverSeat({ sessionName, ...seat });
336
418
  return this.pendingPostCompactRestore.has(sessionName);
337
419
  }
420
+ /** The first time this daemon reaches a seat (a poll, a manual request, a state read): pick up its record from before a
421
+ * restart, with the policy's preparation root (`recoverAfterRestart`). */
422
+ recoverSeat(seat) {
423
+ if (seat.runtime !== "claude-code" || this.recovered.has(seat.sessionName))
424
+ return;
425
+ let preparationRoot = null;
426
+ try {
427
+ preparationRoot = this.settingsStore.resolveClaudeCompactionPolicy().preparationRoot || null;
428
+ }
429
+ catch { /* default roots */ }
430
+ this.recoverAfterRestart(seat, preparationRoot);
431
+ }
432
+ /** The restore step OpenRig owes this seat next, or null. After a /compact whose outcome is unknown (see
433
+ * `afterUncertainCompact`) it also gives what the input box last read (`not_checked` before the first check) and
434
+ * whether the step is held for it. */
435
+ getOwedRestore(sessionName) {
436
+ const stage = this.pendingPostCompactRestore.get(sessionName);
437
+ if (!stage)
438
+ return null;
439
+ const lastDelivery = this.records.get(sessionName)?.record.lastDelivery;
440
+ const failed = !!lastDelivery && lastDelivery.failures > 0;
441
+ const last = lastDelivery ? { lastDelivery } : {};
442
+ const failure = lastDelivery ? ` ${failed ? "Last delivery" : "waiting: seat busy"} at ${lastDelivery.at}: ${[lastDelivery.reason, lastDelivery.activity?.reason, lastDelivery.errorClass, lastDelivery.noticeErrorClass && `owner notice failed (${lastDelivery.noticeErrorClass})`].filter(Boolean).join("; ")}. OpenRig will retry on its existing polls.` : "";
443
+ const step = { turn_boundary: "post-compaction turn boundary", restore_prompt: "restore request", compliance_prompt: "post-restore audit" }[stage];
444
+ if (!this.afterUncertainCompact.has(sessionName)) {
445
+ return { stage, held: failed, ...last, detail: `OpenRig owes this seat its ${step} next, sent on a poll once the pane is idle.${failure}` };
446
+ }
447
+ const inputBox = this.lastInputBox.get(sessionName) ?? "not_checked";
448
+ const held = inputBox !== "not_checked" && !INPUT_BOX_CLEAR.has(inputBox);
449
+ return { stage, held: held || failed, inputBox, ...last, detail: (held
450
+ ? `held: OpenRig owes this seat its restore steps after a /compact whose result was lost, and waits while its input box isn't empty (it reads ${inputBox}). The seat may have /compact text waiting, which any Enter would submit, so check the pane. A seat whose own status line keeps the box unreadable stays held.`
451
+ : `OpenRig owes this seat its ${step} next, after a /compact whose result was lost. Each step goes only into an empty input box, sent on a poll once the pane is idle (the box last read ${inputBox}).`) + failure };
452
+ }
453
+ /** An open record from before a restart that was too old to resume, while no later attempt has replaced it. */
454
+ getStrandedCompaction(sessionName) {
455
+ const record = this.stranded.get(sessionName);
456
+ return record ? strandedSummary(record) : null;
457
+ }
338
458
  /**
339
459
  * Drain a post-compact stage that is already pending, without a usage sample. ContextMonitor
340
460
  * calls this when the latest sample is stale or unknown. Such a sample never starts a
@@ -360,21 +480,84 @@ export class ClaudeCompactionEnforcer {
360
480
  return (await this.drainPendingStage(unsampled, policy)) ?? { triggered: false, reason: "no_pending_stage" };
361
481
  });
362
482
  }
483
+ terminalPolicyReason(input, actor) {
484
+ const nodeId = input.nodeId ?? this.sessionTransport.deliveryGuard?.maybeTarget(input.sessionName)?.nodeId;
485
+ if (!this.terminalPolicies || !nodeId)
486
+ return null;
487
+ try {
488
+ this.terminalPolicies.check(nodeId, "compaction", actor);
489
+ return null;
490
+ }
491
+ catch (error) {
492
+ return error instanceof TerminalPolicyRefusal ? "terminal_policy_refused" : actor.source === "openrig" ? null : "terminal_policy_unavailable";
493
+ }
494
+ }
495
+ checkAttemptPolicy(input, attempt) {
496
+ const reason = this.terminalPolicyReason(input, attempt.policyActor ?? { source: "openrig" });
497
+ if (reason)
498
+ throw new DeliveryGuardError(reason, "This seat's terminal policy does not allow this managed compaction. Read rig seat status <seat> to see or change the explicit choice; the existing override path is unchanged.");
499
+ }
363
500
  async withDeliveryGuard(input, run) {
501
+ const stage = this.pendingPostCompactRestore.get(input.sessionName);
502
+ const record = this.records.get(input.sessionName);
503
+ const previous = record?.record.lastDelivery;
364
504
  const runIfCurrent = () => input.isObservationCurrent && !input.isObservationCurrent()
365
505
  ? Promise.resolve({ triggered: false, reason: "stale_observation" }) : run();
366
506
  const guard = this.sessionTransport.deliveryGuard;
367
- if (guard && input.runtime === "claude-code") {
368
- try {
369
- return await guard.lifecycle([guard.target(input.sessionName).nodeId], runIfCurrent);
507
+ try {
508
+ const outcome = guard && input.runtime === "claude-code"
509
+ ? await guard.lifecycle([guard.target(input.sessionName).nodeId], runIfCurrent) : await runIfCurrent();
510
+ // Refusals before send (policy, guard, observation) must be visible too. A send has already recorded its full result.
511
+ if (!outcome.triggered && record?.record.lastDelivery === previous) {
512
+ this.recordRestoreFailure(input.sessionName, stage, record, { ok: false, reason: outcome.reason });
370
513
  }
371
- catch (error) {
372
- if (error instanceof DeliveryGuardError)
373
- return { triggered: false, reason: error.code === "typing_guard_enabled" ? "typing_guard_enabled" : "guard_target_unknown" };
374
- throw error;
514
+ return outcome;
515
+ }
516
+ catch (error) {
517
+ this.recordRestoreFailure(input.sessionName, stage, record, {
518
+ ok: false, reason: error instanceof DeliveryGuardError ? error.code : "send_failed",
519
+ }, error instanceof Error ? error.name : typeof error);
520
+ if (error instanceof DeliveryGuardError)
521
+ return { triggered: false, reason: error.code === "typing_guard_enabled" ? "typing_guard_enabled" : "guard_target_unknown" };
522
+ throw error;
523
+ }
524
+ finally {
525
+ // The awaited lifecycle has settled: notice work must not inherit its active lease.
526
+ const lastDelivery = record?.record.lastDelivery;
527
+ if (record && lastDelivery && lastDelivery !== previous && lastDelivery.failures >= 2 && this.onRestoreDeliveryFailure) {
528
+ void Promise.resolve().then(() => {
529
+ if (this.records.get(input.sessionName) !== record || record.record.lastDelivery !== lastDelivery || this.pendingPostCompactRestore.get(input.sessionName) !== stage)
530
+ return;
531
+ return this.onRestoreDeliveryFailure({ sessionName: input.sessionName, attemptId: record.record.attemptId, mapPath: record.record.mapPath, lastDelivery });
532
+ }).catch(error => {
533
+ if (this.records.get(input.sessionName) === record && record.record.lastDelivery === lastDelivery && this.pendingPostCompactRestore.get(input.sessionName) === stage) {
534
+ lastDelivery.noticeErrorClass = error instanceof Error ? error.name : typeof error;
535
+ this.persist(input.sessionName, record.record.attemptId, { lastDelivery });
536
+ }
537
+ });
375
538
  }
376
539
  }
377
- return runIfCurrent();
540
+ }
541
+ recordRestoreFailure(session, stage, record, result, errorClass) {
542
+ if (!stage || !record || this.records.get(session) !== record || this.pendingPostCompactRestore.get(session) !== stage)
543
+ return;
544
+ const prior = record.record.lastDelivery;
545
+ // Active work is the expected wait between restore steps, not an undeliverable stage.
546
+ const waiting = result.reason === "wait_for_idle_timeout" && result.activity?.state === "running";
547
+ const lastDelivery = {
548
+ stage, at: new Date(this.now()).toISOString(), ok: result.ok, reason: result.reason ?? "send_failed",
549
+ ...(result.outcome ? { outcome: result.outcome } : {}),
550
+ ...(result.activity ? { activity: { state: result.activity.state, reason: result.activity.reason, evidenceSource: result.activity.evidenceSource } } : {}),
551
+ ...(errorClass ? { errorClass } : {}), failures: waiting ? 0 : (prior?.failures ?? 0) + 1,
552
+ };
553
+ this.persist(session, record.record.attemptId, { lastDelivery });
554
+ }
555
+ async sendRestoreStage(session, text, options) {
556
+ const stage = this.pendingPostCompactRestore.get(session), record = this.records.get(session);
557
+ const result = await this.sessionTransport.send(session, text, options);
558
+ if (!result.ok || result.outcome === "retained")
559
+ this.recordRestoreFailure(session, stage, record, result);
560
+ return result;
378
561
  }
379
562
  /**
380
563
  * Gate and send the pending post-compact stage, one stage per call. Returns null when no stage
@@ -388,6 +571,7 @@ export class ClaudeCompactionEnforcer {
388
571
  const isCurrent = () => this.pendingPostCompactRestore.get(input.sessionName) === pendingStage
389
572
  && this.pendingPreCompactPrep.get(input.sessionName) === attempt;
390
573
  const sendOpts = {
574
+ openrigNotice: true,
391
575
  beforeWrite: () => {
392
576
  if (!isCurrent())
393
577
  throw new DeliveryGuardError("compaction_cancelled", "Managed compaction was cancelled or replaced; no further input is authorized.");
@@ -422,8 +606,20 @@ export class ClaudeCompactionEnforcer {
422
606
  return { triggered: false, reason: "stale_generation" };
423
607
  }
424
608
  }
609
+ // After a /compact whose outcome is unknown, its text may still wait unsubmitted in the input box, and this step's Enter
610
+ // would submit it. So each step goes only into a box holding nothing typed (a harness suggestion isn't input); while it
611
+ // holds text or can't be read, the step waits for the next poll, and the notice and --state say why.
612
+ if (this.afterUncertainCompact.has(input.sessionName)) {
613
+ const box = await this.inputBoxStatus(input.sessionName);
614
+ if (!isCurrent())
615
+ return { triggered: false, reason: "preparation_stopped" };
616
+ this.lastInputBox.set(input.sessionName, box);
617
+ if (!INPUT_BOX_CLEAR.has(box))
618
+ return { triggered: false, reason: "input_box_not_empty" };
619
+ }
425
620
  if (pendingStage === "turn_boundary") {
426
- const boundary = await this.sessionTransport.send(input.sessionName, buildPostCompactTurnBoundaryPrompt(), sendOpts);
621
+ // Only this first step after /compact reads past the compaction output that fills the screen above the input box.
622
+ const boundary = await this.sendRestoreStage(input.sessionName, buildPostCompactTurnBoundaryPrompt(), { ...sendOpts, postCompactTurnBoundary: true });
427
623
  if (!isCurrent())
428
624
  return { triggered: false, reason: "preparation_stopped" };
429
625
  if (!boundary.ok || boundary.outcome === "retained") {
@@ -431,13 +627,14 @@ export class ClaudeCompactionEnforcer {
431
627
  return { triggered: false, reason: "send_failed" };
432
628
  }
433
629
  this.pendingPostCompactRestore.set(input.sessionName, "restore_prompt");
630
+ this.persistStage(input.sessionName, "restore_prompt");
434
631
  return { triggered: true };
435
632
  }
436
633
  if (pendingStage === "restore_prompt") {
437
634
  // OPR.0.4.1.09: resolve the extra FOR THIS SEAT (per-seat preferred; the legacy
438
635
  // global is refused if it declares a different seat) - never inject wrong-seat state.
439
636
  const extra = resolvePostCompactExtra(input.sessionName, this.openrigHome, policy.messageFilePath);
440
- const restore = await this.sessionTransport.send(input.sessionName, buildPostCompactRestorePrompt({
637
+ const restore = await this.sendRestoreStage(input.sessionName, buildPostCompactRestorePrompt({
441
638
  sessionName: input.sessionName,
442
639
  openrigHome: this.openrigHome,
443
640
  ...this.restoreMapFields(input.sessionName),
@@ -457,13 +654,14 @@ export class ClaudeCompactionEnforcer {
457
654
  return { triggered: false, reason: "send_failed" };
458
655
  }
459
656
  this.pendingPostCompactRestore.set(input.sessionName, "compliance_prompt");
657
+ this.persistStage(input.sessionName, "compliance_prompt");
460
658
  this.restoreCarry.delete(input.sessionName);
461
659
  // OPR.0.4.3.14 — surface manual-trigger progress (no-op for auto seats).
462
660
  this.advanceManualStage(input.sessionName, "compact-sent", "restore-sent");
463
661
  return { triggered: true };
464
662
  }
465
663
  if (pendingStage === "compliance_prompt") {
466
- const compliance = await this.sessionTransport.send(input.sessionName, buildPostCompactCompliancePrompt(policy.postRestoreAuditInstruction), sendOpts);
664
+ const compliance = await this.sendRestoreStage(input.sessionName, buildPostCompactCompliancePrompt(policy.postRestoreAuditInstruction), sendOpts);
467
665
  if (!isCurrent())
468
666
  return { triggered: false, reason: "preparation_stopped" };
469
667
  if (!compliance.ok || compliance.outcome === "retained") {
@@ -486,8 +684,14 @@ export class ClaudeCompactionEnforcer {
486
684
  if (!isCurrent())
487
685
  return { triggered: false, reason: "preparation_stopped" };
488
686
  this.pendingPostCompactRestore.delete(input.sessionName);
687
+ this.persistStage(input.sessionName, "done");
688
+ this.records.delete(input.sessionName);
689
+ this.afterUncertainCompact.delete(input.sessionName);
690
+ this.lastInputBox.delete(input.sessionName);
489
691
  this.restoreCarry.delete(input.sessionName);
490
- if (this.pendingPreCompactPrep.get(input.sessionName)?.status === "compact-sent")
692
+ // The attempt is finished, including one stopped after a lost /compact result whose restore this was.
693
+ const finished = this.pendingPreCompactPrep.get(input.sessionName);
694
+ if (finished?.status === "compact-sent" || finished?.compact === "uncertain")
491
695
  this.pendingPreCompactPrep.delete(input.sessionName);
492
696
  this.pendingStageGeneration.delete(input.sessionName); // GHOST-STAGE (b): stage completed → drop its gen
493
697
  this.postCompactRestoreCooldownUntil.set(input.sessionName, Date.now() + this.postCompactRestoreCooldownMs);
@@ -519,6 +723,7 @@ export class ClaudeCompactionEnforcer {
519
723
  if (!isValidThresholdPercent(policy.thresholdPercent)) {
520
724
  return { triggered: false, reason: "invalid_policy" };
521
725
  }
726
+ this.recoverAfterRestart(input, policy.preparationRoot || null);
522
727
  // A trigger sample must not block work already owed to this occupant. Restore reads can
523
728
  // themselves exceed a low threshold; keep the same stage, authorization and idle gates.
524
729
  const drained = await this.drainPendingStage(input, policy);
@@ -553,6 +758,13 @@ export class ClaudeCompactionEnforcer {
553
758
  if (this.triggeredAboveThreshold.has(input.sessionName)) {
554
759
  return { triggered: false, reason: "already_triggered_above_threshold" };
555
760
  }
761
+ const policyRefusal = this.terminalPolicyReason(input, { source: "openrig" });
762
+ if (policyRefusal) {
763
+ const existing = this.pendingPreCompactPrep.get(input.sessionName);
764
+ if (existing?.mode === "automatic" && existing.compact === "not_sent")
765
+ this.stopPreparation(input.sessionName, policyRefusal, existing);
766
+ return { triggered: false, reason: policyRefusal };
767
+ }
556
768
  // Before any preparation prompt or /compact copy: a protected seat with no recorded pane cannot take input.
557
769
  // An attempt already under way stops as not sent; none is begun.
558
770
  if (this.paneUnknownProtected(input.sessionName)) {
@@ -577,7 +789,7 @@ export class ClaudeCompactionEnforcer {
577
789
  if (!attempt) {
578
790
  attempt = this.beginPreparation(input, "automatic");
579
791
  if (attempt.status === "stopped")
580
- return { triggered: false, reason: "occupant_generation_unavailable" };
792
+ return { triggered: false, reason: attempt.reason === "preparation_directory_unavailable" ? attempt.reason : "occupant_generation_unavailable" };
581
793
  }
582
794
  if (attempt.status === "sending") {
583
795
  await this.deliverPreparation(input, attempt);
@@ -616,6 +828,10 @@ export class ClaudeCompactionEnforcer {
616
828
  return this.triggerManualCompactUnchecked(input, opts);
617
829
  }
618
830
  async triggerManualCompactUnchecked(input, opts) {
831
+ // The manual budget starts with the request. A request reaching a seat before the monitor's first poll after a restart
832
+ // finds its owed restore or open preparation first, so it neither prepares twice nor replaces the owed restore.
833
+ const requestedAt = this.now();
834
+ this.recoverSeat(input);
619
835
  this.reconcilePreparations();
620
836
  const active = this.pendingPreCompactPrep.get(input.sessionName);
621
837
  const stage = this.manualCompactionState.get(input.sessionName)?.stage;
@@ -631,9 +847,13 @@ export class ClaudeCompactionEnforcer {
631
847
  // The preparation prompt cannot be written to such a seat either, so the whole attempt is refused up front.
632
848
  if (this.paneUnknownProtected(input.sessionName))
633
849
  return this.recordManualFailure(input.sessionName, "pane_unknown_protected");
634
- const attempt = this.beginPreparation(input, "manual", opts.skipMap === true);
850
+ const actor = opts.actor ?? { source: "caller", session: null };
851
+ const policyRefusal = this.terminalPolicyReason(input, actor);
852
+ if (policyRefusal)
853
+ return this.recordManualFailure(input.sessionName, policyRefusal);
854
+ const attempt = this.beginPreparation(input, "manual", opts.skipMap === true, actor, requestedAt);
635
855
  if (attempt.status === "stopped")
636
- return this.recordManualFailure(input.sessionName, "occupant_generation_unavailable");
856
+ return this.recordManualFailure(input.sessionName, attempt.reason ?? "occupant_generation_unavailable");
637
857
  const failed = (reason) => {
638
858
  // A cancelled request may settle after an explicit retry. Its receipt must
639
859
  // not stop or overwrite the successor attempt's state.
@@ -679,34 +899,51 @@ export class ClaudeCompactionEnforcer {
679
899
  }
680
900
  const compact = await this.sendPreparedCompact(input, attempt, opts.skipMap === true);
681
901
  if (!compact.ok) {
682
- return failed(compact.reason ?? "send_failed");
902
+ const outcome = failed(compact.reason ?? "send_failed");
903
+ // A /compact whose result was lost still owes its restore steps, and this request authorizes them.
904
+ if (!this.pendingPostCompactRestore.has(input.sessionName) || this.pendingPreCompactPrep.get(input.sessionName) !== attempt)
905
+ return outcome;
906
+ this.setManualStage(input.sessionName, "compact-sent", outcome.reason, opts.operatorInitiated === true);
907
+ return { ...outcome, restoreOwed: true };
683
908
  }
684
909
  this.setManualStage(input.sessionName, "compact-sent", undefined, opts.operatorInitiated === true);
685
910
  return { triggered: true, stage: "compact-sent" };
686
911
  }
687
- beginPreparation(input, mode, skipMap = false) {
912
+ beginPreparation(input, mode, skipMap = false, policyActor = { source: "openrig" }, startedAt = this.now()) {
688
913
  const attemptId = randomUUID();
914
+ const policy = this.settingsStore.resolveClaudeCompactionPolicy();
915
+ const preparationRoot = policy.preparationRoot || null;
689
916
  const fallbackMapPath = path.join(this.openrigHome, "compaction", "preparation", sanitizeSessionKey(input.sessionName), attemptId, "RESTORE-MAP.md");
690
917
  const occupantGeneration = this.resolveOccupantGeneration?.(input.sessionName)
691
918
  ?? this.sessionTransport.deliveryGuard?.maybeTarget(input.sessionName)?.occupant ?? null;
692
919
  const attempt = {
693
- attemptId, occupantGeneration, mode, status: "sending", delivery: "pending", compact: "not_sent", sends: 0,
694
- deadlineAt: mode === "manual" ? this.now() + this.manualPrepWaitMs : null,
695
- mapPath: fallbackMapPath,
920
+ policyActor, attemptId, occupantGeneration, mode, status: "sending", delivery: "pending", compact: "not_sent", sends: 0,
921
+ deadlineAt: mode === "manual" ? startedAt + this.manualPrepWaitMs : null,
922
+ mapPath: preparationRoot ? path.join(preparationRoot, sanitizeSessionKey(input.sessionName), attemptId, "RESTORE-MAP.md") : fallbackMapPath,
696
923
  marker: `<!-- openrig-compaction-complete ${JSON.stringify({ attemptId, session: input.sessionName, occupantGeneration })} -->`,
697
- policyWasEnabled: this.settingsStore.resolveClaudeCompactionPolicy().enabled,
924
+ policyWasEnabled: policy.enabled,
925
+ preparationRoot,
698
926
  controller: new AbortController(),
699
- compactInstruction: this.settingsStore.resolveClaudeCompactionPolicy().compactInstruction ?? "",
927
+ compactInstruction: policy.compactInstruction ?? "",
700
928
  };
929
+ // A stranded record this attempt replaces stays visible on the attempt, not dropped quietly.
930
+ const stranded = this.stranded.get(input.sessionName);
931
+ if (stranded)
932
+ attempt.supersedes = strandedSummary(stranded);
701
933
  this.pendingPreCompactPrep.set(input.sessionName, attempt);
934
+ this.stranded.delete(input.sessionName);
702
935
  // A map cannot satisfy an unknown occupant. Keep the failed attempt visible and
703
936
  // disarmed; explicit skip-map still bypasses only the artifact prerequisite.
704
937
  if (occupantGeneration === null && !skipMap)
705
938
  this.stopPreparation(input.sessionName, "occupant_generation_unavailable");
706
- if (attempt.status !== "stopped" && input.cwd && path.isAbsolute(input.cwd)) {
707
- // Keep writes inside Claude's existing edit workspace, without adding permissions.
708
- // This folder holds private working context; ignore its entire contents in Git.
709
- const root = path.join(input.cwd, ".openrig", "compaction");
939
+ if (skipMap && preparationRoot) {
940
+ this.startRecord(input.sessionName, attempt);
941
+ return attempt;
942
+ }
943
+ if (attempt.status !== "stopped" && (preparationRoot || (input.cwd && path.isAbsolute(input.cwd)))) {
944
+ // An explicit root can be outside a workspace denied by Claude file permissions.
945
+ // The daemon cannot prove those permissions; the operator grants access to this root.
946
+ const root = preparationRoot ?? path.join(input.cwd, ".openrig", "compaction");
710
947
  try {
711
948
  fs.mkdirSync(root, { recursive: true });
712
949
  const ignorePath = path.join(root, ".gitignore");
@@ -730,12 +967,17 @@ export class ClaudeCompactionEnforcer {
730
967
  fs.closeSync(fd);
731
968
  }
732
969
  }
733
- const parent = path.join(root, "preparation", sanitizeSessionKey(input.sessionName), attemptId);
970
+ const parent = path.join(preparationRoot ?? path.join(root, "preparation"), sanitizeSessionKey(input.sessionName), attemptId);
734
971
  fs.mkdirSync(parent, { recursive: true });
735
972
  fs.accessSync(parent, fs.constants.W_OK | fs.constants.X_OK);
736
973
  attempt.mapPath = path.join(parent, "RESTORE-MAP.md");
737
974
  }
738
- catch { /* Preserve the existing instance-home path for legacy or unwritable workspaces. */ }
975
+ catch {
976
+ // An explicit location is a permission choice: never silently move it back into
977
+ // the denied workspace or instance home. Keep the selected path visible in --state.
978
+ if (preparationRoot)
979
+ this.stopPreparation(input.sessionName, "preparation_directory_unavailable");
980
+ }
739
981
  }
740
982
  if (attempt.status !== "stopped" && attempt.mapPath === fallbackMapPath) {
741
983
  // The cwd path already creates its parent. Prepare the legacy fallback too;
@@ -745,6 +987,8 @@ export class ClaudeCompactionEnforcer {
745
987
  }
746
988
  catch { /* Retain the existing path and deadline if the directory cannot be prepared. */ }
747
989
  }
990
+ if (attempt.status !== "stopped")
991
+ this.startRecord(input.sessionName, attempt);
748
992
  return attempt;
749
993
  }
750
994
  mapReady(attempt, publish = false) {
@@ -786,23 +1030,44 @@ export class ClaudeCompactionEnforcer {
786
1030
  attempt.status = "waiting";
787
1031
  const policy = this.settingsStore.resolveClaudeCompactionPolicy();
788
1032
  let prep;
1033
+ let marked = false;
789
1034
  try {
790
1035
  const composed = composeManagedCompactCommand({ compactInstruction: attempt.compactInstruction, mapPath: attempt.mapPath });
791
1036
  prep = await this.sessionTransport.send(input.sessionName, buildPreCompactPrepPrompt({
792
1037
  overflowCompactInstruction: composed.instructionInCommand ? null : attempt.compactInstruction,
793
1038
  usedPercentage: input.usedPercentage, thresholdPercent: policy.thresholdPercent,
794
1039
  preCompactInstruction: policy.preCompactInstruction, preparation: attempt, constructedAt: this.now(),
795
- }));
1040
+ }), { openrigNotice: true, beforeWrite: () => {
1041
+ this.reconcilePreparations();
1042
+ if (this.pendingPreCompactPrep.get(input.sessionName) !== attempt || attempt.controller.signal.aborted || attempt.status === "stopped")
1043
+ throw new DeliveryGuardError("preparation_stopped", "This compaction attempt ended before preparation input.");
1044
+ this.checkAttemptPolicy(input, attempt);
1045
+ // At the write, a retry included: from here a restart reads this prompt as possibly delivered and never resends it.
1046
+ if (!marked) {
1047
+ marked = true;
1048
+ this.persist(input.sessionName, attempt.attemptId, { delivery: "pending", sends: attempt.sends });
1049
+ }
1050
+ } });
796
1051
  }
797
- catch {
798
- prep = null;
1052
+ catch (error) {
1053
+ if (error instanceof DeliveryGuardError) {
1054
+ const written = error.inputWritten === true;
1055
+ const attempted = error.inputAttempted === true;
1056
+ prep = { ok: false, sent: written, reason: error.code,
1057
+ inputPhase: written ? "written" : attempted ? "attempted" : "not_reached" };
1058
+ }
1059
+ else
1060
+ prep = null;
799
1061
  }
800
- const notSent = prep?.outcome === "retained"
801
- || ["target_needs_input", "session_missing", "typing_guard_enabled", "mid_work", "tmux_unavailable"].includes(prep?.reason ?? "")
802
- || (prep?.sent === false && ["target_runtime_not_running", "target_runtime_unverified", "target_runtime_conflict", "transport_unavailable"].includes(prep.reason ?? ""));
1062
+ const writeAttempted = prep?.inputPhase === "attempted" || prep?.inputPhase === "written" || prep?.sent === true;
1063
+ // `not_reached` is a positive pre-input result: a guard refusal before any write, such as a draft hold.
1064
+ const notSent = !writeAttempted && (prep?.outcome === "retained" || prep?.inputPhase === "not_reached"
1065
+ || ["preparation_stopped", "terminal_policy_refused", "terminal_policy_unavailable", "target_needs_input", "session_missing", "typing_guard_enabled", "mid_work", "tmux_unavailable"].includes(prep?.reason ?? "")
1066
+ || (prep?.sent === false && ["target_runtime_not_running", "target_runtime_unverified", "target_runtime_conflict", "transport_unavailable"].includes(prep.reason ?? "")));
803
1067
  // Record this attempt's effect even if cancellation/retry happened during the await.
804
1068
  // Neither a failed response nor its loss proves no paste/Enter. Never replay uncertainty.
805
1069
  attempt.delivery = prep?.ok && prep.outcome !== "retained" ? "delivered" : notSent ? "not_sent" : "uncertain";
1070
+ this.persist(input.sessionName, attempt.attemptId, { delivery: attempt.delivery, sends: attempt.sends });
806
1071
  if (this.pendingPreCompactPrep.get(input.sessionName) !== attempt || attempt.controller.signal.aborted)
807
1072
  return;
808
1073
  if (notSent) {
@@ -813,23 +1078,43 @@ export class ClaudeCompactionEnforcer {
813
1078
  }
814
1079
  if (attempt.mode === "automatic")
815
1080
  attempt.deadlineAt = this.now() + AUTO_PREP_WAIT_MS_DEFAULT;
1081
+ this.persist(input.sessionName, attempt.attemptId, { deadlineAt: attempt.deadlineAt });
816
1082
  this.reconcilePreparations();
817
1083
  }
818
1084
  async sendPreparedCompact(input, attempt, skipMap) {
819
1085
  const check = () => {
820
1086
  this.reconcilePreparations();
1087
+ this.checkAttemptPolicy(input, attempt);
821
1088
  if (this.pendingPreCompactPrep.get(input.sessionName) !== attempt || attempt.status !== "waiting" || attempt.controller.signal.aborted)
822
1089
  throw new DeliveryGuardError(attempt.reason ?? "preparation_stopped", "Compaction preparation ended; no further input is authorized.");
823
1090
  if (!skipMap && !this.mapReady(attempt, true))
824
1091
  throw new DeliveryGuardError("preparation_incomplete", "This attempt's restore map is incomplete; /compact was not submitted.");
825
1092
  };
826
1093
  const composed = composeManagedCompactCommand({ compactInstruction: attempt.compactInstruction, mapPath: skipMap ? null : attempt.mapPath });
1094
+ // Whatever the command could not carry, the restore request carries instead. An explicitly
1095
+ // selected preparation root also keeps its exact map in that request, even when the command fit it.
1096
+ const carry = skipMap || attempt.preparationRoot !== null || !composed.mapPathInCommand || !composed.instructionInCommand ? {
1097
+ mapPath: !skipMap && (attempt.preparationRoot !== null || !composed.mapPathInCommand) ? attempt.mapPath : null,
1098
+ compactInstruction: composed.instructionInCommand ? null : attempt.compactInstruction,
1099
+ ...(skipMap ? { skipMap: { mapPath: attempt.mapPath, marker: attempt.marker } } : {}),
1100
+ } : undefined;
1101
+ const operatorInitiated = this.manualCompactionState.get(input.sessionName)?.operatorInitiated;
1102
+ let marked = false;
1103
+ // At the write, after the final checks: from here a restart treats /compact as possibly sent, and keeps what its
1104
+ // restore request needs (the carried map and instruction, and a manual request's authority).
1105
+ const beforeWrite = () => {
1106
+ check();
1107
+ if (!marked) {
1108
+ marked = true;
1109
+ this.persist(input.sessionName, attempt.attemptId, { compactSending: true, restoreCarry: carry, operatorInitiated });
1110
+ }
1111
+ };
827
1112
  const send = async () => {
828
1113
  check();
829
1114
  // Both paths send only to an idle seat, with the same idle wait, bounded by the attempt's existing
830
1115
  // deadline. (The automatic path used to send into a seat still finishing its preparation turn.)
831
1116
  // Idle comes from a live pane read: the newest hook can predate the rest of the preparation turn.
832
- return this.sessionTransport.send(input.sessionName, composed.command, { beforeWrite: check, ...(attempt.deadlineAt !== null ? { waitForIdleMs: Math.max(1, Math.min(this.compactSendIdleWaitMs, attempt.deadlineAt - this.now())), readinessFromPaneOnly: true } : {}) });
1117
+ return this.sessionTransport.send(input.sessionName, composed.command, { openrigNotice: true, beforeWrite, ...(attempt.deadlineAt !== null ? { waitForIdleMs: Math.max(1, Math.min(this.compactSendIdleWaitMs, attempt.deadlineAt - this.now())), readinessFromPaneOnly: true } : {}) });
833
1118
  };
834
1119
  let result;
835
1120
  let guardRefused = false;
@@ -852,13 +1137,25 @@ export class ClaudeCompactionEnforcer {
852
1137
  // Nothing sent: a guard refusal before input, a retained send, or the transport's explicit sent:false
853
1138
  // for a send that never reached its write.
854
1139
  const notSent = !writeAttempted && (guardRefused || result.outcome === "retained" || result.sent === false);
1140
+ if (notSent && marked)
1141
+ this.persist(input.sessionName, attempt.attemptId, { compactSending: undefined });
855
1142
  // Only a known pre-input idle deferral keeps the automatic attempt armed for a later poll; the transport
856
1143
  // marks those `not_reached`. reconcilePreparations still ends it at the deadline or on an occupant change.
857
- if (attempt.mode === "automatic" && notSent && phase === "not_reached") {
1144
+ // A typing-guard draft hold (`draft_*`) is `not_reached` too, but it is a refusal, not an idle wait: it stops
1145
+ // as not sent, and a fresh attempt may begin after the retry cooldown.
1146
+ const draftHold = typeof result.reason === "string" && result.reason.startsWith("draft_");
1147
+ if (attempt.mode === "automatic" && notSent && phase === "not_reached" && !draftHold) {
858
1148
  return { ok: false, reason: "waiting_for_idle" };
859
1149
  }
860
1150
  // A compact may have been sent despite a lost result. Never replay automatically.
861
1151
  attempt.compact = notSent ? "not_sent" : "uncertain";
1152
+ // It may have run, so its restore steps are owed, as after a submitted /compact; the restore request tells a seat that
1153
+ // didn't compact to say so and skip. Not when the attempt was cancelled, stopped or replaced during the send.
1154
+ if (!notSent && !attempt.controller.signal.aborted && this.pendingPreCompactPrep.get(input.sessionName) === attempt) {
1155
+ this.owePostCompactRestore(input.sessionName, attempt, carry);
1156
+ this.afterUncertainCompact.add(input.sessionName);
1157
+ this.persist(input.sessionName, attempt.attemptId, { restoreCarry: carry, operatorInitiated, uncertainCompact: true });
1158
+ }
862
1159
  const reason = attempt.reason ?? result.reason ?? "delivery_uncertain";
863
1160
  this.stopPreparation(input.sessionName, reason, attempt);
864
1161
  return { ok: false, reason };
@@ -866,23 +1163,34 @@ export class ClaudeCompactionEnforcer {
866
1163
  attempt.compact = "submitted_unconfirmed";
867
1164
  if (attempt.controller.signal.aborted)
868
1165
  return { ok: false, reason: attempt.reason };
869
- // Whatever the command could not carry, the restore request carries instead.
870
- if (skipMap || !composed.mapPathInCommand || !composed.instructionInCommand) {
871
- this.restoreCarry.set(input.sessionName, {
872
- mapPath: !skipMap && !composed.mapPathInCommand ? attempt.mapPath : null,
873
- compactInstruction: composed.instructionInCommand ? null : attempt.compactInstruction,
874
- ...(skipMap ? { skipMap: { mapPath: attempt.mapPath, marker: attempt.marker } } : {}),
875
- });
876
- }
877
- else
878
- this.restoreCarry.delete(input.sessionName);
879
1166
  attempt.status = "compact-sent";
880
- this.lastAutoCompactAt.set(input.sessionName, this.now());
881
- this.triggeredAboveThreshold.add(input.sessionName);
882
- this.pendingPostCompactRestore.set(input.sessionName, "turn_boundary");
883
- this.pendingStageGeneration.set(input.sessionName, attempt.occupantGeneration);
1167
+ this.owePostCompactRestore(input.sessionName, attempt, carry);
1168
+ this.persist(input.sessionName, attempt.attemptId, { phase: "turn_boundary", restoreCarry: carry, operatorInitiated });
884
1169
  return { ok: true };
885
1170
  }
1171
+ /** What the seat's input box holds now, as `rig capture --json` reads it (`empty`, `likely-suggestion`, `typed`, ...), or
1172
+ * why it couldn't be read. Never throws. */
1173
+ async inputBoxStatus(sessionName) {
1174
+ try {
1175
+ const capture = await this.sessionTransport.capture(sessionName, { inputBox: true });
1176
+ return capture.inputBox?.status ?? capture.reason ?? "unknown";
1177
+ }
1178
+ catch {
1179
+ return "unknown";
1180
+ }
1181
+ }
1182
+ /** /compact was submitted, or may have been: its restore steps are owed next, and no new automatic compaction starts
1183
+ * until they finish. */
1184
+ owePostCompactRestore(sessionName, attempt, carry) {
1185
+ if (carry)
1186
+ this.restoreCarry.set(sessionName, carry);
1187
+ else
1188
+ this.restoreCarry.delete(sessionName);
1189
+ this.lastAutoCompactAt.set(sessionName, this.now());
1190
+ this.triggeredAboveThreshold.add(sessionName);
1191
+ this.pendingPostCompactRestore.set(sessionName, "turn_boundary");
1192
+ this.pendingStageGeneration.set(sessionName, attempt.occupantGeneration);
1193
+ }
886
1194
  /** The map the restore request names. With --skip-map: a map the seat completed at the attempt path
887
1195
  * anyway, or a plain statement that none was required. Nothing publishes the .tmp under --skip-map, so
888
1196
  * the final path is checked first, then the .tmp, and whichever ends with the marker is named. */
@@ -921,6 +1229,134 @@ export class ClaudeCompactionEnforcer {
921
1229
  attempt.policyWasEnabled = true;
922
1230
  }
923
1231
  }
1232
+ /** Start the record for a new attempt, beside its map. */
1233
+ startRecord(sessionName, attempt) {
1234
+ this.records.set(sessionName, { file: path.join(path.dirname(attempt.mapPath), COMPACTION_RECORD_FILE), record: {
1235
+ daemon: this.daemonInstance, attemptId: attempt.attemptId, session: sessionName, occupantGeneration: attempt.occupantGeneration, mode: attempt.mode,
1236
+ phase: "preparing", delivery: attempt.delivery, deadlineAt: attempt.deadlineAt, sends: attempt.sends,
1237
+ mapPath: attempt.mapPath, marker: attempt.marker, compactInstruction: attempt.compactInstruction,
1238
+ preparationRoot: attempt.preparationRoot, updatedAt: this.now(),
1239
+ } });
1240
+ this.persist(sessionName, attempt.attemptId, {});
1241
+ }
1242
+ /** Record what this daemon just did for the seat's current attempt. Best-effort: a record that can't be written
1243
+ * leaves the attempt as it was before records existed, not picked up after a restart. */
1244
+ persist(sessionName, attemptId, patch) {
1245
+ const current = this.records.get(sessionName);
1246
+ if (!current || current.record.attemptId !== attemptId)
1247
+ return;
1248
+ current.record = { ...current.record, ...patch, daemon: this.daemonInstance, updatedAt: this.now() };
1249
+ const temporary = `${current.file}.${process.pid}.tmp`;
1250
+ try {
1251
+ fs.writeFileSync(temporary, `${JSON.stringify(current.record)}\n`, { mode: 0o600 });
1252
+ fs.renameSync(temporary, current.file);
1253
+ }
1254
+ catch {
1255
+ try {
1256
+ fs.rmSync(temporary, { force: true });
1257
+ }
1258
+ catch { /* nothing to clean */ }
1259
+ }
1260
+ }
1261
+ persistStage(sessionName, phase) {
1262
+ const current = this.records.get(sessionName);
1263
+ if (current)
1264
+ this.persist(sessionName, current.record.attemptId, { phase, lastDelivery: undefined });
1265
+ }
1266
+ /**
1267
+ * After a daemon restart, pick up the seat's managed compaction from the record beside its newest attempt, when an
1268
+ * earlier daemon process wrote it. This runs once per seat, and only when this daemon holds nothing for that seat.
1269
+ * - An owed post-compact stage (turn boundary, restore, audit) is resumed, and so is the restore after a /compact that
1270
+ * was being sent or whose outcome was lost.
1271
+ * - An automatic preparation is waited on rather than begun again. A prompt whose delivery wasn't recorded may have
1272
+ * reached the seat, so it is never sent again.
1273
+ * - A manual preparation stops, because its caller is gone.
1274
+ * A record of another occupant, or in any other shape (see `readCompactionRecord`), is left alone. An open post-compact
1275
+ * record older than the recovery window isn't resumed; it reads as stranded, at the stage it owes.
1276
+ */
1277
+ recoverAfterRestart(input, preparationRoot) {
1278
+ const session = input.sessionName;
1279
+ if (input.runtime !== "claude-code" || this.recovered.has(session))
1280
+ return;
1281
+ this.recovered.add(session);
1282
+ if (this.pendingPreCompactPrep.has(session) || this.pendingPostCompactRestore.has(session))
1283
+ return;
1284
+ const key = sanitizeSessionKey(session);
1285
+ // The places beginPreparation puts an attempt: an explicit root, the seat's workspace, or the instance home.
1286
+ const dirs = new Set([
1287
+ ...(preparationRoot ? [path.join(preparationRoot, key)] : []),
1288
+ ...(input.cwd && path.isAbsolute(input.cwd) ? [path.join(input.cwd, ".openrig", "compaction", "preparation", key)] : []),
1289
+ path.join(this.openrigHome, "compaction", "preparation", key),
1290
+ ]);
1291
+ let newest = null;
1292
+ for (const dir of dirs) {
1293
+ let entries;
1294
+ try {
1295
+ entries = fs.readdirSync(dir);
1296
+ }
1297
+ catch {
1298
+ continue;
1299
+ }
1300
+ for (const entry of entries) {
1301
+ const file = path.join(dir, entry, COMPACTION_RECORD_FILE);
1302
+ const record = readCompactionRecord(file);
1303
+ if (record && record.session === session && record.attemptId === entry && (!newest || record.updatedAt > newest.record.updatedAt)) {
1304
+ newest = { file, record };
1305
+ }
1306
+ }
1307
+ }
1308
+ if (!newest)
1309
+ return;
1310
+ const { record } = newest;
1311
+ // This process's own record (another enforcer in it) is live state, not a predecessor's.
1312
+ if (record.daemon === this.daemonInstance || record.phase === "done" || record.phase === "ended")
1313
+ return;
1314
+ const live = this.resolveOccupantGeneration?.(session) ?? this.sessionTransport.deliveryGuard?.maybeTarget(session)?.occupant ?? null;
1315
+ if (record.occupantGeneration !== null && live !== null && live !== record.occupantGeneration)
1316
+ return;
1317
+ const stale = this.now() - record.updatedAt > this.restartRecoveryWindowMs;
1318
+ // A /compact whose send had begun, or whose outcome was lost, is never sent again; its restore steps are owed in case it
1319
+ // ran, each only into an empty input box. The restore request tells a seat that didn't compact to say so and skip.
1320
+ const phase = (record.phase === "preparing" && record.compactSending) || record.phase === "compact_uncertain" ? "turn_boundary" : record.phase;
1321
+ const inFlight = phase !== record.phase;
1322
+ if (phase === "preparing") {
1323
+ if (stale)
1324
+ return; // Its preparation deadline passed long ago; a fresh attempt may begin.
1325
+ this.records.set(session, newest);
1326
+ this.pendingPreCompactPrep.set(session, {
1327
+ policyActor: { source: "openrig" }, attemptId: record.attemptId, occupantGeneration: record.occupantGeneration,
1328
+ mapPath: record.mapPath, marker: record.marker, mode: record.mode,
1329
+ status: record.delivery === "not_sent" ? "sending" : "waiting",
1330
+ delivery: record.delivery === "pending" ? "uncertain" : record.delivery,
1331
+ compact: "not_sent", sends: record.sends,
1332
+ deadlineAt: record.deadlineAt ?? (record.delivery === "not_sent" ? null : record.updatedAt + AUTO_PREP_WAIT_MS_DEFAULT),
1333
+ policyWasEnabled: true, preparationRoot: record.preparationRoot, controller: new AbortController(),
1334
+ compactInstruction: record.compactInstruction,
1335
+ });
1336
+ if (record.mode === "manual")
1337
+ this.stopPreparation(session, "daemon_restarted");
1338
+ return;
1339
+ }
1340
+ if (stale) {
1341
+ this.stranded.set(session, { ...record, phase });
1342
+ return;
1343
+ }
1344
+ this.records.set(session, newest);
1345
+ this.pendingPostCompactRestore.set(session, phase);
1346
+ this.pendingStageGeneration.set(session, record.occupantGeneration);
1347
+ if (inFlight || record.uncertainCompact) {
1348
+ this.afterUncertainCompact.add(session);
1349
+ this.persist(session, record.attemptId, { uncertainCompact: true });
1350
+ }
1351
+ if (record.restoreCarry)
1352
+ this.restoreCarry.set(session, record.restoreCarry);
1353
+ // As after a /compact this daemon sent: no new automatic compaction until the owed stages finish.
1354
+ this.lastAutoCompactAt.set(session, this.now());
1355
+ this.triggeredAboveThreshold.add(session);
1356
+ if (record.mode === "manual") {
1357
+ this.setManualStage(session, phase === "compliance_prompt" ? "restore-sent" : "compact-sent", undefined, record.operatorInitiated);
1358
+ }
1359
+ }
924
1360
  stopPreparation(session, reason, expected) {
925
1361
  const attempt = this.pendingPreCompactPrep.get(session);
926
1362
  if ((expected && expected !== attempt) || !attempt || attempt.status === "stopped" || attempt.status === "compact-sent")
@@ -929,6 +1365,7 @@ export class ClaudeCompactionEnforcer {
929
1365
  attempt.reason = reason;
930
1366
  attempt.stoppedAt = this.now();
931
1367
  attempt.controller.abort();
1368
+ this.persist(session, attempt.attemptId, { phase: attempt.compact === "uncertain" ? "compact_uncertain" : "ended" });
932
1369
  if (attempt.mode === "manual")
933
1370
  this.setManualStage(session, "skipped-or-failed", reason);
934
1371
  }
@@ -945,13 +1382,20 @@ export class ClaudeCompactionEnforcer {
945
1382
  attempt.reason = "compaction_cancelled";
946
1383
  attempt.controller.abort();
947
1384
  }
1385
+ this.persistStage(session, "ended");
948
1386
  this.pendingPostCompactRestore.delete(session);
949
1387
  this.pendingStageGeneration.delete(session);
950
1388
  this.restoreCarry.delete(session);
1389
+ this.afterUncertainCompact.delete(session);
1390
+ this.lastInputBox.delete(session);
951
1391
  this.setManualStage(session, "cancelled", "compaction_cancelled");
952
1392
  }
953
- else
1393
+ else {
954
1394
  this.stopPreparation(session, "preparation_cancelled");
1395
+ // A cancel also ends an uncertain /compact's owed restore, so a restart doesn't resume it.
1396
+ if (attempt?.compact === "uncertain")
1397
+ this.persistStage(session, "ended");
1398
+ }
955
1399
  return this.getPreparationState(session);
956
1400
  }
957
1401
  getPreparationState(session) {
@@ -959,7 +1403,7 @@ export class ClaudeCompactionEnforcer {
959
1403
  const attempt = this.pendingPreCompactPrep.get(session);
960
1404
  if (!attempt)
961
1405
  return null;
962
- const { controller: _controller, sends: _sends, policyWasEnabled: _enabled, compactInstruction: _instruction, stoppedAt: _stoppedAt, cancelled: _cancelled, ...state } = attempt;
1406
+ const { controller: _controller, sends: _sends, policyWasEnabled: _enabled, preparationRoot: _preparationRoot, compactInstruction: _instruction, stoppedAt: _stoppedAt, cancelled: _cancelled, ...state } = attempt;
963
1407
  return state;
964
1408
  }
965
1409
  /** OPR.0.4.3.14 — read the surfaced manual-trigger state for a seat (AC-3). */
@@ -976,6 +1420,11 @@ export class ClaudeCompactionEnforcer {
976
1420
  */
977
1421
  invalidateOccupant(sessionName) {
978
1422
  this.stopPreparation(sessionName, "stale_generation");
1423
+ this.persistStage(sessionName, "ended");
1424
+ this.records.delete(sessionName);
1425
+ this.stranded.delete(sessionName);
1426
+ this.afterUncertainCompact.delete(sessionName);
1427
+ this.lastInputBox.delete(sessionName);
979
1428
  this.lastAutoCompactAt.delete(sessionName);
980
1429
  this.postCompactRestoreCooldownUntil.delete(sessionName);
981
1430
  this.triggeredAboveThreshold.delete(sessionName);