@hawkeyexl/manni 4.20.0 → 4.21.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 (259) hide show
  1. package/README.md +1 -1
  2. package/dist/{batch-TBQBH6XQ.js → batch-C534YIAU.js} +14 -14
  3. package/dist/{build-S3JQMDFX.js → build-SVKT7QFU.js} +16 -15
  4. package/dist/{calibrate-KLN22IGS.js → calibrate-AL3MH7TY.js} +15 -15
  5. package/dist/{capture-JS3ICXE7.js → capture-2F7B4DAD.js} +14 -14
  6. package/dist/check-BI7OGIVE.js +48 -0
  7. package/dist/{check-WS2USSUD.js → check-JZINDP3F.js} +13 -13
  8. package/dist/{check-2EAR4ZW3.js → check-LKPQPQWJ.js} +15 -15
  9. package/dist/check-OPUMZEVK.js +35 -0
  10. package/dist/{check-PDXYA6XH.js → check-OW7UD73D.js} +12 -12
  11. package/dist/{chunk-JKH2LV5D.js → chunk-22WGKOQ7.js} +5 -5
  12. package/dist/{chunk-IGAZWY2W.js → chunk-2HOWRAWK.js} +2 -2
  13. package/dist/{chunk-KZ7534CD.js → chunk-2NGFDLIM.js} +3 -3
  14. package/dist/{chunk-SOW6SVAM.js → chunk-2YKUSTHS.js} +4 -4
  15. package/dist/{chunk-DQO44Y5G.js → chunk-3SFAB75L.js} +5 -5
  16. package/dist/{chunk-BEQZI3V5.js → chunk-5LE4NH3Z.js} +24 -7
  17. package/dist/chunk-5LE4NH3Z.js.map +1 -0
  18. package/dist/{chunk-U2CE55YV.js → chunk-5UJKXOAD.js} +5 -5
  19. package/dist/chunk-6XK3NTL5.js +706 -0
  20. package/dist/chunk-6XK3NTL5.js.map +1 -0
  21. package/dist/{chunk-6D7FCU4E.js → chunk-762MM6NA.js} +3 -3
  22. package/dist/{chunk-ZEKQRBXO.js → chunk-A4QNKEX4.js} +2 -2
  23. package/dist/{chunk-2G4XYGTN.js → chunk-AE6KBAAU.js} +7 -7
  24. package/dist/chunk-AE6KBAAU.js.map +1 -0
  25. package/dist/{chunk-SX626JUF.js → chunk-APAF4VWW.js} +3 -3
  26. package/dist/{chunk-BV7FJ4V2.js → chunk-ARNI3SJT.js} +8 -8
  27. package/dist/chunk-ARNI3SJT.js.map +1 -0
  28. package/dist/{chunk-DTSWP5FC.js → chunk-BHGFLRXM.js} +5 -5
  29. package/dist/{chunk-PGDUVYTF.js → chunk-BJUEOC4G.js} +2 -2
  30. package/dist/{chunk-5MJE5KMY.js → chunk-BKY6GAFA.js} +8 -8
  31. package/dist/{chunk-ITA7V5Y2.js → chunk-BLXRIAV2.js} +4 -4
  32. package/dist/{chunk-SFSALDIR.js → chunk-BXCVOHEX.js} +7 -7
  33. package/dist/{chunk-PHOWMWFJ.js → chunk-BXE4L52Q.js} +2 -11
  34. package/dist/chunk-BXE4L52Q.js.map +1 -0
  35. package/dist/{chunk-VCU7OMXV.js → chunk-CLPC3LKX.js} +13 -9
  36. package/dist/chunk-CLPC3LKX.js.map +1 -0
  37. package/dist/{chunk-PTXHJLAS.js → chunk-CREFJCWZ.js} +7 -7
  38. package/dist/chunk-CREFJCWZ.js.map +1 -0
  39. package/dist/{chunk-FRM62BEN.js → chunk-CZIO37J5.js} +3 -3
  40. package/dist/{chunk-SFTWEGUD.js → chunk-D4QHRVDJ.js} +2 -2
  41. package/dist/{chunk-6VGWLCYT.js → chunk-D5GBYKDU.js} +2 -2
  42. package/dist/{chunk-RXCDT55X.js → chunk-DENZLZ3Z.js} +34 -32
  43. package/dist/chunk-DENZLZ3Z.js.map +1 -0
  44. package/dist/{chunk-GVOI7SCF.js → chunk-DMVBIIP3.js} +3 -3
  45. package/dist/{chunk-5HB4YKZW.js → chunk-DPDG3FHL.js} +17 -3
  46. package/dist/chunk-DPDG3FHL.js.map +1 -0
  47. package/dist/{chunk-O26NQ7KT.js → chunk-E23KWEPL.js} +2 -2
  48. package/dist/{chunk-NDQA4VYK.js → chunk-E7OG5F6S.js} +3 -3
  49. package/dist/{chunk-HIZNNOVW.js → chunk-FHJIH6XP.js} +16 -106
  50. package/dist/chunk-FHJIH6XP.js.map +1 -0
  51. package/dist/{chunk-JNMY7KZG.js → chunk-G5I2JTDK.js} +2 -2
  52. package/dist/{chunk-O4O6JOGD.js → chunk-GMLOAKOA.js} +16 -4
  53. package/dist/chunk-GMLOAKOA.js.map +1 -0
  54. package/dist/{chunk-4KM23E53.js → chunk-H5YWCCBO.js} +16 -11
  55. package/dist/chunk-H5YWCCBO.js.map +1 -0
  56. package/dist/{chunk-HSC5G3FW.js → chunk-HHJ2HFPP.js} +8 -8
  57. package/dist/{chunk-HZWLHSZG.js → chunk-IN5T22FP.js} +2 -2
  58. package/dist/{chunk-FERFWKZM.js → chunk-IOJD2RFG.js} +2 -2
  59. package/dist/{chunk-ZODSGFAP.js → chunk-JQA6RF4R.js} +22 -22
  60. package/dist/{chunk-ZODSGFAP.js.map → chunk-JQA6RF4R.js.map} +1 -1
  61. package/dist/{chunk-GCF7STEA.js → chunk-JUUCCML3.js} +4 -4
  62. package/dist/{chunk-3OXBZSDN.js → chunk-KBSTXL6L.js} +3 -3
  63. package/dist/{chunk-SRTBHEUM.js → chunk-KCWNJMSS.js} +3 -3
  64. package/dist/{chunk-2XRSQXGZ.js → chunk-KQDRO6N6.js} +2 -2
  65. package/dist/{chunk-ZVEDBFTM.js → chunk-LWBNHK72.js} +45 -41
  66. package/dist/chunk-LWBNHK72.js.map +1 -0
  67. package/dist/{chunk-QSY5YPM4.js → chunk-MTCOBRCX.js} +4 -4
  68. package/dist/{chunk-Q5EKERQS.js → chunk-NLJ3XIKT.js} +7 -5
  69. package/dist/{chunk-Q5EKERQS.js.map → chunk-NLJ3XIKT.js.map} +1 -1
  70. package/dist/{chunk-RGZBROMW.js → chunk-OWJLB2AF.js} +2 -2
  71. package/dist/{chunk-QA7AXRGH.js → chunk-P7HAXMFN.js} +2 -2
  72. package/dist/{chunk-GXDVERLV.js → chunk-PACZEDOH.js} +5 -5
  73. package/dist/{chunk-QSPH4F56.js → chunk-PTGXEZQD.js} +2 -2
  74. package/dist/chunk-PTGXEZQD.js.map +1 -0
  75. package/dist/{chunk-UKSXQHSE.js → chunk-Q76T6Y6X.js} +6 -6
  76. package/dist/{chunk-SGI3WPYK.js → chunk-R2CR62JV.js} +4 -4
  77. package/dist/{chunk-MLY65CQE.js → chunk-RKACUTY5.js} +7 -7
  78. package/dist/{chunk-MNK732BZ.js → chunk-RQPEKHZH.js} +14 -11
  79. package/dist/chunk-RQPEKHZH.js.map +1 -0
  80. package/dist/{chunk-EBYLQE7P.js → chunk-RWXR3GJI.js} +2 -2
  81. package/dist/{chunk-JOZVVIVD.js → chunk-S5G6T4VC.js} +3 -3
  82. package/dist/chunk-SHXPE4D4.js +100 -0
  83. package/dist/chunk-SHXPE4D4.js.map +1 -0
  84. package/dist/{chunk-GL2HXZVX.js → chunk-TFVNEPMF.js} +3 -3
  85. package/dist/{chunk-TKINOTVS.js → chunk-TI4DA6DF.js} +1 -1
  86. package/dist/{chunk-TKINOTVS.js.map → chunk-TI4DA6DF.js.map} +1 -1
  87. package/dist/{chunk-I62V2ZAJ.js → chunk-U4OJ7U45.js} +8 -8
  88. package/dist/{chunk-QWCP7UMG.js → chunk-V2XJJEEF.js} +6 -6
  89. package/dist/{chunk-5UJQLZXY.js → chunk-VLRIP4BQ.js} +60 -63
  90. package/dist/chunk-VLRIP4BQ.js.map +1 -0
  91. package/dist/{chunk-ZRMA5U53.js → chunk-WHVFHBL3.js} +3 -3
  92. package/dist/{chunk-IYRGV2BC.js → chunk-XBJKYXOR.js} +6 -6
  93. package/dist/{chunk-ZBE735BH.js → chunk-XI3BNZG4.js} +5 -5
  94. package/dist/{chunk-Z6FATXBE.js → chunk-YSZNJ2ID.js} +2 -2
  95. package/dist/{cli-4HH6IY2L.js → cli-3PBRPPMQ.js} +14 -14
  96. package/dist/{cli-GVHXRQAD.js → cli-6NKE6RMT.js} +18 -18
  97. package/dist/{cli-T4NY2EGM.js → cli-77A46SB2.js} +17 -17
  98. package/dist/{cli-EQG4KETY.js → cli-AVHLY2AI.js} +61 -45
  99. package/dist/cli-AVHLY2AI.js.map +1 -0
  100. package/dist/{cli-UIY57JPM.js → cli-FDXU7CGZ.js} +16 -15
  101. package/dist/{cli-UIY57JPM.js.map → cli-FDXU7CGZ.js.map} +1 -1
  102. package/dist/{cli-5BFVL3DH.js → cli-FSDJY5OC.js} +2 -2
  103. package/dist/{cli-L7H4C442.js → cli-JNYL6LB7.js} +16 -16
  104. package/dist/{cli-HTAR3PWY.js → cli-K47XWDLJ.js} +21 -21
  105. package/dist/{cli-ZPW5VIRA.js → cli-LP5OE3BL.js} +9 -9
  106. package/dist/{cli-AR43H5BW.js → cli-MOKRUHZT.js} +9 -9
  107. package/dist/{cli-4IE6CRAT.js → cli-MQXOK64K.js} +27 -26
  108. package/dist/{cli-4IE6CRAT.js.map → cli-MQXOK64K.js.map} +1 -1
  109. package/dist/cli.js +15 -15
  110. package/dist/{config-7I5CHHRZ.js → config-BMWDC66C.js} +2 -2
  111. package/dist/docmeta.d.ts +1 -1
  112. package/dist/docmeta.js +8 -8
  113. package/dist/github-6GYTPSGV.js +35 -0
  114. package/dist/{github-RIU47U73.js → github-DJOLVNDD.js} +12 -12
  115. package/dist/{github-CMWG4QMI.js → github-ZF2TQ3RP.js} +14 -14
  116. package/dist/graph/embed.d.ts +2 -1
  117. package/dist/graph/runtime.d.ts +2 -1
  118. package/dist/index.d.ts +29 -15
  119. package/dist/index.js +51 -49
  120. package/dist/index.js.map +1 -1
  121. package/dist/json-Y7625EFE.js +42 -0
  122. package/dist/{json-KSBVGZUX.js → json-YIK72XAL.js} +12 -12
  123. package/dist/{labels-VNKACCAG.js → labels-X633ZPK7.js} +11 -11
  124. package/dist/{lint-75BD6L5T.js → lint-RF3B55W7.js} +14 -14
  125. package/dist/{list-MH54XU7E.js → list-5DW4QZ7P.js} +12 -12
  126. package/dist/list-7CHWJ633.js +39 -0
  127. package/dist/{list-PHNZAYIM.js → list-UNWG6NPD.js} +12 -12
  128. package/dist/{page-5AJS7AEM.js → page-OMPEACUN.js} +11 -11
  129. package/dist/{prepare-R63RJI6O.js → prepare-B4JVDVOV.js} +13 -13
  130. package/dist/{pretty-DE4WXJFA.js → pretty-PPNHHOEN.js} +13 -13
  131. package/dist/{pretty-E3DS32NZ.js → pretty-U7ATCFBN.js} +12 -12
  132. package/dist/pretty-XGYQ25PH.js +43 -0
  133. package/dist/{reporters-V2PSDBVW.js → reporters-FAIEOTC4.js} +13 -13
  134. package/dist/{reporters-DLMLFLKS.js → reporters-KE7AZR6C.js} +4 -4
  135. package/dist/{run-QT2LVHRU.js → run-MHJ3AYKG.js} +12 -12
  136. package/dist/{sarif-GKMUHCZB.js → sarif-DOGRSGTB.js} +10 -10
  137. package/dist/{sarif-HUIRTPSL.js → sarif-MIEMQOIK.js} +11 -11
  138. package/dist/{sarif-2ZKPRT42.js → sarif-RGRG7VFX.js} +15 -15
  139. package/dist/{strategy-TBFM7NZU.js → strategy-EK5VY5DG.js} +24 -23
  140. package/dist/{strategy-TBFM7NZU.js.map → strategy-EK5VY5DG.js.map} +1 -1
  141. package/dist/{term-ZZWAVUW5.js → term-MDN3NJDW.js} +17 -17
  142. package/dist/{validate-ZEUFF3BG.js → validate-QDYQ642J.js} +5 -5
  143. package/package.json +21 -21
  144. package/plugin/manni/.claude-plugin/plugin.json +11 -3
  145. package/plugin/manni/hooks/hooks.json +4 -4
  146. package/plugin/manni/hooks/manni.mjs +47 -7
  147. package/plugin/manni/hooks/tracevals.mjs +7 -0
  148. package/plugin/manni/skills/fix/SKILL.md +5 -1
  149. package/dist/check-6D2JCIMD.js +0 -47
  150. package/dist/check-RNAB7X74.js +0 -33
  151. package/dist/chunk-2G4XYGTN.js.map +0 -1
  152. package/dist/chunk-4KM23E53.js.map +0 -1
  153. package/dist/chunk-5HB4YKZW.js.map +0 -1
  154. package/dist/chunk-5UJQLZXY.js.map +0 -1
  155. package/dist/chunk-BEQZI3V5.js.map +0 -1
  156. package/dist/chunk-BV7FJ4V2.js.map +0 -1
  157. package/dist/chunk-HIZNNOVW.js.map +0 -1
  158. package/dist/chunk-MNK732BZ.js.map +0 -1
  159. package/dist/chunk-NEO2HN2N.js +0 -326
  160. package/dist/chunk-NEO2HN2N.js.map +0 -1
  161. package/dist/chunk-O4O6JOGD.js.map +0 -1
  162. package/dist/chunk-PHOWMWFJ.js.map +0 -1
  163. package/dist/chunk-PTXHJLAS.js.map +0 -1
  164. package/dist/chunk-QSPH4F56.js.map +0 -1
  165. package/dist/chunk-RXCDT55X.js.map +0 -1
  166. package/dist/chunk-SIREOHLW.js +0 -233
  167. package/dist/chunk-SIREOHLW.js.map +0 -1
  168. package/dist/chunk-VCU7OMXV.js.map +0 -1
  169. package/dist/chunk-ZVEDBFTM.js.map +0 -1
  170. package/dist/cli-EQG4KETY.js.map +0 -1
  171. package/dist/github-NIRLMJ65.js +0 -27
  172. package/dist/json-EJTB7XYG.js +0 -34
  173. package/dist/list-6XVIW3RW.js +0 -33
  174. package/dist/pretty-SUKMF6AB.js +0 -35
  175. /package/dist/{batch-TBQBH6XQ.js.map → batch-C534YIAU.js.map} +0 -0
  176. /package/dist/{build-S3JQMDFX.js.map → build-SVKT7QFU.js.map} +0 -0
  177. /package/dist/{calibrate-KLN22IGS.js.map → calibrate-AL3MH7TY.js.map} +0 -0
  178. /package/dist/{capture-JS3ICXE7.js.map → capture-2F7B4DAD.js.map} +0 -0
  179. /package/dist/{check-6D2JCIMD.js.map → check-BI7OGIVE.js.map} +0 -0
  180. /package/dist/{check-PDXYA6XH.js.map → check-JZINDP3F.js.map} +0 -0
  181. /package/dist/{check-2EAR4ZW3.js.map → check-LKPQPQWJ.js.map} +0 -0
  182. /package/dist/{check-RNAB7X74.js.map → check-OPUMZEVK.js.map} +0 -0
  183. /package/dist/{check-WS2USSUD.js.map → check-OW7UD73D.js.map} +0 -0
  184. /package/dist/{chunk-JKH2LV5D.js.map → chunk-22WGKOQ7.js.map} +0 -0
  185. /package/dist/{chunk-IGAZWY2W.js.map → chunk-2HOWRAWK.js.map} +0 -0
  186. /package/dist/{chunk-KZ7534CD.js.map → chunk-2NGFDLIM.js.map} +0 -0
  187. /package/dist/{chunk-SOW6SVAM.js.map → chunk-2YKUSTHS.js.map} +0 -0
  188. /package/dist/{chunk-DQO44Y5G.js.map → chunk-3SFAB75L.js.map} +0 -0
  189. /package/dist/{chunk-U2CE55YV.js.map → chunk-5UJKXOAD.js.map} +0 -0
  190. /package/dist/{chunk-6D7FCU4E.js.map → chunk-762MM6NA.js.map} +0 -0
  191. /package/dist/{chunk-ZEKQRBXO.js.map → chunk-A4QNKEX4.js.map} +0 -0
  192. /package/dist/{chunk-SX626JUF.js.map → chunk-APAF4VWW.js.map} +0 -0
  193. /package/dist/{chunk-DTSWP5FC.js.map → chunk-BHGFLRXM.js.map} +0 -0
  194. /package/dist/{chunk-PGDUVYTF.js.map → chunk-BJUEOC4G.js.map} +0 -0
  195. /package/dist/{chunk-5MJE5KMY.js.map → chunk-BKY6GAFA.js.map} +0 -0
  196. /package/dist/{chunk-ITA7V5Y2.js.map → chunk-BLXRIAV2.js.map} +0 -0
  197. /package/dist/{chunk-SFSALDIR.js.map → chunk-BXCVOHEX.js.map} +0 -0
  198. /package/dist/{chunk-FRM62BEN.js.map → chunk-CZIO37J5.js.map} +0 -0
  199. /package/dist/{chunk-SFTWEGUD.js.map → chunk-D4QHRVDJ.js.map} +0 -0
  200. /package/dist/{chunk-6VGWLCYT.js.map → chunk-D5GBYKDU.js.map} +0 -0
  201. /package/dist/{chunk-GVOI7SCF.js.map → chunk-DMVBIIP3.js.map} +0 -0
  202. /package/dist/{chunk-O26NQ7KT.js.map → chunk-E23KWEPL.js.map} +0 -0
  203. /package/dist/{chunk-NDQA4VYK.js.map → chunk-E7OG5F6S.js.map} +0 -0
  204. /package/dist/{chunk-JNMY7KZG.js.map → chunk-G5I2JTDK.js.map} +0 -0
  205. /package/dist/{chunk-HSC5G3FW.js.map → chunk-HHJ2HFPP.js.map} +0 -0
  206. /package/dist/{chunk-HZWLHSZG.js.map → chunk-IN5T22FP.js.map} +0 -0
  207. /package/dist/{chunk-FERFWKZM.js.map → chunk-IOJD2RFG.js.map} +0 -0
  208. /package/dist/{chunk-GCF7STEA.js.map → chunk-JUUCCML3.js.map} +0 -0
  209. /package/dist/{chunk-3OXBZSDN.js.map → chunk-KBSTXL6L.js.map} +0 -0
  210. /package/dist/{chunk-SRTBHEUM.js.map → chunk-KCWNJMSS.js.map} +0 -0
  211. /package/dist/{chunk-2XRSQXGZ.js.map → chunk-KQDRO6N6.js.map} +0 -0
  212. /package/dist/{chunk-QSY5YPM4.js.map → chunk-MTCOBRCX.js.map} +0 -0
  213. /package/dist/{chunk-RGZBROMW.js.map → chunk-OWJLB2AF.js.map} +0 -0
  214. /package/dist/{chunk-QA7AXRGH.js.map → chunk-P7HAXMFN.js.map} +0 -0
  215. /package/dist/{chunk-GXDVERLV.js.map → chunk-PACZEDOH.js.map} +0 -0
  216. /package/dist/{chunk-UKSXQHSE.js.map → chunk-Q76T6Y6X.js.map} +0 -0
  217. /package/dist/{chunk-SGI3WPYK.js.map → chunk-R2CR62JV.js.map} +0 -0
  218. /package/dist/{chunk-MLY65CQE.js.map → chunk-RKACUTY5.js.map} +0 -0
  219. /package/dist/{chunk-EBYLQE7P.js.map → chunk-RWXR3GJI.js.map} +0 -0
  220. /package/dist/{chunk-JOZVVIVD.js.map → chunk-S5G6T4VC.js.map} +0 -0
  221. /package/dist/{chunk-GL2HXZVX.js.map → chunk-TFVNEPMF.js.map} +0 -0
  222. /package/dist/{chunk-I62V2ZAJ.js.map → chunk-U4OJ7U45.js.map} +0 -0
  223. /package/dist/{chunk-QWCP7UMG.js.map → chunk-V2XJJEEF.js.map} +0 -0
  224. /package/dist/{chunk-ZRMA5U53.js.map → chunk-WHVFHBL3.js.map} +0 -0
  225. /package/dist/{chunk-IYRGV2BC.js.map → chunk-XBJKYXOR.js.map} +0 -0
  226. /package/dist/{chunk-ZBE735BH.js.map → chunk-XI3BNZG4.js.map} +0 -0
  227. /package/dist/{chunk-Z6FATXBE.js.map → chunk-YSZNJ2ID.js.map} +0 -0
  228. /package/dist/{cli-4HH6IY2L.js.map → cli-3PBRPPMQ.js.map} +0 -0
  229. /package/dist/{cli-GVHXRQAD.js.map → cli-6NKE6RMT.js.map} +0 -0
  230. /package/dist/{cli-T4NY2EGM.js.map → cli-77A46SB2.js.map} +0 -0
  231. /package/dist/{cli-5BFVL3DH.js.map → cli-FSDJY5OC.js.map} +0 -0
  232. /package/dist/{cli-L7H4C442.js.map → cli-JNYL6LB7.js.map} +0 -0
  233. /package/dist/{cli-HTAR3PWY.js.map → cli-K47XWDLJ.js.map} +0 -0
  234. /package/dist/{cli-ZPW5VIRA.js.map → cli-LP5OE3BL.js.map} +0 -0
  235. /package/dist/{cli-AR43H5BW.js.map → cli-MOKRUHZT.js.map} +0 -0
  236. /package/dist/{config-7I5CHHRZ.js.map → config-BMWDC66C.js.map} +0 -0
  237. /package/dist/{github-CMWG4QMI.js.map → github-6GYTPSGV.js.map} +0 -0
  238. /package/dist/{github-NIRLMJ65.js.map → github-DJOLVNDD.js.map} +0 -0
  239. /package/dist/{github-RIU47U73.js.map → github-ZF2TQ3RP.js.map} +0 -0
  240. /package/dist/{json-EJTB7XYG.js.map → json-Y7625EFE.js.map} +0 -0
  241. /package/dist/{json-KSBVGZUX.js.map → json-YIK72XAL.js.map} +0 -0
  242. /package/dist/{labels-VNKACCAG.js.map → labels-X633ZPK7.js.map} +0 -0
  243. /package/dist/{lint-75BD6L5T.js.map → lint-RF3B55W7.js.map} +0 -0
  244. /package/dist/{list-6XVIW3RW.js.map → list-5DW4QZ7P.js.map} +0 -0
  245. /package/dist/{list-MH54XU7E.js.map → list-7CHWJ633.js.map} +0 -0
  246. /package/dist/{list-PHNZAYIM.js.map → list-UNWG6NPD.js.map} +0 -0
  247. /package/dist/{page-5AJS7AEM.js.map → page-OMPEACUN.js.map} +0 -0
  248. /package/dist/{prepare-R63RJI6O.js.map → prepare-B4JVDVOV.js.map} +0 -0
  249. /package/dist/{pretty-DE4WXJFA.js.map → pretty-PPNHHOEN.js.map} +0 -0
  250. /package/dist/{pretty-E3DS32NZ.js.map → pretty-U7ATCFBN.js.map} +0 -0
  251. /package/dist/{pretty-SUKMF6AB.js.map → pretty-XGYQ25PH.js.map} +0 -0
  252. /package/dist/{reporters-DLMLFLKS.js.map → reporters-FAIEOTC4.js.map} +0 -0
  253. /package/dist/{reporters-V2PSDBVW.js.map → reporters-KE7AZR6C.js.map} +0 -0
  254. /package/dist/{run-QT2LVHRU.js.map → run-MHJ3AYKG.js.map} +0 -0
  255. /package/dist/{sarif-2ZKPRT42.js.map → sarif-DOGRSGTB.js.map} +0 -0
  256. /package/dist/{sarif-GKMUHCZB.js.map → sarif-MIEMQOIK.js.map} +0 -0
  257. /package/dist/{sarif-HUIRTPSL.js.map → sarif-RGRG7VFX.js.map} +0 -0
  258. /package/dist/{term-ZZWAVUW5.js.map → term-MDN3NJDW.js.map} +0 -0
  259. /package/dist/{validate-ZEUFF3BG.js.map → validate-QDYQ642J.js.map} +0 -0
@@ -1,20 +1,19 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- checkStrategySet
4
- } from "./chunk-SIREOHLW.js";
5
2
  import {
6
3
  DEFAULT_STRATEGY_BASELINE_PATH,
7
4
  StrategyError,
5
+ checkStrategySet,
6
+ displayPath,
8
7
  loadStrategy
9
- } from "./chunk-NEO2HN2N.js";
8
+ } from "./chunk-6XK3NTL5.js";
10
9
  import {
11
10
  RULE_ID_PREFIX
12
- } from "./chunk-O4O6JOGD.js";
11
+ } from "./chunk-GMLOAKOA.js";
13
12
  import {
14
13
  isErrorSeverity,
15
14
  resolveBaselineRequest,
16
15
  settleBaseline
17
- } from "./chunk-PGDUVYTF.js";
16
+ } from "./chunk-BJUEOC4G.js";
18
17
 
19
18
  // src/strategy/commands/check.ts
20
19
  import { existsSync } from "node:fs";
@@ -80,9 +79,13 @@ function reportedFindings(results, origin, order) {
80
79
 
81
80
  // src/strategy/commands/check.ts
82
81
  async function runCheck(opts) {
83
- const { cwd, run, set } = await loadStrategy(opts);
82
+ const { cwd, run, set, steps } = await loadStrategy(opts);
84
83
  const config = run.config;
85
- const findings = checkStrategySet(set, config?.severity === void 0 ? {} : { severity: config.severity });
84
+ const findings = checkStrategySet(set, {
85
+ ...config?.severity === void 0 ? {} : { severity: config.severity },
86
+ steps,
87
+ pagePath: (page) => displayPath(page, cwd, run.base)
88
+ });
86
89
  const { results, origin } = toResults(set, findings);
87
90
  const frame = { cwd, base: run.configDir ?? cwd, runBase: run.base };
88
91
  let request = resolveBaselineRequest(
@@ -111,6 +114,7 @@ async function runCheck(opts) {
111
114
  // value (pages and records alike), plus each value of a record's own
112
115
  // parent field, which load-set keeps out of the references.
113
116
  references: set.references.length + parents,
117
+ steps: [...steps.values()].reduce((n, s) => n + s.length, 0),
114
118
  ...baseline === void 0 ? {} : { baseline },
115
119
  found: findings.length,
116
120
  cwd,
@@ -123,4 +127,4 @@ export {
123
127
  JUNIT_CLASSNAME,
124
128
  runCheck
125
129
  };
126
- //# sourceMappingURL=chunk-VCU7OMXV.js.map
130
+ //# sourceMappingURL=chunk-CLPC3LKX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/strategy/commands/check.ts","../src/strategy/commands/findings.ts"],"sourcesContent":["/**\n * `manni strategy check`: the pages against the records, and the records\n * against each other, with the baseline ratchet term and cite use.\n *\n * `--baseline` records the findings when the file is not there yet, and after\n * that fails only on findings it does not hold. A configured\n * `strategy.baseline` compares without the flag.\n */\nimport { existsSync } from \"node:fs\";\nimport { resolveBaselineRequest, settleBaseline } from \"../../meta/internal.js\";\nimport { checkStrategySet } from \"../core/check.js\";\nimport { DEFAULT_STRATEGY_BASELINE_PATH } from \"../core/config.js\";\nimport { StrategyError } from \"../errors.js\";\nimport { reportedFindings, summarize, toResults, type StrategyReport } from \"./findings.js\";\nimport { displayPath, loadStrategy, type StrategyCommandOptions } from \"./run.js\";\n\nexport interface CheckOptions extends StrategyCommandOptions {\n /** `--baseline`. */\n baseline?: boolean;\n}\n\nexport async function runCheck(opts: CheckOptions): Promise<StrategyReport> {\n const { cwd, run, set, steps } = await loadStrategy(opts);\n const config = run.config;\n const findings = checkStrategySet(set, {\n ...(config?.severity === undefined ? {} : { severity: config.severity }),\n steps,\n pagePath: (page) => displayPath(page, cwd, run.base),\n });\n const { results, origin } = toResults(set, findings);\n\n // Fingerprints must not depend on where the command was run from.\n const frame = { cwd, base: run.configDir ?? cwd, runBase: run.base };\n let request = resolveBaselineRequest(\n opts.baseline === true ? { baseline: true } : {},\n config?.baseline,\n run.configDir,\n cwd,\n { current: DEFAULT_STRATEGY_BASELINE_PATH },\n );\n if (request !== null && !existsSync(request.absPath)) {\n if (opts.baseline !== true) {\n throw new StrategyError(`Baseline \"${request.label}\" not found. Record one with \\`manni strategy check --baseline\\`.`);\n }\n request = { ...request, write: true };\n }\n const { results: reported, baseline } = await settleBaseline(results, request, frame);\n\n const parents = set.records.reduce((n, r) => n + r.parents.length, 0);\n return {\n findings: reportedFindings(reported, origin, findings),\n results: reported,\n origin,\n summary: summarize(reported, baseline),\n frame,\n records: set.records.length,\n // Two kinds, both resolved: every audiences:, personas: and journeys:\n // value (pages and records alike), plus each value of a record's own\n // parent field, which load-set keeps out of the references.\n references: set.references.length + parents,\n steps: [...steps.values()].reduce((n, s) => n + s.length, 0),\n ...(baseline === undefined ? {} : { baseline }),\n found: findings.length,\n cwd,\n base: run.base,\n };\n}\n","/**\n * The report `check` returns, and the bridge from strategy findings to meta's\n * `ValidationResult`, so the SARIF and JUnit renderers and the baseline\n * ratchet work unchanged, as term's adapter does.\n *\n * FieldError: schema `manni:strategy`, keyword = the rule, instancePath\n * `/<field>` when the finding concerns one field and `\"\"` when it concerns a\n * whole record. The subject is the record, the field and what the finding\n * says before its advice, with any `file:line` taken out, so a moved line or\n * a reworded fix moves no baseline.\n */\nimport {\n isErrorSeverity,\n type BaselineSummary,\n type FieldError,\n type FingerprintContext,\n type RunSummary,\n type ValidationResult,\n} from \"../../meta/index.js\";\nimport { RULE_ID_PREFIX } from \"../core/severity.js\";\nimport type { StrategyFinding, StrategySet } from \"../types.js\";\n\nexport const FINDING_FORMATS = [\"pretty\", \"json\", \"github\", \"sarif\", \"junit\"] as const;\nexport type FindingFormat = (typeof FINDING_FORMATS)[number];\n\n/** JUnit `classname` for the strategy tool's findings. */\nexport const JUNIT_CLASSNAME = \"manni.strategy\";\n\nexport interface StrategyReport {\n /** The findings reported: a baselined one is not among them. */\n findings: StrategyFinding[];\n /** The same findings as meta's results, for SARIF and JUnit. One per file. */\n results: ValidationResult[];\n /** Each error in `results` to the finding it came from. */\n origin: ReadonlyMap<FieldError, StrategyFinding>;\n summary: RunSummary;\n frame: FingerprintContext;\n /** Records in the set. */\n records: number;\n /** Values of audiences:, personas:, journeys: and audience: the run read. */\n references: number;\n /** Steps on the set's journeys, each held to the page it names. */\n steps: number;\n baseline?: BaselineSummary;\n /** Findings before the baseline, for the line a recording run prints. */\n found: number;\n /** Where the run stood, for the paths the reporters print. */\n cwd: string;\n /** What finding files are relative to. */\n base: string;\n}\n\nconst LINE_REFERENCE = /:\\d+\\b/g;\n\nfunction toFieldError(finding: StrategyFinding): FieldError {\n const said = finding.key ?? finding.message;\n const subject = [finding.id ?? \"\", finding.field ?? \"\", said.replace(LINE_REFERENCE, \"\")].join(\"\\u0000\");\n const error: FieldError = {\n schema: RULE_ID_PREFIX,\n instancePath: finding.field === undefined ? \"\" : `/${finding.field}`,\n message: finding.message,\n keyword: finding.rule,\n subject,\n severity: finding.severity,\n };\n if (finding.line !== undefined) error.line = finding.line;\n return error;\n}\n\n/** One result per file: every record's file, every file a reference was read from, and every file a finding sits in. */\nexport function toResults(\n set: StrategySet,\n findings: readonly StrategyFinding[],\n): { results: ValidationResult[]; origin: Map<FieldError, StrategyFinding> } {\n const origin = new Map<FieldError, StrategyFinding>();\n const byFile = new Map<string, FieldError[]>();\n for (const { file } of [...set.records, ...set.references]) if (!byFile.has(file)) byFile.set(file, []);\n for (const finding of findings) {\n const error = toFieldError(finding);\n origin.set(error, finding);\n byFile.set(finding.file, [...(byFile.get(finding.file) ?? []), error]);\n }\n const results = [...byFile.keys()].sort().map((file): ValidationResult => {\n const errors = byFile.get(file) ?? [];\n return { file, format: \"strategy\", ok: !errors.some(isErrorSeverity), schemas: [RULE_ID_PREFIX], errors };\n });\n return { results, origin };\n}\n\n/** The run summary meta's renderers read, from results a baseline may have thinned. */\nexport function summarize(results: readonly ValidationResult[], baseline?: BaselineSummary): RunSummary {\n const failed = results.filter((r) => !r.ok).length;\n const count = (keep: (e: FieldError) => boolean): number => results.reduce((n, r) => n + r.errors.filter(keep).length, 0);\n const warnings = count((e) => e.severity === \"warning\");\n const notices = count((e) => e.severity === \"notice\");\n return {\n files: results.length,\n passed: results.length - failed,\n failed,\n errors: count(isErrorSeverity),\n ...(warnings > 0 ? { warnings } : {}),\n ...(notices > 0 ? { notices } : {}),\n ...(baseline ? { baseline } : {}),\n };\n}\n\n/** The findings still reported once a baseline has thinned the results, in report order. */\nexport function reportedFindings(\n results: readonly ValidationResult[],\n origin: ReadonlyMap<FieldError, StrategyFinding>,\n order: readonly StrategyFinding[],\n): StrategyFinding[] {\n const kept = new Set<StrategyFinding>();\n for (const result of results) {\n for (const error of result.errors) {\n const finding = origin.get(error);\n if (finding !== undefined) kept.add(finding);\n }\n }\n return order.filter((finding) => kept.has(finding));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAQA,SAAS,kBAAkB;;;ACcpB,IAAM,kBAAkB,CAAC,UAAU,QAAQ,UAAU,SAAS,OAAO;AAIrE,IAAM,kBAAkB;AA0B/B,IAAM,iBAAiB;AAEvB,SAAS,aAAa,SAAsC;AAC1D,QAAM,OAAO,QAAQ,OAAO,QAAQ;AACpC,QAAM,UAAU,CAAC,QAAQ,MAAM,IAAI,QAAQ,SAAS,IAAI,KAAK,QAAQ,gBAAgB,EAAE,CAAC,EAAE,KAAK,IAAQ;AACvG,QAAM,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EAAE,SAAS,+BAA+B;AAAA,EAC5C;AACA,MAAI,YAAY,QAAQ,CAAC,WAAW,QAAQ,OAAO,GAAG;AACpD,QAAI,KAAK,aAAa,MAAM;AAC1B,YAAM,IAAI,cAAc,aAAa,QAAQ,KAAK,mEAAmE;AAAA,IACvH;AACA,cAAU,EAAE,GAAG,SAAS,OAAO,KAAK;AAAA,EACtC;AACA,QAAM,EAAE,SAAS,UAAU,SAAS,IAAI,MAAM,eAAe,SAAS,SAAS,KAAK;AAEpF,QAAM,UAAU,IAAI,QAAQ,OAAO,CAAC,GAAG,MAAM,IAAI,EAAE,QAAQ,QAAQ,CAAC;AACpE,SAAO;AAAA,IACL,UAAU,iBAAiB,UAAU,QAAQ,QAAQ;AAAA,IACrD,SAAS;AAAA,IACT;AAAA,IACA,SAAS,UAAU,UAAU,QAAQ;AAAA,IACrC;AAAA,IACA,SAAS,IAAI,QAAQ;AAAA;AAAA;AAAA;AAAA,IAIrB,YAAY,IAAI,WAAW,SAAS;AAAA,IACpC,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG,MAAM,IAAI,EAAE,QAAQ,CAAC;AAAA,IAC3D,GAAI,aAAa,SAAY,CAAC,IAAI,EAAE,SAAS;AAAA,IAC7C,OAAO,SAAS;AAAA,IAChB;AAAA,IACA,MAAM,IAAI;AAAA,EACZ;AACF;","names":[]}
@@ -8,24 +8,24 @@ import {
8
8
  loadTemplateFile,
9
9
  resolveLintRun,
10
10
  resolveStructureTool
11
- } from "./chunk-2G4XYGTN.js";
11
+ } from "./chunk-AE6KBAAU.js";
12
12
  import {
13
13
  parserByName,
14
14
  parserForExtension,
15
15
  unsupportedFormatMessage
16
- } from "./chunk-5UJQLZXY.js";
16
+ } from "./chunk-VLRIP4BQ.js";
17
17
  import {
18
18
  BLOCK_KINDS,
19
19
  BLOCK_KIND_NODE,
20
20
  occurrenceRange,
21
21
  quoteList
22
- } from "./chunk-JNMY7KZG.js";
22
+ } from "./chunk-G5I2JTDK.js";
23
23
  import {
24
24
  LintError
25
- } from "./chunk-TKINOTVS.js";
25
+ } from "./chunk-TI4DA6DF.js";
26
26
  import {
27
27
  writeTextAtomic
28
- } from "./chunk-PHOWMWFJ.js";
28
+ } from "./chunk-BXE4L52Q.js";
29
29
  import {
30
30
  palette
31
31
  } from "./chunk-RNVYGWIC.js";
@@ -247,7 +247,7 @@ async function runTemplatesInfer(opts) {
247
247
  }
248
248
  let tree;
249
249
  try {
250
- tree = parser.parse(content, opts.page === STDIN ? "<stdin>" : opts.page);
250
+ tree = await parser.parse(content, opts.page === STDIN ? "<stdin>" : opts.page);
251
251
  } catch (err) {
252
252
  if (err instanceof ToolError) throw new LintError(err.message);
253
253
  throw err;
@@ -525,4 +525,4 @@ export {
525
525
  occurrenceWords,
526
526
  renderTemplateShow
527
527
  };
528
- //# sourceMappingURL=chunk-PTXHJLAS.js.map
528
+ //# sourceMappingURL=chunk-CREFJCWZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lint/core/infer.ts","../src/lint/commands/templates.ts","../src/lint/commands/tools.ts","../src/lint/reporters/template-show.ts"],"sourcesContent":["/**\n * Write a first template from a page that already has the shape its author\n * wants.\n *\n * The format is strict by default: every rule is one occurrence, and a section\n * no rule describes is a finding. A new author's first run against a\n * hand-written template is therefore a screen of unexpected sections, and this\n * is the escape. Proposal 0061's stress test 5 records it, and says the two\n * ship together.\n *\n * Two rules govern everything here.\n *\n * **The output must lint its input clean.** That is the whole contract, and it\n * is why each inference below is the weakest claim that still describes the\n * page. `contains:` lists only the kinds that are there, at `min: 1`, so a\n * section holding more of something still passes. A table's `columns:` is\n * claimed only where every table in that section agrees about them, and a code\n * block's `language:` only where every block in that section declares one -\n * both rules report per offending node, so a claim drawn from one node would\n * fail on its neighbour. A template that fails the page it was inferred from is\n * worse than no template: it hands a new author findings about the very\n * document they pointed at.\n *\n * **Nothing is optional and nothing repeats.** One page cannot show what\n * varies, so no `min: 0`, no `max`, no `repeat` and no `pattern` is invented.\n * Two sections with one heading are two rules. Loosening a heading into a list\n * or a pattern, marking a rule optional, and adding a trailing wildcard are the\n * author's edits, and the reference page says so.\n */\nimport { stringify as stringifyYaml } from \"yaml\";\nimport { LintError } from \"../types.js\";\nimport type {\n CodeNode,\n ContentKind,\n ContentNode,\n DocumentTree,\n Position,\n SectionNode,\n TableNode,\n} from \"../types.js\";\nimport { BLOCK_KINDS, BLOCK_KIND_NODE } from \"./template.js\";\nimport type {\n BlockKind,\n BlockRule,\n HeadingRule,\n Rule,\n Template,\n TemplateFile,\n} from \"./template.js\";\n\n/** How an inferred template is written out. */\nexport const INFER_FORMATS = [\"yaml\", \"json\"] as const;\nexport type InferFormat = (typeof INFER_FORMATS)[number];\n\nexport function isInferFormat(value: string): value is InferFormat {\n return (INFER_FORMATS as readonly string[]).includes(value);\n}\n\n/**\n * Template names the schema's `templates` map accepts.\n *\n * Checked here rather than left to Ajv. `templates` is `additionalProperties:\n * false` beside a `patternProperties` key, so a name outside the pattern is\n * reported as an unexpected property - which names the offending key and says\n * nothing whatsoever about what is wrong with it.\n */\nconst TEMPLATE_NAME = /^[A-Za-z][A-Za-z0-9\\-_]*$/;\n\n/** The node each block-rule key counts, inverted: `codeBlock` -> `codeBlocks`. */\nconst KIND_KEY = new Map<ContentKind, BlockKind>(\n BLOCK_KINDS.map((key) => [BLOCK_KIND_NODE[key], key]),\n);\n\n/* -------------------------------------------------------------------------- *\n * The page as the template's subject\n * -------------------------------------------------------------------------- */\n\n/** A zero-width span at the top of a file, for a document with no sections. */\nfunction origin(): Position {\n return {\n start: { line: 1, column: 1, offset: 0 },\n end: { line: 1, column: 1, offset: 0 },\n };\n}\n\n/** First section's start through the last one's end. */\nfunction span(sections: SectionNode[]): Position {\n const first = sections[0];\n const last = sections[sections.length - 1];\n if (!first || !last) return origin();\n return { start: { ...first.position.start }, end: { ...last.position.end } };\n}\n\n/**\n * The section the template describes: the page itself.\n *\n * Deliberately the same reading `validator.ts` applies, because the template\n * this produces is checked by that one. A page whose body is a single `# Title`\n * *is* that section; anything else - several top-level headings, or a body that\n * starts at `##` with no lead content - has no section standing for the page,\n * so one is synthesised with no heading of its own. The duplication is small\n * and the alternative is worse: an inference that read the page differently\n * from the checker would produce templates that fail their own source.\n */\nfunction pageSection(tree: DocumentTree): SectionNode {\n const [only] = tree.sections;\n if (tree.sections.length === 1 && only && only.level <= 1) return only;\n return {\n slug: \"\",\n title: \"\",\n level: 0,\n order: 0,\n parentSlug: null,\n titlePosition: null,\n position: span(tree.sections),\n children: [],\n sections: tree.sections,\n };\n}\n\n/* -------------------------------------------------------------------------- *\n * Content\n * -------------------------------------------------------------------------- */\n\n/** The header row's cells, in order, or none where the table has no header. */\nfunction headerCells(table: TableNode): string[] {\n const header = table.children.find((row) => row.header);\n return header ? header.children.map((cell) => cell.text) : [];\n}\n\n/**\n * `columns:` for a run of tables, where they all agree about it.\n *\n * `tables.columns` reports once per table whose header differs, so a claim\n * taken from the first of two unlike tables fails on the second - in the very\n * page it was drawn from. Where the tables disagree, or any of them has no\n * header row, the count alone is what the page can honestly be said to show.\n */\nfunction columnsOf(tables: TableNode[]): { columns?: string[] } {\n const headers = tables.map(headerCells);\n const [first] = headers;\n if (first === undefined || first.length === 0) return {};\n const same = (cells: string[]): boolean =>\n cells.length === first.length && cells.every((c, i) => c === first[i]);\n return headers.every(same) ? { columns: [...first] } : {};\n}\n\n/**\n * `language:` for a run of code blocks, where every one of them declares one.\n *\n * `codeBlocks.language` holds every block in the run to the accepted set, so a\n * section mixing a tagged fence with a bare one can claim nothing: the bare one\n * would fail. Where the tags differ the list form says what the page shows,\n * which is what \"one of these\" is for.\n */\nfunction languageOf(blocks: CodeNode[]): { language?: string | string[] } {\n const declared: string[] = [];\n for (const block of blocks) {\n if (block.language === undefined || block.language.length === 0) return {};\n declared.push(block.language);\n }\n const distinct = [...new Set(declared)];\n const [only] = distinct;\n if (only === undefined) return {};\n return { language: distinct.length === 1 ? only : distinct };\n}\n\n/**\n * What a section holds, as a `contains:` rule, or nothing where it holds none\n * of the kinds a template can count.\n *\n * `contains` rather than `sequence`: the page shows one order, and asserting it\n * would make moving a paragraph below a list a finding. Order is a claim its\n * author makes deliberately.\n */\nfunction inferContains(children: ContentNode[]): BlockRule | undefined {\n const byKey = new Map<BlockKind, ContentNode[]>();\n for (const node of children) {\n const key = KIND_KEY.get(node.kind);\n if (key === undefined) continue;\n const bucket = byKey.get(key);\n if (bucket) bucket.push(node);\n else byKey.set(key, [node]);\n }\n\n const rule: BlockRule = {};\n let any = false;\n // In `BLOCK_KINDS` order, not the order the page happens to put them in, so\n // two pages holding the same kinds produce byte-identical rules.\n for (const key of BLOCK_KINDS) {\n const nodes = byKey.get(key);\n if (nodes === undefined) continue;\n any = true;\n if (key === \"tables\") {\n rule.tables = { min: 1, ...columnsOf(nodes as TableNode[]) };\n } else if (key === \"codeBlocks\") {\n rule.codeBlocks = { min: 1, ...languageOf(nodes as CodeNode[]) };\n } else {\n // A computed key, as `validator.ts` does it: every other block rule is a\n // bare count, and nine near-identical branches would say less.\n Object.assign(rule, { [key]: { min: 1 } });\n }\n }\n return any ? rule : undefined;\n}\n\n/* -------------------------------------------------------------------------- *\n * Rules\n * -------------------------------------------------------------------------- */\n\n/**\n * A section's heading, as a rule about it.\n *\n * Exact text, because that is what the page shows; a one-of list or a pattern\n * is a generalisation only its author can make. `false` for a section with no\n * heading of its own - the implicit lead section, and the synthesised page -\n * because that is as specific a claim as naming one.\n *\n * An empty title is the one case with no spelling: the schema's `heading`\n * requires a non-empty string, and `false` would be a lie about a section that\n * does have a heading. The key is omitted, which matches any heading.\n */\nfunction inferHeading(section: SectionNode): HeadingRule | undefined {\n if (section.titlePosition === null) return false;\n return section.title.length > 0 ? section.title : undefined;\n}\n\n/** One section, and every section under it. */\nfunction inferRule(section: SectionNode): Rule {\n const rule: Rule = {};\n const heading = inferHeading(section);\n if (heading !== undefined) rule.heading = heading;\n const contains = inferContains(section.children);\n if (contains) rule.contains = contains;\n // Omitted, never `[]`. An absent `sections:` says nothing about the\n // subsections; an empty list says none are permitted.\n if (section.sections.length > 0) {\n rule.sections = section.sections.map(inferRule);\n }\n return rule;\n}\n\n/** The template one page describes: the page rule, with its sections under it. */\nexport function inferTemplate(tree: DocumentTree): Template {\n return inferRule(pageSection(tree));\n}\n\n/* -------------------------------------------------------------------------- *\n * The file\n * -------------------------------------------------------------------------- */\n\n/** Refuse a name the `templates` map cannot hold, in words that name the rule. */\nexport function assertTemplateName(name: string): string {\n if (TEMPLATE_NAME.test(name)) return name;\n throw new LintError(\n `\"${name}\" is not a usable template name. A name starts with a letter and ` +\n `holds only letters, digits, \"-\" and \"_\". Pass --name <name>.`,\n );\n}\n\n/** A one-template file, ready to serialize. */\nexport function inferTemplateFile(\n tree: DocumentTree,\n name: string,\n): TemplateFile {\n return { templates: { [assertTemplateName(name)]: inferTemplate(tree) } };\n}\n\n/**\n * Serialize a template file.\n *\n * `lineWidth: 0` turns off YAML's folding. A folded heading still parses back\n * to the same string, but a template is read and edited by hand, and a heading\n * broken across two lines is the one thing in this output a reader would\n * mistrust.\n */\nexport function renderTemplateFile(\n file: TemplateFile,\n format: InferFormat,\n): string {\n const text =\n format === \"json\"\n ? JSON.stringify(file, null, 2)\n : stringifyYaml(file, { lineWidth: 0 });\n return text.endsWith(\"\\n\") ? text : `${text}\\n`;\n}\n","/**\n * `templates` command cores.\n *\n * `runTemplates` reports the templates a run could resolve: the built-ins, plus\n * the named templates in any files given by `--templates` or by\n * `lint.templates` in the config, with the doctypes each serves.\n *\n * The `types` column is the part worth printing. It is what frontmatter\n * routing will match a page against, so seeing it is how someone works out\n * which `type:` value to write in a page - or that no template claims the one\n * they already wrote.\n *\n * `runTemplatesInfer` writes a first template from a page that already has the\n * shape its author wants. The inference itself is `../core/infer.ts`; what\n * lives here is the plumbing around it - which parser reads the page, what the\n * template is called, and where the file goes.\n *\n * `runTemplateShow` resolves one ref the way `--template` does and returns the\n * template it names, for `src/lint/reporters/template-show.ts` to print.\n *\n * All three return data; `src/lint/reporters/index.ts` renders the listing, and\n * an inferred template is already the text it will be written as.\n */\nimport { existsSync } from \"node:fs\";\nimport { mkdir, readFile } from \"node:fs/promises\";\nimport { basename, dirname, extname, resolve } from \"node:path\";\nimport { errorMessage, ToolError } from \"../../shared/errors.js\";\nimport { writeTextAtomic } from \"../../shared/write-file.js\";\nimport { LintError } from \"../types.js\";\nimport type { DocumentParser, DocumentTree } from \"../types.js\";\nimport {\n parserByName,\n parserForExtension,\n unsupportedFormatMessage,\n} from \"../parsers/index.js\";\nimport {\n assertTemplateName,\n inferTemplateFile,\n isInferFormat,\n renderTemplateFile,\n type InferFormat,\n} from \"../core/infer.js\";\nimport type { Template, TemplateFile } from \"../core/template.js\";\nimport { resolveLintRun } from \"../core/config.js\";\nimport {\n classifyRef,\n listBuiltins,\n loadResolvedTemplate,\n loadTemplate,\n loadTemplateFile,\n} from \"../core/template-registry.js\";\n\n/** `TemplateInfo.source` for a template that ships with the tool. */\nexport const BUILTIN_SOURCE = \"builtin\";\n\nexport interface TemplateInfo {\n /** The ref to pass to `--template`. */\n id: string;\n /**\n * Human-readable title. Empty for templates read from a user file: the\n * template DSL has no title field, only the built-in registry carries one.\n */\n title: string;\n /** Doctypes the template serves, matched against a page `type`. */\n types: string[];\n /** `builtin`, or the template file this entry came from. */\n source: string;\n /** Link to the author's guide for the doctype, or null when it names none. */\n guide: string | null;\n}\n\nexport interface TemplatesInfo {\n templates: TemplateInfo[];\n}\n\nexport interface TemplatesOptions {\n /** Template files whose entries join the built-ins. */\n templates?: string | string[];\n}\n\nexport async function runTemplates(\n opts: TemplatesOptions = {},\n): Promise<TemplatesInfo> {\n // A built-in's guide lives in its YAML, not the manifest, so each is loaded.\n // They are cached, and a run that lints pages loads them anyway.\n const templates: TemplateInfo[] = await Promise.all(\n listBuiltins().map(async (builtin) => ({\n id: builtin.id,\n title: builtin.title,\n types: builtin.types,\n source: BUILTIN_SOURCE,\n guide: (await loadTemplate(builtin.id)).guide ?? null,\n })),\n );\n\n // Listed after the built-ins, in the order supplied - the same order\n // `buildTypeIndex` applies them in, so a later entry claiming the same\n // doctype is the one that would win.\n const paths =\n opts.templates == null\n ? []\n : Array.isArray(opts.templates)\n ? opts.templates\n : [opts.templates];\n\n for (const path of paths) {\n const file = await loadTemplateFile(path);\n for (const [id, template] of Object.entries(file.templates ?? {})) {\n templates.push({\n id,\n title: \"\",\n types: template.types ?? [],\n source: path,\n guide: template.guide ?? null,\n });\n }\n }\n\n return { templates };\n}\n\n/* -------------------------------------------------------------------------- *\n * infer\n * -------------------------------------------------------------------------- */\n\n/** The token that means stdin, in every command of the family. */\nconst STDIN = \"-\";\n\n/** What a page read from stdin is called when nothing else names it. */\nconst STDIN_NAME = \"stdin\";\n\nexport interface TemplatesInferOptions {\n /** The one page to infer from: a path, or `-` for stdin. */\n page: string;\n /** `--as`: force an input format, by parser name. */\n as?: string;\n /** `--name`: what to call the template. Defaults to the page's own doctype. */\n name?: string;\n /** `-f/--format`: how the file is written. Defaults to `yaml`. */\n format?: InferFormat;\n /** `-o/--out`: write here instead of returning text for stdout. */\n out?: string;\n /** `--force`: replace an existing `--out`. */\n force?: boolean;\n cwd?: string;\n /** Content for the `-` page, injected by the CLI and by tests. */\n stdinContent?: string;\n /** `-c/--config`. */\n configPath?: string;\n /** `--no-config`: skip discovery. */\n noConfig?: boolean;\n /** Told which config governed the run, and where it came from. */\n onConfigLoaded?: (info: { path: string; dir: string }) => void;\n}\n\nexport interface TemplatesInferResult {\n /** The name the template was written under. */\n name: string;\n /** The inferred file, for a caller that wants the data rather than the text. */\n file: TemplateFile;\n /** The serialized template file, exactly as written. */\n text: string;\n /** Where it was written. Absent without `--out`. */\n written?: string;\n}\n\n/**\n * The parser that reads this page.\n *\n * Resolved before anything is read, as `runLint` does it: a typo in `--as`\n * should fail immediately rather than after a file was opened it was going to\n * mis-parse anyway. A name no parser answers to is unknown whatever it was\n * meant to name, so the message points at the one command that lists them.\n */\nfunction parserFor(page: string, as: string | undefined): DocumentParser {\n if (as !== undefined) {\n const forced = parserByName(as);\n if (forced) return forced;\n throw new LintError(\n `Unknown format \"${as}\". Run \"manni lint tools\" to see the formats manni lint reads.`,\n );\n }\n if (page === STDIN) {\n throw new LintError(\n \"Reading from stdin (-) requires --as <format> to choose a parser.\",\n );\n }\n const ext = extname(page);\n const parser = parserForExtension(ext);\n if (parser) return parser;\n throw new LintError(unsupportedFormatMessage(ext || page));\n}\n\n/**\n * What the template is called: `--name`, else the page's own doctype, else the\n * file's stem.\n *\n * The doctype first because that is the handle the page already carries, and\n * the one `types:` will route on once the author adds it. A file read from\n * stdin has no stem, so it falls back to a word rather than to `-`.\n */\nfunction defaultName(tree: DocumentTree, page: string): string {\n const declared = tree.frontmatter?.[\"type\"];\n if (typeof declared === \"string\" && declared.trim().length > 0) {\n return declared.trim();\n }\n if (page === STDIN) return STDIN_NAME;\n return basename(page, extname(page)) || STDIN_NAME;\n}\n\n/**\n * Infer a template from one page.\n *\n * One page, never a set. A template is a generalisation, and this makes exactly\n * the generalisation one exemplar supports; inferring from several would mean\n * deciding which differences are variation and which are mistakes, which is the\n * author's judgment and not the tool's.\n */\nexport async function runTemplatesInfer(\n opts: TemplatesInferOptions,\n): Promise<TemplatesInferResult> {\n const format = opts.format ?? \"yaml\";\n if (!isInferFormat(format)) {\n throw new LintError(\n `Unknown --format \"${String(format)}\". Use yaml or json.`,\n );\n }\n\n // Which config governs the run, said once, the way every other lint verb\n // says it. With a page typed on the command line the base stays the working\n // directory, so the path means what it looked like it meant.\n const run = await resolveLintRun({\n cwd: opts.cwd ?? process.cwd(),\n ...(opts.configPath === undefined ? {} : { configPath: opts.configPath }),\n ...(opts.noConfig === undefined ? {} : { noConfig: opts.noConfig }),\n inputs: [opts.page],\n ...(opts.onConfigLoaded === undefined\n ? {}\n : { onConfigLoaded: opts.onConfigLoaded }),\n });\n const cwd = run.base;\n\n const parser = parserFor(opts.page, opts.as);\n // A name the schema cannot hold is refused before the page is read, beside\n // the other refusals: a run that is going to fail should leave the working\n // tree, and the reader's terminal, exactly as it found them.\n if (opts.name !== undefined) assertTemplateName(opts.name);\n\n // Every refusal happens before the write, and the `--out` guard happens\n // before the read - the ordering `meta schemas infer` established. The path\n // is echoed as it was typed, because that is the string the reader will edit.\n let absOut: string | undefined;\n if (opts.out !== undefined) {\n absOut = resolve(cwd, opts.out);\n if (opts.force !== true && existsSync(absOut)) {\n throw new LintError(`${opts.out} exists. Pass --force to overwrite it.`);\n }\n }\n\n let content: string;\n if (opts.page === STDIN) {\n content = opts.stdinContent ?? \"\";\n } else {\n try {\n content = await readFile(resolve(cwd, opts.page), \"utf8\");\n } catch (err) {\n // The OS message travels verbatim: \"permission denied\" and \"no such\n // file\" send the reader to different places, and this cannot tell which.\n throw new LintError(\n `\"${opts.page}\" could not be read: ${errorMessage(err)}`,\n );\n }\n }\n\n let tree: DocumentTree;\n try {\n tree = await parser.parse(content, opts.page === STDIN ? \"<stdin>\" : opts.page);\n } catch (err) {\n // A page that will not parse has no shape to infer, and the parser's own\n // message already names the file and the syntax it choked on.\n if (err instanceof ToolError) throw new LintError(err.message);\n throw err;\n }\n\n const name = opts.name ?? defaultName(tree, opts.page);\n const file = inferTemplateFile(tree, name);\n const text = renderTemplateFile(file, format);\n\n if (absOut === undefined) return { name, file, text };\n\n await mkdir(dirname(absOut), { recursive: true });\n await writeTextAtomic(absOut, text);\n return { name, file, text, written: opts.out };\n}\n\n/* -------------------------------------------------------------------------- *\n * show\n * -------------------------------------------------------------------------- */\n\nexport interface TemplateShowOptions {\n /** A built-in id, a path, a `path#name`, or a URL: what `--template` takes. */\n ref: string;\n}\n\n/** One resolved template, after `extends` and `$ref`, with where it came from. */\nexport interface TemplateShow extends Omit<Template, \"extends\" | \"id\"> {\n /** The built-in id, or the template's name inside its file. */\n id: string;\n /** `builtin`, or the file or URL the template came from. */\n source: string;\n}\n\n/**\n * Resolve one template ref and return the template it names.\n *\n * The loader is `--template`'s own, so a ref that fails there fails here with\n * the same message, and a template that inherits shows what it inherited.\n */\nexport async function runTemplateShow(\n opts: TemplateShowOptions,\n): Promise<TemplateShow> {\n const template = await loadResolvedTemplate(opts.ref);\n const { extends: _extends, id: _id, ...body } = template;\n\n if (classifyRef(opts.ref).kind === \"builtin\") {\n const title = listBuiltins().find((b) => b.id === opts.ref)?.title;\n return { id: opts.ref, source: BUILTIN_SOURCE, ...(title ? { title } : {}), ...body };\n }\n\n // A file names its template by fragment, or holds only one - the loader\n // above has already refused anything else.\n const hash = opts.ref.lastIndexOf(\"#\");\n const source = hash === -1 ? opts.ref : opts.ref.slice(0, hash);\n const fragment = hash === -1 ? \"\" : opts.ref.slice(hash + 1);\n const id =\n fragment ||\n // The `?? \"\"` is unreachable: loadResolvedTemplate already refused a file\n // with no templates, and one with several but no fragment.\n (Object.keys((await loadTemplateFile(source)).templates ?? {})[0] ?? \"\");\n return { id, source, ...body };\n}\n","/**\n * `tools` command core. One row per lint job: which tool performs it, whether\n * this checkout can run it, what it read its settings from, and the input\n * formats it understands.\n *\n * It replaces `formats`, which reported the parser registry alone. Proposal\n * 0050 records the rename. The registry is here as one column of the job that\n * reads it, because the formats belong to the tool performing that job.\n *\n * The column lists exactly the formats the tool reads, so a row carries no\n * state: a listed format is one that is read, and `--as` accepts every name in\n * it.\n *\n * Returns data; `src/lint/reporters/index.ts` renders it.\n */\nimport type { ContentKind } from \"../types.js\";\nimport { BLOCK_KIND_NODE } from \"../core/template.js\";\nimport { resolveStructureTool } from \"../tools/index.js\";\nimport {\n LINT_JOBS,\n resolveLintRun,\n type LintConfig,\n type LintJob,\n type LintTool,\n} from \"../core/config.js\";\n\n/**\n * The content kinds a template rule can actually name - `BLOCK_KIND_NODE`'s\n * values, the nine block-rule keys map onto. `manni lint tools` lists this\n * column to answer \"can my rule run against this format\", and a rule can\n * never ask about `listItem`, `tableRow`, `tableCell`, or `definitionItem`:\n * those are structural kinds a parser reports so the content model can\n * describe a list's items or a table's cells, not kinds a `sections:` rule\n * counts on its own. What a parser *declares* (`DocumentParser.kinds`, read by\n * the pruner in `validator.ts`) is untouched - this is a display decision, so\n * it belongs here rather than trimming the declaration itself.\n */\nconst REPORTABLE_KINDS = new Set<ContentKind>(Object.values(BLOCK_KIND_NODE));\n\nexport interface FormatInfo {\n /** Parser name, also what `--as` accepts. */\n name: string;\n label: string;\n extensions: string[];\n /** The content kinds this format's parser actually emits today. */\n kinds: ContentKind[];\n}\n\n/** One job, and the tool that would perform it on this run. */\nexport interface ToolInfo {\n job: LintJob;\n tool: LintTool;\n /** Whether the config declares this job, or anything the job's tool reads. */\n configured: boolean;\n /** Whether the tool can run here, as its own probe reported it. */\n available: boolean;\n /**\n * The version the probe reported, or null when it reported none.\n *\n * Null rather than a placeholder string, because this is the shape\n * `-f json` emits: a consumer can test for an absent version, where a dash\n * would be a value it has to know to recognize. The pretty reporter renders\n * the dash.\n */\n version: string | null;\n /** Where the tool read its settings: the config file, or the defaults. */\n config: string;\n /** The input formats the tool reads. */\n formats: FormatInfo[];\n}\n\nexport interface ToolsOptions {\n cwd?: string;\n /** `-c/--config`. */\n configPath?: string;\n /** `--no-config`: ignore any discovered config file. */\n noConfig?: boolean;\n}\n\n/** What a run with no config file to read reports in the `config` column. */\nexport const BUILT_IN_DEFAULTS = \"built-in defaults\";\n\n/**\n * Whether the config says anything about this job.\n *\n * The job's own mapping counts, and so does every key its tool reads: a repo\n * that has written `templates:` and `overrides:` has configured the structure\n * job whether or not it also spelled `structure:` out. Saying otherwise would\n * report \"not configured\" beside a run those keys visibly govern.\n */\nfunction isConfigured(job: LintJob, config: LintConfig): boolean {\n if (config[job] !== undefined) return true;\n return (\n config.templates !== undefined ||\n config.template !== undefined ||\n config.types !== undefined ||\n config.overrides !== undefined\n );\n}\n\nexport async function runTools(opts: ToolsOptions = {}): Promise<ToolInfo[]> {\n // The same resolution every other command does, so a config this command\n // cannot read is the same exit 2 with the same message, rather than a row\n // saying \"built-in defaults\" over a file that is really there and broken.\n const cwd = opts.cwd ?? process.cwd();\n const run = await resolveLintRun({\n cwd,\n configPath: opts.configPath,\n noConfig: opts.noConfig,\n inputs: [],\n });\n\n return await Promise.all(\n LINT_JOBS.map(async (job) => {\n const tool: LintTool = run.config[job]?.tool ?? \"manni\";\n // The row is the tool's own answer about itself. It used to be two\n // literals that happened to be right while manni was the only tool:\n // \"available\" was hard-coded true, and the version was this package's\n // whatever performed the job.\n const descriptor = resolveStructureTool(tool);\n // The family's `tools:` travels with the probe: a tool outside the\n // package is found where its own `tools.<tool>` says it is, so probing\n // without it would report \"not available\" over the very installation the\n // run would go on to use.\n const probed = await descriptor.probe({\n cwd,\n tools: run.tools,\n ...(run.configDir === undefined ? {} : { configDir: run.configDir }),\n });\n return {\n job,\n tool,\n configured: isConfigured(job, run.config),\n available: probed.available,\n version: probed.version,\n config: run.configSource ?? BUILT_IN_DEFAULTS,\n formats: descriptor.formats().map((format) => ({\n ...format,\n kinds: format.kinds.filter((kind) => REPORTABLE_KINDS.has(kind)),\n })),\n };\n }),\n );\n}\n","/**\n * `manni lint templates show`: what a template asks for, as a reader scans it\n * (`pretty`), as data (`json`), or as a page to start writing from\n * (`markdown`).\n *\n * The content lines use the nouns the count findings use, so \"Contains at\n * least 1 table.\" here and \"Expected at least 1 table\" in a finding read as\n * the same rule.\n */\nimport { palette, type Colors } from \"../../shared/color.js\";\nimport { quoteList } from \"../rules/index.js\";\nimport {\n BLOCK_KINDS,\n occurrenceRange,\n type BlockKind,\n type BlockRule,\n type HeadingRule,\n type Occurrences,\n type Rule,\n} from \"../core/template.js\";\nimport type { TemplateShow } from \"../commands/templates.js\";\nimport type { ReportOptions } from \"./index.js\";\n\n/** `templates show -f`. */\nexport const SHOW_FORMATS = [\"pretty\", \"json\", \"markdown\"] as const;\nexport type ShowFormat = (typeof SHOW_FORMATS)[number];\n\nexport function isShowFormat(value: string): value is ShowFormat {\n return (SHOW_FORMATS as readonly string[]).includes(value);\n}\n\n/** How often a rule may occur, in words. */\nexport function occurrenceWords(rule: Occurrences): string {\n const { min, max } = occurrenceRange(rule);\n if (max === 0) return \"forbidden\";\n if (max === null) {\n if (min === 0) return \"optional, repeats\";\n if (min === 1) return \"required, repeats\";\n return `at least ${min}`;\n }\n if (min === 1 && max === 1) return \"required\";\n if (min === 0 && max === 1) return \"optional\";\n return `${min} to ${max}`;\n}\n\nfunction headingForm(heading: HeadingRule | undefined): string {\n if (heading === undefined) return \"(any heading)\";\n if (heading === false) return \"(no heading)\";\n if (typeof heading === \"string\") return heading;\n if (Array.isArray(heading)) return heading.join(\" | \");\n return `/${heading.pattern}/`;\n}\n\nconst NOUNS: Record<BlockKind, string> = {\n paragraphs: \"paragraph\",\n codeBlocks: \"code block\",\n lists: \"list\",\n tables: \"table\",\n admonitions: \"admonition\",\n images: \"image\",\n blockquotes: \"blockquote\",\n definitionLists: \"definition list\",\n elements: \"element\",\n};\n\n/** The noun one kind's rule counts, narrowed the way its count finding is. */\nfunction noun(kind: BlockKind, block: BlockRule): string {\n if (kind === \"lists\" && block.lists?.ordered !== undefined) {\n return block.lists.ordered ? \"numbered list\" : \"bulleted list\";\n }\n if (kind === \"admonitions\" && block.admonitions?.variant !== undefined) {\n return `${block.admonitions.variant} admonition`;\n }\n const tag = block.elements?.tag;\n if (kind === \"elements\" && tag !== undefined) {\n const tags = Array.isArray(tag) ? tag : [tag];\n return `${tags.map((t) => `\"${t}\"`).join(\" or \")} element`;\n }\n return NOUNS[kind];\n}\n\nfunction plural(word: string, n: number): string {\n return n === 1 ? word : `${word}s`;\n}\n\n/** `at least 1 table`, `at most 3 lists`, `no images`. */\nfunction counted(range: Occurrences, word: string): string {\n const { min, max } = occurrenceRange(range);\n if (max === 0) return `no ${plural(word, 0)}`;\n if (max === null) {\n return min === 0 ? `any number of ${plural(word, 0)}` : `at least ${min} ${plural(word, min)}`;\n }\n if (min === 0) return `at most ${max} ${plural(word, max)}`;\n if (min === max) return `exactly ${min} ${plural(word, min)}`;\n return `${min} to ${max} ${plural(word, max)}`;\n}\n\n/** What else a kind's rule asks of each thing it counts. */\nfunction qualifiers(block: BlockRule): string {\n const parts: string[] = [];\n if (block.paragraphs?.pattern !== undefined) {\n parts.push(`each matching /${block.paragraphs.pattern}/`);\n }\n const language = block.codeBlocks?.language;\n if (language !== undefined) {\n parts.push(`in ${(Array.isArray(language) ? language : [language]).join(\" or \")}`);\n }\n if (block.codeBlocks?.fenceInfo !== undefined) {\n parts.push(`with fence info \"${block.codeBlocks.fenceInfo}\"`);\n }\n if (block.lists?.items !== undefined) {\n parts.push(`each with ${counted(block.lists.items, \"item\")}`);\n }\n if (block.tables?.columns !== undefined) {\n parts.push(`with columns ${quoteList(block.tables.columns)}`);\n }\n return parts.map((p) => `, ${p}`).join(\"\");\n}\n\n/** The content minimums a rule sets, one line per kind, then its order. */\nfunction contentLines(rule: Rule): string[] {\n const lines: string[] = [];\n const contains = rule.contains;\n if (contains !== undefined) {\n for (const kind of BLOCK_KINDS) {\n const range = contains[kind];\n if (range === undefined) continue;\n lines.push(\n `Contains ${counted(range, noun(kind, contains))}${qualifiers({ [kind]: range })}.`,\n );\n }\n }\n if (rule.sequence !== undefined) {\n const kinds = rule.sequence.flatMap((entry) => {\n const kind = BLOCK_KINDS.find((k) => entry[k] !== undefined);\n return kind === undefined ? [] : [noun(kind, entry)];\n });\n lines.push(`In order: ${kinds.join(\", \")}.`);\n }\n return lines;\n}\n\nfunction detailLines(rule: Rule): string[] {\n return [...contentLines(rule), ...(rule.description === undefined ? [] : [rule.description])];\n}\n\n/* -------------------------------------------------------------------------- *\n * pretty\n * -------------------------------------------------------------------------- */\n\nfunction prettyRule(c: Colors, rule: Rule, level: number, indent: number, out: string[]): void {\n const pad = \" \".repeat(indent);\n const hashes = \"#\".repeat(level);\n const occurs = c.dim(occurrenceWords(rule));\n if (rule.repeat !== undefined) {\n const group = rule.id === undefined ? \"(group)\" : `(group ${rule.id})`;\n out.push(`${pad}${hashes} ${group} ${occurs}`);\n } else {\n const id = rule.id === undefined ? \"\" : `${c.cyan(rule.id)} · `;\n out.push(`${pad}${hashes} ${headingForm(rule.heading)} ${id}${occurs}`);\n }\n for (const line of detailLines(rule)) out.push(`${pad} ${line}`);\n for (const member of rule.repeat ?? []) prettyRule(c, member, level, indent + 2, out);\n for (const section of rule.sections ?? []) {\n prettyRule(c, section, level + 1, indent + 2, out);\n }\n}\n\nfunction renderPrettyShow(show: TemplateShow, c: Colors): string {\n const title = show.title ? ` ${c.dim(\"—\")} ${show.title}` : \"\";\n const lines = [`${c.bold(show.id)}${title}`];\n if (show.types !== undefined && show.types.length > 0) {\n lines.push(` types: ${show.types.join(\", \")}`);\n }\n if (show.description !== undefined) lines.push(` ${show.description}`);\n for (const line of contentLines(show)) lines.push(` ${line}`);\n if (show.guide !== undefined) lines.push(` Guide: ${show.guide}`);\n const sections = show.sections ?? [];\n if (sections.length > 0) lines.push(\"\");\n for (const section of sections) prettyRule(c, section, 2, 2, lines);\n return lines.join(\"\\n\");\n}\n\n/* -------------------------------------------------------------------------- *\n * markdown\n * -------------------------------------------------------------------------- */\n\n/** The rules a skeleton writes: no catch-all at the end, nothing forbidden. */\nfunction skeletonRules(rules: Rule[] | undefined): Rule[] {\n const kept = (rules ?? []).filter((rule) => occurrenceRange(rule).max !== 0);\n const last = kept[kept.length - 1];\n if (\n last !== undefined &&\n last.id === undefined &&\n last.heading === undefined &&\n last.repeat === undefined\n ) {\n kept.pop();\n }\n return kept;\n}\n\nfunction sentence(text: string): string {\n const trimmed = text.trim();\n return /[.!?]$/.test(trimmed) ? trimmed : `${trimmed}.`;\n}\n\n/** One HTML comment. `--` may not appear inside one, so dashes are spaced. */\nfunction comment(parts: string[]): string {\n return `<!-- ${parts.join(\" \").replace(/-(?=-)/g, \"- \")} -->`;\n}\n\nfunction capitalise(text: string): string {\n return text.charAt(0).toUpperCase() + text.slice(1);\n}\n\n/** The heading a skeleton writes: the exact text, or the first of a list. */\nfunction headingText(heading: HeadingRule | undefined): string | undefined {\n if (typeof heading === \"string\") return heading;\n return Array.isArray(heading) ? heading[0] : undefined;\n}\n\nfunction markdownRule(rule: Rule, level: number, out: string[]): void {\n if (rule.repeat !== undefined) {\n for (const member of skeletonRules(rule.repeat)) markdownRule(member, level, out);\n } else {\n if (rule.heading !== false) {\n const text = headingText(rule.heading) ?? `{${rule.id ?? \"section\"}}`;\n out.push(`${\"#\".repeat(level)} ${text}`, \"\");\n }\n out.push(\n comment([sentence(capitalise(occurrenceWords(rule))), ...detailLines(rule).map(sentence)]),\n \"\",\n );\n }\n for (const section of skeletonRules(rule.sections)) markdownRule(section, level + 1, out);\n}\n\nfunction renderMarkdownShow(show: TemplateShow): string {\n const lines: string[] = [];\n const type = show.types?.[0];\n if (type !== undefined) lines.push(\"---\", `type: ${type}`, \"---\", \"\");\n lines.push(`# ${headingText(show.heading) ?? \"{Title}\"}`, \"\");\n const parts = [\n sentence(show.id),\n ...contentLines(show),\n ...(show.description === undefined ? [] : [sentence(show.description)]),\n ...(show.guide === undefined ? [] : [`Guide: ${show.guide}`]),\n ];\n lines.push(comment(parts), \"\");\n for (const section of skeletonRules(show.sections)) markdownRule(section, 2, lines);\n return lines.join(\"\\n\").trimEnd();\n}\n\n/** Render one shown template. */\nexport function renderTemplateShow(\n show: TemplateShow,\n format: ShowFormat,\n opts: ReportOptions = {},\n): string {\n if (format === \"json\") return JSON.stringify(show, null, 2);\n if (format === \"markdown\") return renderMarkdownShow(show);\n return renderPrettyShow(show, palette(opts.color ?? false));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAS,aAAa,qBAAqB;AAsBpC,IAAM,gBAAgB,CAAC,QAAQ,MAAM;AAGrC,SAAS,cAAc,OAAqC;AACjE,SAAQ,cAAoC,SAAS,KAAK;AAC5D;AAUA,IAAM,gBAAgB;AAGtB,IAAM,WAAW,IAAI;AAAA,EACnB,YAAY,IAAI,CAAC,QAAQ,CAAC,gBAAgB,GAAG,GAAG,GAAG,CAAC;AACtD;AAOA,SAAS,SAAmB;AAC1B,SAAO;AAAA,IACL,OAAO,E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,QAAM,QAAkB,CAAC;AACzB,QAAM,OAAO,KAAK,QAAQ,CAAC;AAC3B,MAAI,SAAS,OAAW,OAAM,KAAK,OAAO,SAAS,IAAI,IAAI,OAAO,EAAE;AACpE,QAAM,KAAK,KAAK,YAAY,KAAK,OAAO,KAAK,SAAS,IAAI,EAAE;AAC5D,QAAM,QAAQ;AAAA,IACZ,SAAS,KAAK,EAAE;AAAA,IAChB,GAAG,aAAa,IAAI;AAAA,IACpB,GAAI,KAAK,gBAAgB,SAAY,CAAC,IAAI,CAAC,SAAS,KAAK,WAAW,CAAC;AAAA,IACrE,GAAI,KAAK,UAAU,SAAY,CAAC,IAAI,CAAC,UAAU,KAAK,KAAK,EAAE;AAAA,EAC7D;AACA,QAAM,KAAK,QAAQ,KAAK,GAAG,EAAE;AAC7B,aAAW,WAAW,cAAc,KAAK,QAAQ,EAAG,cAAa,SAAS,GAAG,KAAK;AAClF,SAAO,MAAM,KAAK,IAAI,EAAE,QAAQ;AAClC;AAGO,SAAS,mBACd,MACA,QACA,OAAsB,CAAC,GACf;AACR,MAAI,WAAW,OAAQ,QAAO,KAAK,UAAU,MAAM,MAAM,CAAC;AAC1D,MAAI,WAAW,WAAY,QAAO,mBAAmB,IAAI;AACzD,SAAO,iBAAiB,MAAM,QAAQ,KAAK,SAAS,KAAK,CAAC;AAC5D;","names":[]}
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  resultFor,
4
4
  splitBaselined
5
- } from "./chunk-ZRMA5U53.js";
5
+ } from "./chunk-WHVFHBL3.js";
6
6
  import {
7
7
  errorSite
8
- } from "./chunk-SGI3WPYK.js";
8
+ } from "./chunk-R2CR62JV.js";
9
9
  import {
10
10
  escapeWorkflowCommandMessage,
11
11
  escapeWorkflowCommandProperty,
@@ -51,4 +51,4 @@ export {
51
51
  findingMessage,
52
52
  renderCheckGithub
53
53
  };
54
- //# sourceMappingURL=chunk-FRM62BEN.js.map
54
+ //# sourceMappingURL=chunk-CZIO37J5.js.map
@@ -8,7 +8,7 @@ import {
8
8
  newAvailability,
9
9
  newReplay,
10
10
  remapAvailability
11
- } from "./chunk-SX626JUF.js";
11
+ } from "./chunk-APAF4VWW.js";
12
12
  import {
13
13
  makeRedactor
14
14
  } from "./chunk-6WJUZQQX.js";
@@ -864,4 +864,4 @@ export {
864
864
  parseTraceContent,
865
865
  renderTrace
866
866
  };
867
- //# sourceMappingURL=chunk-SFTWEGUD.js.map
867
+ //# sourceMappingURL=chunk-D4QHRVDJ.js.map
@@ -5,7 +5,7 @@ import {
5
5
  offerPrompt,
6
6
  planRelocation,
7
7
  relocationOffers
8
- } from "./chunk-PHOWMWFJ.js";
8
+ } from "./chunk-BXE4L52Q.js";
9
9
 
10
10
  // src/meta/core/location-writes.ts
11
11
  import { LineCounter, isMap, isNode, isScalar, parseDocument } from "yaml";
@@ -161,4 +161,4 @@ export {
161
161
  mergeMetaProvenance,
162
162
  metaProvenanceEntries
163
163
  };
164
- //# sourceMappingURL=chunk-6VGWLCYT.js.map
164
+ //# sourceMappingURL=chunk-D5GBYKDU.js.map
@@ -7,7 +7,7 @@ import {
7
7
  canonicalLanguage,
8
8
  deriveGraph,
9
9
  termIndex
10
- } from "./chunk-MNK732BZ.js";
10
+ } from "./chunk-RQPEKHZH.js";
11
11
  import {
12
12
  EmbedderUnavailableError,
13
13
  bodyOf,
@@ -28,11 +28,11 @@ import {
28
28
  partitionByLanguage,
29
29
  storeToQuads,
30
30
  validateGraph
31
- } from "./chunk-ZVEDBFTM.js";
31
+ } from "./chunk-LWBNHK72.js";
32
32
  import {
33
33
  GraphIndex,
34
34
  encodeVectorIndex
35
- } from "./chunk-Q5EKERQS.js";
35
+ } from "./chunk-NLJ3XIKT.js";
36
36
  import {
37
37
  COPIED_SHARE,
38
38
  copiedPairs,
@@ -42,7 +42,18 @@ import {
42
42
  questionKey,
43
43
  readQuestionFile,
44
44
  withExternalMetadata
45
- } from "./chunk-ITA7V5Y2.js";
45
+ } from "./chunk-BLXRIAV2.js";
46
+ import {
47
+ LOCALIZATIONS_FILENAME,
48
+ UNDETERMINED,
49
+ canonicalLanguageTag,
50
+ emitLocalizations,
51
+ isLanguageTag,
52
+ isSafeRelativePath,
53
+ parseLocalizations,
54
+ searchIndexFilename,
55
+ vectorIndexFilename
56
+ } from "./chunk-SHXPE4D4.js";
46
57
  import {
47
58
  COVERAGE_FIELDS,
48
59
  GRAPH_NOT_APPLICABLE_TO_VARIANT,
@@ -68,14 +79,12 @@ import {
68
79
  IIRDS_SOURCE,
69
80
  IIRDS_TITLE,
70
81
  IIRDS_TOPIC,
71
- LOCALIZATIONS_FILENAME,
72
82
  NS,
73
83
  PREFIXES,
74
84
  RDF_TYPE,
75
85
  SECTION_COVERAGE_FIELDS,
76
86
  STDIN,
77
87
  STDIN_PATH,
78
- UNDETERMINED,
79
88
  UNIFORM_COVERAGE_FIELD_NAMES,
80
89
  VCARD_NS,
81
90
  VCARD_ORGANIZATION,
@@ -83,29 +92,22 @@ import {
83
92
  analyzeDoc,
84
93
  assertInputFormat,
85
94
  byCodeUnit,
86
- canonicalLanguageTag,
87
95
  documentBase,
88
96
  documentSetPatterns,
89
- emitLocalizations,
90
97
  extractorFor,
91
98
  formatOf,
92
- isLanguageTag,
93
- isSafeRelativePath,
94
99
  loadRunConfig,
95
100
  metadataOf,
96
101
  noInputMessage,
97
- parseLocalizations,
98
102
  resolveDocumentSet,
99
- routesFrom,
100
- searchIndexFilename,
101
- vectorIndexFilename
102
- } from "./chunk-HIZNNOVW.js";
103
+ routesFrom
104
+ } from "./chunk-FHJIH6XP.js";
103
105
  import {
104
106
  splitBody
105
- } from "./chunk-UKSXQHSE.js";
107
+ } from "./chunk-Q76T6Y6X.js";
106
108
  import {
107
109
  mergeMetaProvenance
108
- } from "./chunk-6VGWLCYT.js";
110
+ } from "./chunk-D5GBYKDU.js";
109
111
  import {
110
112
  findWindows,
111
113
  isMissing,
@@ -114,7 +116,7 @@ import {
114
116
  pinOfLines,
115
117
  spellLines,
116
118
  spliceManifestValue
117
- } from "./chunk-PHOWMWFJ.js";
119
+ } from "./chunk-BXE4L52Q.js";
118
120
  import {
119
121
  termLabelSource
120
122
  } from "./chunk-DSWKBZWW.js";
@@ -122,7 +124,7 @@ import {
122
124
  DocmetaError,
123
125
  urlManifestMessage,
124
126
  writeFileAtomic
125
- } from "./chunk-PGDUVYTF.js";
127
+ } from "./chunk-BJUEOC4G.js";
126
128
  import {
127
129
  noticeOnce,
128
130
  warn
@@ -498,7 +500,7 @@ async function exportLlms(opts) {
498
500
  const paths = pages.map((p) => p.path);
499
501
  const view = await openMetaView(opts.source, cwd, paths, sources);
500
502
  const models = await withExternalMetadata(
501
- pages.map((p) => analyzeDoc(p.content, p.path, new Set(paths), { routes })),
503
+ await Promise.all(pages.map((p) => analyzeDoc(p.content, p.path, new Set(paths), { routes }))),
502
504
  view
503
505
  );
504
506
  const entries = [];
@@ -590,14 +592,14 @@ function runIirds(cwd, sources, graphPath, iirds, baseIri, out) {
590
592
  function searchIndexDigest(raw) {
591
593
  return `sha256:${createHash("sha256").update(raw, "utf8").digest("hex")}`;
592
594
  }
593
- function runSearchIndex(cwd, sources, graphPath, out) {
595
+ async function runSearchIndex(cwd, sources, graphPath, out) {
594
596
  const store = loadGraph(graphPath);
595
597
  const graph = GraphIndex.fromQuads(
596
598
  storeToQuads(store),
597
599
  Object.fromEntries(PREFIXES)
598
600
  );
599
601
  const warnings = [];
600
- const index = buildSearchIndex(graph, sources, { warnings });
602
+ const index = await buildSearchIndex(graph, sources, { warnings });
601
603
  const byLanguage = partitionByLanguage(graph, index);
602
604
  const docCounts = documentsByLanguage(graph);
603
605
  const outDir = out ? resolve3(cwd, out) : dirname2(graphPath);
@@ -1083,7 +1085,7 @@ var FillGuard = class _FillGuard {
1083
1085
  * other page is parsed by its extension, as `build` reads it. A page that
1084
1086
  * will not read or analyze is left out and listed in `unreadable`.
1085
1087
  */
1086
- static create(files, cwd, config, shapesPaths, force, {
1088
+ static async create(files, cwd, config, shapesPaths, force, {
1087
1089
  inline = /* @__PURE__ */ new Map(),
1088
1090
  format,
1089
1091
  inputs = /* @__PURE__ */ new Set()
@@ -1108,7 +1110,7 @@ var FillGuard = class _FillGuard {
1108
1110
  try {
1109
1111
  guard.models.set(
1110
1112
  path2,
1111
- analyzeDoc(
1113
+ await analyzeDoc(
1112
1114
  inline.get(path2) ?? readFileSync3(resolve5(cwd, path2), "utf8"),
1113
1115
  path2,
1114
1116
  guard.allPaths,
@@ -1198,7 +1200,7 @@ var FillGuard = class _FillGuard {
1198
1200
  current,
1199
1201
  { force: this.force }
1200
1202
  );
1201
- const model = analyzeDoc(
1203
+ const model = await analyzeDoc(
1202
1204
  applied.content,
1203
1205
  path2,
1204
1206
  this.allPaths,
@@ -1237,10 +1239,10 @@ var FillGuard = class _FillGuard {
1237
1239
  return { values: current, rejected };
1238
1240
  }
1239
1241
  /** Fold an accepted (written or would-be-written) doc into guard state. */
1240
- commit(path2, content) {
1242
+ async commit(path2, content) {
1241
1243
  this.models.set(
1242
1244
  path2,
1243
- analyzeDoc(content, path2, this.allPaths, this.analyzeOptions)
1245
+ await analyzeDoc(content, path2, this.allPaths, this.analyzeOptions)
1244
1246
  );
1245
1247
  this.baselineKeys = null;
1246
1248
  }
@@ -2159,7 +2161,7 @@ async function runFill(opts = {}) {
2159
2161
  if (asMetaReadsIt !== text) inline.set(path2, asMetaReadsIt);
2160
2162
  }
2161
2163
  if (stdinContent !== void 0) inline.set(STDIN_PATH, stdinContent);
2162
- const guard = !opts.noValidateGraph && config.fill.validateGraph ? FillGuard.create(
2164
+ const guard = !opts.noValidateGraph && config.fill.validateGraph ? await FillGuard.create(
2163
2165
  guardFiles.filter((path2) => !mergeErrors.has(path2)),
2164
2166
  base2,
2165
2167
  { ...config, routes: routesFrom(config, base2) },
@@ -2466,7 +2468,7 @@ async function runFill(opts = {}) {
2466
2468
  const run = await completeValidatedJSON({
2467
2469
  provider: getProvider(),
2468
2470
  system: SYSTEM_PROMPT,
2469
- user: buildUserPrompt(doc(), content, missing, {
2471
+ user: buildUserPrompt(await doc(), content, missing, {
2470
2472
  sections: withSections
2471
2473
  }),
2472
2474
  schema: proposalSchema(missing, { sections: sectionFields }),
@@ -2486,7 +2488,7 @@ async function runFill(opts = {}) {
2486
2488
  );
2487
2489
  const unknownSlugs = [];
2488
2490
  if (withSections) {
2489
- const realSlugs = new Set(doc().sections.map((s) => s.slug));
2491
+ const realSlugs = new Set((await doc()).sections.map((s) => s.slug));
2490
2492
  for (const entry of Array.isArray(proposal["sections"]) ? proposal["sections"] : []) {
2491
2493
  const slug = typeof entry["slug"] === "string" ? entry["slug"] : "";
2492
2494
  if (!realSlugs.has(slug)) {
@@ -2647,7 +2649,7 @@ async function runFill(opts = {}) {
2647
2649
  }
2648
2650
  }
2649
2651
  }
2650
- guard?.commit(path2, applied.content);
2652
+ await guard?.commit(path2, applied.content);
2651
2653
  return {
2652
2654
  after: pageContent,
2653
2655
  merged: applied.content,
@@ -3298,4 +3300,4 @@ export {
3298
3300
  runStats,
3299
3301
  renderStats
3300
3302
  };
3301
- //# sourceMappingURL=chunk-RXCDT55X.js.map
3303
+ //# sourceMappingURL=chunk-DENZLZ3Z.js.map