@openrig/cli 0.7.18 → 0.7.19

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 (647) hide show
  1. package/README.md +7 -6
  2. package/daemon/assets/claude-hook-bridge.cjs +146 -0
  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-core/.claude-plugin/plugin.json +1 -1
  8. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
  9. package/daemon/assets/plugins/openrig-core/README.md +1 -1
  10. package/daemon/assets/plugins/openrig-core/hooks/claude.json +14 -14
  11. package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +43 -22
  12. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +1 -0
  13. package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +1 -1
  14. package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +70 -2
  15. package/daemon/assets/skills/rigs/SKILL.md +40 -19
  16. package/daemon/context-packs/help/manifest.yaml +1 -1
  17. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  18. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +16 -7
  19. package/daemon/context-packs/reference/getting-started.md +9 -4
  20. package/daemon/context-packs/reference/manifest.yaml +1 -1
  21. package/daemon/context-packs/reference/rig-spec.md +56 -26
  22. package/daemon/context-packs/reference/whats-new.md +82 -11
  23. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  24. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  25. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  26. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  27. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  28. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  29. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  30. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  31. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  33. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  34. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  35. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  36. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  37. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  38. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  40. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  46. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/mission-slice-sop/SKILL.md +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/refocusing/scripts/trace-to-root.py +70 -2
  74. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  75. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  76. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  77. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  78. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  79. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  80. package/daemon/dist/adapters/claude-code-adapter.d.ts +9 -0
  81. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  82. package/daemon/dist/adapters/claude-code-adapter.js +41 -4
  83. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  84. package/daemon/dist/adapters/claude-resume.d.ts +2 -0
  85. package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
  86. package/daemon/dist/adapters/claude-resume.js +3 -1
  87. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  88. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +5 -0
  89. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  90. package/daemon/dist/adapters/codex-runtime-adapter.js +45 -10
  91. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  92. package/daemon/dist/adapters/kernel-authority.d.ts +7 -0
  93. package/daemon/dist/adapters/kernel-authority.d.ts.map +1 -1
  94. package/daemon/dist/adapters/kernel-authority.js +24 -1
  95. package/daemon/dist/adapters/kernel-authority.js.map +1 -1
  96. package/daemon/dist/adapters/pi-resume.d.ts.map +1 -1
  97. package/daemon/dist/adapters/pi-resume.js +5 -7
  98. package/daemon/dist/adapters/pi-resume.js.map +1 -1
  99. package/daemon/dist/adapters/pi-runner-protocol.d.ts +5 -1
  100. package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -1
  101. package/daemon/dist/adapters/pi-runner.d.ts +34 -0
  102. package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
  103. package/daemon/dist/adapters/pi-runner.js +359 -26
  104. package/daemon/dist/adapters/pi-runner.js.map +1 -1
  105. package/daemon/dist/adapters/pi-runtime-adapter.d.ts +7 -1
  106. package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
  107. package/daemon/dist/adapters/pi-runtime-adapter.js +29 -19
  108. package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
  109. package/daemon/dist/adapters/tmux.d.ts +54 -34
  110. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  111. package/daemon/dist/adapters/tmux.js +183 -57
  112. package/daemon/dist/adapters/tmux.js.map +1 -1
  113. package/daemon/dist/build-info.js +3 -3
  114. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  115. package/daemon/dist/db/all-migrations.js +6 -0
  116. package/daemon/dist/db/all-migrations.js.map +1 -1
  117. package/daemon/dist/db/migrations/171_seat_hook_bridge.d.ts +5 -0
  118. package/daemon/dist/db/migrations/171_seat_hook_bridge.d.ts.map +1 -0
  119. package/daemon/dist/db/migrations/171_seat_hook_bridge.js +25 -0
  120. package/daemon/dist/db/migrations/171_seat_hook_bridge.js.map +1 -0
  121. package/daemon/dist/db/migrations/174_session_launched_cwd.d.ts +6 -0
  122. package/daemon/dist/db/migrations/174_session_launched_cwd.d.ts.map +1 -0
  123. package/daemon/dist/db/migrations/174_session_launched_cwd.js +8 -0
  124. package/daemon/dist/db/migrations/174_session_launched_cwd.js.map +1 -0
  125. package/daemon/dist/db/migrations/175_core_app_access.d.ts +3 -0
  126. package/daemon/dist/db/migrations/175_core_app_access.d.ts.map +1 -0
  127. package/daemon/dist/db/migrations/175_core_app_access.js +26 -0
  128. package/daemon/dist/db/migrations/175_core_app_access.js.map +1 -0
  129. package/daemon/dist/domain/activity-grants.d.ts.map +1 -1
  130. package/daemon/dist/domain/activity-grants.js +6 -4
  131. package/daemon/dist/domain/activity-grants.js.map +1 -1
  132. package/daemon/dist/domain/agent-activity-store.d.ts +23 -0
  133. package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
  134. package/daemon/dist/domain/agent-activity-store.js +62 -5
  135. package/daemon/dist/domain/agent-activity-store.js.map +1 -1
  136. package/daemon/dist/domain/claude-activity-hooks.d.ts +4 -2
  137. package/daemon/dist/domain/claude-activity-hooks.d.ts.map +1 -1
  138. package/daemon/dist/domain/claude-activity-hooks.js +5 -3
  139. package/daemon/dist/domain/claude-activity-hooks.js.map +1 -1
  140. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +64 -3
  141. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  142. package/daemon/dist/domain/claude-compaction-enforcer.js +203 -6
  143. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  144. package/daemon/dist/domain/compaction-restore-notice.d.ts +3 -1
  145. package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
  146. package/daemon/dist/domain/compaction-restore-notice.js +22 -3
  147. package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
  148. package/daemon/dist/domain/configured-account.d.ts +3 -0
  149. package/daemon/dist/domain/configured-account.d.ts.map +1 -0
  150. package/daemon/dist/domain/configured-account.js +10 -0
  151. package/daemon/dist/domain/configured-account.js.map +1 -0
  152. package/daemon/dist/domain/core-app-access.d.ts +51 -0
  153. package/daemon/dist/domain/core-app-access.d.ts.map +1 -0
  154. package/daemon/dist/domain/core-app-access.js +107 -0
  155. package/daemon/dist/domain/core-app-access.js.map +1 -0
  156. package/daemon/dist/domain/core-app-job.d.ts +411 -0
  157. package/daemon/dist/domain/core-app-job.d.ts.map +1 -0
  158. package/daemon/dist/domain/core-app-job.js +537 -0
  159. package/daemon/dist/domain/core-app-job.js.map +1 -0
  160. package/daemon/dist/domain/current-park-arm.d.ts +4 -0
  161. package/daemon/dist/domain/current-park-arm.d.ts.map +1 -0
  162. package/daemon/dist/domain/current-park-arm.js +14 -0
  163. package/daemon/dist/domain/current-park-arm.js.map +1 -0
  164. package/daemon/dist/domain/cwd-resolution.d.ts +12 -0
  165. package/daemon/dist/domain/cwd-resolution.d.ts.map +1 -1
  166. package/daemon/dist/domain/cwd-resolution.js +21 -1
  167. package/daemon/dist/domain/cwd-resolution.js.map +1 -1
  168. package/daemon/dist/domain/execution-view.d.ts.map +1 -1
  169. package/daemon/dist/domain/execution-view.js +9 -3
  170. package/daemon/dist/domain/execution-view.js.map +1 -1
  171. package/daemon/dist/domain/gateway/participants.d.ts +2 -0
  172. package/daemon/dist/domain/gateway/participants.d.ts.map +1 -1
  173. package/daemon/dist/domain/gateway/participants.js +5 -1
  174. package/daemon/dist/domain/gateway/participants.js.map +1 -1
  175. package/daemon/dist/domain/gateway/slack/message.d.ts +1 -0
  176. package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
  177. package/daemon/dist/domain/gateway/slack/message.js +37 -17
  178. package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
  179. package/daemon/dist/domain/gateway/slack/settled-asks.js +1 -1
  180. package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -1
  181. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +1 -0
  182. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
  183. package/daemon/dist/domain/gateway/slack/slack-delivery.js +2 -0
  184. package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
  185. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts +4 -0
  186. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
  187. package/daemon/dist/domain/gateway/slack/slack-subsystem.js +26 -2
  188. package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
  189. package/daemon/dist/domain/hook-bridge.d.ts +345 -0
  190. package/daemon/dist/domain/hook-bridge.d.ts.map +1 -0
  191. package/daemon/dist/domain/hook-bridge.js +547 -0
  192. package/daemon/dist/domain/hook-bridge.js.map +1 -0
  193. package/daemon/dist/domain/hosted-wake.d.ts +9 -0
  194. package/daemon/dist/domain/hosted-wake.d.ts.map +1 -1
  195. package/daemon/dist/domain/hosted-wake.js +45 -6
  196. package/daemon/dist/domain/hosted-wake.js.map +1 -1
  197. package/daemon/dist/domain/human-ask-attention.d.ts +10 -0
  198. package/daemon/dist/domain/human-ask-attention.d.ts.map +1 -0
  199. package/daemon/dist/domain/human-ask-attention.js +22 -0
  200. package/daemon/dist/domain/human-ask-attention.js.map +1 -0
  201. package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts +4 -0
  202. package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts.map +1 -1
  203. package/daemon/dist/domain/mission-control/mission-control-action-log.js +8 -1
  204. package/daemon/dist/domain/mission-control/mission-control-action-log.js.map +1 -1
  205. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +10 -0
  206. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
  207. package/daemon/dist/domain/mission-control/mission-control-write-contract.js +64 -12
  208. package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
  209. package/daemon/dist/domain/native-continuation-notice.d.ts +16 -0
  210. package/daemon/dist/domain/native-continuation-notice.d.ts.map +1 -0
  211. package/daemon/dist/domain/native-continuation-notice.js +79 -0
  212. package/daemon/dist/domain/native-continuation-notice.js.map +1 -0
  213. package/daemon/dist/domain/native-process-lineage.d.ts +16 -0
  214. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
  215. package/daemon/dist/domain/native-process-lineage.js +48 -3
  216. package/daemon/dist/domain/native-process-lineage.js.map +1 -1
  217. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  218. package/daemon/dist/domain/node-inventory.js +27 -6
  219. package/daemon/dist/domain/node-inventory.js.map +1 -1
  220. package/daemon/dist/domain/node-launcher.d.ts +6 -0
  221. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  222. package/daemon/dist/domain/node-launcher.js +16 -2
  223. package/daemon/dist/domain/node-launcher.js.map +1 -1
  224. package/daemon/dist/domain/outbox-handler.d.ts +21 -3
  225. package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
  226. package/daemon/dist/domain/outbox-handler.js +88 -8
  227. package/daemon/dist/domain/outbox-handler.js.map +1 -1
  228. package/daemon/dist/domain/park-wake-text.d.ts +18 -0
  229. package/daemon/dist/domain/park-wake-text.d.ts.map +1 -1
  230. package/daemon/dist/domain/park-wake-text.js +44 -0
  231. package/daemon/dist/domain/park-wake-text.js.map +1 -1
  232. package/daemon/dist/domain/policies/idle-gate-qitem.d.ts +3 -0
  233. package/daemon/dist/domain/policies/idle-gate-qitem.d.ts.map +1 -1
  234. package/daemon/dist/domain/policies/idle-gate-qitem.js +15 -0
  235. package/daemon/dist/domain/policies/idle-gate-qitem.js.map +1 -1
  236. package/daemon/dist/domain/policies/parked-owner-consumer.d.ts +6 -1
  237. package/daemon/dist/domain/policies/parked-owner-consumer.d.ts.map +1 -1
  238. package/daemon/dist/domain/policies/parked-owner-consumer.js +28 -1
  239. package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
  240. package/daemon/dist/domain/process-limits.d.ts +21 -11
  241. package/daemon/dist/domain/process-limits.d.ts.map +1 -1
  242. package/daemon/dist/domain/process-limits.js +74 -20
  243. package/daemon/dist/domain/process-limits.js.map +1 -1
  244. package/daemon/dist/domain/process-table.d.ts +15 -0
  245. package/daemon/dist/domain/process-table.d.ts.map +1 -1
  246. package/daemon/dist/domain/process-table.js +39 -0
  247. package/daemon/dist/domain/process-table.js.map +1 -1
  248. package/daemon/dist/domain/queue-erasure.d.ts.map +1 -1
  249. package/daemon/dist/domain/queue-erasure.js +3 -0
  250. package/daemon/dist/domain/queue-erasure.js.map +1 -1
  251. package/daemon/dist/domain/queue-repository.d.ts +60 -7
  252. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  253. package/daemon/dist/domain/queue-repository.js +178 -36
  254. package/daemon/dist/domain/queue-repository.js.map +1 -1
  255. package/daemon/dist/domain/queue-stuck-sweep.d.ts +2 -0
  256. package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
  257. package/daemon/dist/domain/queue-stuck-sweep.js +29 -0
  258. package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
  259. package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
  260. package/daemon/dist/domain/queue-waiting.js +28 -3
  261. package/daemon/dist/domain/queue-waiting.js.map +1 -1
  262. package/daemon/dist/domain/queue-wake-ladder.d.ts +12 -0
  263. package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
  264. package/daemon/dist/domain/queue-wake-ladder.js +115 -14
  265. package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
  266. package/daemon/dist/domain/queue-wake-repository.d.ts +8 -0
  267. package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
  268. package/daemon/dist/domain/queue-wake-repository.js +48 -8
  269. package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
  270. package/daemon/dist/domain/reconciler.d.ts +18 -2
  271. package/daemon/dist/domain/reconciler.d.ts.map +1 -1
  272. package/daemon/dist/domain/reconciler.js +40 -0
  273. package/daemon/dist/domain/reconciler.js.map +1 -1
  274. package/daemon/dist/domain/restore-attempt-receipt.d.ts.map +1 -1
  275. package/daemon/dist/domain/restore-attempt-receipt.js +3 -2
  276. package/daemon/dist/domain/restore-attempt-receipt.js.map +1 -1
  277. package/daemon/dist/domain/restore-orchestrator.d.ts +5 -1
  278. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  279. package/daemon/dist/domain/restore-orchestrator.js +73 -8
  280. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  281. package/daemon/dist/domain/restore-topology.d.ts +7 -1
  282. package/daemon/dist/domain/restore-topology.d.ts.map +1 -1
  283. package/daemon/dist/domain/restore-topology.js +21 -0
  284. package/daemon/dist/domain/restore-topology.js.map +1 -1
  285. package/daemon/dist/domain/resume-metadata-refresher.d.ts +2 -3
  286. package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
  287. package/daemon/dist/domain/resume-metadata-refresher.js +6 -25
  288. package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
  289. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  290. package/daemon/dist/domain/rig-repository.js +7 -6
  291. package/daemon/dist/domain/rig-repository.js.map +1 -1
  292. package/daemon/dist/domain/rig-teardown.d.ts +16 -3
  293. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  294. package/daemon/dist/domain/rig-teardown.js +73 -9
  295. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  296. package/daemon/dist/domain/rigspec-exporter.js +2 -2
  297. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  298. package/daemon/dist/domain/rigspec-instantiator.d.ts +5 -0
  299. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  300. package/daemon/dist/domain/rigspec-instantiator.js +17 -7
  301. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  302. package/daemon/dist/domain/rosters.d.ts +11 -0
  303. package/daemon/dist/domain/rosters.d.ts.map +1 -1
  304. package/daemon/dist/domain/rosters.js +21 -2
  305. package/daemon/dist/domain/rosters.js.map +1 -1
  306. package/daemon/dist/domain/runner-channel.d.ts +35 -3
  307. package/daemon/dist/domain/runner-channel.d.ts.map +1 -1
  308. package/daemon/dist/domain/runner-channel.js +177 -8
  309. package/daemon/dist/domain/runner-channel.js.map +1 -1
  310. package/daemon/dist/domain/runner-permissions.d.ts +26 -3
  311. package/daemon/dist/domain/runner-permissions.d.ts.map +1 -1
  312. package/daemon/dist/domain/runner-permissions.js +160 -39
  313. package/daemon/dist/domain/runner-permissions.js.map +1 -1
  314. package/daemon/dist/domain/scope/mission-parent.d.ts +19 -0
  315. package/daemon/dist/domain/scope/mission-parent.d.ts.map +1 -0
  316. package/daemon/dist/domain/scope/mission-parent.js +134 -0
  317. package/daemon/dist/domain/scope/mission-parent.js.map +1 -0
  318. package/daemon/dist/domain/scope/scope-audit.d.ts.map +1 -1
  319. package/daemon/dist/domain/scope/scope-audit.js +8 -0
  320. package/daemon/dist/domain/scope/scope-audit.js.map +1 -1
  321. package/daemon/dist/domain/scope/types.d.ts +3 -1
  322. package/daemon/dist/domain/scope/types.d.ts.map +1 -1
  323. package/daemon/dist/domain/scope/types.js +5 -1
  324. package/daemon/dist/domain/scope/types.js.map +1 -1
  325. package/daemon/dist/domain/seat-delivery-guard.d.ts +14 -2
  326. package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
  327. package/daemon/dist/domain/seat-delivery-guard.js +53 -14
  328. package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
  329. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  330. package/daemon/dist/domain/seat-handover-service.js +9 -4
  331. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  332. package/daemon/dist/domain/seat-identity-reconciler.d.ts +4 -3
  333. package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
  334. package/daemon/dist/domain/seat-identity-reconciler.js +40 -5
  335. package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
  336. package/daemon/dist/domain/seat-lifecycle-service.d.ts +14 -6
  337. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  338. package/daemon/dist/domain/seat-lifecycle-service.js +104 -22
  339. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  340. package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
  341. package/daemon/dist/domain/seat-restart-in-place.js +4 -1
  342. package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
  343. package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
  344. package/daemon/dist/domain/seat-runtime-switch-service.js +2 -0
  345. package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
  346. package/daemon/dist/domain/seat-skill-apply.d.ts +1 -1
  347. package/daemon/dist/domain/seat-skill-apply.d.ts.map +1 -1
  348. package/daemon/dist/domain/seat-skill-apply.js +3 -2
  349. package/daemon/dist/domain/seat-skill-apply.js.map +1 -1
  350. package/daemon/dist/domain/session-registry.d.ts +5 -1
  351. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  352. package/daemon/dist/domain/session-registry.js +12 -1
  353. package/daemon/dist/domain/session-registry.js.map +1 -1
  354. package/daemon/dist/domain/session-transport.d.ts +40 -1
  355. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  356. package/daemon/dist/domain/session-transport.js +211 -10
  357. package/daemon/dist/domain/session-transport.js.map +1 -1
  358. package/daemon/dist/domain/shared-history-selection.d.ts.map +1 -1
  359. package/daemon/dist/domain/shared-history-selection.js +9 -5
  360. package/daemon/dist/domain/shared-history-selection.js.map +1 -1
  361. package/daemon/dist/domain/slices/slice-indexer.d.ts +1 -1
  362. package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -1
  363. package/daemon/dist/domain/slices/slice-indexer.js +4 -0
  364. package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
  365. package/daemon/dist/domain/startup-orchestrator.d.ts +1 -0
  366. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  367. package/daemon/dist/domain/startup-orchestrator.js +6 -4
  368. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  369. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  370. package/daemon/dist/domain/successor-session-launcher.js +10 -4
  371. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  372. package/daemon/dist/domain/terminal/herdr-adapter.d.ts +35 -1
  373. package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
  374. package/daemon/dist/domain/terminal/herdr-adapter.js +231 -33
  375. package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
  376. package/daemon/dist/domain/terminal/herdr-sessions.d.ts.map +1 -1
  377. package/daemon/dist/domain/terminal/herdr-sessions.js +2 -1
  378. package/daemon/dist/domain/terminal/herdr-sessions.js.map +1 -1
  379. package/daemon/dist/domain/terminal/rig-viewer-records.d.ts +59 -0
  380. package/daemon/dist/domain/terminal/rig-viewer-records.d.ts.map +1 -0
  381. package/daemon/dist/domain/terminal/rig-viewer-records.js +210 -0
  382. package/daemon/dist/domain/terminal/rig-viewer-records.js.map +1 -0
  383. package/daemon/dist/domain/terminal/terminal-provider.d.ts +2 -0
  384. package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
  385. package/daemon/dist/domain/terminal/terminal-service.d.ts +99 -4
  386. package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
  387. package/daemon/dist/domain/terminal/terminal-service.js +556 -36
  388. package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
  389. package/daemon/dist/domain/terminal/tile-layout.js +1 -1
  390. package/daemon/dist/domain/terminal/tile-layout.js.map +1 -1
  391. package/daemon/dist/domain/terminal/tmux-viewer-guard.d.ts +25 -0
  392. package/daemon/dist/domain/terminal/tmux-viewer-guard.d.ts.map +1 -0
  393. package/daemon/dist/domain/terminal/tmux-viewer-guard.js +70 -0
  394. package/daemon/dist/domain/terminal/tmux-viewer-guard.js.map +1 -0
  395. package/daemon/dist/domain/transcript-grep-worker.d.ts +2 -0
  396. package/daemon/dist/domain/transcript-grep-worker.d.ts.map +1 -0
  397. package/daemon/dist/domain/transcript-grep-worker.js +108 -0
  398. package/daemon/dist/domain/transcript-grep-worker.js.map +1 -0
  399. package/daemon/dist/domain/transcript-grep.d.ts +26 -0
  400. package/daemon/dist/domain/transcript-grep.d.ts.map +1 -0
  401. package/daemon/dist/domain/transcript-grep.js +90 -0
  402. package/daemon/dist/domain/transcript-grep.js.map +1 -0
  403. package/daemon/dist/domain/transcript-store.d.ts +8 -2
  404. package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
  405. package/daemon/dist/domain/transcript-store.js +10 -60
  406. package/daemon/dist/domain/transcript-store.js.map +1 -1
  407. package/daemon/dist/domain/types.d.ts +69 -2
  408. package/daemon/dist/domain/types.d.ts.map +1 -1
  409. package/daemon/dist/domain/types.js.map +1 -1
  410. package/daemon/dist/domain/watchdog-delivery-receipts.d.ts +4 -0
  411. package/daemon/dist/domain/watchdog-delivery-receipts.d.ts.map +1 -1
  412. package/daemon/dist/domain/watchdog-delivery-receipts.js +35 -2
  413. package/daemon/dist/domain/watchdog-delivery-receipts.js.map +1 -1
  414. package/daemon/dist/domain/watchdog-delivery.d.ts +44 -0
  415. package/daemon/dist/domain/watchdog-delivery.d.ts.map +1 -1
  416. package/daemon/dist/domain/watchdog-delivery.js +60 -2
  417. package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
  418. package/daemon/dist/domain/watchdog-history-log.d.ts +12 -0
  419. package/daemon/dist/domain/watchdog-history-log.d.ts.map +1 -1
  420. package/daemon/dist/domain/watchdog-history-log.js +19 -1
  421. package/daemon/dist/domain/watchdog-history-log.js.map +1 -1
  422. package/daemon/dist/domain/watchdog-jobs-repository.d.ts +32 -0
  423. package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
  424. package/daemon/dist/domain/watchdog-jobs-repository.js +78 -0
  425. package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
  426. package/daemon/dist/domain/watchdog-policy-engine.d.ts +17 -3
  427. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  428. package/daemon/dist/domain/watchdog-policy-engine.js +19 -5
  429. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  430. package/daemon/dist/domain/workflow-projector.js +1 -1
  431. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  432. package/daemon/dist/domain/workflow-runtime.d.ts +12 -0
  433. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  434. package/daemon/dist/domain/workflow-runtime.js +64 -7
  435. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  436. package/daemon/dist/domain/workflow-step-trail-log.d.ts +2 -2
  437. package/daemon/dist/domain/workflow-step-trail-log.d.ts.map +1 -1
  438. package/daemon/dist/domain/workflow-step-trail-log.js.map +1 -1
  439. package/daemon/dist/domain/workflow-types.d.ts +3 -1
  440. package/daemon/dist/domain/workflow-types.d.ts.map +1 -1
  441. package/daemon/dist/domain/workflow-types.js.map +1 -1
  442. package/daemon/dist/index.d.ts.map +1 -1
  443. package/daemon/dist/index.js +5 -1
  444. package/daemon/dist/index.js.map +1 -1
  445. package/daemon/dist/lib/pane-envelope.d.ts +3 -0
  446. package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
  447. package/daemon/dist/lib/pane-envelope.js +3 -1
  448. package/daemon/dist/lib/pane-envelope.js.map +1 -1
  449. package/daemon/dist/mission-parent-surface.d.ts +2 -0
  450. package/daemon/dist/mission-parent-surface.d.ts.map +1 -0
  451. package/daemon/dist/mission-parent-surface.js +2 -0
  452. package/daemon/dist/mission-parent-surface.js.map +1 -0
  453. package/daemon/dist/routes/activity.d.ts +18 -1
  454. package/daemon/dist/routes/activity.d.ts.map +1 -1
  455. package/daemon/dist/routes/activity.js +47 -9
  456. package/daemon/dist/routes/activity.js.map +1 -1
  457. package/daemon/dist/routes/attention.d.ts.map +1 -1
  458. package/daemon/dist/routes/attention.js +194 -177
  459. package/daemon/dist/routes/attention.js.map +1 -1
  460. package/daemon/dist/routes/core-app.d.ts +10 -0
  461. package/daemon/dist/routes/core-app.d.ts.map +1 -0
  462. package/daemon/dist/routes/core-app.js +175 -0
  463. package/daemon/dist/routes/core-app.js.map +1 -0
  464. package/daemon/dist/routes/hook-bridge.d.ts +3 -0
  465. package/daemon/dist/routes/hook-bridge.d.ts.map +1 -0
  466. package/daemon/dist/routes/hook-bridge.js +158 -0
  467. package/daemon/dist/routes/hook-bridge.js.map +1 -0
  468. package/daemon/dist/routes/missions.d.ts.map +1 -1
  469. package/daemon/dist/routes/missions.js +14 -2
  470. package/daemon/dist/routes/missions.js.map +1 -1
  471. package/daemon/dist/routes/queue.d.ts +1 -1
  472. package/daemon/dist/routes/queue.d.ts.map +1 -1
  473. package/daemon/dist/routes/queue.js +8 -5
  474. package/daemon/dist/routes/queue.js.map +1 -1
  475. package/daemon/dist/routes/rigspec.js +1 -1
  476. package/daemon/dist/routes/rigspec.js.map +1 -1
  477. package/daemon/dist/routes/scope-audit.d.ts.map +1 -1
  478. package/daemon/dist/routes/scope-audit.js +7 -1
  479. package/daemon/dist/routes/scope-audit.js.map +1 -1
  480. package/daemon/dist/routes/seat.d.ts.map +1 -1
  481. package/daemon/dist/routes/seat.js +30 -4
  482. package/daemon/dist/routes/seat.js.map +1 -1
  483. package/daemon/dist/routes/slices.d.ts.map +1 -1
  484. package/daemon/dist/routes/slices.js +21 -2
  485. package/daemon/dist/routes/slices.js.map +1 -1
  486. package/daemon/dist/routes/startup.js +2 -1
  487. package/daemon/dist/routes/startup.js.map +1 -1
  488. package/daemon/dist/routes/terminal.d.ts.map +1 -1
  489. package/daemon/dist/routes/terminal.js +47 -6
  490. package/daemon/dist/routes/terminal.js.map +1 -1
  491. package/daemon/dist/routes/transcripts.d.ts.map +1 -1
  492. package/daemon/dist/routes/transcripts.js +16 -1
  493. package/daemon/dist/routes/transcripts.js.map +1 -1
  494. package/daemon/dist/routes/watchdog.d.ts.map +1 -1
  495. package/daemon/dist/routes/watchdog.js +3 -2
  496. package/daemon/dist/routes/watchdog.js.map +1 -1
  497. package/daemon/dist/routes/workflow.d.ts.map +1 -1
  498. package/daemon/dist/routes/workflow.js +5 -0
  499. package/daemon/dist/routes/workflow.js.map +1 -1
  500. package/daemon/dist/server.d.ts +2 -0
  501. package/daemon/dist/server.d.ts.map +1 -1
  502. package/daemon/dist/server.js +11 -0
  503. package/daemon/dist/server.js.map +1 -1
  504. package/daemon/dist/startup.d.ts.map +1 -1
  505. package/daemon/dist/startup.js +90 -33
  506. package/daemon/dist/startup.js.map +1 -1
  507. package/daemon/dist/terminal-viewer-guard-surface.d.ts +2 -0
  508. package/daemon/dist/terminal-viewer-guard-surface.d.ts.map +1 -0
  509. package/daemon/dist/terminal-viewer-guard-surface.js +2 -0
  510. package/daemon/dist/terminal-viewer-guard-surface.js.map +1 -0
  511. package/daemon/docs/reference/agent-startup-guide.md +4 -1
  512. package/daemon/docs/reference/claude-status-line.md +3 -2
  513. package/daemon/docs/reference/community-harness-examples/cursor/openrig-cursor-launch +6 -0
  514. package/daemon/docs/reference/community-harness-examples/dsh/README.md +1 -1
  515. package/daemon/docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs +186 -30
  516. package/daemon/docs/reference/community-harness-examples/hermes/openrig-hermes-launch +6 -0
  517. package/daemon/docs/reference/community-harness-examples/openclaw/openrig-openclaw-launch +6 -0
  518. package/daemon/docs/reference/community-harness-examples/openshell/README.md +2 -0
  519. package/daemon/docs/reference/community-harness-examples/pi-tui/openrig-pi-tui-launch +6 -0
  520. package/daemon/docs/reference/community-harness-presets.md +6 -5
  521. package/daemon/docs/reference/core-app.md +212 -0
  522. package/daemon/docs/reference/daemon-http-clients.md +6 -0
  523. package/daemon/docs/reference/getting-started.md +9 -4
  524. package/daemon/docs/reference/harness-runner-contract.md +50 -4
  525. package/daemon/docs/reference/hosted-members.md +21 -1
  526. package/daemon/docs/reference/quickstart.md +4 -3
  527. package/daemon/docs/reference/rig-spec.md +56 -26
  528. package/daemon/docs/reference/rosters.md +8 -0
  529. package/daemon/docs/reference/sdlc-conventions.md +42 -5
  530. package/daemon/docs/reference/seat-delivery.md +87 -6
  531. package/daemon/docs/reference/terminal-sessions.md +99 -1
  532. package/daemon/docs/reference/whats-new.md +82 -11
  533. package/daemon/specs/rigs/launch/factory/guidance/lead-first-move.md +4 -3
  534. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +13 -3
  535. package/daemon/specs/rigs/launch/starter/guidance/lead-first-move.md +4 -3
  536. package/dist/ask-wake.d.ts.map +1 -1
  537. package/dist/ask-wake.js +8 -1
  538. package/dist/ask-wake.js.map +1 -1
  539. package/dist/build-info.js +3 -3
  540. package/dist/commands/archive.js +1 -1
  541. package/dist/commands/archive.js.map +1 -1
  542. package/dist/commands/daemon.d.ts.map +1 -1
  543. package/dist/commands/daemon.js +7 -0
  544. package/dist/commands/daemon.js.map +1 -1
  545. package/dist/commands/down.d.ts.map +1 -1
  546. package/dist/commands/down.js +5 -0
  547. package/dist/commands/down.js.map +1 -1
  548. package/dist/commands/ps.d.ts +2 -1
  549. package/dist/commands/ps.d.ts.map +1 -1
  550. package/dist/commands/ps.js +9 -4
  551. package/dist/commands/ps.js.map +1 -1
  552. package/dist/commands/queue.js +4 -4
  553. package/dist/commands/queue.js.map +1 -1
  554. package/dist/commands/roster.d.ts +5 -0
  555. package/dist/commands/roster.d.ts.map +1 -1
  556. package/dist/commands/scope.d.ts.map +1 -1
  557. package/dist/commands/scope.js +346 -9
  558. package/dist/commands/scope.js.map +1 -1
  559. package/dist/commands/seat.d.ts.map +1 -1
  560. package/dist/commands/seat.js +90 -8
  561. package/dist/commands/seat.js.map +1 -1
  562. package/dist/commands/send.d.ts +2 -0
  563. package/dist/commands/send.d.ts.map +1 -1
  564. package/dist/commands/send.js +3 -1
  565. package/dist/commands/send.js.map +1 -1
  566. package/dist/commands/terminal.d.ts +56 -0
  567. package/dist/commands/terminal.d.ts.map +1 -1
  568. package/dist/commands/terminal.js +194 -4
  569. package/dist/commands/terminal.js.map +1 -1
  570. package/dist/commands/transcript.js +1 -1
  571. package/dist/commands/transcript.js.map +1 -1
  572. package/dist/commands/unarchive.js +1 -1
  573. package/dist/commands/unarchive.js.map +1 -1
  574. package/dist/commands/workflow-follow.d.ts +3 -1
  575. package/dist/commands/workflow-follow.d.ts.map +1 -1
  576. package/dist/commands/workflow-follow.js +25 -6
  577. package/dist/commands/workflow-follow.js.map +1 -1
  578. package/dist/commands/workflow-render.d.ts.map +1 -1
  579. package/dist/commands/workflow-render.js +5 -1
  580. package/dist/commands/workflow-render.js.map +1 -1
  581. package/dist/commands/workflow.d.ts.map +1 -1
  582. package/dist/commands/workflow.js +14 -4
  583. package/dist/commands/workflow.js.map +1 -1
  584. package/dist/daemon-lifecycle.d.ts.map +1 -1
  585. package/dist/daemon-lifecycle.js +11 -0
  586. package/dist/daemon-lifecycle.js.map +1 -1
  587. package/dist/lib/scope/mission-composition.d.ts +1 -0
  588. package/dist/lib/scope/mission-composition.d.ts.map +1 -1
  589. package/dist/lib/scope/mission-composition.js +14 -0
  590. package/dist/lib/scope/mission-composition.js.map +1 -1
  591. package/dist/lib/scope/scope-audit.d.ts.map +1 -1
  592. package/dist/lib/scope/scope-audit.js +8 -0
  593. package/dist/lib/scope/scope-audit.js.map +1 -1
  594. package/dist/lib/scope/scope-fs.d.ts +10 -0
  595. package/dist/lib/scope/scope-fs.d.ts.map +1 -1
  596. package/dist/lib/scope/scope-fs.js +60 -0
  597. package/dist/lib/scope/scope-fs.js.map +1 -1
  598. package/dist/lib/scope/types.d.ts +3 -1
  599. package/dist/lib/scope/types.d.ts.map +1 -1
  600. package/dist/lib/scope/types.js +5 -1
  601. package/dist/lib/scope/types.js.map +1 -1
  602. package/dist/mcp-server.d.ts.map +1 -1
  603. package/dist/mcp-server.js +18 -8
  604. package/dist/mcp-server.js.map +1 -1
  605. package/dist/restore-packet/packet-writer.d.ts.map +1 -1
  606. package/dist/restore-packet/packet-writer.js +8 -5
  607. package/dist/restore-packet/packet-writer.js.map +1 -1
  608. package/dist/terminal-window.d.ts +2 -1
  609. package/dist/terminal-window.d.ts.map +1 -1
  610. package/dist/terminal-window.js +567 -41
  611. package/dist/terminal-window.js.map +1 -1
  612. package/package.json +1 -1
  613. package/tui/dist/daemon-client.d.ts +4 -0
  614. package/tui/dist/daemon-client.d.ts.map +1 -1
  615. package/tui/dist/daemon-client.js.map +1 -1
  616. package/tui/dist/execution/execution-model.d.ts.map +1 -1
  617. package/tui/dist/execution/execution-model.js +22 -5
  618. package/tui/dist/execution/execution-model.js.map +1 -1
  619. package/tui/dist/hydrate.d.ts.map +1 -1
  620. package/tui/dist/hydrate.js +6 -3
  621. package/tui/dist/hydrate.js.map +1 -1
  622. package/tui/dist/navigator.d.ts +1 -1
  623. package/tui/dist/navigator.d.ts.map +1 -1
  624. package/tui/dist/navigator.js +4 -2
  625. package/tui/dist/navigator.js.map +1 -1
  626. package/tui/dist/pulse/render-pulse.d.ts.map +1 -1
  627. package/tui/dist/pulse/render-pulse.js +7 -14
  628. package/tui/dist/pulse/render-pulse.js.map +1 -1
  629. package/tui/dist/render.d.ts.map +1 -1
  630. package/tui/dist/render.js +29 -21
  631. package/tui/dist/render.js.map +1 -1
  632. package/tui/dist/stylize.d.ts.map +1 -1
  633. package/tui/dist/stylize.js +3 -3
  634. package/tui/dist/stylize.js.map +1 -1
  635. package/tui/dist/terminals/terminal-model.d.ts +1 -0
  636. package/tui/dist/terminals/terminal-model.d.ts.map +1 -1
  637. package/tui/dist/terminals/terminal-model.js +4 -2
  638. package/tui/dist/terminals/terminal-model.js.map +1 -1
  639. package/tui/dist/types.d.ts +1 -0
  640. package/tui/dist/types.d.ts.map +1 -1
  641. package/tui/dist/visual-layout.d.ts +3 -0
  642. package/tui/dist/visual-layout.d.ts.map +1 -1
  643. package/tui/dist/visual-layout.js +17 -0
  644. package/tui/dist/visual-layout.js.map +1 -1
  645. package/ui/dist/assets/{index-1O1f3A7K.js → index-B-sMy02c.js} +107 -107
  646. package/ui/dist/assets/{index-BX8TUZ0E.css → index-DiN7RwWg.css} +1 -1
  647. package/ui/dist/index.html +2 -2
package/README.md CHANGED
@@ -26,14 +26,15 @@ use:
26
26
 
27
27
  ```sh
28
28
  # Claude Code
29
- npx skills add https://github.com/mvschwarz/openrig/tree/v0.7.18/skills/rigs --skill rigs --agent claude-code
29
+ npx skills add https://github.com/mvschwarz/openrig/tree/v0.7.19/skills/rigs --skill rigs --agent claude-code
30
30
  # Codex
31
- npx skills add https://github.com/mvschwarz/openrig/tree/v0.7.18/skills/rigs --skill rigs --agent codex
31
+ npx skills add https://github.com/mvschwarz/openrig/tree/v0.7.19/skills/rigs --skill rigs --agent codex
32
32
  ```
33
33
 
34
34
  Then type `/rigs` in Claude Code, or `$rigs` in Codex, and say what you want built. The skill has your agent tell
35
35
  you what it will run and change before it does, install OpenRig, open the OpenRig view and pass your goal to
36
- OpenRig's operator.
36
+ OpenRig's operator. If Claude Code was already running when you added the skill, type `/reload-skills` first, or start
37
+ a new session: a session doesn't see a skills folder created after it started.
37
38
 
38
39
  You need Node.js 22 or 24 (22 on Apple silicon), tmux, macOS or Linux (WSL2 on Windows), and Claude Code or Codex
39
40
  signed in. One provider is enough to start.
@@ -68,11 +69,11 @@ Setting up Node.js on Linux, on a Mac where you aren't an administrator, or on W
68
69
 
69
70
  ### Install it yourself
70
71
 
71
- This runs OpenRig's install script from the `v0.7.18` release. It checks Node.js and npm, installs the latest published `@openrig/cli` with `npm install -g`, runs the Node.js and SQLite check, then runs `rig setup --dry-run` and `rig setup`. The first line prints that plan and changes nothing:
72
+ This runs OpenRig's install script from the `v0.7.19` release. It checks Node.js and npm, installs the latest published `@openrig/cli` with `npm install -g`, runs the Node.js and SQLite check, then runs `rig setup --dry-run` and `rig setup`. The first line prints that plan and changes nothing:
72
73
 
73
74
  ```bash
74
- curl -fsSL https://raw.githubusercontent.com/mvschwarz/openrig/v0.7.18/scripts/install.sh | sh -s -- --dry-run
75
- curl -fsSL https://raw.githubusercontent.com/mvschwarz/openrig/v0.7.18/scripts/install.sh | sh
75
+ curl -fsSL https://raw.githubusercontent.com/mvschwarz/openrig/v0.7.19/scripts/install.sh | sh -s -- --dry-run
76
+ curl -fsSL https://raw.githubusercontent.com/mvschwarz/openrig/v0.7.19/scripts/install.sh | sh
76
77
  ```
77
78
 
78
79
  If the last step isn't ready, the installer reports `INSTALLED, SETUP NOT COMPLETE` and points to the details from `rig setup` above. Follow that output and any reported Fix, then rerun `rig setup`; the CLI does not need reinstalling. If the only remaining failures are provider sign-ins, sign in to each selected provider as below and continue.
@@ -0,0 +1,146 @@
1
+ #!/usr/bin/env node
2
+ // Slice 13: an opted-in Claude seat's hook bridge, run by the hooks its OpenRig launch adds.
3
+ //
4
+ // node claude-hook-bridge.cjs waiter SessionStart and Stop, as `asyncRewake` command hooks: arm with the daemon at
5
+ // this turn boundary, poll for the seat's queued messages, write them to stderr
6
+ // and exit 2, which wakes Claude with them in its context. Exits 0 when superseded
7
+ // by a newer waiter, when the occupant was replaced, or at its own deadline.
8
+ // node claude-hook-bridge.cjs turn UserPromptSubmit: tell the daemon a turn started, so nothing is delivered into
9
+ // a running turn. Always exits 0 at once: it never blocks a prompt.
10
+ //
11
+ // It reaches the daemon the way the activity relay does (OPENRIG_URL and OPENRIG_ACTIVITY_HOOK_TOKEN, else
12
+ // $OPENRIG_HOME/activity-endpoint.json) and names its seat by OPENRIG_SESSION_NAME, OPENRIG_NODE_ID and
13
+ // OPENRIG_OCCUPANT_GENERATION. It never types into the terminal.
14
+ "use strict";
15
+ const fs = require("node:fs");
16
+ const os = require("node:os");
17
+ const path = require("node:path");
18
+
19
+ const POLL_MS = 1000;
20
+ const UNREACHABLE_MS = 2000;
21
+ const REQUEST_TIMEOUT_MS = 5000;
22
+
23
+ const first = (...values) => values.find((v) => typeof v === "string" && v.length > 0) || "";
24
+
25
+ function endpoint(env = process.env) {
26
+ let baseUrl = first(env.OPENRIG_URL, env.RIGGED_URL);
27
+ let token = first(env.OPENRIG_ACTIVITY_HOOK_TOKEN, env.RIGGED_ACTIVITY_HOOK_TOKEN);
28
+ if (!baseUrl && first(env.OPENRIG_PORT)) baseUrl = `http://${first(env.OPENRIG_HOST) || "127.0.0.1"}:${env.OPENRIG_PORT}`;
29
+ if (!baseUrl || !token) {
30
+ try {
31
+ const home = first(env.OPENRIG_HOME, env.RIGGED_HOME) || path.join(os.homedir(), ".openrig");
32
+ const parsed = JSON.parse(fs.readFileSync(path.join(home, "activity-endpoint.json"), "utf8"));
33
+ if (!baseUrl && typeof parsed.baseUrl === "string") baseUrl = parsed.baseUrl;
34
+ if (!token && typeof parsed.token === "string") token = parsed.token;
35
+ } catch { /* absent: the waiter can't reach the daemon and exits 0 */ }
36
+ }
37
+ return { baseUrl, token };
38
+ }
39
+
40
+ function seat(env = process.env) {
41
+ return { sessionName: first(env.OPENRIG_SESSION_NAME, env.RIGGED_SESSION_NAME), nodeId: first(env.OPENRIG_NODE_ID, env.RIGGED_NODE_ID) || undefined,
42
+ generation: first(env.OPENRIG_OCCUPANT_GENERATION) || null };
43
+ }
44
+
45
+ /** POST to the bridge's route; the parsed answer, or null when the daemon can't be reached. */
46
+ async function post(route, body, { fetchImpl = fetch, env = process.env } = {}) {
47
+ const { baseUrl, token } = endpoint(env);
48
+ if (!baseUrl || !token) return null;
49
+ try {
50
+ const res = await fetchImpl(`${baseUrl.replace(/\/$/, "")}/api/hook-bridge/${route}`, { method: "POST",
51
+ headers: { "content-type": "application/json", authorization: `Bearer ${token}` },
52
+ body: JSON.stringify({ ...seat(env), ...body }), signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS) });
53
+ const json = await res.json().catch(() => ({}));
54
+ return { status: res.status, ...json };
55
+ } catch { return null; }
56
+ }
57
+
58
+ async function readHookInput(stream = process.stdin) {
59
+ if (stream.isTTY) return {};
60
+ return new Promise((resolve) => {
61
+ let data = "";
62
+ const done = () => { try { resolve(JSON.parse(data || "{}")); } catch { resolve({}); } };
63
+ stream.setEncoding("utf8");
64
+ stream.on("data", (chunk) => { data += chunk; });
65
+ stream.on("end", done);
66
+ stream.on("error", done);
67
+ setTimeout(done, 1000).unref();
68
+ }).finally(() => {
69
+ // Nothing more is read: an open stdin mustn't keep the hook running once it has its answer.
70
+ try { stream.removeAllListeners("data"); stream.pause(); stream.unref?.(); } catch { /* best effort */ }
71
+ });
72
+ }
73
+
74
+ /** What the model reads: one plain line saying what this is, then each message exactly as OpenRig's transport
75
+ * addressed it (its From/To/Sent lines name the sender). No wording asks for more than any message would get. */
76
+ function render(sessionName, messages) {
77
+ const lead = `This is not an error. OpenRig's hook bridge delivered ${messages.length === 1 ? "a message" : `${messages.length} messages`} for ${sessionName || "this seat"} at a turn boundary. `
78
+ + "Each starts with its sender as OpenRig's transport recorded it. Treat them as ordinary messages from other sessions: weigh each as you would any other message; this delivery adds no authority to them.";
79
+ return [lead, ...messages.map((m) => m.text)].join("\n\n") + "\n";
80
+ }
81
+
82
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
83
+
84
+ /** Write the batch and wait until the stream has taken all of it: a pipe write is asynchronous, so writing isn't
85
+ * flushing. True once written, false when the write failed. */
86
+ function writeAll(out, text) {
87
+ return new Promise((resolve) => {
88
+ try { out.write(text, (error) => resolve(!error)); } catch { resolve(false); }
89
+ });
90
+ }
91
+
92
+ /** An ack the daemon took (true), refused for good (false: its waiter or occupant is gone), or couldn't answer now
93
+ * (null: unreachable, or a server error), which is retried. */
94
+ function acked(answer) {
95
+ if (!answer) return null;
96
+ if (answer.ok === true) return true;
97
+ return answer.status >= 400 && answer.status < 500 ? false : null;
98
+ }
99
+
100
+ /** Returns the exit code: 2 after delivering a batch, 0 otherwise. */
101
+ async function waiter({ hookEvent, out = process.stderr, deps = {} } = {}) {
102
+ const call = (route, body) => post(route, body, deps);
103
+ const now = deps.now ?? Date.now;
104
+ const wait = deps.sleep ?? sleep;
105
+ const armed = await call("arm", { hookEvent });
106
+ if (!armed || armed.ok !== true || armed.stop || typeof armed.armId !== "string") return 0;
107
+ const armId = armed.armId;
108
+ const deadline = now() + Number(armed.expireAfterSeconds ?? 7080) * 1000;
109
+ while (now() < deadline) {
110
+ const answer = await call("poll", { armId });
111
+ if (!answer) { await wait(UNREACHABLE_MS); continue; }
112
+ if (answer.stop || answer.action === "superseded" || answer.action === "stop") return 0;
113
+ if (answer.action === "rearm") { await call("arm", { hookEvent: "rearm", armId }); continue; }
114
+ if (answer.action === "deliver" && Array.isArray(answer.messages) && answer.messages.length) {
115
+ // Only a batch fully written to the hook's output is acked. A failed write isn't: the daemon then names the batch
116
+ // uncertain, never resent, and this waiter doesn't wake Claude.
117
+ if (!(await writeAll(out, render(seat(deps.env).sessionName, answer.messages)))) return 0;
118
+ // The ack says the batch was handed to the hook's output. One the daemon couldn't take now is retried, three tries
119
+ // in all; if none lands, the daemon marks the batch uncertain rather than resending it.
120
+ for (let tries = 0; tries < 3; tries++) {
121
+ const result = acked(await call("ack", { armId, batchId: answer.batchId }));
122
+ if (result !== null) break;
123
+ if (tries < 2) await wait(UNREACHABLE_MS);
124
+ }
125
+ return 2;
126
+ }
127
+ await wait(POLL_MS);
128
+ }
129
+ await call("expired", { armId });
130
+ return 0;
131
+ }
132
+
133
+ async function main() {
134
+ const mode = process.argv[2];
135
+ const input = await readHookInput();
136
+ if (mode === "turn") { await post("turn", { hookEvent: "UserPromptSubmit" }); process.exitCode = 0; return; }
137
+ if (mode !== "waiter") { process.exitCode = 0; return; }
138
+ const code = await waiter({ hookEvent: typeof input.hook_event_name === "string" ? input.hook_event_name : "unknown" }).catch(() => 0);
139
+ // exitCode, not exit(): the process ends once its output is flushed. The batch was already written in full above; if
140
+ // an idle connection still holds the loop open, end it shortly after, with the same code.
141
+ process.exitCode = code;
142
+ setTimeout(() => process.exit(code), 2000).unref();
143
+ }
144
+
145
+ if (require.main === module) void main();
146
+ module.exports = { render, waiter, endpoint };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openrig",
3
- "version": "0.7.18",
3
+ "version": "0.7.19",
4
4
  "description": "Work with your OpenRig team from your coding agent: hand it work, follow that work, answer its questions and read what it returns.",
5
5
  "author": {
6
6
  "name": "Mike Schwarz",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openrig",
3
- "version": "0.7.18",
3
+ "version": "0.7.19",
4
4
  "description": "Work with your OpenRig team from your coding agent: hand it work, follow that work, answer its questions and read what it returns.",
5
5
  "author": {
6
6
  "name": "Mike Schwarz",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openrig",
3
- "version": "0.7.18",
3
+ "version": "0.7.19",
4
4
  "description": "Work with your OpenRig team from your coding agent: hand it work, follow that work, answer its questions and read what it returns.",
5
5
  "logo": "assets/logo.svg"
6
6
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "openrig",
4
- "version": "0.7.18",
4
+ "version": "0.7.19",
5
5
  "description": "Work with your OpenRig team from your coding agent: hand it work, follow that work, answer its questions and read what it returns.",
6
6
  "author": {
7
7
  "name": "Mike Schwarz",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openrig-core",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "description": "OpenRig canonical skills and hooks for cross-runtime agent topology coordination, continuity, and operating discipline.",
5
5
  "author": {
6
6
  "name": "Mike Schwarz",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openrig-core",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "description": "OpenRig canonical skills and hooks for cross-runtime agent topology coordination, continuity, and operating discipline.",
5
5
  "author": {
6
6
  "name": "Mike Schwarz",
@@ -26,7 +26,7 @@ This plugin ships dual-manifest packaging — both `.claude-plugin/` and `.codex
26
26
  A seat that has OpenRig's activity relay in its own `settings.local.json` (the `claude-activity-hooks` runtime resource)
27
27
  already reports activity from there, so the plugin's `activity-relay.cjs` (which the manifest starts with `--from-plugin`)
28
28
  exits for an event the seat's settings register it for. It does so only when the entry is exactly the one OpenRig writes
29
- (legacy `node` or a quoted absolute Node executable, then one quoted path to
29
+ (legacy `node` or a quoted absolute Node executable, optionally after one plain leading `exec`, then one quoted path to
30
30
  `state/claude-activity-hooks/activity-relay.cjs`), the interpreter is executable, and the script at that path is this same
31
31
  script. A missing interpreter/script, a different script, or a wrapper around it never silences the plugin. A seat without
32
32
  that resource, and a plugin installed outside OpenRig, report through the plugin's relay, so each event is reported once.
@@ -5,7 +5,7 @@
5
5
  "hooks": [
6
6
  {
7
7
  "type": "command",
8
- "command": "\"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/activity-relay.cjs\" --from-plugin",
8
+ "command": "exec \"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/activity-relay.cjs\" --from-plugin",
9
9
  "timeout": 5
10
10
  }
11
11
  ]
@@ -15,7 +15,7 @@
15
15
  "hooks": [
16
16
  {
17
17
  "type": "command",
18
- "command": "\"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/compaction-restore-bridge.cjs\"",
18
+ "command": "exec \"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/compaction-restore-bridge.cjs\"",
19
19
  "timeout": 5
20
20
  }
21
21
  ]
@@ -26,7 +26,7 @@
26
26
  "hooks": [
27
27
  {
28
28
  "type": "command",
29
- "command": "\"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/activity-relay.cjs\" --from-plugin",
29
+ "command": "exec \"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/activity-relay.cjs\" --from-plugin",
30
30
  "timeout": 5
31
31
  }
32
32
  ]
@@ -35,7 +35,7 @@
35
35
  "hooks": [
36
36
  {
37
37
  "type": "command",
38
- "command": "\"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/compaction-restore-bridge.cjs\"",
38
+ "command": "exec \"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/compaction-restore-bridge.cjs\"",
39
39
  "timeout": 5
40
40
  }
41
41
  ]
@@ -44,7 +44,7 @@
44
44
  "hooks": [
45
45
  {
46
46
  "type": "command",
47
- "command": "\"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/refocus.cjs\" --runtime claude",
47
+ "command": "exec \"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/refocus.cjs\" --runtime claude",
48
48
  "timeout": 60
49
49
  }
50
50
  ]
@@ -55,7 +55,7 @@
55
55
  "hooks": [
56
56
  {
57
57
  "type": "command",
58
- "command": "\"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/skills/claude-compaction-restore/scripts/precompact-hook.mjs\"",
58
+ "command": "exec \"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/skills/claude-compaction-restore/scripts/precompact-hook.mjs\"",
59
59
  "timeout": 30
60
60
  }
61
61
  ]
@@ -66,7 +66,7 @@
66
66
  "hooks": [
67
67
  {
68
68
  "type": "command",
69
- "command": "\"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/compaction-restore-bridge.cjs\"",
69
+ "command": "exec \"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/compaction-restore-bridge.cjs\"",
70
70
  "timeout": 5
71
71
  }
72
72
  ]
@@ -75,7 +75,7 @@
75
75
  "hooks": [
76
76
  {
77
77
  "type": "command",
78
- "command": "\"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/refocus.cjs\" --runtime claude",
78
+ "command": "exec \"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/refocus.cjs\" --runtime claude",
79
79
  "timeout": 60
80
80
  }
81
81
  ]
@@ -86,7 +86,7 @@
86
86
  "hooks": [
87
87
  {
88
88
  "type": "command",
89
- "command": "\"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/activity-relay.cjs\" --from-plugin",
89
+ "command": "exec \"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/activity-relay.cjs\" --from-plugin",
90
90
  "timeout": 5
91
91
  }
92
92
  ]
@@ -97,7 +97,7 @@
97
97
  "hooks": [
98
98
  {
99
99
  "type": "command",
100
- "command": "\"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/activity-relay.cjs\" --from-plugin",
100
+ "command": "exec \"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/activity-relay.cjs\" --from-plugin",
101
101
  "timeout": 5
102
102
  }
103
103
  ]
@@ -108,7 +108,7 @@
108
108
  "hooks": [
109
109
  {
110
110
  "type": "command",
111
- "command": "\"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/activity-relay.cjs\" --from-plugin",
111
+ "command": "exec \"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/activity-relay.cjs\" --from-plugin",
112
112
  "timeout": 5
113
113
  }
114
114
  ]
@@ -117,7 +117,7 @@
117
117
  "hooks": [
118
118
  {
119
119
  "type": "command",
120
- "command": "\"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/refocus.cjs\" --runtime claude",
120
+ "command": "exec \"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/refocus.cjs\" --runtime claude",
121
121
  "timeout": 60
122
122
  }
123
123
  ]
@@ -128,7 +128,7 @@
128
128
  "hooks": [
129
129
  {
130
130
  "type": "command",
131
- "command": "\"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/activity-relay.cjs\" --from-plugin",
131
+ "command": "exec \"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/activity-relay.cjs\" --from-plugin",
132
132
  "timeout": 5
133
133
  }
134
134
  ]
@@ -139,7 +139,7 @@
139
139
  "hooks": [
140
140
  {
141
141
  "type": "command",
142
- "command": "\"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/activity-relay.cjs\" --from-plugin",
142
+ "command": "exec \"${OPENRIG_NODE:-node}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/activity-relay.cjs\" --from-plugin",
143
143
  "timeout": 5
144
144
  }
145
145
  ]
@@ -312,27 +312,47 @@ function resolveEndpoint(env = process.env) {
312
312
  return { baseUrl, token };
313
313
  }
314
314
 
315
- async function postHookPayload(payload, env = process.env) {
316
- const { baseUrl, token } = resolveEndpoint(env);
317
- if (!baseUrl || !token || !payload || typeof fetch !== "function") return;
315
+ // #3416 (2): node:http rather than the global fetch. This script runs once per hook event, and the first fetch call
316
+ // loads Node's bundled HTTP client (undici), which more than doubles the CPU of a run; node:http is already in the binary.
317
+ // The post carries the same JSON body and bearer token, waits at most 1.5 s for the answer, closes the connection when the
318
+ // answer arrives, and swallows every error.
319
+ const POST_TIMEOUT_MS = 1500;
318
320
 
319
- const controller = new AbortController();
320
- const timeout = setTimeout(() => controller.abort(), 1500);
321
- try {
322
- await fetch(new URL("/api/activity/hooks", baseUrl).toString(), {
323
- method: "POST",
324
- headers: {
325
- "content-type": "application/json",
326
- "authorization": `Bearer ${token}`,
327
- },
328
- body: JSON.stringify(payload),
329
- signal: controller.signal,
330
- });
331
- } catch {
332
- // Provider hooks must not block the agent loop if OpenRig is unavailable.
333
- } finally {
334
- clearTimeout(timeout);
335
- }
321
+ function postHookPayload(payload, env = process.env) {
322
+ const { baseUrl, token } = resolveEndpoint(env);
323
+ if (!baseUrl || !token || !payload) return Promise.resolve();
324
+ return new Promise((resolve) => {
325
+ let request = null;
326
+ const timer = setTimeout(() => { if (request) request.destroy(); resolve(); }, POST_TIMEOUT_MS);
327
+ const done = () => { clearTimeout(timer); resolve(); };
328
+ try {
329
+ const url = new URL("/api/activity/hooks", baseUrl);
330
+ const client = url.protocol === "http:" ? require("node:http") : url.protocol === "https:" ? require("node:https") : null;
331
+ if (!client) return done();
332
+ const body = Buffer.from(JSON.stringify(payload), "utf8");
333
+ // A fresh connection, closed after the answer: nothing pooled keeps this short-lived process waiting.
334
+ request = client.request(url, {
335
+ method: "POST",
336
+ agent: false,
337
+ headers: {
338
+ "content-type": "application/json",
339
+ "authorization": `Bearer ${token}`,
340
+ "content-length": body.length,
341
+ },
342
+ }, (response) => {
343
+ // As with fetch, the answer's arrival ends the post. Its body is not needed, so the connection closes here: a
344
+ // daemon that sends headers and then stalls can't hold the hook past the answer.
345
+ response.on("error", () => {});
346
+ request.destroy();
347
+ done();
348
+ });
349
+ // Provider hooks must not block the agent loop if OpenRig is unavailable.
350
+ request.on("error", done);
351
+ request.end(body);
352
+ } catch {
353
+ done();
354
+ }
355
+ });
336
356
  }
337
357
 
338
358
  function buildSessionIdentityPayload(providerPayload, env = process.env, now = () => new Date()) {
@@ -411,11 +431,12 @@ function uid() {
411
431
  const SETTINGS_RELAY_TAIL = "state/claude-activity-hooks/activity-relay.cjs";
412
432
 
413
433
  // Keep this finite Node-command grammar in parity with parseManagedClaudeNodeCommand.
414
- // Canonical POSIX quotes and literal unquoted words only; no expansion or wrappers.
434
+ // Canonical POSIX quotes and literal unquoted words only, optionally after one leading `exec` (the shape OpenRig writes
435
+ // since #3416; the one without it is an earlier version's); no expansion or other wrappers.
415
436
  function settingsRelayPath(command) {
416
437
  if (/[\r\n]/.test(command)) return null;
417
438
  const token = /'(?:[^']|'"'"')*'|[-A-Za-z0-9_./:@%+=,]+/.source;
418
- const m = new RegExp(`^(${token})[ \t]+(${token})$`).exec(command.trim());
439
+ const m = new RegExp(`^(${token})[ \t]+(${token})$`).exec(command.trim().replace(/^exec[ \t]+/, ""));
419
440
  if (!m) return null;
420
441
  const decode = token => token.startsWith("'") ? token.slice(1, -1).split(`'"'"'`).join("'") : token;
421
442
  const quote = value => "'" + value.replace(/'/g, `'"'"'`) + "'";
@@ -314,6 +314,7 @@ function renderTrace() {
314
314
  }
315
315
  const env = traceEnv(trees);
316
316
  const timeout = lookupTimeout(contentReserveMs());
317
+ env.OPENRIG_REFOCUS_PARENT_BUDGET_MS = String(Math.max(0, timeout - 350));
317
318
  const result = timeout <= MIN_LOOKUP_MS
318
319
  ? { error: new Error("no time left in the refocus budget"), status: null, stdout: "", stderr: "" }
319
320
  : spawnSync(process.env.PYTHON || "python3", args, {
@@ -117,6 +117,6 @@ is likely a harness suggestion or typed, from where the cursor is and whether th
117
117
  ## Moment-of-truth checklist
118
118
 
119
119
  - **Starting a slice?** → do you know what it's for and what done looks like? mockups attached (UI slices)? **Are you on the light path?** (You are, unless the mission owner assigned the overlay.)
120
- - **Finishing a slice?** → does `PROOF.md` say what you actually verified, by effect, including what is NOT covered? `PROGRESS.md` updated? mission `NOTES.md` refreshed? handed off via `rig queue handoff`?
120
+ - **Finishing a slice?** → does `PROOF.md` say what you actually verified, by effect, including what is NOT covered? `PROGRESS.md` updated? mission `NOTES.md` refreshed? To close a delivered slice in place without moving the slice or its `proof/` directory (accepted judgments still require unchanged item text, policy, and cited evidence bytes), run `rig scope slice close <slice> --in-place --reason delivered` (moving to `closed/` remains the default when `--in-place` is omitted). Handed off via `rig queue handoff`?
121
121
  - **Compacting?** → file your state in mission `NOTES.md`; on restore, read it plus the active slice's `SPEC.md`, `PROGRESS.md`, and `PROOF.md`.
122
122
  - **Starting on a mission?** → read mission `SPEC.md`, `NOTES.md`, and the conventions SSOT.
@@ -6,10 +6,18 @@ import datetime
6
6
  import json
7
7
  import os
8
8
  import re
9
+ import shutil
9
10
  import subprocess
10
11
  import sys
12
+ import time
11
13
  from pathlib import Path
12
14
 
15
+ TRACE_STARTED = time.monotonic()
16
+ try:
17
+ PARENT_TRACE_BUDGET = max(0, float(os.environ.get("OPENRIG_REFOCUS_PARENT_BUDGET_MS", "1650")) / 1000)
18
+ except ValueError:
19
+ PARENT_TRACE_BUDGET = 1.65
20
+
13
21
  SHELVES = {"rigs", "pods", "seats", "missions", "slices"}
14
22
  # The daemon's exact current-work refusal meaning "this seat holds no in-progress typed baton"
15
23
  # (daemon domain/current-work.js, NO_TYPED_IN_PROGRESS). Only this exact text earns the work-root
@@ -26,10 +34,10 @@ SESSION_CHARS = re.compile(r"[A-Za-z0-9\-_.@]+")
26
34
  HUMAN_CLASS_SESSION = re.compile(r"human(?:-[A-Za-z0-9._-]+)?@(?:kernel|host)|[A-Za-z0-9._:-]+@external")
27
35
 
28
36
 
29
- def rig_output(*args):
37
+ def rig_output(*args, timeout=10):
30
38
  try:
31
39
  result = subprocess.run(
32
- ["rig", *args], capture_output=True, text=True, timeout=10, check=False
40
+ ["rig", *args], capture_output=True, text=True, timeout=timeout, check=False
33
41
  )
34
42
  except (OSError, subprocess.SubprocessError):
35
43
  return None
@@ -94,6 +102,44 @@ def read(path):
94
102
  return None
95
103
 
96
104
 
105
+ def may_have_parent(node, spec_text, timeout):
106
+ # Avoid a parser process for ordinary documents without any possible key.
107
+ # For possible links, use the same YAML parser as the CLI before querying.
108
+ manifest = read(node / "mission.yaml")
109
+ if manifest is None and (node / "mission.yaml").exists():
110
+ return None
111
+ frontmatter = re.match(r"\A---[ \t]*\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)", spec_text)
112
+ text = manifest if manifest is not None else (frontmatter.group(1) if frontmatter else "")
113
+ if not re.search(r"parent|\\|\*|<<|\?", text, re.IGNORECASE):
114
+ return False
115
+ if timeout <= 0:
116
+ return None
117
+ rig = shutil.which("rig")
118
+ paths = [str(Path(__file__).resolve().parent), str(node), str(Path.cwd())]
119
+ if rig:
120
+ paths.append(str(Path(rig).resolve().parent))
121
+ script = """
122
+ const fs = require('node:fs');
123
+ const path = require('node:path');
124
+ const input = JSON.parse(fs.readFileSync(0, 'utf8'));
125
+ let yamlPath;
126
+ try { yamlPath = require.resolve('yaml', { paths: input.paths }); }
127
+ catch {
128
+ const cli = require.resolve('@openrig/cli', { paths: input.paths });
129
+ yamlPath = require.resolve('yaml', { paths: [path.dirname(cli)] });
130
+ }
131
+ const YAML = require(yamlPath);
132
+ const doc = YAML.parse(input.text);
133
+ const value = input.manifest ? doc?.metadata?.parent : doc?.parent;
134
+ process.stdout.write(typeof value === 'string' && value.trim() ? 'yes' : 'no');
135
+ """
136
+ try:
137
+ result = subprocess.run(["node", "-e", script], input=json.dumps({"text": text, "manifest": manifest is not None, "paths": paths}), capture_output=True, text=True, timeout=timeout, check=False)
138
+ except (OSError, subprocess.SubprocessError):
139
+ return None
140
+ return {"yes": True, "no": False}.get(result.stdout) if result.returncode == 0 else None
141
+
142
+
97
143
  # Contract twin of CLI scope-fs.ts and daemon scope/node-file.ts; parity is tested.
98
144
  NOTES_FILE_PRECEDENCE = ("NOTES.md", "MISSION_NOTES.md")
99
145
 
@@ -294,6 +340,28 @@ def render_work(start, root, depth, failures, fallback=None, packet=False):
294
340
  body = f"intent: {value}" if value else "MISSING INTENT — no readable intent: field"
295
341
  output.append(f"\n### {label} · {spec.name}\n{body}")
296
342
 
343
+ # Parent links are logical edges, not filesystem ancestors. Ask the
344
+ # scope reader to resolve IDs so tracing uses the same rules as CLI.
345
+ remaining = PARENT_TRACE_BUDGET - (time.monotonic() - TRACE_STARTED)
346
+ has_parent = may_have_parent(node, text, remaining)
347
+ if has_parent is None:
348
+ failures.append(f"parent link unavailable or timed out: {node}")
349
+ output.append(f"PARENT TRACE GAP — unable to read parent link within budget at {node}")
350
+ elif has_parent:
351
+ remaining = PARENT_TRACE_BUDGET - (time.monotonic() - TRACE_STARTED)
352
+ workspace = next((ancestor for ancestor in node.parents if under_root(ancestor, root) and (ancestor / "project.yaml").is_file()), node.parent)
353
+ raw = rig_output("scope", "mission", "show", str(node), "--workspace", str(workspace), "--json", timeout=remaining) if remaining > 0 else None
354
+ try:
355
+ mission = json.loads(raw)["mission"]
356
+ for parent in mission["parentChain"]:
357
+ output.append(f"PARENT · {parent['id']} · {parent['path']}\nintent: {parent.get('intent') or 'MISSING INTENT'}")
358
+ if mission.get("parentGap"):
359
+ failures.append(mission["parentGap"])
360
+ output.append(f"PARENT TRACE GAP — {mission['parentGap']}")
361
+ except (TypeError, ValueError, KeyError):
362
+ failures.append(f"parent link unavailable or timed out: {node}")
363
+ output.append(f"PARENT TRACE GAP — unable to read parent link within budget at {node}")
364
+
297
365
  notes, resolution_error = resolve_notes(node)
298
366
  if resolution_error:
299
367
  failures.append(resolution_error)