@openrig/cli 0.7.0 → 0.7.1

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 (1007) hide show
  1. package/README.md +9 -8
  2. package/daemon/assets/claude-statusline-context.cjs +13 -3
  3. package/daemon/assets/guidance/openrig-seat-skills.md +1 -0
  4. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
  5. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
  6. package/daemon/assets/plugins/openrig-core/hooks/claude.json +11 -11
  7. package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +9 -8
  8. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus-health.cjs +2 -2
  9. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +9 -6
  10. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +1 -1
  11. package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +13 -8
  12. package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +19 -4
  13. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +167 -46
  14. package/daemon/assets/skills/rigs/SKILL.md +2 -1
  15. package/daemon/context-packs/help/manifest.yaml +1 -1
  16. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  17. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +206 -28
  18. package/daemon/context-packs/reference/getting-started.md +65 -6
  19. package/daemon/context-packs/reference/manifest.yaml +1 -1
  20. package/daemon/context-packs/reference/rig-spec.md +82 -2
  21. package/daemon/context-packs/reference/whats-new.md +162 -113
  22. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  23. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  24. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  25. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  26. package/daemon/context-packs/skills/claude-compaction-restore/scripts/precompact-hook.mjs +1 -1
  27. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  28. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  29. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  30. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  31. package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +19 -4
  32. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  33. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  34. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  35. package/daemon/context-packs/skills/core/openrig-herdr/SKILL.md +3 -0
  36. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  37. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  38. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/core/openrig-software-factory/references/worked-example.md +2 -2
  40. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  46. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/forming-an-openrig-mental-model/SKILL.md +13 -8
  49. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  53. package/daemon/context-packs/skills/openrig-user/SKILL.md +167 -46
  54. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  56. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  66. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  68. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  72. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  73. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  74. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  75. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  76. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  77. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  78. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  79. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  80. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  81. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  82. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  83. package/daemon/dist/adapters/claude-code-adapter.js +94 -26
  84. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  85. package/daemon/dist/adapters/claude-resume.d.ts +2 -1
  86. package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
  87. package/daemon/dist/adapters/claude-resume.js +10 -3
  88. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  89. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +10 -4
  90. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  91. package/daemon/dist/adapters/codex-runtime-adapter.js +231 -41
  92. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  93. package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts +21 -2
  94. package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
  95. package/daemon/dist/adapters/community-harness-runtime-adapter.js +90 -8
  96. package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
  97. package/daemon/dist/adapters/pi-runner.d.ts +11 -0
  98. package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
  99. package/daemon/dist/adapters/pi-runner.js +59 -16
  100. package/daemon/dist/adapters/pi-runner.js.map +1 -1
  101. package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
  102. package/daemon/dist/adapters/pi-runtime-adapter.js +9 -6
  103. package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
  104. package/daemon/dist/adapters/stub-runtime-adapter.d.ts.map +1 -1
  105. package/daemon/dist/adapters/stub-runtime-adapter.js +9 -5
  106. package/daemon/dist/adapters/stub-runtime-adapter.js.map +1 -1
  107. package/daemon/dist/adapters/tmux.d.ts +15 -4
  108. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  109. package/daemon/dist/adapters/tmux.js +68 -26
  110. package/daemon/dist/adapters/tmux.js.map +1 -1
  111. package/daemon/dist/attention-surface.d.ts +14 -0
  112. package/daemon/dist/attention-surface.d.ts.map +1 -1
  113. package/daemon/dist/attention-surface.js.map +1 -1
  114. package/daemon/dist/build-info.js +3 -3
  115. package/daemon/dist/daemon-db-path.d.ts +6 -0
  116. package/daemon/dist/daemon-db-path.d.ts.map +1 -1
  117. package/daemon/dist/daemon-db-path.js +65 -1
  118. package/daemon/dist/daemon-db-path.js.map +1 -1
  119. package/daemon/dist/daemon-shutdown.d.ts.map +1 -1
  120. package/daemon/dist/daemon-shutdown.js +4 -2
  121. package/daemon/dist/daemon-shutdown.js.map +1 -1
  122. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  123. package/daemon/dist/db/all-migrations.js +16 -0
  124. package/daemon/dist/db/all-migrations.js.map +1 -1
  125. package/daemon/dist/db/migrations/124_context_usage_watchdog_units.d.ts +4 -0
  126. package/daemon/dist/db/migrations/124_context_usage_watchdog_units.d.ts.map +1 -0
  127. package/daemon/dist/db/migrations/124_context_usage_watchdog_units.js +9 -0
  128. package/daemon/dist/db/migrations/124_context_usage_watchdog_units.js.map +1 -0
  129. package/daemon/dist/db/migrations/125_node_advisor.d.ts +3 -0
  130. package/daemon/dist/db/migrations/125_node_advisor.d.ts.map +1 -0
  131. package/daemon/dist/db/migrations/125_node_advisor.js +8 -0
  132. package/daemon/dist/db/migrations/125_node_advisor.js.map +1 -0
  133. package/daemon/dist/db/migrations/127_operation_correlation.d.ts +3 -0
  134. package/daemon/dist/db/migrations/127_operation_correlation.d.ts.map +1 -0
  135. package/daemon/dist/db/migrations/127_operation_correlation.js +10 -0
  136. package/daemon/dist/db/migrations/127_operation_correlation.js.map +1 -0
  137. package/daemon/dist/db/migrations/128_terminal_policy.d.ts +3 -0
  138. package/daemon/dist/db/migrations/128_terminal_policy.d.ts.map +1 -0
  139. package/daemon/dist/db/migrations/128_terminal_policy.js +37 -0
  140. package/daemon/dist/db/migrations/128_terminal_policy.js.map +1 -0
  141. package/daemon/dist/db/migrations/129_stream_dispositions.d.ts +10 -0
  142. package/daemon/dist/db/migrations/129_stream_dispositions.d.ts.map +1 -0
  143. package/daemon/dist/db/migrations/129_stream_dispositions.js +35 -0
  144. package/daemon/dist/db/migrations/129_stream_dispositions.js.map +1 -0
  145. package/daemon/dist/db/migrations/130_stream_subscriptions.d.ts +11 -0
  146. package/daemon/dist/db/migrations/130_stream_subscriptions.d.ts.map +1 -0
  147. package/daemon/dist/db/migrations/130_stream_subscriptions.js +33 -0
  148. package/daemon/dist/db/migrations/130_stream_subscriptions.js.map +1 -0
  149. package/daemon/dist/db/migrations/131_stream_retention_floor.d.ts +8 -0
  150. package/daemon/dist/db/migrations/131_stream_retention_floor.d.ts.map +1 -0
  151. package/daemon/dist/db/migrations/131_stream_retention_floor.js +20 -0
  152. package/daemon/dist/db/migrations/131_stream_retention_floor.js.map +1 -0
  153. package/daemon/dist/db/migrations/135_seat_identity_process_evidence.d.ts +3 -0
  154. package/daemon/dist/db/migrations/135_seat_identity_process_evidence.d.ts.map +1 -0
  155. package/daemon/dist/db/migrations/135_seat_identity_process_evidence.js +16 -0
  156. package/daemon/dist/db/migrations/135_seat_identity_process_evidence.js.map +1 -0
  157. package/daemon/dist/domain/active-occupant.d.ts +3 -0
  158. package/daemon/dist/domain/active-occupant.d.ts.map +1 -1
  159. package/daemon/dist/domain/active-occupant.js +6 -2
  160. package/daemon/dist/domain/active-occupant.js.map +1 -1
  161. package/daemon/dist/domain/activity-taxonomy.d.ts +3 -0
  162. package/daemon/dist/domain/activity-taxonomy.d.ts.map +1 -1
  163. package/daemon/dist/domain/activity-taxonomy.js.map +1 -1
  164. package/daemon/dist/domain/agent-activity-store.d.ts +6 -2
  165. package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
  166. package/daemon/dist/domain/agent-activity-store.js +13 -4
  167. package/daemon/dist/domain/agent-activity-store.js.map +1 -1
  168. package/daemon/dist/domain/agent-manifest.d.ts.map +1 -1
  169. package/daemon/dist/domain/agent-manifest.js +14 -2
  170. package/daemon/dist/domain/agent-manifest.js.map +1 -1
  171. package/daemon/dist/domain/bootstrap-orchestrator.d.ts +3 -0
  172. package/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
  173. package/daemon/dist/domain/bootstrap-orchestrator.js +20 -6
  174. package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
  175. package/daemon/dist/domain/builtin-startup-files.d.ts.map +1 -1
  176. package/daemon/dist/domain/builtin-startup-files.js +2 -0
  177. package/daemon/dist/domain/builtin-startup-files.js.map +1 -1
  178. package/daemon/dist/domain/bundle-behaviour.d.ts.map +1 -1
  179. package/daemon/dist/domain/bundle-behaviour.js +28 -1
  180. package/daemon/dist/domain/bundle-behaviour.js.map +1 -1
  181. package/daemon/dist/domain/claim-service.d.ts +19 -1
  182. package/daemon/dist/domain/claim-service.d.ts.map +1 -1
  183. package/daemon/dist/domain/claim-service.js +67 -19
  184. package/daemon/dist/domain/claim-service.js.map +1 -1
  185. package/daemon/dist/domain/classification-attempts.d.ts +4 -1
  186. package/daemon/dist/domain/classification-attempts.d.ts.map +1 -1
  187. package/daemon/dist/domain/classification-attempts.js +10 -1
  188. package/daemon/dist/domain/classification-attempts.js.map +1 -1
  189. package/daemon/dist/domain/classification-sources.d.ts +38 -0
  190. package/daemon/dist/domain/classification-sources.d.ts.map +1 -1
  191. package/daemon/dist/domain/classification-sources.js +24 -1
  192. package/daemon/dist/domain/classification-sources.js.map +1 -1
  193. package/daemon/dist/domain/claude-activity-hooks.d.ts +2 -2
  194. package/daemon/dist/domain/claude-activity-hooks.d.ts.map +1 -1
  195. package/daemon/dist/domain/claude-activity-hooks.js +8 -7
  196. package/daemon/dist/domain/claude-activity-hooks.js.map +1 -1
  197. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +109 -7
  198. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  199. package/daemon/dist/domain/claude-compaction-enforcer.js +447 -52
  200. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  201. package/daemon/dist/domain/claude-core-plugin-env.d.ts +4 -1
  202. package/daemon/dist/domain/claude-core-plugin-env.d.ts.map +1 -1
  203. package/daemon/dist/domain/claude-core-plugin-env.js +23 -12
  204. package/daemon/dist/domain/claude-core-plugin-env.js.map +1 -1
  205. package/daemon/dist/domain/claude-managed-launch.d.ts +1 -1
  206. package/daemon/dist/domain/claude-managed-launch.d.ts.map +1 -1
  207. package/daemon/dist/domain/claude-managed-launch.js +33 -15
  208. package/daemon/dist/domain/claude-managed-launch.js.map +1 -1
  209. package/daemon/dist/domain/codex-owned-plugin-trust.d.ts +26 -0
  210. package/daemon/dist/domain/codex-owned-plugin-trust.d.ts.map +1 -0
  211. package/daemon/dist/domain/codex-owned-plugin-trust.js +187 -0
  212. package/daemon/dist/domain/codex-owned-plugin-trust.js.map +1 -0
  213. package/daemon/dist/domain/codex-rebuild-permissions.d.ts +54 -0
  214. package/daemon/dist/domain/codex-rebuild-permissions.d.ts.map +1 -0
  215. package/daemon/dist/domain/codex-rebuild-permissions.js +134 -0
  216. package/daemon/dist/domain/codex-rebuild-permissions.js.map +1 -0
  217. package/daemon/dist/domain/community-harness-launch-result.d.ts +33 -0
  218. package/daemon/dist/domain/community-harness-launch-result.d.ts.map +1 -0
  219. package/daemon/dist/domain/community-harness-launch-result.js +93 -0
  220. package/daemon/dist/domain/community-harness-launch-result.js.map +1 -0
  221. package/daemon/dist/domain/community-harness-presets.d.ts +27 -2
  222. package/daemon/dist/domain/community-harness-presets.d.ts.map +1 -1
  223. package/daemon/dist/domain/community-harness-presets.js +49 -5
  224. package/daemon/dist/domain/community-harness-presets.js.map +1 -1
  225. package/daemon/dist/domain/composer-prompts.d.ts +5 -2
  226. package/daemon/dist/domain/composer-prompts.d.ts.map +1 -1
  227. package/daemon/dist/domain/composer-prompts.js +2 -2
  228. package/daemon/dist/domain/composer-prompts.js.map +1 -1
  229. package/daemon/dist/domain/context-monitor.d.ts.map +1 -1
  230. package/daemon/dist/domain/context-monitor.js +2 -1
  231. package/daemon/dist/domain/context-monitor.js.map +1 -1
  232. package/daemon/dist/domain/continuity-policy-materializer.d.ts +1 -0
  233. package/daemon/dist/domain/continuity-policy-materializer.d.ts.map +1 -1
  234. package/daemon/dist/domain/continuity-policy-materializer.js +2 -0
  235. package/daemon/dist/domain/continuity-policy-materializer.js.map +1 -1
  236. package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
  237. package/daemon/dist/domain/draft-aware-delivery.js +1 -1
  238. package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
  239. package/daemon/dist/domain/execution-view.d.ts.map +1 -1
  240. package/daemon/dist/domain/execution-view.js +7 -6
  241. package/daemon/dist/domain/execution-view.js.map +1 -1
  242. package/daemon/dist/domain/footprint-choice.d.ts +41 -0
  243. package/daemon/dist/domain/footprint-choice.d.ts.map +1 -0
  244. package/daemon/dist/domain/footprint-choice.js +42 -0
  245. package/daemon/dist/domain/footprint-choice.js.map +1 -0
  246. package/daemon/dist/domain/gateway/delivery-rules-engine.d.ts +3 -0
  247. package/daemon/dist/domain/gateway/delivery-rules-engine.d.ts.map +1 -1
  248. package/daemon/dist/domain/gateway/delivery-rules-engine.js +1 -1
  249. package/daemon/dist/domain/gateway/delivery-rules-engine.js.map +1 -1
  250. package/daemon/dist/domain/gateway/human-registry.d.ts +32 -0
  251. package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
  252. package/daemon/dist/domain/gateway/human-registry.js +71 -4
  253. package/daemon/dist/domain/gateway/human-registry.js.map +1 -1
  254. package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
  255. package/daemon/dist/domain/gateway/slack/inbound.js +52 -4
  256. package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
  257. package/daemon/dist/domain/gateway/slack/message.d.ts +3 -0
  258. package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
  259. package/daemon/dist/domain/gateway/slack/message.js +9 -2
  260. package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
  261. package/daemon/dist/domain/gateway/slack/queue-access.d.ts +7 -0
  262. package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
  263. package/daemon/dist/domain/gateway/slack/queue-access.js +14 -2
  264. package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
  265. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +1 -3
  266. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
  267. package/daemon/dist/domain/gateway/slack/slack-delivery.js +22 -22
  268. package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
  269. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
  270. package/daemon/dist/domain/gateway/slack/slack-subsystem.js +4 -7
  271. package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
  272. package/daemon/dist/domain/generated-file-hygiene.js +1 -1
  273. package/daemon/dist/domain/generated-file-hygiene.js.map +1 -1
  274. package/daemon/dist/domain/graph-projection.d.ts +3 -0
  275. package/daemon/dist/domain/graph-projection.d.ts.map +1 -1
  276. package/daemon/dist/domain/graph-projection.js +2 -0
  277. package/daemon/dist/domain/graph-projection.js.map +1 -1
  278. package/daemon/dist/domain/health-diagnosis.d.ts.map +1 -1
  279. package/daemon/dist/domain/health-diagnosis.js +14 -6
  280. package/daemon/dist/domain/health-diagnosis.js.map +1 -1
  281. package/daemon/dist/domain/hot-potato-enforcer.d.ts +1 -1
  282. package/daemon/dist/domain/human-questions.d.ts +2 -0
  283. package/daemon/dist/domain/human-questions.d.ts.map +1 -1
  284. package/daemon/dist/domain/human-questions.js +5 -0
  285. package/daemon/dist/domain/human-questions.js.map +1 -1
  286. package/daemon/dist/domain/kernel-boot.d.ts +5 -1
  287. package/daemon/dist/domain/kernel-boot.d.ts.map +1 -1
  288. package/daemon/dist/domain/kernel-boot.js +34 -4
  289. package/daemon/dist/domain/kernel-boot.js.map +1 -1
  290. package/daemon/dist/domain/managed-blocks.d.ts +32 -1
  291. package/daemon/dist/domain/managed-blocks.d.ts.map +1 -1
  292. package/daemon/dist/domain/managed-blocks.js +109 -11
  293. package/daemon/dist/domain/managed-blocks.js.map +1 -1
  294. package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts +1 -1
  295. package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts.map +1 -1
  296. package/daemon/dist/domain/mission-control/mission-control-action-log.js +3 -0
  297. package/daemon/dist/domain/mission-control/mission-control-action-log.js.map +1 -1
  298. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +21 -0
  299. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
  300. package/daemon/dist/domain/mission-control/mission-control-write-contract.js +110 -0
  301. package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
  302. package/daemon/dist/domain/model-divergence/current-model-reader.d.ts +2 -0
  303. package/daemon/dist/domain/model-divergence/current-model-reader.d.ts.map +1 -1
  304. package/daemon/dist/domain/model-divergence/current-model-reader.js +7 -0
  305. package/daemon/dist/domain/model-divergence/current-model-reader.js.map +1 -1
  306. package/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts +10 -1
  307. package/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts.map +1 -1
  308. package/daemon/dist/domain/model-divergence/model-divergence-monitor.js +24 -5
  309. package/daemon/dist/domain/model-divergence/model-divergence-monitor.js.map +1 -1
  310. package/daemon/dist/domain/native-process-lineage.d.ts +3 -0
  311. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
  312. package/daemon/dist/domain/native-process-lineage.js +60 -2
  313. package/daemon/dist/domain/native-process-lineage.js.map +1 -1
  314. package/daemon/dist/domain/native-resume-probe-evidence.d.ts +19 -0
  315. package/daemon/dist/domain/native-resume-probe-evidence.d.ts.map +1 -0
  316. package/daemon/dist/domain/native-resume-probe-evidence.js +37 -0
  317. package/daemon/dist/domain/native-resume-probe-evidence.js.map +1 -0
  318. package/daemon/dist/domain/native-resume-probe.d.ts +7 -0
  319. package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
  320. package/daemon/dist/domain/native-resume-probe.js +12 -9
  321. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  322. package/daemon/dist/domain/node-inventory.d.ts +49 -1
  323. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  324. package/daemon/dist/domain/node-inventory.js +119 -45
  325. package/daemon/dist/domain/node-inventory.js.map +1 -1
  326. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  327. package/daemon/dist/domain/node-launcher.js +9 -3
  328. package/daemon/dist/domain/node-launcher.js.map +1 -1
  329. package/daemon/dist/domain/occupant-invalidator.d.ts +16 -4
  330. package/daemon/dist/domain/occupant-invalidator.d.ts.map +1 -1
  331. package/daemon/dist/domain/occupant-invalidator.js +25 -5
  332. package/daemon/dist/domain/occupant-invalidator.js.map +1 -1
  333. package/daemon/dist/domain/operation-correlation.d.ts +78 -0
  334. package/daemon/dist/domain/operation-correlation.d.ts.map +1 -0
  335. package/daemon/dist/domain/operation-correlation.js +54 -0
  336. package/daemon/dist/domain/operation-correlation.js.map +1 -0
  337. package/daemon/dist/domain/permission-account.d.ts +28 -0
  338. package/daemon/dist/domain/permission-account.d.ts.map +1 -0
  339. package/daemon/dist/domain/permission-account.js +102 -0
  340. package/daemon/dist/domain/permission-account.js.map +1 -0
  341. package/daemon/dist/domain/permission-drift.d.ts.map +1 -1
  342. package/daemon/dist/domain/permission-drift.js +11 -7
  343. package/daemon/dist/domain/permission-drift.js.map +1 -1
  344. package/daemon/dist/domain/pod-bundle-assembler.d.ts +1 -0
  345. package/daemon/dist/domain/pod-bundle-assembler.d.ts.map +1 -1
  346. package/daemon/dist/domain/pod-bundle-assembler.js +25 -0
  347. package/daemon/dist/domain/pod-bundle-assembler.js.map +1 -1
  348. package/daemon/dist/domain/policies/artifact-pool-helpers.d.ts +7 -0
  349. package/daemon/dist/domain/policies/artifact-pool-helpers.d.ts.map +1 -1
  350. package/daemon/dist/domain/policies/artifact-pool-helpers.js +8 -4
  351. package/daemon/dist/domain/policies/artifact-pool-helpers.js.map +1 -1
  352. package/daemon/dist/domain/policies/context-usage-threshold.d.ts.map +1 -1
  353. package/daemon/dist/domain/policies/context-usage-threshold.js +109 -21
  354. package/daemon/dist/domain/policies/context-usage-threshold.js.map +1 -1
  355. package/daemon/dist/domain/policies/edge-artifact-required.d.ts +6 -1
  356. package/daemon/dist/domain/policies/edge-artifact-required.d.ts.map +1 -1
  357. package/daemon/dist/domain/policies/edge-artifact-required.js +18 -13
  358. package/daemon/dist/domain/policies/edge-artifact-required.js.map +1 -1
  359. package/daemon/dist/domain/policies/mode-scheduled-end.d.ts +2 -0
  360. package/daemon/dist/domain/policies/mode-scheduled-end.d.ts.map +1 -1
  361. package/daemon/dist/domain/policies/mode-scheduled-end.js +5 -1
  362. package/daemon/dist/domain/policies/mode-scheduled-end.js.map +1 -1
  363. package/daemon/dist/domain/policies/periodic-reminder.d.ts +10 -0
  364. package/daemon/dist/domain/policies/periodic-reminder.d.ts.map +1 -1
  365. package/daemon/dist/domain/policies/periodic-reminder.js +11 -6
  366. package/daemon/dist/domain/policies/periodic-reminder.js.map +1 -1
  367. package/daemon/dist/domain/policies/types.d.ts +25 -0
  368. package/daemon/dist/domain/policies/types.d.ts.map +1 -1
  369. package/daemon/dist/domain/policies/workflow-keepalive.d.ts +6 -1
  370. package/daemon/dist/domain/policies/workflow-keepalive.d.ts.map +1 -1
  371. package/daemon/dist/domain/policies/workflow-keepalive.js +11 -5
  372. package/daemon/dist/domain/policies/workflow-keepalive.js.map +1 -1
  373. package/daemon/dist/domain/profile-resolution-worker.d.ts +7 -0
  374. package/daemon/dist/domain/profile-resolution-worker.d.ts.map +1 -0
  375. package/daemon/dist/domain/profile-resolution-worker.js +83 -0
  376. package/daemon/dist/domain/profile-resolution-worker.js.map +1 -0
  377. package/daemon/dist/domain/profile-resolver.d.ts +6 -0
  378. package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
  379. package/daemon/dist/domain/profile-resolver.js +14 -2
  380. package/daemon/dist/domain/profile-resolver.js.map +1 -1
  381. package/daemon/dist/domain/project-classifier.d.ts +7 -0
  382. package/daemon/dist/domain/project-classifier.d.ts.map +1 -1
  383. package/daemon/dist/domain/project-classifier.js +26 -0
  384. package/daemon/dist/domain/project-classifier.js.map +1 -1
  385. package/daemon/dist/domain/provider/subscription-move-report.d.ts +86 -0
  386. package/daemon/dist/domain/provider/subscription-move-report.d.ts.map +1 -0
  387. package/daemon/dist/domain/provider/subscription-move-report.js +227 -0
  388. package/daemon/dist/domain/provider/subscription-move-report.js.map +1 -0
  389. package/daemon/dist/domain/ps-projection.d.ts +6 -35
  390. package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
  391. package/daemon/dist/domain/ps-projection.js +14 -55
  392. package/daemon/dist/domain/ps-projection.js.map +1 -1
  393. package/daemon/dist/domain/queue-owner.d.ts +6 -3
  394. package/daemon/dist/domain/queue-owner.d.ts.map +1 -1
  395. package/daemon/dist/domain/queue-owner.js +10 -5
  396. package/daemon/dist/domain/queue-owner.js.map +1 -1
  397. package/daemon/dist/domain/queue-pickup.d.ts +5 -2
  398. package/daemon/dist/domain/queue-pickup.d.ts.map +1 -1
  399. package/daemon/dist/domain/queue-pickup.js +19 -2
  400. package/daemon/dist/domain/queue-pickup.js.map +1 -1
  401. package/daemon/dist/domain/queue-repository.d.ts +54 -21
  402. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  403. package/daemon/dist/domain/queue-repository.js +257 -97
  404. package/daemon/dist/domain/queue-repository.js.map +1 -1
  405. package/daemon/dist/domain/queue-retention.d.ts +18 -0
  406. package/daemon/dist/domain/queue-retention.d.ts.map +1 -1
  407. package/daemon/dist/domain/queue-retention.js +74 -0
  408. package/daemon/dist/domain/queue-retention.js.map +1 -1
  409. package/daemon/dist/domain/queue-stuck-sweep.d.ts +2 -0
  410. package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
  411. package/daemon/dist/domain/queue-stuck-sweep.js +37 -3
  412. package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
  413. package/daemon/dist/domain/queue-wait-backoff.d.ts +3 -0
  414. package/daemon/dist/domain/queue-wait-backoff.d.ts.map +1 -1
  415. package/daemon/dist/domain/queue-wait-backoff.js +9 -0
  416. package/daemon/dist/domain/queue-wait-backoff.js.map +1 -1
  417. package/daemon/dist/domain/queue-waiting.d.ts +2 -0
  418. package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
  419. package/daemon/dist/domain/queue-waiting.js.map +1 -1
  420. package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
  421. package/daemon/dist/domain/queue-wake-ladder.js +18 -6
  422. package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
  423. package/daemon/dist/domain/reconciler.d.ts +23 -0
  424. package/daemon/dist/domain/reconciler.d.ts.map +1 -1
  425. package/daemon/dist/domain/reconciler.js +44 -1
  426. package/daemon/dist/domain/reconciler.js.map +1 -1
  427. package/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
  428. package/daemon/dist/domain/rehydrate-eligibility.js +2 -3
  429. package/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
  430. package/daemon/dist/domain/restore-guidance.d.ts +7 -0
  431. package/daemon/dist/domain/restore-guidance.d.ts.map +1 -1
  432. package/daemon/dist/domain/restore-guidance.js +20 -8
  433. package/daemon/dist/domain/restore-guidance.js.map +1 -1
  434. package/daemon/dist/domain/restore-orchestrator.d.ts +13 -1
  435. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  436. package/daemon/dist/domain/restore-orchestrator.js +151 -26
  437. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  438. package/daemon/dist/domain/restore-plan-preview.d.ts +7 -2
  439. package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
  440. package/daemon/dist/domain/restore-plan-preview.js +28 -7
  441. package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
  442. package/daemon/dist/domain/restore-policy.d.ts +4 -0
  443. package/daemon/dist/domain/restore-policy.d.ts.map +1 -1
  444. package/daemon/dist/domain/restore-policy.js +11 -0
  445. package/daemon/dist/domain/restore-policy.js.map +1 -1
  446. package/daemon/dist/domain/rig-edge-ops.d.ts +58 -0
  447. package/daemon/dist/domain/rig-edge-ops.d.ts.map +1 -0
  448. package/daemon/dist/domain/rig-edge-ops.js +113 -0
  449. package/daemon/dist/domain/rig-edge-ops.js.map +1 -0
  450. package/daemon/dist/domain/rig-name-override.d.ts +14 -0
  451. package/daemon/dist/domain/rig-name-override.d.ts.map +1 -0
  452. package/daemon/dist/domain/rig-name-override.js +38 -0
  453. package/daemon/dist/domain/rig-name-override.js.map +1 -0
  454. package/daemon/dist/domain/rig-repository.d.ts +10 -2
  455. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  456. package/daemon/dist/domain/rig-repository.js +14 -0
  457. package/daemon/dist/domain/rig-repository.js.map +1 -1
  458. package/daemon/dist/domain/rig-status-compose.d.ts +1 -1
  459. package/daemon/dist/domain/rig-status-compose.d.ts.map +1 -1
  460. package/daemon/dist/domain/rig-status-compose.js +3 -1
  461. package/daemon/dist/domain/rig-status-compose.js.map +1 -1
  462. package/daemon/dist/domain/rig-teardown.d.ts +19 -0
  463. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  464. package/daemon/dist/domain/rig-teardown.js +78 -8
  465. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  466. package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
  467. package/daemon/dist/domain/rigspec-codec.js +10 -0
  468. package/daemon/dist/domain/rigspec-codec.js.map +1 -1
  469. package/daemon/dist/domain/rigspec-exporter.d.ts +3 -0
  470. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  471. package/daemon/dist/domain/rigspec-exporter.js +22 -0
  472. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  473. package/daemon/dist/domain/rigspec-instantiator.d.ts +30 -2
  474. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  475. package/daemon/dist/domain/rigspec-instantiator.js +262 -47
  476. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  477. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  478. package/daemon/dist/domain/rigspec-preflight.js +15 -2
  479. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  480. package/daemon/dist/domain/rigspec-schema.d.ts +3 -0
  481. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  482. package/daemon/dist/domain/rigspec-schema.js +67 -3
  483. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  484. package/daemon/dist/domain/runtime-adapter.d.ts +20 -1
  485. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  486. package/daemon/dist/domain/runtime-adapter.js +5 -1
  487. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  488. package/daemon/dist/domain/scope/scope-view-projection.d.ts +6 -0
  489. package/daemon/dist/domain/scope/scope-view-projection.d.ts.map +1 -1
  490. package/daemon/dist/domain/scope/scope-view-projection.js +26 -10
  491. package/daemon/dist/domain/scope/scope-view-projection.js.map +1 -1
  492. package/daemon/dist/domain/seat-activity-service.d.ts +4 -2
  493. package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
  494. package/daemon/dist/domain/seat-activity-service.js +13 -5
  495. package/daemon/dist/domain/seat-activity-service.js.map +1 -1
  496. package/daemon/dist/domain/seat-attention-reconciler.d.ts +19 -0
  497. package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  498. package/daemon/dist/domain/seat-attention-reconciler.js +60 -6
  499. package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  500. package/daemon/dist/domain/seat-delivery-guard.d.ts +20 -1
  501. package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
  502. package/daemon/dist/domain/seat-delivery-guard.js +66 -11
  503. package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
  504. package/daemon/dist/domain/seat-handover-service.d.ts +8 -0
  505. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  506. package/daemon/dist/domain/seat-handover-service.js +74 -4
  507. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  508. package/daemon/dist/domain/seat-identity-store.d.ts +11 -1
  509. package/daemon/dist/domain/seat-identity-store.d.ts.map +1 -1
  510. package/daemon/dist/domain/seat-identity-store.js +29 -4
  511. package/daemon/dist/domain/seat-identity-store.js.map +1 -1
  512. package/daemon/dist/domain/seat-launch-additions.d.ts +115 -0
  513. package/daemon/dist/domain/seat-launch-additions.d.ts.map +1 -0
  514. package/daemon/dist/domain/seat-launch-additions.js +439 -0
  515. package/daemon/dist/domain/seat-launch-additions.js.map +1 -0
  516. package/daemon/dist/domain/seat-launch-environment.d.ts +1 -1
  517. package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
  518. package/daemon/dist/domain/seat-launch-environment.js +1 -1
  519. package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
  520. package/daemon/dist/domain/seat-lifecycle-service.d.ts +79 -4
  521. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  522. package/daemon/dist/domain/seat-lifecycle-service.js +202 -12
  523. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  524. package/daemon/dist/domain/seat-skill-apply.d.ts +139 -0
  525. package/daemon/dist/domain/seat-skill-apply.d.ts.map +1 -0
  526. package/daemon/dist/domain/seat-skill-apply.js +221 -0
  527. package/daemon/dist/domain/seat-skill-apply.js.map +1 -0
  528. package/daemon/dist/domain/seat-skill-storage.d.ts +295 -0
  529. package/daemon/dist/domain/seat-skill-storage.d.ts.map +1 -0
  530. package/daemon/dist/domain/seat-skill-storage.js +850 -0
  531. package/daemon/dist/domain/seat-skill-storage.js.map +1 -0
  532. package/daemon/dist/domain/seat-status-service.d.ts +9 -0
  533. package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
  534. package/daemon/dist/domain/seat-status-service.js +15 -3
  535. package/daemon/dist/domain/seat-status-service.js.map +1 -1
  536. package/daemon/dist/domain/session-registry.d.ts +4 -0
  537. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  538. package/daemon/dist/domain/session-registry.js +13 -0
  539. package/daemon/dist/domain/session-registry.js.map +1 -1
  540. package/daemon/dist/domain/session-transport.d.ts +52 -21
  541. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  542. package/daemon/dist/domain/session-transport.js +150 -47
  543. package/daemon/dist/domain/session-transport.js.map +1 -1
  544. package/daemon/dist/domain/skill-catalog.d.ts +16 -0
  545. package/daemon/dist/domain/skill-catalog.d.ts.map +1 -1
  546. package/daemon/dist/domain/skill-catalog.js +15 -6
  547. package/daemon/dist/domain/skill-catalog.js.map +1 -1
  548. package/daemon/dist/domain/skill-discovery.d.ts +17 -2
  549. package/daemon/dist/domain/skill-discovery.d.ts.map +1 -1
  550. package/daemon/dist/domain/skill-discovery.js +44 -5
  551. package/daemon/dist/domain/skill-discovery.js.map +1 -1
  552. package/daemon/dist/domain/startup-orchestrator.d.ts +26 -2
  553. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  554. package/daemon/dist/domain/startup-orchestrator.js +226 -14
  555. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  556. package/daemon/dist/domain/stream-dispositions.d.ts +51 -0
  557. package/daemon/dist/domain/stream-dispositions.d.ts.map +1 -0
  558. package/daemon/dist/domain/stream-dispositions.js +112 -0
  559. package/daemon/dist/domain/stream-dispositions.js.map +1 -0
  560. package/daemon/dist/domain/stream-store.d.ts +22 -0
  561. package/daemon/dist/domain/stream-store.d.ts.map +1 -1
  562. package/daemon/dist/domain/stream-store.js +49 -6
  563. package/daemon/dist/domain/stream-store.js.map +1 -1
  564. package/daemon/dist/domain/stream-subscriptions.d.ts +94 -0
  565. package/daemon/dist/domain/stream-subscriptions.d.ts.map +1 -0
  566. package/daemon/dist/domain/stream-subscriptions.js +160 -0
  567. package/daemon/dist/domain/stream-subscriptions.js.map +1 -0
  568. package/daemon/dist/domain/successor-session-launcher.d.ts +6 -0
  569. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  570. package/daemon/dist/domain/successor-session-launcher.js +5 -2
  571. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  572. package/daemon/dist/domain/terminal/herdr-adapter.d.ts +2 -0
  573. package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
  574. package/daemon/dist/domain/terminal/herdr-adapter.js +104 -1
  575. package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
  576. package/daemon/dist/domain/terminal/herdr-sessions.d.ts +9 -0
  577. package/daemon/dist/domain/terminal/herdr-sessions.d.ts.map +1 -0
  578. package/daemon/dist/domain/terminal/herdr-sessions.js +23 -0
  579. package/daemon/dist/domain/terminal/herdr-sessions.js.map +1 -0
  580. package/daemon/dist/domain/terminal/terminal-provider.d.ts +4 -0
  581. package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
  582. package/daemon/dist/domain/terminal/terminal-service.d.ts +12 -3
  583. package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
  584. package/daemon/dist/domain/terminal/terminal-service.js +42 -17
  585. package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
  586. package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -1
  587. package/daemon/dist/domain/terminal/view-composer.js +1 -0
  588. package/daemon/dist/domain/terminal/view-composer.js.map +1 -1
  589. package/daemon/dist/domain/terminal-policy.d.ts +80 -0
  590. package/daemon/dist/domain/terminal-policy.d.ts.map +1 -0
  591. package/daemon/dist/domain/terminal-policy.js +117 -0
  592. package/daemon/dist/domain/terminal-policy.js.map +1 -0
  593. package/daemon/dist/domain/terminal-seat.d.ts +9 -0
  594. package/daemon/dist/domain/terminal-seat.d.ts.map +1 -0
  595. package/daemon/dist/domain/terminal-seat.js +37 -0
  596. package/daemon/dist/domain/terminal-seat.js.map +1 -0
  597. package/daemon/dist/domain/topology-converge.d.ts +25 -2
  598. package/daemon/dist/domain/topology-converge.d.ts.map +1 -1
  599. package/daemon/dist/domain/topology-converge.js +14 -1
  600. package/daemon/dist/domain/topology-converge.js.map +1 -1
  601. package/daemon/dist/domain/types.d.ts +58 -2
  602. package/daemon/dist/domain/types.d.ts.map +1 -1
  603. package/daemon/dist/domain/types.js.map +1 -1
  604. package/daemon/dist/domain/urgent-line.d.ts +4 -0
  605. package/daemon/dist/domain/urgent-line.d.ts.map +1 -0
  606. package/daemon/dist/domain/urgent-line.js +7 -0
  607. package/daemon/dist/domain/urgent-line.js.map +1 -0
  608. package/daemon/dist/domain/usage-series.d.ts.map +1 -1
  609. package/daemon/dist/domain/usage-series.js +6 -2
  610. package/daemon/dist/domain/usage-series.js.map +1 -1
  611. package/daemon/dist/domain/user-settings/settings-browser.js +2 -2
  612. package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
  613. package/daemon/dist/domain/user-settings/settings-store.d.ts +3 -1
  614. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  615. package/daemon/dist/domain/user-settings/settings-store.js +73 -1
  616. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  617. package/daemon/dist/domain/view-projector.d.ts.map +1 -1
  618. package/daemon/dist/domain/view-projector.js +2 -1
  619. package/daemon/dist/domain/view-projector.js.map +1 -1
  620. package/daemon/dist/domain/watchdog-delivery.js +1 -1
  621. package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
  622. package/daemon/dist/domain/watchdog-job-update.d.ts +21 -0
  623. package/daemon/dist/domain/watchdog-job-update.d.ts.map +1 -0
  624. package/daemon/dist/domain/watchdog-job-update.js +143 -0
  625. package/daemon/dist/domain/watchdog-job-update.js.map +1 -0
  626. package/daemon/dist/domain/watchdog-jobs-repository.d.ts +63 -7
  627. package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
  628. package/daemon/dist/domain/watchdog-jobs-repository.js +190 -21
  629. package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
  630. package/daemon/dist/domain/watchdog-policy-engine.d.ts +23 -0
  631. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  632. package/daemon/dist/domain/watchdog-policy-engine.js +46 -13
  633. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  634. package/daemon/dist/domain/workflow-exception-escalation.d.ts.map +1 -1
  635. package/daemon/dist/domain/workflow-exception-escalation.js +7 -3
  636. package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -1
  637. package/daemon/dist/domain/workflow-projector.d.ts +5 -2
  638. package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
  639. package/daemon/dist/domain/workflow-projector.js +16 -7
  640. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  641. package/daemon/dist/domain/workflow-runtime.d.ts +8 -2
  642. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  643. package/daemon/dist/domain/workflow-runtime.js +30 -7
  644. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  645. package/daemon/dist/domain/workspace/project-read.d.ts +2 -0
  646. package/daemon/dist/domain/workspace/project-read.d.ts.map +1 -1
  647. package/daemon/dist/domain/workspace/project-read.js +10 -1
  648. package/daemon/dist/domain/workspace/project-read.js.map +1 -1
  649. package/daemon/dist/index.d.ts.map +1 -1
  650. package/daemon/dist/index.js +2 -0
  651. package/daemon/dist/index.js.map +1 -1
  652. package/daemon/dist/router-line-surface.d.ts +2 -0
  653. package/daemon/dist/router-line-surface.d.ts.map +1 -0
  654. package/daemon/dist/router-line-surface.js +3 -0
  655. package/daemon/dist/router-line-surface.js.map +1 -0
  656. package/daemon/dist/routes/activity.d.ts.map +1 -1
  657. package/daemon/dist/routes/activity.js +3 -0
  658. package/daemon/dist/routes/activity.js.map +1 -1
  659. package/daemon/dist/routes/agent-images.d.ts.map +1 -1
  660. package/daemon/dist/routes/agent-images.js +10 -2
  661. package/daemon/dist/routes/agent-images.js.map +1 -1
  662. package/daemon/dist/routes/attention.d.ts.map +1 -1
  663. package/daemon/dist/routes/attention.js +30 -3
  664. package/daemon/dist/routes/attention.js.map +1 -1
  665. package/daemon/dist/routes/bootstrap-failure-response.js +2 -2
  666. package/daemon/dist/routes/bootstrap-failure-response.js.map +1 -1
  667. package/daemon/dist/routes/bundles.js +1 -1
  668. package/daemon/dist/routes/bundles.js.map +1 -1
  669. package/daemon/dist/routes/compaction.d.ts.map +1 -1
  670. package/daemon/dist/routes/compaction.js +31 -10
  671. package/daemon/dist/routes/compaction.js.map +1 -1
  672. package/daemon/dist/routes/hosts.d.ts.map +1 -1
  673. package/daemon/dist/routes/hosts.js +2 -0
  674. package/daemon/dist/routes/hosts.js.map +1 -1
  675. package/daemon/dist/routes/mission-control.d.ts.map +1 -1
  676. package/daemon/dist/routes/mission-control.js +5 -1
  677. package/daemon/dist/routes/mission-control.js.map +1 -1
  678. package/daemon/dist/routes/projects.d.ts.map +1 -1
  679. package/daemon/dist/routes/projects.js +59 -12
  680. package/daemon/dist/routes/projects.js.map +1 -1
  681. package/daemon/dist/routes/proof.js +2 -2
  682. package/daemon/dist/routes/proof.js.map +1 -1
  683. package/daemon/dist/routes/provider.d.ts.map +1 -1
  684. package/daemon/dist/routes/provider.js +87 -0
  685. package/daemon/dist/routes/provider.js.map +1 -1
  686. package/daemon/dist/routes/queue.d.ts.map +1 -1
  687. package/daemon/dist/routes/queue.js +52 -3
  688. package/daemon/dist/routes/queue.js.map +1 -1
  689. package/daemon/dist/routes/rigs.d.ts.map +1 -1
  690. package/daemon/dist/routes/rigs.js +75 -10
  691. package/daemon/dist/routes/rigs.js.map +1 -1
  692. package/daemon/dist/routes/rigspec.d.ts.map +1 -1
  693. package/daemon/dist/routes/rigspec.js +38 -12
  694. package/daemon/dist/routes/rigspec.js.map +1 -1
  695. package/daemon/dist/routes/scopes.d.ts.map +1 -1
  696. package/daemon/dist/routes/scopes.js +30 -7
  697. package/daemon/dist/routes/scopes.js.map +1 -1
  698. package/daemon/dist/routes/seat.d.ts.map +1 -1
  699. package/daemon/dist/routes/seat.js +19 -3
  700. package/daemon/dist/routes/seat.js.map +1 -1
  701. package/daemon/dist/routes/sessions.js +5 -0
  702. package/daemon/dist/routes/sessions.js.map +1 -1
  703. package/daemon/dist/routes/skills.d.ts.map +1 -1
  704. package/daemon/dist/routes/skills.js +54 -1
  705. package/daemon/dist/routes/skills.js.map +1 -1
  706. package/daemon/dist/routes/stream.d.ts.map +1 -1
  707. package/daemon/dist/routes/stream.js +62 -13
  708. package/daemon/dist/routes/stream.js.map +1 -1
  709. package/daemon/dist/routes/terminal.d.ts.map +1 -1
  710. package/daemon/dist/routes/terminal.js +20 -11
  711. package/daemon/dist/routes/terminal.js.map +1 -1
  712. package/daemon/dist/routes/transport.d.ts.map +1 -1
  713. package/daemon/dist/routes/transport.js +24 -2
  714. package/daemon/dist/routes/transport.js.map +1 -1
  715. package/daemon/dist/routes/up.js +5 -0
  716. package/daemon/dist/routes/up.js.map +1 -1
  717. package/daemon/dist/routes/watchdog.d.ts +1 -0
  718. package/daemon/dist/routes/watchdog.d.ts.map +1 -1
  719. package/daemon/dist/routes/watchdog.js +52 -3
  720. package/daemon/dist/routes/watchdog.js.map +1 -1
  721. package/daemon/dist/routes/workflow.d.ts.map +1 -1
  722. package/daemon/dist/routes/workflow.js +24 -13
  723. package/daemon/dist/routes/workflow.js.map +1 -1
  724. package/daemon/dist/server.d.ts +2 -0
  725. package/daemon/dist/server.d.ts.map +1 -1
  726. package/daemon/dist/server.js +4 -1
  727. package/daemon/dist/server.js.map +1 -1
  728. package/daemon/dist/skill-loadout-surface.d.ts +2 -0
  729. package/daemon/dist/skill-loadout-surface.d.ts.map +1 -1
  730. package/daemon/dist/skill-loadout-surface.js +2 -0
  731. package/daemon/dist/skill-loadout-surface.js.map +1 -1
  732. package/daemon/dist/startup.d.ts.map +1 -1
  733. package/daemon/dist/startup.js +54 -21
  734. package/daemon/dist/startup.js.map +1 -1
  735. package/daemon/dist/terminal/TerminalSessionBroker.d.ts.map +1 -1
  736. package/daemon/dist/terminal/TerminalSessionBroker.js +9 -2
  737. package/daemon/dist/terminal/TerminalSessionBroker.js.map +1 -1
  738. package/daemon/docs/reference/a2a-agents.md +343 -0
  739. package/daemon/docs/reference/acp-agents.md +77 -0
  740. package/daemon/docs/reference/agent-spec.md +7 -5
  741. package/daemon/docs/reference/agent-startup-guide.md +46 -0
  742. package/daemon/docs/reference/agent-state-taxonomy.md +27 -2
  743. package/daemon/docs/reference/checked-seat-stop.md +11 -0
  744. package/daemon/docs/reference/community-harness-examples/cursor/cursor.yaml +13 -0
  745. package/daemon/docs/reference/community-harness-examples/cursor/openrig-cursor-launch +61 -0
  746. package/daemon/docs/reference/community-harness-examples/hermes/config.yaml.example +18 -0
  747. package/daemon/docs/reference/community-harness-examples/hermes/hermes.yaml +12 -0
  748. package/daemon/docs/reference/community-harness-examples/hermes/openrig-hermes-launch +34 -0
  749. package/daemon/docs/reference/community-harness-examples/openclaw/openclaw.yaml +13 -0
  750. package/daemon/docs/reference/community-harness-examples/openclaw/openrig-openclaw-launch +38 -0
  751. package/daemon/docs/reference/community-harness-presets.md +179 -0
  752. package/daemon/docs/reference/getting-started.md +65 -6
  753. package/daemon/docs/reference/operation-correlation.md +9 -0
  754. package/daemon/docs/reference/project-workspace.md +6 -0
  755. package/daemon/docs/reference/quickstart.md +1 -1
  756. package/daemon/docs/reference/refocus-channel.md +6 -4
  757. package/daemon/docs/reference/rig-spec.md +82 -2
  758. package/daemon/docs/reference/seat-delivery.md +73 -2
  759. package/daemon/docs/reference/slack-app-setup.md +3 -1
  760. package/daemon/docs/reference/stream-classifier-worker.md +28 -0
  761. package/daemon/docs/reference/telemetry.md +3 -0
  762. package/daemon/docs/reference/terminal-sessions.md +90 -0
  763. package/daemon/docs/reference/topology-naming.md +1 -1
  764. package/daemon/docs/reference/whats-new.md +162 -113
  765. package/daemon/specs/agents/shared/runtime/claude-settings.fragment.json +0 -3
  766. package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +19 -4
  767. package/daemon/specs/agents/shared/skills/core/openrig-herdr/SKILL.md +3 -0
  768. package/daemon/specs/agents/shared/skills/core/openrig-software-factory/references/worked-example.md +2 -2
  769. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +36 -10
  770. package/daemon/specs/rigs/launch/kernel/agents/queue/worker/guidance/role.md +11 -0
  771. package/daemon/specs/rigs/launch/kernel/agents/queue/worker/startup/context.md +3 -1
  772. package/daemon/specs/rigs/launch/secrets-manager/secrets-manager.compose.yaml +1 -1
  773. package/dist/acp/connector.d.ts +72 -0
  774. package/dist/acp/connector.d.ts.map +1 -0
  775. package/dist/acp/connector.js +218 -0
  776. package/dist/acp/connector.js.map +1 -0
  777. package/dist/acp/json-rpc-stdio.d.ts +53 -0
  778. package/dist/acp/json-rpc-stdio.d.ts.map +1 -0
  779. package/dist/acp/json-rpc-stdio.js +141 -0
  780. package/dist/acp/json-rpc-stdio.js.map +1 -0
  781. package/dist/acp/run-processes.d.ts +10 -0
  782. package/dist/acp/run-processes.d.ts.map +1 -0
  783. package/dist/acp/run-processes.js +33 -0
  784. package/dist/acp/run-processes.js.map +1 -0
  785. package/dist/build-info.js +3 -3
  786. package/dist/client.d.ts +7 -2
  787. package/dist/client.d.ts.map +1 -1
  788. package/dist/client.js +14 -7
  789. package/dist/client.js.map +1 -1
  790. package/dist/commands/acp.d.ts +11 -0
  791. package/dist/commands/acp.d.ts.map +1 -0
  792. package/dist/commands/acp.js +198 -0
  793. package/dist/commands/acp.js.map +1 -0
  794. package/dist/commands/attach.js +1 -1
  795. package/dist/commands/attach.js.map +1 -1
  796. package/dist/commands/auth.d.ts +3 -0
  797. package/dist/commands/auth.d.ts.map +1 -1
  798. package/dist/commands/auth.js +39 -10
  799. package/dist/commands/auth.js.map +1 -1
  800. package/dist/commands/compact-plan.d.ts +2 -0
  801. package/dist/commands/compact-plan.d.ts.map +1 -1
  802. package/dist/commands/compact-plan.js +38 -3
  803. package/dist/commands/compact-plan.js.map +1 -1
  804. package/dist/commands/compact.js +1 -1
  805. package/dist/commands/compact.js.map +1 -1
  806. package/dist/commands/config.d.ts.map +1 -1
  807. package/dist/commands/config.js +7 -1
  808. package/dist/commands/config.js.map +1 -1
  809. package/dist/commands/create.js +2 -2
  810. package/dist/commands/create.js.map +1 -1
  811. package/dist/commands/daemon.d.ts.map +1 -1
  812. package/dist/commands/daemon.js +2 -0
  813. package/dist/commands/daemon.js.map +1 -1
  814. package/dist/commands/down.d.ts +5 -1
  815. package/dist/commands/down.d.ts.map +1 -1
  816. package/dist/commands/down.js +87 -3
  817. package/dist/commands/down.js.map +1 -1
  818. package/dist/commands/edge.d.ts +4 -0
  819. package/dist/commands/edge.d.ts.map +1 -0
  820. package/dist/commands/edge.js +135 -0
  821. package/dist/commands/edge.js.map +1 -0
  822. package/dist/commands/export.d.ts +1 -0
  823. package/dist/commands/export.d.ts.map +1 -1
  824. package/dist/commands/export.js +51 -0
  825. package/dist/commands/export.js.map +1 -1
  826. package/dist/commands/fork.d.ts.map +1 -1
  827. package/dist/commands/fork.js +19 -2
  828. package/dist/commands/fork.js.map +1 -1
  829. package/dist/commands/gateway.d.ts.map +1 -1
  830. package/dist/commands/gateway.js +2 -1
  831. package/dist/commands/gateway.js.map +1 -1
  832. package/dist/commands/grow.js +2 -2
  833. package/dist/commands/grow.js.map +1 -1
  834. package/dist/commands/launch.js +1 -1
  835. package/dist/commands/launch.js.map +1 -1
  836. package/dist/commands/mcp.d.ts.map +1 -1
  837. package/dist/commands/mcp.js +113 -1
  838. package/dist/commands/mcp.js.map +1 -1
  839. package/dist/commands/project-worker.d.ts +25 -1
  840. package/dist/commands/project-worker.d.ts.map +1 -1
  841. package/dist/commands/project-worker.js +9 -7
  842. package/dist/commands/project-worker.js.map +1 -1
  843. package/dist/commands/project.d.ts +2 -0
  844. package/dist/commands/project.d.ts.map +1 -1
  845. package/dist/commands/project.js +64 -1
  846. package/dist/commands/project.js.map +1 -1
  847. package/dist/commands/provider.d.ts.map +1 -1
  848. package/dist/commands/provider.js +101 -0
  849. package/dist/commands/provider.js.map +1 -1
  850. package/dist/commands/ps.d.ts +12 -1
  851. package/dist/commands/ps.d.ts.map +1 -1
  852. package/dist/commands/ps.js +50 -47
  853. package/dist/commands/ps.js.map +1 -1
  854. package/dist/commands/queue.d.ts +4 -2
  855. package/dist/commands/queue.d.ts.map +1 -1
  856. package/dist/commands/queue.js +24 -15
  857. package/dist/commands/queue.js.map +1 -1
  858. package/dist/commands/reconcile-session.d.ts.map +1 -1
  859. package/dist/commands/reconcile-session.js +6 -0
  860. package/dist/commands/reconcile-session.js.map +1 -1
  861. package/dist/commands/seat.d.ts +2 -0
  862. package/dist/commands/seat.d.ts.map +1 -1
  863. package/dist/commands/seat.js +124 -6
  864. package/dist/commands/seat.js.map +1 -1
  865. package/dist/commands/send.d.ts.map +1 -1
  866. package/dist/commands/send.js +62 -55
  867. package/dist/commands/send.js.map +1 -1
  868. package/dist/commands/setup.d.ts +24 -0
  869. package/dist/commands/setup.d.ts.map +1 -1
  870. package/dist/commands/setup.js +160 -7
  871. package/dist/commands/setup.js.map +1 -1
  872. package/dist/commands/skill.d.ts.map +1 -1
  873. package/dist/commands/skill.js +116 -3
  874. package/dist/commands/skill.js.map +1 -1
  875. package/dist/commands/start.d.ts.map +1 -1
  876. package/dist/commands/start.js +18 -25
  877. package/dist/commands/start.js.map +1 -1
  878. package/dist/commands/status.d.ts.map +1 -1
  879. package/dist/commands/status.js +4 -1
  880. package/dist/commands/status.js.map +1 -1
  881. package/dist/commands/stream-outcome.d.ts +157 -0
  882. package/dist/commands/stream-outcome.d.ts.map +1 -0
  883. package/dist/commands/stream-outcome.js +81 -0
  884. package/dist/commands/stream-outcome.js.map +1 -0
  885. package/dist/commands/stream.d.ts.map +1 -1
  886. package/dist/commands/stream.js +64 -2
  887. package/dist/commands/stream.js.map +1 -1
  888. package/dist/commands/terminal.d.ts +1 -0
  889. package/dist/commands/terminal.d.ts.map +1 -1
  890. package/dist/commands/terminal.js +35 -6
  891. package/dist/commands/terminal.js.map +1 -1
  892. package/dist/commands/topology-default-agent.d.ts +2 -2
  893. package/dist/commands/topology-default-agent.d.ts.map +1 -1
  894. package/dist/commands/topology-default-agent.js +5 -3
  895. package/dist/commands/topology-default-agent.js.map +1 -1
  896. package/dist/commands/up.d.ts.map +1 -1
  897. package/dist/commands/up.js +75 -30
  898. package/dist/commands/up.js.map +1 -1
  899. package/dist/commands/watchdog.d.ts.map +1 -1
  900. package/dist/commands/watchdog.js +80 -5
  901. package/dist/commands/watchdog.js.map +1 -1
  902. package/dist/commands/workflow-errors.js +1 -1
  903. package/dist/commands/workflow-errors.js.map +1 -1
  904. package/dist/commands/workflow-render.js +4 -4
  905. package/dist/commands/workflow-render.js.map +1 -1
  906. package/dist/commands/workflow.d.ts.map +1 -1
  907. package/dist/commands/workflow.js +34 -15
  908. package/dist/commands/workflow.js.map +1 -1
  909. package/dist/config-store.d.ts +15 -1
  910. package/dist/config-store.d.ts.map +1 -1
  911. package/dist/config-store.js +86 -4
  912. package/dist/config-store.js.map +1 -1
  913. package/dist/daemon-lifecycle.d.ts +4 -0
  914. package/dist/daemon-lifecycle.d.ts.map +1 -1
  915. package/dist/daemon-lifecycle.js +73 -21
  916. package/dist/daemon-lifecycle.js.map +1 -1
  917. package/dist/decisions/decisions.d.ts +203 -0
  918. package/dist/decisions/decisions.d.ts.map +1 -0
  919. package/dist/decisions/decisions.js +374 -0
  920. package/dist/decisions/decisions.js.map +1 -0
  921. package/dist/decisions/stream-consumer.d.ts +255 -0
  922. package/dist/decisions/stream-consumer.d.ts.map +1 -0
  923. package/dist/decisions/stream-consumer.js +282 -0
  924. package/dist/decisions/stream-consumer.js.map +1 -0
  925. package/dist/decisions/templates.d.ts +8 -0
  926. package/dist/decisions/templates.d.ts.map +1 -0
  927. package/dist/decisions/templates.js +34 -0
  928. package/dist/decisions/templates.js.map +1 -0
  929. package/dist/fresh-seat-command.d.ts +18 -0
  930. package/dist/fresh-seat-command.d.ts.map +1 -0
  931. package/dist/fresh-seat-command.js +36 -0
  932. package/dist/fresh-seat-command.js.map +1 -0
  933. package/dist/front-door.d.ts +4 -0
  934. package/dist/front-door.d.ts.map +1 -1
  935. package/dist/front-door.js +8 -4
  936. package/dist/front-door.js.map +1 -1
  937. package/dist/host-bindings.d.ts.map +1 -1
  938. package/dist/host-bindings.js +16 -9
  939. package/dist/host-bindings.js.map +1 -1
  940. package/dist/index.d.ts +2 -0
  941. package/dist/index.d.ts.map +1 -1
  942. package/dist/index.js +4 -0
  943. package/dist/index.js.map +1 -1
  944. package/dist/lazy-program.d.ts.map +1 -1
  945. package/dist/lazy-program.js +2 -0
  946. package/dist/lazy-program.js.map +1 -1
  947. package/dist/lib/run-on-host.d.ts +29 -0
  948. package/dist/lib/run-on-host.d.ts.map +1 -0
  949. package/dist/lib/run-on-host.js +69 -0
  950. package/dist/lib/run-on-host.js.map +1 -0
  951. package/dist/lib/seat-activity.d.ts +17 -0
  952. package/dist/lib/seat-activity.d.ts.map +1 -0
  953. package/dist/lib/seat-activity.js +29 -0
  954. package/dist/lib/seat-activity.js.map +1 -0
  955. package/dist/local-daemon-owner.d.ts +4 -0
  956. package/dist/local-daemon-owner.d.ts.map +1 -1
  957. package/dist/local-daemon-owner.js +1 -1
  958. package/dist/local-daemon-owner.js.map +1 -1
  959. package/dist/mcp-http.d.ts +42 -0
  960. package/dist/mcp-http.d.ts.map +1 -0
  961. package/dist/mcp-http.js +232 -0
  962. package/dist/mcp-http.js.map +1 -0
  963. package/dist/mcp-server.d.ts +30 -2
  964. package/dist/mcp-server.d.ts.map +1 -1
  965. package/dist/mcp-server.js +1112 -436
  966. package/dist/mcp-server.js.map +1 -1
  967. package/dist/seat-launch-additions-lines.d.ts +11 -0
  968. package/dist/seat-launch-additions-lines.d.ts.map +1 -0
  969. package/dist/seat-launch-additions-lines.js +14 -0
  970. package/dist/seat-launch-additions-lines.js.map +1 -0
  971. package/dist/terminal-window.d.ts +1 -1
  972. package/dist/terminal-window.d.ts.map +1 -1
  973. package/dist/terminal-window.js +50 -22
  974. package/dist/terminal-window.js.map +1 -1
  975. package/package.json +1 -1
  976. package/tui/dist/attention/attention-model.d.ts +3 -1
  977. package/tui/dist/attention/attention-model.d.ts.map +1 -1
  978. package/tui/dist/attention/attention-model.js +68 -1
  979. package/tui/dist/attention/attention-model.js.map +1 -1
  980. package/tui/dist/commands/registry.d.ts.map +1 -1
  981. package/tui/dist/commands/registry.js +2 -0
  982. package/tui/dist/commands/registry.js.map +1 -1
  983. package/tui/dist/config/config-model.d.ts.map +1 -1
  984. package/tui/dist/config/config-model.js +2 -0
  985. package/tui/dist/config/config-model.js.map +1 -1
  986. package/tui/dist/daemon-client.d.ts +18 -0
  987. package/tui/dist/daemon-client.d.ts.map +1 -1
  988. package/tui/dist/daemon-client.js +4 -0
  989. package/tui/dist/daemon-client.js.map +1 -1
  990. package/tui/dist/hydrate.d.ts.map +1 -1
  991. package/tui/dist/hydrate.js +9 -6
  992. package/tui/dist/hydrate.js.map +1 -1
  993. package/tui/dist/main.js +15 -1
  994. package/tui/dist/main.js.map +1 -1
  995. package/tui/dist/render.d.ts.map +1 -1
  996. package/tui/dist/render.js +10 -3
  997. package/tui/dist/render.js.map +1 -1
  998. package/tui/dist/topology/fixture.js +1 -1
  999. package/tui/dist/topology/fixture.js.map +1 -1
  1000. package/tui/dist/topology/glyphs.js +1 -1
  1001. package/tui/dist/topology/glyphs.js.map +1 -1
  1002. package/tui/dist/topology/graph-types.d.ts +1 -0
  1003. package/tui/dist/topology/graph-types.d.ts.map +1 -1
  1004. package/tui/dist/types.d.ts +25 -0
  1005. package/tui/dist/types.d.ts.map +1 -1
  1006. package/ui/dist/assets/{index-CVgod3Pm.js → index-Blg-p32B.js} +92 -92
  1007. package/ui/dist/index.html +1 -1
@@ -1,11 +1,170 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { z } from "zod";
3
3
  import { randomBytes } from "node:crypto";
4
+ import nodePath from "node:path";
5
+ import { DaemonConnectionError, DaemonTimeoutError, terminalAuthHeaders } from "./client.js";
4
6
  import { readOpenRigEnv } from "./openrig-compat.js";
5
7
  import { resolveRigHandle } from "./rig-handle.js";
8
+ import { formatSeatActivity } from "./lib/seat-activity.js";
6
9
  import { CLI_VERSION } from "./version.js";
7
10
  const LONG_RUNNING_UP_TIMEOUT_MS = 120_000;
8
11
  const WAIT_FOR_IDLE_REQUEST_OVERHEAD_MS = 5_000;
12
+ /** The most text rig_context_get and rig_artifact_read return in one call; a longer file or section is cut, and says so. */
13
+ const CONTEXT_TEXT_LIMIT = 48_000;
14
+ /** The one error shape every error a tool returns carries in structuredContent; its text stays as it always was. ok is
15
+ * false, code is stable (the daemon's own when it sends one), message is readable, and status is the HTTP status when
16
+ * there was one. Arguments a tool's input schema refuses never reach the tool: the MCP SDK answers those itself, with
17
+ * its own text-only error. */
18
+ function errorResult(text, code, message, extra = {}) {
19
+ return { content: [{ type: "text", text }], isError: true, structuredContent: { ok: false, code, message, ...extra } };
20
+ }
21
+ /** A request that threw (the daemon unreachable, a timeout): its message as the text, as before, with a code. */
22
+ function caught(err) {
23
+ const message = err.message;
24
+ const code = err instanceof DaemonTimeoutError ? "daemon_timeout"
25
+ : err instanceof DaemonConnectionError ? "daemon_unreachable"
26
+ : typeof err.code === "string" ? err.code
27
+ : "request_failed";
28
+ return errorResult(message, code, message);
29
+ }
30
+ function rigNotFound(handle) {
31
+ const message = `Rig '${handle}' not found: no rig has that name or id`;
32
+ return errorResult(JSON.stringify({ error: message }), "rig_not_found", message);
33
+ }
34
+ /** structuredContent is an object, so a list comes back as { items }. */
35
+ function structured(data) {
36
+ if (data && typeof data === "object" && !Array.isArray(data))
37
+ return data;
38
+ return Array.isArray(data) ? { items: data } : { value: data };
39
+ }
40
+ /** Where a handed-on item went. A cross-host handoff records the remote item as qitem-…@<host> in closureTarget (named, not
41
+ * fetched); a local successor is the item whose handedOffFrom is this one, the newest when there are several. null when
42
+ * none is found; { unknown: true, code } when the lookup failed or the daemon can't filter by handedOffFrom. */
43
+ async function successorOf(client, qitemId, closureTarget) {
44
+ const remote = typeof closureTarget === "string" ? /^(qitem-[^@]+)@([^@]+)$/.exec(closureTarget) : null;
45
+ if (remote)
46
+ return { qitemId: remote[1], host: remote[2] };
47
+ try {
48
+ const res = await client.get(`/api/queue/list?${new URLSearchParams({ handedOffFrom: qitemId, compact: "1", limit: "5" }).toString()}`);
49
+ if (res.status >= 400)
50
+ return { unknown: true, code: mapResult(res).structuredContent.code };
51
+ if (!Array.isArray(res.data))
52
+ return { unknown: true, code: "unexpected_response" };
53
+ if (ignoredFilter(res.data, { handedOffFrom: qitemId }))
54
+ return { unknown: true, code: "filter_unsupported" };
55
+ const [next, ...others] = res.data;
56
+ if (!next)
57
+ return null;
58
+ return { qitemId: next.qitemId, destinationSession: next.destinationSession, state: next.state, ...(others.length > 0 ? { otherSuccessors: others.map((o) => o.qitemId) } : {}) };
59
+ }
60
+ catch (err) {
61
+ return { unknown: true, code: caught(err).structuredContent.code };
62
+ }
63
+ }
64
+ /** The list filter a daemon ignored, if its rows show one: a daemon older than the filter answers the unfiltered list. */
65
+ function ignoredFilter(data, filters) {
66
+ if (!Array.isArray(data))
67
+ return null;
68
+ const rows = data;
69
+ if (filters.handedOffFrom && rows.some((row) => row.handedOffFrom !== filters.handedOffFrom))
70
+ return "handedOffFrom";
71
+ const sinceMs = filters.since ? Date.parse(filters.since) : Number.NaN;
72
+ if (!Number.isNaN(sinceMs) && rows.some((row) => typeof row.tsUpdated === "string" && Date.parse(row.tsUpdated) < sinceMs))
73
+ return "since";
74
+ return null;
75
+ }
76
+ /** A rig's team from its detail (authored delegates_to edges and the daemon's representative) and its node inventory
77
+ * (sessions and activity, passed on as the daemon reports them). */
78
+ function teamView(detail, inventory) {
79
+ const logicalIds = new Map((detail.nodes ?? []).map((node) => [node.id, node.logicalId]));
80
+ const delegation = (detail.edges ?? []).filter((edge) => edge.kind === "delegates_to")
81
+ .map((edge) => ({ from: logicalIds.get(edge.sourceId), to: logicalIds.get(edge.targetId) }));
82
+ const seats = (Array.isArray(inventory) ? inventory : []).map((seat) => ({
83
+ logicalId: seat.logicalId,
84
+ session: seat.canonicalSessionName ?? null,
85
+ pod: seat.podNamespace ?? null,
86
+ role: seat.role ?? null,
87
+ runtime: seat.runtime ?? null,
88
+ kind: seat.nodeKind ?? null,
89
+ sessionStatus: seat.sessionStatus ?? "unknown",
90
+ activity: formatSeatActivity(seat),
91
+ reportsTo: delegation.filter((edge) => edge.to === seat.logicalId).map((edge) => edge.from),
92
+ delegatesTo: delegation.filter((edge) => edge.from === seat.logicalId).map((edge) => edge.to),
93
+ }));
94
+ const rig = { id: detail.rig?.id ?? null, name: detail.rig?.name ?? null };
95
+ if (!("representative" in detail)) {
96
+ return { rig, lead: null, leadNote: "This daemon doesn't report a rig's lead; it needs a newer daemon.", seats };
97
+ }
98
+ const session = detail.representative ?? null;
99
+ if (!session) {
100
+ return { rig, lead: null, leadNote: "No single lead: the rig has no one seat that delegates to others and that nothing delegates to, or that seat has no session.", seats };
101
+ }
102
+ return { rig, lead: { session, logicalId: seats.find((seat) => seat.session === session)?.logicalId ?? null }, seats };
103
+ }
104
+ /** A slice's summary fields, without its paths and readiness detail. */
105
+ function sliceSummary(slice) {
106
+ return {
107
+ name: slice.name, missionId: slice.missionId ?? null, displayName: slice.displayName, status: slice.status,
108
+ description: slice.description ?? null, qitemCount: slice.qitemCount, lastActivityAt: slice.lastActivityAt ?? null,
109
+ };
110
+ }
111
+ /** What an authenticated non-owner caller may reach: its own seat, its rigs' seats, the items they send or own (to read),
112
+ * the items they own (to change), and its shared roots. A person (<entityId>@external) is never in a non-owner's scope. */
113
+ function scopeFor(access, seatOf) {
114
+ const rigs = new Set(access.rigs);
115
+ const session = (value) => {
116
+ if (typeof value !== "string" || !value)
117
+ return false;
118
+ const seat = seatOf();
119
+ if (seat && (value === seat || value.startsWith(`${seat}@`)))
120
+ return true;
121
+ const rig = value.split("@")[1];
122
+ return rig !== undefined && rig !== "external" && rigs.has(rig);
123
+ };
124
+ return {
125
+ session,
126
+ item: (row) => {
127
+ const item = (row ?? {});
128
+ return session(item.sourceSession) || session(item.destinationSession);
129
+ },
130
+ // The daemon's update has no owner check, so changing a row needs its owner in scope: a row a team seat handed to
131
+ // another team, or a person's pending ask, stays readable and isn't the sender's to close or settle.
132
+ owner: (row) => session((row ?? {}).destinationSession),
133
+ rig: (name) => typeof name === "string" && rigs.has(name),
134
+ root: (name) => typeof name === "string" && access.roots.includes(name),
135
+ };
136
+ }
137
+ /** A target outside an authenticated caller's scope. It names the kind of target only, never the record. */
138
+ function outOfScope(what) {
139
+ const message = `${what} is outside what this connection may reach.`;
140
+ return errorResult(JSON.stringify({ ok: false, error: "out_of_scope", message }), "out_of_scope", message);
141
+ }
142
+ /** The shared root an absolute path falls under as written, and its path inside that root. The reference names a file
143
+ * where the daemon runs, which may be another machine, so it's never resolved through this machine's filesystem; the
144
+ * daemon still checks containment itself when the file is read. */
145
+ function underSharedRoot(roots, absolute) {
146
+ for (const root of roots) {
147
+ const inside = nodePath.relative(root.path, absolute);
148
+ if (inside && inside !== ".." && !inside.startsWith(`..${nodePath.sep}`) && !nodePath.isAbsolute(inside))
149
+ return { root: root.name, path: inside };
150
+ }
151
+ return null;
152
+ }
153
+ /** A file the daemon read through a shared root, as text from offset: at most CONTEXT_TEXT_LIMIT characters, with
154
+ * nextOffset when more of what the daemon read remains, and its byte cut when the file was longer than the daemon reads. */
155
+ function artifactView(source, read, offset) {
156
+ const base = { available: true, source, root: read.root, path: read.path, size: read.size, mtime: read.mtime };
157
+ if (read.binary)
158
+ return { ...base, binary: true, note: "A binary file: not shown as text." };
159
+ const text = read.content ?? "";
160
+ const end = offset + CONTEXT_TEXT_LIMIT;
161
+ return {
162
+ ...base, binary: false, offset, text: text.slice(offset, end), totalChars: text.length,
163
+ truncated: text.length > end || read.truncated === true,
164
+ ...(text.length > end ? { nextOffset: end } : {}),
165
+ ...(read.truncated ? { truncatedAtBytes: read.truncatedAtBytes, totalBytes: read.totalBytes } : {}),
166
+ };
167
+ }
9
168
  /**
10
169
  * The rig id for a tool's rig argument, resolved as the rig CLI commands resolve it: an id, or a name one
11
170
  * active rig has, gives that rig's id; a name two active rigs share is an error result with their ids;
@@ -16,12 +175,86 @@ async function rigIdFor(client, handle) {
16
175
  const resolution = await resolveRigHandle(client, handle);
17
176
  if (resolution.kind === "ambiguous") {
18
177
  const message = `'${handle}' matches ${resolution.ids.length} rigs. Nothing was done; pass one of these ids instead.`;
19
- return { content: [{ type: "text", text: JSON.stringify({ ok: false, code: "rig_ambiguous", message, candidates: resolution.ids }) }], isError: true };
178
+ return errorResult(JSON.stringify({ ok: false, code: "rig_ambiguous", message, candidates: resolution.ids }), "rig_ambiguous", message, { candidates: resolution.ids });
20
179
  }
21
180
  if (resolution.kind === "resolved")
22
- return { id: resolution.id, known: true };
23
- return { id: handle, known: resolution.kind === "passthrough" };
181
+ return { id: resolution.id, known: true, resolved: true };
182
+ return { id: handle, known: resolution.kind === "passthrough", resolved: false };
24
183
  }
184
+ /** The rig id for a chatroom tool: only a handle the rig list resolves. History answers [] for an unknown id, so a
185
+ * handle no rig has, or one the list couldn't be read to check, would otherwise read as an empty room. */
186
+ async function chatRigId(client, handle) {
187
+ const rig = await rigIdFor(client, handle);
188
+ if ("content" in rig)
189
+ return rig;
190
+ if (!rig.resolved) {
191
+ const error = rig.known ? `Rig '${handle}' could not be checked: the rig list couldn't be read` : `Rig '${handle}' not found: no rig has that name or id`;
192
+ return errorResult(JSON.stringify({ error }), rig.known ? "rig_list_unavailable" : "rig_not_found", error);
193
+ }
194
+ return rig;
195
+ }
196
+ /** Options for the transport routes: the wait-for-idle timeout, plus the daemon's terminal bearer token when one is
197
+ * configured (the daemon checks it on /api/transport/* only), sent the way the CLI's send and capture send it. */
198
+ function transportRequestOptions(timeout) {
199
+ const headers = terminalAuthHeaders();
200
+ const hasHeaders = Object.keys(headers).length > 0;
201
+ if (!timeout && !hasHeaders)
202
+ return undefined;
203
+ return { ...(timeout ?? {}), ...(hasHeaders ? { headers } : {}) };
204
+ }
205
+ // Hints for a client deciding what to ask the person (MCP tool annotations), not enforcement. A read-only tool changes
206
+ // nothing through OpenRig. An additive one only adds a record, a message or a seat. A destructive one can also change or
207
+ // remove existing state (stop, replace, discard, refresh discovered facts, or end a row's wait), or, for rig_send, types
208
+ // into an agent that may act on it.
209
+ const READ_ONLY = { readOnlyHint: true };
210
+ const ADDITIVE = { readOnlyHint: false, destructiveHint: false };
211
+ const DESTRUCTIVE = { readOnlyHint: false, destructiveHint: true };
212
+ /** What each tool calls and what it does, kept beside the registrations. The MCP contract tests check that it names every
213
+ * registered tool, that each tool's annotations match its effect, and that each route is mounted in the daemon. Tools that
214
+ * take a rig name also read GET /api/rigs/summary to resolve it. */
215
+ export const MCP_OPERATIONS = [
216
+ { tool: "rig_up", routes: ["POST /api/up"], effect: "destructive", access: "owner" },
217
+ { tool: "rig_down", routes: ["POST /api/down"], effect: "destructive", access: "owner" },
218
+ { tool: "rig_ps", routes: ["GET /api/ps"], effect: "read", access: "work" },
219
+ { tool: "rig_status", routes: ["GET /healthz"], effect: "read", access: "work" },
220
+ { tool: "rig_snapshot_create", routes: ["POST /api/rigs/:rigId/snapshots"], effect: "additive", access: "owner" },
221
+ { tool: "rig_snapshot_list", routes: ["GET /api/rigs/:rigId/snapshots"], effect: "read", access: "owner" },
222
+ { tool: "rig_restore", routes: ["POST /api/rigs/:rigId/restore/:snapshotId"], effect: "destructive", access: "owner" },
223
+ { tool: "rig_restore_status", routes: ["GET /api/rigs/:rigId/restore/status/:attemptId"], effect: "read", access: "owner" },
224
+ { tool: "rig_discover", routes: ["POST /api/discovery/scan"], effect: "destructive", access: "owner" },
225
+ { tool: "rig_bind", routes: ["POST /api/discovery/:id/bind"], effect: "destructive", access: "owner" },
226
+ { tool: "rig_bundle_inspect", routes: ["POST /api/bundles/inspect"], effect: "read", access: "owner" },
227
+ { tool: "rig_agent_validate", routes: ["POST /api/agents/validate"], effect: "read", access: "owner" },
228
+ { tool: "rig_rig_validate", routes: ["POST /api/rigs/import/validate"], effect: "read", access: "owner" },
229
+ { tool: "rig_rig_nodes", routes: ["GET /api/rigs/:rigId/nodes"], effect: "read", access: "work" },
230
+ { tool: "rig_send", routes: ["POST /api/transport/send"], effect: "destructive", access: "work" },
231
+ { tool: "rig_capture", routes: ["POST /api/transport/capture"], effect: "read", access: "work" },
232
+ { tool: "rig_chatroom_send", routes: ["POST /api/rigs/:rigId/chat/send"], effect: "additive", access: "work" },
233
+ { tool: "rig_chatroom_watch", routes: ["GET /api/rigs/:rigId/chat/history"], effect: "read", access: "work" },
234
+ { tool: "rig_add", routes: ["POST /api/rigs/:rigId/pods/:podNamespace/members"], effect: "additive", access: "owner" },
235
+ { tool: "rig_queue_create", routes: ["POST /api/queue/create", "GET /api/queue/:qitemId"], effect: "additive", access: "work" },
236
+ { tool: "rig_queue_show", routes: ["GET /api/queue/:qitemId", "GET /api/queue/:qitemId/transitions", "GET /api/queue/list"], effect: "read", access: "work" },
237
+ { tool: "rig_queue_list", routes: ["GET /api/queue/list"], effect: "read", access: "work" },
238
+ { tool: "rig_queue_claim", routes: ["POST /api/queue/:qitemId/claim"], effect: "destructive", access: "work" },
239
+ { tool: "rig_queue_update", routes: ["POST /api/queue/:qitemId/update"], effect: "destructive", access: "work" },
240
+ { tool: "rig_telemetry_events", routes: ["GET /api/telemetry/v1/events"], effect: "read", access: "owner" },
241
+ { tool: "rig_whoami", routes: ["GET /api/whoami"], effect: "read", access: "work" },
242
+ { tool: "rig_team", routes: ["GET /api/rigs/:rigId", "GET /api/rigs/:rigId/nodes"], effect: "read", access: "work" },
243
+ { tool: "rig_slices", routes: ["GET /api/slices"], effect: "read", access: "workspace" },
244
+ { tool: "rig_mission", routes: ["GET /api/missions/:missionId"], effect: "read", access: "workspace" },
245
+ { tool: "rig_context_pack", routes: ["GET /api/context-packs/library/by-ref"], effect: "read", access: "workspace" },
246
+ { tool: "rig_context_get", routes: ["GET /api/context-packs/library/resolve-address"], effect: "read", access: "workspace" },
247
+ { tool: "rig_artifact_read", routes: ["GET /api/queue/:qitemId", "GET /api/files/roots", "GET /api/files/read"], effect: "read", access: "work" },
248
+ { tool: "rig_human_decision_room", routes: ["GET /api/queue/:qitemId", "GET /api/gateway/human/:entityId/decision-room"], effect: "read", access: "work" },
249
+ { tool: "rig_queue_decide", routes: ["POST /api/queue/:qitemId/delegated-decision"], effect: "destructive", access: "work" },
250
+ ];
251
+ // Short guidance a client may show the model (the server's MCP instructions).
252
+ const INSTRUCTIONS = [
253
+ "This server reaches an OpenRig team as one seat: the one named by OPENRIG_SESSION_NAME where the server was configured, or, over authenticated HTTP, the seat of the caller's grant (rig_whoami shows which, and whether the caller is authenticated; rig_team shows a rig's seats and its lead). The daemon attributes this server's writes to that seat.",
254
+ "To hand work to a seat, use rig_queue_create and keep its qitemId; read the answer later with rig_queue_show, which names the next item when the work was handed on. Queue items are durable: they outlive this conversation and this server.",
255
+ "Tools marked read-only change nothing. A seat whose activity is unknown is not idle, and an accepted request (a restore's attemptId) is not a finished one.",
256
+ "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.",
257
+ ].join("\n");
25
258
  /**
26
259
  * Maps a DaemonResponse to MCP tool result.
27
260
  * Three error levels: HTTP status, in-body errors, and structural failure fields.
@@ -29,485 +262,928 @@ async function rigIdFor(client, handle) {
29
262
  * @param structuralCheck - optional extra check for tool-specific structural failures
30
263
  * @returns MCP tool result
31
264
  */
32
- function mapResult(res, structuralCheck) {
265
+ function mapResult(res, structuralCheck, opts = {}) {
33
266
  const text = JSON.stringify(res.data);
267
+ const data = (res.data ?? {});
268
+ // The daemon answers errors two ways: { error: <prose>, code } (restore, up), and the queue's { error: <code>,
269
+ // message: <prose> }, whose missing-item reads send the code alone. So an error beside a message is the code, and so
270
+ // is a snake_case error on its own. The slice and mission routes send a hint where others send a message.
271
+ const error = typeof data.error === "string" ? data.error : undefined;
272
+ const prose = typeof data.message === "string" ? data.message : typeof data.hint === "string" ? data.hint : undefined;
273
+ const errorIsCode = error !== undefined && (prose !== undefined || /^[a-z][a-z0-9]*(_[a-z0-9]+)+$/.test(error));
274
+ const daemonCode = typeof data.code === "string" ? data.code : errorIsCode ? error : undefined;
275
+ const said = (fallback) => (errorIsCode ? prose ?? error : error ?? prose) ?? fallback;
34
276
  // Level 1: HTTP error
35
277
  if (res.status >= 400) {
36
- return { content: [{ type: "text", text }], isError: true };
278
+ return errorResult(text, daemonCode ?? `http_${res.status}`, said(`the daemon answered ${res.status}`), { status: res.status });
37
279
  }
38
- const data = res.data;
39
280
  // Level 2: In-body error/errors fields
40
281
  if (data.error || (Array.isArray(data.errors) && data.errors.length > 0)) {
41
- return { content: [{ type: "text", text }], isError: true };
282
+ const first = Array.isArray(data.errors) ? data.errors[0] : undefined;
283
+ return errorResult(text, daemonCode ?? "request_failed", said(typeof first === "string" ? first : JSON.stringify(first ?? "the request reported an error")));
42
284
  }
43
285
  // Level 3: Tool-specific structural failure
44
286
  if (structuralCheck && structuralCheck(data)) {
45
- return { content: [{ type: "text", text }], isError: true };
287
+ return errorResult(text, daemonCode ?? opts.structuralCode ?? "operation_incomplete", said("the operation did not complete"));
46
288
  }
47
- return { content: [{ type: "text", text }] };
289
+ return opts.structured ? { content: [{ type: "text", text }], structuredContent: structured(res.data) } : { content: [{ type: "text", text }] };
48
290
  }
49
291
  /**
50
292
  * Creates an MCP server wrapping the daemon HTTP API.
51
293
  * @param client - DaemonClient connected to the daemon
52
294
  * @returns McpServer instance (not yet connected to a transport)
53
295
  */
54
- export function createMcpServer(client) {
296
+ export function createMcpServer(client, options = {}) {
55
297
  const server = new McpServer({
56
298
  name: "openrig",
57
299
  version: CLI_VERSION,
58
- });
59
- // 1. rig_up — bootstrap/bundle install
60
- server.tool("rig_up", "Bootstrap a rig from a spec or bundle", {
61
- sourceRef: z.string().describe("Path to .yaml rig spec or .rigbundle"),
62
- plan: z.boolean().optional().describe("Plan mode — preview without executing"),
63
- autoApprove: z.boolean().optional().describe("Auto-approve trusted actions"),
64
- targetRoot: z.string().optional().describe("Target root directory for package installation"),
65
- }, async ({ sourceRef, plan, autoApprove, targetRoot }) => {
66
- try {
67
- const res = await client.post("/api/up", { sourceRef, plan: plan ?? false, autoApprove: autoApprove ?? false, targetRoot }, plan ? undefined : { timeoutMs: LONG_RUNNING_UP_TIMEOUT_MS });
68
- return mapResult(res);
69
- }
70
- catch (err) {
71
- return { content: [{ type: "text", text: err.message }], isError: true };
72
- }
73
- });
300
+ }, { instructions: INSTRUCTIONS });
301
+ const { access } = options;
302
+ // The seat this server acts as: the authenticated caller's, else OPENRIG_SESSION_NAME where it was configured.
303
+ const seatOf = () => options.seat ?? readOpenRigEnv("OPENRIG_SESSION_NAME", "RIGGED_SESSION_NAME")?.trim();
304
+ const accessClass = new Map(MCP_OPERATIONS.map((op) => [op.tool, op.access]));
305
+ // A local caller (no access) is offered every tool; an authenticated one, its class's.
306
+ const offered = (tool) => {
307
+ if (!access || access.owner)
308
+ return true;
309
+ const kind = accessClass.get(tool);
310
+ return kind === "work" || (kind === "workspace" && access.workspace);
311
+ };
312
+ const scope = access && !access.owner ? scopeFor(access, seatOf) : null;
313
+ const caller = access ? { authenticated: true, principal: access.principal } : { authenticated: false, identity: "declared" };
314
+ /** For an authenticated non-owner: the error for an item it can't reach (or can't read), else null. `owner` asks
315
+ * whether it may change the item, which needs the item's owner in scope. */
316
+ const itemOutOfScope = async (qitemId, need = "item") => {
317
+ if (!scope)
318
+ return null;
319
+ const item = await client.get(`/api/queue/${encodeURIComponent(qitemId)}`);
320
+ if (item.status >= 400)
321
+ return mapResult(item);
322
+ if (scope[need](item.data))
323
+ return null;
324
+ return outOfScope(need === "owner" && scope.item(item.data) ? `Item ${qitemId}'s owner` : `Item ${qitemId}`);
325
+ };
326
+ /** For an authenticated non-owner: the name of the rig a handle resolves to when it's one of its rigs, else the error
327
+ * (outside its rigs, or a handle the rig list can't resolve). */
328
+ const scopedRigName = async (handle) => {
329
+ const rig = await rigIdFor(client, handle);
330
+ if ("content" in rig)
331
+ return rig;
332
+ if (!rig.resolved)
333
+ return outOfScope(`Rig ${handle}`);
334
+ const detail = await client.get(`/api/rigs/${encodeURIComponent(rig.id)}`);
335
+ if (detail.status >= 400)
336
+ return mapResult(detail);
337
+ const name = (detail.data ?? {}).rig?.name;
338
+ return scope?.rig(name) ? name : outOfScope(`Rig ${handle}`);
339
+ };
340
+ const rigOutOfScope = async (handle) => {
341
+ if (!scope)
342
+ return null;
343
+ const name = await scopedRigName(handle);
344
+ return typeof name === "string" ? null : name;
345
+ };
346
+ // 1. rig_up — launch from a spec, bundle or topology, or restore an existing rig by name
347
+ if (offered("rig_up"))
348
+ server.tool("rig_up", "Launch a rig from a rig spec (.yaml), a .rigbundle or a .rigtopology, or restore an existing rig by its name from its latest snapshot", {
349
+ sourceRef: z.string().describe("An absolute path to a rig spec (.yaml), .rigbundle or .rigtopology, or the name of an existing rig to restore. The daemon reads the path, so a relative one resolves against the daemon's directory."),
350
+ plan: z.boolean().optional().describe("Plan mode — preview without executing"),
351
+ autoApprove: z.boolean().optional().describe("Auto-approve trusted actions"),
352
+ targetRoot: z.string().optional().describe("Target root directory for package installation"),
353
+ cwd: z.string().refine((dir) => nodePath.isAbsolute(dir), "cwd must be an absolute path").optional().describe("Working directory for a new launch's agents. It must be absolute: this server has no caller directory to resolve a relative one against."),
354
+ // The daemon drops the whole env block when any entry is invalid, so check it here the way rig up --env does.
355
+ env: z.record(z.string().regex(/^[A-Z_][A-Z0-9_]*$/, "env names match ^[A-Z_][A-Z0-9_]*$").refine((name) => !name.startsWith("OPENRIG_"), "OPENRIG_* env names belong to OpenRig"), z.string().min(1, "env values must not be empty").refine((value) => !value.includes("\0"), "env values must not contain a NUL byte")).optional().describe("Environment variables for a new launch from one rig spec or bundle, not saved with the rig (as rig up --env NAME=value). A .rigtopology or a restore by name doesn't use them."),
356
+ rigName: z.string().min(1).optional().describe("A new launch's rig name instead of the spec's (as rig up --name)"),
357
+ fresh: z.array(z.string()).optional().describe("When restoring an existing rig: the seats (logical ids, e.g. dev.impl) to start fresh instead of resuming (as rig up --fresh)"),
358
+ }, DESTRUCTIVE, async ({ sourceRef, plan, autoApprove, targetRoot, cwd, env, rigName, fresh }) => {
359
+ try {
360
+ const res = await client.post("/api/up", { sourceRef, plan: plan ?? false, autoApprove: autoApprove ?? false, targetRoot, cwdOverride: cwd, envOverride: env, rigName, freshLogicalIds: fresh }, plan ? undefined : { timeoutMs: LONG_RUNNING_UP_TIMEOUT_MS });
361
+ return mapResult(res);
362
+ }
363
+ catch (err) {
364
+ return caught(err);
365
+ }
366
+ });
74
367
  // 2. rig_down — rig teardown
75
- server.tool("rig_down", "Tear down a rig", {
76
- rigId: z.string().describe("Rig name or identifier to tear down"),
77
- delete: z.boolean().optional().describe("Delete rig record after stopping"),
78
- force: z.boolean().optional().describe("Kill sessions immediately"),
79
- snapshot: z.boolean().optional().describe("Take snapshot before teardown"),
80
- }, async (params) => {
81
- try {
82
- const rig = await rigIdFor(client, params.rigId);
83
- if ("content" in rig)
84
- return rig;
85
- const res = await client.post("/api/down", {
86
- rigId: rig.id,
87
- delete: params.delete ?? false,
88
- force: params.force ?? false,
89
- snapshot: params.snapshot ?? false,
90
- });
91
- return mapResult(res);
92
- }
93
- catch (err) {
94
- return { content: [{ type: "text", text: err.message }], isError: true };
95
- }
96
- });
368
+ if (offered("rig_down"))
369
+ server.tool("rig_down", "Tear down a rig", {
370
+ rigId: z.string().describe("Rig name or identifier to tear down"),
371
+ delete: z.boolean().optional().describe("Delete rig record after stopping"),
372
+ force: z.boolean().optional().describe("Kill sessions immediately"),
373
+ snapshot: z.boolean().optional().describe("Take snapshot before teardown"),
374
+ }, DESTRUCTIVE, async (params) => {
375
+ try {
376
+ const rig = await rigIdFor(client, params.rigId);
377
+ if ("content" in rig)
378
+ return rig;
379
+ const res = await client.post("/api/down", {
380
+ rigId: rig.id,
381
+ delete: params.delete ?? false,
382
+ force: params.force ?? false,
383
+ snapshot: params.snapshot ?? false,
384
+ });
385
+ return mapResult(res);
386
+ }
387
+ catch (err) {
388
+ return caught(err);
389
+ }
390
+ });
97
391
  // 3. rig_ps — list running rigs
98
- server.tool("rig_ps", "List rigs and their status", {}, async () => {
99
- try {
100
- const res = await client.get("/api/ps");
101
- return mapResult(res);
102
- }
103
- catch (err) {
104
- return { content: [{ type: "text", text: err.message }], isError: true };
105
- }
106
- });
392
+ if (offered("rig_ps"))
393
+ server.tool("rig_ps", "List rigs and their status", {}, READ_ONLY, async () => {
394
+ try {
395
+ const res = await client.get("/api/ps");
396
+ if (scope && res.status < 400 && Array.isArray(res.data))
397
+ return mapResult({ ...res, data: res.data.filter((entry) => scope.rig(entry.name)) });
398
+ return mapResult(res);
399
+ }
400
+ catch (err) {
401
+ return caught(err);
402
+ }
403
+ });
107
404
  // 4. rig_status — daemon health
108
- server.tool("rig_status", "Check daemon health", {}, async () => {
109
- try {
110
- const res = await client.get("/healthz");
111
- return mapResult(res);
112
- }
113
- catch (err) {
114
- return { content: [{ type: "text", text: err.message }], isError: true };
115
- }
116
- });
405
+ if (offered("rig_status"))
406
+ server.tool("rig_status", "Check daemon health", {}, READ_ONLY, async () => {
407
+ try {
408
+ const res = await client.get("/healthz");
409
+ return mapResult(res);
410
+ }
411
+ catch (err) {
412
+ return caught(err);
413
+ }
414
+ });
117
415
  // 5. rig_snapshot_create — create snapshot
118
- server.tool("rig_snapshot_create", "Create a snapshot for a rig", {
119
- rigId: z.string().describe("Rig name or identifier"),
120
- }, async ({ rigId }) => {
121
- try {
122
- const rig = await rigIdFor(client, rigId);
123
- if ("content" in rig)
124
- return rig;
125
- const res = await client.post(`/api/rigs/${encodeURIComponent(rig.id)}/snapshots`, {});
126
- return mapResult(res);
127
- }
128
- catch (err) {
129
- return { content: [{ type: "text", text: err.message }], isError: true };
130
- }
131
- });
416
+ if (offered("rig_snapshot_create"))
417
+ server.tool("rig_snapshot_create", "Create a snapshot for a rig", {
418
+ rigId: z.string().describe("Rig name or identifier"),
419
+ }, ADDITIVE, async ({ rigId }) => {
420
+ try {
421
+ const rig = await rigIdFor(client, rigId);
422
+ if ("content" in rig)
423
+ return rig;
424
+ const res = await client.post(`/api/rigs/${encodeURIComponent(rig.id)}/snapshots`, {});
425
+ return mapResult(res);
426
+ }
427
+ catch (err) {
428
+ return caught(err);
429
+ }
430
+ });
132
431
  // 6. rig_snapshot_list — list snapshots
133
- server.tool("rig_snapshot_list", "List snapshots for a rig", {
134
- rigId: z.string().describe("Rig name or identifier"),
135
- }, async ({ rigId }) => {
136
- try {
137
- const rig = await rigIdFor(client, rigId);
138
- if ("content" in rig)
139
- return rig;
140
- const res = await client.get(`/api/rigs/${encodeURIComponent(rig.id)}/snapshots`);
141
- // The list answers [] for an id it has nothing under, so a handle no rig matches would read as a rig
142
- // with no snapshots. Snapshots kept under a removed rig's id still list.
143
- if (!rig.known && Array.isArray(res.data) && res.data.length === 0) {
144
- return { content: [{ type: "text", text: JSON.stringify({ error: `Rig '${rigId}' not found: no rig has that name or id` }) }], isError: true };
145
- }
146
- return mapResult(res);
147
- }
148
- catch (err) {
149
- return { content: [{ type: "text", text: err.message }], isError: true };
150
- }
151
- });
432
+ if (offered("rig_snapshot_list"))
433
+ server.tool("rig_snapshot_list", "List snapshots for a rig", {
434
+ rigId: z.string().describe("Rig name or identifier"),
435
+ }, READ_ONLY, async ({ rigId }) => {
436
+ try {
437
+ const rig = await rigIdFor(client, rigId);
438
+ if ("content" in rig)
439
+ return rig;
440
+ const res = await client.get(`/api/rigs/${encodeURIComponent(rig.id)}/snapshots`);
441
+ // The list answers [] for an id it has nothing under, so a handle no rig matches would read as a rig
442
+ // with no snapshots. Snapshots kept under a removed rig's id still list.
443
+ if (!rig.known && Array.isArray(res.data) && res.data.length === 0) {
444
+ return rigNotFound(rigId);
445
+ }
446
+ return mapResult(res);
447
+ }
448
+ catch (err) {
449
+ return caught(err);
450
+ }
451
+ });
152
452
  // 7. rig_restore — restore from snapshot
153
- server.tool("rig_restore", "Restore a rig from a snapshot", {
154
- rigId: z.string().describe("Rig name or identifier"),
155
- snapshotId: z.string().describe("Snapshot identifier"),
156
- }, async ({ rigId, snapshotId }) => {
157
- try {
158
- const rig = await rigIdFor(client, rigId);
159
- if ("content" in rig)
160
- return rig;
161
- const res = await client.post(`/api/rigs/${encodeURIComponent(rig.id)}/restore/${encodeURIComponent(snapshotId)}`, {});
162
- return mapResult(res);
163
- }
164
- catch (err) {
165
- return { content: [{ type: "text", text: err.message }], isError: true };
166
- }
167
- });
453
+ if (offered("rig_restore"))
454
+ server.tool("rig_restore", "Start restoring a rig from a snapshot. It answers at once with an attemptId while the restore runs in the background; follow the attempt with rig_restore_status.", {
455
+ rigId: z.string().describe("Rig name or identifier"),
456
+ snapshotId: z.string().describe("Snapshot identifier"),
457
+ }, DESTRUCTIVE, async ({ rigId, snapshotId }) => {
458
+ try {
459
+ const rig = await rigIdFor(client, rigId);
460
+ if ("content" in rig)
461
+ return rig;
462
+ const res = await client.post(`/api/rigs/${encodeURIComponent(rig.id)}/restore/${encodeURIComponent(snapshotId)}`, {});
463
+ return mapResult(res);
464
+ }
465
+ catch (err) {
466
+ return caught(err);
467
+ }
468
+ });
469
+ // 7b. rig_restore_status — follow a restore attempt rig_restore started
470
+ if (offered("rig_restore_status"))
471
+ server.tool("rig_restore_status", "Read where a restore attempt stands: the receipt for the attemptId rig_restore returned. An attempt with no completion yet (still running, or stopped before it finished) answers attempt_incomplete; it isn't a receipt.", {
472
+ rigId: z.string().describe("Rig name or identifier"),
473
+ attemptId: z.number().int().positive().describe("The attemptId rig_restore returned"),
474
+ }, READ_ONLY, async ({ rigId, attemptId }) => {
475
+ try {
476
+ const rig = await rigIdFor(client, rigId);
477
+ if ("content" in rig)
478
+ return rig;
479
+ return mapResult(await client.get(`/api/rigs/${encodeURIComponent(rig.id)}/restore/status/${attemptId}`), undefined, { structured: true });
480
+ }
481
+ catch (err) {
482
+ return caught(err);
483
+ }
484
+ });
168
485
  // 8. rig_discover — scan for sessions
169
- server.tool("rig_discover", "Scan for tmux sessions to discover", {}, async () => {
170
- try {
171
- const res = await client.post("/api/discovery/scan", {});
172
- return mapResult(res);
173
- }
174
- catch (err) {
175
- return { content: [{ type: "text", text: err.message }], isError: true };
176
- }
177
- });
486
+ if (offered("rig_discover"))
487
+ server.tool("rig_discover", "Scan for tmux sessions to discover", {}, DESTRUCTIVE, async () => {
488
+ try {
489
+ const res = await client.post("/api/discovery/scan", {});
490
+ return mapResult(res);
491
+ }
492
+ catch (err) {
493
+ return caught(err);
494
+ }
495
+ });
178
496
  // 9. rig_bind — bind discovered session to a rig node (existing or new in pod)
179
- server.tool("rig_bind", "Bind a discovered session to an existing node or create a new node in a pod", {
180
- discoveryId: z.string().describe("Discovery session identifier"),
181
- rigId: z.string().describe("Target rig name or identifier"),
182
- logicalId: z.string().optional().describe("Existing node logical ID (mode: bind to existing)"),
183
- podNamespace: z.string().optional().describe("Pod namespace to create node in (mode: create in pod)"),
184
- memberName: z.string().optional().describe("Member name for new node (required with podNamespace)"),
185
- }, async ({ discoveryId, rigId, logicalId, podNamespace, memberName }) => {
186
- try {
187
- const rig = await rigIdFor(client, rigId);
188
- if ("content" in rig)
189
- return rig;
190
- const body = { rigId: rig.id };
191
- if (logicalId)
192
- body["logicalId"] = logicalId;
193
- if (podNamespace)
194
- body["podNamespace"] = podNamespace;
195
- if (memberName)
196
- body["memberName"] = memberName;
197
- const res = await client.post(`/api/discovery/${encodeURIComponent(discoveryId)}/bind`, body);
198
- return mapResult(res);
199
- }
200
- catch (err) {
201
- return { content: [{ type: "text", text: err.message }], isError: true };
202
- }
203
- });
497
+ if (offered("rig_bind"))
498
+ server.tool("rig_bind", "Bind a discovered session to an existing node or create a new node in a pod", {
499
+ discoveryId: z.string().describe("Discovery session identifier"),
500
+ rigId: z.string().describe("Target rig name or identifier"),
501
+ logicalId: z.string().optional().describe("Existing node logical ID (mode: bind to existing)"),
502
+ podNamespace: z.string().optional().describe("Pod namespace to create node in (mode: create in pod)"),
503
+ memberName: z.string().optional().describe("Member name for new node (required with podNamespace)"),
504
+ }, DESTRUCTIVE, async ({ discoveryId, rigId, logicalId, podNamespace, memberName }) => {
505
+ try {
506
+ const rig = await rigIdFor(client, rigId);
507
+ if ("content" in rig)
508
+ return rig;
509
+ const body = { rigId: rig.id };
510
+ if (logicalId)
511
+ body["logicalId"] = logicalId;
512
+ if (podNamespace)
513
+ body["podNamespace"] = podNamespace;
514
+ if (memberName)
515
+ body["memberName"] = memberName;
516
+ const res = await client.post(`/api/discovery/${encodeURIComponent(discoveryId)}/bind`, body);
517
+ return mapResult(res);
518
+ }
519
+ catch (err) {
520
+ return caught(err);
521
+ }
522
+ });
204
523
  // 10. rig_bundle_inspect — inspect a bundle
205
- server.tool("rig_bundle_inspect", "Inspect a .rigbundle file", {
206
- bundlePath: z.string().describe("Path to .rigbundle file"),
207
- }, async ({ bundlePath }) => {
208
- try {
209
- const res = await client.post("/api/bundles/inspect", { bundlePath });
210
- return mapResult(res, (data) => {
211
- // Structural failure: digest invalid or integrity check failed
212
- if (data.digestValid === false)
213
- return true;
214
- const integrity = data.integrityResult;
215
- if (integrity && integrity.passed === false)
216
- return true;
217
- return false;
218
- });
219
- }
220
- catch (err) {
221
- return { content: [{ type: "text", text: err.message }], isError: true };
222
- }
223
- });
524
+ if (offered("rig_bundle_inspect"))
525
+ server.tool("rig_bundle_inspect", "Inspect a .rigbundle file", {
526
+ bundlePath: z.string().describe("Path to .rigbundle file"),
527
+ }, READ_ONLY, async ({ bundlePath }) => {
528
+ try {
529
+ const res = await client.post("/api/bundles/inspect", { bundlePath });
530
+ return mapResult(res, (data) => {
531
+ // Structural failure: digest invalid or integrity check failed
532
+ if (data.digestValid === false)
533
+ return true;
534
+ const integrity = data.integrityResult;
535
+ if (integrity && integrity.passed === false)
536
+ return true;
537
+ return false;
538
+ }, { structuralCode: "bundle_integrity_failed" });
539
+ }
540
+ catch (err) {
541
+ return caught(err);
542
+ }
543
+ });
224
544
  // 11. rig_agent_validate — validate an AgentSpec
225
- server.tool("rig_agent_validate", "Validate an AgentSpec (agent.yaml) from YAML text", {
226
- yaml: z.string().describe("YAML text of the agent spec"),
227
- }, async ({ yaml }) => {
228
- try {
229
- const res = await client.postText("/api/agents/validate", yaml);
230
- return mapResult(res);
231
- }
232
- catch (err) {
233
- return { content: [{ type: "text", text: err.message }], isError: true };
234
- }
235
- });
545
+ if (offered("rig_agent_validate"))
546
+ server.tool("rig_agent_validate", "Validate an AgentSpec (agent.yaml) from YAML text", {
547
+ yaml: z.string().describe("YAML text of the agent spec"),
548
+ }, READ_ONLY, async ({ yaml }) => {
549
+ try {
550
+ const res = await client.postText("/api/agents/validate", yaml);
551
+ return mapResult(res);
552
+ }
553
+ catch (err) {
554
+ return caught(err);
555
+ }
556
+ });
236
557
  // 12. rig_rig_validate — validate a RigSpec
237
- server.tool("rig_rig_validate", "Validate a RigSpec (rig.yaml) from YAML text", {
238
- yaml: z.string().describe("YAML text of the rig spec"),
239
- }, async ({ yaml }) => {
240
- try {
241
- const res = await client.postText("/api/rigs/import/validate", yaml);
242
- return mapResult(res);
243
- }
244
- catch (err) {
245
- return { content: [{ type: "text", text: err.message }], isError: true };
246
- }
247
- });
558
+ if (offered("rig_rig_validate"))
559
+ server.tool("rig_rig_validate", "Validate a RigSpec (rig.yaml) from YAML text", {
560
+ yaml: z.string().describe("YAML text of the rig spec"),
561
+ }, READ_ONLY, async ({ yaml }) => {
562
+ try {
563
+ const res = await client.postText("/api/rigs/import/validate", yaml);
564
+ return mapResult(res);
565
+ }
566
+ catch (err) {
567
+ return caught(err);
568
+ }
569
+ });
248
570
  // 13. rig_rig_nodes — node inventory for a rig
249
- server.tool("rig_rig_nodes", "Get node inventory for a rig — session names, status, attach commands, resume commands", {
250
- rigId: z.string().describe("Rig name or identifier"),
251
- }, async ({ rigId }) => {
252
- try {
253
- const rig = await rigIdFor(client, rigId);
254
- if ("content" in rig)
255
- return rig;
256
- const res = await client.get(`/api/rigs/${encodeURIComponent(rig.id)}/nodes`);
257
- return mapResult(res);
258
- }
259
- catch (err) {
260
- return { content: [{ type: "text", text: err.message }], isError: true };
261
- }
262
- });
571
+ if (offered("rig_rig_nodes"))
572
+ server.tool("rig_rig_nodes", "Get node inventory for a rig — session names, status, attach commands, resume commands", {
573
+ rigId: z.string().describe("Rig name or identifier"),
574
+ }, READ_ONLY, async ({ rigId }) => {
575
+ try {
576
+ const denied = await rigOutOfScope(rigId);
577
+ if (denied)
578
+ return denied;
579
+ const rig = await rigIdFor(client, rigId);
580
+ if ("content" in rig)
581
+ return rig;
582
+ const res = await client.get(`/api/rigs/${encodeURIComponent(rig.id)}/nodes`);
583
+ return mapResult(res);
584
+ }
585
+ catch (err) {
586
+ return caught(err);
587
+ }
588
+ });
263
589
  // 14. rig_send — send message to agent session
264
- server.tool("rig_send", "Send a message to an agent's terminal using reliable two-step send", {
265
- session: z.string().describe("Target session name (e.g. dev-impl@my-rig)"),
266
- text: z.string().describe("Message text to send"),
267
- verify: z.boolean().optional().describe("Verify delivery by checking pane content"),
268
- force: z.boolean().optional().describe("Send even if target appears mid-task"),
269
- waitForIdleSeconds: z.number().positive().optional().describe("Wait until explicit idle evidence before sending"),
270
- }, async ({ session, text, verify, force, waitForIdleSeconds }) => {
271
- try {
272
- if (force && waitForIdleSeconds !== undefined) {
273
- return {
274
- content: [{ type: "text", text: JSON.stringify({ ok: false, error: "waitForIdleSeconds cannot be combined with force" }) }],
275
- isError: true,
276
- };
590
+ if (offered("rig_send"))
591
+ server.tool("rig_send", "Send a message to an agent's terminal using reliable two-step send", {
592
+ session: z.string().describe("Target session name (e.g. dev-impl@my-rig)"),
593
+ text: z.string().describe("Message text to send"),
594
+ verify: z.boolean().optional().describe("Verify delivery by checking pane content"),
595
+ force: z.boolean().optional().describe("Send even if target appears mid-task"),
596
+ waitForIdleSeconds: z.number().positive().optional().describe("Wait until explicit idle evidence before sending"),
597
+ }, DESTRUCTIVE, async ({ session, text, verify, force, waitForIdleSeconds }) => {
598
+ try {
599
+ if (force && waitForIdleSeconds !== undefined) {
600
+ const message = "waitForIdleSeconds cannot be combined with force";
601
+ return errorResult(JSON.stringify({ ok: false, error: message }), "invalid_arguments", message);
602
+ }
603
+ if (scope && !scope.session(session))
604
+ return outOfScope(`Session ${session}`);
605
+ const waitForIdleMs = waitForIdleSeconds === undefined ? undefined : Math.ceil(waitForIdleSeconds * 1000);
606
+ const res = await client.post("/api/transport/send", {
607
+ session,
608
+ text,
609
+ verify,
610
+ force,
611
+ waitForIdleMs,
612
+ }, transportRequestOptions(waitForIdleRequestOptions(waitForIdleMs)));
613
+ return mapResult(res);
614
+ }
615
+ catch (err) {
616
+ return caught(err);
277
617
  }
278
- const waitForIdleMs = waitForIdleSeconds === undefined ? undefined : Math.ceil(waitForIdleSeconds * 1000);
279
- const res = await client.post("/api/transport/send", {
280
- session,
281
- text,
282
- verify,
283
- force,
284
- waitForIdleMs,
285
- }, waitForIdleRequestOptions(waitForIdleMs));
286
- return mapResult(res);
287
- }
288
- catch (err) {
289
- return { content: [{ type: "text", text: err.message }], isError: true };
290
- }
291
- });
618
+ });
292
619
  // 15. rig_capture — capture terminal output from agent session
293
- server.tool("rig_capture", "Capture terminal output from an agent session", {
294
- session: z.string().optional().describe("Session name (omit for multi-target with rig/pod)"),
295
- rig: z.string().optional().describe("Capture all sessions in a rig"),
296
- pod: z.string().optional().describe("Capture all sessions in a pod"),
297
- lines: z.number().optional().describe("Number of lines to capture (default: 20)"),
298
- }, async ({ session, rig, pod, lines }) => {
299
- try {
300
- const body = {};
301
- if (session)
302
- body.session = session;
303
- if (rig)
304
- body.rig = rig;
305
- if (pod)
306
- body.pod = pod;
307
- if (lines)
308
- body.lines = lines;
309
- body.inputBox = true; // what the live input box holds, in the result's inputBox
310
- const res = await client.post("/api/transport/capture", body);
311
- return mapResult(res);
312
- }
313
- catch (err) {
314
- return { content: [{ type: "text", text: err.message }], isError: true };
315
- }
316
- });
620
+ if (offered("rig_capture"))
621
+ server.tool("rig_capture", "Capture terminal output from an agent session", {
622
+ session: z.string().optional().describe("Session name (omit for multi-target with rig/pod)"),
623
+ rig: z.string().optional().describe("Capture all sessions in a rig"),
624
+ pod: z.string().optional().describe("Capture all sessions in a pod"),
625
+ lines: z.number().optional().describe("Number of lines to capture (default: 20)"),
626
+ }, READ_ONLY, async ({ session, rig, pod, lines }) => {
627
+ try {
628
+ let rigName = rig;
629
+ if (scope) {
630
+ if (session && !scope.session(session))
631
+ return outOfScope(`Session ${session}`);
632
+ if (pod && !rig)
633
+ return outOfScope(`Pod ${pod} without its rig`);
634
+ // The route finds the rig by name, so send the name this check authorized: a handle that is one rig's id and
635
+ // another rig's name must not reach the second rig's terminals.
636
+ if (rig) {
637
+ const name = await scopedRigName(rig);
638
+ if (typeof name !== "string")
639
+ return name;
640
+ rigName = name;
641
+ }
642
+ }
643
+ const body = {};
644
+ if (session)
645
+ body.session = session;
646
+ if (rigName)
647
+ body.rig = rigName;
648
+ if (pod)
649
+ body.pod = pod;
650
+ if (lines)
651
+ body.lines = lines;
652
+ body.inputBox = true; // what the live input box holds, in the result's inputBox
653
+ const res = await client.post("/api/transport/capture", body, transportRequestOptions());
654
+ return mapResult(res);
655
+ }
656
+ catch (err) {
657
+ return caught(err);
658
+ }
659
+ });
317
660
  // 16. rig_chatroom_send — send message to rig chatroom
318
- server.tool("rig_chatroom_send", "Send a message to a rig's chatroom", {
319
- rigName: z.string().describe("Rig name to send message to"),
320
- body: z.string().describe("Message body"),
321
- sender: z.string().optional().describe("(deprecated, ignored) the sender is derived from the seat env (X-OpenRig-Session, stamped by the MCP server's DaemonClient); the chat route derives it from the transport header"),
322
- }, async ({ rigName, body }) => {
323
- try {
324
- // Resolve rig name → ID
325
- const summaryRes = await client.get("/api/rigs/summary");
326
- const matches = (summaryRes.data ?? []).filter((r) => r.name === rigName);
327
- if (matches.length === 0) {
328
- return { content: [{ type: "text", text: JSON.stringify({ error: `Rig '${rigName}' not found` }) }], isError: true };
329
- }
330
- if (matches.length > 1) {
331
- return { content: [{ type: "text", text: JSON.stringify({ error: `Rig '${rigName}' is ambiguous — ${matches.length} rigs share that name` }) }], isError: true };
332
- }
333
- const rigId = matches[0].id;
334
- // P21: no body sender — the daemon derives it from the transport header (X-OpenRig-Session,
335
- // stamped by the MCP server's DaemonClient from its seat env). A hardcoded 'mcp' differing from the
336
- // header would be SUPERSEDED by it (transport:v1), not persisted (P18: the 409 mismatch is retired).
337
- const res = await client.post(`/api/rigs/${encodeURIComponent(rigId)}/chat/send`, {
338
- body,
339
- });
340
- return mapResult(res);
341
- }
342
- catch (err) {
343
- return { content: [{ type: "text", text: err.message }], isError: true };
344
- }
345
- });
346
- // 17. rig_chatroom_watch — get recent chatroom history for a rig
347
- server.tool("rig_chatroom_watch", "Get recent chatroom messages for a rig (MCP returns history, not streaming)", {
348
- rigName: z.string().describe("Rig name"),
349
- }, async ({ rigName }) => {
350
- try {
351
- // Resolve rig name → ID
352
- const summaryRes = await client.get("/api/rigs/summary");
353
- const matches = (summaryRes.data ?? []).filter((r) => r.name === rigName);
354
- if (matches.length === 0) {
355
- return { content: [{ type: "text", text: JSON.stringify({ error: `Rig '${rigName}' not found` }) }], isError: true };
356
- }
357
- if (matches.length > 1) {
358
- return { content: [{ type: "text", text: JSON.stringify({ error: `Rig '${rigName}' is ambiguous — ${matches.length} rigs share that name` }) }], isError: true };
359
- }
360
- const rigId = matches[0].id;
361
- const res = await client.get(`/api/rigs/${encodeURIComponent(rigId)}/chat/history?limit=20`);
362
- return mapResult(res);
363
- }
364
- catch (err) {
365
- return { content: [{ type: "text", text: err.message }], isError: true };
366
- }
367
- });
661
+ if (offered("rig_chatroom_send"))
662
+ server.tool("rig_chatroom_send", "Send a message to a rig's chatroom as this server's seat", {
663
+ rigName: z.string().describe("Rig name or identifier"),
664
+ body: z.string().describe("Message body"),
665
+ }, ADDITIVE, async ({ rigName, body }) => {
666
+ try {
667
+ const denied = await rigOutOfScope(rigName);
668
+ if (denied)
669
+ return denied;
670
+ const rig = await chatRigId(client, rigName);
671
+ if ("content" in rig)
672
+ return rig;
673
+ // P21: no body sender — the daemon derives it from the transport header (X-OpenRig-Session,
674
+ // stamped by the MCP server's DaemonClient from its seat env).
675
+ const res = await client.post(`/api/rigs/${encodeURIComponent(rig.id)}/chat/send`, {
676
+ body,
677
+ });
678
+ return mapResult(res);
679
+ }
680
+ catch (err) {
681
+ return caught(err);
682
+ }
683
+ });
684
+ // 17. rig_chatroom_watch — a rig's recent chatroom history (the name is kept; it reads history, it doesn't stream)
685
+ if (offered("rig_chatroom_watch"))
686
+ server.tool("rig_chatroom_watch", "Read a rig's recent chatroom messages: the most recent ones (default 20), oldest first, optionally one topic's or one sender's. It returns what is there now and doesn't wait for new messages.", {
687
+ rigName: z.string().describe("Rig name or identifier"),
688
+ topic: z.string().optional().describe("Only messages in this topic"),
689
+ sender: z.string().optional().describe("Only messages from this seat"),
690
+ limit: z.number().int().positive().optional().describe("How many recent messages (default 20)"),
691
+ }, READ_ONLY, async ({ rigName, topic, sender, limit }) => {
692
+ try {
693
+ const denied = await rigOutOfScope(rigName);
694
+ if (denied)
695
+ return denied;
696
+ const rig = await chatRigId(client, rigName);
697
+ if ("content" in rig)
698
+ return rig;
699
+ const params = new URLSearchParams({ limit: String(limit ?? 20) });
700
+ if (topic)
701
+ params.set("topic", topic);
702
+ if (sender)
703
+ params.set("sender", sender);
704
+ const res = await client.get(`/api/rigs/${encodeURIComponent(rig.id)}/chat/history?${params.toString()}`);
705
+ return mapResult(res);
706
+ }
707
+ catch (err) {
708
+ return caught(err);
709
+ }
710
+ });
368
711
  // 18. rig_add — add a single member to an existing pod (the add_member
369
712
  // converge op). Agent parity for `rig add`: the ergonomics live ON the
370
713
  // converge interface, so every future reshape verb inherits this surface.
371
- server.tool("rig_add", "Add a single member to an existing pod in a running rig (the add_member converge op). Identity-migration-free: mints a fresh seat, nothing existing re-keys.", {
372
- rigId: z.string().describe("Target rig name or identifier"),
373
- podNamespace: z.string().describe("Namespace of the existing pod to add the member to"),
374
- member: z.record(z.string(), z.unknown()).describe("Member fragment with spec snake_case fields: id, runtime, agent_ref, profile, cwd (and optional model, codex_config_profile, restore_policy, label)"),
375
- edges: z.array(z.object({ from: z.string(), to: z.string(), kind: z.string() })).optional().describe("Optional pod-local edges (from/to are member ids within the pod; resolved against the new member + existing pod-mates)"),
376
- rigRoot: z.string().optional().describe("Root directory for agent resolution"),
377
- }, async ({ rigId, podNamespace, member, edges, rigRoot }) => {
378
- try {
379
- const body = { member };
380
- if (edges)
381
- body["edges"] = edges;
382
- if (rigRoot)
383
- body["rigRoot"] = rigRoot;
384
- const rig = await rigIdFor(client, rigId);
385
- if ("content" in rig)
386
- return rig;
387
- const res = await client.post(`/api/rigs/${encodeURIComponent(rig.id)}/pods/${encodeURIComponent(podNamespace)}/members`, body);
388
- // Structural failure: the add persisted (201) but the new node did not
389
- // fully launch (failed / attention_required) — surface it as an error so
390
- // the agent knows the seat is not live, mirroring the CLI non-zero exit.
391
- return mapResult(res, (data) => {
392
- const result = data["result"];
393
- return result?.node?.status !== undefined && result.node.status !== "launched";
394
- });
395
- }
396
- catch (err) {
397
- return { content: [{ type: "text", text: err.message }], isError: true };
398
- }
399
- });
714
+ if (offered("rig_add"))
715
+ server.tool("rig_add", "Add a single member to an existing pod in a running rig (the add_member converge op). Identity-migration-free: mints a fresh seat, nothing existing re-keys.", {
716
+ rigId: z.string().describe("Target rig name or identifier"),
717
+ podNamespace: z.string().describe("Namespace of the existing pod to add the member to"),
718
+ member: z.record(z.string(), z.unknown()).describe("Member fragment with spec snake_case fields: id, runtime, agent_ref, profile, cwd (and optional model, codex_config_profile, restore_policy, label)"),
719
+ edges: z.array(z.object({ from: z.string(), to: z.string(), kind: z.string() })).optional().describe("Optional pod-local edges (from/to are member ids within the pod; resolved against the new member + existing pod-mates)"),
720
+ rigRoot: z.string().optional().describe("Root directory for agent resolution"),
721
+ }, ADDITIVE, async ({ rigId, podNamespace, member, edges, rigRoot }) => {
722
+ try {
723
+ const body = { member };
724
+ if (edges)
725
+ body["edges"] = edges;
726
+ if (rigRoot)
727
+ body["rigRoot"] = rigRoot;
728
+ const rig = await rigIdFor(client, rigId);
729
+ if ("content" in rig)
730
+ return rig;
731
+ const res = await client.post(`/api/rigs/${encodeURIComponent(rig.id)}/pods/${encodeURIComponent(podNamespace)}/members`, body);
732
+ // Structural failure: the add persisted (201) but the new node did not
733
+ // fully launch (failed / attention_required) — surface it as an error so
734
+ // the agent knows the seat is not live, mirroring the CLI non-zero exit.
735
+ return mapResult(res, (data) => {
736
+ const result = data["result"];
737
+ return result?.node?.status !== undefined && result.node.status !== "launched";
738
+ }, { structuralCode: "member_not_launched" });
739
+ }
740
+ catch (err) {
741
+ return caught(err);
742
+ }
743
+ });
400
744
  // 19-23. Queue tools: the same routes `rig queue` uses, for a client without a shell. The source
401
745
  // and actor are this server's seat (OPENRIG_SESSION_NAME in its env), stamped on every request by
402
746
  // DaemonClient, so the identity is configured once, where the server is set up.
403
747
  // 19. rig_queue_create — hand a task to a seat
404
- server.tool("rig_queue_create", "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.", {
405
- destination: z.string().describe("Destination seat (e.g. dev-impl@my-rig)"),
406
- body: z.string().describe("The task: what to do and what to return"),
407
- summary: z.string().optional().describe("One-line summary"),
408
- tags: z.array(z.string()).optional().describe("Tags, e.g. mission:<name>"),
409
- priority: z.string().optional().describe("Priority (as rig queue create --priority)"),
410
- tier: z.string().optional().describe("Tier (as rig queue create --tier)"),
411
- qitemId: z.string().optional().describe("Request id to reuse when retrying the same create (default: a new id)"),
412
- }, async ({ destination, body, summary, tags, priority, tier, qitemId }) => {
413
- const id = qitemId ?? `qitem-${new Date().toISOString().replace(/\D/g, "").slice(0, 14)}-${randomBytes(8).toString("hex")}`;
414
- try {
415
- const res = await client.post("/api/queue/create", {
416
- qitemId: id, destinationSession: destination, body, summary, tags, priority, tier,
417
- });
418
- return mapResult(res);
419
- }
420
- catch (err) {
421
- return { content: [{ type: "text", text: `${err.message} The outcome is unknown: check rig_queue_show with qitemId ${id} before retrying, and retry only with that same qitemId.` }], isError: true };
422
- }
423
- });
748
+ if (offered("rig_queue_create"))
749
+ server.tool("rig_queue_create", "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.", {
750
+ destination: z.string().describe("Destination seat (e.g. dev-impl@my-rig)"),
751
+ body: z.string().describe("The task: what to do and what to return"),
752
+ summary: z.string().optional().describe("One-line summary"),
753
+ tags: z.array(z.string()).optional().describe("Tags, e.g. mission:<name>"),
754
+ priority: z.string().optional().describe("Priority (as rig queue create --priority)"),
755
+ tier: z.string().optional().describe("Tier (as rig queue create --tier)"),
756
+ qitemId: z.string().optional().describe("Request id to reuse when retrying the same create (default: a new id)"),
757
+ revises: z.string().optional().describe("The qitemId of the work this asks to revise"),
758
+ alert: z.boolean().optional().describe("For an ask to a person that's urgent: something only they can do, or an approval whose wait costs now (as rig queue create --alert). It stands out in Slack. Without it the ask still posts to Slack unless the person's Slack subscription is urgent-only, in which case it waits on Steering and the TUI"),
759
+ }, ADDITIVE, async ({ destination, body, summary, tags, priority, tier, qitemId, revises, alert }) => {
760
+ if (scope && !scope.session(destination))
761
+ return outOfScope(`Destination ${destination}`);
762
+ // A revision carries its original's lineage as a handoff does: the original's chain, then the original.
763
+ let lineage;
764
+ if (revises) {
765
+ try {
766
+ const original = await client.get(`/api/queue/${encodeURIComponent(revises)}`);
767
+ if (original.status >= 400)
768
+ return mapResult(original);
769
+ if (scope && !scope.item(original.data))
770
+ return outOfScope(`Item ${revises}`);
771
+ const prior = (original.data ?? {});
772
+ const originalId = typeof prior.qitemId === "string" ? prior.qitemId : revises;
773
+ const chain = Array.isArray(prior.chainOfRecord) ? prior.chainOfRecord.filter((link) => typeof link === "string") : [];
774
+ lineage = { chainOfRecord: [...chain, originalId], body: `Revision of ${originalId}.\n\n${body}` };
775
+ }
776
+ catch (err) {
777
+ return caught(err);
778
+ }
779
+ }
780
+ const id = qitemId ?? `qitem-${new Date().toISOString().replace(/\D/g, "").slice(0, 14)}-${randomBytes(8).toString("hex")}`;
781
+ try {
782
+ const res = await client.post("/api/queue/create", {
783
+ qitemId: id, destinationSession: destination, body: lineage?.body ?? body, summary, tags, priority, tier,
784
+ ...(alert ? { humanAlert: true } : {}),
785
+ ...(lineage ? { chainOfRecord: lineage.chainOfRecord } : {}),
786
+ });
787
+ return mapResult(res, undefined, { structured: true });
788
+ }
789
+ catch (err) {
790
+ const failure = caught(err);
791
+ const text = `${err.message} The outcome is unknown: check rig_queue_show with qitemId ${id} before retrying, and retry only with that same qitemId.`;
792
+ return { ...failure, content: [{ type: "text", text }], structuredContent: { ...failure.structuredContent, qitemId: id, outcome: "unknown" } };
793
+ }
794
+ });
424
795
  // 20. rig_queue_show — one item with its transitions: a delegated task's answer is its own record
425
- server.tool("rig_queue_show", "Read one queue item and its transitions. For a task you handed off, this is where its answer is: the state, the closure reason and target, and the notes the assignee recorded.", {
426
- qitemId: z.string().describe("The qitemId returned by rig_queue_create (or any queue item)"),
427
- }, async ({ qitemId }) => {
428
- try {
429
- const id = encodeURIComponent(qitemId);
430
- const item = await client.get(`/api/queue/${id}`);
431
- if (item.status >= 400)
432
- return mapResult(item);
433
- const transitions = await client.get(`/api/queue/${id}/transitions`);
434
- if (transitions.status >= 400)
435
- return mapResult(transitions);
436
- return mapResult({ status: 200, data: { item: item.data, transitions: transitions.data } });
437
- }
438
- catch (err) {
439
- return { content: [{ type: "text", text: err.message }], isError: true };
440
- }
441
- });
796
+ if (offered("rig_queue_show"))
797
+ server.tool("rig_queue_show", "Read one queue item and its transitions. For a task you handed off, this is where its answer is: the state, the closure reason and target, the notes the assignee recorded, and evidenceRef when it names an artifact (read it with rig_artifact_read). When the item was handed on, successor names the next item (on another host: its id and host); follow it with rig_queue_show. null means none was found. A revision names the work it revises in chainOfRecord.", {
798
+ qitemId: z.string().describe("The qitemId returned by rig_queue_create (or any queue item)"),
799
+ }, READ_ONLY, async ({ qitemId }) => {
800
+ try {
801
+ const id = encodeURIComponent(qitemId);
802
+ const item = await client.get(`/api/queue/${id}`);
803
+ if (item.status >= 400)
804
+ return mapResult(item);
805
+ if (scope && !scope.item(item.data))
806
+ return outOfScope(`Item ${qitemId}`);
807
+ const transitions = await client.get(`/api/queue/${id}/transitions`);
808
+ if (transitions.status >= 400)
809
+ return mapResult(transitions);
810
+ const row = (item.data ?? {});
811
+ const handedOn = row.state === "handed-off" || row.closureReason === "handed_off_to";
812
+ let successor = handedOn ? await successorOf(client, qitemId, row.closureTarget) : undefined;
813
+ if (scope && successor && "destinationSession" in successor && !scope.session(successor.destinationSession))
814
+ successor = { unknown: true, code: "out_of_scope" };
815
+ return mapResult({ status: 200, data: { item: item.data, transitions: transitions.data, ...(handedOn ? { successor } : {}) } }, undefined, { structured: true });
816
+ }
817
+ catch (err) {
818
+ return caught(err);
819
+ }
820
+ });
442
821
  // 21. rig_queue_list — list queue items
443
- server.tool("rig_queue_list", "List queue items. owned: assigned to this seat. mine: this seat is the source or the destination. Without a scope, this seat's rig. Without state, open items only (all adds closed ones); a state filter returns exactly those states, closed ones included.", {
444
- owned: z.boolean().optional().describe("Only items assigned to this seat (overrides destination)"),
445
- mine: z.boolean().optional().describe("Items this seat sent or owns"),
446
- destination: z.string().optional().describe("Filter by destination seat"),
447
- source: z.string().optional().describe("Filter by source seat"),
448
- state: z.string().optional().describe("Only these states, comma-separated; closed states included when named"),
449
- all: z.boolean().optional().describe("Without state: include closed items"),
450
- limit: z.number().int().positive().optional().describe("Result limit (default 100)"),
451
- }, async ({ owned, mine, destination, source, state, all, limit }) => {
452
- try {
453
- const params = new URLSearchParams();
454
- const sessionName = readOpenRigEnv("OPENRIG_SESSION_NAME", "RIGGED_SESSION_NAME")?.trim();
455
- if ((owned || mine) && !sessionName) {
456
- return { content: [{ type: "text", text: JSON.stringify({ ok: false, error: "owned and mine need this server's seat: set OPENRIG_SESSION_NAME in its env, or filter by destination or source" }) }], isError: true };
457
- }
458
- if (owned)
459
- params.set("destinationSession", sessionName);
460
- else if (mine)
461
- params.set("as", sessionName);
462
- else if (!destination && !source && sessionName?.includes("@"))
463
- params.set("rig", sessionName.split("@")[1]);
464
- if (!all)
465
- params.set("activeOnly", "1");
466
- params.set("compact", "1");
467
- // owned means assigned to this seat; another destination can't widen it to someone else's items.
468
- if (destination && !owned)
469
- params.set("destinationSession", destination);
470
- if (source)
471
- params.set("sourceSession", source);
472
- if (state)
473
- params.set("state", state);
474
- params.set("limit", String(limit ?? 100));
475
- return mapResult(await client.get(`/api/queue/list?${params.toString()}`));
476
- }
477
- catch (err) {
478
- return { content: [{ type: "text", text: err.message }], isError: true };
479
- }
480
- });
822
+ if (offered("rig_queue_list"))
823
+ server.tool("rig_queue_list", "List queue items. owned: assigned to this seat. mine: this seat is the source or the destination. Without a scope, this seat's rig. Without state, open items only (all adds closed ones); a state filter returns exactly those states, closed ones included. since finds work updated after a time; handedOffFrom finds where a handed-off item went.", {
824
+ owned: z.boolean().optional().describe("Only items assigned to this seat (overrides destination)"),
825
+ mine: z.boolean().optional().describe("Items this seat sent or owns"),
826
+ destination: z.string().optional().describe("Filter by destination seat"),
827
+ source: z.string().optional().describe("Filter by source seat"),
828
+ state: z.string().optional().describe("Only these states, comma-separated; closed states included when named"),
829
+ all: z.boolean().optional().describe("Without state: include closed items"),
830
+ since: z.string().optional().describe("Only items updated at or after this ISO-8601 time, e.g. done work since Monday: state done, since 2026-10-19"),
831
+ handedOffFrom: z.string().optional().describe("The items handed on from this qitemId, in any state and any rig"),
832
+ limit: z.number().int().positive().optional().describe("Result limit (default 100)"),
833
+ }, READ_ONLY, async ({ owned, mine, destination, source, state, all, since, handedOffFrom, limit }) => {
834
+ try {
835
+ const params = new URLSearchParams();
836
+ const sessionName = seatOf();
837
+ if ((owned || mine) && !sessionName) {
838
+ const message = "owned and mine need this server's seat: set OPENRIG_SESSION_NAME in its env, or filter by destination or source";
839
+ return errorResult(JSON.stringify({ ok: false, error: message }), "seat_required", message);
840
+ }
841
+ if (scope) {
842
+ if (destination && !owned && !scope.session(destination))
843
+ return outOfScope(`Destination ${destination}`);
844
+ if (source && !scope.session(source))
845
+ return outOfScope(`Source ${source}`);
846
+ const defaultRig = sessionName?.split("@")[1];
847
+ if (!owned && !mine && !destination && !source && !handedOffFrom && !scope.rig(defaultRig))
848
+ return outOfScope(`Rig ${defaultRig ?? "(none)"}`);
849
+ }
850
+ if (owned)
851
+ params.set("destinationSession", sessionName);
852
+ else if (mine)
853
+ params.set("as", sessionName);
854
+ else if (!destination && !source && !handedOffFrom && sessionName?.includes("@"))
855
+ params.set("rig", sessionName.split("@")[1]);
856
+ if (!all && !handedOffFrom)
857
+ params.set("activeOnly", "1");
858
+ params.set("compact", "1");
859
+ // owned means assigned to this seat; another destination can't widen it to someone else's items.
860
+ if (destination && !owned)
861
+ params.set("destinationSession", destination);
862
+ if (source)
863
+ params.set("sourceSession", source);
864
+ if (state)
865
+ params.set("state", state);
866
+ if (since)
867
+ params.set("updatedSince", since);
868
+ if (handedOffFrom)
869
+ params.set("handedOffFrom", handedOffFrom);
870
+ params.set("limit", String(limit ?? 100));
871
+ const res = await client.get(`/api/queue/list?${params.toString()}`);
872
+ const ignored = res.status < 400 ? ignoredFilter(res.data, { since, handedOffFrom }) : null;
873
+ if (ignored) {
874
+ const message = `The daemon didn't apply ${ignored}, so this list isn't filtered by it; it needs a newer daemon.`;
875
+ return errorResult(JSON.stringify({ ok: false, error: message }), "filter_unsupported", message);
876
+ }
877
+ // An authenticated caller sees only the rows in its scope, whatever the filters matched.
878
+ if (scope && res.status < 400 && Array.isArray(res.data))
879
+ return mapResult({ ...res, data: res.data.filter((row) => scope.item(row)) }, undefined, { structured: true });
880
+ return mapResult(res, undefined, { structured: true });
881
+ }
882
+ catch (err) {
883
+ return caught(err);
884
+ }
885
+ });
481
886
  // 22. rig_queue_claim — take an item assigned to this seat
482
- server.tool("rig_queue_claim", "Claim a queue item assigned to this seat before working on it.", { qitemId: z.string().describe("The queue item to claim") }, async ({ qitemId }) => {
483
- try {
484
- return mapResult(await client.post(`/api/queue/${encodeURIComponent(qitemId)}/claim`, {}));
485
- }
486
- catch (err) {
487
- return { content: [{ type: "text", text: err.message }], isError: true };
488
- }
489
- });
887
+ if (offered("rig_queue_claim"))
888
+ server.tool("rig_queue_claim", "Claim a queue item assigned to this seat before working on it.", { qitemId: z.string().describe("The queue item to claim") }, DESTRUCTIVE, async ({ qitemId }) => {
889
+ try {
890
+ const denied = await itemOutOfScope(qitemId);
891
+ if (denied)
892
+ return denied;
893
+ return mapResult(await client.post(`/api/queue/${encodeURIComponent(qitemId)}/claim`, {}), undefined, { structured: true });
894
+ }
895
+ catch (err) {
896
+ return caught(err);
897
+ }
898
+ });
490
899
  // 23. rig_queue_update — record progress, block, or close with the answer
491
- server.tool("rig_queue_update", "Update a queue item: add a note, block it, or close it. To answer a task, close it with state done, a closure reason, and the answer in note.", {
492
- qitemId: z.string().describe("The queue item to update"),
493
- state: z.string().optional().describe("New state (e.g. in-progress, blocked, done)"),
494
- closureReason: z.string().optional().describe("Why it closed (as rig queue update --closure-reason)"),
495
- closureTarget: z.string().optional().describe("Closure target, when the reason needs one"),
496
- note: z.string().optional().describe("Transition note: progress, or the answer when closing"),
497
- summary: z.string().optional().describe("Replace the one-line summary"),
498
- evidenceRef: z.string().optional().describe("Where the evidence is"),
499
- blockedOn: z.string().optional().describe("What it waits on, when blocking"),
500
- 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."),
501
- }, async ({ qitemId, state, closureReason, closureTarget, note, summary, evidenceRef, blockedOn, wakeAfterSeconds }) => {
502
- try {
503
- return mapResult(await client.post(`/api/queue/${encodeURIComponent(qitemId)}/update`, {
504
- state, closureReason, closureTarget, summary, evidenceRef, blockedOn, wakeAfterSeconds, transitionNote: note,
505
- }));
506
- }
507
- catch (err) {
508
- return { content: [{ type: "text", text: err.message }], isError: true };
509
- }
510
- });
900
+ if (offered("rig_queue_update"))
901
+ server.tool("rig_queue_update", "Update a queue item: add a note, block it, close it, or reopen a closed one. To answer a task, close it with state done, a closure reason and the answer in resolution, which the item keeps; note records why this transition happened.", {
902
+ qitemId: z.string().describe("The queue item to update"),
903
+ state: z.string().optional().describe("New state (e.g. in-progress, blocked, done)"),
904
+ closureReason: z.string().optional().describe("Why it closed (as rig queue update --closure-reason)"),
905
+ closureTarget: z.string().optional().describe("Closure target, when the reason needs one"),
906
+ note: z.string().optional().describe("Transition note: progress, or why this transition happened (required to reopen)"),
907
+ 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)"),
908
+ 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)"),
909
+ summary: z.string().optional().describe("Replace the one-line summary"),
910
+ 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"),
911
+ blockedOn: z.string().optional().describe("What it waits on, when blocking"),
912
+ 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."),
913
+ }, DESTRUCTIVE, async ({ qitemId, state, closureReason, closureTarget, note, resolution, reopen, summary, evidenceRef, blockedOn, wakeAfterSeconds }) => {
914
+ try {
915
+ const denied = await itemOutOfScope(qitemId, "owner");
916
+ if (denied)
917
+ return denied;
918
+ return mapResult(await client.post(`/api/queue/${encodeURIComponent(qitemId)}/update`, {
919
+ state, closureReason, closureTarget, summary, evidenceRef, blockedOn, wakeAfterSeconds, transitionNote: note, resolution, reopen,
920
+ }), undefined, { structured: true });
921
+ }
922
+ catch (err) {
923
+ return caught(err);
924
+ }
925
+ });
926
+ // 24. rig_telemetry_events — one bounded page of event metadata, the page `rig telemetry events` reads
927
+ if (offered("rig_telemetry_events"))
928
+ server.tool("rig_telemetry_events", "Read one bounded page of event metadata: seq, rig, node, type and time, never payloads. Without a cursor it starts at the newest event and returns no rows; start retained reads the retained past instead. Continue with page.nextCursor and the same filters. coverage.gaps names any history it could not read, including a daemon restart, after which the old cursor can't continue.", {
929
+ cursor: z.string().optional().describe("page.nextCursor from the previous page; not with start"),
930
+ start: z.enum(["latest", "retained"]).optional().describe("Without a cursor: latest (default) or retained"),
931
+ rigId: z.string().optional().describe("Rig name or identifier; events with no rig are left out"),
932
+ nodeId: z.string().optional().describe("Node identifier"),
933
+ limit: z.number().int().min(1).max(128).optional().describe("Source rows to scan (default and maximum 128); a filter can return fewer"),
934
+ }, READ_ONLY, async ({ cursor, start, rigId, nodeId, limit }) => {
935
+ try {
936
+ const params = new URLSearchParams();
937
+ if (rigId) {
938
+ const rig = await rigIdFor(client, rigId);
939
+ if ("content" in rig)
940
+ return rig;
941
+ // The daemon filters by exact id and matches nothing for an unknown one, which would read as a quiet rig.
942
+ if (!rig.known) {
943
+ return rigNotFound(rigId);
944
+ }
945
+ params.set("rigId", rig.id);
946
+ }
947
+ if (cursor)
948
+ params.set("cursor", cursor);
949
+ if (start)
950
+ params.set("start", start);
951
+ if (nodeId)
952
+ params.set("nodeId", nodeId);
953
+ if (limit !== undefined)
954
+ params.set("limit", String(limit));
955
+ return mapResult(await client.get(`/api/telemetry/v1/events?${params.toString()}`));
956
+ }
957
+ catch (err) {
958
+ return caught(err);
959
+ }
960
+ });
961
+ // 26. rig_whoami — which seat this server acts as
962
+ if (offered("rig_whoami"))
963
+ server.tool("rig_whoami", "Show which OpenRig seat this server acts as: its rig, pod, peers and edges, and caller: authenticated (a validated HTTP credential, with its principal) or declared (OPENRIG_SESSION_NAME where the server was configured, which nothing verifies).", {}, READ_ONLY, async () => {
964
+ try {
965
+ const seat = seatOf();
966
+ if (!seat) {
967
+ 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." };
968
+ return { content: [{ type: "text", text: JSON.stringify(none) }], structuredContent: none };
969
+ }
970
+ const params = new URLSearchParams({ sessionName: seat, compact: "1" });
971
+ const targetRepo = readOpenRigEnv("OPENRIG_TARGET_REPO", "RIGGED_TARGET_REPO")?.trim();
972
+ if (targetRepo)
973
+ params.set("targetRepo", targetRepo);
974
+ const res = await client.get(`/api/whoami?${params.toString()}`);
975
+ if (res.status >= 400)
976
+ return mapResult(res);
977
+ return mapResult({ ...res, data: { ...res.data, caller } }, undefined, { structured: true });
978
+ }
979
+ catch (err) {
980
+ return caught(err);
981
+ }
982
+ });
983
+ // 27. rig_team — a rig's seats and its lead
984
+ if (offered("rig_team"))
985
+ server.tool("rig_team", "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.", {
986
+ rigId: z.string().describe("Rig name or identifier"),
987
+ }, READ_ONLY, async ({ rigId }) => {
988
+ try {
989
+ const rig = await rigIdFor(client, rigId);
990
+ if ("content" in rig)
991
+ return rig;
992
+ const id = encodeURIComponent(rig.id);
993
+ const detail = await client.get(`/api/rigs/${id}`);
994
+ if (detail.status >= 400)
995
+ return mapResult(detail);
996
+ if (scope && !scope.rig((detail.data ?? {}).rig?.name))
997
+ return outOfScope(`Rig ${rigId}`);
998
+ const nodes = await client.get(`/api/rigs/${id}/nodes`);
999
+ if (nodes.status >= 400)
1000
+ return mapResult(nodes);
1001
+ return mapResult({ status: 200, data: teamView((detail.data ?? {}), nodes.data) }, undefined, { structured: true });
1002
+ }
1003
+ catch (err) {
1004
+ return caught(err);
1005
+ }
1006
+ });
1007
+ // 28. rig_slices — the work tree's slices, as summaries
1008
+ if (offered("rig_slices"))
1009
+ server.tool("rig_slices", "List the work tree's slices, most recently active first: name, mission, status, description and how many queue items name it. Paths and readiness detail are left out.", {
1010
+ missionId: z.string().optional().describe("Only this mission's slices"),
1011
+ filter: z.enum(["all", "active", "done", "blocked"]).optional().describe("Only slices with this status (default all)"),
1012
+ limit: z.number().int().positive().max(200).optional().describe("Most slices to return (default 50)"),
1013
+ }, READ_ONLY, async ({ missionId, filter, limit }) => {
1014
+ try {
1015
+ const res = await client.get(`/api/slices${filter ? `?${new URLSearchParams({ filter }).toString()}` : ""}`);
1016
+ if (res.status >= 400)
1017
+ return mapResult(res);
1018
+ const all = ((res.data ?? {}).slices ?? []).filter((slice) => !missionId || slice.missionId === missionId);
1019
+ const shown = all.slice(0, limit ?? 50);
1020
+ return mapResult({ status: 200, data: { slices: shown.map(sliceSummary), totalCount: all.length, truncated: shown.length < all.length } }, undefined, { structured: true });
1021
+ }
1022
+ catch (err) {
1023
+ return caught(err);
1024
+ }
1025
+ });
1026
+ // 29. rig_mission — one mission's status and slices
1027
+ if (offered("rig_mission"))
1028
+ server.tool("rig_mission", "Read one mission: its status and its slices as summaries.", {
1029
+ missionId: z.string().describe("The mission's id (its folder name)"),
1030
+ }, READ_ONLY, async ({ missionId }) => {
1031
+ try {
1032
+ const res = await client.get(`/api/missions/${encodeURIComponent(missionId)}`);
1033
+ if (res.status >= 400)
1034
+ return mapResult(res);
1035
+ const mission = (res.data ?? {});
1036
+ return mapResult({ status: 200, data: { missionId: mission.missionId ?? missionId, status: mission.status ?? null, slices: (mission.slices ?? []).map(sliceSummary) } }, undefined, { structured: true });
1037
+ }
1038
+ catch (err) {
1039
+ return caught(err);
1040
+ }
1041
+ });
1042
+ // 30. rig_context_pack — one context pack's files
1043
+ if (offered("rig_context_pack"))
1044
+ server.tool("rig_context_pack", "Show one context pack: its purpose and the files it declares (path, role, summary, estimated tokens), so a file can be read with rig_context_get as <pack>/<file>.", {
1045
+ ref: z.string().describe("The pack's ref, as rig context list shows it (e.g. project-world)"),
1046
+ }, READ_ONLY, async ({ ref }) => {
1047
+ try {
1048
+ const res = await client.get(`/api/context-packs/library/by-ref?${new URLSearchParams({ ref }).toString()}`);
1049
+ if (res.status >= 400)
1050
+ return mapResult(res);
1051
+ const pack = (res.data ?? {});
1052
+ return mapResult({ status: 200, data: {
1053
+ ref: pack.relativePath ?? ref, name: pack.name, version: pack.version, purpose: pack.purpose ?? null,
1054
+ files: (pack.files ?? []).map((file) => ({ path: file.path, role: file.role, summary: file.summary ?? null, estimatedTokens: file.estimatedTokens ?? null })),
1055
+ } }, undefined, { structured: true });
1056
+ }
1057
+ catch (err) {
1058
+ return caught(err);
1059
+ }
1060
+ });
1061
+ // 31. rig_context_get — one context file or section, as rig context get reads it
1062
+ if (offered("rig_context_get"))
1063
+ server.tool("rig_context_get", `Read one context file or one section of it, as rig context get does: <pack>/<file>, or <pack>/<file>#<h2-slug>[/<h3-slug>]. Text over ${CONTEXT_TEXT_LIMIT} characters is cut (truncated: true); address a section to read the rest.`, {
1064
+ address: z.string().describe("<pack>/<file>[#<h2-slug>[/<h3-slug>]]"),
1065
+ }, READ_ONLY, async ({ address }) => {
1066
+ try {
1067
+ const res = await client.get(`/api/context-packs/library/resolve-address?${new URLSearchParams({ address }).toString()}`);
1068
+ if (res.status >= 400)
1069
+ return mapResult(res);
1070
+ const found = (res.data ?? {});
1071
+ const text = found.text ?? "";
1072
+ const cut = text.length > CONTEXT_TEXT_LIMIT;
1073
+ return mapResult({ status: 200, data: {
1074
+ address: found.address ?? address, packRef: found.packRef, filePath: found.filePath,
1075
+ ...(found.headerPath !== undefined ? { headerPath: found.headerPath } : {}),
1076
+ text: cut ? text.slice(0, CONTEXT_TEXT_LIMIT) : text,
1077
+ ...(cut ? { truncated: true, totalChars: text.length } : {}),
1078
+ } }, undefined, { structured: true });
1079
+ }
1080
+ catch (err) {
1081
+ return caught(err);
1082
+ }
1083
+ });
1084
+ // 32. rig_artifact_read — a result's artifact, read through the daemon's shared roots
1085
+ if (offered("rig_artifact_read"))
1086
+ server.tool("rig_artifact_read", `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.`, {
1087
+ qitemId: z.string().optional().describe("Read this item's evidenceRef"),
1088
+ 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"),
1089
+ path: z.string().optional().describe("With root: the file's path inside that root"),
1090
+ offset: z.number().int().min(0).optional().describe("The character to start from (default 0)"),
1091
+ }, READ_ONLY, async ({ qitemId, root, path, offset }) => {
1092
+ try {
1093
+ const read = async (source, rootName, inside) => {
1094
+ const res = await client.get(`/api/files/read?${new URLSearchParams({ root: rootName, path: inside }).toString()}`);
1095
+ if (res.status >= 400)
1096
+ return mapResult(res);
1097
+ return mapResult({ status: 200, data: artifactView(source, (res.data ?? {}), offset ?? 0) }, undefined, { structured: true });
1098
+ };
1099
+ if (scope && root && !scope.root(root))
1100
+ return outOfScope(`Root ${root}`);
1101
+ if (!qitemId) {
1102
+ if (root && path)
1103
+ return await read("path", root, path);
1104
+ const message = "Name an item (qitemId), or a file (root and path).";
1105
+ return errorResult(JSON.stringify({ ok: false, error: message }), "artifact_required", message);
1106
+ }
1107
+ const item = await client.get(`/api/queue/${encodeURIComponent(qitemId)}`);
1108
+ if (item.status >= 400)
1109
+ return mapResult(item);
1110
+ if (scope && !scope.item(item.data))
1111
+ return outOfScope(`Item ${qitemId}`);
1112
+ const ref = (item.data ?? {}).evidenceRef;
1113
+ const rootsRes = await client.get("/api/files/roots");
1114
+ if (rootsRes.status >= 400)
1115
+ return mapResult(rootsRes);
1116
+ const roots = ((rootsRes.data ?? {}).roots ?? []).filter((entry) => !scope || scope.root(entry.name));
1117
+ const unavailable = (reason) => mapResult({ status: 200, data: {
1118
+ available: false, qitemId, reason, evidenceRef: typeof ref === "string" ? ref : null, roots: roots.map((entry) => entry.name),
1119
+ } }, undefined, { structured: true });
1120
+ if (typeof ref !== "string" || !ref.trim())
1121
+ return unavailable("This item names no artifact: it has no evidenceRef.");
1122
+ if (/^[a-z][a-z0-9+.-]*:\/\//i.test(ref))
1123
+ return unavailable("The evidenceRef is a link, not a file in a shared root: open it where it lives.");
1124
+ if (roots.length === 0)
1125
+ return unavailable("This daemon shares no roots (OPENRIG_FILES_ALLOWLIST is empty), so no artifact can be read through it.");
1126
+ if (!nodePath.isAbsolute(ref)) {
1127
+ return root ? await read("evidenceRef", root, ref) : unavailable("The evidenceRef is a relative path: name the shared root it's under (root).");
1128
+ }
1129
+ const shared = underSharedRoot(roots, ref);
1130
+ if (!shared)
1131
+ 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.");
1132
+ return await read("evidenceRef", shared.root, shared.path);
1133
+ }
1134
+ catch (err) {
1135
+ return caught(err);
1136
+ }
1137
+ });
1138
+ // 33. rig_human_decision_room — before deciding a question asked of a person: the room their mode gives the team
1139
+ if (offered("rig_human_decision_room"))
1140
+ server.tool("rig_human_decision_room", "Before deciding a question you asked a person: the decision room of the mode they have on, in their own words (what the team may decide for them meanwhile, and what it may not), or none, with why. You judge whether your decision falls inside it; with none, the question stays theirs to answer.", {
1141
+ qitemId: z.string().describe("Your pending ask to the person (a queue item addressed to <person>@external)"),
1142
+ }, READ_ONLY, async ({ qitemId }) => {
1143
+ try {
1144
+ const item = await client.get(`/api/queue/${encodeURIComponent(qitemId)}`);
1145
+ if (item.status >= 400)
1146
+ return mapResult(item);
1147
+ if (scope && !scope.item(item.data))
1148
+ return outOfScope(`Item ${qitemId}`);
1149
+ const row = (item.data ?? {});
1150
+ // A person is addressed as <entityId>@external, the daemon's external session form; an update asks nothing.
1151
+ const person = typeof row.destinationSession === "string" ? /^([A-Za-z0-9._:-]+)@external$/.exec(row.destinationSession) : null;
1152
+ if (!person || row.humanIntent === "update") {
1153
+ const message = `${qitemId} isn't a decision asked of a person: it's ${row.humanIntent === "update" ? "an update" : "addressed"} to ${String(row.destinationSession)}`;
1154
+ return errorResult(JSON.stringify({ ok: false, error: "not-a-decision", message }), "not-a-decision", message);
1155
+ }
1156
+ const res = await client.get(`/api/gateway/human/${encodeURIComponent(person[1])}/decision-room`);
1157
+ if (res.status >= 400)
1158
+ return mapResult(res);
1159
+ return mapResult({ status: 200, data: { qitemId, ...res.data, entityId: person[1] } }, undefined, { structured: true });
1160
+ }
1161
+ catch (err) {
1162
+ return caught(err);
1163
+ }
1164
+ });
1165
+ // 34. rig_queue_decide — a decision made on a person's behalf, inside their decision room, beside their answers
1166
+ if (offered("rig_queue_decide"))
1167
+ server.tool("rig_queue_decide", "Record a decision you made on a person's behalf, on your own pending ask to them, inside the decision room of the mode they have on: read it first with rig_human_decision_room and pass its applicationId. It's recorded beside their answers, never as one, and the ask closes. The daemon refuses it when they have no room, their mode changed since you read it, the ask is a permission prompt or an approval gate, they've started answering, or another seat asked. This server never answers as the person.", {
1168
+ qitemId: z.string().describe("Your pending ask to the person"),
1169
+ applicationId: z.string().describe("decisionRoom.applicationId from rig_human_decision_room: the room you judged against"),
1170
+ choices: z.array(z.object({
1171
+ questionId: z.string().optional().describe("The question's id, when the ask has structured questions"),
1172
+ chosen: z.string().describe("The option's id; for an ask without questions, the choice in words"),
1173
+ })).describe("One choice per structured question; for an ask without questions, one choice without questionId"),
1174
+ reason: z.string().describe("Why this choice"),
1175
+ reversible: z.boolean().describe("Whether the decision can be undone"),
1176
+ }, DESTRUCTIVE, async ({ qitemId, applicationId, choices, reason, reversible }) => {
1177
+ try {
1178
+ const denied = await itemOutOfScope(qitemId);
1179
+ if (denied)
1180
+ return denied;
1181
+ return mapResult(await client.post(`/api/queue/${encodeURIComponent(qitemId)}/delegated-decision`, { applicationId, choices, reason, reversible }), undefined, { structured: true });
1182
+ }
1183
+ catch (err) {
1184
+ return caught(err);
1185
+ }
1186
+ });
511
1187
  return server;
512
1188
  }
513
1189
  function waitForIdleRequestOptions(waitForIdleMs) {