@openrig/cli 0.7.7 → 0.7.9

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 (944) hide show
  1. package/README.md +6 -6
  2. package/daemon/assets/openshell/Dockerfile +15 -0
  3. package/daemon/assets/openshell/README.md +139 -0
  4. package/daemon/assets/openshell/agents/coordinator/agent.yaml +20 -0
  5. package/daemon/assets/openshell/agents/coordinator/role.md +1 -0
  6. package/daemon/assets/openshell/agents/worker/agent.yaml +20 -0
  7. package/daemon/assets/openshell/agents/worker/role.md +3 -0
  8. package/daemon/assets/openshell/claude-code-provider.yaml +55 -0
  9. package/daemon/assets/openshell/driver-v1.schema.json +81 -0
  10. package/daemon/assets/openshell/guest.py +319 -0
  11. package/daemon/assets/openshell/policy.yaml +33 -0
  12. package/daemon/assets/openshell/preset.yaml +13 -0
  13. package/daemon/assets/openshell/rig.yaml +20 -0
  14. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
  15. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
  16. package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +13 -4
  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 +110 -30
  20. package/daemon/context-packs/reference/getting-started.md +36 -9
  21. package/daemon/context-packs/reference/instance-layout.md +11 -0
  22. package/daemon/context-packs/reference/manifest.yaml +1 -1
  23. package/daemon/context-packs/reference/rig-spec.md +130 -14
  24. package/daemon/context-packs/reference/whats-new.md +294 -132
  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/core/agent-starters/manifest.yaml +1 -1
  30. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  31. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  33. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  34. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  35. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  36. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  37. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  38. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/core/openrig-upgrade/SKILL.md +4 -3
  40. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/core/openrig-upgrade/scripts/backup-sqlite.mjs +90 -14
  42. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  46. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  53. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  54. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  56. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  66. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  68. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  72. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  73. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  74. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  75. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  76. package/daemon/context-packs/skills/seat-continuity-and-handover/SKILL.md +13 -4
  77. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  78. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  79. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  80. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  81. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  82. package/daemon/dist/adapters/claude-code-adapter.d.ts +6 -0
  83. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  84. package/daemon/dist/adapters/claude-code-adapter.js +51 -74
  85. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  86. package/daemon/dist/adapters/claude-resume.d.ts +2 -1
  87. package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
  88. package/daemon/dist/adapters/claude-resume.js +19 -7
  89. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  90. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +33 -7
  91. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  92. package/daemon/dist/adapters/codex-runtime-adapter.js +204 -45
  93. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  94. package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts +13 -1
  95. package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
  96. package/daemon/dist/adapters/community-harness-runtime-adapter.js +31 -1
  97. package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
  98. package/daemon/dist/adapters/omp-runtime-adapter.d.ts +5 -0
  99. package/daemon/dist/adapters/omp-runtime-adapter.d.ts.map +1 -1
  100. package/daemon/dist/adapters/omp-runtime-adapter.js +4 -0
  101. package/daemon/dist/adapters/omp-runtime-adapter.js.map +1 -1
  102. package/daemon/dist/adapters/openshell-driver.d.ts +39 -0
  103. package/daemon/dist/adapters/openshell-driver.d.ts.map +1 -0
  104. package/daemon/dist/adapters/openshell-driver.js +145 -0
  105. package/daemon/dist/adapters/openshell-driver.js.map +1 -0
  106. package/daemon/dist/adapters/openshell-podman-observer.d.ts +30 -0
  107. package/daemon/dist/adapters/openshell-podman-observer.d.ts.map +1 -0
  108. package/daemon/dist/adapters/openshell-podman-observer.js +94 -0
  109. package/daemon/dist/adapters/openshell-podman-observer.js.map +1 -0
  110. package/daemon/dist/adapters/pi-openrouter-charge.d.ts +1 -0
  111. package/daemon/dist/adapters/pi-openrouter-charge.d.ts.map +1 -1
  112. package/daemon/dist/adapters/pi-openrouter-charge.js +17 -3
  113. package/daemon/dist/adapters/pi-openrouter-charge.js.map +1 -1
  114. package/daemon/dist/adapters/pi-runner.d.ts +39 -5
  115. package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
  116. package/daemon/dist/adapters/pi-runner.js +97 -19
  117. package/daemon/dist/adapters/pi-runner.js.map +1 -1
  118. package/daemon/dist/adapters/pi-runtime-adapter.d.ts +22 -0
  119. package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
  120. package/daemon/dist/adapters/pi-runtime-adapter.js +39 -8
  121. package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
  122. package/daemon/dist/adapters/preflight-exec.d.ts +2 -0
  123. package/daemon/dist/adapters/preflight-exec.d.ts.map +1 -1
  124. package/daemon/dist/adapters/preflight-exec.js +3 -1
  125. package/daemon/dist/adapters/preflight-exec.js.map +1 -1
  126. package/daemon/dist/adapters/stub-runtime-adapter.d.ts +5 -0
  127. package/daemon/dist/adapters/stub-runtime-adapter.d.ts.map +1 -1
  128. package/daemon/dist/adapters/stub-runtime-adapter.js +7 -4
  129. package/daemon/dist/adapters/stub-runtime-adapter.js.map +1 -1
  130. package/daemon/dist/adapters/tmux-control.d.ts +12 -6
  131. package/daemon/dist/adapters/tmux-control.d.ts.map +1 -1
  132. package/daemon/dist/adapters/tmux-control.js +42 -21
  133. package/daemon/dist/adapters/tmux-control.js.map +1 -1
  134. package/daemon/dist/adapters/tmux-exec.d.ts +3 -0
  135. package/daemon/dist/adapters/tmux-exec.d.ts.map +1 -1
  136. package/daemon/dist/adapters/tmux-exec.js +35 -1
  137. package/daemon/dist/adapters/tmux-exec.js.map +1 -1
  138. package/daemon/dist/adapters/tmux-server.d.ts +6 -3
  139. package/daemon/dist/adapters/tmux-server.d.ts.map +1 -1
  140. package/daemon/dist/adapters/tmux-server.js +13 -8
  141. package/daemon/dist/adapters/tmux-server.js.map +1 -1
  142. package/daemon/dist/adapters/tmux.d.ts +11 -2
  143. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  144. package/daemon/dist/adapters/tmux.js +66 -14
  145. package/daemon/dist/adapters/tmux.js.map +1 -1
  146. package/daemon/dist/build-info.js +3 -3
  147. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  148. package/daemon/dist/db/all-migrations.js +16 -0
  149. package/daemon/dist/db/all-migrations.js.map +1 -1
  150. package/daemon/dist/db/migrations/142_node_claude_mcp.d.ts +3 -0
  151. package/daemon/dist/db/migrations/142_node_claude_mcp.d.ts.map +1 -0
  152. package/daemon/dist/db/migrations/142_node_claude_mcp.js +5 -0
  153. package/daemon/dist/db/migrations/142_node_claude_mcp.js.map +1 -0
  154. package/daemon/dist/db/migrations/143_activity_grants.d.ts +8 -0
  155. package/daemon/dist/db/migrations/143_activity_grants.d.ts.map +1 -0
  156. package/daemon/dist/db/migrations/143_activity_grants.js +22 -0
  157. package/daemon/dist/db/migrations/143_activity_grants.js.map +1 -0
  158. package/daemon/dist/db/migrations/144_environment_bindings.d.ts +4 -0
  159. package/daemon/dist/db/migrations/144_environment_bindings.d.ts.map +1 -0
  160. package/daemon/dist/db/migrations/144_environment_bindings.js +31 -0
  161. package/daemon/dist/db/migrations/144_environment_bindings.js.map +1 -0
  162. package/daemon/dist/db/migrations/145_node_permissions_to.d.ts +5 -0
  163. package/daemon/dist/db/migrations/145_node_permissions_to.d.ts.map +1 -0
  164. package/daemon/dist/db/migrations/145_node_permissions_to.js +7 -0
  165. package/daemon/dist/db/migrations/145_node_permissions_to.js.map +1 -0
  166. package/daemon/dist/db/migrations/146_node_startup_guidance_file.d.ts +6 -0
  167. package/daemon/dist/db/migrations/146_node_startup_guidance_file.d.ts.map +1 -0
  168. package/daemon/dist/db/migrations/146_node_startup_guidance_file.js +8 -0
  169. package/daemon/dist/db/migrations/146_node_startup_guidance_file.js.map +1 -0
  170. package/daemon/dist/db/migrations/147_managed_block_writes.d.ts +9 -0
  171. package/daemon/dist/db/migrations/147_managed_block_writes.d.ts.map +1 -0
  172. package/daemon/dist/db/migrations/147_managed_block_writes.js +19 -0
  173. package/daemon/dist/db/migrations/147_managed_block_writes.js.map +1 -0
  174. package/daemon/dist/db/migrations/148_outbox_dispatched_index.d.ts +8 -0
  175. package/daemon/dist/db/migrations/148_outbox_dispatched_index.d.ts.map +1 -0
  176. package/daemon/dist/db/migrations/148_outbox_dispatched_index.js +12 -0
  177. package/daemon/dist/db/migrations/148_outbox_dispatched_index.js.map +1 -0
  178. package/daemon/dist/db/migrations/149_stream_intake_cursor.d.ts +4 -0
  179. package/daemon/dist/db/migrations/149_stream_intake_cursor.d.ts.map +1 -0
  180. package/daemon/dist/db/migrations/149_stream_intake_cursor.js +14 -0
  181. package/daemon/dist/db/migrations/149_stream_intake_cursor.js.map +1 -0
  182. package/daemon/dist/domain/active-occupant.d.ts +2 -0
  183. package/daemon/dist/domain/active-occupant.d.ts.map +1 -1
  184. package/daemon/dist/domain/active-occupant.js +9 -1
  185. package/daemon/dist/domain/active-occupant.js.map +1 -1
  186. package/daemon/dist/domain/activity-grants.d.ts +63 -0
  187. package/daemon/dist/domain/activity-grants.d.ts.map +1 -0
  188. package/daemon/dist/domain/activity-grants.js +106 -0
  189. package/daemon/dist/domain/activity-grants.js.map +1 -0
  190. package/daemon/dist/domain/activity-taxonomy.d.ts +3 -0
  191. package/daemon/dist/domain/activity-taxonomy.d.ts.map +1 -1
  192. package/daemon/dist/domain/activity-taxonomy.js.map +1 -1
  193. package/daemon/dist/domain/agent-images/agent-image-library-service.d.ts.map +1 -1
  194. package/daemon/dist/domain/agent-images/agent-image-library-service.js +5 -2
  195. package/daemon/dist/domain/agent-images/agent-image-library-service.js.map +1 -1
  196. package/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
  197. package/daemon/dist/domain/bootstrap-orchestrator.js +3 -1
  198. package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
  199. package/daemon/dist/domain/bundle-archive.d.ts.map +1 -1
  200. package/daemon/dist/domain/bundle-archive.js +40 -4
  201. package/daemon/dist/domain/bundle-archive.js.map +1 -1
  202. package/daemon/dist/domain/bundle-behaviour.d.ts.map +1 -1
  203. package/daemon/dist/domain/bundle-behaviour.js +7 -0
  204. package/daemon/dist/domain/bundle-behaviour.js.map +1 -1
  205. package/daemon/dist/domain/bundle-content-routing.d.ts +1 -0
  206. package/daemon/dist/domain/bundle-content-routing.d.ts.map +1 -1
  207. package/daemon/dist/domain/bundle-content-routing.js +3 -1
  208. package/daemon/dist/domain/bundle-content-routing.js.map +1 -1
  209. package/daemon/dist/domain/bundle-source-resolver.d.ts +2 -0
  210. package/daemon/dist/domain/bundle-source-resolver.d.ts.map +1 -1
  211. package/daemon/dist/domain/bundle-source-resolver.js +4 -4
  212. package/daemon/dist/domain/bundle-source-resolver.js.map +1 -1
  213. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +12 -5
  214. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  215. package/daemon/dist/domain/claude-compaction-enforcer.js +47 -18
  216. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  217. package/daemon/dist/domain/claude-mcp.d.ts +10 -0
  218. package/daemon/dist/domain/claude-mcp.d.ts.map +1 -0
  219. package/daemon/dist/domain/claude-mcp.js +19 -0
  220. package/daemon/dist/domain/claude-mcp.js.map +1 -0
  221. package/daemon/dist/domain/claude-owned-settings.d.ts +19 -0
  222. package/daemon/dist/domain/claude-owned-settings.d.ts.map +1 -0
  223. package/daemon/dist/domain/claude-owned-settings.js +160 -0
  224. package/daemon/dist/domain/claude-owned-settings.js.map +1 -0
  225. package/daemon/dist/domain/claude-plugin-channels.d.ts +2 -0
  226. package/daemon/dist/domain/claude-plugin-channels.d.ts.map +1 -0
  227. package/daemon/dist/domain/claude-plugin-channels.js +12 -0
  228. package/daemon/dist/domain/claude-plugin-channels.js.map +1 -0
  229. package/daemon/dist/domain/claude-theme-menu.d.ts +5 -0
  230. package/daemon/dist/domain/claude-theme-menu.d.ts.map +1 -0
  231. package/daemon/dist/domain/claude-theme-menu.js +43 -0
  232. package/daemon/dist/domain/claude-theme-menu.js.map +1 -0
  233. package/daemon/dist/domain/codex-owned-plugin-trust.d.ts.map +1 -1
  234. package/daemon/dist/domain/codex-owned-plugin-trust.js +2 -1
  235. package/daemon/dist/domain/codex-owned-plugin-trust.js.map +1 -1
  236. package/daemon/dist/domain/codex-pane-patterns.d.ts +1 -0
  237. package/daemon/dist/domain/codex-pane-patterns.d.ts.map +1 -1
  238. package/daemon/dist/domain/codex-pane-patterns.js +2 -0
  239. package/daemon/dist/domain/codex-pane-patterns.js.map +1 -1
  240. package/daemon/dist/domain/community-harness-presets.d.ts +2 -1
  241. package/daemon/dist/domain/community-harness-presets.d.ts.map +1 -1
  242. package/daemon/dist/domain/community-harness-presets.js +3 -2
  243. package/daemon/dist/domain/community-harness-presets.js.map +1 -1
  244. package/daemon/dist/domain/composer-prompts.d.ts +2 -0
  245. package/daemon/dist/domain/composer-prompts.d.ts.map +1 -1
  246. package/daemon/dist/domain/composer-prompts.js +3 -2
  247. package/daemon/dist/domain/composer-prompts.js.map +1 -1
  248. package/daemon/dist/domain/context-monitor.d.ts +2 -2
  249. package/daemon/dist/domain/context-monitor.d.ts.map +1 -1
  250. package/daemon/dist/domain/context-monitor.js +8 -2
  251. package/daemon/dist/domain/context-monitor.js.map +1 -1
  252. package/daemon/dist/domain/desired-claude-activity-hooks.d.ts +25 -0
  253. package/daemon/dist/domain/desired-claude-activity-hooks.d.ts.map +1 -0
  254. package/daemon/dist/domain/desired-claude-activity-hooks.js +86 -0
  255. package/daemon/dist/domain/desired-claude-activity-hooks.js.map +1 -0
  256. package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
  257. package/daemon/dist/domain/draft-aware-delivery.js +14 -4
  258. package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
  259. package/daemon/dist/domain/environment-artifacts.d.ts +49 -0
  260. package/daemon/dist/domain/environment-artifacts.d.ts.map +1 -0
  261. package/daemon/dist/domain/environment-artifacts.js +158 -0
  262. package/daemon/dist/domain/environment-artifacts.js.map +1 -0
  263. package/daemon/dist/domain/environment-lifecycle.d.ts +126 -0
  264. package/daemon/dist/domain/environment-lifecycle.d.ts.map +1 -0
  265. package/daemon/dist/domain/environment-lifecycle.js +474 -0
  266. package/daemon/dist/domain/environment-lifecycle.js.map +1 -0
  267. package/daemon/dist/domain/environment-platform.d.ts +121 -0
  268. package/daemon/dist/domain/environment-platform.d.ts.map +1 -0
  269. package/daemon/dist/domain/environment-platform.js +280 -0
  270. package/daemon/dist/domain/environment-platform.js.map +1 -0
  271. package/daemon/dist/domain/environment-startup.d.ts +43 -0
  272. package/daemon/dist/domain/environment-startup.d.ts.map +1 -0
  273. package/daemon/dist/domain/environment-startup.js +307 -0
  274. package/daemon/dist/domain/environment-startup.js.map +1 -0
  275. package/daemon/dist/domain/expected-conversation.d.ts +20 -0
  276. package/daemon/dist/domain/expected-conversation.d.ts.map +1 -0
  277. package/daemon/dist/domain/expected-conversation.js +101 -0
  278. package/daemon/dist/domain/expected-conversation.js.map +1 -0
  279. package/daemon/dist/domain/gateway/human-readiness.d.ts +2 -1
  280. package/daemon/dist/domain/gateway/human-readiness.d.ts.map +1 -1
  281. package/daemon/dist/domain/gateway/human-readiness.js +6 -0
  282. package/daemon/dist/domain/gateway/human-readiness.js.map +1 -1
  283. package/daemon/dist/domain/gateway/human-registry.d.ts +2 -1
  284. package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
  285. package/daemon/dist/domain/gateway/human-registry.js +9 -7
  286. package/daemon/dist/domain/gateway/human-registry.js.map +1 -1
  287. package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts +8 -1
  288. package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
  289. package/daemon/dist/domain/gateway/operator-delivery-engine.js +61 -4
  290. package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
  291. package/daemon/dist/domain/gateway/participants.d.ts +26 -0
  292. package/daemon/dist/domain/gateway/participants.d.ts.map +1 -1
  293. package/daemon/dist/domain/gateway/participants.js +15 -0
  294. package/daemon/dist/domain/gateway/participants.js.map +1 -1
  295. package/daemon/dist/domain/gateway/slack/inbound.d.ts +2 -0
  296. package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
  297. package/daemon/dist/domain/gateway/slack/inbound.js +59 -11
  298. package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
  299. package/daemon/dist/domain/gateway/slack/message.d.ts +19 -0
  300. package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
  301. package/daemon/dist/domain/gateway/slack/message.js +219 -9
  302. package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
  303. package/daemon/dist/domain/gateway/slack/queue-access.d.ts +15 -0
  304. package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
  305. package/daemon/dist/domain/gateway/slack/queue-access.js +24 -5
  306. package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
  307. package/daemon/dist/domain/gateway/slack/recovery-budget.d.ts +1 -0
  308. package/daemon/dist/domain/gateway/slack/recovery-budget.d.ts.map +1 -1
  309. package/daemon/dist/domain/gateway/slack/recovery-budget.js +1 -0
  310. package/daemon/dist/domain/gateway/slack/recovery-budget.js.map +1 -1
  311. package/daemon/dist/domain/gateway/slack/settled-asks.d.ts +37 -0
  312. package/daemon/dist/domain/gateway/slack/settled-asks.d.ts.map +1 -0
  313. package/daemon/dist/domain/gateway/slack/settled-asks.js +276 -0
  314. package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -0
  315. package/daemon/dist/domain/gateway/slack/slack-api.d.ts +32 -0
  316. package/daemon/dist/domain/gateway/slack/slack-api.d.ts.map +1 -1
  317. package/daemon/dist/domain/gateway/slack/slack-api.js +40 -2
  318. package/daemon/dist/domain/gateway/slack/slack-api.js.map +1 -1
  319. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
  320. package/daemon/dist/domain/gateway/slack/slack-delivery.js +9 -4
  321. package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
  322. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts +2 -0
  323. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
  324. package/daemon/dist/domain/gateway/slack/slack-subsystem.js +35 -6
  325. package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
  326. package/daemon/dist/domain/hosts/hosts-registry-writer.d.ts +22 -0
  327. package/daemon/dist/domain/hosts/hosts-registry-writer.d.ts.map +1 -1
  328. package/daemon/dist/domain/hosts/hosts-registry-writer.js +116 -0
  329. package/daemon/dist/domain/hosts/hosts-registry-writer.js.map +1 -1
  330. package/daemon/dist/domain/human-questions.d.ts +3 -1
  331. package/daemon/dist/domain/human-questions.d.ts.map +1 -1
  332. package/daemon/dist/domain/human-questions.js.map +1 -1
  333. package/daemon/dist/domain/kernel-boot-tracker.d.ts +3 -2
  334. package/daemon/dist/domain/kernel-boot-tracker.d.ts.map +1 -1
  335. package/daemon/dist/domain/kernel-boot-tracker.js +2 -1
  336. package/daemon/dist/domain/kernel-boot-tracker.js.map +1 -1
  337. package/daemon/dist/domain/kernel-boot.d.ts +11 -6
  338. package/daemon/dist/domain/kernel-boot.d.ts.map +1 -1
  339. package/daemon/dist/domain/kernel-boot.js +27 -5
  340. package/daemon/dist/domain/kernel-boot.js.map +1 -1
  341. package/daemon/dist/domain/kernel-hook-review.d.ts +18 -0
  342. package/daemon/dist/domain/kernel-hook-review.d.ts.map +1 -0
  343. package/daemon/dist/domain/kernel-hook-review.js +58 -0
  344. package/daemon/dist/domain/kernel-hook-review.js.map +1 -0
  345. package/daemon/dist/domain/managed-block-records.d.ts +54 -0
  346. package/daemon/dist/domain/managed-block-records.d.ts.map +1 -0
  347. package/daemon/dist/domain/managed-block-records.js +130 -0
  348. package/daemon/dist/domain/managed-block-records.js.map +1 -0
  349. package/daemon/dist/domain/managed-blocks.d.ts +14 -0
  350. package/daemon/dist/domain/managed-blocks.d.ts.map +1 -1
  351. package/daemon/dist/domain/managed-blocks.js +24 -4
  352. package/daemon/dist/domain/managed-blocks.js.map +1 -1
  353. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +29 -10
  354. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
  355. package/daemon/dist/domain/mission-control/mission-control-write-contract.js +116 -29
  356. package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
  357. package/daemon/dist/domain/model-divergence/current-generation-record.d.ts.map +1 -1
  358. package/daemon/dist/domain/model-divergence/current-generation-record.js +10 -6
  359. package/daemon/dist/domain/model-divergence/current-generation-record.js.map +1 -1
  360. package/daemon/dist/domain/native-process-lineage.d.ts +5 -1
  361. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
  362. package/daemon/dist/domain/native-process-lineage.js +91 -6
  363. package/daemon/dist/domain/native-process-lineage.js.map +1 -1
  364. package/daemon/dist/domain/native-resume-probe.d.ts +2 -1
  365. package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
  366. package/daemon/dist/domain/native-resume-probe.js +4 -2
  367. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  368. package/daemon/dist/domain/node-inventory.d.ts +1 -0
  369. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  370. package/daemon/dist/domain/node-inventory.js +42 -10
  371. package/daemon/dist/domain/node-inventory.js.map +1 -1
  372. package/daemon/dist/domain/node-launcher.d.ts +3 -0
  373. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  374. package/daemon/dist/domain/node-launcher.js +6 -0
  375. package/daemon/dist/domain/node-launcher.js.map +1 -1
  376. package/daemon/dist/domain/outbox-handler.d.ts +17 -0
  377. package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
  378. package/daemon/dist/domain/outbox-handler.js +60 -3
  379. package/daemon/dist/domain/outbox-handler.js.map +1 -1
  380. package/daemon/dist/domain/policies/parked-owner-consumer.d.ts +10 -0
  381. package/daemon/dist/domain/policies/parked-owner-consumer.d.ts.map +1 -1
  382. package/daemon/dist/domain/policies/parked-owner-consumer.js +60 -4
  383. package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
  384. package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
  385. package/daemon/dist/domain/profile-resolver.js +7 -1
  386. package/daemon/dist/domain/profile-resolver.js.map +1 -1
  387. package/daemon/dist/domain/provider/claude-seat-switch.d.ts +9 -3
  388. package/daemon/dist/domain/provider/claude-seat-switch.d.ts.map +1 -1
  389. package/daemon/dist/domain/provider/claude-seat-switch.js +100 -17
  390. package/daemon/dist/domain/provider/claude-seat-switch.js.map +1 -1
  391. package/daemon/dist/domain/provider/provider-service-impl.js +1 -1
  392. package/daemon/dist/domain/provider/provider-service-impl.js.map +1 -1
  393. package/daemon/dist/domain/provider/provider-service.d.ts +32 -2
  394. package/daemon/dist/domain/provider/provider-service.d.ts.map +1 -1
  395. package/daemon/dist/domain/provider/provider-types.d.ts +1 -1
  396. package/daemon/dist/domain/provider/provider-types.d.ts.map +1 -1
  397. package/daemon/dist/domain/queue-recovery.d.ts +1 -1
  398. package/daemon/dist/domain/queue-recovery.d.ts.map +1 -1
  399. package/daemon/dist/domain/queue-recovery.js +6 -2
  400. package/daemon/dist/domain/queue-recovery.js.map +1 -1
  401. package/daemon/dist/domain/queue-repository.d.ts +64 -8
  402. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  403. package/daemon/dist/domain/queue-repository.js +309 -76
  404. package/daemon/dist/domain/queue-repository.js.map +1 -1
  405. package/daemon/dist/domain/queue-stuck-sweep.d.ts +1 -1
  406. package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
  407. package/daemon/dist/domain/queue-stuck-sweep.js +59 -4
  408. package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
  409. package/daemon/dist/domain/queue-transition-log.d.ts +2 -0
  410. package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
  411. package/daemon/dist/domain/queue-transition-log.js +9 -0
  412. package/daemon/dist/domain/queue-transition-log.js.map +1 -1
  413. package/daemon/dist/domain/queue-wake-ladder.d.ts +3 -0
  414. package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
  415. package/daemon/dist/domain/queue-wake-ladder.js +124 -25
  416. package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
  417. package/daemon/dist/domain/restore-check-service.d.ts +2 -7
  418. package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
  419. package/daemon/dist/domain/restore-check-service.js.map +1 -1
  420. package/daemon/dist/domain/restore-guidance.d.ts +70 -7
  421. package/daemon/dist/domain/restore-guidance.d.ts.map +1 -1
  422. package/daemon/dist/domain/restore-guidance.js +181 -18
  423. package/daemon/dist/domain/restore-guidance.js.map +1 -1
  424. package/daemon/dist/domain/restore-orchestrator.d.ts +40 -3
  425. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  426. package/daemon/dist/domain/restore-orchestrator.js +276 -33
  427. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  428. package/daemon/dist/domain/resume-metadata-refresher.d.ts +2 -1
  429. package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
  430. package/daemon/dist/domain/resume-metadata-refresher.js +20 -6
  431. package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
  432. package/daemon/dist/domain/rig-expansion-service.js +1 -1
  433. package/daemon/dist/domain/rig-expansion-service.js.map +1 -1
  434. package/daemon/dist/domain/rig-repository.d.ts +14 -0
  435. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  436. package/daemon/dist/domain/rig-repository.js +57 -1
  437. package/daemon/dist/domain/rig-repository.js.map +1 -1
  438. package/daemon/dist/domain/rig-teardown.d.ts +18 -0
  439. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  440. package/daemon/dist/domain/rig-teardown.js +73 -17
  441. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  442. package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
  443. package/daemon/dist/domain/rigspec-codec.js +6 -0
  444. package/daemon/dist/domain/rigspec-codec.js.map +1 -1
  445. package/daemon/dist/domain/rigspec-exporter.d.ts +8 -0
  446. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  447. package/daemon/dist/domain/rigspec-exporter.js +66 -3
  448. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  449. package/daemon/dist/domain/rigspec-instantiator.d.ts +7 -4
  450. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  451. package/daemon/dist/domain/rigspec-instantiator.js +38 -11
  452. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  453. package/daemon/dist/domain/rigspec-preflight.d.ts +4 -0
  454. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  455. package/daemon/dist/domain/rigspec-preflight.js +35 -1
  456. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  457. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  458. package/daemon/dist/domain/rigspec-schema.js +56 -6
  459. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  460. package/daemon/dist/domain/runner-permissions.d.ts +150 -0
  461. package/daemon/dist/domain/runner-permissions.d.ts.map +1 -0
  462. package/daemon/dist/domain/runner-permissions.js +383 -0
  463. package/daemon/dist/domain/runner-permissions.js.map +1 -0
  464. package/daemon/dist/domain/runtime-adapter.d.ts +28 -0
  465. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  466. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  467. package/daemon/dist/domain/runtime-switch-materials.d.ts.map +1 -1
  468. package/daemon/dist/domain/runtime-switch-materials.js +3 -0
  469. package/daemon/dist/domain/runtime-switch-materials.js.map +1 -1
  470. package/daemon/dist/domain/runtime-verifier.d.ts.map +1 -1
  471. package/daemon/dist/domain/runtime-verifier.js +9 -4
  472. package/daemon/dist/domain/runtime-verifier.js.map +1 -1
  473. package/daemon/dist/domain/scope/scope-audit.d.ts +1 -1
  474. package/daemon/dist/domain/scope/scope-audit.d.ts.map +1 -1
  475. package/daemon/dist/domain/scope/scope-audit.js.map +1 -1
  476. package/daemon/dist/domain/scope/types.d.ts +3 -0
  477. package/daemon/dist/domain/scope/types.d.ts.map +1 -1
  478. package/daemon/dist/domain/scope/types.js.map +1 -1
  479. package/daemon/dist/domain/seat-activity-service.d.ts +7 -0
  480. package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
  481. package/daemon/dist/domain/seat-activity-service.js +47 -7
  482. package/daemon/dist/domain/seat-activity-service.js.map +1 -1
  483. package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  484. package/daemon/dist/domain/seat-attention-reconciler.js +8 -1
  485. package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  486. package/daemon/dist/domain/seat-delivery-guard.d.ts +22 -4
  487. package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
  488. package/daemon/dist/domain/seat-delivery-guard.js +80 -11
  489. package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
  490. package/daemon/dist/domain/seat-effort.d.ts +6 -0
  491. package/daemon/dist/domain/seat-effort.d.ts.map +1 -1
  492. package/daemon/dist/domain/seat-effort.js +0 -2
  493. package/daemon/dist/domain/seat-effort.js.map +1 -1
  494. package/daemon/dist/domain/seat-handover-planner.js +1 -1
  495. package/daemon/dist/domain/seat-handover-planner.js.map +1 -1
  496. package/daemon/dist/domain/seat-handover-service.d.ts +25 -10
  497. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  498. package/daemon/dist/domain/seat-handover-service.js +164 -31
  499. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  500. package/daemon/dist/domain/seat-launch-additions.d.ts +6 -0
  501. package/daemon/dist/domain/seat-launch-additions.d.ts.map +1 -1
  502. package/daemon/dist/domain/seat-launch-additions.js +41 -11
  503. package/daemon/dist/domain/seat-launch-additions.js.map +1 -1
  504. package/daemon/dist/domain/seat-lifecycle-service.d.ts +24 -2
  505. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  506. package/daemon/dist/domain/seat-lifecycle-service.js +65 -2
  507. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  508. package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
  509. package/daemon/dist/domain/seat-restart-in-place.js +6 -1
  510. package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
  511. package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
  512. package/daemon/dist/domain/seat-runtime-switch-service.js +21 -3
  513. package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
  514. package/daemon/dist/domain/seat-skill-storage.d.ts +8 -6
  515. package/daemon/dist/domain/seat-skill-storage.d.ts.map +1 -1
  516. package/daemon/dist/domain/seat-skill-storage.js +27 -7
  517. package/daemon/dist/domain/seat-skill-storage.js.map +1 -1
  518. package/daemon/dist/domain/seat-status-service.d.ts +5 -0
  519. package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
  520. package/daemon/dist/domain/seat-status-service.js +9 -0
  521. package/daemon/dist/domain/seat-status-service.js.map +1 -1
  522. package/daemon/dist/domain/seat-structural-activity-service.d.ts +15 -5
  523. package/daemon/dist/domain/seat-structural-activity-service.d.ts.map +1 -1
  524. package/daemon/dist/domain/seat-structural-activity-service.js +21 -7
  525. package/daemon/dist/domain/seat-structural-activity-service.js.map +1 -1
  526. package/daemon/dist/domain/self-attach-service.d.ts +8 -1
  527. package/daemon/dist/domain/self-attach-service.d.ts.map +1 -1
  528. package/daemon/dist/domain/self-attach-service.js +26 -0
  529. package/daemon/dist/domain/self-attach-service.js.map +1 -1
  530. package/daemon/dist/domain/session-transport.d.ts +17 -0
  531. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  532. package/daemon/dist/domain/session-transport.js +247 -31
  533. package/daemon/dist/domain/session-transport.js.map +1 -1
  534. package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
  535. package/daemon/dist/domain/snapshot-capture.js +15 -0
  536. package/daemon/dist/domain/snapshot-capture.js.map +1 -1
  537. package/daemon/dist/domain/spec-library-workflow-scanner.d.ts +2 -0
  538. package/daemon/dist/domain/spec-library-workflow-scanner.d.ts.map +1 -1
  539. package/daemon/dist/domain/spec-library-workflow-scanner.js +5 -1
  540. package/daemon/dist/domain/spec-library-workflow-scanner.js.map +1 -1
  541. package/daemon/dist/domain/startup-orchestrator.d.ts +1 -0
  542. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  543. package/daemon/dist/domain/startup-orchestrator.js +106 -8
  544. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  545. package/daemon/dist/domain/stream-intake.d.ts +51 -0
  546. package/daemon/dist/domain/stream-intake.d.ts.map +1 -0
  547. package/daemon/dist/domain/stream-intake.js +438 -0
  548. package/daemon/dist/domain/stream-intake.js.map +1 -0
  549. package/daemon/dist/domain/successor-session-launcher.d.ts +3 -0
  550. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  551. package/daemon/dist/domain/successor-session-launcher.js +2 -0
  552. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  553. package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
  554. package/daemon/dist/domain/terminal/herdr-adapter.js +4 -3
  555. package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
  556. package/daemon/dist/domain/terminal/herdr-follow-view.d.ts.map +1 -1
  557. package/daemon/dist/domain/terminal/herdr-follow-view.js +22 -4
  558. package/daemon/dist/domain/terminal/herdr-follow-view.js.map +1 -1
  559. package/daemon/dist/domain/terminal/herdr-viewer.d.ts.map +1 -1
  560. package/daemon/dist/domain/terminal/herdr-viewer.js +8 -4
  561. package/daemon/dist/domain/terminal/herdr-viewer.js.map +1 -1
  562. package/daemon/dist/domain/terminal/login-shell.d.ts +10 -0
  563. package/daemon/dist/domain/terminal/login-shell.d.ts.map +1 -0
  564. package/daemon/dist/domain/terminal/login-shell.js +37 -0
  565. package/daemon/dist/domain/terminal/login-shell.js.map +1 -0
  566. package/daemon/dist/domain/terminal/rex-layout.d.ts.map +1 -1
  567. package/daemon/dist/domain/terminal/rex-layout.js +2 -1
  568. package/daemon/dist/domain/terminal/rex-layout.js.map +1 -1
  569. package/daemon/dist/domain/terminal/scope-task-terminal-view.d.ts +12 -1
  570. package/daemon/dist/domain/terminal/scope-task-terminal-view.d.ts.map +1 -1
  571. package/daemon/dist/domain/terminal/scope-task-terminal-view.js +120 -18
  572. package/daemon/dist/domain/terminal/scope-task-terminal-view.js.map +1 -1
  573. package/daemon/dist/domain/terminal/terminal-following.js +1 -1
  574. package/daemon/dist/domain/terminal/terminal-following.js.map +1 -1
  575. package/daemon/dist/domain/terminal/terminal-provider.d.ts +2 -0
  576. package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
  577. package/daemon/dist/domain/terminal/terminal-service.d.ts +3 -2
  578. package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
  579. package/daemon/dist/domain/terminal/terminal-service.js +18 -27
  580. package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
  581. package/daemon/dist/domain/terminal/tile-attach.d.ts.map +1 -1
  582. package/daemon/dist/domain/terminal/tile-attach.js +15 -5
  583. package/daemon/dist/domain/terminal/tile-attach.js.map +1 -1
  584. package/daemon/dist/domain/terminal/view-composer.d.ts +6 -3
  585. package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -1
  586. package/daemon/dist/domain/terminal/view-composer.js +15 -5
  587. package/daemon/dist/domain/terminal/view-composer.js.map +1 -1
  588. package/daemon/dist/domain/tmux-server-selection.d.ts +47 -0
  589. package/daemon/dist/domain/tmux-server-selection.d.ts.map +1 -0
  590. package/daemon/dist/domain/tmux-server-selection.js +220 -0
  591. package/daemon/dist/domain/tmux-server-selection.js.map +1 -0
  592. package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
  593. package/daemon/dist/domain/transcript-store.js +19 -10
  594. package/daemon/dist/domain/transcript-store.js.map +1 -1
  595. package/daemon/dist/domain/types.d.ts +54 -0
  596. package/daemon/dist/domain/types.d.ts.map +1 -1
  597. package/daemon/dist/domain/types.js.map +1 -1
  598. package/daemon/dist/domain/user-settings/settings-browser.d.ts.map +1 -1
  599. package/daemon/dist/domain/user-settings/settings-browser.js +3 -1
  600. package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
  601. package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
  602. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  603. package/daemon/dist/domain/user-settings/settings-store.js +23 -0
  604. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  605. package/daemon/dist/domain/watchdog-delivery-receipts.d.ts +11 -0
  606. package/daemon/dist/domain/watchdog-delivery-receipts.d.ts.map +1 -0
  607. package/daemon/dist/domain/watchdog-delivery-receipts.js +134 -0
  608. package/daemon/dist/domain/watchdog-delivery-receipts.js.map +1 -0
  609. package/daemon/dist/domain/watchdog-delivery.d.ts +7 -1
  610. package/daemon/dist/domain/watchdog-delivery.d.ts.map +1 -1
  611. package/daemon/dist/domain/watchdog-delivery.js +24 -8
  612. package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
  613. package/daemon/dist/domain/watchdog-policy-engine.d.ts +21 -2
  614. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  615. package/daemon/dist/domain/watchdog-policy-engine.js +52 -23
  616. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  617. package/daemon/dist/domain/workflow-projector.js +3 -3
  618. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  619. package/daemon/dist/domain/workflow-runtime.d.ts +1 -1
  620. package/daemon/dist/domain/workflow-runtime.js +3 -3
  621. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  622. package/daemon/dist/domain/working-liveness.d.ts +66 -0
  623. package/daemon/dist/domain/working-liveness.d.ts.map +1 -0
  624. package/daemon/dist/domain/working-liveness.js +94 -0
  625. package/daemon/dist/domain/working-liveness.js.map +1 -0
  626. package/daemon/dist/domain/workspace/frontmatter-validator.js +4 -2
  627. package/daemon/dist/domain/workspace/frontmatter-validator.js.map +1 -1
  628. package/daemon/dist/index.d.ts +4 -0
  629. package/daemon/dist/index.d.ts.map +1 -1
  630. package/daemon/dist/index.js +17 -0
  631. package/daemon/dist/index.js.map +1 -1
  632. package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
  633. package/daemon/dist/lib/pane-envelope.js +9 -3
  634. package/daemon/dist/lib/pane-envelope.js.map +1 -1
  635. package/daemon/dist/middleware/auth-bearer-token.js +2 -2
  636. package/daemon/dist/middleware/auth-bearer-token.js.map +1 -1
  637. package/daemon/dist/routes/activity.d.ts +6 -0
  638. package/daemon/dist/routes/activity.d.ts.map +1 -1
  639. package/daemon/dist/routes/activity.js +317 -22
  640. package/daemon/dist/routes/activity.js.map +1 -1
  641. package/daemon/dist/routes/attention.d.ts.map +1 -1
  642. package/daemon/dist/routes/attention.js +17 -5
  643. package/daemon/dist/routes/attention.js.map +1 -1
  644. package/daemon/dist/routes/bundles.js +3 -1
  645. package/daemon/dist/routes/bundles.js.map +1 -1
  646. package/daemon/dist/routes/compaction.js +4 -2
  647. package/daemon/dist/routes/compaction.js.map +1 -1
  648. package/daemon/dist/routes/environments.d.ts +3 -0
  649. package/daemon/dist/routes/environments.d.ts.map +1 -0
  650. package/daemon/dist/routes/environments.js +104 -0
  651. package/daemon/dist/routes/environments.js.map +1 -0
  652. package/daemon/dist/routes/gateway.d.ts +6 -0
  653. package/daemon/dist/routes/gateway.d.ts.map +1 -1
  654. package/daemon/dist/routes/gateway.js +39 -0
  655. package/daemon/dist/routes/gateway.js.map +1 -1
  656. package/daemon/dist/routes/hosts.d.ts.map +1 -1
  657. package/daemon/dist/routes/hosts.js +106 -8
  658. package/daemon/dist/routes/hosts.js.map +1 -1
  659. package/daemon/dist/routes/mission-control.d.ts.map +1 -1
  660. package/daemon/dist/routes/mission-control.js +6 -1
  661. package/daemon/dist/routes/mission-control.js.map +1 -1
  662. package/daemon/dist/routes/provider.d.ts.map +1 -1
  663. package/daemon/dist/routes/provider.js +53 -7
  664. package/daemon/dist/routes/provider.js.map +1 -1
  665. package/daemon/dist/routes/queue.d.ts.map +1 -1
  666. package/daemon/dist/routes/queue.js +21 -2
  667. package/daemon/dist/routes/queue.js.map +1 -1
  668. package/daemon/dist/routes/restore-check.d.ts.map +1 -1
  669. package/daemon/dist/routes/restore-check.js +5 -19
  670. package/daemon/dist/routes/restore-check.js.map +1 -1
  671. package/daemon/dist/routes/rigs.js +3 -0
  672. package/daemon/dist/routes/rigs.js.map +1 -1
  673. package/daemon/dist/routes/rigspec.d.ts.map +1 -1
  674. package/daemon/dist/routes/rigspec.js +8 -3
  675. package/daemon/dist/routes/rigspec.js.map +1 -1
  676. package/daemon/dist/routes/scope-audit.d.ts.map +1 -1
  677. package/daemon/dist/routes/scope-audit.js +30 -0
  678. package/daemon/dist/routes/scope-audit.js.map +1 -1
  679. package/daemon/dist/routes/seat.d.ts.map +1 -1
  680. package/daemon/dist/routes/seat.js +32 -5
  681. package/daemon/dist/routes/seat.js.map +1 -1
  682. package/daemon/dist/routes/sessions.d.ts.map +1 -1
  683. package/daemon/dist/routes/sessions.js +66 -20
  684. package/daemon/dist/routes/sessions.js.map +1 -1
  685. package/daemon/dist/routes/spec-library.d.ts.map +1 -1
  686. package/daemon/dist/routes/spec-library.js +60 -5
  687. package/daemon/dist/routes/spec-library.js.map +1 -1
  688. package/daemon/dist/routes/startup.js +2 -2
  689. package/daemon/dist/routes/startup.js.map +1 -1
  690. package/daemon/dist/routes/transport.d.ts.map +1 -1
  691. package/daemon/dist/routes/transport.js +31 -5
  692. package/daemon/dist/routes/transport.js.map +1 -1
  693. package/daemon/dist/server.d.ts +7 -0
  694. package/daemon/dist/server.d.ts.map +1 -1
  695. package/daemon/dist/server.js +57 -1
  696. package/daemon/dist/server.js.map +1 -1
  697. package/daemon/dist/startup.d.ts +2 -0
  698. package/daemon/dist/startup.d.ts.map +1 -1
  699. package/daemon/dist/startup.js +90 -37
  700. package/daemon/dist/startup.js.map +1 -1
  701. package/daemon/docs/reference/agent-spec.md +1 -1
  702. package/daemon/docs/reference/agent-startup-guide.md +119 -3
  703. package/daemon/docs/reference/agent-state-taxonomy.md +23 -2
  704. package/daemon/docs/reference/author-contracts.md +9 -9
  705. package/daemon/docs/reference/checked-seat-stop.md +12 -1
  706. package/daemon/docs/reference/community-harness-examples/dsh/README.md +96 -0
  707. package/daemon/docs/reference/community-harness-examples/dsh/dsh.yaml +20 -0
  708. package/daemon/docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs +626 -0
  709. package/daemon/docs/reference/community-harness-examples/openshell/README.md +5 -0
  710. package/daemon/docs/reference/community-harness-presets.md +25 -1
  711. package/daemon/docs/reference/daemon-http-clients.md +203 -0
  712. package/daemon/docs/reference/execution-platform-contract.md +1 -1
  713. package/daemon/docs/reference/gateway-participants.md +29 -17
  714. package/daemon/docs/reference/getting-started.md +36 -9
  715. package/daemon/docs/reference/harness-runner-contract.md +235 -26
  716. package/daemon/docs/reference/hosted-members.md +32 -0
  717. package/daemon/docs/reference/instance-layout.md +11 -0
  718. package/daemon/docs/reference/keeping-a-watch.md +22 -0
  719. package/daemon/docs/reference/pi-tool-selection-recovery.md +84 -0
  720. package/daemon/docs/reference/quickstart.md +9 -4
  721. package/daemon/docs/reference/rig-bundle.md +2 -2
  722. package/daemon/docs/reference/rig-spec.md +130 -14
  723. package/daemon/docs/reference/runner-conformance/README.md +77 -0
  724. package/daemon/docs/reference/runner-conformance/check-runner.mjs +818 -0
  725. package/daemon/docs/reference/runner-conformance/fake-acp-agent.mjs +150 -0
  726. package/daemon/docs/reference/sdlc-conventions.md +22 -3
  727. package/daemon/docs/reference/seat-delivery.md +31 -6
  728. package/daemon/docs/reference/slack-app-setup.md +55 -5
  729. package/daemon/docs/reference/terminal-sessions.md +100 -14
  730. package/daemon/docs/reference/tmux-servers.md +166 -0
  731. package/daemon/docs/reference/whats-new.md +294 -132
  732. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +4 -3
  733. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/scripts/backup-sqlite.mjs +90 -14
  734. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +2 -1
  735. package/daemon/specs/rigs/launch/kernel/agents/queue/worker/guidance/role.md +1 -1
  736. package/dist/acp/connector.d.ts.map +1 -1
  737. package/dist/acp/connector.js +6 -1
  738. package/dist/acp/connector.js.map +1 -1
  739. package/dist/atomic-text-write.d.ts +2 -0
  740. package/dist/atomic-text-write.d.ts.map +1 -1
  741. package/dist/atomic-text-write.js +17 -0
  742. package/dist/atomic-text-write.js.map +1 -1
  743. package/dist/build-info.js +3 -3
  744. package/dist/client.d.ts +3 -0
  745. package/dist/client.d.ts.map +1 -1
  746. package/dist/client.js +28 -0
  747. package/dist/client.js.map +1 -1
  748. package/dist/commands/attach.d.ts +1 -0
  749. package/dist/commands/attach.d.ts.map +1 -1
  750. package/dist/commands/attach.js +8 -2
  751. package/dist/commands/attach.js.map +1 -1
  752. package/dist/commands/broadcast.js +2 -1
  753. package/dist/commands/broadcast.js.map +1 -1
  754. package/dist/commands/compact.d.ts.map +1 -1
  755. package/dist/commands/compact.js +7 -4
  756. package/dist/commands/compact.js.map +1 -1
  757. package/dist/commands/config.d.ts.map +1 -1
  758. package/dist/commands/config.js +9 -3
  759. package/dist/commands/config.js.map +1 -1
  760. package/dist/commands/context.d.ts.map +1 -1
  761. package/dist/commands/context.js +1 -0
  762. package/dist/commands/context.js.map +1 -1
  763. package/dist/commands/daemon.d.ts.map +1 -1
  764. package/dist/commands/daemon.js +7 -1
  765. package/dist/commands/daemon.js.map +1 -1
  766. package/dist/commands/destroy.d.ts.map +1 -1
  767. package/dist/commands/destroy.js +2 -0
  768. package/dist/commands/destroy.js.map +1 -1
  769. package/dist/commands/doctor.d.ts +8 -1
  770. package/dist/commands/doctor.d.ts.map +1 -1
  771. package/dist/commands/doctor.js +126 -10
  772. package/dist/commands/doctor.js.map +1 -1
  773. package/dist/commands/down.d.ts.map +1 -1
  774. package/dist/commands/down.js +10 -0
  775. package/dist/commands/down.js.map +1 -1
  776. package/dist/commands/env.d.ts.map +1 -1
  777. package/dist/commands/env.js +10 -4
  778. package/dist/commands/env.js.map +1 -1
  779. package/dist/commands/environment.d.ts +8 -0
  780. package/dist/commands/environment.d.ts.map +1 -0
  781. package/dist/commands/environment.js +197 -0
  782. package/dist/commands/environment.js.map +1 -0
  783. package/dist/commands/export.d.ts +2 -0
  784. package/dist/commands/export.d.ts.map +1 -1
  785. package/dist/commands/export.js +31 -7
  786. package/dist/commands/export.js.map +1 -1
  787. package/dist/commands/gateway.js +15 -11
  788. package/dist/commands/gateway.js.map +1 -1
  789. package/dist/commands/host.d.ts +13 -6
  790. package/dist/commands/host.d.ts.map +1 -1
  791. package/dist/commands/host.js +112 -15
  792. package/dist/commands/host.js.map +1 -1
  793. package/dist/commands/project-jev.js +1 -1
  794. package/dist/commands/project-jev.js.map +1 -1
  795. package/dist/commands/provider.d.ts.map +1 -1
  796. package/dist/commands/provider.js +12 -5
  797. package/dist/commands/provider.js.map +1 -1
  798. package/dist/commands/ps.d.ts +2 -0
  799. package/dist/commands/ps.d.ts.map +1 -1
  800. package/dist/commands/ps.js +12 -3
  801. package/dist/commands/ps.js.map +1 -1
  802. package/dist/commands/queue.d.ts +1 -0
  803. package/dist/commands/queue.d.ts.map +1 -1
  804. package/dist/commands/queue.js +50 -6
  805. package/dist/commands/queue.js.map +1 -1
  806. package/dist/commands/scope.d.ts.map +1 -1
  807. package/dist/commands/scope.js +36 -2
  808. package/dist/commands/scope.js.map +1 -1
  809. package/dist/commands/seat.d.ts.map +1 -1
  810. package/dist/commands/seat.js +85 -8
  811. package/dist/commands/seat.js.map +1 -1
  812. package/dist/commands/send.d.ts.map +1 -1
  813. package/dist/commands/send.js +46 -16
  814. package/dist/commands/send.js.map +1 -1
  815. package/dist/commands/setup.d.ts.map +1 -1
  816. package/dist/commands/setup.js +18 -0
  817. package/dist/commands/setup.js.map +1 -1
  818. package/dist/commands/slack.d.ts.map +1 -1
  819. package/dist/commands/slack.js +5 -0
  820. package/dist/commands/slack.js.map +1 -1
  821. package/dist/commands/specs.d.ts +1 -1
  822. package/dist/commands/specs.d.ts.map +1 -1
  823. package/dist/commands/specs.js +44 -10
  824. package/dist/commands/specs.js.map +1 -1
  825. package/dist/commands/stream.d.ts.map +1 -1
  826. package/dist/commands/stream.js +6 -1
  827. package/dist/commands/stream.js.map +1 -1
  828. package/dist/commands/terminal.d.ts +2 -0
  829. package/dist/commands/terminal.d.ts.map +1 -1
  830. package/dist/commands/terminal.js +31 -2
  831. package/dist/commands/terminal.js.map +1 -1
  832. package/dist/commands/topology-default-agent.js +1 -1
  833. package/dist/commands/topology-default-agent.js.map +1 -1
  834. package/dist/commands/tui.d.ts +3 -2
  835. package/dist/commands/tui.d.ts.map +1 -1
  836. package/dist/commands/tui.js.map +1 -1
  837. package/dist/commands/walk.d.ts.map +1 -1
  838. package/dist/commands/walk.js +27 -10
  839. package/dist/commands/walk.js.map +1 -1
  840. package/dist/commands/workspace.d.ts.map +1 -1
  841. package/dist/commands/workspace.js +8 -1
  842. package/dist/commands/workspace.js.map +1 -1
  843. package/dist/config-store.d.ts +9 -1
  844. package/dist/config-store.d.ts.map +1 -1
  845. package/dist/config-store.js +33 -2
  846. package/dist/config-store.js.map +1 -1
  847. package/dist/cross-host-target.d.ts.map +1 -1
  848. package/dist/cross-host-target.js +3 -1
  849. package/dist/cross-host-target.js.map +1 -1
  850. package/dist/daemon-lifecycle.d.ts +6 -0
  851. package/dist/daemon-lifecycle.d.ts.map +1 -1
  852. package/dist/daemon-lifecycle.js +66 -4
  853. package/dist/daemon-lifecycle.js.map +1 -1
  854. package/dist/daemon-reachability.d.ts +2 -1
  855. package/dist/daemon-reachability.d.ts.map +1 -1
  856. package/dist/daemon-reachability.js +3 -2
  857. package/dist/daemon-reachability.js.map +1 -1
  858. package/dist/destroy-helpers.d.ts +3 -2
  859. package/dist/destroy-helpers.d.ts.map +1 -1
  860. package/dist/destroy-helpers.js +6 -3
  861. package/dist/destroy-helpers.js.map +1 -1
  862. package/dist/host-bindings.js +1 -1
  863. package/dist/host-bindings.js.map +1 -1
  864. package/dist/host-registry.d.ts +22 -0
  865. package/dist/host-registry.d.ts.map +1 -1
  866. package/dist/host-registry.js +121 -0
  867. package/dist/host-registry.js.map +1 -1
  868. package/dist/index.d.ts +2 -0
  869. package/dist/index.d.ts.map +1 -1
  870. package/dist/index.js +2 -0
  871. package/dist/index.js.map +1 -1
  872. package/dist/lazy-program.d.ts.map +1 -1
  873. package/dist/lazy-program.js +1 -0
  874. package/dist/lazy-program.js.map +1 -1
  875. package/dist/lib/scope/progress-edit.d.ts.map +1 -1
  876. package/dist/lib/scope/progress-edit.js +37 -7
  877. package/dist/lib/scope/progress-edit.js.map +1 -1
  878. package/dist/lib/scope/scope-audit.d.ts +1 -1
  879. package/dist/lib/scope/scope-audit.d.ts.map +1 -1
  880. package/dist/lib/scope/scope-audit.js.map +1 -1
  881. package/dist/lib/scope/scope-fs.d.ts +3 -0
  882. package/dist/lib/scope/scope-fs.d.ts.map +1 -1
  883. package/dist/lib/scope/scope-fs.js +39 -53
  884. package/dist/lib/scope/scope-fs.js.map +1 -1
  885. package/dist/lib/scope/types.d.ts +3 -0
  886. package/dist/lib/scope/types.d.ts.map +1 -1
  887. package/dist/lib/scope/types.js.map +1 -1
  888. package/dist/mcp-server.d.ts.map +1 -1
  889. package/dist/mcp-server.js +89 -18
  890. package/dist/mcp-server.js.map +1 -1
  891. package/dist/openrig-compat.d.ts +1 -1
  892. package/dist/openrig-compat.d.ts.map +1 -1
  893. package/dist/openrig-compat.js +2 -2
  894. package/dist/openrig-compat.js.map +1 -1
  895. package/dist/seat-launch-additions-lines.d.ts +2 -0
  896. package/dist/seat-launch-additions-lines.d.ts.map +1 -1
  897. package/dist/seat-launch-additions-lines.js +1 -0
  898. package/dist/seat-launch-additions-lines.js.map +1 -1
  899. package/dist/shared-tui.d.ts +4 -2
  900. package/dist/shared-tui.d.ts.map +1 -1
  901. package/dist/shared-tui.js +4 -11
  902. package/dist/shared-tui.js.map +1 -1
  903. package/dist/terminal-window.d.ts.map +1 -1
  904. package/dist/terminal-window.js +34 -29
  905. package/dist/terminal-window.js.map +1 -1
  906. package/dist/tmux-attachment.d.ts +17 -0
  907. package/dist/tmux-attachment.d.ts.map +1 -0
  908. package/dist/tmux-attachment.js +89 -0
  909. package/dist/tmux-attachment.js.map +1 -0
  910. package/package.json +2 -2
  911. package/tui/dist/attention/attention-model.d.ts +3 -2
  912. package/tui/dist/attention/attention-model.d.ts.map +1 -1
  913. package/tui/dist/attention/attention-model.js +7 -4
  914. package/tui/dist/attention/attention-model.js.map +1 -1
  915. package/tui/dist/daemon-client.d.ts +4 -4
  916. package/tui/dist/daemon-client.d.ts.map +1 -1
  917. package/tui/dist/daemon-client.js +6 -5
  918. package/tui/dist/daemon-client.js.map +1 -1
  919. package/tui/dist/hydrate.d.ts.map +1 -1
  920. package/tui/dist/hydrate.js +16 -5
  921. package/tui/dist/hydrate.js.map +1 -1
  922. package/tui/dist/pulse/pulse-model.d.ts +1 -1
  923. package/tui/dist/pulse/pulse-model.d.ts.map +1 -1
  924. package/tui/dist/pulse/pulse-model.js +6 -17
  925. package/tui/dist/pulse/pulse-model.js.map +1 -1
  926. package/tui/dist/render.d.ts.map +1 -1
  927. package/tui/dist/render.js +8 -2
  928. package/tui/dist/render.js.map +1 -1
  929. package/tui/dist/terminals/terminal-model.d.ts.map +1 -1
  930. package/tui/dist/terminals/terminal-model.js +2 -1
  931. package/tui/dist/terminals/terminal-model.js.map +1 -1
  932. package/tui/dist/theme.d.ts.map +1 -1
  933. package/tui/dist/theme.js +7 -2
  934. package/tui/dist/theme.js.map +1 -1
  935. package/tui/dist/time.d.ts +2 -0
  936. package/tui/dist/time.d.ts.map +1 -1
  937. package/tui/dist/time.js +5 -0
  938. package/tui/dist/time.js.map +1 -1
  939. package/tui/dist/types.d.ts +2 -3
  940. package/tui/dist/types.d.ts.map +1 -1
  941. package/ui/dist/assets/index-BFOs3ejL.css +32 -0
  942. package/ui/dist/assets/{index-CMBgYrS7.js → index-CdkFwtld.js} +92 -92
  943. package/ui/dist/index.html +2 -2
  944. package/ui/dist/assets/index-DNU3XZr_.css +0 -32
@@ -0,0 +1,54 @@
1
+ import type Database from "better-sqlite3";
2
+ import { type ManagedBlockMergeFsOps, type ManagedBlockStanding } from "./managed-blocks.js";
3
+ /** #2456: OpenRig's record of what it last wrote in each managed guidance block, so a later start, exact resume, handover
4
+ * or runtime switch can tell a block it wrote (refreshed when its source changes) from a block a person edited (kept). */
5
+ export interface ManagedBlockRecords {
6
+ /** The hash of what OpenRig last wrote in this block of this file, or undefined when there's no record. Throws when the
7
+ * record can't be read, which is unknown, never "no record". */
8
+ get(file: string, blockId: string): string | undefined;
9
+ /** Record that OpenRig's block in this file now holds `body`. Throws when the record can't be saved. */
10
+ set(file: string, blockId: string, body: string): void;
11
+ }
12
+ /** The hash a record keeps: sha256 of the body without the writer's framing, so framing never reads as an edit. */
13
+ export declare function managedBlockBodyHash(body: string): string;
14
+ /** A guidance file's key: the file's own real path, so every link to one file names the same file; a file that doesn't
15
+ * exist yet is keyed by its folder's real path and its name. */
16
+ export declare function guidanceFileKey(file: string): string;
17
+ /** The records kept in the daemon database (`managed_block_writes`). A database without that table has no records: reads
18
+ * find none and writes record nothing, so its blocks read as unrecorded. Any other failure is thrown, so a caller can
19
+ * name it instead of reading it as no record. */
20
+ export declare function managedBlockRecords(db: Pick<Database.Database, "prepare">, now?: () => Date): ManagedBlockRecords;
21
+ /** Record a block just written. A record that can't be saved is named in `notes`; the write itself still counts. */
22
+ export declare function recordManagedBlockWrite(records: ManagedBlockRecords, targetPath: string, blockId: string, body: string, notes?: string[]): void;
23
+ /** The note for a block left as it is, named for the seat and the person. */
24
+ export declare function keptGuidanceNote(standing: "edited" | "unrecorded", targetPath: string, blockId: string, sourcePath: string): string;
25
+ /** The note for a block a start replaced although OpenRig had no record of writing it. */
26
+ export declare function refreshedUnrecordedGuidanceNote(targetPath: string, blockId: string, sourcePath: string): string;
27
+ /** #2456: what to do with one block, from the file's text, the source's text and the record:
28
+ * - write it when it's absent (unless `onlyIfPresent`), current, OpenRig's own last write, or (`unrecorded: "refresh"`,
29
+ * a start, as starts always replaced) different with no record, which is named;
30
+ * - keep it, named, when a person edited it since OpenRig wrote it, or (`"keep"`, exact resume and handover) when it
31
+ * differs with no record;
32
+ * - keep it, named, when it differs and its record can't be read (`unknown`): that's never read as no record. */
33
+ export declare function decideManagedBlock(content: string, blockId: string, source: string, records: ManagedBlockRecords, targetPath: string, opts: {
34
+ unrecorded: "keep" | "refresh";
35
+ onlyIfPresent?: boolean;
36
+ sourcePath?: string;
37
+ }): {
38
+ standing: ManagedBlockStanding | "unknown";
39
+ write: boolean;
40
+ note?: string;
41
+ };
42
+ /** #2456: the one write of a managed guidance block that every adapter's guidance merge goes through. Without `records` it's
43
+ * the plain merge, as before. With them, `decideManagedBlock` decides; a kept block is named in `warnings` and nothing is
44
+ * written. A written block is recorded at once, so a later failure in the same start can't lose its record. Returns
45
+ * whether the block was written. */
46
+ export declare function writeManagedGuidanceBlock(files: ManagedBlockMergeFsOps, targetPath: string, blockId: string, content: string, opts: {
47
+ records?: ManagedBlockRecords;
48
+ unrecorded?: "keep" | "refresh";
49
+ onlyIfPresent?: boolean;
50
+ sourcePath?: string;
51
+ warnings?: string[];
52
+ replaceBlockIds?: string[];
53
+ }): boolean;
54
+ //# sourceMappingURL=managed-block-records.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managed-block-records.d.ts","sourceRoot":"","sources":["../../src/domain/managed-block-records.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC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AAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,EACnI,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,EAAE,oBAAoB,GAAG,SAAS,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAgBvK;AAED;;;qCAGqC;AACrC,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE;IACnI,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7G,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CACjD,GAAG,OAAO,CAgBV"}
@@ -0,0 +1,130 @@
1
+ import { createHash } from "node:crypto";
2
+ import fs from "node:fs";
3
+ import nodePath from "node:path";
4
+ import { frameManagedBlockBody, managedBlockStanding, mergeManagedBlock } from "./managed-blocks.js";
5
+ /** The hash a record keeps: sha256 of the body without the writer's framing, so framing never reads as an edit. */
6
+ export function managedBlockBodyHash(body) {
7
+ return createHash("sha256").update(frameManagedBlockBody(body)).digest("hex");
8
+ }
9
+ /** A guidance file's key: the file's own real path, so every link to one file names the same file; a file that doesn't
10
+ * exist yet is keyed by its folder's real path and its name. */
11
+ export function guidanceFileKey(file) {
12
+ const resolved = nodePath.resolve(file);
13
+ try {
14
+ return fs.realpathSync.native(resolved);
15
+ }
16
+ catch { /* not there yet */ }
17
+ try {
18
+ return nodePath.join(fs.realpathSync.native(nodePath.dirname(resolved)), nodePath.basename(resolved));
19
+ }
20
+ catch {
21
+ return resolved;
22
+ }
23
+ }
24
+ /** Whether a database error is a schema without the records table (an older test or tool schema), which has no records. */
25
+ function noRecordsTable(err) {
26
+ return err instanceof Error && err.message.includes("no such table: managed_block_writes");
27
+ }
28
+ /** The records kept in the daemon database (`managed_block_writes`). A database without that table has no records: reads
29
+ * find none and writes record nothing, so its blocks read as unrecorded. Any other failure is thrown, so a caller can
30
+ * name it instead of reading it as no record. */
31
+ export function managedBlockRecords(db, now = () => new Date()) {
32
+ return {
33
+ get(file, blockId) {
34
+ try {
35
+ const row = db.prepare("SELECT body_sha256 FROM managed_block_writes WHERE path_key = ? AND block_id = ?")
36
+ .get(guidanceFileKey(file), blockId);
37
+ return row?.body_sha256;
38
+ }
39
+ catch (err) {
40
+ if (noRecordsTable(err))
41
+ return undefined;
42
+ throw err;
43
+ }
44
+ },
45
+ set(file, blockId, body) {
46
+ try {
47
+ db.prepare(`INSERT INTO managed_block_writes (path_key, block_id, body_sha256, written_at) VALUES (?, ?, ?, ?)
48
+ ON CONFLICT(path_key, block_id) DO UPDATE SET body_sha256 = excluded.body_sha256, written_at = excluded.written_at`)
49
+ .run(guidanceFileKey(file), blockId, managedBlockBodyHash(body), now().toISOString());
50
+ }
51
+ catch (err) {
52
+ if (!noRecordsTable(err))
53
+ throw err;
54
+ }
55
+ },
56
+ };
57
+ }
58
+ /** Record a block just written. A record that can't be saved is named in `notes`; the write itself still counts. */
59
+ export function recordManagedBlockWrite(records, targetPath, blockId, body, notes) {
60
+ try {
61
+ records.set(targetPath, blockId, body);
62
+ }
63
+ catch {
64
+ notes?.push(`guidance_block_record_not_saved: ${targetPath}: ${blockId} was written, but its write record wasn't saved, so a later edit may read as unrecorded`);
65
+ }
66
+ }
67
+ /** The note for a block left as it is, named for the seat and the person. */
68
+ export function keptGuidanceNote(standing, targetPath, blockId, sourcePath) {
69
+ return standing === "edited"
70
+ ? `guidance_block_edited: ${targetPath}: ${blockId} was edited by hand since OpenRig wrote it, so it wasn't refreshed from ${sourcePath}`
71
+ : `guidance_block_may_be_stale: ${targetPath}: ${blockId} differs from ${sourcePath} and OpenRig has no record of writing it, so it was left as it is`;
72
+ }
73
+ /** The note for a block a start replaced although OpenRig had no record of writing it. */
74
+ export function refreshedUnrecordedGuidanceNote(targetPath, blockId, sourcePath) {
75
+ return `guidance_block_refreshed_unrecorded: ${targetPath}: ${blockId} was replaced from ${sourcePath}; OpenRig had no record of writing it, as for every block written before records were kept`;
76
+ }
77
+ /** #2456: what to do with one block, from the file's text, the source's text and the record:
78
+ * - write it when it's absent (unless `onlyIfPresent`), current, OpenRig's own last write, or (`unrecorded: "refresh"`,
79
+ * a start, as starts always replaced) different with no record, which is named;
80
+ * - keep it, named, when a person edited it since OpenRig wrote it, or (`"keep"`, exact resume and handover) when it
81
+ * differs with no record;
82
+ * - keep it, named, when it differs and its record can't be read (`unknown`): that's never read as no record. */
83
+ export function decideManagedBlock(content, blockId, source, records, targetPath, opts) {
84
+ let recorded;
85
+ let unreadable = false;
86
+ try {
87
+ recorded = records.get(targetPath, blockId);
88
+ }
89
+ catch {
90
+ unreadable = true;
91
+ }
92
+ const standing = managedBlockStanding(content, blockId, source, recorded, managedBlockBodyHash);
93
+ const named = opts.sourcePath ?? "its source";
94
+ if (standing === "absent")
95
+ return { standing, write: !opts.onlyIfPresent };
96
+ if (unreadable && standing === "unrecorded") {
97
+ return { standing: "unknown", write: false,
98
+ note: `guidance_block_record_unreadable: ${targetPath}: ${blockId} wasn't refreshed from ${named} because OpenRig couldn't read its write record` };
99
+ }
100
+ if (standing === "edited" || (standing === "unrecorded" && opts.unrecorded === "keep")) {
101
+ return { standing, write: false, note: keptGuidanceNote(standing, targetPath, blockId, named) };
102
+ }
103
+ if (standing === "unrecorded")
104
+ return { standing, write: true, note: refreshedUnrecordedGuidanceNote(targetPath, blockId, named) };
105
+ return { standing, write: true };
106
+ }
107
+ /** #2456: the one write of a managed guidance block that every adapter's guidance merge goes through. Without `records` it's
108
+ * the plain merge, as before. With them, `decideManagedBlock` decides; a kept block is named in `warnings` and nothing is
109
+ * written. A written block is recorded at once, so a later failure in the same start can't lose its record. Returns
110
+ * whether the block was written. */
111
+ export function writeManagedGuidanceBlock(files, targetPath, blockId, content, opts) {
112
+ const merge = () => mergeManagedBlock(files, targetPath, blockId, content, { warnings: opts.warnings, replaceBlockIds: opts.replaceBlockIds ?? [] });
113
+ // Without records, the plain merge as before; a refresh-only call (`onlyIfPresent`) then writes nothing.
114
+ if (!opts.records) {
115
+ if (opts.onlyIfPresent)
116
+ return false;
117
+ merge();
118
+ return true;
119
+ }
120
+ const existing = files.exists(targetPath) ? files.readFile(targetPath) : "";
121
+ const decision = decideManagedBlock(existing, blockId, content, opts.records, targetPath, { unrecorded: opts.unrecorded ?? "refresh", onlyIfPresent: opts.onlyIfPresent, sourcePath: opts.sourcePath });
122
+ if (decision.note)
123
+ opts.warnings?.push(decision.note);
124
+ if (!decision.write)
125
+ return false;
126
+ merge();
127
+ recordManagedBlockWrite(opts.records, targetPath, blockId, content, opts.warnings);
128
+ return true;
129
+ }
130
+ //# sourceMappingURL=managed-block-records.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managed-block-records.js","sourceRoot":"","sources":["../../src/domain/managed-block-records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,iBAAiB,EAA0D,MAAM,qBAAqB,CAAC;AAY7J,mHAAmH;AACnH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAA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AC;AACd,CAAC"}
@@ -21,9 +21,23 @@ export declare function managedBlockText(blockId: string, content: string): stri
21
21
  /** What `mergeManagedBlock` puts between a file's existing text and a block it adds at the end. */
22
22
  export declare const MANAGED_BLOCK_APPEND_SEPARATOR = "\n\n";
23
23
  export declare function mergeManagedBlock(fs: ManagedBlockMergeFsOps, targetPath: string, blockId: string, content: string, options?: MergeManagedBlockOptions): void;
24
+ /** A block body without the writer's own framing: CRLF line endings become LF, and newlines at either end go. */
25
+ export declare function frameManagedBlockBody(text: string): string;
24
26
  /** Whether a block's body still holds `written`: the same bytes, ignoring only the writer's own framing (newlines at either
25
27
  * end, and CRLF line endings). A person's spaces count, so an indented line is an edit. */
26
28
  export declare function managedBlockBodyMatches(body: string, written: string): boolean;
29
+ /** The bodies of every `blockId` block in `content`, in the current or the legacy marker form. */
30
+ export declare function managedBlockBodies(content: string, blockId: string): string[];
31
+ /** #2456: how a block already in a guidance file stands against its current source and OpenRig's record of what it last
32
+ * wrote there (a hash of the framed body, `managedBlockBodyHash`):
33
+ * - `absent`: the file holds no such block;
34
+ * - `current`: it holds the source's text;
35
+ * - `stale`: it holds what OpenRig last wrote, and the source has changed since, so it's OpenRig's to refresh;
36
+ * - `edited`: it holds something else, which someone wrote by hand;
37
+ * - `unrecorded`: it differs from the source and OpenRig has no record of writing it, so which of the two is unknown.
38
+ * A block written more than once counts as edited when any copy is. */
39
+ export type ManagedBlockStanding = "absent" | "current" | "stale" | "edited" | "unrecorded";
40
+ export declare function managedBlockStanding(content: string, blockId: string, source: string, recordedHash: string | undefined, hash: (body: string) => string): ManagedBlockStanding;
27
41
  /** Whether `content` holds a `blockId` block whose body is anything but `written`: someone edited it. */
28
42
  export declare function hasEditedManagedBlock(content: string, blockId: string, written: string): boolean;
29
43
  /** What a removal did: whether the file changed, and the ids of blocks kept because they were edited. */
@@ -1 +1 @@
1
- {"version":3,"file":"managed-blocks.d.ts","sourceRoot":"","sources":["../../src/domain/managed-blocks.ts"],"names":[],"mappings":"A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AoB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,SAAS,EACrH,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,oBAAoB,CAMtD;AAED,yGAAyG;AACzG,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEhG;AAED,yGAAyG;AACzG,MAAM,WAAW,mBAAmB;IAAG,OAAO,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE;AAE/E;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,EAAE,EAAE,wBAAwB,EAC5B,UAAU,EAAE,MAAM,EAClB,aAAa,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,GACnD,mBAAmB,CAiCrB;AA6BD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAS1D;AAMD;;;gGAGgG;AAChG,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAGnF;AAKD;;mGAEmG;AACnG,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAEpF;AAED;mFACmF;AACnF,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI9F"}
@@ -60,7 +60,9 @@ export function mergeManagedBlock(fs, targetPath, blockId, content, options) {
60
60
  if (!updated.includes(begin) || !updated.includes(end)) {
61
61
  updated = `${updated.trim()}\n\n${block}`.trim();
62
62
  }
63
- fs.writeFile(targetPath, `${updated}\n`);
63
+ // End with one newline only when the file doesn't already: re-merging on every launch must not add a line each time
64
+ // (#2372), and blank lines a person left after the last block stay.
65
+ fs.writeFile(targetPath, updated.endsWith("\n") ? updated : `${updated}\n`);
64
66
  return;
65
67
  }
66
68
  fs.writeFile(targetPath, `${existing}${MANAGED_BLOCK_APPEND_SEPARATOR}${block}`);
@@ -69,11 +71,29 @@ export function mergeManagedBlock(fs, targetPath, blockId, content, options) {
69
71
  function managedBlockPattern(blockId) {
70
72
  return new RegExp(`${escapeRegex(MANAGED_BLOCK_START(blockId))}([\\s\\S]*?)${escapeRegex(MANAGED_BLOCK_END(blockId))}`, "g");
71
73
  }
74
+ /** A block body without the writer's own framing: CRLF line endings become LF, and newlines at either end go. */
75
+ export function frameManagedBlockBody(text) {
76
+ return text.replace(/\r\n/g, "\n").replace(/^\n+|\n+$/g, "");
77
+ }
72
78
  /** Whether a block's body still holds `written`: the same bytes, ignoring only the writer's own framing (newlines at either
73
79
  * end, and CRLF line endings). A person's spaces count, so an indented line is an edit. */
74
80
  export function managedBlockBodyMatches(body, written) {
75
- const frame = (text) => text.replace(/\r\n/g, "\n").replace(/^\n+|\n+$/g, "");
76
- return frame(body) === frame(written);
81
+ return frameManagedBlockBody(body) === frameManagedBlockBody(written);
82
+ }
83
+ /** The bodies of every `blockId` block in `content`, in the current or the legacy marker form. */
84
+ export function managedBlockBodies(content, blockId) {
85
+ const legacy = new RegExp(`${escapeRegex(LEGACY_BLOCK_START(blockId))}([\\s\\S]*?)${escapeRegex(LEGACY_BLOCK_END(blockId))}`, "g");
86
+ return [...content.matchAll(managedBlockPattern(blockId)), ...content.matchAll(legacy)].map((m) => m[1]);
87
+ }
88
+ export function managedBlockStanding(content, blockId, source, recordedHash, hash) {
89
+ const bodies = managedBlockBodies(content, blockId);
90
+ if (bodies.length === 0)
91
+ return "absent";
92
+ if (bodies.every((body) => managedBlockBodyMatches(body, source)))
93
+ return "current";
94
+ if (recordedHash === undefined)
95
+ return "unrecorded";
96
+ return bodies.every((body) => hash(body) === recordedHash) ? "stale" : "edited";
77
97
  }
78
98
  /** Whether `content` holds a `blockId` block whose body is anything but `written`: someone edited it. */
79
99
  export function hasEditedManagedBlock(content, blockId, written) {
@@ -122,7 +142,7 @@ const CURRENT_BLOCK = /(?:\n|^)\s*(<!-- BEGIN OpenRig MANAGED BLOCK: [\s\S]*?<!-
122
142
  /**
123
143
  * `content` with OpenRig's blocks taken out as `mergeManagedBlock` put them in: each block, the separator it wrote before
124
144
  * the first (none when that block started a new file), and the newline-only text between and after blocks, where the
125
- * writer puts its separators (a later merge ends the file with one more). Text a person adds is kept. Blank lines a
145
+ * writer puts its separators (a later merge ends the file with a newline). Text a person adds is kept. Blank lines a
126
146
  * person adds right next to a block, between blocks or after the last, go with it: they can't be told from the writer's.
127
147
  * Null when the file isn't in that shape, such as a legacy block, or text against a block without the writer's separator.
128
148
  */
@@ -1 +1 @@
1
- {"version":3,"file":"managed-blocks.js","sourceRoot":"","sources":["../../src/domain/managed-blocks.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,kEAAkE;AAClE,uEAAuE;AACvE,qEAAqE;AACrE,wEAAwE;AACxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,qCAAqC,EAAE,MAAM,CAAC;AACjG,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,mCAAmC,EAAE,MAAM,CAAC;AAC7F,MAAM,kBAAkB,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,oCAAoC,EAAE,MAAM,CAAC;AAExF,qEAAqE;AACrE,4EAA4E;AAC5E,qDAAqD;AACrD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,WAAW,EAAE,iBAAiB,CAAU,CAAC;AAEpF,MAAM,CAAC,MAAM,iCAAiC,GAA2B,WAAW,CAAC;AACrF,MAAM,gBAAgB,GAAG,CAAC,EAAU,EAAE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AAM,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjE,CAAC;AAED;mFACmF;AACnF,MAAM,UAAU,sBAAsB,CAAC,OAAe,EAAE,UAAkB;IACxE,IAAI,OAAO,KAAK,UAAU;QAAE,OAAO,SAAS,CAAC;IAC7C,OAAO,GAAG,OAAO,qBAAqB,UAAU,sFAAsF;UAClI,gHAAgH,CAAC;AACvH,CAAC"}
@@ -2,8 +2,8 @@ import type Database from "better-sqlite3";
2
2
  import type { EventBus } from "../event-bus.js";
3
3
  import { type QueueRepository, type QueueItem } from "../queue-repository.js";
4
4
  import { MissionControlActionLog, type MissionControlVerb } from "./mission-control-action-log.js";
5
- /** The primary user when several people are registered and none is the default, or when no one is registered and the
6
- * claimed actor is a shared channel: the generic human seat the web UI also records. */
5
+ /** The terminal's act, which names no responder: the generic human seat the web UI also records, read as explicitly
6
+ * unattributed, never a person. */
7
7
  export declare const UNNAMED_PRIMARY_USER = "human@host";
8
8
  export declare class MissionControlWriteContractError extends Error {
9
9
  readonly code: string;
@@ -28,15 +28,22 @@ export interface MissionControlActionInput {
28
28
  /** OPR.0.4.4.19 FR-7 — required for `resolve`: the human's non-empty
29
29
  * decision text. Lands durably in queue_transitions.transition_note. */
30
30
  decision?: string;
31
+ /** For `resolve` of a decision parked on the person it asked, from Slack: their typed words, also stored as its answer in
32
+ * the same transaction as the resume. Set in process only; the route never passes it. */
33
+ answerText?: string;
31
34
  /** For `answer`: the question and option the person chose. Without them, `decision` is their typed answer. */
32
35
  questionId?: string;
33
36
  optionId?: string;
34
37
  /** Operator-supplied audit context. */
35
38
  auditNotes?: Record<string, unknown>;
36
- /** `primary-user`: the person at the terminal acts (the TUI), whoever was asked. The actor recorded is the primary user
37
- * (the default person), never the claimed actor, and the audit notes say whose ask it was. Only a request with no
38
- * transport identity carries it. */
39
+ /** `primary-user`: the person at the terminal acts (the TUI), whoever was asked. The terminal's claimed actor is the
40
+ * Feed's recipient-derived value, not who typed, so the act is recorded as human@host, explicitly unattributed, never
41
+ * the default person or the claim; the audit notes say whose ask it was. Only a request with no transport identity
42
+ * carries it. A surface that knows its person sends them without it. */
39
43
  authority?: "primary-user";
44
+ /** #2446, opt-in: the `decisionRevision` the caller read. A settling act then runs only on that decision; omitted, the
45
+ * act and its result are exactly as before. An `operationId` in `auditNotes` lets a retry be answered from the record. */
46
+ expectedRevision?: string;
40
47
  /**
41
48
  * For handoff: opt-in best-effort wake. Default true (PL-004 Phase A R1
42
49
  * pattern: durable + waking by default; operators opt out for cold queues).
@@ -59,6 +66,12 @@ export interface MissionControlActionResult {
59
66
  unanswered: string[];
60
67
  message?: string;
61
68
  };
69
+ /** With expectedRevision only: the decision's revision as saved. */
70
+ decisionRevision?: string;
71
+ /** With expectedRevision only: this retry is the caller's own committed operation, answered from its record. */
72
+ reconciled?: true;
73
+ /** With expectedRevision on a verb that doesn't settle a decision: it wasn't checked, and the act ran as without it. */
74
+ revisionNote?: string;
62
75
  }
63
76
  interface WriteContractDeps {
64
77
  db: Database.Database;
@@ -80,6 +93,9 @@ export declare class MissionControlWriteContract {
80
93
  * notify subscribers + opt-in transport wake (handoff only).
81
94
  */
82
95
  act(input: MissionControlActionInput): Promise<MissionControlActionResult>;
96
+ /** A guarded act's decision changed since its revision was read: nothing was written, and the caller gets what's saved. */
97
+ private revisionChanged;
98
+ private actOn;
83
99
  /**
84
100
  * Annotate has no queue mutation — only an audit record + event.
85
101
  * Still wrapped in a transaction so the audit + event are atomic.
@@ -120,14 +136,17 @@ export declare class MissionControlWriteContract {
120
136
  * words: finish its close and tell the person where their original answer went. No second reply or wake is created.
121
137
  */
122
138
  private answerAsk;
139
+ /** Another person's committed return already answers the ask: settle the ask with it if it's still pending (the
140
+ * repository closes it as theirs), then tell this person who answered and where it went. */
141
+ private answeredByAnother;
123
142
  /** The audit row and event for one answer (its queue writes are the repository's own). */
124
143
  private recordAnswer;
125
144
  /**
126
- * Who acts, and on whose ask. With primary-user authority the actor is the primary user: the default person, or, with
127
- * several people and none chosen, the generic human seat. With no one registered it's the claimed actor, as before,
128
- * unless that's a shared channel: then it's the generic human seat. The audit notes record the authority and the person
129
- * asked, and the transition says so when they differ. Without it, a registered person can't settle what was asked of
130
- * another registered person: that's someone else's answer. A shared channel never acts on a row, for any verb: its
145
+ * Who acts, and on whose ask. One trusted workspace, equal authority: any registered person settles an ask that went to
146
+ * another, recorded as themselves, and the transition and audit notes name the person asked. With primary-user
147
+ * authority the terminal names no responder (its claimed actor is the Feed's recipient-derived value), so the act is
148
+ * human@host, explicitly unattributed, never the default person or the claim, whether or not anyone is registered. A
149
+ * shared channel never acts on a row, for any verb: its
131
150
  * messages are correspondence, so the asking seat or the person at the terminal acts on a channel's row.
132
151
  */
133
152
  private asActor;
@@ -1 +1 @@
1
- {"version":3,"file":"mission-control-write-contract.d.ts","sourceRoot":"","sources":["../../../src/domain/mission-control/mission-control-write-contract.ts"],"names":[],"mappings":"AAyCA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAsB,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAElG,OAAO,EACL,uBAAuB,EAEvB,KAAK,kBAAkB,EACxB,MAAM,iCAAiC,CAAC;AAKzC;yFACyF;AACzF,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAIjD,qBAAa,gCAAiC,SAAQ,KAAK;aAEvC,IAAI,EAAE,MAAM;aAEZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBAFjC,IAAI,EAAE,MAAM,EAC5B,OAAO,EAAE,MAAM,EACC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAA;CAKpD;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,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AS,EAAE,uBAAuB,CAAC;IACnC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,qBAAa,2BAA2B;IACtC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAoB;IACvC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;IACpC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkB;IAC5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA0B;IACpD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAa;gBAErB,IAAI,EAAE,iBAAiB;IAQnC;;;;OAIG;IACG,GAAG,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAsKhF;;;OAGG;YACW,YAAY;IAsD1B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;YACW,aAAa;IAoH3B;;;;;;;;OAQG;YACW,SAAS;IAwFvB,0FAA0F;IAC1F,OAAO,CAAC,YAAY;IAkBpB;;;;;;;OAOG;IACH,OAAO,CAAC,OAAO;IAyBf,OAAO,CAAC,mBAAmB;CAkB5B"}
1
+ {"version":3,"file":"mission-control-write-contract.d.ts","sourceRoot":"","sources":["../../../src/domain/mission-control/mission-control-write-contract.ts"],"names":[],"mappings":"AA0CA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAA0C,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEtH,OAAO,EACL,uBAAuB,EAEvB,KAAK,kBAAkB,EACxB,MAAM,iCAAiC,CAAC;AAKzC;oCACoC;AACpC,eAAO,MAAM,oBAAoB,eAAqB,CAAC;AAIvD,qBAAa,gCAAiC,SAAQ,KAAK;aAEvC,IAAI,EAAE,MAAM;aAEZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBAFjC,IAAI,EAAE,MAAM,EAC5B,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