@openrig/cli 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (635) hide show
  1. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +15 -0
  2. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +24 -0
  3. package/daemon/assets/plugins/openrig-core/LICENSE +200 -0
  4. package/daemon/assets/plugins/openrig-core/README.md +42 -0
  5. package/daemon/assets/plugins/openrig-core/hooks/claude.json +78 -0
  6. package/daemon/assets/plugins/openrig-core/hooks/codex.json +37 -0
  7. package/daemon/assets/{openrig-activity-hook-relay.cjs → plugins/openrig-core/hooks/scripts/activity-relay.cjs} +12 -0
  8. package/daemon/assets/plugins/openrig-core/hooks/scripts/compaction-restore-bridge.cjs +172 -0
  9. package/daemon/assets/plugins/openrig-core/skills/agent-startup-and-context-ingestion/SKILL.md +104 -0
  10. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +131 -0
  11. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +174 -0
  12. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +433 -0
  13. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/templates/compact-instruction.md +1 -0
  14. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/templates/post-compact-restore-instruction.md +1 -0
  15. package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +305 -0
  16. package/daemon/{specs/agents/shared/skills/rig-architect → assets/plugins/openrig-core/skills/openrig-architect}/SKILL.md +38 -19
  17. package/daemon/assets/plugins/openrig-core/skills/openrig-operator/SKILL.md +222 -0
  18. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +597 -0
  19. package/daemon/assets/plugins/openrig-core/skills/queue-handoff/SKILL.md +122 -0
  20. package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +137 -0
  21. package/daemon/assets/vm-preview-fixtures/README.md +48 -0
  22. package/daemon/assets/vm-preview-fixtures/workflows/sample-basic-loop.yaml +79 -0
  23. package/daemon/dist/adapters/claude-code-adapter.d.ts +11 -3
  24. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  25. package/daemon/dist/adapters/claude-code-adapter.js +58 -60
  26. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  27. package/daemon/dist/adapters/cmux-transport.d.ts.map +1 -1
  28. package/daemon/dist/adapters/cmux-transport.js +81 -2
  29. package/daemon/dist/adapters/cmux-transport.js.map +1 -1
  30. package/daemon/dist/adapters/cmux.d.ts +4 -0
  31. package/daemon/dist/adapters/cmux.d.ts.map +1 -1
  32. package/daemon/dist/adapters/cmux.js +87 -0
  33. package/daemon/dist/adapters/cmux.js.map +1 -1
  34. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +14 -3
  35. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  36. package/daemon/dist/adapters/codex-runtime-adapter.js +43 -57
  37. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  38. package/daemon/dist/builtins/workflow-specs/basic-loop.yaml +76 -0
  39. package/daemon/dist/builtins/workflow-specs/conveyor.yaml +80 -0
  40. package/daemon/dist/db/migrations/026_inbox_entries.d.ts +1 -1
  41. package/daemon/dist/db/migrations/026_inbox_entries.js +1 -1
  42. package/daemon/dist/db/migrations/029_classifier_leases.d.ts +1 -1
  43. package/daemon/dist/db/migrations/029_classifier_leases.js +1 -1
  44. package/daemon/dist/db/migrations/037_mission_control_actions.d.ts +51 -0
  45. package/daemon/dist/db/migrations/037_mission_control_actions.d.ts.map +1 -0
  46. package/daemon/dist/db/migrations/037_mission_control_actions.js +74 -0
  47. package/daemon/dist/db/migrations/037_mission_control_actions.js.map +1 -0
  48. package/daemon/dist/db/migrations/038_workspace_primitive.d.ts +16 -0
  49. package/daemon/dist/db/migrations/038_workspace_primitive.d.ts.map +1 -0
  50. package/daemon/dist/db/migrations/038_workspace_primitive.js +20 -0
  51. package/daemon/dist/db/migrations/038_workspace_primitive.js.map +1 -0
  52. package/daemon/dist/db/migrations/039_queue_target_repo.d.ts +16 -0
  53. package/daemon/dist/db/migrations/039_queue_target_repo.d.ts.map +1 -0
  54. package/daemon/dist/db/migrations/039_queue_target_repo.js +21 -0
  55. package/daemon/dist/db/migrations/039_queue_target_repo.js.map +1 -0
  56. package/daemon/dist/db/migrations/040_workflow_specs_diagnostic.d.ts +32 -0
  57. package/daemon/dist/db/migrations/040_workflow_specs_diagnostic.d.ts.map +1 -0
  58. package/daemon/dist/db/migrations/040_workflow_specs_diagnostic.js +37 -0
  59. package/daemon/dist/db/migrations/040_workflow_specs_diagnostic.js.map +1 -0
  60. package/daemon/dist/domain/active-lens-store.d.ts +23 -0
  61. package/daemon/dist/domain/active-lens-store.d.ts.map +1 -0
  62. package/daemon/dist/domain/active-lens-store.js +87 -0
  63. package/daemon/dist/domain/active-lens-store.js.map +1 -0
  64. package/daemon/dist/domain/agent-images/agent-image-library-service.d.ts +68 -0
  65. package/daemon/dist/domain/agent-images/agent-image-library-service.d.ts.map +1 -0
  66. package/daemon/dist/domain/agent-images/agent-image-library-service.js +339 -0
  67. package/daemon/dist/domain/agent-images/agent-image-library-service.js.map +1 -0
  68. package/daemon/dist/domain/agent-images/agent-image-types.d.ts +113 -0
  69. package/daemon/dist/domain/agent-images/agent-image-types.d.ts.map +1 -0
  70. package/daemon/dist/domain/agent-images/agent-image-types.js +24 -0
  71. package/daemon/dist/domain/agent-images/agent-image-types.js.map +1 -0
  72. package/daemon/dist/domain/agent-images/evidence-guard.d.ts +26 -0
  73. package/daemon/dist/domain/agent-images/evidence-guard.d.ts.map +1 -0
  74. package/daemon/dist/domain/agent-images/evidence-guard.js +185 -0
  75. package/daemon/dist/domain/agent-images/evidence-guard.js.map +1 -0
  76. package/daemon/dist/domain/agent-images/manifest-parser.d.ts +3 -0
  77. package/daemon/dist/domain/agent-images/manifest-parser.d.ts.map +1 -0
  78. package/daemon/dist/domain/agent-images/manifest-parser.js +114 -0
  79. package/daemon/dist/domain/agent-images/manifest-parser.js.map +1 -0
  80. package/daemon/dist/domain/agent-images/resume-token-discovery.d.ts +28 -0
  81. package/daemon/dist/domain/agent-images/resume-token-discovery.d.ts.map +1 -0
  82. package/daemon/dist/domain/agent-images/resume-token-discovery.js +83 -0
  83. package/daemon/dist/domain/agent-images/resume-token-discovery.js.map +1 -0
  84. package/daemon/dist/domain/agent-images/snapshot-capturer.d.ts +36 -0
  85. package/daemon/dist/domain/agent-images/snapshot-capturer.d.ts.map +1 -0
  86. package/daemon/dist/domain/agent-images/snapshot-capturer.js +58 -0
  87. package/daemon/dist/domain/agent-images/snapshot-capturer.js.map +1 -0
  88. package/daemon/dist/domain/agent-manifest.d.ts.map +1 -1
  89. package/daemon/dist/domain/agent-manifest.js +116 -37
  90. package/daemon/dist/domain/agent-manifest.js.map +1 -1
  91. package/daemon/dist/domain/agent-resolver.js +1 -1
  92. package/daemon/dist/domain/agent-resolver.js.map +1 -1
  93. package/daemon/dist/domain/agent-starter-resolver.d.ts +10 -16
  94. package/daemon/dist/domain/agent-starter-resolver.d.ts.map +1 -1
  95. package/daemon/dist/domain/agent-starter-resolver.js +11 -13
  96. package/daemon/dist/domain/agent-starter-resolver.js.map +1 -1
  97. package/daemon/dist/domain/classifier-lease-manager.d.ts +1 -1
  98. package/daemon/dist/domain/classifier-lease-manager.js +1 -1
  99. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +81 -0
  100. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -0
  101. package/daemon/dist/domain/claude-compaction-enforcer.js +242 -0
  102. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -0
  103. package/daemon/dist/domain/cmux-layout-service.d.ts +41 -0
  104. package/daemon/dist/domain/cmux-layout-service.d.ts.map +1 -0
  105. package/daemon/dist/domain/cmux-layout-service.js +184 -0
  106. package/daemon/dist/domain/cmux-layout-service.js.map +1 -0
  107. package/daemon/dist/domain/conflict-detector.d.ts.map +1 -1
  108. package/daemon/dist/domain/conflict-detector.js +6 -3
  109. package/daemon/dist/domain/conflict-detector.js.map +1 -1
  110. package/daemon/dist/domain/context-monitor.d.ts +20 -5
  111. package/daemon/dist/domain/context-monitor.d.ts.map +1 -1
  112. package/daemon/dist/domain/context-monitor.js +63 -13
  113. package/daemon/dist/domain/context-monitor.js.map +1 -1
  114. package/daemon/dist/domain/context-packs/bundle-assembler.d.ts +49 -0
  115. package/daemon/dist/domain/context-packs/bundle-assembler.d.ts.map +1 -0
  116. package/daemon/dist/domain/context-packs/bundle-assembler.js +81 -0
  117. package/daemon/dist/domain/context-packs/bundle-assembler.js.map +1 -0
  118. package/daemon/dist/domain/context-packs/context-pack-library-service.d.ts +41 -0
  119. package/daemon/dist/domain/context-packs/context-pack-library-service.d.ts.map +1 -0
  120. package/daemon/dist/domain/context-packs/context-pack-library-service.js +148 -0
  121. package/daemon/dist/domain/context-packs/context-pack-library-service.js.map +1 -0
  122. package/daemon/dist/domain/context-packs/context-pack-types.d.ts +64 -0
  123. package/daemon/dist/domain/context-packs/context-pack-types.d.ts.map +1 -0
  124. package/daemon/dist/domain/context-packs/context-pack-types.js +22 -0
  125. package/daemon/dist/domain/context-packs/context-pack-types.js.map +1 -0
  126. package/daemon/dist/domain/context-packs/manifest-parser.d.ts +3 -0
  127. package/daemon/dist/domain/context-packs/manifest-parser.d.ts.map +1 -0
  128. package/daemon/dist/domain/context-packs/manifest-parser.js +74 -0
  129. package/daemon/dist/domain/context-packs/manifest-parser.js.map +1 -0
  130. package/daemon/dist/domain/context-usage-store.d.ts +14 -1
  131. package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
  132. package/daemon/dist/domain/context-usage-store.js +156 -1
  133. package/daemon/dist/domain/context-usage-store.js.map +1 -1
  134. package/daemon/dist/domain/files/file-write-service.d.ts +61 -0
  135. package/daemon/dist/domain/files/file-write-service.d.ts.map +1 -0
  136. package/daemon/dist/domain/files/file-write-service.js +180 -0
  137. package/daemon/dist/domain/files/file-write-service.js.map +1 -0
  138. package/daemon/dist/domain/files/path-safety.d.ts +47 -0
  139. package/daemon/dist/domain/files/path-safety.d.ts.map +1 -0
  140. package/daemon/dist/domain/files/path-safety.js +176 -0
  141. package/daemon/dist/domain/files/path-safety.js.map +1 -0
  142. package/daemon/dist/domain/graph-projection.d.ts +14 -1
  143. package/daemon/dist/domain/graph-projection.d.ts.map +1 -1
  144. package/daemon/dist/domain/graph-projection.js +8 -0
  145. package/daemon/dist/domain/graph-projection.js.map +1 -1
  146. package/daemon/dist/domain/install-engine.d.ts.map +1 -1
  147. package/daemon/dist/domain/install-engine.js +22 -6
  148. package/daemon/dist/domain/install-engine.js.map +1 -1
  149. package/daemon/dist/domain/install-verifier.d.ts.map +1 -1
  150. package/daemon/dist/domain/install-verifier.js +10 -5
  151. package/daemon/dist/domain/install-verifier.js.map +1 -1
  152. package/daemon/dist/domain/kernel-boot-tracker.d.ts +74 -0
  153. package/daemon/dist/domain/kernel-boot-tracker.d.ts.map +1 -0
  154. package/daemon/dist/domain/kernel-boot-tracker.js +213 -0
  155. package/daemon/dist/domain/kernel-boot-tracker.js.map +1 -0
  156. package/daemon/dist/domain/kernel-boot.d.ts +50 -0
  157. package/daemon/dist/domain/kernel-boot.d.ts.map +1 -0
  158. package/daemon/dist/domain/kernel-boot.js +147 -0
  159. package/daemon/dist/domain/kernel-boot.js.map +1 -0
  160. package/daemon/dist/domain/managed-blocks.d.ts.map +1 -1
  161. package/daemon/dist/domain/managed-blocks.js +22 -3
  162. package/daemon/dist/domain/managed-blocks.js.map +1 -1
  163. package/daemon/dist/domain/mission-control/audit-browse.d.ts +26 -0
  164. package/daemon/dist/domain/mission-control/audit-browse.d.ts.map +1 -0
  165. package/daemon/dist/domain/mission-control/audit-browse.js +101 -0
  166. package/daemon/dist/domain/mission-control/audit-browse.js.map +1 -0
  167. package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts +51 -0
  168. package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts.map +1 -0
  169. package/daemon/dist/domain/mission-control/mission-control-action-log.js +124 -0
  170. package/daemon/dist/domain/mission-control/mission-control-action-log.js.map +1 -0
  171. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.d.ts +131 -0
  172. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.d.ts.map +1 -0
  173. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.js +232 -0
  174. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.js.map +1 -0
  175. package/daemon/dist/domain/mission-control/mission-control-read-layer.d.ts +90 -0
  176. package/daemon/dist/domain/mission-control/mission-control-read-layer.d.ts.map +1 -0
  177. package/daemon/dist/domain/mission-control/mission-control-read-layer.js +279 -0
  178. package/daemon/dist/domain/mission-control/mission-control-read-layer.js.map +1 -0
  179. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +69 -0
  180. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -0
  181. package/daemon/dist/domain/mission-control/mission-control-write-contract.js +302 -0
  182. package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -0
  183. package/daemon/dist/domain/mission-control/notification-adapter-ntfy.d.ts +18 -0
  184. package/daemon/dist/domain/mission-control/notification-adapter-ntfy.d.ts.map +1 -0
  185. package/daemon/dist/domain/mission-control/notification-adapter-ntfy.js +48 -0
  186. package/daemon/dist/domain/mission-control/notification-adapter-ntfy.js.map +1 -0
  187. package/daemon/dist/domain/mission-control/notification-adapter-types.d.ts +25 -0
  188. package/daemon/dist/domain/mission-control/notification-adapter-types.d.ts.map +1 -0
  189. package/daemon/dist/domain/mission-control/notification-adapter-types.js +7 -0
  190. package/daemon/dist/domain/mission-control/notification-adapter-types.js.map +1 -0
  191. package/daemon/dist/domain/mission-control/notification-adapter-webhook.d.ts +27 -0
  192. package/daemon/dist/domain/mission-control/notification-adapter-webhook.d.ts.map +1 -0
  193. package/daemon/dist/domain/mission-control/notification-adapter-webhook.js +47 -0
  194. package/daemon/dist/domain/mission-control/notification-adapter-webhook.js.map +1 -0
  195. package/daemon/dist/domain/mission-control/notification-dispatcher.d.ts +53 -0
  196. package/daemon/dist/domain/mission-control/notification-dispatcher.d.ts.map +1 -0
  197. package/daemon/dist/domain/mission-control/notification-dispatcher.js +181 -0
  198. package/daemon/dist/domain/mission-control/notification-dispatcher.js.map +1 -0
  199. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  200. package/daemon/dist/domain/node-inventory.js +24 -0
  201. package/daemon/dist/domain/node-inventory.js.map +1 -1
  202. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  203. package/daemon/dist/domain/node-launcher.js +7 -5
  204. package/daemon/dist/domain/node-launcher.js.map +1 -1
  205. package/daemon/dist/domain/plugin-discovery-service.d.ts +150 -0
  206. package/daemon/dist/domain/plugin-discovery-service.d.ts.map +1 -0
  207. package/daemon/dist/domain/plugin-discovery-service.js +468 -0
  208. package/daemon/dist/domain/plugin-discovery-service.js.map +1 -0
  209. package/daemon/dist/domain/plugin-vendor-service.d.ts +54 -0
  210. package/daemon/dist/domain/plugin-vendor-service.d.ts.map +1 -0
  211. package/daemon/dist/domain/plugin-vendor-service.js +111 -0
  212. package/daemon/dist/domain/plugin-vendor-service.js.map +1 -0
  213. package/daemon/dist/domain/preview/preview-rate-limiter.d.ts +20 -0
  214. package/daemon/dist/domain/preview/preview-rate-limiter.d.ts.map +1 -0
  215. package/daemon/dist/domain/preview/preview-rate-limiter.js +46 -0
  216. package/daemon/dist/domain/preview/preview-rate-limiter.js.map +1 -0
  217. package/daemon/dist/domain/profile-resolver.d.ts +8 -3
  218. package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
  219. package/daemon/dist/domain/profile-resolver.js +69 -15
  220. package/daemon/dist/domain/profile-resolver.js.map +1 -1
  221. package/daemon/dist/domain/progress/progress-indexer.d.ts +73 -0
  222. package/daemon/dist/domain/progress/progress-indexer.d.ts.map +1 -0
  223. package/daemon/dist/domain/progress/progress-indexer.js +210 -0
  224. package/daemon/dist/domain/progress/progress-indexer.js.map +1 -0
  225. package/daemon/dist/domain/project-classifier.d.ts +1 -1
  226. package/daemon/dist/domain/projection-planner.d.ts +7 -1
  227. package/daemon/dist/domain/projection-planner.d.ts.map +1 -1
  228. package/daemon/dist/domain/projection-planner.js +44 -4
  229. package/daemon/dist/domain/projection-planner.js.map +1 -1
  230. package/daemon/dist/domain/queue-repository.d.ts +30 -5
  231. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  232. package/daemon/dist/domain/queue-repository.js +94 -27
  233. package/daemon/dist/domain/queue-repository.js.map +1 -1
  234. package/daemon/dist/domain/rehydrate-eligibility.d.ts +16 -0
  235. package/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -0
  236. package/daemon/dist/domain/rehydrate-eligibility.js +43 -0
  237. package/daemon/dist/domain/rehydrate-eligibility.js.map +1 -0
  238. package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
  239. package/daemon/dist/domain/restore-check-service.js +19 -6
  240. package/daemon/dist/domain/restore-check-service.js.map +1 -1
  241. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  242. package/daemon/dist/domain/restore-orchestrator.js +4 -2
  243. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  244. package/daemon/dist/domain/rig-repository.d.ts +14 -0
  245. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  246. package/daemon/dist/domain/rig-repository.js +41 -0
  247. package/daemon/dist/domain/rig-repository.js.map +1 -1
  248. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  249. package/daemon/dist/domain/rig-teardown.js +5 -0
  250. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  251. package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
  252. package/daemon/dist/domain/rigspec-codec.js +15 -0
  253. package/daemon/dist/domain/rigspec-codec.js.map +1 -1
  254. package/daemon/dist/domain/rigspec-instantiator.d.ts +29 -0
  255. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  256. package/daemon/dist/domain/rigspec-instantiator.js +136 -4
  257. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  258. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  259. package/daemon/dist/domain/rigspec-schema.js +157 -4
  260. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  261. package/daemon/dist/domain/runtime-adapter.d.ts +11 -0
  262. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  263. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  264. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  265. package/daemon/dist/domain/session-transport.js +33 -0
  266. package/daemon/dist/domain/session-transport.js.map +1 -1
  267. package/daemon/dist/domain/skill-discovery.d.ts +51 -0
  268. package/daemon/dist/domain/skill-discovery.d.ts.map +1 -0
  269. package/daemon/dist/domain/skill-discovery.js +144 -0
  270. package/daemon/dist/domain/skill-discovery.js.map +1 -0
  271. package/daemon/dist/domain/skill-library-discovery.d.ts +68 -0
  272. package/daemon/dist/domain/skill-library-discovery.d.ts.map +1 -0
  273. package/daemon/dist/domain/skill-library-discovery.js +144 -0
  274. package/daemon/dist/domain/skill-library-discovery.js.map +1 -0
  275. package/daemon/dist/domain/slices/slice-detail-projector.d.ts +182 -0
  276. package/daemon/dist/domain/slices/slice-detail-projector.d.ts.map +1 -0
  277. package/daemon/dist/domain/slices/slice-detail-projector.js +508 -0
  278. package/daemon/dist/domain/slices/slice-detail-projector.js.map +1 -0
  279. package/daemon/dist/domain/slices/slice-indexer.d.ts +137 -0
  280. package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -0
  281. package/daemon/dist/domain/slices/slice-indexer.js +585 -0
  282. package/daemon/dist/domain/slices/slice-indexer.js.map +1 -0
  283. package/daemon/dist/domain/spec-library-service.d.ts +23 -2
  284. package/daemon/dist/domain/spec-library-service.d.ts.map +1 -1
  285. package/daemon/dist/domain/spec-library-service.js +31 -1
  286. package/daemon/dist/domain/spec-library-service.js.map +1 -1
  287. package/daemon/dist/domain/spec-library-workflow-scanner.d.ts +124 -0
  288. package/daemon/dist/domain/spec-library-workflow-scanner.d.ts.map +1 -0
  289. package/daemon/dist/domain/spec-library-workflow-scanner.js +325 -0
  290. package/daemon/dist/domain/spec-library-workflow-scanner.js.map +1 -0
  291. package/daemon/dist/domain/spec-review-service.d.ts +1 -1
  292. package/daemon/dist/domain/spec-review-service.d.ts.map +1 -1
  293. package/daemon/dist/domain/spec-review-service.js +14 -1
  294. package/daemon/dist/domain/spec-review-service.js.map +1 -1
  295. package/daemon/dist/domain/startup-validation.d.ts.map +1 -1
  296. package/daemon/dist/domain/startup-validation.js +57 -11
  297. package/daemon/dist/domain/startup-validation.js.map +1 -1
  298. package/daemon/dist/domain/steering/health-summary.d.ts +39 -0
  299. package/daemon/dist/domain/steering/health-summary.d.ts.map +1 -0
  300. package/daemon/dist/domain/steering/health-summary.js +100 -0
  301. package/daemon/dist/domain/steering/health-summary.js.map +1 -0
  302. package/daemon/dist/domain/steering/steering-composer.d.ts +102 -0
  303. package/daemon/dist/domain/steering/steering-composer.d.ts.map +1 -0
  304. package/daemon/dist/domain/steering/steering-composer.js +263 -0
  305. package/daemon/dist/domain/steering/steering-composer.js.map +1 -0
  306. package/daemon/dist/domain/transcript-capture.d.ts.map +1 -1
  307. package/daemon/dist/domain/transcript-capture.js +7 -4
  308. package/daemon/dist/domain/transcript-capture.js.map +1 -1
  309. package/daemon/dist/domain/transcript-rotation.d.ts +29 -0
  310. package/daemon/dist/domain/transcript-rotation.d.ts.map +1 -0
  311. package/daemon/dist/domain/transcript-rotation.js +109 -0
  312. package/daemon/dist/domain/transcript-rotation.js.map +1 -0
  313. package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
  314. package/daemon/dist/domain/transcript-store.js +7 -1
  315. package/daemon/dist/domain/transcript-store.js.map +1 -1
  316. package/daemon/dist/domain/types.d.ts +128 -9
  317. package/daemon/dist/domain/types.d.ts.map +1 -1
  318. package/daemon/dist/domain/types.js +8 -1
  319. package/daemon/dist/domain/types.js.map +1 -1
  320. package/daemon/dist/domain/user-settings/settings-store.d.ts +66 -0
  321. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -0
  322. package/daemon/dist/domain/user-settings/settings-store.js +546 -0
  323. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -0
  324. package/daemon/dist/domain/view-event-bridge.d.ts.map +1 -1
  325. package/daemon/dist/domain/view-event-bridge.js +2 -3
  326. package/daemon/dist/domain/view-event-bridge.js.map +1 -1
  327. package/daemon/dist/domain/whoami-service.d.ts +29 -0
  328. package/daemon/dist/domain/whoami-service.d.ts.map +1 -1
  329. package/daemon/dist/domain/whoami-service.js +68 -0
  330. package/daemon/dist/domain/whoami-service.js.map +1 -1
  331. package/daemon/dist/domain/workflow/slice-workflow-binding.d.ts +21 -0
  332. package/daemon/dist/domain/workflow/slice-workflow-binding.d.ts.map +1 -0
  333. package/daemon/dist/domain/workflow/slice-workflow-binding.js +103 -0
  334. package/daemon/dist/domain/workflow/slice-workflow-binding.js.map +1 -0
  335. package/daemon/dist/domain/workflow/slice-workflow-projection.d.ts +81 -0
  336. package/daemon/dist/domain/workflow/slice-workflow-projection.d.ts.map +1 -0
  337. package/daemon/dist/domain/workflow/slice-workflow-projection.js +127 -0
  338. package/daemon/dist/domain/workflow/slice-workflow-projection.js.map +1 -0
  339. package/daemon/dist/domain/workflow/starter-spec-loader.d.ts +51 -0
  340. package/daemon/dist/domain/workflow/starter-spec-loader.d.ts.map +1 -0
  341. package/daemon/dist/domain/workflow/starter-spec-loader.js +140 -0
  342. package/daemon/dist/domain/workflow/starter-spec-loader.js.map +1 -0
  343. package/daemon/dist/domain/workflow-projector.js +11 -3
  344. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  345. package/daemon/dist/domain/workflow-spec-cache.d.ts +34 -0
  346. package/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
  347. package/daemon/dist/domain/workflow-spec-cache.js +121 -15
  348. package/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
  349. package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts +6 -0
  350. package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -0
  351. package/daemon/dist/domain/workspace/default-workspace-scaffold.js +252 -0
  352. package/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -0
  353. package/daemon/dist/domain/workspace/frontmatter-validator.d.ts +40 -0
  354. package/daemon/dist/domain/workspace/frontmatter-validator.d.ts.map +1 -0
  355. package/daemon/dist/domain/workspace/frontmatter-validator.js +185 -0
  356. package/daemon/dist/domain/workspace/frontmatter-validator.js.map +1 -0
  357. package/daemon/dist/domain/workspace/getting-started-narrative.d.ts +15 -0
  358. package/daemon/dist/domain/workspace/getting-started-narrative.d.ts.map +1 -0
  359. package/daemon/dist/domain/workspace/getting-started-narrative.js +237 -0
  360. package/daemon/dist/domain/workspace/getting-started-narrative.js.map +1 -0
  361. package/daemon/dist/domain/workspace/workspace-resolver.d.ts +25 -0
  362. package/daemon/dist/domain/workspace/workspace-resolver.d.ts.map +1 -0
  363. package/daemon/dist/domain/workspace/workspace-resolver.js +86 -0
  364. package/daemon/dist/domain/workspace/workspace-resolver.js.map +1 -0
  365. package/daemon/dist/index.d.ts +2 -1
  366. package/daemon/dist/index.d.ts.map +1 -1
  367. package/daemon/dist/index.js +56 -12
  368. package/daemon/dist/index.js.map +1 -1
  369. package/daemon/dist/lib/pane-envelope.d.ts +7 -0
  370. package/daemon/dist/lib/pane-envelope.d.ts.map +1 -0
  371. package/daemon/dist/lib/pane-envelope.js +38 -0
  372. package/daemon/dist/lib/pane-envelope.js.map +1 -0
  373. package/daemon/dist/middleware/auth-bearer-token.d.ts +91 -0
  374. package/daemon/dist/middleware/auth-bearer-token.d.ts.map +1 -0
  375. package/daemon/dist/middleware/auth-bearer-token.js +236 -0
  376. package/daemon/dist/middleware/auth-bearer-token.js.map +1 -0
  377. package/daemon/dist/openrig-compat.d.ts +1 -1
  378. package/daemon/dist/openrig-compat.d.ts.map +1 -1
  379. package/daemon/dist/openrig-compat.js +6 -4
  380. package/daemon/dist/openrig-compat.js.map +1 -1
  381. package/daemon/dist/routes/agent-images.d.ts +8 -0
  382. package/daemon/dist/routes/agent-images.d.ts.map +1 -0
  383. package/daemon/dist/routes/agent-images.js +253 -0
  384. package/daemon/dist/routes/agent-images.js.map +1 -0
  385. package/daemon/dist/routes/config.d.ts +3 -0
  386. package/daemon/dist/routes/config.d.ts.map +1 -0
  387. package/daemon/dist/routes/config.js +109 -0
  388. package/daemon/dist/routes/config.js.map +1 -0
  389. package/daemon/dist/routes/context-packs.d.ts +3 -0
  390. package/daemon/dist/routes/context-packs.d.ts.map +1 -0
  391. package/daemon/dist/routes/context-packs.js +129 -0
  392. package/daemon/dist/routes/context-packs.js.map +1 -0
  393. package/daemon/dist/routes/files.d.ts +17 -0
  394. package/daemon/dist/routes/files.d.ts.map +1 -0
  395. package/daemon/dist/routes/files.js +262 -0
  396. package/daemon/dist/routes/files.js.map +1 -0
  397. package/daemon/dist/routes/health-summary.d.ts +9 -0
  398. package/daemon/dist/routes/health-summary.d.ts.map +1 -0
  399. package/daemon/dist/routes/health-summary.js +33 -0
  400. package/daemon/dist/routes/health-summary.js.map +1 -0
  401. package/daemon/dist/routes/kernel-status.d.ts +3 -0
  402. package/daemon/dist/routes/kernel-status.d.ts.map +1 -0
  403. package/daemon/dist/routes/kernel-status.js +40 -0
  404. package/daemon/dist/routes/kernel-status.js.map +1 -0
  405. package/daemon/dist/routes/mission-control.d.ts +37 -0
  406. package/daemon/dist/routes/mission-control.d.ts.map +1 -0
  407. package/daemon/dist/routes/mission-control.js +306 -0
  408. package/daemon/dist/routes/mission-control.js.map +1 -0
  409. package/daemon/dist/routes/missions.d.ts +3 -0
  410. package/daemon/dist/routes/missions.d.ts.map +1 -0
  411. package/daemon/dist/routes/missions.js +195 -0
  412. package/daemon/dist/routes/missions.js.map +1 -0
  413. package/daemon/dist/routes/plugins.d.ts +3 -0
  414. package/daemon/dist/routes/plugins.d.ts.map +1 -0
  415. package/daemon/dist/routes/plugins.js +223 -0
  416. package/daemon/dist/routes/plugins.js.map +1 -0
  417. package/daemon/dist/routes/progress.d.ts +7 -0
  418. package/daemon/dist/routes/progress.d.ts.map +1 -0
  419. package/daemon/dist/routes/progress.js +33 -0
  420. package/daemon/dist/routes/progress.js.map +1 -0
  421. package/daemon/dist/routes/queue.d.ts.map +1 -1
  422. package/daemon/dist/routes/queue.js +52 -1
  423. package/daemon/dist/routes/queue.js.map +1 -1
  424. package/daemon/dist/routes/rig-cmux.d.ts +3 -0
  425. package/daemon/dist/routes/rig-cmux.d.ts.map +1 -0
  426. package/daemon/dist/routes/rig-cmux.js +121 -0
  427. package/daemon/dist/routes/rig-cmux.js.map +1 -0
  428. package/daemon/dist/routes/rigs.d.ts +3 -0
  429. package/daemon/dist/routes/rigs.d.ts.map +1 -1
  430. package/daemon/dist/routes/rigs.js +73 -7
  431. package/daemon/dist/routes/rigs.js.map +1 -1
  432. package/daemon/dist/routes/rigspec.js +6 -3
  433. package/daemon/dist/routes/rigspec.js.map +1 -1
  434. package/daemon/dist/routes/sessions.d.ts.map +1 -1
  435. package/daemon/dist/routes/sessions.js +119 -0
  436. package/daemon/dist/routes/sessions.js.map +1 -1
  437. package/daemon/dist/routes/skills.d.ts +3 -0
  438. package/daemon/dist/routes/skills.d.ts.map +1 -0
  439. package/daemon/dist/routes/skills.js +147 -0
  440. package/daemon/dist/routes/skills.js.map +1 -0
  441. package/daemon/dist/routes/slices.d.ts +9 -0
  442. package/daemon/dist/routes/slices.d.ts.map +1 -0
  443. package/daemon/dist/routes/slices.js +207 -0
  444. package/daemon/dist/routes/slices.js.map +1 -0
  445. package/daemon/dist/routes/spec-library.d.ts.map +1 -1
  446. package/daemon/dist/routes/spec-library.js +87 -5
  447. package/daemon/dist/routes/spec-library.js.map +1 -1
  448. package/daemon/dist/routes/steering.d.ts +7 -0
  449. package/daemon/dist/routes/steering.d.ts.map +1 -0
  450. package/daemon/dist/routes/steering.js +27 -0
  451. package/daemon/dist/routes/steering.js.map +1 -0
  452. package/daemon/dist/routes/up.d.ts.map +1 -1
  453. package/daemon/dist/routes/up.js +21 -3
  454. package/daemon/dist/routes/up.js.map +1 -1
  455. package/daemon/dist/routes/whoami.d.ts.map +1 -1
  456. package/daemon/dist/routes/whoami.js +6 -1
  457. package/daemon/dist/routes/whoami.js.map +1 -1
  458. package/daemon/dist/routes/workflow.d.ts.map +1 -1
  459. package/daemon/dist/routes/workflow.js +43 -0
  460. package/daemon/dist/routes/workflow.js.map +1 -1
  461. package/daemon/dist/routes/workspace.d.ts +3 -0
  462. package/daemon/dist/routes/workspace.d.ts.map +1 -0
  463. package/daemon/dist/routes/workspace.js +53 -0
  464. package/daemon/dist/routes/workspace.js.map +1 -0
  465. package/daemon/dist/server.d.ts +82 -0
  466. package/daemon/dist/server.d.ts.map +1 -1
  467. package/daemon/dist/server.js +82 -1
  468. package/daemon/dist/server.js.map +1 -1
  469. package/daemon/dist/startup.d.ts +9 -0
  470. package/daemon/dist/startup.d.ts.map +1 -1
  471. package/daemon/dist/startup.js +577 -5
  472. package/daemon/dist/startup.js.map +1 -1
  473. package/daemon/docs/reference/agent-spec.md +7 -7
  474. package/daemon/docs/reference/agent-startup-guide.md +2 -2
  475. package/daemon/docs/reference/project-workspace.md +102 -0
  476. package/daemon/specs/agents/apps/vault-specialist/agent.yaml +1 -2
  477. package/daemon/specs/agents/apps/vault-specialist/guidance/role.md +0 -1
  478. package/daemon/specs/agents/conveyor/builder/agent.yaml +34 -0
  479. package/daemon/specs/agents/conveyor/builder/guidance/role.md +31 -0
  480. package/daemon/specs/agents/conveyor/builder/startup/context.md +9 -0
  481. package/daemon/specs/agents/conveyor/lead/agent.yaml +34 -0
  482. package/daemon/specs/agents/conveyor/lead/guidance/role.md +34 -0
  483. package/daemon/specs/agents/conveyor/lead/startup/context.md +15 -0
  484. package/daemon/specs/agents/conveyor/planner/agent.yaml +34 -0
  485. package/daemon/specs/agents/conveyor/planner/guidance/role.md +29 -0
  486. package/daemon/specs/agents/conveyor/planner/startup/context.md +12 -0
  487. package/daemon/specs/agents/conveyor/reviewer/agent.yaml +34 -0
  488. package/daemon/specs/agents/conveyor/reviewer/guidance/role.md +29 -0
  489. package/daemon/specs/agents/conveyor/reviewer/startup/context.md +10 -0
  490. package/daemon/specs/agents/design/product-designer/agent.yaml +0 -1
  491. package/daemon/specs/agents/development/implementer/agent.yaml +1 -2
  492. package/daemon/specs/agents/development/implementer/guidance/role.md +0 -1
  493. package/daemon/specs/agents/development/qa/agent.yaml +0 -1
  494. package/daemon/specs/agents/development/qa/guidance/role.md +0 -2
  495. package/daemon/specs/agents/orchestration/orchestrator/agent.yaml +1 -2
  496. package/daemon/specs/agents/orchestration/orchestrator/guidance/role.md +2 -3
  497. package/daemon/specs/agents/research/analyst/agent.yaml +0 -1
  498. package/daemon/specs/agents/research/synthesizer/agent.yaml +0 -1
  499. package/daemon/specs/agents/review/independent-reviewer/agent.yaml +0 -1
  500. package/daemon/specs/agents/shared/agent.yaml +6 -8
  501. package/daemon/specs/agents/shared/skills/core/openrig-architect/SKILL.md +361 -0
  502. package/daemon/specs/agents/shared/skills/core/openrig-installer/SKILL.md +142 -0
  503. package/daemon/specs/agents/shared/skills/core/openrig-user/SKILL.md +30 -0
  504. package/daemon/specs/agents/shared/skills/core/openrig-user-settings/SKILL.md +153 -0
  505. package/daemon/specs/agents/shared/skills/core/rig-lifecycle/SKILL.md +116 -0
  506. package/daemon/specs/agents/shared/skills/pods/development-team/SKILL.md +0 -1
  507. package/daemon/specs/agents/shared/skills/pods/orchestration-team/SKILL.md +2 -2
  508. package/daemon/specs/agents/shared/skills/process/agent-browser/LOCAL-INSIGHTS.md +6 -6
  509. package/daemon/specs/agents/shared/skills/process/agent-browser/OPENRIG.md +40 -0
  510. package/daemon/specs/agents/shared/skills/process/agent-browser/SKILL.md +10 -0
  511. package/daemon/specs/agents/shared/skills/process/brainstorming/OPENRIG.md +48 -0
  512. package/daemon/specs/agents/shared/skills/process/brainstorming/SKILL.md +11 -0
  513. package/daemon/specs/agents/shared/skills/process/dogfood/SKILL.md +5 -0
  514. package/daemon/specs/agents/shared/skills/process/executing-plans/OPENRIG.md +56 -0
  515. package/daemon/specs/agents/shared/skills/process/executing-plans/SKILL.md +10 -0
  516. package/daemon/specs/agents/shared/skills/process/frontend-design/SKILL.md +5 -0
  517. package/daemon/specs/agents/shared/skills/process/systematic-debugging/SKILL.md +5 -0
  518. package/daemon/specs/agents/shared/skills/process/test-driven-development/SKILL.md +5 -0
  519. package/daemon/specs/agents/shared/skills/process/using-superpowers/OPENRIG.md +48 -0
  520. package/daemon/specs/agents/shared/skills/process/using-superpowers/SKILL.md +11 -0
  521. package/daemon/specs/agents/shared/skills/process/verification-before-completion/SKILL.md +5 -0
  522. package/daemon/specs/agents/shared/skills/process/writing-plans/OPENRIG.md +52 -0
  523. package/daemon/specs/agents/shared/skills/process/writing-plans/SKILL.md +12 -2
  524. package/daemon/specs/rigs/launch/conveyor/CULTURE.md +34 -0
  525. package/daemon/specs/rigs/launch/conveyor/README.md +33 -0
  526. package/daemon/specs/rigs/launch/conveyor/rig.yaml +72 -0
  527. package/daemon/specs/rigs/launch/kernel/agents/advisor/lead/agent.yaml +35 -0
  528. package/daemon/specs/rigs/launch/kernel/agents/advisor/lead/guidance/role.md +50 -0
  529. package/daemon/specs/rigs/launch/kernel/agents/advisor/lead/startup/context.md +37 -0
  530. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/agent.yaml +35 -0
  531. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +49 -0
  532. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/startup/context.md +63 -0
  533. package/daemon/specs/rigs/launch/kernel/agents/queue/worker/agent.yaml +35 -0
  534. package/daemon/specs/rigs/launch/kernel/agents/queue/worker/guidance/role.md +33 -0
  535. package/daemon/specs/rigs/launch/kernel/agents/queue/worker/startup/context.md +30 -0
  536. package/daemon/specs/rigs/launch/kernel/culture/CULTURE.md +69 -0
  537. package/daemon/specs/rigs/launch/kernel/rig-claude-only.yaml +59 -0
  538. package/daemon/specs/rigs/launch/kernel/rig-codex-only.yaml +59 -0
  539. package/daemon/specs/rigs/launch/kernel/rig.yaml +69 -0
  540. package/daemon/specs/rigs/preview/product-team/CULTURE.md +2 -2
  541. package/daemon/specs/rigs/preview/product-team/rig.yaml +3 -4
  542. package/dist/commands/agent-image.d.ts +4 -0
  543. package/dist/commands/agent-image.d.ts.map +1 -0
  544. package/dist/commands/agent-image.js +352 -0
  545. package/dist/commands/agent-image.js.map +1 -0
  546. package/dist/commands/config-init-workspace.d.ts +35 -0
  547. package/dist/commands/config-init-workspace.d.ts.map +1 -0
  548. package/dist/commands/config-init-workspace.js +553 -0
  549. package/dist/commands/config-init-workspace.js.map +1 -0
  550. package/dist/commands/config.d.ts.map +1 -1
  551. package/dist/commands/config.js +86 -18
  552. package/dist/commands/config.js.map +1 -1
  553. package/dist/commands/context-pack.d.ts +4 -0
  554. package/dist/commands/context-pack.d.ts.map +1 -0
  555. package/dist/commands/context-pack.js +357 -0
  556. package/dist/commands/context-pack.js.map +1 -0
  557. package/dist/commands/daemon.d.ts.map +1 -1
  558. package/dist/commands/daemon.js +61 -1
  559. package/dist/commands/daemon.js.map +1 -1
  560. package/dist/commands/heartbeat.d.ts.map +1 -1
  561. package/dist/commands/heartbeat.js +0 -5
  562. package/dist/commands/heartbeat.js.map +1 -1
  563. package/dist/commands/import.d.ts.map +1 -1
  564. package/dist/commands/import.js +7 -2
  565. package/dist/commands/import.js.map +1 -1
  566. package/dist/commands/plugin.d.ts +4 -0
  567. package/dist/commands/plugin.d.ts.map +1 -0
  568. package/dist/commands/plugin.js +395 -0
  569. package/dist/commands/plugin.js.map +1 -0
  570. package/dist/commands/ps.d.ts.map +1 -1
  571. package/dist/commands/ps.js +173 -14
  572. package/dist/commands/ps.js.map +1 -1
  573. package/dist/commands/queue.d.ts.map +1 -1
  574. package/dist/commands/queue.js +9 -0
  575. package/dist/commands/queue.js.map +1 -1
  576. package/dist/commands/send.d.ts +15 -0
  577. package/dist/commands/send.d.ts.map +1 -1
  578. package/dist/commands/send.js +32 -1
  579. package/dist/commands/send.js.map +1 -1
  580. package/dist/commands/specs.d.ts +4 -2
  581. package/dist/commands/specs.d.ts.map +1 -1
  582. package/dist/commands/specs.js +12 -8
  583. package/dist/commands/specs.js.map +1 -1
  584. package/dist/commands/up.d.ts.map +1 -1
  585. package/dist/commands/up.js +30 -4
  586. package/dist/commands/up.js.map +1 -1
  587. package/dist/commands/whoami.d.ts.map +1 -1
  588. package/dist/commands/whoami.js +9 -4
  589. package/dist/commands/whoami.js.map +1 -1
  590. package/dist/commands/workflow.d.ts.map +1 -1
  591. package/dist/commands/workflow.js +37 -0
  592. package/dist/commands/workflow.js.map +1 -1
  593. package/dist/commands/workspace.d.ts +6 -0
  594. package/dist/commands/workspace.d.ts.map +1 -0
  595. package/dist/commands/workspace.js +83 -0
  596. package/dist/commands/workspace.js.map +1 -0
  597. package/dist/config-store.d.ts +90 -1
  598. package/dist/config-store.d.ts.map +1 -1
  599. package/dist/config-store.js +477 -42
  600. package/dist/config-store.js.map +1 -1
  601. package/dist/daemon-lifecycle.d.ts +42 -1
  602. package/dist/daemon-lifecycle.d.ts.map +1 -1
  603. package/dist/daemon-lifecycle.js +98 -7
  604. package/dist/daemon-lifecycle.js.map +1 -1
  605. package/dist/host-registry.d.ts +1 -1
  606. package/dist/host-registry.js +1 -1
  607. package/dist/index.d.ts +5 -0
  608. package/dist/index.d.ts.map +1 -1
  609. package/dist/index.js +8 -0
  610. package/dist/index.js.map +1 -1
  611. package/dist/openrig-compat.d.ts +1 -1
  612. package/dist/openrig-compat.d.ts.map +1 -1
  613. package/dist/openrig-compat.js +6 -4
  614. package/dist/openrig-compat.js.map +1 -1
  615. package/dist/restore-packet/claude-transcript-parser.js +1 -1
  616. package/dist/restore-packet/claude-transcript-parser.js.map +1 -1
  617. package/dist/restore-packet/codex-jsonl-parser.js +1 -1
  618. package/dist/restore-packet/codex-jsonl-parser.js.map +1 -1
  619. package/package.json +2 -2
  620. package/ui/dist/assets/index-C_Q5FczU.css +1 -0
  621. package/ui/dist/assets/index-Rl3ZBrUg.js +547 -0
  622. package/ui/dist/graphics/operator-climber-monochrome.png +0 -0
  623. package/ui/dist/index.html +3 -2
  624. package/daemon/specs/agents/shared/skills/claude-compact-in-place/SKILL.md +0 -100
  625. package/daemon/specs/agents/shared/skills/mental-model-ha/SKILL.md +0 -956
  626. package/daemon/specs/agents/shared/skills/process/containerized-e2e/SKILL.md +0 -256
  627. package/daemon/specs/agents/shared/skills/process/containerized-e2e/scripts/Dockerfile +0 -39
  628. package/daemon/specs/agents/shared/skills/process/containerized-e2e/scripts/build-e2e-image.sh +0 -37
  629. package/daemon/specs/agents/shared/skills/process/containerized-e2e/templates/control-plane-test.yaml +0 -40
  630. package/daemon/specs/agents/shared/skills/process/containerized-e2e/templates/e2e-report-template.md +0 -94
  631. package/daemon/specs/agents/shared/skills/process/containerized-e2e/templates/expansion-collision-fragment.yaml +0 -13
  632. package/daemon/specs/agents/shared/skills/process/containerized-e2e/templates/expansion-pod-fragment.yaml +0 -14
  633. package/ui/dist/assets/index-B09doO8H.js +0 -139
  634. package/ui/dist/assets/index-Dec25siz.css +0 -1
  635. package/ui/dist/assets/index-GNYaWmBj.js +0 -225
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slice-indexer.d.ts","sourceRoot":"","sources":["../../../src/domain/slices/slice-indexer.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAElE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,a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,gBAAgB;IAQlC,kEAAkE;IAClE,OAAO,IAAI,OAAO;IAIlB,6EAA6E;IAC7E,UAAU,IAAI,IAAI;IAKlB,IAAI,IAAI,cAAc,EAAE;IAYxB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAiBrC,OAAO,CAAC,kBAAkB;IA+C1B,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,UAAU;IAalB,OAAO,CAAC,WAAW;IAwBnB,OAAO,CAAC,WAAW;IA4BnB,OAAO,CAAC,sBAAsB;IAgC9B,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,eAAe;IAiBvB,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,SAAS;IAWjB,OAAO,CAAC,WAAW;IAsFnB,OAAO,CAAC,eAAe;IAsCvB,OAAO,CAAC,eAAe;IAqDvB,OAAO,CAAC,mBAAmB;IA6B3B,OAAO,CAAC,cAAc;CAUvB;AAID,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqBzE;AAED;;;;oCAIoC;AACpC,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAUzE"}
@@ -0,0 +1,585 @@
1
+ // Slice Story View v0 — slice indexer.
2
+ //
3
+ // Reads slice folders from a configured filesystem root. The default
4
+ // workspace contract is `workspace/missions/<mission>/slices/<slice>`;
5
+ // explicitly configured flat roots (`workspace/slices/<slice>`) remain
6
+ // supported for compatibility. The indexer parses each slice's
7
+ // frontmatter + acceptance section markers and exposes a
8
+ // normalized Slice record stitched against already-shipped tables
9
+ // (queue_items, queue_transitions, mission_control_actions) and
10
+ // dogfood-evidence directories.
11
+ //
12
+ // MVP context: single-developer, single-user, single-host. v0 uses the
13
+ // slice folder as the navigable entity. NO new SQLite migrations, NO new
14
+ // event types: read-only projection over existing data + the filesystem.
15
+ import * as fs from "node:fs";
16
+ import * as path from "node:path";
17
+ const FRONTMATTER_DELIM = "---";
18
+ const DEFAULT_CACHE_TTL_MS = 60_000;
19
+ const STATUS_TO_BUCKET = {
20
+ active: "active",
21
+ "in-flight": "active",
22
+ ratified: "active",
23
+ "draft-pending-orch-ratification": "draft",
24
+ draft: "draft",
25
+ done: "done",
26
+ shipped: "done",
27
+ promoted: "done",
28
+ closed: "done",
29
+ blocked: "blocked",
30
+ "parked-with-evidence": "blocked",
31
+ };
32
+ export class SliceIndexer {
33
+ slicesRoot;
34
+ additionalSliceRoots;
35
+ dogfoodEvidenceRoot;
36
+ /** Workflows in Spec Library v0: exposed read-only so the slices
37
+ * route's `boundToWorkflow` lens filter can call
38
+ * `findSliceWorkflowBinding(db, qitemIds)` without re-injecting
39
+ * the db handle elsewhere. Internal callers continue to use it
40
+ * the same way; read-only consumer outside the class. */
41
+ db;
42
+ cacheTtlMs;
43
+ listingCache = null;
44
+ detailCache = new Map();
45
+ constructor(opts) {
46
+ this.slicesRoot = opts.slicesRoot;
47
+ this.additionalSliceRoots = opts.additionalSliceRoots ?? [];
48
+ this.dogfoodEvidenceRoot = opts.dogfoodEvidenceRoot;
49
+ this.db = opts.db;
50
+ this.cacheTtlMs = opts.cacheTtlMs ?? DEFAULT_CACHE_TTL_MS;
51
+ }
52
+ /** Returns true when any configured slice root exists on disk. */
53
+ isReady() {
54
+ return this.sliceRoots().some((root) => this.isDirectory(root));
55
+ }
56
+ /** Drops both caches. Used by tests + by a future explicit-refresh route. */
57
+ invalidate() {
58
+ this.listingCache = null;
59
+ this.detailCache.clear();
60
+ }
61
+ list() {
62
+ if (!this.isReady())
63
+ return [];
64
+ const now = Date.now();
65
+ if (this.listingCache && this.listingCache.expiresAt > now) {
66
+ return this.listingCache.entries;
67
+ }
68
+ const locations = this.readSliceLocations();
69
+ const entries = locations.map((location) => this.toListEntry(location));
70
+ this.listingCache = { entries, expiresAt: now + this.cacheTtlMs };
71
+ return entries;
72
+ }
73
+ get(name) {
74
+ if (!this.isReady())
75
+ return null;
76
+ const now = Date.now();
77
+ const cached = this.detailCache.get(name);
78
+ if (cached && cached.expiresAt > now) {
79
+ return cached.record;
80
+ }
81
+ const location = this.findSliceLocation(name);
82
+ if (!location)
83
+ return null;
84
+ const record = this.buildRecord(location);
85
+ this.detailCache.set(name, { record, expiresAt: now + this.cacheTtlMs });
86
+ return record;
87
+ }
88
+ // --- internals ---
89
+ readSliceLocations() {
90
+ const locations = [];
91
+ const seen = new Set();
92
+ const addLocation = (location) => {
93
+ if (seen.has(location.name))
94
+ return;
95
+ seen.add(location.name);
96
+ locations.push(location);
97
+ };
98
+ for (const root of this.sliceRoots()) {
99
+ let entries;
100
+ try {
101
+ entries = fs.readdirSync(root, { withFileTypes: true });
102
+ }
103
+ catch {
104
+ continue;
105
+ }
106
+ for (const entry of entries) {
107
+ if (!entry.isDirectory() || entry.name.startsWith("."))
108
+ continue;
109
+ const entryPath = path.join(root, entry.name);
110
+ const nestedSlicesRoot = path.join(entryPath, "slices");
111
+ if (this.isDirectory(nestedSlicesRoot)) {
112
+ let nestedEntries;
113
+ try {
114
+ nestedEntries = fs.readdirSync(nestedSlicesRoot, { withFileTypes: true });
115
+ }
116
+ catch {
117
+ nestedEntries = [];
118
+ }
119
+ for (const nested of nestedEntries) {
120
+ if (!nested.isDirectory() || nested.name.startsWith("."))
121
+ continue;
122
+ addLocation({
123
+ name: nested.name,
124
+ missionId: entry.name,
125
+ slicePath: path.join(nestedSlicesRoot, nested.name),
126
+ });
127
+ }
128
+ continue;
129
+ }
130
+ addLocation({
131
+ name: entry.name,
132
+ missionId: null,
133
+ slicePath: entryPath,
134
+ });
135
+ }
136
+ }
137
+ return locations.sort((a, b) => a.name.localeCompare(b.name));
138
+ }
139
+ findSliceLocation(name) {
140
+ return this.readSliceLocations().find((location) => location.name === name) ?? null;
141
+ }
142
+ isDirectory(absPath) {
143
+ try {
144
+ return fs.statSync(absPath).isDirectory();
145
+ }
146
+ catch {
147
+ return false;
148
+ }
149
+ }
150
+ sliceRoots() {
151
+ const roots = [this.slicesRoot, ...this.additionalSliceRoots].filter((root) => root.length > 0);
152
+ const seen = new Set();
153
+ const out = [];
154
+ for (const root of roots) {
155
+ const resolved = path.resolve(root);
156
+ if (seen.has(resolved))
157
+ continue;
158
+ seen.add(resolved);
159
+ out.push(root);
160
+ }
161
+ return out;
162
+ }
163
+ toListEntry(location) {
164
+ const { name, missionId, slicePath } = location;
165
+ const frontmatter = this.readPrimaryFrontmatter(slicePath);
166
+ const status = this.mapStatus(frontmatter["status"]);
167
+ const railItem = this.extractRailItem(frontmatter, missionId);
168
+ const qitemIds = this.matchQitems(name, railItem, missionId);
169
+ const proofPacket = this.findProofPacket(name);
170
+ const lastActivityAt = this.computeLastActivity(slicePath, qitemIds, proofPacket);
171
+ return {
172
+ name,
173
+ missionId,
174
+ displayName: this.extractDisplayName(slicePath, frontmatter, name),
175
+ railItem,
176
+ workflowSpec: parseWorkflowSpecRef(frontmatter["workflow_spec"]),
177
+ status,
178
+ rawStatus: frontmatter["status"] ?? null,
179
+ qitemCount: qitemIds.length,
180
+ hasProofPacket: proofPacket !== null,
181
+ lastActivityAt,
182
+ slicePath,
183
+ };
184
+ }
185
+ buildRecord(location) {
186
+ const { name, missionId, slicePath } = location;
187
+ const frontmatter = this.readPrimaryFrontmatter(slicePath);
188
+ const status = this.mapStatus(frontmatter["status"]);
189
+ const railItem = this.extractRailItem(frontmatter, missionId);
190
+ const qitemIds = this.matchQitems(name, railItem, missionId);
191
+ const proofPacket = this.findProofPacket(name);
192
+ const lastActivityAt = this.computeLastActivity(slicePath, qitemIds, proofPacket);
193
+ const commitRefs = this.extractCommitRefs(frontmatter);
194
+ const files = this.listSliceFiles(slicePath);
195
+ return {
196
+ name,
197
+ missionId,
198
+ slicePath,
199
+ displayName: this.extractDisplayName(slicePath, frontmatter, name),
200
+ railItem,
201
+ status,
202
+ rawStatus: frontmatter["status"] ?? null,
203
+ qitemIds,
204
+ commitRefs,
205
+ proofPacket,
206
+ lastActivityAt,
207
+ files,
208
+ workflowSpec: parseWorkflowSpecRef(frontmatter["workflow_spec"]),
209
+ };
210
+ }
211
+ readPrimaryFrontmatter(slicePath) {
212
+ // Merge canonical slice frontmatter in document-order, with PROGRESS.md
213
+ // last so the current lifecycle cursor overrides older dispatch metadata
214
+ // while README.md/IMPLEMENTATION-PRD.md still supply slice title, rail item,
215
+ // and source refs when PROGRESS.md is sparse.
216
+ const candidates = ["IMPLEMENTATION-PRD.md", "README.md", "PROGRESS.md"];
217
+ const merged = {};
218
+ for (const candidate of candidates) {
219
+ const fullPath = path.join(slicePath, candidate);
220
+ if (!fs.existsSync(fullPath))
221
+ continue;
222
+ const fm = parseFrontmatter(fs.readFileSync(fullPath, "utf8"));
223
+ if (Object.keys(fm).length > 0) {
224
+ Object.assign(merged, fm);
225
+ }
226
+ }
227
+ if (Object.keys(merged).length > 0)
228
+ return merged;
229
+ // Some slices only have a planner-brief at this point.
230
+ // Best-effort: any planner-brief shape.
231
+ try {
232
+ const entries = fs.readdirSync(slicePath, { withFileTypes: true });
233
+ for (const e of entries) {
234
+ if (!e.isFile() || !e.name.endsWith(".md"))
235
+ continue;
236
+ const fm = parseFrontmatter(fs.readFileSync(path.join(slicePath, e.name), "utf8"));
237
+ if (Object.keys(fm).length > 0)
238
+ return fm;
239
+ }
240
+ }
241
+ catch {
242
+ // Slice folder unreadable — return empty.
243
+ }
244
+ return {};
245
+ }
246
+ extractDisplayName(slicePath, frontmatter, fallback) {
247
+ if (typeof frontmatter["title"] === "string")
248
+ return frontmatter["title"];
249
+ if (typeof frontmatter["slice"] === "string")
250
+ return frontmatter["slice"];
251
+ // Pull the first H1 from the primary doc.
252
+ for (const candidate of ["README.md", "IMPLEMENTATION-PRD.md", "PROGRESS.md"]) {
253
+ const fullPath = path.join(slicePath, candidate);
254
+ if (!fs.existsSync(fullPath))
255
+ continue;
256
+ const content = fs.readFileSync(fullPath, "utf8");
257
+ const m = content.match(/^# (.+?)$/m);
258
+ if (m && m[1])
259
+ return m[1].trim();
260
+ }
261
+ return fallback;
262
+ }
263
+ extractRailItem(frontmatter, missionId) {
264
+ const raw = frontmatter["rail-item"];
265
+ if (typeof raw === "string") {
266
+ // Strip array brackets if YAML parser dropped them as a string ("[PL-008]").
267
+ const stripped = raw.replace(/^\[|\]$/g, "").trim();
268
+ if (stripped.length > 0)
269
+ return stripped.split(",")[0].trim();
270
+ }
271
+ if (Array.isArray(raw) && raw.length > 0 && typeof raw[0] === "string")
272
+ return raw[0];
273
+ const related = frontmatter["related-rail-items"];
274
+ if (typeof related === "string") {
275
+ const stripped = related.replace(/^\[|\]$/g, "").trim();
276
+ if (stripped.length > 0)
277
+ return stripped.split(",")[0].trim();
278
+ }
279
+ if (Array.isArray(related) && related.length > 0 && typeof related[0] === "string")
280
+ return related[0];
281
+ return missionId;
282
+ }
283
+ extractCommitRefs(frontmatter) {
284
+ const refs = [];
285
+ for (const [key, value] of Object.entries(frontmatter)) {
286
+ if (typeof value !== "string")
287
+ continue;
288
+ // Match keys like phase-a-shipped-commits / target-commit / phase-a-base-commit.
289
+ if (!/commits?$/.test(key))
290
+ continue;
291
+ // Comma- or whitespace-separated 7+ char hex tokens are the heuristic.
292
+ const tokens = value.split(/[\s,]+/).filter((t) => /^[0-9a-f]{7,40}$/i.test(t));
293
+ refs.push(...tokens);
294
+ }
295
+ // Dedup while preserving order.
296
+ return Array.from(new Set(refs));
297
+ }
298
+ mapStatus(raw) {
299
+ if (!raw)
300
+ return "draft";
301
+ const normalized = raw.toLowerCase().trim();
302
+ if (STATUS_TO_BUCKET[normalized])
303
+ return STATUS_TO_BUCKET[normalized];
304
+ // Heuristic fallbacks.
305
+ if (normalized.includes("done") || normalized.includes("ship") || normalized.includes("close"))
306
+ return "done";
307
+ if (normalized.includes("block") || normalized.includes("park"))
308
+ return "blocked";
309
+ if (normalized.includes("draft") || normalized.includes("pending"))
310
+ return "draft";
311
+ return "active";
312
+ }
313
+ matchQitems(sliceName, railItem, missionId) {
314
+ // V0.3.1 slice 17 founder-walk-workspace-state-correctness (walk item 3): the previous implementation unioned substring matches on
315
+ // [sliceName, railItem, missionId]. The missionId term over-matched
316
+ // — every qitem tagged `mission:<id>` appeared under EVERY slice in
317
+ // that mission. Fix: when typed `slice:<name>` tag rows exist for
318
+ // this slice, the missionId substring term is dropped from the
319
+ // union; the typed tag is the authoritative slice membership signal.
320
+ // Substring fallback (including the missionId term) is preserved for
321
+ // slices whose qitem corpus pre-dates the typed-tag convention so
322
+ // legacy mission-aware workspaces don't regress.
323
+ const ids = new Set();
324
+ try {
325
+ // 1. Typed-tag matches: tags JSON contains `slice:<sliceName>` literal.
326
+ // Both the `"slice:..."` JSON-array form and the comma-separated
327
+ // form (legacy CLI tags) are caught by a wildcard on the slice id.
328
+ let typedTagMatchCount = 0;
329
+ try {
330
+ const rows = this.db.prepare(`SELECT qitem_id FROM queue_items WHERE tags LIKE ? LIMIT 500`).all(`%slice:${sliceName}%`);
331
+ for (const r of rows)
332
+ ids.add(r.qitem_id);
333
+ typedTagMatchCount = rows.length;
334
+ }
335
+ catch {
336
+ // queue_items present but `tags` column missing (older test
337
+ // harness): fall through to substring path with full term set.
338
+ }
339
+ // 2. Substring matches. Terms are chosen so the missionId term
340
+ // is INCLUDED only when no typed-tag rows exist (legacy
341
+ // compatibility); otherwise the slice-specific terms drive
342
+ // matching. In mission-folder workspaces, railItem defaults to
343
+ // missionId when no explicit rail item is authored, so the typed-tag
344
+ // branch must not blindly keep that fallback or mission-only qitems
345
+ // leak back into every slice in the mission.
346
+ const substringTerms = (typedTagMatchCount > 0
347
+ ? [sliceName, railItem === missionId ? null : railItem]
348
+ : [sliceName, railItem, missionId]).filter((v) => !!v);
349
+ for (const term of Array.from(new Set(substringTerms))) {
350
+ try {
351
+ const rows = this.db.prepare(`SELECT qitem_id FROM queue_items WHERE body LIKE ? OR tags LIKE ? LIMIT 500`).all(`%${term}%`, `%${term}%`);
352
+ for (const r of rows)
353
+ ids.add(r.qitem_id);
354
+ }
355
+ catch {
356
+ const rows = this.db.prepare(`SELECT qitem_id FROM queue_items WHERE body LIKE ? LIMIT 500`).all(`%${term}%`);
357
+ for (const r of rows)
358
+ ids.add(r.qitem_id);
359
+ }
360
+ }
361
+ }
362
+ catch {
363
+ // queue_items table absent (test harness without the migration); return empty.
364
+ return [];
365
+ }
366
+ // V0.3.1 slice 17 walk item 10 — forward-fix #1. Sort qitemIds DESC
367
+ // by ts_created so the slice-detail Queue tab renders newest first
368
+ // (HG-5). The ScopePages.ScopeQueueRollup frontend sort still runs
369
+ // as a belt-and-suspenders measure for code paths that bypass this
370
+ // helper, but the backend is the authoritative consistency point.
371
+ // Fallback to qitem-id lex DESC when ts_created is unavailable (the
372
+ // id encodes the timestamp prefix `qitem-YYYYMMDDHHMMSS-...`).
373
+ const idsArr = Array.from(ids);
374
+ if (idsArr.length <= 1)
375
+ return idsArr;
376
+ try {
377
+ const placeholders = idsArr.map(() => "?").join(",");
378
+ const tsRows = this.db.prepare(`SELECT qitem_id, ts_created FROM queue_items WHERE qitem_id IN (${placeholders})`).all(...idsArr);
379
+ const tsByQitemId = new Map();
380
+ for (const r of tsRows)
381
+ if (r.ts_created)
382
+ tsByQitemId.set(r.qitem_id, r.ts_created);
383
+ idsArr.sort((a, b) => {
384
+ const tsA = tsByQitemId.get(a) ?? a;
385
+ const tsB = tsByQitemId.get(b) ?? b;
386
+ if (tsA === tsB)
387
+ return 0;
388
+ return tsA < tsB ? 1 : -1; // DESC
389
+ });
390
+ }
391
+ catch {
392
+ // Sort failure (e.g. ts_created column absent): fall back to
393
+ // qitem-id lex DESC. id format encodes the timestamp so this
394
+ // still yields newest-first in practice.
395
+ idsArr.sort((a, b) => (a < b ? 1 : a > b ? -1 : 0));
396
+ }
397
+ return idsArr;
398
+ }
399
+ findProofPacket(sliceName) {
400
+ if (!this.dogfoodEvidenceRoot)
401
+ return null;
402
+ let entries;
403
+ try {
404
+ entries = fs.readdirSync(this.dogfoodEvidenceRoot, { withFileTypes: true });
405
+ }
406
+ catch {
407
+ return null;
408
+ }
409
+ // Match strategy: token-based. Tokenize slice name on `-`, drop
410
+ // trailing `vN` version tokens (real proof dirs typically don't
411
+ // include the version suffix), then a dir matches if every remaining
412
+ // token appears as a hyphen-bounded substring of the dir name. This
413
+ // handles real-world dir-naming where phase indicators land at the
414
+ // front (e.g. `pl005-phase-a-mission-control-queue-observability-...`)
415
+ // even though the slice folder uses suffix form
416
+ // (`mission-control-queue-observability-phase-a`). Latest mtime wins.
417
+ const sliceTokens = sliceName.split("-").filter((t) => t.length > 0 && !/^v\d+$/.test(t));
418
+ const matches = [];
419
+ for (const dirent of entries) {
420
+ if (!dirent.isDirectory())
421
+ continue;
422
+ const dirTokenSet = new Set(dirent.name.split(/[-._]/).filter((t) => t.length > 0));
423
+ const allTokensPresent = sliceTokens.every((t) => dirTokenSet.has(t));
424
+ if (!allTokensPresent)
425
+ continue;
426
+ try {
427
+ const st = fs.statSync(path.join(this.dogfoodEvidenceRoot, dirent.name));
428
+ matches.push({ dirent, mtime: st.mtimeMs });
429
+ }
430
+ catch {
431
+ // skip
432
+ }
433
+ }
434
+ if (matches.length === 0)
435
+ return null;
436
+ matches.sort((a, b) => b.mtime - a.mtime);
437
+ const winner = matches[0];
438
+ const absPath = path.join(this.dogfoodEvidenceRoot, winner.dirent.name);
439
+ return this.scanProofPacket(absPath, winner.dirent.name, winner.mtime);
440
+ }
441
+ scanProofPacket(absPath, dirName, mtimeMs) {
442
+ const markdownFiles = [];
443
+ const screenshots = [];
444
+ const videos = [];
445
+ const traces = [];
446
+ const walk = (dir, relPrefix) => {
447
+ let entries;
448
+ try {
449
+ entries = fs.readdirSync(dir, { withFileTypes: true });
450
+ }
451
+ catch {
452
+ return;
453
+ }
454
+ for (const entry of entries) {
455
+ const rel = relPrefix ? `${relPrefix}/${entry.name}` : entry.name;
456
+ const full = path.join(dir, entry.name);
457
+ if (entry.isDirectory()) {
458
+ walk(full, rel);
459
+ continue;
460
+ }
461
+ if (!entry.isFile())
462
+ continue;
463
+ const lower = entry.name.toLowerCase();
464
+ if (lower.endsWith(".md")) {
465
+ try {
466
+ const st = fs.statSync(full);
467
+ markdownFiles.push({ rel, mtime: st.mtimeMs });
468
+ }
469
+ catch {
470
+ markdownFiles.push({ rel, mtime: 0 });
471
+ }
472
+ }
473
+ else if (lower.endsWith(".png") || lower.endsWith(".jpg") || lower.endsWith(".jpeg") || lower.endsWith(".gif") || lower.endsWith(".webp")) {
474
+ screenshots.push(rel);
475
+ }
476
+ else if (lower.endsWith(".mp4") || lower.endsWith(".webm") || lower.endsWith(".mov")) {
477
+ videos.push(rel);
478
+ }
479
+ else if (lower.endsWith(".zip") && rel.includes("trace")) {
480
+ traces.push(rel);
481
+ }
482
+ }
483
+ };
484
+ walk(absPath, "");
485
+ markdownFiles.sort((a, b) => b.mtime - a.mtime);
486
+ return {
487
+ dirName,
488
+ absPath,
489
+ markdownFiles: markdownFiles.map((m) => m.rel),
490
+ screenshots: screenshots.sort(),
491
+ videos: videos.sort(),
492
+ traces: traces.sort(),
493
+ mtime: new Date(mtimeMs).toISOString(),
494
+ };
495
+ }
496
+ computeLastActivity(slicePath, qitemIds, proofPacket) {
497
+ let maxMs = 0;
498
+ try {
499
+ const st = fs.statSync(slicePath);
500
+ maxMs = Math.max(maxMs, st.mtimeMs);
501
+ }
502
+ catch {
503
+ // ignore
504
+ }
505
+ if (qitemIds.length > 0) {
506
+ try {
507
+ const placeholders = qitemIds.map(() => "?").join(",");
508
+ const row = this.db.prepare(`SELECT MAX(ts_updated) AS mx FROM queue_items WHERE qitem_id IN (${placeholders})`).get(...qitemIds);
509
+ if (row?.mx) {
510
+ const ms = Date.parse(row.mx);
511
+ if (!Number.isNaN(ms))
512
+ maxMs = Math.max(maxMs, ms);
513
+ }
514
+ }
515
+ catch {
516
+ // ignore (queue_items absent)
517
+ }
518
+ }
519
+ if (proofPacket) {
520
+ const ms = Date.parse(proofPacket.mtime);
521
+ if (!Number.isNaN(ms))
522
+ maxMs = Math.max(maxMs, ms);
523
+ }
524
+ return maxMs > 0 ? new Date(maxMs).toISOString() : null;
525
+ }
526
+ listSliceFiles(slicePath) {
527
+ try {
528
+ return fs.readdirSync(slicePath, { withFileTypes: true })
529
+ .filter((e) => e.isFile())
530
+ .map((e) => e.name)
531
+ .sort();
532
+ }
533
+ catch {
534
+ return [];
535
+ }
536
+ }
537
+ }
538
+ // --- frontmatter parser (intentionally minimal; YAML lite) ---
539
+ export function parseFrontmatter(content) {
540
+ if (!content.startsWith(FRONTMATTER_DELIM))
541
+ return {};
542
+ const rest = content.slice(FRONTMATTER_DELIM.length);
543
+ const endIdx = rest.indexOf(`\n${FRONTMATTER_DELIM}`);
544
+ if (endIdx === -1)
545
+ return {};
546
+ const body = rest.slice(0, endIdx);
547
+ const out = {};
548
+ for (const line of body.split("\n")) {
549
+ const trimmed = line.trim();
550
+ if (!trimmed || trimmed.startsWith("#"))
551
+ continue;
552
+ const colonIdx = trimmed.indexOf(":");
553
+ if (colonIdx === -1)
554
+ continue;
555
+ const key = trimmed.slice(0, colonIdx).trim();
556
+ let value = trimmed.slice(colonIdx + 1).trim();
557
+ // Strip wrapping quotes.
558
+ if ((value.startsWith('"') && value.endsWith('"')) || (value.startsWith("'") && value.endsWith("'"))) {
559
+ value = value.slice(1, -1);
560
+ }
561
+ out[key] = value;
562
+ }
563
+ return out;
564
+ }
565
+ /** V0.3.1 slice 13 walk-item 7 — parse `workflow_spec: <name>@<version>`
566
+ * frontmatter into a structured ref. Returns null when the value is
567
+ * missing, non-string, or doesn't match the `<name>@<version>` shape.
568
+ * Exported so the missions route can reuse the same parser on the
569
+ * mission README's frontmatter. */
570
+ export function parseWorkflowSpecRef(raw) {
571
+ if (typeof raw !== "string")
572
+ return null;
573
+ const trimmed = raw.trim();
574
+ if (!trimmed)
575
+ return null;
576
+ const atIdx = trimmed.lastIndexOf("@");
577
+ if (atIdx <= 0 || atIdx === trimmed.length - 1)
578
+ return null;
579
+ const name = trimmed.slice(0, atIdx).trim();
580
+ const version = trimmed.slice(atIdx + 1).trim();
581
+ if (!name || !version)
582
+ return null;
583
+ return { name, version };
584
+ }
585
+ //# sourceMappingURL=slice-indexer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slice-indexer.js","sourceRoot":"","sources":["../../../src/domain/slices/slice-indexer.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,uEAAuE;AACvE,+DAA+D;AAC/D,yDAAyD;AACzD,kEAAkE;AAClE,gEAAgE;AAChE,gCAAgC;AAChC,EAAE;AACF,uEAAuE;AACvE,yEAAyE;AACzE,yEAAyE;AAEzE,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAqHlC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAChC,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAEpC,MAAM,gBAAgB,GAAgC;IACpD,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,QAAQ;IACrB,QAAQ,EAAE,QAAQ;IAClB,iCAAiC,EAAE,OAAO;IAC1C,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,MAAM;IAChB,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,SAAS;IAClB,sBAAsB,EAAE,SAAS;CAClC,CAAC;AAEF,MAAM,OAAO,YAAY;IACd,UAAU,CAAS;IACnB,oBAAoB,CAAW;IAC/B,mBAAmB,CAAgB;IAC5C;;;;8DAI0D;IACjD,EAAE,CAAoB;IACd,UAAU,CAAS;IAC5B,YAAY,GAAyB,IAAI,CAAC;IAC1C,WAAW,GAA6B,IAAI,GAAG,EAAE,CAAC;IAE1D,YAAY,IAAsB;QAChC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,oBAA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