@hawkeyexl/manni 4.28.0 → 4.29.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 (239) hide show
  1. package/README.md +33 -15
  2. package/dist/{batch-PR6HELQ3.js → batch-LKECW5WN.js} +12 -12
  3. package/dist/{build-IJIWQIKR.js → build-PIWP7QEQ.js} +13 -13
  4. package/dist/{calibrate-OO6JL6BK.js → calibrate-QBAVFCXX.js} +13 -13
  5. package/dist/{capture-M73GEEBJ.js → capture-VS4HY2FL.js} +12 -12
  6. package/dist/check-3AZ33DIQ.js +58 -0
  7. package/dist/{check-MAB3XYX5.js → check-6T3ZZTBW.js} +12 -12
  8. package/dist/{check-V3MJF3LV.js → check-C7GN5ZUC.js} +10 -10
  9. package/dist/{check-5PZYQV3S.js → check-HIIEDFCI.js} +22 -22
  10. package/dist/{check-FXAHW6N5.js → check-LKZ2D5Y3.js} +13 -13
  11. package/dist/{chunk-NENXKSOX.js → chunk-2A7L2AC2.js} +4 -4
  12. package/dist/{chunk-NKE3SJ7O.js → chunk-2AC35AS2.js} +8 -8
  13. package/dist/{chunk-4QJJG2DG.js → chunk-2HZR3H2N.js} +2 -2
  14. package/dist/{chunk-E6TI5H2P.js → chunk-3FDQKFNQ.js} +2 -2
  15. package/dist/{chunk-FK65KN2H.js → chunk-3LAEG2JM.js} +4 -4
  16. package/dist/{chunk-HZUYNBWK.js → chunk-3NGA6KCU.js} +7 -6
  17. package/dist/chunk-3NGA6KCU.js.map +1 -0
  18. package/dist/{chunk-YGVCKNKQ.js → chunk-44N4NCOQ.js} +2 -2
  19. package/dist/{chunk-6YUNB4VT.js → chunk-4AWM6625.js} +4 -4
  20. package/dist/{chunk-MSX65NSU.js → chunk-4XTNIPXL.js} +2 -2
  21. package/dist/{chunk-ENK42KDR.js → chunk-4ZKEJPRY.js} +341 -43
  22. package/dist/chunk-4ZKEJPRY.js.map +1 -0
  23. package/dist/{chunk-7DZ6DJOF.js → chunk-5BHBLVBD.js} +3 -3
  24. package/dist/{chunk-7L6GS7LH.js → chunk-5LSQZBLS.js} +4 -4
  25. package/dist/{chunk-N2RRDNVX.js → chunk-6FNRVJQC.js} +6 -6
  26. package/dist/{chunk-VDJGTAVP.js → chunk-6QMD7FTM.js} +4 -4
  27. package/dist/{chunk-HM2EZX66.js → chunk-77RJZP3W.js} +7 -7
  28. package/dist/{chunk-FWJGGP2J.js → chunk-7QIYWXKX.js} +10 -10
  29. package/dist/{chunk-CY3NIZZF.js → chunk-7SYTA2HW.js} +2 -2
  30. package/dist/{chunk-XWWYVVKL.js → chunk-A2DDN2HO.js} +2 -2
  31. package/dist/{chunk-WHG5WJBY.js → chunk-A6FYDQC2.js} +4 -4
  32. package/dist/{chunk-E2ZPFHHR.js → chunk-ACHFEEYB.js} +2 -2
  33. package/dist/{chunk-X42S4Y3E.js → chunk-AWJ7UWOH.js} +21 -5
  34. package/dist/{chunk-X42S4Y3E.js.map → chunk-AWJ7UWOH.js.map} +1 -1
  35. package/dist/{chunk-WZDL4XDO.js → chunk-BS2HWHLN.js} +6 -6
  36. package/dist/{chunk-2EW7JGHQ.js → chunk-C6M7SALA.js} +7 -7
  37. package/dist/{chunk-BEKZC55J.js → chunk-C7KHPFDN.js} +8 -8
  38. package/dist/{chunk-A7JU42HX.js → chunk-D6HTXNFN.js} +2 -2
  39. package/dist/{chunk-SWGLTZR3.js → chunk-DA5RHOH4.js} +5 -5
  40. package/dist/{chunk-FOUZK5XB.js → chunk-DM64IZA5.js} +3 -3
  41. package/dist/{chunk-RCLF35PJ.js → chunk-DT4VOGC6.js} +8 -8
  42. package/dist/{chunk-4WKXAVEW.js → chunk-FR5IEI5I.js} +3 -3
  43. package/dist/{chunk-S34LFS5R.js → chunk-FRAEC2Y4.js} +3 -3
  44. package/dist/{chunk-232TBIFA.js → chunk-HGL5VY2P.js} +4 -4
  45. package/dist/{chunk-WFHPNJNT.js → chunk-HV6QKQTR.js} +3 -3
  46. package/dist/{chunk-IFMEIUTY.js → chunk-I4C5VROJ.js} +2 -2
  47. package/dist/{chunk-TKU525DB.js → chunk-IPET4C6M.js} +10 -10
  48. package/dist/{chunk-AXLWNX4Y.js → chunk-IYGSEC73.js} +2 -2
  49. package/dist/{chunk-5NFGWFLC.js → chunk-KCNRAZON.js} +8 -8
  50. package/dist/{chunk-XXW572PF.js → chunk-KZK5JOET.js} +6 -6
  51. package/dist/{chunk-WXDNQMUI.js → chunk-LD7BSZMJ.js} +5 -5
  52. package/dist/{chunk-RHNEQRPJ.js → chunk-LPTOSRG4.js} +2 -2
  53. package/dist/{chunk-GZVHZCUI.js → chunk-MD52QS2O.js} +3 -3
  54. package/dist/{chunk-DJT5F4MT.js → chunk-N7HOXMHV.js} +3 -3
  55. package/dist/{chunk-IWZH3YPO.js → chunk-NA3M7JLP.js} +6 -6
  56. package/dist/{chunk-KGC6FPEP.js → chunk-OAA6SX2W.js} +3 -3
  57. package/dist/{chunk-JMDZFDCS.js → chunk-OY7AMSDK.js} +2 -2
  58. package/dist/{chunk-HV7R7EP7.js → chunk-PVAJUMDT.js} +4 -4
  59. package/dist/{chunk-ZWVYT2G6.js → chunk-QEFVMOWF.js} +1 -1
  60. package/dist/chunk-QEFVMOWF.js.map +1 -0
  61. package/dist/{chunk-ZV3NEWTY.js → chunk-RZX6I2NY.js} +3 -3
  62. package/dist/{chunk-FCLA7EH4.js → chunk-SF2WTUDR.js} +3 -3
  63. package/dist/{chunk-NWS5NNHX.js → chunk-SFUKZRTP.js} +2 -2
  64. package/dist/{chunk-DEDH7IH3.js → chunk-SXWPKK4D.js} +2 -2
  65. package/dist/{chunk-ZL2KZRNC.js → chunk-TTHG53NH.js} +6 -6
  66. package/dist/{chunk-DXGRODYQ.js → chunk-TWOWMTIH.js} +14 -7
  67. package/dist/chunk-TWOWMTIH.js.map +1 -0
  68. package/dist/{chunk-XHBRV4QK.js → chunk-VGIKTY7D.js} +2 -2
  69. package/dist/{chunk-732PX32V.js → chunk-VQB22TCH.js} +366 -234
  70. package/dist/chunk-VQB22TCH.js.map +1 -0
  71. package/dist/{chunk-PDIBXVWI.js → chunk-WV5VMIC5.js} +5 -5
  72. package/dist/{chunk-H5HWF2RF.js → chunk-Y7SBE6TC.js} +3 -3
  73. package/dist/{chunk-BOVAHVNE.js → chunk-YBDRFSOK.js} +5 -5
  74. package/dist/{chunk-KIYDAB7Q.js → chunk-YQG4YCQL.js} +3 -3
  75. package/dist/{chunk-JNYYKYOX.js → chunk-YWHSZSQL.js} +3 -3
  76. package/dist/{chunk-QBTDPI57.js → chunk-Z2KVPZYI.js} +2 -2
  77. package/dist/{chunk-QBTDPI57.js.map → chunk-Z2KVPZYI.js.map} +1 -1
  78. package/dist/{chunk-OLFYMD26.js → chunk-ZMLGMLXE.js} +13 -13
  79. package/dist/{chunk-P5KEPKW4.js → chunk-ZWE73OJR.js} +38 -15
  80. package/dist/chunk-ZWE73OJR.js.map +1 -0
  81. package/dist/{cli-QZTJ5LB3.js → cli-56Z2RAWA.js} +30 -23
  82. package/dist/{cli-QZTJ5LB3.js.map → cli-56Z2RAWA.js.map} +1 -1
  83. package/dist/{cli-L5NG7KFW.js → cli-AVOEQZZM.js} +16 -16
  84. package/dist/{cli-7OWZWDEE.js → cli-B3RIVCKY.js} +52 -52
  85. package/dist/{cli-5ASE6JCZ.js → cli-BI2GQEDM.js} +26 -26
  86. package/dist/{cli-ZC2XIC3A.js → cli-OIYUAXPA.js} +33 -33
  87. package/dist/{cli-3FJLVOVV.js → cli-OY6RHP5P.js} +7 -7
  88. package/dist/{cli-CWLFP4LA.js → cli-Q3ZRWXB4.js} +19 -19
  89. package/dist/{cli-BBKPB2HF.js → cli-RMIZNJL3.js} +13 -13
  90. package/dist/{cli-FZ3TF4OX.js → cli-UINJ634O.js} +2 -2
  91. package/dist/{cli-G7DMKZFI.js → cli-YAG5OFYC.js} +27 -27
  92. package/dist/{cli-73QJRBGD.js → cli-ZTSPDBDE.js} +13 -13
  93. package/dist/cli.js +15 -15
  94. package/dist/docmeta.js +6 -6
  95. package/dist/{github-YO4WC4Q4.js → github-B3QCNYMP.js} +12 -12
  96. package/dist/{github-CMA4NVGZ.js → github-PLPEWRPJ.js} +10 -10
  97. package/dist/github-XBGWVVIA.js +49 -0
  98. package/dist/index.d.ts +2638 -2543
  99. package/dist/index.js +71 -193
  100. package/dist/index.js.map +1 -1
  101. package/dist/{json-W4ATTXER.js → json-7ERIDOTV.js} +13 -13
  102. package/dist/{json-SFFOWLUQ.js → json-UNN7BJM6.js} +10 -10
  103. package/dist/{labels-ILSCGLR2.js → labels-XUW7THEE.js} +9 -9
  104. package/dist/{lint-YLEK6OWJ.js → lint-NWSLIVHJ.js} +11 -11
  105. package/dist/{list-BPZQKN4W.js → list-BKD62XJ4.js} +12 -12
  106. package/dist/{list-F3XQLKBG.js → list-TXOFFLES.js} +10 -10
  107. package/dist/list-WM4EHFC6.js +56 -0
  108. package/dist/{page-GL2IKGR7.js → page-CFDNR2OB.js} +9 -9
  109. package/dist/{prepare-IWGF6RYG.js → prepare-Y7WBJ3RZ.js} +11 -11
  110. package/dist/{pretty-MSZCPJCI.js → pretty-ALGCRVPF.js} +12 -12
  111. package/dist/{pretty-T6F4E24U.js → pretty-BX6RMDVM.js} +22 -22
  112. package/dist/{pretty-IWCYUTFE.js → pretty-MTAJRM7S.js} +10 -10
  113. package/dist/{reporters-4X4NKOXM.js → reporters-OZPJP6UK.js} +4 -4
  114. package/dist/{reporters-FR4AXDLX.js → reporters-QSBVVOX7.js} +10 -10
  115. package/dist/run-UTKXWCM4.js +59 -0
  116. package/dist/sarif-6QY3B2KF.js +50 -0
  117. package/dist/{sarif-K22E6B5M.js → sarif-JZSDSSBV.js} +8 -8
  118. package/dist/{sarif-EASXSUVZ.js → sarif-KTMQVMN5.js} +8 -8
  119. package/dist/{strategy-N2D5HM4C.js → strategy-G25TI5UA.js} +19 -19
  120. package/dist/{term-43EIVTZC.js → term-YYIAR32K.js} +15 -15
  121. package/dist/{validate-TQPUQUT2.js → validate-VKZJAD77.js} +4 -4
  122. package/package.json +1 -1
  123. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  124. package/schemas/lint/template.json +6 -0
  125. package/templates/lint/tgdp/concept.yaml +46 -0
  126. package/templates/lint/tgdp/how-to.yaml +48 -0
  127. package/templates/lint/tgdp/readme.yaml +35 -0
  128. package/templates/lint/tgdp/reference.yaml +49 -0
  129. package/templates/lint/tgdp/release-notes.yaml +47 -0
  130. package/templates/lint/tgdp/troubleshooting.yaml +35 -0
  131. package/templates/lint/tgdp/tutorial.yaml +38 -0
  132. package/dist/check-WYJYCP4C.js +0 -58
  133. package/dist/chunk-732PX32V.js.map +0 -1
  134. package/dist/chunk-DXGRODYQ.js.map +0 -1
  135. package/dist/chunk-ENK42KDR.js.map +0 -1
  136. package/dist/chunk-HZUYNBWK.js.map +0 -1
  137. package/dist/chunk-P5KEPKW4.js.map +0 -1
  138. package/dist/chunk-ZWVYT2G6.js.map +0 -1
  139. package/dist/github-KD6OPT6N.js +0 -49
  140. package/dist/list-ZDVWETJA.js +0 -49
  141. package/dist/run-4SBRYTKW.js +0 -52
  142. package/dist/sarif-L7IEQ7TT.js +0 -50
  143. /package/dist/{batch-PR6HELQ3.js.map → batch-LKECW5WN.js.map} +0 -0
  144. /package/dist/{build-IJIWQIKR.js.map → build-PIWP7QEQ.js.map} +0 -0
  145. /package/dist/{calibrate-OO6JL6BK.js.map → calibrate-QBAVFCXX.js.map} +0 -0
  146. /package/dist/{capture-M73GEEBJ.js.map → capture-VS4HY2FL.js.map} +0 -0
  147. /package/dist/{check-5PZYQV3S.js.map → check-3AZ33DIQ.js.map} +0 -0
  148. /package/dist/{check-MAB3XYX5.js.map → check-6T3ZZTBW.js.map} +0 -0
  149. /package/dist/{check-V3MJF3LV.js.map → check-C7GN5ZUC.js.map} +0 -0
  150. /package/dist/{check-WYJYCP4C.js.map → check-HIIEDFCI.js.map} +0 -0
  151. /package/dist/{check-FXAHW6N5.js.map → check-LKZ2D5Y3.js.map} +0 -0
  152. /package/dist/{chunk-NENXKSOX.js.map → chunk-2A7L2AC2.js.map} +0 -0
  153. /package/dist/{chunk-NKE3SJ7O.js.map → chunk-2AC35AS2.js.map} +0 -0
  154. /package/dist/{chunk-4QJJG2DG.js.map → chunk-2HZR3H2N.js.map} +0 -0
  155. /package/dist/{chunk-E6TI5H2P.js.map → chunk-3FDQKFNQ.js.map} +0 -0
  156. /package/dist/{chunk-FK65KN2H.js.map → chunk-3LAEG2JM.js.map} +0 -0
  157. /package/dist/{chunk-YGVCKNKQ.js.map → chunk-44N4NCOQ.js.map} +0 -0
  158. /package/dist/{chunk-6YUNB4VT.js.map → chunk-4AWM6625.js.map} +0 -0
  159. /package/dist/{chunk-MSX65NSU.js.map → chunk-4XTNIPXL.js.map} +0 -0
  160. /package/dist/{chunk-7DZ6DJOF.js.map → chunk-5BHBLVBD.js.map} +0 -0
  161. /package/dist/{chunk-7L6GS7LH.js.map → chunk-5LSQZBLS.js.map} +0 -0
  162. /package/dist/{chunk-N2RRDNVX.js.map → chunk-6FNRVJQC.js.map} +0 -0
  163. /package/dist/{chunk-VDJGTAVP.js.map → chunk-6QMD7FTM.js.map} +0 -0
  164. /package/dist/{chunk-HM2EZX66.js.map → chunk-77RJZP3W.js.map} +0 -0
  165. /package/dist/{chunk-FWJGGP2J.js.map → chunk-7QIYWXKX.js.map} +0 -0
  166. /package/dist/{chunk-CY3NIZZF.js.map → chunk-7SYTA2HW.js.map} +0 -0
  167. /package/dist/{chunk-XWWYVVKL.js.map → chunk-A2DDN2HO.js.map} +0 -0
  168. /package/dist/{chunk-WHG5WJBY.js.map → chunk-A6FYDQC2.js.map} +0 -0
  169. /package/dist/{chunk-E2ZPFHHR.js.map → chunk-ACHFEEYB.js.map} +0 -0
  170. /package/dist/{chunk-WZDL4XDO.js.map → chunk-BS2HWHLN.js.map} +0 -0
  171. /package/dist/{chunk-2EW7JGHQ.js.map → chunk-C6M7SALA.js.map} +0 -0
  172. /package/dist/{chunk-BEKZC55J.js.map → chunk-C7KHPFDN.js.map} +0 -0
  173. /package/dist/{chunk-A7JU42HX.js.map → chunk-D6HTXNFN.js.map} +0 -0
  174. /package/dist/{chunk-SWGLTZR3.js.map → chunk-DA5RHOH4.js.map} +0 -0
  175. /package/dist/{chunk-FOUZK5XB.js.map → chunk-DM64IZA5.js.map} +0 -0
  176. /package/dist/{chunk-RCLF35PJ.js.map → chunk-DT4VOGC6.js.map} +0 -0
  177. /package/dist/{chunk-4WKXAVEW.js.map → chunk-FR5IEI5I.js.map} +0 -0
  178. /package/dist/{chunk-S34LFS5R.js.map → chunk-FRAEC2Y4.js.map} +0 -0
  179. /package/dist/{chunk-232TBIFA.js.map → chunk-HGL5VY2P.js.map} +0 -0
  180. /package/dist/{chunk-WFHPNJNT.js.map → chunk-HV6QKQTR.js.map} +0 -0
  181. /package/dist/{chunk-IFMEIUTY.js.map → chunk-I4C5VROJ.js.map} +0 -0
  182. /package/dist/{chunk-TKU525DB.js.map → chunk-IPET4C6M.js.map} +0 -0
  183. /package/dist/{chunk-AXLWNX4Y.js.map → chunk-IYGSEC73.js.map} +0 -0
  184. /package/dist/{chunk-5NFGWFLC.js.map → chunk-KCNRAZON.js.map} +0 -0
  185. /package/dist/{chunk-XXW572PF.js.map → chunk-KZK5JOET.js.map} +0 -0
  186. /package/dist/{chunk-WXDNQMUI.js.map → chunk-LD7BSZMJ.js.map} +0 -0
  187. /package/dist/{chunk-RHNEQRPJ.js.map → chunk-LPTOSRG4.js.map} +0 -0
  188. /package/dist/{chunk-GZVHZCUI.js.map → chunk-MD52QS2O.js.map} +0 -0
  189. /package/dist/{chunk-DJT5F4MT.js.map → chunk-N7HOXMHV.js.map} +0 -0
  190. /package/dist/{chunk-IWZH3YPO.js.map → chunk-NA3M7JLP.js.map} +0 -0
  191. /package/dist/{chunk-KGC6FPEP.js.map → chunk-OAA6SX2W.js.map} +0 -0
  192. /package/dist/{chunk-JMDZFDCS.js.map → chunk-OY7AMSDK.js.map} +0 -0
  193. /package/dist/{chunk-HV7R7EP7.js.map → chunk-PVAJUMDT.js.map} +0 -0
  194. /package/dist/{chunk-ZV3NEWTY.js.map → chunk-RZX6I2NY.js.map} +0 -0
  195. /package/dist/{chunk-FCLA7EH4.js.map → chunk-SF2WTUDR.js.map} +0 -0
  196. /package/dist/{chunk-NWS5NNHX.js.map → chunk-SFUKZRTP.js.map} +0 -0
  197. /package/dist/{chunk-DEDH7IH3.js.map → chunk-SXWPKK4D.js.map} +0 -0
  198. /package/dist/{chunk-ZL2KZRNC.js.map → chunk-TTHG53NH.js.map} +0 -0
  199. /package/dist/{chunk-XHBRV4QK.js.map → chunk-VGIKTY7D.js.map} +0 -0
  200. /package/dist/{chunk-PDIBXVWI.js.map → chunk-WV5VMIC5.js.map} +0 -0
  201. /package/dist/{chunk-H5HWF2RF.js.map → chunk-Y7SBE6TC.js.map} +0 -0
  202. /package/dist/{chunk-BOVAHVNE.js.map → chunk-YBDRFSOK.js.map} +0 -0
  203. /package/dist/{chunk-KIYDAB7Q.js.map → chunk-YQG4YCQL.js.map} +0 -0
  204. /package/dist/{chunk-JNYYKYOX.js.map → chunk-YWHSZSQL.js.map} +0 -0
  205. /package/dist/{chunk-OLFYMD26.js.map → chunk-ZMLGMLXE.js.map} +0 -0
  206. /package/dist/{cli-L5NG7KFW.js.map → cli-AVOEQZZM.js.map} +0 -0
  207. /package/dist/{cli-7OWZWDEE.js.map → cli-B3RIVCKY.js.map} +0 -0
  208. /package/dist/{cli-5ASE6JCZ.js.map → cli-BI2GQEDM.js.map} +0 -0
  209. /package/dist/{cli-ZC2XIC3A.js.map → cli-OIYUAXPA.js.map} +0 -0
  210. /package/dist/{cli-3FJLVOVV.js.map → cli-OY6RHP5P.js.map} +0 -0
  211. /package/dist/{cli-CWLFP4LA.js.map → cli-Q3ZRWXB4.js.map} +0 -0
  212. /package/dist/{cli-BBKPB2HF.js.map → cli-RMIZNJL3.js.map} +0 -0
  213. /package/dist/{cli-FZ3TF4OX.js.map → cli-UINJ634O.js.map} +0 -0
  214. /package/dist/{cli-G7DMKZFI.js.map → cli-YAG5OFYC.js.map} +0 -0
  215. /package/dist/{cli-73QJRBGD.js.map → cli-ZTSPDBDE.js.map} +0 -0
  216. /package/dist/{github-CMA4NVGZ.js.map → github-B3QCNYMP.js.map} +0 -0
  217. /package/dist/{github-KD6OPT6N.js.map → github-PLPEWRPJ.js.map} +0 -0
  218. /package/dist/{github-YO4WC4Q4.js.map → github-XBGWVVIA.js.map} +0 -0
  219. /package/dist/{json-SFFOWLUQ.js.map → json-7ERIDOTV.js.map} +0 -0
  220. /package/dist/{json-W4ATTXER.js.map → json-UNN7BJM6.js.map} +0 -0
  221. /package/dist/{labels-ILSCGLR2.js.map → labels-XUW7THEE.js.map} +0 -0
  222. /package/dist/{lint-YLEK6OWJ.js.map → lint-NWSLIVHJ.js.map} +0 -0
  223. /package/dist/{list-BPZQKN4W.js.map → list-BKD62XJ4.js.map} +0 -0
  224. /package/dist/{list-F3XQLKBG.js.map → list-TXOFFLES.js.map} +0 -0
  225. /package/dist/{list-ZDVWETJA.js.map → list-WM4EHFC6.js.map} +0 -0
  226. /package/dist/{page-GL2IKGR7.js.map → page-CFDNR2OB.js.map} +0 -0
  227. /package/dist/{prepare-IWGF6RYG.js.map → prepare-Y7WBJ3RZ.js.map} +0 -0
  228. /package/dist/{pretty-IWCYUTFE.js.map → pretty-ALGCRVPF.js.map} +0 -0
  229. /package/dist/{pretty-MSZCPJCI.js.map → pretty-BX6RMDVM.js.map} +0 -0
  230. /package/dist/{pretty-T6F4E24U.js.map → pretty-MTAJRM7S.js.map} +0 -0
  231. /package/dist/{reporters-4X4NKOXM.js.map → reporters-OZPJP6UK.js.map} +0 -0
  232. /package/dist/{reporters-FR4AXDLX.js.map → reporters-QSBVVOX7.js.map} +0 -0
  233. /package/dist/{run-4SBRYTKW.js.map → run-UTKXWCM4.js.map} +0 -0
  234. /package/dist/{sarif-EASXSUVZ.js.map → sarif-6QY3B2KF.js.map} +0 -0
  235. /package/dist/{sarif-K22E6B5M.js.map → sarif-JZSDSSBV.js.map} +0 -0
  236. /package/dist/{sarif-L7IEQ7TT.js.map → sarif-KTMQVMN5.js.map} +0 -0
  237. /package/dist/{strategy-N2D5HM4C.js.map → strategy-G25TI5UA.js.map} +0 -0
  238. /package/dist/{term-43EIVTZC.js.map → term-YYIAR32K.js.map} +0 -0
  239. /package/dist/{validate-TQPUQUT2.js.map → validate-VKZJAD77.js.map} +0 -0
@@ -17,14 +17,14 @@ import {
17
17
  isWildcard,
18
18
  matchSections,
19
19
  occurrenceRange
20
- } from "./chunk-ZWVYT2G6.js";
20
+ } from "./chunk-QEFVMOWF.js";
21
21
  import {
22
22
  listFormats,
23
23
  parserByName,
24
24
  parserForExtension,
25
25
  supportedExtensions,
26
26
  unsupportedFormatMessage
27
- } from "./chunk-CY3NIZZF.js";
27
+ } from "./chunk-7SYTA2HW.js";
28
28
  import {
29
29
  LintError
30
30
  } from "./chunk-OPF3NOKF.js";
@@ -34,11 +34,12 @@ import {
34
34
  } from "./chunk-HMJZHUCJ.js";
35
35
  import {
36
36
  STDIN_TOKEN,
37
+ __default,
37
38
  assertNonEmpty,
38
39
  gitignoreOptions,
39
40
  isErrorSeverity,
40
41
  resolveTargetSet
41
- } from "./chunk-A7JU42HX.js";
42
+ } from "./chunk-D6HTXNFN.js";
42
43
  import {
43
44
  ditaOtHome,
44
45
  findConfigFile,
@@ -50,7 +51,7 @@ import {
50
51
  } from "./chunk-HX44GB4Z.js";
51
52
  import {
52
53
  package_default
53
- } from "./chunk-QBTDPI57.js";
54
+ } from "./chunk-Z2KVPZYI.js";
54
55
  import {
55
56
  ToolError,
56
57
  errorMessage
@@ -58,14 +59,170 @@ import {
58
59
 
59
60
  // src/lint/commands/lint.ts
60
61
  import { readFile as readFile3 } from "node:fs/promises";
61
- import { extname, relative, resolve as resolve2 } from "node:path";
62
+ import { extname, relative, resolve as resolve3 } from "node:path";
63
+
64
+ // src/lint/core/resolve-template.ts
65
+ import picomatch from "picomatch";
66
+ var FILE_TEMPLATE_KEY = "$template";
67
+ var TYPE_KEY = "type";
68
+ function buildTypeIndex(params) {
69
+ const index = /* @__PURE__ */ new Map();
70
+ for (const builtin of params.builtins ?? []) {
71
+ for (const type of builtin.types) {
72
+ index.set(type, { ref: builtin.id, source: "builtin" });
73
+ }
74
+ }
75
+ for (const { ref, file } of params.userFiles ?? []) {
76
+ for (const [name, template] of Object.entries(file.templates ?? {})) {
77
+ for (const type of template.types ?? []) {
78
+ index.set(type, { ref: `${ref}#${name}`, source: "user" });
79
+ }
80
+ }
81
+ }
82
+ for (const [type, ref] of Object.entries(params.explicitTypes ?? {})) {
83
+ index.set(type, { ref, source: "config" });
84
+ }
85
+ return index;
86
+ }
87
+ var matcherCache = /* @__PURE__ */ new Map();
88
+ function clearMatcherCache() {
89
+ matcherCache.clear();
90
+ }
91
+ function matchesGlob(glob, filePath) {
92
+ let m = matcherCache.get(glob);
93
+ if (!m) {
94
+ m = picomatch(glob, { dot: true });
95
+ matcherCache.set(glob, m);
96
+ }
97
+ return m(filePath.replace(/\\/g, "/"));
98
+ }
99
+ function suggestTypes(unknown, known) {
100
+ const target = unknown.toLowerCase();
101
+ const scored = [];
102
+ for (const type of known) {
103
+ const distance = editDistance(target, type.toLowerCase());
104
+ const threshold = target.length <= 4 ? 1 : 3;
105
+ if (distance <= threshold) scored.push({ type, distance });
106
+ }
107
+ return scored.sort((a, b) => a.distance - b.distance || a.type.localeCompare(b.type)).slice(0, 3).map((s) => s.type);
108
+ }
109
+ function editDistance(a, b) {
110
+ if (a === b) return 0;
111
+ let prev = Array.from({ length: b.length + 1 }, (_, i) => i);
112
+ let last = b.length;
113
+ for (let i = 0; i < a.length; i++) {
114
+ const row = [i + 1];
115
+ let left = i + 1;
116
+ let diagonal = i;
117
+ for (const [j, above] of prev.slice(1).entries()) {
118
+ const cost = a.charCodeAt(i) === b.charCodeAt(j) ? 0 : 1;
119
+ const cell = Math.min(left + 1, above + 1, diagonal + cost);
120
+ row.push(cell);
121
+ diagonal = above;
122
+ left = cell;
123
+ }
124
+ prev = row;
125
+ last = left;
126
+ }
127
+ return last;
128
+ }
129
+ function refFromFrontmatter(frontmatter, key) {
130
+ const value = frontmatter?.[key];
131
+ return typeof value === "string" && value.length > 0 ? value : null;
132
+ }
133
+ function resolveTemplateRef(params) {
134
+ const steps = [];
135
+ const typeIndex = params.typeIndex ?? /* @__PURE__ */ new Map();
136
+ const decide = (stage, ref) => ({
137
+ ref,
138
+ stage,
139
+ steps
140
+ });
141
+ if (params.cliTemplate) {
142
+ steps.push({ stage: "cli", ref: params.cliTemplate, detail: "--template" });
143
+ return decide("cli", params.cliTemplate);
144
+ }
145
+ steps.push({ stage: "cli", ref: null, detail: "--template not given" });
146
+ const fileTemplate = refFromFrontmatter(params.frontmatter, FILE_TEMPLATE_KEY);
147
+ if (fileTemplate) {
148
+ steps.push({
149
+ stage: "frontmatter-template",
150
+ ref: fileTemplate,
151
+ detail: `${FILE_TEMPLATE_KEY} in frontmatter`
152
+ });
153
+ return decide("frontmatter-template", fileTemplate);
154
+ }
155
+ steps.push({
156
+ stage: "frontmatter-template",
157
+ ref: null,
158
+ detail: `no ${FILE_TEMPLATE_KEY} in frontmatter`
159
+ });
160
+ for (const override of params.overrides ?? []) {
161
+ if (matchesGlob(override.files, params.filePath) || params.absolutePath !== void 0 && matchesGlob(override.files, params.absolutePath)) {
162
+ steps.push({
163
+ stage: "config-override",
164
+ ref: override.template,
165
+ detail: `matched override "${override.files}"`
166
+ });
167
+ return decide("config-override", override.template);
168
+ }
169
+ }
170
+ steps.push({
171
+ stage: "config-override",
172
+ ref: null,
173
+ detail: (params.overrides ?? []).length ? "no override glob matched" : "no overrides configured"
174
+ });
175
+ const type = refFromFrontmatter(params.frontmatter, TYPE_KEY);
176
+ if (type) {
177
+ const entry = typeIndex.get(type);
178
+ if (entry) {
179
+ steps.push({
180
+ stage: "type",
181
+ ref: entry.ref,
182
+ detail: `type: ${type} -> ${entry.source} template`
183
+ });
184
+ return decide("type", entry.ref);
185
+ }
186
+ steps.push({
187
+ stage: "type",
188
+ ref: null,
189
+ detail: `type: ${type} matches no template`
190
+ });
191
+ return {
192
+ ref: null,
193
+ stage: null,
194
+ cause: "unknown-type",
195
+ unknownType: type,
196
+ suggestions: suggestTypes(type, typeIndex.keys()),
197
+ knownTypes: knownTypes(typeIndex),
198
+ steps
199
+ };
200
+ }
201
+ steps.push({ stage: "type", ref: null, detail: "no type in frontmatter" });
202
+ if (params.defaultTemplate) {
203
+ steps.push({
204
+ stage: "config-default",
205
+ ref: params.defaultTemplate,
206
+ detail: "config default"
207
+ });
208
+ return decide("config-default", params.defaultTemplate);
209
+ }
210
+ steps.push({ stage: "config-default", ref: null, detail: "no default configured" });
211
+ return { ref: null, stage: null, cause: "no-type", steps };
212
+ }
213
+ function knownTypes(index) {
214
+ return [...index.keys()].sort();
215
+ }
216
+
217
+ // src/lint/core/routing.ts
218
+ import { resolve } from "node:path";
62
219
 
63
220
  // src/lint/core/template-registry.ts
64
221
  import { readFile } from "node:fs/promises";
65
222
  import { dirname, isAbsolute, join, resolve as resolvePath } from "node:path";
66
223
  import { parse as parseYaml } from "yaml";
67
224
  import { dereference } from "@apidevtools/json-schema-ref-parser";
68
- import * as AjvNs from "ajv";
225
+ import * as Ajv2020Ns from "ajv/dist/2020.js";
69
226
 
70
227
  // schemas/lint/template.json
71
228
  var template_default = {
@@ -184,6 +341,12 @@ var template_default = {
184
341
  type: "string",
185
342
  pattern: "^https?://"
186
343
  },
344
+ evals: {
345
+ description: "Evals that manni docevals grades on every page this template routes. manni lint never grades them. Each entry is an entry of the manni:evals:1.0.0 vocabulary: a bare assertion, a `use:` reference to an eval under docevals.evals, or an inline definition with an `id`. An inline entry may not use grader command. A template that `extends` another inherits its evals: an inline entry replaces the inherited entry with its `id`, a `use:` entry narrows the inherited entry it names, and anything else is appended.",
346
+ type: "array",
347
+ minItems: 1,
348
+ items: { $ref: "manni:evals:1.0.0#/$defs/evalEntry" }
349
+ },
187
350
  extends: {
188
351
  description: "Template reference (built-in id, path, or URL, optionally with a `#name` fragment) whose rules this template inherits.",
189
352
  type: "string",
@@ -420,6 +583,9 @@ var template_default = {
420
583
  }
421
584
  };
422
585
 
586
+ // src/lint/core/template-registry.ts
587
+ import draft07MetaSchema from "ajv/dist/refs/json-schema-draft-07.json" with { type: "json" };
588
+
423
589
  // templates/lint/tgdp/manifest.json
424
590
  var manifest_default = {
425
591
  $comment: 'Built-in doctype templates derived from The Good Docs Project templates, pinned to release v1.6.0 ("Iron"): https://gitlab.com/tgdp/templates/-/tree/v1.6.0. Each entry\'s `file` is a YAML template beside this manifest; `source` is the upstream Markdown it was derived from, vendored under test/lint/fixtures/tgdp/ and linted against the derived template so the two cannot drift. Run `npm run check:tgdp-pin` to see whether upstream has moved past the pin.',
@@ -480,7 +646,7 @@ var manifest_default = {
480
646
  };
481
647
 
482
648
  // src/lint/core/template-registry.ts
483
- var Ajv = AjvNs.default;
649
+ var Ajv2020 = Ajv2020Ns.default;
484
650
  var DEREFERENCE_OPTIONS = { resolve: { external: false } };
485
651
  var MANIFESTS = [manifest_default];
486
652
  var BUILTINS = /* @__PURE__ */ new Map();
@@ -545,7 +711,9 @@ function classifyRef(ref) {
545
711
  return { kind: "file", ref };
546
712
  }
547
713
  var DEFAULT_TIMEOUT_MS = 1e4;
548
- var ajv = new Ajv();
714
+ var ajv = new Ajv2020({ allowUnionTypes: true, keywords: ["x-manni-location"] });
715
+ ajv.addMetaSchema(draft07MetaSchema);
716
+ ajv.addSchema(__default);
549
717
  var compiled = null;
550
718
  function fileValidator() {
551
719
  compiled ??= ajv.compile(template_default);
@@ -579,6 +747,7 @@ function findInstructions(node, segments = [], seen = /* @__PURE__ */ new WeakSe
579
747
  if (!insideSectionsMap && "instructions" in record) {
580
748
  return {
581
749
  path: segments.join("."),
750
+ template: segments[0] === "templates" ? segments[1] ?? "<template>" : "<template>",
582
751
  name: suggestEvalName(segments),
583
752
  values: stringsOf(record.instructions)
584
753
  };
@@ -592,13 +761,13 @@ function findInstructions(node, segments = [], seen = /* @__PURE__ */ new WeakSe
592
761
  function instructionsMessage(source, hit) {
593
762
  const assertion = hit.values[0] ?? "";
594
763
  return [
595
- `${source}: "${hit.path}" uses \`instructions\`, which manni lint no longer evaluates \u2014 structure checking is deterministic. Move it to a manni docevals assertion eval in manni.config.yaml:`,
764
+ `${source}: "${hit.path}" uses \`instructions\`, which manni lint does not evaluate. Move it to the template's evals, which manni docevals grades on every page this template routes:`,
596
765
  "",
597
- " docevals:",
598
- " evals:",
599
- ` ${hit.name}:`,
600
- ` assertion: ${assertion}`,
601
- " grader: ai"
766
+ " templates:",
767
+ ` ${hit.template}:`,
768
+ " evals:",
769
+ ` - id: ${hit.name}`,
770
+ ` assertion: ${assertion}`
602
771
  ].join("\n");
603
772
  }
604
773
  var V1_KEYS = {
@@ -639,6 +808,26 @@ function findV1File(data) {
639
808
  if (!isRecord(data)) return null;
640
809
  return findV1Key(data.templates) ?? findV1Key(data.components);
641
810
  }
811
+ function findEvalsRefusal(data, source) {
812
+ if (!isRecord(data) || !isRecord(data.templates)) return null;
813
+ for (const [name, template] of Object.entries(data.templates)) {
814
+ if (!isRecord(template) || !Array.isArray(template.evals)) continue;
815
+ const ids = /* @__PURE__ */ new Set();
816
+ for (const [index, entry] of template.evals.entries()) {
817
+ if (!isRecord(entry) || "use" in entry) continue;
818
+ const id = typeof entry.id === "string" ? entry.id : "<id>";
819
+ if (entry.grader === "command") {
820
+ return `${source}: "templates.${name}.evals[${index}]" uses grader command, which a template cannot carry. Define it under docevals.evals in manni.config.yaml and reference it with use: ${id}.`;
821
+ }
822
+ if (typeof entry.id !== "string") continue;
823
+ if (ids.has(entry.id)) {
824
+ return `${source}: "templates.${name}.evals" defines "${entry.id}" twice`;
825
+ }
826
+ ids.add(entry.id);
827
+ }
828
+ }
829
+ return null;
830
+ }
642
831
  function ruleLabel(rule, path) {
643
832
  return rule.id === void 0 ? path : `"${rule.id}"`;
644
833
  }
@@ -755,9 +944,13 @@ function validateTemplateFile(data, source) {
755
944
  if (instructions) throw new LintError(instructionsMessage(source, instructions));
756
945
  const v1 = findV1File(data);
757
946
  if (v1) throw new LintError(`${source}: ${v1}`);
947
+ const evalsRefusal = findEvalsRefusal(data, source);
948
+ if (evalsRefusal) throw new LintError(evalsRefusal);
758
949
  const validate = fileValidator();
759
950
  if (!validate(data)) {
760
- const errors = validate.errors ?? [];
951
+ const all = validate.errors ?? [];
952
+ const specific = all.filter((error) => error.keyword !== "if");
953
+ const errors = specific.length > 0 ? specific : all;
761
954
  const detail = errors.map(describeError).join("; ") || "does not match the template schema";
762
955
  throw new LintError(`${source} is not a valid template file: ${detail}.`);
763
956
  }
@@ -915,12 +1108,51 @@ function mergeRules(parent, child) {
915
1108
  if (sections !== void 0) merged.sections = sections;
916
1109
  return merged;
917
1110
  }
1111
+ var NARROWED_EVAL_FIELDS = ["skip", "severity", "weight", "type"];
1112
+ function evalKey(entry) {
1113
+ if (typeof entry === "string") return void 0;
1114
+ const key = "use" in entry ? entry.use : entry.id;
1115
+ return typeof key === "string" ? key : void 0;
1116
+ }
1117
+ function mergeEvals(parent, child) {
1118
+ if (!parent) return child;
1119
+ if (!child) return parent;
1120
+ const merged = [...parent];
1121
+ for (const entry of child) {
1122
+ const key = evalKey(entry);
1123
+ const index = key === void 0 ? -1 : merged.findIndex((inherited) => evalKey(inherited) === key);
1124
+ const target = index === -1 ? void 0 : merged[index];
1125
+ if (target === void 0 || typeof entry === "string" || typeof target === "string") {
1126
+ merged.push(entry);
1127
+ } else if ("use" in entry) {
1128
+ merged[index] = narrowEval(target, entry);
1129
+ } else {
1130
+ merged[index] = entry;
1131
+ }
1132
+ }
1133
+ return merged;
1134
+ }
1135
+ function narrowEval(target, narrowing) {
1136
+ const narrowed = { ...target };
1137
+ for (const field of NARROWED_EVAL_FIELDS) {
1138
+ if (narrowing[field] !== void 0) narrowed[field] = narrowing[field];
1139
+ }
1140
+ if (isRecord(narrowing.options)) {
1141
+ narrowed.options = {
1142
+ ...isRecord(target.options) ? target.options : {},
1143
+ ...narrowing.options
1144
+ };
1145
+ }
1146
+ return narrowed;
1147
+ }
918
1148
  function mergeTemplates(parent, child) {
919
1149
  const sections = mergeRuleLists(parent.sections, child.sections);
920
- const { sections: _parentSections, ...parentRest } = parent;
921
- const { sections: _childSections, ...childRest } = child;
1150
+ const evals = mergeEvals(parent.evals, child.evals);
1151
+ const { sections: _parentSections, evals: _parentEvals, ...parentRest } = parent;
1152
+ const { sections: _childSections, evals: _childEvals, ...childRest } = child;
922
1153
  const merged = { ...parentRest, ...childRest };
923
1154
  if (sections !== void 0) merged.sections = sections;
1155
+ if (evals !== void 0) merged.evals = evals;
924
1156
  delete merged.extends;
925
1157
  return merged;
926
1158
  }
@@ -966,157 +1198,102 @@ async function loadResolvedTemplate(ref, options = {}, chain = []) {
966
1198
  return mergeTemplates(parent, template);
967
1199
  }
968
1200
 
969
- // src/lint/core/resolve-template.ts
970
- import picomatch from "picomatch";
971
- var FILE_TEMPLATE_KEY = "$template";
972
- var TYPE_KEY = "type";
973
- function buildTypeIndex(params) {
974
- const index = /* @__PURE__ */ new Map();
975
- for (const builtin of params.builtins ?? []) {
976
- for (const type of builtin.types) {
977
- index.set(type, { ref: builtin.id, source: "builtin" });
978
- }
979
- }
980
- for (const { ref, file } of params.userFiles ?? []) {
981
- for (const [name, template] of Object.entries(file.templates ?? {})) {
982
- for (const type of template.types ?? []) {
983
- index.set(type, { ref: `${ref}#${name}`, source: "user" });
984
- }
985
- }
986
- }
987
- for (const [type, ref] of Object.entries(params.explicitTypes ?? {})) {
988
- index.set(type, { ref, source: "config" });
989
- }
990
- return index;
991
- }
992
- var matcherCache = /* @__PURE__ */ new Map();
993
- function clearMatcherCache() {
994
- matcherCache.clear();
1201
+ // src/lint/core/routing.ts
1202
+ var TEMPLATE_FILE_EXTENSIONS = [".yaml", ".yml", ".json"];
1203
+ function templateFiles(value) {
1204
+ if (value == null) return [];
1205
+ return Array.isArray(value) ? value : [value];
995
1206
  }
996
- function matchesGlob(glob, filePath) {
997
- let m = matcherCache.get(glob);
998
- if (!m) {
999
- m = picomatch(glob, { dot: true });
1000
- matcherCache.set(glob, m);
1001
- }
1002
- return m(filePath.replace(/\\/g, "/"));
1207
+ function templateLoader() {
1208
+ const cache = /* @__PURE__ */ new Map();
1209
+ return (ref) => {
1210
+ let pending = cache.get(ref);
1211
+ if (!pending) {
1212
+ pending = loadResolvedTemplate(ref);
1213
+ cache.set(ref, pending);
1214
+ }
1215
+ return pending;
1216
+ };
1003
1217
  }
1004
- function suggestTypes(unknown, known) {
1005
- const target = unknown.toLowerCase();
1006
- const scored = [];
1007
- for (const type of known) {
1008
- const distance = editDistance(target, type.toLowerCase());
1009
- const threshold = target.length <= 4 ? 1 : 3;
1010
- if (distance <= threshold) scored.push({ type, distance });
1218
+ function cliTemplateRef(template, templatePaths) {
1219
+ if (!template) return void 0;
1220
+ if (template.includes("#")) return template;
1221
+ if (classifyRef(template).kind !== "file") return template;
1222
+ if (template.includes("/") || template.includes("\\")) return template;
1223
+ if (TEMPLATE_FILE_EXTENSIONS.some((e) => template.toLowerCase().endsWith(e))) {
1224
+ return template;
1011
1225
  }
1012
- return scored.sort((a, b) => a.distance - b.distance || a.type.localeCompare(b.type)).slice(0, 3).map((s) => s.type);
1226
+ if (templatePaths.length === 0) return template;
1227
+ return `${templatePaths[templatePaths.length - 1] ?? ""}#${template}`;
1013
1228
  }
1014
- function editDistance(a, b) {
1015
- if (a === b) return 0;
1016
- let prev = Array.from({ length: b.length + 1 }, (_, i) => i);
1017
- let last = b.length;
1018
- for (let i = 0; i < a.length; i++) {
1019
- const row = [i + 1];
1020
- let left = i + 1;
1021
- let diagonal = i;
1022
- for (const [j, above] of prev.slice(1).entries()) {
1023
- const cost = a.charCodeAt(i) === b.charCodeAt(j) ? 0 : 1;
1024
- const cell = Math.min(left + 1, above + 1, diagonal + cost);
1025
- row.push(cell);
1026
- diagonal = above;
1027
- left = cell;
1229
+ async function buildTemplateRouting(params) {
1230
+ const { config } = params;
1231
+ const templatePaths = templateFiles(params.templates ?? config.templates);
1232
+ const getTemplate = templateLoader();
1233
+ const userFiles = [];
1234
+ for (const ref of templatePaths) {
1235
+ const file = await loadTemplateFile(ref);
1236
+ const templates = {};
1237
+ for (const name of Object.keys(file.templates ?? {})) {
1238
+ templates[name] = await getTemplate(`${ref}#${name}`);
1028
1239
  }
1029
- prev = row;
1030
- last = left;
1240
+ userFiles.push({ ref, file: { ...file, templates } });
1031
1241
  }
1032
- return last;
1033
- }
1034
- function refFromFrontmatter(frontmatter, key) {
1035
- const value = frontmatter?.[key];
1036
- return typeof value === "string" && value.length > 0 ? value : null;
1037
- }
1038
- function resolveTemplateRef(params) {
1039
- const steps = [];
1040
- const typeIndex = params.typeIndex ?? /* @__PURE__ */ new Map();
1041
- const decide = (stage, ref) => ({
1042
- ref,
1043
- stage,
1044
- steps
1242
+ const typeIndex = buildTypeIndex({
1243
+ builtins: listBuiltins(),
1244
+ userFiles,
1245
+ explicitTypes: params.types ?? config.types
1045
1246
  });
1046
- if (params.cliTemplate) {
1047
- steps.push({ stage: "cli", ref: params.cliTemplate, detail: "--template" });
1048
- return decide("cli", params.cliTemplate);
1049
- }
1050
- steps.push({ stage: "cli", ref: null, detail: "--template not given" });
1051
- const fileTemplate = refFromFrontmatter(params.frontmatter, FILE_TEMPLATE_KEY);
1052
- if (fileTemplate) {
1053
- steps.push({
1054
- stage: "frontmatter-template",
1055
- ref: fileTemplate,
1056
- detail: `${FILE_TEMPLATE_KEY} in frontmatter`
1057
- });
1058
- return decide("frontmatter-template", fileTemplate);
1059
- }
1060
- steps.push({
1061
- stage: "frontmatter-template",
1062
- ref: null,
1063
- detail: `no ${FILE_TEMPLATE_KEY} in frontmatter`
1247
+ return {
1248
+ typeIndex,
1249
+ getTemplate,
1250
+ templatePaths,
1251
+ cliTemplate: cliTemplateRef(params.cliTemplate, templatePaths),
1252
+ overrides: params.overrides ?? config.overrides,
1253
+ // `template:` in config is the default for a page that declares no type -
1254
+ // the bottom of the chain, not the top. `--template` is the top.
1255
+ defaultTemplate: params.defaultTemplate ?? config.template
1256
+ };
1257
+ }
1258
+ function routePage(routing, page) {
1259
+ const resolution = resolveTemplateRef({
1260
+ filePath: page.filePath,
1261
+ absolutePath: page.absolutePath,
1262
+ frontmatter: page.frontmatter,
1263
+ cliTemplate: routing.cliTemplate,
1264
+ overrides: routing.overrides,
1265
+ typeIndex: routing.typeIndex,
1266
+ defaultTemplate: routing.defaultTemplate
1064
1267
  });
1065
- for (const override of params.overrides ?? []) {
1066
- if (matchesGlob(override.files, params.filePath) || params.absolutePath !== void 0 && matchesGlob(override.files, params.absolutePath)) {
1067
- steps.push({
1068
- stage: "config-override",
1069
- ref: override.template,
1070
- detail: `matched override "${override.files}"`
1071
- });
1072
- return decide("config-override", override.template);
1073
- }
1268
+ if (resolution.ref === null || resolution.stage !== "frontmatter-template") {
1269
+ return { resolution, ref: resolution.ref };
1074
1270
  }
1075
- steps.push({
1076
- stage: "config-override",
1077
- ref: null,
1078
- detail: (params.overrides ?? []).length ? "no override glob matched" : "no overrides configured"
1079
- });
1080
- const type = refFromFrontmatter(params.frontmatter, TYPE_KEY);
1081
- if (type) {
1082
- const entry = typeIndex.get(type);
1083
- if (entry) {
1084
- steps.push({
1085
- stage: "type",
1086
- ref: entry.ref,
1087
- detail: `type: ${type} -> ${entry.source} template`
1088
- });
1089
- return decide("type", entry.ref);
1090
- }
1091
- steps.push({
1092
- stage: "type",
1093
- ref: null,
1094
- detail: `type: ${type} matches no template`
1095
- });
1271
+ if (classifyRef(resolution.ref).kind === "url") {
1096
1272
  return {
1273
+ resolution,
1097
1274
  ref: null,
1098
- stage: null,
1099
- cause: "unknown-type",
1100
- unknownType: type,
1101
- suggestions: suggestTypes(type, typeIndex.keys()),
1102
- knownTypes: knownTypes(typeIndex),
1103
- steps
1275
+ refusal: `${FILE_TEMPLATE_KEY} may not name a URL ("${resolution.ref}"): a document must not choose what the linter fetches. Declare it in manni.config.yaml under "templates:" or "types:", or pass it with --template.`
1104
1276
  };
1105
1277
  }
1106
- steps.push({ stage: "type", ref: null, detail: "no type in frontmatter" });
1107
- if (params.defaultTemplate) {
1108
- steps.push({
1109
- stage: "config-default",
1110
- ref: params.defaultTemplate,
1111
- detail: "config default"
1112
- });
1113
- return decide("config-default", params.defaultTemplate);
1278
+ return { resolution, ref: refRelativeTo(page.absolutePath, resolution.ref) };
1279
+ }
1280
+ async function templateSources(ref) {
1281
+ const sources = [];
1282
+ const seen = /* @__PURE__ */ new Set([ref]);
1283
+ let current = ref;
1284
+ while (current !== void 0) {
1285
+ const hash = current.lastIndexOf("#");
1286
+ const base = hash === -1 ? current : current.slice(0, hash);
1287
+ if (classifyRef(base).kind === "file") {
1288
+ const path = resolve(base).replace(/\\/g, "/");
1289
+ if (!sources.includes(path)) sources.push(path);
1290
+ }
1291
+ const parent = (await loadTemplate(current)).extends;
1292
+ const next = parent === void 0 ? void 0 : refRelativeTo(current, parent);
1293
+ current = next !== void 0 && !seen.has(next) ? next : void 0;
1294
+ if (next !== void 0) seen.add(next);
1114
1295
  }
1115
- steps.push({ stage: "config-default", ref: null, detail: "no default configured" });
1116
- return { ref: null, stage: null, cause: "no-type", steps };
1117
- }
1118
- function knownTypes(index) {
1119
- return [...index.keys()].sort();
1296
+ return sources;
1120
1297
  }
1121
1298
 
1122
1299
  // src/lint/core/validator.ts
@@ -1416,9 +1593,9 @@ function validateDocument(tree, template, options = {}) {
1416
1593
  }
1417
1594
 
1418
1595
  // src/lint/core/config.ts
1419
- import { dirname as dirname2, isAbsolute as isAbsolute2, resolve } from "node:path";
1596
+ import { dirname as dirname2, isAbsolute as isAbsolute2, resolve as resolve2 } from "node:path";
1420
1597
  import { parse as parseYaml2 } from "yaml";
1421
- import * as AjvNs2 from "ajv";
1598
+ import * as AjvNs from "ajv";
1422
1599
 
1423
1600
  // schemas/lint/config.json
1424
1601
  var config_default = {
@@ -1496,7 +1673,7 @@ var config_default = {
1496
1673
  };
1497
1674
 
1498
1675
  // src/lint/core/config.ts
1499
- var Ajv2 = AjvNs2.default;
1676
+ var Ajv = AjvNs.default;
1500
1677
  var LINT_TOOLS = ["manni", "dita-ot"];
1501
1678
  var LINT_JOBS = ["structure"];
1502
1679
  var TOOLS_BY_JOB = {
@@ -1549,7 +1726,7 @@ function checkJobs(section, source) {
1549
1726
  }
1550
1727
  }
1551
1728
  }
1552
- var ajv2 = new Ajv2({ allErrors: true });
1729
+ var ajv2 = new Ajv({ allErrors: true });
1553
1730
  var compiled2 = null;
1554
1731
  function sectionValidator() {
1555
1732
  compiled2 ??= ajv2.compile(config_default);
@@ -1633,10 +1810,10 @@ function sectionOf(file) {
1633
1810
  }
1634
1811
  function rebaseConfig(found) {
1635
1812
  if (!found) return {};
1636
- const dir = dirname2(resolve(found.path));
1813
+ const dir = dirname2(resolve2(found.path));
1637
1814
  const config = found.config;
1638
1815
  const ref = (value) => refRelativeTo(found.path, value);
1639
- const glob = (value) => isAbsolute2(value) ? value : resolve(dir, value).replace(/\\/g, "/");
1816
+ const glob = (value) => isAbsolute2(value) ? value : resolve2(dir, value).replace(/\\/g, "/");
1640
1817
  return {
1641
1818
  ...config,
1642
1819
  ...config.templates ? { templates: config.templates.map(ref) } : {},
@@ -1656,7 +1833,7 @@ function rebaseConfig(found) {
1656
1833
  }
1657
1834
  var STDIN = "-";
1658
1835
  async function resolveLintRun(opts) {
1659
- const cwd = resolve(opts.cwd);
1836
+ const cwd = resolve2(opts.cwd);
1660
1837
  const wanted = opts.collection ?? [];
1661
1838
  if (wanted.length > 0 && opts.inputs.some((input) => input !== STDIN)) {
1662
1839
  throw new LintError(
@@ -1970,7 +2147,6 @@ function resolveStructureTool(name) {
1970
2147
 
1971
2148
  // src/lint/commands/lint.ts
1972
2149
  var STDIN_LABEL = "<stdin>";
1973
- var TEMPLATE_FILE_EXTENSIONS = [".yaml", ".yml", ".json"];
1974
2150
  async function asLintError(run) {
1975
2151
  try {
1976
2152
  return await run();
@@ -1980,10 +2156,6 @@ async function asLintError(run) {
1980
2156
  throw err;
1981
2157
  }
1982
2158
  }
1983
- function templateFiles(value) {
1984
- if (value == null) return [];
1985
- return Array.isArray(value) ? value : [value];
1986
- }
1987
2159
  var TOOL_OPTIONS = [
1988
2160
  { spelling: "--template", given: (o) => o.template !== void 0 },
1989
2161
  {
@@ -2047,28 +2219,6 @@ function parseFinding(message) {
2047
2219
  template: null
2048
2220
  };
2049
2221
  }
2050
- function templateLoader() {
2051
- const cache = /* @__PURE__ */ new Map();
2052
- return (ref) => {
2053
- let pending = cache.get(ref);
2054
- if (!pending) {
2055
- pending = loadResolvedTemplate(ref);
2056
- cache.set(ref, pending);
2057
- }
2058
- return pending;
2059
- };
2060
- }
2061
- function cliTemplateRef(template, templatePaths) {
2062
- if (!template) return void 0;
2063
- if (template.includes("#")) return template;
2064
- if (classifyRef(template).kind !== "file") return template;
2065
- if (template.includes("/") || template.includes("\\")) return template;
2066
- if (TEMPLATE_FILE_EXTENSIONS.some((e) => template.toLowerCase().endsWith(e))) {
2067
- return template;
2068
- }
2069
- if (templatePaths.length === 0) return template;
2070
- return `${templatePaths[templatePaths.length - 1] ?? ""}#${template}`;
2071
- }
2072
2222
  function templateIdentity(ref) {
2073
2223
  const hash = ref.lastIndexOf("#");
2074
2224
  if (hash === -1) return { source: ref, template: ref };
@@ -2092,7 +2242,7 @@ async function lintOne(label, content, parser, ctx) {
2092
2242
  let tree;
2093
2243
  try {
2094
2244
  tree = await parser.parse(content, label, {
2095
- absPath: ctx.absoluteOf?.(label) ?? label,
2245
+ absPath: ctx.absoluteOf(label),
2096
2246
  flare: ctx.flare
2097
2247
  });
2098
2248
  } catch (err) {
@@ -2104,15 +2254,12 @@ async function lintOne(label, content, parser, ctx) {
2104
2254
  template: null
2105
2255
  };
2106
2256
  }
2107
- const resolution = resolveTemplateRef({
2257
+ const routed = routePage(ctx.routing, {
2108
2258
  filePath: label,
2109
- absolutePath: ctx.absoluteOf?.(label),
2110
- frontmatter: tree.frontmatter,
2111
- cliTemplate: ctx.cliTemplate,
2112
- overrides: ctx.overrides,
2113
- typeIndex: ctx.typeIndex,
2114
- defaultTemplate: ctx.defaultTemplate
2259
+ absolutePath: ctx.absoluteOf(label),
2260
+ frontmatter: tree.frontmatter
2115
2261
  });
2262
+ const resolution = routed.resolution;
2116
2263
  const withResolution = (result) => ctx.explain ? { ...result, resolution, ...tree.flare === void 0 ? {} : { flare: tree.flare } } : result;
2117
2264
  const metaPosition = tree.frontmatterPosition ?? origin2();
2118
2265
  const target = tree.flare?.target;
@@ -2126,7 +2273,7 @@ async function lintOne(label, content, parser, ctx) {
2126
2273
  return withResolution({
2127
2274
  file: label,
2128
2275
  success: false,
2129
- findings: [unknownTypeFinding(resolution, ctx.typeIndex, metaPosition)],
2276
+ findings: [unknownTypeFinding(resolution, ctx.routing.typeIndex, metaPosition)],
2130
2277
  template: null
2131
2278
  });
2132
2279
  }
@@ -2153,17 +2300,13 @@ async function lintOne(label, content, parser, ctx) {
2153
2300
  ],
2154
2301
  template: resolution.ref
2155
2302
  });
2156
- if (resolution.stage === "frontmatter-template" && classifyRef(resolution.ref).kind === "url") {
2157
- return brokenTemplate(
2158
- new LintError(
2159
- `${FILE_TEMPLATE_KEY} may not name a URL ("${resolution.ref}"): a document must not choose what the linter fetches. Declare it in manni.config.yaml under "templates:" or "types:", or pass it with --template.`
2160
- )
2161
- );
2303
+ const ref = routed.ref;
2304
+ if (ref === null) {
2305
+ return brokenTemplate(new LintError(routed.refusal ?? "No template ref resolved."));
2162
2306
  }
2163
- const ref = resolution.stage === "frontmatter-template" ? refRelativeTo(ctx.absoluteOf?.(label) ?? label, resolution.ref) : resolution.ref;
2164
2307
  let template;
2165
2308
  try {
2166
- template = await ctx.getTemplate(ref);
2309
+ template = await ctx.routing.getTemplate(ref);
2167
2310
  } catch (err) {
2168
2311
  return brokenTemplate(err);
2169
2312
  }
@@ -2205,35 +2348,21 @@ async function lintOne(label, content, parser, ctx) {
2205
2348
  }
2206
2349
  async function lintWithManni(run) {
2207
2350
  const { opts, config, cwd, files, forcedParser, usingStdin, tools } = run;
2208
- const templatePaths = templateFiles(opts.templates ?? config.templates);
2209
- const getTemplate = templateLoader();
2210
- const userFiles = [];
2211
- for (const ref of templatePaths) {
2212
- const file = await loadTemplateFile(ref);
2213
- const templates = {};
2214
- for (const name of Object.keys(file.templates ?? {})) {
2215
- templates[name] = await getTemplate(`${ref}#${name}`);
2216
- }
2217
- userFiles.push({ ref, file: { ...file, templates } });
2218
- }
2219
- const typeIndex = buildTypeIndex({
2220
- builtins: listBuiltins(),
2221
- userFiles,
2222
- explicitTypes: opts.types ?? config.types
2351
+ const routing = await buildTemplateRouting({
2352
+ config,
2353
+ templates: opts.templates === void 0 ? void 0 : templateFiles(opts.templates),
2354
+ types: opts.types,
2355
+ overrides: opts.overrides,
2356
+ defaultTemplate: opts.defaultTemplate,
2357
+ cliTemplate: opts.template
2223
2358
  });
2224
2359
  const ctx = {
2225
- getTemplate,
2226
- absoluteOf: (file) => resolve2(cwd, file).replace(/\\/g, "/"),
2227
- typeIndex,
2228
- cliTemplate: cliTemplateRef(opts.template, templatePaths),
2229
- overrides: opts.overrides ?? config.overrides,
2230
- // `template:` in config is the default for a page that declares no type -
2231
- // the bottom of the chain, not the top. `--template` is the top.
2232
- defaultTemplate: opts.defaultTemplate ?? config.template,
2360
+ routing,
2361
+ absoluteOf: (file) => resolve3(cwd, file).replace(/\\/g, "/"),
2233
2362
  explain: opts.explain === true,
2234
2363
  flare: flareRun(tools)
2235
2364
  };
2236
- if (ctx.cliTemplate != null) await getTemplate(ctx.cliTemplate);
2365
+ if (routing.cliTemplate != null) await routing.getTemplate(routing.cliTemplate);
2237
2366
  const results = [];
2238
2367
  if (usingStdin && forcedParser) {
2239
2368
  results.push(
@@ -2249,7 +2378,7 @@ async function lintWithManni(run) {
2249
2378
  }
2250
2379
  let content;
2251
2380
  try {
2252
- content = await readFile3(resolve2(cwd, file), "utf8");
2381
+ content = await readFile3(resolve3(cwd, file), "utf8");
2253
2382
  } catch (err) {
2254
2383
  results.push(
2255
2384
  skip(file, `could not be read: ${errorMessage(err)}`, "unreadable")
@@ -2296,7 +2425,7 @@ async function lintWithDitaOt(run) {
2296
2425
  }
2297
2426
  const labels = /* @__PURE__ */ new Map();
2298
2427
  for (const file of targets) {
2299
- const absolute = resolve2(cwd, file);
2428
+ const absolute = resolve3(cwd, file);
2300
2429
  if (!labels.has(absolute)) labels.set(absolute, file);
2301
2430
  }
2302
2431
  const unique = [...labels.values()];
@@ -2331,7 +2460,7 @@ async function lintWithDitaOt(run) {
2331
2460
  for (const { target, messages } of results) {
2332
2461
  const invoked = labelOf(target);
2333
2462
  for (const message of messages) {
2334
- const file = message.file === void 0 ? invoked : labelOf(resolve2(cwd, message.file));
2463
+ const file = message.file === void 0 ? invoked : labelOf(resolve3(cwd, message.file));
2335
2464
  findingsFor(file).push(ditaOtFinding(message));
2336
2465
  }
2337
2466
  }
@@ -2473,6 +2602,7 @@ async function runLint(opts) {
2473
2602
  }
2474
2603
 
2475
2604
  export {
2605
+ clearMatcherCache,
2476
2606
  listBuiltins,
2477
2607
  classifyRef,
2478
2608
  clearTemplateCaches,
@@ -2480,7 +2610,9 @@ export {
2480
2610
  loadTemplate,
2481
2611
  resolveExtends,
2482
2612
  loadResolvedTemplate,
2483
- clearMatcherCache,
2613
+ buildTemplateRouting,
2614
+ routePage,
2615
+ templateSources,
2484
2616
  validateSections,
2485
2617
  validateDocument,
2486
2618
  LINT_TOOLS,
@@ -2495,4 +2627,4 @@ export {
2495
2627
  STDIN_LABEL,
2496
2628
  runLint
2497
2629
  };
2498
- //# sourceMappingURL=chunk-732PX32V.js.map
2630
+ //# sourceMappingURL=chunk-VQB22TCH.js.map