raptor-aios 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (719) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/LICENSE +21 -0
  3. package/README.md +315 -0
  4. package/bin/raptor.js +5 -0
  5. package/dist/_core/dist/agents/adapters/antigravity.d.ts +9 -0
  6. package/dist/_core/dist/agents/adapters/antigravity.d.ts.map +1 -0
  7. package/dist/_core/dist/agents/adapters/antigravity.js +72 -0
  8. package/dist/_core/dist/agents/adapters/antigravity.js.map +1 -0
  9. package/dist/_core/dist/agents/adapters/claude-code.d.ts +9 -0
  10. package/dist/_core/dist/agents/adapters/claude-code.d.ts.map +1 -0
  11. package/dist/_core/dist/agents/adapters/claude-code.js +71 -0
  12. package/dist/_core/dist/agents/adapters/claude-code.js.map +1 -0
  13. package/dist/_core/dist/agents/adapters/codex.d.ts +12 -0
  14. package/dist/_core/dist/agents/adapters/codex.d.ts.map +1 -0
  15. package/dist/_core/dist/agents/adapters/codex.js +69 -0
  16. package/dist/_core/dist/agents/adapters/codex.js.map +1 -0
  17. package/dist/_core/dist/agents/adapters/copilot.d.ts +12 -0
  18. package/dist/_core/dist/agents/adapters/copilot.d.ts.map +1 -0
  19. package/dist/_core/dist/agents/adapters/copilot.js +71 -0
  20. package/dist/_core/dist/agents/adapters/copilot.js.map +1 -0
  21. package/dist/_core/dist/agents/adapters/cursor.d.ts +9 -0
  22. package/dist/_core/dist/agents/adapters/cursor.d.ts.map +1 -0
  23. package/dist/_core/dist/agents/adapters/cursor.js +62 -0
  24. package/dist/_core/dist/agents/adapters/cursor.js.map +1 -0
  25. package/dist/_core/dist/agents/adapters/gemini.d.ts +11 -0
  26. package/dist/_core/dist/agents/adapters/gemini.d.ts.map +1 -0
  27. package/dist/_core/dist/agents/adapters/gemini.js +68 -0
  28. package/dist/_core/dist/agents/adapters/gemini.js.map +1 -0
  29. package/dist/_core/dist/agents/adapters/human.d.ts +10 -0
  30. package/dist/_core/dist/agents/adapters/human.d.ts.map +1 -0
  31. package/dist/_core/dist/agents/adapters/human.js +48 -0
  32. package/dist/_core/dist/agents/adapters/human.js.map +1 -0
  33. package/dist/_core/dist/agents/artifact-watcher.d.ts +86 -0
  34. package/dist/_core/dist/agents/artifact-watcher.d.ts.map +1 -0
  35. package/dist/_core/dist/agents/artifact-watcher.js +214 -0
  36. package/dist/_core/dist/agents/artifact-watcher.js.map +1 -0
  37. package/dist/_core/dist/agents/backup.d.ts +69 -0
  38. package/dist/_core/dist/agents/backup.d.ts.map +1 -0
  39. package/dist/_core/dist/agents/backup.js +107 -0
  40. package/dist/_core/dist/agents/backup.js.map +1 -0
  41. package/dist/_core/dist/agents/config.d.ts +36 -0
  42. package/dist/_core/dist/agents/config.d.ts.map +1 -0
  43. package/dist/_core/dist/agents/config.js +270 -0
  44. package/dist/_core/dist/agents/config.js.map +1 -0
  45. package/dist/_core/dist/agents/context-file.d.ts +35 -0
  46. package/dist/_core/dist/agents/context-file.d.ts.map +1 -0
  47. package/dist/_core/dist/agents/context-file.js +106 -0
  48. package/dist/_core/dist/agents/context-file.js.map +1 -0
  49. package/dist/_core/dist/agents/handoff.d.ts +57 -0
  50. package/dist/_core/dist/agents/handoff.d.ts.map +1 -0
  51. package/dist/_core/dist/agents/handoff.js +71 -0
  52. package/dist/_core/dist/agents/handoff.js.map +1 -0
  53. package/dist/_core/dist/agents/index.d.ts +32 -0
  54. package/dist/_core/dist/agents/index.d.ts.map +1 -0
  55. package/dist/_core/dist/agents/index.js +37 -0
  56. package/dist/_core/dist/agents/index.js.map +1 -0
  57. package/dist/_core/dist/agents/keys.d.ts +50 -0
  58. package/dist/_core/dist/agents/keys.d.ts.map +1 -0
  59. package/dist/_core/dist/agents/keys.js +91 -0
  60. package/dist/_core/dist/agents/keys.js.map +1 -0
  61. package/dist/_core/dist/agents/materialize.d.ts +37 -0
  62. package/dist/_core/dist/agents/materialize.d.ts.map +1 -0
  63. package/dist/_core/dist/agents/materialize.js +157 -0
  64. package/dist/_core/dist/agents/materialize.js.map +1 -0
  65. package/dist/_core/dist/agents/prompt-builder.d.ts +35 -0
  66. package/dist/_core/dist/agents/prompt-builder.d.ts.map +1 -0
  67. package/dist/_core/dist/agents/prompt-builder.js +261 -0
  68. package/dist/_core/dist/agents/prompt-builder.js.map +1 -0
  69. package/dist/_core/dist/agents/prompt-markers.d.ts +69 -0
  70. package/dist/_core/dist/agents/prompt-markers.d.ts.map +1 -0
  71. package/dist/_core/dist/agents/prompt-markers.js +111 -0
  72. package/dist/_core/dist/agents/prompt-markers.js.map +1 -0
  73. package/dist/_core/dist/agents/registry.d.ts +35 -0
  74. package/dist/_core/dist/agents/registry.d.ts.map +1 -0
  75. package/dist/_core/dist/agents/registry.js +102 -0
  76. package/dist/_core/dist/agents/registry.js.map +1 -0
  77. package/dist/_core/dist/agents/selector.d.ts +33 -0
  78. package/dist/_core/dist/agents/selector.d.ts.map +1 -0
  79. package/dist/_core/dist/agents/selector.js +120 -0
  80. package/dist/_core/dist/agents/selector.js.map +1 -0
  81. package/dist/_core/dist/agents/slash-materializer.d.ts +63 -0
  82. package/dist/_core/dist/agents/slash-materializer.d.ts.map +1 -0
  83. package/dist/_core/dist/agents/slash-materializer.js +131 -0
  84. package/dist/_core/dist/agents/slash-materializer.js.map +1 -0
  85. package/dist/_core/dist/agents/types.d.ts +121 -0
  86. package/dist/_core/dist/agents/types.d.ts.map +1 -0
  87. package/dist/_core/dist/agents/types.js +10 -0
  88. package/dist/_core/dist/agents/types.js.map +1 -0
  89. package/dist/_core/dist/audit/hash.d.ts +4 -0
  90. package/dist/_core/dist/audit/hash.d.ts.map +1 -0
  91. package/dist/_core/dist/audit/hash.js +12 -0
  92. package/dist/_core/dist/audit/hash.js.map +1 -0
  93. package/dist/_core/dist/audit/index.d.ts +6 -0
  94. package/dist/_core/dist/audit/index.d.ts.map +1 -0
  95. package/dist/_core/dist/audit/index.js +6 -0
  96. package/dist/_core/dist/audit/index.js.map +1 -0
  97. package/dist/_core/dist/audit/logger.d.ts +77 -0
  98. package/dist/_core/dist/audit/logger.d.ts.map +1 -0
  99. package/dist/_core/dist/audit/logger.js +93 -0
  100. package/dist/_core/dist/audit/logger.js.map +1 -0
  101. package/dist/_core/dist/audit/query.d.ts +13 -0
  102. package/dist/_core/dist/audit/query.d.ts.map +1 -0
  103. package/dist/_core/dist/audit/query.js +57 -0
  104. package/dist/_core/dist/audit/query.js.map +1 -0
  105. package/dist/_core/dist/audit/schema.d.ts +455 -0
  106. package/dist/_core/dist/audit/schema.d.ts.map +1 -0
  107. package/dist/_core/dist/audit/schema.js +341 -0
  108. package/dist/_core/dist/audit/schema.js.map +1 -0
  109. package/dist/_core/dist/audit/validate.d.ts +21 -0
  110. package/dist/_core/dist/audit/validate.d.ts.map +1 -0
  111. package/dist/_core/dist/audit/validate.js +139 -0
  112. package/dist/_core/dist/audit/validate.js.map +1 -0
  113. package/dist/_core/dist/constitution/core.d.ts +22 -0
  114. package/dist/_core/dist/constitution/core.d.ts.map +1 -0
  115. package/dist/_core/dist/constitution/core.js +102 -0
  116. package/dist/_core/dist/constitution/core.js.map +1 -0
  117. package/dist/_core/dist/constitution/index.d.ts +2 -0
  118. package/dist/_core/dist/constitution/index.d.ts.map +1 -0
  119. package/dist/_core/dist/constitution/index.js +2 -0
  120. package/dist/_core/dist/constitution/index.js.map +1 -0
  121. package/dist/_core/dist/extensions/index.d.ts +12 -0
  122. package/dist/_core/dist/extensions/index.d.ts.map +1 -0
  123. package/dist/_core/dist/extensions/index.js +12 -0
  124. package/dist/_core/dist/extensions/index.js.map +1 -0
  125. package/dist/_core/dist/extensions/integrate.d.ts +69 -0
  126. package/dist/_core/dist/extensions/integrate.d.ts.map +1 -0
  127. package/dist/_core/dist/extensions/integrate.js +181 -0
  128. package/dist/_core/dist/extensions/integrate.js.map +1 -0
  129. package/dist/_core/dist/extensions/loader.d.ts +24 -0
  130. package/dist/_core/dist/extensions/loader.d.ts.map +1 -0
  131. package/dist/_core/dist/extensions/loader.js +73 -0
  132. package/dist/_core/dist/extensions/loader.js.map +1 -0
  133. package/dist/_core/dist/extensions/manifest.d.ts +23 -0
  134. package/dist/_core/dist/extensions/manifest.d.ts.map +1 -0
  135. package/dist/_core/dist/extensions/manifest.js +176 -0
  136. package/dist/_core/dist/extensions/manifest.js.map +1 -0
  137. package/dist/_core/dist/extensions/registry.d.ts +32 -0
  138. package/dist/_core/dist/extensions/registry.d.ts.map +1 -0
  139. package/dist/_core/dist/extensions/registry.js +57 -0
  140. package/dist/_core/dist/extensions/registry.js.map +1 -0
  141. package/dist/_core/dist/extensions/resolver.d.ts +55 -0
  142. package/dist/_core/dist/extensions/resolver.d.ts.map +1 -0
  143. package/dist/_core/dist/extensions/resolver.js +143 -0
  144. package/dist/_core/dist/extensions/resolver.js.map +1 -0
  145. package/dist/_core/dist/extensions/types.d.ts +173 -0
  146. package/dist/_core/dist/extensions/types.d.ts.map +1 -0
  147. package/dist/_core/dist/extensions/types.js +83 -0
  148. package/dist/_core/dist/extensions/types.js.map +1 -0
  149. package/dist/_core/dist/frontmatter/index.d.ts +10 -0
  150. package/dist/_core/dist/frontmatter/index.d.ts.map +1 -0
  151. package/dist/_core/dist/frontmatter/index.js +24 -0
  152. package/dist/_core/dist/frontmatter/index.js.map +1 -0
  153. package/dist/_core/dist/gates/agent-gates.d.ts +16 -0
  154. package/dist/_core/dist/gates/agent-gates.d.ts.map +1 -0
  155. package/dist/_core/dist/gates/agent-gates.js +205 -0
  156. package/dist/_core/dist/gates/agent-gates.js.map +1 -0
  157. package/dist/_core/dist/gates/builtin.d.ts +18 -0
  158. package/dist/_core/dist/gates/builtin.d.ts.map +1 -0
  159. package/dist/_core/dist/gates/builtin.js +860 -0
  160. package/dist/_core/dist/gates/builtin.js.map +1 -0
  161. package/dist/_core/dist/gates/index.d.ts +7 -0
  162. package/dist/_core/dist/gates/index.d.ts.map +1 -0
  163. package/dist/_core/dist/gates/index.js +7 -0
  164. package/dist/_core/dist/gates/index.js.map +1 -0
  165. package/dist/_core/dist/gates/m7-gates.d.ts +17 -0
  166. package/dist/_core/dist/gates/m7-gates.d.ts.map +1 -0
  167. package/dist/_core/dist/gates/m7-gates.js +309 -0
  168. package/dist/_core/dist/gates/m7-gates.js.map +1 -0
  169. package/dist/_core/dist/gates/phase-gates.d.ts +18 -0
  170. package/dist/_core/dist/gates/phase-gates.d.ts.map +1 -0
  171. package/dist/_core/dist/gates/phase-gates.js +275 -0
  172. package/dist/_core/dist/gates/phase-gates.js.map +1 -0
  173. package/dist/_core/dist/gates/runner.d.ts +4 -0
  174. package/dist/_core/dist/gates/runner.d.ts.map +1 -0
  175. package/dist/_core/dist/gates/runner.js +64 -0
  176. package/dist/_core/dist/gates/runner.js.map +1 -0
  177. package/dist/_core/dist/gates/types.d.ts +36 -0
  178. package/dist/_core/dist/gates/types.d.ts.map +1 -0
  179. package/dist/_core/dist/gates/types.js +2 -0
  180. package/dist/_core/dist/gates/types.js.map +1 -0
  181. package/dist/_core/dist/hooks/index.d.ts +4 -0
  182. package/dist/_core/dist/hooks/index.d.ts.map +1 -0
  183. package/dist/_core/dist/hooks/index.js +4 -0
  184. package/dist/_core/dist/hooks/index.js.map +1 -0
  185. package/dist/_core/dist/hooks/runner.d.ts +28 -0
  186. package/dist/_core/dist/hooks/runner.d.ts.map +1 -0
  187. package/dist/_core/dist/hooks/runner.js +294 -0
  188. package/dist/_core/dist/hooks/runner.js.map +1 -0
  189. package/dist/_core/dist/hooks/runtime.d.ts +65 -0
  190. package/dist/_core/dist/hooks/runtime.d.ts.map +1 -0
  191. package/dist/_core/dist/hooks/runtime.js +212 -0
  192. package/dist/_core/dist/hooks/runtime.js.map +1 -0
  193. package/dist/_core/dist/hooks/types.d.ts +36 -0
  194. package/dist/_core/dist/hooks/types.d.ts.map +1 -0
  195. package/dist/_core/dist/hooks/types.js +23 -0
  196. package/dist/_core/dist/hooks/types.js.map +1 -0
  197. package/dist/_core/dist/index.d.ts +21 -0
  198. package/dist/_core/dist/index.d.ts.map +1 -0
  199. package/dist/_core/dist/index.js +20 -0
  200. package/dist/_core/dist/index.js.map +1 -0
  201. package/dist/_core/dist/manifest/index.d.ts +119 -0
  202. package/dist/_core/dist/manifest/index.d.ts.map +1 -0
  203. package/dist/_core/dist/manifest/index.js +125 -0
  204. package/dist/_core/dist/manifest/index.js.map +1 -0
  205. package/dist/_core/dist/markers/index.d.ts +47 -0
  206. package/dist/_core/dist/markers/index.d.ts.map +1 -0
  207. package/dist/_core/dist/markers/index.js +97 -0
  208. package/dist/_core/dist/markers/index.js.map +1 -0
  209. package/dist/_core/dist/mcp/config.d.ts +19 -0
  210. package/dist/_core/dist/mcp/config.d.ts.map +1 -0
  211. package/dist/_core/dist/mcp/config.js +114 -0
  212. package/dist/_core/dist/mcp/config.js.map +1 -0
  213. package/dist/_core/dist/mcp/index.d.ts +9 -0
  214. package/dist/_core/dist/mcp/index.d.ts.map +1 -0
  215. package/dist/_core/dist/mcp/index.js +8 -0
  216. package/dist/_core/dist/mcp/index.js.map +1 -0
  217. package/dist/_core/dist/mcp/materializer.d.ts +40 -0
  218. package/dist/_core/dist/mcp/materializer.d.ts.map +1 -0
  219. package/dist/_core/dist/mcp/materializer.js +161 -0
  220. package/dist/_core/dist/mcp/materializer.js.map +1 -0
  221. package/dist/_core/dist/mcp/targets.d.ts +37 -0
  222. package/dist/_core/dist/mcp/targets.d.ts.map +1 -0
  223. package/dist/_core/dist/mcp/targets.js +56 -0
  224. package/dist/_core/dist/mcp/targets.js.map +1 -0
  225. package/dist/_core/dist/mcp/types.d.ts +34 -0
  226. package/dist/_core/dist/mcp/types.d.ts.map +1 -0
  227. package/dist/_core/dist/mcp/types.js +8 -0
  228. package/dist/_core/dist/mcp/types.js.map +1 -0
  229. package/dist/_core/dist/models/analyze.d.ts +131 -0
  230. package/dist/_core/dist/models/analyze.d.ts.map +1 -0
  231. package/dist/_core/dist/models/analyze.js +301 -0
  232. package/dist/_core/dist/models/analyze.js.map +1 -0
  233. package/dist/_core/dist/models/checklist.d.ts +113 -0
  234. package/dist/_core/dist/models/checklist.d.ts.map +1 -0
  235. package/dist/_core/dist/models/checklist.js +159 -0
  236. package/dist/_core/dist/models/checklist.js.map +1 -0
  237. package/dist/_core/dist/models/clarify.d.ts +116 -0
  238. package/dist/_core/dist/models/clarify.d.ts.map +1 -0
  239. package/dist/_core/dist/models/clarify.js +166 -0
  240. package/dist/_core/dist/models/clarify.js.map +1 -0
  241. package/dist/_core/dist/models/impl-log.d.ts +64 -0
  242. package/dist/_core/dist/models/impl-log.d.ts.map +1 -0
  243. package/dist/_core/dist/models/impl-log.js +137 -0
  244. package/dist/_core/dist/models/impl-log.js.map +1 -0
  245. package/dist/_core/dist/models/index.d.ts +8 -0
  246. package/dist/_core/dist/models/index.d.ts.map +1 -0
  247. package/dist/_core/dist/models/index.js +8 -0
  248. package/dist/_core/dist/models/index.js.map +1 -0
  249. package/dist/_core/dist/models/plan.d.ts +24 -0
  250. package/dist/_core/dist/models/plan.d.ts.map +1 -0
  251. package/dist/_core/dist/models/plan.js +15 -0
  252. package/dist/_core/dist/models/plan.js.map +1 -0
  253. package/dist/_core/dist/models/spec.d.ts +23 -0
  254. package/dist/_core/dist/models/spec.d.ts.map +1 -0
  255. package/dist/_core/dist/models/spec.js +22 -0
  256. package/dist/_core/dist/models/spec.js.map +1 -0
  257. package/dist/_core/dist/models/tasks.d.ts +33 -0
  258. package/dist/_core/dist/models/tasks.d.ts.map +1 -0
  259. package/dist/_core/dist/models/tasks.js +78 -0
  260. package/dist/_core/dist/models/tasks.js.map +1 -0
  261. package/dist/_core/dist/presets/gates.d.ts +9 -0
  262. package/dist/_core/dist/presets/gates.d.ts.map +1 -0
  263. package/dist/_core/dist/presets/gates.js +173 -0
  264. package/dist/_core/dist/presets/gates.js.map +1 -0
  265. package/dist/_core/dist/presets/index.d.ts +10 -0
  266. package/dist/_core/dist/presets/index.d.ts.map +1 -0
  267. package/dist/_core/dist/presets/index.js +7 -0
  268. package/dist/_core/dist/presets/index.js.map +1 -0
  269. package/dist/_core/dist/presets/loader.d.ts +56 -0
  270. package/dist/_core/dist/presets/loader.d.ts.map +1 -0
  271. package/dist/_core/dist/presets/loader.js +216 -0
  272. package/dist/_core/dist/presets/loader.js.map +1 -0
  273. package/dist/_core/dist/presets/mobile-opinionated.d.ts +3 -0
  274. package/dist/_core/dist/presets/mobile-opinionated.d.ts.map +1 -0
  275. package/dist/_core/dist/presets/mobile-opinionated.js +78 -0
  276. package/dist/_core/dist/presets/mobile-opinionated.js.map +1 -0
  277. package/dist/_core/dist/presets/registry.d.ts +5 -0
  278. package/dist/_core/dist/presets/registry.d.ts.map +1 -0
  279. package/dist/_core/dist/presets/registry.js +14 -0
  280. package/dist/_core/dist/presets/registry.js.map +1 -0
  281. package/dist/_core/dist/presets/renderer.d.ts +5 -0
  282. package/dist/_core/dist/presets/renderer.d.ts.map +1 -0
  283. package/dist/_core/dist/presets/renderer.js +37 -0
  284. package/dist/_core/dist/presets/renderer.js.map +1 -0
  285. package/dist/_core/dist/presets/stacking.d.ts +29 -0
  286. package/dist/_core/dist/presets/stacking.d.ts.map +1 -0
  287. package/dist/_core/dist/presets/stacking.js +91 -0
  288. package/dist/_core/dist/presets/stacking.js.map +1 -0
  289. package/dist/_core/dist/presets/types.d.ts +22 -0
  290. package/dist/_core/dist/presets/types.d.ts.map +1 -0
  291. package/dist/_core/dist/presets/types.js +2 -0
  292. package/dist/_core/dist/presets/types.js.map +1 -0
  293. package/dist/_core/dist/prompts/audit-log.d.ts +73 -0
  294. package/dist/_core/dist/prompts/audit-log.d.ts.map +1 -0
  295. package/dist/_core/dist/prompts/audit-log.js +73 -0
  296. package/dist/_core/dist/prompts/audit-log.js.map +1 -0
  297. package/dist/_core/dist/prompts/index.d.ts +9 -0
  298. package/dist/_core/dist/prompts/index.d.ts.map +1 -0
  299. package/dist/_core/dist/prompts/index.js +7 -0
  300. package/dist/_core/dist/prompts/index.js.map +1 -0
  301. package/dist/_core/dist/prompts/renderer.d.ts +73 -0
  302. package/dist/_core/dist/prompts/renderer.d.ts.map +1 -0
  303. package/dist/_core/dist/prompts/renderer.js +179 -0
  304. package/dist/_core/dist/prompts/renderer.js.map +1 -0
  305. package/dist/_core/dist/prompts/resumption.d.ts +59 -0
  306. package/dist/_core/dist/prompts/resumption.d.ts.map +1 -0
  307. package/dist/_core/dist/prompts/resumption.js +149 -0
  308. package/dist/_core/dist/prompts/resumption.js.map +1 -0
  309. package/dist/_core/dist/skills/config.d.ts +27 -0
  310. package/dist/_core/dist/skills/config.d.ts.map +1 -0
  311. package/dist/_core/dist/skills/config.js +102 -0
  312. package/dist/_core/dist/skills/config.js.map +1 -0
  313. package/dist/_core/dist/skills/index.d.ts +9 -0
  314. package/dist/_core/dist/skills/index.d.ts.map +1 -0
  315. package/dist/_core/dist/skills/index.js +8 -0
  316. package/dist/_core/dist/skills/index.js.map +1 -0
  317. package/dist/_core/dist/skills/materializer.d.ts +45 -0
  318. package/dist/_core/dist/skills/materializer.d.ts.map +1 -0
  319. package/dist/_core/dist/skills/materializer.js +97 -0
  320. package/dist/_core/dist/skills/materializer.js.map +1 -0
  321. package/dist/_core/dist/skills/registry.d.ts +18 -0
  322. package/dist/_core/dist/skills/registry.d.ts.map +1 -0
  323. package/dist/_core/dist/skills/registry.js +36 -0
  324. package/dist/_core/dist/skills/registry.js.map +1 -0
  325. package/dist/_core/dist/skills/types.d.ts +39 -0
  326. package/dist/_core/dist/skills/types.d.ts.map +1 -0
  327. package/dist/_core/dist/skills/types.js +13 -0
  328. package/dist/_core/dist/skills/types.js.map +1 -0
  329. package/dist/_core/dist/state/feature.d.ts +58 -0
  330. package/dist/_core/dist/state/feature.d.ts.map +1 -0
  331. package/dist/_core/dist/state/feature.js +81 -0
  332. package/dist/_core/dist/state/feature.js.map +1 -0
  333. package/dist/_core/dist/state/index.d.ts +8 -0
  334. package/dist/_core/dist/state/index.d.ts.map +1 -0
  335. package/dist/_core/dist/state/index.js +6 -0
  336. package/dist/_core/dist/state/index.js.map +1 -0
  337. package/dist/_core/dist/state/init-options.d.ts +60 -0
  338. package/dist/_core/dist/state/init-options.d.ts.map +1 -0
  339. package/dist/_core/dist/state/init-options.js +74 -0
  340. package/dist/_core/dist/state/init-options.js.map +1 -0
  341. package/dist/_core/dist/template/engine.d.ts +7 -0
  342. package/dist/_core/dist/template/engine.d.ts.map +1 -0
  343. package/dist/_core/dist/template/engine.js +86 -0
  344. package/dist/_core/dist/template/engine.js.map +1 -0
  345. package/dist/_core/dist/template/helpers.d.ts +5 -0
  346. package/dist/_core/dist/template/helpers.d.ts.map +1 -0
  347. package/dist/_core/dist/template/helpers.js +59 -0
  348. package/dist/_core/dist/template/helpers.js.map +1 -0
  349. package/dist/_core/dist/template/index.d.ts +6 -0
  350. package/dist/_core/dist/template/index.d.ts.map +1 -0
  351. package/dist/_core/dist/template/index.js +6 -0
  352. package/dist/_core/dist/template/index.js.map +1 -0
  353. package/dist/_core/dist/template/loader.d.ts +36 -0
  354. package/dist/_core/dist/template/loader.d.ts.map +1 -0
  355. package/dist/_core/dist/template/loader.js +62 -0
  356. package/dist/_core/dist/template/loader.js.map +1 -0
  357. package/dist/_core/dist/template/parser.d.ts +3 -0
  358. package/dist/_core/dist/template/parser.d.ts.map +1 -0
  359. package/dist/_core/dist/template/parser.js +234 -0
  360. package/dist/_core/dist/template/parser.js.map +1 -0
  361. package/dist/_core/dist/template/types.d.ts +40 -0
  362. package/dist/_core/dist/template/types.d.ts.map +1 -0
  363. package/dist/_core/dist/template/types.js +14 -0
  364. package/dist/_core/dist/template/types.js.map +1 -0
  365. package/dist/_core/dist/verify/a11y.d.ts +36 -0
  366. package/dist/_core/dist/verify/a11y.d.ts.map +1 -0
  367. package/dist/_core/dist/verify/a11y.js +153 -0
  368. package/dist/_core/dist/verify/a11y.js.map +1 -0
  369. package/dist/_core/dist/verify/architecture.d.ts +37 -0
  370. package/dist/_core/dist/verify/architecture.d.ts.map +1 -0
  371. package/dist/_core/dist/verify/architecture.js +113 -0
  372. package/dist/_core/dist/verify/architecture.js.map +1 -0
  373. package/dist/_core/dist/verify/index.d.ts +10 -0
  374. package/dist/_core/dist/verify/index.d.ts.map +1 -0
  375. package/dist/_core/dist/verify/index.js +10 -0
  376. package/dist/_core/dist/verify/index.js.map +1 -0
  377. package/dist/_core/dist/verify/os-matrix.d.ts +35 -0
  378. package/dist/_core/dist/verify/os-matrix.d.ts.map +1 -0
  379. package/dist/_core/dist/verify/os-matrix.js +104 -0
  380. package/dist/_core/dist/verify/os-matrix.js.map +1 -0
  381. package/dist/_core/dist/verify/perf.d.ts +43 -0
  382. package/dist/_core/dist/verify/perf.d.ts.map +1 -0
  383. package/dist/_core/dist/verify/perf.js +69 -0
  384. package/dist/_core/dist/verify/perf.js.map +1 -0
  385. package/dist/_core/dist/verify/stores.d.ts +38 -0
  386. package/dist/_core/dist/verify/stores.d.ts.map +1 -0
  387. package/dist/_core/dist/verify/stores.js +57 -0
  388. package/dist/_core/dist/verify/stores.js.map +1 -0
  389. package/dist/_core/dist/version.d.ts +8 -0
  390. package/dist/_core/dist/version.d.ts.map +1 -0
  391. package/dist/_core/dist/version.js +11 -0
  392. package/dist/_core/dist/version.js.map +1 -0
  393. package/dist/_core/dist/workflows/bundled.d.ts +32 -0
  394. package/dist/_core/dist/workflows/bundled.d.ts.map +1 -0
  395. package/dist/_core/dist/workflows/bundled.js +254 -0
  396. package/dist/_core/dist/workflows/bundled.js.map +1 -0
  397. package/dist/_core/dist/workflows/engine.d.ts +74 -0
  398. package/dist/_core/dist/workflows/engine.d.ts.map +1 -0
  399. package/dist/_core/dist/workflows/engine.js +574 -0
  400. package/dist/_core/dist/workflows/engine.js.map +1 -0
  401. package/dist/_core/dist/workflows/expressions.d.ts +48 -0
  402. package/dist/_core/dist/workflows/expressions.d.ts.map +1 -0
  403. package/dist/_core/dist/workflows/expressions.js +336 -0
  404. package/dist/_core/dist/workflows/expressions.js.map +1 -0
  405. package/dist/_core/dist/workflows/index.d.ts +16 -0
  406. package/dist/_core/dist/workflows/index.d.ts.map +1 -0
  407. package/dist/_core/dist/workflows/index.js +15 -0
  408. package/dist/_core/dist/workflows/index.js.map +1 -0
  409. package/dist/_core/dist/workflows/parser.d.ts +38 -0
  410. package/dist/_core/dist/workflows/parser.d.ts.map +1 -0
  411. package/dist/_core/dist/workflows/parser.js +386 -0
  412. package/dist/_core/dist/workflows/parser.js.map +1 -0
  413. package/dist/_core/dist/workflows/sdd-flow.d.ts +85 -0
  414. package/dist/_core/dist/workflows/sdd-flow.d.ts.map +1 -0
  415. package/dist/_core/dist/workflows/sdd-flow.js +269 -0
  416. package/dist/_core/dist/workflows/sdd-flow.js.map +1 -0
  417. package/dist/_core/dist/workflows/types.d.ts +285 -0
  418. package/dist/_core/dist/workflows/types.d.ts.map +1 -0
  419. package/dist/_core/dist/workflows/types.js +13 -0
  420. package/dist/_core/dist/workflows/types.js.map +1 -0
  421. package/dist/_core/package.json +6 -0
  422. package/dist/_core/templates/constitution.md.hbs +46 -0
  423. package/dist/_core/templates/ghaWorkflow.yml.hbs +58 -0
  424. package/dist/_core/templates/hotfix.md.hbs +39 -0
  425. package/dist/_core/templates/plan.md.hbs +212 -0
  426. package/dist/_core/templates/preCommitHook.sh.hbs +30 -0
  427. package/dist/_core/templates/prePushHook.sh.hbs +45 -0
  428. package/dist/_core/templates/raptor.yml.hbs +24 -0
  429. package/dist/_core/templates/spec.md.hbs +127 -0
  430. package/dist/_core/templates/tasks.md.hbs +71 -0
  431. package/dist/commands/add-agent.d.ts +22 -0
  432. package/dist/commands/add-agent.d.ts.map +1 -0
  433. package/dist/commands/add-agent.js +121 -0
  434. package/dist/commands/add-agent.js.map +1 -0
  435. package/dist/commands/add-extension.d.ts +18 -0
  436. package/dist/commands/add-extension.d.ts.map +1 -0
  437. package/dist/commands/add-extension.js +83 -0
  438. package/dist/commands/add-extension.js.map +1 -0
  439. package/dist/commands/analyze.d.ts +18 -0
  440. package/dist/commands/analyze.d.ts.map +1 -0
  441. package/dist/commands/analyze.js +323 -0
  442. package/dist/commands/analyze.js.map +1 -0
  443. package/dist/commands/approve.d.ts +14 -0
  444. package/dist/commands/approve.d.ts.map +1 -0
  445. package/dist/commands/approve.js +116 -0
  446. package/dist/commands/approve.js.map +1 -0
  447. package/dist/commands/audit/query.d.ts +23 -0
  448. package/dist/commands/audit/query.d.ts.map +1 -0
  449. package/dist/commands/audit/query.js +118 -0
  450. package/dist/commands/audit/query.js.map +1 -0
  451. package/dist/commands/audit/show.d.ts +17 -0
  452. package/dist/commands/audit/show.d.ts.map +1 -0
  453. package/dist/commands/audit/show.js +53 -0
  454. package/dist/commands/audit/show.js.map +1 -0
  455. package/dist/commands/checklist.d.ts +17 -0
  456. package/dist/commands/checklist.d.ts.map +1 -0
  457. package/dist/commands/checklist.js +255 -0
  458. package/dist/commands/checklist.js.map +1 -0
  459. package/dist/commands/clarify.d.ts +17 -0
  460. package/dist/commands/clarify.d.ts.map +1 -0
  461. package/dist/commands/clarify.js +254 -0
  462. package/dist/commands/clarify.js.map +1 -0
  463. package/dist/commands/doctor.d.ts +8 -0
  464. package/dist/commands/doctor.d.ts.map +1 -0
  465. package/dist/commands/doctor.js +435 -0
  466. package/dist/commands/doctor.js.map +1 -0
  467. package/dist/commands/extension/add.d.ts +15 -0
  468. package/dist/commands/extension/add.d.ts.map +1 -0
  469. package/dist/commands/extension/add.js +93 -0
  470. package/dist/commands/extension/add.js.map +1 -0
  471. package/dist/commands/extension/info.d.ts +13 -0
  472. package/dist/commands/extension/info.d.ts.map +1 -0
  473. package/dist/commands/extension/info.js +75 -0
  474. package/dist/commands/extension/info.js.map +1 -0
  475. package/dist/commands/extension/list.d.ts +10 -0
  476. package/dist/commands/extension/list.d.ts.map +1 -0
  477. package/dist/commands/extension/list.js +71 -0
  478. package/dist/commands/extension/list.js.map +1 -0
  479. package/dist/commands/extension/remove.d.ts +14 -0
  480. package/dist/commands/extension/remove.d.ts.map +1 -0
  481. package/dist/commands/extension/remove.js +49 -0
  482. package/dist/commands/extension/remove.js.map +1 -0
  483. package/dist/commands/gate/approve.d.ts +15 -0
  484. package/dist/commands/gate/approve.d.ts.map +1 -0
  485. package/dist/commands/gate/approve.js +106 -0
  486. package/dist/commands/gate/approve.js.map +1 -0
  487. package/dist/commands/gate/list.d.ts +6 -0
  488. package/dist/commands/gate/list.d.ts.map +1 -0
  489. package/dist/commands/gate/list.js +38 -0
  490. package/dist/commands/gate/list.js.map +1 -0
  491. package/dist/commands/gate/skip.d.ts +14 -0
  492. package/dist/commands/gate/skip.d.ts.map +1 -0
  493. package/dist/commands/gate/skip.js +95 -0
  494. package/dist/commands/gate/skip.js.map +1 -0
  495. package/dist/commands/hook/list.d.ts +11 -0
  496. package/dist/commands/hook/list.d.ts.map +1 -0
  497. package/dist/commands/hook/list.js +152 -0
  498. package/dist/commands/hook/list.js.map +1 -0
  499. package/dist/commands/hook/run.d.ts +16 -0
  500. package/dist/commands/hook/run.d.ts.map +1 -0
  501. package/dist/commands/hook/run.js +74 -0
  502. package/dist/commands/hook/run.js.map +1 -0
  503. package/dist/commands/hotfix.d.ts +21 -0
  504. package/dist/commands/hotfix.d.ts.map +1 -0
  505. package/dist/commands/hotfix.js +216 -0
  506. package/dist/commands/hotfix.js.map +1 -0
  507. package/dist/commands/implement.d.ts +19 -0
  508. package/dist/commands/implement.d.ts.map +1 -0
  509. package/dist/commands/implement.js +282 -0
  510. package/dist/commands/implement.js.map +1 -0
  511. package/dist/commands/init.d.ts +43 -0
  512. package/dist/commands/init.d.ts.map +1 -0
  513. package/dist/commands/init.js +465 -0
  514. package/dist/commands/init.js.map +1 -0
  515. package/dist/commands/list-agents.d.ts +12 -0
  516. package/dist/commands/list-agents.d.ts.map +1 -0
  517. package/dist/commands/list-agents.js +55 -0
  518. package/dist/commands/list-agents.js.map +1 -0
  519. package/dist/commands/mcp/add.d.ts +21 -0
  520. package/dist/commands/mcp/add.d.ts.map +1 -0
  521. package/dist/commands/mcp/add.js +119 -0
  522. package/dist/commands/mcp/add.js.map +1 -0
  523. package/dist/commands/mcp/list.d.ts +10 -0
  524. package/dist/commands/mcp/list.d.ts.map +1 -0
  525. package/dist/commands/mcp/list.js +54 -0
  526. package/dist/commands/mcp/list.js.map +1 -0
  527. package/dist/commands/mcp/remove.d.ts +10 -0
  528. package/dist/commands/mcp/remove.d.ts.map +1 -0
  529. package/dist/commands/mcp/remove.js +53 -0
  530. package/dist/commands/mcp/remove.js.map +1 -0
  531. package/dist/commands/mcp/sync.d.ts +7 -0
  532. package/dist/commands/mcp/sync.d.ts.map +1 -0
  533. package/dist/commands/mcp/sync.js +31 -0
  534. package/dist/commands/mcp/sync.js.map +1 -0
  535. package/dist/commands/new.d.ts +19 -0
  536. package/dist/commands/new.d.ts.map +1 -0
  537. package/dist/commands/new.js +306 -0
  538. package/dist/commands/new.js.map +1 -0
  539. package/dist/commands/plan.d.ts +17 -0
  540. package/dist/commands/plan.d.ts.map +1 -0
  541. package/dist/commands/plan.js +200 -0
  542. package/dist/commands/plan.js.map +1 -0
  543. package/dist/commands/preset/add.d.ts +13 -0
  544. package/dist/commands/preset/add.d.ts.map +1 -0
  545. package/dist/commands/preset/add.js +66 -0
  546. package/dist/commands/preset/add.js.map +1 -0
  547. package/dist/commands/preset/info.d.ts +13 -0
  548. package/dist/commands/preset/info.d.ts.map +1 -0
  549. package/dist/commands/preset/info.js +80 -0
  550. package/dist/commands/preset/info.js.map +1 -0
  551. package/dist/commands/preset/list.d.ts +10 -0
  552. package/dist/commands/preset/list.d.ts.map +1 -0
  553. package/dist/commands/preset/list.js +63 -0
  554. package/dist/commands/preset/list.js.map +1 -0
  555. package/dist/commands/preset/remove.d.ts +14 -0
  556. package/dist/commands/preset/remove.d.ts.map +1 -0
  557. package/dist/commands/preset/remove.js +60 -0
  558. package/dist/commands/preset/remove.js.map +1 -0
  559. package/dist/commands/repair/constitution.d.ts +11 -0
  560. package/dist/commands/repair/constitution.d.ts.map +1 -0
  561. package/dist/commands/repair/constitution.js +117 -0
  562. package/dist/commands/repair/constitution.js.map +1 -0
  563. package/dist/commands/resync.d.ts +22 -0
  564. package/dist/commands/resync.d.ts.map +1 -0
  565. package/dist/commands/resync.js +103 -0
  566. package/dist/commands/resync.js.map +1 -0
  567. package/dist/commands/skill/add.d.ts +19 -0
  568. package/dist/commands/skill/add.d.ts.map +1 -0
  569. package/dist/commands/skill/add.js +107 -0
  570. package/dist/commands/skill/add.js.map +1 -0
  571. package/dist/commands/skill/list.d.ts +10 -0
  572. package/dist/commands/skill/list.d.ts.map +1 -0
  573. package/dist/commands/skill/list.js +56 -0
  574. package/dist/commands/skill/list.js.map +1 -0
  575. package/dist/commands/skill/remove.d.ts +10 -0
  576. package/dist/commands/skill/remove.d.ts.map +1 -0
  577. package/dist/commands/skill/remove.js +47 -0
  578. package/dist/commands/skill/remove.js.map +1 -0
  579. package/dist/commands/skill/sync.d.ts +7 -0
  580. package/dist/commands/skill/sync.d.ts.map +1 -0
  581. package/dist/commands/skill/sync.js +30 -0
  582. package/dist/commands/skill/sync.js.map +1 -0
  583. package/dist/commands/status.d.ts +17 -0
  584. package/dist/commands/status.d.ts.map +1 -0
  585. package/dist/commands/status.js +265 -0
  586. package/dist/commands/status.js.map +1 -0
  587. package/dist/commands/tasks.d.ts +16 -0
  588. package/dist/commands/tasks.d.ts.map +1 -0
  589. package/dist/commands/tasks.js +176 -0
  590. package/dist/commands/tasks.js.map +1 -0
  591. package/dist/commands/trace.d.ts +16 -0
  592. package/dist/commands/trace.d.ts.map +1 -0
  593. package/dist/commands/trace.js +113 -0
  594. package/dist/commands/trace.js.map +1 -0
  595. package/dist/commands/upgrade.d.ts +20 -0
  596. package/dist/commands/upgrade.d.ts.map +1 -0
  597. package/dist/commands/upgrade.js +178 -0
  598. package/dist/commands/upgrade.js.map +1 -0
  599. package/dist/commands/verify/a11y.d.ts +15 -0
  600. package/dist/commands/verify/a11y.d.ts.map +1 -0
  601. package/dist/commands/verify/a11y.js +121 -0
  602. package/dist/commands/verify/a11y.js.map +1 -0
  603. package/dist/commands/verify/architecture.d.ts +11 -0
  604. package/dist/commands/verify/architecture.d.ts.map +1 -0
  605. package/dist/commands/verify/architecture.js +71 -0
  606. package/dist/commands/verify/architecture.js.map +1 -0
  607. package/dist/commands/verify/audit.d.ts +18 -0
  608. package/dist/commands/verify/audit.d.ts.map +1 -0
  609. package/dist/commands/verify/audit.js +108 -0
  610. package/dist/commands/verify/audit.js.map +1 -0
  611. package/dist/commands/verify/constitution.d.ts +10 -0
  612. package/dist/commands/verify/constitution.d.ts.map +1 -0
  613. package/dist/commands/verify/constitution.js +91 -0
  614. package/dist/commands/verify/constitution.js.map +1 -0
  615. package/dist/commands/verify/os-matrix.d.ts +14 -0
  616. package/dist/commands/verify/os-matrix.d.ts.map +1 -0
  617. package/dist/commands/verify/os-matrix.js +108 -0
  618. package/dist/commands/verify/os-matrix.js.map +1 -0
  619. package/dist/commands/verify/perf.d.ts +17 -0
  620. package/dist/commands/verify/perf.d.ts.map +1 -0
  621. package/dist/commands/verify/perf.js +106 -0
  622. package/dist/commands/verify/perf.js.map +1 -0
  623. package/dist/commands/verify/stores.d.ts +14 -0
  624. package/dist/commands/verify/stores.d.ts.map +1 -0
  625. package/dist/commands/verify/stores.js +98 -0
  626. package/dist/commands/verify/stores.js.map +1 -0
  627. package/dist/commands/verify.d.ts +14 -0
  628. package/dist/commands/verify.d.ts.map +1 -0
  629. package/dist/commands/verify.js +97 -0
  630. package/dist/commands/verify.js.map +1 -0
  631. package/dist/commands/workflow/catalog.d.ts +11 -0
  632. package/dist/commands/workflow/catalog.d.ts.map +1 -0
  633. package/dist/commands/workflow/catalog.js +164 -0
  634. package/dist/commands/workflow/catalog.js.map +1 -0
  635. package/dist/commands/workflow/list.d.ts +7 -0
  636. package/dist/commands/workflow/list.d.ts.map +1 -0
  637. package/dist/commands/workflow/list.js +50 -0
  638. package/dist/commands/workflow/list.js.map +1 -0
  639. package/dist/commands/workflow/resume.d.ts +13 -0
  640. package/dist/commands/workflow/resume.d.ts.map +1 -0
  641. package/dist/commands/workflow/resume.js +126 -0
  642. package/dist/commands/workflow/resume.js.map +1 -0
  643. package/dist/commands/workflow/run.d.ts +14 -0
  644. package/dist/commands/workflow/run.d.ts.map +1 -0
  645. package/dist/commands/workflow/run.js +139 -0
  646. package/dist/commands/workflow/run.js.map +1 -0
  647. package/dist/commands/workflow/status.d.ts +10 -0
  648. package/dist/commands/workflow/status.d.ts.map +1 -0
  649. package/dist/commands/workflow/status.js +86 -0
  650. package/dist/commands/workflow/status.js.map +1 -0
  651. package/dist/index.d.ts +2 -0
  652. package/dist/index.d.ts.map +1 -0
  653. package/dist/index.js +2 -0
  654. package/dist/index.js.map +1 -0
  655. package/dist/shared/agents.d.ts +12 -0
  656. package/dist/shared/agents.d.ts.map +1 -0
  657. package/dist/shared/agents.js +31 -0
  658. package/dist/shared/agents.js.map +1 -0
  659. package/dist/shared/artifact-io.d.ts +54 -0
  660. package/dist/shared/artifact-io.d.ts.map +1 -0
  661. package/dist/shared/artifact-io.js +71 -0
  662. package/dist/shared/artifact-io.js.map +1 -0
  663. package/dist/shared/feature-prompt.d.ts +18 -0
  664. package/dist/shared/feature-prompt.d.ts.map +1 -0
  665. package/dist/shared/feature-prompt.js +21 -0
  666. package/dist/shared/feature-prompt.js.map +1 -0
  667. package/dist/shared/hooks.d.ts +7 -0
  668. package/dist/shared/hooks.d.ts.map +1 -0
  669. package/dist/shared/hooks.js +52 -0
  670. package/dist/shared/hooks.js.map +1 -0
  671. package/dist/shared/mcp.d.ts +9 -0
  672. package/dist/shared/mcp.d.ts.map +1 -0
  673. package/dist/shared/mcp.js +15 -0
  674. package/dist/shared/mcp.js.map +1 -0
  675. package/dist/shared/project.d.ts +42 -0
  676. package/dist/shared/project.d.ts.map +1 -0
  677. package/dist/shared/project.js +98 -0
  678. package/dist/shared/project.js.map +1 -0
  679. package/dist/shared/workflow-resolver.d.ts +19 -0
  680. package/dist/shared/workflow-resolver.d.ts.map +1 -0
  681. package/dist/shared/workflow-resolver.js +71 -0
  682. package/dist/shared/workflow-resolver.js.map +1 -0
  683. package/dist/workflow/args-builder.d.ts +31 -0
  684. package/dist/workflow/args-builder.d.ts.map +1 -0
  685. package/dist/workflow/args-builder.js +110 -0
  686. package/dist/workflow/args-builder.js.map +1 -0
  687. package/dist/workflow/executor.d.ts +18 -0
  688. package/dist/workflow/executor.d.ts.map +1 -0
  689. package/dist/workflow/executor.js +112 -0
  690. package/dist/workflow/executor.js.map +1 -0
  691. package/extensions/git/commands/rpt.git.feature.md +85 -0
  692. package/extensions/git/extension.yml +47 -0
  693. package/package.json +58 -0
  694. package/scripts/bash/check-prerequisites.sh +149 -0
  695. package/scripts/bash/common.sh +389 -0
  696. package/scripts/bash/create-new-feature.sh +164 -0
  697. package/scripts/bash/setup-plan.sh +113 -0
  698. package/scripts/check-naming.sh +138 -0
  699. package/scripts/check-prompts.sh +165 -0
  700. package/scripts/check-tasks.sh +166 -0
  701. package/scripts/powershell/check-prerequisites.ps1 +117 -0
  702. package/scripts/powershell/common.ps1 +328 -0
  703. package/scripts/powershell/create-new-feature.ps1 +138 -0
  704. package/scripts/powershell/setup-plan.ps1 +96 -0
  705. package/scripts/prepare-npm.mjs +157 -0
  706. package/templates/checklist-template.md +103 -0
  707. package/templates/commands/analyze.md +103 -0
  708. package/templates/commands/checklist.md +87 -0
  709. package/templates/commands/clarify.md +85 -0
  710. package/templates/commands/constitution.md +126 -0
  711. package/templates/commands/implement.md +117 -0
  712. package/templates/commands/plan.md +125 -0
  713. package/templates/commands/specify.md +127 -0
  714. package/templates/commands/tasks.md +98 -0
  715. package/templates/commands/taskstoissues.md +81 -0
  716. package/templates/constitution-template.md +48 -0
  717. package/templates/plan-template.md +150 -0
  718. package/templates/spec-template.md +116 -0
  719. package/templates/tasks-template.md +77 -0
@@ -0,0 +1,33 @@
1
+ export type TasksStatus = "draft" | "approved";
2
+ export interface TasksFrontmatter {
3
+ id: string;
4
+ slug: string;
5
+ plan_hash: string;
6
+ plan_ref: string;
7
+ created: string;
8
+ status: TasksStatus;
9
+ audit_ref: string | null;
10
+ }
11
+ export interface TasksFile {
12
+ path: string;
13
+ raw: string;
14
+ hash: string;
15
+ data: TasksFrontmatter;
16
+ body: string;
17
+ }
18
+ export interface TaskItem {
19
+ id: string;
20
+ /** First user story tag, kept for backward compatibility. Prefer `stories`. */
21
+ story?: string;
22
+ /** All user story tags on the task (a task may serve several, e.g. [US1] [US2]). */
23
+ stories: string[];
24
+ parallel: boolean;
25
+ description: string;
26
+ status: "pending" | "completed";
27
+ lineIndex: number;
28
+ raw: string;
29
+ }
30
+ export declare function parseTasks(path: string): TasksFile;
31
+ export declare function parseTaskList(body: string): TaskItem[];
32
+ export declare function markTaskCompleted(body: string, taskId: string): string;
33
+ //# sourceMappingURL=tasks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/models/tasks.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,SAAS,GAAG,WAAW,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAUlD;AAQD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,EAAE,CAkCtD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAmBtE"}
@@ -0,0 +1,78 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { parseFrontmatter } from "../frontmatter/index.js";
3
+ import { hashString } from "../audit/hash.js";
4
+ export function parseTasks(path) {
5
+ const raw = readFileSync(path, "utf8");
6
+ const { data, body } = parseFrontmatter(raw);
7
+ return {
8
+ path,
9
+ raw,
10
+ hash: hashString(raw),
11
+ data,
12
+ body,
13
+ };
14
+ }
15
+ const TASK_PATTERNS = [
16
+ { re: /^-\s*\[\s*\]\s*\**(T\d+)\**\s*[—-]?\s*(.*)$/, status: "pending" },
17
+ { re: /^-\s*\[[xX]\]\s*\**(T\d+)\**\s*[—-]?\s*(.*)$/, status: "completed" },
18
+ { re: /^-\s*\*\*(T\d+)\*\*\s*[—-]?\s*(.*)$/, status: "pending" },
19
+ ];
20
+ export function parseTaskList(body) {
21
+ const lines = body.split("\n");
22
+ const items = [];
23
+ for (let i = 0; i < lines.length; i++) {
24
+ const line = lines[i];
25
+ for (const { re, status } of TASK_PATTERNS) {
26
+ const m = line.match(re);
27
+ if (!m)
28
+ continue;
29
+ const id = m[1];
30
+ const rest = m[2] ?? "";
31
+ // Collect ALL [US#] tags — a task can legitimately serve several stories
32
+ // (e.g. "[US1] [US2]"). Previously only the first was captured, which made
33
+ // gate.tasks.coverage_complete report the others as uncovered.
34
+ const stories = [...rest.matchAll(/\[(US\d+)\]/gi)].map((mm) => mm[1]);
35
+ const story = stories[0];
36
+ const parallel = /\[P\]/i.test(rest);
37
+ const description = rest
38
+ .replace(/\[US\d+\]/gi, "")
39
+ .replace(/\[P\]/gi, "")
40
+ .trim();
41
+ items.push({
42
+ id,
43
+ ...(story ? { story } : {}),
44
+ stories,
45
+ parallel,
46
+ description,
47
+ status,
48
+ lineIndex: i,
49
+ raw: line,
50
+ });
51
+ break;
52
+ }
53
+ }
54
+ return items;
55
+ }
56
+ export function markTaskCompleted(body, taskId) {
57
+ const lines = body.split("\n");
58
+ let mutated = false;
59
+ for (let i = 0; i < lines.length; i++) {
60
+ const line = lines[i];
61
+ for (const { re } of TASK_PATTERNS) {
62
+ const m = line.match(re);
63
+ if (!m || m[1] !== taskId)
64
+ continue;
65
+ const rest = m[2] ?? "";
66
+ lines[i] = `- [X] **${taskId}** — ${rest}`.replace(/\s+$/, "");
67
+ mutated = true;
68
+ break;
69
+ }
70
+ if (mutated)
71
+ break;
72
+ }
73
+ if (!mutated) {
74
+ throw new Error(`task ${taskId} not found in tasks.md body`);
75
+ }
76
+ return lines.join("\n");
77
+ }
78
+ //# sourceMappingURL=tasks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/models/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAmC9C,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACvC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAmB,GAAG,CAAC,CAAC;IAC/D,OAAO;QACL,IAAI;QACJ,GAAG;QACH,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC;QACrB,IAAI;QACJ,IAAI;KACL,CAAC;AACJ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K,CAAC,QAAQ,MAAM,6BAA6B,CAAC,CAAC;IAC/D,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { Gate } from "../gates/types.js";
2
+ export declare const gateMobileStores: Gate;
3
+ export declare const gateMobilePrivacy: Gate;
4
+ export declare const gateMobileA11y: Gate;
5
+ export declare const gateMobileOsMatrix: Gate;
6
+ export declare const gateMobilePerfBudget: Gate;
7
+ export declare const gateMobileCrashFree: Gate;
8
+ export declare const MOBILE_GATES: Gate[];
9
+ //# sourceMappingURL=gates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gates.d.ts","sourceRoot":"","sources":["../../src/presets/gates.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAA2B,MAAM,mBAAmB,CAAC;AA+GvE,eAAO,MAAM,gBAAgB,EAAE,IAmB9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,IAqB/B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,IAoB5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,IAiBhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,IAwBlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,IAkBjC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,IAAI,EAO9B,CAAC"}
@@ -0,0 +1,173 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { parseFrontmatter } from "../frontmatter/index.js";
4
+ function requireFeatureDir(ctx) {
5
+ if (!ctx.featureDir)
6
+ throw new Error("gate requires featureDir in context");
7
+ return ctx.featureDir;
8
+ }
9
+ function readSpec(ctx) {
10
+ const dir = requireFeatureDir(ctx);
11
+ const path = join(dir, "spec.md");
12
+ if (!existsSync(path))
13
+ return { path, data: {}, exists: false };
14
+ const raw = readFileSync(path, "utf8");
15
+ const { data } = parseFrontmatter(raw);
16
+ return { path, data, exists: true };
17
+ }
18
+ function readPlan(ctx) {
19
+ const dir = requireFeatureDir(ctx);
20
+ const path = join(dir, "plan.md");
21
+ if (!existsSync(path))
22
+ return { path, data: {}, exists: false };
23
+ const raw = readFileSync(path, "utf8");
24
+ const { data } = parseFrontmatter(raw);
25
+ return { path, data, exists: true };
26
+ }
27
+ function fail(g, message, details) {
28
+ return {
29
+ id: g.id,
30
+ title: g.title,
31
+ level: g.level,
32
+ article: g.article,
33
+ status: "fail",
34
+ message,
35
+ details,
36
+ };
37
+ }
38
+ function pass(g, details) {
39
+ return {
40
+ id: g.id,
41
+ title: g.title,
42
+ level: g.level,
43
+ article: g.article,
44
+ status: "pass",
45
+ details,
46
+ };
47
+ }
48
+ export const gateMobileStores = {
49
+ id: "gate.mobile.stores",
50
+ title: "Spec declares store permissions (M1)",
51
+ level: "required",
52
+ article: "M1",
53
+ run(ctx) {
54
+ const spec = readSpec(ctx);
55
+ if (!spec.exists)
56
+ return fail(this, "spec.md missing");
57
+ const s = spec.data.stores;
58
+ const iosCount = s?.ios_permissions?.length ?? 0;
59
+ const androidCount = s?.android_permissions?.length ?? 0;
60
+ if (!s || (iosCount === 0 && androidCount === 0)) {
61
+ return fail(this, "spec frontmatter missing stores.ios_permissions / stores.android_permissions");
62
+ }
63
+ return pass(this, { ios: iosCount, android: androidCount });
64
+ },
65
+ };
66
+ export const gateMobilePrivacy = {
67
+ id: "gate.mobile.privacy",
68
+ title: "Plan declares lawful basis, residency, retention (M2)",
69
+ level: "required",
70
+ article: "M2",
71
+ run(ctx) {
72
+ const plan = readPlan(ctx);
73
+ if (!plan.exists)
74
+ return fail(this, "plan.md missing");
75
+ const p = plan.data.privacy;
76
+ if (!p || !p.lawful_basis || !p.residency || !p.retention) {
77
+ return fail(this, "plan frontmatter missing privacy.lawful_basis / residency / retention");
78
+ }
79
+ return pass(this, {
80
+ lawful_basis: p.lawful_basis,
81
+ residency: p.residency,
82
+ retention: p.retention,
83
+ });
84
+ },
85
+ };
86
+ export const gateMobileA11y = {
87
+ id: "gate.mobile.a11y",
88
+ title: "Spec declares WCAG AA criteria (M3)",
89
+ level: "required",
90
+ article: "M3",
91
+ run(ctx) {
92
+ const spec = readSpec(ctx);
93
+ if (!spec.exists)
94
+ return fail(this, "spec.md missing");
95
+ const a = spec.data.a11y;
96
+ if (a?.wcag_level === "n/a" && a.justification) {
97
+ return pass(this, { wcag_level: "n/a" });
98
+ }
99
+ if (!a || a.wcag_level !== "AA" || !a.criteria || a.criteria.length === 0) {
100
+ return fail(this, 'spec frontmatter missing a11y.wcag_level="AA" and non-empty a11y.criteria (or a11y.wcag_level="n/a" with justification)');
101
+ }
102
+ return pass(this, { criteria: a.criteria.length });
103
+ },
104
+ };
105
+ export const gateMobileOsMatrix = {
106
+ id: "gate.mobile.os_matrix",
107
+ title: "Plan declares iOS/Android minimum versions (M4)",
108
+ level: "required",
109
+ article: "M4",
110
+ run(ctx) {
111
+ const plan = readPlan(ctx);
112
+ if (!plan.exists)
113
+ return fail(this, "plan.md missing");
114
+ const m = plan.data.os_matrix;
115
+ if (!m || !m.ios_min || !m.android_min) {
116
+ return fail(this, "plan frontmatter missing os_matrix.ios_min / android_min");
117
+ }
118
+ return pass(this, { ios_min: m.ios_min, android_min: m.android_min });
119
+ },
120
+ };
121
+ export const gateMobilePerfBudget = {
122
+ id: "gate.mobile.perf_budget",
123
+ title: "Plan declares performance budget (M5)",
124
+ level: "required",
125
+ article: "M5",
126
+ run(ctx) {
127
+ const plan = readPlan(ctx);
128
+ if (!plan.exists)
129
+ return fail(this, "plan.md missing");
130
+ const b = plan.data.perf_budget;
131
+ if (!b) {
132
+ return fail(this, "plan frontmatter missing perf_budget block");
133
+ }
134
+ if (b.scope === "none")
135
+ return pass(this, { scope: "none" });
136
+ if (!b.ttfi_ms || !b.interactions_ms) {
137
+ return fail(this, "plan frontmatter missing perf_budget.ttfi_ms / interactions_ms (or perf_budget.scope=none)");
138
+ }
139
+ return pass(this, {
140
+ ttfi_ms: b.ttfi_ms,
141
+ interactions_ms: b.interactions_ms,
142
+ });
143
+ },
144
+ };
145
+ export const gateMobileCrashFree = {
146
+ id: "gate.mobile.crash_free",
147
+ title: "Plan declares crash-free SLO + observability (M6)",
148
+ level: "advisory",
149
+ article: "M6",
150
+ run(ctx) {
151
+ const plan = readPlan(ctx);
152
+ if (!plan.exists)
153
+ return fail(this, "plan.md missing");
154
+ const slo = plan.data.crash_free_slo;
155
+ const obs = plan.data.observability;
156
+ if (typeof slo !== "number" || slo < 99.5) {
157
+ return fail(this, `crash_free_slo=${slo ?? "unset"} (must be ≥99.5)`);
158
+ }
159
+ if (!obs || !obs.provider) {
160
+ return fail(this, "plan frontmatter missing observability.provider");
161
+ }
162
+ return pass(this, { slo, provider: obs.provider });
163
+ },
164
+ };
165
+ export const MOBILE_GATES = [
166
+ gateMobileStores,
167
+ gateMobilePrivacy,
168
+ gateMobileA11y,
169
+ gateMobileOsMatrix,
170
+ gateMobilePerfBudget,
171
+ gateMobileCrashFree,
172
+ ];
173
+ //# sourceMappingURL=gates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gates.js","sourceRoot":"","sources":["../../src/presets/gates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAsD3D,SAAS,iBAAiB,CAAC,GAAgB;IACzC,IAAI,CAAC,GAAG,CAAC,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IAC5E,OAAO,GAAG,CAAC,UAAU,CAAC;AACxB,CAAC;AAED,SAAS,QAAQ,CAAC,GAAgB;IAKhC,MAAM,GAAG,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACnC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC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I,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrD,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAW;IAClC,gBAAgB;IAChB,iBAAiB;IACjB,cAAc;IACd,kBAAkB;IAClB,oBAAoB;IACpB,mBAAmB;CACpB,CAAC"}
@@ -0,0 +1,10 @@
1
+ export type { Preset, PresetArticle, PresetArticleViolation, } from "./types.js";
2
+ export { mobileOpinionated } from "./mobile-opinionated.js";
3
+ export { getPreset, listPresets, knownPresetIds } from "./registry.js";
4
+ export { PRESET_SCHEMA_V1, PRESET_DIR_SUBDIR, PresetManifestError, parsePresetManifest, loadPresetFromDir, loadPresetsFromProject, materializePreset, } from "./loader.js";
5
+ export type { PresetManifest, LoadedPreset } from "./loader.js";
6
+ export { stackPresets } from "./stacking.js";
7
+ export type { StackResult } from "./stacking.js";
8
+ export { renderPresetArticle, renderPresetArticles, renderPresetGatesForPlan, } from "./renderer.js";
9
+ export { MOBILE_GATES, gateMobileStores, gateMobilePrivacy, gateMobileA11y, gateMobileOsMatrix, gateMobilePerfBudget, gateMobileCrashFree, } from "./gates.js";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/presets/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,MAAM,EACN,aAAa,EACb,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { mobileOpinionated } from "./mobile-opinionated.js";
2
+ export { getPreset, listPresets, knownPresetIds } from "./registry.js";
3
+ export { PRESET_SCHEMA_V1, PRESET_DIR_SUBDIR, PresetManifestError, parsePresetManifest, loadPresetFromDir, loadPresetsFromProject, materializePreset, } from "./loader.js";
4
+ export { stackPresets } from "./stacking.js";
5
+ export { renderPresetArticle, renderPresetArticles, renderPresetGatesForPlan, } from "./renderer.js";
6
+ export { MOBILE_GATES, gateMobileStores, gateMobilePrivacy, gateMobileA11y, gateMobileOsMatrix, gateMobilePerfBudget, gateMobileCrashFree, } from "./gates.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/presets/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Preset loader — reads `preset.yml` manifests from disk so projects
3
+ * and extensions can define their own presets alongside the bundled
4
+ * TypeScript ones (e.g. `mobile-opinionated`).
5
+ *
6
+ * Layout:
7
+ * `<projectRoot>/.raptor/presets/<id>/preset.yml`
8
+ *
9
+ * The manifest only carries the preset metadata (articles text, gate
10
+ * references). It does NOT execute code; gates must be provided
11
+ * separately via the extensions system or referenced by id.
12
+ *
13
+ * Blueprint ref: 04 §3.
14
+ */
15
+ import type { Gate } from "../gates/types.js";
16
+ import type { Preset, PresetArticle } from "./types.js";
17
+ export declare const PRESET_SCHEMA_V1: "raptor.preset/v1";
18
+ export declare const PRESET_DIR_SUBDIR = ".raptor/presets";
19
+ export declare class PresetManifestError extends Error {
20
+ constructor(message: string);
21
+ }
22
+ export interface PresetManifest {
23
+ schema: typeof PRESET_SCHEMA_V1;
24
+ id: string;
25
+ name: string;
26
+ version: string;
27
+ description?: string;
28
+ articles?: PresetArticle[];
29
+ /**
30
+ * Ids of existing Gate objects (from core or extensions) that this
31
+ * preset wants to activate. Resolved by the caller against a
32
+ * registry of known gates — the manifest does not ship code.
33
+ */
34
+ gates?: string[];
35
+ }
36
+ export interface LoadedPreset {
37
+ manifest: PresetManifest;
38
+ rootDir: string;
39
+ manifestPath: string;
40
+ }
41
+ export declare function parsePresetManifest(raw: string, path?: string): PresetManifest;
42
+ export declare function loadPresetFromDir(dir: string): LoadedPreset;
43
+ /**
44
+ * Walk every `<projectRoot>/.raptor/presets/<id>/preset.yml` and return
45
+ * a LoadedPreset per match. Skips hidden / underscore-prefixed folders.
46
+ */
47
+ export declare function loadPresetsFromProject(projectRoot: string, subdir?: string): LoadedPreset[];
48
+ /**
49
+ * Materialize a LoadedPreset into the runtime `Preset` shape used by
50
+ * renderer/gates. Gate ids are resolved against a lookup function the
51
+ * caller provides (usually a combination of core + extension gates).
52
+ * Unknown ids are silently skipped so a preset targeting a gate from
53
+ * an extension that isn't installed keeps rendering the articles.
54
+ */
55
+ export declare function materializePreset(loaded: LoadedPreset, gateLookup: (id: string) => Gate | undefined): Preset;
56
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/presets/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAA0B,MAAM,YAAY,CAAC;AAEhF,eAAO,MAAM,gBAAgB,EAAG,kBAA2B,CAAC;AAC5D,eAAO,MAAM,iBAAiB,oBAAoB,CAAC;AAEnD,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM;CAI5B;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,gBAAgB,CAAC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;IAC3B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AAKD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAgD9E;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAS3D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,EACnB,MAAM,SAAoB,GACzB,YAAY,EAAE,CAwChB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,GAAG,SAAS,GAC3C,MAAM,CAcR"}
@@ -0,0 +1,216 @@
1
+ /**
2
+ * Preset loader — reads `preset.yml` manifests from disk so projects
3
+ * and extensions can define their own presets alongside the bundled
4
+ * TypeScript ones (e.g. `mobile-opinionated`).
5
+ *
6
+ * Layout:
7
+ * `<projectRoot>/.raptor/presets/<id>/preset.yml`
8
+ *
9
+ * The manifest only carries the preset metadata (articles text, gate
10
+ * references). It does NOT execute code; gates must be provided
11
+ * separately via the extensions system or referenced by id.
12
+ *
13
+ * Blueprint ref: 04 §3.
14
+ */
15
+ import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
16
+ import { isAbsolute, join } from "node:path";
17
+ import { parse as parseYaml } from "yaml";
18
+ export const PRESET_SCHEMA_V1 = "raptor.preset/v1";
19
+ export const PRESET_DIR_SUBDIR = ".raptor/presets";
20
+ export class PresetManifestError extends Error {
21
+ constructor(message) {
22
+ super(message);
23
+ this.name = "PresetManifestError";
24
+ }
25
+ }
26
+ const ID_RE = /^[a-z][a-z0-9._-]{1,63}$/;
27
+ const VERSION_RE = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/;
28
+ export function parsePresetManifest(raw, path) {
29
+ let parsed;
30
+ try {
31
+ parsed = parseYaml(raw);
32
+ }
33
+ catch (err) {
34
+ throw new PresetManifestError(`failed to parse preset.yml${path ? ` at ${path}` : ""}: ${err.message}`);
35
+ }
36
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
37
+ throw new PresetManifestError(`preset.yml${path ? ` at ${path}` : ""} must be a YAML mapping`);
38
+ }
39
+ const obj = parsed;
40
+ if (obj.schema !== PRESET_SCHEMA_V1) {
41
+ throw new PresetManifestError(`unsupported schema "${String(obj.schema)}" — expected "${PRESET_SCHEMA_V1}"`);
42
+ }
43
+ const id = requireString(obj, "id");
44
+ if (!ID_RE.test(id)) {
45
+ throw new PresetManifestError(`invalid preset id "${id}" — must match ${ID_RE}`);
46
+ }
47
+ const name = requireString(obj, "name");
48
+ const version = requireString(obj, "version");
49
+ if (!VERSION_RE.test(version)) {
50
+ throw new PresetManifestError(`invalid version "${version}"`);
51
+ }
52
+ const description = optionalString(obj, "description");
53
+ const manifest = {
54
+ schema: PRESET_SCHEMA_V1,
55
+ id,
56
+ name,
57
+ version,
58
+ };
59
+ if (description !== undefined)
60
+ manifest.description = description;
61
+ const articles = parseArticles(obj.articles);
62
+ if (articles)
63
+ manifest.articles = articles;
64
+ const gates = parseGateList(obj.gates);
65
+ if (gates)
66
+ manifest.gates = gates;
67
+ return manifest;
68
+ }
69
+ export function loadPresetFromDir(dir) {
70
+ const abs = isAbsolute(dir) ? dir : join(process.cwd(), dir);
71
+ const manifestPath = join(abs, "preset.yml");
72
+ if (!existsSync(manifestPath)) {
73
+ throw new PresetManifestError(`preset.yml not found in ${abs}`);
74
+ }
75
+ const raw = readFileSync(manifestPath, "utf8");
76
+ const manifest = parsePresetManifest(raw, manifestPath);
77
+ return { manifest, rootDir: abs, manifestPath };
78
+ }
79
+ /**
80
+ * Walk every `<projectRoot>/.raptor/presets/<id>/preset.yml` and return
81
+ * a LoadedPreset per match. Skips hidden / underscore-prefixed folders.
82
+ */
83
+ export function loadPresetsFromProject(projectRoot, subdir = PRESET_DIR_SUBDIR) {
84
+ if (!isAbsolute(projectRoot)) {
85
+ throw new PresetManifestError(`projectRoot must be absolute, got "${projectRoot}"`);
86
+ }
87
+ const root = join(projectRoot, subdir);
88
+ if (!existsSync(root))
89
+ return [];
90
+ if (!statSync(root).isDirectory())
91
+ return [];
92
+ const out = [];
93
+ const seen = new Map();
94
+ const errors = [];
95
+ for (const entry of readdirSync(root).sort()) {
96
+ if (entry.startsWith(".") || entry.startsWith("_"))
97
+ continue;
98
+ const dir = join(root, entry);
99
+ if (!statSync(dir).isDirectory())
100
+ continue;
101
+ const manifest = join(dir, "preset.yml");
102
+ if (!existsSync(manifest))
103
+ continue;
104
+ try {
105
+ const loaded = loadPresetFromDir(dir);
106
+ const prior = seen.get(loaded.manifest.id);
107
+ if (prior) {
108
+ errors.push(`duplicate preset id "${loaded.manifest.id}" in both ${prior} and ${dir}`);
109
+ continue;
110
+ }
111
+ seen.set(loaded.manifest.id, dir);
112
+ out.push(loaded);
113
+ }
114
+ catch (err) {
115
+ errors.push(`[${entry}] ${err.message}`);
116
+ }
117
+ }
118
+ if (errors.length > 0) {
119
+ throw new PresetManifestError(`failed to load ${errors.length} preset(s):\n - ${errors.join("\n - ")}`);
120
+ }
121
+ return out;
122
+ }
123
+ /**
124
+ * Materialize a LoadedPreset into the runtime `Preset` shape used by
125
+ * renderer/gates. Gate ids are resolved against a lookup function the
126
+ * caller provides (usually a combination of core + extension gates).
127
+ * Unknown ids are silently skipped so a preset targeting a gate from
128
+ * an extension that isn't installed keeps rendering the articles.
129
+ */
130
+ export function materializePreset(loaded, gateLookup) {
131
+ const gates = [];
132
+ for (const gid of loaded.manifest.gates ?? []) {
133
+ const g = gateLookup(gid);
134
+ if (g)
135
+ gates.push(g);
136
+ }
137
+ return {
138
+ id: loaded.manifest.id,
139
+ name: loaded.manifest.name,
140
+ version: loaded.manifest.version,
141
+ description: loaded.manifest.description ?? "",
142
+ articles: loaded.manifest.articles ?? [],
143
+ gates,
144
+ };
145
+ }
146
+ // ---------------------------------------------------------------------------
147
+ // internals
148
+ // ---------------------------------------------------------------------------
149
+ function requireString(obj, key) {
150
+ const v = obj[key];
151
+ if (typeof v !== "string" || v.trim().length === 0) {
152
+ throw new PresetManifestError(`missing or invalid "${key}"`);
153
+ }
154
+ return v;
155
+ }
156
+ function optionalString(obj, key) {
157
+ const v = obj[key];
158
+ if (v === undefined || v === null)
159
+ return undefined;
160
+ if (typeof v !== "string") {
161
+ throw new PresetManifestError(`"${key}" must be a string`);
162
+ }
163
+ return v;
164
+ }
165
+ function parseArticles(value) {
166
+ if (value === undefined || value === null)
167
+ return undefined;
168
+ if (!Array.isArray(value)) {
169
+ throw new PresetManifestError(`"articles" must be a list`);
170
+ }
171
+ return value.map((raw, idx) => {
172
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
173
+ throw new PresetManifestError(`articles[${idx}] must be a mapping`);
174
+ }
175
+ const a = raw;
176
+ const violation = parseViolation(a.violation, idx);
177
+ return {
178
+ id: requireString(a, "id"),
179
+ title: requireString(a, "title"),
180
+ statement: requireString(a, "statement"),
181
+ rationale: requireString(a, "rationale"),
182
+ enforcement: requireString(a, "enforcement"),
183
+ violation,
184
+ };
185
+ });
186
+ }
187
+ function parseViolation(value, idx) {
188
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
189
+ throw new PresetManifestError(`articles[${idx}].violation must be a mapping`);
190
+ }
191
+ const v = value;
192
+ const level = v.level;
193
+ if (level !== "required" && level !== "advisory") {
194
+ throw new PresetManifestError(`articles[${idx}].violation.level must be "required" or "advisory"`);
195
+ }
196
+ if (typeof v.description !== "string") {
197
+ throw new PresetManifestError(`articles[${idx}].violation.description must be a string`);
198
+ }
199
+ return { level, description: v.description };
200
+ }
201
+ function parseGateList(value) {
202
+ if (value === undefined || value === null)
203
+ return undefined;
204
+ if (!Array.isArray(value)) {
205
+ throw new PresetManifestError(`"gates" must be a list of gate ids`);
206
+ }
207
+ const out = [];
208
+ for (const v of value) {
209
+ if (typeof v !== "string" || v.trim().length === 0) {
210
+ throw new PresetManifestError(`"gates" entries must be non-empty strings`);
211
+ }
212
+ out.push(v);
213
+ }
214
+ return out;
215
+ }
216
+ //# sourceMappingURL=loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/presets/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE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IAC3C,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;IACtB,IAAI,KAAK,KAAK,UAAU,IAAI,KAAK,KAAK,UAAU,EAAE,CAAC;QACjD,MAAM,IAAI,mBAAmB,CAC3B,YAAY,GAAG,oDAAoD,CACpE,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,CAAC,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QACtC,MAAM,IAAI,mBAAmB,CAC3B,YAAY,GAAG,0CAA0C,CAC1D,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AAC/C,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,mBAAmB,CAAC,oCAAoC,CAAC,CAAC;IACtE,CAAC;IACD,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnD,MAAM,IAAI,mBAAmB,CAAC,2CAA2C,CAAC,CAAC;QAC7E,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Preset } from "./types.js";
2
+ export declare const mobileOpinionated: Preset;
3
+ //# sourceMappingURL=mobile-opinionated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mobile-opinionated.d.ts","sourceRoot":"","sources":["../../src/presets/mobile-opinionated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,YAAY,CAAC;AAgGxD,eAAO,MAAM,iBAAiB,EAAE,MAQ/B,CAAC"}