@openrig/cli 0.7.10 → 0.7.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1131) hide show
  1. package/README.md +9 -6
  2. package/daemon/assets/claude-permission-policies.cjs +41 -0
  3. package/daemon/assets/claude-permission-policies.d.cts +3 -0
  4. package/daemon/assets/claude-team-permissions.cjs +13 -3
  5. package/daemon/assets/guidance/openrig-context-entry.md +8 -0
  6. package/daemon/assets/herdr-app/mods/rig-cell-header/main.js +15 -0
  7. package/daemon/assets/herdr-app/mods/rig-cell-header/mod.json +1 -0
  8. package/daemon/assets/herdr-app/mods/rig-ended/main.js +14 -0
  9. package/daemon/assets/herdr-app/mods/rig-ended/mod.json +1 -0
  10. package/daemon/assets/herdr-app/mods/rig-pad/main.js +10 -0
  11. package/daemon/assets/herdr-app/mods/rig-pad/mod.json +1 -0
  12. package/daemon/assets/herdr-app/mods/rig-strip/main.js +153 -0
  13. package/daemon/assets/herdr-app/mods/rig-strip/mod.json +1 -0
  14. package/daemon/assets/openshell/README.md +1 -1
  15. package/daemon/assets/pi-account-lock.cjs +39 -0
  16. package/daemon/assets/plugins/openrig/.claude-plugin/marketplace.json +15 -0
  17. package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +32 -0
  18. package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +39 -0
  19. package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +6 -0
  20. package/daemon/assets/plugins/openrig/LICENSE +200 -0
  21. package/daemon/assets/plugins/openrig/README.md +106 -0
  22. package/daemon/assets/plugins/openrig/assets/logo.svg +1 -0
  23. package/daemon/assets/plugins/openrig/mcp.json +10 -0
  24. package/daemon/assets/plugins/openrig/plugin.json +14 -0
  25. package/daemon/assets/plugins/openrig/skills/working-with-an-openrig-team/SKILL.md +90 -0
  26. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
  27. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
  28. package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +35 -0
  29. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus-state.cjs +103 -0
  30. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +177 -86
  31. package/daemon/assets/plugins/openrig-core/skills/agent-operated-software/SKILL.md +5 -1
  32. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +3 -2
  33. package/daemon/assets/plugins/openrig-core/skills/openrig-skills/SKILL.md +1 -0
  34. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +25 -9
  35. package/daemon/assets/plugins/openrig-core/skills/refocusing/SKILL.md +5 -0
  36. package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +26 -4
  37. package/daemon/assets/plugins/openrig-core/skills/retiring-and-inheriting-a-seat/SKILL.md +1 -1
  38. package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +10 -6
  39. package/daemon/assets/plugins/openrig-core/skills/session-compaction-and-restore/SKILL.md +1 -1
  40. package/daemon/assets/skills/rigs/SKILL.md +37 -2
  41. package/daemon/context-packs/help/help.md +18 -0
  42. package/daemon/context-packs/help/manifest.yaml +1 -1
  43. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  44. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +104 -14
  45. package/daemon/context-packs/reference/acp-agents.md +68 -0
  46. package/daemon/context-packs/reference/getting-started.md +19 -3
  47. package/daemon/context-packs/reference/manifest.yaml +4 -1
  48. package/daemon/context-packs/reference/rig-spec.md +71 -8
  49. package/daemon/context-packs/reference/tmux-servers.md +214 -0
  50. package/daemon/context-packs/reference/whats-new.md +402 -132
  51. package/daemon/context-packs/skills/agent-operated-software/SKILL.md +5 -1
  52. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  53. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  54. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/claude-compaction-restore/SKILL.md +3 -2
  56. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/core/cross-host-rig-commands/SKILL.md +7 -0
  60. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/core/openrig-herdr/SKILL.md +1 -0
  66. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/core/openrig-skills/SKILL.md +1 -0
  68. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  72. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  73. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  74. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  75. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  76. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  77. package/daemon/context-packs/skills/core/working-with-an-openrig-team/SKILL.md +90 -0
  78. package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +10 -0
  79. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  80. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  81. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  82. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  83. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  84. package/daemon/context-packs/skills/openrig-user/SKILL.md +25 -9
  85. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  86. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  87. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  88. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  89. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  90. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  91. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  92. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  93. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  94. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  95. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  96. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  97. package/daemon/context-packs/skills/pods/review-team/SKILL.md +2 -0
  98. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  99. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  100. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  101. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  102. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  103. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  104. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  105. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  106. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  107. package/daemon/context-packs/skills/refocusing/SKILL.md +5 -0
  108. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  109. package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +26 -4
  110. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/SKILL.md +1 -1
  111. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  112. package/daemon/context-packs/skills/seat-continuity-and-handover/SKILL.md +10 -6
  113. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  114. package/daemon/context-packs/skills/session-compaction-and-restore/SKILL.md +1 -1
  115. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  116. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  117. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  118. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  119. package/daemon/dist/adapters/claude-code-adapter.d.ts +3 -1
  120. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  121. package/daemon/dist/adapters/claude-code-adapter.js +59 -15
  122. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  123. package/daemon/dist/adapters/claude-resume.d.ts +2 -1
  124. package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
  125. package/daemon/dist/adapters/claude-resume.js +28 -6
  126. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  127. package/daemon/dist/adapters/codex-resume.d.ts +1 -1
  128. package/daemon/dist/adapters/codex-resume.d.ts.map +1 -1
  129. package/daemon/dist/adapters/codex-resume.js +6 -2
  130. package/daemon/dist/adapters/codex-resume.js.map +1 -1
  131. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +2 -0
  132. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  133. package/daemon/dist/adapters/codex-runtime-adapter.js +54 -13
  134. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  135. package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts +10 -6
  136. package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
  137. package/daemon/dist/adapters/community-harness-runtime-adapter.js +78 -24
  138. package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
  139. package/daemon/dist/adapters/kernel-authority.d.ts +2 -4
  140. package/daemon/dist/adapters/kernel-authority.d.ts.map +1 -1
  141. package/daemon/dist/adapters/kernel-authority.js +10 -41
  142. package/daemon/dist/adapters/kernel-authority.js.map +1 -1
  143. package/daemon/dist/adapters/openshell-podman-observer.d.ts.map +1 -1
  144. package/daemon/dist/adapters/openshell-podman-observer.js +5 -3
  145. package/daemon/dist/adapters/openshell-podman-observer.js.map +1 -1
  146. package/daemon/dist/adapters/pi-community-runtime-adapter.d.ts +27 -0
  147. package/daemon/dist/adapters/pi-community-runtime-adapter.d.ts.map +1 -0
  148. package/daemon/dist/adapters/pi-community-runtime-adapter.js +38 -0
  149. package/daemon/dist/adapters/pi-community-runtime-adapter.js.map +1 -0
  150. package/daemon/dist/adapters/pi-resume.d.ts +4 -1
  151. package/daemon/dist/adapters/pi-resume.d.ts.map +1 -1
  152. package/daemon/dist/adapters/pi-resume.js +38 -9
  153. package/daemon/dist/adapters/pi-resume.js.map +1 -1
  154. package/daemon/dist/adapters/pi-runner-protocol.d.ts +9 -3
  155. package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -1
  156. package/daemon/dist/adapters/pi-runner-protocol.js +13 -1
  157. package/daemon/dist/adapters/pi-runner-protocol.js.map +1 -1
  158. package/daemon/dist/adapters/pi-runner.d.ts +14 -4
  159. package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
  160. package/daemon/dist/adapters/pi-runner.js +174 -29
  161. package/daemon/dist/adapters/pi-runner.js.map +1 -1
  162. package/daemon/dist/adapters/pi-runtime-adapter.d.ts +37 -14
  163. package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
  164. package/daemon/dist/adapters/pi-runtime-adapter.js +97 -31
  165. package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
  166. package/daemon/dist/adapters/tmux-control.d.ts +32 -1
  167. package/daemon/dist/adapters/tmux-control.d.ts.map +1 -1
  168. package/daemon/dist/adapters/tmux-control.js +149 -9
  169. package/daemon/dist/adapters/tmux-control.js.map +1 -1
  170. package/daemon/dist/adapters/tmux-exec.d.ts.map +1 -1
  171. package/daemon/dist/adapters/tmux-exec.js +13 -4
  172. package/daemon/dist/adapters/tmux-exec.js.map +1 -1
  173. package/daemon/dist/adapters/tmux-server.d.ts +11 -0
  174. package/daemon/dist/adapters/tmux-server.d.ts.map +1 -1
  175. package/daemon/dist/adapters/tmux-server.js +13 -1
  176. package/daemon/dist/adapters/tmux-server.js.map +1 -1
  177. package/daemon/dist/adapters/tmux.d.ts +32 -1
  178. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  179. package/daemon/dist/adapters/tmux.js +241 -27
  180. package/daemon/dist/adapters/tmux.js.map +1 -1
  181. package/daemon/dist/attention-surface.d.ts +7 -0
  182. package/daemon/dist/attention-surface.d.ts.map +1 -1
  183. package/daemon/dist/attention-surface.js.map +1 -1
  184. package/daemon/dist/build-info.js +3 -3
  185. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  186. package/daemon/dist/db/all-migrations.js +20 -0
  187. package/daemon/dist/db/all-migrations.js.map +1 -1
  188. package/daemon/dist/db/migrations/150_node_launch_wrapper.d.ts +3 -0
  189. package/daemon/dist/db/migrations/150_node_launch_wrapper.d.ts.map +1 -0
  190. package/daemon/dist/db/migrations/150_node_launch_wrapper.js +5 -0
  191. package/daemon/dist/db/migrations/150_node_launch_wrapper.js.map +1 -0
  192. package/daemon/dist/db/migrations/151_pi_account_switches.d.ts +4 -0
  193. package/daemon/dist/db/migrations/151_pi_account_switches.d.ts.map +1 -0
  194. package/daemon/dist/db/migrations/151_pi_account_switches.js +44 -0
  195. package/daemon/dist/db/migrations/151_pi_account_switches.js.map +1 -0
  196. package/daemon/dist/db/migrations/152_workflow_instance_spec.d.ts +8 -0
  197. package/daemon/dist/db/migrations/152_workflow_instance_spec.d.ts.map +1 -0
  198. package/daemon/dist/db/migrations/152_workflow_instance_spec.js +13 -0
  199. package/daemon/dist/db/migrations/152_workflow_instance_spec.js.map +1 -0
  200. package/daemon/dist/db/migrations/153_events_retention_marks.d.ts +7 -0
  201. package/daemon/dist/db/migrations/153_events_retention_marks.d.ts.map +1 -0
  202. package/daemon/dist/db/migrations/153_events_retention_marks.js +17 -0
  203. package/daemon/dist/db/migrations/153_events_retention_marks.js.map +1 -0
  204. package/daemon/dist/db/migrations/154_workflow_instance_root_objective.d.ts +7 -0
  205. package/daemon/dist/db/migrations/154_workflow_instance_root_objective.d.ts.map +1 -0
  206. package/daemon/dist/db/migrations/154_workflow_instance_root_objective.js +11 -0
  207. package/daemon/dist/db/migrations/154_workflow_instance_root_objective.js.map +1 -0
  208. package/daemon/dist/db/migrations/155_queue_erasure.d.ts +12 -0
  209. package/daemon/dist/db/migrations/155_queue_erasure.d.ts.map +1 -0
  210. package/daemon/dist/db/migrations/155_queue_erasure.js +28 -0
  211. package/daemon/dist/db/migrations/155_queue_erasure.js.map +1 -0
  212. package/daemon/dist/db/migrations/156_queue_erasure_link_indexes.d.ts +4 -0
  213. package/daemon/dist/db/migrations/156_queue_erasure_link_indexes.d.ts.map +1 -0
  214. package/daemon/dist/db/migrations/156_queue_erasure_link_indexes.js +14 -0
  215. package/daemon/dist/db/migrations/156_queue_erasure_link_indexes.js.map +1 -0
  216. package/daemon/dist/db/migrations/157_queue_erasure_batches.d.ts +9 -0
  217. package/daemon/dist/db/migrations/157_queue_erasure_batches.d.ts.map +1 -0
  218. package/daemon/dist/db/migrations/157_queue_erasure_batches.js +18 -0
  219. package/daemon/dist/db/migrations/157_queue_erasure_batches.js.map +1 -0
  220. package/daemon/dist/db/migrations/158_queue_inbox_checkins.d.ts +8 -0
  221. package/daemon/dist/db/migrations/158_queue_inbox_checkins.d.ts.map +1 -0
  222. package/daemon/dist/db/migrations/158_queue_inbox_checkins.js +15 -0
  223. package/daemon/dist/db/migrations/158_queue_inbox_checkins.js.map +1 -0
  224. package/daemon/dist/db/migrations/159_queue_items_handed_off_from_index.d.ts +5 -0
  225. package/daemon/dist/db/migrations/159_queue_items_handed_off_from_index.d.ts.map +1 -0
  226. package/daemon/dist/db/migrations/159_queue_items_handed_off_from_index.js +9 -0
  227. package/daemon/dist/db/migrations/159_queue_items_handed_off_from_index.js.map +1 -0
  228. package/daemon/dist/domain/activity-taxonomy.d.ts +9 -0
  229. package/daemon/dist/domain/activity-taxonomy.d.ts.map +1 -1
  230. package/daemon/dist/domain/activity-taxonomy.js.map +1 -1
  231. package/daemon/dist/domain/agent-activity-store.d.ts +4 -2
  232. package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
  233. package/daemon/dist/domain/agent-activity-store.js +11 -7
  234. package/daemon/dist/domain/agent-activity-store.js.map +1 -1
  235. package/daemon/dist/domain/agent-manifest.d.ts.map +1 -1
  236. package/daemon/dist/domain/agent-manifest.js +11 -1
  237. package/daemon/dist/domain/agent-manifest.js.map +1 -1
  238. package/daemon/dist/domain/builtin-startup-files.d.ts +8 -0
  239. package/daemon/dist/domain/builtin-startup-files.d.ts.map +1 -1
  240. package/daemon/dist/domain/builtin-startup-files.js +37 -11
  241. package/daemon/dist/domain/builtin-startup-files.js.map +1 -1
  242. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +73 -20
  243. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  244. package/daemon/dist/domain/claude-compaction-enforcer.js +442 -84
  245. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  246. package/daemon/dist/domain/claude-continuation-launch.d.ts +16 -0
  247. package/daemon/dist/domain/claude-continuation-launch.d.ts.map +1 -0
  248. package/daemon/dist/domain/claude-continuation-launch.js +110 -0
  249. package/daemon/dist/domain/claude-continuation-launch.js.map +1 -0
  250. package/daemon/dist/domain/claude-git-trust-root.d.ts +11 -0
  251. package/daemon/dist/domain/claude-git-trust-root.d.ts.map +1 -0
  252. package/daemon/dist/domain/claude-git-trust-root.js +72 -0
  253. package/daemon/dist/domain/claude-git-trust-root.js.map +1 -0
  254. package/daemon/dist/domain/claude-managed-launch.d.ts +3 -0
  255. package/daemon/dist/domain/claude-managed-launch.d.ts.map +1 -1
  256. package/daemon/dist/domain/claude-managed-launch.js +17 -7
  257. package/daemon/dist/domain/claude-managed-launch.js.map +1 -1
  258. package/daemon/dist/domain/community-harness-presets.d.ts +5 -0
  259. package/daemon/dist/domain/community-harness-presets.d.ts.map +1 -1
  260. package/daemon/dist/domain/community-harness-presets.js +33 -6
  261. package/daemon/dist/domain/community-harness-presets.js.map +1 -1
  262. package/daemon/dist/domain/compaction-restore-notice.d.ts +3 -1
  263. package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
  264. package/daemon/dist/domain/compaction-restore-notice.js +37 -6
  265. package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
  266. package/daemon/dist/domain/context-monitor.d.ts.map +1 -1
  267. package/daemon/dist/domain/context-monitor.js +3 -0
  268. package/daemon/dist/domain/context-monitor.js.map +1 -1
  269. package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
  270. package/daemon/dist/domain/context-usage-store.js +10 -1
  271. package/daemon/dist/domain/context-usage-store.js.map +1 -1
  272. package/daemon/dist/domain/current-work.d.ts +52 -0
  273. package/daemon/dist/domain/current-work.d.ts.map +1 -1
  274. package/daemon/dist/domain/current-work.js +215 -0
  275. package/daemon/dist/domain/current-work.js.map +1 -1
  276. package/daemon/dist/domain/default-receiver.d.ts +40 -0
  277. package/daemon/dist/domain/default-receiver.d.ts.map +1 -0
  278. package/daemon/dist/domain/default-receiver.js +70 -0
  279. package/daemon/dist/domain/default-receiver.js.map +1 -0
  280. package/daemon/dist/domain/desired-claude-activity-hooks.d.ts +4 -3
  281. package/daemon/dist/domain/desired-claude-activity-hooks.d.ts.map +1 -1
  282. package/daemon/dist/domain/desired-claude-activity-hooks.js +49 -15
  283. package/daemon/dist/domain/desired-claude-activity-hooks.js.map +1 -1
  284. package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
  285. package/daemon/dist/domain/draft-aware-delivery.js +6 -2
  286. package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
  287. package/daemon/dist/domain/escalation-owner.d.ts.map +1 -1
  288. package/daemon/dist/domain/escalation-owner.js +8 -3
  289. package/daemon/dist/domain/escalation-owner.js.map +1 -1
  290. package/daemon/dist/domain/event-bus.d.ts +47 -8
  291. package/daemon/dist/domain/event-bus.d.ts.map +1 -1
  292. package/daemon/dist/domain/event-bus.js +137 -17
  293. package/daemon/dist/domain/event-bus.js.map +1 -1
  294. package/daemon/dist/domain/execution-view.d.ts +9 -0
  295. package/daemon/dist/domain/execution-view.d.ts.map +1 -1
  296. package/daemon/dist/domain/execution-view.js +41 -3
  297. package/daemon/dist/domain/execution-view.js.map +1 -1
  298. package/daemon/dist/domain/gateway/connections-projection.d.ts +13 -1
  299. package/daemon/dist/domain/gateway/connections-projection.d.ts.map +1 -1
  300. package/daemon/dist/domain/gateway/connections-projection.js +38 -10
  301. package/daemon/dist/domain/gateway/connections-projection.js.map +1 -1
  302. package/daemon/dist/domain/gateway/dispatcher.d.ts +2 -0
  303. package/daemon/dist/domain/gateway/dispatcher.d.ts.map +1 -1
  304. package/daemon/dist/domain/gateway/dispatcher.js +14 -1
  305. package/daemon/dist/domain/gateway/dispatcher.js.map +1 -1
  306. package/daemon/dist/domain/gateway/gateway-subsystem.d.ts +5 -0
  307. package/daemon/dist/domain/gateway/gateway-subsystem.d.ts.map +1 -1
  308. package/daemon/dist/domain/gateway/gateway-subsystem.js +10 -0
  309. package/daemon/dist/domain/gateway/gateway-subsystem.js.map +1 -1
  310. package/daemon/dist/domain/gateway/human-quiet-windows.d.ts +2 -1
  311. package/daemon/dist/domain/gateway/human-quiet-windows.d.ts.map +1 -1
  312. package/daemon/dist/domain/gateway/human-quiet-windows.js +2 -1
  313. package/daemon/dist/domain/gateway/human-quiet-windows.js.map +1 -1
  314. package/daemon/dist/domain/gateway/human-readiness.d.ts +7 -0
  315. package/daemon/dist/domain/gateway/human-readiness.d.ts.map +1 -1
  316. package/daemon/dist/domain/gateway/human-readiness.js +45 -0
  317. package/daemon/dist/domain/gateway/human-readiness.js.map +1 -1
  318. package/daemon/dist/domain/gateway/human-registry.d.ts +35 -4
  319. package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
  320. package/daemon/dist/domain/gateway/human-registry.js +130 -42
  321. package/daemon/dist/domain/gateway/human-registry.js.map +1 -1
  322. package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
  323. package/daemon/dist/domain/gateway/operator-delivery-engine.js +8 -2
  324. package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
  325. package/daemon/dist/domain/gateway/relay-config.d.ts +83 -0
  326. package/daemon/dist/domain/gateway/relay-config.d.ts.map +1 -0
  327. package/daemon/dist/domain/gateway/relay-config.js +321 -0
  328. package/daemon/dist/domain/gateway/relay-config.js.map +1 -0
  329. package/daemon/dist/domain/gateway/relay-inbound.d.ts +85 -0
  330. package/daemon/dist/domain/gateway/relay-inbound.d.ts.map +1 -0
  331. package/daemon/dist/domain/gateway/relay-inbound.js +981 -0
  332. package/daemon/dist/domain/gateway/relay-inbound.js.map +1 -0
  333. package/daemon/dist/domain/gateway/relay-outbound.d.ts +218 -0
  334. package/daemon/dist/domain/gateway/relay-outbound.d.ts.map +1 -0
  335. package/daemon/dist/domain/gateway/relay-outbound.js +801 -0
  336. package/daemon/dist/domain/gateway/relay-outbound.js.map +1 -0
  337. package/daemon/dist/domain/gateway/slack/config.d.ts +21 -0
  338. package/daemon/dist/domain/gateway/slack/config.d.ts.map +1 -1
  339. package/daemon/dist/domain/gateway/slack/config.js +30 -3
  340. package/daemon/dist/domain/gateway/slack/config.js.map +1 -1
  341. package/daemon/dist/domain/gateway/slack/message.d.ts +4 -0
  342. package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
  343. package/daemon/dist/domain/gateway/slack/message.js +7 -2
  344. package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
  345. package/daemon/dist/domain/gateway/slack/open-asks.d.ts +13 -1
  346. package/daemon/dist/domain/gateway/slack/open-asks.d.ts.map +1 -1
  347. package/daemon/dist/domain/gateway/slack/open-asks.js +72 -8
  348. package/daemon/dist/domain/gateway/slack/open-asks.js.map +1 -1
  349. package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts +9 -0
  350. package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts.map +1 -1
  351. package/daemon/dist/domain/gateway/slack/outbound-driver.js.map +1 -1
  352. package/daemon/dist/domain/gateway/slack/settled-asks.d.ts.map +1 -1
  353. package/daemon/dist/domain/gateway/slack/settled-asks.js +19 -1
  354. package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -1
  355. package/daemon/dist/domain/gateway/slack/slack-api.d.ts +3 -0
  356. package/daemon/dist/domain/gateway/slack/slack-api.d.ts.map +1 -1
  357. package/daemon/dist/domain/gateway/slack/slack-api.js +12 -4
  358. package/daemon/dist/domain/gateway/slack/slack-api.js.map +1 -1
  359. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +2 -0
  360. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
  361. package/daemon/dist/domain/gateway/slack/slack-delivery.js +38 -12
  362. package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
  363. package/daemon/dist/domain/gateway/slack/slack-recovery.d.ts +12 -1
  364. package/daemon/dist/domain/gateway/slack/slack-recovery.d.ts.map +1 -1
  365. package/daemon/dist/domain/gateway/slack/slack-recovery.js +68 -10
  366. package/daemon/dist/domain/gateway/slack/slack-recovery.js.map +1 -1
  367. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
  368. package/daemon/dist/domain/gateway/slack/slack-subsystem.js +363 -67
  369. package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
  370. package/daemon/dist/domain/gateway/slack/socket-inbound.d.ts +1 -0
  371. package/daemon/dist/domain/gateway/slack/socket-inbound.d.ts.map +1 -1
  372. package/daemon/dist/domain/gateway/slack/socket-inbound.js +5 -0
  373. package/daemon/dist/domain/gateway/slack/socket-inbound.js.map +1 -1
  374. package/daemon/dist/domain/gateway/slack/state-store.d.ts +4 -0
  375. package/daemon/dist/domain/gateway/slack/state-store.d.ts.map +1 -1
  376. package/daemon/dist/domain/gateway/slack/state-store.js +4 -1
  377. package/daemon/dist/domain/gateway/slack/state-store.js.map +1 -1
  378. package/daemon/dist/domain/gateway/slack/thread-recovery.d.ts +23 -3
  379. package/daemon/dist/domain/gateway/slack/thread-recovery.d.ts.map +1 -1
  380. package/daemon/dist/domain/gateway/slack/thread-recovery.js +52 -10
  381. package/daemon/dist/domain/gateway/slack/thread-recovery.js.map +1 -1
  382. package/daemon/dist/domain/gateway/slack/thread-seat-map.d.ts +4 -1
  383. package/daemon/dist/domain/gateway/slack/thread-seat-map.d.ts.map +1 -1
  384. package/daemon/dist/domain/gateway/slack/thread-seat-map.js +7 -4
  385. package/daemon/dist/domain/gateway/slack/thread-seat-map.js.map +1 -1
  386. package/daemon/dist/domain/guidance-projection.d.ts +39 -0
  387. package/daemon/dist/domain/guidance-projection.d.ts.map +1 -0
  388. package/daemon/dist/domain/guidance-projection.js +91 -0
  389. package/daemon/dist/domain/guidance-projection.js.map +1 -0
  390. package/daemon/dist/domain/health-passive-ceremony.d.ts.map +1 -1
  391. package/daemon/dist/domain/health-passive-ceremony.js +31 -12
  392. package/daemon/dist/domain/health-passive-ceremony.js.map +1 -1
  393. package/daemon/dist/domain/hosted-wake.d.ts +5 -1
  394. package/daemon/dist/domain/hosted-wake.d.ts.map +1 -1
  395. package/daemon/dist/domain/hosted-wake.js +13 -3
  396. package/daemon/dist/domain/hosted-wake.js.map +1 -1
  397. package/daemon/dist/domain/hosts/pairing-ask.d.ts +10 -0
  398. package/daemon/dist/domain/hosts/pairing-ask.d.ts.map +1 -0
  399. package/daemon/dist/domain/hosts/pairing-ask.js +9 -0
  400. package/daemon/dist/domain/hosts/pairing-ask.js.map +1 -0
  401. package/daemon/dist/domain/launch-wrapper.d.ts +29 -0
  402. package/daemon/dist/domain/launch-wrapper.d.ts.map +1 -0
  403. package/daemon/dist/domain/launch-wrapper.js +97 -0
  404. package/daemon/dist/domain/launch-wrapper.js.map +1 -0
  405. package/daemon/dist/domain/managed-blocks.d.ts +3 -0
  406. package/daemon/dist/domain/managed-blocks.d.ts.map +1 -1
  407. package/daemon/dist/domain/managed-blocks.js +5 -0
  408. package/daemon/dist/domain/managed-blocks.js.map +1 -1
  409. package/daemon/dist/domain/markdown-address.d.ts.map +1 -1
  410. package/daemon/dist/domain/markdown-address.js +12 -1
  411. package/daemon/dist/domain/markdown-address.js.map +1 -1
  412. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +1 -1
  413. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
  414. package/daemon/dist/domain/mission-control/mission-control-write-contract.js +116 -28
  415. package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
  416. package/daemon/dist/domain/model-divergence/current-model-reader.d.ts.map +1 -1
  417. package/daemon/dist/domain/model-divergence/current-model-reader.js +14 -3
  418. package/daemon/dist/domain/model-divergence/current-model-reader.js.map +1 -1
  419. package/daemon/dist/domain/native-process-arguments.d.ts +5 -0
  420. package/daemon/dist/domain/native-process-arguments.d.ts.map +1 -1
  421. package/daemon/dist/domain/native-process-arguments.js +60 -5
  422. package/daemon/dist/domain/native-process-arguments.js.map +1 -1
  423. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
  424. package/daemon/dist/domain/native-process-lineage.js +32 -9
  425. package/daemon/dist/domain/native-process-lineage.js.map +1 -1
  426. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  427. package/daemon/dist/domain/node-inventory.js +9 -2
  428. package/daemon/dist/domain/node-inventory.js.map +1 -1
  429. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  430. package/daemon/dist/domain/node-launcher.js +9 -2
  431. package/daemon/dist/domain/node-launcher.js.map +1 -1
  432. package/daemon/dist/domain/outbox-handler.d.ts +53 -3
  433. package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
  434. package/daemon/dist/domain/outbox-handler.js +101 -6
  435. package/daemon/dist/domain/outbox-handler.js.map +1 -1
  436. package/daemon/dist/domain/package-manifest.d.ts.map +1 -1
  437. package/daemon/dist/domain/package-manifest.js +10 -5
  438. package/daemon/dist/domain/package-manifest.js.map +1 -1
  439. package/daemon/dist/domain/parent-session-env.d.ts +2 -1
  440. package/daemon/dist/domain/parent-session-env.d.ts.map +1 -1
  441. package/daemon/dist/domain/parent-session-env.js +9 -1
  442. package/daemon/dist/domain/parent-session-env.js.map +1 -1
  443. package/daemon/dist/domain/parked-query.d.ts +6 -0
  444. package/daemon/dist/domain/parked-query.d.ts.map +1 -1
  445. package/daemon/dist/domain/parked-query.js +1 -0
  446. package/daemon/dist/domain/parked-query.js.map +1 -1
  447. package/daemon/dist/domain/pi-account-state.d.ts +6 -0
  448. package/daemon/dist/domain/pi-account-state.d.ts.map +1 -0
  449. package/daemon/dist/domain/pi-account-state.js +14 -0
  450. package/daemon/dist/domain/pi-account-state.js.map +1 -0
  451. package/daemon/dist/domain/policies/delivery-digest-flush.d.ts.map +1 -1
  452. package/daemon/dist/domain/policies/delivery-digest-flush.js +9 -1
  453. package/daemon/dist/domain/policies/delivery-digest-flush.js.map +1 -1
  454. package/daemon/dist/domain/policies/mode-scheduled-end.d.ts +4 -1
  455. package/daemon/dist/domain/policies/mode-scheduled-end.d.ts.map +1 -1
  456. package/daemon/dist/domain/policies/mode-scheduled-end.js +19 -10
  457. package/daemon/dist/domain/policies/mode-scheduled-end.js.map +1 -1
  458. package/daemon/dist/domain/policies/parked-owner-consumer.d.ts +6 -0
  459. package/daemon/dist/domain/policies/parked-owner-consumer.d.ts.map +1 -1
  460. package/daemon/dist/domain/policies/parked-owner-consumer.js +13 -3
  461. package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
  462. package/daemon/dist/domain/policies/quiet-release.d.ts +19 -6
  463. package/daemon/dist/domain/policies/quiet-release.d.ts.map +1 -1
  464. package/daemon/dist/domain/policies/quiet-release.js +50 -10
  465. package/daemon/dist/domain/policies/quiet-release.js.map +1 -1
  466. package/daemon/dist/domain/projection-planner.d.ts +4 -1
  467. package/daemon/dist/domain/projection-planner.d.ts.map +1 -1
  468. package/daemon/dist/domain/projection-planner.js +3 -0
  469. package/daemon/dist/domain/projection-planner.js.map +1 -1
  470. package/daemon/dist/domain/proof/judgments.d.ts +11 -0
  471. package/daemon/dist/domain/proof/judgments.d.ts.map +1 -1
  472. package/daemon/dist/domain/proof/judgments.js +61 -38
  473. package/daemon/dist/domain/proof/judgments.js.map +1 -1
  474. package/daemon/dist/domain/queue-blocker.d.ts +5 -0
  475. package/daemon/dist/domain/queue-blocker.d.ts.map +1 -0
  476. package/daemon/dist/domain/queue-blocker.js +12 -0
  477. package/daemon/dist/domain/queue-blocker.js.map +1 -0
  478. package/daemon/dist/domain/queue-erasure.d.ts +173 -0
  479. package/daemon/dist/domain/queue-erasure.d.ts.map +1 -0
  480. package/daemon/dist/domain/queue-erasure.js +885 -0
  481. package/daemon/dist/domain/queue-erasure.js.map +1 -0
  482. package/daemon/dist/domain/queue-owner.d.ts +6 -0
  483. package/daemon/dist/domain/queue-owner.d.ts.map +1 -1
  484. package/daemon/dist/domain/queue-owner.js +13 -4
  485. package/daemon/dist/domain/queue-owner.js.map +1 -1
  486. package/daemon/dist/domain/queue-pickup.d.ts +20 -1
  487. package/daemon/dist/domain/queue-pickup.d.ts.map +1 -1
  488. package/daemon/dist/domain/queue-pickup.js +38 -6
  489. package/daemon/dist/domain/queue-pickup.js.map +1 -1
  490. package/daemon/dist/domain/queue-recovery.d.ts +14 -0
  491. package/daemon/dist/domain/queue-recovery.d.ts.map +1 -1
  492. package/daemon/dist/domain/queue-recovery.js +33 -1
  493. package/daemon/dist/domain/queue-recovery.js.map +1 -1
  494. package/daemon/dist/domain/queue-repository.d.ts +226 -20
  495. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  496. package/daemon/dist/domain/queue-repository.js +786 -91
  497. package/daemon/dist/domain/queue-repository.js.map +1 -1
  498. package/daemon/dist/domain/queue-retention.d.ts +82 -0
  499. package/daemon/dist/domain/queue-retention.d.ts.map +1 -1
  500. package/daemon/dist/domain/queue-retention.js +168 -0
  501. package/daemon/dist/domain/queue-retention.js.map +1 -1
  502. package/daemon/dist/domain/queue-stuck-sweep.d.ts +38 -4
  503. package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
  504. package/daemon/dist/domain/queue-stuck-sweep.js +763 -190
  505. package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
  506. package/daemon/dist/domain/queue-transition-log.d.ts +52 -1
  507. package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
  508. package/daemon/dist/domain/queue-transition-log.js +241 -3
  509. package/daemon/dist/domain/queue-transition-log.js.map +1 -1
  510. package/daemon/dist/domain/queue-waiting.d.ts +49 -3
  511. package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
  512. package/daemon/dist/domain/queue-waiting.js +73 -13
  513. package/daemon/dist/domain/queue-waiting.js.map +1 -1
  514. package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
  515. package/daemon/dist/domain/queue-wake-ladder.js +86 -30
  516. package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
  517. package/daemon/dist/domain/quiet-hold-custody.d.ts.map +1 -1
  518. package/daemon/dist/domain/quiet-hold-custody.js +7 -3
  519. package/daemon/dist/domain/quiet-hold-custody.js.map +1 -1
  520. package/daemon/dist/domain/rebuild-priming-chain.d.ts +3 -1
  521. package/daemon/dist/domain/rebuild-priming-chain.d.ts.map +1 -1
  522. package/daemon/dist/domain/rebuild-priming-chain.js +3 -1
  523. package/daemon/dist/domain/rebuild-priming-chain.js.map +1 -1
  524. package/daemon/dist/domain/refocus-record.d.ts +17 -0
  525. package/daemon/dist/domain/refocus-record.d.ts.map +1 -0
  526. package/daemon/dist/domain/refocus-record.js +94 -0
  527. package/daemon/dist/domain/refocus-record.js.map +1 -0
  528. package/daemon/dist/domain/restore-check-service.js +1 -1
  529. package/daemon/dist/domain/restore-check-service.js.map +1 -1
  530. package/daemon/dist/domain/restore-guidance.d.ts.map +1 -1
  531. package/daemon/dist/domain/restore-guidance.js +5 -6
  532. package/daemon/dist/domain/restore-guidance.js.map +1 -1
  533. package/daemon/dist/domain/restore-orchestrator.d.ts +15 -2
  534. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  535. package/daemon/dist/domain/restore-orchestrator.js +100 -42
  536. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  537. package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
  538. package/daemon/dist/domain/restore-plan-preview.js +2 -1
  539. package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
  540. package/daemon/dist/domain/resume-token-validation.d.ts +7 -0
  541. package/daemon/dist/domain/resume-token-validation.d.ts.map +1 -1
  542. package/daemon/dist/domain/resume-token-validation.js +13 -3
  543. package/daemon/dist/domain/resume-token-validation.js.map +1 -1
  544. package/daemon/dist/domain/rig-repository.d.ts +3 -0
  545. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  546. package/daemon/dist/domain/rig-repository.js +46 -1
  547. package/daemon/dist/domain/rig-repository.js.map +1 -1
  548. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  549. package/daemon/dist/domain/rig-teardown.js +2 -1
  550. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  551. package/daemon/dist/domain/rigs-being-built.d.ts +5 -0
  552. package/daemon/dist/domain/rigs-being-built.d.ts.map +1 -0
  553. package/daemon/dist/domain/rigs-being-built.js +18 -0
  554. package/daemon/dist/domain/rigs-being-built.js.map +1 -0
  555. package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
  556. package/daemon/dist/domain/rigspec-codec.js +4 -0
  557. package/daemon/dist/domain/rigspec-codec.js.map +1 -1
  558. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  559. package/daemon/dist/domain/rigspec-exporter.js +5 -0
  560. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  561. package/daemon/dist/domain/rigspec-instantiator.d.ts +20 -1
  562. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  563. package/daemon/dist/domain/rigspec-instantiator.js +100 -22
  564. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  565. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  566. package/daemon/dist/domain/rigspec-preflight.js +13 -0
  567. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  568. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  569. package/daemon/dist/domain/rigspec-schema.js +26 -1
  570. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  571. package/daemon/dist/domain/runner-permissions.d.ts +16 -0
  572. package/daemon/dist/domain/runner-permissions.d.ts.map +1 -1
  573. package/daemon/dist/domain/runner-permissions.js +95 -14
  574. package/daemon/dist/domain/runner-permissions.js.map +1 -1
  575. package/daemon/dist/domain/runtime-adapter.d.ts +2 -0
  576. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  577. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  578. package/daemon/dist/domain/runtime-switch-materials.d.ts +1 -1
  579. package/daemon/dist/domain/runtime-switch-materials.d.ts.map +1 -1
  580. package/daemon/dist/domain/runtime-switch-materials.js +2 -2
  581. package/daemon/dist/domain/runtime-switch-materials.js.map +1 -1
  582. package/daemon/dist/domain/scope/logical-checkbox.d.ts.map +1 -1
  583. package/daemon/dist/domain/scope/logical-checkbox.js +14 -0
  584. package/daemon/dist/domain/scope/logical-checkbox.js.map +1 -1
  585. package/daemon/dist/domain/seat-activity-service.d.ts +50 -1
  586. package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
  587. package/daemon/dist/domain/seat-activity-service.js +144 -5
  588. package/daemon/dist/domain/seat-activity-service.js.map +1 -1
  589. package/daemon/dist/domain/seat-attention-reconciler.d.ts +13 -0
  590. package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  591. package/daemon/dist/domain/seat-attention-reconciler.js +45 -1
  592. package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  593. package/daemon/dist/domain/seat-handover-service.d.ts +8 -0
  594. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  595. package/daemon/dist/domain/seat-handover-service.js +61 -19
  596. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  597. package/daemon/dist/domain/seat-kinds.d.ts +21 -0
  598. package/daemon/dist/domain/seat-kinds.d.ts.map +1 -0
  599. package/daemon/dist/domain/seat-kinds.js +27 -0
  600. package/daemon/dist/domain/seat-kinds.js.map +1 -0
  601. package/daemon/dist/domain/seat-launch-environment.d.ts +14 -0
  602. package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
  603. package/daemon/dist/domain/seat-launch-environment.js +64 -16
  604. package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
  605. package/daemon/dist/domain/seat-lifecycle-service.d.ts +12 -0
  606. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  607. package/daemon/dist/domain/seat-lifecycle-service.js +59 -14
  608. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  609. package/daemon/dist/domain/seat-restart-in-place.d.ts +2 -1
  610. package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
  611. package/daemon/dist/domain/seat-restart-in-place.js +19 -1
  612. package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
  613. package/daemon/dist/domain/seat-runtime-home.d.ts +4 -1
  614. package/daemon/dist/domain/seat-runtime-home.d.ts.map +1 -1
  615. package/daemon/dist/domain/seat-runtime-home.js +6 -4
  616. package/daemon/dist/domain/seat-runtime-home.js.map +1 -1
  617. package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
  618. package/daemon/dist/domain/seat-runtime-switch-service.js +87 -13
  619. package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
  620. package/daemon/dist/domain/seat-skill-apply.d.ts +2 -0
  621. package/daemon/dist/domain/seat-skill-apply.d.ts.map +1 -1
  622. package/daemon/dist/domain/seat-skill-apply.js +5 -2
  623. package/daemon/dist/domain/seat-skill-apply.js.map +1 -1
  624. package/daemon/dist/domain/seat-skill-storage.d.ts +57 -4
  625. package/daemon/dist/domain/seat-skill-storage.d.ts.map +1 -1
  626. package/daemon/dist/domain/seat-skill-storage.js +339 -9
  627. package/daemon/dist/domain/seat-skill-storage.js.map +1 -1
  628. package/daemon/dist/domain/seat-status-service.d.ts +12 -2
  629. package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
  630. package/daemon/dist/domain/seat-status-service.js +39 -4
  631. package/daemon/dist/domain/seat-status-service.js.map +1 -1
  632. package/daemon/dist/domain/seat-structural-activity-service.d.ts +8 -0
  633. package/daemon/dist/domain/seat-structural-activity-service.d.ts.map +1 -1
  634. package/daemon/dist/domain/seat-structural-activity-service.js +8 -2
  635. package/daemon/dist/domain/seat-structural-activity-service.js.map +1 -1
  636. package/daemon/dist/domain/self-attach-service.d.ts.map +1 -1
  637. package/daemon/dist/domain/self-attach-service.js +11 -4
  638. package/daemon/dist/domain/self-attach-service.js.map +1 -1
  639. package/daemon/dist/domain/session-jsonl.d.ts +4 -2
  640. package/daemon/dist/domain/session-jsonl.d.ts.map +1 -1
  641. package/daemon/dist/domain/session-jsonl.js +56 -22
  642. package/daemon/dist/domain/session-jsonl.js.map +1 -1
  643. package/daemon/dist/domain/session-registry.d.ts +20 -3
  644. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  645. package/daemon/dist/domain/session-registry.js +39 -3
  646. package/daemon/dist/domain/session-registry.js.map +1 -1
  647. package/daemon/dist/domain/session-transport.d.ts +52 -5
  648. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  649. package/daemon/dist/domain/session-transport.js +434 -85
  650. package/daemon/dist/domain/session-transport.js.map +1 -1
  651. package/daemon/dist/domain/skill-catalog.d.ts +37 -0
  652. package/daemon/dist/domain/skill-catalog.d.ts.map +1 -1
  653. package/daemon/dist/domain/skill-catalog.js +152 -3
  654. package/daemon/dist/domain/skill-catalog.js.map +1 -1
  655. package/daemon/dist/domain/slices/slice-detail-projector.d.ts +1 -1
  656. package/daemon/dist/domain/slices/slice-detail-projector.d.ts.map +1 -1
  657. package/daemon/dist/domain/slices/slice-detail-projector.js +11 -13
  658. package/daemon/dist/domain/slices/slice-detail-projector.js.map +1 -1
  659. package/daemon/dist/domain/slices/slice-indexer.d.ts +41 -0
  660. package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -1
  661. package/daemon/dist/domain/slices/slice-indexer.js +463 -22
  662. package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
  663. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  664. package/daemon/dist/domain/startup-orchestrator.js +12 -3
  665. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  666. package/daemon/dist/domain/startup-submission-evidence.d.ts +1 -0
  667. package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
  668. package/daemon/dist/domain/startup-submission-evidence.js +18 -4
  669. package/daemon/dist/domain/startup-submission-evidence.js.map +1 -1
  670. package/daemon/dist/domain/successor-session-launcher.d.ts +1 -0
  671. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  672. package/daemon/dist/domain/successor-session-launcher.js +1 -0
  673. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  674. package/daemon/dist/domain/terminal/earlier-tile-attach-0711.d.ts +2 -0
  675. package/daemon/dist/domain/terminal/earlier-tile-attach-0711.d.ts.map +1 -0
  676. package/daemon/dist/domain/terminal/earlier-tile-attach-0711.js +146 -0
  677. package/daemon/dist/domain/terminal/earlier-tile-attach-0711.js.map +1 -0
  678. package/daemon/dist/domain/terminal/earlier-tile-attach.d.ts +1 -0
  679. package/daemon/dist/domain/terminal/earlier-tile-attach.d.ts.map +1 -1
  680. package/daemon/dist/domain/terminal/earlier-tile-attach.js +42 -1
  681. package/daemon/dist/domain/terminal/earlier-tile-attach.js.map +1 -1
  682. package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
  683. package/daemon/dist/domain/terminal/herdr-adapter.js +3 -2
  684. package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
  685. package/daemon/dist/domain/terminal/herdr-app-install.d.ts +28 -0
  686. package/daemon/dist/domain/terminal/herdr-app-install.d.ts.map +1 -0
  687. package/daemon/dist/domain/terminal/herdr-app-install.js +170 -0
  688. package/daemon/dist/domain/terminal/herdr-app-install.js.map +1 -0
  689. package/daemon/dist/domain/terminal/herdr-app-layout.d.ts +79 -0
  690. package/daemon/dist/domain/terminal/herdr-app-layout.d.ts.map +1 -0
  691. package/daemon/dist/domain/terminal/herdr-app-layout.js +134 -0
  692. package/daemon/dist/domain/terminal/herdr-app-layout.js.map +1 -0
  693. package/daemon/dist/domain/terminal/herdr-app-provider.d.ts +123 -0
  694. package/daemon/dist/domain/terminal/herdr-app-provider.d.ts.map +1 -0
  695. package/daemon/dist/domain/terminal/herdr-app-provider.js +681 -0
  696. package/daemon/dist/domain/terminal/herdr-app-provider.js.map +1 -0
  697. package/daemon/dist/domain/terminal/herdr-app-state.d.ts +91 -0
  698. package/daemon/dist/domain/terminal/herdr-app-state.d.ts.map +1 -0
  699. package/daemon/dist/domain/terminal/herdr-app-state.js +140 -0
  700. package/daemon/dist/domain/terminal/herdr-app-state.js.map +1 -0
  701. package/daemon/dist/domain/terminal/herdr-app-transport.d.ts +68 -0
  702. package/daemon/dist/domain/terminal/herdr-app-transport.d.ts.map +1 -0
  703. package/daemon/dist/domain/terminal/herdr-app-transport.js +133 -0
  704. package/daemon/dist/domain/terminal/herdr-app-transport.js.map +1 -0
  705. package/daemon/dist/domain/terminal/herdr-follow-view.d.ts.map +1 -1
  706. package/daemon/dist/domain/terminal/herdr-follow-view.js +43 -19
  707. package/daemon/dist/domain/terminal/herdr-follow-view.js.map +1 -1
  708. package/daemon/dist/domain/terminal/herdr-viewer.d.ts +7 -4
  709. package/daemon/dist/domain/terminal/herdr-viewer.d.ts.map +1 -1
  710. package/daemon/dist/domain/terminal/herdr-viewer.js +101 -47
  711. package/daemon/dist/domain/terminal/herdr-viewer.js.map +1 -1
  712. package/daemon/dist/domain/terminal/terminal-following.js +3 -3
  713. package/daemon/dist/domain/terminal/terminal-following.js.map +1 -1
  714. package/daemon/dist/domain/terminal/terminal-provider.d.ts +18 -0
  715. package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
  716. package/daemon/dist/domain/terminal/terminal-service.d.ts +28 -3
  717. package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
  718. package/daemon/dist/domain/terminal/terminal-service.js +56 -8
  719. package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
  720. package/daemon/dist/domain/terminal/tile-attach.d.ts +6 -3
  721. package/daemon/dist/domain/terminal/tile-attach.d.ts.map +1 -1
  722. package/daemon/dist/domain/terminal/tile-attach.js +11 -46
  723. package/daemon/dist/domain/terminal/tile-attach.js.map +1 -1
  724. package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -1
  725. package/daemon/dist/domain/terminal/view-composer.js +1 -0
  726. package/daemon/dist/domain/terminal/view-composer.js.map +1 -1
  727. package/daemon/dist/domain/time-bound-advisory.js +3 -3
  728. package/daemon/dist/domain/time-bound-advisory.js.map +1 -1
  729. package/daemon/dist/domain/tmux-server-selection.d.ts.map +1 -1
  730. package/daemon/dist/domain/tmux-server-selection.js +8 -2
  731. package/daemon/dist/domain/tmux-server-selection.js.map +1 -1
  732. package/daemon/dist/domain/types.d.ts +69 -1
  733. package/daemon/dist/domain/types.d.ts.map +1 -1
  734. package/daemon/dist/domain/types.js.map +1 -1
  735. package/daemon/dist/domain/user-settings/settings-browser.d.ts +2 -1
  736. package/daemon/dist/domain/user-settings/settings-browser.d.ts.map +1 -1
  737. package/daemon/dist/domain/user-settings/settings-browser.js +22 -3
  738. package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
  739. package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
  740. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  741. package/daemon/dist/domain/user-settings/settings-store.js +83 -0
  742. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  743. package/daemon/dist/domain/view-event-bridge.js +1 -1
  744. package/daemon/dist/domain/view-event-bridge.js.map +1 -1
  745. package/daemon/dist/domain/view-projector.d.ts +4 -1
  746. package/daemon/dist/domain/view-projector.d.ts.map +1 -1
  747. package/daemon/dist/domain/view-projector.js +9 -4
  748. package/daemon/dist/domain/view-projector.js.map +1 -1
  749. package/daemon/dist/domain/wake-recovery.d.ts.map +1 -1
  750. package/daemon/dist/domain/wake-recovery.js +10 -2
  751. package/daemon/dist/domain/wake-recovery.js.map +1 -1
  752. package/daemon/dist/domain/whoami-service.d.ts +6 -0
  753. package/daemon/dist/domain/whoami-service.d.ts.map +1 -1
  754. package/daemon/dist/domain/whoami-service.js +9 -1
  755. package/daemon/dist/domain/whoami-service.js.map +1 -1
  756. package/daemon/dist/domain/workflow-exception-escalation.d.ts +3 -2
  757. package/daemon/dist/domain/workflow-exception-escalation.d.ts.map +1 -1
  758. package/daemon/dist/domain/workflow-exception-escalation.js +1 -1
  759. package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -1
  760. package/daemon/dist/domain/workflow-instance-store.d.ts +8 -1
  761. package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
  762. package/daemon/dist/domain/workflow-instance-store.js +21 -3
  763. package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
  764. package/daemon/dist/domain/workflow-projector.js +1 -1
  765. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  766. package/daemon/dist/domain/workflow-reconciliation.d.ts.map +1 -1
  767. package/daemon/dist/domain/workflow-reconciliation.js +2 -1
  768. package/daemon/dist/domain/workflow-reconciliation.js.map +1 -1
  769. package/daemon/dist/domain/workflow-runtime.d.ts +4 -1
  770. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  771. package/daemon/dist/domain/workflow-runtime.js +24 -11
  772. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  773. package/daemon/dist/domain/workflow-spec-cache.d.ts +38 -4
  774. package/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
  775. package/daemon/dist/domain/workflow-spec-cache.js +115 -14
  776. package/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
  777. package/daemon/dist/domain/workflow-spec-unregister.d.ts +36 -0
  778. package/daemon/dist/domain/workflow-spec-unregister.d.ts.map +1 -0
  779. package/daemon/dist/domain/workflow-spec-unregister.js +105 -0
  780. package/daemon/dist/domain/workflow-spec-unregister.js.map +1 -0
  781. package/daemon/dist/domain/workflow-types.d.ts +14 -0
  782. package/daemon/dist/domain/workflow-types.d.ts.map +1 -1
  783. package/daemon/dist/index.d.ts +3 -1
  784. package/daemon/dist/index.d.ts.map +1 -1
  785. package/daemon/dist/index.js +31 -5
  786. package/daemon/dist/index.js.map +1 -1
  787. package/daemon/dist/learned-host-bindings-surface.d.ts +2 -0
  788. package/daemon/dist/learned-host-bindings-surface.d.ts.map +1 -0
  789. package/daemon/dist/learned-host-bindings-surface.js +4 -0
  790. package/daemon/dist/learned-host-bindings-surface.js.map +1 -0
  791. package/daemon/dist/lib/pane-envelope.d.ts +3 -0
  792. package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
  793. package/daemon/dist/lib/pane-envelope.js +3 -1
  794. package/daemon/dist/lib/pane-envelope.js.map +1 -1
  795. package/daemon/dist/routes/activity.d.ts.map +1 -1
  796. package/daemon/dist/routes/activity.js +147 -25
  797. package/daemon/dist/routes/activity.js.map +1 -1
  798. package/daemon/dist/routes/adapters.d.ts.map +1 -1
  799. package/daemon/dist/routes/adapters.js +4 -0
  800. package/daemon/dist/routes/adapters.js.map +1 -1
  801. package/daemon/dist/routes/attention.d.ts.map +1 -1
  802. package/daemon/dist/routes/attention.js +2 -0
  803. package/daemon/dist/routes/attention.js.map +1 -1
  804. package/daemon/dist/routes/compaction.js +2 -0
  805. package/daemon/dist/routes/compaction.js.map +1 -1
  806. package/daemon/dist/routes/config.d.ts.map +1 -1
  807. package/daemon/dist/routes/config.js +9 -1
  808. package/daemon/dist/routes/config.js.map +1 -1
  809. package/daemon/dist/routes/events.js +11 -2
  810. package/daemon/dist/routes/events.js.map +1 -1
  811. package/daemon/dist/routes/gateway.d.ts +3 -0
  812. package/daemon/dist/routes/gateway.d.ts.map +1 -1
  813. package/daemon/dist/routes/gateway.js +87 -8
  814. package/daemon/dist/routes/gateway.js.map +1 -1
  815. package/daemon/dist/routes/hosts.d.ts.map +1 -1
  816. package/daemon/dist/routes/hosts.js +400 -37
  817. package/daemon/dist/routes/hosts.js.map +1 -1
  818. package/daemon/dist/routes/provider.js +1 -1
  819. package/daemon/dist/routes/provider.js.map +1 -1
  820. package/daemon/dist/routes/queue.d.ts +19 -0
  821. package/daemon/dist/routes/queue.d.ts.map +1 -1
  822. package/daemon/dist/routes/queue.js +242 -46
  823. package/daemon/dist/routes/queue.js.map +1 -1
  824. package/daemon/dist/routes/seat.d.ts.map +1 -1
  825. package/daemon/dist/routes/seat.js +4 -3
  826. package/daemon/dist/routes/seat.js.map +1 -1
  827. package/daemon/dist/routes/skills.d.ts.map +1 -1
  828. package/daemon/dist/routes/skills.js +8 -2
  829. package/daemon/dist/routes/skills.js.map +1 -1
  830. package/daemon/dist/routes/slices.d.ts.map +1 -1
  831. package/daemon/dist/routes/slices.js +156 -28
  832. package/daemon/dist/routes/slices.js.map +1 -1
  833. package/daemon/dist/routes/terminal-ws.d.ts +1 -0
  834. package/daemon/dist/routes/terminal-ws.d.ts.map +1 -1
  835. package/daemon/dist/routes/terminal-ws.js +1 -1
  836. package/daemon/dist/routes/terminal-ws.js.map +1 -1
  837. package/daemon/dist/routes/terminal.d.ts.map +1 -1
  838. package/daemon/dist/routes/terminal.js +40 -3
  839. package/daemon/dist/routes/terminal.js.map +1 -1
  840. package/daemon/dist/routes/transport.d.ts.map +1 -1
  841. package/daemon/dist/routes/transport.js +0 -1
  842. package/daemon/dist/routes/transport.js.map +1 -1
  843. package/daemon/dist/routes/workflow.d.ts.map +1 -1
  844. package/daemon/dist/routes/workflow.js +24 -0
  845. package/daemon/dist/routes/workflow.js.map +1 -1
  846. package/daemon/dist/server.d.ts +2 -0
  847. package/daemon/dist/server.d.ts.map +1 -1
  848. package/daemon/dist/server.js +7 -2
  849. package/daemon/dist/server.js.map +1 -1
  850. package/daemon/dist/startup.d.ts +34 -0
  851. package/daemon/dist/startup.d.ts.map +1 -1
  852. package/daemon/dist/startup.js +255 -25
  853. package/daemon/dist/startup.js.map +1 -1
  854. package/daemon/dist/terminal/TerminalSessionBroker.d.ts +18 -13
  855. package/daemon/dist/terminal/TerminalSessionBroker.d.ts.map +1 -1
  856. package/daemon/dist/terminal/TerminalSessionBroker.js +113 -76
  857. package/daemon/dist/terminal/TerminalSessionBroker.js.map +1 -1
  858. package/daemon/dist/terminal/window-pin.d.ts +3 -3
  859. package/daemon/dist/terminal/window-pin.d.ts.map +1 -1
  860. package/daemon/dist/terminal/window-pin.js +2 -2
  861. package/daemon/dist/terminal/window-pin.js.map +1 -1
  862. package/daemon/docs/reference/acp-agents.md +68 -0
  863. package/daemon/docs/reference/agent-spec.md +51 -1
  864. package/daemon/docs/reference/agent-startup-guide.md +52 -2
  865. package/daemon/docs/reference/agent-state-taxonomy.md +7 -0
  866. package/daemon/docs/reference/community-harness-examples/omo/omo.yaml +14 -0
  867. package/daemon/docs/reference/community-harness-presets.md +56 -2
  868. package/daemon/docs/reference/daemon-http-clients.md +31 -8
  869. package/daemon/docs/reference/edge-types.md +6 -4
  870. package/daemon/docs/reference/gateway-participants.md +23 -1
  871. package/daemon/docs/reference/gateway-relay.md +268 -0
  872. package/daemon/docs/reference/getting-started.md +19 -3
  873. package/daemon/docs/reference/harness-runner-contract.md +61 -12
  874. package/daemon/docs/reference/health-diagnosis.md +5 -1
  875. package/daemon/docs/reference/help.md +18 -0
  876. package/daemon/docs/reference/herdr-app.md +148 -0
  877. package/daemon/docs/reference/hosted-members.md +56 -7
  878. package/daemon/docs/reference/keeping-a-watch.md +3 -1
  879. package/daemon/docs/reference/project-workspace.md +4 -0
  880. package/daemon/docs/reference/queue-erasure.md +161 -0
  881. package/daemon/docs/reference/quickstart.md +1 -1
  882. package/daemon/docs/reference/reconstructions.md +90 -0
  883. package/daemon/docs/reference/rig-spec.md +71 -8
  884. package/daemon/docs/reference/runner-conformance/README.md +3 -0
  885. package/daemon/docs/reference/runner-conformance/check-runner.mjs +27 -6
  886. package/daemon/docs/reference/runner-conformance/fake-acp-agent.mjs +1 -1
  887. package/daemon/docs/reference/sdlc-conventions.md +16 -1
  888. package/daemon/docs/reference/seat-delivery.md +30 -3
  889. package/daemon/docs/reference/slack-app-setup.md +37 -12
  890. package/daemon/docs/reference/terminal-sessions.md +101 -26
  891. package/daemon/docs/reference/tmux-servers.md +50 -2
  892. package/daemon/docs/reference/whats-new.md +402 -132
  893. package/daemon/specs/agents/shared/skills/core/cross-host-rig-commands/SKILL.md +7 -0
  894. package/daemon/specs/agents/shared/skills/core/openrig-herdr/SKILL.md +1 -0
  895. package/daemon/specs/agents/shared/skills/core/openrig-skills/SKILL.md +1 -0
  896. package/daemon/specs/agents/shared/skills/core/working-with-an-openrig-team/SKILL.md +90 -0
  897. package/daemon/specs/agents/shared/skills/pods/review-team/SKILL.md +2 -0
  898. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +24 -0
  899. package/daemon/specs/rigs/launch/kernel/culture/CULTURE.md +7 -4
  900. package/daemon/specs/rigs/launch/kernel/rig.yaml +6 -3
  901. package/daemon/specs/rigs/launch/starter/guidance/lead-first-move.md +3 -1
  902. package/dist/acp/agent-server.d.ts +126 -0
  903. package/dist/acp/agent-server.d.ts.map +1 -0
  904. package/dist/acp/agent-server.js +449 -0
  905. package/dist/acp/agent-server.js.map +1 -0
  906. package/dist/acp/json-rpc-stdio.d.ts +24 -10
  907. package/dist/acp/json-rpc-stdio.d.ts.map +1 -1
  908. package/dist/acp/json-rpc-stdio.js +58 -36
  909. package/dist/acp/json-rpc-stdio.js.map +1 -1
  910. package/dist/bin-wrapper.d.ts.map +1 -1
  911. package/dist/bin-wrapper.js +3 -1
  912. package/dist/bin-wrapper.js.map +1 -1
  913. package/dist/build-info.js +3 -3
  914. package/dist/client.d.ts +4 -0
  915. package/dist/client.d.ts.map +1 -1
  916. package/dist/client.js +9 -2
  917. package/dist/client.js.map +1 -1
  918. package/dist/commands/acp.d.ts +14 -0
  919. package/dist/commands/acp.d.ts.map +1 -1
  920. package/dist/commands/acp.js +189 -2
  921. package/dist/commands/acp.js.map +1 -1
  922. package/dist/commands/attach.js +1 -1
  923. package/dist/commands/attach.js.map +1 -1
  924. package/dist/commands/capture.js +6 -6
  925. package/dist/commands/capture.js.map +1 -1
  926. package/dist/commands/compact.d.ts.map +1 -1
  927. package/dist/commands/compact.js +14 -2
  928. package/dist/commands/compact.js.map +1 -1
  929. package/dist/commands/config.d.ts.map +1 -1
  930. package/dist/commands/config.js +46 -7
  931. package/dist/commands/config.js.map +1 -1
  932. package/dist/commands/context-reconstruction.d.ts +5 -0
  933. package/dist/commands/context-reconstruction.d.ts.map +1 -0
  934. package/dist/commands/context-reconstruction.js +69 -0
  935. package/dist/commands/context-reconstruction.js.map +1 -0
  936. package/dist/commands/context.d.ts.map +1 -1
  937. package/dist/commands/context.js +46 -4
  938. package/dist/commands/context.js.map +1 -1
  939. package/dist/commands/daemon.d.ts.map +1 -1
  940. package/dist/commands/daemon.js +22 -5
  941. package/dist/commands/daemon.js.map +1 -1
  942. package/dist/commands/doctor.d.ts.map +1 -1
  943. package/dist/commands/doctor.js +61 -0
  944. package/dist/commands/doctor.js.map +1 -1
  945. package/dist/commands/gateway.d.ts.map +1 -1
  946. package/dist/commands/gateway.js +36 -11
  947. package/dist/commands/gateway.js.map +1 -1
  948. package/dist/commands/host.d.ts.map +1 -1
  949. package/dist/commands/host.js +68 -12
  950. package/dist/commands/host.js.map +1 -1
  951. package/dist/commands/launch.d.ts +1 -0
  952. package/dist/commands/launch.d.ts.map +1 -1
  953. package/dist/commands/launch.js +1 -1
  954. package/dist/commands/launch.js.map +1 -1
  955. package/dist/commands/mcp.d.ts.map +1 -1
  956. package/dist/commands/mcp.js +29 -5
  957. package/dist/commands/mcp.js.map +1 -1
  958. package/dist/commands/proof.d.ts.map +1 -1
  959. package/dist/commands/proof.js +18 -6
  960. package/dist/commands/proof.js.map +1 -1
  961. package/dist/commands/provider.d.ts.map +1 -1
  962. package/dist/commands/provider.js +4 -1
  963. package/dist/commands/provider.js.map +1 -1
  964. package/dist/commands/ps.d.ts +11 -1
  965. package/dist/commands/ps.d.ts.map +1 -1
  966. package/dist/commands/ps.js +26 -3
  967. package/dist/commands/ps.js.map +1 -1
  968. package/dist/commands/queue.d.ts +3 -0
  969. package/dist/commands/queue.d.ts.map +1 -1
  970. package/dist/commands/queue.js +429 -75
  971. package/dist/commands/queue.js.map +1 -1
  972. package/dist/commands/scope.d.ts +2 -0
  973. package/dist/commands/scope.d.ts.map +1 -1
  974. package/dist/commands/scope.js +15 -0
  975. package/dist/commands/scope.js.map +1 -1
  976. package/dist/commands/seat.d.ts.map +1 -1
  977. package/dist/commands/seat.js +79 -13
  978. package/dist/commands/seat.js.map +1 -1
  979. package/dist/commands/send.d.ts +2 -0
  980. package/dist/commands/send.d.ts.map +1 -1
  981. package/dist/commands/send.js +16 -6
  982. package/dist/commands/send.js.map +1 -1
  983. package/dist/commands/setup.js +1 -1
  984. package/dist/commands/setup.js.map +1 -1
  985. package/dist/commands/skill.d.ts.map +1 -1
  986. package/dist/commands/skill.js +5 -0
  987. package/dist/commands/skill.js.map +1 -1
  988. package/dist/commands/slack.d.ts +1 -1
  989. package/dist/commands/slack.d.ts.map +1 -1
  990. package/dist/commands/slack.js +5 -1
  991. package/dist/commands/slack.js.map +1 -1
  992. package/dist/commands/status.d.ts.map +1 -1
  993. package/dist/commands/status.js +11 -1
  994. package/dist/commands/status.js.map +1 -1
  995. package/dist/commands/stream.d.ts.map +1 -1
  996. package/dist/commands/stream.js +24 -1
  997. package/dist/commands/stream.js.map +1 -1
  998. package/dist/commands/terminal.d.ts +22 -0
  999. package/dist/commands/terminal.d.ts.map +1 -1
  1000. package/dist/commands/terminal.js +117 -8
  1001. package/dist/commands/terminal.js.map +1 -1
  1002. package/dist/commands/up.d.ts.map +1 -1
  1003. package/dist/commands/up.js +22 -0
  1004. package/dist/commands/up.js.map +1 -1
  1005. package/dist/commands/whoami.d.ts.map +1 -1
  1006. package/dist/commands/whoami.js +13 -2
  1007. package/dist/commands/whoami.js.map +1 -1
  1008. package/dist/commands/workflow-errors.js +1 -1
  1009. package/dist/commands/workflow-errors.js.map +1 -1
  1010. package/dist/commands/workflow-render.d.ts +4 -0
  1011. package/dist/commands/workflow-render.d.ts.map +1 -1
  1012. package/dist/commands/workflow-render.js +7 -0
  1013. package/dist/commands/workflow-render.js.map +1 -1
  1014. package/dist/commands/workflow.d.ts.map +1 -1
  1015. package/dist/commands/workflow.js +70 -2
  1016. package/dist/commands/workflow.js.map +1 -1
  1017. package/dist/config-store.d.ts +15 -1
  1018. package/dist/config-store.d.ts.map +1 -1
  1019. package/dist/config-store.js +112 -1
  1020. package/dist/config-store.js.map +1 -1
  1021. package/dist/daemon-lifecycle.d.ts +2 -0
  1022. package/dist/daemon-lifecycle.d.ts.map +1 -1
  1023. package/dist/daemon-lifecycle.js +38 -5
  1024. package/dist/daemon-lifecycle.js.map +1 -1
  1025. package/dist/daemon-reachability.d.ts +1 -1
  1026. package/dist/daemon-reachability.d.ts.map +1 -1
  1027. package/dist/daemon-reachability.js +4 -2
  1028. package/dist/daemon-reachability.js.map +1 -1
  1029. package/dist/daemon-start-lock.d.ts +24 -2
  1030. package/dist/daemon-start-lock.d.ts.map +1 -1
  1031. package/dist/daemon-start-lock.js +125 -4
  1032. package/dist/daemon-start-lock.js.map +1 -1
  1033. package/dist/lib/reconstruction-reader.d.ts +122 -0
  1034. package/dist/lib/reconstruction-reader.d.ts.map +1 -0
  1035. package/dist/lib/reconstruction-reader.js +481 -0
  1036. package/dist/lib/reconstruction-reader.js.map +1 -0
  1037. package/dist/lib/scope/logical-checkbox.d.ts.map +1 -1
  1038. package/dist/lib/scope/logical-checkbox.js +14 -0
  1039. package/dist/lib/scope/logical-checkbox.js.map +1 -1
  1040. package/dist/lib/scope/scope-fs.d.ts.map +1 -1
  1041. package/dist/lib/scope/scope-fs.js +36 -2
  1042. package/dist/lib/scope/scope-fs.js.map +1 -1
  1043. package/dist/lib/work-install.d.ts +28 -0
  1044. package/dist/lib/work-install.d.ts.map +1 -1
  1045. package/dist/lib/work-install.js +80 -20
  1046. package/dist/lib/work-install.js.map +1 -1
  1047. package/dist/mcp-http.d.ts +7 -0
  1048. package/dist/mcp-http.d.ts.map +1 -1
  1049. package/dist/mcp-http.js +30 -6
  1050. package/dist/mcp-http.js.map +1 -1
  1051. package/dist/mcp-server.d.ts +33 -3
  1052. package/dist/mcp-server.d.ts.map +1 -1
  1053. package/dist/mcp-server.js +489 -57
  1054. package/dist/mcp-server.js.map +1 -1
  1055. package/dist/queue-artifact.d.ts +57 -0
  1056. package/dist/queue-artifact.d.ts.map +1 -0
  1057. package/dist/queue-artifact.js +70 -0
  1058. package/dist/queue-artifact.js.map +1 -0
  1059. package/dist/queue-receipt.d.ts.map +1 -1
  1060. package/dist/queue-receipt.js +4 -3
  1061. package/dist/queue-receipt.js.map +1 -1
  1062. package/dist/recap-seat.d.ts +28 -0
  1063. package/dist/recap-seat.d.ts.map +1 -0
  1064. package/dist/recap-seat.js +41 -0
  1065. package/dist/recap-seat.js.map +1 -0
  1066. package/dist/seat-attention.d.ts +24 -0
  1067. package/dist/seat-attention.d.ts.map +1 -0
  1068. package/dist/seat-attention.js +119 -0
  1069. package/dist/seat-attention.js.map +1 -0
  1070. package/dist/system-preflight.d.ts.map +1 -1
  1071. package/dist/system-preflight.js +15 -7
  1072. package/dist/system-preflight.js.map +1 -1
  1073. package/dist/terminal-window.d.ts.map +1 -1
  1074. package/dist/terminal-window.js +16 -13
  1075. package/dist/terminal-window.js.map +1 -1
  1076. package/package.json +1 -1
  1077. package/tui/dist/attention/attention-model.d.ts +2 -1
  1078. package/tui/dist/attention/attention-model.d.ts.map +1 -1
  1079. package/tui/dist/attention/attention-model.js +21 -4
  1080. package/tui/dist/attention/attention-model.js.map +1 -1
  1081. package/tui/dist/config/config-model.d.ts.map +1 -1
  1082. package/tui/dist/config/config-model.js +7 -1
  1083. package/tui/dist/config/config-model.js.map +1 -1
  1084. package/tui/dist/config/pairing.d.ts +49 -0
  1085. package/tui/dist/config/pairing.d.ts.map +1 -0
  1086. package/tui/dist/config/pairing.js +98 -0
  1087. package/tui/dist/config/pairing.js.map +1 -0
  1088. package/tui/dist/daemon-client.d.ts +18 -1
  1089. package/tui/dist/daemon-client.d.ts.map +1 -1
  1090. package/tui/dist/daemon-client.js +33 -9
  1091. package/tui/dist/daemon-client.js.map +1 -1
  1092. package/tui/dist/demo-data.js +2 -2
  1093. package/tui/dist/demo-data.js.map +1 -1
  1094. package/tui/dist/detail.d.ts +3 -0
  1095. package/tui/dist/detail.d.ts.map +1 -1
  1096. package/tui/dist/detail.js +6 -1
  1097. package/tui/dist/detail.js.map +1 -1
  1098. package/tui/dist/execution/execution-model.d.ts +2 -0
  1099. package/tui/dist/execution/execution-model.d.ts.map +1 -1
  1100. package/tui/dist/execution/execution-model.js +10 -3
  1101. package/tui/dist/execution/execution-model.js.map +1 -1
  1102. package/tui/dist/health/health-model.d.ts.map +1 -1
  1103. package/tui/dist/health/health-model.js +27 -11
  1104. package/tui/dist/health/health-model.js.map +1 -1
  1105. package/tui/dist/hydrate.d.ts.map +1 -1
  1106. package/tui/dist/hydrate.js +4 -2
  1107. package/tui/dist/hydrate.js.map +1 -1
  1108. package/tui/dist/main.js +11 -2
  1109. package/tui/dist/main.js.map +1 -1
  1110. package/tui/dist/scopes/scopes-model.d.ts +9 -0
  1111. package/tui/dist/scopes/scopes-model.d.ts.map +1 -1
  1112. package/tui/dist/scopes/scopes-model.js +27 -1
  1113. package/tui/dist/scopes/scopes-model.js.map +1 -1
  1114. package/tui/dist/state.d.ts.map +1 -1
  1115. package/tui/dist/state.js +4 -3
  1116. package/tui/dist/state.js.map +1 -1
  1117. package/tui/dist/terminals/open-window.d.ts +21 -1
  1118. package/tui/dist/terminals/open-window.d.ts.map +1 -1
  1119. package/tui/dist/terminals/open-window.js +46 -9
  1120. package/tui/dist/terminals/open-window.js.map +1 -1
  1121. package/tui/dist/terminals/terminal-model.d.ts +8 -1
  1122. package/tui/dist/terminals/terminal-model.d.ts.map +1 -1
  1123. package/tui/dist/terminals/terminal-model.js +25 -8
  1124. package/tui/dist/terminals/terminal-model.js.map +1 -1
  1125. package/tui/dist/types.d.ts +18 -2
  1126. package/tui/dist/types.d.ts.map +1 -1
  1127. package/ui/dist/assets/index-BOYrLyfQ.js +623 -0
  1128. package/ui/dist/assets/index-DqSRu4OY.css +32 -0
  1129. package/ui/dist/index.html +2 -2
  1130. package/ui/dist/assets/index-BFOs3ejL.css +0 -32
  1131. package/ui/dist/assets/index-CdkFwtld.js +0 -623
@@ -1,6 +1,6 @@
1
1
  import { McpServer } from "@modelcontextprotocol/server";
2
2
  import { z } from "zod";
3
- import { randomBytes } from "node:crypto";
3
+ import { createHash, randomBytes } from "node:crypto";
4
4
  import { statSync } from "node:fs";
5
5
  import nodePath from "node:path";
6
6
  import { DaemonConnectionError, DaemonTimeoutError, terminalAuthHeaders } from "./client.js";
@@ -11,6 +11,7 @@ import { CLI_VERSION } from "./version.js";
11
11
  import { ConfigStore } from "./config-store.js";
12
12
  import { readRosters } from "./commands/roster.js";
13
13
  import { mcpPresenceFilePath, readPresence } from "./mcp-presence.js";
14
+ import { codeResultOf, planItemArtifact } from "./queue-artifact.js";
14
15
  const LONG_RUNNING_UP_TIMEOUT_MS = 120_000;
15
16
  const WAIT_FOR_IDLE_REQUEST_OVERHEAD_MS = 5_000;
16
17
  /** The most text rig_context_get and rig_artifact_read return in one call; a longer file or section is cut, and says so. */
@@ -256,6 +257,18 @@ function projectForExternal(row, view) {
256
257
  fields.pickup = { state: pickup.state };
257
258
  return fields;
258
259
  }
260
+ /** A handed-on item as a scoped caller receives it: without the daemon's own successor fields (successors,
261
+ * successorsTruncated, successorNote), which name rows and remote ids regardless of this caller's scope. Its answer is
262
+ * show's scope-checked successor (successorOf). */
263
+ function withoutDaemonSuccessors(row) {
264
+ if (!row || typeof row !== "object" || Array.isArray(row))
265
+ return row;
266
+ const fields = { ...row };
267
+ delete fields.successors;
268
+ delete fields.successorsTruncated;
269
+ delete fields.successorNote;
270
+ return fields;
271
+ }
259
272
  /** What an authenticated non-owner caller may reach: its own seat, its rigs' seats, the items they send or own (to read),
260
273
  * the items they own (to change), and its shared roots. A person (<entityId>@external) is never in a non-owner's scope. */
261
274
  function scopeFor(access, seatOf) {
@@ -342,22 +355,23 @@ function externalScope(access, seatOf) {
342
355
  names: (seat) => caller(seat) || team(seat),
343
356
  };
344
357
  }
358
+ /** The daemon's root_unknown names every shared root it has. A scoped caller learns only the ones it may read: the
359
+ * daemon's roots its grant names, or none when that list can't be read. Every other answer passes as it is. */
360
+ function scopedRootUnknown(res, scope) {
361
+ const data = (res.data ?? {});
362
+ if (data.error !== "root_unknown")
363
+ return res;
364
+ const roots = Array.isArray(data.configuredRoots)
365
+ ? data.configuredRoots.filter((name) => typeof name === "string" && scope.root(name)) : [];
366
+ const named = typeof data.rootName === "string" ? ` '${data.rootName}'` : "";
367
+ return { status: res.status, data: { error: "root_unknown", ...(named ? { rootName: data.rootName } : {}), configuredRoots: roots,
368
+ message: `Shared root${named} is not configured on this daemon. Shared roots this connection may read: ${roots.join(", ") || "(none)"}.` } };
369
+ }
345
370
  /** A target outside an authenticated caller's scope. It names the kind of target only, never the record. */
346
- function outOfScope(what) {
347
- const message = `${what} is outside what this connection may reach.`;
371
+ function outOfScope(what, hint) {
372
+ const message = `${what} is outside what this connection may reach.${hint ? ` ${hint}` : ""}`;
348
373
  return errorResult(JSON.stringify({ ok: false, error: "out_of_scope", message }), "out_of_scope", message);
349
374
  }
350
- /** The shared root an absolute path falls under as written, and its path inside that root. The reference names a file
351
- * where the daemon runs, which may be another machine, so it's never resolved through this machine's filesystem; the
352
- * daemon still checks containment itself when the file is read. */
353
- function underSharedRoot(roots, absolute) {
354
- for (const root of roots) {
355
- const inside = nodePath.relative(root.path, absolute);
356
- if (inside && inside !== ".." && !inside.startsWith(`..${nodePath.sep}`) && !nodePath.isAbsolute(inside))
357
- return { root: root.name, path: inside };
358
- }
359
- return null;
360
- }
361
375
  /** A file the daemon read through a shared root, as text from offset: at most CONTEXT_TEXT_LIMIT characters, with
362
376
  * nextOffset when more of what the daemon read remains, and its byte cut when the file was longer than the daemon reads. */
363
377
  function artifactView(source, read, offset) {
@@ -367,7 +381,7 @@ function artifactView(source, read, offset) {
367
381
  const text = read.content ?? "";
368
382
  const end = wholeCharEnd(text, offset + CONTEXT_TEXT_LIMIT);
369
383
  return {
370
- ...base, binary: false, offset, text: text.slice(offset, end), totalChars: text.length,
384
+ ...base, binary: false, offset, text: text.slice(offset, end), totalChars: text.length, ...codeResultOf(read),
371
385
  truncated: text.length > end || read.truncated === true,
372
386
  ...(text.length > end ? { nextOffset: end } : {}),
373
387
  ...(read.truncated ? { truncatedAtBytes: read.truncatedAtBytes, totalBytes: read.totalBytes } : {}),
@@ -422,13 +436,17 @@ const EXTERNAL_TOOLS = {
422
436
  queue: { create: "rig_queue_create", show: "rig_queue_show", list: "rig_queue_list", claim: "rig_queue_claim", update: "rig_queue_update" },
423
437
  team: { list: "rig_team" },
424
438
  artifact: { read: "rig_artifact_read" },
439
+ question: { read: "rig_question_list", answer: "rig_question_answer" },
425
440
  };
426
- function externalTools(objects) {
441
+ /** A person tool (access class `person`) acts for the person an external grant names, so a grant without a person isn't
442
+ * offered it, whatever its objects say. The caller's seat is never taken for a person. */
443
+ const personTool = (tool) => MCP_OPERATIONS.some((op) => op.tool === tool && op.access === "person");
444
+ function externalTools(external) {
427
445
  const tools = new Set();
428
- for (const [object, actions] of Object.entries(objects)) {
446
+ for (const [object, actions] of Object.entries(external.objects)) {
429
447
  for (const action of Array.isArray(actions) ? actions : []) {
430
448
  const tool = Object.hasOwn(EXTERNAL_TOOLS, object) && Object.hasOwn(EXTERNAL_TOOLS[object], action) ? EXTERNAL_TOOLS[object][action] : undefined;
431
- if (tool)
449
+ if (tool && (!personTool(tool) || external.person))
432
450
  tools.add(tool);
433
451
  }
434
452
  }
@@ -471,6 +489,8 @@ export const MCP_OPERATIONS = [
471
489
  { tool: "rig_context_pack", routes: ["GET /api/context-packs/library/by-ref"], effect: "read", access: "workspace" },
472
490
  { tool: "rig_context_get", routes: ["GET /api/context-packs/library/resolve-address"], effect: "read", access: "workspace" },
473
491
  { tool: "rig_artifact_read", routes: ["GET /api/queue/:qitemId", "GET /api/files/roots", "GET /api/files/read"], effect: "read", access: "work" },
492
+ { tool: "rig_question_list", routes: ["GET /api/attention", "GET /api/queue/:qitemId"], effect: "read", access: "person" },
493
+ { tool: "rig_question_answer", routes: ["GET /api/attention", "GET /api/queue/:qitemId", "POST /api/mission-control/action"], effect: "destructive", access: "person" },
474
494
  { tool: "rig_human_decision_room", routes: ["GET /api/queue/:qitemId", "GET /api/gateway/human/:entityId/decision-room"], effect: "read", access: "work" },
475
495
  { tool: "rig_queue_decide", routes: ["POST /api/queue/:qitemId/delegated-decision"], effect: "destructive", access: "work" },
476
496
  { tool: "rig_queue_handoff", routes: ["POST /api/queue/:qitemId/handoff"], effect: "destructive", access: "work" },
@@ -500,16 +520,70 @@ const SHARED_INSTRUCTIONS = [
500
520
  "A question reserved for a person is theirs to answer: don't answer it on their behalf. rig_queue_decide records a decision only inside the decision room of the mode they have on, beside their answers and never as one.",
501
521
  ];
502
522
  const INSTRUCTIONS = [...SHARED_INSTRUCTIONS, MEMBER_WORKFLOW].join("\n");
503
- const EXTERNAL_INSTRUCTIONS = SHARED_INSTRUCTIONS.join("\n");
523
+ /** rig mcp serve --front-door: the seat is a person's agent in their own app, the front door to their team, not a member
524
+ * that works its inbox. The team's questions to it are the person's to answer. */
525
+ export const FRONT_DOOR_WORKFLOW_VERSION = "front-door/v2";
526
+ export const FRONT_DOOR_WORKFLOW = [
527
+ `Front door (${FRONT_DOOR_WORKFLOW_VERSION}). This seat is a person's agent in their own app: you hand the team their work and bring back what it produced, and you aren't one of its members.`,
528
+ "Items addressed to your seat (rig_queue_list with owned set) are usually the team's questions about work you handed it. They're the person's to answer, not yours: show each to the person with the team's draft, and record only what the person tells you.",
529
+ "To record an answer, claim the item (rig_queue_claim), then close it done with closure reason no-follow-on and exactly what the person typed in resolution, with no label, quotation marks or words of your own (rig_queue_update). If the person isn't there, leave the item open and tell them it's waiting. Never choose an answer for them, and don't claim an item you can't close with their words.",
530
+ "Nothing wakes this conversation when the team finishes: check your work and your items when the person asks or comes back.",
531
+ ].join(" ");
532
+ const FRONT_DOOR_INSTRUCTIONS = [...SHARED_INSTRUCTIONS, FRONT_DOOR_WORKFLOW].join("\n");
533
+ // An external caller's first paragraph says what the connection is for, on its own: a client may show the model only the
534
+ // start (ChatGPT asks that the first 512 characters stand alone). The paragraphs after it say how.
535
+ const EXTERNAL_PURPOSE = "This connection links you to the person's OpenRig team, AI agents who do work for them. Give the team a task with rig_queue_create and keep its qitemId; read its progress and answer with rig_queue_show; list your requests with rig_queue_list; read files it attached with rig_artifact_read. The work carries on after this chat ends.";
536
+ const EXTERNAL_HOW = [
537
+ "This connection acts as the caller its grant names, and the team records your requests as that caller's. Use only the tools this connection offers.",
538
+ "To ask the connected team to do work, use rig_queue_create with the task in body. You may omit destination to use the receiver configured by the server operator. If no receiver is available, ask the operator to configure it; don't guess an address. An explicit destination still must be within this connection's grant.",
539
+ "Acceptance is not completed work. If a create times out, check that same qitemId before retrying and reuse it; never retry with a new id. Use revises for a requested revision of earlier work, preserving its lineage. rig_queue_list shows your own work, including an empty list before your first request.",
540
+ "rig_artifact_read reads within the shared roots and items this connection may reach.",
541
+ ];
542
+ const EXTERNAL_INSTRUCTIONS = [
543
+ `${EXTERNAL_PURPOSE} A question reserved for a person is theirs to answer: don't answer it on their behalf.`,
544
+ ...EXTERNAL_HOW,
545
+ ].join("\n");
546
+ /** For a grant that names the person who owns the connection: the team's questions to them can be read and answered
547
+ * here, with only what they say. */
548
+ const EXTERNAL_PERSON_INSTRUCTIONS = [
549
+ `${EXTERNAL_PURPOSE} The team's questions to the person are in rig_question_list: submit only the answer they explicitly give you, with rig_question_answer, and never choose for them.`,
550
+ ...EXTERNAL_HOW,
551
+ "To answer one, show the person the question and its options as rig_question_list gives them. Then pass rig_question_answer its qitemId, the revision you showed, and either the options they chose or exactly what they typed, with no label or words of your own. If the question changed, show them the new one; if it was already answered or closed, say so. It's recorded as their answer, given through this connection. A question reserved for a person is theirs to answer, never yours.",
552
+ ].join("\n");
504
553
  /** For an external grant that names claim and update: how it works the items addressed to it, messages included. */
505
554
  const EXTERNAL_INBOX_INSTRUCTIONS = [...SHARED_INSTRUCTIONS,
506
555
  "Items addressed to your seat are yours: rig_queue_list with owned set lists them. For each, claim it (rig_queue_claim), do it, then close it done with closure reason no-follow-on and the answer in resolution (rig_queue_update); the sender reads that answer on the same item. A message is an item too: read it, close it done, and reply, when it needs one, with a new item to its sender. Nothing promises to wake you, so check your items again.",
507
556
  ].join("\n");
508
- function instructionsFor(access) {
557
+ function instructionsFor(access, frontDoor = false) {
509
558
  if (!access?.external)
510
- return INSTRUCTIONS;
511
- const tools = externalTools(access.external.objects);
512
- return tools.has("rig_queue_claim") && tools.has("rig_queue_update") ? EXTERNAL_INBOX_INSTRUCTIONS : EXTERNAL_INSTRUCTIONS;
559
+ return frontDoor ? FRONT_DOOR_INSTRUCTIONS : INSTRUCTIONS;
560
+ const tools = externalTools(access.external);
561
+ const instructions = tools.has("rig_queue_claim") && tools.has("rig_queue_update") ? EXTERNAL_INBOX_INSTRUCTIONS
562
+ : tools.has("rig_question_list") || tools.has("rig_question_answer") ? EXTERNAL_PERSON_INSTRUCTIONS : EXTERNAL_INSTRUCTIONS;
563
+ return tools.has("rig_team") ? `Discover the team this grant connects you to by calling rig_team without rigId. A sole granted rig is selected automatically; with several, it returns the granted names to choose from.\n${instructions}` : instructions;
564
+ }
565
+ /** A configured default must identify exactly one existing local node. No topology relationship, name convention
566
+ * for a lead, caller identity or task history supplies a missing receiver. Resolve again on each omitted destination. */
567
+ async function taskDestinationExists(client, destination) {
568
+ const rigName = destination.split("@")[1];
569
+ const rig = await resolveRigHandle(client, rigName, { strict: true });
570
+ if (rig.kind !== "resolved")
571
+ return false;
572
+ const nodes = await client.get(`/api/rigs/${encodeURIComponent(rig.id)}/nodes`);
573
+ if (nodes.status !== 200 || !Array.isArray(nodes.data))
574
+ return false;
575
+ let matches = 0;
576
+ for (const entry of nodes.data) {
577
+ const { logicalId, rigName: name } = (entry ?? {});
578
+ if (typeof logicalId !== "string" || name !== rigName)
579
+ return false;
580
+ const dot = logicalId.indexOf(".");
581
+ if (dot <= 0 || dot === logicalId.length - 1)
582
+ return false;
583
+ if (`${logicalId.slice(0, dot)}-${logicalId.slice(dot + 1)}@${name}` === destination)
584
+ matches++;
585
+ }
586
+ return matches === 1;
513
587
  }
514
588
  /**
515
589
  * Maps a DaemonResponse to MCP tool result.
@@ -544,6 +618,39 @@ function mapResult(res, structuralCheck, opts = {}) {
544
618
  }
545
619
  return opts.structured ? { content: [{ type: "text", text }], structuredContent: structured(res.data) } : { content: [{ type: "text", text }] };
546
620
  }
621
+ // An app that doesn't substitute its settings passes the template through as written: ${user_config.seat}, ${input:seat},
622
+ // $SEAT. No seat address can contain these.
623
+ const SEAT_PLACEHOLDER = /\$\{[^}]*\}|^\s*\$[A-Za-z_]/;
624
+ /** Treat an empty or unfilled seat as no seat, for the whole process: drops both names from env, so neither requests
625
+ * nor rig_whoami act as the placeholder, or as a seat inherited under the legacy name behind an empty one. A set
626
+ * OPENRIG_SESSION_NAME decides; RIGGED_SESSION_NAME counts only when it's absent. Returns what was dropped. */
627
+ export function dropUnfilledSeat(env = process.env) {
628
+ const variable = env.OPENRIG_SESSION_NAME !== undefined ? "OPENRIG_SESSION_NAME" : env.RIGGED_SESSION_NAME !== undefined ? "RIGGED_SESSION_NAME" : undefined;
629
+ const value = variable ? env[variable] : undefined;
630
+ if (!variable || value === undefined || (value.trim() && !SEAT_PLACEHOLDER.test(value)))
631
+ return undefined;
632
+ delete env.OPENRIG_SESSION_NAME;
633
+ delete env.RIGGED_SESSION_NAME;
634
+ return { variable, value };
635
+ }
636
+ /** How an MCP client named itself in its handshake, cut to one short line; it's the client's claim, never an identity. */
637
+ function clientSaid(client) {
638
+ const part = (value) => typeof value === "string" ? value.replace(/[\u0000-\u001f\u007f]+/g, " ").trim().slice(0, 60) : "";
639
+ const name = part(client?.name);
640
+ if (!name)
641
+ return null;
642
+ const version = part(client?.version);
643
+ return JSON.stringify(version ? `${name} ${version}` : name);
644
+ }
645
+ export function unfilledSeatText(seat) {
646
+ return seat.value.trim()
647
+ ? `${seat.variable} is ${JSON.stringify(seat.value)}, a placeholder the app didn't fill in`
648
+ : `${seat.variable} is empty`;
649
+ }
650
+ /** A label for a caller with no seat: no seat's address, and random, so each `rig mcp serve` process has its own. */
651
+ export function mintUnknownSender() {
652
+ return `unknown-mcp-${randomBytes(4).toString("hex")}`;
653
+ }
547
654
  /**
548
655
  * Creates an MCP server wrapping the daemon HTTP API.
549
656
  * @param client - DaemonClient connected to the daemon
@@ -553,22 +660,38 @@ export function createMcpServer(client, options = {}) {
553
660
  const server = new McpServer({
554
661
  name: "openrig",
555
662
  version: CLI_VERSION,
556
- }, { instructions: instructionsFor(options.access) });
663
+ }, { instructions: instructionsFor(options.access, options.frontDoor === true) });
557
664
  const { access } = options;
558
665
  const rostersFolder = options.rostersFolder ?? (() => nodePath.join(new ConfigStore().get("workspace.root"), "rosters"));
559
666
  const presenceFile = options.presenceFile ?? (() => mcpPresenceFilePath());
560
667
  // The seat this server acts as: the authenticated caller's, else OPENRIG_SESSION_NAME where it was configured.
561
668
  const seatOf = () => options.seat ?? readOpenRigEnv("OPENRIG_SESSION_NAME", "RIGGED_SESSION_NAME")?.trim();
669
+ // With no seat (none configured, or one an app left unfilled), messages, new tasks and chat still go through, as an
670
+ // unknown sender. Its label is this server's own and no seat's, so two unknown callers never count as one author (a
671
+ // delegated decision compares authors). Its note says only what is known: why there's no seat, and how the client
672
+ // describes itself in its handshake, which is the client's claim, not an identity. Every other write keeps its rules.
673
+ // HTTP builds a server per request and passes its process's label, so a caller keeps the one rig_whoami names.
674
+ const unknownSender = options.unknownSender ?? mintUnknownSender();
675
+ const unknownSenderNote = (kind) => {
676
+ if (seatOf())
677
+ return null;
678
+ const why = options.unfilledSeat ? unfilledSeatText(options.unfilledSeat) : "OPENRIG_SESSION_NAME isn't set where it was configured";
679
+ const said = clientSaid(server.server.getClientVersion());
680
+ return `[Unknown sender ${unknownSender}: this app has no OpenRig seat (${why}).${said ? ` Its MCP client says it is ${said}.` : ""}`
681
+ + (kind === "task" ? " There's no return address: it follows this by its task id.]" : " There's no return address.]");
682
+ };
562
683
  const accessClass = new Map(MCP_OPERATIONS.map((op) => [op.tool, op.access]));
563
684
  // A local caller (no access) is offered every tool; an authenticated one, its class's; an external caller, its
564
685
  // grant's pairs.
565
- const external = access?.external ? externalTools(access.external.objects) : null;
686
+ const external = access?.external ? externalTools(access.external) : null;
566
687
  const offered = (tool) => {
567
688
  if (external)
568
689
  return external.has(tool);
690
+ const kind = accessClass.get(tool);
691
+ if (kind === "person")
692
+ return false;
569
693
  if (!access || access.owner)
570
694
  return true;
571
- const kind = accessClass.get(tool);
572
695
  return kind === "work" || (kind === "workspace" && access.workspace);
573
696
  };
574
697
  const scope = access && !access.owner ? scopeFor(access, seatOf) : null;
@@ -925,9 +1048,11 @@ export function createMcpServer(client, options = {}) {
925
1048
  if (scope && !scope.session(session))
926
1049
  return outOfScope(`Session ${session}`);
927
1050
  const waitForIdleMs = waitForIdleSeconds === undefined ? undefined : Math.ceil(waitForIdleSeconds * 1000);
1051
+ // Unsigned, as before (the transport names it "<unknown sender>"); the note tells the recipient what is known.
1052
+ const note = unknownSenderNote("message");
928
1053
  const res = await client.post("/api/transport/send", {
929
1054
  session,
930
- text,
1055
+ text: note ? `${note}\n${text}` : text,
931
1056
  verify,
932
1057
  force,
933
1058
  waitForIdleMs,
@@ -986,7 +1111,7 @@ export function createMcpServer(client, options = {}) {
986
1111
  // 16. rig_chatroom_send — send message to rig chatroom
987
1112
  if (offered("rig_chatroom_send"))
988
1113
  server.registerTool("rig_chatroom_send", {
989
- description: "Send a message to a rig's chatroom as this server's seat",
1114
+ description: "Send a message to a rig's chatroom as this server's seat, or, with no seat, as an unknown sender with a note saying so",
990
1115
  inputSchema: z.object({
991
1116
  rigName: z.string().describe("Rig name or identifier"),
992
1117
  body: z.string().describe("Message body"),
@@ -1001,10 +1126,10 @@ export function createMcpServer(client, options = {}) {
1001
1126
  if ("content" in rig)
1002
1127
  return rig;
1003
1128
  // P21: no body sender — the daemon derives it from the transport header (X-OpenRig-Session,
1004
- // stamped by the MCP server's DaemonClient from its seat env).
1005
- const res = await client.post(`/api/rigs/${encodeURIComponent(rig.id)}/chat/send`, {
1006
- body,
1007
- });
1129
+ // stamped by the MCP server's DaemonClient from its seat env). With no seat, the unknown sender is declared.
1130
+ const note = unknownSenderNote("message");
1131
+ const res = await client.post(`/api/rigs/${encodeURIComponent(rig.id)}/chat/send`, note
1132
+ ? { body: `${note}\n${body}`, sender: unknownSender } : { body });
1008
1133
  return mapResult(res);
1009
1134
  }
1010
1135
  catch (err) {
@@ -1087,7 +1212,9 @@ export function createMcpServer(client, options = {}) {
1087
1212
  server.registerTool("rig_queue_create", {
1088
1213
  description: "Hand a task to another seat as a durable queue item. Returns its qitemId: read the answer later with rig_queue_show. If the call times out, check rig_queue_show with the same qitemId before retrying; never retry with a new id. To ask for a revision of earlier work, name it in revises: the new item opens with 'Revision of <id>' and records it in its chainOfRecord.",
1089
1214
  inputSchema: z.object({
1090
- destination: z.string().describe("Destination seat (e.g. dev-impl@my-rig)"),
1215
+ destination: access?.external
1216
+ ? z.string().optional().describe("Destination seat: member@rig, or its name alone (e.g. workshop-lead) within this connection's team; omit to use the connected team's configured receiver")
1217
+ : z.string().describe("Destination seat (e.g. dev-impl@my-rig)"),
1091
1218
  body: z.string().describe("The task: what to do and what to return"),
1092
1219
  summary: z.string().optional().describe("One-line summary"),
1093
1220
  tags: z.array(z.string()).optional().describe("Tags, e.g. mission:<name>"),
@@ -1099,8 +1226,48 @@ export function createMcpServer(client, options = {}) {
1099
1226
  }),
1100
1227
  annotations: ADDITIVE,
1101
1228
  }, async ({ destination, body, summary, tags, priority, tier, qitemId, revises, alert }) => {
1229
+ // The server's one receiver counts for this connection only when its grant reaches it. Then a refused destination
1230
+ // says how to reach it, so the assistant retries instead of telling the person the connection lacks access. It
1231
+ // never names the receiver.
1232
+ const receiver = options.taskDestination && scope?.destination(options.taskDestination) ? options.taskDestination : undefined;
1233
+ const omitHint = receiver ? "Omit destination to reach the team's configured receiver." : undefined;
1234
+ if (destination === undefined && access?.external) {
1235
+ destination = options.taskDestination;
1236
+ const unavailable = () => errorResult("The connected team's task receiver is unavailable. Ask the server operator to configure it.", "task_destination_unavailable", "The connected team's task receiver is unavailable. Ask the server operator to configure it.");
1237
+ if (!destination)
1238
+ return unavailable();
1239
+ // Check scope before looking up the configured receiver: configuration never expands a grant or reveals
1240
+ // another rig's destination. An explicit destination continues through the existing path below.
1241
+ if (!scope?.destination(destination))
1242
+ return outOfScope("Configured task destination");
1243
+ try {
1244
+ if (!await taskDestinationExists(client, destination))
1245
+ return unavailable();
1246
+ }
1247
+ catch {
1248
+ return unavailable();
1249
+ }
1250
+ }
1251
+ else if (destination !== undefined && access?.external && !destination.includes("@")) {
1252
+ // A person names their lead as their team shows it ("workshop-lead"), and the assistant passes that on. A name
1253
+ // alone is the receiver this connection reaches when it is that seat's name, else a seat of this connection's one
1254
+ // rig; never another rig's. It must be in scope and exist, or nothing is written.
1255
+ const named = destination;
1256
+ const resolved = receiver?.split("@")[0] === named ? receiver
1257
+ : access.rigs.length === 1 ? `${named}@${access.rigs[0]}` : undefined;
1258
+ let exists = false;
1259
+ if (resolved && scope?.destination(resolved)) {
1260
+ try {
1261
+ exists = await taskDestinationExists(client, resolved);
1262
+ }
1263
+ catch { /* not resolved */ }
1264
+ }
1265
+ if (!exists)
1266
+ return outOfScope(`Destination ${named}`, omitHint);
1267
+ destination = resolved;
1268
+ }
1102
1269
  if (scope && !scope.destination(destination))
1103
- return outOfScope(`Destination ${destination}`);
1270
+ return outOfScope(`Destination ${destination}`, access?.external ? omitHint : undefined);
1104
1271
  // A revision carries its original's lineage as a handoff does: the original's chain, then the original.
1105
1272
  let lineage;
1106
1273
  if (revises) {
@@ -1120,9 +1287,12 @@ export function createMcpServer(client, options = {}) {
1120
1287
  }
1121
1288
  }
1122
1289
  const id = qitemId ?? `qitem-${new Date().toISOString().replace(/\D/g, "").slice(0, 14)}-${randomBytes(8).toString("hex")}`;
1290
+ // With no seat, the task goes to its destination as from the unknown sender, with the note at the top of its body.
1291
+ const note = unknownSenderNote("task");
1123
1292
  try {
1124
1293
  const res = await client.post("/api/queue/create", {
1125
- qitemId: id, destinationSession: destination, body: lineage?.body ?? body, summary, priority, tier,
1294
+ qitemId: id, destinationSession: destination, body: note ? `${note}\n\n${lineage?.body ?? body}` : lineage?.body ?? body,
1295
+ ...(note ? { sourceSession: unknownSender } : {}), summary, priority, tier,
1126
1296
  tags: access?.external ? tags?.filter((tag) => !OPENRIG_PROVENANCE_TAG.test(tag)) : tags,
1127
1297
  ...(alert ? { humanAlert: true } : {}),
1128
1298
  ...(lineage ? { chainOfRecord: lineage.chainOfRecord } : {}),
@@ -1136,7 +1306,10 @@ export function createMcpServer(client, options = {}) {
1136
1306
  }
1137
1307
  // A create's return, a retry's stored row included, goes through the same external projection as show and list.
1138
1308
  const view = externalView(scope);
1139
- return mapResult(view && res.status < 400 ? { ...res, data: projectForExternal(res.data, view) } : res, undefined, { structured: true });
1309
+ // An unknown sender has no return address, so it says how to follow the task.
1310
+ const sent = note && res.status < 400 && res.data && typeof res.data === "object" ? { ...res, data: { ...res.data,
1311
+ unknownSender: { label: unknownSender, followUp: `No return address: read this task with rig_queue_show and qitemId ${id}.` } } } : res;
1312
+ return mapResult(view && sent.status < 400 ? { ...sent, data: projectForExternal(sent.data, view) } : sent, undefined, { structured: true });
1140
1313
  }
1141
1314
  catch (err) {
1142
1315
  const failure = caught(err);
@@ -1169,9 +1342,10 @@ export function createMcpServer(client, options = {}) {
1169
1342
  let successor = handedOn ? await successorOf(client, qitemId, row.closureTarget, view ? scope.item : undefined) : undefined;
1170
1343
  if (scope && !view && successor && "destinationSession" in successor && !scope.successor(successor.destinationSession))
1171
1344
  successor = { unknown: true, code: "out_of_scope" };
1345
+ const shownItem = scope ? withoutDaemonSuccessors(item.data) : item.data;
1172
1346
  const data = view
1173
- ? { item: projectForExternal(item.data, view), transitions: Array.isArray(transitions.data) ? transitions.data.map((t) => projectForExternal(t, view)) : transitions.data }
1174
- : { item: item.data, transitions: transitions.data };
1347
+ ? { item: projectForExternal(shownItem, view), transitions: Array.isArray(transitions.data) ? transitions.data.map((t) => projectForExternal(t, view)) : transitions.data }
1348
+ : { item: shownItem, transitions: transitions.data };
1175
1349
  return mapResult({ status: 200, data: { ...data, ...(handedOn ? { successor } : {}) } }, undefined, { structured: true });
1176
1350
  }
1177
1351
  catch (err) {
@@ -1201,7 +1375,7 @@ export function createMcpServer(client, options = {}) {
1201
1375
  // An external caller lists its own items only, so the daemon's limit counts those and not the team's.
1202
1376
  const mine = mineAsked || (scope?.ownListsOnly === true && !owned);
1203
1377
  if ((owned || mine) && !sessionName) {
1204
- const message = "owned and mine need this server's seat: set OPENRIG_SESSION_NAME in its env, or filter by destination or source";
1378
+ const message = "owned and mine need this server's seat (rig_whoami says how to give it one), or filter by destination or source";
1205
1379
  return errorResult(JSON.stringify({ ok: false, error: message }), "seat_required", message);
1206
1380
  }
1207
1381
  if (scope) {
@@ -1285,7 +1459,7 @@ export function createMcpServer(client, options = {}) {
1285
1459
  resolution: z.string().optional().describe("The outcome the item keeps, stored only by the update that closes an open item (as rig queue update --resolution)"),
1286
1460
  reopen: z.boolean().optional().describe("Reopen a closed item: give an active state (pending, in-progress or blocked) and a note (as rig queue update --reopen)"),
1287
1461
  summary: z.string().optional().describe("Replace the one-line summary"),
1288
- evidenceRef: z.string().optional().describe("Pointer to the durable artifact, stored on the item when closing with state done or parking on a human seat; other updates refuse it"),
1462
+ evidenceRef: z.string().optional().describe("Pointer to the durable artifact, stored on the item when closing with state done or parking on a human seat; other updates refuse it. For a code result, a JSON file of kind openrig.code-result/v1 with repo, base and revision (full commit ids) and paths lets a reader diff it exactly"),
1289
1463
  blockedOn: z.string().optional().describe("What it waits on, when blocking: another qitemId (this item returns to pending when that one closes), or the address of the person this item came from, not a shared channel (they're asked with this item's summary, and their answer returns it to you in progress)"),
1290
1464
  wakeAfterSeconds: z.number().int().positive().optional().describe("Wake this seat after this many seconds, when blocking. Delivered only to a seat with a terminal: an attached app can't receive it today, so the item just waits until it is checked."),
1291
1465
  }),
@@ -1386,7 +1560,18 @@ export function createMcpServer(client, options = {}) {
1386
1560
  try {
1387
1561
  const seat = seatOf();
1388
1562
  if (!seat) {
1389
- const none = { ok: true, seat: null, caller, message: "This server has no seat: OPENRIG_SESSION_NAME isn't set where it was configured, so its writes aren't attributed to a seat." };
1563
+ const why = options.unfilledSeat ? unfilledSeatText(options.unfilledSeat) : "OPENRIG_SESSION_NAME isn't set where it was configured";
1564
+ const message = `This server has no seat: ${why}, so it acts as no seat and never as another seat. Reads work. `
1565
+ + `Messages (rig_send), new tasks (rig_queue_create) and chat go through as the unknown sender ${unknownSender}, each `
1566
+ + "with a note saying so: there's no return address, so follow a task by its qitemId with rig_queue_show. "
1567
+ + "Claiming, updating, handing off or deciding a task, answering a question asked of a seat, and listing your own "
1568
+ + "items (owned or mine) need this app's seat; reply to the team's questions as a message or a new task naming the "
1569
+ + "question's qitemId. To act as this app's address on the team, such as cursor@my-team, the server needs "
1570
+ + "OPENRIG_SESSION_NAME: in Claude Code, set the plugin's OpenRig seat; in Codex, pass it with --env on codex mcp add. "
1571
+ + "VS Code, Copilot CLI and Cursor can't give a plugin's server a value: add your own rig mcp serve --front-door "
1572
+ + "server with OPENRIG_SESSION_NAME in its env and turn the plugin's openrig server off (in VS Code, give yours "
1573
+ + "another name, such as openrig-seat). Starting the app from a shell with it set lasts only for that launch.";
1574
+ const none = { ok: true, seat: null, caller, unknownSender, ...(options.unfilledSeat ? { unfilledSeat: options.unfilledSeat } : {}), message };
1390
1575
  return { content: [{ type: "text", text: JSON.stringify(none) }], structuredContent: none };
1391
1576
  }
1392
1577
  const params = new URLSearchParams({ sessionName: seat, compact: "1" });
@@ -1402,6 +1587,17 @@ export function createMcpServer(client, options = {}) {
1402
1587
  message: "This seat has no session here: it's the seat this connection's grant names, such as a hosted member's. rig_team shows its rig and hosted members, and rig_queue_list with owned set lists its work." };
1403
1588
  return { content: [{ type: "text", text: JSON.stringify(member) }], structuredContent: member };
1404
1589
  }
1590
+ // A front door (--front-door) usually has no session either: its seat is the address the person picked for their
1591
+ // app, declared in OPENRIG_SESSION_NAME. Answer with it when its rig exists here, still marked declared.
1592
+ if (res.status === 404 && !access && options.frontDoor === true) {
1593
+ const at = seat.indexOf("@");
1594
+ const rigName = at > 0 ? seat.slice(at + 1) : "";
1595
+ if (rigName && (await resolveRigHandle(client, rigName, { strict: true })).kind === "resolved") {
1596
+ const frontDoor = { ok: true, seat, rig: rigName, session: null, caller,
1597
+ message: "This seat has no session here: it's the front-door address this server was configured with (OPENRIG_SESSION_NAME), declared, not verified. rig_team shows its rig and lead, and rig_queue_list with owned set lists the team's questions to it." };
1598
+ return { content: [{ type: "text", text: JSON.stringify(frontDoor) }], structuredContent: frontDoor };
1599
+ }
1600
+ }
1405
1601
  if (res.status >= 400)
1406
1602
  return mapResult(res);
1407
1603
  return mapResult({ ...res, data: { ...res.data, caller } }, undefined, { structured: true });
@@ -1413,19 +1609,35 @@ export function createMcpServer(client, options = {}) {
1413
1609
  // 27. rig_team — a rig's seats and its lead
1414
1610
  if (offered("rig_team"))
1415
1611
  server.registerTool("rig_team", {
1416
- description: "Show a rig's team: its lead, the rig's one delegates_to root (the seat that delegates to others and that nothing delegates to: the seat to delegate to), and each seat's pod, role, runtime, delegation (reportsTo, delegatesTo) and activity as the daemon reports it. Activity the daemon doesn't know reads unknown, never idle. hostedMembers are the rig's members that live outside a terminal (roster entries marked hosted): their authored capabilities and limits, with no pane and activity unknown.",
1612
+ description: "Show a rig's team. For an external grant, omit rigId to use its sole rig or see its granted names to choose from. The answer includes its lead, the rig's one delegates_to root (the seat that delegates to others and that nothing delegates to: the seat to delegate to), and each seat's pod, role, runtime, delegation (reportsTo, delegatesTo) and activity as the daemon reports it. Activity the daemon doesn't know reads unknown, never idle. hostedMembers are the rig's members that live outside a terminal (roster entries marked hosted): their authored capabilities and limits, with no pane and activity unknown.",
1417
1613
  inputSchema: z.object({
1418
- rigId: z.string().describe("Rig name or identifier"),
1614
+ rigId: z.string().optional().describe("Rig name or identifier; optional for an external grant to discover its team"),
1419
1615
  }),
1420
1616
  annotations: READ_ONLY,
1421
1617
  }, async ({ rigId }) => {
1422
1618
  try {
1619
+ const inferred = rigId === undefined && !!access?.external;
1620
+ if (rigId === undefined) {
1621
+ if (!access?.external) {
1622
+ const message = "Pass a rig name or identifier as rigId.";
1623
+ return errorResult(message, "rig_required", message);
1624
+ }
1625
+ const rigs = [...new Set(access.rigs)];
1626
+ if (rigs.length !== 1)
1627
+ return mapResult({ status: 200, data: { rigs,
1628
+ message: rigs.length ? "Choose one of this grant's rigs and pass its name as rigId." : "This grant names no rigs; ask the connection operator to check its scope." } }, undefined, { structured: true });
1629
+ rigId = rigs[0];
1630
+ }
1423
1631
  // An external caller names one of its grant's rigs, so a lookup never answers about another workspace's rig.
1424
1632
  if (access?.external && !scope?.rig(rigId))
1425
1633
  return outOfScope(`Rig ${rigId}`);
1426
1634
  const rig = await rigIdFor(client, rigId);
1427
1635
  if ("content" in rig)
1428
1636
  return rig;
1637
+ if (inferred && !rig.resolved) {
1638
+ const message = `No rig could be resolved from this grant's scope: ${rigId}. Check the connection's scope with its operator.`;
1639
+ return errorResult(message, "scoped_rig_unresolved", message, { rigs: [rigId] });
1640
+ }
1429
1641
  const id = encodeURIComponent(rig.id);
1430
1642
  const detail = await client.get(`/api/rigs/${id}`);
1431
1643
  if (detail.status >= 400)
@@ -1552,7 +1764,7 @@ export function createMcpServer(client, options = {}) {
1552
1764
  // 32. rig_artifact_read — a result's artifact, read through the daemon's shared roots
1553
1765
  if (offered("rig_artifact_read"))
1554
1766
  server.registerTool("rig_artifact_read", {
1555
- description: `Read a finished item's artifact (its evidenceRef), or a named file, through the daemon's shared roots (OPENRIG_FILES_ALLOWLIST), as text: at most ${CONTEXT_TEXT_LIMIT} characters from offset; nextOffset reads on. An artifact outside every shared root, a link, or an item with no evidenceRef comes back as available: false with the reason and the shared roots' names; nothing outside those roots is read.`,
1767
+ description: `Read a finished item's artifact (its evidenceRef), or a named file, through the daemon's shared roots (OPENRIG_FILES_ALLOWLIST), as text: at most ${CONTEXT_TEXT_LIMIT} characters from offset; nextOffset reads on. An artifact outside every shared root, a link, or an item with no evidenceRef comes back as available: false with the reason and the shared roots' names; nothing outside those roots is read. A code-result manifest (kind openrig.code-result/v1) also comes back parsed as codeResult: its repo, the exact base and revision commits, and paths; a branch or fetch ref in it is a hint, never the revision.`,
1556
1768
  inputSchema: z.object({
1557
1769
  qitemId: z.string().optional().describe("Read this item's evidenceRef"),
1558
1770
  root: z.string().optional().describe("A shared root's name: with path, the file to read; with qitemId, the root a relative evidenceRef is under"),
@@ -1565,7 +1777,7 @@ export function createMcpServer(client, options = {}) {
1565
1777
  const read = async (source, rootName, inside) => {
1566
1778
  const res = await client.get(`/api/files/read?${new URLSearchParams({ root: rootName, path: inside }).toString()}`);
1567
1779
  if (res.status >= 400)
1568
- return mapResult(res);
1780
+ return mapResult(scope ? scopedRootUnknown(res, scope) : res);
1569
1781
  return mapResult({ status: 200, data: artifactView(source, (res.data ?? {}), offset ?? 0) }, undefined, { structured: true });
1570
1782
  };
1571
1783
  if (scope && root && !scope.root(root))
@@ -1591,19 +1803,239 @@ export function createMcpServer(client, options = {}) {
1591
1803
  const unavailable = (reason) => mapResult({ status: 200, data: {
1592
1804
  available: false, qitemId, reason, evidenceRef: typeof ref === "string" ? ref : null, roots: roots.map((entry) => entry.name),
1593
1805
  } }, undefined, { structured: true });
1594
- if (typeof ref !== "string" || !ref.trim())
1595
- return unavailable("This item names no artifact: it has no evidenceRef.");
1596
- if (/^[a-z][a-z0-9+.-]*:\/\//i.test(ref))
1597
- return unavailable("The evidenceRef is a link, not a file in a shared root: open it where it lives.");
1598
- if (roots.length === 0)
1599
- return unavailable("This daemon shares no roots (OPENRIG_FILES_ALLOWLIST is empty), so no artifact can be read through it.");
1600
- if (!nodePath.isAbsolute(ref)) {
1601
- return root ? await read("evidenceRef", root, ref) : unavailable("The evidenceRef is a relative path: name the shared root it's under (root).");
1806
+ const plan = planItemArtifact(ref, roots, root);
1807
+ if ("unavailable" in plan)
1808
+ return unavailable(plan.unavailable);
1809
+ return await read("evidenceRef", plan.read.root, plan.read.path);
1810
+ }
1811
+ catch (err) {
1812
+ return caught(err);
1813
+ }
1814
+ });
1815
+ // The person an external grant names: the connection's owner, as the grant service vouches. The team's questions to
1816
+ // them are what Steering shows them as answerable, read from Steering's own view of them, and answered through
1817
+ // Steering's write path (answer for an ask, resolve for a park), as them, through their own client. The caller's seat
1818
+ // is only the route the answer came by.
1819
+ const person = access?.external?.person;
1820
+ const personAddress = person ? `${person}@external` : undefined;
1821
+ const answerable = async () => {
1822
+ const res = await client.get(`/api/attention?view=${encodeURIComponent(person ?? "")}`);
1823
+ if (res.status >= 400)
1824
+ return mapResult(res);
1825
+ const data = (res.data ?? {});
1826
+ // With no perspective for this person (they aren't registered, or no one is), Steering's view shows every request,
1827
+ // so nothing is anyone's to answer here.
1828
+ if (!person || data.perspective?.basis !== "chosen-here" || data.perspective.viewing !== personAddress) {
1829
+ const message = `This connection's person (${personAddress ?? "none"}) isn't registered on this team, so no question can be read or answered for them here.`;
1830
+ return errorResult(JSON.stringify({ ok: false, error: "person_not_registered", message }), "person_not_registered", message);
1831
+ }
1832
+ return (data.items ?? []).flatMap((item) => {
1833
+ const qitemId = typeof item.id === "string" && item.id.startsWith("queue:") ? item.id.slice("queue:".length) : "";
1834
+ const verb = item.answer?.verb;
1835
+ return qitemId && (verb === "answer" || verb === "approve" || verb === "resolve") ? [{ qitemId, verb, item }] : [];
1836
+ });
1837
+ };
1838
+ /** Whether a row read after the view is still the question the view named: open for its verb, with the same recipient.
1839
+ * A park moved to another person between the two reads is theirs now, so nothing of it is shown or answered here. */
1840
+ const stillListed = (entry, row) => entry.verb === "resolve"
1841
+ ? row.state === "blocked" && row.blockedOn === entry.item.recipient
1842
+ : row.state === "pending" && row.destinationSession === entry.item.recipient;
1843
+ /** One question as Steering shows it to the person, with the revision their answer must name, or null once the row is
1844
+ * no longer the question the view named. */
1845
+ const questionView = async (entry, read) => {
1846
+ let row = read;
1847
+ if (!row) {
1848
+ const res = await client.get(`/api/queue/${encodeURIComponent(entry.qitemId)}`);
1849
+ if (res.status >= 400)
1850
+ return null;
1851
+ row = (res.data ?? {});
1852
+ }
1853
+ if (!stillListed(entry, row))
1854
+ return null;
1855
+ const questions = Array.isArray(row.humanQuestions) && row.humanQuestions.length > 0 ? row.humanQuestions : null;
1856
+ return {
1857
+ qitemId: entry.qitemId,
1858
+ kind: entry.verb === "resolve" ? "parked" : "ask",
1859
+ from: entry.verb === "resolve" ? row.destinationSession : row.sourceSession,
1860
+ summary: entry.item.summary,
1861
+ body: row.body,
1862
+ ...(row.humanDetail ? { detail: row.humanDetail } : {}),
1863
+ ...(row.evidenceRef ? { evidenceRef: row.evidenceRef } : {}),
1864
+ ...(questions ? { questions, answered: row.humanAnswers ?? {} } : {}),
1865
+ answerWith: entry.verb === "answer" && questions ? "choices or words" : "words",
1866
+ revision: row.decisionRevision,
1867
+ askedAt: row.tsCreated,
1868
+ };
1869
+ };
1870
+ const QUESTION_LIST_LIMIT = 25;
1871
+ // 32a. rig_question_list — the team's questions to the person who owns this connection
1872
+ if (offered("rig_question_list"))
1873
+ server.registerTool("rig_question_list", {
1874
+ description: "List the team's questions waiting on the person who owns this connection: what Steering shows them to answer. Each comes with its options when it has any, and the revision to name when you submit the person's answer with rig_question_answer.",
1875
+ inputSchema: z.object({}),
1876
+ annotations: READ_ONLY,
1877
+ }, async () => {
1878
+ try {
1879
+ const found = await answerable();
1880
+ if (!Array.isArray(found))
1881
+ return found;
1882
+ const items = (await Promise.all(found.slice(0, QUESTION_LIST_LIMIT).map((entry) => questionView(entry)))).filter((view) => view !== null);
1883
+ return mapResult({ status: 200, data: { person: personAddress, items, ...(found.length > QUESTION_LIST_LIMIT ? { more: found.length - QUESTION_LIST_LIMIT } : {}) } }, undefined, { structured: true });
1884
+ }
1885
+ catch (err) {
1886
+ return caught(err);
1887
+ }
1888
+ });
1889
+ // 32b. rig_question_answer — the person's own answer to one of those questions, given through this connection
1890
+ if (offered("rig_question_answer"))
1891
+ server.registerTool("rig_question_answer", {
1892
+ description: "Submit the person's answer to a question rig_question_list showed them: only what they explicitly told you, never your own choice. Name the revision you showed them, and give either the options they chose (one per question) or exactly what they typed, with no label or words of your own. It's recorded as their answer, given through this connection, and the team's work continues. After an uncertain result, send the same call again: it confirms or finishes what was recorded.",
1893
+ inputSchema: z.object({
1894
+ qitemId: z.string().describe("The question's qitemId, from rig_question_list"),
1895
+ revision: z.string().describe("The revision rig_question_list gave for the question you showed the person"),
1896
+ choices: z.array(z.object({ questionId: z.string(), optionId: z.string() })).min(1).max(4).optional()
1897
+ .describe("The options the person chose, one per question"),
1898
+ words: z.string().min(1).optional().describe("Exactly what the person typed, when they answered in their own words"),
1899
+ }),
1900
+ annotations: DESTRUCTIVE,
1901
+ }, async ({ qitemId, revision, choices, words }) => {
1902
+ const refuse = (code, message, extra = {}) => errorResult(JSON.stringify({ ok: false, error: code, message, ...extra }), code, message, extra);
1903
+ try {
1904
+ if ((choices === undefined) === (words === undefined))
1905
+ return refuse("answer_shape", "Give either the options the person chose or exactly what they typed, not both.");
1906
+ const personClient = options.personClient;
1907
+ if (!personClient)
1908
+ return refuse("person_unavailable", "This connection can't act for its person here.");
1909
+ const found = await answerable();
1910
+ if (!Array.isArray(found))
1911
+ return found;
1912
+ const read = await client.get(`/api/queue/${encodeURIComponent(qitemId)}`);
1913
+ const row = read.status < 400 ? (read.data ?? {}) : null;
1914
+ const listed = found.find((candidate) => candidate.qitemId === qitemId);
1915
+ const entry = listed && row && stillListed(listed, row) ? listed : undefined;
1916
+ // What became of a question is said only when it was addressed to, or parked on, this person.
1917
+ const theirs = row !== null && (row.destinationSession === personAddress || row.blockedOn === personAddress);
1918
+ const notWaiting = () => theirs
1919
+ ? refuse("not_waiting_on_person", `That question isn't waiting on ${personAddress} any more: it's ${row.state}.`, { state: row.state, answered: row.humanAnswers ?? null })
1920
+ : refuse("not_waiting_on_person", "That question isn't waiting on this connection's person: it was answered or closed, or it isn't theirs.");
1921
+ // Out of the person's view, only a row no longer open for any answer is asked about: an identical retry there
1922
+ // learns whether this same operation settled it. An open row out of view is never answered.
1923
+ if (!row || (!entry && (row.state === "pending" || row.state === "blocked")))
1924
+ return notWaiting();
1925
+ // A settled park is back at work and a settled ask is done. The verb shapes only the daemon's fingerprint: the
1926
+ // operation id on its last action is what's checked.
1927
+ const verb = entry ? (entry.verb === "resolve" ? "resolve" : "answer") : row.state === "in-progress" ? "resolve" : "answer";
1928
+ const questions = Array.isArray(row.humanQuestions) ? row.humanQuestions : [];
1929
+ if (entry && choices) {
1930
+ if (entry.verb !== "answer" || questions.length === 0)
1931
+ return refuse("answer_shape", "This question takes the person's words, not options.");
1932
+ // Options are checked against the question the person saw. If it has changed since, the daemon says so: that's
1933
+ // the truth to tell them, rather than that their choice isn't an option.
1934
+ if (row.decisionRevision === revision) {
1935
+ const seen = new Set();
1936
+ for (const { questionId, optionId } of choices) {
1937
+ const question = questions.find((q) => q.id === questionId);
1938
+ if (!question || seen.has(questionId) || !question.options.some((option) => option.id === optionId)) {
1939
+ return refuse("unknown_option", `${questionId}/${optionId} isn't one of this question's options (one choice per question).`, { questions });
1940
+ }
1941
+ seen.add(questionId);
1942
+ }
1943
+ }
1944
+ }
1945
+ // The route the answer came by, recorded beside it: never the person, and never the caller's own judgment.
1946
+ const grant = access?.external?.grant;
1947
+ const route = { route: "external-assistant", assistantSeat: seatOf(), principal: access?.principal, ...(grant ? { grant: grant.id, grantVersion: grant.version } : {}), person: personAddress };
1948
+ // One operation per submission, one id per step: a retry of the same answer to the same revision is recognised by
1949
+ // these ids, never by equal answers.
1950
+ const operation = `assistant:${createHash("sha256").update(JSON.stringify([grant?.id ?? access?.principal, qitemId, revision, choices ?? null, words ?? null])).digest("hex").slice(0, 24)}`;
1951
+ const steps = choices ? choices.map((choice) => ({ ...choice })) : [{ decision: words }];
1952
+ const ownStep = (id) => {
1953
+ if (typeof id !== "string" || !id.startsWith(`${operation}:`))
1954
+ return null;
1955
+ const step = Number(id.slice(operation.length + 1));
1956
+ return Number.isInteger(step) && step >= 0 && step < steps.length ? step : null;
1957
+ };
1958
+ const label = (step) => step.questionId ?? "their words";
1959
+ /** What this call knows when it stops at step `at`: the steps before it are recorded, `at` itself is unknown when
1960
+ * its send got no answer, and the rest weren't sent. Nothing is read back from the row. */
1961
+ const stopped = (code, why, at, unknown, extra = {}) => {
1962
+ const recorded = steps.slice(0, at).map(label);
1963
+ const indeterminate = unknown ? label(steps[at]) : null;
1964
+ const notRecorded = steps.slice(unknown ? at + 1 : at).map(label);
1965
+ const said = [
1966
+ recorded.length ? `Recorded: ${recorded.join(", ")}.` : unknown ? "" : "This call recorded nothing.",
1967
+ indeterminate ? `Unknown whether ${indeterminate} was recorded.` : "",
1968
+ notRecorded.length && (recorded.length || unknown) ? `Not recorded: ${notRecorded.join(", ")}.` : "",
1969
+ unknown ? "Send the same call again to confirm what was recorded." : "",
1970
+ ].filter(Boolean).join(" ");
1971
+ const partial = recorded.length || unknown ? { recorded, ...(indeterminate ? { indeterminate } : {}), notRecorded } : {};
1972
+ return refuse(code, `${why} ${said}`.trim(), { ...partial, ...extra });
1973
+ };
1974
+ let expected = revision;
1975
+ let next = 0;
1976
+ let fresh = 0;
1977
+ let last = null;
1978
+ while (next < steps.length) {
1979
+ let res;
1980
+ try {
1981
+ res = await personClient.post("/api/mission-control/action", {
1982
+ verb, qitemId, ...steps[next], expectedRevision: expected, auditNotes: { operationId: `${operation}:${next}`, ...route },
1983
+ });
1984
+ }
1985
+ catch (err) {
1986
+ // No answer from the daemon (a timeout, a body that isn't JSON): this step may or may not have landed.
1987
+ const failed = caught(err).structuredContent;
1988
+ return stopped(failed.code, failed.message, next, true);
1989
+ }
1990
+ let confirmed = false;
1991
+ if (res.status < 400) {
1992
+ confirmed = res.data?.reconciled === true;
1993
+ if (!confirmed)
1994
+ fresh += 1;
1995
+ last = res.data ?? null;
1996
+ expected = typeof res.data?.decisionRevision === "string" ? res.data.decisionRevision : expected;
1997
+ next += 1;
1998
+ }
1999
+ else {
2000
+ const failure = (res.data ?? {});
2001
+ // This submission's own step is the last action on the question (its result was lost, or a later step failed):
2002
+ // it's recorded. Any other change is refused.
2003
+ const own = failure.error === "decision_revision_changed" ? ownStep(failure.lastAction?.auditNotes?.operationId) : null;
2004
+ if (own !== null && own >= next) {
2005
+ confirmed = true;
2006
+ next = own + 1;
2007
+ }
2008
+ else {
2009
+ if (!entry)
2010
+ return notWaiting();
2011
+ if (failure.error === "decision_revision_changed") {
2012
+ const still = await answerable();
2013
+ const again = Array.isArray(still) ? still.find((candidate) => candidate.qitemId === qitemId) : undefined;
2014
+ const view = again ? await questionView(again) : null;
2015
+ return view
2016
+ ? stopped("question_changed", "The question changed since the revision the person saw. Show them the current question and ask again.", next, false, { current: view })
2017
+ : stopped("not_waiting_on_person", "The question was answered or closed by someone else.", next, false);
2018
+ }
2019
+ // A refusal from the daemon (4xx) records nothing; a server error (5xx) may have landed.
2020
+ const refused = (mapResult(res).structuredContent ?? {});
2021
+ return stopped(refused.code ?? "request_failed", refused.message ?? "The answer stopped.", next, res.status >= 500);
2022
+ }
2023
+ }
2024
+ // A retry never resumes after a part it confirms: since that part was recorded the question may have moved, or
2025
+ // someone may have answered the rest (a Slack click leaves no action to see). The rest goes in a new answer to
2026
+ // the question as it is now.
2027
+ if (confirmed && next < steps.length) {
2028
+ return stopped("question_changed", "This answer's earlier parts were already recorded, so the rest wasn't sent. Read the question again with rig_question_list and submit the rest as a new answer.", next, false);
2029
+ }
1602
2030
  }
1603
- const shared = underSharedRoot(roots, ref);
1604
- if (!shared)
1605
- return unavailable("The evidenceRef is outside every shared root as the daemon lists them, so it isn't read. If it reaches a root through a link, read the file with root and path.");
1606
- return await read("evidenceRef", shared.root, shared.path);
2031
+ // The receipt says only what this call knows: what was submitted and what the daemon answered it, never a fresh read
2032
+ // of the row, which may since belong to someone else.
2033
+ const open = verb === "answer" && fresh > 0 && last?.answer?.outcome === "recorded";
2034
+ const outcome = fresh === 0 ? "already-recorded" : open ? "recorded" : "answered";
2035
+ const message = outcome === "already-recorded" ? "This answer was already recorded; nothing new was sent."
2036
+ : open ? "Recorded. The question still has parts the person hasn't answered."
2037
+ : `Recorded as ${personAddress}'s answer, given through this connection. The team's work continues.`;
2038
+ return mapResult({ status: 200, data: { ok: true, outcome, qitemId, submitted: choices ?? { words }, message } }, undefined, { structured: true });
1607
2039
  }
1608
2040
  catch (err) {
1609
2041
  return caught(err);