@openrig/cli 0.7.8 → 0.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (660) hide show
  1. package/README.md +6 -6
  2. package/daemon/assets/openshell/README.md +4 -2
  3. package/daemon/assets/openshell/guest.py +13 -0
  4. package/daemon/assets/openshell/preset.yaml +1 -0
  5. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
  6. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
  7. package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +12 -3
  8. package/daemon/context-packs/help/manifest.yaml +1 -1
  9. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  10. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +99 -29
  11. package/daemon/context-packs/reference/getting-started.md +30 -8
  12. package/daemon/context-packs/reference/instance-layout.md +11 -0
  13. package/daemon/context-packs/reference/manifest.yaml +1 -1
  14. package/daemon/context-packs/reference/rig-spec.md +61 -2
  15. package/daemon/context-packs/reference/whats-new.md +198 -140
  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-upgrade/SKILL.md +4 -3
  31. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/core/openrig-upgrade/scripts/backup-sqlite.mjs +90 -14
  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/delegating-work/manifest.yaml +1 -1
  40. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  46. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  53. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  54. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  56. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  66. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/seat-continuity-and-handover/SKILL.md +12 -3
  68. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  71. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  72. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  73. package/daemon/dist/adapters/claude-code-adapter.d.ts +6 -0
  74. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  75. package/daemon/dist/adapters/claude-code-adapter.js +14 -68
  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 +13 -4
  79. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  80. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +29 -0
  81. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  82. package/daemon/dist/adapters/codex-runtime-adapter.js +118 -12
  83. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  84. package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
  85. package/daemon/dist/adapters/community-harness-runtime-adapter.js +3 -0
  86. package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
  87. package/daemon/dist/adapters/omp-runtime-adapter.d.ts +5 -0
  88. package/daemon/dist/adapters/omp-runtime-adapter.d.ts.map +1 -1
  89. package/daemon/dist/adapters/omp-runtime-adapter.js +4 -0
  90. package/daemon/dist/adapters/omp-runtime-adapter.js.map +1 -1
  91. package/daemon/dist/adapters/openshell-driver.d.ts.map +1 -1
  92. package/daemon/dist/adapters/openshell-driver.js +8 -2
  93. package/daemon/dist/adapters/openshell-driver.js.map +1 -1
  94. package/daemon/dist/adapters/pi-runner.d.ts +39 -5
  95. package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
  96. package/daemon/dist/adapters/pi-runner.js +97 -19
  97. package/daemon/dist/adapters/pi-runner.js.map +1 -1
  98. package/daemon/dist/adapters/pi-runtime-adapter.d.ts +22 -0
  99. package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
  100. package/daemon/dist/adapters/pi-runtime-adapter.js +39 -8
  101. package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
  102. package/daemon/dist/adapters/preflight-exec.d.ts +2 -0
  103. package/daemon/dist/adapters/preflight-exec.d.ts.map +1 -1
  104. package/daemon/dist/adapters/preflight-exec.js +3 -1
  105. package/daemon/dist/adapters/preflight-exec.js.map +1 -1
  106. package/daemon/dist/adapters/stub-runtime-adapter.d.ts +5 -0
  107. package/daemon/dist/adapters/stub-runtime-adapter.d.ts.map +1 -1
  108. package/daemon/dist/adapters/stub-runtime-adapter.js +7 -4
  109. package/daemon/dist/adapters/stub-runtime-adapter.js.map +1 -1
  110. package/daemon/dist/adapters/tmux-exec.d.ts +3 -0
  111. package/daemon/dist/adapters/tmux-exec.d.ts.map +1 -1
  112. package/daemon/dist/adapters/tmux-exec.js +35 -1
  113. package/daemon/dist/adapters/tmux-exec.js.map +1 -1
  114. package/daemon/dist/adapters/tmux.d.ts +3 -0
  115. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  116. package/daemon/dist/adapters/tmux.js +28 -3
  117. package/daemon/dist/adapters/tmux.js.map +1 -1
  118. package/daemon/dist/build-info.js +3 -3
  119. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  120. package/daemon/dist/db/all-migrations.js +8 -0
  121. package/daemon/dist/db/all-migrations.js.map +1 -1
  122. package/daemon/dist/db/migrations/146_node_startup_guidance_file.d.ts +6 -0
  123. package/daemon/dist/db/migrations/146_node_startup_guidance_file.d.ts.map +1 -0
  124. package/daemon/dist/db/migrations/146_node_startup_guidance_file.js +8 -0
  125. package/daemon/dist/db/migrations/146_node_startup_guidance_file.js.map +1 -0
  126. package/daemon/dist/db/migrations/147_managed_block_writes.d.ts +9 -0
  127. package/daemon/dist/db/migrations/147_managed_block_writes.d.ts.map +1 -0
  128. package/daemon/dist/db/migrations/147_managed_block_writes.js +19 -0
  129. package/daemon/dist/db/migrations/147_managed_block_writes.js.map +1 -0
  130. package/daemon/dist/db/migrations/148_outbox_dispatched_index.d.ts +8 -0
  131. package/daemon/dist/db/migrations/148_outbox_dispatched_index.d.ts.map +1 -0
  132. package/daemon/dist/db/migrations/148_outbox_dispatched_index.js +12 -0
  133. package/daemon/dist/db/migrations/148_outbox_dispatched_index.js.map +1 -0
  134. package/daemon/dist/db/migrations/149_stream_intake_cursor.d.ts +4 -0
  135. package/daemon/dist/db/migrations/149_stream_intake_cursor.d.ts.map +1 -0
  136. package/daemon/dist/db/migrations/149_stream_intake_cursor.js +14 -0
  137. package/daemon/dist/db/migrations/149_stream_intake_cursor.js.map +1 -0
  138. package/daemon/dist/domain/activity-taxonomy.d.ts +3 -0
  139. package/daemon/dist/domain/activity-taxonomy.d.ts.map +1 -1
  140. package/daemon/dist/domain/activity-taxonomy.js.map +1 -1
  141. package/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
  142. package/daemon/dist/domain/bootstrap-orchestrator.js +3 -1
  143. package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
  144. package/daemon/dist/domain/bundle-archive.d.ts.map +1 -1
  145. package/daemon/dist/domain/bundle-archive.js +40 -4
  146. package/daemon/dist/domain/bundle-archive.js.map +1 -1
  147. package/daemon/dist/domain/bundle-behaviour.d.ts.map +1 -1
  148. package/daemon/dist/domain/bundle-behaviour.js +7 -0
  149. package/daemon/dist/domain/bundle-behaviour.js.map +1 -1
  150. package/daemon/dist/domain/bundle-content-routing.d.ts +1 -0
  151. package/daemon/dist/domain/bundle-content-routing.d.ts.map +1 -1
  152. package/daemon/dist/domain/bundle-content-routing.js +3 -1
  153. package/daemon/dist/domain/bundle-content-routing.js.map +1 -1
  154. package/daemon/dist/domain/bundle-source-resolver.d.ts +2 -0
  155. package/daemon/dist/domain/bundle-source-resolver.d.ts.map +1 -1
  156. package/daemon/dist/domain/bundle-source-resolver.js +4 -4
  157. package/daemon/dist/domain/bundle-source-resolver.js.map +1 -1
  158. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +1 -1
  159. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  160. package/daemon/dist/domain/claude-compaction-enforcer.js +14 -9
  161. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  162. package/daemon/dist/domain/claude-owned-settings.d.ts +19 -0
  163. package/daemon/dist/domain/claude-owned-settings.d.ts.map +1 -0
  164. package/daemon/dist/domain/claude-owned-settings.js +160 -0
  165. package/daemon/dist/domain/claude-owned-settings.js.map +1 -0
  166. package/daemon/dist/domain/claude-plugin-channels.d.ts +2 -0
  167. package/daemon/dist/domain/claude-plugin-channels.d.ts.map +1 -0
  168. package/daemon/dist/domain/claude-plugin-channels.js +12 -0
  169. package/daemon/dist/domain/claude-plugin-channels.js.map +1 -0
  170. package/daemon/dist/domain/claude-theme-menu.d.ts +5 -0
  171. package/daemon/dist/domain/claude-theme-menu.d.ts.map +1 -0
  172. package/daemon/dist/domain/claude-theme-menu.js +43 -0
  173. package/daemon/dist/domain/claude-theme-menu.js.map +1 -0
  174. package/daemon/dist/domain/codex-pane-patterns.d.ts +1 -0
  175. package/daemon/dist/domain/codex-pane-patterns.d.ts.map +1 -1
  176. package/daemon/dist/domain/codex-pane-patterns.js +2 -0
  177. package/daemon/dist/domain/codex-pane-patterns.js.map +1 -1
  178. package/daemon/dist/domain/composer-prompts.d.ts +2 -0
  179. package/daemon/dist/domain/composer-prompts.d.ts.map +1 -1
  180. package/daemon/dist/domain/composer-prompts.js +3 -2
  181. package/daemon/dist/domain/composer-prompts.js.map +1 -1
  182. package/daemon/dist/domain/desired-claude-activity-hooks.d.ts +10 -6
  183. package/daemon/dist/domain/desired-claude-activity-hooks.d.ts.map +1 -1
  184. package/daemon/dist/domain/desired-claude-activity-hooks.js +69 -13
  185. package/daemon/dist/domain/desired-claude-activity-hooks.js.map +1 -1
  186. package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
  187. package/daemon/dist/domain/draft-aware-delivery.js +8 -2
  188. package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
  189. package/daemon/dist/domain/environment-lifecycle.d.ts +7 -0
  190. package/daemon/dist/domain/environment-lifecycle.d.ts.map +1 -1
  191. package/daemon/dist/domain/environment-lifecycle.js +15 -2
  192. package/daemon/dist/domain/environment-lifecycle.js.map +1 -1
  193. package/daemon/dist/domain/environment-startup.d.ts +3 -1
  194. package/daemon/dist/domain/environment-startup.d.ts.map +1 -1
  195. package/daemon/dist/domain/environment-startup.js +31 -5
  196. package/daemon/dist/domain/environment-startup.js.map +1 -1
  197. package/daemon/dist/domain/gateway/human-readiness.d.ts +2 -1
  198. package/daemon/dist/domain/gateway/human-readiness.d.ts.map +1 -1
  199. package/daemon/dist/domain/gateway/human-readiness.js +6 -0
  200. package/daemon/dist/domain/gateway/human-readiness.js.map +1 -1
  201. package/daemon/dist/domain/gateway/human-registry.d.ts +2 -1
  202. package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
  203. package/daemon/dist/domain/gateway/human-registry.js +9 -7
  204. package/daemon/dist/domain/gateway/human-registry.js.map +1 -1
  205. package/daemon/dist/domain/gateway/participants.d.ts +26 -0
  206. package/daemon/dist/domain/gateway/participants.d.ts.map +1 -1
  207. package/daemon/dist/domain/gateway/participants.js +15 -0
  208. package/daemon/dist/domain/gateway/participants.js.map +1 -1
  209. package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
  210. package/daemon/dist/domain/gateway/slack/inbound.js +21 -5
  211. package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
  212. package/daemon/dist/domain/gateway/slack/message.d.ts +3 -0
  213. package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
  214. package/daemon/dist/domain/gateway/slack/message.js +4 -3
  215. package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
  216. package/daemon/dist/domain/gateway/slack/queue-access.d.ts +3 -2
  217. package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
  218. package/daemon/dist/domain/gateway/slack/queue-access.js +17 -6
  219. package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
  220. package/daemon/dist/domain/gateway/slack/recovery-budget.d.ts +1 -0
  221. package/daemon/dist/domain/gateway/slack/recovery-budget.d.ts.map +1 -1
  222. package/daemon/dist/domain/gateway/slack/recovery-budget.js +1 -0
  223. package/daemon/dist/domain/gateway/slack/recovery-budget.js.map +1 -1
  224. package/daemon/dist/domain/gateway/slack/settled-asks.d.ts +37 -0
  225. package/daemon/dist/domain/gateway/slack/settled-asks.d.ts.map +1 -0
  226. package/daemon/dist/domain/gateway/slack/settled-asks.js +276 -0
  227. package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -0
  228. package/daemon/dist/domain/gateway/slack/slack-api.d.ts +32 -0
  229. package/daemon/dist/domain/gateway/slack/slack-api.d.ts.map +1 -1
  230. package/daemon/dist/domain/gateway/slack/slack-api.js +40 -2
  231. package/daemon/dist/domain/gateway/slack/slack-api.js.map +1 -1
  232. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
  233. package/daemon/dist/domain/gateway/slack/slack-subsystem.js +30 -6
  234. package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
  235. package/daemon/dist/domain/human-questions.d.ts +3 -1
  236. package/daemon/dist/domain/human-questions.d.ts.map +1 -1
  237. package/daemon/dist/domain/human-questions.js.map +1 -1
  238. package/daemon/dist/domain/kernel-boot-tracker.d.ts +3 -2
  239. package/daemon/dist/domain/kernel-boot-tracker.d.ts.map +1 -1
  240. package/daemon/dist/domain/kernel-boot-tracker.js +2 -1
  241. package/daemon/dist/domain/kernel-boot-tracker.js.map +1 -1
  242. package/daemon/dist/domain/kernel-boot.d.ts +11 -6
  243. package/daemon/dist/domain/kernel-boot.d.ts.map +1 -1
  244. package/daemon/dist/domain/kernel-boot.js +27 -5
  245. package/daemon/dist/domain/kernel-boot.js.map +1 -1
  246. package/daemon/dist/domain/kernel-hook-review.d.ts +3 -1
  247. package/daemon/dist/domain/kernel-hook-review.d.ts.map +1 -1
  248. package/daemon/dist/domain/kernel-hook-review.js +12 -3
  249. package/daemon/dist/domain/kernel-hook-review.js.map +1 -1
  250. package/daemon/dist/domain/managed-block-records.d.ts +54 -0
  251. package/daemon/dist/domain/managed-block-records.d.ts.map +1 -0
  252. package/daemon/dist/domain/managed-block-records.js +130 -0
  253. package/daemon/dist/domain/managed-block-records.js.map +1 -0
  254. package/daemon/dist/domain/managed-blocks.d.ts +14 -0
  255. package/daemon/dist/domain/managed-blocks.d.ts.map +1 -1
  256. package/daemon/dist/domain/managed-blocks.js +24 -4
  257. package/daemon/dist/domain/managed-blocks.js.map +1 -1
  258. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +26 -10
  259. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
  260. package/daemon/dist/domain/mission-control/mission-control-write-contract.js +98 -26
  261. package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
  262. package/daemon/dist/domain/native-process-lineage.d.ts +2 -1
  263. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
  264. package/daemon/dist/domain/native-process-lineage.js +57 -5
  265. package/daemon/dist/domain/native-process-lineage.js.map +1 -1
  266. package/daemon/dist/domain/node-inventory.d.ts +1 -0
  267. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  268. package/daemon/dist/domain/node-inventory.js +24 -2
  269. package/daemon/dist/domain/node-inventory.js.map +1 -1
  270. package/daemon/dist/domain/outbox-handler.d.ts +5 -0
  271. package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
  272. package/daemon/dist/domain/outbox-handler.js +28 -0
  273. package/daemon/dist/domain/outbox-handler.js.map +1 -1
  274. package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
  275. package/daemon/dist/domain/profile-resolver.js +7 -1
  276. package/daemon/dist/domain/profile-resolver.js.map +1 -1
  277. package/daemon/dist/domain/queue-recovery.d.ts +1 -1
  278. package/daemon/dist/domain/queue-recovery.d.ts.map +1 -1
  279. package/daemon/dist/domain/queue-recovery.js +6 -2
  280. package/daemon/dist/domain/queue-recovery.js.map +1 -1
  281. package/daemon/dist/domain/queue-repository.d.ts +32 -7
  282. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  283. package/daemon/dist/domain/queue-repository.js +165 -50
  284. package/daemon/dist/domain/queue-repository.js.map +1 -1
  285. package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
  286. package/daemon/dist/domain/queue-stuck-sweep.js +28 -4
  287. package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
  288. package/daemon/dist/domain/queue-transition-log.d.ts +2 -0
  289. package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
  290. package/daemon/dist/domain/queue-transition-log.js +9 -0
  291. package/daemon/dist/domain/queue-transition-log.js.map +1 -1
  292. package/daemon/dist/domain/restore-guidance.d.ts +70 -7
  293. package/daemon/dist/domain/restore-guidance.d.ts.map +1 -1
  294. package/daemon/dist/domain/restore-guidance.js +181 -18
  295. package/daemon/dist/domain/restore-guidance.js.map +1 -1
  296. package/daemon/dist/domain/restore-orchestrator.d.ts +5 -0
  297. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  298. package/daemon/dist/domain/restore-orchestrator.js +115 -17
  299. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  300. package/daemon/dist/domain/rig-repository.d.ts +4 -0
  301. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  302. package/daemon/dist/domain/rig-repository.js +20 -1
  303. package/daemon/dist/domain/rig-repository.js.map +1 -1
  304. package/daemon/dist/domain/rig-teardown.d.ts +18 -0
  305. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  306. package/daemon/dist/domain/rig-teardown.js +73 -17
  307. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  308. package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
  309. package/daemon/dist/domain/rigspec-codec.js +2 -0
  310. package/daemon/dist/domain/rigspec-codec.js.map +1 -1
  311. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  312. package/daemon/dist/domain/rigspec-exporter.js +6 -1
  313. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  314. package/daemon/dist/domain/rigspec-instantiator.d.ts +7 -4
  315. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  316. package/daemon/dist/domain/rigspec-instantiator.js +19 -7
  317. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  318. package/daemon/dist/domain/rigspec-preflight.d.ts +4 -0
  319. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  320. package/daemon/dist/domain/rigspec-preflight.js +35 -1
  321. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  322. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  323. package/daemon/dist/domain/rigspec-schema.js +32 -5
  324. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  325. package/daemon/dist/domain/runner-permissions.d.ts +15 -0
  326. package/daemon/dist/domain/runner-permissions.d.ts.map +1 -1
  327. package/daemon/dist/domain/runner-permissions.js +74 -9
  328. package/daemon/dist/domain/runner-permissions.js.map +1 -1
  329. package/daemon/dist/domain/runtime-adapter.d.ts +19 -1
  330. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  331. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  332. package/daemon/dist/domain/runtime-switch-materials.d.ts.map +1 -1
  333. package/daemon/dist/domain/runtime-switch-materials.js +3 -0
  334. package/daemon/dist/domain/runtime-switch-materials.js.map +1 -1
  335. package/daemon/dist/domain/runtime-verifier.d.ts.map +1 -1
  336. package/daemon/dist/domain/runtime-verifier.js +9 -4
  337. package/daemon/dist/domain/runtime-verifier.js.map +1 -1
  338. package/daemon/dist/domain/scope/scope-audit.d.ts +1 -1
  339. package/daemon/dist/domain/scope/scope-audit.d.ts.map +1 -1
  340. package/daemon/dist/domain/scope/scope-audit.js.map +1 -1
  341. package/daemon/dist/domain/scope/types.d.ts +3 -0
  342. package/daemon/dist/domain/scope/types.d.ts.map +1 -1
  343. package/daemon/dist/domain/scope/types.js.map +1 -1
  344. package/daemon/dist/domain/seat-activity-service.d.ts +7 -0
  345. package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
  346. package/daemon/dist/domain/seat-activity-service.js +47 -7
  347. package/daemon/dist/domain/seat-activity-service.js.map +1 -1
  348. package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  349. package/daemon/dist/domain/seat-attention-reconciler.js +8 -1
  350. package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  351. package/daemon/dist/domain/seat-delivery-guard.d.ts +22 -4
  352. package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
  353. package/daemon/dist/domain/seat-delivery-guard.js +80 -11
  354. package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
  355. package/daemon/dist/domain/seat-handover-service.d.ts +23 -10
  356. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  357. package/daemon/dist/domain/seat-handover-service.js +119 -3
  358. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  359. package/daemon/dist/domain/seat-launch-additions.d.ts +6 -0
  360. package/daemon/dist/domain/seat-launch-additions.d.ts.map +1 -1
  361. package/daemon/dist/domain/seat-launch-additions.js +41 -11
  362. package/daemon/dist/domain/seat-launch-additions.js.map +1 -1
  363. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  364. package/daemon/dist/domain/seat-lifecycle-service.js +3 -1
  365. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  366. package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
  367. package/daemon/dist/domain/seat-runtime-switch-service.js +17 -3
  368. package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
  369. package/daemon/dist/domain/seat-skill-storage.d.ts +2 -2
  370. package/daemon/dist/domain/seat-skill-storage.js +2 -2
  371. package/daemon/dist/domain/seat-structural-activity-service.d.ts +15 -5
  372. package/daemon/dist/domain/seat-structural-activity-service.d.ts.map +1 -1
  373. package/daemon/dist/domain/seat-structural-activity-service.js +21 -7
  374. package/daemon/dist/domain/seat-structural-activity-service.js.map +1 -1
  375. package/daemon/dist/domain/session-transport.d.ts +7 -0
  376. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  377. package/daemon/dist/domain/session-transport.js +145 -31
  378. package/daemon/dist/domain/session-transport.js.map +1 -1
  379. package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
  380. package/daemon/dist/domain/snapshot-capture.js +1 -0
  381. package/daemon/dist/domain/snapshot-capture.js.map +1 -1
  382. package/daemon/dist/domain/spec-library-workflow-scanner.d.ts +2 -0
  383. package/daemon/dist/domain/spec-library-workflow-scanner.d.ts.map +1 -1
  384. package/daemon/dist/domain/spec-library-workflow-scanner.js +5 -1
  385. package/daemon/dist/domain/spec-library-workflow-scanner.js.map +1 -1
  386. package/daemon/dist/domain/startup-orchestrator.d.ts +1 -0
  387. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  388. package/daemon/dist/domain/startup-orchestrator.js +74 -7
  389. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  390. package/daemon/dist/domain/stream-intake.d.ts +51 -0
  391. package/daemon/dist/domain/stream-intake.d.ts.map +1 -0
  392. package/daemon/dist/domain/stream-intake.js +438 -0
  393. package/daemon/dist/domain/stream-intake.js.map +1 -0
  394. package/daemon/dist/domain/successor-session-launcher.d.ts +2 -0
  395. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  396. package/daemon/dist/domain/successor-session-launcher.js +1 -0
  397. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  398. package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
  399. package/daemon/dist/domain/terminal/herdr-adapter.js +4 -3
  400. package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
  401. package/daemon/dist/domain/terminal/herdr-viewer.d.ts.map +1 -1
  402. package/daemon/dist/domain/terminal/herdr-viewer.js +8 -4
  403. package/daemon/dist/domain/terminal/herdr-viewer.js.map +1 -1
  404. package/daemon/dist/domain/terminal/login-shell.d.ts +10 -0
  405. package/daemon/dist/domain/terminal/login-shell.d.ts.map +1 -0
  406. package/daemon/dist/domain/terminal/login-shell.js +37 -0
  407. package/daemon/dist/domain/terminal/login-shell.js.map +1 -0
  408. package/daemon/dist/domain/terminal/rex-layout.d.ts.map +1 -1
  409. package/daemon/dist/domain/terminal/rex-layout.js +2 -1
  410. package/daemon/dist/domain/terminal/rex-layout.js.map +1 -1
  411. package/daemon/dist/domain/terminal/tile-attach.d.ts.map +1 -1
  412. package/daemon/dist/domain/terminal/tile-attach.js +15 -5
  413. package/daemon/dist/domain/terminal/tile-attach.js.map +1 -1
  414. package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
  415. package/daemon/dist/domain/transcript-store.js +11 -5
  416. package/daemon/dist/domain/transcript-store.js.map +1 -1
  417. package/daemon/dist/domain/types.d.ts +16 -0
  418. package/daemon/dist/domain/types.d.ts.map +1 -1
  419. package/daemon/dist/domain/types.js.map +1 -1
  420. package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
  421. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  422. package/daemon/dist/domain/user-settings/settings-store.js +14 -0
  423. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  424. package/daemon/dist/domain/watchdog-delivery-receipts.d.ts +11 -0
  425. package/daemon/dist/domain/watchdog-delivery-receipts.d.ts.map +1 -0
  426. package/daemon/dist/domain/watchdog-delivery-receipts.js +134 -0
  427. package/daemon/dist/domain/watchdog-delivery-receipts.js.map +1 -0
  428. package/daemon/dist/domain/watchdog-delivery.d.ts +6 -1
  429. package/daemon/dist/domain/watchdog-delivery.d.ts.map +1 -1
  430. package/daemon/dist/domain/watchdog-delivery.js +10 -6
  431. package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
  432. package/daemon/dist/domain/watchdog-policy-engine.d.ts +19 -2
  433. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  434. package/daemon/dist/domain/watchdog-policy-engine.js +49 -22
  435. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  436. package/daemon/dist/domain/workflow-projector.js +3 -3
  437. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  438. package/daemon/dist/domain/workflow-runtime.js +3 -3
  439. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  440. package/daemon/dist/domain/working-liveness.d.ts +66 -0
  441. package/daemon/dist/domain/working-liveness.d.ts.map +1 -0
  442. package/daemon/dist/domain/working-liveness.js +94 -0
  443. package/daemon/dist/domain/working-liveness.js.map +1 -0
  444. package/daemon/dist/domain/workspace/frontmatter-validator.js +4 -2
  445. package/daemon/dist/domain/workspace/frontmatter-validator.js.map +1 -1
  446. package/daemon/dist/index.d.ts +1 -1
  447. package/daemon/dist/index.d.ts.map +1 -1
  448. package/daemon/dist/index.js +3 -0
  449. package/daemon/dist/index.js.map +1 -1
  450. package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
  451. package/daemon/dist/lib/pane-envelope.js +9 -3
  452. package/daemon/dist/lib/pane-envelope.js.map +1 -1
  453. package/daemon/dist/middleware/auth-bearer-token.js +2 -2
  454. package/daemon/dist/middleware/auth-bearer-token.js.map +1 -1
  455. package/daemon/dist/routes/activity.d.ts +2 -0
  456. package/daemon/dist/routes/activity.d.ts.map +1 -1
  457. package/daemon/dist/routes/activity.js +60 -5
  458. package/daemon/dist/routes/activity.js.map +1 -1
  459. package/daemon/dist/routes/attention.d.ts.map +1 -1
  460. package/daemon/dist/routes/attention.js +17 -5
  461. package/daemon/dist/routes/attention.js.map +1 -1
  462. package/daemon/dist/routes/bundles.js +3 -1
  463. package/daemon/dist/routes/bundles.js.map +1 -1
  464. package/daemon/dist/routes/gateway.d.ts +6 -0
  465. package/daemon/dist/routes/gateway.d.ts.map +1 -1
  466. package/daemon/dist/routes/gateway.js +39 -0
  467. package/daemon/dist/routes/gateway.js.map +1 -1
  468. package/daemon/dist/routes/hosts.d.ts.map +1 -1
  469. package/daemon/dist/routes/hosts.js +26 -4
  470. package/daemon/dist/routes/hosts.js.map +1 -1
  471. package/daemon/dist/routes/mission-control.d.ts.map +1 -1
  472. package/daemon/dist/routes/mission-control.js +6 -1
  473. package/daemon/dist/routes/mission-control.js.map +1 -1
  474. package/daemon/dist/routes/queue.d.ts.map +1 -1
  475. package/daemon/dist/routes/queue.js +21 -2
  476. package/daemon/dist/routes/queue.js.map +1 -1
  477. package/daemon/dist/routes/scope-audit.d.ts.map +1 -1
  478. package/daemon/dist/routes/scope-audit.js +30 -0
  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 +3 -3
  482. package/daemon/dist/routes/seat.js.map +1 -1
  483. package/daemon/dist/routes/spec-library.d.ts.map +1 -1
  484. package/daemon/dist/routes/spec-library.js +60 -5
  485. package/daemon/dist/routes/spec-library.js.map +1 -1
  486. package/daemon/dist/routes/startup.js +2 -2
  487. package/daemon/dist/routes/startup.js.map +1 -1
  488. package/daemon/dist/routes/transport.d.ts.map +1 -1
  489. package/daemon/dist/routes/transport.js +8 -3
  490. package/daemon/dist/routes/transport.js.map +1 -1
  491. package/daemon/dist/server.d.ts +1 -0
  492. package/daemon/dist/server.d.ts.map +1 -1
  493. package/daemon/dist/server.js +1 -0
  494. package/daemon/dist/server.js.map +1 -1
  495. package/daemon/dist/startup.d.ts.map +1 -1
  496. package/daemon/dist/startup.js +30 -12
  497. package/daemon/dist/startup.js.map +1 -1
  498. package/daemon/docs/reference/agent-spec.md +1 -1
  499. package/daemon/docs/reference/agent-startup-guide.md +115 -3
  500. package/daemon/docs/reference/agent-state-taxonomy.md +23 -2
  501. package/daemon/docs/reference/author-contracts.md +6 -6
  502. package/daemon/docs/reference/checked-seat-stop.md +12 -1
  503. package/daemon/docs/reference/community-harness-examples/dsh/README.md +32 -7
  504. package/daemon/docs/reference/community-harness-examples/dsh/dsh.yaml +2 -2
  505. package/daemon/docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs +101 -18
  506. package/daemon/docs/reference/daemon-http-clients.md +203 -0
  507. package/daemon/docs/reference/execution-platform-contract.md +1 -1
  508. package/daemon/docs/reference/gateway-participants.md +29 -17
  509. package/daemon/docs/reference/getting-started.md +30 -8
  510. package/daemon/docs/reference/harness-runner-contract.md +93 -19
  511. package/daemon/docs/reference/hosted-members.md +32 -0
  512. package/daemon/docs/reference/instance-layout.md +11 -0
  513. package/daemon/docs/reference/keeping-a-watch.md +22 -0
  514. package/daemon/docs/reference/pi-tool-selection-recovery.md +2 -1
  515. package/daemon/docs/reference/quickstart.md +9 -4
  516. package/daemon/docs/reference/rig-bundle.md +2 -2
  517. package/daemon/docs/reference/rig-spec.md +61 -2
  518. package/daemon/docs/reference/runner-conformance/README.md +5 -3
  519. package/daemon/docs/reference/runner-conformance/check-runner.mjs +136 -16
  520. package/daemon/docs/reference/runner-conformance/fake-acp-agent.mjs +10 -3
  521. package/daemon/docs/reference/sdlc-conventions.md +22 -3
  522. package/daemon/docs/reference/seat-delivery.md +31 -6
  523. package/daemon/docs/reference/slack-app-setup.md +55 -5
  524. package/daemon/docs/reference/terminal-sessions.md +15 -5
  525. package/daemon/docs/reference/whats-new.md +198 -140
  526. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +4 -3
  527. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/scripts/backup-sqlite.mjs +90 -14
  528. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +2 -1
  529. package/daemon/specs/rigs/launch/kernel/agents/queue/worker/guidance/role.md +1 -1
  530. package/dist/atomic-text-write.d.ts +2 -0
  531. package/dist/atomic-text-write.d.ts.map +1 -1
  532. package/dist/atomic-text-write.js +17 -0
  533. package/dist/atomic-text-write.js.map +1 -1
  534. package/dist/build-info.js +3 -3
  535. package/dist/commands/broadcast.js +2 -1
  536. package/dist/commands/broadcast.js.map +1 -1
  537. package/dist/commands/config.d.ts.map +1 -1
  538. package/dist/commands/config.js +1 -0
  539. package/dist/commands/config.js.map +1 -1
  540. package/dist/commands/context.d.ts.map +1 -1
  541. package/dist/commands/context.js +1 -0
  542. package/dist/commands/context.js.map +1 -1
  543. package/dist/commands/doctor.d.ts +1 -1
  544. package/dist/commands/doctor.d.ts.map +1 -1
  545. package/dist/commands/doctor.js +48 -6
  546. package/dist/commands/doctor.js.map +1 -1
  547. package/dist/commands/down.d.ts.map +1 -1
  548. package/dist/commands/down.js +10 -0
  549. package/dist/commands/down.js.map +1 -1
  550. package/dist/commands/env.d.ts.map +1 -1
  551. package/dist/commands/env.js +9 -3
  552. package/dist/commands/env.js.map +1 -1
  553. package/dist/commands/environment.d.ts.map +1 -1
  554. package/dist/commands/environment.js +5 -2
  555. package/dist/commands/environment.js.map +1 -1
  556. package/dist/commands/export.d.ts +2 -0
  557. package/dist/commands/export.d.ts.map +1 -1
  558. package/dist/commands/export.js +26 -5
  559. package/dist/commands/export.js.map +1 -1
  560. package/dist/commands/gateway.js +15 -11
  561. package/dist/commands/gateway.js.map +1 -1
  562. package/dist/commands/host.d.ts +13 -6
  563. package/dist/commands/host.d.ts.map +1 -1
  564. package/dist/commands/host.js +35 -8
  565. package/dist/commands/host.js.map +1 -1
  566. package/dist/commands/project-jev.js +1 -1
  567. package/dist/commands/project-jev.js.map +1 -1
  568. package/dist/commands/provider.d.ts.map +1 -1
  569. package/dist/commands/provider.js +10 -5
  570. package/dist/commands/provider.js.map +1 -1
  571. package/dist/commands/ps.d.ts +2 -0
  572. package/dist/commands/ps.d.ts.map +1 -1
  573. package/dist/commands/ps.js +12 -3
  574. package/dist/commands/ps.js.map +1 -1
  575. package/dist/commands/queue.d.ts +1 -0
  576. package/dist/commands/queue.d.ts.map +1 -1
  577. package/dist/commands/queue.js +38 -4
  578. package/dist/commands/queue.js.map +1 -1
  579. package/dist/commands/scope.d.ts.map +1 -1
  580. package/dist/commands/scope.js +36 -2
  581. package/dist/commands/scope.js.map +1 -1
  582. package/dist/commands/seat.d.ts.map +1 -1
  583. package/dist/commands/seat.js +31 -4
  584. package/dist/commands/seat.js.map +1 -1
  585. package/dist/commands/send.d.ts.map +1 -1
  586. package/dist/commands/send.js +46 -16
  587. package/dist/commands/send.js.map +1 -1
  588. package/dist/commands/slack.d.ts.map +1 -1
  589. package/dist/commands/slack.js +5 -0
  590. package/dist/commands/slack.js.map +1 -1
  591. package/dist/commands/specs.d.ts +1 -1
  592. package/dist/commands/specs.d.ts.map +1 -1
  593. package/dist/commands/specs.js +44 -10
  594. package/dist/commands/specs.js.map +1 -1
  595. package/dist/commands/stream.d.ts.map +1 -1
  596. package/dist/commands/stream.js +6 -1
  597. package/dist/commands/stream.js.map +1 -1
  598. package/dist/commands/topology-default-agent.js +1 -1
  599. package/dist/commands/topology-default-agent.js.map +1 -1
  600. package/dist/commands/walk.d.ts.map +1 -1
  601. package/dist/commands/walk.js +27 -10
  602. package/dist/commands/walk.js.map +1 -1
  603. package/dist/commands/workspace.d.ts.map +1 -1
  604. package/dist/commands/workspace.js +8 -1
  605. package/dist/commands/workspace.js.map +1 -1
  606. package/dist/config-store.d.ts +7 -1
  607. package/dist/config-store.d.ts.map +1 -1
  608. package/dist/config-store.js +23 -2
  609. package/dist/config-store.js.map +1 -1
  610. package/dist/lib/scope/progress-edit.d.ts.map +1 -1
  611. package/dist/lib/scope/progress-edit.js +37 -7
  612. package/dist/lib/scope/progress-edit.js.map +1 -1
  613. package/dist/lib/scope/scope-audit.d.ts +1 -1
  614. package/dist/lib/scope/scope-audit.d.ts.map +1 -1
  615. package/dist/lib/scope/scope-audit.js.map +1 -1
  616. package/dist/lib/scope/scope-fs.d.ts +3 -0
  617. package/dist/lib/scope/scope-fs.d.ts.map +1 -1
  618. package/dist/lib/scope/scope-fs.js +39 -53
  619. package/dist/lib/scope/scope-fs.js.map +1 -1
  620. package/dist/lib/scope/types.d.ts +3 -0
  621. package/dist/lib/scope/types.d.ts.map +1 -1
  622. package/dist/lib/scope/types.js.map +1 -1
  623. package/dist/mcp-server.d.ts.map +1 -1
  624. package/dist/mcp-server.js +53 -16
  625. package/dist/mcp-server.js.map +1 -1
  626. package/dist/seat-launch-additions-lines.d.ts +2 -0
  627. package/dist/seat-launch-additions-lines.d.ts.map +1 -1
  628. package/dist/seat-launch-additions-lines.js +1 -0
  629. package/dist/seat-launch-additions-lines.js.map +1 -1
  630. package/package.json +1 -1
  631. package/tui/dist/attention/attention-model.d.ts +3 -2
  632. package/tui/dist/attention/attention-model.d.ts.map +1 -1
  633. package/tui/dist/attention/attention-model.js +7 -4
  634. package/tui/dist/attention/attention-model.js.map +1 -1
  635. package/tui/dist/daemon-client.d.ts +4 -4
  636. package/tui/dist/daemon-client.d.ts.map +1 -1
  637. package/tui/dist/daemon-client.js +6 -5
  638. package/tui/dist/daemon-client.js.map +1 -1
  639. package/tui/dist/hydrate.d.ts.map +1 -1
  640. package/tui/dist/hydrate.js +10 -4
  641. package/tui/dist/hydrate.js.map +1 -1
  642. package/tui/dist/pulse/pulse-model.d.ts +1 -1
  643. package/tui/dist/pulse/pulse-model.d.ts.map +1 -1
  644. package/tui/dist/pulse/pulse-model.js +6 -17
  645. package/tui/dist/pulse/pulse-model.js.map +1 -1
  646. package/tui/dist/render.js +1 -1
  647. package/tui/dist/render.js.map +1 -1
  648. package/tui/dist/theme.d.ts.map +1 -1
  649. package/tui/dist/theme.js +7 -2
  650. package/tui/dist/theme.js.map +1 -1
  651. package/tui/dist/time.d.ts +2 -0
  652. package/tui/dist/time.d.ts.map +1 -1
  653. package/tui/dist/time.js +5 -0
  654. package/tui/dist/time.js.map +1 -1
  655. package/tui/dist/types.d.ts +2 -3
  656. package/tui/dist/types.d.ts.map +1 -1
  657. package/ui/dist/assets/index-BFOs3ejL.css +32 -0
  658. package/ui/dist/assets/{index-Ch6UxNld.js → index-CdkFwtld.js} +81 -81
  659. package/ui/dist/index.html +2 -2
  660. package/ui/dist/assets/index-DNU3XZr_.css +0 -32
@@ -214,7 +214,7 @@ After the files, OpenRig sends a session-identity message (rig, pod, member, log
214
214
  | Delivery Hint | When | How | Use For |
215
215
  |---------------|------|-----|---------|
216
216
  | `auto` | Depends on the file | Resolved per file: a `SKILL.md` (or content starting `# SKILL`) is `skill_install`, any other `.md` is `guidance_merge`, and any other file is `send_text` | Default — let OpenRig decide |
217
- | `guidance_merge` | Before harness boot | Merged as a managed block into `AGENTS.md` (Codex, Pi) or `CLAUDE.md` (Claude; `CLAUDE.local.md` with the rig's `managed_blocks: { claude-code: CLAUDE.local.md }`) | Role guidance, culture, project context |
217
+ | `guidance_merge` | Before harness boot | Merged as a managed block into the repository `AGENTS.md` (Codex, OMP), a fresh Pi seat's own agent-directory `AGENTS.md` (see [Runtime Differences](#runtime-differences)), or `CLAUDE.md` (Claude; `CLAUDE.local.md` with the rig's `managed_blocks: { claude-code: CLAUDE.local.md }`). A fresh launch of Codex 0.164.0 or later can carry it as launch developer instructions instead (see [Codex guidance at launch](#codex-guidance-at-launch)) | Role guidance, culture, project context |
218
218
  | `skill_install` | Before harness boot | Copied to runtime's skill directory | Skills |
219
219
  | `send_text` | After harness is ready | Sent as text to agent's terminal via tmux | Boot-time grounding, identity hints, instructions to read skills |
220
220
 
@@ -367,7 +367,15 @@ Each startup file and action specifies when it applies:
367
367
  - `restore` — delivered when a seat is restored without its earlier conversation: a restore whose resume falls back to a fresh conversation, or a retried start
368
368
  - Default: `[fresh_start, restore]` (both)
369
369
 
370
- **An exact resume delivers neither.** When a restore reopens the seat's saved conversation (`rig up <rig> --existing` with a resume token), OpenRig types no startup actions and delivers no startup files, `restore` ones included: the conversation already has them, and typing them again would add turns to it. The one exception: a managed guidance block missing from the guidance file is put back before the harness starts.
370
+ **An exact resume delivers neither.** When a restore reopens the seat's saved conversation (`rig up <rig> --existing` with a resume token), OpenRig types no startup actions and delivers no startup files, `restore` ones included: the conversation already has them, and typing them again would add turns to it. The one exception: the guidance file's managed blocks are brought up to date before the harness starts. A missing block is put back, and a stale one is refreshed (see below).
371
+
372
+ **A seat handover does the same put-back.** Before a fresh, fork or rebuild successor starts, the handover puts the seat's missing managed guidance blocks back in its guidance file from the saved startup context. That's the rig's Claude file (`CLAUDE.md`, or `CLAUDE.local.md` when the rig uses it) for Claude, and `AGENTS.md` for Codex, Pi and omp. So a seat rebuilt into a new working directory keeps its guidance.
373
+
374
+ **A block you edited by hand is never overwritten.** OpenRig records what it last wrote in each managed block, so a launch, an exact resume, a handover or a runtime switch can refresh a block whose source file changed since. The record follows the file itself, so two links to one file share it. A block you've edited since OpenRig wrote it is left as you wrote it. The start's result names it (`guidance_block_edited`), and the seat is told in one line once it's ready, or in a handover's packet. A block OpenRig has no record of writing (any block written before these records were kept) that differs from its source works like this:
375
+ - a launch replaces it, as launches always did, and names it (`guidance_block_refreshed_unrecorded`);
376
+ - an exact resume or a handover leaves it, and names it as possibly stale (`guidance_block_may_be_stale`).
377
+
378
+ An exact resume doesn't type anything into the resumed conversation. So there, the restore result names the block (`guidanceNotes`), but the seat isn't told.
371
379
 
372
380
  Use this to avoid re-sending context that a fresh conversation doesn't need twice. For example, a one-time project briefing might only apply on `fresh_start`, while identity grounding should apply on both, so a seat that comes back fresh gets it again.
373
381
 
@@ -528,6 +536,58 @@ This separates provider files, not OS users or accounts. Project-local resources
528
536
  still use the selected project directory; shared project and system settings
529
537
  remain shared.
530
538
 
539
+ ### Codex guidance at launch
540
+
541
+ On a fresh launch of Codex 0.164.0 or later, OpenRig passes a seat's managed guidance (OpenRig's start file and the
542
+ rig's and project's context, culture and SOP files) with the launch, as `-c developer_instructions=…`, instead of
543
+ merging it into the repository `AGENTS.md`. Neither the tracked `AGENTS.md` nor the Codex home is written for it, and
544
+ both still load as usual. The text opens: "OpenRig seat guidance for this session follows. Where it conflicts with
545
+ AGENTS.md guidance in the repository or the Codex home, follow AGENTS.md."
546
+
547
+ A launch value replaces a configured one, so this happens only when no Codex config layer OpenRig reads sets
548
+ `developer_instructions`. OpenRig reads:
549
+
550
+ - `/etc/codex/config.toml` and `/etc/codex/managed_config.toml`;
551
+ - the Codex home's `config.toml`, profiles included, and the selected profile's `<profile>.config.toml`;
552
+ - each `.codex/config.toml` from the seat's working directory up.
553
+
554
+ The Codex home it reads is the seat's own (a `CODEX_HOME` in its `env:`, or a recorded account switch), else the
555
+ daemon's `CODEX_HOME`, else `~/.codex`.
556
+
557
+ The guidance still goes to the repository `AGENTS.md`, as before, when:
558
+
559
+ - a layer OpenRig reads sets `developer_instructions`, or can't be read. A launch warning names the file;
560
+ - the launch resumes or forks a conversation. Developer instructions on a resume haven't been tested, and an exact
561
+ resume puts the guidance back in the repository `AGENTS.md`;
562
+ - the seat is restored, even when the restore starts a new conversation. A restore keeps the guidance file its launch
563
+ recorded, which for Codex is the repository `AGENTS.md`;
564
+ - a handover successor starts (fresh, fork or rebuild). Its launch carries no guidance of its own, so the handover
565
+ first puts the seat's missing blocks back in the repository `AGENTS.md` from its saved startup context;
566
+ - Codex is older than 0.164.0, or its version is unknown.
567
+
568
+ A seat's role still arrives as startup text, and the seat-skills line, after the person's yes, still goes to
569
+ `AGENTS.md`.
570
+
571
+ A launch that carries developer instructions writes no new blocks to the repository `AGENTS.md`. But blocks an earlier
572
+ handover or resume left there are refreshed from their sources, by the same rule as every other managed block. That
573
+ matters because the launch text asks Codex to follow `AGENTS.md` where the two differ.
574
+
575
+ **If your shell sets `CODEX_HOME`.** When neither the seat nor the daemon declares a `CODEX_HOME`, a seat's pane keeps
576
+ its own, and OpenRig reads `~/.codex`. A `CODEX_HOME` that only your shell startup sets (in `~/.zshrc`, for example),
577
+ with the daemon started without it, isn't seen. A `developer_instructions` set in that home is then replaced by the
578
+ launch value for the session. To have it checked, declare that same absolute path as `CODEX_HOME` in the member's or
579
+ rig's `env:` (see [Launch environment](rig-spec.md#launch-environment), "A seat's own account"). OpenRig then reads
580
+ that home at the seat's next fresh launch, and a `developer_instructions` set there keeps the repository `AGENTS.md`.
581
+ The seat keeps the same home and login.
582
+
583
+ **What it doesn't cover.** OpenRig doesn't read Codex's packaged defaults, or MDM- or enterprise-managed settings. A
584
+ `developer_instructions` set there may be replaced for the session. Legacy MDM-managed config ranks above launch flags,
585
+ so it can override OpenRig's guidance, and the seat then gets none of it.
586
+
587
+ **Not established.** The order Codex assembles developer instructions and `AGENTS.md` in, and how it settles every
588
+ conflict, aren't established; the opening sentence asks it to follow `AGENTS.md`. The native behaviour was observed on
589
+ Codex 0.164.0 alone, on fresh launches without tools.
590
+
531
591
  ### Runtime Differences
532
592
 
533
593
  **Claude Code:**
@@ -558,7 +618,10 @@ remain shared.
558
618
  - Can self-install dependencies from instructions but timer/recurring behavior is not reliably available
559
619
 
560
620
  **Pi and OMP:**
561
- - Read `AGENTS.md` in the working directory; guidance is merged there, added to Pi's own system prompt
621
+ - Read `AGENTS.md` in the working directory, added to Pi's own system prompt. Pi also reads the one in its agent
622
+ directory: on a fresh launch, a Pi seat's guidance is merged there, under OpenRig's state, not into the
623
+ repository's. When that file or its directory is a link, the repository `AGENTS.md` is used instead. A restore keeps
624
+ the file the seat launched with. OMP keeps its guidance in the repository `AGENTS.md`
562
625
  - Selected skills are projected into the seat's own agent directory under OpenRig's state, not into a shared
563
626
  workspace folder
564
627
 
@@ -672,6 +735,29 @@ When authoring startup content, note which instructions are runtime-specific. Fo
672
735
 
673
736
  ---
674
737
 
738
+ ## Files OpenRig writes into a project
739
+
740
+ These are the files OpenRig writes into a seat's working directory, and what `rig down` does with each. Paths are
741
+ relative to that directory.
742
+
743
+ | Path | When OpenRig writes it | What `rig down` does |
744
+ | --- | --- | --- |
745
+ | Managed blocks in `CLAUDE.md` (or the rig's `managed_blocks` file, such as `CLAUDE.local.md`) or `AGENTS.md` | Each launch merges the seat's guidance blocks. A fresh Codex launch that takes developer instructions puts them in its launch text instead: in `AGENTS.md` it adds only the seat-skills line, after your yes, and refreshes blocks already there. A fresh Pi seat writes its own agent-directory `AGENTS.md` outside the project, except when that folder or file is a link: then its guidance stays in the repository `AGENTS.md`. | Removes OpenRig's blocks, current or legacy, and keeps everything else. When nothing else is left, it deletes the file if the file began with an OpenRig block, or held only blocks in an older format. A block-only file isn't proof that OpenRig created it. The seat-skills line is kept if you edited it. |
746
+ | `.openrig/context-collector.cjs` | Claude seats, at launch. | Removes it while its bytes are still the shipped collector's; otherwise keeps it and says so. |
747
+ | `.claude/settings.local.json` | Claude seats, at launch: OpenRig's status line and its activity hooks are merged in, separately. Your own status line is never replaced, but the activity hooks are still merged beside it. A file that doesn't parse gets neither. | Removes OpenRig's status line and hooks and keeps the file, even if `{}` is all that's left. |
748
+ | `.claude/settings.local.json` fragments and `.mcp.json` | When a profile or spec declares `claude_settings_fragment` or `claude_mcp_fragment`. | Leaves the merged content in place. |
749
+ | `.claude/agents/`, `.claude/plugins/<id>/`, `.claude/extensions/<id>/`; `.agents/<id>.yaml`, `.codex/plugins/<id>/`, `.agents/extensions/<id>/` | When the seat's projection includes subagents, plugins or runtime resources (Claude, then Codex). | Leaves them in place. |
750
+ | `.claude/skills/<id>/`, `.agents/skills/<id>/` | Only for a seat without seat storage. New Claude and Codex seats keep their skills under `$OPENRIG_HOME/state/seats/`, outside the project. | Leaves them in place. |
751
+ | The managed compaction preparation folder described in [Claude compaction preparation directory](#claude-compaction-preparation-directory), with its `.gitignore` of `*` and each attempt's `RESTORE-MAP.md` | Managed Claude compaction, unless a preparation root is configured elsewhere. | Leaves it in place. |
752
+ | `.rigged-checkpoint.md` | A restore that didn't resume a seat's native conversation (by choice or not) and had a checkpoint to hand it. | Leaves it in place. |
753
+
754
+ `rig down` leaves a file alone while another seat still uses it: a running seat of the same rig, or any seat of
755
+ another rig that isn't archived. That is decided file by file. A guidance file is kept while another seat's
756
+ guidance targets the same file. The Claude settings and collector are kept while another Claude seat works in that
757
+ directory. So another rig's Codex seat keeps `AGENTS.md` without keeping `CLAUDE.md` or the Claude settings. It
758
+ removes `.openrig/` and `.claude/` only when they are empty.
759
+ `rig down --delete` does nothing more to project files. OpenRig doesn't edit your project's own `.gitignore`.
760
+
675
761
  ## Patterns and Anti-Patterns
676
762
 
677
763
  ### Good Patterns
@@ -741,6 +827,32 @@ rig uses it, so it stays until then. To remove it sooner, by hand:
741
827
  3. Keep a copy of the file, remove only those lines, and compare the result with
742
828
  the copy: nothing else in the file should differ.
743
829
 
830
+ **The kernel's own folder.** A newly created default kernel works in
831
+ `<workspace.root>/kernel`, beside your projects (`<workspace.root>/projects` by
832
+ default) rather than above them. Claude reads `CLAUDE.md` from a seat's folder
833
+ and from every folder above it, so a kernel working in the workspace root put its
834
+ guidance into every Claude project seat below it. If that folder can't be made,
835
+ the new kernel works in the workspace root, as before.
836
+
837
+ A kernel that already exists keeps its folders, usually `workspace.root`.
838
+ Upgrading moves no seat, changes no restored conversation and removes no file.
839
+ To move an existing kernel yourself, if you want to:
840
+
841
+ 1. Save the new folder for each kernel seat with `rig seat set-cwd <seat> --cwd
842
+ <workspace.root>/kernel --reason <text>`, using the absolute path. It creates
843
+ the folder ([details](#change-an-existing-seats-working-directory)).
844
+ 2. Choose when each seat adopts it. A seat keeps its current folder until it
845
+ starts again, and the new start doesn't continue its current native
846
+ conversation: `rig seat launch <seat> --fresh --stop --reason <text>` starts a
847
+ blank one, and `rig handover <seat> --source rebuild --reason <text>` carries
848
+ durable context into a new one. Nothing does this for you.
849
+ 3. Tidy the old `<workspace.root>/CLAUDE.md` (or `AGENTS.md`) by hand, once no
850
+ running rig's seat still works in that folder: a seat there still reads those
851
+ blocks, and `rig down` checks the same before it removes them. Remove only
852
+ OpenRig's managed blocks, each from its `<!-- BEGIN OpenRig MANAGED BLOCK: … -->`
853
+ line through its `END` line, as in the steps above, and keep everything else,
854
+ including your own text. Don't move or delete the whole file.
855
+
744
856
  **Separate project context from role**
745
857
 
746
858
  Don't put project documentation inside the role guidance. The role is about the agent's function; project context is about what the agent is working on. Use rig-level or pod-level startup files for project context.
@@ -23,7 +23,10 @@ Only the activity axis is served today. The session and resumability values are
23
23
  `activity-taxonomy.ts` but no surface reads them: `rig ps --nodes --full` shows the raw session
24
24
  STATUS, both node views show a LIFECYCLE of `running`, `detached`, `recoverable` or `attention_required` (`run`, `det`, `rec`,
25
25
  `att`), and node inventory serves `occupantLifecycle` (`active`, `retiring`, `retired`,
26
- `context_walled`, `compacted`, `crashed`, `unknown`).
26
+ `context_walled`, `compacted`, `crashed`, `unknown`). Node inventory's `sessionStatus` is the
27
+ recorded session status, with two observed corrections: a running session whose pane is verified
28
+ to have exited (identity reason `pane_exited`) reads `exited`, with `startupStatus:
29
+ "attention_required"`, and a running session confirmed missing reads `detached`.
27
30
 
28
31
  The axes never blend. Reachability is strict; revival optimism is a different field
29
32
  (omnigent's strict-liveness split). `unknown` is a first-class honest value — the oracle
@@ -59,6 +62,21 @@ the existing live-hook fallback in effect; lifecycle, startup, held and error si
59
62
  can independently raise attention. A false attention flag means no known trigger, not
60
63
  proof that an unobserved input box is clear.
61
64
 
65
+ A handover whose successor started without a required file also raises attention. That's
66
+ a projected guidance file or a guidance startup file marked `required` still missing from
67
+ the guidance file, or, for a fresh or rebuild successor, a required `send_text` startup
68
+ file that's missing. The seat serves `startedWithoutRequired` with each file's path, the
69
+ table's reason column names each file, and the handover's own output says it's degraded.
70
+ The mark belongs to that successor's session, so the seat's next launch or handover
71
+ clears it. Time alone never does. Repairing the file in place doesn't clear it either,
72
+ because no route delivers guidance into a running conversation.
73
+
74
+ A fresh or rebuild successor's first turn opens with the seat's `send_text` startup files,
75
+ the ones a fresh start delivers, as absolute paths with the role first. A pointer asks the
76
+ successor to read the file; it isn't the pasted text a start sends. A fork successor
77
+ carries its parent's conversation and gets no list. `send_text` startup actions, such as
78
+ an `after_ready` preload, aren't run for a successor.
79
+
62
80
  The compact human table's ATTN column renders `yes`, `no`, or `?` when the flag is
63
81
  unavailable. Compact JSON retains `needsAttention`; use `--full` or
64
82
  `--fields needsAttention,arbitratedNeedsInput,needsInputEvidence` with `--json` for the
@@ -116,7 +134,10 @@ time-bounded evidence. Rungs, top down, with each rung's retirement condition:
116
134
  PER-HARNESS when that harness's hook rung earns trust through a measured agreement
117
135
  window in production — never by fixture pass alone (symmetric admission: a fixture
118
136
  pass admits a rung to TRIAL, where it is measured but not consulted; production agreement
119
- promotes it). Undeclared and partial-coverage rungs are identity-only, which is also where
137
+ promotes it). For Codex, this fallback also accepts a fresh working status adjacent to
138
+ the composer, or an advancing counter across two fresh captures when output separates
139
+ them. This positive evidence expires after five seconds; unrecognized, frozen, old or
140
+ pre-occupant frames add nothing. It uses the existing pane capture. Undeclared and partial-coverage rungs are identity-only, which is also where
120
141
  a degraded rung goes, with one declared exception: for a pi or omp seat or a community
121
142
  harness, sampling is positive-only: a changing pane reads working, and a quiet one never reads idle on its
122
143
  own, since the pane can be quiet mid-turn.
@@ -1,4 +1,4 @@
1
- # Integration author contracts — DRAFT, published with 0.7.6
1
+ # Integration author contracts — DRAFT, first published with 0.7.6
2
2
 
3
3
  OpenRig composes agents into a team. An integration author supplies the pieces that let a new harness participate, or let an existing harness run in a new environment. This guide divides that work into two contracts:
4
4
 
@@ -9,16 +9,16 @@ These are draft author responsibilities. Some use implemented OpenRig interfaces
9
9
 
10
10
  ## Release and support status
11
11
 
12
- This draft was published with **OpenRig 0.7.6** (tag [`v0.7.6`](https://github.com/mvschwarz/openrig/tree/v0.7.6), source `c00c6321`). Its implemented-interface baseline is commit [`b6bd4633`](https://github.com/mvschwarz/openrig/tree/b6bd4633fbd94634a2b4bdef2574a6880f97be63). That base includes the runner declaration and `passes_model` changes. The published 0.7.6 adds release repairs and documentation on top of that base. References below use the immutable base instead of a moving branch.
12
+ This draft was published with **OpenRig 0.7.6** (tag [`v0.7.6`](https://github.com/mvschwarz/openrig/tree/v0.7.6), source `c00c6321`). Its implemented-interface baseline is commit [`b6bd4633`](https://github.com/mvschwarz/openrig/tree/b6bd4633fbd94634a2b4bdef2574a6880f97be63). That base includes the runner declaration and `passes_model` changes. The published 0.7.6 adds release repairs and documentation on top of that base. **OpenRig 0.7.8** adds seat activity grants, OpenRig's side of the answered permission path and the maintained OpenShell reference driver (`rig environment`); the rows below that say 0.7.8 describe it. References below use the immutable base instead of a moving branch, except the community preset reference, which is the in-tree copy.
13
13
 
14
- | Area | Status at this baseline | What the status means |
14
+ | Area | Status | What the status means |
15
15
  |---|---|---|
16
16
  | Community launcher presets, RigSpec members and AgentSpec role/startup declarations | Implemented interfaces | They compose configuration. A launcher must implement its declared effects; successful parsing does not prove delivery or native behavior. |
17
17
  | `runner: true` with `launch_result: true` | Released in 0.7.6 | The declaration is retained at launch, and Core uses the runner identity/activity path. It does not supply a runner executable. |
18
18
  | `passes_model: true` | Released in 0.7.6 | Passes the declared model through `OPENRIG_MODEL`. It does not observe or verify the effective native model. Cursor and Hermes examples leave it off pending native qualification. |
19
- | The dsh/ACP input, cancellation and answered permission recipe (a person answers, and the default is permit) | Proposed author implementation | No end-to-end dsh integration is established. Native reopen capabilities and the tools-off case remain implementer questions. |
19
+ | The dsh/ACP input, cancellation and answered permission recipe (a person answers, and the default is permit) | OpenRig's side released in 0.7.8; runner side not qualified | OpenRig asks a person for a runner's permission requests and returns the answer. No end-to-end dsh integration is established, and the native verdict is pending. Native reopen capabilities and the tools-off case remain implementer questions. |
20
20
  | Exact native resume via an author launcher | Existing interface; integration-specific evidence | A requested conversation must reopen exactly or fail honestly. One provider/harness result does not establish portability to another. |
21
- | Environment preparation, projection, artifact export and owned-resource cleanup | Measured in a private wrapper; generic seam proposed | The platform chapter makes the responsibilities reusable. Core does not provide a generic platform driver or `DeploySpec` loader at this baseline. |
21
+ | Environment preparation, projection, artifact export and owned-resource cleanup | OpenShell reference driver released in 0.7.8; generic seam proposed | The platform chapter makes the responsibilities reusable. Core ships one maintained reference driver, OpenShell 0.1.6, as `rig environment`. It doesn't provide a generic platform driver or `DeploySpec` loader. |
22
22
  | `HarnessSpec`, `DeploySpec`, generic lifecycle fields and wake-on-demand declarations | Proposed vocabulary or unsupported configuration | They are not new accepted YAML keys. Use existing composition and an explicit author implementation. |
23
23
  | Cross-host native resume, provider-wide cancellation or permission support | Unresolved unless qualified by an integration | Unsupported and untested are distinct from observed failure. Publish the actual boundary and version. |
24
24
 
@@ -50,7 +50,7 @@ The queue records who owns work. It does not prove that an old provider process
50
50
 
51
51
  ## Start from an existing example
52
52
 
53
- For a terminal harness, begin with the pinned [community preset reference](https://github.com/mvschwarz/openrig/blob/b6bd4633fbd94634a2b4bdef2574a6880f97be63/docs/reference/community-harness-presets.md) and the [Cursor](https://github.com/mvschwarz/openrig/tree/b6bd4633fbd94634a2b4bdef2574a6880f97be63/docs/reference/community-harness-examples/cursor) or [Hermes](https://github.com/mvschwarz/openrig/tree/b6bd4633fbd94634a2b4bdef2574a6880f97be63/docs/reference/community-harness-examples/hermes) directory. Their presence is source guidance, not an effective-model or complete integration guarantee.
53
+ For a terminal harness, begin with the [community preset reference](community-harness-presets.md) and the pinned [Cursor](https://github.com/mvschwarz/openrig/tree/b6bd4633fbd94634a2b4bdef2574a6880f97be63/docs/reference/community-harness-examples/cursor) or [Hermes](https://github.com/mvschwarz/openrig/tree/b6bd4633fbd94634a2b4bdef2574a6880f97be63/docs/reference/community-harness-examples/hermes) directory. Their presence is source guidance, not an effective-model or complete integration guarantee.
54
54
 
55
55
  For a structured runner, the [runner chapter](harness-runner-contract.md#2-declare-it-what-the-preset-says-fixed-at-launch) supplies a minimal preset, launch record and activity message. The executable named by the preset must still be implemented and installed by its author.
56
56
 
@@ -8,4 +8,15 @@ Read `GET /api/seat/stop-precondition/:seatRef` immediately before an operator-c
8
8
 
9
9
  Pass `expected` unchanged in the body of the existing `POST /api/seat/stop/:seatRef`, alongside `reason` and optional `operator`. The contract marker lets clients detect support. `expected` is optional; a request without it retains the existing stop behavior. A malformed explicit value returns HTTP 400. A null session ID can describe an empty seat, but stopping it returns `no_session`.
10
10
 
11
- Checked stop requires the delivery guard. It refuses a changed node, latest session, binding or occupant before a terminal effect with HTTP 409 `selection_changed`. If the selection changes after client detach, the response reports `partialEffect: true` and no kill is sent. A kill failure or a failure to save stop state after a kill reports `stop_uncertain`; inspect the seat before retrying. Success retains the usual `seat`, `sessionName` and `sessionId` fields.
11
+ Checked stop requires the delivery guard. It refuses a changed node, latest session, binding or occupant before a terminal effect with HTTP 409 `selection_changed`. A kill failure or a failure to save stop state after a kill reports `stop_uncertain`; inspect the seat before retrying. Success retains the usual `seat`, `sessionName` and `sessionId` fields.
12
+
13
+ A `selection_changed` or `stop_uncertain` response from a checked stop says how far the stop got in `stopPhase`. A refusal before the stop starts carries neither `stopPhase` nor `partialEffect`, and nothing was sent. The stop detaches the seat's clients, checks the selection again, then kills the session:
14
+
15
+ | `stopPhase` | What was sent to the seat |
16
+ | --- | --- |
17
+ | `none` | Nothing. |
18
+ | `detach_attempted` | The client detach, which may not have finished. No kill. |
19
+ | `detached` | The client detach. No kill. |
20
+ | `kill_attempted` | The kill. |
21
+
22
+ `partialEffect` is `true` whenever `stopPhase` isn't `none`, so on its own it doesn't say whether the kill went out. `selection_changed` with `stopPhase: "kill_attempted"` is a change seen after the kill, when the stop state is saved: the session was killed, so re-read the seat rather than offering the stop again.
@@ -5,8 +5,9 @@ It runs in the seat's pane, hosts `dsh --profile acp` over ACP on stdio, and doe
5
5
  section:
6
6
  - **identity:** the launch record, written once the conversation is open;
7
7
  - **one prompt per block:** each submitted block becomes one `session/prompt`, using bracketed paste in a TTY;
8
- - **turn boundaries:** reported as activity hooks;
9
- - **cancel:** `/abort` or Ctrl-C sends `session/cancel`, and a turn reads cancelled only when dsh says so;
8
+ - **turn boundaries:** reported as activity hooks, with a working beat every 10 s through a long, quiet turn;
9
+ - **cancel:** `/abort` or Ctrl-C sends `session/cancel`, and a turn reads cancelled only when dsh says so. Type `/abort`
10
+ in the seat's pane: one sent with `rig send` arrives inside a From/To envelope, so it's an ordinary prompt;
10
11
  - **permissions:** each request goes to a person through OpenRig;
11
12
  - **resume:** it reopens the exact conversation, or says honestly that it couldn't.
12
13
 
@@ -21,13 +22,19 @@ own. [bpamiri/dsh-seat](https://github.com/bpamiri/dsh-seat) is a fuller dsh run
21
22
  `$OPENRIG_HOME/community-harnesses/`. Then declare a member with `runtime: dsh`.
22
23
  3. **Give the seat credentials.** Each seat gets its own dsh home, at `$OPENRIG_HOME/state/dsh/<node>/home`, because dsh
23
24
  rewrites its profile there on every start. Put a `.credentials.yaml` there, or put a provider key in the seat's
24
- `env:`. To use a home you prepared yourself, set `OPENRIG_DSH_HOME`. `OPENRIG_DSH` names another `dsh` binary.
25
+ `env:`. To use a home you prepared yourself, set `DSH_SEAT_HOME` in the member's `env:`; `DSH_SEAT_BIN` there names
26
+ another `dsh` binary. The runner doesn't take dsh's own `DSH_HOME` from its environment, because your shell's startup
27
+ files run after the seat's `env:` and could set it. A member's `env:` can't set `OPENRIG_*` names, which OpenRig
28
+ reserves, but the runner still reads `OPENRIG_DSH_HOME` and `OPENRIG_DSH` when something exports them to it, such as
29
+ a preset `command` wrapper.
25
30
 
26
31
  The runner's own defaults for dsh:
27
32
  - **Uploads:** the seat home gets a `cordis.patch.yml` that turns off dsh's session-log and plugin-list uploads to
28
33
  DeepSeek, and the runner starts dsh with `DSH_TELEMETRY_DISABLED=1`.
29
34
  - **Permission mode:** `DSH_PERMISSION_MODE` is `workspace-write` unless you set it.
30
35
  - **The hook token:** OpenRig's activity token isn't passed to dsh, whose shell tool inherits the runner's environment.
36
+ - **Its version:** the launch record names dsh's version from `dsh --version`. If that fails or takes over 5 seconds, it
37
+ names the version dsh's ACP handshake reports, marked as such: dsh 0.2.1-rc.2 reports 0.0.1 there.
31
38
 
32
39
  ## Permissions
33
40
 
@@ -37,6 +44,11 @@ The runner submits each request to OpenRig, which asks one person:
37
44
 
38
45
  That person answers one of the options dsh offered, and the runner gives that answer to the same live request, once.
39
46
 
47
+ **When the person answers in their own words** rather than with a choice, a yes or a no, OpenRig permits by default and
48
+ passes their words back as `said`. The runner gives dsh its option as usual, shows the words in the pane, and queues
49
+ them like any other message, so dsh gets them after the current turn and after any message already waiting. The words
50
+ are never the answer.
51
+
40
52
  **When no one can be asked, the request is permitted** with dsh's own allow option: `allow_once` when dsh offers it,
41
53
  else `allow_always`. That's OpenRig's default. The runner does the same when OpenRig can't answer: an older OpenRig
42
54
  without this path, an OpenRig it can't reach, or a refusal other than `--deny`.
@@ -53,10 +65,23 @@ OpenRig says the request isn't the seat's current occupant's (for example, after
53
65
 
54
66
  ## Before you declare resume
55
67
 
56
- The preset leaves `resume` out. The runner reopens a conversation by the method dsh advertises: `session/resume`, or
57
- `session/load`. When dsh advertises neither, it tries `session/resume`. It reports a conversation missing only on dsh's
58
- own not-found error (`-32002`); any other failure leaves the resume unconfirmed, and it never starts a new conversation
59
- on a resume. Add `resume: true` after a real dsh has reopened a conversation and refused a missing one.
68
+ The preset leaves `resume` out, so a restore stops and asks, and a fresh launch starts a new conversation.
69
+ `rig seat restart --keep-conversation` is for Codex seats only. The runner reopens a conversation by the method dsh
70
+ advertises: `session/resume`, or `session/load`. When dsh advertises neither, it tries `session/resume`. It never starts
71
+ a new conversation on a resume.
72
+
73
+ **Telling a missing conversation from one that won't reopen.** dsh `0.2.1-rc.2` answers `-32602` both for a
74
+ conversation it doesn't have and for one already active elsewhere, so the runner never reads that error as missing.
75
+ - **Only dsh's own not-found error (`-32002`) counts as missing.** Any other failure leaves the resume unconfirmed.
76
+ - **When dsh advertises `session/list`** (it does), the runner first asks the list, following its pages. A conversation
77
+ the list names but that won't reopen stays unconfirmed, even on a not-found.
78
+ - **An unlisted conversation is still reopened.** dsh's list can leave out a conversation another running dsh holds
79
+ unsaved, so it can't show a conversation is gone.
80
+
81
+ **Limit:** dsh answers `-32602`, not `-32002`, for a conversation it doesn't have, so the runner can't report a missing
82
+ dsh conversation as missing. It reads unconfirmed.
83
+
84
+ Add `resume: true` after a real dsh has reopened a conversation and recalled what was said in it.
60
85
 
61
86
  ## Check it without a model
62
87
 
@@ -8,10 +8,10 @@ launch_result: true
8
8
  first_input: true
9
9
  limits:
10
10
  - written for dsh 0.2.1-rc.2 (npm @deepseek-ai/dsh) over ACP protocol 1, with Node 22 or later, and checked against a stand-in agent only
11
- - each seat gets its own dsh home under $OPENRIG_HOME/state/dsh/<node>/home, holding a patch that turns off dsh's session-log and plugin-list uploads to DeepSeek; give it credentials (.credentials.yaml there) or a provider key in the seat's env
11
+ - each seat gets its own dsh home under $OPENRIG_HOME/state/dsh/<node>/home, holding a patch that turns off dsh's session-log and plugin-list uploads to DeepSeek; give it credentials (.credentials.yaml there) or a provider key in the seat's env; set DSH_SEAT_HOME in the member's env to use a home you prepared, and DSH_SEAT_BIN for another dsh binary (a member's env can't set OPENRIG_* names, and the runner doesn't read dsh's own DSH_HOME)
12
12
  - DSH_PERMISSION_MODE defaults to workspace-write; a permission request goes to the default person or the seat's override (rig seat set-permissions-to), is permitted with dsh's allow_once (else allow_always) when no one can be asked or OpenRig can't answer, and is refused and held as needs input only after --deny
13
13
  - allow_always creates a standing grant in dsh, which OpenRig doesn't record or revoke; the runner prefers allow_once, and where dsh keeps the grant and for how long isn't checked
14
- - resume isn't declared until a real dsh has reopened a conversation and refused a missing one; the runner reopens by the method dsh advertises and reports missing only on dsh's own not-found error
14
+ - resume isn't declared until a real dsh has reopened a conversation and recalled it; the runner reopens by the method dsh advertises and reports missing only on dsh's own not-found error, not when dsh's session list names the conversation; dsh answers -32602 for a missing conversation (and for one active elsewhere), so a missing dsh conversation reads unconfirmed
15
15
  - a prompt whose whole text is /abort can't be sent; a Ctrl-C byte inside a paste also aborts; without a TTY, input is read line by line; this isn't a binary-safe channel
16
16
  - one prompt at a time; a message that arrives mid-turn waits for the next turn
17
17
  - the seat's model isn't passed; dsh uses its own configured model
@@ -4,11 +4,12 @@
4
4
  //
5
5
  // It follows docs/reference/harness-runner-contract.md: it hosts `dsh --profile acp` over ACP on stdio, writes the
6
6
  // launch record once the conversation is open, turns each submitted block into one prompt, reports turn boundaries as
7
- // activity hooks, cancels on /abort or Ctrl-C, and sends permission requests to OpenRig: a person answers, or OpenRig
8
- // permits when no one can be asked, and so does the runner when OpenRig can't answer (refusing and holding needs input
9
- // only when the seat opted in to refusal). Copy it and maintain it as your own.
7
+ // activity hooks with a working beat through a long, quiet turn, cancels on /abort or Ctrl-C, and sends permission
8
+ // requests to OpenRig: a person answers, or OpenRig permits when no one can be asked, and so does the runner when OpenRig
9
+ // can't answer (refusing and holding needs input only when the seat opted in to refusal). Copy it and maintain it as your
10
+ // own.
10
11
 
11
- import { spawn } from "node:child_process";
12
+ import { execFileSync, spawn } from "node:child_process";
12
13
  import { existsSync, mkdirSync, readFileSync, realpathSync, renameSync, writeFileSync } from "node:fs";
13
14
  import { homedir } from "node:os";
14
15
  import { join } from "node:path";
@@ -19,6 +20,9 @@ const RUNNER = "openrig-dsh-runner 1";
19
20
  const NAME = process.env.OPENRIG_RUNTIME || "dsh"; // the preset's name: OpenRig passes it, and checks the record against it
20
21
  const LIVENESS_SECONDS = 60;
21
22
  const BEAT_MS = 30_000;
23
+ // The working beat (contract section 4): every 10 s, more often than half its 30 s lifetime.
24
+ const WORK_LIVENESS_SECONDS = 30;
25
+ const WORK_BEAT_MS = 10_000;
22
26
  const ACTIVE_EVERY_MS = 15_000;
23
27
  const POST_TIMEOUT_MS = 2_000;
24
28
  const WAIT_SECONDS = 25;
@@ -30,6 +34,8 @@ const NOT_LIVE = ["stale_generation", "activity_grant_wrong_seat", "activity_gra
30
34
  const ENDED = ["refused", "withdrawn", "stale", "answered"];
31
35
  const CANCELLED = { outcome: { outcome: "cancelled" } };
32
36
  const ACP_RESOURCE_NOT_FOUND = -32002;
37
+ // The most pages of dsh's session list read before a resume; a longer list decides nothing.
38
+ const LIST_PAGES = 50;
33
39
 
34
40
  const PASTE_START = "\x1b[200~";
35
41
  const PASTE_END = "\x1b[201~";
@@ -201,10 +207,12 @@ const UPLOADS_OFF = [
201
207
  "",
202
208
  ].join("\n");
203
209
 
204
- /** Each seat gets its own writable dsh home (dsh rewrites its profile there on every start). OPENRIG_DSH_HOME names
205
- * one you prepared yourself, which is used as it is. */
210
+ /** Each seat gets its own writable dsh home (dsh rewrites its profile there on every start). DSH_SEAT_HOME, which a rig
211
+ * spec's env: can set, or OPENRIG_DSH_HOME names one you prepared yourself, which is used as it is. Not dsh's own
212
+ * DSH_HOME: a person's shell startup files can export it, and they run after the seat's env:. */
206
213
  function seatHome() {
207
- if (process.env.OPENRIG_DSH_HOME) return process.env.OPENRIG_DSH_HOME;
214
+ const prepared = process.env.OPENRIG_DSH_HOME || process.env.DSH_SEAT_HOME;
215
+ if (prepared) return prepared;
208
216
  const seat = process.env.OPENRIG_NODE_ID || process.env.OPENRIG_SESSION_NAME || "default";
209
217
  const home = join(openrigHome(), "state", "dsh", seat, "home");
210
218
  mkdirSync(home, { recursive: true, mode: 0o700 });
@@ -213,6 +221,17 @@ function seatHome() {
213
221
  return home;
214
222
  }
215
223
 
224
+ /** dsh's version as its CLI reports it, or null when it can't say. dsh 0.2.1-rc.2's ACP handshake reports 0.0.1.
225
+ * SIGKILL at the timeout, because a synchronous call waits for the child to exit, and a child can ignore SIGTERM. */
226
+ function cliVersion(bin, env) {
227
+ try {
228
+ const out = execFileSync(bin, ["--version"], { encoding: "utf8", env, timeout: 5_000, killSignal: "SIGKILL", stdio: ["ignore", "pipe", "ignore"] });
229
+ return out.match(/\d+\.\d+\.\d+(?:-[0-9A-Za-z.]+)?/)?.[0] ?? null;
230
+ } catch {
231
+ return null;
232
+ }
233
+ }
234
+
216
235
  function writeLaunchRecord(fields) {
217
236
  const path = process.env.OPENRIG_LAUNCH_RESULT;
218
237
  if (!path) return;
@@ -248,16 +267,23 @@ async function main() {
248
267
  agentEnv.DSH_PERMISSION_MODE ??= "workspace-write";
249
268
  if (agentEnv.DSH_TELEMETRY_DISABLED === undefined && agentEnv.DSH_TELEMETRY_MODE === undefined) agentEnv.DSH_TELEMETRY_DISABLED = "1";
250
269
 
251
- const child = spawn(env.OPENRIG_DSH || "dsh", ["--profile", "acp"], { cwd, env: agentEnv, stdio: ["pipe", "pipe", "inherit"] });
270
+ // DSH_SEAT_BIN, which a rig spec's env: can set, or OPENRIG_DSH names another dsh binary.
271
+ const bin = env.OPENRIG_DSH || env.DSH_SEAT_BIN || "dsh";
272
+ const version = cliVersion(bin, agentEnv);
273
+ const child = spawn(bin, ["--profile", "acp"], { cwd, env: agentEnv, stdio: ["pipe", "pipe", "inherit"] });
252
274
  child.stdin.on("error", () => {});
253
275
  const peer = new AgentPeer(child, (line) => say(`[dsh] ${line}`));
254
- const state = { sessionId: null, turn: 0, running: false, cancelRequestedAt: null, holding: false, refused: false, queue: [], asks: new Set(), lastActive: 0 };
276
+ const state = { sessionId: null, turn: 0, running: false, cancelRequestedAt: null, holding: false, refused: false, queue: [], asks: new Set(), lastActive: 0, asking: 0, waiting: 0, resolvedAsk: null };
255
277
  const inflight = new Set();
256
278
  const track = (promise) => { inflight.add(promise); promise.finally(() => inflight.delete(promise)); return promise; };
257
279
  let agentExited = false;
258
280
  let stopping = false;
259
281
  let heartbeat;
282
+ let workBeat;
260
283
  let tty = false;
284
+ // The turn may read working: it runs, nothing holds needs input, no permission request is being submitted or waits for its
285
+ // permission_resolved, and dsh is alive. The beat and the agent's own reports both go by it.
286
+ const working = () => state.running && !state.holding && state.asking === 0 && !state.resolvedAsk && !agentExited;
261
287
 
262
288
  const restoreTty = () => {
263
289
  if (!tty) return;
@@ -267,6 +293,7 @@ async function main() {
267
293
  };
268
294
  const finish = async (code) => {
269
295
  clearInterval(heartbeat);
296
+ clearInterval(workBeat);
270
297
  restoreTty();
271
298
  await Promise.race([Promise.allSettled([...inflight, activity.flushed()]), sleep(2_000)]);
272
299
  process.exit(code);
@@ -297,7 +324,7 @@ async function main() {
297
324
  peer.onNotification("session/update", (params) => {
298
325
  if (params.sessionId !== state.sessionId || !params.update) return;
299
326
  const update = params.update;
300
- const reporting = state.running && !state.holding; // while needs input is held, nothing may read working
327
+ const reporting = working();
301
328
  if (update.sessionUpdate === "agent_message_chunk") {
302
329
  if (update.content?.type === "text") process.stdout.write(update.content.text);
303
330
  if (reporting && Date.now() - state.lastActive >= ACTIVE_EVERY_MS) { state.lastActive = Date.now(); activity.post("active", "agent_message"); }
@@ -344,10 +371,17 @@ async function main() {
344
371
  const allow = options.find((option) => option.kind === "allow_once") ?? options.find((option) => option.kind === "allow_always");
345
372
  const permit = (why) => {
346
373
  if (!allow) return refuse(`${why}, and the agent offered no allow option`);
347
- state.holding = false;
374
+ state.holding = state.refused || state.waiting > 0; // another ask may still wait on a person
348
375
  say(`[permission] permitted: ${why} (${allow.optionId})`);
349
376
  return { outcome: { outcome: "selected", optionId: allow.optionId } };
350
377
  };
378
+ // A person who answered in their own words: OpenRig passes them back as `said`. They join the prompt queue like any
379
+ // message, so dsh gets them after this turn and after any message already waiting. They're never the answer.
380
+ const passOn = (said) => {
381
+ if (typeof said !== "string" || !said.trim()) return;
382
+ say(`[permission] the person also wrote: ${firstLine(said)}`);
383
+ submit(`The person who answered your permission request (${toolCall.title}) also wrote:\n\n${said}`);
384
+ };
351
385
  if (!askId) {
352
386
  if (submitted.body?.code === "denied_by_seat") return refuse("the seat's operator chose to refuse its permission requests");
353
387
  if (NOT_LIVE.includes(submitted.body?.code)) {
@@ -358,7 +392,12 @@ async function main() {
358
392
  : submitted.status === 0 ? "OpenRig couldn't be reached" : `OpenRig couldn't ask anyone (${submitted.body?.code ?? submitted.status})`);
359
393
  }
360
394
  state.holding = true; // OpenRig recorded the seat's permission prompt when it opened the ask
395
+ state.waiting += 1;
361
396
  say(`[permission] OpenRig asked a person (${askId}); waiting for their answer`);
397
+ // This ask no longer waits on a person; the seat still needs input while another one does, or after its own refusal.
398
+ const stopWaiting = () => { state.waiting -= 1; state.holding = state.refused || state.waiting > 0; };
399
+ // The agent got an answer or a permit for this ask: once nothing else waits, permission_resolved says the turn goes on.
400
+ const resolved = () => { state.resolvedAsk = { turn, askId }; };
362
401
  return new Promise((resolve) => {
363
402
  let done = false; // the agent has its answer
364
403
  let ended = false; // OpenRig was told the request is over
@@ -369,7 +408,7 @@ async function main() {
369
408
  withdraw(askId, reason);
370
409
  if (done) return;
371
410
  done = true;
372
- if (!state.refused) state.holding = false; // the turn ended the person's ask: no one is still being asked
411
+ stopWaiting(); // the turn ended the person's ask
373
412
  resolve(CANCELLED);
374
413
  } };
375
414
  state.asks.add(ask);
@@ -385,18 +424,23 @@ async function main() {
385
424
  // A person's option, or OpenRig's permit when they closed it without one.
386
425
  if ((answer.state === "answered" || answer.state === "permitted") && offered(answer.optionId) && live()) {
387
426
  state.asks.delete(ask);
388
- state.holding = false;
427
+ stopWaiting();
389
428
  say(`[permission] ${answer.state}: ${answer.optionId}`);
390
429
  resolve({ outcome: { outcome: "selected", optionId: answer.optionId } });
430
+ resolved();
431
+ passOn(answer.said);
391
432
  } else if (live() && (read.status === 200 ? !ENDED.includes(answer.state) : !NOT_LIVE.includes(answer.code))) {
392
433
  // OpenRig stopped answering, or answered in a way the contract doesn't list: nobody can be asked. The ask stays
393
434
  // tracked, so the turn's end still withdraws it.
435
+ stopWaiting();
394
436
  resolve(permit(read.status === 0 ? "OpenRig couldn't be reached" : `OpenRig couldn't answer (${answer.code ?? read.status})`));
437
+ if (!state.refused) resolved(); // permitted, not refused for want of an allow option
395
438
  } else {
396
439
  state.asks.delete(ask);
397
- state.holding = false; // a person said no, or the request is over: no one is still waiting
440
+ stopWaiting(); // a person said no, or the request is over
398
441
  say(`[permission] not answered (${answer.reason ?? answer.state ?? answer.code ?? read.status}); answered cancelled`);
399
442
  resolve(CANCELLED);
443
+ passOn(answer.said);
400
444
  }
401
445
  }
402
446
  })();
@@ -409,9 +453,19 @@ async function main() {
409
453
  const options = Array.isArray(params.options) ? params.options : [];
410
454
  say(`\n[permission] dsh asks: ${toolCall.title} (${toolCall.kind}); options ${options.map((option) => option.optionId).join(", ")}`);
411
455
  if (!state.running || state.cancelRequestedAt) return CANCELLED;
412
- return askOwner(requestId, toolCall, options);
456
+ state.asking += 1; // no beat while a permission request is open: it may be waiting on a person
457
+ return askOwner(requestId, toolCall, options).finally(() => { state.asking -= 1; setImmediate(settle); });
413
458
  });
414
459
 
460
+ // Once nothing waits on a person or is being submitted, the seat holds no refusal of its own and dsh is alive, say the turn
461
+ // goes on. It goes out after the agent has its answer, and before the next beat.
462
+ const settle = () => {
463
+ const done = state.resolvedAsk;
464
+ if (!done || state.holding || state.asking > 0) return;
465
+ state.resolvedAsk = null;
466
+ if (state.running && state.turn === done.turn && !agentExited) activity.post("active", "permission_resolved", { turnId: String(done.turn), askId: done.askId });
467
+ };
468
+
415
469
  const abort = () => {
416
470
  if (!state.running) { say("[openrig-dsh] no turn is running"); return; }
417
471
  if (state.cancelRequestedAt) return;
@@ -427,6 +481,8 @@ async function main() {
427
481
  state.turn += 1;
428
482
  state.holding = false;
429
483
  state.refused = false;
484
+ state.waiting = 0;
485
+ state.resolvedAsk = null;
430
486
  state.cancelRequestedAt = null;
431
487
  state.lastActive = 0;
432
488
  const turnId = String(state.turn);
@@ -470,16 +526,37 @@ async function main() {
470
526
  return fatal(`dsh didn't complete the ACP handshake (${error.message})`, 1);
471
527
  }
472
528
  const capabilities = init?.agentCapabilities ?? {};
473
- const producer = `${RUNNER}; dsh ${init?.agentInfo?.version ?? "(version not reported)"}; ACP ${init?.protocolVersion ?? "?"}`;
529
+ const reported = init?.agentInfo?.version ? `${init.agentInfo.version} (as its ACP handshake reports it)` : "(version not reported)";
530
+ const producer = `${RUNNER}; dsh ${version ?? reported}; ACP ${init?.protocolVersion ?? "?"}`;
474
531
  const resumeRef = env.OPENRIG_RESUME_REF;
532
+ // Whether dsh's own session list names a conversation, following its pages: true, false when every page was read and
533
+ // none names it, or undefined when the list fails, answers in another shape, or runs past LIST_PAGES pages. An ACP
534
+ // cursor is an opaque string, possibly empty, passed back unchanged; an absent or null one ends the list.
535
+ const listsConversation = async (id) => {
536
+ let cursor;
537
+ for (let page = 0; page < LIST_PAGES; page += 1) {
538
+ let listing;
539
+ try { listing = await peer.request("session/list", cursor === undefined ? {} : { cursor }); } catch { return undefined; }
540
+ if (!Array.isArray(listing?.sessions) || listing.sessions.some((session) => typeof session?.sessionId !== "string")) return undefined;
541
+ if (listing.sessions.some((session) => session.sessionId === id)) return true;
542
+ if (listing.nextCursor === undefined || listing.nextCursor === null) return false;
543
+ if (typeof listing.nextCursor !== "string") return undefined;
544
+ cursor = listing.nextCursor;
545
+ }
546
+ return undefined;
547
+ };
475
548
  if (resumeRef) {
476
549
  // The method dsh advertises; with neither advertised, session/resume, the method dsh 0.2.1-rc.2 answered in its
477
- // maintainer's checks. Only dsh's own "not found" counts as missing; anything else leaves the resume unconfirmed.
550
+ // maintainer's checks. dsh 0.2.1-rc.2 answers -32602 both for a conversation it doesn't have and for one active
551
+ // elsewhere, so that error can't mean missing. Only dsh's own "not found" counts as missing, and not when dsh's list
552
+ // names the conversation. The list can't show a conversation is gone: one another running dsh holds unsaved may be
553
+ // left out, so an unlisted conversation is still reopened. Anything else leaves the resume unconfirmed.
478
554
  const method = capabilities.sessionCapabilities?.resume ? "session/resume" : capabilities.loadSession ? "session/load" : "session/resume";
555
+ const listed = capabilities.sessionCapabilities?.list ? await listsConversation(resumeRef) === true : false;
479
556
  try {
480
557
  await peer.request(method, { sessionId: resumeRef, cwd, mcpServers: [] });
481
558
  } catch (error) {
482
- if (error.code === ACP_RESOURCE_NOT_FOUND) {
559
+ if (error.code === ACP_RESOURCE_NOT_FOUND && !listed) {
483
560
  writeLaunchRecord({ error: "missing", producer });
484
561
  return fatal(`dsh says conversation ${resumeRef} doesn't exist (${error.message}); no new one was started`, 3);
485
562
  }
@@ -500,6 +577,12 @@ async function main() {
500
577
  say("[openrig-dsh] each submitted message is one prompt; /abort or Ctrl-C cancels the running turn");
501
578
 
502
579
  heartbeat = setInterval(() => { if (!state.running && !state.holding && !agentExited) postIdle("idle_heartbeat"); }, BEAT_MS);
580
+ // While a turn runs and nothing waits on a person: the turn is still outstanding and dsh is alive. Not progress.
581
+ workBeat = setInterval(() => {
582
+ if (working()) {
583
+ activity.post("active", "liveness", { turnId: String(state.turn), livenessSeconds: WORK_LIVENESS_SECONDS });
584
+ }
585
+ }, WORK_BEAT_MS);
503
586
  for (const signal of ["SIGHUP", "SIGTERM"]) {
504
587
  process.on(signal, () => {
505
588
  if (state.running && !state.cancelRequestedAt) peer.notify("session/cancel", { sessionId: state.sessionId });