@openrig/cli 0.7.10 → 0.7.12

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 (1131) hide show
  1. package/README.md +9 -6
  2. package/daemon/assets/claude-permission-policies.cjs +41 -0
  3. package/daemon/assets/claude-permission-policies.d.cts +3 -0
  4. package/daemon/assets/claude-team-permissions.cjs +13 -3
  5. package/daemon/assets/guidance/openrig-context-entry.md +8 -0
  6. package/daemon/assets/herdr-app/mods/rig-cell-header/main.js +15 -0
  7. package/daemon/assets/herdr-app/mods/rig-cell-header/mod.json +1 -0
  8. package/daemon/assets/herdr-app/mods/rig-ended/main.js +14 -0
  9. package/daemon/assets/herdr-app/mods/rig-ended/mod.json +1 -0
  10. package/daemon/assets/herdr-app/mods/rig-pad/main.js +10 -0
  11. package/daemon/assets/herdr-app/mods/rig-pad/mod.json +1 -0
  12. package/daemon/assets/herdr-app/mods/rig-strip/main.js +153 -0
  13. package/daemon/assets/herdr-app/mods/rig-strip/mod.json +1 -0
  14. package/daemon/assets/openshell/README.md +1 -1
  15. package/daemon/assets/pi-account-lock.cjs +39 -0
  16. package/daemon/assets/plugins/openrig/.claude-plugin/marketplace.json +15 -0
  17. package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +32 -0
  18. package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +39 -0
  19. package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +6 -0
  20. package/daemon/assets/plugins/openrig/LICENSE +200 -0
  21. package/daemon/assets/plugins/openrig/README.md +106 -0
  22. package/daemon/assets/plugins/openrig/assets/logo.svg +1 -0
  23. package/daemon/assets/plugins/openrig/mcp.json +10 -0
  24. package/daemon/assets/plugins/openrig/plugin.json +14 -0
  25. package/daemon/assets/plugins/openrig/skills/working-with-an-openrig-team/SKILL.md +90 -0
  26. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
  27. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
  28. package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +35 -0
  29. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus-state.cjs +103 -0
  30. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +177 -86
  31. package/daemon/assets/plugins/openrig-core/skills/agent-operated-software/SKILL.md +5 -1
  32. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +3 -2
  33. package/daemon/assets/plugins/openrig-core/skills/openrig-skills/SKILL.md +1 -0
  34. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +25 -9
  35. package/daemon/assets/plugins/openrig-core/skills/refocusing/SKILL.md +5 -0
  36. package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +26 -4
  37. package/daemon/assets/plugins/openrig-core/skills/retiring-and-inheriting-a-seat/SKILL.md +1 -1
  38. package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +10 -6
  39. package/daemon/assets/plugins/openrig-core/skills/session-compaction-and-restore/SKILL.md +1 -1
  40. package/daemon/assets/skills/rigs/SKILL.md +37 -2
  41. package/daemon/context-packs/help/help.md +18 -0
  42. package/daemon/context-packs/help/manifest.yaml +1 -1
  43. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  44. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +104 -14
  45. package/daemon/context-packs/reference/acp-agents.md +68 -0
  46. package/daemon/context-packs/reference/getting-started.md +19 -3
  47. package/daemon/context-packs/reference/manifest.yaml +4 -1
  48. package/daemon/context-packs/reference/rig-spec.md +71 -8
  49. package/daemon/context-packs/reference/tmux-servers.md +214 -0
  50. package/daemon/context-packs/reference/whats-new.md +402 -132
  51. package/daemon/context-packs/skills/agent-operated-software/SKILL.md +5 -1
  52. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  53. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  54. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/claude-compaction-restore/SKILL.md +3 -2
  56. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/core/cross-host-rig-commands/SKILL.md +7 -0
  60. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/core/openrig-herdr/SKILL.md +1 -0
  66. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/core/openrig-skills/SKILL.md +1 -0
  68. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  72. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  73. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  74. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  75. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  76. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  77. package/daemon/context-packs/skills/core/working-with-an-openrig-team/SKILL.md +90 -0
  78. package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +10 -0
  79. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  80. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  81. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  82. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  83. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  84. package/daemon/context-packs/skills/openrig-user/SKILL.md +25 -9
  85. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  86. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  87. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  88. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  89. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  90. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  91. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  92. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  93. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  94. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  95. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  96. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  97. package/daemon/context-packs/skills/pods/review-team/SKILL.md +2 -0
  98. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  99. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  100. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  101. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  102. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  103. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  104. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  105. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  106. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  107. package/daemon/context-packs/skills/refocusing/SKILL.md +5 -0
  108. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  109. package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +26 -4
  110. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/SKILL.md +1 -1
  111. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  112. package/daemon/context-packs/skills/seat-continuity-and-handover/SKILL.md +10 -6
  113. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  114. package/daemon/context-packs/skills/session-compaction-and-restore/SKILL.md +1 -1
  115. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  116. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  117. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  118. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  119. package/daemon/dist/adapters/claude-code-adapter.d.ts +3 -1
  120. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  121. package/daemon/dist/adapters/claude-code-adapter.js +59 -15
  122. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  123. package/daemon/dist/adapters/claude-resume.d.ts +2 -1
  124. package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
  125. package/daemon/dist/adapters/claude-resume.js +28 -6
  126. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  127. package/daemon/dist/adapters/codex-resume.d.ts +1 -1
  128. package/daemon/dist/adapters/codex-resume.d.ts.map +1 -1
  129. package/daemon/dist/adapters/codex-resume.js +6 -2
  130. package/daemon/dist/adapters/codex-resume.js.map +1 -1
  131. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +2 -0
  132. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  133. package/daemon/dist/adapters/codex-runtime-adapter.js +54 -13
  134. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  135. package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts +10 -6
  136. package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
  137. package/daemon/dist/adapters/community-harness-runtime-adapter.js +78 -24
  138. package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
  139. package/daemon/dist/adapters/kernel-authority.d.ts +2 -4
  140. package/daemon/dist/adapters/kernel-authority.d.ts.map +1 -1
  141. package/daemon/dist/adapters/kernel-authority.js +10 -41
  142. package/daemon/dist/adapters/kernel-authority.js.map +1 -1
  143. package/daemon/dist/adapters/openshell-podman-observer.d.ts.map +1 -1
  144. package/daemon/dist/adapters/openshell-podman-observer.js +5 -3
  145. package/daemon/dist/adapters/openshell-podman-observer.js.map +1 -1
  146. package/daemon/dist/adapters/pi-community-runtime-adapter.d.ts +27 -0
  147. package/daemon/dist/adapters/pi-community-runtime-adapter.d.ts.map +1 -0
  148. package/daemon/dist/adapters/pi-community-runtime-adapter.js +38 -0
  149. package/daemon/dist/adapters/pi-community-runtime-adapter.js.map +1 -0
  150. package/daemon/dist/adapters/pi-resume.d.ts +4 -1
  151. package/daemon/dist/adapters/pi-resume.d.ts.map +1 -1
  152. package/daemon/dist/adapters/pi-resume.js +38 -9
  153. package/daemon/dist/adapters/pi-resume.js.map +1 -1
  154. package/daemon/dist/adapters/pi-runner-protocol.d.ts +9 -3
  155. package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -1
  156. package/daemon/dist/adapters/pi-runner-protocol.js +13 -1
  157. package/daemon/dist/adapters/pi-runner-protocol.js.map +1 -1
  158. package/daemon/dist/adapters/pi-runner.d.ts +14 -4
  159. package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
  160. package/daemon/dist/adapters/pi-runner.js +174 -29
  161. package/daemon/dist/adapters/pi-runner.js.map +1 -1
  162. package/daemon/dist/adapters/pi-runtime-adapter.d.ts +37 -14
  163. package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
  164. package/daemon/dist/adapters/pi-runtime-adapter.js +97 -31
  165. package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
  166. package/daemon/dist/adapters/tmux-control.d.ts +32 -1
  167. package/daemon/dist/adapters/tmux-control.d.ts.map +1 -1
  168. package/daemon/dist/adapters/tmux-control.js +149 -9
  169. package/daemon/dist/adapters/tmux-control.js.map +1 -1
  170. package/daemon/dist/adapters/tmux-exec.d.ts.map +1 -1
  171. package/daemon/dist/adapters/tmux-exec.js +13 -4
  172. package/daemon/dist/adapters/tmux-exec.js.map +1 -1
  173. package/daemon/dist/adapters/tmux-server.d.ts +11 -0
  174. package/daemon/dist/adapters/tmux-server.d.ts.map +1 -1
  175. package/daemon/dist/adapters/tmux-server.js +13 -1
  176. package/daemon/dist/adapters/tmux-server.js.map +1 -1
  177. package/daemon/dist/adapters/tmux.d.ts +32 -1
  178. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  179. package/daemon/dist/adapters/tmux.js +241 -27
  180. package/daemon/dist/adapters/tmux.js.map +1 -1
  181. package/daemon/dist/attention-surface.d.ts +7 -0
  182. package/daemon/dist/attention-surface.d.ts.map +1 -1
  183. package/daemon/dist/attention-surface.js.map +1 -1
  184. package/daemon/dist/build-info.js +3 -3
  185. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  186. package/daemon/dist/db/all-migrations.js +20 -0
  187. package/daemon/dist/db/all-migrations.js.map +1 -1
  188. package/daemon/dist/db/migrations/150_node_launch_wrapper.d.ts +3 -0
  189. package/daemon/dist/db/migrations/150_node_launch_wrapper.d.ts.map +1 -0
  190. package/daemon/dist/db/migrations/150_node_launch_wrapper.js +5 -0
  191. package/daemon/dist/db/migrations/150_node_launch_wrapper.js.map +1 -0
  192. package/daemon/dist/db/migrations/151_pi_account_switches.d.ts +4 -0
  193. package/daemon/dist/db/migrations/151_pi_account_switches.d.ts.map +1 -0
  194. package/daemon/dist/db/migrations/151_pi_account_switches.js +44 -0
  195. package/daemon/dist/db/migrations/151_pi_account_switches.js.map +1 -0
  196. package/daemon/dist/db/migrations/152_workflow_instance_spec.d.ts +8 -0
  197. package/daemon/dist/db/migrations/152_workflow_instance_spec.d.ts.map +1 -0
  198. package/daemon/dist/db/migrations/152_workflow_instance_spec.js +13 -0
  199. package/daemon/dist/db/migrations/152_workflow_instance_spec.js.map +1 -0
  200. package/daemon/dist/db/migrations/153_events_retention_marks.d.ts +7 -0
  201. package/daemon/dist/db/migrations/153_events_retention_marks.d.ts.map +1 -0
  202. package/daemon/dist/db/migrations/153_events_retention_marks.js +17 -0
  203. package/daemon/dist/db/migrations/153_events_retention_marks.js.map +1 -0
  204. package/daemon/dist/db/migrations/154_workflow_instance_root_objective.d.ts +7 -0
  205. package/daemon/dist/db/migrations/154_workflow_instance_root_objective.d.ts.map +1 -0
  206. package/daemon/dist/db/migrations/154_workflow_instance_root_objective.js +11 -0
  207. package/daemon/dist/db/migrations/154_workflow_instance_root_objective.js.map +1 -0
  208. package/daemon/dist/db/migrations/155_queue_erasure.d.ts +12 -0
  209. package/daemon/dist/db/migrations/155_queue_erasure.d.ts.map +1 -0
  210. package/daemon/dist/db/migrations/155_queue_erasure.js +28 -0
  211. package/daemon/dist/db/migrations/155_queue_erasure.js.map +1 -0
  212. package/daemon/dist/db/migrations/156_queue_erasure_link_indexes.d.ts +4 -0
  213. package/daemon/dist/db/migrations/156_queue_erasure_link_indexes.d.ts.map +1 -0
  214. package/daemon/dist/db/migrations/156_queue_erasure_link_indexes.js +14 -0
  215. package/daemon/dist/db/migrations/156_queue_erasure_link_indexes.js.map +1 -0
  216. package/daemon/dist/db/migrations/157_queue_erasure_batches.d.ts +9 -0
  217. package/daemon/dist/db/migrations/157_queue_erasure_batches.d.ts.map +1 -0
  218. package/daemon/dist/db/migrations/157_queue_erasure_batches.js +18 -0
  219. package/daemon/dist/db/migrations/157_queue_erasure_batches.js.map +1 -0
  220. package/daemon/dist/db/migrations/158_queue_inbox_checkins.d.ts +8 -0
  221. package/daemon/dist/db/migrations/158_queue_inbox_checkins.d.ts.map +1 -0
  222. package/daemon/dist/db/migrations/158_queue_inbox_checkins.js +15 -0
  223. package/daemon/dist/db/migrations/158_queue_inbox_checkins.js.map +1 -0
  224. package/daemon/dist/db/migrations/159_queue_items_handed_off_from_index.d.ts +5 -0
  225. package/daemon/dist/db/migrations/159_queue_items_handed_off_from_index.d.ts.map +1 -0
  226. package/daemon/dist/db/migrations/159_queue_items_handed_off_from_index.js +9 -0
  227. package/daemon/dist/db/migrations/159_queue_items_handed_off_from_index.js.map +1 -0
  228. package/daemon/dist/domain/activity-taxonomy.d.ts +9 -0
  229. package/daemon/dist/domain/activity-taxonomy.d.ts.map +1 -1
  230. package/daemon/dist/domain/activity-taxonomy.js.map +1 -1
  231. package/daemon/dist/domain/agent-activity-store.d.ts +4 -2
  232. package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
  233. package/daemon/dist/domain/agent-activity-store.js +11 -7
  234. package/daemon/dist/domain/agent-activity-store.js.map +1 -1
  235. package/daemon/dist/domain/agent-manifest.d.ts.map +1 -1
  236. package/daemon/dist/domain/agent-manifest.js +11 -1
  237. package/daemon/dist/domain/agent-manifest.js.map +1 -1
  238. package/daemon/dist/domain/builtin-startup-files.d.ts +8 -0
  239. package/daemon/dist/domain/builtin-startup-files.d.ts.map +1 -1
  240. package/daemon/dist/domain/builtin-startup-files.js +37 -11
  241. package/daemon/dist/domain/builtin-startup-files.js.map +1 -1
  242. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +73 -20
  243. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  244. package/daemon/dist/domain/claude-compaction-enforcer.js +442 -84
  245. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  246. package/daemon/dist/domain/claude-continuation-launch.d.ts +16 -0
  247. package/daemon/dist/domain/claude-continuation-launch.d.ts.map +1 -0
  248. package/daemon/dist/domain/claude-continuation-launch.js +110 -0
  249. package/daemon/dist/domain/claude-continuation-launch.js.map +1 -0
  250. package/daemon/dist/domain/claude-git-trust-root.d.ts +11 -0
  251. package/daemon/dist/domain/claude-git-trust-root.d.ts.map +1 -0
  252. package/daemon/dist/domain/claude-git-trust-root.js +72 -0
  253. package/daemon/dist/domain/claude-git-trust-root.js.map +1 -0
  254. package/daemon/dist/domain/claude-managed-launch.d.ts +3 -0
  255. package/daemon/dist/domain/claude-managed-launch.d.ts.map +1 -1
  256. package/daemon/dist/domain/claude-managed-launch.js +17 -7
  257. package/daemon/dist/domain/claude-managed-launch.js.map +1 -1
  258. package/daemon/dist/domain/community-harness-presets.d.ts +5 -0
  259. package/daemon/dist/domain/community-harness-presets.d.ts.map +1 -1
  260. package/daemon/dist/domain/community-harness-presets.js +33 -6
  261. package/daemon/dist/domain/community-harness-presets.js.map +1 -1
  262. package/daemon/dist/domain/compaction-restore-notice.d.ts +3 -1
  263. package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
  264. package/daemon/dist/domain/compaction-restore-notice.js +37 -6
  265. package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
  266. package/daemon/dist/domain/context-monitor.d.ts.map +1 -1
  267. package/daemon/dist/domain/context-monitor.js +3 -0
  268. package/daemon/dist/domain/context-monitor.js.map +1 -1
  269. package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
  270. package/daemon/dist/domain/context-usage-store.js +10 -1
  271. package/daemon/dist/domain/context-usage-store.js.map +1 -1
  272. package/daemon/dist/domain/current-work.d.ts +52 -0
  273. package/daemon/dist/domain/current-work.d.ts.map +1 -1
  274. package/daemon/dist/domain/current-work.js +215 -0
  275. package/daemon/dist/domain/current-work.js.map +1 -1
  276. package/daemon/dist/domain/default-receiver.d.ts +40 -0
  277. package/daemon/dist/domain/default-receiver.d.ts.map +1 -0
  278. package/daemon/dist/domain/default-receiver.js +70 -0
  279. package/daemon/dist/domain/default-receiver.js.map +1 -0
  280. package/daemon/dist/domain/desired-claude-activity-hooks.d.ts +4 -3
  281. package/daemon/dist/domain/desired-claude-activity-hooks.d.ts.map +1 -1
  282. package/daemon/dist/domain/desired-claude-activity-hooks.js +49 -15
  283. package/daemon/dist/domain/desired-claude-activity-hooks.js.map +1 -1
  284. package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
  285. package/daemon/dist/domain/draft-aware-delivery.js +6 -2
  286. package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
  287. package/daemon/dist/domain/escalation-owner.d.ts.map +1 -1
  288. package/daemon/dist/domain/escalation-owner.js +8 -3
  289. package/daemon/dist/domain/escalation-owner.js.map +1 -1
  290. package/daemon/dist/domain/event-bus.d.ts +47 -8
  291. package/daemon/dist/domain/event-bus.d.ts.map +1 -1
  292. package/daemon/dist/domain/event-bus.js +137 -17
  293. package/daemon/dist/domain/event-bus.js.map +1 -1
  294. package/daemon/dist/domain/execution-view.d.ts +9 -0
  295. package/daemon/dist/domain/execution-view.d.ts.map +1 -1
  296. package/daemon/dist/domain/execution-view.js +41 -3
  297. package/daemon/dist/domain/execution-view.js.map +1 -1
  298. package/daemon/dist/domain/gateway/connections-projection.d.ts +13 -1
  299. package/daemon/dist/domain/gateway/connections-projection.d.ts.map +1 -1
  300. package/daemon/dist/domain/gateway/connections-projection.js +38 -10
  301. package/daemon/dist/domain/gateway/connections-projection.js.map +1 -1
  302. package/daemon/dist/domain/gateway/dispatcher.d.ts +2 -0
  303. package/daemon/dist/domain/gateway/dispatcher.d.ts.map +1 -1
  304. package/daemon/dist/domain/gateway/dispatcher.js +14 -1
  305. package/daemon/dist/domain/gateway/dispatcher.js.map +1 -1
  306. package/daemon/dist/domain/gateway/gateway-subsystem.d.ts +5 -0
  307. package/daemon/dist/domain/gateway/gateway-subsystem.d.ts.map +1 -1
  308. package/daemon/dist/domain/gateway/gateway-subsystem.js +10 -0
  309. package/daemon/dist/domain/gateway/gateway-subsystem.js.map +1 -1
  310. package/daemon/dist/domain/gateway/human-quiet-windows.d.ts +2 -1
  311. package/daemon/dist/domain/gateway/human-quiet-windows.d.ts.map +1 -1
  312. package/daemon/dist/domain/gateway/human-quiet-windows.js +2 -1
  313. package/daemon/dist/domain/gateway/human-quiet-windows.js.map +1 -1
  314. package/daemon/dist/domain/gateway/human-readiness.d.ts +7 -0
  315. package/daemon/dist/domain/gateway/human-readiness.d.ts.map +1 -1
  316. package/daemon/dist/domain/gateway/human-readiness.js +45 -0
  317. package/daemon/dist/domain/gateway/human-readiness.js.map +1 -1
  318. package/daemon/dist/domain/gateway/human-registry.d.ts +35 -4
  319. package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
  320. package/daemon/dist/domain/gateway/human-registry.js +130 -42
  321. package/daemon/dist/domain/gateway/human-registry.js.map +1 -1
  322. package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
  323. package/daemon/dist/domain/gateway/operator-delivery-engine.js +8 -2
  324. package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
  325. package/daemon/dist/domain/gateway/relay-config.d.ts +83 -0
  326. package/daemon/dist/domain/gateway/relay-config.d.ts.map +1 -0
  327. package/daemon/dist/domain/gateway/relay-config.js +321 -0
  328. package/daemon/dist/domain/gateway/relay-config.js.map +1 -0
  329. package/daemon/dist/domain/gateway/relay-inbound.d.ts +85 -0
  330. package/daemon/dist/domain/gateway/relay-inbound.d.ts.map +1 -0
  331. package/daemon/dist/domain/gateway/relay-inbound.js +981 -0
  332. package/daemon/dist/domain/gateway/relay-inbound.js.map +1 -0
  333. package/daemon/dist/domain/gateway/relay-outbound.d.ts +218 -0
  334. package/daemon/dist/domain/gateway/relay-outbound.d.ts.map +1 -0
  335. package/daemon/dist/domain/gateway/relay-outbound.js +801 -0
  336. package/daemon/dist/domain/gateway/relay-outbound.js.map +1 -0
  337. package/daemon/dist/domain/gateway/slack/config.d.ts +21 -0
  338. package/daemon/dist/domain/gateway/slack/config.d.ts.map +1 -1
  339. package/daemon/dist/domain/gateway/slack/config.js +30 -3
  340. package/daemon/dist/domain/gateway/slack/config.js.map +1 -1
  341. package/daemon/dist/domain/gateway/slack/message.d.ts +4 -0
  342. package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
  343. package/daemon/dist/domain/gateway/slack/message.js +7 -2
  344. package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
  345. package/daemon/dist/domain/gateway/slack/open-asks.d.ts +13 -1
  346. package/daemon/dist/domain/gateway/slack/open-asks.d.ts.map +1 -1
  347. package/daemon/dist/domain/gateway/slack/open-asks.js +72 -8
  348. package/daemon/dist/domain/gateway/slack/open-asks.js.map +1 -1
  349. package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts +9 -0
  350. package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts.map +1 -1
  351. package/daemon/dist/domain/gateway/slack/outbound-driver.js.map +1 -1
  352. package/daemon/dist/domain/gateway/slack/settled-asks.d.ts.map +1 -1
  353. package/daemon/dist/domain/gateway/slack/settled-asks.js +19 -1
  354. package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -1
  355. package/daemon/dist/domain/gateway/slack/slack-api.d.ts +3 -0
  356. package/daemon/dist/domain/gateway/slack/slack-api.d.ts.map +1 -1
  357. package/daemon/dist/domain/gateway/slack/slack-api.js +12 -4
  358. package/daemon/dist/domain/gateway/slack/slack-api.js.map +1 -1
  359. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +2 -0
  360. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
  361. package/daemon/dist/domain/gateway/slack/slack-delivery.js +38 -12
  362. package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
  363. package/daemon/dist/domain/gateway/slack/slack-recovery.d.ts +12 -1
  364. package/daemon/dist/domain/gateway/slack/slack-recovery.d.ts.map +1 -1
  365. package/daemon/dist/domain/gateway/slack/slack-recovery.js +68 -10
  366. package/daemon/dist/domain/gateway/slack/slack-recovery.js.map +1 -1
  367. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
  368. package/daemon/dist/domain/gateway/slack/slack-subsystem.js +363 -67
  369. package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
  370. package/daemon/dist/domain/gateway/slack/socket-inbound.d.ts +1 -0
  371. package/daemon/dist/domain/gateway/slack/socket-inbound.d.ts.map +1 -1
  372. package/daemon/dist/domain/gateway/slack/socket-inbound.js +5 -0
  373. package/daemon/dist/domain/gateway/slack/socket-inbound.js.map +1 -1
  374. package/daemon/dist/domain/gateway/slack/state-store.d.ts +4 -0
  375. package/daemon/dist/domain/gateway/slack/state-store.d.ts.map +1 -1
  376. package/daemon/dist/domain/gateway/slack/state-store.js +4 -1
  377. package/daemon/dist/domain/gateway/slack/state-store.js.map +1 -1
  378. package/daemon/dist/domain/gateway/slack/thread-recovery.d.ts +23 -3
  379. package/daemon/dist/domain/gateway/slack/thread-recovery.d.ts.map +1 -1
  380. package/daemon/dist/domain/gateway/slack/thread-recovery.js +52 -10
  381. package/daemon/dist/domain/gateway/slack/thread-recovery.js.map +1 -1
  382. package/daemon/dist/domain/gateway/slack/thread-seat-map.d.ts +4 -1
  383. package/daemon/dist/domain/gateway/slack/thread-seat-map.d.ts.map +1 -1
  384. package/daemon/dist/domain/gateway/slack/thread-seat-map.js +7 -4
  385. package/daemon/dist/domain/gateway/slack/thread-seat-map.js.map +1 -1
  386. package/daemon/dist/domain/guidance-projection.d.ts +39 -0
  387. package/daemon/dist/domain/guidance-projection.d.ts.map +1 -0
  388. package/daemon/dist/domain/guidance-projection.js +91 -0
  389. package/daemon/dist/domain/guidance-projection.js.map +1 -0
  390. package/daemon/dist/domain/health-passive-ceremony.d.ts.map +1 -1
  391. package/daemon/dist/domain/health-passive-ceremony.js +31 -12
  392. package/daemon/dist/domain/health-passive-ceremony.js.map +1 -1
  393. package/daemon/dist/domain/hosted-wake.d.ts +5 -1
  394. package/daemon/dist/domain/hosted-wake.d.ts.map +1 -1
  395. package/daemon/dist/domain/hosted-wake.js +13 -3
  396. package/daemon/dist/domain/hosted-wake.js.map +1 -1
  397. package/daemon/dist/domain/hosts/pairing-ask.d.ts +10 -0
  398. package/daemon/dist/domain/hosts/pairing-ask.d.ts.map +1 -0
  399. package/daemon/dist/domain/hosts/pairing-ask.js +9 -0
  400. package/daemon/dist/domain/hosts/pairing-ask.js.map +1 -0
  401. package/daemon/dist/domain/launch-wrapper.d.ts +29 -0
  402. package/daemon/dist/domain/launch-wrapper.d.ts.map +1 -0
  403. package/daemon/dist/domain/launch-wrapper.js +97 -0
  404. package/daemon/dist/domain/launch-wrapper.js.map +1 -0
  405. package/daemon/dist/domain/managed-blocks.d.ts +3 -0
  406. package/daemon/dist/domain/managed-blocks.d.ts.map +1 -1
  407. package/daemon/dist/domain/managed-blocks.js +5 -0
  408. package/daemon/dist/domain/managed-blocks.js.map +1 -1
  409. package/daemon/dist/domain/markdown-address.d.ts.map +1 -1
  410. package/daemon/dist/domain/markdown-address.js +12 -1
  411. package/daemon/dist/domain/markdown-address.js.map +1 -1
  412. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +1 -1
  413. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
  414. package/daemon/dist/domain/mission-control/mission-control-write-contract.js +116 -28
  415. package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
  416. package/daemon/dist/domain/model-divergence/current-model-reader.d.ts.map +1 -1
  417. package/daemon/dist/domain/model-divergence/current-model-reader.js +14 -3
  418. package/daemon/dist/domain/model-divergence/current-model-reader.js.map +1 -1
  419. package/daemon/dist/domain/native-process-arguments.d.ts +5 -0
  420. package/daemon/dist/domain/native-process-arguments.d.ts.map +1 -1
  421. package/daemon/dist/domain/native-process-arguments.js +60 -5
  422. package/daemon/dist/domain/native-process-arguments.js.map +1 -1
  423. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
  424. package/daemon/dist/domain/native-process-lineage.js +32 -9
  425. package/daemon/dist/domain/native-process-lineage.js.map +1 -1
  426. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  427. package/daemon/dist/domain/node-inventory.js +9 -2
  428. package/daemon/dist/domain/node-inventory.js.map +1 -1
  429. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  430. package/daemon/dist/domain/node-launcher.js +9 -2
  431. package/daemon/dist/domain/node-launcher.js.map +1 -1
  432. package/daemon/dist/domain/outbox-handler.d.ts +53 -3
  433. package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
  434. package/daemon/dist/domain/outbox-handler.js +101 -6
  435. package/daemon/dist/domain/outbox-handler.js.map +1 -1
  436. package/daemon/dist/domain/package-manifest.d.ts.map +1 -1
  437. package/daemon/dist/domain/package-manifest.js +10 -5
  438. package/daemon/dist/domain/package-manifest.js.map +1 -1
  439. package/daemon/dist/domain/parent-session-env.d.ts +2 -1
  440. package/daemon/dist/domain/parent-session-env.d.ts.map +1 -1
  441. package/daemon/dist/domain/parent-session-env.js +9 -1
  442. package/daemon/dist/domain/parent-session-env.js.map +1 -1
  443. package/daemon/dist/domain/parked-query.d.ts +6 -0
  444. package/daemon/dist/domain/parked-query.d.ts.map +1 -1
  445. package/daemon/dist/domain/parked-query.js +1 -0
  446. package/daemon/dist/domain/parked-query.js.map +1 -1
  447. package/daemon/dist/domain/pi-account-state.d.ts +6 -0
  448. package/daemon/dist/domain/pi-account-state.d.ts.map +1 -0
  449. package/daemon/dist/domain/pi-account-state.js +14 -0
  450. package/daemon/dist/domain/pi-account-state.js.map +1 -0
  451. package/daemon/dist/domain/policies/delivery-digest-flush.d.ts.map +1 -1
  452. package/daemon/dist/domain/policies/delivery-digest-flush.js +9 -1
  453. package/daemon/dist/domain/policies/delivery-digest-flush.js.map +1 -1
  454. package/daemon/dist/domain/policies/mode-scheduled-end.d.ts +4 -1
  455. package/daemon/dist/domain/policies/mode-scheduled-end.d.ts.map +1 -1
  456. package/daemon/dist/domain/policies/mode-scheduled-end.js +19 -10
  457. package/daemon/dist/domain/policies/mode-scheduled-end.js.map +1 -1
  458. package/daemon/dist/domain/policies/parked-owner-consumer.d.ts +6 -0
  459. package/daemon/dist/domain/policies/parked-owner-consumer.d.ts.map +1 -1
  460. package/daemon/dist/domain/policies/parked-owner-consumer.js +13 -3
  461. package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
  462. package/daemon/dist/domain/policies/quiet-release.d.ts +19 -6
  463. package/daemon/dist/domain/policies/quiet-release.d.ts.map +1 -1
  464. package/daemon/dist/domain/policies/quiet-release.js +50 -10
  465. package/daemon/dist/domain/policies/quiet-release.js.map +1 -1
  466. package/daemon/dist/domain/projection-planner.d.ts +4 -1
  467. package/daemon/dist/domain/projection-planner.d.ts.map +1 -1
  468. package/daemon/dist/domain/projection-planner.js +3 -0
  469. package/daemon/dist/domain/projection-planner.js.map +1 -1
  470. package/daemon/dist/domain/proof/judgments.d.ts +11 -0
  471. package/daemon/dist/domain/proof/judgments.d.ts.map +1 -1
  472. package/daemon/dist/domain/proof/judgments.js +61 -38
  473. package/daemon/dist/domain/proof/judgments.js.map +1 -1
  474. package/daemon/dist/domain/queue-blocker.d.ts +5 -0
  475. package/daemon/dist/domain/queue-blocker.d.ts.map +1 -0
  476. package/daemon/dist/domain/queue-blocker.js +12 -0
  477. package/daemon/dist/domain/queue-blocker.js.map +1 -0
  478. package/daemon/dist/domain/queue-erasure.d.ts +173 -0
  479. package/daemon/dist/domain/queue-erasure.d.ts.map +1 -0
  480. package/daemon/dist/domain/queue-erasure.js +885 -0
  481. package/daemon/dist/domain/queue-erasure.js.map +1 -0
  482. package/daemon/dist/domain/queue-owner.d.ts +6 -0
  483. package/daemon/dist/domain/queue-owner.d.ts.map +1 -1
  484. package/daemon/dist/domain/queue-owner.js +13 -4
  485. package/daemon/dist/domain/queue-owner.js.map +1 -1
  486. package/daemon/dist/domain/queue-pickup.d.ts +20 -1
  487. package/daemon/dist/domain/queue-pickup.d.ts.map +1 -1
  488. package/daemon/dist/domain/queue-pickup.js +38 -6
  489. package/daemon/dist/domain/queue-pickup.js.map +1 -1
  490. package/daemon/dist/domain/queue-recovery.d.ts +14 -0
  491. package/daemon/dist/domain/queue-recovery.d.ts.map +1 -1
  492. package/daemon/dist/domain/queue-recovery.js +33 -1
  493. package/daemon/dist/domain/queue-recovery.js.map +1 -1
  494. package/daemon/dist/domain/queue-repository.d.ts +226 -20
  495. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  496. package/daemon/dist/domain/queue-repository.js +786 -91
  497. package/daemon/dist/domain/queue-repository.js.map +1 -1
  498. package/daemon/dist/domain/queue-retention.d.ts +82 -0
  499. package/daemon/dist/domain/queue-retention.d.ts.map +1 -1
  500. package/daemon/dist/domain/queue-retention.js +168 -0
  501. package/daemon/dist/domain/queue-retention.js.map +1 -1
  502. package/daemon/dist/domain/queue-stuck-sweep.d.ts +38 -4
  503. package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
  504. package/daemon/dist/domain/queue-stuck-sweep.js +763 -190
  505. package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
  506. package/daemon/dist/domain/queue-transition-log.d.ts +52 -1
  507. package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
  508. package/daemon/dist/domain/queue-transition-log.js +241 -3
  509. package/daemon/dist/domain/queue-transition-log.js.map +1 -1
  510. package/daemon/dist/domain/queue-waiting.d.ts +49 -3
  511. package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
  512. package/daemon/dist/domain/queue-waiting.js +73 -13
  513. package/daemon/dist/domain/queue-waiting.js.map +1 -1
  514. package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
  515. package/daemon/dist/domain/queue-wake-ladder.js +86 -30
  516. package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
  517. package/daemon/dist/domain/quiet-hold-custody.d.ts.map +1 -1
  518. package/daemon/dist/domain/quiet-hold-custody.js +7 -3
  519. package/daemon/dist/domain/quiet-hold-custody.js.map +1 -1
  520. package/daemon/dist/domain/rebuild-priming-chain.d.ts +3 -1
  521. package/daemon/dist/domain/rebuild-priming-chain.d.ts.map +1 -1
  522. package/daemon/dist/domain/rebuild-priming-chain.js +3 -1
  523. package/daemon/dist/domain/rebuild-priming-chain.js.map +1 -1
  524. package/daemon/dist/domain/refocus-record.d.ts +17 -0
  525. package/daemon/dist/domain/refocus-record.d.ts.map +1 -0
  526. package/daemon/dist/domain/refocus-record.js +94 -0
  527. package/daemon/dist/domain/refocus-record.js.map +1 -0
  528. package/daemon/dist/domain/restore-check-service.js +1 -1
  529. package/daemon/dist/domain/restore-check-service.js.map +1 -1
  530. package/daemon/dist/domain/restore-guidance.d.ts.map +1 -1
  531. package/daemon/dist/domain/restore-guidance.js +5 -6
  532. package/daemon/dist/domain/restore-guidance.js.map +1 -1
  533. package/daemon/dist/domain/restore-orchestrator.d.ts +15 -2
  534. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  535. package/daemon/dist/domain/restore-orchestrator.js +100 -42
  536. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  537. package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
  538. package/daemon/dist/domain/restore-plan-preview.js +2 -1
  539. package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
  540. package/daemon/dist/domain/resume-token-validation.d.ts +7 -0
  541. package/daemon/dist/domain/resume-token-validation.d.ts.map +1 -1
  542. package/daemon/dist/domain/resume-token-validation.js +13 -3
  543. package/daemon/dist/domain/resume-token-validation.js.map +1 -1
  544. package/daemon/dist/domain/rig-repository.d.ts +3 -0
  545. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  546. package/daemon/dist/domain/rig-repository.js +46 -1
  547. package/daemon/dist/domain/rig-repository.js.map +1 -1
  548. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  549. package/daemon/dist/domain/rig-teardown.js +2 -1
  550. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  551. package/daemon/dist/domain/rigs-being-built.d.ts +5 -0
  552. package/daemon/dist/domain/rigs-being-built.d.ts.map +1 -0
  553. package/daemon/dist/domain/rigs-being-built.js +18 -0
  554. package/daemon/dist/domain/rigs-being-built.js.map +1 -0
  555. package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
  556. package/daemon/dist/domain/rigspec-codec.js +4 -0
  557. package/daemon/dist/domain/rigspec-codec.js.map +1 -1
  558. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  559. package/daemon/dist/domain/rigspec-exporter.js +5 -0
  560. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  561. package/daemon/dist/domain/rigspec-instantiator.d.ts +20 -1
  562. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  563. package/daemon/dist/domain/rigspec-instantiator.js +100 -22
  564. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  565. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  566. package/daemon/dist/domain/rigspec-preflight.js +13 -0
  567. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  568. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  569. package/daemon/dist/domain/rigspec-schema.js +26 -1
  570. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  571. package/daemon/dist/domain/runner-permissions.d.ts +16 -0
  572. package/daemon/dist/domain/runner-permissions.d.ts.map +1 -1
  573. package/daemon/dist/domain/runner-permissions.js +95 -14
  574. package/daemon/dist/domain/runner-permissions.js.map +1 -1
  575. package/daemon/dist/domain/runtime-adapter.d.ts +2 -0
  576. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  577. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  578. package/daemon/dist/domain/runtime-switch-materials.d.ts +1 -1
  579. package/daemon/dist/domain/runtime-switch-materials.d.ts.map +1 -1
  580. package/daemon/dist/domain/runtime-switch-materials.js +2 -2
  581. package/daemon/dist/domain/runtime-switch-materials.js.map +1 -1
  582. package/daemon/dist/domain/scope/logical-checkbox.d.ts.map +1 -1
  583. package/daemon/dist/domain/scope/logical-checkbox.js +14 -0
  584. package/daemon/dist/domain/scope/logical-checkbox.js.map +1 -1
  585. package/daemon/dist/domain/seat-activity-service.d.ts +50 -1
  586. package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
  587. package/daemon/dist/domain/seat-activity-service.js +144 -5
  588. package/daemon/dist/domain/seat-activity-service.js.map +1 -1
  589. package/daemon/dist/domain/seat-attention-reconciler.d.ts +13 -0
  590. package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  591. package/daemon/dist/domain/seat-attention-reconciler.js +45 -1
  592. package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  593. package/daemon/dist/domain/seat-handover-service.d.ts +8 -0
  594. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  595. package/daemon/dist/domain/seat-handover-service.js +61 -19
  596. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  597. package/daemon/dist/domain/seat-kinds.d.ts +21 -0
  598. package/daemon/dist/domain/seat-kinds.d.ts.map +1 -0
  599. package/daemon/dist/domain/seat-kinds.js +27 -0
  600. package/daemon/dist/domain/seat-kinds.js.map +1 -0
  601. package/daemon/dist/domain/seat-launch-environment.d.ts +14 -0
  602. package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
  603. package/daemon/dist/domain/seat-launch-environment.js +64 -16
  604. package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
  605. package/daemon/dist/domain/seat-lifecycle-service.d.ts +12 -0
  606. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  607. package/daemon/dist/domain/seat-lifecycle-service.js +59 -14
  608. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  609. package/daemon/dist/domain/seat-restart-in-place.d.ts +2 -1
  610. package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
  611. package/daemon/dist/domain/seat-restart-in-place.js +19 -1
  612. package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
  613. package/daemon/dist/domain/seat-runtime-home.d.ts +4 -1
  614. package/daemon/dist/domain/seat-runtime-home.d.ts.map +1 -1
  615. package/daemon/dist/domain/seat-runtime-home.js +6 -4
  616. package/daemon/dist/domain/seat-runtime-home.js.map +1 -1
  617. package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
  618. package/daemon/dist/domain/seat-runtime-switch-service.js +87 -13
  619. package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
  620. package/daemon/dist/domain/seat-skill-apply.d.ts +2 -0
  621. package/daemon/dist/domain/seat-skill-apply.d.ts.map +1 -1
  622. package/daemon/dist/domain/seat-skill-apply.js +5 -2
  623. package/daemon/dist/domain/seat-skill-apply.js.map +1 -1
  624. package/daemon/dist/domain/seat-skill-storage.d.ts +57 -4
  625. package/daemon/dist/domain/seat-skill-storage.d.ts.map +1 -1
  626. package/daemon/dist/domain/seat-skill-storage.js +339 -9
  627. package/daemon/dist/domain/seat-skill-storage.js.map +1 -1
  628. package/daemon/dist/domain/seat-status-service.d.ts +12 -2
  629. package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
  630. package/daemon/dist/domain/seat-status-service.js +39 -4
  631. package/daemon/dist/domain/seat-status-service.js.map +1 -1
  632. package/daemon/dist/domain/seat-structural-activity-service.d.ts +8 -0
  633. package/daemon/dist/domain/seat-structural-activity-service.d.ts.map +1 -1
  634. package/daemon/dist/domain/seat-structural-activity-service.js +8 -2
  635. package/daemon/dist/domain/seat-structural-activity-service.js.map +1 -1
  636. package/daemon/dist/domain/self-attach-service.d.ts.map +1 -1
  637. package/daemon/dist/domain/self-attach-service.js +11 -4
  638. package/daemon/dist/domain/self-attach-service.js.map +1 -1
  639. package/daemon/dist/domain/session-jsonl.d.ts +4 -2
  640. package/daemon/dist/domain/session-jsonl.d.ts.map +1 -1
  641. package/daemon/dist/domain/session-jsonl.js +56 -22
  642. package/daemon/dist/domain/session-jsonl.js.map +1 -1
  643. package/daemon/dist/domain/session-registry.d.ts +20 -3
  644. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  645. package/daemon/dist/domain/session-registry.js +39 -3
  646. package/daemon/dist/domain/session-registry.js.map +1 -1
  647. package/daemon/dist/domain/session-transport.d.ts +52 -5
  648. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  649. package/daemon/dist/domain/session-transport.js +434 -85
  650. package/daemon/dist/domain/session-transport.js.map +1 -1
  651. package/daemon/dist/domain/skill-catalog.d.ts +37 -0
  652. package/daemon/dist/domain/skill-catalog.d.ts.map +1 -1
  653. package/daemon/dist/domain/skill-catalog.js +152 -3
  654. package/daemon/dist/domain/skill-catalog.js.map +1 -1
  655. package/daemon/dist/domain/slices/slice-detail-projector.d.ts +1 -1
  656. package/daemon/dist/domain/slices/slice-detail-projector.d.ts.map +1 -1
  657. package/daemon/dist/domain/slices/slice-detail-projector.js +11 -13
  658. package/daemon/dist/domain/slices/slice-detail-projector.js.map +1 -1
  659. package/daemon/dist/domain/slices/slice-indexer.d.ts +41 -0
  660. package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -1
  661. package/daemon/dist/domain/slices/slice-indexer.js +463 -22
  662. package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
  663. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  664. package/daemon/dist/domain/startup-orchestrator.js +12 -3
  665. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  666. package/daemon/dist/domain/startup-submission-evidence.d.ts +1 -0
  667. package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
  668. package/daemon/dist/domain/startup-submission-evidence.js +18 -4
  669. package/daemon/dist/domain/startup-submission-evidence.js.map +1 -1
  670. package/daemon/dist/domain/successor-session-launcher.d.ts +1 -0
  671. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  672. package/daemon/dist/domain/successor-session-launcher.js +1 -0
  673. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  674. package/daemon/dist/domain/terminal/earlier-tile-attach-0711.d.ts +2 -0
  675. package/daemon/dist/domain/terminal/earlier-tile-attach-0711.d.ts.map +1 -0
  676. package/daemon/dist/domain/terminal/earlier-tile-attach-0711.js +146 -0
  677. package/daemon/dist/domain/terminal/earlier-tile-attach-0711.js.map +1 -0
  678. package/daemon/dist/domain/terminal/earlier-tile-attach.d.ts +1 -0
  679. package/daemon/dist/domain/terminal/earlier-tile-attach.d.ts.map +1 -1
  680. package/daemon/dist/domain/terminal/earlier-tile-attach.js +42 -1
  681. package/daemon/dist/domain/terminal/earlier-tile-attach.js.map +1 -1
  682. package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
  683. package/daemon/dist/domain/terminal/herdr-adapter.js +3 -2
  684. package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
  685. package/daemon/dist/domain/terminal/herdr-app-install.d.ts +28 -0
  686. package/daemon/dist/domain/terminal/herdr-app-install.d.ts.map +1 -0
  687. package/daemon/dist/domain/terminal/herdr-app-install.js +170 -0
  688. package/daemon/dist/domain/terminal/herdr-app-install.js.map +1 -0
  689. package/daemon/dist/domain/terminal/herdr-app-layout.d.ts +79 -0
  690. package/daemon/dist/domain/terminal/herdr-app-layout.d.ts.map +1 -0
  691. package/daemon/dist/domain/terminal/herdr-app-layout.js +134 -0
  692. package/daemon/dist/domain/terminal/herdr-app-layout.js.map +1 -0
  693. package/daemon/dist/domain/terminal/herdr-app-provider.d.ts +123 -0
  694. package/daemon/dist/domain/terminal/herdr-app-provider.d.ts.map +1 -0
  695. package/daemon/dist/domain/terminal/herdr-app-provider.js +681 -0
  696. package/daemon/dist/domain/terminal/herdr-app-provider.js.map +1 -0
  697. package/daemon/dist/domain/terminal/herdr-app-state.d.ts +91 -0
  698. package/daemon/dist/domain/terminal/herdr-app-state.d.ts.map +1 -0
  699. package/daemon/dist/domain/terminal/herdr-app-state.js +140 -0
  700. package/daemon/dist/domain/terminal/herdr-app-state.js.map +1 -0
  701. package/daemon/dist/domain/terminal/herdr-app-transport.d.ts +68 -0
  702. package/daemon/dist/domain/terminal/herdr-app-transport.d.ts.map +1 -0
  703. package/daemon/dist/domain/terminal/herdr-app-transport.js +133 -0
  704. package/daemon/dist/domain/terminal/herdr-app-transport.js.map +1 -0
  705. package/daemon/dist/domain/terminal/herdr-follow-view.d.ts.map +1 -1
  706. package/daemon/dist/domain/terminal/herdr-follow-view.js +43 -19
  707. package/daemon/dist/domain/terminal/herdr-follow-view.js.map +1 -1
  708. package/daemon/dist/domain/terminal/herdr-viewer.d.ts +7 -4
  709. package/daemon/dist/domain/terminal/herdr-viewer.d.ts.map +1 -1
  710. package/daemon/dist/domain/terminal/herdr-viewer.js +101 -47
  711. package/daemon/dist/domain/terminal/herdr-viewer.js.map +1 -1
  712. package/daemon/dist/domain/terminal/terminal-following.js +3 -3
  713. package/daemon/dist/domain/terminal/terminal-following.js.map +1 -1
  714. package/daemon/dist/domain/terminal/terminal-provider.d.ts +18 -0
  715. package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
  716. package/daemon/dist/domain/terminal/terminal-service.d.ts +28 -3
  717. package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
  718. package/daemon/dist/domain/terminal/terminal-service.js +56 -8
  719. package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
  720. package/daemon/dist/domain/terminal/tile-attach.d.ts +6 -3
  721. package/daemon/dist/domain/terminal/tile-attach.d.ts.map +1 -1
  722. package/daemon/dist/domain/terminal/tile-attach.js +11 -46
  723. package/daemon/dist/domain/terminal/tile-attach.js.map +1 -1
  724. package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -1
  725. package/daemon/dist/domain/terminal/view-composer.js +1 -0
  726. package/daemon/dist/domain/terminal/view-composer.js.map +1 -1
  727. package/daemon/dist/domain/time-bound-advisory.js +3 -3
  728. package/daemon/dist/domain/time-bound-advisory.js.map +1 -1
  729. package/daemon/dist/domain/tmux-server-selection.d.ts.map +1 -1
  730. package/daemon/dist/domain/tmux-server-selection.js +8 -2
  731. package/daemon/dist/domain/tmux-server-selection.js.map +1 -1
  732. package/daemon/dist/domain/types.d.ts +69 -1
  733. package/daemon/dist/domain/types.d.ts.map +1 -1
  734. package/daemon/dist/domain/types.js.map +1 -1
  735. package/daemon/dist/domain/user-settings/settings-browser.d.ts +2 -1
  736. package/daemon/dist/domain/user-settings/settings-browser.d.ts.map +1 -1
  737. package/daemon/dist/domain/user-settings/settings-browser.js +22 -3
  738. package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
  739. package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
  740. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  741. package/daemon/dist/domain/user-settings/settings-store.js +83 -0
  742. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  743. package/daemon/dist/domain/view-event-bridge.js +1 -1
  744. package/daemon/dist/domain/view-event-bridge.js.map +1 -1
  745. package/daemon/dist/domain/view-projector.d.ts +4 -1
  746. package/daemon/dist/domain/view-projector.d.ts.map +1 -1
  747. package/daemon/dist/domain/view-projector.js +9 -4
  748. package/daemon/dist/domain/view-projector.js.map +1 -1
  749. package/daemon/dist/domain/wake-recovery.d.ts.map +1 -1
  750. package/daemon/dist/domain/wake-recovery.js +10 -2
  751. package/daemon/dist/domain/wake-recovery.js.map +1 -1
  752. package/daemon/dist/domain/whoami-service.d.ts +6 -0
  753. package/daemon/dist/domain/whoami-service.d.ts.map +1 -1
  754. package/daemon/dist/domain/whoami-service.js +9 -1
  755. package/daemon/dist/domain/whoami-service.js.map +1 -1
  756. package/daemon/dist/domain/workflow-exception-escalation.d.ts +3 -2
  757. package/daemon/dist/domain/workflow-exception-escalation.d.ts.map +1 -1
  758. package/daemon/dist/domain/workflow-exception-escalation.js +1 -1
  759. package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -1
  760. package/daemon/dist/domain/workflow-instance-store.d.ts +8 -1
  761. package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
  762. package/daemon/dist/domain/workflow-instance-store.js +21 -3
  763. package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
  764. package/daemon/dist/domain/workflow-projector.js +1 -1
  765. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  766. package/daemon/dist/domain/workflow-reconciliation.d.ts.map +1 -1
  767. package/daemon/dist/domain/workflow-reconciliation.js +2 -1
  768. package/daemon/dist/domain/workflow-reconciliation.js.map +1 -1
  769. package/daemon/dist/domain/workflow-runtime.d.ts +4 -1
  770. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  771. package/daemon/dist/domain/workflow-runtime.js +24 -11
  772. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  773. package/daemon/dist/domain/workflow-spec-cache.d.ts +38 -4
  774. package/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
  775. package/daemon/dist/domain/workflow-spec-cache.js +115 -14
  776. package/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
  777. package/daemon/dist/domain/workflow-spec-unregister.d.ts +36 -0
  778. package/daemon/dist/domain/workflow-spec-unregister.d.ts.map +1 -0
  779. package/daemon/dist/domain/workflow-spec-unregister.js +105 -0
  780. package/daemon/dist/domain/workflow-spec-unregister.js.map +1 -0
  781. package/daemon/dist/domain/workflow-types.d.ts +14 -0
  782. package/daemon/dist/domain/workflow-types.d.ts.map +1 -1
  783. package/daemon/dist/index.d.ts +3 -1
  784. package/daemon/dist/index.d.ts.map +1 -1
  785. package/daemon/dist/index.js +31 -5
  786. package/daemon/dist/index.js.map +1 -1
  787. package/daemon/dist/learned-host-bindings-surface.d.ts +2 -0
  788. package/daemon/dist/learned-host-bindings-surface.d.ts.map +1 -0
  789. package/daemon/dist/learned-host-bindings-surface.js +4 -0
  790. package/daemon/dist/learned-host-bindings-surface.js.map +1 -0
  791. package/daemon/dist/lib/pane-envelope.d.ts +3 -0
  792. package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
  793. package/daemon/dist/lib/pane-envelope.js +3 -1
  794. package/daemon/dist/lib/pane-envelope.js.map +1 -1
  795. package/daemon/dist/routes/activity.d.ts.map +1 -1
  796. package/daemon/dist/routes/activity.js +147 -25
  797. package/daemon/dist/routes/activity.js.map +1 -1
  798. package/daemon/dist/routes/adapters.d.ts.map +1 -1
  799. package/daemon/dist/routes/adapters.js +4 -0
  800. package/daemon/dist/routes/adapters.js.map +1 -1
  801. package/daemon/dist/routes/attention.d.ts.map +1 -1
  802. package/daemon/dist/routes/attention.js +2 -0
  803. package/daemon/dist/routes/attention.js.map +1 -1
  804. package/daemon/dist/routes/compaction.js +2 -0
  805. package/daemon/dist/routes/compaction.js.map +1 -1
  806. package/daemon/dist/routes/config.d.ts.map +1 -1
  807. package/daemon/dist/routes/config.js +9 -1
  808. package/daemon/dist/routes/config.js.map +1 -1
  809. package/daemon/dist/routes/events.js +11 -2
  810. package/daemon/dist/routes/events.js.map +1 -1
  811. package/daemon/dist/routes/gateway.d.ts +3 -0
  812. package/daemon/dist/routes/gateway.d.ts.map +1 -1
  813. package/daemon/dist/routes/gateway.js +87 -8
  814. package/daemon/dist/routes/gateway.js.map +1 -1
  815. package/daemon/dist/routes/hosts.d.ts.map +1 -1
  816. package/daemon/dist/routes/hosts.js +400 -37
  817. package/daemon/dist/routes/hosts.js.map +1 -1
  818. package/daemon/dist/routes/provider.js +1 -1
  819. package/daemon/dist/routes/provider.js.map +1 -1
  820. package/daemon/dist/routes/queue.d.ts +19 -0
  821. package/daemon/dist/routes/queue.d.ts.map +1 -1
  822. package/daemon/dist/routes/queue.js +242 -46
  823. package/daemon/dist/routes/queue.js.map +1 -1
  824. package/daemon/dist/routes/seat.d.ts.map +1 -1
  825. package/daemon/dist/routes/seat.js +4 -3
  826. package/daemon/dist/routes/seat.js.map +1 -1
  827. package/daemon/dist/routes/skills.d.ts.map +1 -1
  828. package/daemon/dist/routes/skills.js +8 -2
  829. package/daemon/dist/routes/skills.js.map +1 -1
  830. package/daemon/dist/routes/slices.d.ts.map +1 -1
  831. package/daemon/dist/routes/slices.js +156 -28
  832. package/daemon/dist/routes/slices.js.map +1 -1
  833. package/daemon/dist/routes/terminal-ws.d.ts +1 -0
  834. package/daemon/dist/routes/terminal-ws.d.ts.map +1 -1
  835. package/daemon/dist/routes/terminal-ws.js +1 -1
  836. package/daemon/dist/routes/terminal-ws.js.map +1 -1
  837. package/daemon/dist/routes/terminal.d.ts.map +1 -1
  838. package/daemon/dist/routes/terminal.js +40 -3
  839. package/daemon/dist/routes/terminal.js.map +1 -1
  840. package/daemon/dist/routes/transport.d.ts.map +1 -1
  841. package/daemon/dist/routes/transport.js +0 -1
  842. package/daemon/dist/routes/transport.js.map +1 -1
  843. package/daemon/dist/routes/workflow.d.ts.map +1 -1
  844. package/daemon/dist/routes/workflow.js +24 -0
  845. package/daemon/dist/routes/workflow.js.map +1 -1
  846. package/daemon/dist/server.d.ts +2 -0
  847. package/daemon/dist/server.d.ts.map +1 -1
  848. package/daemon/dist/server.js +7 -2
  849. package/daemon/dist/server.js.map +1 -1
  850. package/daemon/dist/startup.d.ts +34 -0
  851. package/daemon/dist/startup.d.ts.map +1 -1
  852. package/daemon/dist/startup.js +255 -25
  853. package/daemon/dist/startup.js.map +1 -1
  854. package/daemon/dist/terminal/TerminalSessionBroker.d.ts +18 -13
  855. package/daemon/dist/terminal/TerminalSessionBroker.d.ts.map +1 -1
  856. package/daemon/dist/terminal/TerminalSessionBroker.js +113 -76
  857. package/daemon/dist/terminal/TerminalSessionBroker.js.map +1 -1
  858. package/daemon/dist/terminal/window-pin.d.ts +3 -3
  859. package/daemon/dist/terminal/window-pin.d.ts.map +1 -1
  860. package/daemon/dist/terminal/window-pin.js +2 -2
  861. package/daemon/dist/terminal/window-pin.js.map +1 -1
  862. package/daemon/docs/reference/acp-agents.md +68 -0
  863. package/daemon/docs/reference/agent-spec.md +51 -1
  864. package/daemon/docs/reference/agent-startup-guide.md +52 -2
  865. package/daemon/docs/reference/agent-state-taxonomy.md +7 -0
  866. package/daemon/docs/reference/community-harness-examples/omo/omo.yaml +14 -0
  867. package/daemon/docs/reference/community-harness-presets.md +56 -2
  868. package/daemon/docs/reference/daemon-http-clients.md +31 -8
  869. package/daemon/docs/reference/edge-types.md +6 -4
  870. package/daemon/docs/reference/gateway-participants.md +23 -1
  871. package/daemon/docs/reference/gateway-relay.md +268 -0
  872. package/daemon/docs/reference/getting-started.md +19 -3
  873. package/daemon/docs/reference/harness-runner-contract.md +61 -12
  874. package/daemon/docs/reference/health-diagnosis.md +5 -1
  875. package/daemon/docs/reference/help.md +18 -0
  876. package/daemon/docs/reference/herdr-app.md +148 -0
  877. package/daemon/docs/reference/hosted-members.md +56 -7
  878. package/daemon/docs/reference/keeping-a-watch.md +3 -1
  879. package/daemon/docs/reference/project-workspace.md +4 -0
  880. package/daemon/docs/reference/queue-erasure.md +161 -0
  881. package/daemon/docs/reference/quickstart.md +1 -1
  882. package/daemon/docs/reference/reconstructions.md +90 -0
  883. package/daemon/docs/reference/rig-spec.md +71 -8
  884. package/daemon/docs/reference/runner-conformance/README.md +3 -0
  885. package/daemon/docs/reference/runner-conformance/check-runner.mjs +27 -6
  886. package/daemon/docs/reference/runner-conformance/fake-acp-agent.mjs +1 -1
  887. package/daemon/docs/reference/sdlc-conventions.md +16 -1
  888. package/daemon/docs/reference/seat-delivery.md +30 -3
  889. package/daemon/docs/reference/slack-app-setup.md +37 -12
  890. package/daemon/docs/reference/terminal-sessions.md +101 -26
  891. package/daemon/docs/reference/tmux-servers.md +50 -2
  892. package/daemon/docs/reference/whats-new.md +402 -132
  893. package/daemon/specs/agents/shared/skills/core/cross-host-rig-commands/SKILL.md +7 -0
  894. package/daemon/specs/agents/shared/skills/core/openrig-herdr/SKILL.md +1 -0
  895. package/daemon/specs/agents/shared/skills/core/openrig-skills/SKILL.md +1 -0
  896. package/daemon/specs/agents/shared/skills/core/working-with-an-openrig-team/SKILL.md +90 -0
  897. package/daemon/specs/agents/shared/skills/pods/review-team/SKILL.md +2 -0
  898. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +24 -0
  899. package/daemon/specs/rigs/launch/kernel/culture/CULTURE.md +7 -4
  900. package/daemon/specs/rigs/launch/kernel/rig.yaml +6 -3
  901. package/daemon/specs/rigs/launch/starter/guidance/lead-first-move.md +3 -1
  902. package/dist/acp/agent-server.d.ts +126 -0
  903. package/dist/acp/agent-server.d.ts.map +1 -0
  904. package/dist/acp/agent-server.js +449 -0
  905. package/dist/acp/agent-server.js.map +1 -0
  906. package/dist/acp/json-rpc-stdio.d.ts +24 -10
  907. package/dist/acp/json-rpc-stdio.d.ts.map +1 -1
  908. package/dist/acp/json-rpc-stdio.js +58 -36
  909. package/dist/acp/json-rpc-stdio.js.map +1 -1
  910. package/dist/bin-wrapper.d.ts.map +1 -1
  911. package/dist/bin-wrapper.js +3 -1
  912. package/dist/bin-wrapper.js.map +1 -1
  913. package/dist/build-info.js +3 -3
  914. package/dist/client.d.ts +4 -0
  915. package/dist/client.d.ts.map +1 -1
  916. package/dist/client.js +9 -2
  917. package/dist/client.js.map +1 -1
  918. package/dist/commands/acp.d.ts +14 -0
  919. package/dist/commands/acp.d.ts.map +1 -1
  920. package/dist/commands/acp.js +189 -2
  921. package/dist/commands/acp.js.map +1 -1
  922. package/dist/commands/attach.js +1 -1
  923. package/dist/commands/attach.js.map +1 -1
  924. package/dist/commands/capture.js +6 -6
  925. package/dist/commands/capture.js.map +1 -1
  926. package/dist/commands/compact.d.ts.map +1 -1
  927. package/dist/commands/compact.js +14 -2
  928. package/dist/commands/compact.js.map +1 -1
  929. package/dist/commands/config.d.ts.map +1 -1
  930. package/dist/commands/config.js +46 -7
  931. package/dist/commands/config.js.map +1 -1
  932. package/dist/commands/context-reconstruction.d.ts +5 -0
  933. package/dist/commands/context-reconstruction.d.ts.map +1 -0
  934. package/dist/commands/context-reconstruction.js +69 -0
  935. package/dist/commands/context-reconstruction.js.map +1 -0
  936. package/dist/commands/context.d.ts.map +1 -1
  937. package/dist/commands/context.js +46 -4
  938. package/dist/commands/context.js.map +1 -1
  939. package/dist/commands/daemon.d.ts.map +1 -1
  940. package/dist/commands/daemon.js +22 -5
  941. package/dist/commands/daemon.js.map +1 -1
  942. package/dist/commands/doctor.d.ts.map +1 -1
  943. package/dist/commands/doctor.js +61 -0
  944. package/dist/commands/doctor.js.map +1 -1
  945. package/dist/commands/gateway.d.ts.map +1 -1
  946. package/dist/commands/gateway.js +36 -11
  947. package/dist/commands/gateway.js.map +1 -1
  948. package/dist/commands/host.d.ts.map +1 -1
  949. package/dist/commands/host.js +68 -12
  950. package/dist/commands/host.js.map +1 -1
  951. package/dist/commands/launch.d.ts +1 -0
  952. package/dist/commands/launch.d.ts.map +1 -1
  953. package/dist/commands/launch.js +1 -1
  954. package/dist/commands/launch.js.map +1 -1
  955. package/dist/commands/mcp.d.ts.map +1 -1
  956. package/dist/commands/mcp.js +29 -5
  957. package/dist/commands/mcp.js.map +1 -1
  958. package/dist/commands/proof.d.ts.map +1 -1
  959. package/dist/commands/proof.js +18 -6
  960. package/dist/commands/proof.js.map +1 -1
  961. package/dist/commands/provider.d.ts.map +1 -1
  962. package/dist/commands/provider.js +4 -1
  963. package/dist/commands/provider.js.map +1 -1
  964. package/dist/commands/ps.d.ts +11 -1
  965. package/dist/commands/ps.d.ts.map +1 -1
  966. package/dist/commands/ps.js +26 -3
  967. package/dist/commands/ps.js.map +1 -1
  968. package/dist/commands/queue.d.ts +3 -0
  969. package/dist/commands/queue.d.ts.map +1 -1
  970. package/dist/commands/queue.js +429 -75
  971. package/dist/commands/queue.js.map +1 -1
  972. package/dist/commands/scope.d.ts +2 -0
  973. package/dist/commands/scope.d.ts.map +1 -1
  974. package/dist/commands/scope.js +15 -0
  975. package/dist/commands/scope.js.map +1 -1
  976. package/dist/commands/seat.d.ts.map +1 -1
  977. package/dist/commands/seat.js +79 -13
  978. package/dist/commands/seat.js.map +1 -1
  979. package/dist/commands/send.d.ts +2 -0
  980. package/dist/commands/send.d.ts.map +1 -1
  981. package/dist/commands/send.js +16 -6
  982. package/dist/commands/send.js.map +1 -1
  983. package/dist/commands/setup.js +1 -1
  984. package/dist/commands/setup.js.map +1 -1
  985. package/dist/commands/skill.d.ts.map +1 -1
  986. package/dist/commands/skill.js +5 -0
  987. package/dist/commands/skill.js.map +1 -1
  988. package/dist/commands/slack.d.ts +1 -1
  989. package/dist/commands/slack.d.ts.map +1 -1
  990. package/dist/commands/slack.js +5 -1
  991. package/dist/commands/slack.js.map +1 -1
  992. package/dist/commands/status.d.ts.map +1 -1
  993. package/dist/commands/status.js +11 -1
  994. package/dist/commands/status.js.map +1 -1
  995. package/dist/commands/stream.d.ts.map +1 -1
  996. package/dist/commands/stream.js +24 -1
  997. package/dist/commands/stream.js.map +1 -1
  998. package/dist/commands/terminal.d.ts +22 -0
  999. package/dist/commands/terminal.d.ts.map +1 -1
  1000. package/dist/commands/terminal.js +117 -8
  1001. package/dist/commands/terminal.js.map +1 -1
  1002. package/dist/commands/up.d.ts.map +1 -1
  1003. package/dist/commands/up.js +22 -0
  1004. package/dist/commands/up.js.map +1 -1
  1005. package/dist/commands/whoami.d.ts.map +1 -1
  1006. package/dist/commands/whoami.js +13 -2
  1007. package/dist/commands/whoami.js.map +1 -1
  1008. package/dist/commands/workflow-errors.js +1 -1
  1009. package/dist/commands/workflow-errors.js.map +1 -1
  1010. package/dist/commands/workflow-render.d.ts +4 -0
  1011. package/dist/commands/workflow-render.d.ts.map +1 -1
  1012. package/dist/commands/workflow-render.js +7 -0
  1013. package/dist/commands/workflow-render.js.map +1 -1
  1014. package/dist/commands/workflow.d.ts.map +1 -1
  1015. package/dist/commands/workflow.js +70 -2
  1016. package/dist/commands/workflow.js.map +1 -1
  1017. package/dist/config-store.d.ts +15 -1
  1018. package/dist/config-store.d.ts.map +1 -1
  1019. package/dist/config-store.js +112 -1
  1020. package/dist/config-store.js.map +1 -1
  1021. package/dist/daemon-lifecycle.d.ts +2 -0
  1022. package/dist/daemon-lifecycle.d.ts.map +1 -1
  1023. package/dist/daemon-lifecycle.js +38 -5
  1024. package/dist/daemon-lifecycle.js.map +1 -1
  1025. package/dist/daemon-reachability.d.ts +1 -1
  1026. package/dist/daemon-reachability.d.ts.map +1 -1
  1027. package/dist/daemon-reachability.js +4 -2
  1028. package/dist/daemon-reachability.js.map +1 -1
  1029. package/dist/daemon-start-lock.d.ts +24 -2
  1030. package/dist/daemon-start-lock.d.ts.map +1 -1
  1031. package/dist/daemon-start-lock.js +125 -4
  1032. package/dist/daemon-start-lock.js.map +1 -1
  1033. package/dist/lib/reconstruction-reader.d.ts +122 -0
  1034. package/dist/lib/reconstruction-reader.d.ts.map +1 -0
  1035. package/dist/lib/reconstruction-reader.js +481 -0
  1036. package/dist/lib/reconstruction-reader.js.map +1 -0
  1037. package/dist/lib/scope/logical-checkbox.d.ts.map +1 -1
  1038. package/dist/lib/scope/logical-checkbox.js +14 -0
  1039. package/dist/lib/scope/logical-checkbox.js.map +1 -1
  1040. package/dist/lib/scope/scope-fs.d.ts.map +1 -1
  1041. package/dist/lib/scope/scope-fs.js +36 -2
  1042. package/dist/lib/scope/scope-fs.js.map +1 -1
  1043. package/dist/lib/work-install.d.ts +28 -0
  1044. package/dist/lib/work-install.d.ts.map +1 -1
  1045. package/dist/lib/work-install.js +80 -20
  1046. package/dist/lib/work-install.js.map +1 -1
  1047. package/dist/mcp-http.d.ts +7 -0
  1048. package/dist/mcp-http.d.ts.map +1 -1
  1049. package/dist/mcp-http.js +30 -6
  1050. package/dist/mcp-http.js.map +1 -1
  1051. package/dist/mcp-server.d.ts +33 -3
  1052. package/dist/mcp-server.d.ts.map +1 -1
  1053. package/dist/mcp-server.js +489 -57
  1054. package/dist/mcp-server.js.map +1 -1
  1055. package/dist/queue-artifact.d.ts +57 -0
  1056. package/dist/queue-artifact.d.ts.map +1 -0
  1057. package/dist/queue-artifact.js +70 -0
  1058. package/dist/queue-artifact.js.map +1 -0
  1059. package/dist/queue-receipt.d.ts.map +1 -1
  1060. package/dist/queue-receipt.js +4 -3
  1061. package/dist/queue-receipt.js.map +1 -1
  1062. package/dist/recap-seat.d.ts +28 -0
  1063. package/dist/recap-seat.d.ts.map +1 -0
  1064. package/dist/recap-seat.js +41 -0
  1065. package/dist/recap-seat.js.map +1 -0
  1066. package/dist/seat-attention.d.ts +24 -0
  1067. package/dist/seat-attention.d.ts.map +1 -0
  1068. package/dist/seat-attention.js +119 -0
  1069. package/dist/seat-attention.js.map +1 -0
  1070. package/dist/system-preflight.d.ts.map +1 -1
  1071. package/dist/system-preflight.js +15 -7
  1072. package/dist/system-preflight.js.map +1 -1
  1073. package/dist/terminal-window.d.ts.map +1 -1
  1074. package/dist/terminal-window.js +16 -13
  1075. package/dist/terminal-window.js.map +1 -1
  1076. package/package.json +1 -1
  1077. package/tui/dist/attention/attention-model.d.ts +2 -1
  1078. package/tui/dist/attention/attention-model.d.ts.map +1 -1
  1079. package/tui/dist/attention/attention-model.js +21 -4
  1080. package/tui/dist/attention/attention-model.js.map +1 -1
  1081. package/tui/dist/config/config-model.d.ts.map +1 -1
  1082. package/tui/dist/config/config-model.js +7 -1
  1083. package/tui/dist/config/config-model.js.map +1 -1
  1084. package/tui/dist/config/pairing.d.ts +49 -0
  1085. package/tui/dist/config/pairing.d.ts.map +1 -0
  1086. package/tui/dist/config/pairing.js +98 -0
  1087. package/tui/dist/config/pairing.js.map +1 -0
  1088. package/tui/dist/daemon-client.d.ts +18 -1
  1089. package/tui/dist/daemon-client.d.ts.map +1 -1
  1090. package/tui/dist/daemon-client.js +33 -9
  1091. package/tui/dist/daemon-client.js.map +1 -1
  1092. package/tui/dist/demo-data.js +2 -2
  1093. package/tui/dist/demo-data.js.map +1 -1
  1094. package/tui/dist/detail.d.ts +3 -0
  1095. package/tui/dist/detail.d.ts.map +1 -1
  1096. package/tui/dist/detail.js +6 -1
  1097. package/tui/dist/detail.js.map +1 -1
  1098. package/tui/dist/execution/execution-model.d.ts +2 -0
  1099. package/tui/dist/execution/execution-model.d.ts.map +1 -1
  1100. package/tui/dist/execution/execution-model.js +10 -3
  1101. package/tui/dist/execution/execution-model.js.map +1 -1
  1102. package/tui/dist/health/health-model.d.ts.map +1 -1
  1103. package/tui/dist/health/health-model.js +27 -11
  1104. package/tui/dist/health/health-model.js.map +1 -1
  1105. package/tui/dist/hydrate.d.ts.map +1 -1
  1106. package/tui/dist/hydrate.js +4 -2
  1107. package/tui/dist/hydrate.js.map +1 -1
  1108. package/tui/dist/main.js +11 -2
  1109. package/tui/dist/main.js.map +1 -1
  1110. package/tui/dist/scopes/scopes-model.d.ts +9 -0
  1111. package/tui/dist/scopes/scopes-model.d.ts.map +1 -1
  1112. package/tui/dist/scopes/scopes-model.js +27 -1
  1113. package/tui/dist/scopes/scopes-model.js.map +1 -1
  1114. package/tui/dist/state.d.ts.map +1 -1
  1115. package/tui/dist/state.js +4 -3
  1116. package/tui/dist/state.js.map +1 -1
  1117. package/tui/dist/terminals/open-window.d.ts +21 -1
  1118. package/tui/dist/terminals/open-window.d.ts.map +1 -1
  1119. package/tui/dist/terminals/open-window.js +46 -9
  1120. package/tui/dist/terminals/open-window.js.map +1 -1
  1121. package/tui/dist/terminals/terminal-model.d.ts +8 -1
  1122. package/tui/dist/terminals/terminal-model.d.ts.map +1 -1
  1123. package/tui/dist/terminals/terminal-model.js +25 -8
  1124. package/tui/dist/terminals/terminal-model.js.map +1 -1
  1125. package/tui/dist/types.d.ts +18 -2
  1126. package/tui/dist/types.d.ts.map +1 -1
  1127. package/ui/dist/assets/index-BOYrLyfQ.js +623 -0
  1128. package/ui/dist/assets/index-DqSRu4OY.css +32 -0
  1129. package/ui/dist/index.html +2 -2
  1130. package/ui/dist/assets/index-BFOs3ejL.css +0 -32
  1131. package/ui/dist/assets/index-CdkFwtld.js +0 -623
@@ -20,13 +20,14 @@ import { buildInProcessWire } from "../gateway-subsystem.js";
20
20
  import { DispatchBuffer } from "../dispatch-buffer.js";
21
21
  import { downloadPrivateFile, isSlackHost, lookupBotApp, postChatMessage } from "./slack-api.js";
22
22
  import { botInboxProblems } from "./bot-inbox.js";
23
- import { loadConfig } from "./config.js";
23
+ import { effectiveInboundDestination, inboundDestinationNote, loadConfig } from "./config.js";
24
+ import { resolveDefaultReceiver } from "../../default-receiver.js";
24
25
  import { resolveSecret } from "./secrets.js";
25
26
  import { SeenStore, DeadLetterStore, InboundReceiptStore, slackMicros } from "./state-store.js";
26
27
  import { makeQueuePorts } from "./queue-access.js";
27
28
  import { SlackOutboundDriver, OUTBOUND_OP } from "./outbound-driver.js";
28
29
  import { SlackAskSettlement } from "./settled-asks.js";
29
- import { abortableSleep, subsystemSlackDeliver } from "./slack-delivery.js";
30
+ import { abortableSleep, POSSIBLY_POSTED_CLASS, subsystemSlackDeliver } from "./slack-delivery.js";
30
31
  import { InboundRouter, SLACK_THREAD_ROOT_TAG, handleEnvelope } from "./inbound.js";
31
32
  import { makeInboundSenderResolver } from "./inbound-admission.js";
32
33
  import { ThreadSeatMap, formatPostedStamp } from "./thread-seat-map.js";
@@ -42,17 +43,19 @@ import { sharedChannelAddresses, sharedChannelFor } from "../participants.js";
42
43
  import { hasLiveHumanGate, isBlockerLive } from "../../queue-repository.js";
43
44
  import { humanAnswerText } from "../../human-questions.js";
44
45
  import { formatReplyToChoice, formatReplyToThreadMissing, REPLY_TO_CHOICE_ACTOR, REPLY_TO_CHAIN_LIMIT } from "../../reply-to-choice.js";
45
- import { ownerNotificationLevelAtLeast } from "../../queue-transition-log.js";
46
+ import { ownerNotificationLevelAtLeast, RELAY_OWNER_NOTIFICATION_TRANSPORT_FAILED_PREFIX, } from "../../queue-transition-log.js";
46
47
  // OPR.0.5.6.1 — the delivery rules engine: ONE decision per message replaces
47
48
  // the two dial-reads (the S14 default-decision stub). The legacy dial path
48
49
  // survives ONLY as the stated degrade when the destination is not a
49
50
  // registered human (no prefs -> no engine input).
50
51
  import { decideDelivery, resolveAvailability, isEscalationClass, formatDeliveryTermination, DELIVERY_TERMINATION_PREFIX, } from "../delivery-rules-engine.js";
51
52
  import { armDeliveryDeferral } from "../../policies/delivery-deferral.js";
52
- import { confirmReleaseAtPost, currentAskVerdict, holdForQuiet } from "../../policies/quiet-release.js";
53
- import { noteRePresentNotPosted, RE_PRESENT_DECISION_PREFIX } from "./open-asks.js";
53
+ import { confirmReleaseAtPost, currentAskVerdict, holdForQuiet, noteQuietUnreadable } from "../../policies/quiet-release.js";
54
+ import { noteRePresentNotPosted, noteRePresentUnconfirmed, rePresentMarks, RE_PRESENT_DECISION_PREFIX } from "./open-asks.js";
54
55
  import { quietHoldFor } from "../human-quiet-windows.js";
55
56
  import { WatchdogJobsRepository } from "../../watchdog-jobs-repository.js";
57
+ import { loadRelayProfiles } from "../relay-config.js";
58
+ import { createRelayOutboundTransport, prepareRelayDecision, relayStatePaths, resolvePrimaryRelayBinding, } from "../relay-outbound.js";
56
59
  const SECRET_BOT = "SLACK_BOT_TOKEN";
57
60
  const SECRET_APP = "SLACK_APP_TOKEN";
58
61
  /** Compose an inbound reply with Mission Control's existing human-park resolver.
@@ -259,12 +262,47 @@ export function buildSlackGatewayWire(opts) {
259
262
  const app = resolveSecret(SECRET_APP, { envFile });
260
263
  const outboundReady = cfg.enabled && bot !== null && cfg.channel !== null;
261
264
  const inboundReady = cfg.enabled && app !== null;
262
- const inboundRouting = { fallback: "local", destination: cfg.inboundDestination };
265
+ // Read once, when the connector starts, like the rest of its configuration.
266
+ const receiver = (() => { try {
267
+ return resolveDefaultReceiver(opts.queueRepo.db);
268
+ }
269
+ catch {
270
+ return null;
271
+ } })();
272
+ const inbound = effectiveInboundDestination(cfg, receiver?.session ?? null);
273
+ const inboundNote = inboundDestinationNote(inbound, receiver);
274
+ if (inbound.from === "default")
275
+ log(`slack inbound: ${inboundNote}`);
276
+ const inboundRouting = { fallback: "local", destination: inbound.destination, destinationFrom: inbound.from, ...(inboundNote ? { destinationNote: inboundNote } : {}) };
263
277
  const dead = new DeadLetterStore(path.join(stateDir(opts.home), "slack-inbound-deadletter.jsonl"));
264
278
  const deadActions = new DeadLetterStore(path.join(stateDir(opts.home), "slack-inbound-action-deadletter.jsonl"));
265
279
  // Retained relays belong to their original host, even after forwarding configuration changes.
266
280
  const deadForwards = new DeadLetterStore(path.join(stateDir(opts.home), "slack-inbound-forward-deadletter.jsonl"));
267
- if (!outboundReady && !inboundReady) {
281
+ const registrySurface = opts.registry ?? { loadHumanRegistry, resolveSlackHandle };
282
+ const hasRelayPrimaryBinding = () => {
283
+ try {
284
+ const reg = registrySurface.loadHumanRegistry(opts.home);
285
+ return (reg.ok &&
286
+ reg.entities.some((e) => e.connectorBindings.some((b) => b.role === "primary" && b.kind === "relay")));
287
+ }
288
+ catch {
289
+ return false;
290
+ }
291
+ };
292
+ const hasPendingRelayDecisions = () => {
293
+ try {
294
+ return new DispatchBuffer(opts.home).pending().some((d) => {
295
+ const p = (d.payload ?? {});
296
+ return Boolean(p.relayConnectorRef || p.relayEnvelope);
297
+ });
298
+ }
299
+ catch {
300
+ return false;
301
+ }
302
+ };
303
+ const relayConfigured = hasRelayPrimaryBinding() || hasPendingRelayDecisions();
304
+ const anyOutboundEnabled = outboundReady || relayConfigured;
305
+ if (!outboundReady && !inboundReady && !relayConfigured) {
268
306
  const missing = !cfg.enabled ? "connector disabled (rig slack enable)" : !bot ? "SLACK_BOT_TOKEN unresolved" : "channel unconfigured";
269
307
  log(`slack delivery not configured (${missing}) — wire is inert; dispatches would be refused honestly`);
270
308
  const inert = buildInProcessWire({
@@ -275,7 +313,6 @@ export function buildSlackGatewayWire(opts) {
275
313
  });
276
314
  return { ...inert, status: () => ({ platform: "slack", configurationDigest: channelStateDigest(cfg), outboundReady: false, inboundReady: false, inboundRouting, recovery: { state: "unavailable", reason: "inbound-not-configured" }, inbound: { state: "not-configured" }, ...deadLetterBacklogFields(dead, deadActions, deadForwards) }) };
277
315
  }
278
- const registrySurface = opts.registry ?? { loadHumanRegistry, resolveSlackHandle };
279
316
  const ports = makeQueuePorts(opts.queueRepo, {
280
317
  loadHumanRegistry: () => registrySurface.loadHumanRegistry(opts.home),
281
318
  sharedChannels: () => sharedChannelAddresses(opts.home),
@@ -283,7 +320,11 @@ export function buildSlackGatewayWire(opts) {
283
320
  // OPR.0.5.6.1 — the one engine consult (AM-F5: the gateway consults the
284
321
  // engine BEFORE dispatch). Null = destination is not a registered human;
285
322
  // the caller keeps the pre-engine dial behavior (stated degrade).
286
- const decideForPayload = (p) => {
323
+ // The person's quiet hours are read on their own. When only they can't be read, that isn't a quiet window: with
324
+ // `pastUnreadableQuiet`, a routine ask that would post is decided from the person's other settings, with no mention
325
+ // (quiet hours would have muted one), and `quietUnreadable` says why, for the post to say so. Quiet hours never change
326
+ // an escalation, or an ask that posts nothing. Without it (a relay, which can't show that line) the read throws.
327
+ const decideForPayload = (p, { pastUnreadableQuiet }) => {
287
328
  const local = (p.destinationSession ?? "").split("@")[0] ?? "";
288
329
  if (!local)
289
330
  return null;
@@ -293,9 +334,21 @@ export function buildSlackGatewayWire(opts) {
293
334
  const human = reg.entities.find((e) => e.entityId === local);
294
335
  if (!human)
295
336
  return null;
296
- return decideDelivery({
337
+ const escalation = p.humanIntent !== "update" && isEscalationClass(p.tags);
338
+ let quiet;
339
+ let quietUnreadable;
340
+ try {
341
+ quiet = quietHoldFor(opts.queueRepo.db, human.entityId, new Date());
342
+ }
343
+ catch (error) {
344
+ if (!pastUnreadableQuiet)
345
+ throw error;
346
+ quiet = null;
347
+ quietUnreadable = error.message;
348
+ }
349
+ const decision = decideDelivery({
297
350
  level: p.ownerNotificationLevel ?? null,
298
- escalation: p.humanIntent !== "update" && isEscalationClass(p.tags),
351
+ escalation,
299
352
  alerted: p.humanIntent !== "update" && (p.tags ?? []).includes(HUMAN_ALERT_TAG),
300
353
  human: {
301
354
  entityId: human.entityId,
@@ -306,8 +359,11 @@ export function buildSlackGatewayWire(opts) {
306
359
  minimumLevelThatPosts: cfg.minimumLevelThatPosts,
307
360
  minimumLevelThatInterrupts: cfg.minimumLevelThatInterrupts,
308
361
  },
309
- quiet: quietHoldFor(opts.queueRepo.db, human.entityId, new Date()),
362
+ quiet,
310
363
  });
364
+ if (quietUnreadable === undefined || escalation || (decision.outcome !== "interrupt" && decision.outcome !== "notify"))
365
+ return decision;
366
+ return { ...decision, outcome: "notify", mention: false, quietUnreadable };
311
367
  };
312
368
  const outboundSeen = new SeenStore(path.join(stateDir(opts.home), "slack-outbound-seen.jsonl"));
313
369
  const delivered = new SeenStore(path.join(stateDir(opts.home), "slack-delivered-decisions.jsonl"));
@@ -358,19 +414,48 @@ export function buildSlackGatewayWire(opts) {
358
414
  tags: ["slack-undeliverable", recoveryTag(p.qitemId)],
359
415
  }).catch((e) => log(`undeliverable notice FAILED for ${p.qitemId}: ${e.message}`));
360
416
  };
361
- const recordTransportFailed = (p, failureClass, detail, partlyPosted) => {
417
+ const resolveRelayConnectorRef = (p) => {
418
+ const carry = p;
419
+ if (typeof carry.relayConnectorRef === "string" && carry.relayConnectorRef.trim().length > 0) {
420
+ return carry.relayConnectorRef.trim();
421
+ }
422
+ try {
423
+ const reg = registrySurface.loadHumanRegistry(opts.home);
424
+ return resolvePrimaryRelayBinding(p.destinationSession, reg)?.connectorRef ?? null;
425
+ }
426
+ catch {
427
+ return null;
428
+ }
429
+ };
430
+ const recordTransportFailed = (p, failureClass, detail, partlyPosted, relay = false) => {
362
431
  if (!p.qitemId)
363
432
  return;
364
- if (failureClass === "human-message-unrenderable" || failureClass === "slack-invalid-blocks") {
433
+ const carry = p;
434
+ const isRelay = relay || Boolean(carry.relayConnectorRef || carry.relayEnvelope);
435
+ if (!isRelay && (failureClass === "human-message-unrenderable" || failureClass === "slack-invalid-blocks")) {
365
436
  notifySourceUndeliverable(p, detail, partlyPosted, failureClass === "slack-invalid-blocks");
366
437
  }
367
438
  const key = p.notificationKey ?? p.qitemId;
368
- const previousFailure = opts.queueRepo.transitionLog.listForQitem(p.qitemId).filter((transition) => transition.transitionNote?.startsWith("slack-owner-notification-transport-failed ")
439
+ if (isRelay) {
440
+ opts.queueRepo.recordRelayOwnerNotificationTransportFailed({
441
+ qitemId: p.qitemId,
442
+ notificationKey: key,
443
+ connectorRef: resolveRelayConnectorRef(p),
444
+ failureClass,
445
+ detail,
446
+ });
447
+ return;
448
+ }
449
+ const previousFailure = opts.queueRepo.transitionLog.listForQitem(p.qitemId).filter((transition) => (transition.transitionNote?.startsWith("slack-owner-notification-transport-failed ")
450
+ || transition.transitionNote?.startsWith(`${RELAY_OWNER_NOTIFICATION_TRANSPORT_FAILED_PREFIX} `))
369
451
  && transition.transitionNote.split(/\s+/).includes(`notification_key=${key}`)).at(-1);
370
452
  // A corrected attempt can fail transiently after a permanent rejection, and a
371
- // transient failure can be followed by a definite rejection. Preserve both changes.
372
- const alreadyRecorded = previousFailure &&
373
- previousFailure.transitionNote.includes("class=slack-invalid-blocks ") === (failureClass === "slack-invalid-blocks");
453
+ // transient failure can be followed by a definite rejection; an unreadable 2xx
454
+ // (possibly posted) can follow either. Preserve each change of kind.
455
+ const previousNote = previousFailure?.transitionNote ?? "";
456
+ const sameKind = (kind) => previousNote.includes(`class=${kind} `) === (failureClass === kind);
457
+ const alreadyRecorded = previousNote.startsWith("slack-owner-notification-transport-failed ")
458
+ && sameKind("slack-invalid-blocks") && sameKind(POSSIBLY_POSTED_CLASS);
374
459
  if (alreadyRecorded)
375
460
  return;
376
461
  opts.queueRepo.update({
@@ -540,10 +625,11 @@ export function buildSlackGatewayWire(opts) {
540
625
  if (p.quietRelease)
541
626
  return undefined; // releasing a quiet hold: posted, never a mention
542
627
  const fire = p.deliveryDeferralFire === true;
543
- // At post time the decision was just made; if it can't be re-read now (quiet hours unreadable), no mention.
628
+ // At post time the decision was just made; if it can't be re-read now, no mention. Quiet hours that can't be read
629
+ // never mention a routine ask (the decision says so).
544
630
  let decision;
545
631
  try {
546
- decision = fire ? null : decideForPayload(p);
632
+ decision = fire ? null : decideForPayload(p, { pastUnreadableQuiet: true });
547
633
  }
548
634
  catch {
549
635
  return undefined;
@@ -676,6 +762,101 @@ export function buildSlackGatewayWire(opts) {
676
762
  log,
677
763
  })
678
764
  : async () => ({ ok: false, class: "slack-outbound-not-configured", detail: "bot token or channel missing" });
765
+ const { attemptedPath: relayAttemptedPath, deliveredPath: relayDeliveredPath } = relayStatePaths(opts.home);
766
+ const relayAttempted = new SeenStore(relayAttemptedPath);
767
+ const relayDelivered = new SeenStore(relayDeliveredPath);
768
+ const relayTransport = createRelayOutboundTransport({
769
+ attempted: relayAttempted,
770
+ delivered: relayDelivered,
771
+ outboundSeen,
772
+ fetchImpl: opts.fetchImpl,
773
+ stopSignal: runCtl.signal,
774
+ log,
775
+ resolveProfile: (connectorRef) => {
776
+ const reg = registrySurface.loadHumanRegistry(opts.home);
777
+ const loaded = loadRelayProfiles(opts.home, reg.ok ? { entities: reg.entities } : undefined);
778
+ if (!loaded.ok && loaded.registryError) {
779
+ return { ok: false, reason: loaded.registryError };
780
+ }
781
+ const profile = loaded.get(connectorRef);
782
+ if (!profile) {
783
+ return { ok: false, reason: `relay profile "${connectorRef}" is not registered` };
784
+ }
785
+ if (!profile.ready || !profile.credentials) {
786
+ return { ok: false, reason: profile.reason };
787
+ }
788
+ return {
789
+ ok: true,
790
+ connectorRef: profile.connectorRef,
791
+ mode: profile.mode,
792
+ url: profile.credentials.url,
793
+ outboundToken: profile.credentials.outboundToken,
794
+ };
795
+ },
796
+ hasAcceptedReceipt: ({ qitemId, notificationKey, deliveryId }) => opts.queueRepo.hasRelayOwnerNotificationReceipt(qitemId, notificationKey, deliveryId),
797
+ onAccepted: (info) => {
798
+ opts.queueRepo.recordRelayOwnerNotificationAccepted({
799
+ qitemId: info.qitemId,
800
+ notificationKey: info.notificationKey,
801
+ deliveryId: info.deliveryId,
802
+ connectorRef: info.connectorRef,
803
+ replyRef: info.replyRef,
804
+ replyRefHash: info.refHash,
805
+ revision: info.revision,
806
+ episodeKey: info.episodeKey,
807
+ level: info.level,
808
+ kind: info.kind,
809
+ humanIntent: info.humanIntent,
810
+ closeUpdate: !info.digestId,
811
+ ...(info.digestId ? { digest: info.digestId } : {}),
812
+ });
813
+ },
814
+ onTransportFailed: (p, failureClass, detail) => recordTransportFailed(p, failureClass, detail, false, true),
815
+ release: (q) => releaseRef(q),
816
+ });
817
+ const prepareDecision = (decision) => prepareRelayDecision(decision, {
818
+ loadHumanRegistry: () => registrySurface.loadHumanRegistry(opts.home),
819
+ queueRepo: opts.queueRepo,
820
+ resolveOutcome: (p) => {
821
+ let ruled = null;
822
+ try {
823
+ ruled = p.qitemId ? decideForPayload(p, { pastUnreadableQuiet: false }) : null;
824
+ }
825
+ catch {
826
+ ruled = null;
827
+ }
828
+ if (ruled) {
829
+ if (ruled.outcome === "interrupt" && ruled.deferMinutes === undefined)
830
+ return "interrupt";
831
+ if (ruled.outcome === "digest")
832
+ return "digest";
833
+ return "notify";
834
+ }
835
+ const interrupt = Boolean(p.ownerNotificationLevel && ownerNotificationLevelAtLeast(p.ownerNotificationLevel, cfg.minimumLevelThatInterrupts));
836
+ return interrupt ? "interrupt" : "notify";
837
+ },
838
+ });
839
+ const isRelayDecision = (decision, p) => {
840
+ const carry = p;
841
+ if (carry.relayConnectorRef || carry.relayEnvelope)
842
+ return true;
843
+ try {
844
+ const reg = registrySurface.loadHumanRegistry(opts.home);
845
+ return resolvePrimaryRelayBinding(p.destinationSession ?? decision.entityBindingRef, reg) !== null;
846
+ }
847
+ catch {
848
+ return false;
849
+ }
850
+ };
851
+ const targetDeliverFor = (decision, p) => {
852
+ if (!isRelayDecision(decision, p))
853
+ return deliver;
854
+ return (d) => {
855
+ const carry = (d.payload ?? {});
856
+ const readyDecision = carry.relayConnectorRef && carry.relayEnvelope ? d : prepareDecision(d);
857
+ return relayTransport.deliver(readyDecision);
858
+ };
859
+ };
679
860
  // OPR.0.5.6.1 — decision containment ahead of the transport: log-class and
680
861
  // digest-class produce ZERO post attempts (AM-F5 tooth); an away-escalation
681
862
  // deferral arms the watchdog substrate and posts nothing now (AM-F1); an
@@ -699,6 +880,8 @@ export function buildSlackGatewayWire(opts) {
699
880
  // Decisions already in the dispatch buffer when this wire is built are retained from an earlier
700
881
  // run: posts that failed or never finished, which startServices() replays.
701
882
  const replayedAtStart = new Set(new DispatchBuffer(opts.home).pending().map((d) => d.decisionId));
883
+ /** The marks a later post of a re-shown ask carries, from its row (see `rePresentMarks`); empty for any other ask. */
884
+ const rowMarks = (qitemId, key) => qitemId && key ? rePresentMarks(opts.queueRepo.listTransitions(qitemId).map((t) => t.transitionNote ?? ""), key) : {};
702
885
  // A replayed notification for a row that has since left the active states is history, not news
703
886
  // (a post that failed, retried a day later): it posts nothing, and the row says why, unless the
704
887
  // episode already has its posted receipt. Returning ok drains it from the dispatch buffer.
@@ -734,26 +917,36 @@ export function buildSlackGatewayWire(opts) {
734
917
  // The original decision only ever carries its original payload: if what's left differs, it goes out as a new
735
918
  // decision with its own id and receipts (enqueued before the original is acked), so a post under one id never has two
736
919
  // contents, and receipts bind to exactly the members posted under it. An earlier attempt of the original that may
737
- // have landed is resolved by the reconciler first. If the quiet state can't be read, nothing posts (see the catch).
920
+ // have landed is resolved by the reconciler first. Quiet hours that can't be read aren't a quiet window: the digest
921
+ // posts and says so, and each member's row records it. A relay, which can't show that line, posts nothing (the catch).
738
922
  const deliverDigestPost = async (decision, p) => {
739
- const settled = await resolveEarlierAttempt(decision);
740
- if (settled)
741
- return settled;
923
+ const relay = isRelayDecision(decision, p);
924
+ const targetDeliver = targetDeliverFor(decision, p);
925
+ if (!relay) {
926
+ const settled = await resolveEarlierAttempt(decision);
927
+ if (settled)
928
+ return settled;
929
+ }
742
930
  const recipient = (p.destinationSession ?? "").split("@")[0] ?? "";
743
931
  let quiet;
932
+ let quietUnreadable;
744
933
  try {
745
934
  quiet = recipient ? quietHoldFor(opts.queueRepo.db, recipient, new Date()) : null;
746
935
  }
747
936
  catch (error) {
748
- // An attempted digest (it may be in Slack) is retained: acked, the next flush would mint the ask again from the
749
- // row as it is now. A never-attempted one is acked: its members keep their digest notes, so the next flush
750
- // selects them again. A store check only: no Slack read on a failure path.
751
- if ("attempted" in deliver && deliver.attempted(decision)) {
752
- log(`digest post ${decision.decisionId} retained: quiet hours couldn't be read: ${error.message}`);
753
- return { ok: false, class: "quiet-unreadable", detail: error.message };
937
+ if (relay) {
938
+ // A relay's attempted digest (it may be in Slack) is retained: acked, the next flush would mint the ask again
939
+ // from the row as it is now. A never-attempted one is acked: its members keep their digest notes, so the next
940
+ // flush selects them again. A store check only: no Slack read on a failure path.
941
+ if (relayTransport.wasAttempted(decision)) {
942
+ log(`digest post ${decision.decisionId} retained: quiet hours couldn't be read: ${error.message}`);
943
+ return { ok: false, class: "quiet-unreadable", detail: error.message };
944
+ }
945
+ log(`digest post ${decision.decisionId} not posted: quiet hours couldn't be read: ${error.message}`);
946
+ return { ok: true };
754
947
  }
755
- log(`digest post ${decision.decisionId} not posted: quiet hours couldn't be read: ${error.message}`);
756
- return { ok: true };
948
+ quiet = null;
949
+ quietUnreadable = error.message;
757
950
  }
758
951
  const aggregate = p.memberReceipts;
759
952
  const members = aggregate ?? (p.qitemId ? [{ qitemId: p.qitemId, notificationKey: p.notificationKey ?? p.qitemId }] : []);
@@ -775,8 +968,18 @@ export function buildSlackGatewayWire(opts) {
775
968
  holdForQuiet({ queueRepo: opts.queueRepo, jobsRepo, qitemId: m.qitemId, entityId: recipient, hold: { ...quiet, notificationKey: m.notificationKey } });
776
969
  return false;
777
970
  });
778
- if (kept.length === members.length)
779
- return deliver(decision); // unchanged: the original, as it is
971
+ if (kept.length === members.length) {
972
+ // A digest holding a re-shown ask whose earlier attempt may be in Slack says it may repeat, and an attempt log that
973
+ // can't be read doesn't hold it. A kept digest decides the same when it comes back here.
974
+ const repeat = !relay && members.some((m) => rowMarks(m.qitemId, m.notificationKey).possibleRepeat);
975
+ if (quietUnreadable !== undefined) {
976
+ log(`digest post ${decision.decisionId} posting: its recipient's quiet hours couldn't be read (${quietUnreadable})`);
977
+ for (const m of members)
978
+ noteQuietUnreadable(opts.queueRepo, m.qitemId, m.notificationKey, quietUnreadable);
979
+ }
980
+ const marks = { ...(repeat ? { possibleRepeat: true } : {}), ...(quietUnreadable !== undefined ? { quietUnreadable: true } : {}) };
981
+ return targetDeliver(Object.keys(marks).length > 0 ? { ...decision, payload: { ...p, ...marks } } : decision); // the original, as it is
982
+ }
780
983
  if (kept.length === 0 || !aggregate)
781
984
  return { ok: true }; // nothing left to post under it
782
985
  const keptIds = new Set(kept.map((m) => m.qitemId));
@@ -785,11 +988,26 @@ export function buildSlackGatewayWire(opts) {
785
988
  const keptId = `${decision.decisionId}:kept:${createHash("sha256").update(kept.map((m) => m.notificationKey).sort().join(",")).digest("hex").slice(0, 16)}`;
786
989
  // Durable first: the new decision is in the buffer before the original is acked (returning ok). A crash between the
787
990
  // two replays the original, which computes the same kept set and id; the dispatcher accepts the pending id once.
788
- const res = selfDispatch(keptId, { ...p, memberReceipts: kept, body, summary });
991
+ const { relayConnectorRef: _rc, relayEnvelope: _re, relayRevision: _rr, ...restPayload } = p;
992
+ const res = selfDispatch(keptId, { ...restPayload, memberReceipts: kept, body, summary });
789
993
  return res.ok ? { ok: true } : { ok: false, class: "kept-dispatch-refused", detail: res.error };
790
994
  };
791
995
  const engineDeliver = async (decision) => {
792
- const p = (decision.payload ?? {});
996
+ let p = (decision.payload ?? {});
997
+ const relay = isRelayDecision(decision, p);
998
+ const targetDeliver = targetDeliverFor(decision, p);
999
+ if (relay) {
1000
+ let alreadyAttempted = false;
1001
+ try {
1002
+ alreadyAttempted = relayTransport.wasAttempted(decision);
1003
+ }
1004
+ catch {
1005
+ return targetDeliver(decision);
1006
+ }
1007
+ if (alreadyAttempted) {
1008
+ return targetDeliver(decision);
1009
+ }
1010
+ }
793
1011
  // The decision-resolved notice is written at closure, so a closed row is its normal case.
794
1012
  if (replayedAtStart.has(decision.decisionId) && p.qitemId && p.ownerNotificationKind !== "human-decision-resolved"
795
1013
  && !p.deliveryDigestPost) {
@@ -816,9 +1034,11 @@ export function buildSlackGatewayWire(opts) {
816
1034
  releaseRef(p.qitemId);
817
1035
  return { ok: true };
818
1036
  }
819
- const settled = await resolveEarlierAttempt(decision);
820
- if (settled)
821
- return settled;
1037
+ if (!relay) {
1038
+ const settled = await resolveEarlierAttempt(decision);
1039
+ if (settled)
1040
+ return settled;
1041
+ }
822
1042
  const verdict = !p.qitemId ? "post" : await confirmReleaseAtPost({
823
1043
  queueRepo: opts.queueRepo,
824
1044
  jobsRepo: new WatchdogJobsRepository(opts.queueRepo.db),
@@ -827,9 +1047,18 @@ export function buildSlackGatewayWire(opts) {
827
1047
  entityId: (p.destinationSession ?? "").split("@")[0] ?? "",
828
1048
  qitemId: p.qitemId,
829
1049
  notificationKey: key,
1050
+ // Quiet hours that can't be read at release don't hold it: it posts and says so. A relay can't, so it waits.
1051
+ pastUnreadableQuiet: !relay,
830
1052
  });
831
- if (verdict === "post")
832
- return deliver(decision);
1053
+ if (verdict === "post" || verdict === "post-quiet-unreadable") {
1054
+ // A re-shown ask whose earlier attempt may be in Slack keeps saying so when its release posts it, and an attempt
1055
+ // log that still can't be read doesn't hold the release. (The release has just re-checked its state.)
1056
+ const { possibleRepeat } = relay ? {} : rowMarks(p.qitemId, key);
1057
+ if (verdict === "post-quiet-unreadable")
1058
+ log(`quiet release ${decision.decisionId} posting: its recipient's quiet hours couldn't be read`);
1059
+ const marks = { ...(possibleRepeat ? { possibleRepeat } : {}), ...(verdict === "post-quiet-unreadable" ? { quietUnreadable: true } : {}) };
1060
+ return targetDeliver(Object.keys(marks).length > 0 ? { ...decision, payload: { ...p, ...marks } } : decision);
1061
+ }
833
1062
  // Declined (the row says why) or couldn't be checked (nothing written): either way nothing posts now. Acking is
834
1063
  // safe because the window's release job owns redelivery until the ask has a receipt or a disposition; keeping it
835
1064
  // buffered would wait for a restart and block the job's own re-dispatch of the same decision id.
@@ -847,39 +1076,75 @@ export function buildSlackGatewayWire(opts) {
847
1076
  return { ok: true };
848
1077
  }
849
1078
  // Whether an earlier attempt can be in Slack is read from the attempt log, which the landing check below reads
850
- // leniently. A log that exists but can't be read is unknown, not "never attempted": the decision stays in the buffer,
851
- // with no post (delivery's reconcile reads the same log) and no not-posted record, until it reads.
1079
+ // leniently. A log that exists but can't be read is unknown, not "never attempted": it counts as an earlier attempt
1080
+ // that may be in Slack, and never as a reason to write a not-posted record.
1081
+ let attemptLogUnreadable = null;
852
1082
  try {
853
- attempted.statuses();
1083
+ (relay ? relayAttempted : attempted).statuses();
854
1084
  }
855
1085
  catch (error) {
856
- log(`re-shown ${decision.decisionId} retained: the attempt log couldn't be read (${error.message})`);
857
- return { ok: false, class: "re-present-attempt-log-unreadable", detail: error.message };
1086
+ attemptLogUnreadable = error.message;
858
1087
  }
859
1088
  // An earlier attempt of this decision found in Slack goes to delivery, which records it.
860
- const landing = "landing" in deliver ? await deliver.landing(decision) : "unattempted";
1089
+ const landing = attemptLogUnreadable ? "maybe"
1090
+ : !relay && "landing" in deliver ? await deliver.landing(decision) : "unattempted";
861
1091
  if (landing === "found" || landing === "partial")
862
- return deliver(decision);
1092
+ return targetDeliver(decision);
1093
+ const regForVerdict = registrySurface.loadHumanRegistry(opts.home);
1094
+ const alertsForVerdict = regForVerdict.ok || regForVerdict.noHumans
1095
+ ? await ports.listHumanAlerts({ minimumLevel: cfg.minimumLevelThatPosts })
1096
+ : undefined;
863
1097
  const verdict = await currentAskVerdict({
864
1098
  queueRepo: opts.queueRepo,
865
1099
  home: opts.home,
866
- registry: { loadHumanRegistry: () => registrySurface.loadHumanRegistry(opts.home) },
1100
+ registry: { loadHumanRegistry: () => regForVerdict },
867
1101
  entityId: (p.destinationSession ?? "").split("@")[0] ?? "",
868
1102
  qitemId: p.qitemId,
869
1103
  notificationKey: key,
1104
+ ...(alertsForVerdict ? { alerts: alertsForVerdict } : {}),
870
1105
  });
871
- if (verdict.kind !== "post") {
872
- // One whose earlier attempt Slack couldn't rule out may already be posted: it's never recorded as not posted, and
873
- // it stays in the buffer, so its replay decides again (and reconciles) instead of the uncertainty being dropped.
1106
+ // A definite verdict is positive evidence: this is no longer the person's current ask, so it doesn't post. One whose
1107
+ // earlier attempt Slack couldn't rule out may already be posted: it's never recorded as not posted, and it stays in
1108
+ // the buffer, so its replay decides again (and reconciles) instead of the uncertainty being dropped.
1109
+ if (verdict.kind === "disposition") {
1110
+ if (landing === "maybe") {
1111
+ log(`re-shown ${decision.decisionId} retained: an earlier attempt may be in Slack, and it can't go on now (${verdict.reason})`);
1112
+ return attemptLogUnreadable
1113
+ ? { ok: false, class: "re-present-attempt-log-unreadable", detail: attemptLogUnreadable }
1114
+ : { ok: false, class: "re-present-earlier-attempt-unconfirmed", detail: verdict.reason };
1115
+ }
1116
+ noteRePresentNotPosted(opts.queueRepo, p.qitemId, key, verdict);
1117
+ releaseRef(key);
1118
+ return { ok: true };
1119
+ }
1120
+ // What OpenRig can't tell isn't a reason to hold the ask: it goes on through the person's delivery settings (a
1121
+ // readable quiet window still holds it), and the post says what couldn't be checked. An attempt log that can't be
1122
+ // read can't record the new attempt either, so the bound is the process: a kept decision replays only when the
1123
+ // gateway starts, and the dispatcher takes a pending id once. The relay posts no such line, so it waits, as before.
1124
+ const unconfirmed = [
1125
+ ...(attemptLogUnreadable || (landing === "maybe" && verdict.kind === "unavailable") ? ["attempt"] : []),
1126
+ ...(verdict.kind === "unavailable" ? ["state"] : []),
1127
+ ];
1128
+ if (unconfirmed.length > 0 && relay) {
874
1129
  if (landing === "maybe") {
875
- const why = verdict.kind === "unavailable" ? verdict.detail : verdict.reason;
1130
+ const why = attemptLogUnreadable ?? (verdict.kind === "unavailable" ? verdict.detail : "an earlier attempt may be in Slack");
876
1131
  log(`re-shown ${decision.decisionId} retained: an earlier attempt may be in Slack, and it can't go on now (${why})`);
877
- return { ok: false, class: "re-present-earlier-attempt-unconfirmed", detail: why };
1132
+ return attemptLogUnreadable
1133
+ ? { ok: false, class: "re-present-attempt-log-unreadable", detail: attemptLogUnreadable }
1134
+ : { ok: false, class: "re-present-earlier-attempt-unconfirmed", detail: why };
878
1135
  }
879
1136
  noteRePresentNotPosted(opts.queueRepo, p.qitemId, key, verdict);
880
1137
  releaseRef(key);
881
1138
  return { ok: true };
882
1139
  }
1140
+ if (unconfirmed.length > 0) {
1141
+ const why = [attemptLogUnreadable ? `the attempt log couldn't be read (${attemptLogUnreadable})` : null,
1142
+ verdict.kind === "unavailable" ? `the ask's state couldn't be checked (${verdict.detail})` : null].filter(Boolean).join("; ");
1143
+ log(`re-shown ${decision.decisionId} goes on to delivery, marked: ${why}`);
1144
+ noteRePresentUnconfirmed(opts.queueRepo, p.qitemId, key, unconfirmed, why);
1145
+ p = { ...p, ...(unconfirmed.includes("attempt") ? { possibleRepeat: true } : {}), ...(unconfirmed.includes("state") ? { stateUnconfirmed: true } : {}) };
1146
+ decision = { ...decision, payload: p };
1147
+ }
883
1148
  }
884
1149
  if (p.deliveryDeferralFire) {
885
1150
  const fireKey = p.notificationKey ?? p.qitemId;
@@ -887,12 +1152,14 @@ export function buildSlackGatewayWire(opts) {
887
1152
  releaseRef(p.qitemId);
888
1153
  return { ok: true };
889
1154
  }
890
- return deliver(decision);
1155
+ // A deferred re-shown ask keeps its marks when the fire posts it: the fire checks nothing again.
1156
+ const marks = relay ? {} : rowMarks(p.qitemId, fireKey);
1157
+ return targetDeliver(Object.keys(marks).length > 0 ? { ...decision, payload: { ...p, ...marks } } : decision);
891
1158
  }
892
1159
  // A post confirmed partly in Slack finishes without consulting quiet hours, so it is resolved before the decision
893
1160
  // (which reads them). Only a started multipart post is checked here, from the stores first, so an ordinary
894
1161
  // retry isn't scanned twice; any other attempted decision is resolved at the gate below.
895
- const started = "unfinished" in deliver && deliver.unfinished(decision);
1162
+ const started = !relay && "unfinished" in deliver && deliver.unfinished(decision);
896
1163
  if (started) {
897
1164
  const settled = await resolveEarlierAttempt(decision);
898
1165
  if (settled)
@@ -900,18 +1167,24 @@ export function buildSlackGatewayWire(opts) {
900
1167
  }
901
1168
  let ruled;
902
1169
  try {
903
- ruled = p.qitemId ? decideForPayload(p) : null;
1170
+ // Quiet hours that can't be read are decided past (see decideForPayload), so a re-shown ask goes through the
1171
+ // person's known settings like any other. What still throws here is the decision itself, which isn't permission.
1172
+ ruled = p.qitemId ? decideForPayload(p, { pastUnreadableQuiet: !relay }) : null;
904
1173
  }
905
1174
  catch (error) {
906
1175
  // An attempted decision (it may be partly or wholly in Slack) is retained and nothing posts: acking it would drop
907
1176
  // the post's missing parts and let the sweep offer the ask again under a new id, posting it from the start. Its
908
1177
  // replay decides again once the quiet state reads. A store check only: no Slack read on a failure path.
909
- if ("attempted" in deliver && deliver.attempted(decision)) {
1178
+ const wasAttempted = relay
1179
+ ? relayTransport.wasAttempted(decision)
1180
+ : "attempted" in deliver && deliver.attempted(decision);
1181
+ if (wasAttempted) {
910
1182
  log(`delivery decision for attempted ${decision.decisionId} couldn't be made; retained: ${error.message}`);
911
1183
  return { ok: false, class: "quiet-unreadable", detail: error.message };
912
1184
  }
913
1185
  // The decision couldn't be made (for example the person's quiet hours couldn't be read): post nothing and record
914
1186
  // nothing. Releasing the in-flight guard lets the outbound sweep offer this still-unseen ask again and decide afresh.
1187
+ // (A relay's unreadable quiet hours land here: it can't show the line that would let it post.)
915
1188
  log(`delivery decision for ${p.qitemId} deferred: ${error.message}`);
916
1189
  // A re-shown ask is seen, so no sweep offers it again: its row says it wasn't posted, and the person who ran
917
1190
  // `rig slack post-open-asks` runs it again once the state reads (same decision id).
@@ -922,7 +1195,7 @@ export function buildSlackGatewayWire(opts) {
922
1195
  releaseRef(p.notificationKey ?? p.qitemId);
923
1196
  return { ok: true };
924
1197
  }
925
- if (!started && ruled && (ruled.outcome === "log" || (ruled.outcome === "hold" && ruled.quietHold)
1198
+ if (!relay && !started && ruled && (ruled.outcome === "log" || (ruled.outcome === "hold" && ruled.quietHold)
926
1199
  || ruled.outcome === "digest" || ruled.deferMinutes !== undefined)) {
927
1200
  const settled = await resolveEarlierAttempt(decision);
928
1201
  if (settled)
@@ -979,19 +1252,27 @@ export function buildSlackGatewayWire(opts) {
979
1252
  }
980
1253
  catch (e) {
981
1254
  log(`deferral arm failed for ${p.qitemId}: ${e.message} — falling through to immediate notify-class delivery (fail-loud beats silent loss)`);
982
- return deliver(decision);
1255
+ return targetDeliver(decision);
983
1256
  }
984
1257
  outboundSeen.mark(episodeKey, "interrupt-deferred");
985
1258
  releaseRef(p.qitemId);
986
1259
  return { ok: true };
987
1260
  }
1261
+ if (ruled.quietUnreadable !== undefined) {
1262
+ // It posts now, unmentioned, and says the person's quiet hours couldn't be read; the row records that first, and
1263
+ // what became of the post is its own receipt. A replay decides again from a fresh read.
1264
+ log(`${decision.decisionId} posting: ${p.qitemId}'s recipient's quiet hours couldn't be read (${ruled.quietUnreadable})`);
1265
+ noteQuietUnreadable(opts.queueRepo, p.qitemId, episodeKey, ruled.quietUnreadable);
1266
+ return targetDeliver({ ...decision, payload: { ...p, quietUnreadable: true } });
1267
+ }
988
1268
  }
989
- return deliver(decision);
1269
+ return targetDeliver(decision);
990
1270
  };
991
1271
  const wire = buildInProcessWire({
992
1272
  home: opts.home,
993
- ops: outboundReady ? [OUTBOUND_OP] : [],
994
- deliver: outboundReady ? engineDeliver : deliver,
1273
+ ops: anyOutboundEnabled ? [OUTBOUND_OP] : [],
1274
+ ...(anyOutboundEnabled ? { prepare: prepareDecision } : {}),
1275
+ deliver: anyOutboundEnabled ? engineDeliver : deliver,
995
1276
  log,
996
1277
  });
997
1278
  selfDispatch = (decisionId, payload) => wire.dispatcher.dispatch(OUTBOUND_OP, String(payload.destinationSession ?? ""), payload, { decisionId });
@@ -1018,10 +1299,24 @@ export function buildSlackGatewayWire(opts) {
1018
1299
  fetchImpl: opts.fetchImpl,
1019
1300
  ...(relayed ? { relayed: true } : {}),
1020
1301
  });
1021
- if (outboundReady) {
1302
+ if (anyOutboundEnabled) {
1303
+ const driverQueue = outboundReady
1304
+ ? ports
1305
+ : {
1306
+ listHumanAlerts: async (filter) => {
1307
+ const alerts = await ports.listHumanAlerts(filter);
1308
+ try {
1309
+ const reg = registrySurface.loadHumanRegistry(opts.home);
1310
+ return alerts.filter((alert) => resolvePrimaryRelayBinding(alert.destinationSession, reg) !== null);
1311
+ }
1312
+ catch {
1313
+ return [];
1314
+ }
1315
+ },
1316
+ };
1022
1317
  const driver = new SlackOutboundDriver({
1023
1318
  home: opts.home,
1024
- queue: ports,
1319
+ queue: driverQueue,
1025
1320
  seen: outboundSeen,
1026
1321
  filter: { minimumLevel: cfg.minimumLevelThatPosts },
1027
1322
  dispatch: (op, ref, payload) => wire.dispatcher.dispatch(op, ref, payload),
@@ -1053,14 +1348,14 @@ export function buildSlackGatewayWire(opts) {
1053
1348
  queue: ports,
1054
1349
  seen: inboundSeen,
1055
1350
  deadLetter: dead,
1056
- destination: cfg.inboundDestination,
1351
+ destination: inbound.destination,
1057
1352
  reactions: cfg.reactions === "off" ? "off" : "route",
1058
1353
  resolveSender: makeInboundSenderResolver(registry, opts.home),
1059
1354
  // S10 — deterministic thread routing: mapped thread → exactly the mapped seat; unmapped
1060
1355
  // or human-initiated → the configured orchestrator slot as an unrouted-signal row.
1061
1356
  resolveRoute: makeThreadRouteResolver({
1062
1357
  map: threadMap,
1063
- unroutedDestination: cfg.inboundDestination,
1358
+ unroutedDestination: inbound.destination,
1064
1359
  // A person's top-level message in a channel the map routes: its `inbound` seat or its rig's representative.
1065
1360
  resolveChannelDestination: (channel) => resolveInboundChannelDestination(cfg, channel, (rig) => resolveRigRepresentative(opts.queueRepo.db, rig)),
1066
1361
  log,
@@ -1183,6 +1478,7 @@ export function buildSlackGatewayWire(opts) {
1183
1478
  return {
1184
1479
  dispatcher: wire.dispatcher,
1185
1480
  ...(acceptForwarded ? { acceptForwarded } : {}),
1481
+ releaseOutboundKey: (key) => releaseRef(key),
1186
1482
  startServices: () => {
1187
1483
  if (servicesLive)
1188
1484
  return; // idempotent — a double post-bind start must not double-poll