@openrig/cli 0.5.8 → 0.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (781) hide show
  1. package/daemon/assets/claude-statusline-context.cjs +1 -0
  2. package/daemon/assets/plugins/openrig-core/README.md +1 -1
  3. package/daemon/assets/plugins/openrig-core/skills/agent-operated-software/SKILL.md +92 -0
  4. package/daemon/assets/plugins/openrig-core/skills/agent-operated-workflows/SKILL.md +79 -0
  5. package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +2 -2
  6. package/daemon/assets/plugins/openrig-core/skills/openrig-skills/SKILL.md +4 -2
  7. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +12 -16
  8. package/daemon/assets/plugins/openrig-core/skills/software-for-agents/SKILL.md +11 -179
  9. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  10. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +63 -19
  11. package/daemon/context-packs/skills/agent-operated-software/SKILL.md +92 -0
  12. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +10 -0
  13. package/daemon/context-packs/skills/agent-operated-workflows/SKILL.md +79 -0
  14. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +10 -0
  15. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  16. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  17. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  18. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  19. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  20. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  21. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  22. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  23. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  24. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  25. package/daemon/context-packs/skills/core/openrig-skills/SKILL.md +4 -2
  26. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  27. package/daemon/context-packs/skills/core/openrig-upgrade/SKILL.md +81 -0
  28. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +3 -1
  29. package/daemon/context-packs/skills/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs +1419 -0
  30. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  31. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  33. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  34. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  35. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  36. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  37. package/daemon/context-packs/skills/forming-an-openrig-mental-model/SKILL.md +2 -2
  38. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  40. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/openrig-user/SKILL.md +12 -16
  43. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  46. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  53. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  54. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  56. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  66. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  68. package/daemon/context-packs/skills/software-for-agents/SKILL.md +11 -179
  69. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +3 -3
  70. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  71. package/daemon/context-packs/world-example/your-world.md +1 -1
  72. package/daemon/context-packs/world-public/build-your-world.md +19 -0
  73. package/daemon/context-packs/world-public/claims.yaml +5 -1
  74. package/daemon/context-packs/world-public/manifest.yaml +40 -1
  75. package/daemon/context-packs/world-public/verify-world.sh +25 -9
  76. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  77. package/daemon/dist/adapters/claude-code-adapter.js +4 -2
  78. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  79. package/daemon/dist/build-info.js +3 -3
  80. package/daemon/dist/db/all-migrations.d.ts +1 -1
  81. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  82. package/daemon/dist/db/all-migrations.js +3 -1
  83. package/daemon/dist/db/all-migrations.js.map +1 -1
  84. package/daemon/dist/db/migrations/046_seat_identity_verdicts.d.ts +8 -5
  85. package/daemon/dist/db/migrations/046_seat_identity_verdicts.d.ts.map +1 -1
  86. package/daemon/dist/db/migrations/046_seat_identity_verdicts.js +8 -5
  87. package/daemon/dist/db/migrations/046_seat_identity_verdicts.js.map +1 -1
  88. package/daemon/dist/db/migrations/079_workflow_lifecycle_parallel.d.ts +8 -0
  89. package/daemon/dist/db/migrations/079_workflow_lifecycle_parallel.d.ts.map +1 -0
  90. package/daemon/dist/db/migrations/079_workflow_lifecycle_parallel.js +50 -0
  91. package/daemon/dist/db/migrations/079_workflow_lifecycle_parallel.js.map +1 -0
  92. package/daemon/dist/domain/active-occupant.d.ts +6 -1
  93. package/daemon/dist/domain/active-occupant.d.ts.map +1 -1
  94. package/daemon/dist/domain/active-occupant.js +47 -0
  95. package/daemon/dist/domain/active-occupant.js.map +1 -1
  96. package/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
  97. package/daemon/dist/domain/bootstrap-orchestrator.js +8 -1
  98. package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
  99. package/daemon/dist/domain/bundle-context-packs-router.d.ts +3 -3
  100. package/daemon/dist/domain/bundle-context-packs-router.d.ts.map +1 -1
  101. package/daemon/dist/domain/bundle-skills-router.d.ts +3 -0
  102. package/daemon/dist/domain/bundle-skills-router.d.ts.map +1 -1
  103. package/daemon/dist/domain/bundle-skills-router.js +5 -1
  104. package/daemon/dist/domain/bundle-skills-router.js.map +1 -1
  105. package/daemon/dist/domain/claim-service.d.ts +2 -0
  106. package/daemon/dist/domain/claim-service.d.ts.map +1 -1
  107. package/daemon/dist/domain/claim-service.js +33 -12
  108. package/daemon/dist/domain/claim-service.js.map +1 -1
  109. package/daemon/dist/domain/context-packs/context-pack-library-service.d.ts.map +1 -1
  110. package/daemon/dist/domain/context-packs/context-pack-library-service.js +9 -1
  111. package/daemon/dist/domain/context-packs/context-pack-library-service.js.map +1 -1
  112. package/daemon/dist/domain/context-packs/context-pack-types.d.ts +25 -0
  113. package/daemon/dist/domain/context-packs/context-pack-types.d.ts.map +1 -1
  114. package/daemon/dist/domain/context-packs/context-pack-types.js +3 -1
  115. package/daemon/dist/domain/context-packs/context-pack-types.js.map +1 -1
  116. package/daemon/dist/domain/context-packs/manifest-parser.d.ts.map +1 -1
  117. package/daemon/dist/domain/context-packs/manifest-parser.js +143 -3
  118. package/daemon/dist/domain/context-packs/manifest-parser.js.map +1 -1
  119. package/daemon/dist/domain/context-packs/profile-composer.d.ts +22 -1
  120. package/daemon/dist/domain/context-packs/profile-composer.d.ts.map +1 -1
  121. package/daemon/dist/domain/context-packs/profile-composer.js +105 -40
  122. package/daemon/dist/domain/context-packs/profile-composer.js.map +1 -1
  123. package/daemon/dist/domain/context-usage-store.d.ts +4 -0
  124. package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
  125. package/daemon/dist/domain/context-usage-store.js +8 -4
  126. package/daemon/dist/domain/context-usage-store.js.map +1 -1
  127. package/daemon/dist/domain/crash-cart-conductor.d.ts +13 -0
  128. package/daemon/dist/domain/crash-cart-conductor.d.ts.map +1 -1
  129. package/daemon/dist/domain/crash-cart-conductor.js +3 -1
  130. package/daemon/dist/domain/crash-cart-conductor.js.map +1 -1
  131. package/daemon/dist/domain/execution-view.d.ts.map +1 -1
  132. package/daemon/dist/domain/execution-view.js +145 -16
  133. package/daemon/dist/domain/execution-view.js.map +1 -1
  134. package/daemon/dist/domain/instance-initialization.d.ts +25 -0
  135. package/daemon/dist/domain/instance-initialization.d.ts.map +1 -0
  136. package/daemon/dist/domain/instance-initialization.js +81 -0
  137. package/daemon/dist/domain/instance-initialization.js.map +1 -0
  138. package/daemon/dist/domain/lifecycle-manifest.d.ts +19 -0
  139. package/daemon/dist/domain/lifecycle-manifest.d.ts.map +1 -0
  140. package/daemon/dist/domain/lifecycle-manifest.js +73 -0
  141. package/daemon/dist/domain/lifecycle-manifest.js.map +1 -0
  142. package/daemon/dist/domain/model-divergence/current-generation-record.d.ts +36 -36
  143. package/daemon/dist/domain/model-divergence/current-generation-record.d.ts.map +1 -1
  144. package/daemon/dist/domain/model-divergence/current-generation-record.js +104 -135
  145. package/daemon/dist/domain/model-divergence/current-generation-record.js.map +1 -1
  146. package/daemon/dist/domain/native-process-lineage.d.ts +10 -0
  147. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -0
  148. package/daemon/dist/domain/native-process-lineage.js +86 -0
  149. package/daemon/dist/domain/native-process-lineage.js.map +1 -0
  150. package/daemon/dist/domain/native-resume-probe.js +12 -1
  151. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  152. package/daemon/dist/domain/node-inventory.d.ts +2 -0
  153. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  154. package/daemon/dist/domain/node-inventory.js +3 -1
  155. package/daemon/dist/domain/node-inventory.js.map +1 -1
  156. package/daemon/dist/domain/node-launcher.d.ts +3 -0
  157. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  158. package/daemon/dist/domain/node-launcher.js +21 -8
  159. package/daemon/dist/domain/node-launcher.js.map +1 -1
  160. package/daemon/dist/domain/pane-binding-observation.d.ts +22 -0
  161. package/daemon/dist/domain/pane-binding-observation.d.ts.map +1 -0
  162. package/daemon/dist/domain/pane-binding-observation.js +54 -0
  163. package/daemon/dist/domain/pane-binding-observation.js.map +1 -0
  164. package/daemon/dist/domain/policies/parked-owner-consumer.js +1 -1
  165. package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
  166. package/daemon/dist/domain/policies/workflow-keepalive.d.ts.map +1 -1
  167. package/daemon/dist/domain/policies/workflow-keepalive.js +16 -2
  168. package/daemon/dist/domain/policies/workflow-keepalive.js.map +1 -1
  169. package/daemon/dist/domain/profile-resolver.d.ts +12 -0
  170. package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
  171. package/daemon/dist/domain/profile-resolver.js +60 -0
  172. package/daemon/dist/domain/profile-resolver.js.map +1 -1
  173. package/daemon/dist/domain/project-lifecycle-compiler.d.ts +35 -0
  174. package/daemon/dist/domain/project-lifecycle-compiler.d.ts.map +1 -0
  175. package/daemon/dist/domain/project-lifecycle-compiler.js +190 -0
  176. package/daemon/dist/domain/project-lifecycle-compiler.js.map +1 -0
  177. package/daemon/dist/domain/provider/claude-usage-reader.d.ts +1 -1
  178. package/daemon/dist/domain/provider/claude-usage-reader.d.ts.map +1 -1
  179. package/daemon/dist/domain/provider/claude-usage-reader.js +28 -18
  180. package/daemon/dist/domain/provider/claude-usage-reader.js.map +1 -1
  181. package/daemon/dist/domain/queue-repository.d.ts +5 -1
  182. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  183. package/daemon/dist/domain/queue-repository.js +6 -0
  184. package/daemon/dist/domain/queue-repository.js.map +1 -1
  185. package/daemon/dist/domain/queue-retention.d.ts +3 -4
  186. package/daemon/dist/domain/queue-retention.d.ts.map +1 -1
  187. package/daemon/dist/domain/queue-retention.js +5 -8
  188. package/daemon/dist/domain/queue-retention.js.map +1 -1
  189. package/daemon/dist/domain/queue-transition-log.d.ts +28 -0
  190. package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
  191. package/daemon/dist/domain/queue-transition-log.js +124 -0
  192. package/daemon/dist/domain/queue-transition-log.js.map +1 -1
  193. package/daemon/dist/domain/restore-attempt-receipt.d.ts +34 -0
  194. package/daemon/dist/domain/restore-attempt-receipt.d.ts.map +1 -0
  195. package/daemon/dist/domain/restore-attempt-receipt.js +59 -0
  196. package/daemon/dist/domain/restore-attempt-receipt.js.map +1 -0
  197. package/daemon/dist/domain/restore-orchestrator.d.ts +57 -24
  198. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  199. package/daemon/dist/domain/restore-orchestrator.js +152 -26
  200. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  201. package/daemon/dist/domain/restore-topology.d.ts +14 -0
  202. package/daemon/dist/domain/restore-topology.d.ts.map +1 -0
  203. package/daemon/dist/domain/restore-topology.js +27 -0
  204. package/daemon/dist/domain/restore-topology.js.map +1 -0
  205. package/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
  206. package/daemon/dist/domain/rig-lifecycle-service.js +9 -0
  207. package/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
  208. package/daemon/dist/domain/rigspec-instantiator.d.ts +19 -0
  209. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  210. package/daemon/dist/domain/rigspec-instantiator.js +65 -1
  211. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  212. package/daemon/dist/domain/rigspec-preflight.d.ts +8 -0
  213. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  214. package/daemon/dist/domain/rigspec-preflight.js +4 -0
  215. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  216. package/daemon/dist/domain/seat-attention-reconciler.d.ts +23 -1
  217. package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  218. package/daemon/dist/domain/seat-attention-reconciler.js +97 -46
  219. package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  220. package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
  221. package/daemon/dist/domain/seat-identity-reconciler.js +15 -6
  222. package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
  223. package/daemon/dist/domain/seat-lifecycle-service.d.ts +47 -1
  224. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  225. package/daemon/dist/domain/seat-lifecycle-service.js +525 -29
  226. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  227. package/daemon/dist/domain/session-registry.d.ts +8 -1
  228. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  229. package/daemon/dist/domain/session-registry.js +19 -0
  230. package/daemon/dist/domain/session-registry.js.map +1 -1
  231. package/daemon/dist/domain/skill-catalog.d.ts +81 -0
  232. package/daemon/dist/domain/skill-catalog.d.ts.map +1 -0
  233. package/daemon/dist/domain/skill-catalog.js +827 -0
  234. package/daemon/dist/domain/skill-catalog.js.map +1 -0
  235. package/daemon/dist/domain/skill-discovery.d.ts +3 -0
  236. package/daemon/dist/domain/skill-discovery.d.ts.map +1 -1
  237. package/daemon/dist/domain/skill-discovery.js +1 -1
  238. package/daemon/dist/domain/skill-discovery.js.map +1 -1
  239. package/daemon/dist/domain/snapshot-capture.d.ts +4 -1
  240. package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
  241. package/daemon/dist/domain/snapshot-capture.js +38 -2
  242. package/daemon/dist/domain/snapshot-capture.js.map +1 -1
  243. package/daemon/dist/domain/snapshot-repository.d.ts +15 -1
  244. package/daemon/dist/domain/snapshot-repository.d.ts.map +1 -1
  245. package/daemon/dist/domain/snapshot-repository.js +103 -1
  246. package/daemon/dist/domain/snapshot-repository.js.map +1 -1
  247. package/daemon/dist/domain/startup-orchestrator.d.ts +2 -0
  248. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  249. package/daemon/dist/domain/startup-orchestrator.js +12 -0
  250. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  251. package/daemon/dist/domain/system-world.d.ts +45 -0
  252. package/daemon/dist/domain/system-world.d.ts.map +1 -0
  253. package/daemon/dist/domain/system-world.js +123 -0
  254. package/daemon/dist/domain/system-world.js.map +1 -0
  255. package/daemon/dist/domain/telemetry-state-paths.d.ts +7 -0
  256. package/daemon/dist/domain/telemetry-state-paths.d.ts.map +1 -0
  257. package/daemon/dist/domain/telemetry-state-paths.js +20 -0
  258. package/daemon/dist/domain/telemetry-state-paths.js.map +1 -0
  259. package/daemon/dist/domain/types.d.ts +103 -4
  260. package/daemon/dist/domain/types.d.ts.map +1 -1
  261. package/daemon/dist/domain/types.js.map +1 -1
  262. package/daemon/dist/domain/user-settings/settings-store.d.ts +8 -3
  263. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  264. package/daemon/dist/domain/user-settings/settings-store.js +65 -29
  265. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  266. package/daemon/dist/domain/watchdog-policy-engine.d.ts +7 -23
  267. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  268. package/daemon/dist/domain/watchdog-policy-engine.js +44 -226
  269. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  270. package/daemon/dist/domain/workflow-boot-sweep.d.ts.map +1 -1
  271. package/daemon/dist/domain/workflow-boot-sweep.js +20 -6
  272. package/daemon/dist/domain/workflow-boot-sweep.js.map +1 -1
  273. package/daemon/dist/domain/workflow-instance-store.d.ts +33 -1
  274. package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
  275. package/daemon/dist/domain/workflow-instance-store.js +127 -2
  276. package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
  277. package/daemon/dist/domain/workflow-keepalive-arming.d.ts +7 -5
  278. package/daemon/dist/domain/workflow-keepalive-arming.d.ts.map +1 -1
  279. package/daemon/dist/domain/workflow-keepalive-arming.js +27 -16
  280. package/daemon/dist/domain/workflow-keepalive-arming.js.map +1 -1
  281. package/daemon/dist/domain/workflow-projector.d.ts +6 -2
  282. package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
  283. package/daemon/dist/domain/workflow-projector.js +271 -2
  284. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  285. package/daemon/dist/domain/workflow-runtime.d.ts +62 -2
  286. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  287. package/daemon/dist/domain/workflow-runtime.js +334 -18
  288. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  289. package/daemon/dist/domain/workflow-spec-cache.d.ts +9 -1
  290. package/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
  291. package/daemon/dist/domain/workflow-spec-cache.js +85 -0
  292. package/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
  293. package/daemon/dist/domain/workflow-types.d.ts +38 -1
  294. package/daemon/dist/domain/workflow-types.d.ts.map +1 -1
  295. package/daemon/dist/domain/workflow-types.js.map +1 -1
  296. package/daemon/dist/domain/workflow-validator.d.ts.map +1 -1
  297. package/daemon/dist/domain/workflow-validator.js +20 -3
  298. package/daemon/dist/domain/workflow-validator.js.map +1 -1
  299. package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts +38 -9
  300. package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
  301. package/daemon/dist/domain/workspace/default-workspace-scaffold.js +93 -347
  302. package/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
  303. package/daemon/dist/index.d.ts.map +1 -1
  304. package/daemon/dist/index.js +13 -0
  305. package/daemon/dist/index.js.map +1 -1
  306. package/daemon/dist/instance-initialization-surface.d.ts +3 -0
  307. package/daemon/dist/instance-initialization-surface.d.ts.map +1 -0
  308. package/daemon/dist/instance-initialization-surface.js +3 -0
  309. package/daemon/dist/instance-initialization-surface.js.map +1 -0
  310. package/daemon/dist/project-lifecycle-surface.d.ts +3 -0
  311. package/daemon/dist/project-lifecycle-surface.d.ts.map +1 -0
  312. package/daemon/dist/project-lifecycle-surface.js +3 -0
  313. package/daemon/dist/project-lifecycle-surface.js.map +1 -0
  314. package/daemon/dist/routes/bundles.js +10 -9
  315. package/daemon/dist/routes/bundles.js.map +1 -1
  316. package/daemon/dist/routes/config.d.ts.map +1 -1
  317. package/daemon/dist/routes/config.js +27 -49
  318. package/daemon/dist/routes/config.js.map +1 -1
  319. package/daemon/dist/routes/context-packs.d.ts.map +1 -1
  320. package/daemon/dist/routes/context-packs.js +114 -16
  321. package/daemon/dist/routes/context-packs.js.map +1 -1
  322. package/daemon/dist/routes/crash-cart.js +3 -0
  323. package/daemon/dist/routes/crash-cart.js.map +1 -1
  324. package/daemon/dist/routes/queue.d.ts.map +1 -1
  325. package/daemon/dist/routes/queue.js +20 -0
  326. package/daemon/dist/routes/queue.js.map +1 -1
  327. package/daemon/dist/routes/rigs.js +12 -1
  328. package/daemon/dist/routes/rigs.js.map +1 -1
  329. package/daemon/dist/routes/rigspec.js +9 -2
  330. package/daemon/dist/routes/rigspec.js.map +1 -1
  331. package/daemon/dist/routes/seat.js +21 -1
  332. package/daemon/dist/routes/seat.js.map +1 -1
  333. package/daemon/dist/routes/sessions.js +16 -6
  334. package/daemon/dist/routes/sessions.js.map +1 -1
  335. package/daemon/dist/routes/snapshots.d.ts.map +1 -1
  336. package/daemon/dist/routes/snapshots.js +41 -3
  337. package/daemon/dist/routes/snapshots.js.map +1 -1
  338. package/daemon/dist/routes/up.js +12 -1
  339. package/daemon/dist/routes/up.js.map +1 -1
  340. package/daemon/dist/routes/watchdog.d.ts.map +1 -1
  341. package/daemon/dist/routes/watchdog.js +7 -6
  342. package/daemon/dist/routes/watchdog.js.map +1 -1
  343. package/daemon/dist/routes/workflow.d.ts.map +1 -1
  344. package/daemon/dist/routes/workflow.js +104 -39
  345. package/daemon/dist/routes/workflow.js.map +1 -1
  346. package/daemon/dist/server.d.ts +2 -0
  347. package/daemon/dist/server.d.ts.map +1 -1
  348. package/daemon/dist/server.js +1 -0
  349. package/daemon/dist/server.js.map +1 -1
  350. package/daemon/dist/skill-loadout-surface.d.ts +3 -0
  351. package/daemon/dist/skill-loadout-surface.d.ts.map +1 -0
  352. package/daemon/dist/skill-loadout-surface.js +2 -0
  353. package/daemon/dist/skill-loadout-surface.js.map +1 -0
  354. package/daemon/dist/startup.d.ts.map +1 -1
  355. package/daemon/dist/startup.js +72 -65
  356. package/daemon/dist/startup.js.map +1 -1
  357. package/daemon/dist/system-world-surface.d.ts +2 -0
  358. package/daemon/dist/system-world-surface.d.ts.map +1 -0
  359. package/daemon/dist/system-world-surface.js +2 -0
  360. package/daemon/dist/system-world-surface.js.map +1 -0
  361. package/daemon/docs/reference/getting-started.md +2 -1
  362. package/daemon/docs/reference/instance-layout.md +106 -0
  363. package/daemon/docs/reference/mission-install.md +12 -2
  364. package/daemon/docs/reference/project-workspace.md +66 -40
  365. package/daemon/specs/agents/shared/skills/core/openrig-skills/SKILL.md +4 -2
  366. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +81 -0
  367. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs +1419 -0
  368. package/dist/build-info.js +3 -3
  369. package/dist/commands/config-init-workspace.d.ts +4 -23
  370. package/dist/commands/config-init-workspace.d.ts.map +1 -1
  371. package/dist/commands/config-init-workspace.js +14 -576
  372. package/dist/commands/config-init-workspace.js.map +1 -1
  373. package/dist/commands/config.d.ts.map +1 -1
  374. package/dist/commands/config.js +6 -4
  375. package/dist/commands/config.js.map +1 -1
  376. package/dist/commands/context.d.ts.map +1 -1
  377. package/dist/commands/context.js +114 -8
  378. package/dist/commands/context.js.map +1 -1
  379. package/dist/commands/daemon.d.ts.map +1 -1
  380. package/dist/commands/daemon.js +16 -0
  381. package/dist/commands/daemon.js.map +1 -1
  382. package/dist/commands/launch.d.ts.map +1 -1
  383. package/dist/commands/launch.js +51 -4
  384. package/dist/commands/launch.js.map +1 -1
  385. package/dist/commands/restore.d.ts.map +1 -1
  386. package/dist/commands/restore.js +43 -3
  387. package/dist/commands/restore.js.map +1 -1
  388. package/dist/commands/scope.d.ts.map +1 -1
  389. package/dist/commands/scope.js +169 -79
  390. package/dist/commands/scope.js.map +1 -1
  391. package/dist/commands/seat.d.ts.map +1 -1
  392. package/dist/commands/seat.js +30 -0
  393. package/dist/commands/seat.js.map +1 -1
  394. package/dist/commands/skill.d.ts.map +1 -1
  395. package/dist/commands/skill.js +61 -0
  396. package/dist/commands/skill.js.map +1 -1
  397. package/dist/commands/snapshot.d.ts.map +1 -1
  398. package/dist/commands/snapshot.js +4 -2
  399. package/dist/commands/snapshot.js.map +1 -1
  400. package/dist/commands/start.d.ts.map +1 -1
  401. package/dist/commands/start.js +3 -0
  402. package/dist/commands/start.js.map +1 -1
  403. package/dist/commands/up.d.ts.map +1 -1
  404. package/dist/commands/up.js +3 -0
  405. package/dist/commands/up.js.map +1 -1
  406. package/dist/commands/walk.d.ts.map +1 -1
  407. package/dist/commands/walk.js +3 -0
  408. package/dist/commands/walk.js.map +1 -1
  409. package/dist/commands/workflow-render.d.ts +31 -0
  410. package/dist/commands/workflow-render.d.ts.map +1 -1
  411. package/dist/commands/workflow-render.js +84 -6
  412. package/dist/commands/workflow-render.js.map +1 -1
  413. package/dist/commands/workflow.d.ts.map +1 -1
  414. package/dist/commands/workflow.js +96 -8
  415. package/dist/commands/workflow.js.map +1 -1
  416. package/dist/config-store.d.ts +9 -4
  417. package/dist/config-store.d.ts.map +1 -1
  418. package/dist/config-store.js +67 -30
  419. package/dist/config-store.js.map +1 -1
  420. package/dist/daemon-lifecycle.d.ts +8 -15
  421. package/dist/daemon-lifecycle.d.ts.map +1 -1
  422. package/dist/daemon-lifecycle.js +24 -31
  423. package/dist/daemon-lifecycle.js.map +1 -1
  424. package/dist/lib/scope/mission-composition.d.ts +16 -0
  425. package/dist/lib/scope/mission-composition.d.ts.map +1 -0
  426. package/dist/lib/scope/mission-composition.js +110 -0
  427. package/dist/lib/scope/mission-composition.js.map +1 -0
  428. package/dist/lib/scope/scope-fs.d.ts +5 -0
  429. package/dist/lib/scope/scope-fs.d.ts.map +1 -1
  430. package/dist/lib/scope/scope-fs.js +34 -4
  431. package/dist/lib/scope/scope-fs.js.map +1 -1
  432. package/dist/lib/work-install.d.ts +17 -0
  433. package/dist/lib/work-install.d.ts.map +1 -1
  434. package/dist/lib/work-install.js +49 -6
  435. package/dist/lib/work-install.js.map +1 -1
  436. package/node_modules/@openrig/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  437. package/node_modules/@openrig/daemon/dist/adapters/claude-code-adapter.js +4 -2
  438. package/node_modules/@openrig/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  439. package/node_modules/@openrig/daemon/dist/build-info.js +3 -3
  440. package/node_modules/@openrig/daemon/dist/db/all-migrations.d.ts +1 -1
  441. package/node_modules/@openrig/daemon/dist/db/all-migrations.d.ts.map +1 -1
  442. package/node_modules/@openrig/daemon/dist/db/all-migrations.js +3 -1
  443. package/node_modules/@openrig/daemon/dist/db/all-migrations.js.map +1 -1
  444. package/node_modules/@openrig/daemon/dist/db/migrations/046_seat_identity_verdicts.d.ts +8 -5
  445. package/node_modules/@openrig/daemon/dist/db/migrations/046_seat_identity_verdicts.d.ts.map +1 -1
  446. package/node_modules/@openrig/daemon/dist/db/migrations/046_seat_identity_verdicts.js +8 -5
  447. package/node_modules/@openrig/daemon/dist/db/migrations/046_seat_identity_verdicts.js.map +1 -1
  448. package/node_modules/@openrig/daemon/dist/db/migrations/079_workflow_lifecycle_parallel.d.ts +8 -0
  449. package/node_modules/@openrig/daemon/dist/db/migrations/079_workflow_lifecycle_parallel.d.ts.map +1 -0
  450. package/node_modules/@openrig/daemon/dist/db/migrations/079_workflow_lifecycle_parallel.js +50 -0
  451. package/node_modules/@openrig/daemon/dist/db/migrations/079_workflow_lifecycle_parallel.js.map +1 -0
  452. package/node_modules/@openrig/daemon/dist/domain/active-occupant.d.ts +6 -1
  453. package/node_modules/@openrig/daemon/dist/domain/active-occupant.d.ts.map +1 -1
  454. package/node_modules/@openrig/daemon/dist/domain/active-occupant.js +47 -0
  455. package/node_modules/@openrig/daemon/dist/domain/active-occupant.js.map +1 -1
  456. package/node_modules/@openrig/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
  457. package/node_modules/@openrig/daemon/dist/domain/bootstrap-orchestrator.js +8 -1
  458. package/node_modules/@openrig/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
  459. package/node_modules/@openrig/daemon/dist/domain/bundle-context-packs-router.d.ts +3 -3
  460. package/node_modules/@openrig/daemon/dist/domain/bundle-context-packs-router.d.ts.map +1 -1
  461. package/node_modules/@openrig/daemon/dist/domain/bundle-skills-router.d.ts +3 -0
  462. package/node_modules/@openrig/daemon/dist/domain/bundle-skills-router.d.ts.map +1 -1
  463. package/node_modules/@openrig/daemon/dist/domain/bundle-skills-router.js +5 -1
  464. package/node_modules/@openrig/daemon/dist/domain/bundle-skills-router.js.map +1 -1
  465. package/node_modules/@openrig/daemon/dist/domain/claim-service.d.ts +2 -0
  466. package/node_modules/@openrig/daemon/dist/domain/claim-service.d.ts.map +1 -1
  467. package/node_modules/@openrig/daemon/dist/domain/claim-service.js +33 -12
  468. package/node_modules/@openrig/daemon/dist/domain/claim-service.js.map +1 -1
  469. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-library-service.d.ts.map +1 -1
  470. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-library-service.js +9 -1
  471. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-library-service.js.map +1 -1
  472. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-types.d.ts +25 -0
  473. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-types.d.ts.map +1 -1
  474. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-types.js +3 -1
  475. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-types.js.map +1 -1
  476. package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.d.ts.map +1 -1
  477. package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.js +143 -3
  478. package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.js.map +1 -1
  479. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.d.ts +22 -1
  480. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.d.ts.map +1 -1
  481. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.js +105 -40
  482. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.js.map +1 -1
  483. package/node_modules/@openrig/daemon/dist/domain/context-usage-store.d.ts +4 -0
  484. package/node_modules/@openrig/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
  485. package/node_modules/@openrig/daemon/dist/domain/context-usage-store.js +8 -4
  486. package/node_modules/@openrig/daemon/dist/domain/context-usage-store.js.map +1 -1
  487. package/node_modules/@openrig/daemon/dist/domain/crash-cart-conductor.d.ts +13 -0
  488. package/node_modules/@openrig/daemon/dist/domain/crash-cart-conductor.d.ts.map +1 -1
  489. package/node_modules/@openrig/daemon/dist/domain/crash-cart-conductor.js +3 -1
  490. package/node_modules/@openrig/daemon/dist/domain/crash-cart-conductor.js.map +1 -1
  491. package/node_modules/@openrig/daemon/dist/domain/execution-view.d.ts.map +1 -1
  492. package/node_modules/@openrig/daemon/dist/domain/execution-view.js +145 -16
  493. package/node_modules/@openrig/daemon/dist/domain/execution-view.js.map +1 -1
  494. package/node_modules/@openrig/daemon/dist/domain/instance-initialization.d.ts +25 -0
  495. package/node_modules/@openrig/daemon/dist/domain/instance-initialization.d.ts.map +1 -0
  496. package/node_modules/@openrig/daemon/dist/domain/instance-initialization.js +81 -0
  497. package/node_modules/@openrig/daemon/dist/domain/instance-initialization.js.map +1 -0
  498. package/node_modules/@openrig/daemon/dist/domain/lifecycle-manifest.d.ts +19 -0
  499. package/node_modules/@openrig/daemon/dist/domain/lifecycle-manifest.d.ts.map +1 -0
  500. package/node_modules/@openrig/daemon/dist/domain/lifecycle-manifest.js +73 -0
  501. package/node_modules/@openrig/daemon/dist/domain/lifecycle-manifest.js.map +1 -0
  502. package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.d.ts +36 -36
  503. package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.d.ts.map +1 -1
  504. package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.js +104 -135
  505. package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.js.map +1 -1
  506. package/node_modules/@openrig/daemon/dist/domain/native-process-lineage.d.ts +10 -0
  507. package/node_modules/@openrig/daemon/dist/domain/native-process-lineage.d.ts.map +1 -0
  508. package/node_modules/@openrig/daemon/dist/domain/native-process-lineage.js +86 -0
  509. package/node_modules/@openrig/daemon/dist/domain/native-process-lineage.js.map +1 -0
  510. package/node_modules/@openrig/daemon/dist/domain/native-resume-probe.js +12 -1
  511. package/node_modules/@openrig/daemon/dist/domain/native-resume-probe.js.map +1 -1
  512. package/node_modules/@openrig/daemon/dist/domain/node-inventory.d.ts +2 -0
  513. package/node_modules/@openrig/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  514. package/node_modules/@openrig/daemon/dist/domain/node-inventory.js +3 -1
  515. package/node_modules/@openrig/daemon/dist/domain/node-inventory.js.map +1 -1
  516. package/node_modules/@openrig/daemon/dist/domain/node-launcher.d.ts +3 -0
  517. package/node_modules/@openrig/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  518. package/node_modules/@openrig/daemon/dist/domain/node-launcher.js +21 -8
  519. package/node_modules/@openrig/daemon/dist/domain/node-launcher.js.map +1 -1
  520. package/node_modules/@openrig/daemon/dist/domain/pane-binding-observation.d.ts +22 -0
  521. package/node_modules/@openrig/daemon/dist/domain/pane-binding-observation.d.ts.map +1 -0
  522. package/node_modules/@openrig/daemon/dist/domain/pane-binding-observation.js +54 -0
  523. package/node_modules/@openrig/daemon/dist/domain/pane-binding-observation.js.map +1 -0
  524. package/node_modules/@openrig/daemon/dist/domain/policies/parked-owner-consumer.js +1 -1
  525. package/node_modules/@openrig/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
  526. package/node_modules/@openrig/daemon/dist/domain/policies/workflow-keepalive.d.ts.map +1 -1
  527. package/node_modules/@openrig/daemon/dist/domain/policies/workflow-keepalive.js +16 -2
  528. package/node_modules/@openrig/daemon/dist/domain/policies/workflow-keepalive.js.map +1 -1
  529. package/node_modules/@openrig/daemon/dist/domain/profile-resolver.d.ts +12 -0
  530. package/node_modules/@openrig/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
  531. package/node_modules/@openrig/daemon/dist/domain/profile-resolver.js +60 -0
  532. package/node_modules/@openrig/daemon/dist/domain/profile-resolver.js.map +1 -1
  533. package/node_modules/@openrig/daemon/dist/domain/project-lifecycle-compiler.d.ts +35 -0
  534. package/node_modules/@openrig/daemon/dist/domain/project-lifecycle-compiler.d.ts.map +1 -0
  535. package/node_modules/@openrig/daemon/dist/domain/project-lifecycle-compiler.js +190 -0
  536. package/node_modules/@openrig/daemon/dist/domain/project-lifecycle-compiler.js.map +1 -0
  537. package/node_modules/@openrig/daemon/dist/domain/provider/claude-usage-reader.d.ts +1 -1
  538. package/node_modules/@openrig/daemon/dist/domain/provider/claude-usage-reader.d.ts.map +1 -1
  539. package/node_modules/@openrig/daemon/dist/domain/provider/claude-usage-reader.js +28 -18
  540. package/node_modules/@openrig/daemon/dist/domain/provider/claude-usage-reader.js.map +1 -1
  541. package/node_modules/@openrig/daemon/dist/domain/queue-repository.d.ts +5 -1
  542. package/node_modules/@openrig/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  543. package/node_modules/@openrig/daemon/dist/domain/queue-repository.js +6 -0
  544. package/node_modules/@openrig/daemon/dist/domain/queue-repository.js.map +1 -1
  545. package/node_modules/@openrig/daemon/dist/domain/queue-retention.d.ts +3 -4
  546. package/node_modules/@openrig/daemon/dist/domain/queue-retention.d.ts.map +1 -1
  547. package/node_modules/@openrig/daemon/dist/domain/queue-retention.js +5 -8
  548. package/node_modules/@openrig/daemon/dist/domain/queue-retention.js.map +1 -1
  549. package/node_modules/@openrig/daemon/dist/domain/queue-transition-log.d.ts +28 -0
  550. package/node_modules/@openrig/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
  551. package/node_modules/@openrig/daemon/dist/domain/queue-transition-log.js +124 -0
  552. package/node_modules/@openrig/daemon/dist/domain/queue-transition-log.js.map +1 -1
  553. package/node_modules/@openrig/daemon/dist/domain/restore-attempt-receipt.d.ts +34 -0
  554. package/node_modules/@openrig/daemon/dist/domain/restore-attempt-receipt.d.ts.map +1 -0
  555. package/node_modules/@openrig/daemon/dist/domain/restore-attempt-receipt.js +59 -0
  556. package/node_modules/@openrig/daemon/dist/domain/restore-attempt-receipt.js.map +1 -0
  557. package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.d.ts +57 -24
  558. package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  559. package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.js +152 -26
  560. package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  561. package/node_modules/@openrig/daemon/dist/domain/restore-topology.d.ts +14 -0
  562. package/node_modules/@openrig/daemon/dist/domain/restore-topology.d.ts.map +1 -0
  563. package/node_modules/@openrig/daemon/dist/domain/restore-topology.js +27 -0
  564. package/node_modules/@openrig/daemon/dist/domain/restore-topology.js.map +1 -0
  565. package/node_modules/@openrig/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
  566. package/node_modules/@openrig/daemon/dist/domain/rig-lifecycle-service.js +9 -0
  567. package/node_modules/@openrig/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
  568. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.d.ts +19 -0
  569. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  570. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.js +65 -1
  571. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  572. package/node_modules/@openrig/daemon/dist/domain/rigspec-preflight.d.ts +8 -0
  573. package/node_modules/@openrig/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  574. package/node_modules/@openrig/daemon/dist/domain/rigspec-preflight.js +4 -0
  575. package/node_modules/@openrig/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  576. package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.d.ts +23 -1
  577. package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  578. package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.js +97 -46
  579. package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  580. package/node_modules/@openrig/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
  581. package/node_modules/@openrig/daemon/dist/domain/seat-identity-reconciler.js +15 -6
  582. package/node_modules/@openrig/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
  583. package/node_modules/@openrig/daemon/dist/domain/seat-lifecycle-service.d.ts +47 -1
  584. package/node_modules/@openrig/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  585. package/node_modules/@openrig/daemon/dist/domain/seat-lifecycle-service.js +525 -29
  586. package/node_modules/@openrig/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  587. package/node_modules/@openrig/daemon/dist/domain/session-registry.d.ts +8 -1
  588. package/node_modules/@openrig/daemon/dist/domain/session-registry.d.ts.map +1 -1
  589. package/node_modules/@openrig/daemon/dist/domain/session-registry.js +19 -0
  590. package/node_modules/@openrig/daemon/dist/domain/session-registry.js.map +1 -1
  591. package/node_modules/@openrig/daemon/dist/domain/skill-catalog.d.ts +81 -0
  592. package/node_modules/@openrig/daemon/dist/domain/skill-catalog.d.ts.map +1 -0
  593. package/node_modules/@openrig/daemon/dist/domain/skill-catalog.js +827 -0
  594. package/node_modules/@openrig/daemon/dist/domain/skill-catalog.js.map +1 -0
  595. package/node_modules/@openrig/daemon/dist/domain/skill-discovery.d.ts +3 -0
  596. package/node_modules/@openrig/daemon/dist/domain/skill-discovery.d.ts.map +1 -1
  597. package/node_modules/@openrig/daemon/dist/domain/skill-discovery.js +1 -1
  598. package/node_modules/@openrig/daemon/dist/domain/skill-discovery.js.map +1 -1
  599. package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.d.ts +4 -1
  600. package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
  601. package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.js +38 -2
  602. package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.js.map +1 -1
  603. package/node_modules/@openrig/daemon/dist/domain/snapshot-repository.d.ts +15 -1
  604. package/node_modules/@openrig/daemon/dist/domain/snapshot-repository.d.ts.map +1 -1
  605. package/node_modules/@openrig/daemon/dist/domain/snapshot-repository.js +103 -1
  606. package/node_modules/@openrig/daemon/dist/domain/snapshot-repository.js.map +1 -1
  607. package/node_modules/@openrig/daemon/dist/domain/startup-orchestrator.d.ts +2 -0
  608. package/node_modules/@openrig/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  609. package/node_modules/@openrig/daemon/dist/domain/startup-orchestrator.js +12 -0
  610. package/node_modules/@openrig/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  611. package/node_modules/@openrig/daemon/dist/domain/system-world.d.ts +45 -0
  612. package/node_modules/@openrig/daemon/dist/domain/system-world.d.ts.map +1 -0
  613. package/node_modules/@openrig/daemon/dist/domain/system-world.js +123 -0
  614. package/node_modules/@openrig/daemon/dist/domain/system-world.js.map +1 -0
  615. package/node_modules/@openrig/daemon/dist/domain/telemetry-state-paths.d.ts +7 -0
  616. package/node_modules/@openrig/daemon/dist/domain/telemetry-state-paths.d.ts.map +1 -0
  617. package/node_modules/@openrig/daemon/dist/domain/telemetry-state-paths.js +20 -0
  618. package/node_modules/@openrig/daemon/dist/domain/telemetry-state-paths.js.map +1 -0
  619. package/node_modules/@openrig/daemon/dist/domain/types.d.ts +103 -4
  620. package/node_modules/@openrig/daemon/dist/domain/types.d.ts.map +1 -1
  621. package/node_modules/@openrig/daemon/dist/domain/types.js.map +1 -1
  622. package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.d.ts +8 -3
  623. package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  624. package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.js +65 -29
  625. package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  626. package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.d.ts +7 -23
  627. package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  628. package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.js +44 -226
  629. package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  630. package/node_modules/@openrig/daemon/dist/domain/workflow-boot-sweep.d.ts.map +1 -1
  631. package/node_modules/@openrig/daemon/dist/domain/workflow-boot-sweep.js +20 -6
  632. package/node_modules/@openrig/daemon/dist/domain/workflow-boot-sweep.js.map +1 -1
  633. package/node_modules/@openrig/daemon/dist/domain/workflow-instance-store.d.ts +33 -1
  634. package/node_modules/@openrig/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
  635. package/node_modules/@openrig/daemon/dist/domain/workflow-instance-store.js +127 -2
  636. package/node_modules/@openrig/daemon/dist/domain/workflow-instance-store.js.map +1 -1
  637. package/node_modules/@openrig/daemon/dist/domain/workflow-keepalive-arming.d.ts +7 -5
  638. package/node_modules/@openrig/daemon/dist/domain/workflow-keepalive-arming.d.ts.map +1 -1
  639. package/node_modules/@openrig/daemon/dist/domain/workflow-keepalive-arming.js +27 -16
  640. package/node_modules/@openrig/daemon/dist/domain/workflow-keepalive-arming.js.map +1 -1
  641. package/node_modules/@openrig/daemon/dist/domain/workflow-projector.d.ts +6 -2
  642. package/node_modules/@openrig/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
  643. package/node_modules/@openrig/daemon/dist/domain/workflow-projector.js +271 -2
  644. package/node_modules/@openrig/daemon/dist/domain/workflow-projector.js.map +1 -1
  645. package/node_modules/@openrig/daemon/dist/domain/workflow-runtime.d.ts +62 -2
  646. package/node_modules/@openrig/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  647. package/node_modules/@openrig/daemon/dist/domain/workflow-runtime.js +334 -18
  648. package/node_modules/@openrig/daemon/dist/domain/workflow-runtime.js.map +1 -1
  649. package/node_modules/@openrig/daemon/dist/domain/workflow-spec-cache.d.ts +9 -1
  650. package/node_modules/@openrig/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
  651. package/node_modules/@openrig/daemon/dist/domain/workflow-spec-cache.js +85 -0
  652. package/node_modules/@openrig/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
  653. package/node_modules/@openrig/daemon/dist/domain/workflow-types.d.ts +38 -1
  654. package/node_modules/@openrig/daemon/dist/domain/workflow-types.d.ts.map +1 -1
  655. package/node_modules/@openrig/daemon/dist/domain/workflow-types.js.map +1 -1
  656. package/node_modules/@openrig/daemon/dist/domain/workflow-validator.d.ts.map +1 -1
  657. package/node_modules/@openrig/daemon/dist/domain/workflow-validator.js +20 -3
  658. package/node_modules/@openrig/daemon/dist/domain/workflow-validator.js.map +1 -1
  659. package/node_modules/@openrig/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts +38 -9
  660. package/node_modules/@openrig/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
  661. package/node_modules/@openrig/daemon/dist/domain/workspace/default-workspace-scaffold.js +93 -347
  662. package/node_modules/@openrig/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
  663. package/node_modules/@openrig/daemon/dist/index.d.ts.map +1 -1
  664. package/node_modules/@openrig/daemon/dist/index.js +13 -0
  665. package/node_modules/@openrig/daemon/dist/index.js.map +1 -1
  666. package/node_modules/@openrig/daemon/dist/instance-initialization-surface.d.ts +3 -0
  667. package/node_modules/@openrig/daemon/dist/instance-initialization-surface.d.ts.map +1 -0
  668. package/node_modules/@openrig/daemon/dist/instance-initialization-surface.js +3 -0
  669. package/node_modules/@openrig/daemon/dist/instance-initialization-surface.js.map +1 -0
  670. package/node_modules/@openrig/daemon/dist/project-lifecycle-surface.d.ts +3 -0
  671. package/node_modules/@openrig/daemon/dist/project-lifecycle-surface.d.ts.map +1 -0
  672. package/node_modules/@openrig/daemon/dist/project-lifecycle-surface.js +3 -0
  673. package/node_modules/@openrig/daemon/dist/project-lifecycle-surface.js.map +1 -0
  674. package/node_modules/@openrig/daemon/dist/routes/bundles.js +10 -9
  675. package/node_modules/@openrig/daemon/dist/routes/bundles.js.map +1 -1
  676. package/node_modules/@openrig/daemon/dist/routes/config.d.ts.map +1 -1
  677. package/node_modules/@openrig/daemon/dist/routes/config.js +27 -49
  678. package/node_modules/@openrig/daemon/dist/routes/config.js.map +1 -1
  679. package/node_modules/@openrig/daemon/dist/routes/context-packs.d.ts.map +1 -1
  680. package/node_modules/@openrig/daemon/dist/routes/context-packs.js +114 -16
  681. package/node_modules/@openrig/daemon/dist/routes/context-packs.js.map +1 -1
  682. package/node_modules/@openrig/daemon/dist/routes/crash-cart.js +3 -0
  683. package/node_modules/@openrig/daemon/dist/routes/crash-cart.js.map +1 -1
  684. package/node_modules/@openrig/daemon/dist/routes/queue.d.ts.map +1 -1
  685. package/node_modules/@openrig/daemon/dist/routes/queue.js +20 -0
  686. package/node_modules/@openrig/daemon/dist/routes/queue.js.map +1 -1
  687. package/node_modules/@openrig/daemon/dist/routes/rigs.js +12 -1
  688. package/node_modules/@openrig/daemon/dist/routes/rigs.js.map +1 -1
  689. package/node_modules/@openrig/daemon/dist/routes/rigspec.js +9 -2
  690. package/node_modules/@openrig/daemon/dist/routes/rigspec.js.map +1 -1
  691. package/node_modules/@openrig/daemon/dist/routes/seat.js +21 -1
  692. package/node_modules/@openrig/daemon/dist/routes/seat.js.map +1 -1
  693. package/node_modules/@openrig/daemon/dist/routes/sessions.js +16 -6
  694. package/node_modules/@openrig/daemon/dist/routes/sessions.js.map +1 -1
  695. package/node_modules/@openrig/daemon/dist/routes/snapshots.d.ts.map +1 -1
  696. package/node_modules/@openrig/daemon/dist/routes/snapshots.js +41 -3
  697. package/node_modules/@openrig/daemon/dist/routes/snapshots.js.map +1 -1
  698. package/node_modules/@openrig/daemon/dist/routes/up.js +12 -1
  699. package/node_modules/@openrig/daemon/dist/routes/up.js.map +1 -1
  700. package/node_modules/@openrig/daemon/dist/routes/watchdog.d.ts.map +1 -1
  701. package/node_modules/@openrig/daemon/dist/routes/watchdog.js +7 -6
  702. package/node_modules/@openrig/daemon/dist/routes/watchdog.js.map +1 -1
  703. package/node_modules/@openrig/daemon/dist/routes/workflow.d.ts.map +1 -1
  704. package/node_modules/@openrig/daemon/dist/routes/workflow.js +104 -39
  705. package/node_modules/@openrig/daemon/dist/routes/workflow.js.map +1 -1
  706. package/node_modules/@openrig/daemon/dist/server.d.ts +2 -0
  707. package/node_modules/@openrig/daemon/dist/server.d.ts.map +1 -1
  708. package/node_modules/@openrig/daemon/dist/server.js +1 -0
  709. package/node_modules/@openrig/daemon/dist/server.js.map +1 -1
  710. package/node_modules/@openrig/daemon/dist/skill-loadout-surface.d.ts +3 -0
  711. package/node_modules/@openrig/daemon/dist/skill-loadout-surface.d.ts.map +1 -0
  712. package/node_modules/@openrig/daemon/dist/skill-loadout-surface.js +2 -0
  713. package/node_modules/@openrig/daemon/dist/skill-loadout-surface.js.map +1 -0
  714. package/node_modules/@openrig/daemon/dist/startup.d.ts.map +1 -1
  715. package/node_modules/@openrig/daemon/dist/startup.js +72 -65
  716. package/node_modules/@openrig/daemon/dist/startup.js.map +1 -1
  717. package/node_modules/@openrig/daemon/dist/system-world-surface.d.ts +2 -0
  718. package/node_modules/@openrig/daemon/dist/system-world-surface.d.ts.map +1 -0
  719. package/node_modules/@openrig/daemon/dist/system-world-surface.js +2 -0
  720. package/node_modules/@openrig/daemon/dist/system-world-surface.js.map +1 -0
  721. package/node_modules/@openrig/daemon/package.json +17 -1
  722. package/package.json +1 -1
  723. package/tui/dist/commands/registry.d.ts.map +1 -1
  724. package/tui/dist/commands/registry.js +10 -1
  725. package/tui/dist/commands/registry.js.map +1 -1
  726. package/tui/dist/daemon-client.d.ts +11 -0
  727. package/tui/dist/daemon-client.d.ts.map +1 -1
  728. package/tui/dist/daemon-client.js +15 -0
  729. package/tui/dist/daemon-client.js.map +1 -1
  730. package/tui/dist/demo-data.d.ts.map +1 -1
  731. package/tui/dist/demo-data.js +65 -9
  732. package/tui/dist/demo-data.js.map +1 -1
  733. package/tui/dist/detail.d.ts +9 -0
  734. package/tui/dist/detail.d.ts.map +1 -1
  735. package/tui/dist/detail.js.map +1 -1
  736. package/tui/dist/execution/execution-model.d.ts +8 -2
  737. package/tui/dist/execution/execution-model.d.ts.map +1 -1
  738. package/tui/dist/execution/execution-model.js +482 -119
  739. package/tui/dist/execution/execution-model.js.map +1 -1
  740. package/tui/dist/hydrate.d.ts +3 -2
  741. package/tui/dist/hydrate.d.ts.map +1 -1
  742. package/tui/dist/hydrate.js +66 -8
  743. package/tui/dist/hydrate.js.map +1 -1
  744. package/tui/dist/input.d.ts +6 -1
  745. package/tui/dist/input.d.ts.map +1 -1
  746. package/tui/dist/input.js +20 -10
  747. package/tui/dist/input.js.map +1 -1
  748. package/tui/dist/main.js +39 -8
  749. package/tui/dist/main.js.map +1 -1
  750. package/tui/dist/navigator.d.ts.map +1 -1
  751. package/tui/dist/navigator.js +10 -6
  752. package/tui/dist/navigator.js.map +1 -1
  753. package/tui/dist/render.d.ts.map +1 -1
  754. package/tui/dist/render.js +596 -155
  755. package/tui/dist/render.js.map +1 -1
  756. package/tui/dist/scopes/scopes-model.d.ts +14 -8
  757. package/tui/dist/scopes/scopes-model.d.ts.map +1 -1
  758. package/tui/dist/scopes/scopes-model.js +218 -46
  759. package/tui/dist/scopes/scopes-model.js.map +1 -1
  760. package/tui/dist/socket-server.d.ts +13 -0
  761. package/tui/dist/socket-server.d.ts.map +1 -1
  762. package/tui/dist/socket-server.js +24 -0
  763. package/tui/dist/socket-server.js.map +1 -1
  764. package/tui/dist/state.d.ts.map +1 -1
  765. package/tui/dist/state.js +20 -6
  766. package/tui/dist/state.js.map +1 -1
  767. package/tui/dist/stylize.d.ts.map +1 -1
  768. package/tui/dist/stylize.js +22 -28
  769. package/tui/dist/stylize.js.map +1 -1
  770. package/tui/dist/theme.d.ts +1 -1
  771. package/tui/dist/theme.d.ts.map +1 -1
  772. package/tui/dist/theme.js +5 -4
  773. package/tui/dist/theme.js.map +1 -1
  774. package/tui/dist/types.d.ts +97 -1
  775. package/tui/dist/types.d.ts.map +1 -1
  776. package/tui/dist/visual-layout.d.ts +6 -0
  777. package/tui/dist/visual-layout.d.ts.map +1 -0
  778. package/tui/dist/visual-layout.js +8 -0
  779. package/tui/dist/visual-layout.js.map +1 -0
  780. package/ui/dist/assets/{index-B_wqzP0D.js → index-wyX378xb.js} +15 -15
  781. package/ui/dist/index.html +1 -1
@@ -1,9 +1,9 @@
1
1
  // GENERATED by scripts/build-package.sh — the packaged build-identity stamp.
2
2
  export const BUILD_INFO = {
3
- semver: "0.5.8",
4
- commit: "8b46e6504bdba9418b9db719e08566ea6d8e7043",
3
+ semver: "0.5.9",
4
+ commit: "dbf05f9d59ef3b0ae14fc00174c643df4858d45a",
5
5
  dirty: false,
6
- builtAt: "2026-09-02T23:59:01Z",
6
+ builtAt: "2026-09-05T02:09:38Z",
7
7
  };
8
8
  export function stampFields(info = BUILD_INFO) {
9
9
  if (!info.commit) return {};
@@ -1,33 +1,14 @@
1
1
  import { Command } from "commander";
2
+ import { workspaceScaffoldDirs, workspaceScaffoldFiles, type InitWorkspaceResult } from "@openrig/daemon/instance-initialization";
3
+ export { workspaceScaffoldDirs, workspaceScaffoldFiles };
4
+ export type { InitWorkspaceResult };
2
5
  export interface InitWorkspaceOpts {
3
6
  root?: string;
7
+ /** Deprecated compatibility input. Existing files are always preserved. */
4
8
  force?: boolean;
5
9
  dryRun?: boolean;
6
10
  json?: boolean;
7
11
  }
8
- export interface InitWorkspaceResult {
9
- root: string;
10
- /** True when this run would (or did) create the root dir; false if root existed. */
11
- rootCreated: boolean;
12
- subdirs: Array<{
13
- name: string;
14
- path: string;
15
- created: boolean;
16
- }>;
17
- files: Array<{
18
- relPath: string;
19
- absPath: string;
20
- created: boolean;
21
- skipped: "exists" | null;
22
- }>;
23
- /** True when --dry-run; nothing was actually written. */
24
- dryRun: boolean;
25
- }
26
- export declare function workspaceScaffoldDirs(): string[];
27
- export declare function workspaceScaffoldFiles(): Array<{
28
- relPath: string;
29
- content: string;
30
- }>;
31
12
  export declare function initWorkspaceCommand(configPath?: string): Command;
32
13
  export declare function runInitWorkspace(opts: InitWorkspaceOpts & {
33
14
  configPath?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"config-init-workspace.d.ts","sourceRoot":"","sources":["../../src/commands/config-init-workspace.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,oFAAoF;IACpF,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACjE,KAAK,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IAC/F,yDAAyD;IACzD,MAAM,EAAE,OAAO,CAAC;CACjB;AAygBD,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAEhD;AAED,wBAAgB,sBAAsB,IAAI,KAAK,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CA8CpF;AAED,wBAAgB,oBAAoB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CA8BjE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,mBAAmB,CA+CvG"}
1
+ {"version":3,"file":"config-init-workspace.d.ts","sourceRoot":"","sources":["../../src/commands/config-init-workspace.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAEL,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,mBAAmB,EACzB,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,CAAC;AACzD,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAEpC,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,oBAAoB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CA8BjE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,mBAAmB,CAWvG"}
@@ -1,542 +1,14 @@
1
- // User Settings v0 — `rig config init-workspace` workspace scaffolding.
2
- //
3
- // Creates the mission-aware default workspace at ~/.openrig/workspace/ (or a
4
- // caller-supplied --root). The same scaffold is also used idempotently by
5
- // daemon startup so a fresh install has a browsable work tree before
6
- // the user discovers the explicit command.
7
- //
8
- // Behavior:
9
- // - Reads workspace.root setting (default ~/.openrig/workspace/).
10
- // - Creates canonical subdirs: missions/ progress/ field-notes/ specs/ dogfood-evidence/.
11
- // - Seeds two example missions with multiple slices.
12
- // - Drops workspace README.md + SPEC.md + STEERING.md.
13
- // - --dry-run: report what would be created without acting.
14
- // - --force: overwrite existing files (NOT directories — never deletes
15
- // operator content).
16
- // - Idempotent without --force: existing-dir + existing-readme is a no-op.
1
+ // Public adapter for the S01 project-workspace owner used by S05 instance
2
+ // initialization. The bytes and behavior live in @openrig/daemon.
17
3
  import { Command } from "commander";
18
- import { existsSync, mkdirSync, writeFileSync } from "node:fs";
19
- import { join } from "node:path";
4
+ import { ensureDefaultWorkspace, workspaceScaffoldDirs, workspaceScaffoldFiles, } from "@openrig/daemon/instance-initialization";
20
5
  import { ConfigStore } from "../config-store.js";
21
- import { renderNotesTemplate, renderSliceProofTemplate } from "../lib/scope/templates.js";
22
- // Release-0.3.2 slice 01 (OPR.0.3.2.1) — seeded missions/slices now
23
- // carry §1 dot-IDs in frontmatter so the scaffold coheres with
24
- // `conventions/scope-and-versioning`. Mirror of the daemon constant;
25
- // the slice-21 parity test asserts both sides emit identical bodies.
26
- const DEFAULT_MISSIONS = [
27
- {
28
- id: "getting-started",
29
- dotId: "OPR.99.0.1",
30
- title: "Getting Started",
31
- status: "active",
32
- objective: "Launch the conveyor starter and learn how OpenRig moves work through queue-backed slices.",
33
- slices: [
34
- {
35
- id: "first-conveyor-run",
36
- dotId: "OPR.99.0.1.1",
37
- title: "First Conveyor Run",
38
- status: "active",
39
- objective: "Move one small packet through intake, planning, build, review, and close on the conveyor starter.",
40
- },
41
- {
42
- id: "inspect-project-evidence",
43
- dotId: "OPR.99.0.1.2",
44
- title: "Inspect Project Evidence",
45
- status: "draft",
46
- objective: "Open Project, Queue, Story, and Tests to inspect the evidence created by the first conveyor run.",
47
- },
48
- ],
49
- },
50
- ];
51
- const WORKSPACE_DIRS = [
52
- "missions",
53
- "artifacts",
54
- "evidence",
55
- "progress",
56
- "field-notes",
57
- "specs",
58
- "dogfood-evidence",
59
- ...DEFAULT_MISSIONS.flatMap((mission) => [
60
- `missions/${mission.id}`,
61
- `missions/${mission.id}/slices`,
62
- ...mission.slices.flatMap((slice) => [
63
- `missions/${mission.id}/slices/${slice.id}`,
64
- `missions/${mission.id}/slices/${slice.id}/proof`,
65
- ]),
66
- ]),
67
- ];
68
- function subdirReadmeContent(subdir) {
69
- switch (subdir) {
70
- case "missions":
71
- return "# missions\n\nMissions live here. Each mission owns a `slices/` child folder and appears in the OpenRig TUI.\n\nExpected shape:\n\n```text\nmissions/<mission-name>/SPEC.md\nmissions/<mission-name>/NOTES.md\nmissions/<mission-name>/PROGRESS.md\nmissions/<mission-name>/slices/<slice-name>/SPEC.md\nmissions/<mission-name>/slices/<slice-name>/PROGRESS.md\nmissions/<mission-name>/slices/<slice-name>/PROOF.md\n```\n\nEvery mission and slice SPEC carries an authored `intent:`, advisory sibling build-order `depends_on:` dot-IDs, and a stable dot-ID (`id: OPR.<ver>[.<n>]`). Use `rig scope mission create <name>` and `rig scope slice create <mission> <slug>` to mint conformant artifacts. Folder names are operator-facing slugs; `id:` is the stable handle that survives renames.\n";
72
- case "artifacts":
73
- return "# artifacts\n\nWork products live here: plans, drafts, generated outputs, and other files that a slice may reference before closure.\n";
74
- case "evidence":
75
- return "# evidence\n\nHuman-readable verification notes live here. Use this for compact proof summaries that are not tied to a screenshot or video packet.\n";
76
- case "progress":
77
- return "# progress\n\nPROGRESS.md tree. OpenRig's Progress browse view scans this directory recursively for PROGRESS.md files and renders them as a hierarchical tree.\n";
78
- case "field-notes":
79
- return "# field-notes\n\nOperator field notes. Free-form markdown notes from your daily work. OpenRig surfaces these alongside missions and slices for context.\n";
80
- case "specs":
81
- return "# specs\n\nWorkspace specs (rig specs / agent specs / workflow specs / context packs / skills). OpenRig's Library browses this directory alongside bundled specs.\n";
82
- case "dogfood-evidence":
83
- return "# dogfood-evidence\n\nProof packets live here. Each proof packet folder is matched to a slice by folder-name tokens and may contain markdown, screenshots, videos, traces, and other verification artifacts.\n";
84
- default:
85
- return `# ${subdir}\n`;
86
- }
87
- }
88
- const WORKSPACE_README = `# OpenRig Workspace
89
-
90
- This workspace is file-backed. The OpenRig TUI mirrors this structure:
91
-
92
- - \`missions/<mission-id>\` becomes a TUI mission.
93
- - \`missions/<mission-id>/slices/<slice-id>\` becomes a TUI slice.
94
- - Queue items should mention or tag the mission id and slice id so the TUI can attach live work to the right slice.
95
- - \`artifacts/\` is for work products that a slice needs to keep.
96
- - \`evidence/\` is for proof notes and verification summaries.
97
- - \`dogfood-evidence/<proof-packet-id>\` supplies test evidence when the packet id contains the slice id tokens.
98
-
99
- Use stable kebab-case names for mission and slice folders. Every mission/slice \`SPEC.md\` carries authored \`intent:\`, advisory sibling build-order \`depends_on:\`, and a stable dot-ID (\`id: OPR.<ver>[.<n>]\`). Mint conformant artifacts via \`rig scope mission create <name>\` and \`rig scope slice create <mission> <slug>\`. Folder names are operator-facing slugs; \`id:\` is the rename-proof handle.
100
- `;
101
- const PROJECT_SPEC = `---
102
- intent: Organize this project's durable work as missions and slices, then move it through queue-backed agent collaboration.
103
- ---
104
-
105
- # Project
106
-
107
- This is the project-level context for the default OpenRig workspace. It gives
108
- agents a stable project intent before they descend into the active mission and
109
- slice. Edit it to describe what your project is for and who benefits from it.
110
- `;
111
- const PROJECT_MANIFEST = `schema: openrig.project/v0alpha1
112
- kind: project
113
- missions:
114
- root: missions
115
- # Optional enrichment is added here; absence inherits defaults.
116
- `;
117
- const MISSION_MANIFEST = `schema: openrig.mission/v0alpha1
118
- kind: mission
119
- composition:
120
- mission_markdown:
121
- spec: SPEC.md
122
- # Optional team and SDLC sections are added here.
123
- `;
124
- const SLICE_MANIFEST = `schema: openrig.slice/v0alpha1
125
- kind: slice
126
- composition:
127
- mission: ../../mission.yaml
128
- slice_markdown:
129
- spec: SPEC.md
130
- progress: PROGRESS.md
131
- proof: PROOF.md
132
- # Optional assignment, SDLC, and evidence sections are added here.
133
- `;
134
- const STEERING_PLACEHOLDER = `---
135
- title: Priority Stack
136
- status: placeholder
137
- ---
138
-
139
- # OpenRig Priority Stack
140
-
141
- This file is a placeholder created by \`rig config init-workspace\`. Edit it
142
- to record your top priorities. The OpenRig TUI reads this file alongside the
143
- work tree.
144
-
145
- ## Top 3
146
-
147
- 1. Run the \`conveyor\` starter rig.
148
- 2. Move one packet through \`basic-loop\` or \`conveyor\`.
149
- 3. Inspect the mission, queue, story, and proof surfaces in the TUI.
150
-
151
- ## In Motion
152
-
153
- (Active slices land here as you push them through the priority rail.)
154
-
155
- ## Loop State
156
-
157
- (Health gates + loop diagnostics land here.)
158
- `;
159
- function missionReadme(mission) {
160
- return `---
161
- id: ${mission.dotId}
162
- title: ${mission.title}
163
- status: ${mission.status}
164
- mission: ${mission.id}
165
- intent: ${JSON.stringify(mission.objective)}
166
- depends_on: []
167
- ---
168
-
169
- # ${mission.title}
170
-
171
- ${mission.objective}
172
-
173
- ## Slices
174
-
175
- ${mission.slices.map((slice) => `- [${slice.title}](slices/${slice.id}/SPEC.md)`).join("\n")}
176
- `;
177
- }
178
- function missionProgress(mission) {
179
- return `---
180
- title: ${mission.title} Progress
181
- status: ${mission.status}
182
- mission: ${mission.id}
183
- ---
184
-
185
- # ${mission.title} Progress
186
-
187
- ## Acceptance
188
-
189
- - [ ] Keep mission SPEC current.
190
- - [ ] Keep active slices queue-backed with mission and slice ids.
191
- `;
192
- }
193
- // V0.3.1 slice 21 onboarding-conveyor — narrative content for the
194
- // getting-started mission's two slices. PARITY CONTRACT with
195
- // `packages/daemon/src/domain/workspace/getting-started-narrative.ts`:
196
- // the daemon side is the canonical source; this CLI-side mirror MUST
197
- // stay byte-identical. The narrative-parity test in
198
- // `packages/daemon/test/getting-started-narrative-parity.test.ts`
199
- // (added in this slice) asserts byte-identity by reading both this
200
- // file and the daemon module — if either drifts, the test fails.
201
- // If you update content here, update the daemon mirror in lockstep.
202
- const FIRST_CONVEYOR_RUN_README = `# First Conveyor Run
203
-
204
- Welcome to OpenRig. This is the first slice in your getting-started mission. It exists to teach you what a **conveyor run** is + how OpenRig moves work through a multi-agent topology.
205
-
206
- ## What a conveyor run is
207
-
208
- A **conveyor** is OpenRig's central work-movement primitive. One conveyor run = one complete flow of work through your topology:
209
-
210
- 1. **Slice declared** — operator (you) or an agent declares a slice with intent + acceptance criteria
211
- 2. **Work routed** — orchestrator picks the slice up + routes it to the right agent
212
- 3. **Agents collaborate** — work moves agent-to-agent via durable handoffs (queue items)
213
- 4. **Evidence accumulates** — each step leaves a trail: commits, files, proof packets, screenshots
214
- 5. **Slice closes** — acceptance criteria met; orchestrator routes the result back
215
-
216
- You're looking at a mocked conveyor run RIGHT NOW. The other tabs (Story / Progress / Artifacts / Tests / Queue / Topology) each show a different slice of this same run.
217
-
218
- ## Walking the tabs
219
-
220
- - **Overview** (you're here) — read what a slice intends + how to use the rest of the tabs
221
- - **Story** — narrative timeline of what happened, beat by beat
222
- - **Progress** — acceptance checklist; what's done, what's pending
223
- - **Artifacts** — files produced, commits, proof packets — the durable evidence trail
224
- - **Tests** — pass/fail summaries + screenshots + verification proof
225
- - **Queue** — operational qitems showing how work moved between agents
226
- - **Topology** — the rig graph; which agents touched this slice + which edges fired
227
-
228
- ## Click through
229
-
230
- Try them in order. Each tab teaches itself.
231
- `;
232
- const FIRST_CONVEYOR_RUN_TIMELINE = `# Story — First Conveyor Run
233
-
234
- ## 2026-04-15 09:00 — Slice declared
235
-
236
- Operator request: "Build a CLI tool that lints todo lists." Slice declared in \`getting-started/slices/first-conveyor-run/\`. Acceptance: \`tdl lint <file>\` exits non-zero on malformed entries.
237
-
238
- ## 09:02 — Orchestrator routes
239
-
240
- \`orch-lead@getting-started\` picks up the slice. Routes to \`driver@getting-started\` via \`rig queue handoff\`. Driver receives nudge; opens IMPL-PRD; reads acceptance.
241
-
242
- ## 09:05 — Driver picks up
243
-
244
- Driver claims qitem. Reads slice scope. Surveys existing tdl repo (this is a worked example — imagine the repo is real). Plans: parse YAML; validate entries; exit code per finding.
245
-
246
- ## 09:30 — First commit
247
-
248
- \`feat(lint): parse + validate todo entries\` — driver commits 4 files. Stream event emitted; visible in Artifacts tab.
249
-
250
- ## 10:15 — Driver hands to reviewer
251
-
252
- Acceptance met locally. Driver hands off to \`reviewer@getting-started\`. Reviewer opens diff; reads tests.
253
-
254
- ## 10:25 — Reviewer flags concern
255
-
256
- "Edge case: what about UTF-8 entries with combining characters?" Hands back to driver as \`concerning\`.
257
-
258
- ## 10:40 — Driver addresses
259
-
260
- Driver fixes UTF-8 handling. Re-runs tests; all pass. Hands back.
261
-
262
- ## 11:00 — Reviewer accepts
263
-
264
- \`accept\` decision; closes qitem with \`closure-reason: handed_off_to orch-lead\`. Conveyor proceeds.
265
-
266
- ## 11:05 — Slice ships
267
-
268
- Orchestrator merges. Proof packet generated. Slice marked SHIPPED.
269
-
270
- ---
271
-
272
- **What you just read**: one conveyor run from declaration to ship. ~2 hours wall-clock; 3 agents involved; 1 handoff with concern + remediation; 5 stream events; 1 proof packet.
273
-
274
- The Story tab shows this kind of narrative for any real slice. Driver-authored \`timeline.md\` files live in each slice folder; this is yours to read + your operator's to update as work moves.
275
- `;
276
- const FIRST_CONVEYOR_RUN_PROGRESS = `---
277
- title: First Conveyor Run Progress
278
- status: active
279
- mission: getting-started
280
- rail-item: getting-started
281
- slice: first-conveyor-run
282
- ---
283
-
284
- # Progress — First Conveyor Run
285
-
286
- ## Acceptance criteria
287
-
288
- - [x] Parse YAML todo entries
289
- - [x] Validate per-entry shape (id, title, status, due-date)
290
- - [x] Exit non-zero on malformed entries
291
- - [x] Handle UTF-8 entries with combining characters
292
- - [x] Tests pass (12/12)
293
- - [x] Reviewer accepts
294
- - [x] Slice merged
295
-
296
- ## Status: SHIPPED
297
-
298
- This was a mocked conveyor run — no real code was produced. But the Progress tab works the same way for real work: as acceptance criteria are met, boxes get checked; the operator can scan at a glance whether the slice is on track.
299
-
300
- ## How the Progress tab works
301
-
302
- The tab renders the slice's \`PROGRESS.md\` markdown file. Driver updates it as work progresses. Operator scans it during walks. Founder reviews at slice closure.
303
-
304
- Try writing one for a real slice you start. It's just markdown; live updates appear here.
305
- `;
306
- const INSPECT_PROJECT_EVIDENCE_README = `# Inspect Project Evidence
307
-
308
- The previous slice (First Conveyor Run) showed you what a conveyor run looks like as it happens. This slice teaches you how to inspect the evidence after a run completes.
309
-
310
- ## Why inspect evidence?
311
-
312
- In OpenRig, agents work autonomously. The operator (you) doesn't watch every keystroke. Instead, the operator:
313
-
314
- 1. Declares slices with clear acceptance
315
- 2. Routes them to agents
316
- 3. Inspects evidence when slices close
317
-
318
- The Artifacts + Tests + Queue + Topology tabs are your inspection surface. They show you what happened, with enough detail to:
319
-
320
- - Verify the acceptance was actually met
321
- - Spot subtle issues a passing test might miss
322
- - Build trust in the agents over time
323
-
324
- ## Walking the tabs
325
-
326
- - **Overview** — you're here; learn what to look for
327
- - **Story** — read the narrative of what happened (high-level)
328
- - **Progress** — acceptance status at a glance
329
- - **Artifacts** — the durable evidence: files, commits, proof packets. **THIS IS THE TAB YOU LEARN MOST FROM.**
330
- - **Tests** — pass/fail + screenshots + verification proof
331
- - **Queue** — who handed what to whom (audit trail of decisions)
332
- - **Topology** — which agents touched this; which edges fired
333
-
334
- ## Key inspection skills
335
-
336
- When walking a finished slice:
337
-
338
- 1. **Read the Story** for context — what was the operator trying to do?
339
- 2. **Check Progress** — did acceptance actually pass? Any TODO boxes?
340
- 3. **Open Artifacts → Files** — sample-read 2-3 files; does the code match what the Story claimed?
341
- 4. **Open Tests → Proof packets** — do screenshots actually show what was claimed?
342
- 5. **Read Queue** — were there concerning decisions? Hand-offs to escalation?
343
- 6. **Skim Topology** — were unexpected agents involved?
344
-
345
- Trust comes from repeated successful inspections, not from a single proof packet.
346
- `;
347
- const INSPECT_PROJECT_EVIDENCE_TIMELINE = `# Story — Inspect Project Evidence
348
-
349
- This slice mirrors the previous one (First Conveyor Run). The same agents shipped the same work. But this view is from the inspector's angle, not the runner's.
350
-
351
- ## 11:10 — Operator opens project
352
-
353
- Operator (you, in the real world) opens \`/project/slice/first-conveyor-run\` after the slice ships. First read: the Progress tab. All boxes checked.
354
-
355
- ## 11:12 — Read Story
356
-
357
- Operator reads the Story narrative. Notices the reviewer's UTF-8 concern + driver's remediation. Confidence-building: there was friction, friction was caught, friction was addressed.
358
-
359
- ## 11:15 — Open Artifacts
360
-
361
- Operator clicks Artifacts. Sees 4 commits, 5 files, 1 proof packet, 2 screenshots. Opens commit \`feat(lint): parse + validate todo entries\`. Reads the diff.
362
-
363
- ## 11:18 — Read tests
364
-
365
- Operator opens Tests tab. 12/12 passing. Opens the proof packet — screenshot shows CLI output \`Error: malformed entry at line 3\`. Visually verifies the acceptance was met.
366
-
367
- ## 11:22 — Skim Queue
368
-
369
- Operator scrolls Queue. 4 qitems in chronological order. Sees the \`concerning\` decision + subsequent \`accept\`. Confidence reinforced.
370
-
371
- ## 11:25 — Mark complete
372
-
373
- Operator marks slice acceptance complete. Closes the inspection.
374
-
375
- ---
376
-
377
- **What you just read**: a clean inspection in ~15 minutes. Operator builds trust through the evidence trail. This is the OpenRig usage pattern at scale: declare → route → inspect.
378
- `;
379
- const INSPECT_PROJECT_EVIDENCE_PROGRESS = `---
380
- title: Inspect Project Evidence Progress
381
- status: active
382
- mission: getting-started
383
- rail-item: getting-started
384
- slice: inspect-project-evidence
385
- ---
386
-
387
- # Progress — Inspect Project Evidence
388
-
389
- ## Inspection checklist
390
-
391
- - [x] Read Story (context: what was being done)
392
- - [x] Check Progress (acceptance status)
393
- - [x] Sample-read Artifacts files
394
- - [x] Verify Tests proof packets visually
395
- - [x] Skim Queue for concerning decisions
396
- - [x] Skim Topology for unexpected agents
397
-
398
- ## Status: COMPLETE
399
-
400
- This was a mocked inspection — a worked example of the inspection workflow.
401
-
402
- ## How to apply this
403
-
404
- For any real slice that ships in YOUR project: open the slice page, walk the tabs in this order, check each box mentally. Over time you'll develop instincts for what passes the smell test vs what needs deeper investigation.
405
- `;
406
- const GETTING_STARTED_NARRATIVE = {
407
- "first-conveyor-run": {
408
- readme: FIRST_CONVEYOR_RUN_README,
409
- timeline: FIRST_CONVEYOR_RUN_TIMELINE,
410
- progress: FIRST_CONVEYOR_RUN_PROGRESS,
411
- },
412
- "inspect-project-evidence": {
413
- readme: INSPECT_PROJECT_EVIDENCE_README,
414
- timeline: INSPECT_PROJECT_EVIDENCE_TIMELINE,
415
- progress: INSPECT_PROJECT_EVIDENCE_PROGRESS,
416
- },
417
- };
418
- function sliceReadme(mission, slice) {
419
- // V0.3.1 slice 21: getting-started slices ship rich narrative.
420
- const narrative = GETTING_STARTED_NARRATIVE[slice.id];
421
- if (narrative) {
422
- return `---
423
- id: ${slice.dotId}
424
- title: ${slice.title}
425
- status: ${slice.status}
426
- mission: ${mission.id}
427
- rail-item: ${mission.id}
428
- slice: ${slice.id}
429
- intent: ${JSON.stringify(slice.objective)}
430
- depends_on: []
431
- ---
432
-
433
- ${narrative.readme}`;
434
- }
435
- return `---
436
- id: ${slice.dotId}
437
- title: ${slice.title}
438
- status: ${slice.status}
439
- mission: ${mission.id}
440
- rail-item: ${mission.id}
441
- slice: ${slice.id}
442
- intent: ${JSON.stringify(slice.objective)}
443
- depends_on: []
444
- ---
445
-
446
- # ${slice.title}
447
-
448
- ## Intent
449
-
450
- ${slice.objective}
451
-
452
- ## Mini-requirements
453
-
454
- 1. The work is visible in the Project slice and its queue items link back to \`${slice.id}\`.
455
-
456
- ## Proof contract
457
-
458
- - [ ] The work is visible in the Project slice — captured from this SPEC.md.
459
-
460
- ## Queue Mapping
461
-
462
- Queue items for this slice should mention or tag:
463
-
464
- - mission: \`${mission.id}\`
465
- - slice: \`${slice.id}\`
466
-
467
- This lets Project attach queue activity to the slice story, queue, tests, and topology tabs.
468
- `;
469
- }
470
- function sliceTimeline(mission, slice) {
471
- const narrative = GETTING_STARTED_NARRATIVE[slice.id];
472
- return narrative ? narrative.timeline : null;
473
- }
474
- function sliceProgress(mission, slice) {
475
- const narrative = GETTING_STARTED_NARRATIVE[slice.id];
476
- if (narrative)
477
- return narrative.progress;
478
- return `---
479
- title: ${slice.title} Progress
480
- status: ${slice.status}
481
- mission: ${mission.id}
482
- rail-item: ${mission.id}
483
- slice: ${slice.id}
484
- ---
485
-
486
- # ${slice.title} Progress
487
-
488
- ## Acceptance
489
-
490
- - [ ] Define the next concrete packet.
491
- - [ ] Attach queue work to this slice id.
492
- - [ ] Capture proof or notes before closing.
493
- `;
494
- }
495
- export function workspaceScaffoldDirs() {
496
- return [...WORKSPACE_DIRS];
497
- }
498
- export function workspaceScaffoldFiles() {
499
- const files = [
500
- { relPath: "README.md", content: WORKSPACE_README },
501
- { relPath: "SPEC.md", content: PROJECT_SPEC },
502
- { relPath: "project.yaml", content: PROJECT_MANIFEST },
503
- { relPath: "STEERING.md", content: STEERING_PLACEHOLDER },
504
- { relPath: "missions/README.md", content: subdirReadmeContent("missions") },
505
- { relPath: "artifacts/README.md", content: subdirReadmeContent("artifacts") },
506
- { relPath: "evidence/README.md", content: subdirReadmeContent("evidence") },
507
- { relPath: "progress/README.md", content: subdirReadmeContent("progress") },
508
- { relPath: "field-notes/README.md", content: subdirReadmeContent("field-notes") },
509
- { relPath: "specs/README.md", content: subdirReadmeContent("specs") },
510
- { relPath: "dogfood-evidence/README.md", content: subdirReadmeContent("dogfood-evidence") },
511
- ];
512
- for (const mission of DEFAULT_MISSIONS) {
513
- files.push({ relPath: `missions/${mission.id}/SPEC.md`, content: missionReadme(mission) }, { relPath: `missions/${mission.id}/mission.yaml`, content: MISSION_MANIFEST }, { relPath: `missions/${mission.id}/PROGRESS.md`, content: missionProgress(mission) }, {
514
- relPath: `missions/${mission.id}/NOTES.md`,
515
- content: renderNotesTemplate({
516
- mission_id: mission.dotId,
517
- mission_name: mission.title,
518
- created_date: new Date().toISOString().slice(0, 10),
519
- }).rendered,
520
- });
521
- for (const slice of mission.slices) {
522
- files.push({ relPath: `missions/${mission.id}/slices/${slice.id}/SPEC.md`, content: sliceReadme(mission, slice) }, { relPath: `missions/${mission.id}/slices/${slice.id}/slice.yaml`, content: SLICE_MANIFEST }, { relPath: `missions/${mission.id}/slices/${slice.id}/PROGRESS.md`, content: sliceProgress(mission, slice) }, { relPath: `missions/${mission.id}/slices/${slice.id}/PROOF.md`, content: renderSliceProofTemplate({ id: slice.dotId, title: slice.title }) });
523
- // V0.3.1 slice 21: getting-started slices ship timeline.md.
524
- const timeline = sliceTimeline(mission, slice);
525
- if (timeline) {
526
- files.push({
527
- relPath: `missions/${mission.id}/slices/${slice.id}/timeline.md`,
528
- content: timeline,
529
- });
530
- }
531
- }
532
- }
533
- return files;
534
- }
6
+ export { workspaceScaffoldDirs, workspaceScaffoldFiles };
535
7
  export function initWorkspaceCommand(configPath) {
536
8
  const cmd = new Command("init-workspace")
537
- .description("Scaffold the default workspace at ~/.openrig/workspace/ with mission/slice folders")
9
+ .description("Scaffold a repo-ready project workspace")
538
10
  .option("--root <path>", "Override workspace root (default: workspace.root setting)")
539
- .option("--force", "Overwrite existing scaffolded files (does NOT remove directories)")
11
+ .option("--force", "Deprecated compatibility flag; existing files are still preserved")
540
12
  .option("--dry-run", "Show what would be created without writing")
541
13
  .option("--json", "JSON output")
542
14
  .action((opts) => {
@@ -554,8 +26,8 @@ export function initWorkspaceCommand(configPath) {
554
26
  for (const sub of result.subdirs) {
555
27
  console.log(` ${sub.created ? "+" : " "} ${sub.name}/`);
556
28
  }
557
- for (const f of result.files) {
558
- console.log(` ${f.created ? "+" : " "} ${f.relPath}${f.skipped ? ` (skipped: ${f.skipped})` : ""}`);
29
+ for (const file of result.files) {
30
+ console.log(` ${file.created ? "+" : " "} ${file.relPath}${file.skipped ? ` (skipped: ${file.skipped})` : ""}`);
559
31
  }
560
32
  if (result.dryRun)
561
33
  console.log("(dry-run; no files written.)");
@@ -571,46 +43,12 @@ export function initWorkspaceCommand(configPath) {
571
43
  export function runInitWorkspace(opts) {
572
44
  const store = new ConfigStore(opts.configPath);
573
45
  const root = opts.root ?? store.get("workspace.root");
574
- const dryRun = !!opts.dryRun;
575
- const force = !!opts.force;
576
- // FR-5e BLOCKER-1 — precompute the full scaffold file list BEFORE
577
- // any filesystem mutation. workspaceScaffoldFiles() now invokes
578
- // renderNotesTemplate(), which throws on an invalid current or legacy
579
- // notes-template override. If we mkdir first then
580
- // throw on render, the operator is left with a half-created
581
- // workspace that the next `rig workspace doctor` will misread as
582
- // partially-initialized. Verify-first-then-write (banked from
583
- // FR-3 self-lesson) — fail before any side effect.
584
- const scaffoldFiles = workspaceScaffoldFiles();
585
- const scaffoldDirs = workspaceScaffoldDirs();
586
- const rootExists = existsSync(root);
587
- const result = {
588
- root,
589
- rootCreated: !rootExists,
590
- subdirs: [],
591
- files: [],
592
- dryRun,
593
- };
594
- if (!rootExists && !dryRun)
595
- mkdirSync(root, { recursive: true });
596
- for (const sub of scaffoldDirs) {
597
- const subPath = join(root, sub);
598
- const subExists = existsSync(subPath);
599
- if (!subExists && !dryRun)
600
- mkdirSync(subPath, { recursive: true });
601
- result.subdirs.push({ name: sub, path: subPath, created: !subExists });
602
- }
603
- for (const file of scaffoldFiles) {
604
- const absPath = join(root, file.relPath);
605
- const exists = existsSync(absPath);
606
- if (exists && !force) {
607
- result.files.push({ relPath: file.relPath, absPath, created: false, skipped: "exists" });
608
- }
609
- else {
610
- if (!dryRun)
611
- writeFileSync(absPath, file.content, "utf-8");
612
- result.files.push({ relPath: file.relPath, absPath, created: true, skipped: null });
613
- }
46
+ const result = ensureDefaultWorkspace({ root, dryRun: !!opts.dryRun });
47
+ if (!result.ok) {
48
+ const detail = result.conflicts
49
+ .map((conflict) => `${conflict.path}: expected ${conflict.expected}, found ${conflict.actual}`)
50
+ .join("; ");
51
+ throw new Error(`Workspace initialization blocked: ${detail}`);
614
52
  }
615
53
  return result;
616
54
  }