@openrig/cli 0.7.16 → 0.7.17

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 (363) hide show
  1. package/README.md +9 -9
  2. package/daemon/assets/onboarding/02-self-and-competent-action.md +5 -41
  3. package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +1 -1
  4. package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +1 -1
  5. package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
  6. package/daemon/assets/plugins/openrig/plugin.json +1 -1
  7. package/daemon/assets/plugins/openrig/skills/working-with-an-openrig-team/SKILL.md +22 -6
  8. package/daemon/assets/skills/rigs/SKILL.md +68 -29
  9. package/daemon/assets/skills/rigs/references/installing-for-someone.md +47 -0
  10. package/daemon/context-packs/help/manifest.yaml +1 -1
  11. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  12. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +87 -33
  13. package/daemon/context-packs/reference/getting-started.md +8 -8
  14. package/daemon/context-packs/reference/manifest.yaml +1 -1
  15. package/daemon/context-packs/reference/whats-new.md +193 -6
  16. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  17. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  18. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  19. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  20. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  21. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  22. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  23. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  24. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  25. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  26. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  27. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  28. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  29. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  30. package/daemon/context-packs/skills/core/openrig-software-factory/references/worked-example.md +1 -1
  31. package/daemon/context-packs/skills/core/openrig-upgrade/SKILL.md +2 -0
  32. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  33. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  34. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  35. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  36. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  37. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  38. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/core/working-with-an-openrig-team/SKILL.md +22 -6
  40. package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  46. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  53. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  54. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  56. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  66. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  68. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  72. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  73. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  74. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  75. package/daemon/dist/adapters/claude-code-adapter.js +36 -3
  76. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  77. package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
  78. package/daemon/dist/adapters/claude-resume.js +4 -2
  79. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  80. package/daemon/dist/adapters/openshell-driver.d.ts +1 -0
  81. package/daemon/dist/adapters/openshell-driver.d.ts.map +1 -1
  82. package/daemon/dist/adapters/openshell-driver.js +3 -0
  83. package/daemon/dist/adapters/openshell-driver.js.map +1 -1
  84. package/daemon/dist/adapters/openshell-podman-observer.d.ts +9 -7
  85. package/daemon/dist/adapters/openshell-podman-observer.d.ts.map +1 -1
  86. package/daemon/dist/adapters/openshell-podman-observer.js +20 -3
  87. package/daemon/dist/adapters/openshell-podman-observer.js.map +1 -1
  88. package/daemon/dist/adapters/pi-runner.d.ts +38 -4
  89. package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
  90. package/daemon/dist/adapters/pi-runner.js +244 -30
  91. package/daemon/dist/adapters/pi-runner.js.map +1 -1
  92. package/daemon/dist/adapters/tmux.d.ts +3 -0
  93. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  94. package/daemon/dist/adapters/tmux.js +1 -1
  95. package/daemon/dist/adapters/tmux.js.map +1 -1
  96. package/daemon/dist/build-info.js +3 -3
  97. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  98. package/daemon/dist/db/all-migrations.js +4 -0
  99. package/daemon/dist/db/all-migrations.js.map +1 -1
  100. package/daemon/dist/db/migrations/168_context_usage_occupant_generation.d.ts +6 -0
  101. package/daemon/dist/db/migrations/168_context_usage_occupant_generation.d.ts.map +1 -0
  102. package/daemon/dist/db/migrations/168_context_usage_occupant_generation.js +10 -0
  103. package/daemon/dist/db/migrations/168_context_usage_occupant_generation.js.map +1 -0
  104. package/daemon/dist/db/migrations/170_rig_delivery_drains.d.ts +3 -0
  105. package/daemon/dist/db/migrations/170_rig_delivery_drains.d.ts.map +1 -0
  106. package/daemon/dist/db/migrations/170_rig_delivery_drains.js +21 -0
  107. package/daemon/dist/db/migrations/170_rig_delivery_drains.js.map +1 -0
  108. package/daemon/dist/domain/codex-thread-id.d.ts +13 -0
  109. package/daemon/dist/domain/codex-thread-id.d.ts.map +1 -1
  110. package/daemon/dist/domain/codex-thread-id.js +132 -9
  111. package/daemon/dist/domain/codex-thread-id.js.map +1 -1
  112. package/daemon/dist/domain/connection-contract.d.ts.map +1 -1
  113. package/daemon/dist/domain/connection-contract.js +2 -1
  114. package/daemon/dist/domain/connection-contract.js.map +1 -1
  115. package/daemon/dist/domain/context-usage-store.d.ts +11 -2
  116. package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
  117. package/daemon/dist/domain/context-usage-store.js +33 -13
  118. package/daemon/dist/domain/context-usage-store.js.map +1 -1
  119. package/daemon/dist/domain/current-work.d.ts +5 -0
  120. package/daemon/dist/domain/current-work.d.ts.map +1 -1
  121. package/daemon/dist/domain/current-work.js +66 -4
  122. package/daemon/dist/domain/current-work.js.map +1 -1
  123. package/daemon/dist/domain/environment-lifecycle.d.ts +15 -0
  124. package/daemon/dist/domain/environment-lifecycle.d.ts.map +1 -1
  125. package/daemon/dist/domain/environment-lifecycle.js +22 -4
  126. package/daemon/dist/domain/environment-lifecycle.js.map +1 -1
  127. package/daemon/dist/domain/expected-conversation.d.ts.map +1 -1
  128. package/daemon/dist/domain/expected-conversation.js +26 -11
  129. package/daemon/dist/domain/expected-conversation.js.map +1 -1
  130. package/daemon/dist/domain/gateway/destination-resolver.d.ts +4 -0
  131. package/daemon/dist/domain/gateway/destination-resolver.d.ts.map +1 -1
  132. package/daemon/dist/domain/gateway/destination-resolver.js +10 -3
  133. package/daemon/dist/domain/gateway/destination-resolver.js.map +1 -1
  134. package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts +3 -1
  135. package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
  136. package/daemon/dist/domain/gateway/operator-delivery-engine.js +14 -4
  137. package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
  138. package/daemon/dist/domain/health-diagnosis.d.ts.map +1 -1
  139. package/daemon/dist/domain/health-diagnosis.js +4 -0
  140. package/daemon/dist/domain/health-diagnosis.js.map +1 -1
  141. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
  142. package/daemon/dist/domain/mission-control/mission-control-write-contract.js +1 -1
  143. package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
  144. package/daemon/dist/domain/native-model-picker.d.ts +2 -0
  145. package/daemon/dist/domain/native-model-picker.d.ts.map +1 -1
  146. package/daemon/dist/domain/native-model-picker.js +8 -2
  147. package/daemon/dist/domain/native-model-picker.js.map +1 -1
  148. package/daemon/dist/domain/native-resume-probe.js +78 -11
  149. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  150. package/daemon/dist/domain/network/network-connector.d.ts.map +1 -1
  151. package/daemon/dist/domain/network/network-connector.js +5 -3
  152. package/daemon/dist/domain/network/network-connector.js.map +1 -1
  153. package/daemon/dist/domain/network/network-installations.d.ts +5 -4
  154. package/daemon/dist/domain/network/network-installations.d.ts.map +1 -1
  155. package/daemon/dist/domain/network/network-installations.js +42 -11
  156. package/daemon/dist/domain/network/network-installations.js.map +1 -1
  157. package/daemon/dist/domain/node-launcher.d.ts +3 -0
  158. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  159. package/daemon/dist/domain/node-launcher.js +4 -3
  160. package/daemon/dist/domain/node-launcher.js.map +1 -1
  161. package/daemon/dist/domain/occupant-invalidator.d.ts +4 -1
  162. package/daemon/dist/domain/occupant-invalidator.d.ts.map +1 -1
  163. package/daemon/dist/domain/occupant-invalidator.js +10 -2
  164. package/daemon/dist/domain/occupant-invalidator.js.map +1 -1
  165. package/daemon/dist/domain/operation-correlation.d.ts +1 -1
  166. package/daemon/dist/domain/operation-correlation.d.ts.map +1 -1
  167. package/daemon/dist/domain/operation-correlation.js +1 -1
  168. package/daemon/dist/domain/operation-correlation.js.map +1 -1
  169. package/daemon/dist/domain/queue-erasure.d.ts +7 -1
  170. package/daemon/dist/domain/queue-erasure.d.ts.map +1 -1
  171. package/daemon/dist/domain/queue-erasure.js +226 -20
  172. package/daemon/dist/domain/queue-erasure.js.map +1 -1
  173. package/daemon/dist/domain/queue-repository.d.ts +19 -2
  174. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  175. package/daemon/dist/domain/queue-repository.js +59 -15
  176. package/daemon/dist/domain/queue-repository.js.map +1 -1
  177. package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
  178. package/daemon/dist/domain/queue-stuck-sweep.js +49 -21
  179. package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
  180. package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
  181. package/daemon/dist/domain/queue-wake-ladder.js +90 -24
  182. package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
  183. package/daemon/dist/domain/restore-check-service.d.ts +13 -0
  184. package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
  185. package/daemon/dist/domain/restore-check-service.js +122 -9
  186. package/daemon/dist/domain/restore-check-service.js.map +1 -1
  187. package/daemon/dist/domain/restore-orchestrator.d.ts +4 -1
  188. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  189. package/daemon/dist/domain/restore-orchestrator.js +95 -33
  190. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  191. package/daemon/dist/domain/restore-preconditions.d.ts +2 -0
  192. package/daemon/dist/domain/restore-preconditions.d.ts.map +1 -1
  193. package/daemon/dist/domain/restore-preconditions.js +2 -0
  194. package/daemon/dist/domain/restore-preconditions.js.map +1 -1
  195. package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
  196. package/daemon/dist/domain/resume-metadata-refresher.js +4 -1
  197. package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
  198. package/daemon/dist/domain/rig-delivery-drain.d.ts +46 -0
  199. package/daemon/dist/domain/rig-delivery-drain.d.ts.map +1 -0
  200. package/daemon/dist/domain/rig-delivery-drain.js +128 -0
  201. package/daemon/dist/domain/rig-delivery-drain.js.map +1 -0
  202. package/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
  203. package/daemon/dist/domain/rig-lifecycle-service.js +4 -1
  204. package/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
  205. package/daemon/dist/domain/rig-teardown.d.ts +20 -3
  206. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  207. package/daemon/dist/domain/rig-teardown.js +71 -11
  208. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  209. package/daemon/dist/domain/rigspec-preflight.d.ts +1 -1
  210. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  211. package/daemon/dist/domain/rigspec-preflight.js +16 -1
  212. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  213. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  214. package/daemon/dist/domain/seat-handover-service.js +6 -1
  215. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  216. package/daemon/dist/domain/seat-launch-environment.d.ts +3 -2
  217. package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
  218. package/daemon/dist/domain/seat-launch-environment.js +16 -4
  219. package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
  220. package/daemon/dist/domain/session-name.d.ts +13 -0
  221. package/daemon/dist/domain/session-name.d.ts.map +1 -1
  222. package/daemon/dist/domain/session-name.js +77 -0
  223. package/daemon/dist/domain/session-name.js.map +1 -1
  224. package/daemon/dist/domain/session-registry.d.ts +7 -1
  225. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  226. package/daemon/dist/domain/session-registry.js +7 -4
  227. package/daemon/dist/domain/session-registry.js.map +1 -1
  228. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  229. package/daemon/dist/domain/session-transport.js +27 -7
  230. package/daemon/dist/domain/session-transport.js.map +1 -1
  231. package/daemon/dist/domain/shared-history-selection.d.ts +1 -0
  232. package/daemon/dist/domain/shared-history-selection.d.ts.map +1 -1
  233. package/daemon/dist/domain/shared-history-selection.js +3 -1
  234. package/daemon/dist/domain/shared-history-selection.js.map +1 -1
  235. package/daemon/dist/domain/snapshot-capture.d.ts +4 -1
  236. package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
  237. package/daemon/dist/domain/snapshot-capture.js +19 -12
  238. package/daemon/dist/domain/snapshot-capture.js.map +1 -1
  239. package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
  240. package/daemon/dist/domain/startup-submission-evidence.js +3 -2
  241. package/daemon/dist/domain/startup-submission-evidence.js.map +1 -1
  242. package/daemon/dist/domain/types.d.ts +9 -1
  243. package/daemon/dist/domain/types.d.ts.map +1 -1
  244. package/daemon/dist/domain/types.js.map +1 -1
  245. package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
  246. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  247. package/daemon/dist/domain/user-settings/settings-store.js +6 -0
  248. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  249. package/daemon/dist/domain/watchdog-policy-engine.d.ts +4 -0
  250. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  251. package/daemon/dist/domain/watchdog-policy-engine.js +28 -1
  252. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  253. package/daemon/dist/domain/workflow-instance-store.d.ts +3 -2
  254. package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
  255. package/daemon/dist/domain/workflow-instance-store.js +6 -4
  256. package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
  257. package/daemon/dist/domain/workflow-projector.d.ts +48 -0
  258. package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
  259. package/daemon/dist/domain/workflow-projector.js +160 -90
  260. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  261. package/daemon/dist/domain/workflow-reconciliation.d.ts +7 -1
  262. package/daemon/dist/domain/workflow-reconciliation.d.ts.map +1 -1
  263. package/daemon/dist/domain/workflow-reconciliation.js +51 -13
  264. package/daemon/dist/domain/workflow-reconciliation.js.map +1 -1
  265. package/daemon/dist/domain/workflow-runtime.d.ts +4 -2
  266. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  267. package/daemon/dist/domain/workflow-runtime.js +46 -22
  268. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  269. package/daemon/dist/routes/queue.d.ts.map +1 -1
  270. package/daemon/dist/routes/queue.js +34 -4
  271. package/daemon/dist/routes/queue.js.map +1 -1
  272. package/daemon/dist/routes/restore-check.d.ts.map +1 -1
  273. package/daemon/dist/routes/restore-check.js +17 -0
  274. package/daemon/dist/routes/restore-check.js.map +1 -1
  275. package/daemon/dist/routes/rig-delivery-drain.d.ts +3 -0
  276. package/daemon/dist/routes/rig-delivery-drain.d.ts.map +1 -0
  277. package/daemon/dist/routes/rig-delivery-drain.js +46 -0
  278. package/daemon/dist/routes/rig-delivery-drain.js.map +1 -0
  279. package/daemon/dist/routes/startup.d.ts.map +1 -1
  280. package/daemon/dist/routes/startup.js +120 -28
  281. package/daemon/dist/routes/startup.js.map +1 -1
  282. package/daemon/dist/routes/up.js +2 -0
  283. package/daemon/dist/routes/up.js.map +1 -1
  284. package/daemon/dist/routes/workflow.js +1 -1
  285. package/daemon/dist/routes/workflow.js.map +1 -1
  286. package/daemon/dist/server.d.ts.map +1 -1
  287. package/daemon/dist/server.js +2 -0
  288. package/daemon/dist/server.js.map +1 -1
  289. package/daemon/dist/startup.d.ts.map +1 -1
  290. package/daemon/dist/startup.js +6 -0
  291. package/daemon/dist/startup.js.map +1 -1
  292. package/daemon/docs/reference/agent-startup-guide.md +3 -2
  293. package/daemon/docs/reference/daemon-http-clients.md +68 -0
  294. package/daemon/docs/reference/getting-started.md +8 -8
  295. package/daemon/docs/reference/hosted-members.md +4 -2
  296. package/daemon/docs/reference/network-connector.md +4 -3
  297. package/daemon/docs/reference/queue-erasure.md +16 -1
  298. package/daemon/docs/reference/quickstart.md +2 -2
  299. package/daemon/docs/reference/whats-new.md +193 -6
  300. package/daemon/specs/agents/shared/skills/core/openrig-software-factory/references/worked-example.md +1 -1
  301. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +2 -0
  302. package/daemon/specs/agents/shared/skills/core/working-with-an-openrig-team/SKILL.md +22 -6
  303. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +78 -18
  304. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/startup/context.md +9 -6
  305. package/dist/build-info.js +3 -3
  306. package/dist/commands/config.d.ts.map +1 -1
  307. package/dist/commands/config.js +2 -0
  308. package/dist/commands/config.js.map +1 -1
  309. package/dist/commands/down.d.ts.map +1 -1
  310. package/dist/commands/down.js +5 -1
  311. package/dist/commands/down.js.map +1 -1
  312. package/dist/commands/environment.js +1 -1
  313. package/dist/commands/environment.js.map +1 -1
  314. package/dist/commands/network.d.ts +2 -0
  315. package/dist/commands/network.d.ts.map +1 -1
  316. package/dist/commands/network.js +14 -1
  317. package/dist/commands/network.js.map +1 -1
  318. package/dist/commands/queue.d.ts +1 -1
  319. package/dist/commands/queue.d.ts.map +1 -1
  320. package/dist/commands/queue.js +43 -10
  321. package/dist/commands/queue.js.map +1 -1
  322. package/dist/commands/restore.d.ts.map +1 -1
  323. package/dist/commands/restore.js +6 -1
  324. package/dist/commands/restore.js.map +1 -1
  325. package/dist/commands/seat.js +3 -3
  326. package/dist/commands/seat.js.map +1 -1
  327. package/dist/commands/setup.d.ts.map +1 -1
  328. package/dist/commands/setup.js +5 -3
  329. package/dist/commands/setup.js.map +1 -1
  330. package/dist/commands/up.d.ts.map +1 -1
  331. package/dist/commands/up.js +7 -0
  332. package/dist/commands/up.js.map +1 -1
  333. package/dist/commands/workflow.d.ts.map +1 -1
  334. package/dist/commands/workflow.js +6 -4
  335. package/dist/commands/workflow.js.map +1 -1
  336. package/dist/config-store.d.ts +3 -1
  337. package/dist/config-store.d.ts.map +1 -1
  338. package/dist/config-store.js +5 -0
  339. package/dist/config-store.js.map +1 -1
  340. package/dist/lib/bundle-check.d.ts.map +1 -1
  341. package/dist/lib/bundle-check.js +33 -3
  342. package/dist/lib/bundle-check.js.map +1 -1
  343. package/dist/mcp-server.d.ts.map +1 -1
  344. package/dist/mcp-server.js +48 -9
  345. package/dist/mcp-server.js.map +1 -1
  346. package/dist/person-registration-offer.d.ts.map +1 -1
  347. package/dist/person-registration-offer.js +2 -1
  348. package/dist/person-registration-offer.js.map +1 -1
  349. package/package.json +2 -2
  350. package/tui/dist/config/config-model.js +1 -1
  351. package/tui/dist/config/config-model.js.map +1 -1
  352. package/tui/dist/daemon-client.d.ts +3 -1
  353. package/tui/dist/daemon-client.d.ts.map +1 -1
  354. package/tui/dist/daemon-client.js +4 -2
  355. package/tui/dist/daemon-client.js.map +1 -1
  356. package/tui/dist/hydrate.d.ts.map +1 -1
  357. package/tui/dist/hydrate.js +31 -1
  358. package/tui/dist/hydrate.js.map +1 -1
  359. package/tui/dist/render.d.ts.map +1 -1
  360. package/tui/dist/render.js +106 -15
  361. package/tui/dist/render.js.map +1 -1
  362. package/tui/dist/types.d.ts +2 -0
  363. package/tui/dist/types.d.ts.map +1 -1
@@ -1,6 +1,8 @@
1
+ import { RigDeliveryDrainStore } from "./rig-delivery-drain.js";
1
2
  import { PROMPT_ALERT_TAG, readWakeLadderBackstop } from "./queue-wake-ladder.js";
2
3
  import { withUrgentLine } from "./urgent-line.js";
3
4
  import { quietCustodyBackstop, quietHoldCustody } from "./quiet-hold-custody.js";
5
+ import { cooperativeReadFile, readRowsCooperatively } from "./execution-candidate-reader.js";
4
6
  import { createHash } from "node:crypto";
5
7
  import { loadHumanRegistry, registeredPeople, resolveRegisteredHumanAddress, slackSubscriptionFor, withHumanAlertTag } from "./gateway/human-registry.js";
6
8
  import { DispatchBuffer } from "./gateway/dispatch-buffer.js";
@@ -31,7 +33,7 @@ import { parseSessionName, isHumanSeatSessionRef } from "./session-name.js";
31
33
  import { runnerPermissionOrigin } from "./runner-permissions.js";
32
34
  import { isHostPairingAsk } from "./hosts/pairing-ask.js";
33
35
  import { parseReplyToChoice, parseArrivalThread, parseReplyToThreadMissing, formatReplyToChoice, describeReplyToFallback, REPLY_TO_CHOICE_ACTOR } from "./reply-to-choice.js";
34
- import { classifyDestination } from "./gateway/destination-resolver.js";
36
+ import { classifyDestination, recordsNoWakeRoute } from "./gateway/destination-resolver.js";
35
37
  import { join } from "node:path";
36
38
  import { SettingsStore } from "./user-settings/settings-store.js";
37
39
  import { hostedMembersAt, hostedWakeFor, isHostedMemberAt } from "./rosters.js";
@@ -539,6 +541,7 @@ function isWakeTimeoutSignal(s) {
539
541
  }
540
542
  export class QueueRepository {
541
543
  db;
544
+ deliveryDrains;
542
545
  transitionLog;
543
546
  eventBus;
544
547
  destinationAdvisory;
@@ -607,6 +610,7 @@ export class QueueRepository {
607
610
  workflowFrontierPredicate;
608
611
  constructor(db, eventBus, opts) {
609
612
  this.db = db;
613
+ this.deliveryDrains = new RigDeliveryDrainStore(db);
610
614
  this.eventBus = eventBus;
611
615
  this.transitionLog = new QueueTransitionLog(db);
612
616
  this.wakeRepo = new QueueWakeRepository(db);
@@ -990,13 +994,15 @@ export class QueueRepository {
990
994
  return "skipped";
991
995
  const alreadyHeld = this.outbox.getById(outboxId);
992
996
  if (alreadyHeld?.deliveryState === "retained" || alreadyHeld?.deliveryState === "retired") {
997
+ if (this.deliveryDrains.holds(alreadyHeld.destinationSession))
998
+ return "retained";
993
999
  if (alreadyHeld.auditPointer)
994
1000
  this.recordNudgeAttempt(alreadyHeld.auditPointer, "retained:typing_guard");
995
1001
  return "retained";
996
1002
  }
997
1003
  let recovering = false;
998
1004
  const claim = (entry) => {
999
- if (!eligible(entry) || attempted.has(entry.outboxId) || !this.outbox.claimForDelivery(entry.outboxId))
1005
+ if (this.deliveryDrains.holds(entry.destinationSession) || !eligible(entry) || attempted.has(entry.outboxId) || !this.outbox.claimForDelivery(entry.outboxId))
1000
1006
  return false;
1001
1007
  this.bindFirstTarget(entry);
1002
1008
  attempted.add(entry.outboxId);
@@ -1005,6 +1011,8 @@ export class QueueRepository {
1005
1011
  };
1006
1012
  let superseded = false;
1007
1013
  const actionable = (entry) => {
1014
+ if (!eligible(entry))
1015
+ return false;
1008
1016
  const current = this.currentWakeIntent(entry);
1009
1017
  if (!current) {
1010
1018
  // Existing failed state means the requested old delivery was refused;
@@ -1208,18 +1216,19 @@ export class QueueRepository {
1208
1216
  const BATCH = 200;
1209
1217
  const horizon = this.db.prepare("SELECT COALESCE(MAX(rowid),0) AS id FROM outbox_entries").get().id;
1210
1218
  // Retire never-attempted obsolete notifications without materializing historical intents.
1211
- tally.failed += this.db.prepare(`UPDATE outbox_entries AS o SET delivery_state = 'failed',
1219
+ if (!opts?.eligible)
1220
+ tally.failed += this.db.prepare(`UPDATE outbox_entries AS o SET delivery_state = 'failed',
1212
1221
  tags = json_insert(COALESCE(tags, '[]'), '$[#]', 'queue:wake-superseded')
1213
1222
  WHERE delivery_state = 'pending' AND rowid <= ? AND substr(outbox_id, 1, ?) = ?
1214
1223
  AND substr(outbox_id, 1, ?) != ?
1215
1224
  AND NOT EXISTS (SELECT 1 FROM queue_items q WHERE q.qitem_id = o.audit_pointer
1216
1225
  AND q.state = 'pending' AND q.destination_session = o.destination_session)`)
1217
- .run(horizon, WAKE_INTENT_PREFIX.length, WAKE_INTENT_PREFIX, CLAIM_OVERRIDDEN_WAKE_PREFIX.length, CLAIM_OVERRIDDEN_WAKE_PREFIX).changes;
1226
+ .run(horizon, WAKE_INTENT_PREFIX.length, WAKE_INTENT_PREFIX, CLAIM_OVERRIDDEN_WAKE_PREFIX.length, CLAIM_OVERRIDDEN_WAKE_PREFIX).changes;
1218
1227
  // A stop also refuses every later claim inside a delivery: coalesced peers and members it releases for their own send.
1219
1228
  // So does a missing receiver, for a notification already tried. One never tried still gets its attempt, so its row
1220
1229
  // records why it didn't land.
1221
1230
  const eligible = (entry) => {
1222
- if (opts?.stopRequested?.())
1231
+ if (opts?.stopRequested?.() || opts?.eligible && !opts.eligible(entry))
1223
1232
  return false;
1224
1233
  if (entry.deliveryState === "pending" || !this.wakeHasNoReceiver(entry.destinationSession))
1225
1234
  return true;
@@ -1294,9 +1303,11 @@ export class QueueRepository {
1294
1303
  * copies were deleted, refused at the seat boundary instead); this
1295
1304
  * site holds no copy of its own.
1296
1305
  */
1297
- async maybeNudge(qitemId, destinationSession, nudgeOpt, sourceSession, bodyOverride, trigger = "agent") {
1306
+ async maybeNudge(qitemId, destinationSession, nudgeOpt, sourceSession, bodyOverride, trigger = "agent", opts) {
1298
1307
  if (nudgeOpt === false)
1299
1308
  return;
1309
+ if (!opts?.explicit && this.deliveryDrains.holds(destinationSession))
1310
+ return;
1300
1311
  if (!this.transport)
1301
1312
  return;
1302
1313
  const outcome = await this.performWakeSend(qitemId, destinationSession, sourceSession, bodyOverride, undefined, undefined, trigger);
@@ -1304,6 +1315,7 @@ export class QueueRepository {
1304
1315
  }
1305
1316
  /** The following startup intent drain owns durable pending wakes. Legacy packets
1306
1317
  * and overdue claimed work (not eligible for that drain) still use the nudge path. */
1318
+ // Held workflow boot packets remain owed: their keepalive resumes after END; the sweep reports unclaimed work.
1307
1319
  async recoverLostNudge(qitemId, destinationSession, sourceSession) {
1308
1320
  const outboxId = `${WAKE_INTENT_PREFIX}${qitemId}`;
1309
1321
  if (this.outbox?.getById(outboxId) && this.getById(qitemId)?.state === "pending")
@@ -1325,6 +1337,8 @@ export class QueueRepository {
1325
1337
  }
1326
1338
  if (state !== "running" && state !== "idle")
1327
1339
  return;
1340
+ if (addresses.some(address => this.deliveryDrains.holds(address)))
1341
+ return;
1328
1342
  if (addresses.every(address => this.promptRecoveryState.get(address) === false))
1329
1343
  return;
1330
1344
  // A compaction's "Compacted" is also a clear. While its turn boundary, restore or audit is still owed, a retried wake
@@ -1391,7 +1405,7 @@ export class QueueRepository {
1391
1405
  * gateway, not held or released for quiet hours, and its seat now pane-bound. A handoff's retry ladder is the
1392
1406
  * caller's to check: the sweep defers to a live ladder, the reachable-seat retry leaves every handed-off row to it. */
1393
1407
  unroutableWakeRetryable(row, now = new Date()) {
1394
- return row.lastNudgeResult?.startsWith("unroutable:") === true
1408
+ return recordsNoWakeRoute(row.lastNudgeResult)
1395
1409
  && !row.claimedAt
1396
1410
  && row.deliveryOutcome !== "never-posted" && row.deliveryOutcome !== "transport-failed"
1397
1411
  && !this.isLocalHumanDecisionWithoutGateway(row)
@@ -1407,12 +1421,15 @@ export class QueueRepository {
1407
1421
  const addresses = this.resolveSessionAddresses(sessionName);
1408
1422
  if (!addresses.length)
1409
1423
  return;
1424
+ if (addresses.some(address => this.deliveryDrains.holds(address)))
1425
+ return;
1410
1426
  // As for a prompt clear (#2575): while a compaction's restore is owed, the wake would reach the agent before it.
1411
1427
  if ([sessionName, ...addresses].some(address => this.hasPendingPostCompactStage?.(address)))
1412
1428
  return;
1413
1429
  const rows = this.db.prepare(`SELECT qitem_id FROM queue_items
1414
1430
  WHERE destination_session IN (${addresses.map(() => "?").join(",")}) AND state = 'pending'
1415
- AND handed_off_from IS NULL AND last_nudge_result LIKE 'unroutable:%' ORDER BY ts_created, qitem_id`)
1431
+ AND handed_off_from IS NULL AND (last_nudge_result LIKE 'unroutable:%' OR last_nudge_result LIKE 'awaiting-pickup:%')
1432
+ ORDER BY ts_created, qitem_id`)
1416
1433
  .all(...addresses);
1417
1434
  const now = new Date();
1418
1435
  // One attempt per intent for the pass: a returned result and its resume go as one send, so the second row's turn
@@ -4272,12 +4289,9 @@ export class QueueRepository {
4272
4289
  this.eventBus.notifySubscribers(persisted);
4273
4290
  return persisted;
4274
4291
  }
4275
- findUndelivered(opts) {
4276
- // OPR.0.5.6.14 — delivery truth belongs to the CURRENT human-notification
4277
- // episode, not to the row's whole history. Pull every active row that can
4278
- // carry a current episode or a legacy nudge/receipt, then derive/filter in
4279
- // JS. LIMIT is applied after that filtering so historical POSTED episodes
4280
- // cannot consume the window and hide a later failure.
4292
+ /** The active rows findUndelivered considers: each can carry a current owner episode, a legacy nudge failure or a
4293
+ * delivery receipt. Which of them is undelivered is derived per row afterwards. */
4294
+ undeliveredCandidateFilter(opts) {
4281
4295
  const ownerEpisodeCandidate = this.hasOwnerNotificationColumns
4282
4296
  ? `EXISTS (SELECT 1 FROM queue_transitions owner_episode
4283
4297
  WHERE owner_episode.qitem_id = queue_items.qitem_id
@@ -4287,6 +4301,7 @@ export class QueueRepository {
4287
4301
  "state IN ('pending', 'in-progress', 'blocked')",
4288
4302
  `((state = 'pending' AND (last_nudge_result LIKE 'failed:%'
4289
4303
  OR last_nudge_result LIKE 'unroutable:%'
4304
+ OR last_nudge_result LIKE 'awaiting-pickup:%'
4290
4305
  OR last_nudge_result LIKE 'gateway-owned%'))
4291
4306
  OR ${ownerEpisodeCandidate}
4292
4307
  OR EXISTS (SELECT 1 FROM queue_transitions receipt
@@ -4306,6 +4321,35 @@ export class QueueRepository {
4306
4321
  conditions.push("(destination_session LIKE ? ESCAPE '\\' OR source_session LIKE ? ESCAPE '\\')");
4307
4322
  params.push(`%@${escaped}`, `%@${escaped}`);
4308
4323
  }
4324
+ return { conditions, params };
4325
+ }
4326
+ /**
4327
+ * The ids of the rows findUndelivered considers, oldest first, with no row's delivery outcome derived: a caller that
4328
+ * must stay responsive (the stuck sweep) derives each one by id, `findUndelivered({ qitemId })`, between its own
4329
+ * yields, so a long candidate set never runs as one synchronous read. On a WAL file database outside a transaction the
4330
+ * read runs in rowid windows on its own readonly connection and yields between windows (readRowsCooperatively, one
4331
+ * snapshot for the whole read); otherwise it is one id-only read on this handle. Every candidate is returned: nothing
4332
+ * is capped, and rows that change after the read are judged on that fresh read by id.
4333
+ */
4334
+ async undeliveredCandidateIds(opts) {
4335
+ const { conditions, params } = this.undeliveredCandidateFilter(opts);
4336
+ const where = conditions.join(" AND ");
4337
+ const columns = "qitem_id, ts_created, queue_items.rowid AS rid";
4338
+ const file = cooperativeReadFile(this.db);
4339
+ const rows = file
4340
+ ? (await readRowsCooperatively(file, "queue_items", `SELECT ${columns} FROM queue_items WHERE queue_items.rowid > ? AND queue_items.rowid <= ? AND ${where}`, params)).rows
4341
+ : this.db.prepare(`SELECT ${columns} FROM queue_items WHERE ${where}`).all(...params);
4342
+ // findUndelivered's order: oldest first, ties in rowid order.
4343
+ rows.sort((a, b) => (a.ts_created < b.ts_created ? -1 : a.ts_created > b.ts_created ? 1 : a.rid - b.rid));
4344
+ return rows.map((row) => row.qitem_id);
4345
+ }
4346
+ findUndelivered(opts) {
4347
+ // OPR.0.5.6.14 — delivery truth belongs to the CURRENT human-notification
4348
+ // episode, not to the row's whole history. Pull every active row that can
4349
+ // carry a current episode or a legacy nudge/receipt, then derive/filter in
4350
+ // JS. LIMIT is applied after that filtering so historical POSTED episodes
4351
+ // cannot consume the window and hide a later failure.
4352
+ const { conditions, params } = this.undeliveredCandidateFilter(opts);
4309
4353
  const columns = opts?.compact ? this.compactColumns() : "*";
4310
4354
  const sql = `SELECT ${columns} FROM queue_items WHERE ${conditions.join(" AND ")} ORDER BY ts_created ASC`;
4311
4355
  const rows = this.db.prepare(sql).all(...params);
@@ -4336,7 +4380,7 @@ export class QueueRepository {
4336
4380
  // undelivered. An active non-human row can still have an old OWNER
4337
4381
  // transition; that historical episode is not a current obligation.
4338
4382
  const lastNudge = item.lastNudgeResult ?? "";
4339
- if (item.state === "pending" && (lastNudge.startsWith("failed:") || lastNudge.startsWith("unroutable:"))) {
4383
+ if (item.state === "pending" && (lastNudge.startsWith("failed:") || recordsNoWakeRoute(lastNudge))) {
4340
4384
  out.push(item);
4341
4385
  }
4342
4386
  }