@hawkeyexl/manni 4.20.1 → 4.22.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 (314) hide show
  1. package/README.md +1 -1
  2. package/dist/{batch-J626LZ22.js → batch-C3NN2YXB.js} +20 -21
  3. package/dist/build-CEVEAHN7.js +36 -0
  4. package/dist/calibrate-CSKPY5AK.js +42 -0
  5. package/dist/capture-3HDBIHH6.js +37 -0
  6. package/dist/check-555TCJGF.js +45 -0
  7. package/dist/check-KGJBV42O.js +30 -0
  8. package/dist/{check-RCSQARQE.js → check-KXWHSCCR.js} +13 -16
  9. package/dist/check-MZSXCS2M.js +33 -0
  10. package/dist/{check-PQ7S5I3I.js → check-QNHLTYPN.js} +23 -23
  11. package/dist/{chunk-YIHIRMXN.js → chunk-2VLZDU4E.js} +5 -5
  12. package/dist/{chunk-D54BQM5P.js → chunk-37Q7WEJJ.js} +9 -9
  13. package/dist/{chunk-QSPH4F56.js → chunk-3ZVRGBK6.js} +5 -5
  14. package/dist/chunk-3ZVRGBK6.js.map +1 -0
  15. package/dist/{chunk-P5DWBG6T.js → chunk-46MMIJWR.js} +3 -3
  16. package/dist/{chunk-P6XZ44C2.js → chunk-4LYVTR2T.js} +4 -4
  17. package/dist/{chunk-ODSIHEIW.js → chunk-562QZKAB.js} +6599 -3508
  18. package/dist/chunk-562QZKAB.js.map +1 -0
  19. package/dist/{chunk-ACJUZFRT.js → chunk-57LZPG4V.js} +29 -4
  20. package/dist/chunk-57LZPG4V.js.map +1 -0
  21. package/dist/chunk-5LQX57BW.js +100 -0
  22. package/dist/chunk-5LQX57BW.js.map +1 -0
  23. package/dist/{chunk-MPXMQGJI.js → chunk-63EQKVNT.js} +45 -910
  24. package/dist/chunk-63EQKVNT.js.map +1 -0
  25. package/dist/{chunk-6FY573GB.js → chunk-64DULZIG.js} +4 -4
  26. package/dist/{chunk-TAJYMXMM.js → chunk-6SVHI2U6.js} +2 -2
  27. package/dist/{chunk-OVUQNM7Y.js → chunk-6UHEMPEY.js} +3 -157
  28. package/dist/chunk-6UHEMPEY.js.map +1 -0
  29. package/dist/{chunk-A633WB3N.js → chunk-A5YUK3SG.js} +37 -26
  30. package/dist/chunk-A5YUK3SG.js.map +1 -0
  31. package/dist/{chunk-C5BXSQDO.js → chunk-A67EJ3J6.js} +6 -6
  32. package/dist/{chunk-2GTR24SA.js → chunk-BLDL23RY.js} +8 -8
  33. package/dist/{chunk-JPXC62SD.js → chunk-BY3635RR.js} +82 -16
  34. package/dist/chunk-BY3635RR.js.map +1 -0
  35. package/dist/{chunk-CFMI74TP.js → chunk-BZ74YUYE.js} +2 -2
  36. package/dist/{chunk-NDPQ2GQ4.js → chunk-CHTSA3YR.js} +6 -6
  37. package/dist/{chunk-5CJ3P5O3.js → chunk-CPYQ4BJK.js} +19 -100
  38. package/dist/chunk-CPYQ4BJK.js.map +1 -0
  39. package/dist/{chunk-Z2T5U7HN.js → chunk-CQTESLC5.js} +2 -2
  40. package/dist/{chunk-245W2Q7C.js → chunk-D4BGNAN5.js} +2 -2
  41. package/dist/{chunk-XPO655IX.js → chunk-E3HYSNS6.js} +4 -4
  42. package/dist/{chunk-LPJ3IB26.js → chunk-EL2KNRC3.js} +17 -3
  43. package/dist/chunk-EL2KNRC3.js.map +1 -0
  44. package/dist/{chunk-ISDFYXLA.js → chunk-FTSNG6DZ.js} +48 -28
  45. package/dist/chunk-FTSNG6DZ.js.map +1 -0
  46. package/dist/{chunk-MJZK7G4B.js → chunk-FXE5K56B.js} +3 -3
  47. package/dist/{chunk-YM2W43DI.js → chunk-HYEKQ22B.js} +13 -9
  48. package/dist/chunk-HYEKQ22B.js.map +1 -0
  49. package/dist/{chunk-QGBNWEWS.js → chunk-IC3FJWIF.js} +2 -2
  50. package/dist/{chunk-OQR3VVAX.js → chunk-IDDRHB7E.js} +3 -3
  51. package/dist/chunk-INOVEO32.js +28 -0
  52. package/dist/chunk-INOVEO32.js.map +1 -0
  53. package/dist/chunk-IXFFVI5S.js +409 -0
  54. package/dist/chunk-IXFFVI5S.js.map +1 -0
  55. package/dist/{chunk-OXCWCEVV.js → chunk-JA7DWOVV.js} +5 -5
  56. package/dist/{chunk-B2242FYO.js → chunk-JF4BC7ZD.js} +38 -3
  57. package/dist/chunk-JF4BC7ZD.js.map +1 -0
  58. package/dist/{chunk-RN7IA742.js → chunk-JL5FHNQK.js} +9 -11
  59. package/dist/{chunk-RN7IA742.js.map → chunk-JL5FHNQK.js.map} +1 -1
  60. package/dist/{chunk-HGUCJ3K3.js → chunk-JVE5YQN4.js} +4 -4
  61. package/dist/chunk-K5LBIAOM.js +700 -0
  62. package/dist/chunk-K5LBIAOM.js.map +1 -0
  63. package/dist/{chunk-5E3ABFOQ.js → chunk-KIUFBUUZ.js} +13 -11
  64. package/dist/{chunk-5E3ABFOQ.js.map → chunk-KIUFBUUZ.js.map} +1 -1
  65. package/dist/{chunk-SUTY4VCZ.js → chunk-LCMBG4LY.js} +3635 -3409
  66. package/dist/chunk-LCMBG4LY.js.map +1 -0
  67. package/dist/{chunk-H3C3UXTA.js → chunk-LMS2RWDS.js} +15 -13
  68. package/dist/{chunk-H3C3UXTA.js.map → chunk-LMS2RWDS.js.map} +1 -1
  69. package/dist/{chunk-RA2BER5P.js → chunk-MR5JWMC2.js} +2 -2
  70. package/dist/{chunk-JCTHXG33.js → chunk-NHOGTAPK.js} +2 -2
  71. package/dist/{chunk-VM7VAFJW.js → chunk-NVYDWVXN.js} +2 -1
  72. package/dist/{chunk-N2VB6UUE.js → chunk-O6IDYZVW.js} +7 -5
  73. package/dist/{chunk-N2VB6UUE.js.map → chunk-O6IDYZVW.js.map} +1 -1
  74. package/dist/{chunk-MTMR65NM.js → chunk-OHMLEITS.js} +2 -2
  75. package/dist/{chunk-NUQF5F5J.js → chunk-PNDEKFF3.js} +2 -2
  76. package/dist/{chunk-S2HW3CBF.js → chunk-PX7OTUNU.js} +6 -6
  77. package/dist/{chunk-4F5WGZRP.js → chunk-Q7FFJMFO.js} +19 -15
  78. package/dist/chunk-Q7FFJMFO.js.map +1 -0
  79. package/dist/{chunk-D4XQX4W7.js → chunk-QJJPTS6L.js} +5 -3
  80. package/dist/{chunk-D4XQX4W7.js.map → chunk-QJJPTS6L.js.map} +1 -1
  81. package/dist/chunk-RAN3CF33.js +1875 -0
  82. package/dist/chunk-RAN3CF33.js.map +1 -0
  83. package/dist/{chunk-YYWZ2MSL.js → chunk-S7V4F7HC.js} +16 -11
  84. package/dist/chunk-S7V4F7HC.js.map +1 -0
  85. package/dist/{chunk-CXL6ES7O.js → chunk-SCKVDD4E.js} +4 -4
  86. package/dist/{chunk-ZB3OFSRB.js → chunk-TJYJ4BNK.js} +4 -4
  87. package/dist/{chunk-MJZ5HYYL.js → chunk-TR5TNPWT.js} +2 -2
  88. package/dist/{chunk-MJZ5HYYL.js.map → chunk-TR5TNPWT.js.map} +1 -1
  89. package/dist/chunk-TT5UDTDM.js +888 -0
  90. package/dist/chunk-TT5UDTDM.js.map +1 -0
  91. package/dist/{chunk-N3DYE6LJ.js → chunk-TWYJ2TVS.js} +7 -7
  92. package/dist/{chunk-BM43RJIS.js → chunk-UQI463L3.js} +9 -9
  93. package/dist/{chunk-FIR2MAGS.js → chunk-V27DOGAO.js} +2 -2
  94. package/dist/{chunk-O4O6JOGD.js → chunk-VSDXZAQU.js} +14 -20
  95. package/dist/chunk-VSDXZAQU.js.map +1 -0
  96. package/dist/{chunk-4DFBBU4A.js → chunk-VSHMXMBZ.js} +2 -2
  97. package/dist/{chunk-ROZDHPKA.js → chunk-VZSATUI7.js} +4 -4
  98. package/dist/{chunk-EOJEPEYY.js → chunk-W5OZMYMX.js} +2 -2
  99. package/dist/{chunk-KERICP5Y.js → chunk-WW4JATBJ.js} +6 -6
  100. package/dist/{chunk-SSQZB5SQ.js → chunk-XG6PVB5S.js} +11 -1
  101. package/dist/chunk-XG6PVB5S.js.map +1 -0
  102. package/dist/{chunk-TDG2S5UE.js → chunk-XQKRD5A3.js} +4 -4
  103. package/dist/{chunk-GGTCSMNX.js → chunk-XSP3TUFN.js} +5 -5
  104. package/dist/{chunk-UVC3BUKU.js → chunk-XTMONCQE.js} +6 -405
  105. package/dist/chunk-XTMONCQE.js.map +1 -0
  106. package/dist/{chunk-WRWW6SGG.js → chunk-YB3KD5RI.js} +3 -3
  107. package/dist/chunk-ZAOJYN2D.js +159 -0
  108. package/dist/chunk-ZAOJYN2D.js.map +1 -0
  109. package/dist/{chunk-FKELQCGN.js → chunk-ZKIXGFID.js} +2 -2
  110. package/dist/{chunk-BY4THWAQ.js → chunk-ZT3ERG4B.js} +3 -3
  111. package/dist/chunk-ZTRC37NH.js +38 -0
  112. package/dist/chunk-ZTRC37NH.js.map +1 -0
  113. package/dist/{chunk-LXJ4FZ7Y.js → chunk-ZW4YASUB.js} +4 -4
  114. package/dist/{chunk-E6JYRVR5.js → chunk-ZX4TOTZS.js} +27 -8
  115. package/dist/chunk-ZX4TOTZS.js.map +1 -0
  116. package/dist/{cli-4RTNEVVX.js → cli-4QAH3DBX.js} +9 -11
  117. package/dist/{cli-IIFCE6GY.js → cli-6476FRBK.js} +16 -19
  118. package/dist/{cli-IIFCE6GY.js.map → cli-6476FRBK.js.map} +1 -1
  119. package/dist/{cli-DQRFSU7U.js → cli-7XT7O5YM.js} +16 -18
  120. package/dist/{cli-DQRFSU7U.js.map → cli-7XT7O5YM.js.map} +1 -1
  121. package/dist/{cli-PCZ7XNCO.js → cli-FGCHGJYZ.js} +70 -53
  122. package/dist/cli-FGCHGJYZ.js.map +1 -0
  123. package/dist/{cli-6J4P5MLU.js → cli-JE4LG35H.js} +4 -4
  124. package/dist/{cli-K5635N25.js → cli-U3622DIB.js} +14 -17
  125. package/dist/{cli-K5635N25.js.map → cli-U3622DIB.js.map} +1 -1
  126. package/dist/{cli-K5QWXB7H.js → cli-ULHJTJHH.js} +74 -41
  127. package/dist/cli-ULHJTJHH.js.map +1 -0
  128. package/dist/{cli-ISKXSN3P.js → cli-W7B2PNZO.js} +18 -21
  129. package/dist/{cli-ISKXSN3P.js.map → cli-W7B2PNZO.js.map} +1 -1
  130. package/dist/{cli-FTSJQSB4.js → cli-YGMXZ46V.js} +17 -20
  131. package/dist/{cli-FTSJQSB4.js.map → cli-YGMXZ46V.js.map} +1 -1
  132. package/dist/{cli-TCHSYJLB.js → cli-YINQL2NI.js} +28 -29
  133. package/dist/{cli-TCHSYJLB.js.map → cli-YINQL2NI.js.map} +1 -1
  134. package/dist/cli-Z3ART5DN.js +152 -0
  135. package/dist/cli-Z3ART5DN.js.map +1 -0
  136. package/dist/cli.js +15 -15
  137. package/dist/cli.js.map +1 -1
  138. package/dist/{config-7I5CHHRZ.js → config-2YJPJ36T.js} +5 -5
  139. package/dist/docmeta.js +8 -10
  140. package/dist/docmeta.js.map +1 -1
  141. package/dist/github-64ZVAUIT.js +28 -0
  142. package/dist/github-ARGPMQD2.js +32 -0
  143. package/dist/github-YHJABBUI.js +33 -0
  144. package/dist/graph/runtime.js.map +1 -1
  145. package/dist/{host-YSTYO5DX.js → host-JT27OWTC.js} +3 -3
  146. package/dist/index.d.ts +334 -24
  147. package/dist/index.js +218 -203
  148. package/dist/index.js.map +1 -1
  149. package/dist/{json-7Z2IFGB3.js → json-CVOVXB7O.js} +12 -15
  150. package/dist/json-QNGJFUY2.js +40 -0
  151. package/dist/{labels-SE2WL7WD.js → labels-5WOKC3VR.js} +11 -14
  152. package/dist/{labels-SE2WL7WD.js.map → labels-5WOKC3VR.js.map} +1 -1
  153. package/dist/lint-OQGB4DWJ.js +32 -0
  154. package/dist/list-EDAB7X5Y.js +30 -0
  155. package/dist/list-OQ3IYV2W.js +37 -0
  156. package/dist/list-PN6JKYNX.js +33 -0
  157. package/dist/{page-A2Y4ZMV4.js → page-TPNMHL27.js} +11 -14
  158. package/dist/{prepare-M2COBP5O.js → prepare-3V2QYBKL.js} +20 -22
  159. package/dist/{prepare-M2COBP5O.js.map → prepare-3V2QYBKL.js.map} +1 -1
  160. package/dist/{pretty-SFFOMSG5.js → pretty-EZ2NFU3C.js} +13 -16
  161. package/dist/pretty-HO2LYG5N.js +41 -0
  162. package/dist/{pretty-D3DZFC5U.js → pretty-K3M4AW2D.js} +12 -15
  163. package/dist/{provider-JY2I3VLF.js → provider-YWNTTQPA.js} +3 -3
  164. package/dist/{release-VHHASAG7.js → release-EFLQT3FW.js} +3 -3
  165. package/dist/{reporters-TO7Q6JYF.js → reporters-4R2E7PRJ.js} +6 -6
  166. package/dist/{reporters-UTLJVSWX.js → reporters-YVLLFBO5.js} +11 -14
  167. package/dist/run-H4BOR2FR.js +36 -0
  168. package/dist/{sarif-IAGMXA6C.js → sarif-GWHWJJFP.js} +10 -13
  169. package/dist/sarif-SJFVSOBV.js +33 -0
  170. package/dist/sarif-YBFD5OUL.js +28 -0
  171. package/dist/{strategy-UKRA6WO4.js → strategy-T56PH2VK.js} +29 -46
  172. package/dist/strategy-T56PH2VK.js.map +1 -0
  173. package/dist/{term-AMORBEO7.js → term-33YSMISR.js} +18 -22
  174. package/dist/{term-AMORBEO7.js.map → term-33YSMISR.js.map} +1 -1
  175. package/dist/{validate-CDTKFZUV.js → validate-6R5UBDGU.js} +6 -7
  176. package/package.json +1 -1
  177. package/plugin/manni/.claude-plugin/plugin.json +11 -3
  178. package/plugin/manni/hooks/graph-server.mjs +3 -3
  179. package/plugin/manni/hooks/hooks.json +4 -4
  180. package/plugin/manni/hooks/manni.mjs +18 -5
  181. package/plugin/manni/hooks/page-metadata.mjs +81 -7
  182. package/plugin/manni/hooks/tracevals.mjs +7 -0
  183. package/plugin/manni/skills/fix/SKILL.md +8 -4
  184. package/shapes/graph/shapes-1.3.0.ttl +1250 -0
  185. package/dist/build-AYLD6V6Y.js +0 -38
  186. package/dist/calibrate-2HZFACIX.js +0 -43
  187. package/dist/capture-NMDIPC6S.js +0 -39
  188. package/dist/check-KNQV7GLU.js +0 -33
  189. package/dist/check-OH4KKXP3.js +0 -33
  190. package/dist/check-PRAMKQCI.js +0 -47
  191. package/dist/chunk-4F5WGZRP.js.map +0 -1
  192. package/dist/chunk-4H3IOF52.js +0 -3200
  193. package/dist/chunk-4H3IOF52.js.map +0 -1
  194. package/dist/chunk-5CJ3P5O3.js.map +0 -1
  195. package/dist/chunk-A633WB3N.js.map +0 -1
  196. package/dist/chunk-ACJUZFRT.js.map +0 -1
  197. package/dist/chunk-B2242FYO.js.map +0 -1
  198. package/dist/chunk-CT5WSUUZ.js +0 -441
  199. package/dist/chunk-CT5WSUUZ.js.map +0 -1
  200. package/dist/chunk-DNF42MK7.js +0 -326
  201. package/dist/chunk-DNF42MK7.js.map +0 -1
  202. package/dist/chunk-E6JYRVR5.js.map +0 -1
  203. package/dist/chunk-ISDFYXLA.js.map +0 -1
  204. package/dist/chunk-JPXC62SD.js.map +0 -1
  205. package/dist/chunk-LPJ3IB26.js.map +0 -1
  206. package/dist/chunk-MPXMQGJI.js.map +0 -1
  207. package/dist/chunk-O4O6JOGD.js.map +0 -1
  208. package/dist/chunk-ODSIHEIW.js.map +0 -1
  209. package/dist/chunk-OVUQNM7Y.js.map +0 -1
  210. package/dist/chunk-QSPH4F56.js.map +0 -1
  211. package/dist/chunk-SIREOHLW.js +0 -233
  212. package/dist/chunk-SIREOHLW.js.map +0 -1
  213. package/dist/chunk-SSQZB5SQ.js.map +0 -1
  214. package/dist/chunk-SUTY4VCZ.js.map +0 -1
  215. package/dist/chunk-UP6NBQ62.js +0 -2
  216. package/dist/chunk-UVC3BUKU.js.map +0 -1
  217. package/dist/chunk-WI3PPQQX.js +0 -164
  218. package/dist/chunk-WI3PPQQX.js.map +0 -1
  219. package/dist/chunk-YM2W43DI.js.map +0 -1
  220. package/dist/chunk-YYWZ2MSL.js.map +0 -1
  221. package/dist/chunk-ZPLVANY2.js +0 -15
  222. package/dist/chunk-ZPLVANY2.js.map +0 -1
  223. package/dist/cli-K5QWXB7H.js.map +0 -1
  224. package/dist/cli-PCZ7XNCO.js.map +0 -1
  225. package/dist/cli-TM2JCTQT.js +0 -84
  226. package/dist/cli-TM2JCTQT.js.map +0 -1
  227. package/dist/github-BUK5CVQW.js +0 -27
  228. package/dist/github-CMAZWS76.js +0 -31
  229. package/dist/github-NXR4QMMM.js +0 -35
  230. package/dist/json-NZSGRYOE.js +0 -34
  231. package/dist/lint-VUYM5PPM.js +0 -35
  232. package/dist/list-4JGOXLOZ.js +0 -33
  233. package/dist/list-LTF25DQE.js +0 -33
  234. package/dist/list-WD3TZS5R.js +0 -36
  235. package/dist/pretty-R67YU6TU.js +0 -35
  236. package/dist/run-BDGYRUXJ.js +0 -39
  237. package/dist/sarif-EHAMGCVR.js +0 -36
  238. package/dist/sarif-GJYLRXLS.js +0 -30
  239. package/dist/strategy-UKRA6WO4.js.map +0 -1
  240. package/dist/validate-CDTKFZUV.js.map +0 -1
  241. /package/dist/{batch-J626LZ22.js.map → batch-C3NN2YXB.js.map} +0 -0
  242. /package/dist/{build-AYLD6V6Y.js.map → build-CEVEAHN7.js.map} +0 -0
  243. /package/dist/{calibrate-2HZFACIX.js.map → calibrate-CSKPY5AK.js.map} +0 -0
  244. /package/dist/{capture-NMDIPC6S.js.map → capture-3HDBIHH6.js.map} +0 -0
  245. /package/dist/{check-KNQV7GLU.js.map → check-555TCJGF.js.map} +0 -0
  246. /package/dist/{check-OH4KKXP3.js.map → check-KGJBV42O.js.map} +0 -0
  247. /package/dist/{check-PRAMKQCI.js.map → check-KXWHSCCR.js.map} +0 -0
  248. /package/dist/{check-RCSQARQE.js.map → check-MZSXCS2M.js.map} +0 -0
  249. /package/dist/{check-PQ7S5I3I.js.map → check-QNHLTYPN.js.map} +0 -0
  250. /package/dist/{chunk-YIHIRMXN.js.map → chunk-2VLZDU4E.js.map} +0 -0
  251. /package/dist/{chunk-D54BQM5P.js.map → chunk-37Q7WEJJ.js.map} +0 -0
  252. /package/dist/{chunk-P5DWBG6T.js.map → chunk-46MMIJWR.js.map} +0 -0
  253. /package/dist/{chunk-P6XZ44C2.js.map → chunk-4LYVTR2T.js.map} +0 -0
  254. /package/dist/{chunk-6FY573GB.js.map → chunk-64DULZIG.js.map} +0 -0
  255. /package/dist/{chunk-TAJYMXMM.js.map → chunk-6SVHI2U6.js.map} +0 -0
  256. /package/dist/{chunk-C5BXSQDO.js.map → chunk-A67EJ3J6.js.map} +0 -0
  257. /package/dist/{chunk-2GTR24SA.js.map → chunk-BLDL23RY.js.map} +0 -0
  258. /package/dist/{chunk-CFMI74TP.js.map → chunk-BZ74YUYE.js.map} +0 -0
  259. /package/dist/{chunk-NDPQ2GQ4.js.map → chunk-CHTSA3YR.js.map} +0 -0
  260. /package/dist/{chunk-Z2T5U7HN.js.map → chunk-CQTESLC5.js.map} +0 -0
  261. /package/dist/{chunk-245W2Q7C.js.map → chunk-D4BGNAN5.js.map} +0 -0
  262. /package/dist/{chunk-XPO655IX.js.map → chunk-E3HYSNS6.js.map} +0 -0
  263. /package/dist/{chunk-MJZK7G4B.js.map → chunk-FXE5K56B.js.map} +0 -0
  264. /package/dist/{chunk-QGBNWEWS.js.map → chunk-IC3FJWIF.js.map} +0 -0
  265. /package/dist/{chunk-OQR3VVAX.js.map → chunk-IDDRHB7E.js.map} +0 -0
  266. /package/dist/{chunk-OXCWCEVV.js.map → chunk-JA7DWOVV.js.map} +0 -0
  267. /package/dist/{chunk-HGUCJ3K3.js.map → chunk-JVE5YQN4.js.map} +0 -0
  268. /package/dist/{chunk-RA2BER5P.js.map → chunk-MR5JWMC2.js.map} +0 -0
  269. /package/dist/{chunk-JCTHXG33.js.map → chunk-NHOGTAPK.js.map} +0 -0
  270. /package/dist/{chunk-VM7VAFJW.js.map → chunk-NVYDWVXN.js.map} +0 -0
  271. /package/dist/{chunk-MTMR65NM.js.map → chunk-OHMLEITS.js.map} +0 -0
  272. /package/dist/{chunk-NUQF5F5J.js.map → chunk-PNDEKFF3.js.map} +0 -0
  273. /package/dist/{chunk-S2HW3CBF.js.map → chunk-PX7OTUNU.js.map} +0 -0
  274. /package/dist/{chunk-CXL6ES7O.js.map → chunk-SCKVDD4E.js.map} +0 -0
  275. /package/dist/{chunk-ZB3OFSRB.js.map → chunk-TJYJ4BNK.js.map} +0 -0
  276. /package/dist/{chunk-N3DYE6LJ.js.map → chunk-TWYJ2TVS.js.map} +0 -0
  277. /package/dist/{chunk-BM43RJIS.js.map → chunk-UQI463L3.js.map} +0 -0
  278. /package/dist/{chunk-FIR2MAGS.js.map → chunk-V27DOGAO.js.map} +0 -0
  279. /package/dist/{chunk-4DFBBU4A.js.map → chunk-VSHMXMBZ.js.map} +0 -0
  280. /package/dist/{chunk-ROZDHPKA.js.map → chunk-VZSATUI7.js.map} +0 -0
  281. /package/dist/{chunk-EOJEPEYY.js.map → chunk-W5OZMYMX.js.map} +0 -0
  282. /package/dist/{chunk-KERICP5Y.js.map → chunk-WW4JATBJ.js.map} +0 -0
  283. /package/dist/{chunk-TDG2S5UE.js.map → chunk-XQKRD5A3.js.map} +0 -0
  284. /package/dist/{chunk-GGTCSMNX.js.map → chunk-XSP3TUFN.js.map} +0 -0
  285. /package/dist/{chunk-WRWW6SGG.js.map → chunk-YB3KD5RI.js.map} +0 -0
  286. /package/dist/{chunk-FKELQCGN.js.map → chunk-ZKIXGFID.js.map} +0 -0
  287. /package/dist/{chunk-BY4THWAQ.js.map → chunk-ZT3ERG4B.js.map} +0 -0
  288. /package/dist/{chunk-LXJ4FZ7Y.js.map → chunk-ZW4YASUB.js.map} +0 -0
  289. /package/dist/{chunk-UP6NBQ62.js.map → cli-4QAH3DBX.js.map} +0 -0
  290. /package/dist/{cli-6J4P5MLU.js.map → cli-JE4LG35H.js.map} +0 -0
  291. /package/dist/{cli-4RTNEVVX.js.map → config-2YJPJ36T.js.map} +0 -0
  292. /package/dist/{config-7I5CHHRZ.js.map → github-64ZVAUIT.js.map} +0 -0
  293. /package/dist/{github-BUK5CVQW.js.map → github-ARGPMQD2.js.map} +0 -0
  294. /package/dist/{github-CMAZWS76.js.map → github-YHJABBUI.js.map} +0 -0
  295. /package/dist/{github-NXR4QMMM.js.map → host-JT27OWTC.js.map} +0 -0
  296. /package/dist/{host-YSTYO5DX.js.map → json-CVOVXB7O.js.map} +0 -0
  297. /package/dist/{json-7Z2IFGB3.js.map → json-QNGJFUY2.js.map} +0 -0
  298. /package/dist/{json-NZSGRYOE.js.map → lint-OQGB4DWJ.js.map} +0 -0
  299. /package/dist/{lint-VUYM5PPM.js.map → list-EDAB7X5Y.js.map} +0 -0
  300. /package/dist/{list-4JGOXLOZ.js.map → list-OQ3IYV2W.js.map} +0 -0
  301. /package/dist/{list-LTF25DQE.js.map → list-PN6JKYNX.js.map} +0 -0
  302. /package/dist/{list-WD3TZS5R.js.map → page-TPNMHL27.js.map} +0 -0
  303. /package/dist/{page-A2Y4ZMV4.js.map → pretty-EZ2NFU3C.js.map} +0 -0
  304. /package/dist/{pretty-D3DZFC5U.js.map → pretty-HO2LYG5N.js.map} +0 -0
  305. /package/dist/{pretty-R67YU6TU.js.map → pretty-K3M4AW2D.js.map} +0 -0
  306. /package/dist/{pretty-SFFOMSG5.js.map → provider-YWNTTQPA.js.map} +0 -0
  307. /package/dist/{release-VHHASAG7.js.map → release-EFLQT3FW.js.map} +0 -0
  308. /package/dist/{provider-JY2I3VLF.js.map → reporters-4R2E7PRJ.js.map} +0 -0
  309. /package/dist/{reporters-TO7Q6JYF.js.map → reporters-YVLLFBO5.js.map} +0 -0
  310. /package/dist/{reporters-UTLJVSWX.js.map → run-H4BOR2FR.js.map} +0 -0
  311. /package/dist/{run-BDGYRUXJ.js.map → sarif-GWHWJJFP.js.map} +0 -0
  312. /package/dist/{sarif-EHAMGCVR.js.map → sarif-SJFVSOBV.js.map} +0 -0
  313. /package/dist/{sarif-GJYLRXLS.js.map → sarif-YBFD5OUL.js.map} +0 -0
  314. /package/dist/{sarif-IAGMXA6C.js.map → validate-6R5UBDGU.js.map} +0 -0
@@ -0,0 +1,700 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ PathIndex,
4
+ hasScheme,
5
+ loadConfig,
6
+ resolveRoute,
7
+ routesFrom
8
+ } from "./chunk-CPYQ4BJK.js";
9
+ import {
10
+ guidanceFor,
11
+ isStrategyRule,
12
+ resolveSeverity,
13
+ ruleId
14
+ } from "./chunk-VSDXZAQU.js";
15
+ import {
16
+ PAGE_FIELDS,
17
+ PARENTS,
18
+ STRATEGY_RULES
19
+ } from "./chunk-INOVEO32.js";
20
+ import {
21
+ closestName
22
+ } from "./chunk-XTKJNRJ6.js";
23
+ import {
24
+ declaredAt,
25
+ metaPageView
26
+ } from "./chunk-FXE5K56B.js";
27
+ import {
28
+ RECORD_FIELDS,
29
+ readRecord
30
+ } from "./chunk-LCMBG4LY.js";
31
+ import {
32
+ STDIN_REQUIRES_AS
33
+ } from "./chunk-562QZKAB.js";
34
+ import {
35
+ STDIN_LABEL,
36
+ STDIN_TOKEN,
37
+ assertNonEmpty,
38
+ extractorByName,
39
+ extractorForExtension,
40
+ gitignoreOptions,
41
+ resolveTargetSet,
42
+ supportedExtensions
43
+ } from "./chunk-YB3KD5RI.js";
44
+ import {
45
+ SEVERITIES
46
+ } from "./chunk-77AINBYM.js";
47
+ import {
48
+ findConfigFile,
49
+ readConfigFile,
50
+ selectCollections
51
+ } from "./chunk-JF4BC7ZD.js";
52
+ import {
53
+ ToolError,
54
+ errorMessage
55
+ } from "./chunk-G3T47CFV.js";
56
+
57
+ // src/strategy/core/steps.ts
58
+ import { relative, resolve } from "node:path";
59
+
60
+ // src/strategy/core/check.ts
61
+ var fold = (value) => value.toLowerCase();
62
+ var FIELD_TYPES = RECORD_FIELDS;
63
+ var parentTypeOf = (type) => FIELD_TYPES[PARENTS[type]];
64
+ function indexSet(set) {
65
+ const byType = /* @__PURE__ */ new Map();
66
+ const byId = /* @__PURE__ */ new Map();
67
+ for (const record of set.records) {
68
+ const ids = byType.get(record.type) ?? /* @__PURE__ */ new Map();
69
+ if (!ids.has(fold(record.id))) ids.set(fold(record.id), record);
70
+ byType.set(record.type, ids);
71
+ if (!byId.has(fold(record.id))) byId.set(fold(record.id), record);
72
+ }
73
+ const resolveIn = (type, value) => byType.get(type)?.get(fold(value));
74
+ const parentsOf = (record) => {
75
+ if (record.type === "audience") return [];
76
+ const type = parentTypeOf(record.type);
77
+ const found = record.parents.map((p) => resolveIn(type, p.value)).filter((r) => r !== void 0);
78
+ return [...new Set(found)];
79
+ };
80
+ const children = /* @__PURE__ */ new Map();
81
+ for (const record of set.records) {
82
+ for (const parent of parentsOf(record)) children.set(parent, [...children.get(parent) ?? [], record]);
83
+ }
84
+ const pages = /* @__PURE__ */ new Map();
85
+ for (const reference of set.references) {
86
+ if (reference.record) continue;
87
+ const target2 = resolveIn(FIELD_TYPES[reference.field], reference.value);
88
+ if (target2 === void 0) continue;
89
+ const named = pages.get(target2) ?? /* @__PURE__ */ new Set();
90
+ named.add(reference.page);
91
+ pages.set(target2, named);
92
+ }
93
+ return {
94
+ has: (type) => (byType.get(type)?.size ?? 0) > 0,
95
+ resolve: resolveIn,
96
+ anyWithId: (value) => byId.get(fold(value)),
97
+ parentsOf,
98
+ childrenOf: (record) => children.get(record) ?? [],
99
+ pagesNaming: (record) => [...pages.get(record) ?? []].sort()
100
+ };
101
+ }
102
+ function article(type) {
103
+ return `${type === "audience" ? "an" : "a"} ${type}`;
104
+ }
105
+ function onRecord(record) {
106
+ return record.idAt ?? { file: record.file, line: record.line };
107
+ }
108
+ function located(at) {
109
+ return { file: at.file, ...at.line === void 0 ? {} : { line: at.line } };
110
+ }
111
+ function ancestorOf(index, record, type) {
112
+ let current = index.parentsOf(record)[0];
113
+ while (current !== void 0 && current.type !== type) current = index.parentsOf(current)[0];
114
+ return current;
115
+ }
116
+ function stepDrafts(record, steps, naming, pagePath) {
117
+ const drafts = [];
118
+ for (const step of steps) {
119
+ const on = (at) => located(at ?? { file: step.file, ...step.line === void 0 ? {} : { line: step.line } });
120
+ const about = { ...on(void 0), id: record.id, field: "steps" };
121
+ const n = `step ${String(step.n)}`;
122
+ if (step.state === "broken") {
123
+ drafts.push(
124
+ step.doc === void 0 ? {
125
+ rule: "broken-step",
126
+ message: `${n}: exists: ${String(step.exists)}, but the step has no doc.`,
127
+ fix: "Name its page in doc:, or set exists: false.",
128
+ ...about,
129
+ ...on(step.existsAt)
130
+ } : {
131
+ rule: "broken-step",
132
+ message: `${n}: doc "${step.doc}" names no page.`,
133
+ fix: "Correct doc, or set exists: false if the page does not exist.",
134
+ ...about,
135
+ ...on(step.docAt)
136
+ }
137
+ );
138
+ }
139
+ if (step.state === "unwritten") {
140
+ drafts.push({
141
+ rule: "unwritten-step",
142
+ message: step.doc === void 0 ? `${n}: no page carries this stage.` : `${n}: doc "${step.doc}" names a page that does not exist.`,
143
+ ...about
144
+ });
145
+ }
146
+ if (step.page === void 0) continue;
147
+ if (step.exists === false && step.doc !== void 0) {
148
+ drafts.push({
149
+ rule: "stale-step",
150
+ message: `${n}: exists: false, but doc "${step.doc}" names a page.`,
151
+ fix: "Set exists: true or partial, or drop exists:.",
152
+ ...about,
153
+ ...on(step.existsAt)
154
+ });
155
+ }
156
+ if (!naming.has(step.page)) {
157
+ drafts.push({
158
+ rule: "missing-journey",
159
+ message: `${n}: ${pagePath(step.page)} does not name "${record.id}" in journeys:.`,
160
+ fix: "Add it to that page's journeys:, or point the step at a page that does.",
161
+ ...about,
162
+ ...on(step.docAt)
163
+ });
164
+ }
165
+ }
166
+ return drafts;
167
+ }
168
+ function checkStrategySet(set, opts = {}) {
169
+ const levels = resolveSeverity(opts.severity);
170
+ const index = indexSet(set);
171
+ const drafts = [];
172
+ const steps = opts.steps ?? resolveSteps(set, {}, index);
173
+ for (const [record, resolved] of steps) {
174
+ if (record.lifecycle === "draft" || record.lifecycle === "archived") continue;
175
+ const naming = new Set(index.pagesNaming(record).map((page) => page.replaceAll("\\", "/")));
176
+ drafts.push(...stepDrafts(record, resolved, naming, opts.pagePath ?? ((page) => page)));
177
+ }
178
+ const unresolved = (field, value, onRecordField) => {
179
+ const type = FIELD_TYPES[field];
180
+ const other = index.anyWithId(value);
181
+ if (other !== void 0) {
182
+ const ancestor = ancestorOf(index, other, type);
183
+ const fix2 = ancestor !== void 0 ? `Did you mean its ${type}, "${ancestor.id}"?` : onRecordField ? "Correct the value." : `Move it to ${PAGE_FIELDS[other.type]}:.`;
184
+ return { message: `${field}: "${value}" is ${article(other.type)}, not ${article(type)}.`, fix: fix2 };
185
+ }
186
+ const ids = set.records.filter((r) => r.type === type).map((r) => r.id);
187
+ const nearest = closestName(fold(value), ids.map(fold));
188
+ const suggestion = nearest === void 0 ? void 0 : ids.find((id) => fold(id) === nearest);
189
+ const add = `Correct the value, or add a record with type: ${type} and id: ${value}.`;
190
+ const fix = suggestion === void 0 ? add : onRecordField ? `Did you mean "${suggestion}"?` : `Did you mean "${suggestion}"? ${add}`;
191
+ return { message: `${field}: "${value}" names no ${type}.`, fix };
192
+ };
193
+ for (const reference of set.references) {
194
+ const type = FIELD_TYPES[reference.field];
195
+ if (!index.has(type) || index.resolve(type, reference.value) !== void 0) continue;
196
+ drafts.push({
197
+ rule: "undefined-reference",
198
+ ...unresolved(reference.field, reference.value, false),
199
+ ...located(reference),
200
+ field: reference.field
201
+ });
202
+ }
203
+ for (const record of set.records) {
204
+ if (record.type === "audience") continue;
205
+ const field = PARENTS[record.type];
206
+ const type = parentTypeOf(record.type);
207
+ if (!index.has(type)) continue;
208
+ for (const parent of record.parents) {
209
+ if (index.resolve(type, parent.value) !== void 0) continue;
210
+ drafts.push({
211
+ rule: "undefined-reference",
212
+ ...unresolved(field, parent.value, true),
213
+ ...located(parent),
214
+ id: record.id,
215
+ field
216
+ });
217
+ }
218
+ }
219
+ const sharing = /* @__PURE__ */ new Map();
220
+ for (const record of set.records) sharing.set(fold(record.id), [...sharing.get(fold(record.id)) ?? [], record]);
221
+ for (const group of sharing.values()) {
222
+ if (group.length < 2) continue;
223
+ for (const record of group) {
224
+ const others = group.filter((other) => other !== record).map((other) => {
225
+ const at = onRecord(other);
226
+ return at.line === void 0 ? at.file : `${at.file}:${String(at.line)}`;
227
+ });
228
+ drafts.push({
229
+ rule: "duplicate-id",
230
+ message: `id: "${record.id}" is also the id of ${others.join(", ")}.`,
231
+ fix: "Give each record its own id.",
232
+ ...located(onRecord(record)),
233
+ id: record.id
234
+ });
235
+ }
236
+ }
237
+ const byPage = /* @__PURE__ */ new Map();
238
+ for (const reference of set.references) {
239
+ if (reference.record) continue;
240
+ byPage.set(reference.page, [...byPage.get(reference.page) ?? [], reference]);
241
+ }
242
+ for (const references of byPage.values()) {
243
+ const named = (field) => new Set(references.filter((r) => r.field === field).map((r) => fold(r.value)));
244
+ const reported = /* @__PURE__ */ new Set();
245
+ for (const childType of ["journey", "persona"]) {
246
+ const parentType = parentTypeOf(childType);
247
+ const parentField = PAGE_FIELDS[parentType];
248
+ const has = named(parentField);
249
+ for (const reference of references) {
250
+ if (reference.field !== PAGE_FIELDS[childType]) continue;
251
+ const child = index.resolve(childType, reference.value);
252
+ if (child === void 0) continue;
253
+ const parents = index.parentsOf(child);
254
+ const ids = parents.map((p) => `"${p.id}"`).join(", ");
255
+ const key = `${parentType} ${ids}`;
256
+ if (parents.length === 0 || parents.some((p) => has.has(fold(p.id))) || reported.has(key)) continue;
257
+ reported.add(key);
258
+ const one = parents.length === 1;
259
+ drafts.push({
260
+ rule: "missing-parent",
261
+ message: one ? `${parentField}: does not name ${ids}, the ${parentType} of ${childType} "${child.id}".` : `${parentField}: names none of ${ids}, the ${parentField} of ${childType} "${child.id}".`,
262
+ fix: `Add ${one ? "it" : "one"}, or drop "${child.id}" from ${PAGE_FIELDS[childType]}:.`,
263
+ ...located(reference),
264
+ field: parentField
265
+ });
266
+ }
267
+ }
268
+ }
269
+ for (const record of set.records) {
270
+ const at = located(onRecord(record));
271
+ if (record.type !== "audience" && record.parents.length === 0 && index.has(parentTypeOf(record.type))) {
272
+ const field = PARENTS[record.type];
273
+ drafts.push({
274
+ rule: "orphan-record",
275
+ message: `${field}: missing, so this ${record.type} belongs to no ${parentTypeOf(record.type)}.`,
276
+ fix: `Name one with ${field}:.`,
277
+ ...at,
278
+ id: record.id,
279
+ field
280
+ });
281
+ }
282
+ if (index.resolve(record.type, record.id) !== record) continue;
283
+ const pages = index.pagesNaming(record);
284
+ const live = record.lifecycle !== "draft" && record.lifecycle !== "archived";
285
+ if (record.type === "journey" && live && pages.length === 0) {
286
+ drafts.push({
287
+ rule: "unserved-journey",
288
+ message: "no page names this journey in journeys:.",
289
+ fix: "Name it on the pages that serve it.",
290
+ ...at,
291
+ id: record.id
292
+ });
293
+ }
294
+ if (record.type !== "journey" && pages.length === 0 && index.childrenOf(record).length === 0) {
295
+ drafts.push({
296
+ rule: "unused-record",
297
+ message: `no page and no record names this ${record.type}.`,
298
+ ...at,
299
+ id: record.id
300
+ });
301
+ }
302
+ }
303
+ const findings = [];
304
+ for (const draft of drafts) {
305
+ const level = levels[draft.rule];
306
+ if (level === "off") continue;
307
+ findings.push({
308
+ rule: draft.rule,
309
+ ruleId: ruleId(draft.rule),
310
+ severity: level,
311
+ message: draft.fix === void 0 ? draft.message : `${draft.message} ${draft.fix}`,
312
+ ...draft.fix === void 0 ? {} : { key: draft.message },
313
+ guidance: guidanceFor(draft.rule),
314
+ file: draft.file,
315
+ ...draft.line === void 0 ? {} : { line: draft.line },
316
+ ...draft.id === void 0 ? {} : { id: draft.id },
317
+ ...draft.field === void 0 ? {} : { field: draft.field }
318
+ });
319
+ }
320
+ return findings.sort(compareFindings);
321
+ }
322
+ function compareText(a, b) {
323
+ return a < b ? -1 : a > b ? 1 : 0;
324
+ }
325
+ function compareFindings(a, b) {
326
+ return compareText(a.file, b.file) || (a.line ?? 0) - (b.line ?? 0) || compareText(a.ruleId, b.ruleId) || compareText(a.message, b.message);
327
+ }
328
+
329
+ // src/strategy/core/steps.ts
330
+ var posix = (path) => path.replaceAll("\\", "/");
331
+ function target(doc) {
332
+ return doc.split(/[?#]/, 1)[0] ?? "";
333
+ }
334
+ function isRoute(doc) {
335
+ return target(doc).startsWith("/");
336
+ }
337
+ function stepsNeedRoutes(set) {
338
+ return set.records.some((r) => r.steps?.some((s) => s.doc !== void 0 && isRoute(s.doc)) === true);
339
+ }
340
+ function locate(doc, pages, index, ctx) {
341
+ if (hasScheme(doc)) return "unchecked";
342
+ const path = target(doc);
343
+ if (path.startsWith("/")) {
344
+ const found = resolveRoute(path, ctx.routes ?? [], index);
345
+ if (found === null) return "unchecked";
346
+ return found === "broken" ? "none" : { page: found };
347
+ }
348
+ const label = ctx.from === void 0 || ctx.base === void 0 ? path : relative(ctx.base, resolve(ctx.from, path));
349
+ const wanted = posix(label);
350
+ return pages.has(wanted) ? { page: wanted } : "none";
351
+ }
352
+ function stateOf(step, found, served) {
353
+ if (found === void 0) return step.exists === true || step.exists === "partial" ? "broken" : "unwritten";
354
+ if (found === "unchecked") return step.exists === false ? "unwritten" : "unchecked";
355
+ if (found === "none") return step.exists === false ? "unwritten" : "broken";
356
+ if (step.exists === "partial") return "partial";
357
+ return served ? "served" : "unclaimed";
358
+ }
359
+ function resolveSteps(set, ctx = {}, index = indexSet(set)) {
360
+ const pages = new Set((set.pages ?? []).map(posix));
361
+ const routeIndex = new PathIndex(pages);
362
+ const out = /* @__PURE__ */ new Map();
363
+ for (const record of set.records) {
364
+ if (record.type !== "journey" || record.steps === void 0) continue;
365
+ const naming = new Set(index.pagesNaming(record).map(posix));
366
+ out.set(
367
+ record,
368
+ record.steps.map((step) => {
369
+ const found = step.doc === void 0 ? void 0 : locate(step.doc, pages, routeIndex, ctx);
370
+ const page = typeof found === "object" ? found.page : void 0;
371
+ const state = stateOf(step, found, page !== void 0 && naming.has(page));
372
+ return { ...step, state, ...page === void 0 ? {} : { page } };
373
+ })
374
+ );
375
+ }
376
+ return out;
377
+ }
378
+ function coverageOf(steps) {
379
+ return { served: steps.filter((s) => s.state === "served").length, steps: steps.length };
380
+ }
381
+
382
+ // src/strategy/errors.ts
383
+ var StrategyError = class extends ToolError {
384
+ constructor(message) {
385
+ super(message);
386
+ this.name = "StrategyError";
387
+ }
388
+ };
389
+
390
+ // src/strategy/core/config.ts
391
+ import { resolve as resolve2 } from "node:path";
392
+ var STRATEGY_SECTION = "strategy";
393
+ var DEFAULT_STRATEGY_BASELINE_PATH = ".manni-strategy-baseline.json";
394
+ var CONFIG_KEYS = ["severity", "baseline", "allowEmpty", "respectGitignore"];
395
+ var COLLECTION_KEYS = ["paths", "exclude"];
396
+ var SEVERITY_LEVELS = [...SEVERITIES, "off"];
397
+ var CONFIG_FILE = {
398
+ section: STRATEGY_SECTION,
399
+ legacyNames: [],
400
+ toError: (message) => new StrategyError(message)
401
+ };
402
+ function isMapping(value) {
403
+ return typeof value === "object" && value !== null && !Array.isArray(value);
404
+ }
405
+ function isLevel(value) {
406
+ return typeof value === "string" && SEVERITY_LEVELS.includes(value);
407
+ }
408
+ function rejectUnknownKeys(obj, allowed, where, source) {
409
+ for (const key of Object.keys(obj)) {
410
+ if (!allowed.includes(key)) {
411
+ throw new StrategyError(`Unknown key "${key}" under ${where}: in ${source}. Supported keys: ${allowed.join(", ")}.`);
412
+ }
413
+ }
414
+ }
415
+ function wrongType(key, expected, source) {
416
+ return new StrategyError(`strategy.${key} in ${source} must be ${expected}.`);
417
+ }
418
+ function asBoolean(value, key, source) {
419
+ if (typeof value !== "boolean") throw wrongType(key, "a boolean", source);
420
+ return value;
421
+ }
422
+ function parseSeverity(value, source) {
423
+ if (!isMapping(value)) throw wrongType("severity", "a mapping", source);
424
+ rejectUnknownKeys(value, STRATEGY_RULES, "strategy.severity", source);
425
+ const severity = {};
426
+ for (const [rule, level] of Object.entries(value)) {
427
+ if (!isStrategyRule(rule)) continue;
428
+ if (!isLevel(level)) {
429
+ const quoted = typeof level === "string" ? ` "${level}"` : "";
430
+ throw new StrategyError(
431
+ `${source}: strategy.severity.${rule}${quoted} is not a level. Expected ${SEVERITY_LEVELS.join(" | ")}.`
432
+ );
433
+ }
434
+ severity[rule] = level;
435
+ }
436
+ return severity;
437
+ }
438
+ function parseStrategyConfig(raw, source) {
439
+ if (raw == null) return {};
440
+ if (!isMapping(raw)) throw new StrategyError(`strategy: in ${source} must be a mapping.`);
441
+ for (const key of COLLECTION_KEYS) {
442
+ if (Object.hasOwn(raw, key)) {
443
+ throw new StrategyError(`${source}: strategy does not carry "${key}". Name a collection under collections:.`);
444
+ }
445
+ }
446
+ rejectUnknownKeys(raw, CONFIG_KEYS, "strategy", source);
447
+ const config = {};
448
+ if (raw.severity !== void 0) config.severity = parseSeverity(raw.severity, source);
449
+ if (raw.baseline !== void 0) {
450
+ if (typeof raw.baseline !== "string") throw wrongType("baseline", "a string", source);
451
+ config.baseline = raw.baseline;
452
+ }
453
+ if (raw.allowEmpty !== void 0) config.allowEmpty = asBoolean(raw.allowEmpty, "allowEmpty", source);
454
+ if (raw.respectGitignore !== void 0) {
455
+ config.respectGitignore = asBoolean(raw.respectGitignore, "respectGitignore", source);
456
+ }
457
+ return config;
458
+ }
459
+ var STDIN = "-";
460
+ async function resolveStrategyRun(opts) {
461
+ const cwd = resolve2(opts.cwd);
462
+ const wanted = opts.collection ?? [];
463
+ if (wanted.length > 0 && opts.inputs.some((input) => input !== STDIN)) {
464
+ throw new StrategyError("--collection selects a configured collection; it cannot be combined with paths.");
465
+ }
466
+ const file = opts.configPath ? await readConfigFile(opts.configPath, cwd, CONFIG_FILE) : await findConfigFile(cwd, CONFIG_FILE);
467
+ if (wanted.length > 0 && file === null) {
468
+ throw new StrategyError("--collection needs a config file to select from.");
469
+ }
470
+ const config = file === null ? null : parseStrategyConfig(file.value, file.source);
471
+ const collections = file ? selectCollections(file.collections, wanted, file.source, (message) => new StrategyError(message)) : [];
472
+ const fromCollections = opts.inputs.length === 0;
473
+ const inputs = fromCollections ? collections.flatMap((c) => c.paths) : opts.inputs;
474
+ const base = fromCollections && inputs.length > 0 && file ? file.dir : cwd;
475
+ return {
476
+ config,
477
+ inputs,
478
+ base,
479
+ collections,
480
+ fromCollections,
481
+ ...file ? { configDir: file.dir, configPath: file.path, configSource: file.source, configFile: file } : {}
482
+ };
483
+ }
484
+
485
+ // src/strategy/commands/run.ts
486
+ import { isAbsolute, relative as relative2, resolve as resolve4 } from "node:path";
487
+
488
+ // src/strategy/core/load-set.ts
489
+ import { readFile } from "node:fs/promises";
490
+ import { extname, resolve as resolve3 } from "node:path";
491
+ function text(value) {
492
+ return typeof value === "string" && value.trim() !== "" ? value : void 0;
493
+ }
494
+ function extract(content, label, path, format) {
495
+ const extractor = extractorByName(format);
496
+ if (extractor === void 0) throw new StrategyError(`${label}: no reader for format "${format}".`);
497
+ try {
498
+ return { label, extracted: extractor.extract(content, path ?? label) };
499
+ } catch (error) {
500
+ throw new StrategyError(`${label}: could not be read as ${format}: ${errorMessage(error)}`);
501
+ }
502
+ }
503
+ async function readInput(path, label) {
504
+ try {
505
+ return await readFile(path, "utf8");
506
+ } catch (error) {
507
+ throw new StrategyError(`${label}: could not be read: ${errorMessage(error)}`);
508
+ }
509
+ }
510
+ async function extractAll(opts, allowEmpty) {
511
+ const { run } = opts;
512
+ const exclude = opts.exclude ?? [];
513
+ const usingStdin = run.inputs.includes(STDIN_TOKEN);
514
+ const inputs = run.inputs.filter((input) => input !== STDIN_TOKEN);
515
+ if (usingStdin && (opts.as === void 0 || opts.as === "")) throw new StrategyError(STDIN_REQUIRES_AS);
516
+ if (inputs.length === 0 && !usingStdin) {
517
+ throw new StrategyError(
518
+ "No files to read. Pass paths/globs, or declare a collection under `collections:` in manni.config.yaml."
519
+ );
520
+ }
521
+ const out = [];
522
+ if (inputs.length > 0) {
523
+ const { files, gitignoreSkipped } = await resolveTargetSet({
524
+ inputs,
525
+ cwd: run.base,
526
+ exclude,
527
+ exts: opts.exts ?? supportedExtensions(),
528
+ allowEmpty,
529
+ ...gitignoreOptions({
530
+ ...opts.noGitignore === true ? { flag: false } : {},
531
+ ...run.config?.respectGitignore === void 0 ? {} : { configured: run.config.respectGitignore },
532
+ ...opts.onNotice ? { onNotice: opts.onNotice } : {}
533
+ })
534
+ });
535
+ assertNonEmpty({
536
+ files,
537
+ inputs,
538
+ usingStdin,
539
+ allowEmpty,
540
+ exclude,
541
+ ...opts.exts === void 0 ? {} : { exts: opts.exts },
542
+ gitignoreSkipped,
543
+ action: "read"
544
+ });
545
+ for (const file of files) {
546
+ const extractor = extractorForExtension(extname(file));
547
+ if (extractor === void 0) {
548
+ throw new StrategyError(`${file}: no reader for its extension. Pass --as <format> through stdin to read it.`);
549
+ }
550
+ const path = resolve3(run.base, file);
551
+ out.push(extract(await readInput(path, file), file, path, extractor.name));
552
+ }
553
+ }
554
+ if (usingStdin && opts.as !== void 0) out.push(extract(opts.stdin ?? "", STDIN_LABEL, void 0, opts.as));
555
+ return out;
556
+ }
557
+ function valuesOf(data, field) {
558
+ const raw = data[field];
559
+ if (typeof raw === "string") return raw.trim() === "" ? [] : [{ value: raw, pointer: `/${field}` }];
560
+ if (!Array.isArray(raw)) return [];
561
+ return raw.flatMap(
562
+ (item, i) => typeof item === "string" && item.trim() !== "" ? [{ value: item, pointer: `/${field}/${String(i)}` }] : []
563
+ );
564
+ }
565
+ function stepsOf(data, at) {
566
+ const raw = data["steps"];
567
+ if (!Array.isArray(raw)) return [];
568
+ return raw.flatMap((item, i) => {
569
+ if (typeof item !== "object" || item === null || Array.isArray(item)) return [];
570
+ const fields = item;
571
+ const pointer = `/steps/${String(i)}`;
572
+ const stage = text(fields["stage"]);
573
+ const doc = text(fields["doc"]);
574
+ const note = text(fields["note"]);
575
+ const exists = fields["exists"];
576
+ const known = exists === true || exists === false || exists === "partial" ? exists : void 0;
577
+ return [
578
+ {
579
+ n: i + 1,
580
+ ...stage === void 0 ? {} : { stage },
581
+ ...doc === void 0 ? {} : { doc },
582
+ ...known === void 0 ? {} : { exists: known },
583
+ ...note === void 0 ? {} : { note },
584
+ ...at(pointer),
585
+ ...doc === void 0 ? {} : { docAt: at(`${pointer}/doc`) },
586
+ ...known === void 0 ? {} : { existsAt: at(`${pointer}/exists`) }
587
+ }
588
+ ];
589
+ });
590
+ }
591
+ async function loadStrategySet(opts) {
592
+ const { run } = opts;
593
+ const allowEmpty = opts.allowEmpty ?? run.config?.allowEmpty === true;
594
+ const inputs = await extractAll(opts, allowEmpty);
595
+ const view = await metaPageView({
596
+ cwd: run.base,
597
+ ...run.configPath === void 0 ? { noConfig: true } : { configPath: run.configPath },
598
+ pages: inputs.filter((i) => i.label !== STDIN_LABEL).map((i) => resolve3(run.base, i.label))
599
+ });
600
+ const pages = [];
601
+ const set = { records: [], references: [], pages };
602
+ for (const { label, extracted } of inputs) {
603
+ const merged = await view.merge(label, extracted);
604
+ const data = merged.extracted.data;
605
+ const at = (pointer) => declaredAt(label, pointer, { extracted: merged.extracted, locate: merged.locate });
606
+ const declares = readRecord(data, label);
607
+ const type = declares?.type;
608
+ const isRecord = declares !== void 0;
609
+ if (declares !== void 0) {
610
+ const declaredId = text(data["id"]);
611
+ const title = text(data["title"]);
612
+ const description = text(data["description"]);
613
+ const lifecycle = text(data["lifecycle"]);
614
+ const steps = type === "journey" ? stepsOf(data, at) : [];
615
+ const record = {
616
+ id: declares.id,
617
+ type: declares.type,
618
+ ...title === void 0 ? {} : { title },
619
+ ...description === void 0 ? {} : { description },
620
+ ...lifecycle === void 0 ? {} : { lifecycle },
621
+ file: label,
622
+ line: 1,
623
+ ...declaredId === void 0 ? {} : { idAt: at("/id") },
624
+ parents: declares.type === "audience" ? [] : valuesOf(data, PARENTS[declares.type]).map(({ value, pointer }) => ({ value, ...at(pointer) })),
625
+ ...steps.length === 0 ? {} : { steps }
626
+ };
627
+ set.records.push(record);
628
+ } else {
629
+ pages.push(label);
630
+ }
631
+ const parentField = type !== void 0 && type !== "audience" ? PARENTS[type] : void 0;
632
+ for (const field of Object.values(PAGE_FIELDS)) {
633
+ if (field === parentField) continue;
634
+ for (const { value, pointer } of valuesOf(data, field)) {
635
+ const reference = { field, value, page: label, record: isRecord, ...at(pointer) };
636
+ set.references.push(reference);
637
+ }
638
+ }
639
+ }
640
+ if (set.records.length === 0 && !allowEmpty) {
641
+ throw new StrategyError(
642
+ "no strategy records found. A record is a page declaring type: audience, type: persona or type: journey."
643
+ );
644
+ }
645
+ return set;
646
+ }
647
+
648
+ // src/strategy/commands/run.ts
649
+ async function loadStrategy(opts) {
650
+ const cwd = resolve4(opts.cwd ?? process.cwd());
651
+ const run = await resolveStrategyRun({
652
+ cwd,
653
+ inputs: opts.inputs,
654
+ ...opts.configPath === void 0 ? {} : { configPath: opts.configPath },
655
+ ...opts.collection === void 0 ? {} : { collection: opts.collection }
656
+ });
657
+ const exclude = [
658
+ .../* @__PURE__ */ new Set([...opts.exclude ?? [], ...run.fromCollections ? run.collections.flatMap((c) => c.exclude) : []])
659
+ ];
660
+ const set = await loadStrategySet({
661
+ run,
662
+ exclude,
663
+ ...opts.exts === void 0 ? {} : { exts: opts.exts },
664
+ ...opts.allowEmpty === true ? { allowEmpty: true } : {},
665
+ ...opts.noGitignore === true ? { noGitignore: true } : {},
666
+ ...opts.stdin === void 0 ? {} : { stdin: opts.stdin },
667
+ ...opts.as === void 0 ? {} : { as: opts.as },
668
+ ...opts.onNotice === void 0 ? {} : { onNotice: opts.onNotice }
669
+ });
670
+ const routes = stepsNeedRoutes(set) && run.configPath !== void 0 ? routesFrom(loadConfig(run.configPath, cwd), run.base) : [];
671
+ const steps = resolveSteps(set, { routes, from: run.configDir ?? cwd, base: run.base });
672
+ return { cwd, run, set, steps };
673
+ }
674
+ function formatChoice(value, allowed) {
675
+ const found = allowed.find((candidate) => candidate === value);
676
+ if (found === void 0) throw new StrategyError(`unknown format "${value}". Expected ${allowed.join(" | ")}.`);
677
+ return found;
678
+ }
679
+ function displayPath(path, cwd, base = cwd) {
680
+ if (path.startsWith("<")) return path;
681
+ const rel = relative2(cwd, isAbsolute(path) ? path : resolve4(base, path));
682
+ return (rel === "" ? "." : rel).replaceAll("\\", "/");
683
+ }
684
+ function plural(n, one, many = `${one}s`) {
685
+ return `${String(n)} ${n === 1 ? one : many}`;
686
+ }
687
+
688
+ export {
689
+ resolveSteps,
690
+ coverageOf,
691
+ indexSet,
692
+ checkStrategySet,
693
+ StrategyError,
694
+ DEFAULT_STRATEGY_BASELINE_PATH,
695
+ loadStrategy,
696
+ formatChoice,
697
+ displayPath,
698
+ plural
699
+ };
700
+ //# sourceMappingURL=chunk-K5LBIAOM.js.map