@openrig/cli 0.5.7 → 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 (947) 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/hooks/scripts/refocus.cjs +25 -2
  4. package/daemon/assets/plugins/openrig-core/skills/agent-operated-software/SKILL.md +92 -0
  5. package/daemon/assets/plugins/openrig-core/skills/agent-operated-workflows/SKILL.md +79 -0
  6. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +95 -8
  7. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +9 -1
  8. package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +2 -2
  9. package/daemon/assets/plugins/openrig-core/skills/openrig-skills/SKILL.md +4 -2
  10. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +12 -16
  11. package/daemon/assets/plugins/openrig-core/skills/software-for-agents/SKILL.md +11 -179
  12. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  13. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +98 -29
  14. package/daemon/context-packs/skills/agent-operated-software/SKILL.md +92 -0
  15. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +10 -0
  16. package/daemon/context-packs/skills/agent-operated-workflows/SKILL.md +79 -0
  17. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +10 -0
  18. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  19. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  20. package/daemon/context-packs/skills/claude-compaction-restore/scripts/precompact-hook.mjs +95 -8
  21. package/daemon/context-packs/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +9 -1
  22. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  23. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  24. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  25. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  26. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  27. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  28. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  29. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  30. package/daemon/context-packs/skills/core/openrig-skills/SKILL.md +4 -2
  31. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/core/openrig-upgrade/SKILL.md +189 -343
  33. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +11 -3
  34. package/daemon/context-packs/skills/core/openrig-upgrade/scripts/backup-sqlite.mjs +62 -0
  35. package/daemon/context-packs/skills/core/openrig-upgrade/scripts/inspect-upgrade.mjs +40 -0
  36. package/daemon/context-packs/skills/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs +1419 -0
  37. package/daemon/context-packs/skills/core/openrig-upgrade/scripts/refresh-managed-plugin.mjs +151 -0
  38. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  40. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/forming-an-openrig-mental-model/SKILL.md +2 -2
  46. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/openrig-user/SKILL.md +12 -16
  51. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  53. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  54. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  56. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  66. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  68. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  72. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  73. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  74. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  75. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  76. package/daemon/context-packs/skills/software-for-agents/SKILL.md +11 -179
  77. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +3 -3
  78. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  79. package/daemon/context-packs/world-example/your-world.md +1 -1
  80. package/daemon/context-packs/world-public/build-your-world.md +19 -0
  81. package/daemon/context-packs/world-public/claims.yaml +5 -1
  82. package/daemon/context-packs/world-public/manifest.yaml +40 -1
  83. package/daemon/context-packs/world-public/verify-world.sh +25 -9
  84. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  85. package/daemon/dist/adapters/claude-code-adapter.js +4 -2
  86. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  87. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  88. package/daemon/dist/adapters/codex-runtime-adapter.js +249 -2
  89. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  90. package/daemon/dist/adapters/tmux.d.ts +6 -5
  91. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  92. package/daemon/dist/adapters/tmux.js +29 -12
  93. package/daemon/dist/adapters/tmux.js.map +1 -1
  94. package/daemon/dist/build-info.js +3 -3
  95. package/daemon/dist/db/all-migrations.d.ts +1 -1
  96. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  97. package/daemon/dist/db/all-migrations.js +5 -1
  98. package/daemon/dist/db/all-migrations.js.map +1 -1
  99. package/daemon/dist/db/migrations/046_seat_identity_verdicts.d.ts +8 -5
  100. package/daemon/dist/db/migrations/046_seat_identity_verdicts.d.ts.map +1 -1
  101. package/daemon/dist/db/migrations/046_seat_identity_verdicts.js +8 -5
  102. package/daemon/dist/db/migrations/046_seat_identity_verdicts.js.map +1 -1
  103. package/daemon/dist/db/migrations/078_idle_gate_fired_condition.d.ts +17 -0
  104. package/daemon/dist/db/migrations/078_idle_gate_fired_condition.d.ts.map +1 -0
  105. package/daemon/dist/db/migrations/078_idle_gate_fired_condition.js +21 -0
  106. package/daemon/dist/db/migrations/078_idle_gate_fired_condition.js.map +1 -0
  107. package/daemon/dist/db/migrations/079_workflow_lifecycle_parallel.d.ts +8 -0
  108. package/daemon/dist/db/migrations/079_workflow_lifecycle_parallel.d.ts.map +1 -0
  109. package/daemon/dist/db/migrations/079_workflow_lifecycle_parallel.js +50 -0
  110. package/daemon/dist/db/migrations/079_workflow_lifecycle_parallel.js.map +1 -0
  111. package/daemon/dist/domain/active-occupant.d.ts +12 -1
  112. package/daemon/dist/domain/active-occupant.d.ts.map +1 -1
  113. package/daemon/dist/domain/active-occupant.js +61 -0
  114. package/daemon/dist/domain/active-occupant.js.map +1 -1
  115. package/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
  116. package/daemon/dist/domain/bootstrap-orchestrator.js +8 -1
  117. package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
  118. package/daemon/dist/domain/bundle-context-packs-router.d.ts +3 -3
  119. package/daemon/dist/domain/bundle-context-packs-router.d.ts.map +1 -1
  120. package/daemon/dist/domain/bundle-skills-router.d.ts +3 -0
  121. package/daemon/dist/domain/bundle-skills-router.d.ts.map +1 -1
  122. package/daemon/dist/domain/bundle-skills-router.js +5 -1
  123. package/daemon/dist/domain/bundle-skills-router.js.map +1 -1
  124. package/daemon/dist/domain/claim-service.d.ts +2 -0
  125. package/daemon/dist/domain/claim-service.d.ts.map +1 -1
  126. package/daemon/dist/domain/claim-service.js +33 -12
  127. package/daemon/dist/domain/claim-service.js.map +1 -1
  128. package/daemon/dist/domain/context-packs/context-pack-library-service.d.ts.map +1 -1
  129. package/daemon/dist/domain/context-packs/context-pack-library-service.js +9 -1
  130. package/daemon/dist/domain/context-packs/context-pack-library-service.js.map +1 -1
  131. package/daemon/dist/domain/context-packs/context-pack-types.d.ts +25 -0
  132. package/daemon/dist/domain/context-packs/context-pack-types.d.ts.map +1 -1
  133. package/daemon/dist/domain/context-packs/context-pack-types.js +3 -1
  134. package/daemon/dist/domain/context-packs/context-pack-types.js.map +1 -1
  135. package/daemon/dist/domain/context-packs/manifest-parser.d.ts.map +1 -1
  136. package/daemon/dist/domain/context-packs/manifest-parser.js +143 -3
  137. package/daemon/dist/domain/context-packs/manifest-parser.js.map +1 -1
  138. package/daemon/dist/domain/context-packs/profile-composer.d.ts +22 -1
  139. package/daemon/dist/domain/context-packs/profile-composer.d.ts.map +1 -1
  140. package/daemon/dist/domain/context-packs/profile-composer.js +105 -40
  141. package/daemon/dist/domain/context-packs/profile-composer.js.map +1 -1
  142. package/daemon/dist/domain/context-usage-store.d.ts +4 -0
  143. package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
  144. package/daemon/dist/domain/context-usage-store.js +8 -4
  145. package/daemon/dist/domain/context-usage-store.js.map +1 -1
  146. package/daemon/dist/domain/crash-cart-conductor.d.ts +13 -0
  147. package/daemon/dist/domain/crash-cart-conductor.d.ts.map +1 -1
  148. package/daemon/dist/domain/crash-cart-conductor.js +3 -1
  149. package/daemon/dist/domain/crash-cart-conductor.js.map +1 -1
  150. package/daemon/dist/domain/current-work.d.ts +73 -0
  151. package/daemon/dist/domain/current-work.d.ts.map +1 -0
  152. package/daemon/dist/domain/current-work.js +225 -0
  153. package/daemon/dist/domain/current-work.js.map +1 -0
  154. package/daemon/dist/domain/execution-view.d.ts.map +1 -1
  155. package/daemon/dist/domain/execution-view.js +344 -13
  156. package/daemon/dist/domain/execution-view.js.map +1 -1
  157. package/daemon/dist/domain/gateway/human-registry.d.ts +3 -2
  158. package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
  159. package/daemon/dist/domain/gateway/human-registry.js +113 -18
  160. package/daemon/dist/domain/gateway/human-registry.js.map +1 -1
  161. package/daemon/dist/domain/instance-initialization.d.ts +25 -0
  162. package/daemon/dist/domain/instance-initialization.d.ts.map +1 -0
  163. package/daemon/dist/domain/instance-initialization.js +81 -0
  164. package/daemon/dist/domain/instance-initialization.js.map +1 -0
  165. package/daemon/dist/domain/lifecycle-manifest.d.ts +19 -0
  166. package/daemon/dist/domain/lifecycle-manifest.d.ts.map +1 -0
  167. package/daemon/dist/domain/lifecycle-manifest.js +73 -0
  168. package/daemon/dist/domain/lifecycle-manifest.js.map +1 -0
  169. package/daemon/dist/domain/model-divergence/current-generation-record.d.ts +36 -36
  170. package/daemon/dist/domain/model-divergence/current-generation-record.d.ts.map +1 -1
  171. package/daemon/dist/domain/model-divergence/current-generation-record.js +104 -135
  172. package/daemon/dist/domain/model-divergence/current-generation-record.js.map +1 -1
  173. package/daemon/dist/domain/model-divergence/effective-model-readers.d.ts +3 -2
  174. package/daemon/dist/domain/model-divergence/effective-model-readers.d.ts.map +1 -1
  175. package/daemon/dist/domain/model-divergence/effective-model-readers.js +7 -5
  176. package/daemon/dist/domain/model-divergence/effective-model-readers.js.map +1 -1
  177. package/daemon/dist/domain/native-process-lineage.d.ts +10 -0
  178. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -0
  179. package/daemon/dist/domain/native-process-lineage.js +86 -0
  180. package/daemon/dist/domain/native-process-lineage.js.map +1 -0
  181. package/daemon/dist/domain/native-resume-probe.js +12 -1
  182. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  183. package/daemon/dist/domain/node-inventory.d.ts +2 -0
  184. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  185. package/daemon/dist/domain/node-inventory.js +3 -1
  186. package/daemon/dist/domain/node-inventory.js.map +1 -1
  187. package/daemon/dist/domain/node-launcher.d.ts +3 -0
  188. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  189. package/daemon/dist/domain/node-launcher.js +21 -8
  190. package/daemon/dist/domain/node-launcher.js.map +1 -1
  191. package/daemon/dist/domain/pane-binding-observation.d.ts +22 -0
  192. package/daemon/dist/domain/pane-binding-observation.d.ts.map +1 -0
  193. package/daemon/dist/domain/pane-binding-observation.js +54 -0
  194. package/daemon/dist/domain/pane-binding-observation.js.map +1 -0
  195. package/daemon/dist/domain/policies/idle-gate-qitem.d.ts +5 -5
  196. package/daemon/dist/domain/policies/idle-gate-qitem.d.ts.map +1 -1
  197. package/daemon/dist/domain/policies/idle-gate-qitem.js +130 -22
  198. package/daemon/dist/domain/policies/idle-gate-qitem.js.map +1 -1
  199. package/daemon/dist/domain/policies/parked-owner-consumer.js +1 -1
  200. package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
  201. package/daemon/dist/domain/policies/types.d.ts +12 -0
  202. package/daemon/dist/domain/policies/types.d.ts.map +1 -1
  203. package/daemon/dist/domain/policies/workflow-keepalive.d.ts.map +1 -1
  204. package/daemon/dist/domain/policies/workflow-keepalive.js +16 -2
  205. package/daemon/dist/domain/policies/workflow-keepalive.js.map +1 -1
  206. package/daemon/dist/domain/profile-resolver.d.ts +12 -0
  207. package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
  208. package/daemon/dist/domain/profile-resolver.js +60 -0
  209. package/daemon/dist/domain/profile-resolver.js.map +1 -1
  210. package/daemon/dist/domain/project-lifecycle-compiler.d.ts +35 -0
  211. package/daemon/dist/domain/project-lifecycle-compiler.d.ts.map +1 -0
  212. package/daemon/dist/domain/project-lifecycle-compiler.js +190 -0
  213. package/daemon/dist/domain/project-lifecycle-compiler.js.map +1 -0
  214. package/daemon/dist/domain/provider/claude-usage-reader.d.ts +1 -1
  215. package/daemon/dist/domain/provider/claude-usage-reader.d.ts.map +1 -1
  216. package/daemon/dist/domain/provider/claude-usage-reader.js +28 -18
  217. package/daemon/dist/domain/provider/claude-usage-reader.js.map +1 -1
  218. package/daemon/dist/domain/queue-repository.d.ts +42 -3
  219. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  220. package/daemon/dist/domain/queue-repository.js +177 -16
  221. package/daemon/dist/domain/queue-repository.js.map +1 -1
  222. package/daemon/dist/domain/queue-retention.d.ts +3 -4
  223. package/daemon/dist/domain/queue-retention.d.ts.map +1 -1
  224. package/daemon/dist/domain/queue-retention.js +5 -8
  225. package/daemon/dist/domain/queue-retention.js.map +1 -1
  226. package/daemon/dist/domain/queue-transition-log.d.ts +28 -0
  227. package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
  228. package/daemon/dist/domain/queue-transition-log.js +124 -0
  229. package/daemon/dist/domain/queue-transition-log.js.map +1 -1
  230. package/daemon/dist/domain/queue-wake-repository.d.ts +19 -0
  231. package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
  232. package/daemon/dist/domain/queue-wake-repository.js +33 -0
  233. package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
  234. package/daemon/dist/domain/reconciler.d.ts.map +1 -1
  235. package/daemon/dist/domain/reconciler.js +4 -1
  236. package/daemon/dist/domain/reconciler.js.map +1 -1
  237. package/daemon/dist/domain/rehydrate-eligibility.d.ts +11 -1
  238. package/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
  239. package/daemon/dist/domain/rehydrate-eligibility.js +34 -0
  240. package/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
  241. package/daemon/dist/domain/restore-attempt-receipt.d.ts +34 -0
  242. package/daemon/dist/domain/restore-attempt-receipt.d.ts.map +1 -0
  243. package/daemon/dist/domain/restore-attempt-receipt.js +59 -0
  244. package/daemon/dist/domain/restore-attempt-receipt.js.map +1 -0
  245. package/daemon/dist/domain/restore-orchestrator.d.ts +66 -24
  246. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  247. package/daemon/dist/domain/restore-orchestrator.js +184 -26
  248. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  249. package/daemon/dist/domain/restore-plan-preview.js +2 -2
  250. package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
  251. package/daemon/dist/domain/restore-topology.d.ts +14 -0
  252. package/daemon/dist/domain/restore-topology.d.ts.map +1 -0
  253. package/daemon/dist/domain/restore-topology.js +27 -0
  254. package/daemon/dist/domain/restore-topology.js.map +1 -0
  255. package/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
  256. package/daemon/dist/domain/rig-lifecycle-service.js +9 -0
  257. package/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
  258. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  259. package/daemon/dist/domain/rigspec-exporter.js +2 -0
  260. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  261. package/daemon/dist/domain/rigspec-instantiator.d.ts +34 -9
  262. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  263. package/daemon/dist/domain/rigspec-instantiator.js +131 -84
  264. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  265. package/daemon/dist/domain/rigspec-preflight.d.ts +8 -0
  266. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  267. package/daemon/dist/domain/rigspec-preflight.js +4 -0
  268. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  269. package/daemon/dist/domain/rigspec-schema.d.ts +5 -1
  270. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  271. package/daemon/dist/domain/rigspec-schema.js +41 -2
  272. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  273. package/daemon/dist/domain/seat-attention-reconciler.d.ts +55 -2
  274. package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  275. package/daemon/dist/domain/seat-attention-reconciler.js +246 -16
  276. package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  277. package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
  278. package/daemon/dist/domain/seat-identity-reconciler.js +15 -6
  279. package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
  280. package/daemon/dist/domain/seat-lifecycle-service.d.ts +47 -1
  281. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  282. package/daemon/dist/domain/seat-lifecycle-service.js +525 -29
  283. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  284. package/daemon/dist/domain/session-registry.d.ts +8 -1
  285. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  286. package/daemon/dist/domain/session-registry.js +19 -0
  287. package/daemon/dist/domain/session-registry.js.map +1 -1
  288. package/daemon/dist/domain/session-transport.d.ts +5 -0
  289. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  290. package/daemon/dist/domain/session-transport.js +33 -7
  291. package/daemon/dist/domain/session-transport.js.map +1 -1
  292. package/daemon/dist/domain/skill-catalog.d.ts +81 -0
  293. package/daemon/dist/domain/skill-catalog.d.ts.map +1 -0
  294. package/daemon/dist/domain/skill-catalog.js +827 -0
  295. package/daemon/dist/domain/skill-catalog.js.map +1 -0
  296. package/daemon/dist/domain/skill-discovery.d.ts +3 -0
  297. package/daemon/dist/domain/skill-discovery.d.ts.map +1 -1
  298. package/daemon/dist/domain/skill-discovery.js +1 -1
  299. package/daemon/dist/domain/skill-discovery.js.map +1 -1
  300. package/daemon/dist/domain/snapshot-capture.d.ts +4 -1
  301. package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
  302. package/daemon/dist/domain/snapshot-capture.js +41 -3
  303. package/daemon/dist/domain/snapshot-capture.js.map +1 -1
  304. package/daemon/dist/domain/snapshot-repository.d.ts +15 -1
  305. package/daemon/dist/domain/snapshot-repository.d.ts.map +1 -1
  306. package/daemon/dist/domain/snapshot-repository.js +103 -1
  307. package/daemon/dist/domain/snapshot-repository.js.map +1 -1
  308. package/daemon/dist/domain/startup-orchestrator.d.ts +2 -0
  309. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  310. package/daemon/dist/domain/startup-orchestrator.js +12 -0
  311. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  312. package/daemon/dist/domain/system-world.d.ts +45 -0
  313. package/daemon/dist/domain/system-world.d.ts.map +1 -0
  314. package/daemon/dist/domain/system-world.js +123 -0
  315. package/daemon/dist/domain/system-world.js.map +1 -0
  316. package/daemon/dist/domain/telemetry-state-paths.d.ts +7 -0
  317. package/daemon/dist/domain/telemetry-state-paths.d.ts.map +1 -0
  318. package/daemon/dist/domain/telemetry-state-paths.js +20 -0
  319. package/daemon/dist/domain/telemetry-state-paths.js.map +1 -0
  320. package/daemon/dist/domain/topology-defaults-installer.d.ts +4 -2
  321. package/daemon/dist/domain/topology-defaults-installer.d.ts.map +1 -1
  322. package/daemon/dist/domain/topology-defaults-installer.js +27 -0
  323. package/daemon/dist/domain/topology-defaults-installer.js.map +1 -1
  324. package/daemon/dist/domain/types.d.ts +103 -4
  325. package/daemon/dist/domain/types.d.ts.map +1 -1
  326. package/daemon/dist/domain/types.js.map +1 -1
  327. package/daemon/dist/domain/up-command-router.d.ts.map +1 -1
  328. package/daemon/dist/domain/up-command-router.js +19 -0
  329. package/daemon/dist/domain/up-command-router.js.map +1 -1
  330. package/daemon/dist/domain/user-settings/settings-store.d.ts +8 -3
  331. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  332. package/daemon/dist/domain/user-settings/settings-store.js +65 -29
  333. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  334. package/daemon/dist/domain/watchdog-jobs-repository.d.ts +9 -0
  335. package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
  336. package/daemon/dist/domain/watchdog-jobs-repository.js +15 -2
  337. package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
  338. package/daemon/dist/domain/watchdog-policy-engine.d.ts +14 -23
  339. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  340. package/daemon/dist/domain/watchdog-policy-engine.js +91 -226
  341. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  342. package/daemon/dist/domain/workflow-boot-sweep.d.ts.map +1 -1
  343. package/daemon/dist/domain/workflow-boot-sweep.js +20 -6
  344. package/daemon/dist/domain/workflow-boot-sweep.js.map +1 -1
  345. package/daemon/dist/domain/workflow-instance-store.d.ts +33 -1
  346. package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
  347. package/daemon/dist/domain/workflow-instance-store.js +127 -2
  348. package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
  349. package/daemon/dist/domain/workflow-keepalive-arming.d.ts +7 -5
  350. package/daemon/dist/domain/workflow-keepalive-arming.d.ts.map +1 -1
  351. package/daemon/dist/domain/workflow-keepalive-arming.js +27 -16
  352. package/daemon/dist/domain/workflow-keepalive-arming.js.map +1 -1
  353. package/daemon/dist/domain/workflow-projector.d.ts +6 -2
  354. package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
  355. package/daemon/dist/domain/workflow-projector.js +271 -2
  356. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  357. package/daemon/dist/domain/workflow-runtime.d.ts +62 -2
  358. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  359. package/daemon/dist/domain/workflow-runtime.js +334 -18
  360. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  361. package/daemon/dist/domain/workflow-spec-cache.d.ts +9 -1
  362. package/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
  363. package/daemon/dist/domain/workflow-spec-cache.js +85 -0
  364. package/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
  365. package/daemon/dist/domain/workflow-types.d.ts +38 -1
  366. package/daemon/dist/domain/workflow-types.d.ts.map +1 -1
  367. package/daemon/dist/domain/workflow-types.js.map +1 -1
  368. package/daemon/dist/domain/workflow-validator.d.ts.map +1 -1
  369. package/daemon/dist/domain/workflow-validator.js +20 -3
  370. package/daemon/dist/domain/workflow-validator.js.map +1 -1
  371. package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts +38 -9
  372. package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
  373. package/daemon/dist/domain/workspace/default-workspace-scaffold.js +93 -347
  374. package/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
  375. package/daemon/dist/index.d.ts.map +1 -1
  376. package/daemon/dist/index.js +13 -0
  377. package/daemon/dist/index.js.map +1 -1
  378. package/daemon/dist/instance-initialization-surface.d.ts +3 -0
  379. package/daemon/dist/instance-initialization-surface.d.ts.map +1 -0
  380. package/daemon/dist/instance-initialization-surface.js +3 -0
  381. package/daemon/dist/instance-initialization-surface.js.map +1 -0
  382. package/daemon/dist/project-lifecycle-surface.d.ts +3 -0
  383. package/daemon/dist/project-lifecycle-surface.d.ts.map +1 -0
  384. package/daemon/dist/project-lifecycle-surface.js +3 -0
  385. package/daemon/dist/project-lifecycle-surface.js.map +1 -0
  386. package/daemon/dist/routes/bundles.js +10 -9
  387. package/daemon/dist/routes/bundles.js.map +1 -1
  388. package/daemon/dist/routes/config.d.ts.map +1 -1
  389. package/daemon/dist/routes/config.js +27 -49
  390. package/daemon/dist/routes/config.js.map +1 -1
  391. package/daemon/dist/routes/context-packs.d.ts.map +1 -1
  392. package/daemon/dist/routes/context-packs.js +114 -16
  393. package/daemon/dist/routes/context-packs.js.map +1 -1
  394. package/daemon/dist/routes/crash-cart.js +3 -0
  395. package/daemon/dist/routes/crash-cart.js.map +1 -1
  396. package/daemon/dist/routes/queue.d.ts.map +1 -1
  397. package/daemon/dist/routes/queue.js +51 -10
  398. package/daemon/dist/routes/queue.js.map +1 -1
  399. package/daemon/dist/routes/rigs.js +22 -4
  400. package/daemon/dist/routes/rigs.js.map +1 -1
  401. package/daemon/dist/routes/rigspec.d.ts.map +1 -1
  402. package/daemon/dist/routes/rigspec.js +46 -2
  403. package/daemon/dist/routes/rigspec.js.map +1 -1
  404. package/daemon/dist/routes/seat.js +21 -1
  405. package/daemon/dist/routes/seat.js.map +1 -1
  406. package/daemon/dist/routes/sessions.js +16 -6
  407. package/daemon/dist/routes/sessions.js.map +1 -1
  408. package/daemon/dist/routes/snapshots.d.ts.map +1 -1
  409. package/daemon/dist/routes/snapshots.js +41 -3
  410. package/daemon/dist/routes/snapshots.js.map +1 -1
  411. package/daemon/dist/routes/up.js +22 -4
  412. package/daemon/dist/routes/up.js.map +1 -1
  413. package/daemon/dist/routes/watchdog.d.ts.map +1 -1
  414. package/daemon/dist/routes/watchdog.js +7 -6
  415. package/daemon/dist/routes/watchdog.js.map +1 -1
  416. package/daemon/dist/routes/workflow.d.ts.map +1 -1
  417. package/daemon/dist/routes/workflow.js +104 -39
  418. package/daemon/dist/routes/workflow.js.map +1 -1
  419. package/daemon/dist/server.d.ts +2 -0
  420. package/daemon/dist/server.d.ts.map +1 -1
  421. package/daemon/dist/server.js +1 -0
  422. package/daemon/dist/server.js.map +1 -1
  423. package/daemon/dist/skill-loadout-surface.d.ts +3 -0
  424. package/daemon/dist/skill-loadout-surface.d.ts.map +1 -0
  425. package/daemon/dist/skill-loadout-surface.js +2 -0
  426. package/daemon/dist/skill-loadout-surface.js.map +1 -0
  427. package/daemon/dist/startup.d.ts.map +1 -1
  428. package/daemon/dist/startup.js +88 -71
  429. package/daemon/dist/startup.js.map +1 -1
  430. package/daemon/dist/system-world-surface.d.ts +2 -0
  431. package/daemon/dist/system-world-surface.d.ts.map +1 -0
  432. package/daemon/dist/system-world-surface.js +2 -0
  433. package/daemon/dist/system-world-surface.js.map +1 -0
  434. package/daemon/docs/reference/agent-spec.md +33 -0
  435. package/daemon/docs/reference/chain-file-convention.md +17 -12
  436. package/daemon/docs/reference/getting-started.md +2 -1
  437. package/daemon/docs/reference/instance-layout.md +106 -0
  438. package/daemon/docs/reference/mission-install.md +12 -2
  439. package/daemon/docs/reference/project-workspace.md +66 -40
  440. package/daemon/docs/reference/release-boundary.md +29 -5
  441. package/daemon/docs/reference/sdlc-conventions.md +6 -0
  442. package/daemon/specs/agents/shared/skills/core/openrig-skills/SKILL.md +4 -2
  443. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +189 -343
  444. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/scripts/backup-sqlite.mjs +62 -0
  445. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/scripts/inspect-upgrade.mjs +40 -0
  446. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs +1419 -0
  447. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/scripts/refresh-managed-plugin.mjs +151 -0
  448. package/daemon/specs/rigs/preview/product-team/topology/instance/CRAFT.md +4 -4
  449. package/daemon/specs/rigs/preview/product-team/topology/rig/ORCHESTRATION-CRAFT.md +3 -3
  450. package/dist/build-info.js +3 -3
  451. package/dist/commands/config-init-workspace.d.ts +4 -23
  452. package/dist/commands/config-init-workspace.d.ts.map +1 -1
  453. package/dist/commands/config-init-workspace.js +14 -576
  454. package/dist/commands/config-init-workspace.js.map +1 -1
  455. package/dist/commands/config.d.ts.map +1 -1
  456. package/dist/commands/config.js +6 -4
  457. package/dist/commands/config.js.map +1 -1
  458. package/dist/commands/context.d.ts.map +1 -1
  459. package/dist/commands/context.js +167 -15
  460. package/dist/commands/context.js.map +1 -1
  461. package/dist/commands/daemon.d.ts.map +1 -1
  462. package/dist/commands/daemon.js +16 -0
  463. package/dist/commands/daemon.js.map +1 -1
  464. package/dist/commands/import.d.ts.map +1 -1
  465. package/dist/commands/import.js +27 -1
  466. package/dist/commands/import.js.map +1 -1
  467. package/dist/commands/launch.d.ts.map +1 -1
  468. package/dist/commands/launch.js +51 -4
  469. package/dist/commands/launch.js.map +1 -1
  470. package/dist/commands/restore.d.ts.map +1 -1
  471. package/dist/commands/restore.js +43 -3
  472. package/dist/commands/restore.js.map +1 -1
  473. package/dist/commands/scope.d.ts.map +1 -1
  474. package/dist/commands/scope.js +169 -79
  475. package/dist/commands/scope.js.map +1 -1
  476. package/dist/commands/seat.d.ts.map +1 -1
  477. package/dist/commands/seat.js +30 -0
  478. package/dist/commands/seat.js.map +1 -1
  479. package/dist/commands/skill.d.ts.map +1 -1
  480. package/dist/commands/skill.js +61 -0
  481. package/dist/commands/skill.js.map +1 -1
  482. package/dist/commands/snapshot.d.ts.map +1 -1
  483. package/dist/commands/snapshot.js +4 -2
  484. package/dist/commands/snapshot.js.map +1 -1
  485. package/dist/commands/start.d.ts.map +1 -1
  486. package/dist/commands/start.js +3 -0
  487. package/dist/commands/start.js.map +1 -1
  488. package/dist/commands/up.d.ts.map +1 -1
  489. package/dist/commands/up.js +3 -0
  490. package/dist/commands/up.js.map +1 -1
  491. package/dist/commands/walk.d.ts.map +1 -1
  492. package/dist/commands/walk.js +3 -0
  493. package/dist/commands/walk.js.map +1 -1
  494. package/dist/commands/watchdog.d.ts.map +1 -1
  495. package/dist/commands/watchdog.js +51 -3
  496. package/dist/commands/watchdog.js.map +1 -1
  497. package/dist/commands/workflow-render.d.ts +31 -0
  498. package/dist/commands/workflow-render.d.ts.map +1 -1
  499. package/dist/commands/workflow-render.js +84 -6
  500. package/dist/commands/workflow-render.js.map +1 -1
  501. package/dist/commands/workflow.d.ts.map +1 -1
  502. package/dist/commands/workflow.js +96 -8
  503. package/dist/commands/workflow.js.map +1 -1
  504. package/dist/config-store.d.ts +9 -4
  505. package/dist/config-store.d.ts.map +1 -1
  506. package/dist/config-store.js +67 -30
  507. package/dist/config-store.js.map +1 -1
  508. package/dist/daemon-lifecycle.d.ts +8 -15
  509. package/dist/daemon-lifecycle.d.ts.map +1 -1
  510. package/dist/daemon-lifecycle.js +24 -31
  511. package/dist/daemon-lifecycle.js.map +1 -1
  512. package/dist/front-door.d.ts.map +1 -1
  513. package/dist/front-door.js +16 -4
  514. package/dist/front-door.js.map +1 -1
  515. package/dist/lib/scope/mission-composition.d.ts +16 -0
  516. package/dist/lib/scope/mission-composition.d.ts.map +1 -0
  517. package/dist/lib/scope/mission-composition.js +110 -0
  518. package/dist/lib/scope/mission-composition.js.map +1 -0
  519. package/dist/lib/scope/scope-fs.d.ts +5 -0
  520. package/dist/lib/scope/scope-fs.d.ts.map +1 -1
  521. package/dist/lib/scope/scope-fs.js +34 -4
  522. package/dist/lib/scope/scope-fs.js.map +1 -1
  523. package/dist/lib/topology-trace.d.ts +3 -2
  524. package/dist/lib/topology-trace.d.ts.map +1 -1
  525. package/dist/lib/topology-trace.js +12 -2
  526. package/dist/lib/topology-trace.js.map +1 -1
  527. package/dist/lib/work-install.d.ts +17 -0
  528. package/dist/lib/work-install.d.ts.map +1 -1
  529. package/dist/lib/work-install.js +111 -34
  530. package/dist/lib/work-install.js.map +1 -1
  531. package/node_modules/@openrig/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  532. package/node_modules/@openrig/daemon/dist/adapters/claude-code-adapter.js +4 -2
  533. package/node_modules/@openrig/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  534. package/node_modules/@openrig/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  535. package/node_modules/@openrig/daemon/dist/adapters/codex-runtime-adapter.js +249 -2
  536. package/node_modules/@openrig/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  537. package/node_modules/@openrig/daemon/dist/adapters/tmux.d.ts +6 -5
  538. package/node_modules/@openrig/daemon/dist/adapters/tmux.d.ts.map +1 -1
  539. package/node_modules/@openrig/daemon/dist/adapters/tmux.js +29 -12
  540. package/node_modules/@openrig/daemon/dist/adapters/tmux.js.map +1 -1
  541. package/node_modules/@openrig/daemon/dist/build-info.js +3 -3
  542. package/node_modules/@openrig/daemon/dist/db/all-migrations.d.ts +1 -1
  543. package/node_modules/@openrig/daemon/dist/db/all-migrations.d.ts.map +1 -1
  544. package/node_modules/@openrig/daemon/dist/db/all-migrations.js +5 -1
  545. package/node_modules/@openrig/daemon/dist/db/all-migrations.js.map +1 -1
  546. package/node_modules/@openrig/daemon/dist/db/migrations/046_seat_identity_verdicts.d.ts +8 -5
  547. package/node_modules/@openrig/daemon/dist/db/migrations/046_seat_identity_verdicts.d.ts.map +1 -1
  548. package/node_modules/@openrig/daemon/dist/db/migrations/046_seat_identity_verdicts.js +8 -5
  549. package/node_modules/@openrig/daemon/dist/db/migrations/046_seat_identity_verdicts.js.map +1 -1
  550. package/node_modules/@openrig/daemon/dist/db/migrations/078_idle_gate_fired_condition.d.ts +17 -0
  551. package/node_modules/@openrig/daemon/dist/db/migrations/078_idle_gate_fired_condition.d.ts.map +1 -0
  552. package/node_modules/@openrig/daemon/dist/db/migrations/078_idle_gate_fired_condition.js +21 -0
  553. package/node_modules/@openrig/daemon/dist/db/migrations/078_idle_gate_fired_condition.js.map +1 -0
  554. package/node_modules/@openrig/daemon/dist/db/migrations/079_workflow_lifecycle_parallel.d.ts +8 -0
  555. package/node_modules/@openrig/daemon/dist/db/migrations/079_workflow_lifecycle_parallel.d.ts.map +1 -0
  556. package/node_modules/@openrig/daemon/dist/db/migrations/079_workflow_lifecycle_parallel.js +50 -0
  557. package/node_modules/@openrig/daemon/dist/db/migrations/079_workflow_lifecycle_parallel.js.map +1 -0
  558. package/node_modules/@openrig/daemon/dist/domain/active-occupant.d.ts +12 -1
  559. package/node_modules/@openrig/daemon/dist/domain/active-occupant.d.ts.map +1 -1
  560. package/node_modules/@openrig/daemon/dist/domain/active-occupant.js +61 -0
  561. package/node_modules/@openrig/daemon/dist/domain/active-occupant.js.map +1 -1
  562. package/node_modules/@openrig/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
  563. package/node_modules/@openrig/daemon/dist/domain/bootstrap-orchestrator.js +8 -1
  564. package/node_modules/@openrig/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
  565. package/node_modules/@openrig/daemon/dist/domain/bundle-context-packs-router.d.ts +3 -3
  566. package/node_modules/@openrig/daemon/dist/domain/bundle-context-packs-router.d.ts.map +1 -1
  567. package/node_modules/@openrig/daemon/dist/domain/bundle-skills-router.d.ts +3 -0
  568. package/node_modules/@openrig/daemon/dist/domain/bundle-skills-router.d.ts.map +1 -1
  569. package/node_modules/@openrig/daemon/dist/domain/bundle-skills-router.js +5 -1
  570. package/node_modules/@openrig/daemon/dist/domain/bundle-skills-router.js.map +1 -1
  571. package/node_modules/@openrig/daemon/dist/domain/claim-service.d.ts +2 -0
  572. package/node_modules/@openrig/daemon/dist/domain/claim-service.d.ts.map +1 -1
  573. package/node_modules/@openrig/daemon/dist/domain/claim-service.js +33 -12
  574. package/node_modules/@openrig/daemon/dist/domain/claim-service.js.map +1 -1
  575. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-library-service.d.ts.map +1 -1
  576. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-library-service.js +9 -1
  577. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-library-service.js.map +1 -1
  578. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-types.d.ts +25 -0
  579. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-types.d.ts.map +1 -1
  580. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-types.js +3 -1
  581. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-types.js.map +1 -1
  582. package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.d.ts.map +1 -1
  583. package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.js +143 -3
  584. package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.js.map +1 -1
  585. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.d.ts +22 -1
  586. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.d.ts.map +1 -1
  587. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.js +105 -40
  588. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.js.map +1 -1
  589. package/node_modules/@openrig/daemon/dist/domain/context-usage-store.d.ts +4 -0
  590. package/node_modules/@openrig/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
  591. package/node_modules/@openrig/daemon/dist/domain/context-usage-store.js +8 -4
  592. package/node_modules/@openrig/daemon/dist/domain/context-usage-store.js.map +1 -1
  593. package/node_modules/@openrig/daemon/dist/domain/crash-cart-conductor.d.ts +13 -0
  594. package/node_modules/@openrig/daemon/dist/domain/crash-cart-conductor.d.ts.map +1 -1
  595. package/node_modules/@openrig/daemon/dist/domain/crash-cart-conductor.js +3 -1
  596. package/node_modules/@openrig/daemon/dist/domain/crash-cart-conductor.js.map +1 -1
  597. package/node_modules/@openrig/daemon/dist/domain/current-work.d.ts +73 -0
  598. package/node_modules/@openrig/daemon/dist/domain/current-work.d.ts.map +1 -0
  599. package/node_modules/@openrig/daemon/dist/domain/current-work.js +225 -0
  600. package/node_modules/@openrig/daemon/dist/domain/current-work.js.map +1 -0
  601. package/node_modules/@openrig/daemon/dist/domain/execution-view.d.ts.map +1 -1
  602. package/node_modules/@openrig/daemon/dist/domain/execution-view.js +344 -13
  603. package/node_modules/@openrig/daemon/dist/domain/execution-view.js.map +1 -1
  604. package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.d.ts +3 -2
  605. package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
  606. package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.js +113 -18
  607. package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.js.map +1 -1
  608. package/node_modules/@openrig/daemon/dist/domain/instance-initialization.d.ts +25 -0
  609. package/node_modules/@openrig/daemon/dist/domain/instance-initialization.d.ts.map +1 -0
  610. package/node_modules/@openrig/daemon/dist/domain/instance-initialization.js +81 -0
  611. package/node_modules/@openrig/daemon/dist/domain/instance-initialization.js.map +1 -0
  612. package/node_modules/@openrig/daemon/dist/domain/lifecycle-manifest.d.ts +19 -0
  613. package/node_modules/@openrig/daemon/dist/domain/lifecycle-manifest.d.ts.map +1 -0
  614. package/node_modules/@openrig/daemon/dist/domain/lifecycle-manifest.js +73 -0
  615. package/node_modules/@openrig/daemon/dist/domain/lifecycle-manifest.js.map +1 -0
  616. package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.d.ts +36 -36
  617. package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.d.ts.map +1 -1
  618. package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.js +104 -135
  619. package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.js.map +1 -1
  620. package/node_modules/@openrig/daemon/dist/domain/model-divergence/effective-model-readers.d.ts +3 -2
  621. package/node_modules/@openrig/daemon/dist/domain/model-divergence/effective-model-readers.d.ts.map +1 -1
  622. package/node_modules/@openrig/daemon/dist/domain/model-divergence/effective-model-readers.js +7 -5
  623. package/node_modules/@openrig/daemon/dist/domain/model-divergence/effective-model-readers.js.map +1 -1
  624. package/node_modules/@openrig/daemon/dist/domain/native-process-lineage.d.ts +10 -0
  625. package/node_modules/@openrig/daemon/dist/domain/native-process-lineage.d.ts.map +1 -0
  626. package/node_modules/@openrig/daemon/dist/domain/native-process-lineage.js +86 -0
  627. package/node_modules/@openrig/daemon/dist/domain/native-process-lineage.js.map +1 -0
  628. package/node_modules/@openrig/daemon/dist/domain/native-resume-probe.js +12 -1
  629. package/node_modules/@openrig/daemon/dist/domain/native-resume-probe.js.map +1 -1
  630. package/node_modules/@openrig/daemon/dist/domain/node-inventory.d.ts +2 -0
  631. package/node_modules/@openrig/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  632. package/node_modules/@openrig/daemon/dist/domain/node-inventory.js +3 -1
  633. package/node_modules/@openrig/daemon/dist/domain/node-inventory.js.map +1 -1
  634. package/node_modules/@openrig/daemon/dist/domain/node-launcher.d.ts +3 -0
  635. package/node_modules/@openrig/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  636. package/node_modules/@openrig/daemon/dist/domain/node-launcher.js +21 -8
  637. package/node_modules/@openrig/daemon/dist/domain/node-launcher.js.map +1 -1
  638. package/node_modules/@openrig/daemon/dist/domain/pane-binding-observation.d.ts +22 -0
  639. package/node_modules/@openrig/daemon/dist/domain/pane-binding-observation.d.ts.map +1 -0
  640. package/node_modules/@openrig/daemon/dist/domain/pane-binding-observation.js +54 -0
  641. package/node_modules/@openrig/daemon/dist/domain/pane-binding-observation.js.map +1 -0
  642. package/node_modules/@openrig/daemon/dist/domain/policies/idle-gate-qitem.d.ts +5 -5
  643. package/node_modules/@openrig/daemon/dist/domain/policies/idle-gate-qitem.d.ts.map +1 -1
  644. package/node_modules/@openrig/daemon/dist/domain/policies/idle-gate-qitem.js +130 -22
  645. package/node_modules/@openrig/daemon/dist/domain/policies/idle-gate-qitem.js.map +1 -1
  646. package/node_modules/@openrig/daemon/dist/domain/policies/parked-owner-consumer.js +1 -1
  647. package/node_modules/@openrig/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
  648. package/node_modules/@openrig/daemon/dist/domain/policies/types.d.ts +12 -0
  649. package/node_modules/@openrig/daemon/dist/domain/policies/types.d.ts.map +1 -1
  650. package/node_modules/@openrig/daemon/dist/domain/policies/workflow-keepalive.d.ts.map +1 -1
  651. package/node_modules/@openrig/daemon/dist/domain/policies/workflow-keepalive.js +16 -2
  652. package/node_modules/@openrig/daemon/dist/domain/policies/workflow-keepalive.js.map +1 -1
  653. package/node_modules/@openrig/daemon/dist/domain/profile-resolver.d.ts +12 -0
  654. package/node_modules/@openrig/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
  655. package/node_modules/@openrig/daemon/dist/domain/profile-resolver.js +60 -0
  656. package/node_modules/@openrig/daemon/dist/domain/profile-resolver.js.map +1 -1
  657. package/node_modules/@openrig/daemon/dist/domain/project-lifecycle-compiler.d.ts +35 -0
  658. package/node_modules/@openrig/daemon/dist/domain/project-lifecycle-compiler.d.ts.map +1 -0
  659. package/node_modules/@openrig/daemon/dist/domain/project-lifecycle-compiler.js +190 -0
  660. package/node_modules/@openrig/daemon/dist/domain/project-lifecycle-compiler.js.map +1 -0
  661. package/node_modules/@openrig/daemon/dist/domain/provider/claude-usage-reader.d.ts +1 -1
  662. package/node_modules/@openrig/daemon/dist/domain/provider/claude-usage-reader.d.ts.map +1 -1
  663. package/node_modules/@openrig/daemon/dist/domain/provider/claude-usage-reader.js +28 -18
  664. package/node_modules/@openrig/daemon/dist/domain/provider/claude-usage-reader.js.map +1 -1
  665. package/node_modules/@openrig/daemon/dist/domain/queue-repository.d.ts +42 -3
  666. package/node_modules/@openrig/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  667. package/node_modules/@openrig/daemon/dist/domain/queue-repository.js +177 -16
  668. package/node_modules/@openrig/daemon/dist/domain/queue-repository.js.map +1 -1
  669. package/node_modules/@openrig/daemon/dist/domain/queue-retention.d.ts +3 -4
  670. package/node_modules/@openrig/daemon/dist/domain/queue-retention.d.ts.map +1 -1
  671. package/node_modules/@openrig/daemon/dist/domain/queue-retention.js +5 -8
  672. package/node_modules/@openrig/daemon/dist/domain/queue-retention.js.map +1 -1
  673. package/node_modules/@openrig/daemon/dist/domain/queue-transition-log.d.ts +28 -0
  674. package/node_modules/@openrig/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
  675. package/node_modules/@openrig/daemon/dist/domain/queue-transition-log.js +124 -0
  676. package/node_modules/@openrig/daemon/dist/domain/queue-transition-log.js.map +1 -1
  677. package/node_modules/@openrig/daemon/dist/domain/queue-wake-repository.d.ts +19 -0
  678. package/node_modules/@openrig/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
  679. package/node_modules/@openrig/daemon/dist/domain/queue-wake-repository.js +33 -0
  680. package/node_modules/@openrig/daemon/dist/domain/queue-wake-repository.js.map +1 -1
  681. package/node_modules/@openrig/daemon/dist/domain/reconciler.d.ts.map +1 -1
  682. package/node_modules/@openrig/daemon/dist/domain/reconciler.js +4 -1
  683. package/node_modules/@openrig/daemon/dist/domain/reconciler.js.map +1 -1
  684. package/node_modules/@openrig/daemon/dist/domain/rehydrate-eligibility.d.ts +11 -1
  685. package/node_modules/@openrig/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
  686. package/node_modules/@openrig/daemon/dist/domain/rehydrate-eligibility.js +34 -0
  687. package/node_modules/@openrig/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
  688. package/node_modules/@openrig/daemon/dist/domain/restore-attempt-receipt.d.ts +34 -0
  689. package/node_modules/@openrig/daemon/dist/domain/restore-attempt-receipt.d.ts.map +1 -0
  690. package/node_modules/@openrig/daemon/dist/domain/restore-attempt-receipt.js +59 -0
  691. package/node_modules/@openrig/daemon/dist/domain/restore-attempt-receipt.js.map +1 -0
  692. package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.d.ts +66 -24
  693. package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  694. package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.js +184 -26
  695. package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  696. package/node_modules/@openrig/daemon/dist/domain/restore-plan-preview.js +2 -2
  697. package/node_modules/@openrig/daemon/dist/domain/restore-plan-preview.js.map +1 -1
  698. package/node_modules/@openrig/daemon/dist/domain/restore-topology.d.ts +14 -0
  699. package/node_modules/@openrig/daemon/dist/domain/restore-topology.d.ts.map +1 -0
  700. package/node_modules/@openrig/daemon/dist/domain/restore-topology.js +27 -0
  701. package/node_modules/@openrig/daemon/dist/domain/restore-topology.js.map +1 -0
  702. package/node_modules/@openrig/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
  703. package/node_modules/@openrig/daemon/dist/domain/rig-lifecycle-service.js +9 -0
  704. package/node_modules/@openrig/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
  705. package/node_modules/@openrig/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  706. package/node_modules/@openrig/daemon/dist/domain/rigspec-exporter.js +2 -0
  707. package/node_modules/@openrig/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  708. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.d.ts +34 -9
  709. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  710. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.js +131 -84
  711. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  712. package/node_modules/@openrig/daemon/dist/domain/rigspec-preflight.d.ts +8 -0
  713. package/node_modules/@openrig/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  714. package/node_modules/@openrig/daemon/dist/domain/rigspec-preflight.js +4 -0
  715. package/node_modules/@openrig/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  716. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.d.ts +5 -1
  717. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  718. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.js +41 -2
  719. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.js.map +1 -1
  720. package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.d.ts +55 -2
  721. package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  722. package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.js +246 -16
  723. package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  724. package/node_modules/@openrig/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
  725. package/node_modules/@openrig/daemon/dist/domain/seat-identity-reconciler.js +15 -6
  726. package/node_modules/@openrig/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
  727. package/node_modules/@openrig/daemon/dist/domain/seat-lifecycle-service.d.ts +47 -1
  728. package/node_modules/@openrig/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  729. package/node_modules/@openrig/daemon/dist/domain/seat-lifecycle-service.js +525 -29
  730. package/node_modules/@openrig/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  731. package/node_modules/@openrig/daemon/dist/domain/session-registry.d.ts +8 -1
  732. package/node_modules/@openrig/daemon/dist/domain/session-registry.d.ts.map +1 -1
  733. package/node_modules/@openrig/daemon/dist/domain/session-registry.js +19 -0
  734. package/node_modules/@openrig/daemon/dist/domain/session-registry.js.map +1 -1
  735. package/node_modules/@openrig/daemon/dist/domain/session-transport.d.ts +5 -0
  736. package/node_modules/@openrig/daemon/dist/domain/session-transport.d.ts.map +1 -1
  737. package/node_modules/@openrig/daemon/dist/domain/session-transport.js +33 -7
  738. package/node_modules/@openrig/daemon/dist/domain/session-transport.js.map +1 -1
  739. package/node_modules/@openrig/daemon/dist/domain/skill-catalog.d.ts +81 -0
  740. package/node_modules/@openrig/daemon/dist/domain/skill-catalog.d.ts.map +1 -0
  741. package/node_modules/@openrig/daemon/dist/domain/skill-catalog.js +827 -0
  742. package/node_modules/@openrig/daemon/dist/domain/skill-catalog.js.map +1 -0
  743. package/node_modules/@openrig/daemon/dist/domain/skill-discovery.d.ts +3 -0
  744. package/node_modules/@openrig/daemon/dist/domain/skill-discovery.d.ts.map +1 -1
  745. package/node_modules/@openrig/daemon/dist/domain/skill-discovery.js +1 -1
  746. package/node_modules/@openrig/daemon/dist/domain/skill-discovery.js.map +1 -1
  747. package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.d.ts +4 -1
  748. package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
  749. package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.js +41 -3
  750. package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.js.map +1 -1
  751. package/node_modules/@openrig/daemon/dist/domain/snapshot-repository.d.ts +15 -1
  752. package/node_modules/@openrig/daemon/dist/domain/snapshot-repository.d.ts.map +1 -1
  753. package/node_modules/@openrig/daemon/dist/domain/snapshot-repository.js +103 -1
  754. package/node_modules/@openrig/daemon/dist/domain/snapshot-repository.js.map +1 -1
  755. package/node_modules/@openrig/daemon/dist/domain/startup-orchestrator.d.ts +2 -0
  756. package/node_modules/@openrig/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  757. package/node_modules/@openrig/daemon/dist/domain/startup-orchestrator.js +12 -0
  758. package/node_modules/@openrig/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  759. package/node_modules/@openrig/daemon/dist/domain/system-world.d.ts +45 -0
  760. package/node_modules/@openrig/daemon/dist/domain/system-world.d.ts.map +1 -0
  761. package/node_modules/@openrig/daemon/dist/domain/system-world.js +123 -0
  762. package/node_modules/@openrig/daemon/dist/domain/system-world.js.map +1 -0
  763. package/node_modules/@openrig/daemon/dist/domain/telemetry-state-paths.d.ts +7 -0
  764. package/node_modules/@openrig/daemon/dist/domain/telemetry-state-paths.d.ts.map +1 -0
  765. package/node_modules/@openrig/daemon/dist/domain/telemetry-state-paths.js +20 -0
  766. package/node_modules/@openrig/daemon/dist/domain/telemetry-state-paths.js.map +1 -0
  767. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.d.ts +4 -2
  768. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.d.ts.map +1 -1
  769. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.js +27 -0
  770. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.js.map +1 -1
  771. package/node_modules/@openrig/daemon/dist/domain/types.d.ts +103 -4
  772. package/node_modules/@openrig/daemon/dist/domain/types.d.ts.map +1 -1
  773. package/node_modules/@openrig/daemon/dist/domain/types.js.map +1 -1
  774. package/node_modules/@openrig/daemon/dist/domain/up-command-router.d.ts.map +1 -1
  775. package/node_modules/@openrig/daemon/dist/domain/up-command-router.js +19 -0
  776. package/node_modules/@openrig/daemon/dist/domain/up-command-router.js.map +1 -1
  777. package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.d.ts +8 -3
  778. package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  779. package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.js +65 -29
  780. package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  781. package/node_modules/@openrig/daemon/dist/domain/watchdog-jobs-repository.d.ts +9 -0
  782. package/node_modules/@openrig/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
  783. package/node_modules/@openrig/daemon/dist/domain/watchdog-jobs-repository.js +15 -2
  784. package/node_modules/@openrig/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
  785. package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.d.ts +14 -23
  786. package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  787. package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.js +91 -226
  788. package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  789. package/node_modules/@openrig/daemon/dist/domain/workflow-boot-sweep.d.ts.map +1 -1
  790. package/node_modules/@openrig/daemon/dist/domain/workflow-boot-sweep.js +20 -6
  791. package/node_modules/@openrig/daemon/dist/domain/workflow-boot-sweep.js.map +1 -1
  792. package/node_modules/@openrig/daemon/dist/domain/workflow-instance-store.d.ts +33 -1
  793. package/node_modules/@openrig/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
  794. package/node_modules/@openrig/daemon/dist/domain/workflow-instance-store.js +127 -2
  795. package/node_modules/@openrig/daemon/dist/domain/workflow-instance-store.js.map +1 -1
  796. package/node_modules/@openrig/daemon/dist/domain/workflow-keepalive-arming.d.ts +7 -5
  797. package/node_modules/@openrig/daemon/dist/domain/workflow-keepalive-arming.d.ts.map +1 -1
  798. package/node_modules/@openrig/daemon/dist/domain/workflow-keepalive-arming.js +27 -16
  799. package/node_modules/@openrig/daemon/dist/domain/workflow-keepalive-arming.js.map +1 -1
  800. package/node_modules/@openrig/daemon/dist/domain/workflow-projector.d.ts +6 -2
  801. package/node_modules/@openrig/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
  802. package/node_modules/@openrig/daemon/dist/domain/workflow-projector.js +271 -2
  803. package/node_modules/@openrig/daemon/dist/domain/workflow-projector.js.map +1 -1
  804. package/node_modules/@openrig/daemon/dist/domain/workflow-runtime.d.ts +62 -2
  805. package/node_modules/@openrig/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  806. package/node_modules/@openrig/daemon/dist/domain/workflow-runtime.js +334 -18
  807. package/node_modules/@openrig/daemon/dist/domain/workflow-runtime.js.map +1 -1
  808. package/node_modules/@openrig/daemon/dist/domain/workflow-spec-cache.d.ts +9 -1
  809. package/node_modules/@openrig/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
  810. package/node_modules/@openrig/daemon/dist/domain/workflow-spec-cache.js +85 -0
  811. package/node_modules/@openrig/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
  812. package/node_modules/@openrig/daemon/dist/domain/workflow-types.d.ts +38 -1
  813. package/node_modules/@openrig/daemon/dist/domain/workflow-types.d.ts.map +1 -1
  814. package/node_modules/@openrig/daemon/dist/domain/workflow-types.js.map +1 -1
  815. package/node_modules/@openrig/daemon/dist/domain/workflow-validator.d.ts.map +1 -1
  816. package/node_modules/@openrig/daemon/dist/domain/workflow-validator.js +20 -3
  817. package/node_modules/@openrig/daemon/dist/domain/workflow-validator.js.map +1 -1
  818. package/node_modules/@openrig/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts +38 -9
  819. package/node_modules/@openrig/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
  820. package/node_modules/@openrig/daemon/dist/domain/workspace/default-workspace-scaffold.js +93 -347
  821. package/node_modules/@openrig/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
  822. package/node_modules/@openrig/daemon/dist/index.d.ts.map +1 -1
  823. package/node_modules/@openrig/daemon/dist/index.js +13 -0
  824. package/node_modules/@openrig/daemon/dist/index.js.map +1 -1
  825. package/node_modules/@openrig/daemon/dist/instance-initialization-surface.d.ts +3 -0
  826. package/node_modules/@openrig/daemon/dist/instance-initialization-surface.d.ts.map +1 -0
  827. package/node_modules/@openrig/daemon/dist/instance-initialization-surface.js +3 -0
  828. package/node_modules/@openrig/daemon/dist/instance-initialization-surface.js.map +1 -0
  829. package/node_modules/@openrig/daemon/dist/project-lifecycle-surface.d.ts +3 -0
  830. package/node_modules/@openrig/daemon/dist/project-lifecycle-surface.d.ts.map +1 -0
  831. package/node_modules/@openrig/daemon/dist/project-lifecycle-surface.js +3 -0
  832. package/node_modules/@openrig/daemon/dist/project-lifecycle-surface.js.map +1 -0
  833. package/node_modules/@openrig/daemon/dist/routes/bundles.js +10 -9
  834. package/node_modules/@openrig/daemon/dist/routes/bundles.js.map +1 -1
  835. package/node_modules/@openrig/daemon/dist/routes/config.d.ts.map +1 -1
  836. package/node_modules/@openrig/daemon/dist/routes/config.js +27 -49
  837. package/node_modules/@openrig/daemon/dist/routes/config.js.map +1 -1
  838. package/node_modules/@openrig/daemon/dist/routes/context-packs.d.ts.map +1 -1
  839. package/node_modules/@openrig/daemon/dist/routes/context-packs.js +114 -16
  840. package/node_modules/@openrig/daemon/dist/routes/context-packs.js.map +1 -1
  841. package/node_modules/@openrig/daemon/dist/routes/crash-cart.js +3 -0
  842. package/node_modules/@openrig/daemon/dist/routes/crash-cart.js.map +1 -1
  843. package/node_modules/@openrig/daemon/dist/routes/queue.d.ts.map +1 -1
  844. package/node_modules/@openrig/daemon/dist/routes/queue.js +51 -10
  845. package/node_modules/@openrig/daemon/dist/routes/queue.js.map +1 -1
  846. package/node_modules/@openrig/daemon/dist/routes/rigs.js +22 -4
  847. package/node_modules/@openrig/daemon/dist/routes/rigs.js.map +1 -1
  848. package/node_modules/@openrig/daemon/dist/routes/rigspec.d.ts.map +1 -1
  849. package/node_modules/@openrig/daemon/dist/routes/rigspec.js +46 -2
  850. package/node_modules/@openrig/daemon/dist/routes/rigspec.js.map +1 -1
  851. package/node_modules/@openrig/daemon/dist/routes/seat.js +21 -1
  852. package/node_modules/@openrig/daemon/dist/routes/seat.js.map +1 -1
  853. package/node_modules/@openrig/daemon/dist/routes/sessions.js +16 -6
  854. package/node_modules/@openrig/daemon/dist/routes/sessions.js.map +1 -1
  855. package/node_modules/@openrig/daemon/dist/routes/snapshots.d.ts.map +1 -1
  856. package/node_modules/@openrig/daemon/dist/routes/snapshots.js +41 -3
  857. package/node_modules/@openrig/daemon/dist/routes/snapshots.js.map +1 -1
  858. package/node_modules/@openrig/daemon/dist/routes/up.js +22 -4
  859. package/node_modules/@openrig/daemon/dist/routes/up.js.map +1 -1
  860. package/node_modules/@openrig/daemon/dist/routes/watchdog.d.ts.map +1 -1
  861. package/node_modules/@openrig/daemon/dist/routes/watchdog.js +7 -6
  862. package/node_modules/@openrig/daemon/dist/routes/watchdog.js.map +1 -1
  863. package/node_modules/@openrig/daemon/dist/routes/workflow.d.ts.map +1 -1
  864. package/node_modules/@openrig/daemon/dist/routes/workflow.js +104 -39
  865. package/node_modules/@openrig/daemon/dist/routes/workflow.js.map +1 -1
  866. package/node_modules/@openrig/daemon/dist/server.d.ts +2 -0
  867. package/node_modules/@openrig/daemon/dist/server.d.ts.map +1 -1
  868. package/node_modules/@openrig/daemon/dist/server.js +1 -0
  869. package/node_modules/@openrig/daemon/dist/server.js.map +1 -1
  870. package/node_modules/@openrig/daemon/dist/skill-loadout-surface.d.ts +3 -0
  871. package/node_modules/@openrig/daemon/dist/skill-loadout-surface.d.ts.map +1 -0
  872. package/node_modules/@openrig/daemon/dist/skill-loadout-surface.js +2 -0
  873. package/node_modules/@openrig/daemon/dist/skill-loadout-surface.js.map +1 -0
  874. package/node_modules/@openrig/daemon/dist/startup.d.ts.map +1 -1
  875. package/node_modules/@openrig/daemon/dist/startup.js +88 -71
  876. package/node_modules/@openrig/daemon/dist/startup.js.map +1 -1
  877. package/node_modules/@openrig/daemon/dist/system-world-surface.d.ts +2 -0
  878. package/node_modules/@openrig/daemon/dist/system-world-surface.d.ts.map +1 -0
  879. package/node_modules/@openrig/daemon/dist/system-world-surface.js +2 -0
  880. package/node_modules/@openrig/daemon/dist/system-world-surface.js.map +1 -0
  881. package/node_modules/@openrig/daemon/package.json +17 -1
  882. package/package.json +2 -1
  883. package/tui/dist/commands/registry.d.ts.map +1 -1
  884. package/tui/dist/commands/registry.js +10 -1
  885. package/tui/dist/commands/registry.js.map +1 -1
  886. package/tui/dist/daemon-client.d.ts +13 -0
  887. package/tui/dist/daemon-client.d.ts.map +1 -1
  888. package/tui/dist/daemon-client.js +19 -0
  889. package/tui/dist/daemon-client.js.map +1 -1
  890. package/tui/dist/demo-data.d.ts.map +1 -1
  891. package/tui/dist/demo-data.js +65 -9
  892. package/tui/dist/demo-data.js.map +1 -1
  893. package/tui/dist/detail.d.ts +9 -0
  894. package/tui/dist/detail.d.ts.map +1 -1
  895. package/tui/dist/detail.js.map +1 -1
  896. package/tui/dist/execution/execution-model.d.ts +25 -0
  897. package/tui/dist/execution/execution-model.d.ts.map +1 -0
  898. package/tui/dist/execution/execution-model.js +881 -0
  899. package/tui/dist/execution/execution-model.js.map +1 -0
  900. package/tui/dist/hydrate.d.ts +3 -2
  901. package/tui/dist/hydrate.d.ts.map +1 -1
  902. package/tui/dist/hydrate.js +70 -8
  903. package/tui/dist/hydrate.js.map +1 -1
  904. package/tui/dist/input.d.ts +12 -0
  905. package/tui/dist/input.d.ts.map +1 -1
  906. package/tui/dist/input.js +31 -8
  907. package/tui/dist/input.js.map +1 -1
  908. package/tui/dist/live.d.ts +10 -0
  909. package/tui/dist/live.d.ts.map +1 -1
  910. package/tui/dist/live.js +34 -1
  911. package/tui/dist/live.js.map +1 -1
  912. package/tui/dist/main.js +57 -7
  913. package/tui/dist/main.js.map +1 -1
  914. package/tui/dist/navigator.d.ts.map +1 -1
  915. package/tui/dist/navigator.js +10 -6
  916. package/tui/dist/navigator.js.map +1 -1
  917. package/tui/dist/render.d.ts.map +1 -1
  918. package/tui/dist/render.js +605 -153
  919. package/tui/dist/render.js.map +1 -1
  920. package/tui/dist/scopes/scopes-model.d.ts +15 -8
  921. package/tui/dist/scopes/scopes-model.d.ts.map +1 -1
  922. package/tui/dist/scopes/scopes-model.js +218 -44
  923. package/tui/dist/scopes/scopes-model.js.map +1 -1
  924. package/tui/dist/sections.js +2 -2
  925. package/tui/dist/sections.js.map +1 -1
  926. package/tui/dist/socket-server.d.ts +13 -0
  927. package/tui/dist/socket-server.d.ts.map +1 -1
  928. package/tui/dist/socket-server.js +24 -0
  929. package/tui/dist/socket-server.js.map +1 -1
  930. package/tui/dist/state.d.ts.map +1 -1
  931. package/tui/dist/state.js +35 -8
  932. package/tui/dist/state.js.map +1 -1
  933. package/tui/dist/stylize.d.ts.map +1 -1
  934. package/tui/dist/stylize.js +23 -29
  935. package/tui/dist/stylize.js.map +1 -1
  936. package/tui/dist/theme.d.ts +1 -1
  937. package/tui/dist/theme.d.ts.map +1 -1
  938. package/tui/dist/theme.js +5 -4
  939. package/tui/dist/theme.js.map +1 -1
  940. package/tui/dist/types.d.ts +117 -1
  941. package/tui/dist/types.d.ts.map +1 -1
  942. package/tui/dist/visual-layout.d.ts +6 -0
  943. package/tui/dist/visual-layout.d.ts.map +1 -0
  944. package/tui/dist/visual-layout.js +8 -0
  945. package/tui/dist/visual-layout.js.map +1 -0
  946. package/ui/dist/assets/{index-B_wqzP0D.js → index-wyX378xb.js} +15 -15
  947. package/ui/dist/index.html +1 -1
@@ -0,0 +1,827 @@
1
+ import { createHash, randomUUID } from "node:crypto";
2
+ import { execFileSync } from "node:child_process";
3
+ import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, writeFileSync, } from "node:fs";
4
+ import nodePath from "node:path";
5
+ import { parse as parseYaml } from "yaml";
6
+ import { parseSkillFrontmatter } from "./skill-discovery.js";
7
+ const CATALOG_SCHEMA = "openrig.skill-catalog/v1";
8
+ const MANIFEST_SCHEMA = "openrig.skill-loadout/v1";
9
+ const SAFE_ID = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/;
10
+ const SAFE_TOPOLOGY_OWNER = /^[A-Za-z0-9][A-Za-z0-9._:@-]{0,255}$/;
11
+ const SHA256 = /^[a-f0-9]{64}$/;
12
+ function isRecord(value) {
13
+ return value !== null && typeof value === "object" && !Array.isArray(value);
14
+ }
15
+ function sha256(content) {
16
+ return createHash("sha256").update(content).digest("hex");
17
+ }
18
+ function compareBytes(a, b) {
19
+ return a < b ? -1 : a > b ? 1 : 0;
20
+ }
21
+ function pathEntryExists(path) {
22
+ try {
23
+ lstatSync(path);
24
+ return true;
25
+ }
26
+ catch {
27
+ return false;
28
+ }
29
+ }
30
+ function isSafeRelativePath(path) {
31
+ return path.length > 0
32
+ && !nodePath.posix.isAbsolute(path)
33
+ && !path.split("/").some((part) => part === "" || part === "." || part === "..");
34
+ }
35
+ function isWithin(parent, child) {
36
+ const relative = nodePath.relative(parent, child);
37
+ return relative !== "" && relative !== ".." && !relative.startsWith(`..${nodePath.sep}`) && !nodePath.isAbsolute(relative);
38
+ }
39
+ function readYamlObject(path) {
40
+ let parsed;
41
+ try {
42
+ parsed = parseYaml(readFileSync(path, "utf8"));
43
+ }
44
+ catch (err) {
45
+ throw new Error(`${path} is not valid YAML: ${err.message}`);
46
+ }
47
+ if (!isRecord(parsed))
48
+ throw new Error(`${path} must contain a YAML object`);
49
+ return parsed;
50
+ }
51
+ function readStringList(value, label) {
52
+ if (value === undefined || value === null)
53
+ return [];
54
+ if (!Array.isArray(value) || !value.every((entry) => typeof entry === "string" && SAFE_ID.test(entry))) {
55
+ throw new Error(`${label} must be a list of bounded skill identities`);
56
+ }
57
+ return value;
58
+ }
59
+ export function readSystemSkillSelection(catalogRoot) {
60
+ const manifestPath = nodePath.join(catalogRoot, "catalog.yaml");
61
+ if (!existsSync(manifestPath))
62
+ return [];
63
+ const manifest = readYamlObject(manifestPath);
64
+ if (manifest["schema"] !== CATALOG_SCHEMA) {
65
+ throw new Error(`${manifestPath} must declare schema: ${CATALOG_SCHEMA}`);
66
+ }
67
+ return readStringList(manifest["system"], `${manifestPath} system`);
68
+ }
69
+ export function readProjectSkillSelection(projectRoot) {
70
+ const manifestPath = nodePath.join(projectRoot, "project.yaml");
71
+ if (!existsSync(manifestPath))
72
+ return [];
73
+ const manifest = readYamlObject(manifestPath);
74
+ const install = manifest["install"];
75
+ if (install === undefined || install === null)
76
+ return [];
77
+ if (!isRecord(install))
78
+ throw new Error(`${manifestPath} install must be a YAML object`);
79
+ return readStringList(install["skills"], `${manifestPath} install.skills`);
80
+ }
81
+ export function inspectSkillDirectory(root) {
82
+ const rootStat = lstatSync(root);
83
+ if (rootStat.isSymbolicLink() || !rootStat.isDirectory()) {
84
+ throw new Error(`managed skill target must be a real directory, not a symlink or file: ${root}`);
85
+ }
86
+ const files = {};
87
+ const fileModes = {};
88
+ const walk = (dir, prefix) => {
89
+ for (const entry of readdirSync(dir, { withFileTypes: true }).sort((a, b) => compareBytes(a.name, b.name))) {
90
+ const absolute = nodePath.join(dir, entry.name);
91
+ const relative = prefix ? `${prefix}/${entry.name}` : entry.name;
92
+ const stat = lstatSync(absolute);
93
+ if (stat.isSymbolicLink())
94
+ throw new Error(`symlink is not allowed in a managed skill: ${absolute}`);
95
+ if (stat.isDirectory())
96
+ walk(absolute, relative);
97
+ else if (stat.isFile()) {
98
+ files[relative] = sha256(readFileSync(absolute));
99
+ fileModes[relative] = stat.mode & 0o777;
100
+ }
101
+ else
102
+ throw new Error(`unsupported filesystem entry in a managed skill: ${absolute}`);
103
+ }
104
+ };
105
+ walk(root, "");
106
+ const digest = sha256(Object.keys(files).sort(compareBytes)
107
+ .map((path) => `${path}\0${fileModes[path].toString(8).padStart(3, "0")}\0${files[path]}`)
108
+ .join("\n"));
109
+ return { digest, files };
110
+ }
111
+ function gitRevision(catalogRoot) {
112
+ let repoRoot;
113
+ try {
114
+ repoRoot = execFileSync("git", ["-C", catalogRoot, "rev-parse", "--show-toplevel"], { encoding: "utf8" }).trim();
115
+ }
116
+ catch {
117
+ throw new Error(`managed skill catalog is not inside a readable Git repository: ${catalogRoot}`);
118
+ }
119
+ const rel = nodePath.relative(realpathSync(repoRoot), realpathSync(catalogRoot)) || ".";
120
+ const dirty = execFileSync("git", ["-C", repoRoot, "status", "--porcelain=v1", "--untracked-files=all", "--", rel], { encoding: "utf8" }).trim();
121
+ if (dirty) {
122
+ throw new Error(`managed skill catalog has uncommitted content at ${catalogRoot}; commit or restore it before projection`);
123
+ }
124
+ return execFileSync("git", ["-C", repoRoot, "rev-parse", "HEAD"], { encoding: "utf8" }).trim();
125
+ }
126
+ function scanCatalog(catalogRoot) {
127
+ if (!existsSync(catalogRoot))
128
+ throw new Error(`managed skill catalog root does not exist: ${catalogRoot}`);
129
+ const rootStat = lstatSync(catalogRoot);
130
+ if (rootStat.isSymbolicLink() || !rootStat.isDirectory()) {
131
+ throw new Error(`managed skill catalog root must be a real directory, not a symlink: ${catalogRoot}`);
132
+ }
133
+ const revision = gitRevision(catalogRoot);
134
+ const skills = new Map();
135
+ for (const entry of readdirSync(catalogRoot, { withFileTypes: true }).sort((a, b) => compareBytes(a.name, b.name))) {
136
+ if (!entry.isDirectory())
137
+ continue;
138
+ const sourceDir = nodePath.join(catalogRoot, entry.name);
139
+ if (lstatSync(sourceDir).isSymbolicLink()) {
140
+ throw new Error(`symlinked skill directories are not allowed: ${sourceDir}`);
141
+ }
142
+ const skillFile = nodePath.join(sourceDir, "SKILL.md");
143
+ if (!existsSync(skillFile))
144
+ continue;
145
+ const parsed = parseSkillFrontmatter(readFileSync(skillFile, "utf8"));
146
+ if (!parsed.ok)
147
+ throw new Error(`${skillFile}: ${parsed.reason}`);
148
+ const id = parsed.frontmatter.name;
149
+ if (!SAFE_ID.test(id))
150
+ throw new Error(`${skillFile}: frontmatter name '${id}' is not a bounded skill identity`);
151
+ const prior = skills.get(id);
152
+ if (prior) {
153
+ throw new Error(`duplicate managed skill identity '${id}' at ${prior.sourceDir} and ${sourceDir}`);
154
+ }
155
+ const tree = inspectSkillDirectory(sourceDir);
156
+ skills.set(id, {
157
+ id,
158
+ sourceDir,
159
+ sourceRoot: catalogRoot,
160
+ revision,
161
+ digest: tree.digest,
162
+ files: tree.files,
163
+ });
164
+ }
165
+ const digest = sha256([...skills.values()].map((skill) => `${skill.id}\0${skill.digest}`).join("\n"));
166
+ return { revision, digest, skills };
167
+ }
168
+ export function resolveSkillLoadout(input) {
169
+ const errors = [];
170
+ let system = [];
171
+ let project = [];
172
+ const projectSelectionDeclared = input.projectSkills !== undefined
173
+ || (input.projectRoot !== undefined && existsSync(nodePath.join(input.projectRoot, "project.yaml")));
174
+ try {
175
+ system = input.systemSkills ?? readSystemSkillSelection(input.catalogRoot);
176
+ project = input.projectSkills ?? (input.projectRoot ? readProjectSkillSelection(input.projectRoot) : []);
177
+ readStringList(system, "system skill selection");
178
+ readStringList(input.topologySkills ?? [], "topology skill selection");
179
+ }
180
+ catch (err) {
181
+ return { ok: false, errors: [{ code: "selector_invalid", message: err.message }] };
182
+ }
183
+ const selected = new Map();
184
+ for (const [source, ids] of [
185
+ ["system", system],
186
+ ["topology", input.topologySkills ?? []],
187
+ ["project", project],
188
+ ]) {
189
+ for (const id of ids) {
190
+ const sources = selected.get(id) ?? [];
191
+ if (!sources.includes(source))
192
+ sources.push(source);
193
+ selected.set(id, sources);
194
+ }
195
+ }
196
+ const catalogManifestExists = existsSync(nodePath.join(input.catalogRoot, "catalog.yaml"));
197
+ const catalogRequired = system.length > 0 || project.length > 0 || (!input.allowMissingTopology && selected.size > 0);
198
+ if (!catalogManifestExists && !catalogRequired) {
199
+ return {
200
+ ok: true,
201
+ loadout: {
202
+ catalogRoot: input.catalogRoot,
203
+ catalogRevision: null,
204
+ catalogDigest: null,
205
+ projectSelectionDeclared,
206
+ projectSelection: [...project].sort(compareBytes),
207
+ entries: [],
208
+ },
209
+ };
210
+ }
211
+ let catalog;
212
+ try {
213
+ catalog = scanCatalog(input.catalogRoot);
214
+ }
215
+ catch (err) {
216
+ return { ok: false, errors: [{ code: "catalog_unavailable", message: err.message, path: input.catalogRoot }] };
217
+ }
218
+ const entries = [];
219
+ for (const [id, selectedBy] of [...selected.entries()].sort(([a], [b]) => compareBytes(a, b))) {
220
+ const skill = catalog.skills.get(id);
221
+ if (!skill) {
222
+ if (input.allowMissingTopology && selectedBy.every((source) => source === "topology"))
223
+ continue;
224
+ errors.push({
225
+ code: "selected_skill_missing",
226
+ message: `selected skill '${id}' is missing from managed catalog ${input.catalogRoot}`,
227
+ path: input.catalogRoot,
228
+ });
229
+ continue;
230
+ }
231
+ entries.push({ ...skill, selectedBy });
232
+ }
233
+ if (errors.length > 0)
234
+ return { ok: false, errors };
235
+ return {
236
+ ok: true,
237
+ loadout: {
238
+ catalogRoot: input.catalogRoot,
239
+ catalogRevision: catalog.revision,
240
+ catalogDigest: catalog.digest,
241
+ projectSelectionDeclared,
242
+ projectSelection: [...project].sort(compareBytes),
243
+ entries,
244
+ },
245
+ };
246
+ }
247
+ function targetRootFor(runtime, cwd) {
248
+ return nodePath.join(cwd, runtime === "claude-code" ? ".claude" : ".agents", "skills");
249
+ }
250
+ function ownershipManifestPath(cwd, runtime) {
251
+ return nodePath.join(cwd, ".openrig", "skill-loadouts", `${runtime}.json`);
252
+ }
253
+ function readOwnershipManifest(path, runtime, targetRoot) {
254
+ if (!existsSync(path)) {
255
+ return { schema: MANIFEST_SCHEMA, runtime, targetRoot, updatedAt: "", topologySelections: {}, projectSelection: [], skills: [] };
256
+ }
257
+ let value;
258
+ try {
259
+ value = JSON.parse(readFileSync(path, "utf8"));
260
+ }
261
+ catch (err) {
262
+ throw new Error(`skill ownership manifest is unreadable at ${path}: ${err.message}`);
263
+ }
264
+ if (!isRecord(value) || value["schema"] !== MANIFEST_SCHEMA || value["runtime"] !== runtime || value["targetRoot"] !== targetRoot || !Array.isArray(value["skills"])) {
265
+ throw new Error(`skill ownership manifest has an incompatible shape at ${path}; move it aside and re-run inspection`);
266
+ }
267
+ const skills = value["skills"];
268
+ if (!skills.every((entry) => {
269
+ if (!isRecord(entry)
270
+ || typeof entry["id"] !== "string"
271
+ || !SAFE_ID.test(entry["id"])
272
+ || entry["target"] !== nodePath.join(targetRoot, entry["id"])
273
+ || typeof entry["sourceRoot"] !== "string"
274
+ || !nodePath.isAbsolute(entry["sourceRoot"])
275
+ || (entry["sourceDir"] !== undefined && typeof entry["sourceDir"] !== "string")
276
+ || typeof entry["revision"] !== "string"
277
+ || entry["revision"].length === 0
278
+ || typeof entry["digest"] !== "string"
279
+ || !SHA256.test(entry["digest"])
280
+ || !isRecord(entry["files"])
281
+ || !Object.entries(entry["files"]).every(([file, digest]) => isSafeRelativePath(file) && typeof digest === "string" && SHA256.test(digest))
282
+ || !Array.isArray(entry["selectedBy"])
283
+ || !entry["selectedBy"].every((source) => source === "system" || source === "topology" || source === "project"))
284
+ return false;
285
+ const sourceDir = entry["sourceDir"] ?? nodePath.join(entry["sourceRoot"], entry["id"]);
286
+ return nodePath.isAbsolute(sourceDir) && isWithin(entry["sourceRoot"], sourceDir);
287
+ })) {
288
+ throw new Error(`skill ownership manifest contains an invalid skill record at ${path}; move it aside and re-run inspection`);
289
+ }
290
+ if (new Set(skills.map((entry) => entry["id"])).size !== skills.length) {
291
+ throw new Error(`skill ownership manifest contains duplicate skill identities at ${path}; move it aside and re-run inspection`);
292
+ }
293
+ const rawTopology = value["topologySelections"];
294
+ if (rawTopology !== undefined
295
+ && (!isRecord(rawTopology)
296
+ || !Object.entries(rawTopology).every(([owner, ids]) => (SAFE_TOPOLOGY_OWNER.test(owner)
297
+ && Array.isArray(ids)
298
+ && ids.every((id) => typeof id === "string" && SAFE_ID.test(id))
299
+ && new Set(ids).size === ids.length)))) {
300
+ throw new Error(`skill ownership manifest contains invalid topology selections at ${path}; move it aside and re-run inspection`);
301
+ }
302
+ const rawProject = value["projectSelection"];
303
+ if (rawProject !== undefined
304
+ && (!Array.isArray(rawProject) || !rawProject.every((id) => typeof id === "string" && SAFE_ID.test(id)) || new Set(rawProject).size !== rawProject.length)) {
305
+ throw new Error(`skill ownership manifest contains an invalid project selection at ${path}; move it aside and re-run inspection`);
306
+ }
307
+ const parsed = value;
308
+ const parsedSkills = parsed.skills.map((skill) => ({
309
+ ...skill,
310
+ sourceDir: skill.sourceDir ?? nodePath.join(skill.sourceRoot, skill.id),
311
+ }));
312
+ return {
313
+ ...parsed,
314
+ topologySelections: parsed.topologySelections ?? {},
315
+ projectSelection: parsed.projectSelection
316
+ ?? parsedSkills.filter((skill) => skill.selectedBy.includes("project")).map((skill) => skill.id).sort(compareBytes),
317
+ skills: parsedSkills,
318
+ };
319
+ }
320
+ function copyDirectoryExact(source, target) {
321
+ mkdirSync(target, { recursive: true });
322
+ for (const entry of readdirSync(source, { withFileTypes: true })) {
323
+ const src = nodePath.join(source, entry.name);
324
+ const dest = nodePath.join(target, entry.name);
325
+ const stat = lstatSync(src);
326
+ if (stat.isSymbolicLink())
327
+ throw new Error(`symlink is not allowed in a managed skill: ${src}`);
328
+ if (stat.isDirectory())
329
+ copyDirectoryExact(src, dest);
330
+ else if (stat.isFile()) {
331
+ writeFileSync(dest, readFileSync(src));
332
+ chmodSync(dest, stat.mode & 0o777);
333
+ }
334
+ else
335
+ throw new Error(`unsupported filesystem entry in a managed skill: ${src}`);
336
+ }
337
+ }
338
+ function gitIgnorePattern(base, path, directory) {
339
+ const relative = nodePath.relative(base, path);
340
+ if (!relative || relative === ".." || relative.startsWith(`..${nodePath.sep}`) || nodePath.isAbsolute(relative)) {
341
+ throw new Error(`managed skill projection path is outside its Git working tree: ${path}`);
342
+ }
343
+ const escaped = relative
344
+ .split(nodePath.sep)
345
+ .join("/")
346
+ .replace(/([\\*?\[\] !#])/g, "\\$1");
347
+ return `/${escaped}${directory ? "/" : ""}`;
348
+ }
349
+ function replaceGitIgnoreBlock(original, begin, end, patterns) {
350
+ const beginAt = original.indexOf(begin);
351
+ const endAt = original.indexOf(end);
352
+ if ((beginAt === -1) !== (endAt === -1)) {
353
+ throw new Error(`managed Git exclusion block is incomplete (${begin})`);
354
+ }
355
+ if (beginAt !== -1) {
356
+ if (original.indexOf(begin, beginAt + begin.length) !== -1
357
+ || original.indexOf(end, endAt + end.length) !== -1
358
+ || (beginAt > 0 && original[beginAt - 1] !== "\n")
359
+ || endAt < beginAt
360
+ || (original[endAt + end.length] !== undefined && original[endAt + end.length] !== "\n")) {
361
+ throw new Error(`managed Git exclusion block is ambiguous (${begin})`);
362
+ }
363
+ const after = original[endAt + end.length] === "\n" ? endAt + end.length + 1 : endAt + end.length;
364
+ const block = patterns === null ? "" : `${begin}\n${patterns.join("\n")}\n${end}\n`;
365
+ return `${original.slice(0, beginAt)}${block}${original.slice(after)}`;
366
+ }
367
+ if (patterns === null)
368
+ return original;
369
+ const separator = original.length > 0 && !original.endsWith("\n") ? "\n" : "";
370
+ return `${original}${separator}${begin}\n${patterns.join("\n")}\n${end}\n`;
371
+ }
372
+ function isGitIgnored(repoRoot, path) {
373
+ try {
374
+ execFileSync("git", ["-C", repoRoot, "check-ignore", "-q", "--no-index", "--", path], { stdio: "ignore" });
375
+ return true;
376
+ }
377
+ catch (err) {
378
+ if (err.status === 1)
379
+ return false;
380
+ throw err;
381
+ }
382
+ }
383
+ function isGitTracked(repoRoot, path) {
384
+ const relative = nodePath.relative(repoRoot, path);
385
+ try {
386
+ execFileSync("git", ["-C", repoRoot, "ls-files", "--error-unmatch", "--", relative], { stdio: "ignore" });
387
+ return true;
388
+ }
389
+ catch (err) {
390
+ if (err.status === 1)
391
+ return false;
392
+ throw err;
393
+ }
394
+ }
395
+ function planGitIgnoreFile(input) {
396
+ const originalExists = existsSync(input.path);
397
+ const originalContent = originalExists ? readFileSync(input.path, "utf8") : "";
398
+ const hasManagedBlock = originalContent.includes(input.begin) || originalContent.includes(input.end);
399
+ const hasOtherManagedBlock = ["claude-code", "codex"].some((runtime) => originalContent.includes(`# BEGIN OpenRig managed skill loadout ${runtime}`)
400
+ && originalContent.includes(`# END OpenRig managed skill loadout ${runtime}`));
401
+ if (!hasManagedBlock && !hasOtherManagedBlock) {
402
+ if (input.coveragePaths.every((path) => isGitIgnored(input.repoRoot, path)))
403
+ return null;
404
+ if (originalExists) {
405
+ throw new Error(`refusing to modify an existing unmanaged Git ignore file at ${input.path}`);
406
+ }
407
+ }
408
+ const patterns = input.targets.length === 0
409
+ ? null
410
+ : ["/.gitignore", ...input.targets
411
+ .map((target) => gitIgnorePattern(nodePath.dirname(input.path), target.path, target.directory))
412
+ .sort(compareBytes)];
413
+ const nextContent = replaceGitIgnoreBlock(originalContent, input.begin, input.end, patterns);
414
+ if (nextContent !== originalContent && isGitTracked(input.repoRoot, input.path)) {
415
+ throw new Error(`refusing to modify a tracked Git ignore file at ${input.path}`);
416
+ }
417
+ return { path: input.path, originalExists, originalContent, nextContent, changed: nextContent !== originalContent };
418
+ }
419
+ function planGitIgnores(input) {
420
+ let repoRoot;
421
+ try {
422
+ repoRoot = execFileSync("git", ["-C", input.cwd, "rev-parse", "--show-toplevel"], {
423
+ encoding: "utf8",
424
+ stdio: ["ignore", "pipe", "ignore"],
425
+ }).trim();
426
+ }
427
+ catch {
428
+ return [];
429
+ }
430
+ const canonicalRepoRoot = realpathSync(repoRoot);
431
+ const canonicalCwd = realpathSync(input.cwd);
432
+ const fromCanonicalCwd = (path) => {
433
+ const relative = nodePath.relative(input.cwd, path);
434
+ if (!relative || relative === ".." || relative.startsWith(`..${nodePath.sep}`) || nodePath.isAbsolute(relative)) {
435
+ throw new Error(`managed skill projection path is outside its working directory: ${path}`);
436
+ }
437
+ return nodePath.join(canonicalCwd, relative);
438
+ };
439
+ const canonicalTargetRoot = fromCanonicalCwd(input.targetRoot);
440
+ const canonicalManifestPath = fromCanonicalCwd(input.manifestPath);
441
+ const key = input.runtime;
442
+ const begin = `# BEGIN OpenRig managed skill loadout ${key}`;
443
+ const end = `# END OpenRig managed skill loadout ${key}`;
444
+ const plans = [
445
+ planGitIgnoreFile({
446
+ repoRoot: canonicalRepoRoot,
447
+ path: nodePath.join(canonicalTargetRoot, ".gitignore"),
448
+ begin,
449
+ end,
450
+ targets: input.owned.map((skill) => ({ path: fromCanonicalCwd(skill.target), directory: true })),
451
+ coveragePaths: input.owned.flatMap((skill) => Object.keys(skill.files)
452
+ .map((path) => nodePath.join(fromCanonicalCwd(skill.target), path))),
453
+ }),
454
+ planGitIgnoreFile({
455
+ repoRoot: canonicalRepoRoot,
456
+ path: nodePath.join(nodePath.dirname(canonicalManifestPath), ".gitignore"),
457
+ begin,
458
+ end,
459
+ targets: [{ path: canonicalManifestPath, directory: false }],
460
+ coveragePaths: [canonicalManifestPath],
461
+ }),
462
+ ];
463
+ return plans.filter((plan) => plan !== null);
464
+ }
465
+ function writeFileAtomic(path, content) {
466
+ mkdirSync(nodePath.dirname(path), { recursive: true });
467
+ const temporary = `${path}.${randomUUID()}.tmp`;
468
+ try {
469
+ writeFileSync(temporary, content, "utf8");
470
+ if (existsSync(path))
471
+ chmodSync(temporary, lstatSync(path).mode & 0o777);
472
+ renameSync(temporary, path);
473
+ }
474
+ finally {
475
+ rmSync(temporary, { force: true });
476
+ }
477
+ }
478
+ function applyGitIgnore(plan) {
479
+ if (plan.nextContent.length === 0)
480
+ rmSync(plan.path, { force: true });
481
+ else
482
+ writeFileAtomic(plan.path, plan.nextContent);
483
+ }
484
+ function restoreGitIgnore(plan) {
485
+ if (plan.nextContent.length === 0) {
486
+ if (existsSync(plan.path))
487
+ return;
488
+ }
489
+ else if (!existsSync(plan.path) || readFileSync(plan.path, "utf8") !== plan.nextContent)
490
+ return;
491
+ if (plan.originalExists)
492
+ writeFileAtomic(plan.path, plan.originalContent);
493
+ else
494
+ rmSync(plan.path, { force: true });
495
+ }
496
+ function classifySkillProjectionTarget(skill, prior, target) {
497
+ if (!pathEntryExists(target)) {
498
+ return { status: "missing", detail: "selected skill is not projected" };
499
+ }
500
+ try {
501
+ const actual = inspectSkillDirectory(target);
502
+ if (actual.digest === skill.digest) {
503
+ return prior
504
+ ? { status: "current", detail: "owned target matches catalog bytes" }
505
+ : { status: "shadowed", detail: "equal unowned target already supplies these bytes" };
506
+ }
507
+ if (prior && actual.digest === prior.digest) {
508
+ return { status: "stale", detail: "owned target still matches the prior projection and can be refreshed safely" };
509
+ }
510
+ return {
511
+ status: "conflicting",
512
+ detail: prior
513
+ ? "target differs from both the catalog and OpenRig's last owned projection; refusing to overwrite an operator edit"
514
+ : "unowned target differs from the selected catalog skill; move it aside or reconcile its bytes explicitly",
515
+ };
516
+ }
517
+ catch (err) {
518
+ return { status: "conflicting", detail: err.message };
519
+ }
520
+ }
521
+ export function reconcileSkillLoadout(input) {
522
+ const cwd = nodePath.resolve(input.cwd);
523
+ const targetRoot = targetRootFor(input.runtime, cwd);
524
+ const manifestPath = ownershipManifestPath(cwd, input.runtime);
525
+ const receipts = [];
526
+ const errors = [];
527
+ let manifest;
528
+ try {
529
+ manifest = readOwnershipManifest(manifestPath, input.runtime, targetRoot);
530
+ }
531
+ catch (err) {
532
+ return { ok: false, applied: false, freshLaunchRequired: false, runtime: input.runtime, targetRoot, manifestPath, receipts, removed: [], errors: [{ code: "ownership_manifest_invalid", message: err.message, path: manifestPath }] };
533
+ }
534
+ const owned = new Map(manifest.skills.map((skill) => [skill.id, skill]));
535
+ if (input.loadout.catalogRevision === null
536
+ && input.loadout.entries.length === 0
537
+ && manifest.skills.length === 0
538
+ && manifest.projectSelection.length === 0
539
+ && Object.keys(manifest.topologySelections).length === 0) {
540
+ return { ok: true, applied: false, freshLaunchRequired: false, runtime: input.runtime, targetRoot, manifestPath, receipts, removed: [], errors };
541
+ }
542
+ const topologyOwner = input.topologyOwner?.trim() || "workspace";
543
+ if (!SAFE_TOPOLOGY_OWNER.test(topologyOwner)) {
544
+ return {
545
+ ok: false,
546
+ applied: false,
547
+ freshLaunchRequired: false,
548
+ runtime: input.runtime,
549
+ targetRoot,
550
+ manifestPath,
551
+ receipts,
552
+ removed: [],
553
+ errors: [{ code: "topology_owner_invalid", message: `topology owner '${topologyOwner}' is not a bounded seat identity` }],
554
+ };
555
+ }
556
+ const topologySelections = Object.create(null);
557
+ for (const owner of Object.keys(manifest.topologySelections).sort(compareBytes)) {
558
+ topologySelections[owner] = [...manifest.topologySelections[owner]].sort(compareBytes);
559
+ }
560
+ const currentTopology = input.loadout.entries
561
+ .filter((entry) => entry.selectedBy.includes("topology"))
562
+ .map((entry) => entry.id)
563
+ .sort(compareBytes);
564
+ if (currentTopology.length > 0)
565
+ topologySelections[topologyOwner] = currentTopology;
566
+ else
567
+ delete topologySelections[topologyOwner];
568
+ const canonicalTopologySelections = Object.create(null);
569
+ for (const owner of Object.keys(topologySelections).sort(compareBytes)) {
570
+ canonicalTopologySelections[owner] = topologySelections[owner];
571
+ }
572
+ const retainedTopology = new Set(Object.values(topologySelections).flat());
573
+ const effectiveEntries = [...input.loadout.entries];
574
+ for (const id of [...retainedTopology].sort(compareBytes)) {
575
+ const current = effectiveEntries.find((entry) => entry.id === id);
576
+ if (current) {
577
+ current.selectedBy = ["system", "topology", "project"]
578
+ .filter((source) => current.selectedBy.includes(source) || source === "topology");
579
+ continue;
580
+ }
581
+ const prior = owned.get(id);
582
+ if (!prior) {
583
+ errors.push({
584
+ code: "topology_selection_unavailable",
585
+ message: `topology owner still selects '${id}', but its owned source record is absent; relaunch that owner or clear its selection explicitly`,
586
+ path: manifestPath,
587
+ });
588
+ continue;
589
+ }
590
+ effectiveEntries.push({
591
+ id: prior.id,
592
+ sourceDir: prior.sourceDir,
593
+ sourceRoot: prior.sourceRoot,
594
+ revision: prior.revision,
595
+ digest: prior.digest,
596
+ files: prior.files,
597
+ selectedBy: ["topology"],
598
+ });
599
+ }
600
+ const projectSelection = (input.loadout.projectSelectionDeclared
601
+ ? input.loadout.projectSelection
602
+ : manifest.projectSelection).slice().sort(compareBytes);
603
+ for (const id of projectSelection) {
604
+ const current = effectiveEntries.find((entry) => entry.id === id);
605
+ if (current) {
606
+ current.selectedBy = ["system", "topology", "project"]
607
+ .filter((source) => current.selectedBy.includes(source) || source === "project");
608
+ continue;
609
+ }
610
+ const prior = owned.get(id);
611
+ if (!prior) {
612
+ errors.push({
613
+ code: "project_selection_unavailable",
614
+ message: `installed project still selects '${id}', but its owned source record is absent; run an explicit project install to repair or clear it`,
615
+ path: manifestPath,
616
+ });
617
+ continue;
618
+ }
619
+ effectiveEntries.push({
620
+ id: prior.id,
621
+ sourceDir: prior.sourceDir,
622
+ sourceRoot: prior.sourceRoot,
623
+ revision: prior.revision,
624
+ digest: prior.digest,
625
+ files: prior.files,
626
+ selectedBy: ["project"],
627
+ });
628
+ }
629
+ effectiveEntries.sort((a, b) => compareBytes(a.id, b.id));
630
+ for (const skill of effectiveEntries) {
631
+ const target = nodePath.join(targetRoot, skill.id);
632
+ const prior = owned.get(skill.id);
633
+ let { status, detail } = classifySkillProjectionTarget(skill, prior, target);
634
+ receipts.push({
635
+ id: skill.id,
636
+ selectedBy: skill.selectedBy,
637
+ sourceRoot: skill.sourceRoot,
638
+ revision: skill.revision,
639
+ digest: skill.digest,
640
+ target,
641
+ status,
642
+ detail,
643
+ });
644
+ if (status === "missing" || status === "stale") {
645
+ try {
646
+ const source = inspectSkillDirectory(skill.sourceDir);
647
+ if (source.digest !== skill.digest) {
648
+ status = "conflicting";
649
+ detail = "catalog source bytes no longer match the resolved loadout; resolve a fresh loadout before applying";
650
+ receipts[receipts.length - 1].status = status;
651
+ receipts[receipts.length - 1].detail = detail;
652
+ }
653
+ }
654
+ catch (err) {
655
+ status = "conflicting";
656
+ detail = `catalog source cannot be projected safely: ${err.message}`;
657
+ receipts[receipts.length - 1].status = status;
658
+ receipts[receipts.length - 1].detail = detail;
659
+ }
660
+ }
661
+ if (status === "conflicting")
662
+ errors.push({ code: "target_conflict", message: `${skill.id}: ${detail}`, path: target });
663
+ }
664
+ const selectedIds = new Set(effectiveEntries.map((entry) => entry.id));
665
+ const safeRemovals = [];
666
+ for (const prior of manifest.skills) {
667
+ if (selectedIds.has(prior.id))
668
+ continue;
669
+ if (!pathEntryExists(prior.target))
670
+ continue;
671
+ try {
672
+ const actual = inspectSkillDirectory(prior.target);
673
+ if (actual.digest === prior.digest)
674
+ safeRemovals.push(prior);
675
+ else
676
+ errors.push({
677
+ code: "stale_target_modified",
678
+ message: `${prior.id}: deselected owned target was modified after projection; refusing to remove it`,
679
+ path: prior.target,
680
+ });
681
+ }
682
+ catch (err) {
683
+ errors.push({ code: "stale_target_unreadable", message: `${prior.id}: ${err.message}`, path: prior.target });
684
+ }
685
+ }
686
+ if (errors.length > 0 || !input.apply) {
687
+ return { ok: errors.length === 0, applied: false, freshLaunchRequired: false, runtime: input.runtime, targetRoot, manifestPath, receipts, removed: [], errors };
688
+ }
689
+ const changed = receipts.filter((receipt) => receipt.status === "missing" || receipt.status === "stale");
690
+ const nextOwned = effectiveEntries
691
+ .filter((skill) => receipts.find((receipt) => receipt.id === skill.id)?.status !== "shadowed")
692
+ .map((skill) => ({
693
+ id: skill.id,
694
+ target: nodePath.join(targetRoot, skill.id),
695
+ sourceDir: skill.sourceDir,
696
+ sourceRoot: skill.sourceRoot,
697
+ revision: skill.revision,
698
+ digest: skill.digest,
699
+ files: skill.files,
700
+ selectedBy: skill.selectedBy,
701
+ }))
702
+ .sort((a, b) => compareBytes(a.id, b.id));
703
+ let gitIgnorePlans;
704
+ try {
705
+ gitIgnorePlans = planGitIgnores({ cwd, runtime: input.runtime, targetRoot, manifestPath, owned: nextOwned });
706
+ }
707
+ catch (err) {
708
+ return {
709
+ ok: false,
710
+ applied: false,
711
+ freshLaunchRequired: false,
712
+ runtime: input.runtime,
713
+ targetRoot,
714
+ manifestPath,
715
+ receipts,
716
+ removed: [],
717
+ errors: [{ code: "git_exclusion_failed", message: `skill projection could not preserve clean Git state: ${err.message}` }],
718
+ };
719
+ }
720
+ if (changed.length === 0
721
+ && safeRemovals.length === 0
722
+ && JSON.stringify(manifest.skills) === JSON.stringify(nextOwned)
723
+ && JSON.stringify(manifest.topologySelections) === JSON.stringify(canonicalTopologySelections)
724
+ && JSON.stringify(manifest.projectSelection) === JSON.stringify(projectSelection)
725
+ && !gitIgnorePlans.some((plan) => plan.changed)) {
726
+ return { ok: true, applied: false, freshLaunchRequired: false, runtime: input.runtime, targetRoot, manifestPath, receipts, removed: [], errors: [] };
727
+ }
728
+ const removed = [];
729
+ const rollback = [];
730
+ let stagingRoot = null;
731
+ const appliedGitIgnores = [];
732
+ try {
733
+ mkdirSync(nodePath.dirname(targetRoot), { recursive: true });
734
+ stagingRoot = nodePath.join(nodePath.dirname(targetRoot), `.openrig-skill-stage-${randomUUID()}`);
735
+ mkdirSync(stagingRoot, { recursive: true });
736
+ const staged = nodePath.join(stagingRoot, "new");
737
+ const backups = nodePath.join(stagingRoot, "old");
738
+ mkdirSync(staged, { recursive: true });
739
+ mkdirSync(backups, { recursive: true });
740
+ for (const receipt of changed) {
741
+ const skill = effectiveEntries.find((entry) => entry.id === receipt.id);
742
+ copyDirectoryExact(skill.sourceDir, nodePath.join(staged, skill.id));
743
+ }
744
+ for (const plan of gitIgnorePlans.filter((candidate) => candidate.changed)) {
745
+ applyGitIgnore(plan);
746
+ appliedGitIgnores.push(plan);
747
+ }
748
+ mkdirSync(targetRoot, { recursive: true });
749
+ for (const receipt of changed) {
750
+ const backup = pathEntryExists(receipt.target) ? nodePath.join(backups, receipt.id) : null;
751
+ if (backup)
752
+ renameSync(receipt.target, backup);
753
+ renameSync(nodePath.join(staged, receipt.id), receipt.target);
754
+ rollback.push({ target: receipt.target, backup });
755
+ receipt.status = "current";
756
+ receipt.detail = "projected exact catalog bytes";
757
+ }
758
+ for (const prior of safeRemovals) {
759
+ const backup = nodePath.join(backups, `removed-${prior.id}`);
760
+ renameSync(prior.target, backup);
761
+ rollback.push({ target: prior.target, backup });
762
+ removed.push(prior.id);
763
+ }
764
+ mkdirSync(nodePath.dirname(manifestPath), { recursive: true });
765
+ const nextManifest = {
766
+ schema: MANIFEST_SCHEMA,
767
+ runtime: input.runtime,
768
+ targetRoot,
769
+ updatedAt: new Date().toISOString(),
770
+ topologySelections: canonicalTopologySelections,
771
+ projectSelection,
772
+ skills: nextOwned,
773
+ };
774
+ const tmpManifest = `${manifestPath}.${randomUUID()}.tmp`;
775
+ writeFileSync(tmpManifest, `${JSON.stringify(nextManifest, null, 2)}\n`, "utf8");
776
+ renameSync(tmpManifest, manifestPath);
777
+ rmSync(stagingRoot, { recursive: true, force: true });
778
+ return {
779
+ ok: true,
780
+ applied: true,
781
+ freshLaunchRequired: changed.length > 0 || removed.length > 0,
782
+ runtime: input.runtime,
783
+ targetRoot,
784
+ manifestPath,
785
+ receipts,
786
+ removed,
787
+ errors: [],
788
+ };
789
+ }
790
+ catch (err) {
791
+ for (const action of rollback.reverse()) {
792
+ try {
793
+ if (pathEntryExists(action.target))
794
+ rmSync(action.target, { recursive: true, force: true });
795
+ if (action.backup && pathEntryExists(action.backup))
796
+ renameSync(action.backup, action.target);
797
+ }
798
+ catch { /* retain the original failure; rollback is best-effort */ }
799
+ }
800
+ for (const plan of appliedGitIgnores.reverse()) {
801
+ try {
802
+ restoreGitIgnore(plan);
803
+ }
804
+ catch { /* retain the original failure; rollback is best-effort */ }
805
+ }
806
+ for (const receipt of changed) {
807
+ const skill = effectiveEntries.find((entry) => entry.id === receipt.id);
808
+ const restored = classifySkillProjectionTarget(skill, owned.get(receipt.id), receipt.target);
809
+ receipt.status = restored.status;
810
+ receipt.detail = restored.detail;
811
+ }
812
+ if (stagingRoot)
813
+ rmSync(stagingRoot, { recursive: true, force: true });
814
+ return {
815
+ ok: false,
816
+ applied: false,
817
+ freshLaunchRequired: false,
818
+ runtime: input.runtime,
819
+ targetRoot,
820
+ manifestPath,
821
+ receipts,
822
+ removed: [],
823
+ errors: [{ code: "projection_failed", message: `skill projection failed and was rolled back: ${err.message}` }],
824
+ };
825
+ }
826
+ }
827
+ //# sourceMappingURL=skill-catalog.js.map