@hawkeyexl/manni 4.19.0 → 4.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/README.md +1 -1
  2. package/dist/{batch-R7A22ANE.js → batch-J626LZ22.js} +13 -13
  3. package/dist/{build-EUPWPNJJ.js → build-AYLD6V6Y.js} +15 -15
  4. package/dist/{calibrate-3JTVKYSQ.js → calibrate-2HZFACIX.js} +14 -14
  5. package/dist/{capture-WT4O77PA.js → capture-NMDIPC6S.js} +13 -13
  6. package/dist/{check-5HPK2S57.js → check-KNQV7GLU.js} +13 -12
  7. package/dist/check-OH4KKXP3.js +33 -0
  8. package/dist/{check-POQHLDLN.js → check-PQ7S5I3I.js} +31 -31
  9. package/dist/check-PRAMKQCI.js +47 -0
  10. package/dist/{check-KQ3KUXQT.js → check-RCSQARQE.js} +13 -13
  11. package/dist/{chunk-XGL4TSEA.js → chunk-2GTR24SA.js} +8 -8
  12. package/dist/{chunk-2BY4C2WU.js → chunk-4DFBBU4A.js} +2 -2
  13. package/dist/{chunk-CEIJV5QG.js → chunk-4F5WGZRP.js} +5 -5
  14. package/dist/{chunk-XH3NRZFD.js → chunk-4H3IOF52.js} +3 -3
  15. package/dist/{chunk-OABOOM6D.js → chunk-5CJ3P5O3.js} +13 -13
  16. package/dist/chunk-5CJ3P5O3.js.map +1 -0
  17. package/dist/{chunk-X4ZANRWU.js → chunk-5E3ABFOQ.js} +3 -3
  18. package/dist/{chunk-BJ4T6QRD.js → chunk-6FY573GB.js} +3 -3
  19. package/dist/{chunk-PF6BTJ4N.js → chunk-A633WB3N.js} +26 -26
  20. package/dist/chunk-A633WB3N.js.map +1 -0
  21. package/dist/{chunk-EWNWPYMQ.js → chunk-ACJUZFRT.js} +4 -4
  22. package/dist/{chunk-YKOB2LDR.js → chunk-BM43RJIS.js} +8 -8
  23. package/dist/{chunk-P3DDYDJW.js → chunk-BY4THWAQ.js} +3 -3
  24. package/dist/{chunk-IM2K47B7.js → chunk-C5BXSQDO.js} +5 -5
  25. package/dist/{chunk-5YOZIXTG.js → chunk-CT5WSUUZ.js} +2 -2
  26. package/dist/{chunk-5SL2QOCH.js → chunk-CXL6ES7O.js} +4 -4
  27. package/dist/{chunk-S2PXTHDM.js → chunk-D4XQX4W7.js} +2 -2
  28. package/dist/{chunk-7FDYCTXS.js → chunk-D54BQM5P.js} +8 -8
  29. package/dist/chunk-D54BQM5P.js.map +1 -0
  30. package/dist/chunk-DNF42MK7.js +326 -0
  31. package/dist/chunk-DNF42MK7.js.map +1 -0
  32. package/dist/chunk-E6JYRVR5.js +137 -0
  33. package/dist/chunk-E6JYRVR5.js.map +1 -0
  34. package/dist/{chunk-TC76MTNC.js → chunk-EOJEPEYY.js} +2 -2
  35. package/dist/{chunk-KMZF77L6.js → chunk-FIR2MAGS.js} +2 -2
  36. package/dist/chunk-FKELQCGN.js +25 -0
  37. package/dist/chunk-FKELQCGN.js.map +1 -0
  38. package/dist/{chunk-JNMY7KZG.js → chunk-G5I2JTDK.js} +2 -2
  39. package/dist/{chunk-TMPCYEGS.js → chunk-GGTCSMNX.js} +4 -4
  40. package/dist/{chunk-HCUHASZN.js → chunk-H3C3UXTA.js} +6 -6
  41. package/dist/{chunk-BMFT6SBM.js → chunk-HGUCJ3K3.js} +5 -5
  42. package/dist/{chunk-BAH6O5PN.js → chunk-ISDFYXLA.js} +38 -36
  43. package/dist/chunk-ISDFYXLA.js.map +1 -0
  44. package/dist/{chunk-6Q7JZZVG.js → chunk-JPXC62SD.js} +11 -10
  45. package/dist/chunk-JPXC62SD.js.map +1 -0
  46. package/dist/{chunk-S3WWQTJC.js → chunk-KERICP5Y.js} +6 -6
  47. package/dist/chunk-LPJ3IB26.js +64 -0
  48. package/dist/chunk-LPJ3IB26.js.map +1 -0
  49. package/dist/{chunk-K2FE4B6R.js → chunk-LXJ4FZ7Y.js} +6 -6
  50. package/dist/{chunk-SGUSZTUB.js → chunk-MJZ5HYYL.js} +22 -22
  51. package/dist/{chunk-SGUSZTUB.js.map → chunk-MJZ5HYYL.js.map} +1 -1
  52. package/dist/{chunk-6MVYXXRG.js → chunk-MJZK7G4B.js} +3 -3
  53. package/dist/{chunk-VBEFPLAN.js → chunk-MPXMQGJI.js} +7 -7
  54. package/dist/{chunk-X7RPFR6B.js → chunk-MTMR65NM.js} +2 -2
  55. package/dist/{chunk-23C7Q3Z5.js → chunk-N2VB6UUE.js} +2 -2
  56. package/dist/{chunk-5R4BXMGC.js → chunk-N3DYE6LJ.js} +5 -5
  57. package/dist/{chunk-T63LOFB2.js → chunk-NDPQ2GQ4.js} +5 -5
  58. package/dist/chunk-O4O6JOGD.js +59 -0
  59. package/dist/chunk-O4O6JOGD.js.map +1 -0
  60. package/dist/{chunk-JA25DZIV.js → chunk-ODSIHEIW.js} +6 -11
  61. package/dist/chunk-ODSIHEIW.js.map +1 -0
  62. package/dist/{chunk-IBNI5CRF.js → chunk-OQR3VVAX.js} +3 -3
  63. package/dist/{chunk-NZYXMTNI.js → chunk-OVUQNM7Y.js} +2 -2
  64. package/dist/{chunk-YL7EATZ7.js → chunk-OXCWCEVV.js} +5 -5
  65. package/dist/chunk-P5DWBG6T.js +50 -0
  66. package/dist/chunk-P5DWBG6T.js.map +1 -0
  67. package/dist/{chunk-PGMHGOLD.js → chunk-P6XZ44C2.js} +7 -7
  68. package/dist/chunk-P6XZ44C2.js.map +1 -0
  69. package/dist/{chunk-3EQR6QAZ.js → chunk-QGBNWEWS.js} +60 -63
  70. package/dist/chunk-QGBNWEWS.js.map +1 -0
  71. package/dist/{chunk-S243N72D.js → chunk-RA2BER5P.js} +2 -2
  72. package/dist/{chunk-YM2DGL3T.js → chunk-RN7IA742.js} +7 -7
  73. package/dist/{chunk-G4RTYFFR.js → chunk-ROZDHPKA.js} +3 -3
  74. package/dist/{chunk-U2PJNL3R.js → chunk-S2HW3CBF.js} +5 -5
  75. package/dist/chunk-SIREOHLW.js +233 -0
  76. package/dist/chunk-SIREOHLW.js.map +1 -0
  77. package/dist/{chunk-QYFPJY7F.js → chunk-SUTY4VCZ.js} +6 -6
  78. package/dist/{chunk-IX5YIY5O.js → chunk-TAJYMXMM.js} +2 -2
  79. package/dist/{chunk-2MRYDECM.js → chunk-TDG2S5UE.js} +2 -2
  80. package/dist/{chunk-TKINOTVS.js → chunk-TI4DA6DF.js} +1 -1
  81. package/dist/{chunk-TKINOTVS.js.map → chunk-TI4DA6DF.js.map} +1 -1
  82. package/dist/{chunk-K5Q766TX.js → chunk-UVC3BUKU.js} +3 -3
  83. package/dist/{chunk-BKWXY474.js → chunk-WI3PPQQX.js} +2 -2
  84. package/dist/{chunk-T3DDFC2B.js → chunk-WRWW6SGG.js} +2 -2
  85. package/dist/{chunk-JBJGBEBU.js → chunk-XPO655IX.js} +3 -3
  86. package/dist/chunk-XTKJNRJ6.js +33 -0
  87. package/dist/chunk-XTKJNRJ6.js.map +1 -0
  88. package/dist/{chunk-WQVXJMJM.js → chunk-YIHIRMXN.js} +7 -7
  89. package/dist/chunk-YIHIRMXN.js.map +1 -0
  90. package/dist/chunk-YM2W43DI.js +126 -0
  91. package/dist/chunk-YM2W43DI.js.map +1 -0
  92. package/dist/chunk-YYWZ2MSL.js +50 -0
  93. package/dist/chunk-YYWZ2MSL.js.map +1 -0
  94. package/dist/{chunk-NNAE7NF2.js → chunk-Z2T5U7HN.js} +2 -2
  95. package/dist/{chunk-DJM67CFP.js → chunk-ZB3OFSRB.js} +7 -32
  96. package/dist/chunk-ZB3OFSRB.js.map +1 -0
  97. package/dist/{cli-5CUZEROV.js → cli-4RTNEVVX.js} +9 -9
  98. package/dist/{cli-4QKOQEWV.js → cli-6J4P5MLU.js} +2 -2
  99. package/dist/{cli-WAXGGWNW.js → cli-DQRFSU7U.js} +15 -15
  100. package/dist/{cli-WRNKMNEM.js → cli-FTSJQSB4.js} +17 -17
  101. package/dist/{cli-2Q2OFLOI.js → cli-IIFCE6GY.js} +14 -14
  102. package/dist/{cli-TMMOVK3R.js → cli-ISKXSN3P.js} +18 -18
  103. package/dist/{cli-4OHXIGOF.js → cli-K5635N25.js} +16 -16
  104. package/dist/{cli-II4EPPDK.js → cli-K5QWXB7H.js} +31 -31
  105. package/dist/cli-K5QWXB7H.js.map +1 -0
  106. package/dist/{cli-ZEOR6LL5.js → cli-PCZ7XNCO.js} +89 -38
  107. package/dist/cli-PCZ7XNCO.js.map +1 -0
  108. package/dist/{cli-534K765K.js → cli-TCHSYJLB.js} +21 -21
  109. package/dist/{cli-R3CS7V3H.js → cli-TM2JCTQT.js} +9 -9
  110. package/dist/cli.js +20 -14
  111. package/dist/cli.js.map +1 -1
  112. package/dist/docmeta.d.ts +1 -1
  113. package/dist/docmeta.js +8 -8
  114. package/dist/github-BUK5CVQW.js +27 -0
  115. package/dist/{github-PXXYARFQ.js → github-CMAZWS76.js} +12 -12
  116. package/dist/{github-K2A4TNDE.js → github-NXR4QMMM.js} +14 -14
  117. package/dist/graph/embed.d.ts +2 -1
  118. package/dist/graph/runtime.d.ts +2 -1
  119. package/dist/index.d.ts +27 -14
  120. package/dist/index.js +101 -101
  121. package/dist/{json-ELJ5D3VR.js → json-7Z2IFGB3.js} +12 -12
  122. package/dist/json-NZSGRYOE.js +34 -0
  123. package/dist/{labels-CHN33A4X.js → labels-SE2WL7WD.js} +11 -11
  124. package/dist/{lint-PYDL7IT7.js → lint-VUYM5PPM.js} +14 -14
  125. package/dist/list-4JGOXLOZ.js +33 -0
  126. package/dist/{list-EIFNJKE5.js → list-LTF25DQE.js} +12 -12
  127. package/dist/{list-T2NPRQCA.js → list-WD3TZS5R.js} +12 -12
  128. package/dist/{page-C4P4KFUL.js → page-A2Y4ZMV4.js} +11 -11
  129. package/dist/{prepare-Q6Y4NCXU.js → prepare-M2COBP5O.js} +16 -16
  130. package/dist/{pretty-XXMCA3SX.js → pretty-D3DZFC5U.js} +12 -12
  131. package/dist/pretty-R67YU6TU.js +35 -0
  132. package/dist/{pretty-B52EGTKL.js → pretty-SFFOMSG5.js} +13 -13
  133. package/dist/{release-Z3ASYZ3S.js → release-VHHASAG7.js} +4 -4
  134. package/dist/{reporters-3MDFUPKQ.js → reporters-TO7Q6JYF.js} +4 -4
  135. package/dist/{reporters-6VOPV7L6.js → reporters-UTLJVSWX.js} +13 -13
  136. package/dist/reporters-UTLJVSWX.js.map +1 -0
  137. package/dist/{run-YFH7RPUR.js → run-BDGYRUXJ.js} +12 -12
  138. package/dist/run-BDGYRUXJ.js.map +1 -0
  139. package/dist/{sarif-RBLPUGPH.js → sarif-EHAMGCVR.js} +15 -15
  140. package/dist/sarif-EHAMGCVR.js.map +1 -0
  141. package/dist/sarif-GJYLRXLS.js +30 -0
  142. package/dist/sarif-GJYLRXLS.js.map +1 -0
  143. package/dist/{sarif-NXSMEW2M.js → sarif-IAGMXA6C.js} +10 -10
  144. package/dist/sarif-IAGMXA6C.js.map +1 -0
  145. package/dist/strategy-UKRA6WO4.js +222 -0
  146. package/dist/strategy-UKRA6WO4.js.map +1 -0
  147. package/dist/{term-QIG4USZM.js → term-AMORBEO7.js} +30 -28
  148. package/dist/term-AMORBEO7.js.map +1 -0
  149. package/dist/{validate-W2XQYBSW.js → validate-CDTKFZUV.js} +5 -5
  150. package/dist/validate-CDTKFZUV.js.map +1 -0
  151. package/package.json +21 -21
  152. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  153. package/plugin/manni/hooks/manni.mjs +29 -2
  154. package/plugin/manni/skills/fix/SKILL.md +18 -1
  155. package/plugin/manni/skills/setup/SKILL.md +1 -1
  156. package/dist/check-URJURAED.js +0 -47
  157. package/dist/chunk-3EQR6QAZ.js.map +0 -1
  158. package/dist/chunk-6Q7JZZVG.js.map +0 -1
  159. package/dist/chunk-7FDYCTXS.js.map +0 -1
  160. package/dist/chunk-BAH6O5PN.js.map +0 -1
  161. package/dist/chunk-DJM67CFP.js.map +0 -1
  162. package/dist/chunk-JA25DZIV.js.map +0 -1
  163. package/dist/chunk-OABOOM6D.js.map +0 -1
  164. package/dist/chunk-PF6BTJ4N.js.map +0 -1
  165. package/dist/chunk-PGMHGOLD.js.map +0 -1
  166. package/dist/chunk-WQVXJMJM.js.map +0 -1
  167. package/dist/cli-II4EPPDK.js.map +0 -1
  168. package/dist/cli-ZEOR6LL5.js.map +0 -1
  169. package/dist/term-QIG4USZM.js.map +0 -1
  170. /package/dist/{batch-R7A22ANE.js.map → batch-J626LZ22.js.map} +0 -0
  171. /package/dist/{build-EUPWPNJJ.js.map → build-AYLD6V6Y.js.map} +0 -0
  172. /package/dist/{calibrate-3JTVKYSQ.js.map → calibrate-2HZFACIX.js.map} +0 -0
  173. /package/dist/{capture-WT4O77PA.js.map → capture-NMDIPC6S.js.map} +0 -0
  174. /package/dist/{check-5HPK2S57.js.map → check-KNQV7GLU.js.map} +0 -0
  175. /package/dist/{check-KQ3KUXQT.js.map → check-OH4KKXP3.js.map} +0 -0
  176. /package/dist/{check-POQHLDLN.js.map → check-PQ7S5I3I.js.map} +0 -0
  177. /package/dist/{check-URJURAED.js.map → check-PRAMKQCI.js.map} +0 -0
  178. /package/dist/{cli-5CUZEROV.js.map → check-RCSQARQE.js.map} +0 -0
  179. /package/dist/{chunk-XGL4TSEA.js.map → chunk-2GTR24SA.js.map} +0 -0
  180. /package/dist/{chunk-2BY4C2WU.js.map → chunk-4DFBBU4A.js.map} +0 -0
  181. /package/dist/{chunk-CEIJV5QG.js.map → chunk-4F5WGZRP.js.map} +0 -0
  182. /package/dist/{chunk-XH3NRZFD.js.map → chunk-4H3IOF52.js.map} +0 -0
  183. /package/dist/{chunk-X4ZANRWU.js.map → chunk-5E3ABFOQ.js.map} +0 -0
  184. /package/dist/{chunk-BJ4T6QRD.js.map → chunk-6FY573GB.js.map} +0 -0
  185. /package/dist/{chunk-EWNWPYMQ.js.map → chunk-ACJUZFRT.js.map} +0 -0
  186. /package/dist/{chunk-YKOB2LDR.js.map → chunk-BM43RJIS.js.map} +0 -0
  187. /package/dist/{chunk-P3DDYDJW.js.map → chunk-BY4THWAQ.js.map} +0 -0
  188. /package/dist/{chunk-IM2K47B7.js.map → chunk-C5BXSQDO.js.map} +0 -0
  189. /package/dist/{chunk-5YOZIXTG.js.map → chunk-CT5WSUUZ.js.map} +0 -0
  190. /package/dist/{chunk-5SL2QOCH.js.map → chunk-CXL6ES7O.js.map} +0 -0
  191. /package/dist/{chunk-S2PXTHDM.js.map → chunk-D4XQX4W7.js.map} +0 -0
  192. /package/dist/{chunk-TC76MTNC.js.map → chunk-EOJEPEYY.js.map} +0 -0
  193. /package/dist/{chunk-KMZF77L6.js.map → chunk-FIR2MAGS.js.map} +0 -0
  194. /package/dist/{chunk-JNMY7KZG.js.map → chunk-G5I2JTDK.js.map} +0 -0
  195. /package/dist/{chunk-TMPCYEGS.js.map → chunk-GGTCSMNX.js.map} +0 -0
  196. /package/dist/{chunk-HCUHASZN.js.map → chunk-H3C3UXTA.js.map} +0 -0
  197. /package/dist/{chunk-BMFT6SBM.js.map → chunk-HGUCJ3K3.js.map} +0 -0
  198. /package/dist/{chunk-S3WWQTJC.js.map → chunk-KERICP5Y.js.map} +0 -0
  199. /package/dist/{chunk-K2FE4B6R.js.map → chunk-LXJ4FZ7Y.js.map} +0 -0
  200. /package/dist/{chunk-6MVYXXRG.js.map → chunk-MJZK7G4B.js.map} +0 -0
  201. /package/dist/{chunk-VBEFPLAN.js.map → chunk-MPXMQGJI.js.map} +0 -0
  202. /package/dist/{chunk-X7RPFR6B.js.map → chunk-MTMR65NM.js.map} +0 -0
  203. /package/dist/{chunk-23C7Q3Z5.js.map → chunk-N2VB6UUE.js.map} +0 -0
  204. /package/dist/{chunk-5R4BXMGC.js.map → chunk-N3DYE6LJ.js.map} +0 -0
  205. /package/dist/{chunk-T63LOFB2.js.map → chunk-NDPQ2GQ4.js.map} +0 -0
  206. /package/dist/{chunk-IBNI5CRF.js.map → chunk-OQR3VVAX.js.map} +0 -0
  207. /package/dist/{chunk-NZYXMTNI.js.map → chunk-OVUQNM7Y.js.map} +0 -0
  208. /package/dist/{chunk-YL7EATZ7.js.map → chunk-OXCWCEVV.js.map} +0 -0
  209. /package/dist/{chunk-S243N72D.js.map → chunk-RA2BER5P.js.map} +0 -0
  210. /package/dist/{chunk-YM2DGL3T.js.map → chunk-RN7IA742.js.map} +0 -0
  211. /package/dist/{chunk-G4RTYFFR.js.map → chunk-ROZDHPKA.js.map} +0 -0
  212. /package/dist/{chunk-U2PJNL3R.js.map → chunk-S2HW3CBF.js.map} +0 -0
  213. /package/dist/{chunk-QYFPJY7F.js.map → chunk-SUTY4VCZ.js.map} +0 -0
  214. /package/dist/{chunk-IX5YIY5O.js.map → chunk-TAJYMXMM.js.map} +0 -0
  215. /package/dist/{chunk-2MRYDECM.js.map → chunk-TDG2S5UE.js.map} +0 -0
  216. /package/dist/{chunk-K5Q766TX.js.map → chunk-UVC3BUKU.js.map} +0 -0
  217. /package/dist/{chunk-BKWXY474.js.map → chunk-WI3PPQQX.js.map} +0 -0
  218. /package/dist/{chunk-T3DDFC2B.js.map → chunk-WRWW6SGG.js.map} +0 -0
  219. /package/dist/{chunk-JBJGBEBU.js.map → chunk-XPO655IX.js.map} +0 -0
  220. /package/dist/{chunk-NNAE7NF2.js.map → chunk-Z2T5U7HN.js.map} +0 -0
  221. /package/dist/{github-K2A4TNDE.js.map → cli-4RTNEVVX.js.map} +0 -0
  222. /package/dist/{cli-4QKOQEWV.js.map → cli-6J4P5MLU.js.map} +0 -0
  223. /package/dist/{cli-WAXGGWNW.js.map → cli-DQRFSU7U.js.map} +0 -0
  224. /package/dist/{cli-WRNKMNEM.js.map → cli-FTSJQSB4.js.map} +0 -0
  225. /package/dist/{cli-2Q2OFLOI.js.map → cli-IIFCE6GY.js.map} +0 -0
  226. /package/dist/{cli-TMMOVK3R.js.map → cli-ISKXSN3P.js.map} +0 -0
  227. /package/dist/{cli-4OHXIGOF.js.map → cli-K5635N25.js.map} +0 -0
  228. /package/dist/{cli-534K765K.js.map → cli-TCHSYJLB.js.map} +0 -0
  229. /package/dist/{cli-R3CS7V3H.js.map → cli-TM2JCTQT.js.map} +0 -0
  230. /package/dist/{github-PXXYARFQ.js.map → github-BUK5CVQW.js.map} +0 -0
  231. /package/dist/{json-ELJ5D3VR.js.map → github-CMAZWS76.js.map} +0 -0
  232. /package/dist/{lint-PYDL7IT7.js.map → github-NXR4QMMM.js.map} +0 -0
  233. /package/dist/{list-EIFNJKE5.js.map → json-7Z2IFGB3.js.map} +0 -0
  234. /package/dist/{list-T2NPRQCA.js.map → json-NZSGRYOE.js.map} +0 -0
  235. /package/dist/{labels-CHN33A4X.js.map → labels-SE2WL7WD.js.map} +0 -0
  236. /package/dist/{page-C4P4KFUL.js.map → lint-VUYM5PPM.js.map} +0 -0
  237. /package/dist/{pretty-B52EGTKL.js.map → list-4JGOXLOZ.js.map} +0 -0
  238. /package/dist/{pretty-XXMCA3SX.js.map → list-LTF25DQE.js.map} +0 -0
  239. /package/dist/{reporters-3MDFUPKQ.js.map → list-WD3TZS5R.js.map} +0 -0
  240. /package/dist/{reporters-6VOPV7L6.js.map → page-A2Y4ZMV4.js.map} +0 -0
  241. /package/dist/{prepare-Q6Y4NCXU.js.map → prepare-M2COBP5O.js.map} +0 -0
  242. /package/dist/{run-YFH7RPUR.js.map → pretty-D3DZFC5U.js.map} +0 -0
  243. /package/dist/{sarif-NXSMEW2M.js.map → pretty-R67YU6TU.js.map} +0 -0
  244. /package/dist/{sarif-RBLPUGPH.js.map → pretty-SFFOMSG5.js.map} +0 -0
  245. /package/dist/{release-Z3ASYZ3S.js.map → release-VHHASAG7.js.map} +0 -0
  246. /package/dist/{validate-W2XQYBSW.js.map → reporters-TO7Q6JYF.js.map} +0 -0
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  resultFor,
4
4
  splitBaselined
5
- } from "./chunk-P3DDYDJW.js";
5
+ } from "./chunk-BY4THWAQ.js";
6
6
  import {
7
7
  errorSite
8
- } from "./chunk-5SL2QOCH.js";
8
+ } from "./chunk-CXL6ES7O.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-IBNI5CRF.js.map
54
+ //# sourceMappingURL=chunk-OQR3VVAX.js.map
@@ -8,7 +8,7 @@ import {
8
8
  newAvailability,
9
9
  newReplay,
10
10
  remapAvailability
11
- } from "./chunk-K5Q766TX.js";
11
+ } from "./chunk-UVC3BUKU.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-NZYXMTNI.js.map
867
+ //# sourceMappingURL=chunk-OVUQNM7Y.js.map
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  findingMessage
4
- } from "./chunk-IBNI5CRF.js";
4
+ } from "./chunk-OQR3VVAX.js";
5
5
  import {
6
6
  errorSite
7
- } from "./chunk-5SL2QOCH.js";
7
+ } from "./chunk-CXL6ES7O.js";
8
8
  import {
9
9
  RULE_ID_PREFIX,
10
10
  guidanceFor,
11
11
  isCiteRule
12
- } from "./chunk-BJ4T6QRD.js";
12
+ } from "./chunk-6FY573GB.js";
13
13
  import {
14
14
  renderSarif
15
- } from "./chunk-JBJGBEBU.js";
15
+ } from "./chunk-XPO655IX.js";
16
16
  import {
17
17
  guidanceLines
18
18
  } from "./chunk-QK6VYJHV.js";
@@ -78,4 +78,4 @@ export {
78
78
  withFindingMessages,
79
79
  renderCheckSarif
80
80
  };
81
- //# sourceMappingURL=chunk-YL7EATZ7.js.map
81
+ //# sourceMappingURL=chunk-OXCWCEVV.js.map
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ RULE_ID_PREFIX,
4
+ guidanceFor,
5
+ isStrategyRule
6
+ } from "./chunk-O4O6JOGD.js";
7
+ import {
8
+ renderSarif
9
+ } from "./chunk-XPO655IX.js";
10
+ import {
11
+ guidanceLines
12
+ } from "./chunk-QK6VYJHV.js";
13
+
14
+ // src/strategy/reporters/sarif.ts
15
+ var INFORMATION_URI = "https://hawkeyexl.github.io/manni/strategy/";
16
+ var FIELD_LABEL = /^(?:\(root\)|\/(?:audiences|personas|journeys|audience)) /;
17
+ function describeRule(rule) {
18
+ const name = rule.id.slice(RULE_ID_PREFIX.length + 1);
19
+ if (!isStrategyRule(name)) return rule;
20
+ const { description, guide } = guidanceFor(name);
21
+ const text = description ?? "";
22
+ return { id: rule.id, shortDescription: { text }, fullDescription: { text }, ...guide === null ? {} : { helpUri: guide } };
23
+ }
24
+ function renderFindingsSarif(report, opts = {}) {
25
+ const log = JSON.parse(
26
+ renderSarif(report.results, {
27
+ frame: report.frame,
28
+ ...opts.onNotice === void 0 ? {} : { onNotice: opts.onNotice },
29
+ resultProperties: (error) => {
30
+ const guidance = report.origin.get(error)?.guidance;
31
+ return guidance === void 0 ? void 0 : { guidance };
32
+ }
33
+ })
34
+ );
35
+ for (const run of log.runs) {
36
+ run.tool.driver.informationUri = INFORMATION_URI;
37
+ run.tool.driver.rules = run.tool.driver.rules.map(describeRule);
38
+ for (const result of run.results) {
39
+ const text = result.message.text.replace(FIELD_LABEL, "");
40
+ result.message.text = [text, ...guidanceLines(result.properties?.guidance)].join("\n");
41
+ }
42
+ }
43
+ return JSON.stringify(log, null, 2);
44
+ }
45
+
46
+ export {
47
+ FIELD_LABEL,
48
+ renderFindingsSarif
49
+ };
50
+ //# sourceMappingURL=chunk-P5DWBG6T.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/strategy/reporters/sarif.ts"],"sourcesContent":["/**\n * SARIF for `check`: meta's renderer over the adapted results, with each rule\n * described in its own words and linked to its section of the rules page, and\n * each message the finding's own with its guidance, as term's renderer does.\n */\nimport { renderSarif } from \"../../meta/index.js\";\nimport { guidanceLines, type Guidance } from \"../../shared/guidance.js\";\nimport type { StrategyReport } from \"../commands/findings.js\";\nimport { RULE_ID_PREFIX, guidanceFor, isStrategyRule } from \"../core/severity.js\";\n\nconst INFORMATION_URI = \"https://hawkeyexl.github.io/manni/strategy/\";\n\n/** The label meta's reporters put before a message: `(root) ` or `/<field> `. */\nexport const FIELD_LABEL = /^(?:\\(root\\)|\\/(?:audiences|personas|journeys|audience)) /;\n\ninterface SarifRule {\n id: string;\n shortDescription: { text: string };\n fullDescription?: { text: string };\n helpUri?: string;\n}\n\ninterface SarifLog {\n runs: {\n tool: { driver: { informationUri: string; rules: SarifRule[] } };\n results: { ruleId: string; message: { text: string }; properties?: { guidance?: Guidance } }[];\n }[];\n}\n\nfunction describeRule(rule: SarifRule): SarifRule {\n const name = rule.id.slice(RULE_ID_PREFIX.length + 1);\n if (!isStrategyRule(name)) return rule;\n const { description, guide } = guidanceFor(name);\n const text = description ?? \"\";\n return { id: rule.id, shortDescription: { text }, fullDescription: { text }, ...(guide === null ? {} : { helpUri: guide }) };\n}\n\nexport function renderFindingsSarif(report: StrategyReport, opts: { onNotice?: (message: string) => void } = {}): string {\n const log = JSON.parse(\n renderSarif(report.results, {\n frame: report.frame,\n ...(opts.onNotice === undefined ? {} : { onNotice: opts.onNotice }),\n resultProperties: (error) => {\n const guidance = report.origin.get(error)?.guidance;\n return guidance === undefined ? undefined : { guidance };\n },\n }),\n ) as SarifLog;\n for (const run of log.runs) {\n run.tool.driver.informationUri = INFORMATION_URI;\n run.tool.driver.rules = run.tool.driver.rules.map(describeRule);\n for (const result of run.results) {\n const text = result.message.text.replace(FIELD_LABEL, \"\");\n result.message.text = [text, ...guidanceLines(result.properties?.guidance)].join(\"\\n\");\n }\n }\n return JSON.stringify(log, null, 2);\n}\n"],"mappings":";;;;;;;;;;;;;;AAUA,IAAM,kBAAkB;AAGjB,IAAM,cAAc;AAgB3B,SAAS,aAAa,MAA4B;AAChD,QAAM,OAAO,KAAK,GAAG,MAAM,eAAe,SAAS,CAAC;AACpD,MAAI,CAAC,eAAe,IAAI,EAAG,QAAO;AAClC,QAAM,EAAE,aAAa,MAAM,IAAI,YAAY,IAAI;AAC/C,QAAM,OAAO,eAAe;AAC5B,SAAO,EAAE,IAAI,KAAK,IAAI,kBAAkB,EAAE,KAAK,GAAG,iBAAiB,EAAE,KAAK,GAAG,GAAI,UAAU,OAAO,CAAC,IAAI,EAAE,SAAS,MAAM,EAAG;AAC7H;AAEO,SAAS,oBAAoB,QAAwB,OAAiD,CAAC,GAAW;AACvH,QAAM,MAAM,KAAK;AAAA,IACf,YAAY,OAAO,SAAS;AAAA,MAC1B,OAAO,OAAO;AAAA,MACd,GAAI,KAAK,aAAa,SAAY,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS;AAAA,MACjE,kBAAkB,CAAC,UAAU;AAC3B,cAAM,WAAW,OAAO,OAAO,IAAI,KAAK,GAAG;AAC3C,eAAO,aAAa,SAAY,SAAY,EAAE,SAAS;AAAA,MACzD;AAAA,IACF,CAAC;AAAA,EACH;AACA,aAAW,OAAO,IAAI,MAAM;AAC1B,QAAI,KAAK,OAAO,iBAAiB;AACjC,QAAI,KAAK,OAAO,QAAQ,IAAI,KAAK,OAAO,MAAM,IAAI,YAAY;AAC9D,eAAW,UAAU,IAAI,SAAS;AAChC,YAAM,OAAO,OAAO,QAAQ,KAAK,QAAQ,aAAa,EAAE;AACxD,aAAO,QAAQ,OAAO,CAAC,MAAM,GAAG,cAAc,OAAO,YAAY,QAAQ,CAAC,EAAE,KAAK,IAAI;AAAA,IACvF;AAAA,EACF;AACA,SAAO,KAAK,UAAU,KAAK,MAAM,CAAC;AACpC;","names":[]}
@@ -8,24 +8,24 @@ import {
8
8
  loadTemplateFile,
9
9
  resolveLintRun,
10
10
  resolveStructureTool
11
- } from "./chunk-WQVXJMJM.js";
11
+ } from "./chunk-YIHIRMXN.js";
12
12
  import {
13
13
  parserByName,
14
14
  parserForExtension,
15
15
  unsupportedFormatMessage
16
- } from "./chunk-3EQR6QAZ.js";
16
+ } from "./chunk-QGBNWEWS.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-JA25DZIV.js";
28
+ } from "./chunk-ODSIHEIW.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-PGMHGOLD.js.map
528
+ //# sourceMappingURL=chunk-P6XZ44C2.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,Q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AAW,cAAc,KAAK,QAAQ,EAAG,cAAa,SAAS,QAAQ,GAAG,GAAG;AAC1F;AAEA,SAAS,mBAAmB,MAA4B;AACtD,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":[]}
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  LintError
4
- } from "./chunk-TKINOTVS.js";
4
+ } from "./chunk-TI4DA6DF.js";
5
5
  import {
6
6
  extractFrontmatter,
7
7
  extractorForExtension,
8
8
  locateFrontmatter
9
- } from "./chunk-T3DDFC2B.js";
9
+ } from "./chunk-WRWW6SGG.js";
10
10
  import {
11
11
  errorMessage
12
12
  } from "./chunk-G3T47CFV.js";
@@ -333,10 +333,10 @@ function withoutFence(content) {
333
333
  // src/lint/parsers/markdown.ts
334
334
  var markdownProcessor = unified().use(remarkParse).use(remarkGfm).use(remarkFrontmatter, ["yaml", "toml"]);
335
335
  var mdxProcessor = unified().use(remarkParse).use(remarkGfm).use(remarkFrontmatter, ["yaml", "toml"]).use(remarkMdx);
336
- function parseWith(processor2, format, content, filePath) {
336
+ function parseWith(processor, format, content, filePath) {
337
337
  let root;
338
338
  try {
339
- root = processor2.parse(content);
339
+ root = processor.parse(content);
340
340
  } catch (err) {
341
341
  throw new LintError(
342
342
  `${filePath}: could not parse as ${format}: ${errorMessage(err)}`
@@ -2679,14 +2679,10 @@ var xmlParser = {
2679
2679
  };
2680
2680
 
2681
2681
  // src/lint/parsers/asciidoc.ts
2682
- import { createRequire } from "node:module";
2683
- var processor;
2684
- function getProcessor() {
2685
- if (processor === void 0) {
2686
- const factory = createRequire(import.meta.url)("@asciidoctor/core");
2687
- processor = factory();
2688
- }
2689
- return processor;
2682
+ var asciidoctor;
2683
+ function getAsciidoctor() {
2684
+ asciidoctor ??= import("@asciidoctor/core");
2685
+ return asciidoctor;
2690
2686
  }
2691
2687
  function asNode(value) {
2692
2688
  const node = value;
@@ -2753,18 +2749,17 @@ function decodeEntities(text) {
2753
2749
  (whole, name) => NAMED_ENTITIES[name.toLowerCase()] ?? whole
2754
2750
  );
2755
2751
  }
2756
- var harvested = [];
2757
2752
  var ANCHOR = /<a\s([^>]*)>/gi;
2758
2753
  var HREF = /(?:^|\s)href="([^"]*)"/;
2759
2754
  var CLASS = /(?:^|\s)class="([^"]*)"/;
2760
- function inline(html, line) {
2755
+ function inline(html, line, links) {
2761
2756
  for (const match of (html ?? "").matchAll(ANCHOR)) {
2762
2757
  const attrs = match[1] ?? "";
2763
2758
  const href = HREF.exec(attrs)?.[1];
2764
2759
  if (href === void 0) continue;
2765
2760
  const classes = (CLASS.exec(attrs)?.[1] ?? "").split(/\s+/);
2766
2761
  if (classes.includes("include") || classes.includes("footnote")) continue;
2767
- harvested.push({ target: decodeEntities(href), line });
2762
+ links.push({ target: decodeEntities(href), line });
2768
2763
  }
2769
2764
  return flattenInline2(html);
2770
2765
  }
@@ -2772,26 +2767,27 @@ function stringAttribute(node, name) {
2772
2767
  const value = node.getAttribute?.(name);
2773
2768
  return typeof value === "string" && value.length > 0 ? value : void 0;
2774
2769
  }
2775
- function draftList(node, ordered) {
2770
+ async function draftList(node, ordered, links) {
2776
2771
  const items = [];
2777
2772
  for (const raw of node.getItems?.() ?? []) {
2778
2773
  const item = asItem(raw);
2779
2774
  if (!item) continue;
2780
2775
  const line = lineOf(item);
2781
- const text = inline(item.getText(), line);
2776
+ const text = inline(item.getText(), line, links);
2782
2777
  const children = [];
2783
2778
  if (text.length > 0) children.push({ kind: "paragraph", line, text });
2784
- collect(
2779
+ await collect(
2785
2780
  item.getBlocks().map(asNode).filter((n) => n !== null),
2786
- children
2781
+ children,
2782
+ links
2787
2783
  );
2788
2784
  items.push({ line, text, children });
2789
2785
  }
2790
2786
  return { kind: "list", line: lineOf(node), ordered, items };
2791
2787
  }
2792
- function draftChildren(node) {
2788
+ async function draftChildren(node, links) {
2793
2789
  const children = [];
2794
- collect(childrenOf(node), children);
2790
+ await collect(childrenOf(node), children, links);
2795
2791
  return children;
2796
2792
  }
2797
2793
  var ADMONITION_VARIANTS4 = /* @__PURE__ */ new Set([
@@ -2805,43 +2801,43 @@ function admonitionVariant(node) {
2805
2801
  const name = stringAttribute(node, "name")?.toLowerCase();
2806
2802
  return name && ADMONITION_VARIANTS4.has(name) ? name : null;
2807
2803
  }
2808
- function draftAdmonition(node, variant) {
2809
- const children = draftChildren(node);
2804
+ async function draftAdmonition(node, variant, links) {
2805
+ const children = await draftChildren(node, links);
2810
2806
  if (children.length === 0) {
2811
- const text = inline(node.getContent?.(), lineOf(node));
2807
+ const text = inline(await node.getContent?.(), lineOf(node), links);
2812
2808
  if (text.length > 0) children.push({ kind: "paragraph", line: lineOf(node), text });
2813
2809
  }
2814
2810
  return { kind: "admonition", line: lineOf(node), variant, children };
2815
2811
  }
2816
- function draftBlockquote(node) {
2817
- const children = draftChildren(node);
2812
+ async function draftBlockquote(node, links) {
2813
+ const children = await draftChildren(node, links);
2818
2814
  if (children.length === 0) {
2819
- const text = inline(node.getContent?.(), lineOf(node));
2815
+ const text = inline(await node.getContent?.(), lineOf(node), links);
2820
2816
  if (text.length > 0) children.push({ kind: "paragraph", line: lineOf(node), text });
2821
2817
  }
2822
2818
  return { kind: "blockquote", line: lineOf(node), children };
2823
2819
  }
2824
- function draftTable(node) {
2825
- const rows = node.getRows?.();
2820
+ function draftTable(node, links) {
2821
+ const rows = node.rows;
2826
2822
  const toRow = (header) => (cells) => ({
2827
2823
  line: cells[0]?.getLineNumber?.() ?? lineOf(node),
2828
2824
  header,
2829
2825
  cells: cells.map((cell) => {
2830
2826
  const line = cell.getLineNumber?.() ?? lineOf(node);
2831
- return { line, text: inline(cell.getText(), line) };
2827
+ return { line, text: inline(cell.getText(), line, links) };
2832
2828
  })
2833
2829
  });
2834
2830
  return {
2835
2831
  kind: "table",
2836
2832
  line: lineOf(node),
2837
2833
  rows: [
2838
- ...rows?.getHead().map(toRow(true)) ?? [],
2839
- ...rows?.getBody().map(toRow(false)) ?? [],
2840
- ...rows?.getFoot().map(toRow(false)) ?? []
2834
+ ...rows?.head.map(toRow(true)) ?? [],
2835
+ ...rows?.body.map(toRow(false)) ?? [],
2836
+ ...rows?.foot.map(toRow(false)) ?? []
2841
2837
  ]
2842
2838
  };
2843
2839
  }
2844
- function draftDefinitionList(node) {
2840
+ async function draftDefinitionList(node, links) {
2845
2841
  const items = [];
2846
2842
  for (const entry of node.getItems?.() ?? []) {
2847
2843
  if (!Array.isArray(entry)) continue;
@@ -2852,28 +2848,29 @@ function draftDefinitionList(node) {
2852
2848
  const children = [];
2853
2849
  const desc = asItem(rawDesc);
2854
2850
  if (desc) {
2855
- const text = inline(desc.getText(), lineOf(desc));
2851
+ const text = inline(desc.getText(), lineOf(desc), links);
2856
2852
  if (text.length > 0) children.push({ kind: "paragraph", line: lineOf(desc), text });
2857
- collect(
2853
+ await collect(
2858
2854
  desc.getBlocks().map(asNode).filter((n) => n !== null),
2859
- children
2855
+ children,
2856
+ links
2860
2857
  );
2861
2858
  }
2862
2859
  items.push({
2863
2860
  line: lineOf(first),
2864
- term: terms.map((t) => inline(t.getText(), lineOf(t))).join(", "),
2861
+ term: terms.map((t) => inline(t.getText(), lineOf(t), links)).join(", "),
2865
2862
  children
2866
2863
  });
2867
2864
  }
2868
2865
  return { kind: "definitionList", line: lineOf(node), items };
2869
2866
  }
2870
- function draftOf(node) {
2867
+ async function draftOf(node, links) {
2871
2868
  switch (node.getContext()) {
2872
2869
  case "paragraph":
2873
2870
  return {
2874
2871
  kind: "paragraph",
2875
2872
  line: lineOf(node),
2876
- text: inline(node.getContent?.(), lineOf(node))
2873
+ text: inline(await node.getContent?.(), lineOf(node), links)
2877
2874
  };
2878
2875
  case "listing":
2879
2876
  case "literal": {
@@ -2888,19 +2885,19 @@ function draftOf(node) {
2888
2885
  };
2889
2886
  }
2890
2887
  case "ulist":
2891
- return draftList(node, false);
2888
+ return draftList(node, false, links);
2892
2889
  case "olist":
2893
- return draftList(node, true);
2890
+ return draftList(node, true, links);
2894
2891
  case "table":
2895
- return draftTable(node);
2892
+ return draftTable(node, links);
2896
2893
  case "admonition": {
2897
2894
  const variant = admonitionVariant(node);
2898
- return variant ? draftAdmonition(node, variant) : null;
2895
+ return variant ? draftAdmonition(node, variant, links) : null;
2899
2896
  }
2900
2897
  case "image": {
2901
2898
  const url = stringAttribute(node, "target");
2902
2899
  if (!url) return null;
2903
- const title = inline(node.getTitle?.(), lineOf(node));
2900
+ const title = inline(node.getTitle?.(), lineOf(node), links);
2904
2901
  return {
2905
2902
  kind: "image",
2906
2903
  line: lineOf(node),
@@ -2910,14 +2907,14 @@ function draftOf(node) {
2910
2907
  };
2911
2908
  }
2912
2909
  case "quote":
2913
- return draftBlockquote(node);
2910
+ return draftBlockquote(node, links);
2914
2911
  case "dlist":
2915
- return draftDefinitionList(node);
2912
+ return draftDefinitionList(node, links);
2916
2913
  default:
2917
2914
  return null;
2918
2915
  }
2919
2916
  }
2920
- function collect(nodes, out) {
2917
+ async function collect(nodes, out, links) {
2921
2918
  for (const node of nodes) {
2922
2919
  const context = node.getContext();
2923
2920
  if (context === "section") {
@@ -2928,17 +2925,17 @@ function collect(nodes, out) {
2928
2925
  // Asciidoctor's `=` title is level 0, so every level is one shallower
2929
2926
  // than the heading level the rest of the tool speaks in.
2930
2927
  level: (node.getLevel?.() ?? 0) + 1,
2931
- title: inline(node.getTitle?.(), lineOf(node)),
2928
+ title: inline(node.getTitle?.(), lineOf(node), links),
2932
2929
  ...id ? { id } : {}
2933
2930
  });
2934
- collect(childrenOf(node), out);
2931
+ await collect(childrenOf(node), out, links);
2935
2932
  continue;
2936
2933
  }
2937
2934
  if (context === "preamble" || context === "open") {
2938
- collect(childrenOf(node), out);
2935
+ await collect(childrenOf(node), out, links);
2939
2936
  continue;
2940
2937
  }
2941
- const draft = draftOf(node);
2938
+ const draft = await draftOf(node, links);
2942
2939
  if (draft) out.push(draft);
2943
2940
  }
2944
2941
  }
@@ -3118,10 +3115,10 @@ function metadata(content, filePath, index) {
3118
3115
  position: (fenced.present ? fencedPosition(content) : null) ?? headerPosition(content, index)
3119
3116
  };
3120
3117
  }
3121
- function load(content, filePath) {
3122
- const asciidoc = getProcessor();
3118
+ async function load(content, filePath) {
3119
+ const asciidoc = await getAsciidoctor();
3123
3120
  try {
3124
- return asciidoc.load(content, {
3121
+ return await asciidoc.load(content, {
3125
3122
  // Without this every block's `getLineNumber()` is undefined and there are
3126
3123
  // no positions to derive at all.
3127
3124
  sourcemap: true,
@@ -3144,11 +3141,11 @@ function load(content, filePath) {
3144
3141
  );
3145
3142
  }
3146
3143
  }
3147
- function headerDraft(doc) {
3144
+ function headerDraft(doc, links) {
3148
3145
  if (!doc.hasHeader()) return null;
3149
3146
  const header = asNode(doc.getHeader());
3150
3147
  if (!header) return null;
3151
- const title = inline(header.getTitle?.(), lineOf(header));
3148
+ const title = inline(header.getTitle?.(), lineOf(header), links);
3152
3149
  if (title.length === 0) return null;
3153
3150
  return {
3154
3151
  kind: "heading",
@@ -3157,14 +3154,14 @@ function headerDraft(doc) {
3157
3154
  title
3158
3155
  };
3159
3156
  }
3160
- function parse2(content, filePath) {
3161
- const doc = load(content, filePath);
3157
+ async function parse2(content, filePath) {
3158
+ const doc = await load(content, filePath);
3162
3159
  const index = lineIndex(content);
3163
- harvested = [];
3160
+ const harvested = [];
3164
3161
  const drafts = [];
3165
- const header = headerDraft(doc);
3162
+ const header = headerDraft(doc, harvested);
3166
3163
  if (header) drafts.push(header);
3167
- collect(childrenOf(doc), drafts);
3164
+ await collect(childrenOf(doc), drafts, harvested);
3168
3165
  const links = harvested.sort((a, b) => a.line - b.line).map(({ target, line }) => ({
3169
3166
  target,
3170
3167
  position: { start: index.start(line), end: index.endOfLine(line) }
@@ -3247,4 +3244,4 @@ export {
3247
3244
  unsupportedFormatMessage,
3248
3245
  listFormats
3249
3246
  };
3250
- //# sourceMappingURL=chunk-3EQR6QAZ.js.map
3247
+ //# sourceMappingURL=chunk-QGBNWEWS.js.map