@openrig/cli 0.7.12 → 0.7.14

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 (635) hide show
  1. package/README.md +5 -5
  2. package/daemon/assets/plugins/openrig/.claude-plugin/icon.png +0 -0
  3. package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +2 -2
  4. package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +4 -2
  5. package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
  6. package/daemon/assets/plugins/openrig/plugin.json +2 -2
  7. package/daemon/assets/plugins/openrig/skills/working-with-an-openrig-team/SKILL.md +7 -0
  8. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +2 -2
  9. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +5 -3
  10. package/daemon/assets/plugins/openrig-core/README.md +6 -0
  11. package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +125 -0
  12. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +24 -1
  13. package/daemon/assets/skills/rigs/SKILL.md +11 -4
  14. package/daemon/context-packs/help/manifest.yaml +1 -1
  15. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  16. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +87 -22
  17. package/daemon/context-packs/reference/getting-started.md +30 -13
  18. package/daemon/context-packs/reference/manifest.yaml +1 -1
  19. package/daemon/context-packs/reference/rig-spec.md +18 -0
  20. package/daemon/context-packs/reference/tmux-servers.md +10 -1
  21. package/daemon/context-packs/reference/whats-new.md +302 -179
  22. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  23. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  24. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  25. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  26. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  27. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  28. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  29. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  30. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  31. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  33. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  34. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  35. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  36. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  37. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  38. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  40. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/core/watchdog/SKILL.md +5 -0
  43. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/core/working-with-an-openrig-team/SKILL.md +7 -0
  45. package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
  46. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  53. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  54. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  56. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  66. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  68. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  72. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  73. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  74. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  75. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  76. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  77. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  78. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  79. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  80. package/daemon/dist/adapters/claude-code-adapter.js +27 -4
  81. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  82. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +11 -2
  83. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  84. package/daemon/dist/adapters/codex-runtime-adapter.js +32 -9
  85. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  86. package/daemon/dist/adapters/pi-runner.d.ts +49 -1
  87. package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
  88. package/daemon/dist/adapters/pi-runner.js +343 -28
  89. package/daemon/dist/adapters/pi-runner.js.map +1 -1
  90. package/daemon/dist/adapters/tmux-exec.d.ts +4 -4
  91. package/daemon/dist/adapters/tmux-exec.d.ts.map +1 -1
  92. package/daemon/dist/adapters/tmux-exec.js +37 -8
  93. package/daemon/dist/adapters/tmux-exec.js.map +1 -1
  94. package/daemon/dist/adapters/tmux-server.d.ts +9 -1
  95. package/daemon/dist/adapters/tmux-server.d.ts.map +1 -1
  96. package/daemon/dist/adapters/tmux-server.js +36 -4
  97. package/daemon/dist/adapters/tmux-server.js.map +1 -1
  98. package/daemon/dist/adapters/tmux.d.ts +9 -0
  99. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  100. package/daemon/dist/adapters/tmux.js +23 -3
  101. package/daemon/dist/adapters/tmux.js.map +1 -1
  102. package/daemon/dist/attention-surface.d.ts +8 -0
  103. package/daemon/dist/attention-surface.d.ts.map +1 -1
  104. package/daemon/dist/attention-surface.js.map +1 -1
  105. package/daemon/dist/build-info.js +3 -3
  106. package/daemon/dist/connection-contract-surface.d.ts +2 -0
  107. package/daemon/dist/connection-contract-surface.d.ts.map +1 -0
  108. package/daemon/dist/connection-contract-surface.js +4 -0
  109. package/daemon/dist/connection-contract-surface.js.map +1 -0
  110. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  111. package/daemon/dist/db/all-migrations.js +12 -0
  112. package/daemon/dist/db/all-migrations.js.map +1 -1
  113. package/daemon/dist/db/migrations/160_network_bindings.d.ts +7 -0
  114. package/daemon/dist/db/migrations/160_network_bindings.d.ts.map +1 -0
  115. package/daemon/dist/db/migrations/160_network_bindings.js +26 -0
  116. package/daemon/dist/db/migrations/160_network_bindings.js.map +1 -0
  117. package/daemon/dist/db/migrations/161_network_receipts.d.ts +8 -0
  118. package/daemon/dist/db/migrations/161_network_receipts.d.ts.map +1 -0
  119. package/daemon/dist/db/migrations/161_network_receipts.js +25 -0
  120. package/daemon/dist/db/migrations/161_network_receipts.js.map +1 -0
  121. package/daemon/dist/db/migrations/162_session_address_read_indexes.d.ts +5 -0
  122. package/daemon/dist/db/migrations/162_session_address_read_indexes.d.ts.map +1 -0
  123. package/daemon/dist/db/migrations/162_session_address_read_indexes.js +12 -0
  124. package/daemon/dist/db/migrations/162_session_address_read_indexes.js.map +1 -0
  125. package/daemon/dist/db/migrations/163_network_installations.d.ts +7 -0
  126. package/daemon/dist/db/migrations/163_network_installations.d.ts.map +1 -0
  127. package/daemon/dist/db/migrations/163_network_installations.js +23 -0
  128. package/daemon/dist/db/migrations/163_network_installations.js.map +1 -0
  129. package/daemon/dist/db/migrations/164_queue_items_reply_to_index.d.ts +5 -0
  130. package/daemon/dist/db/migrations/164_queue_items_reply_to_index.d.ts.map +1 -0
  131. package/daemon/dist/db/migrations/164_queue_items_reply_to_index.js +9 -0
  132. package/daemon/dist/db/migrations/164_queue_items_reply_to_index.js.map +1 -0
  133. package/daemon/dist/db/migrations/166_queue_list_read_indexes.d.ts +4 -0
  134. package/daemon/dist/db/migrations/166_queue_list_read_indexes.d.ts.map +1 -0
  135. package/daemon/dist/db/migrations/166_queue_list_read_indexes.js +17 -0
  136. package/daemon/dist/db/migrations/166_queue_list_read_indexes.js.map +1 -0
  137. package/daemon/dist/domain/agent-activity-store.d.ts +8 -0
  138. package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
  139. package/daemon/dist/domain/agent-activity-store.js +14 -0
  140. package/daemon/dist/domain/agent-activity-store.js.map +1 -1
  141. package/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
  142. package/daemon/dist/domain/bootstrap-orchestrator.js +5 -0
  143. package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
  144. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +5 -0
  145. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  146. package/daemon/dist/domain/claude-compaction-enforcer.js +12 -3
  147. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  148. package/daemon/dist/domain/connection-contract.d.ts +111 -0
  149. package/daemon/dist/domain/connection-contract.d.ts.map +1 -0
  150. package/daemon/dist/domain/connection-contract.js +113 -0
  151. package/daemon/dist/domain/connection-contract.js.map +1 -0
  152. package/daemon/dist/domain/context-monitor.d.ts.map +1 -1
  153. package/daemon/dist/domain/context-monitor.js +8 -3
  154. package/daemon/dist/domain/context-monitor.js.map +1 -1
  155. package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
  156. package/daemon/dist/domain/draft-aware-delivery.js +2 -1
  157. package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
  158. package/daemon/dist/domain/execution-view.js +2 -2
  159. package/daemon/dist/domain/execution-view.js.map +1 -1
  160. package/daemon/dist/domain/hosts/pairing-ask.d.ts +8 -0
  161. package/daemon/dist/domain/hosts/pairing-ask.d.ts.map +1 -1
  162. package/daemon/dist/domain/hosts/pairing-ask.js +20 -0
  163. package/daemon/dist/domain/hosts/pairing-ask.js.map +1 -1
  164. package/daemon/dist/domain/input-read-diagnostic.d.ts +30 -0
  165. package/daemon/dist/domain/input-read-diagnostic.d.ts.map +1 -0
  166. package/daemon/dist/domain/input-read-diagnostic.js +32 -0
  167. package/daemon/dist/domain/input-read-diagnostic.js.map +1 -0
  168. package/daemon/dist/domain/install-engine.d.ts +5 -0
  169. package/daemon/dist/domain/install-engine.d.ts.map +1 -1
  170. package/daemon/dist/domain/install-engine.js +28 -26
  171. package/daemon/dist/domain/install-engine.js.map +1 -1
  172. package/daemon/dist/domain/install-verifier.d.ts +5 -1
  173. package/daemon/dist/domain/install-verifier.d.ts.map +1 -1
  174. package/daemon/dist/domain/install-verifier.js +12 -1
  175. package/daemon/dist/domain/install-verifier.js.map +1 -1
  176. package/daemon/dist/domain/managed-block-records.d.ts +9 -3
  177. package/daemon/dist/domain/managed-block-records.d.ts.map +1 -1
  178. package/daemon/dist/domain/managed-block-records.js +43 -8
  179. package/daemon/dist/domain/managed-block-records.js.map +1 -1
  180. package/daemon/dist/domain/managed-blocks.d.ts +40 -3
  181. package/daemon/dist/domain/managed-blocks.d.ts.map +1 -1
  182. package/daemon/dist/domain/managed-blocks.js +151 -39
  183. package/daemon/dist/domain/managed-blocks.js.map +1 -1
  184. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
  185. package/daemon/dist/domain/mission-control/mission-control-write-contract.js +3 -2
  186. package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
  187. package/daemon/dist/domain/native-model-picker.d.ts +8 -0
  188. package/daemon/dist/domain/native-model-picker.d.ts.map +1 -0
  189. package/daemon/dist/domain/native-model-picker.js +35 -0
  190. package/daemon/dist/domain/native-model-picker.js.map +1 -0
  191. package/daemon/dist/domain/native-process-lineage.d.ts +6 -0
  192. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
  193. package/daemon/dist/domain/native-process-lineage.js +34 -29
  194. package/daemon/dist/domain/native-process-lineage.js.map +1 -1
  195. package/daemon/dist/domain/native-resume-probe.d.ts +6 -0
  196. package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
  197. package/daemon/dist/domain/native-resume-probe.js +124 -2
  198. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  199. package/daemon/dist/domain/network/hub-client.d.ts +40 -0
  200. package/daemon/dist/domain/network/hub-client.d.ts.map +1 -0
  201. package/daemon/dist/domain/network/hub-client.js +102 -0
  202. package/daemon/dist/domain/network/hub-client.js.map +1 -0
  203. package/daemon/dist/domain/network/network-bindings.d.ts +104 -0
  204. package/daemon/dist/domain/network/network-bindings.d.ts.map +1 -0
  205. package/daemon/dist/domain/network/network-bindings.js +272 -0
  206. package/daemon/dist/domain/network/network-bindings.js.map +1 -0
  207. package/daemon/dist/domain/network/network-connector.d.ts +77 -0
  208. package/daemon/dist/domain/network/network-connector.d.ts.map +1 -0
  209. package/daemon/dist/domain/network/network-connector.js +380 -0
  210. package/daemon/dist/domain/network/network-connector.js.map +1 -0
  211. package/daemon/dist/domain/network/network-installations.d.ts +97 -0
  212. package/daemon/dist/domain/network/network-installations.d.ts.map +1 -0
  213. package/daemon/dist/domain/network/network-installations.js +371 -0
  214. package/daemon/dist/domain/network/network-installations.js.map +1 -0
  215. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  216. package/daemon/dist/domain/node-inventory.js +6 -5
  217. package/daemon/dist/domain/node-inventory.js.map +1 -1
  218. package/daemon/dist/domain/operation-correlation.d.ts +1 -1
  219. package/daemon/dist/domain/operation-correlation.d.ts.map +1 -1
  220. package/daemon/dist/domain/operation-correlation.js +1 -1
  221. package/daemon/dist/domain/operation-correlation.js.map +1 -1
  222. package/daemon/dist/domain/package-install-service.d.ts +1 -0
  223. package/daemon/dist/domain/package-install-service.d.ts.map +1 -1
  224. package/daemon/dist/domain/package-install-service.js +2 -1
  225. package/daemon/dist/domain/package-install-service.js.map +1 -1
  226. package/daemon/dist/domain/plugin-vendor-service.d.ts +9 -0
  227. package/daemon/dist/domain/plugin-vendor-service.d.ts.map +1 -1
  228. package/daemon/dist/domain/plugin-vendor-service.js +50 -8
  229. package/daemon/dist/domain/plugin-vendor-service.js.map +1 -1
  230. package/daemon/dist/domain/process-observation-pass.d.ts +20 -0
  231. package/daemon/dist/domain/process-observation-pass.d.ts.map +1 -0
  232. package/daemon/dist/domain/process-observation-pass.js +80 -0
  233. package/daemon/dist/domain/process-observation-pass.js.map +1 -0
  234. package/daemon/dist/domain/proof/judgments.d.ts +12 -13
  235. package/daemon/dist/domain/proof/judgments.d.ts.map +1 -1
  236. package/daemon/dist/domain/proof/judgments.js +14 -0
  237. package/daemon/dist/domain/proof/judgments.js.map +1 -1
  238. package/daemon/dist/domain/proof/source-watch.d.ts +1 -1
  239. package/daemon/dist/domain/proof/source-watch.d.ts.map +1 -1
  240. package/daemon/dist/domain/proof/source-watch.js +45 -22
  241. package/daemon/dist/domain/proof/source-watch.js.map +1 -1
  242. package/daemon/dist/domain/provider/claude-usage-reader.d.ts +3 -3
  243. package/daemon/dist/domain/provider/claude-usage-reader.d.ts.map +1 -1
  244. package/daemon/dist/domain/provider/claude-usage-reader.js +16 -5
  245. package/daemon/dist/domain/provider/claude-usage-reader.js.map +1 -1
  246. package/daemon/dist/domain/provider/codex-limit-banner.d.ts.map +1 -1
  247. package/daemon/dist/domain/provider/codex-limit-banner.js +2 -1
  248. package/daemon/dist/domain/provider/codex-limit-banner.js.map +1 -1
  249. package/daemon/dist/domain/provider/provider-signals.d.ts +6 -0
  250. package/daemon/dist/domain/provider/provider-signals.d.ts.map +1 -1
  251. package/daemon/dist/domain/provider/provider-signals.js +9 -3
  252. package/daemon/dist/domain/provider/provider-signals.js.map +1 -1
  253. package/daemon/dist/domain/provider/reactive-tap.d.ts.map +1 -1
  254. package/daemon/dist/domain/provider/reactive-tap.js +6 -0
  255. package/daemon/dist/domain/provider/reactive-tap.js.map +1 -1
  256. package/daemon/dist/domain/queue-erasure.d.ts +10 -6
  257. package/daemon/dist/domain/queue-erasure.d.ts.map +1 -1
  258. package/daemon/dist/domain/queue-erasure.js +31 -18
  259. package/daemon/dist/domain/queue-erasure.js.map +1 -1
  260. package/daemon/dist/domain/queue-recovery.d.ts +10 -1
  261. package/daemon/dist/domain/queue-recovery.d.ts.map +1 -1
  262. package/daemon/dist/domain/queue-recovery.js +25 -3
  263. package/daemon/dist/domain/queue-recovery.js.map +1 -1
  264. package/daemon/dist/domain/queue-repository.d.ts +39 -3
  265. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  266. package/daemon/dist/domain/queue-repository.js +132 -6
  267. package/daemon/dist/domain/queue-repository.js.map +1 -1
  268. package/daemon/dist/domain/queue-retention.d.ts +1 -1
  269. package/daemon/dist/domain/queue-retention.d.ts.map +1 -1
  270. package/daemon/dist/domain/queue-retention.js +1 -0
  271. package/daemon/dist/domain/queue-retention.js.map +1 -1
  272. package/daemon/dist/domain/queue-stuck-sweep.d.ts +5 -0
  273. package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
  274. package/daemon/dist/domain/queue-stuck-sweep.js +408 -68
  275. package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
  276. package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
  277. package/daemon/dist/domain/queue-wake-ladder.js +45 -27
  278. package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
  279. package/daemon/dist/domain/queue-wake-repository.d.ts +3 -0
  280. package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
  281. package/daemon/dist/domain/queue-wake-repository.js +6 -0
  282. package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
  283. package/daemon/dist/domain/receiver-context.d.ts +9 -0
  284. package/daemon/dist/domain/receiver-context.d.ts.map +1 -0
  285. package/daemon/dist/domain/receiver-context.js +25 -0
  286. package/daemon/dist/domain/receiver-context.js.map +1 -0
  287. package/daemon/dist/domain/reconciler.d.ts +15 -6
  288. package/daemon/dist/domain/reconciler.d.ts.map +1 -1
  289. package/daemon/dist/domain/reconciler.js +26 -26
  290. package/daemon/dist/domain/reconciler.js.map +1 -1
  291. package/daemon/dist/domain/restore-guidance.d.ts +9 -4
  292. package/daemon/dist/domain/restore-guidance.d.ts.map +1 -1
  293. package/daemon/dist/domain/restore-guidance.js +43 -27
  294. package/daemon/dist/domain/restore-guidance.js.map +1 -1
  295. package/daemon/dist/domain/restore-orchestrator.d.ts +6 -0
  296. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  297. package/daemon/dist/domain/restore-orchestrator.js +69 -5
  298. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  299. package/daemon/dist/domain/restore-preconditions.d.ts.map +1 -1
  300. package/daemon/dist/domain/restore-preconditions.js +2 -1
  301. package/daemon/dist/domain/restore-preconditions.js.map +1 -1
  302. package/daemon/dist/domain/rigspec-instantiator.d.ts +1 -0
  303. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  304. package/daemon/dist/domain/rigspec-instantiator.js +1 -1
  305. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  306. package/daemon/dist/domain/rosters.d.ts +12 -0
  307. package/daemon/dist/domain/rosters.d.ts.map +1 -1
  308. package/daemon/dist/domain/rosters.js +24 -1
  309. package/daemon/dist/domain/rosters.js.map +1 -1
  310. package/daemon/dist/domain/runner-permissions.d.ts.map +1 -1
  311. package/daemon/dist/domain/runner-permissions.js +9 -2
  312. package/daemon/dist/domain/runner-permissions.js.map +1 -1
  313. package/daemon/dist/domain/runtime-adapter.d.ts +9 -0
  314. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  315. package/daemon/dist/domain/runtime-adapter.js +2 -0
  316. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  317. package/daemon/dist/domain/seat-delivery-guard.d.ts +3 -1
  318. package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
  319. package/daemon/dist/domain/seat-delivery-guard.js +8 -5
  320. package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
  321. package/daemon/dist/domain/seat-handover-service.d.ts +9 -1
  322. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  323. package/daemon/dist/domain/seat-handover-service.js +75 -9
  324. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  325. package/daemon/dist/domain/seat-identity-reconciler.d.ts +4 -0
  326. package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
  327. package/daemon/dist/domain/seat-identity-reconciler.js +18 -2
  328. package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
  329. package/daemon/dist/domain/seat-lifecycle-service.d.ts +13 -8
  330. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  331. package/daemon/dist/domain/seat-lifecycle-service.js +46 -26
  332. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  333. package/daemon/dist/domain/seat-structural-activity-service.d.ts.map +1 -1
  334. package/daemon/dist/domain/seat-structural-activity-service.js +7 -4
  335. package/daemon/dist/domain/seat-structural-activity-service.js.map +1 -1
  336. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  337. package/daemon/dist/domain/session-registry.js +16 -5
  338. package/daemon/dist/domain/session-registry.js.map +1 -1
  339. package/daemon/dist/domain/session-transport.d.ts +4 -0
  340. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  341. package/daemon/dist/domain/session-transport.js +44 -10
  342. package/daemon/dist/domain/session-transport.js.map +1 -1
  343. package/daemon/dist/domain/slices/slice-indexer.d.ts +5 -2
  344. package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -1
  345. package/daemon/dist/domain/slices/slice-indexer.js +60 -16
  346. package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
  347. package/daemon/dist/domain/slow-op-recorder.d.ts +0 -3
  348. package/daemon/dist/domain/slow-op-recorder.d.ts.map +1 -1
  349. package/daemon/dist/domain/slow-op-recorder.js +5 -34
  350. package/daemon/dist/domain/slow-op-recorder.js.map +1 -1
  351. package/daemon/dist/domain/spec-library-workflow-scanner.d.ts +2 -0
  352. package/daemon/dist/domain/spec-library-workflow-scanner.d.ts.map +1 -1
  353. package/daemon/dist/domain/spec-library-workflow-scanner.js +22 -13
  354. package/daemon/dist/domain/spec-library-workflow-scanner.js.map +1 -1
  355. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  356. package/daemon/dist/domain/startup-orchestrator.js +8 -3
  357. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  358. package/daemon/dist/domain/successor-session-launcher.d.ts +5 -0
  359. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  360. package/daemon/dist/domain/successor-session-launcher.js +11 -6
  361. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  362. package/daemon/dist/domain/team-operations.d.ts +20 -0
  363. package/daemon/dist/domain/team-operations.d.ts.map +1 -0
  364. package/daemon/dist/domain/team-operations.js +23 -0
  365. package/daemon/dist/domain/team-operations.js.map +1 -0
  366. package/daemon/dist/domain/terminal/herdr-adapter.d.ts +12 -2
  367. package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
  368. package/daemon/dist/domain/terminal/herdr-adapter.js +52 -2
  369. package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
  370. package/daemon/dist/domain/terminal/herdr-live-workspace.d.ts +42 -0
  371. package/daemon/dist/domain/terminal/herdr-live-workspace.d.ts.map +1 -0
  372. package/daemon/dist/domain/terminal/herdr-live-workspace.js +118 -0
  373. package/daemon/dist/domain/terminal/herdr-live-workspace.js.map +1 -0
  374. package/daemon/dist/domain/terminal/herdr-sessions.d.ts.map +1 -1
  375. package/daemon/dist/domain/terminal/herdr-sessions.js +3 -0
  376. package/daemon/dist/domain/terminal/herdr-sessions.js.map +1 -1
  377. package/daemon/dist/domain/terminal/rex-adapter.d.ts +3 -0
  378. package/daemon/dist/domain/terminal/rex-adapter.d.ts.map +1 -1
  379. package/daemon/dist/domain/terminal/rex-adapter.js +10 -1
  380. package/daemon/dist/domain/terminal/rex-adapter.js.map +1 -1
  381. package/daemon/dist/domain/terminal/rex-agent-status.d.ts +76 -0
  382. package/daemon/dist/domain/terminal/rex-agent-status.d.ts.map +1 -0
  383. package/daemon/dist/domain/terminal/rex-agent-status.js +168 -0
  384. package/daemon/dist/domain/terminal/rex-agent-status.js.map +1 -0
  385. package/daemon/dist/domain/terminal/terminal-provider.d.ts +12 -1
  386. package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
  387. package/daemon/dist/domain/terminal/terminal-service.d.ts +2 -0
  388. package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
  389. package/daemon/dist/domain/terminal/terminal-service.js +3 -2
  390. package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
  391. package/daemon/dist/domain/tmux-option-defaults.d.ts +4 -4
  392. package/daemon/dist/domain/tmux-option-defaults.d.ts.map +1 -1
  393. package/daemon/dist/domain/tmux-option-defaults.js +25 -12
  394. package/daemon/dist/domain/tmux-option-defaults.js.map +1 -1
  395. package/daemon/dist/domain/types.d.ts +12 -0
  396. package/daemon/dist/domain/types.d.ts.map +1 -1
  397. package/daemon/dist/domain/types.js.map +1 -1
  398. package/daemon/dist/domain/user-settings/settings-browser.d.ts +8 -2
  399. package/daemon/dist/domain/user-settings/settings-browser.d.ts.map +1 -1
  400. package/daemon/dist/domain/user-settings/settings-browser.js +5 -2
  401. package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
  402. package/daemon/dist/domain/user-settings/settings-store.d.ts +15 -1
  403. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  404. package/daemon/dist/domain/user-settings/settings-store.js +108 -44
  405. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  406. package/daemon/dist/domain/watchdog-delivery-receipts.d.ts.map +1 -1
  407. package/daemon/dist/domain/watchdog-delivery-receipts.js +8 -3
  408. package/daemon/dist/domain/watchdog-delivery-receipts.js.map +1 -1
  409. package/daemon/dist/domain/workflow-exception-escalation.d.ts.map +1 -1
  410. package/daemon/dist/domain/workflow-exception-escalation.js +4 -2
  411. package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -1
  412. package/daemon/dist/domain/workflow-spec-cache.d.ts +8 -0
  413. package/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
  414. package/daemon/dist/domain/workflow-spec-cache.js +34 -10
  415. package/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
  416. package/daemon/dist/domain/workflow-validator.d.ts.map +1 -1
  417. package/daemon/dist/domain/workflow-validator.js +16 -0
  418. package/daemon/dist/domain/workflow-validator.js.map +1 -1
  419. package/daemon/dist/herdr-live-workspace-surface.d.ts +2 -0
  420. package/daemon/dist/herdr-live-workspace-surface.d.ts.map +1 -0
  421. package/daemon/dist/herdr-live-workspace-surface.js +2 -0
  422. package/daemon/dist/herdr-live-workspace-surface.js.map +1 -0
  423. package/daemon/dist/index.d.ts.map +1 -1
  424. package/daemon/dist/index.js +3 -0
  425. package/daemon/dist/index.js.map +1 -1
  426. package/daemon/dist/routes/activity.d.ts.map +1 -1
  427. package/daemon/dist/routes/activity.js +12 -0
  428. package/daemon/dist/routes/activity.js.map +1 -1
  429. package/daemon/dist/routes/attention.d.ts.map +1 -1
  430. package/daemon/dist/routes/attention.js +5 -1
  431. package/daemon/dist/routes/attention.js.map +1 -1
  432. package/daemon/dist/routes/hosts.d.ts.map +1 -1
  433. package/daemon/dist/routes/hosts.js +30 -46
  434. package/daemon/dist/routes/hosts.js.map +1 -1
  435. package/daemon/dist/routes/network.d.ts +13 -0
  436. package/daemon/dist/routes/network.d.ts.map +1 -0
  437. package/daemon/dist/routes/network.js +93 -0
  438. package/daemon/dist/routes/network.js.map +1 -0
  439. package/daemon/dist/routes/packages.js +3 -1
  440. package/daemon/dist/routes/packages.js.map +1 -1
  441. package/daemon/dist/routes/proof.d.ts.map +1 -1
  442. package/daemon/dist/routes/proof.js +6 -4
  443. package/daemon/dist/routes/proof.js.map +1 -1
  444. package/daemon/dist/routes/queue.d.ts.map +1 -1
  445. package/daemon/dist/routes/queue.js +13 -0
  446. package/daemon/dist/routes/queue.js.map +1 -1
  447. package/daemon/dist/routes/rigspec.js +13 -4
  448. package/daemon/dist/routes/rigspec.js.map +1 -1
  449. package/daemon/dist/routes/sessions.d.ts.map +1 -1
  450. package/daemon/dist/routes/sessions.js +24 -5
  451. package/daemon/dist/routes/sessions.js.map +1 -1
  452. package/daemon/dist/routes/slices.d.ts +1 -0
  453. package/daemon/dist/routes/slices.d.ts.map +1 -1
  454. package/daemon/dist/routes/slices.js +66 -16
  455. package/daemon/dist/routes/slices.js.map +1 -1
  456. package/daemon/dist/routes/spec-library.d.ts.map +1 -1
  457. package/daemon/dist/routes/spec-library.js +7 -3
  458. package/daemon/dist/routes/spec-library.js.map +1 -1
  459. package/daemon/dist/routes/terminal.js +1 -1
  460. package/daemon/dist/routes/terminal.js.map +1 -1
  461. package/daemon/dist/server.d.ts +3 -0
  462. package/daemon/dist/server.d.ts.map +1 -1
  463. package/daemon/dist/server.js +7 -0
  464. package/daemon/dist/server.js.map +1 -1
  465. package/daemon/dist/startup.d.ts.map +1 -1
  466. package/daemon/dist/startup.js +35 -31
  467. package/daemon/dist/startup.js.map +1 -1
  468. package/daemon/dist/tmux-server-start-surface.d.ts +2 -0
  469. package/daemon/dist/tmux-server-start-surface.d.ts.map +1 -0
  470. package/daemon/dist/tmux-server-start-surface.js +2 -0
  471. package/daemon/dist/tmux-server-start-surface.js.map +1 -0
  472. package/daemon/dist/tmux-server-start.d.ts +13 -0
  473. package/daemon/dist/tmux-server-start.d.ts.map +1 -0
  474. package/daemon/dist/tmux-server-start.js +36 -0
  475. package/daemon/dist/tmux-server-start.js.map +1 -0
  476. package/daemon/docs/reference/agent-startup-guide.md +52 -17
  477. package/daemon/docs/reference/agent-state-taxonomy.md +2 -1
  478. package/daemon/docs/reference/claude-status-line.md +25 -9
  479. package/daemon/docs/reference/daemon-http-clients.md +42 -0
  480. package/daemon/docs/reference/getting-started.md +30 -13
  481. package/daemon/docs/reference/herdr-app.md +3 -2
  482. package/daemon/docs/reference/hosted-members.md +60 -4
  483. package/daemon/docs/reference/keeping-a-watch.md +28 -0
  484. package/daemon/docs/reference/network-connector.md +185 -0
  485. package/daemon/docs/reference/operation-correlation.md +18 -2
  486. package/daemon/docs/reference/queue-erasure.md +7 -5
  487. package/daemon/docs/reference/quickstart.md +4 -4
  488. package/daemon/docs/reference/rig-spec.md +18 -0
  489. package/daemon/docs/reference/rosters.md +5 -0
  490. package/daemon/docs/reference/seat-delivery.md +16 -1
  491. package/daemon/docs/reference/terminal-sessions.md +12 -0
  492. package/daemon/docs/reference/tmux-servers.md +10 -1
  493. package/daemon/docs/reference/whats-new.md +302 -179
  494. package/daemon/specs/agents/shared/skills/core/watchdog/SKILL.md +5 -0
  495. package/daemon/specs/agents/shared/skills/core/working-with-an-openrig-team/SKILL.md +7 -0
  496. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +66 -24
  497. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/startup/context.md +11 -3
  498. package/dist/build-info.js +3 -3
  499. package/dist/commands/broadcast.js +7 -3
  500. package/dist/commands/broadcast.js.map +1 -1
  501. package/dist/commands/chatroom.d.ts.map +1 -1
  502. package/dist/commands/chatroom.js +8 -3
  503. package/dist/commands/chatroom.js.map +1 -1
  504. package/dist/commands/config.d.ts.map +1 -1
  505. package/dist/commands/config.js +50 -10
  506. package/dist/commands/config.js.map +1 -1
  507. package/dist/commands/daemon.d.ts +4 -2
  508. package/dist/commands/daemon.d.ts.map +1 -1
  509. package/dist/commands/daemon.js +28 -4
  510. package/dist/commands/daemon.js.map +1 -1
  511. package/dist/commands/doctor.js +1 -1
  512. package/dist/commands/doctor.js.map +1 -1
  513. package/dist/commands/down.d.ts.map +1 -1
  514. package/dist/commands/down.js +2 -1
  515. package/dist/commands/down.js.map +1 -1
  516. package/dist/commands/gateway.d.ts.map +1 -1
  517. package/dist/commands/gateway.js +5 -0
  518. package/dist/commands/gateway.js.map +1 -1
  519. package/dist/commands/host.d.ts +4 -10
  520. package/dist/commands/host.d.ts.map +1 -1
  521. package/dist/commands/host.js +9 -36
  522. package/dist/commands/host.js.map +1 -1
  523. package/dist/commands/import.d.ts.map +1 -1
  524. package/dist/commands/import.js +96 -3
  525. package/dist/commands/import.js.map +1 -1
  526. package/dist/commands/network.d.ts +12 -0
  527. package/dist/commands/network.d.ts.map +1 -0
  528. package/dist/commands/network.js +150 -0
  529. package/dist/commands/network.js.map +1 -0
  530. package/dist/commands/package.d.ts.map +1 -1
  531. package/dist/commands/package.js +5 -0
  532. package/dist/commands/package.js.map +1 -1
  533. package/dist/commands/ps.d.ts.map +1 -1
  534. package/dist/commands/ps.js +44 -0
  535. package/dist/commands/ps.js.map +1 -1
  536. package/dist/commands/queue.d.ts.map +1 -1
  537. package/dist/commands/queue.js +68 -3
  538. package/dist/commands/queue.js.map +1 -1
  539. package/dist/commands/roster.d.ts +15 -0
  540. package/dist/commands/roster.d.ts.map +1 -1
  541. package/dist/commands/roster.js +38 -2
  542. package/dist/commands/roster.js.map +1 -1
  543. package/dist/commands/seat.d.ts.map +1 -1
  544. package/dist/commands/seat.js +6 -5
  545. package/dist/commands/seat.js.map +1 -1
  546. package/dist/commands/send.d.ts +4 -0
  547. package/dist/commands/send.d.ts.map +1 -1
  548. package/dist/commands/send.js +6 -1
  549. package/dist/commands/send.js.map +1 -1
  550. package/dist/commands/setup.js +1 -1
  551. package/dist/commands/setup.js.map +1 -1
  552. package/dist/commands/terminal.d.ts.map +1 -1
  553. package/dist/commands/terminal.js +9 -7
  554. package/dist/commands/terminal.js.map +1 -1
  555. package/dist/commands/watchdog.d.ts.map +1 -1
  556. package/dist/commands/watchdog.js +22 -2
  557. package/dist/commands/watchdog.js.map +1 -1
  558. package/dist/config-store.d.ts +14 -1
  559. package/dist/config-store.d.ts.map +1 -1
  560. package/dist/config-store.js +34 -5
  561. package/dist/config-store.js.map +1 -1
  562. package/dist/cross-host-executor.d.ts.map +1 -1
  563. package/dist/cross-host-executor.js +6 -1
  564. package/dist/cross-host-executor.js.map +1 -1
  565. package/dist/daemon-lifecycle.d.ts +11 -0
  566. package/dist/daemon-lifecycle.d.ts.map +1 -1
  567. package/dist/daemon-lifecycle.js +61 -9
  568. package/dist/daemon-lifecycle.js.map +1 -1
  569. package/dist/daemon-reachability.js +1 -1
  570. package/dist/daemon-reachability.js.map +1 -1
  571. package/dist/index.d.ts +2 -0
  572. package/dist/index.d.ts.map +1 -1
  573. package/dist/index.js +2 -0
  574. package/dist/index.js.map +1 -1
  575. package/dist/lazy-program.d.ts.map +1 -1
  576. package/dist/lazy-program.js +1 -0
  577. package/dist/lazy-program.js.map +1 -1
  578. package/dist/lib/check-in.d.ts +7 -0
  579. package/dist/lib/check-in.d.ts.map +1 -0
  580. package/dist/lib/check-in.js +13 -0
  581. package/dist/lib/check-in.js.map +1 -0
  582. package/dist/mcp-http.d.ts.map +1 -1
  583. package/dist/mcp-http.js +25 -2
  584. package/dist/mcp-http.js.map +1 -1
  585. package/dist/mcp-server.d.ts +12 -1
  586. package/dist/mcp-server.d.ts.map +1 -1
  587. package/dist/mcp-server.js +185 -57
  588. package/dist/mcp-server.js.map +1 -1
  589. package/dist/person-registration-offer.d.ts +10 -0
  590. package/dist/person-registration-offer.d.ts.map +1 -0
  591. package/dist/person-registration-offer.js +25 -0
  592. package/dist/person-registration-offer.js.map +1 -0
  593. package/dist/terminal-window.d.ts.map +1 -1
  594. package/dist/terminal-window.js +20 -102
  595. package/dist/terminal-window.js.map +1 -1
  596. package/dist/tmux-attachment.d.ts.map +1 -1
  597. package/dist/tmux-attachment.js +3 -1
  598. package/dist/tmux-attachment.js.map +1 -1
  599. package/package.json +1 -1
  600. package/tui/dist/attention/attention-model.d.ts.map +1 -1
  601. package/tui/dist/attention/attention-model.js +10 -5
  602. package/tui/dist/attention/attention-model.js.map +1 -1
  603. package/tui/dist/config/pairing.d.ts.map +1 -1
  604. package/tui/dist/config/pairing.js +8 -3
  605. package/tui/dist/config/pairing.js.map +1 -1
  606. package/tui/dist/connected-assistants.d.ts +20 -0
  607. package/tui/dist/connected-assistants.d.ts.map +1 -0
  608. package/tui/dist/connected-assistants.js +51 -0
  609. package/tui/dist/connected-assistants.js.map +1 -0
  610. package/tui/dist/daemon-client.d.ts +8 -0
  611. package/tui/dist/daemon-client.d.ts.map +1 -1
  612. package/tui/dist/daemon-client.js +8 -0
  613. package/tui/dist/daemon-client.js.map +1 -1
  614. package/tui/dist/hydrate.d.ts.map +1 -1
  615. package/tui/dist/hydrate.js +19 -4
  616. package/tui/dist/hydrate.js.map +1 -1
  617. package/tui/dist/navigator.js +1 -1
  618. package/tui/dist/navigator.js.map +1 -1
  619. package/tui/dist/render.d.ts.map +1 -1
  620. package/tui/dist/render.js +48 -29
  621. package/tui/dist/render.js.map +1 -1
  622. package/tui/dist/state.js +2 -2
  623. package/tui/dist/state.js.map +1 -1
  624. package/tui/dist/stylize.d.ts.map +1 -1
  625. package/tui/dist/stylize.js +4 -0
  626. package/tui/dist/stylize.js.map +1 -1
  627. package/tui/dist/topology/glyphs.d.ts.map +1 -1
  628. package/tui/dist/topology/glyphs.js +4 -0
  629. package/tui/dist/topology/glyphs.js.map +1 -1
  630. package/tui/dist/topology/host-label.d.ts +2 -0
  631. package/tui/dist/topology/host-label.d.ts.map +1 -1
  632. package/tui/dist/topology/host-label.js +7 -1
  633. package/tui/dist/topology/host-label.js.map +1 -1
  634. package/tui/dist/types.d.ts +13 -1
  635. package/tui/dist/types.d.ts.map +1 -1
@@ -34,7 +34,8 @@ import { parseReplyToChoice, parseReplyToThreadMissing, formatReplyToChoice, des
34
34
  import { classifyDestination } from "./gateway/destination-resolver.js";
35
35
  import { join } from "node:path";
36
36
  import { SettingsStore } from "./user-settings/settings-store.js";
37
- import { hostedWakeFor, isHostedMemberAt } from "./rosters.js";
37
+ import { hostedMembersAt, hostedWakeFor, isHostedMemberAt } from "./rosters.js";
38
+ import { memberCheckInStatus } from "./connection-contract.js";
38
39
  import { hostedRingMayHaveArrived, ringHostedWake } from "./hosted-wake.js";
39
40
  import { effectiveGateRoles } from "./gate-predicate.js";
40
41
  import { computeClosureRequiredAt, validateClosure, } from "./hot-potato-enforcer.js";
@@ -44,6 +45,7 @@ import { WatchdogJobsRepository } from "./watchdog-jobs-repository.js";
44
45
  import { armQueueWait, backOffQueueWait, refreshQueueWaits, evaluateQueueWait, retargetQueueWait, isQueueWait } from "./queue-wait-backoff.js";
45
46
  import { parseHumanQuestions, unansweredQuestions, describeTypedReplyPlacement, formatHumanAnswers, humanAnswerText } from "./human-questions.js";
46
47
  import { slackMicros } from "./gateway/slack/state-store.js";
48
+ import { askBackRoute, RUNNER_CLOSE_WAITS, terminalAnswerMeaning } from "./receiver-context.js";
47
49
  /** A direct ask's answer row ID: from the ask, or from the ask and the park episode its answer belongs to. */
48
50
  function humanAnswerId(askId, episodeKey) {
49
51
  return `qitem-human-answer-${createHash("sha256").update(episodeKey ? `${askId}\n${episodeKey}` : askId).digest("hex").slice(0, 20)}`;
@@ -158,6 +160,19 @@ export const QUEUE_PRIORITIES = ["routine", "urgent", "critical"];
158
160
  function sideEffectProvenance(provenance) {
159
161
  return provenance === "principal:v1" ? "transport:v1" : provenance ?? null;
160
162
  }
163
+ /** Adds the exact, conjunctive tag predicates shared by the bounded list paths. */
164
+ function pushExactTagFilters(tag, conditions, params) {
165
+ if (tag === undefined)
166
+ return;
167
+ const values = [...new Set(Array.isArray(tag) ? tag : [tag])];
168
+ if (values.some((value) => value.trim().length === 0)) {
169
+ throw new TypeError("tag filters cannot be blank");
170
+ }
171
+ for (const value of values) {
172
+ conditions.push("EXISTS (SELECT 1 FROM json_each(queue_items.tags) WHERE value = ?)");
173
+ params.push(value);
174
+ }
175
+ }
161
176
  /** Adds the handoff-successor and updated-since filters both list paths share. */
162
177
  function pushFollowThroughFilters(opts, conditions, params) {
163
178
  if (opts?.handedOffFrom) {
@@ -195,6 +210,16 @@ function defaultIsHostedMember(destination) {
195
210
  return false;
196
211
  }
197
212
  }
213
+ /** The hosted members the authored rosters list on this host. Empty when the rosters or this host's id can't be read. */
214
+ function defaultHostedMembers() {
215
+ try {
216
+ const root = new SettingsStore().resolveOne("workspace.root").value;
217
+ return typeof root === "string" && root ? hostedMembersAt(join(root, "rosters"), getSelfHostId()) : [];
218
+ }
219
+ catch {
220
+ return [];
221
+ }
222
+ }
198
223
  /** A session's check-in is written at most this often; the stuck sweep reads it in units of its unclaimed age. */
199
224
  const INBOX_CHECKIN_WRITE_INTERVAL_MS = 60_000;
200
225
  export class QueueRepositoryError extends Error {
@@ -569,6 +594,7 @@ export class QueueRepository {
569
594
  hostedWakeFn;
570
595
  /** Whether the rosters list an address as a hosted member, trigger or not. */
571
596
  hostedMemberFn;
597
+ hostedMembersFn;
572
598
  permissionDecider;
573
599
  hostedWakeFetch;
574
600
  /** When this process last wrote each session's inbox check-in, so a seat that polls often writes at most once a minute. */
@@ -595,6 +621,7 @@ export class QueueRepository {
595
621
  this.sharedChannelsFn = opts?.sharedChannels ?? (() => sharedChannelAddresses());
596
622
  this.hostedWakeFn = opts?.hostedWake ?? defaultHostedWake;
597
623
  this.hostedMemberFn = opts?.isHostedMember ?? defaultIsHostedMember;
624
+ this.hostedMembersFn = opts?.hostedMembers ?? defaultHostedMembers;
598
625
  this.permissionDecider = opts?.permissionDecider;
599
626
  this.hostedWakeFetch = opts?.hostedWakeFetch;
600
627
  this.hasTargetRepoColumn = detectQueueColumn(db, "target_repo");
@@ -1577,6 +1604,52 @@ export class QueueRepository {
1577
1604
  ORDER BY ts_created, rowid`).all(qitemId, actorSession, ask.sourceSession)
1578
1605
  .map((row) => ({ qitemId: row.qitem_id, body: row.body ?? "" }));
1579
1606
  }
1607
+ /** Every answer returned to this ask, oldest first, under getHumanAnswer's rule for whoever answered: an ask to a person
1608
+ * (never an update), a row back to the asker linked by reply_to, from someone who may answer it (never a shared
1609
+ * channel). An answer row carries the human-answer tag; the unnamed primary user's own is one. An untagged Slack reply
1610
+ * (from before that tag) counts only when it came before the ask's first tagged answer (in this read's order) and no
1611
+ * later than the ask's first close, even if it was reopened since, and only each person's first: after an answer or a
1612
+ * close, a reply on the thread is correspondence. Each gives who, when,
1613
+ * their words without the footer, the park it answered (null for the ask itself or an older Slack reply), and the
1614
+ * identity recorded when the answer row was created. An ask answered in place (a runner's permission request, a host
1615
+ * pairing request) has no answer row: its answer is on the ask. */
1616
+ answersForAsk(askId) {
1617
+ const ask = this.getById(askId);
1618
+ if (!this.hasReplyToColumn || !ask || ask.humanIntent === "update" || !this.isPersonAddress(ask.destinationSession))
1619
+ return [];
1620
+ const candidates = this.db.prepare(`SELECT qitem_id, source_session, ts_created,
1621
+ EXISTS (SELECT 1 FROM json_each(queue_items.tags) WHERE value = 'human-answer') AS tagged
1622
+ FROM queue_items
1623
+ WHERE reply_to = ? AND destination_session = ?
1624
+ AND (EXISTS (SELECT 1 FROM json_each(queue_items.tags) WHERE value = 'human-answer')
1625
+ OR (qitem_id LIKE 'qitem-slack-inbound-%' AND COALESCE(summary, '') NOT LIKE '[Recovered after gap] %'))
1626
+ ORDER BY ts_created, rowid`).all(askId, ask.sourceSession)
1627
+ .filter((row) => !this.isSharedChannel(row.source_session)
1628
+ && (this.answersAsk(ask, row.source_session) || (row.tagged === 1 && row.source_session === UNATTRIBUTED_ACTOR)));
1629
+ const firstTagged = candidates.findIndex((row) => row.tagged === 1);
1630
+ const history = this.transitionLog.listForQitem(askId);
1631
+ // The ask's first close, whatever its state now: a reopen doesn't make later thread replies its answers.
1632
+ const firstClose = history.find((transition) => !isBlockerLive(transition.state))?.ts;
1633
+ const legacyFirst = new Set();
1634
+ const rows = candidates.filter((row, index) => row.tagged === 1 || ((firstTagged < 0 || index < firstTagged)
1635
+ && (!firstClose || row.ts_created <= firstClose) && !legacyFirst.has(row.source_session) && !!legacyFirst.add(row.source_session)));
1636
+ if (rows.length === 0)
1637
+ return [];
1638
+ // An answer to a park's question has the ID made from that park's episode, so the episode is read back from the ID.
1639
+ const episodes = new Map(history
1640
+ .filter((transition) => transition.ownerNotificationKind === "human-required")
1641
+ .map((transition) => `${askId}:${transition.transitionId}`)
1642
+ .map((key) => [humanAnswerId(askId, key), key]));
1643
+ return rows.flatMap(({ qitem_id }) => {
1644
+ const row = this.getById(qitem_id);
1645
+ if (!row)
1646
+ return [];
1647
+ const created = this.transitionLog.listForQitem(qitem_id)[0];
1648
+ return [{ qitemId: row.qitemId, by: row.sourceSession, at: row.tsCreated, text: humanAnswerText(row.body),
1649
+ episode: episodes.get(row.qitemId) ?? null,
1650
+ recordedIdentity: created ? { provenance: created.identityProvenance, principal: created.identityPrincipal } : null }];
1651
+ });
1652
+ }
1580
1653
  /** This person's answer to the current question of a decision parked on them, if one was returned. */
1581
1654
  currentEpisodeAnswer(qitemId, actorSession) {
1582
1655
  const episode = this.currentHumanRequiredEpisode(qitemId);
@@ -1875,6 +1948,14 @@ export class QueueRepository {
1875
1948
  const registry = this.loadHumanRegistryFn();
1876
1949
  return registry.ok && resolveRegisteredHumanAddress(destination, registry.entities) !== null;
1877
1950
  }
1951
+ /** The registered person an address names, so an ask back reaches them; null for anyone else, the unattributed
1952
+ * terminal actor included (it's a person address, but nothing is delivered there). */
1953
+ reachablePerson(address) {
1954
+ if (!address || address === UNATTRIBUTED_ACTOR)
1955
+ return null;
1956
+ const registry = this.loadHumanRegistryFn();
1957
+ return registry.ok ? resolveRegisteredHumanAddress(address, registry.entities) : null;
1958
+ }
1878
1959
  /** Who may answer an ask: the asked person, and any other registered person in this workspace, who's recorded as
1879
1960
  * themselves with the asked person kept (one trusted workspace, equal authority). A shared channel never answers. */
1880
1961
  answersAsk(item, actorSession) {
@@ -3365,6 +3446,9 @@ export class QueueRepository {
3365
3446
  : answer && typeof answer === "object" && "text" in answer ? `wrote "${String(answer.text).trim()}"`
3366
3447
  : "answered without a choice or words";
3367
3448
  const person = input.actorSession;
3449
+ // Who to ask back: the person who answered when OpenRig can name them, else the person the request went to.
3450
+ const unattributed = person === UNATTRIBUTED_ACTOR;
3451
+ const askBack = (unattributed ? null : this.reachablePerson(person)) ?? this.reachablePerson(item.destinationSession);
3368
3452
  // A handoff that fails after persisting its events rolls them back with its savepoint: discardOnThrow takes their
3369
3453
  // tokens out of the caller's notify envelope too, so the kept answer below still commits.
3370
3454
  try {
@@ -3381,8 +3465,12 @@ export class QueueRepository {
3381
3465
  "",
3382
3466
  `Their whole answer is recorded on the request: rig queue show ${answered.qitemId} --full.`,
3383
3467
  `Decide with: rig seat decide-permission ${item.qitemId} --option <id> --reason "<why>"`,
3384
- "Act on a clear answer at once: a clear yes or an allow click is the allow option, a clear no or a reject click the reject option. Don't ask them to confirm a clear answer. If their words are unclear or conditional, ask them back, naming this request, then decide.",
3468
+ `- **Who's who:** ${root.sourceSession} is the agent asking to run the tool; ${item.destinationSession} is the person it asked; ${person} answered.`,
3469
+ ...(unattributed ? [terminalAnswerMeaning(UNATTRIBUTED_ACTOR)] : []),
3470
+ "Act on a clear answer at once: a clear yes or an allow click is the allow option, a clear no or a reject click the reject option. Don't ask them to confirm a clear answer.",
3471
+ `${askBackRoute(askBack, UNATTRIBUTED_ACTOR, `request ${item.qitemId}`)} Then decide on what they answer.`,
3385
3472
  "Until it's decided (by you, or by anyone with that command), the runner keeps waiting, with no timeout that refuses it; if its turn ends first, nothing is sent.",
3473
+ RUNNER_CLOSE_WAITS,
3386
3474
  ].join("\n"),
3387
3475
  }));
3388
3476
  }
@@ -3395,7 +3483,9 @@ export class QueueRepository {
3395
3483
  // The person learns who decides and in what recorded state, so a delay is shown: one update per request.
3396
3484
  const toldId = `qitem-runner-permission-passed-${item.qitemId.replace(/^qitem-runner-permission-/, "").replace(/^qitem-/, "")}`;
3397
3485
  setImmediate(() => {
3486
+ // The request the person answered is what they'd judge (convention C3: a note to a person names its evidence).
3398
3487
  void this.create({ qitemId: toldId, sourceSession: root.sourceSession, destinationSession: person, humanIntent: "update",
3488
+ evidenceRef: `rig queue show ${root.qitemId}`,
3399
3489
  summary: `Your answer went to ${decider} to decide; ${root.sourceSession} is waiting`,
3400
3490
  body: [`Your answer to ${root.sourceSession}'s permission request ${root.qitemId} went to ${decider}, which decides it while ${root.sourceSession} waits. Nothing runs until it decides.`,
3401
3491
  ...(chosen?.describe ? [`Receiving agent: ${chosen.describe}`] : []),
@@ -3448,6 +3538,7 @@ export class QueueRepository {
3448
3538
  // After the answer's own write settles: one receipt per request (its id is the request's), told to who answered.
3449
3539
  setImmediate(() => {
3450
3540
  void this.create({ qitemId: receiptId, sourceSession: requester, destinationSession: person, humanIntent: "update",
3541
+ evidenceRef: `rig queue show ${item.qitemId}`,
3451
3542
  summary: `Your answer to ${requester}'s permission request is kept; the tool hasn't run`,
3452
3543
  body: [`Your answer to ${requester}'s permission request ${item.qitemId} is kept, and the request is still waiting: ${unreachable ? `it couldn't be passed to ${unreachable}, the receiving agent, just now (answer again to retry)` : `no receiving agent on this host can read it before the tool runs (none is set, or the only one is ${requester} itself)`}. The tool hasn't run, and nothing was permitted or refused.`,
3453
3544
  `To decide now: rig seat decide-permission ${item.qitemId} --option <id>${options.length ? ` (options: ${options.map((o) => `${o.id}, ${o.label}`).join("; ")})` : ""}. Or set up a receiving agent that isn't ${requester}: rig config set agents.operator_session <seat>@<rig>.`,
@@ -3520,6 +3611,8 @@ export class QueueRepository {
3520
3611
  return { status: "not-applicable", reason: "schema" };
3521
3612
  if (this.closeStaleRunnerPermission(input.qitemId))
3522
3613
  return { status: "not-applicable", reason: "state-canceled" };
3614
+ // Set inside the transaction when this click changed the answers (a declared type, so the closure's write is seen).
3615
+ let changed = null;
3523
3616
  const result = this.db.transaction(() => {
3524
3617
  const item = this.getById(input.qitemId);
3525
3618
  if (!item?.humanQuestions?.length)
@@ -3554,8 +3647,22 @@ export class QueueRepository {
3554
3647
  const answers = { ...(item.humanAnswers ?? {}), [input.questionId]: input.optionId };
3555
3648
  this.db.prepare("UPDATE queue_items SET human_answers = ? WHERE qitem_id = ?").run(JSON.stringify(answers), input.qitemId);
3556
3649
  const complete = unansweredQuestions(item.humanQuestions, answers).length === 0;
3650
+ if (item.humanAnswers?.[input.questionId] !== input.optionId) {
3651
+ changed = { summary: item.summary ?? null, answered: item.humanQuestions.length - unansweredQuestions(item.humanQuestions, answers).length };
3652
+ }
3557
3653
  return { status: "recorded", answers, complete, questions: item.humanQuestions };
3558
3654
  })();
3655
+ // The click is on the ask before anyone hears of it; a failed event never takes it back or holds up its return.
3656
+ if (changed && result.status === "recorded") {
3657
+ try {
3658
+ this.eventBus.emit({ type: "queue.answer_recorded", qitemId: input.qitemId, actorSession: input.actorSession,
3659
+ questionId: input.questionId, answered: changed.answered, questions: result.questions.length,
3660
+ complete: result.complete, summary: changed.summary });
3661
+ }
3662
+ catch (error) {
3663
+ console.warn(`[queue] ${input.qitemId}'s recorded answer has no event`, error);
3664
+ }
3665
+ }
3559
3666
  // A pending ask's interrupted close finishes here, as theirs; a park resumes with it through the reply resolver.
3560
3667
  if (result.status === "not-applicable" && result.answeredBy) {
3561
3668
  this.resolveDirectHumanReply({ qitemId: input.qitemId, actorSession: input.actorSession, decision: "", primaryUser: input.primaryUser });
@@ -3874,10 +3981,7 @@ export class QueueRepository {
3874
3981
  const limit = opts?.limit ?? 100;
3875
3982
  const conditions = [];
3876
3983
  const params = [];
3877
- if (opts?.tag) {
3878
- conditions.push("EXISTS (SELECT 1 FROM json_each(queue_items.tags) WHERE value = ?)");
3879
- params.push(opts.tag);
3880
- }
3984
+ pushExactTagFilters(opts?.tag, conditions, params);
3881
3985
  if (opts?.rig) {
3882
3986
  const escaped = opts.rig.replace(/%/g, "\\%").replace(/_/g, "\\_");
3883
3987
  conditions.push("(destination_session LIKE ? ESCAPE '\\' OR source_session LIKE ? ESCAPE '\\')");
@@ -4057,6 +4161,7 @@ export class QueueRepository {
4057
4161
  if (this.hasHumanIntentColumn)
4058
4162
  conditions.push("COALESCE(human_intent, 'decision') <> 'update'");
4059
4163
  const params = [...states];
4164
+ pushExactTagFilters(opts?.tag, conditions, params);
4060
4165
  if (opts?.destinationSession) {
4061
4166
  const addresses = this.resolveSessionAddresses(opts.destinationSession);
4062
4167
  conditions.push(`destination_session IN (${addresses.map(() => "?").join(",")})`);
@@ -4327,6 +4432,27 @@ export class QueueRepository {
4327
4432
  this.inboxCheckInWriteFailed = true;
4328
4433
  }
4329
4434
  }
4435
+ /** Each hosted member on this host with its check-in status: its stated cadence against its own inbox reads. A status
4436
+ * only; nothing here changes how work reaches it. */
4437
+ hostedMemberCheckIns(now = new Date()) {
4438
+ return this.hostedMembersFn().map((m) => ({ seat: m.seat, rung: m.wake !== undefined,
4439
+ ...memberCheckInStatus({ checkInMinutes: m.check_in_minutes, onRequest: m.check_in_on_request, cadenceProblem: m.check_in_problem,
4440
+ checkIn: this.lastInboxCheckIn(m.seat), now }) }));
4441
+ }
4442
+ /** One member's check-in status, as `hostedMemberCheckIns` gives it. A seat the rosters don't list here (or can't be
4443
+ * read for) states no cadence, so it reads by its check-ins alone. */
4444
+ hostedMemberCheckIn(seat, now = new Date()) {
4445
+ let member;
4446
+ try {
4447
+ member = this.hostedMembersFn().find((m) => this.isSameSession(m.seat, seat));
4448
+ }
4449
+ catch {
4450
+ member = undefined;
4451
+ }
4452
+ // The roster's spelling of the seat, as the list read uses, so both read the same check-ins.
4453
+ return memberCheckInStatus({ checkInMinutes: member?.check_in_minutes, onRequest: member?.check_in_on_request,
4454
+ cadenceProblem: member?.check_in_problem, checkIn: this.lastInboxCheckIn(member?.seat ?? seat), now });
4455
+ }
4330
4456
  /** This session's latest recorded check-in under any of its names. */
4331
4457
  lastInboxCheckIn(session) {
4332
4458
  try {