@openrig/cli 0.3.1 → 0.3.3-rc.0

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 (358) hide show
  1. package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +1 -1
  2. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +8 -8
  3. package/daemon/dist/adapters/cmux-transport.d.ts.map +1 -1
  4. package/daemon/dist/adapters/cmux-transport.js +51 -9
  5. package/daemon/dist/adapters/cmux-transport.js.map +1 -1
  6. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  7. package/daemon/dist/adapters/codex-runtime-adapter.js +34 -5
  8. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  9. package/daemon/dist/adapters/tmux.d.ts +68 -1
  10. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  11. package/daemon/dist/adapters/tmux.js +141 -2
  12. package/daemon/dist/adapters/tmux.js.map +1 -1
  13. package/daemon/dist/db/migrations/037_mission_control_actions.d.ts +5 -1
  14. package/daemon/dist/db/migrations/037_mission_control_actions.d.ts.map +1 -1
  15. package/daemon/dist/db/migrations/037_mission_control_actions.js +5 -1
  16. package/daemon/dist/db/migrations/037_mission_control_actions.js.map +1 -1
  17. package/daemon/dist/db/migrations/041_rig_policy.d.ts +32 -0
  18. package/daemon/dist/db/migrations/041_rig_policy.d.ts.map +1 -0
  19. package/daemon/dist/db/migrations/041_rig_policy.js +47 -0
  20. package/daemon/dist/db/migrations/041_rig_policy.js.map +1 -0
  21. package/daemon/dist/db/migrations/042_rig_archive.d.ts +16 -0
  22. package/daemon/dist/db/migrations/042_rig_archive.d.ts.map +1 -0
  23. package/daemon/dist/db/migrations/042_rig_archive.js +21 -0
  24. package/daemon/dist/db/migrations/042_rig_archive.js.map +1 -0
  25. package/daemon/dist/domain/agent-images/resume-token-discovery.js +1 -1
  26. package/daemon/dist/domain/agent-images/resume-token-discovery.js.map +1 -1
  27. package/daemon/dist/domain/agent-images/snapshot-capturer.d.ts.map +1 -1
  28. package/daemon/dist/domain/agent-images/snapshot-capturer.js +2 -1
  29. package/daemon/dist/domain/agent-images/snapshot-capturer.js.map +1 -1
  30. package/daemon/dist/domain/agent-manifest.js +27 -0
  31. package/daemon/dist/domain/agent-manifest.js.map +1 -1
  32. package/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
  33. package/daemon/dist/domain/bootstrap-orchestrator.js +86 -6
  34. package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
  35. package/daemon/dist/domain/bundle-agent-images-router.d.ts +95 -0
  36. package/daemon/dist/domain/bundle-agent-images-router.d.ts.map +1 -0
  37. package/daemon/dist/domain/bundle-agent-images-router.js +140 -0
  38. package/daemon/dist/domain/bundle-agent-images-router.js.map +1 -0
  39. package/daemon/dist/domain/bundle-assembler.d.ts +18 -1
  40. package/daemon/dist/domain/bundle-assembler.d.ts.map +1 -1
  41. package/daemon/dist/domain/bundle-assembler.js +11 -1
  42. package/daemon/dist/domain/bundle-assembler.js.map +1 -1
  43. package/daemon/dist/domain/bundle-audit.d.ts +89 -0
  44. package/daemon/dist/domain/bundle-audit.d.ts.map +1 -0
  45. package/daemon/dist/domain/bundle-audit.js +87 -0
  46. package/daemon/dist/domain/bundle-audit.js.map +1 -0
  47. package/daemon/dist/domain/bundle-conflict-detector.d.ts +57 -0
  48. package/daemon/dist/domain/bundle-conflict-detector.d.ts.map +1 -0
  49. package/daemon/dist/domain/bundle-conflict-detector.js +49 -0
  50. package/daemon/dist/domain/bundle-conflict-detector.js.map +1 -0
  51. package/daemon/dist/domain/bundle-context-packs-router.d.ts +100 -0
  52. package/daemon/dist/domain/bundle-context-packs-router.d.ts.map +1 -0
  53. package/daemon/dist/domain/bundle-context-packs-router.js +158 -0
  54. package/daemon/dist/domain/bundle-context-packs-router.js.map +1 -0
  55. package/daemon/dist/domain/bundle-plugins-router.d.ts +69 -0
  56. package/daemon/dist/domain/bundle-plugins-router.d.ts.map +1 -0
  57. package/daemon/dist/domain/bundle-plugins-router.js +87 -0
  58. package/daemon/dist/domain/bundle-plugins-router.js.map +1 -0
  59. package/daemon/dist/domain/bundle-skills-router.d.ts +62 -0
  60. package/daemon/dist/domain/bundle-skills-router.d.ts.map +1 -0
  61. package/daemon/dist/domain/bundle-skills-router.js +90 -0
  62. package/daemon/dist/domain/bundle-skills-router.js.map +1 -0
  63. package/daemon/dist/domain/bundle-types.d.ts +106 -0
  64. package/daemon/dist/domain/bundle-types.d.ts.map +1 -1
  65. package/daemon/dist/domain/bundle-types.js +375 -0
  66. package/daemon/dist/domain/bundle-types.js.map +1 -1
  67. package/daemon/dist/domain/bundle-workflow-specs-router.d.ts +94 -0
  68. package/daemon/dist/domain/bundle-workflow-specs-router.d.ts.map +1 -0
  69. package/daemon/dist/domain/bundle-workflow-specs-router.js +144 -0
  70. package/daemon/dist/domain/bundle-workflow-specs-router.js.map +1 -0
  71. package/daemon/dist/domain/context-monitor.d.ts +5 -1
  72. package/daemon/dist/domain/context-monitor.d.ts.map +1 -1
  73. package/daemon/dist/domain/context-monitor.js +28 -15
  74. package/daemon/dist/domain/context-monitor.js.map +1 -1
  75. package/daemon/dist/domain/graph-projection.d.ts +6 -0
  76. package/daemon/dist/domain/graph-projection.d.ts.map +1 -1
  77. package/daemon/dist/domain/graph-projection.js +6 -0
  78. package/daemon/dist/domain/graph-projection.js.map +1 -1
  79. package/daemon/dist/domain/native-resume-probe.js +7 -7
  80. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  81. package/daemon/dist/domain/node-inventory.d.ts +18 -0
  82. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  83. package/daemon/dist/domain/node-inventory.js +98 -0
  84. package/daemon/dist/domain/node-inventory.js.map +1 -1
  85. package/daemon/dist/domain/node-launcher.d.ts +12 -0
  86. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  87. package/daemon/dist/domain/node-launcher.js +25 -1
  88. package/daemon/dist/domain/node-launcher.js.map +1 -1
  89. package/daemon/dist/domain/pod-bundle-assembler.d.ts +16 -1
  90. package/daemon/dist/domain/pod-bundle-assembler.d.ts.map +1 -1
  91. package/daemon/dist/domain/pod-bundle-assembler.js +11 -1
  92. package/daemon/dist/domain/pod-bundle-assembler.js.map +1 -1
  93. package/daemon/dist/domain/profile-resolver.d.ts +10 -0
  94. package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
  95. package/daemon/dist/domain/profile-resolver.js +4 -0
  96. package/daemon/dist/domain/profile-resolver.js.map +1 -1
  97. package/daemon/dist/domain/ps-projection.d.ts +28 -1
  98. package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
  99. package/daemon/dist/domain/ps-projection.js +67 -1
  100. package/daemon/dist/domain/ps-projection.js.map +1 -1
  101. package/daemon/dist/domain/queue-repository.d.ts +37 -1
  102. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  103. package/daemon/dist/domain/queue-repository.js +99 -2
  104. package/daemon/dist/domain/queue-repository.js.map +1 -1
  105. package/daemon/dist/domain/restore-check-service.d.ts +4 -0
  106. package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
  107. package/daemon/dist/domain/restore-check-service.js +16 -7
  108. package/daemon/dist/domain/restore-check-service.js.map +1 -1
  109. package/daemon/dist/domain/rig-expansion-service.d.ts +1 -1
  110. package/daemon/dist/domain/rig-expansion-service.d.ts.map +1 -1
  111. package/daemon/dist/domain/rig-expansion-service.js +12 -10
  112. package/daemon/dist/domain/rig-expansion-service.js.map +1 -1
  113. package/daemon/dist/domain/rig-policy/rig-policy-defaults.d.ts +48 -0
  114. package/daemon/dist/domain/rig-policy/rig-policy-defaults.d.ts.map +1 -0
  115. package/daemon/dist/domain/rig-policy/rig-policy-defaults.js +96 -0
  116. package/daemon/dist/domain/rig-policy/rig-policy-defaults.js.map +1 -0
  117. package/daemon/dist/domain/rig-policy/rig-policy-store.d.ts +46 -0
  118. package/daemon/dist/domain/rig-policy/rig-policy-store.d.ts.map +1 -0
  119. package/daemon/dist/domain/rig-policy/rig-policy-store.js +171 -0
  120. package/daemon/dist/domain/rig-policy/rig-policy-store.js.map +1 -0
  121. package/daemon/dist/domain/rig-policy/rig-policy-types.d.ts +145 -0
  122. package/daemon/dist/domain/rig-policy/rig-policy-types.d.ts.map +1 -0
  123. package/daemon/dist/domain/rig-policy/rig-policy-types.js +52 -0
  124. package/daemon/dist/domain/rig-policy/rig-policy-types.js.map +1 -0
  125. package/daemon/dist/domain/rig-policy/rig-policy-validator.d.ts +58 -0
  126. package/daemon/dist/domain/rig-policy/rig-policy-validator.d.ts.map +1 -0
  127. package/daemon/dist/domain/rig-policy/rig-policy-validator.js +211 -0
  128. package/daemon/dist/domain/rig-policy/rig-policy-validator.js.map +1 -0
  129. package/daemon/dist/domain/rig-repository.d.ts +28 -2
  130. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  131. package/daemon/dist/domain/rig-repository.js +40 -3
  132. package/daemon/dist/domain/rig-repository.js.map +1 -1
  133. package/daemon/dist/domain/rigspec-instantiator.d.ts +177 -1
  134. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  135. package/daemon/dist/domain/rigspec-instantiator.js +414 -55
  136. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  137. package/daemon/dist/domain/rigspec-preflight.d.ts +19 -1
  138. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  139. package/daemon/dist/domain/rigspec-preflight.js +30 -12
  140. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  141. package/daemon/dist/domain/rigspec-schema.d.ts +1 -0
  142. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  143. package/daemon/dist/domain/rigspec-schema.js +4 -1
  144. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  145. package/daemon/dist/domain/seat-activity-service.d.ts +79 -0
  146. package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -0
  147. package/daemon/dist/domain/seat-activity-service.js +123 -0
  148. package/daemon/dist/domain/seat-activity-service.js.map +1 -0
  149. package/daemon/dist/domain/session-transport.d.ts +15 -0
  150. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  151. package/daemon/dist/domain/session-transport.js +8 -3
  152. package/daemon/dist/domain/session-transport.js.map +1 -1
  153. package/daemon/dist/domain/slices/slice-indexer.d.ts +12 -0
  154. package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -1
  155. package/daemon/dist/domain/slices/slice-indexer.js +23 -0
  156. package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
  157. package/daemon/dist/domain/spec-library-service.d.ts.map +1 -1
  158. package/daemon/dist/domain/spec-library-service.js +19 -0
  159. package/daemon/dist/domain/spec-library-service.js.map +1 -1
  160. package/daemon/dist/domain/topology-converge.d.ts +97 -0
  161. package/daemon/dist/domain/topology-converge.d.ts.map +1 -0
  162. package/daemon/dist/domain/topology-converge.js +70 -0
  163. package/daemon/dist/domain/topology-converge.js.map +1 -0
  164. package/daemon/dist/domain/types.d.ts +85 -3
  165. package/daemon/dist/domain/types.d.ts.map +1 -1
  166. package/daemon/dist/domain/types.js.map +1 -1
  167. package/daemon/dist/domain/whoami-service.d.ts +8 -0
  168. package/daemon/dist/domain/whoami-service.d.ts.map +1 -1
  169. package/daemon/dist/domain/whoami-service.js +1 -0
  170. package/daemon/dist/domain/whoami-service.js.map +1 -1
  171. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  172. package/daemon/dist/domain/workflow-runtime.js +9 -1
  173. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  174. package/daemon/dist/domain/workflow-spec-cache.d.ts +41 -0
  175. package/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
  176. package/daemon/dist/domain/workflow-spec-cache.js +63 -0
  177. package/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
  178. package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts +7 -0
  179. package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
  180. package/daemon/dist/domain/workspace/default-workspace-scaffold.js +156 -3
  181. package/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
  182. package/daemon/dist/domain/workspace/workspace-doctor.d.ts +197 -0
  183. package/daemon/dist/domain/workspace/workspace-doctor.d.ts.map +1 -0
  184. package/daemon/dist/domain/workspace/workspace-doctor.js +448 -0
  185. package/daemon/dist/domain/workspace/workspace-doctor.js.map +1 -0
  186. package/daemon/dist/index.d.ts.map +1 -1
  187. package/daemon/dist/index.js +11 -0
  188. package/daemon/dist/index.js.map +1 -1
  189. package/daemon/dist/routes/bundles.d.ts.map +1 -1
  190. package/daemon/dist/routes/bundles.js +966 -7
  191. package/daemon/dist/routes/bundles.js.map +1 -1
  192. package/daemon/dist/routes/config.d.ts.map +1 -1
  193. package/daemon/dist/routes/config.js +19 -2
  194. package/daemon/dist/routes/config.js.map +1 -1
  195. package/daemon/dist/routes/info.d.ts +3 -0
  196. package/daemon/dist/routes/info.d.ts.map +1 -0
  197. package/daemon/dist/routes/info.js +20 -0
  198. package/daemon/dist/routes/info.js.map +1 -0
  199. package/daemon/dist/routes/ps.js +4 -1
  200. package/daemon/dist/routes/ps.js.map +1 -1
  201. package/daemon/dist/routes/queue.d.ts +18 -0
  202. package/daemon/dist/routes/queue.d.ts.map +1 -1
  203. package/daemon/dist/routes/queue.js +97 -5
  204. package/daemon/dist/routes/queue.js.map +1 -1
  205. package/daemon/dist/routes/rig-policy.d.ts +9 -0
  206. package/daemon/dist/routes/rig-policy.d.ts.map +1 -0
  207. package/daemon/dist/routes/rig-policy.js +174 -0
  208. package/daemon/dist/routes/rig-policy.js.map +1 -0
  209. package/daemon/dist/routes/rigs.d.ts.map +1 -1
  210. package/daemon/dist/routes/rigs.js +134 -4
  211. package/daemon/dist/routes/rigs.js.map +1 -1
  212. package/daemon/dist/routes/sessions.d.ts.map +1 -1
  213. package/daemon/dist/routes/sessions.js +26 -3
  214. package/daemon/dist/routes/sessions.js.map +1 -1
  215. package/daemon/dist/routes/up.d.ts +25 -0
  216. package/daemon/dist/routes/up.d.ts.map +1 -1
  217. package/daemon/dist/routes/up.js +70 -3
  218. package/daemon/dist/routes/up.js.map +1 -1
  219. package/daemon/dist/routes/workspace.d.ts.map +1 -1
  220. package/daemon/dist/routes/workspace.js +80 -1
  221. package/daemon/dist/routes/workspace.js.map +1 -1
  222. package/daemon/dist/server.d.ts +10 -0
  223. package/daemon/dist/server.d.ts.map +1 -1
  224. package/daemon/dist/server.js +11 -0
  225. package/daemon/dist/server.js.map +1 -1
  226. package/daemon/dist/startup.d.ts.map +1 -1
  227. package/daemon/dist/startup.js +46 -4
  228. package/daemon/dist/startup.js.map +1 -1
  229. package/daemon/docs/reference/getting-started.md +69 -0
  230. package/daemon/specs/agents/orchestration/orchestrator/guidance/role.md +28 -4
  231. package/daemon/specs/agents/shared/skills/core/openrig-user/SKILL.md +361 -15
  232. package/daemon/specs/agents/shared/skills/core/rig-lifecycle/SKILL.md +2 -2
  233. package/daemon/specs/rigs/launch/conveyor/rig.yaml +1 -1
  234. package/dist/client.d.ts +3 -0
  235. package/dist/client.d.ts.map +1 -1
  236. package/dist/client.js +13 -1
  237. package/dist/client.js.map +1 -1
  238. package/dist/commands/add.d.ts +4 -0
  239. package/dist/commands/add.d.ts.map +1 -0
  240. package/dist/commands/add.js +115 -0
  241. package/dist/commands/add.js.map +1 -0
  242. package/dist/commands/archive.d.ts +10 -0
  243. package/dist/commands/archive.d.ts.map +1 -0
  244. package/dist/commands/archive.js +68 -0
  245. package/dist/commands/archive.js.map +1 -0
  246. package/dist/commands/bootstrap.js +2 -2
  247. package/dist/commands/bootstrap.js.map +1 -1
  248. package/dist/commands/bundle.d.ts.map +1 -1
  249. package/dist/commands/bundle.js +123 -2
  250. package/dist/commands/bundle.js.map +1 -1
  251. package/dist/commands/config-init-workspace.d.ts.map +1 -1
  252. package/dist/commands/config-init-workspace.js +40 -5
  253. package/dist/commands/config-init-workspace.js.map +1 -1
  254. package/dist/commands/discover.js +2 -2
  255. package/dist/commands/discover.js.map +1 -1
  256. package/dist/commands/down.d.ts +1 -1
  257. package/dist/commands/down.d.ts.map +1 -1
  258. package/dist/commands/down.js +91 -3
  259. package/dist/commands/down.js.map +1 -1
  260. package/dist/commands/ps.d.ts.map +1 -1
  261. package/dist/commands/ps.js +72 -10
  262. package/dist/commands/ps.js.map +1 -1
  263. package/dist/commands/queue.d.ts +6 -0
  264. package/dist/commands/queue.d.ts.map +1 -1
  265. package/dist/commands/queue.js +103 -5
  266. package/dist/commands/queue.js.map +1 -1
  267. package/dist/commands/rig-policy.d.ts +48 -0
  268. package/dist/commands/rig-policy.d.ts.map +1 -0
  269. package/dist/commands/rig-policy.js +429 -0
  270. package/dist/commands/rig-policy.js.map +1 -0
  271. package/dist/commands/scope.d.ts +6 -0
  272. package/dist/commands/scope.d.ts.map +1 -0
  273. package/dist/commands/scope.js +659 -0
  274. package/dist/commands/scope.js.map +1 -0
  275. package/dist/commands/send.d.ts.map +1 -1
  276. package/dist/commands/send.js +11 -0
  277. package/dist/commands/send.js.map +1 -1
  278. package/dist/commands/setup.d.ts +7 -0
  279. package/dist/commands/setup.d.ts.map +1 -1
  280. package/dist/commands/setup.js +28 -1
  281. package/dist/commands/setup.js.map +1 -1
  282. package/dist/commands/status.d.ts.map +1 -1
  283. package/dist/commands/status.js +35 -2
  284. package/dist/commands/status.js.map +1 -1
  285. package/dist/commands/unarchive.d.ts +10 -0
  286. package/dist/commands/unarchive.d.ts.map +1 -0
  287. package/dist/commands/unarchive.js +53 -0
  288. package/dist/commands/unarchive.js.map +1 -0
  289. package/dist/commands/up.d.ts.map +1 -1
  290. package/dist/commands/up.js +97 -0
  291. package/dist/commands/up.js.map +1 -1
  292. package/dist/commands/whoami.d.ts.map +1 -1
  293. package/dist/commands/whoami.js +4 -1
  294. package/dist/commands/whoami.js.map +1 -1
  295. package/dist/commands/workflow.d.ts +9 -0
  296. package/dist/commands/workflow.d.ts.map +1 -1
  297. package/dist/commands/workflow.js +141 -4
  298. package/dist/commands/workflow.js.map +1 -1
  299. package/dist/commands/workspace.d.ts +20 -0
  300. package/dist/commands/workspace.d.ts.map +1 -1
  301. package/dist/commands/workspace.js +140 -10
  302. package/dist/commands/workspace.js.map +1 -1
  303. package/dist/daemon-lifecycle.d.ts +48 -1
  304. package/dist/daemon-lifecycle.d.ts.map +1 -1
  305. package/dist/daemon-lifecycle.js +57 -2
  306. package/dist/daemon-lifecycle.js.map +1 -1
  307. package/dist/index.d.ts +5 -0
  308. package/dist/index.d.ts.map +1 -1
  309. package/dist/index.js +12 -0
  310. package/dist/index.js.map +1 -1
  311. package/dist/lib/scope/dot-id.d.ts +43 -0
  312. package/dist/lib/scope/dot-id.d.ts.map +1 -0
  313. package/dist/lib/scope/dot-id.js +165 -0
  314. package/dist/lib/scope/dot-id.js.map +1 -0
  315. package/dist/lib/scope/scope-fs.d.ts +79 -0
  316. package/dist/lib/scope/scope-fs.d.ts.map +1 -0
  317. package/dist/lib/scope/scope-fs.js +468 -0
  318. package/dist/lib/scope/scope-fs.js.map +1 -0
  319. package/dist/lib/scope/templates.d.ts +38 -0
  320. package/dist/lib/scope/templates.d.ts.map +1 -0
  321. package/dist/lib/scope/templates.js +109 -0
  322. package/dist/lib/scope/templates.js.map +1 -0
  323. package/dist/lib/scope/types.d.ts +61 -0
  324. package/dist/lib/scope/types.d.ts.map +1 -0
  325. package/dist/lib/scope/types.js +38 -0
  326. package/dist/lib/scope/types.js.map +1 -0
  327. package/dist/lib/scope-templates/backlog-deprecation.md +26 -0
  328. package/dist/lib/scope-templates/backlog-tech-debt.md +22 -0
  329. package/dist/lib/scope-templates/bug-fix.md +30 -0
  330. package/dist/lib/scope-templates/mission-notes.md +97 -0
  331. package/dist/lib/scope-templates/mission-placeholder.md +20 -0
  332. package/dist/lib/scope-templates/mission-release.md +25 -0
  333. package/dist/lib/scope-templates/placeholder.md +30 -0
  334. package/dist/lib/scope-templates/release-feature.md +26 -0
  335. package/dist/lib/scope-templates/research.md +22 -0
  336. package/dist/mcp-server.d.ts.map +1 -1
  337. package/dist/mcp-server.js +29 -0
  338. package/dist/mcp-server.js.map +1 -1
  339. package/dist/release-surface/affected-skills.d.ts +49 -0
  340. package/dist/release-surface/affected-skills.d.ts.map +1 -0
  341. package/dist/release-surface/affected-skills.js +153 -0
  342. package/dist/release-surface/affected-skills.js.map +1 -0
  343. package/dist/release-surface/extract-surface.d.ts +23 -0
  344. package/dist/release-surface/extract-surface.d.ts.map +1 -0
  345. package/dist/release-surface/extract-surface.js +193 -0
  346. package/dist/release-surface/extract-surface.js.map +1 -0
  347. package/dist/release-surface/generate.d.ts +2 -0
  348. package/dist/release-surface/generate.d.ts.map +1 -0
  349. package/dist/release-surface/generate.js +51 -0
  350. package/dist/release-surface/generate.js.map +1 -0
  351. package/dist/release-surface/surface-diff.d.ts +40 -0
  352. package/dist/release-surface/surface-diff.d.ts.map +1 -0
  353. package/dist/release-surface/surface-diff.js +212 -0
  354. package/dist/release-surface/surface-diff.js.map +1 -0
  355. package/package.json +2 -2
  356. package/ui/dist/assets/index-CrJgCmkX.js +552 -0
  357. package/ui/dist/index.html +1 -1
  358. package/ui/dist/assets/index-Rl3ZBrUg.js +0 -547
@@ -1,4 +1,4 @@
1
- import { stringify as stringifyYaml } from "yaml";
1
+ import { RigSpecSchema as PodRigSpecSchema } from "./rigspec-schema.js";
2
2
  /**
3
3
  * Orchestrates live rig expansion by composing PodRigInstantiator.materialize()
4
4
  * for topology persistence and NodeLauncher for launching new nodes.
@@ -14,11 +14,14 @@ export class RigExpansionService {
14
14
  if (!rig) {
15
15
  return { ok: false, code: "rig_not_found", error: `Rig "${request.rigId}" not found` };
16
16
  }
17
- // 2. Build synthetic rig spec YAML for the new pod
17
+ // 2. Build the one-pod spec as a structured OBJECT (OPR.0.3.3.24: no
18
+ // synthetic-spec YAML round-trip). It flows through the materialize
19
+ // structured-front (validate + preflight + persistence core) and the launch
20
+ // core directly.
18
21
  const pod = request.pod;
19
- const syntheticSpec = this.buildSyntheticSpec(rig.rig.name, pod, request.crossPodEdges);
22
+ const specObject = this.buildExpansionSpecObject(rig.rig.name, pod, request.crossPodEdges);
20
23
  // 3. Materialize topology (suppress rig.imported event)
21
- const materializeResult = await this.deps.podInstantiator.materialize(syntheticSpec, request.rigRoot ?? ".", { targetRigId: request.rigId, suppressSummaryEvent: true });
24
+ const materializeResult = await this.deps.podInstantiator.materializeStructured(specObject, request.rigRoot ?? ".", { targetRigId: request.rigId, suppressSummaryEvent: true });
22
25
  if (!materializeResult.ok) {
23
26
  const code = materializeResult.code;
24
27
  const message = "message" in materializeResult
@@ -37,8 +40,9 @@ export class RigExpansionService {
37
40
  .find((id) => id !== null);
38
41
  const podId = newPod ?? "";
39
42
  const podNamespace = pod.id;
40
- // 5. Launch and fully start the newly created nodes via the pod-aware seam
41
- const launchOutcome = await this.deps.podInstantiator.launchMaterialized(syntheticSpec, request.rigRoot ?? ".", request.rigId);
43
+ // 5. Launch and fully start the newly created nodes via the launch core on
44
+ // the structured spec (no YAML round-trip; normalize is pure).
45
+ const launchOutcome = await this.deps.podInstantiator.launchValidatedSpec(PodRigSpecSchema.normalize(specObject), request.rigRoot ?? ".", request.rigId);
42
46
  if (!launchOutcome.ok) {
43
47
  const message = "message" in launchOutcome
44
48
  ? launchOutcome.message
@@ -81,7 +85,7 @@ export class RigExpansionService {
81
85
  retryTargets,
82
86
  };
83
87
  }
84
- buildSyntheticSpec(rigName, pod, crossPodEdges) {
88
+ buildExpansionSpecObject(rigName, pod, crossPodEdges) {
85
89
  const syntheticSpec = {
86
90
  version: "0.2",
87
91
  name: rigName,
@@ -126,9 +130,7 @@ export class RigExpansionService {
126
130
  to: edge.to,
127
131
  })),
128
132
  };
129
- return stringifyYaml(syntheticSpec, {
130
- lineWidth: 0,
131
- });
133
+ return syntheticSpec;
132
134
  }
133
135
  }
134
136
  //# sourceMappingURL=rig-expansion-service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rig-expansion-service.js","sourceRoot":"","sources":["../../src/domain/rig-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G,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iCACnG;6BACF;yBACF,CAAC,CAAC,CAAC,EAAE,CAAC;wBACP,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;4BACtB,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE;yBAC9C,CAAC,CAAC,CAAC,EAAE,CAAC;qBACR,CAAC,CAAC;oBACH,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;wBAC9B,IAAI,EAAE,IAAI,CAAC,IAAI;wBACf,IAAI,EAAE,IAAI,CAAC,IAAI;wBACf,EAAE,EAAE,IAAI,CAAC,EAAE;qBACZ,CAAC,CAAC;iBACJ;aACF;YACD,KAAK,EAAE,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBAC1C,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,EAAE,EAAE,IAAI,CAAC,EAAE;aACZ,CAAC,CAAC;SACJ,CAAC;QAEF,OAAO,aAAa,CAAC;IACvB,CAAC;CACF"}
@@ -0,0 +1,48 @@
1
+ import type { AutonomyScope, ConcurrencyLimit, EscalationThreshold, HeartbeatCadence, InspectionDepth, OperatorContextMode, OperatorContextScope, PermissionPromptPosture, UpdateDetail } from "./rig-policy-types.js";
2
+ /**
3
+ * The seven per-mode setting defaults (Component 3 §Recommended
4
+ * Per-Mode Defaults). Mirrors the convention table verbatim.
5
+ *
6
+ * `scope` is NOT included here — per-mode default scope lives in
7
+ * RECOMMENDED_DEFAULT_SCOPE below, since the convention treats it
8
+ * separately (Component 4 §Recommended Default Scopes Per Mode).
9
+ *
10
+ * `expiry_or_stale_rule` and `evidence_citation` are not part of the
11
+ * 6×7 matrix; the daemon applies a conservative default for the
12
+ * former (`re_confirm_on_long_gap` — convention Q3 leaves the numeric
13
+ * for Mode 2; the rule kind is the v0 conservative choice) and the
14
+ * latter is operator-provided per invocation.
15
+ */
16
+ export interface RecommendedModeDefaults {
17
+ autonomy_scope: AutonomyScope;
18
+ heartbeat_cadence: HeartbeatCadence;
19
+ inspection_depth: InspectionDepth;
20
+ update_detail: UpdateDetail;
21
+ escalation_threshold: EscalationThreshold;
22
+ concurrency_limit: ConcurrencyLimit;
23
+ permission_prompt_posture: PermissionPromptPosture;
24
+ }
25
+ export declare const RECOMMENDED_MODE_DEFAULTS: Record<OperatorContextMode, RecommendedModeDefaults>;
26
+ /**
27
+ * Component 4 — Recommended Default Scopes Per Mode.
28
+ *
29
+ * Used during restate-and-confirm: when the operator's invocation
30
+ * omits an explicit scope, the agent restates with this recommendation
31
+ * and awaits confirmation/correction. The operator's confirmation is
32
+ * authoritative.
33
+ */
34
+ export declare const RECOMMENDED_DEFAULT_SCOPE: Record<OperatorContextMode, OperatorContextScope>;
35
+ /**
36
+ * Conservative default for `expiry_or_stale_rule`. Per convention Q3,
37
+ * the numeric threshold is deferred to a Mode 2 helper slice;
38
+ * `re_confirm_on_long_gap` is the rule kind selected here as the
39
+ * safest default (it prompts re-confirmation rather than silent
40
+ * continuation when the operator has been away for an extended
41
+ * period).
42
+ *
43
+ * Operators may override per-binding via the `expiry_or_stale_rule`
44
+ * field of the OperatorContextModeRecord; v0 does not auto-tune the
45
+ * threshold.
46
+ */
47
+ export declare const DEFAULT_STALE_RULE: "re_confirm_on_long_gap";
48
+ //# sourceMappingURL=rig-policy-defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rig-policy-defaults.d.ts","sourceRoot":"","sources":["../../../src/domain/rig-policy/rig-policy-defaults.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,YAAY,EACb,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,uBAAuB;IACtC,cAAc,EAAE,aAAa,CAAC;IAC9B,iBAAiB,EAAE,gBAAgB,CAAC;IACpC,gBAAgB,EAAE,eAAe,CAAC;IAClC,aAAa,EAAE,YAAY,CAAC;IAC5B,oBAAoB,EAAE,mBAAmB,CAAC;IAC1C,iBAAiB,EAAE,gBAAgB,CAAC;IACpC,yBAAyB,EAAE,uBAAuB,CAAC;CACpD;AAED,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,mBAAmB,EAAE,uBAAuB,CAuD1F,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,mBAAmB,EAAE,oBAAoB,CAOvF,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,EAAE,wBAAmD,CAAC"}
@@ -0,0 +1,96 @@
1
+ // Slice 09 — recommended per-mode defaults + per-mode default scope.
2
+ //
3
+ // Component 3 — Recommended Per-Mode Defaults (the 6×7 matrix).
4
+ // Component 4 — Recommended Default Scopes Per Mode.
5
+ //
6
+ // "RECOMMENDED, operator-overridable per field" — these are the
7
+ // fall-back values the CLI / HTTP set route applies when the operator
8
+ // invokes a bare mode (e.g., `rig policy set debug`) without
9
+ // specifying individual fields. Operator-supplied per-field overrides
10
+ // merge over the defaults.
11
+ export const RECOMMENDED_MODE_DEFAULTS = {
12
+ sleep: {
13
+ autonomy_scope: "pre_approved_only",
14
+ heartbeat_cadence: "sparse",
15
+ inspection_depth: "normal",
16
+ update_detail: "compact",
17
+ escalation_threshold: "blocker_only",
18
+ concurrency_limit: "serial",
19
+ permission_prompt_posture: "batch_for_human",
20
+ },
21
+ desk: {
22
+ autonomy_scope: "full_autonomy_within_workstream",
23
+ heartbeat_cadence: "normal",
24
+ inspection_depth: "normal",
25
+ update_detail: "normal",
26
+ escalation_threshold: "normal",
27
+ concurrency_limit: "unlimited", // "normal" in the convention table; v0 maps "normal" concurrency to unlimited (the existing OpenRig default — agents fan out per workstream-mode discipline)
28
+ permission_prompt_posture: "normal",
29
+ },
30
+ mobile: {
31
+ autonomy_scope: "bounded_continuation",
32
+ heartbeat_cadence: "normal",
33
+ inspection_depth: "surface",
34
+ update_detail: "compact",
35
+ escalation_threshold: "low",
36
+ concurrency_limit: "unlimited",
37
+ permission_prompt_posture: "batch_for_human",
38
+ },
39
+ away: {
40
+ autonomy_scope: "pre_approved_only",
41
+ heartbeat_cadence: "sparse",
42
+ inspection_depth: "normal",
43
+ update_detail: "compact",
44
+ escalation_threshold: "blocker_only",
45
+ concurrency_limit: "serial",
46
+ permission_prompt_posture: "batch_for_human",
47
+ },
48
+ focus: {
49
+ autonomy_scope: "full_autonomy_within_workstream",
50
+ heartbeat_cadence: "normal",
51
+ inspection_depth: "normal",
52
+ update_detail: "compact",
53
+ escalation_threshold: "blocker_only",
54
+ concurrency_limit: "unlimited",
55
+ permission_prompt_posture: "batch_for_human",
56
+ },
57
+ debug: {
58
+ autonomy_scope: "bounded_continuation",
59
+ heartbeat_cadence: "fast",
60
+ inspection_depth: "forensic",
61
+ update_detail: "verbose",
62
+ escalation_threshold: "low",
63
+ concurrency_limit: "serial",
64
+ permission_prompt_posture: "normal",
65
+ },
66
+ };
67
+ /**
68
+ * Component 4 — Recommended Default Scopes Per Mode.
69
+ *
70
+ * Used during restate-and-confirm: when the operator's invocation
71
+ * omits an explicit scope, the agent restates with this recommendation
72
+ * and awaits confirmation/correction. The operator's confirmation is
73
+ * authoritative.
74
+ */
75
+ export const RECOMMENDED_DEFAULT_SCOPE = {
76
+ sleep: "global_host",
77
+ away: "global_host",
78
+ desk: "global_host",
79
+ mobile: "global_host",
80
+ focus: "workstream",
81
+ debug: "qitem",
82
+ };
83
+ /**
84
+ * Conservative default for `expiry_or_stale_rule`. Per convention Q3,
85
+ * the numeric threshold is deferred to a Mode 2 helper slice;
86
+ * `re_confirm_on_long_gap` is the rule kind selected here as the
87
+ * safest default (it prompts re-confirmation rather than silent
88
+ * continuation when the operator has been away for an extended
89
+ * period).
90
+ *
91
+ * Operators may override per-binding via the `expiry_or_stale_rule`
92
+ * field of the OperatorContextModeRecord; v0 does not auto-tune the
93
+ * threshold.
94
+ */
95
+ export const DEFAULT_STALE_RULE = "re_confirm_on_long_gap";
96
+ //# sourceMappingURL=rig-policy-defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rig-policy-defaults.js","sourceRoot":"","sources":["../../../src/domain/rig-policy/rig-policy-defaults.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,EAAE;AACF,gEAAgE;AAChE,qDAAqD;AACrD,EAAE;AACF,gEAAgE;AAChE,sEAAsE;AACtE,6DAA6D;AAC7D,sEAAsE;AACtE,2BAA2B;AAsC3B,MAAM,CAAC,MAAM,yBAAyB,GAAyD;IAC7F,KAAK,EAAE;QACL,cAAc,EAAE,mBAAmB;QACnC,iBAAiB,EAAE,QAAQ;QAC3B,gBAAgB,EAAE,QAAQ;QAC1B,aAAa,EAAE,SAAS;QACxB,oBAAoB,EAAE,cAAc;QACpC,iBAAiB,EAAE,QAAQ;QAC3B,yBAAyB,EAAE,iBAAiB;KAC7C;IACD,IAAI,EAAE;QACJ,cAAc,EAAE,iCAAiC;QACjD,iBAAiB,EAAE,QAAQ;QAC3B,gBAAgB,EAAE,QAAQ;QAC1B,aAAa,EAAE,QAAQ;QACvB,oBAAoB,EAAE,QAAQ;QAC9B,iBAAiB,EAAE,WAAW,EAAE,6JAA6J;QAC7L,yBAAyB,EAAE,QAAQ;KACpC;IACD,MAAM,EAAE;QACN,cAAc,EAAE,sBAAsB;QACtC,iBAAiB,EAAE,QAAQ;QAC3B,gBAAgB,EAAE,SAAS;QAC3B,aAAa,EAAE,SAAS;QACxB,oBAAoB,EAAE,KAAK;QAC3B,iBAAiB,EAAE,WAAW;QAC9B,yBAAyB,EAAE,iBAAiB;KAC7C;IACD,IAAI,EAAE;QACJ,cAAc,EAAE,mBAAmB;QACnC,iBAAiB,EAAE,QAAQ;QAC3B,gBAAgB,EAAE,QAAQ;QAC1B,aAAa,EAAE,SAAS;QACxB,oBAAoB,EAAE,cAAc;QACpC,iBAAiB,EAAE,QAAQ;QAC3B,yBAAyB,EAAE,iBAAiB;KAC7C;IACD,KAAK,EAAE;QACL,cAAc,EAAE,iCAAiC;QACjD,iBAAiB,EAAE,QAAQ;QAC3B,gBAAgB,EAAE,QAAQ;QAC1B,aAAa,EAAE,SAAS;QACxB,oBAAoB,EAAE,cAAc;QACpC,iBAAiB,EAAE,WAAW;QAC9B,yBAAyB,EAAE,iBAAiB;KAC7C;IACD,KAAK,EAAE;QACL,cAAc,EAAE,sBAAsB;QACtC,iBAAiB,EAAE,MAAM;QACzB,gBAAgB,EAAE,UAAU;QAC5B,aAAa,EAAE,SAAS;QACxB,oBAAoB,EAAE,KAAK;QAC3B,iBAAiB,EAAE,QAAQ;QAC3B,yBAAyB,EAAE,QAAQ;KACpC;CACF,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAsD;IAC1F,KAAK,EAAE,aAAa;IACpB,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,aAAa;IACnB,MAAM,EAAE,aAAa;IACrB,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,OAAO;CACf,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA6B,wBAAwB,CAAC"}
@@ -0,0 +1,46 @@
1
+ import type Database from "better-sqlite3";
2
+ import { type EffectiveOperatorContextMode, type OperatorContextModeBinding, type OperatorContextReadContext, type OperatorContextScope } from "./rig-policy-types.js";
3
+ export interface SetBindingResult {
4
+ ok: true;
5
+ binding: OperatorContextModeBinding;
6
+ }
7
+ export interface SetBindingError {
8
+ ok: false;
9
+ errors: string[];
10
+ }
11
+ export interface RigPolicyStoreOpts {
12
+ /** Override the clock for tests; defaults to new Date(). */
13
+ now?: () => Date;
14
+ }
15
+ export declare class RigPolicyStore {
16
+ private readonly db;
17
+ private readonly now;
18
+ constructor(db: Database.Database, opts?: RigPolicyStoreOpts);
19
+ /**
20
+ * Operator-only set. Validates the candidate record + the
21
+ * scope/qualifier shape, then upserts. Returns the typed binding
22
+ * on success.
23
+ *
24
+ * scope == 'global_host' REQUIRES qualifier === null;
25
+ * scope != 'global_host' REQUIRES a non-empty qualifier string.
26
+ * Both are operator/host invariants — the route validates and
27
+ * the store rejects on disagreement.
28
+ */
29
+ setBinding(scope: OperatorContextScope, qualifier: string | null, mode: unknown, candidateRecord: unknown): SetBindingResult | SetBindingError;
30
+ getBinding(scope: OperatorContextScope, qualifier: string | null): OperatorContextModeBinding | null;
31
+ listBindings(): OperatorContextModeBinding[];
32
+ deleteBinding(scope: OperatorContextScope, qualifier: string | null): boolean;
33
+ /**
34
+ * Resolve the most-specific applicable binding for a read context.
35
+ * Returns null when no binding matches — callers MUST treat null as
36
+ * `unknown_posture` per convention §Q6 (do NOT default to `desk`).
37
+ *
38
+ * Specificity ranks (qitem > workstream > rig > global_host) are
39
+ * defined in rig-policy-types.SCOPE_SPECIFICITY. For each scope the
40
+ * resolver picks the binding whose qualifier matches the read
41
+ * context. Among multiple matching bindings, the most-specific
42
+ * scope wins.
43
+ */
44
+ resolveEffective(ctx: OperatorContextReadContext): EffectiveOperatorContextMode | null;
45
+ }
46
+ //# sourceMappingURL=rig-policy-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rig-policy-store.d.ts","sourceRoot":"","sources":["../../../src/domain/rig-policy/rig-policy-store.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EACL,KAAK,4BAA4B,EAEjC,KAAK,0BAA0B,EAE/B,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EAE1B,MAAM,uBAAuB,CAAC;AA4B/B,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,IAAI,CAAC;IACT,OAAO,EAAE,0BAA0B,CAAC;CACrC;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,4DAA4D;IAC5D,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAoB;IACvC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAa;gBAErB,EAAE,EAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,kBAAkB;IAK5D;;;;;;;;;OASG;IACH,UAAU,CACR,KAAK,EAAE,oBAAoB,EAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,IAAI,EAAE,OAAO,EACb,eAAe,EAAE,OAAO,GACvB,gBAAgB,GAAG,eAAe;IAsDrC,UAAU,CACR,KAAK,EAAE,oBAAoB,EAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,GACvB,0BAA0B,GAAG,IAAI;IASpC,YAAY,IAAI,0BAA0B,EAAE;IAS5C,aAAa,CAAC,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO;IAO7E;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,GAAG,EAAE,0BAA0B,GAAG,4BAA4B,GAAG,IAAI;CA4BvF"}
@@ -0,0 +1,171 @@
1
+ // Slice 09 — daemon-persisted typed primitive (SQLite-backed).
2
+ //
3
+ // Follows the workspace-primitive precedent: structured table,
4
+ // JSON column for the 10-field record (validator owns integrity at
5
+ // write time). NO parallel/forked store (HG-5).
6
+ //
7
+ // The store exposes:
8
+ // - setBinding(scope, qualifier, mode, record) → upserts a row
9
+ // (mode is binding-level
10
+ // Component-2 identity;
11
+ // record is the frozen
12
+ // 10-field Component-3
13
+ // settings)
14
+ // - getBinding(scope, qualifier) → reads one row
15
+ // - listBindings() → all rows (for show)
16
+ // - resolveEffective(readContext) → most-specific binding
17
+ // - deleteBinding(scope, qualifier) → unset
18
+ //
19
+ // Update authority is operator-only: setBinding hard-codes
20
+ // `set_by = 'operator'`. The HTTP route + CLI are the only authoring
21
+ // surfaces; agent code paths read but never write. (HG-4)
22
+ //
23
+ // HG-SAFE preserved here: this store NEVER writes to permission
24
+ // allowlists / runtime configs / auth / tmux / lifecycle. It writes
25
+ // to ONE table (operator_context_mode_bindings) and reads JSON. A
26
+ // future contributor cannot widen permission authority via this
27
+ // service because the surface area is the bindings table only.
28
+ import { SCOPE_SPECIFICITY, } from "./rig-policy-types.js";
29
+ import { validateModeName, validateRecord } from "./rig-policy-validator.js";
30
+ function rowToBinding(row) {
31
+ return {
32
+ id: row.id,
33
+ mode: row.mode,
34
+ record: JSON.parse(row.record_json),
35
+ qualifier: row.qualifier,
36
+ setAt: row.set_at,
37
+ setBy: "operator",
38
+ };
39
+ }
40
+ function bindingId(scope, qualifier) {
41
+ return `${scope}:${qualifier ?? "host"}`;
42
+ }
43
+ export class RigPolicyStore {
44
+ db;
45
+ now;
46
+ constructor(db, opts) {
47
+ this.db = db;
48
+ this.now = opts?.now ?? (() => new Date());
49
+ }
50
+ /**
51
+ * Operator-only set. Validates the candidate record + the
52
+ * scope/qualifier shape, then upserts. Returns the typed binding
53
+ * on success.
54
+ *
55
+ * scope == 'global_host' REQUIRES qualifier === null;
56
+ * scope != 'global_host' REQUIRES a non-empty qualifier string.
57
+ * Both are operator/host invariants — the route validates and
58
+ * the store rejects on disagreement.
59
+ */
60
+ setBinding(scope, qualifier, mode, candidateRecord) {
61
+ const errors = [];
62
+ if (scope === "global_host" && qualifier !== null) {
63
+ errors.push(`Global-host bindings cannot carry a qualifier (got ${JSON.stringify(qualifier)}). Pass null for the global_host scope.`);
64
+ }
65
+ if (scope !== "global_host" && (typeof qualifier !== "string" || qualifier.length === 0)) {
66
+ errors.push(`${scope} bindings require a qualifier (rigId / workstreamId / qitemId). Got ${JSON.stringify(qualifier)}.`);
67
+ }
68
+ const modeCheck = validateModeName(mode);
69
+ if (!modeCheck.ok)
70
+ errors.push(modeCheck.error);
71
+ const validation = validateRecord(candidateRecord);
72
+ if (!validation.ok)
73
+ errors.push(...validation.errors);
74
+ if (errors.length > 0 || !modeCheck.ok || !validation.ok) {
75
+ return { ok: false, errors };
76
+ }
77
+ const record = validation.record;
78
+ if (record.scope !== scope) {
79
+ return {
80
+ ok: false,
81
+ errors: [
82
+ `Record scope mismatch: binding scope is "${scope}" but record.scope is "${record.scope}". The record's scope field MUST agree with the binding scope.`,
83
+ ],
84
+ };
85
+ }
86
+ const id = bindingId(scope, qualifier);
87
+ const setAt = this.now().toISOString();
88
+ this.db.prepare(`
89
+ INSERT INTO operator_context_mode_bindings (id, scope, qualifier, mode, record_json, set_at, set_by)
90
+ VALUES (?, ?, ?, ?, ?, ?, 'operator')
91
+ ON CONFLICT(id) DO UPDATE SET
92
+ mode = excluded.mode,
93
+ record_json = excluded.record_json,
94
+ set_at = excluded.set_at
95
+ `).run(id, scope, qualifier, modeCheck.mode, JSON.stringify(record), setAt);
96
+ return {
97
+ ok: true,
98
+ binding: {
99
+ id,
100
+ mode: modeCheck.mode,
101
+ record,
102
+ qualifier,
103
+ setAt,
104
+ setBy: "operator",
105
+ },
106
+ };
107
+ }
108
+ getBinding(scope, qualifier) {
109
+ const row = this.db.prepare(`
110
+ SELECT id, scope, qualifier, mode, record_json, set_at, set_by
111
+ FROM operator_context_mode_bindings
112
+ WHERE id = ?
113
+ `).get(bindingId(scope, qualifier));
114
+ return row ? rowToBinding(row) : null;
115
+ }
116
+ listBindings() {
117
+ const rows = this.db.prepare(`
118
+ SELECT id, scope, qualifier, mode, record_json, set_at, set_by
119
+ FROM operator_context_mode_bindings
120
+ ORDER BY scope, qualifier NULLS FIRST, id
121
+ `).all();
122
+ return rows.map(rowToBinding);
123
+ }
124
+ deleteBinding(scope, qualifier) {
125
+ const info = this.db.prepare(`
126
+ DELETE FROM operator_context_mode_bindings WHERE id = ?
127
+ `).run(bindingId(scope, qualifier));
128
+ return info.changes > 0;
129
+ }
130
+ /**
131
+ * Resolve the most-specific applicable binding for a read context.
132
+ * Returns null when no binding matches — callers MUST treat null as
133
+ * `unknown_posture` per convention §Q6 (do NOT default to `desk`).
134
+ *
135
+ * Specificity ranks (qitem > workstream > rig > global_host) are
136
+ * defined in rig-policy-types.SCOPE_SPECIFICITY. For each scope the
137
+ * resolver picks the binding whose qualifier matches the read
138
+ * context. Among multiple matching bindings, the most-specific
139
+ * scope wins.
140
+ */
141
+ resolveEffective(ctx) {
142
+ const candidates = [];
143
+ if (ctx.qitemId) {
144
+ const b = this.getBinding("qitem", ctx.qitemId);
145
+ if (b)
146
+ candidates.push(b);
147
+ }
148
+ if (ctx.workstreamId) {
149
+ const b = this.getBinding("workstream", ctx.workstreamId);
150
+ if (b)
151
+ candidates.push(b);
152
+ }
153
+ if (ctx.rigId) {
154
+ const b = this.getBinding("rig", ctx.rigId);
155
+ if (b)
156
+ candidates.push(b);
157
+ }
158
+ const host = this.getBinding("global_host", null);
159
+ if (host)
160
+ candidates.push(host);
161
+ if (candidates.length === 0)
162
+ return null;
163
+ candidates.sort((a, b) => SCOPE_SPECIFICITY[b.record.scope] - SCOPE_SPECIFICITY[a.record.scope]);
164
+ const winner = candidates[0];
165
+ return {
166
+ binding: winner,
167
+ resolvedScope: winner.record.scope,
168
+ };
169
+ }
170
+ }
171
+ //# sourceMappingURL=rig-policy-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rig-policy-store.js","sourceRoot":"","sources":["../../../src/domain/rig-policy/rig-policy-store.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,EAAE;AACF,+DAA+D;AAC/D,mEAAmE;AACnE,gDAAgD;AAChD,EAAE;AACF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six reserved mode names. Lowercase single English
3
+ * words; synonyms and numeric aliases (`L0`–`L3`, `operator:L<n>`)
4
+ * are explicitly forbidden by the convention. The L0–L3 collision
5
+ * warning at `conventions/operator-context-mode-system/README.md`
6
+ * §"L0–L3 Collision Warning" is load-bearing.
7
+ */
8
+ export type OperatorContextMode = "sleep" | "desk" | "mobile" | "away" | "focus" | "debug";
9
+ export declare const OPERATOR_CONTEXT_MODES: readonly ["sleep", "desk", "mobile", "away", "focus", "debug"];
10
+ /**
11
+ * Component 4 — four scopes. More-specific overrides less-specific
12
+ * when multiple modes coexist (Scope hierarchy: qitem > workstream >
13
+ * rig > global_host).
14
+ */
15
+ export type OperatorContextScope = "global_host" | "rig" | "workstream" | "qitem";
16
+ export declare const OPERATOR_CONTEXT_SCOPES: readonly ["global_host", "rig", "workstream", "qitem"];
17
+ /**
18
+ * Scope specificity ranks; higher number = more specific. Used by the
19
+ * store's effective-mode resolver. NOT operator-facing.
20
+ */
21
+ export declare const SCOPE_SPECIFICITY: Record<OperatorContextScope, number>;
22
+ export type AutonomyScope = "pre_approved_only" | "bounded_continuation" | "full_autonomy_within_workstream" | "full_autonomy";
23
+ export type HeartbeatCadence = "sparse" | "normal" | "fast";
24
+ export type InspectionDepth = "surface" | "normal" | "forensic";
25
+ export type UpdateDetail = "compact" | "normal" | "verbose";
26
+ export type EscalationThreshold = "low" | "normal" | "high" | "blocker_only";
27
+ /**
28
+ * Component 3 — concurrency_limit. Suggested values include the enum
29
+ * forms below + structured integer values (1..N). v0 ships the enum
30
+ * subset for simplicity; an integer specialization can graduate via
31
+ * Mode 1.5 amendment when fixture-backed evidence appears.
32
+ */
33
+ export type ConcurrencyLimit = "serial" | "2" | "4" | "unlimited";
34
+ /**
35
+ * Component 6 — Safety Policy load-bearing rule:
36
+ * `permission_prompt_posture` MUST NOT include auto-accept in v0 or
37
+ * any descendant. The safe values are exactly these three.
38
+ *
39
+ * The enum is STRUCTURALLY closed: no auto-accept literal exists in
40
+ * the union. A contributor cannot "set permissionPromptPosture =
41
+ * 'auto_accept'" because the literal isn't a member; TypeScript
42
+ * rejects at compile time. The validator additionally rejects any
43
+ * non-member string at runtime (defense-in-depth for inputs that
44
+ * bypass typing — JSON file, env var, etc).
45
+ *
46
+ * If a future amendment proposes auto-accept, it MUST first amend
47
+ * the permission-posture canon at
48
+ * `conventions/permission-posture/README.md` AND the FROZEN
49
+ * operator-context-mode safety policy. This slice and its
50
+ * descendants reject auto-accept independently of any caller intent.
51
+ */
52
+ export type PermissionPromptPosture = "normal" | "batch_for_human" | "do_not_prompt_unless_blocked";
53
+ export declare const SAFE_PERMISSION_PROMPT_POSTURES: readonly ["normal", "batch_for_human", "do_not_prompt_unless_blocked"];
54
+ /**
55
+ * Component 4 — citation source. Free-text in v0 (operator may cite
56
+ * `current-mode.md`, a qitem id, a chatroom topic, or a convention-only
57
+ * declaration). Structured citations are a Mode 1.5 amendment per
58
+ * the convention.
59
+ */
60
+ export type EvidenceCitation = string;
61
+ /**
62
+ * Component 4 — expiry_or_stale_rule. v0 declares the field with a
63
+ * conservative default ("re_confirm_on_long_gap"); the numeric
64
+ * threshold is deferred per convention Q3 to a Mode 2 helper slice.
65
+ * The rule values below enumerate the supported re-confirmation
66
+ * triggers. NO silent-switch value exists — drift is always a
67
+ * question, never an auto-mode-change.
68
+ */
69
+ export type ExpiryOrStaleRule = "none" | "re_confirm_on_long_gap" | "re_confirm_on_day_boundary" | "re_confirm_on_observed_conflict";
70
+ export declare const STALE_RULES: readonly ["none", "re_confirm_on_long_gap", "re_confirm_on_day_boundary", "re_confirm_on_observed_conflict"];
71
+ /**
72
+ * Component 3 — the 10-field SETTINGS schema. ALL fields are required
73
+ * by the validator; none may be merged or dropped. Reviewer field-set
74
+ * integrity check (HG-2).
75
+ *
76
+ * **`mode` is NOT in this record.** Mode is the binding's identity
77
+ * (Component 2 — the name of the named bundle); the record parameterizes
78
+ * how that named mode shapes ergonomics. The binding wrapper
79
+ * (OperatorContextModeBinding) carries `mode` at the top level so the
80
+ * frozen 10-field settings record stays exactly 10 fields, as declared
81
+ * by the convention's §Component 3 table.
82
+ */
83
+ export interface OperatorContextModeRecord {
84
+ autonomy_scope: AutonomyScope;
85
+ heartbeat_cadence: HeartbeatCadence;
86
+ inspection_depth: InspectionDepth;
87
+ update_detail: UpdateDetail;
88
+ escalation_threshold: EscalationThreshold;
89
+ concurrency_limit: ConcurrencyLimit;
90
+ permission_prompt_posture: PermissionPromptPosture;
91
+ scope: OperatorContextScope;
92
+ expiry_or_stale_rule: ExpiryOrStaleRule;
93
+ evidence_citation: EvidenceCitation;
94
+ }
95
+ /**
96
+ * A scoped binding of a mode to a target context. The store keys rows
97
+ * by (scope, qualifier) so the same scope can hold many bindings
98
+ * (e.g., multiple rig-scoped modes), and the effective-mode resolver
99
+ * picks the right one for the (rig, workstream, qitem) read context.
100
+ *
101
+ * - `global_host` bindings have a null qualifier.
102
+ * - `rig` bindings carry the rig id as qualifier.
103
+ * - `workstream` bindings carry the workstream id as qualifier.
104
+ * - `qitem` bindings carry the qitem id as qualifier.
105
+ */
106
+ export interface OperatorContextModeBinding {
107
+ /** Stable identifier — `${scope}:${qualifier ?? "host"}` v0. */
108
+ id: string;
109
+ /** Component 2 — the named mode this binding selects. Lives at the
110
+ * binding (not in the 10-field settings record) so the frozen
111
+ * Component-3 record stays exactly 10 fields. */
112
+ mode: OperatorContextMode;
113
+ record: OperatorContextModeRecord;
114
+ /** Qualifier value (rigId, workstreamId, qitemId) — null when scope is global_host. */
115
+ qualifier: string | null;
116
+ /** ISO timestamp of last set. Used by drift-rule consumers. */
117
+ setAt: string;
118
+ /** Who set it. Operator-only by contract — see update authority. */
119
+ setBy: "operator";
120
+ }
121
+ /**
122
+ * The effective-mode read result. The resolver returns the most
123
+ * specific binding for a (rig?, workstream?, qitem?) context, or
124
+ * `null` when no binding exists at any matching scope.
125
+ *
126
+ * Per convention §"Q6 — Absent mode is unknown_posture, NOT desk":
127
+ * callers MUST treat a null effective mode as `unknown_posture` and
128
+ * re-confirm to a real mode explicitly. The resolver does NOT default
129
+ * to `desk` and never invents a binding.
130
+ */
131
+ export interface EffectiveOperatorContextMode {
132
+ binding: OperatorContextModeBinding;
133
+ /** Why this binding won (which scope; for debug + UI surfacing). */
134
+ resolvedScope: OperatorContextScope;
135
+ }
136
+ /**
137
+ * Read context for the resolver. All fields optional; the resolver
138
+ * picks the most-specific applicable binding.
139
+ */
140
+ export interface OperatorContextReadContext {
141
+ rigId?: string;
142
+ workstreamId?: string;
143
+ qitemId?: string;
144
+ }
145
+ //# sourceMappingURL=rig-policy-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rig-policy-types.d.ts","sourceRoot":"","sources":["../../../src/domain/rig-policy/rig-policy-types.ts"],"names":[],"mappings":"AAiBA;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAE3F,eAAO,MAAM,sBAAsB,gEAOgB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG,KAAK,GAAG,YAAY,GAAG,OAAO,CAAC;AAElF,eAAO,MAAM,uBAAuB,wDAKgB,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAKlE,CAAC;AAIF,MAAM,MAAM,aAAa,GACrB,mBAAmB,GACnB,sBAAsB,GACtB,iCAAiC,GACjC,eAAe,CAAC;AAEpB,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE5D,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEhE,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE5D,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,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