@hawkeyexl/manni 4.12.4 → 4.14.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 (299) hide show
  1. package/README.md +1 -1
  2. package/dist/batch-TKNIUBLK.js +48 -0
  3. package/dist/build-6G7PEAG4.js +37 -0
  4. package/dist/calibrate-BDCXDZV5.js +43 -0
  5. package/dist/capture-NQJLZD66.js +39 -0
  6. package/dist/check-552X5I2J.js +36 -0
  7. package/dist/{check-3O2PZ7TZ.js → check-5HMDJOFP.js} +15 -14
  8. package/dist/check-BSB4FF4L.js +33 -0
  9. package/dist/{check-V7JUDAPS.js → check-QIZCTAIR.js} +33 -32
  10. package/dist/{check-V7JUDAPS.js.map → check-QIZCTAIR.js.map} +1 -1
  11. package/dist/{chunk-Z42MO7SO.js → chunk-2A6XYSXO.js} +58 -10
  12. package/dist/chunk-2A6XYSXO.js.map +1 -0
  13. package/dist/{chunk-HP43LH7E.js → chunk-2HQSMZ4N.js} +11 -5
  14. package/dist/chunk-2HQSMZ4N.js.map +1 -0
  15. package/dist/{chunk-EBZ4QKKX.js → chunk-36FJWJSK.js} +132 -27
  16. package/dist/chunk-36FJWJSK.js.map +1 -0
  17. package/dist/{chunk-WWKXPPN5.js → chunk-3BMTCS4H.js} +33 -18
  18. package/dist/chunk-3BMTCS4H.js.map +1 -0
  19. package/dist/{chunk-7QH2ZI4F.js → chunk-3CCY7M3R.js} +56 -29
  20. package/dist/chunk-3CCY7M3R.js.map +1 -0
  21. package/dist/{chunk-PNUM6RHR.js → chunk-3MTZZJKH.js} +3 -3
  22. package/dist/chunk-4U3X7LYV.js +236 -0
  23. package/dist/chunk-4U3X7LYV.js.map +1 -0
  24. package/dist/{chunk-ZCJUSQM7.js → chunk-56URKBXQ.js} +17 -17
  25. package/dist/chunk-56URKBXQ.js.map +1 -0
  26. package/dist/{chunk-PP22XDW2.js → chunk-66MKBRTA.js} +88 -12
  27. package/dist/chunk-66MKBRTA.js.map +1 -0
  28. package/dist/{chunk-7JUIJ7Q5.js → chunk-6VT3Z352.js} +24 -7
  29. package/dist/chunk-6VT3Z352.js.map +1 -0
  30. package/dist/{chunk-CU57HT2E.js → chunk-6WJUZQQX.js} +2 -2
  31. package/dist/{chunk-KRKNZ3IV.js → chunk-6XFSZCLT.js} +31 -13
  32. package/dist/chunk-6XFSZCLT.js.map +1 -0
  33. package/dist/{chunk-VFL3ERMI.js → chunk-742G2QCV.js} +4 -3
  34. package/dist/{chunk-VFL3ERMI.js.map → chunk-742G2QCV.js.map} +1 -1
  35. package/dist/chunk-7AXJY4FX.js +83 -0
  36. package/dist/chunk-7AXJY4FX.js.map +1 -0
  37. package/dist/{chunk-PSPNIAOP.js → chunk-7KOWE4F4.js} +14 -16
  38. package/dist/chunk-7KOWE4F4.js.map +1 -0
  39. package/dist/{chunk-J4ZOTZII.js → chunk-7PENJOI6.js} +14 -8
  40. package/dist/{chunk-J4ZOTZII.js.map → chunk-7PENJOI6.js.map} +1 -1
  41. package/dist/chunk-7WVWGULD.js +81 -0
  42. package/dist/chunk-7WVWGULD.js.map +1 -0
  43. package/dist/{chunk-4IW6FAUN.js → chunk-A7MNH4YI.js} +88 -7
  44. package/dist/chunk-A7MNH4YI.js.map +1 -0
  45. package/dist/{chunk-4TGIGVFO.js → chunk-AJYUJ37M.js} +65 -8
  46. package/dist/chunk-AJYUJ37M.js.map +1 -0
  47. package/dist/{chunk-OTJOBZJ5.js → chunk-B2242FYO.js} +2 -1
  48. package/dist/chunk-B2242FYO.js.map +1 -0
  49. package/dist/{chunk-U4SY2TJS.js → chunk-B6GUSA53.js} +15 -10
  50. package/dist/chunk-B6GUSA53.js.map +1 -0
  51. package/dist/{chunk-5NNPEPVM.js → chunk-BA4TCCOO.js} +5 -5
  52. package/dist/{chunk-X4GQ4HPY.js → chunk-BAWKNF6U.js} +3 -3
  53. package/dist/{chunk-Y4TDIUG6.js → chunk-BIRGZEWO.js} +86 -10
  54. package/dist/chunk-BIRGZEWO.js.map +1 -0
  55. package/dist/chunk-BREAC43H.js +85 -0
  56. package/dist/chunk-BREAC43H.js.map +1 -0
  57. package/dist/{chunk-YQV75FIL.js → chunk-CFMI74TP.js} +3 -3
  58. package/dist/{chunk-DTXLFSAB.js → chunk-CZJNYHK7.js} +2 -2
  59. package/dist/{chunk-AATCO43N.js → chunk-D2TIZOMN.js} +6 -5
  60. package/dist/chunk-D2TIZOMN.js.map +1 -0
  61. package/dist/{chunk-3FXPIZXL.js → chunk-EXAZ7K25.js} +5 -5
  62. package/dist/{chunk-BGRP44SX.js → chunk-GHZAOPGK.js} +148 -92
  63. package/dist/chunk-GHZAOPGK.js.map +1 -0
  64. package/dist/{chunk-XP4RNQZL.js → chunk-HGU4FDRY.js} +242 -15
  65. package/dist/chunk-HGU4FDRY.js.map +1 -0
  66. package/dist/{chunk-ZXRAE55H.js → chunk-IGRXQC3H.js} +2 -2
  67. package/dist/{chunk-6KONPVHQ.js → chunk-IOYEPB27.js} +5 -5
  68. package/dist/{chunk-U6IHLEWT.js → chunk-JCTHXG33.js} +2 -2
  69. package/dist/{chunk-TBAMBLF3.js → chunk-JNMY7KZG.js} +132 -15
  70. package/dist/chunk-JNMY7KZG.js.map +1 -0
  71. package/dist/{chunk-QWE3WLV4.js → chunk-JTEWU4C6.js} +26 -16
  72. package/dist/chunk-JTEWU4C6.js.map +1 -0
  73. package/dist/{chunk-KQRYW4DN.js → chunk-JWBS7YDI.js} +8 -8
  74. package/dist/chunk-JWBS7YDI.js.map +1 -0
  75. package/dist/{chunk-EX6E2P6Z.js → chunk-LCRBR7KW.js} +10 -4
  76. package/dist/chunk-LCRBR7KW.js.map +1 -0
  77. package/dist/{chunk-JAPSZ44X.js → chunk-M43NTWVH.js} +10 -7
  78. package/dist/chunk-M43NTWVH.js.map +1 -0
  79. package/dist/chunk-M534DYAJ.js +76 -0
  80. package/dist/chunk-M534DYAJ.js.map +1 -0
  81. package/dist/chunk-MC7U5IH4.js +126 -0
  82. package/dist/chunk-MC7U5IH4.js.map +1 -0
  83. package/dist/{chunk-7TVIFCGT.js → chunk-MIGFQP5N.js} +2 -2
  84. package/dist/{chunk-TZOYZK2E.js → chunk-OZUPJB4J.js} +2 -2
  85. package/dist/{chunk-J67EOBN3.js → chunk-QEZQ7MGH.js} +53 -13
  86. package/dist/chunk-QEZQ7MGH.js.map +1 -0
  87. package/dist/{chunk-5OKSFNUV.js → chunk-QF7EIRMU.js} +29 -23
  88. package/dist/chunk-QF7EIRMU.js.map +1 -0
  89. package/dist/chunk-QK6VYJHV.js +26 -0
  90. package/dist/chunk-QK6VYJHV.js.map +1 -0
  91. package/dist/chunk-QS2Z3SWL.js +21 -0
  92. package/dist/chunk-QS2Z3SWL.js.map +1 -0
  93. package/dist/{chunk-OKMTUAWO.js → chunk-QSPH4F56.js} +5 -5
  94. package/dist/{chunk-XEYS3KAZ.js → chunk-STM3G7WJ.js} +207 -79
  95. package/dist/chunk-STM3G7WJ.js.map +1 -0
  96. package/dist/{chunk-GNUZ37L2.js → chunk-T3BBNLAT.js} +2 -2
  97. package/dist/{chunk-GNUZ37L2.js.map → chunk-T3BBNLAT.js.map} +1 -1
  98. package/dist/{chunk-YGFIQ6Y5.js → chunk-TKINOTVS.js} +1 -1
  99. package/dist/chunk-TKINOTVS.js.map +1 -0
  100. package/dist/{chunk-QUG53QGZ.js → chunk-USKTLEPZ.js} +4 -4
  101. package/dist/{chunk-EU4HDGG4.js → chunk-V6OCE4ND.js} +129 -59
  102. package/dist/chunk-V6OCE4ND.js.map +1 -0
  103. package/dist/{chunk-SSDSV52B.js → chunk-VBBJGFME.js} +6 -7
  104. package/dist/chunk-VBBJGFME.js.map +1 -0
  105. package/dist/{chunk-CWXZ2MRT.js → chunk-VHJ72YCD.js} +4 -3
  106. package/dist/chunk-VHJ72YCD.js.map +1 -0
  107. package/dist/{chunk-PAU352SV.js → chunk-W4GTMOJW.js} +2 -2
  108. package/dist/{chunk-JEUFYSFQ.js → chunk-W5DO426O.js} +114 -70
  109. package/dist/chunk-W5DO426O.js.map +1 -0
  110. package/dist/{chunk-LWMB7JRE.js → chunk-W6B24IMO.js} +3 -3
  111. package/dist/{chunk-SE4JN5XN.js → chunk-WDENIUC7.js} +3 -1
  112. package/dist/chunk-WDENIUC7.js.map +1 -0
  113. package/dist/{chunk-NLELGEKL.js → chunk-WIPTWZVH.js} +6 -6
  114. package/dist/{chunk-RLPWXF5R.js → chunk-Y36PNW6J.js} +9 -9
  115. package/dist/{chunk-TR2XFZPR.js → chunk-Y37VJFX2.js} +9 -9
  116. package/dist/{chunk-3QUCVYNX.js → chunk-YJ3EG2D5.js} +12 -124
  117. package/dist/chunk-YJ3EG2D5.js.map +1 -0
  118. package/dist/{chunk-UKZNLVJW.js → chunk-ZINZTHWO.js} +4 -2
  119. package/dist/chunk-ZINZTHWO.js.map +1 -0
  120. package/dist/{chunk-N5JSOJY6.js → chunk-ZPLIXZZ6.js} +7 -5
  121. package/dist/chunk-ZPLIXZZ6.js.map +1 -0
  122. package/dist/{chunk-VXU75N5R.js → chunk-ZRQUQS7P.js} +5 -79
  123. package/dist/chunk-ZRQUQS7P.js.map +1 -0
  124. package/dist/{cli-RQRMZKKM.js → cli-5XKHMRZ5.js} +317 -28
  125. package/dist/cli-5XKHMRZ5.js.map +1 -0
  126. package/dist/{cli-5QGP6R63.js → cli-7QHJW5GH.js} +69 -26
  127. package/dist/cli-7QHJW5GH.js.map +1 -0
  128. package/dist/{cli-UL2IFH3R.js → cli-BUV3DRUH.js} +29 -83
  129. package/dist/cli-BUV3DRUH.js.map +1 -0
  130. package/dist/{cli-RQSCBJJY.js → cli-IKDX2I5X.js} +20 -18
  131. package/dist/{cli-RQSCBJJY.js.map → cli-IKDX2I5X.js.map} +1 -1
  132. package/dist/{cli-2Q5FODAX.js → cli-LOND37OA.js} +383 -247
  133. package/dist/cli-LOND37OA.js.map +1 -0
  134. package/dist/{cli-4ANSKDPD.js → cli-O6Y2KVWD.js} +11 -11
  135. package/dist/{cli-2OQKCKRD.js → cli-QTLOAVOY.js} +11 -10
  136. package/dist/{cli-2OQKCKRD.js.map → cli-QTLOAVOY.js.map} +1 -1
  137. package/dist/{cli-IE3CYYHA.js → cli-SOA2E26G.js} +62 -22
  138. package/dist/cli-SOA2E26G.js.map +1 -0
  139. package/dist/{cli-SDTXHLCA.js → cli-VQYB3663.js} +19 -18
  140. package/dist/{cli-SDTXHLCA.js.map → cli-VQYB3663.js.map} +1 -1
  141. package/dist/{cli-SGSS6FXE.js → cli-X6IWTDFK.js} +31 -29
  142. package/dist/{cli-SGSS6FXE.js.map → cli-X6IWTDFK.js.map} +1 -1
  143. package/dist/{cli-USPQURPP.js → cli-XAT673VB.js} +3 -3
  144. package/dist/cli.js +14 -14
  145. package/dist/{config-JJW75SBX.js → config-7I5CHHRZ.js} +6 -6
  146. package/dist/docmeta.js +10 -10
  147. package/dist/github-IPBOTQBN.js +36 -0
  148. package/dist/github-XM36D7ZH.js +32 -0
  149. package/dist/graph/runtime.js.map +1 -1
  150. package/dist/index.d.ts +157 -13
  151. package/dist/index.js +147 -131
  152. package/dist/index.js.map +1 -1
  153. package/dist/{json-PQURAHQ5.js → json-225TND7K.js} +15 -13
  154. package/dist/{labels-FMLO2URZ.js → labels-CTLHIRC4.js} +14 -12
  155. package/dist/{labels-FMLO2URZ.js.map → labels-CTLHIRC4.js.map} +1 -1
  156. package/dist/lint-NP3PC3SO.js +35 -0
  157. package/dist/list-JJGNKO6S.js +36 -0
  158. package/dist/list-Q457TIMA.js +34 -0
  159. package/dist/{page-X3HYSH6D.js → page-FJW7J2EU.js} +13 -12
  160. package/dist/{picker-3XF36MJF.js → picker-FPUC5UGM.js} +3 -3
  161. package/dist/{prepare-IQMB262G.js → prepare-RKJEKHAG.js} +21 -20
  162. package/dist/{prepare-IQMB262G.js.map → prepare-RKJEKHAG.js.map} +1 -1
  163. package/dist/{pretty-22PXIEOV.js → pretty-ECBO3EVT.js} +15 -14
  164. package/dist/{pretty-K5BOCKBB.js → pretty-QFEN2SIA.js} +15 -13
  165. package/dist/{provider-LBX4IXGX.js → provider-JY2I3VLF.js} +3 -3
  166. package/dist/{release-VV3UTKE5.js → release-Z3ASYZ3S.js} +3 -3
  167. package/dist/{reporters-5LIYYE6M.js → reporters-IKKL5RHS.js} +15 -14
  168. package/dist/{reporters-26H3N2KW.js → reporters-TDQDQHKE.js} +6 -5
  169. package/dist/{reporters-324OWH36.js → reporters-WGLQKW2Y.js} +6 -6
  170. package/dist/run-BTETGGLW.js +39 -0
  171. package/dist/sarif-K4SMB563.js +31 -0
  172. package/dist/sarif-ZHFK6PZY.js +37 -0
  173. package/dist/{term-2ADSKGZW.js → term-2M7APX2A.js} +58 -109
  174. package/dist/term-2M7APX2A.js.map +1 -0
  175. package/dist/types-VMOT7RAL.js +12 -0
  176. package/dist/types-VMOT7RAL.js.map +1 -0
  177. package/dist/{validate-LRYUEZLJ.js → validate-GBM5STKS.js} +6 -6
  178. package/dist/validate-GBM5STKS.js.map +1 -0
  179. package/package.json +1 -1
  180. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  181. package/plugin/manni/skills/check/SKILL.md +2 -2
  182. package/plugin/manni/skills/evals/SKILL.md +1 -1
  183. package/plugin/manni/skills/fix/SKILL.md +99 -18
  184. package/plugin/manni/skills/setup/SKILL.md +1 -1
  185. package/schemas/lint/template.json +6 -1
  186. package/shapes/graph/shapes-1.1.1.ttl +953 -0
  187. package/templates/lint/tgdp/concept.yaml +27 -13
  188. package/templates/lint/tgdp/how-to.yaml +35 -21
  189. package/templates/lint/tgdp/readme.yaml +69 -25
  190. package/templates/lint/tgdp/reference.yaml +44 -31
  191. package/templates/lint/tgdp/release-notes.yaml +48 -19
  192. package/templates/lint/tgdp/troubleshooting.yaml +45 -31
  193. package/templates/lint/tgdp/tutorial.yaml +35 -19
  194. package/dist/batch-UHLVBMYM.js +0 -46
  195. package/dist/build-4RPXBSAO.js +0 -36
  196. package/dist/calibrate-POL5DCJ6.js +0 -41
  197. package/dist/capture-I7ZYG7NZ.js +0 -38
  198. package/dist/check-6TEG5TM6.js +0 -34
  199. package/dist/check-DGOUTC3V.js +0 -30
  200. package/dist/chunk-3QUCVYNX.js.map +0 -1
  201. package/dist/chunk-4IW6FAUN.js.map +0 -1
  202. package/dist/chunk-4TGIGVFO.js.map +0 -1
  203. package/dist/chunk-5OKSFNUV.js.map +0 -1
  204. package/dist/chunk-7JUIJ7Q5.js.map +0 -1
  205. package/dist/chunk-7QH2ZI4F.js.map +0 -1
  206. package/dist/chunk-AATCO43N.js.map +0 -1
  207. package/dist/chunk-BGRP44SX.js.map +0 -1
  208. package/dist/chunk-CWXZ2MRT.js.map +0 -1
  209. package/dist/chunk-EBZ4QKKX.js.map +0 -1
  210. package/dist/chunk-EU4HDGG4.js.map +0 -1
  211. package/dist/chunk-EX6E2P6Z.js.map +0 -1
  212. package/dist/chunk-HP43LH7E.js.map +0 -1
  213. package/dist/chunk-J67EOBN3.js.map +0 -1
  214. package/dist/chunk-JAPSZ44X.js.map +0 -1
  215. package/dist/chunk-JEUFYSFQ.js.map +0 -1
  216. package/dist/chunk-KQRYW4DN.js.map +0 -1
  217. package/dist/chunk-KRKNZ3IV.js.map +0 -1
  218. package/dist/chunk-MNH7QO4Z.js +0 -15
  219. package/dist/chunk-MNH7QO4Z.js.map +0 -1
  220. package/dist/chunk-N5JSOJY6.js.map +0 -1
  221. package/dist/chunk-OTJOBZJ5.js.map +0 -1
  222. package/dist/chunk-PP22XDW2.js.map +0 -1
  223. package/dist/chunk-PSPNIAOP.js.map +0 -1
  224. package/dist/chunk-QWE3WLV4.js.map +0 -1
  225. package/dist/chunk-SE4JN5XN.js.map +0 -1
  226. package/dist/chunk-SSDSV52B.js.map +0 -1
  227. package/dist/chunk-TBAMBLF3.js.map +0 -1
  228. package/dist/chunk-U4SY2TJS.js.map +0 -1
  229. package/dist/chunk-UKZNLVJW.js.map +0 -1
  230. package/dist/chunk-VXU75N5R.js.map +0 -1
  231. package/dist/chunk-W7EZJPRX.js +0 -117
  232. package/dist/chunk-W7EZJPRX.js.map +0 -1
  233. package/dist/chunk-WWKXPPN5.js.map +0 -1
  234. package/dist/chunk-XEYS3KAZ.js.map +0 -1
  235. package/dist/chunk-XP4RNQZL.js.map +0 -1
  236. package/dist/chunk-Y4TDIUG6.js.map +0 -1
  237. package/dist/chunk-YGFIQ6Y5.js.map +0 -1
  238. package/dist/chunk-Z42MO7SO.js.map +0 -1
  239. package/dist/chunk-ZCJUSQM7.js.map +0 -1
  240. package/dist/cli-2Q5FODAX.js.map +0 -1
  241. package/dist/cli-5QGP6R63.js.map +0 -1
  242. package/dist/cli-IE3CYYHA.js.map +0 -1
  243. package/dist/cli-RQRMZKKM.js.map +0 -1
  244. package/dist/cli-UL2IFH3R.js.map +0 -1
  245. package/dist/github-PBIYRH5S.js +0 -35
  246. package/dist/github-RJG2MAWB.js +0 -30
  247. package/dist/lint-N2CY66JX.js +0 -34
  248. package/dist/list-OMHTVFDY.js +0 -32
  249. package/dist/list-VBFNFEXV.js +0 -35
  250. package/dist/run-4EKG6EMI.js +0 -37
  251. package/dist/term-2ADSKGZW.js.map +0 -1
  252. package/dist/types-Y6TXHM7M.js +0 -10
  253. /package/dist/{batch-UHLVBMYM.js.map → batch-TKNIUBLK.js.map} +0 -0
  254. /package/dist/{build-4RPXBSAO.js.map → build-6G7PEAG4.js.map} +0 -0
  255. /package/dist/{calibrate-POL5DCJ6.js.map → calibrate-BDCXDZV5.js.map} +0 -0
  256. /package/dist/{capture-I7ZYG7NZ.js.map → capture-NQJLZD66.js.map} +0 -0
  257. /package/dist/{check-3O2PZ7TZ.js.map → check-552X5I2J.js.map} +0 -0
  258. /package/dist/{check-6TEG5TM6.js.map → check-5HMDJOFP.js.map} +0 -0
  259. /package/dist/{check-DGOUTC3V.js.map → check-BSB4FF4L.js.map} +0 -0
  260. /package/dist/{chunk-PNUM6RHR.js.map → chunk-3MTZZJKH.js.map} +0 -0
  261. /package/dist/{chunk-CU57HT2E.js.map → chunk-6WJUZQQX.js.map} +0 -0
  262. /package/dist/{chunk-5NNPEPVM.js.map → chunk-BA4TCCOO.js.map} +0 -0
  263. /package/dist/{chunk-X4GQ4HPY.js.map → chunk-BAWKNF6U.js.map} +0 -0
  264. /package/dist/{chunk-YQV75FIL.js.map → chunk-CFMI74TP.js.map} +0 -0
  265. /package/dist/{chunk-DTXLFSAB.js.map → chunk-CZJNYHK7.js.map} +0 -0
  266. /package/dist/{chunk-3FXPIZXL.js.map → chunk-EXAZ7K25.js.map} +0 -0
  267. /package/dist/{chunk-ZXRAE55H.js.map → chunk-IGRXQC3H.js.map} +0 -0
  268. /package/dist/{chunk-6KONPVHQ.js.map → chunk-IOYEPB27.js.map} +0 -0
  269. /package/dist/{chunk-U6IHLEWT.js.map → chunk-JCTHXG33.js.map} +0 -0
  270. /package/dist/{chunk-7TVIFCGT.js.map → chunk-MIGFQP5N.js.map} +0 -0
  271. /package/dist/{chunk-TZOYZK2E.js.map → chunk-OZUPJB4J.js.map} +0 -0
  272. /package/dist/{chunk-OKMTUAWO.js.map → chunk-QSPH4F56.js.map} +0 -0
  273. /package/dist/{chunk-QUG53QGZ.js.map → chunk-USKTLEPZ.js.map} +0 -0
  274. /package/dist/{chunk-PAU352SV.js.map → chunk-W4GTMOJW.js.map} +0 -0
  275. /package/dist/{chunk-LWMB7JRE.js.map → chunk-W6B24IMO.js.map} +0 -0
  276. /package/dist/{chunk-NLELGEKL.js.map → chunk-WIPTWZVH.js.map} +0 -0
  277. /package/dist/{chunk-RLPWXF5R.js.map → chunk-Y36PNW6J.js.map} +0 -0
  278. /package/dist/{chunk-TR2XFZPR.js.map → chunk-Y37VJFX2.js.map} +0 -0
  279. /package/dist/{cli-4ANSKDPD.js.map → cli-O6Y2KVWD.js.map} +0 -0
  280. /package/dist/{cli-USPQURPP.js.map → cli-XAT673VB.js.map} +0 -0
  281. /package/dist/{config-JJW75SBX.js.map → config-7I5CHHRZ.js.map} +0 -0
  282. /package/dist/{github-PBIYRH5S.js.map → github-IPBOTQBN.js.map} +0 -0
  283. /package/dist/{github-RJG2MAWB.js.map → github-XM36D7ZH.js.map} +0 -0
  284. /package/dist/{json-PQURAHQ5.js.map → json-225TND7K.js.map} +0 -0
  285. /package/dist/{lint-N2CY66JX.js.map → lint-NP3PC3SO.js.map} +0 -0
  286. /package/dist/{list-OMHTVFDY.js.map → list-JJGNKO6S.js.map} +0 -0
  287. /package/dist/{list-VBFNFEXV.js.map → list-Q457TIMA.js.map} +0 -0
  288. /package/dist/{page-X3HYSH6D.js.map → page-FJW7J2EU.js.map} +0 -0
  289. /package/dist/{picker-3XF36MJF.js.map → picker-FPUC5UGM.js.map} +0 -0
  290. /package/dist/{pretty-22PXIEOV.js.map → pretty-ECBO3EVT.js.map} +0 -0
  291. /package/dist/{pretty-K5BOCKBB.js.map → pretty-QFEN2SIA.js.map} +0 -0
  292. /package/dist/{provider-LBX4IXGX.js.map → provider-JY2I3VLF.js.map} +0 -0
  293. /package/dist/{release-VV3UTKE5.js.map → release-Z3ASYZ3S.js.map} +0 -0
  294. /package/dist/{reporters-26H3N2KW.js.map → reporters-IKKL5RHS.js.map} +0 -0
  295. /package/dist/{reporters-324OWH36.js.map → reporters-TDQDQHKE.js.map} +0 -0
  296. /package/dist/{reporters-5LIYYE6M.js.map → reporters-WGLQKW2Y.js.map} +0 -0
  297. /package/dist/{run-4EKG6EMI.js.map → run-BTETGGLW.js.map} +0 -0
  298. /package/dist/{types-Y6TXHM7M.js.map → sarif-K4SMB563.js.map} +0 -0
  299. /package/dist/{validate-LRYUEZLJ.js.map → sarif-ZHFK6PZY.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/a11y/cli.ts","../src/a11y/types.ts","../src/a11y/core/url.ts","../src/a11y/core/crawl.ts","../src/a11y/core/exclude.ts","../src/a11y/core/seeds.ts","../src/a11y/core/sitemap.ts","../src/a11y/commands/check.ts","../src/a11y/core/analyzer.ts","../src/a11y/core/config.ts","../src/a11y/reporters/github.ts","../src/a11y/reporters/json.ts","../src/a11y/reporters/pretty.ts","../src/a11y/reporters/index.ts","../src/a11y/reporters/progress.ts"],"sourcesContent":["/**\n * The a11y tool's CLI. A thin commander wrapper over `runCheck`, following\n * clig.dev the way meta's does: primary output to stdout, diagnostics to\n * stderr, color only on a TTY (never under NO_COLOR/--no-color), and the\n * exit codes 0 ok, 1 findings, 2 operational/usage.\n *\n * Every flag is validated here and turned into an `A11yError` before the\n * browser is asked to launch, so a typo costs a message and not a launch.\n */\nimport { Command } from \"commander\";\nimport pkg from \"../../package.json\" with { type: \"json\" };\nimport { shouldColor } from \"../shared/color.js\";\nimport { FAMILY_CONFIG_NAMES } from \"../shared/config-file.js\";\nimport { fail } from \"../shared/run.js\";\nimport { CHECK_DEFAULTS, runCheck } from \"./commands/check.js\";\nimport { createPlaywrightAnalyzer } from \"./core/analyzer.js\";\nimport { excludeEntryLabel, loadA11yConfig, type LoadedA11yConfig } from \"./core/config.js\";\nimport { MUST_START_WITH_SLASH, isUrlPathGlob, type ExcludeGlob } from \"./core/exclude.js\";\nimport { resolveSeeds } from \"./core/seeds.js\";\nimport { A11Y_FORMAT_LIST, isA11yFormat, render } from \"./reporters/index.js\";\nimport { CLEAR_LINE, createProgressReporter } from \"./reporters/progress.js\";\nimport {\n A11yError,\n SEVERITY_LIST,\n isSeverity,\n type Severity,\n type ProgressListener,\n} from \"./types.js\";\n\n/**\n * `--collection <name>` and `--exclude <glob>`: one value per occurrence,\n * never split on commas. The two lines are meta's `collect`, copied rather\n * than imported: a tool does not reach into a sibling tool's CLI.\n */\nfunction collect(value: string, prev: string[]): string[] {\n return prev.concat([value]);\n}\n\n/** `--tags <list>`: commas separate, whitespace around them is trimmed, empty items are dropped. */\nfunction splitList(value: string): string[] {\n return value\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n}\n\n/**\n * Whether to paint what goes to `stream`. The report and the progress line\n * are decided separately, since stdout may be a pipe while stderr is still\n * the terminal (`-f json | jq`), and the other way round.\n */\nfunction resolveColor(program: Command, stream: NodeJS.WriteStream): boolean {\n // commander maps --no-color to opts.color === false.\n const noColor = program.opts().color === false;\n // `isTTY` is undefined off a terminal, never false; `shouldColor` treats a\n // missing one as \"not a terminal\".\n return shouldColor({ noColor, isTTY: stream.isTTY });\n}\n\ninterface Progress {\n /** Hears the run's events; `undefined` keeps the run silent. */\n listener: ProgressListener | undefined;\n /**\n * Erase the status line. On a terminal it is rewritten in place, and a run\n * that dies mid-crawl (no browser, a seed that will not load) would leave\n * it there for the error to land on. A no-op everywhere else.\n */\n clear: () => void;\n}\n\n/**\n * `--progress` and `--no-progress` decide; with neither, progress is on\n * exactly when stderr is a terminal, so a CI log stays as it was.\n */\nfunction resolveProgress(program: Command, flag: boolean | undefined): Progress {\n // @types/node says boolean; off a terminal it is undefined (see resolveColor).\n const tty = (process.stderr.isTTY as boolean | undefined) ?? false;\n const silent: Progress = { listener: undefined, clear: () => undefined };\n if (!(flag ?? tty)) return silent;\n const listener = createProgressReporter({\n stream: process.stderr,\n color: resolveColor(program, process.stderr),\n tty,\n });\n if (!tty) return { listener, clear: silent.clear };\n return {\n listener,\n clear: () => {\n process.stderr.write(CLEAR_LINE);\n },\n };\n}\n\n/**\n * A positive integer flag, in canonical form. Anything else is a usage error:\n * `0`, `-3`, `2.5`, `many`, and `01`, since a leading zero is not how anyone\n * writes a page count and would read as an octal literal elsewhere.\n * Exported for its unit test only.\n */\nexport function positiveInteger(value: string, flag: string): number {\n if (!/^[1-9]\\d*$/.test(value)) {\n throw new A11yError(`${flag} must be an integer >= 1.`);\n }\n return Number(value);\n}\n\n/**\n * `--max-pages <n>` and `--no-max-pages` share one option value, the way `-c`\n * and `--no-config` do, so the pair has three states rather than two:\n * a number the user typed, `\"uncapped\"` for the negation, and `undefined`\n * when neither half was typed and the config key still decides.\n */\nexport type MaxPagesFlag = number | \"uncapped\" | undefined;\n\n/**\n * The typed half of that pair, in canonical form. commander hands the\n * negation over as `false`, which is not the same as saying nothing: it is\n * the typed way to ask for a run with no cap at all. Parsed before the config\n * file is read, so a bad value costs a message and nothing else.\n * Exported for its unit test only.\n */\nexport function parseMaxPages(value: string | false | undefined): MaxPagesFlag {\n if (value === false) return \"uncapped\";\n if (value === undefined) return undefined;\n return positiveInteger(value, \"--max-pages\");\n}\n\n/**\n * The cap in force: a typed flag beats the config key, and `undefined` out\n * means no cap, which is what `runCheck` reads as \"check everything found\".\n * Exported for its unit test only.\n */\nexport function resolveMaxPages(\n flag: MaxPagesFlag,\n configured: number | undefined,\n): number | undefined {\n if (flag === \"uncapped\") return undefined;\n return flag ?? configured;\n}\n\n/**\n * Whether to crawl: `--crawl` and `--no-crawl` are both declared, so\n * commander holds no default for the pair and `undefined` means the user\n * typed neither. Same three-way precedence as meta: CLI flag > config key >\n * built-in default.\n * Exported for its unit test only.\n */\nexport function resolveCrawl(flag: boolean | undefined, configured: boolean | undefined): boolean {\n return flag ?? configured ?? CHECK_DEFAULTS.crawl;\n}\n\n/**\n * Every `--exclude` value has to be able to match a path, which always starts\n * with `/`. Checked before the config file is read and long before a browser\n * launches, so a pattern that could only ever miss costs a message. Each\n * survivor carries the flag spelling a later message names it by.\n * Exported for its unit test only.\n */\nexport function assertExcludeGlobs(globs: readonly string[]): ExcludeGlob[] {\n return globs.map((glob) => {\n if (!isUrlPathGlob(glob)) {\n throw new A11yError(`--exclude \"${glob}\" ${MUST_START_WITH_SLASH}`);\n }\n return { glob, source: `--exclude \"${glob}\"` };\n });\n}\n\n/**\n * The same list as it arrives from `a11y.exclude:`, named the way the config\n * errors name it. A run whose patterns came from a file never reports them as\n * a flag, which would send a reader looking through a shell history for\n * something they never typed.\n * Exported for its unit test only.\n */\nexport function configExcludeGlobs(\n globs: readonly string[],\n source: string | null,\n): ExcludeGlob[] {\n // The CLI reaches here only with a file behind it, since `cfg.exclude` is\n // set, so the fallback is for a programmatic caller that passed a section\n // with no source. It names the file a reader would look for rather than\n // labelling an entry with \"null\".\n const file = source ?? FAMILY_CONFIG_NAMES[0] ?? \"manni.config.yaml\";\n return globs.map((glob, i) => ({ glob, source: excludeEntryLabel(file, i) }));\n}\n\nfunction assertSeverity(value: string): Severity {\n if (!isSeverity(value)) {\n throw new A11yError(`Unknown --severity \"${value}\". Use ${SEVERITY_LIST}.`);\n }\n return value;\n}\n\ninterface CheckCliOptions {\n /** `-f, --format` (default \"pretty\"). */\n format: string;\n /** `--crawl` → true, `--no-crawl` → false, neither → undefined (config decides). */\n crawl?: boolean;\n /** `--max-pages <n>` → the string; `--no-max-pages` → commander's false; neither → undefined. */\n maxPages?: string | false;\n /** `--tags <list>`, split on \",\" here (same helper shape as meta's --ext). */\n tags?: string;\n /** `--severity <level>`. */\n severity: string;\n /** `--timeout <ms>`, parsed to int here. */\n timeout: string;\n /** `-q, --quiet`. */\n quiet?: boolean;\n /** `--progress` → true, `--no-progress` → false, neither → undefined (auto). */\n progress?: boolean;\n /** `--collection <name>`, one value per occurrence. `[]` when never given. */\n collection: string[];\n /** `--exclude <glob>`, one value per occurrence. `[]` when never given. */\n exclude: string[];\n /** `-c <path>` | `--no-config` → false. */\n config?: string | false;\n}\n\n/** Commander program named \"a11y\"; the umbrella mounts it. No entry point. */\nexport function buildProgram(): Command {\n const program = new Command();\n program\n .name(\"a11y\")\n .description(\"Crawl a site and check every page for accessibility violations with axe-core\")\n .version(pkg.version, \"-V, --version\")\n .option(\"--no-color\", \"disable colored output\")\n // A pointer, not the whole help screen; the message before it already\n // names the offending flag.\n .showHelpAfterError(\"(add --help for usage)\")\n // MUST come before the `.command()` call below. `copyInheritedSettings`\n // copies `_exitCallback` **by value** at subcommand-creation time, so an\n // `exitOverride()` installed afterwards leaves the subcommand calling\n // `process.exit(1)` while the program-level case looks fixed.\n .exitOverride();\n\n program\n .command(\"check\")\n .description(\"Crawl from the given URLs and check every page with axe-core\")\n .argument(\n \"[urls...]\",\n \"http(s) seed URLs; falls back to a collection's url: or a11y.urls in manni.config.yaml\",\n )\n .option(\"-f, --format <format>\", `output: ${A11Y_FORMAT_LIST}`, \"pretty\")\n // `--crawl` first, so that `--no-crawl` leaves the pair's default\n // undefined instead of commander's `true` for a lone negation. Undefined\n // is what lets `crawl:` in config be read as the next rung down.\n .option(\"--crawl\", \"crawl from the given URLs: sitemap and link following (default)\")\n .option(\"--no-crawl\", \"check exactly the given URLs: no sitemap, no link following\")\n // No commander default on purpose: the built-in behaviour is to check\n // everything discovered, and \"no cap\" is not a value commander could hold.\n .option(\n \"--max-pages <n>\",\n \"cap on pages checked; the rest are reported as skipped (default: no cap)\",\n )\n .option(\"--no-max-pages\", \"check every page found, ignoring a configured maxPages\")\n .option(\n \"--exclude <glob>\",\n \"URL path glob to keep out of the crawl; repeatable\",\n collect,\n [],\n )\n .option(\"--tags <list>\", \"comma-separated axe tags to restrict the rules to\")\n .option(\n \"--severity <level>\",\n `minimum severity reported: ${SEVERITY_LIST}`,\n CHECK_DEFAULTS.severity,\n )\n .option(\n \"--timeout <ms>\",\n \"per-page navigation timeout in milliseconds\",\n String(CHECK_DEFAULTS.timeout),\n )\n .option(\"-q, --quiet\", \"in pretty output, hide pages with no violations\")\n // `--progress` first, so that adding `--no-progress` leaves the default\n // undefined (auto) instead of commander's `true` for a lone negation.\n .option(\"--progress\", \"report progress on stderr (default: only on a terminal)\")\n .option(\"--no-progress\", \"never report progress\")\n .option(\n \"--collection <name>\",\n \"configured collection to run over; repeatable\",\n collect,\n [],\n )\n .option(\"-c, --config <path>\", \"path to a manni config file\")\n .option(\"--no-config\", \"ignore any discovered config file\")\n .action(async (urls: string[], options: CheckCliOptions, command: Command) => {\n // Settled once the flags are validated; until then there is no line to clear.\n let clearProgress = (): void => undefined;\n try {\n // A value commander filled in from the option's default yields to the\n // config file; one the user typed wins over it. Same three-way\n // precedence as meta: CLI flag > config key > default.\n const typed = (name: string): boolean =>\n command.getOptionValueSource(name) === \"cli\";\n\n const format = options.format;\n if (!isA11yFormat(format)) {\n throw new A11yError(`Unknown --format \"${format}\". Use ${A11Y_FORMAT_LIST}.`);\n }\n const severity = assertSeverity(options.severity);\n const maxPages = parseMaxPages(options.maxPages);\n const timeout = positiveInteger(options.timeout, \"--timeout\");\n const exclude = assertExcludeGlobs(options.exclude);\n\n const loaded: LoadedA11yConfig =\n options.config === false\n // --no-config drops the collections with the section: the file\n // the user told the run to ignore is where both live.\n ? { config: {}, source: null, collections: [] }\n : await loadA11yConfig(process.cwd(), options.config);\n const cfg = loaded.config;\n\n // Before the analyzer exists: a run with nothing to check, or a\n // --collection that cannot be honoured, costs a message and not a\n // browser launch.\n const seeds = resolveSeeds({\n urls,\n collections: options.collection,\n ...(cfg.urls === undefined ? {} : { configUrls: cfg.urls }),\n declared: loaded.collections,\n source: loaded.source,\n });\n\n const parent = command.parent ?? command;\n const progress = resolveProgress(parent, options.progress);\n clearProgress = progress.clear;\n\n const run = await runCheck(\n {\n urls: seeds,\n crawl: resolveCrawl(options.crawl, cfg.crawl),\n // Typed flag > config key > no cap. There is no default to fall\n // to, and `--no-max-pages` is the typed way to ask for none.\n maxPages: resolveMaxPages(maxPages, cfg.maxPages),\n tags:\n options.tags !== undefined\n ? splitList(options.tags)\n : (cfg.tags ?? CHECK_DEFAULTS.tags),\n // A typed flag replaces the config list entirely; the two do not\n // merge. Merging would only ever let a run exclude *more* than\n // the repository's default, so checking one excluded section on\n // purpose would need --no-config, which also drops collections:.\n exclude: typed(\"exclude\")\n ? exclude\n : configExcludeGlobs(cfg.exclude ?? [], loaded.source),\n severity: typed(\"severity\") ? severity : (cfg.severity ?? CHECK_DEFAULTS.severity),\n timeout: typed(\"timeout\") ? timeout : (cfg.timeout ?? CHECK_DEFAULTS.timeout),\n },\n { analyzer: createPlaywrightAnalyzer(), onProgress: progress.listener },\n );\n\n const color = resolveColor(parent, process.stdout);\n const text = render(format, run, { color, quiet: Boolean(options.quiet) });\n // Only `github` may say nothing on a clean run; every other format\n // owes its envelope even when it is empty.\n if (text.length > 0 || format !== \"github\") {\n process.stdout.write(`${text}\\n`);\n }\n process.exitCode = run.summary.failed > 0 ? 1 : 0;\n } catch (err) {\n clearProgress();\n fail(err);\n }\n });\n\n return program;\n}\n\n","/**\n * The shapes the a11y tool produces and the error it throws.\n *\n * Everything downstream of the browser — the crawl, the check core, the\n * reporters — speaks in these types, so the analyzer is the only module that\n * knows axe's own result shape.\n */\nimport { ToolError } from \"../shared/errors.js\";\nimport type { Severity } from \"../shared/severity.js\";\n\n/**\n * The severity scale is the family's, not a11y's. It is re-exported here so\n * the tool's own modules and tests have one import for everything they speak.\n */\nexport {\n SEVERITIES,\n SEVERITY_LIST,\n isSeverity,\n meetsSeverity,\n type Severity,\n} from \"../shared/severity.js\";\n\n/** Operational/usage failure of the a11y tool: one line on stderr, exit 2. */\nexport class A11yError extends ToolError {\n constructor(message: string) {\n super(message);\n this.name = \"A11yError\";\n }\n}\n\n/**\n * axe's own scale, which it calls impact. Least to most severe. The analyzer\n * maps these onto the family `Severity` (`severityOf`) and keeps the original\n * on the violation as `impact`.\n */\nexport const AXE_IMPACTS = [\"minor\", \"moderate\", \"serious\", \"critical\"] as const;\nexport type AxeImpact = (typeof AXE_IMPACTS)[number];\n\nexport function isAxeImpact(value: string): value is AxeImpact {\n return (AXE_IMPACTS as readonly string[]).includes(value);\n}\n\nexport interface ViolationNode {\n /** axe's CSS selector path to the element (joined `target`). */\n target: string;\n /** The element's outer HTML, as axe reports it (truncated to 200 chars in pretty output only). */\n html: string;\n /** axe's failureSummary: what to fix, in prose. */\n summary: string;\n}\n\nexport interface Violation {\n /** axe rule id, e.g. \"image-alt\". */\n id: string;\n /** The family level, mapped from `impact`. What the floor and the reporters use. */\n severity: Severity;\n /**\n * axe's own value, kept for lookup against Deque's rule pages and the axe\n * DevTools report a team already reads. An unknown or `null` impact is\n * recorded as `\"minor\"`.\n */\n impact: AxeImpact;\n /** Short rule description, e.g. \"Images must have alternate text\". */\n help: string;\n /** Deque University rule page. */\n helpUrl: string;\n /** axe tags, e.g. [\"cat.text-alternatives\", \"wcag2a\", \"wcag111\"]. */\n tags: string[];\n nodes: ViolationNode[];\n}\n\nexport interface PageResult {\n /** Normalized URL that was checked. */\n url: string;\n /** How the URL entered the run. */\n source: \"seed\" | \"sitemap\" | \"link\";\n /** Violations at or above the severity floor. Empty when `error` is set. */\n violations: Violation[];\n /** Count of axe rules that passed on this page. */\n passes: number;\n /** Count of rules axe could not decide (reported, never counted as failures). */\n incomplete: number;\n /**\n * round(100 × passes ÷ (passes + violations.length)), the share of applicable\n * axe rules that passed after severity filtering. Not a Lighthouse score.\n * `null` when the page did not load, or when no rule applied.\n */\n score: number | null;\n /** Set when the page could not be loaded or analyzed; the page counts as failed. */\n error?: string;\n}\n\n/**\n * A page that sent the browser elsewhere once it had loaded, by a meta refresh\n * or a script. It is not analyzed and is not a result: its destination joins\n * the crawl in its place, under the same rules as any other URL.\n */\nexport interface Redirect {\n /** The page that redirected, as queued. */\n url: string;\n /** Where it redirects, normalized. Present whether or not the destination was checked. */\n to: string;\n /** How the redirecting page entered the run. Its destination inherits it. */\n source: PageResult[\"source\"];\n}\n\nexport interface CheckSummary {\n /** Distinct URLs that entered the frontier (seeds + sitemap + links). */\n discovered: number;\n /** Pages actually analyzed. */\n checked: number;\n /** Discovered but not checked because the `maxPages` cap was reached; `0` without a cap. */\n skipped: number;\n /**\n * Discovered, then dropped unloaded because the browser had already landed\n * on the same page under another spelling (a redirect target). Neither\n * checked nor skipped:\n * `checked + skipped + duplicates + redirects === discovered`.\n */\n duplicates: number;\n /**\n * Pages discovered, then not analyzed because they redirect in the browser\n * (a meta refresh or a script). Each one is listed in `CheckRun.redirects`.\n */\n redirects: number;\n /**\n * Distinct URLs an `--exclude` pattern kept out of the crawl, counted once\n * each however many pages linked to them, and keyed the way the frontier\n * dedupes. It sits **outside** the identity above, because an excluded URL\n * never entered the frontier. `0` on a run that excludes nothing.\n */\n excluded: number;\n /**\n * Pages with ≥1 remaining violation, whatever its severity, or an `error`.\n * Drives exit 1. The floor is the gate here, unlike `meta` and `cite`, which\n * fail on error-severity findings alone; proposal 0064.\n */\n failed: number;\n /** Total remaining violations across pages (rules, not nodes). */\n violations: number;\n /** Violations by family severity, always all three keys, zero-filled. */\n bySeverity: Record<Severity, number>;\n /** The sitemap URL that was found, or `null` if none was. Finding one is not using one: see `sitemapPages`. */\n sitemap: string | null;\n /**\n * Same-host, in-scope page URLs the sitemap listed. `0` when no sitemap was\n * found, and `0` when one was found whose every `<loc>` was out of scope — a\n * built sitemap listing production URLs, read on a local preview, is the\n * ordinary way that happens.\n *\n * This is the count the progress line reports, so it is taken before the\n * crawl dedupes against the seeds. A seed that the sitemap also lists is\n * counted here, which means the number can overstate what the sitemap alone\n * contributed to the frontier.\n */\n sitemapPages: number;\n /**\n * Whether the run discovered pages beyond the seeds (sitemap and same-host\n * links). `false` under `--no-crawl`, where `sitemap` is always `null` and\n * no link was followed.\n */\n crawl: boolean;\n}\n\nexport interface CheckRun {\n results: PageResult[];\n /** Pages that redirected in the browser, in visit order. Never in `results`. */\n redirects: Redirect[];\n summary: CheckSummary;\n}\n\n/**\n * What a run says while it is still running. The crawl emits these in order\n * (`browser`, then `page` and `checked` or `redirected` per page, then\n * `done`); the check core adds `sitemap` before them when it crawls. A\n * listener is optional, and nothing is emitted without one.\n */\nexport type ProgressEvent =\n /** About to launch the browser, before the first page. */\n | { kind: \"browser\" }\n /** Discovery finished: the sitemap that was found (or none), and how many in-scope URLs it gave. */\n | { kind: \"sitemap\"; source: string | null; urls: number }\n /**\n * Discovery settled and `--exclude` took `urls` distinct URLs out, across\n * `patterns` patterns. Emitted once, before the browser starts, and only\n * when something was excluded. There is no event per excluded URL: a\n * pattern that removes four hundred pages would bury the ones checked.\n *\n * `urls` is what the seeds and the sitemap gave the run. Links are followed\n * afterwards, and a page excluded that way is counted in `summary.excluded`\n * without reaching this event, so the two can disagree and the summary is\n * the authoritative total.\n */\n | { kind: \"excluded\"; urls: number; patterns: number }\n /** About to check page `index` (1-based); `queued` is every URL discovered so far. */\n | { kind: \"page\"; index: number; queued: number; url: string }\n /**\n * Page `index` finished. `violations` is axe's count for the page before the\n * severity floor is applied, so it can be higher than what the report keeps.\n * `error` is set when the page could not be loaded or analyzed. A seed that\n * fails ends the run instead, and is reported as the run's error.\n */\n | { kind: \"checked\"; index: number; url: string; violations: number; error?: string }\n /**\n * Page `index` sent the browser to `to` once loaded, so it was not\n * analyzed. Emitted in place of `checked`; the counter counts checked\n * pages, so the next page reuses `index`.\n */\n | { kind: \"redirected\"; index: number; url: string; to: string }\n /** The crawl is over: pages analyzed, and pages left in the frontier. */\n | { kind: \"done\"; checked: number; skipped: number };\n\nexport type ProgressListener = (event: ProgressEvent) => void;\n","/**\n * URL helpers for the crawl.\n *\n * Three questions, asked of every candidate before it enters the frontier:\n * what is its canonical spelling (so `/a#top` and `/a` are one page), is it\n * on a host the run is allowed to visit, and is it a page at all rather than\n * a stylesheet or a PDF. The WHATWG parser does most of the first one.\n */\nimport { A11yError } from \"../types.js\";\n\n/**\n * Canonical spelling for dedupe: parse with `new URL`, drop the fragment,\n * lowercase the hostname, drop a default port, keep path/query/trailing slash\n * exactly as given. Throws `A11yError` for an unparseable string.\n */\nexport function normalizeUrl(url: string): string {\n const parsed = parse(url);\n if (parsed === null) throw new A11yError(`Not a valid URL: \"${url}\".`);\n parsed.hash = \"\";\n return parsed.href;\n}\n\n/**\n * The key two spellings of one page share: `normalizeUrl`, then one trailing\n * `/` dropped from the path unless the path is exactly `/`. The query stays.\n * `/a` and `/a/` can be different resources, but on a static site they are one\n * page, and a crawl that checks both double-counts it. Only the seen set uses\n * this; the URL fetched and reported keeps the spelling it was given. Throws\n * `A11yError` for an unparseable string.\n */\nexport function dedupeKey(url: string): string {\n const parsed = new URL(normalizeUrl(url));\n if (parsed.pathname.length > 1 && parsed.pathname.endsWith(\"/\")) {\n parsed.pathname = parsed.pathname.slice(0, -1);\n }\n return parsed.href;\n}\n\n/** `http:` or `https:` and parseable. */\nexport function isHttpUrl(url: string): boolean {\n const parsed = parse(url);\n return parsed !== null && isHttpProtocol(parsed);\n}\n\n/**\n * Same site = same hostname (case-insensitive) and same non-default port.\n * `http://` and `https://` of one host are the same site; `www.example.com`\n * and `example.com` are not.\n */\nexport function sameHost(a: string, b: string): boolean {\n const left = parse(a);\n const right = parse(b);\n if (left === null || right === null) return false;\n // The parser has already dropped `:80` on http and `:443` on https, so an\n // empty port on both sides means \"the scheme's default\" and the two schemes\n // of one host compare equal, as the doc comment promises. Only an explicit\n // non-default port survives to differ.\n return (\n left.hostname.toLowerCase() === right.hostname.toLowerCase() &&\n left.port === right.port\n );\n}\n\n/**\n * A link worth loading as a page: http(s), not `mailto:`/`tel:`/`javascript:`/\n * `data:`, and the last path segment does not end in one of ASSET_EXTENSIONS.\n */\nexport function isPageLink(url: string): boolean {\n const parsed = parse(url);\n if (parsed === null || !isHttpProtocol(parsed)) return false;\n const last = parsed.pathname.slice(parsed.pathname.lastIndexOf(\"/\") + 1);\n const dot = last.lastIndexOf(\".\");\n if (dot === -1) return true;\n return !ASSET_EXTENSIONS.has(last.slice(dot).toLowerCase());\n}\n\nexport const ASSET_EXTENSIONS: ReadonlySet<string> = new Set([\n \".pdf\",\n \".zip\",\n \".gz\",\n \".png\",\n \".jpg\",\n \".jpeg\",\n \".gif\",\n \".svg\",\n \".webp\",\n \".avif\",\n \".ico\",\n \".css\",\n \".js\",\n \".mjs\",\n \".map\",\n \".json\",\n \".xml\",\n \".txt\",\n \".mp3\",\n \".mp4\",\n \".webm\",\n \".woff\",\n \".woff2\",\n \".ttf\",\n]);\n\nfunction parse(url: string): URL | null {\n try {\n return new URL(url);\n } catch {\n return null;\n }\n}\n\nfunction isHttpProtocol(url: URL): boolean {\n return url.protocol === \"http:\" || url.protocol === \"https:\";\n}\n","/**\n * The crawl: which pages a run visits, and in what order.\n *\n * A breadth-first walk over a FIFO frontier. Seeds go in first, then the\n * sitemap's pages, then every same-host link each visited page lists, in the\n * order it listed them. A page enters the frontier once, under its `dedupeKey`\n * (so `/a` and `/a/` are one page), keeping the spelling that arrived first.\n * Pages run one at a time so a site sees one request at a time.\n *\n * A page that redirects in the browser is not a page the run checks. Its\n * destination joins the frontier in its place, under the same rules.\n */\nimport type { AnalyzeOptions, PageAnalyzer } from \"./analyzer.js\";\nimport { A11yError, type PageResult, type ProgressListener, type Redirect } from \"../types.js\";\nimport type { ExcludeFilter, ExcludeGlob } from \"./exclude.js\";\nimport { dedupeKey, isHttpUrl, isPageLink, normalizeUrl, sameHost } from \"./url.js\";\n\nexport interface CrawlOptions {\n /** Normalized http(s) seeds; each seed's host is in scope. */\n seeds: string[];\n /** `false` = check exactly `seeds`. */\n crawl: boolean;\n /** Hard cap on pages analyzed. Absent means no cap: the whole frontier is analyzed. */\n maxPages?: number;\n /** Extra URLs to enqueue right after the seeds (from the sitemap). */\n extra: string[];\n /**\n * Keeps matching URLs out of the frontier, beside the same-host and\n * asset-extension checks. Absent means nothing is excluded.\n */\n exclude?: ExcludeFilter;\n analyze: AnalyzeOptions;\n /** Told about each step as it happens. Absent means silent. */\n onProgress?: ProgressListener;\n}\n\nexport interface CrawlOutcome {\n /** In visit order. `source` is \"seed\", \"sitemap\" (came from `extra`) or \"link\". */\n pages: Omit<PageResult, \"score\">[];\n /** Distinct pages (by `dedupeKey`) that entered the frontier. */\n discovered: number;\n /** Left in the frontier when `maxPages` stopped the run; `0` without a cap. */\n skipped: number;\n /**\n * Dequeued and dropped unloaded, because the browser had already landed on\n * that page under another spelling.\n * `checked + skipped + duplicates + redirects.length` is `discovered`.\n */\n duplicates: number;\n /** Pages that redirected in the browser, in visit order. Never in `pages`. */\n redirects: Redirect[];\n /**\n * Distinct URLs (by `dedupeKey`) an `exclude` pattern kept out. Never part\n * of `discovered`: an excluded URL is dropped where an off-host URL and a\n * `.png` link are, before the frontier.\n */\n excluded: number;\n}\n\ntype Source = PageResult[\"source\"];\n\n/** What `enqueue` did with a URL, and the pattern when one excluded it. */\ntype Enqueued =\n | { as: \"queued\" | \"seen\" | \"invalid\" | \"asset\" | \"off-host\" }\n | { as: \"excluded\"; pattern: ExcludeGlob };\n\ninterface Candidate {\n url: string;\n key: string;\n source: Source;\n}\n\n/**\n * BFS over a FIFO frontier: seeds, then `extra`, then links in the order each\n * page listed them. Every candidate goes through `normalizeUrl`, and is\n * enqueued once per `dedupeKey` (so a trailing slash does not make a second\n * page), only when `isPageLink` and `sameHost` with **any** seed. The first\n * spelling seen is the one fetched and reported. Pages run sequentially.\n * - A seed that fails to analyze rethrows (nothing was checked: exit 2).\n * - Any other page's failure is recorded as `error` and the crawl continues.\n * - A page's `finalUrl` (where the browser landed) counts as visited, so a\n * queued spelling of it is dropped at dequeue time (`duplicates`), and a\n * link to it seen afterwards is never queued.\n * - With `maxPages` set, stops when `pages.length === maxPages`; `skipped` =\n * frontier left behind. Without it, runs the frontier dry and `skipped` is 0.\n * - With `crawl: false`, `extra` is ignored and no links are followed.\n * - With `exclude` set, a URL whose path a pattern matches is never enqueued,\n * never fetched and never counted in `discovered`; `excluded` counts those,\n * once per key. `onProgress` hears one `excluded` event before `browser`\n * when the count is not zero.\n * - A page that redirects in the browser is recorded in `redirects`, not in\n * `pages`, and does not count toward `maxPages`. Its destination is\n * enqueued with the page's own `source`, under `crawl: false` too, since it\n * is the same page under a new address. A seed whose destination is not\n * http(s), is on another host, or is excluded, rethrows: otherwise nothing\n * would be checked.\n * - `onProgress` hears `browser` once before the first analyze (that is where\n * the lazy launch happens), `page` before each analyze, `checked` (or\n * `redirected`) after each, and `done` at the end. A failing seed rethrows\n * before `checked`.\n */\nexport async function crawl(opts: CrawlOptions, analyzer: PageAnalyzer): Promise<CrawlOutcome> {\n const frontier: Candidate[] = [];\n /** Keys that entered the frontier, or that the browser landed on. */\n const seen = new Set<string>();\n /** Keys analyzed, or that the browser landed on. */\n const visited = new Set<string>();\n /** Keys an `exclude` pattern kept out, so a page linked thirty times counts once. */\n const excluded = new Set<string>();\n const progress = opts.onProgress ?? (() => undefined);\n\n const enqueue = (raw: string, source: Source): Enqueued => {\n let url: string;\n let key: string;\n try {\n url = normalizeUrl(raw);\n key = dedupeKey(url);\n } catch {\n return { as: \"invalid\" };\n }\n // A seed is what the user asked for, so it is never filtered as an asset;\n // it still has to be on its own host, which it is by definition.\n if (source !== \"seed\" && !isPageLink(url)) return { as: \"asset\" };\n if (!opts.seeds.some((seed) => sameHost(seed, url))) return { as: \"off-host\" };\n // After the scope checks, so an off-host or asset URL is not also counted\n // as excluded; the two filters answer different questions and a URL that\n // was never in scope was not kept out by a pattern.\n const pattern = opts.exclude?.match(url) ?? null;\n if (pattern !== null) {\n excluded.add(key);\n return { as: \"excluded\", pattern };\n }\n if (seen.has(key)) return { as: \"seen\" };\n seen.add(key);\n frontier.push({ url, key, source });\n return { as: \"queued\" };\n };\n\n /** Where the browser landed is a page the run has now checked, whatever it was asked for. */\n const landed = (finalUrl: string | undefined): void => {\n if (finalUrl === undefined) return;\n try {\n const key = dedupeKey(finalUrl);\n seen.add(key);\n visited.add(key);\n } catch {\n // Not a URL the crawl could ever queue, so nothing to mark.\n }\n };\n\n for (const seed of opts.seeds) enqueue(seed, \"seed\");\n if (opts.crawl) for (const url of opts.extra) enqueue(url, \"sitemap\");\n // Discovery has settled as far as it can before a page is fetched, and this\n // is where a pattern that matched far more than intended is worth seeing:\n // the browser has not launched yet, so the run is still cheap to stop.\n if (excluded.size > 0) {\n progress({ kind: \"excluded\", urls: excluded.size, patterns: opts.exclude?.patterns.length ?? 0 });\n }\n\n const pages: CrawlOutcome[\"pages\"] = [];\n const redirects: Redirect[] = [];\n let duplicates = 0;\n const capped = (): boolean => opts.maxPages !== undefined && pages.length >= opts.maxPages;\n for (let next = 0; next < frontier.length && !capped(); next++) {\n const candidate = frontier[next];\n if (candidate === undefined) break;\n const { url, key, source } = candidate;\n if (visited.has(key)) {\n duplicates += 1;\n continue;\n }\n visited.add(key);\n const index = pages.length + 1;\n // Not `index === 1`: a redirect pushes no page, so the next one reuses that index.\n if (pages.length + redirects.length === 0) progress({ kind: \"browser\" });\n progress({ kind: \"page\", index, queued: frontier.length, url });\n try {\n const analyzed = await analyzer.analyze(url, opts.analyze);\n if (\"redirect\" in analyzed) {\n const to = normalized(analyzed.redirect);\n // Recorded and narrated before the seed checks below on purpose: the\n // `↪` line then precedes the fatal message that explains it, and a\n // throw discards `redirects` anyway.\n redirects.push({ url, to, source });\n progress({ kind: \"redirected\", index, url, to });\n const outcome = enqueue(to, source);\n if (source === \"seed\") {\n if (!isHttpUrl(to)) {\n throw new A11yError(`${url} redirects to ${to}, which is not an http(s) URL.`);\n }\n if (outcome.as === \"off-host\") {\n throw new A11yError(`${url} redirects to ${to}, which is on another host. Check ${to} instead.`);\n }\n if (outcome.as === \"excluded\") {\n throw new A11yError(`${outcome.pattern.source} excludes ${to}, where the seed ${url} redirects.`);\n }\n }\n continue;\n }\n pages.push({ ...analyzed.result, url, source });\n landed(analyzed.finalUrl);\n if (opts.crawl) for (const link of analyzed.links) enqueue(link, \"link\");\n progress({ kind: \"checked\", index, url, violations: analyzed.result.violations.length });\n } catch (err) {\n if (source === \"seed\") throw err;\n const error = err instanceof Error ? err.message : String(err);\n pages.push({ url, source, violations: [], passes: 0, incomplete: 0, error });\n progress({ kind: \"checked\", index, url, violations: 0, error });\n }\n }\n\n const skipped = frontier.length - pages.length - duplicates - redirects.length;\n progress({ kind: \"done\", checked: pages.length, skipped });\n return {\n pages,\n discovered: frontier.length,\n skipped,\n duplicates,\n redirects,\n excluded: excluded.size,\n };\n}\n\n/** `normalizeUrl`, or the string as it came when it is not a URL. */\nfunction normalized(url: string): string {\n try {\n return normalizeUrl(url);\n } catch {\n return url;\n }\n}\n","/**\n * Keeping part of a site out of the crawl (proposal 0059).\n *\n * A pattern is matched against the URL's **path** alone, never the scheme,\n * host, port, query or fragment. The host is exactly the part that changes\n * between a local preview and production, so one pattern has to survive the\n * move: `/proposals/**` reads the same against `http://127.0.0.1:4321/` and\n * against `https://example.com/`.\n *\n * A trailing slash is not part of the comparison, because a crawl produces\n * both spellings — a sitemap usually lists `/proposals/`, a bare link usually\n * points at `/proposals`. Stripping it means a pattern cannot catch one and\n * silently miss the other. Stripping it is also what makes `/proposals/**`\n * cover the section index as well as the pages under it, since picomatch's\n * `**` already matches zero segments.\n *\n * Matching itself is the family's file-glob matcher, so an exclusion and a\n * collection's `paths:` read a `*`, a `**` and a dot segment the same way. A\n * URL path never carries a raw backslash — the WHATWG parser rewrites one and\n * percent-encodes the rest — so that matcher's separator normalization cannot\n * change what a pattern here means.\n */\nimport { matchesFileGlob } from \"../../shared/globs.js\";\n\n/**\n * One pattern, and the name a message gives it.\n *\n * A pattern reaches a run from one of two places, and an error about it has to\n * say which. `--exclude \"/proposals/**\"` for a typed flag, and the config\n * file's own shape for a key, so that a run whose patterns came from\n * `a11y.exclude:` never names a flag the user did not type.\n */\nexport interface ExcludeGlob {\n glob: string;\n /** How a message names this pattern: a flag, or a file and a key. */\n source: string;\n}\n\nexport interface ExcludeFilter {\n /** The patterns, in the order they were given. */\n readonly patterns: readonly ExcludeGlob[];\n /** The first pattern that keeps `url` out of the crawl, or `null`. */\n match(url: string): ExcludeGlob | null;\n /** Whether any pattern keeps `url` out of the crawl. */\n matches(url: string): boolean;\n}\n\n/**\n * The tail every \"that is not a path glob\" message ends with, so the flag and\n * the config key say the same thing about the same mistake.\n */\nexport const MUST_START_WITH_SLASH = 'must start with \"/\": it matches a URL path.';\n\n/**\n * Can this pattern ever match a path? A path always starts with `/`, so a\n * pattern that does not is a silent near-miss rather than a filter, and both\n * the flag and the config key refuse it.\n */\nexport function isUrlPathGlob(pattern: string): boolean {\n return pattern.startsWith(\"/\");\n}\n\n/**\n * The path a pattern is matched against: the URL's `pathname` with one\n * trailing `/` dropped, unless the path is exactly `/`. `null` for a string\n * that is not a URL, which the crawl has already dropped for other reasons.\n */\nexport function excludePath(url: string): string | null {\n let parsed: URL;\n try {\n parsed = new URL(url);\n } catch {\n return null;\n }\n const path = parsed.pathname;\n return path.length > 1 && path.endsWith(\"/\") ? path.slice(0, -1) : path;\n}\n\n/**\n * A filter over `patterns`, in order. An empty list excludes nothing, which is\n * the default and the shape a run with neither the flag nor the config key\n * has. Patterns are taken as given: one value is one pattern, and a comma\n * inside it is a literal comma, per 0034's one-separator rule.\n */\nexport function createExcludeFilter(patterns: readonly ExcludeGlob[]): ExcludeFilter {\n const list = [...patterns];\n const match = (url: string): ExcludeGlob | null => {\n if (list.length === 0) return null;\n const path = excludePath(url);\n if (path === null) return null;\n return list.find((pattern) => matchesFileGlob(path, pattern.glob)) ?? null;\n };\n return {\n patterns: list,\n match,\n matches: (url) => match(url) !== null,\n };\n}\n","/**\n * Where a check starts from.\n *\n * A collection may declare `url:`, the site root its documents are published\n * at (proposal 0041, rule 12), which makes \"check the guides\" something a\n * person can mean. Four sources can therefore name a seed, and this module is\n * the one place that decides between them: first non-empty wins, in the order\n * positional URLs, the collections named by `--collection`, `a11y.urls`, then\n * every declared collection that has a `url`.\n *\n * `a11y.urls` keeps its place ahead of the collections because a site has\n * entry points no documentation collection covers, and because nothing that\n * ships today should have to move.\n *\n * It is separate from the CLI, and pure, because the interesting part is the\n * order and the three refusals, and neither is worth a spawned bin with a\n * browser behind it to test.\n */\nimport { selectCollections, type CollectionConfig } from \"../../shared/collections.js\";\nimport { A11yError } from \"../types.js\";\n\n/**\n * Nothing to check. Also thrown by `runCheck` for a programmatic caller that\n * resolved its own seeds, which is why the text lives here and not there.\n */\nexport const NO_SEEDS_MESSAGE =\n \"No URLs to check. Pass one or more, set url: on a collection, or set a11y.urls in manni.config.yaml.\";\n\n/** The family file's name, for a message about a config that was never found. */\nconst CONFIG_NAME = \"manni.config.yaml\";\n\nexport interface SeedSources {\n /** Positional `[urls...]`, as typed. Validated and normalized by `runCheck`. */\n urls: readonly string[];\n /** `--collection` names, one per occurrence. Empty means none were named. */\n collections: readonly string[];\n /** `a11y.urls`, when the key is set. An empty list counts as unset. */\n configUrls?: readonly string[];\n /** Every collection the family file declares, in declaration order. */\n declared: readonly CollectionConfig[];\n /**\n * The config file as the user would name it, for the unknown-name message.\n * `null` or absent (no file found) names the canonical family file, since\n * that is where the missing `collections:` would go.\n */\n source?: string | null;\n}\n\n/**\n * The seeds a run checks, or an `A11yError` explaining why there are none.\n *\n * 1. `urls` when non-empty.\n * 2. The `url` of each collection named by `collections`, in **declaration**\n * order, repeats and shared urls collapsed. A named collection with no\n * `url` is an error, and so is a name that is not declared.\n * 3. `configUrls` when non-empty, exactly as configured.\n * 4. The `url` of every declared collection that has one, in declaration\n * order, shared urls collapsed. One without a `url` contributes nothing.\n *\n * Naming a url-less collection fails where leaving it out of the default set\n * does not: `--collection blog` asked for something specific and has to be\n * told it cannot be done, while a bare `manni a11y check` gets whatever is\n * publishable.\n */\nexport function resolveSeeds(sources: SeedSources): string[] {\n const { urls, collections: names, declared } = sources;\n\n if (names.length > 0) {\n // The shape of the invocation, before anything about the config: a run\n // that named both a collection and a URL has no reading to pick between.\n if (urls.length > 0) {\n throw new A11yError(\n \"--collection selects a configured collection; it cannot be combined with URLs.\",\n );\n }\n // No config at all — nothing was found, or `--no-config` refused it. The\n // flag selects from a config file, so say that rather than reporting the\n // name as unknown: \"Configured: (none).\" blames the name for the absence\n // of the file. `manni meta` refuses the same combination with the same\n // sentence, which is the parity CLAUDE.md asks for on a shared flag. A\n // real config always carries a source, so this cannot mistake a\n // programmatic caller that passed collections without one.\n if (sources.source == null && declared.length === 0) {\n throw new A11yError(\"--collection needs a config file to select from.\");\n }\n const selected = selectCollections(\n declared,\n names,\n sources.source ?? CONFIG_NAME,\n (message) => new A11yError(message),\n );\n const seeds: string[] = [];\n for (const collection of selected) {\n if (collection.url === undefined) {\n throw new A11yError(`collection \"${collection.name}\" has no url: to check.`);\n }\n seeds.push(collection.url);\n }\n return unique(seeds);\n }\n\n if (urls.length > 0) return [...urls];\n\n const configUrls = sources.configUrls ?? [];\n if (configUrls.length > 0) return [...configUrls];\n\n const published = unique(\n declared.flatMap((collection) => (collection.url === undefined ? [] : [collection.url])),\n );\n if (published.length > 0) return published;\n\n throw new A11yError(NO_SEEDS_MESSAGE);\n}\n\nfunction unique(values: readonly string[]): string[] {\n return [...new Set(values)];\n}\n","/**\n * Sitemap discovery: the page list a site publishes for itself.\n *\n * A sitemap reaches pages no link points at, so the crawl reads it first and\n * follows links second. Nothing here is allowed to fail the run: a site with\n * no sitemap, a broken one, or one behind a firewall is a site to crawl by\n * links alone, and the outcome says so with `source: null`.\n */\nimport { DOMParser } from \"@xmldom/xmldom\";\nimport { isHttpUrl, isPageLink, normalizeUrl, sameHost } from \"./url.js\";\n\n/** `fetch` narrowed to what this module needs, so tests inject a fake. */\nexport type Fetcher = (\n url: string,\n) => Promise<{ ok: boolean; status: number; text(): Promise<string> }>;\n\nexport interface SitemapDiscovery {\n /** The sitemap (or sitemap index) URL that was read, `null` when none was usable. */\n source: string | null;\n /** Same-host page URLs from every `<loc>`, normalized and deduped, in document order. */\n urls: string[];\n}\n\nexport interface ParsedSitemap {\n kind: \"index\" | \"urlset\";\n locs: string[];\n}\n\n/** How many levels of `<sitemapindex>` nesting are followed below the first. */\nconst MAX_INDEX_DEPTH = 3;\n/** How many child sitemaps one discovery reads, across every index it meets. */\nconst MAX_CHILD_SITEMAPS = 50;\n/** A robots.txt or sitemap that has not answered in this long is \"no sitemap\". */\nconst FETCH_TIMEOUT_MS = 10_000;\n\nconst defaultFetcher: Fetcher = (url) =>\n fetch(url, { signal: AbortSignal.timeout(FETCH_TIMEOUT_MS) });\n\n/**\n * The file names tried in each directory of the seed's path, in this order.\n * `sitemap.xml` is the convention; `sitemap-index.xml` is what Astro (and so\n * Starlight) emits; `sitemap_index.xml` is Yoast's and Hugo's spelling.\n */\nconst WELL_KNOWN_SITEMAP_FILES = [\"sitemap.xml\", \"sitemap-index.xml\", \"sitemap_index.xml\"];\n\n/**\n * Candidates, in order:\n * 1. GET `<origin>/robots.txt`; every `Sitemap:` line (case-insensitive key,\n * absolute URL) is a candidate, in order.\n * 2. Then, for each directory of the seed's path from the seed's own\n * directory up to `/`, nearest first (`https://h/manni/meta/fix/` walks\n * `/manni/meta/fix/`, `/manni/meta/`, `/manni/`, `/`; a seed that names a\n * file, `https://h/manni/page.html`, starts at `/manni/`), the files\n * `sitemap.xml`, `sitemap-index.xml`, `sitemap_index.xml`, in that order\n * within each directory. A project site under a path prefix (GitHub Pages)\n * cannot write to the origin's `/robots.txt` or `/sitemap.xml`, which is\n * why the walk starts at the seed and not at the root.\n * Candidates are deduped, keeping the first position of each.\n *\n * Then parse the first candidate that returns 2xx with `@xmldom/xmldom`\n * (`DOMParser`, errors swallowed); a 2xx body that is not a sitemap is skipped\n * and the next candidate tried. A `<sitemapindex>` recurses into each child\n * `<sitemap><loc>` (depth ≤ 3, ≤ 50 child sitemaps). A `<urlset>` yields its\n * `<url><loc>` values. Keep only `sameHost(seed, loc) && isPageLink(loc)`.\n * `source` is the candidate that was actually used.\n *\n * A network error, non-2xx, or unparseable body means \"no sitemap here\" —\n * never an error, and never a page failure. `.xml.gz` bodies are not\n * decompressed (deferred).\n */\nexport async function discoverSitemap(\n seed: string,\n fetcher: Fetcher = defaultFetcher,\n): Promise<SitemapDiscovery> {\n const origin = new URL(seed).origin;\n const candidates = await robotsSitemaps(`${origin}/robots.txt`, fetcher);\n for (const candidate of wellKnownCandidates(seed)) {\n if (!candidates.includes(candidate)) candidates.push(candidate);\n }\n\n for (const candidate of candidates) {\n const parsed = await fetchSitemap(candidate, fetcher);\n if (parsed === null) continue;\n const walk: Walk = { fetcher, seen: new Set([candidate]), childBudget: MAX_CHILD_SITEMAPS };\n const locs = await expand(parsed, 0, walk);\n return { source: candidate, urls: pageUrls(seed, locs) };\n }\n return { source: null, urls: [] };\n}\n\n/** Pure parser, exported for tests: returns `{ kind: \"index\" | \"urlset\", locs: string[] }` or `null`. */\nexport function parseSitemapXml(text: string): ParsedSitemap | null {\n if (text.trim() === \"\") return null;\n let root: XmlNode | null;\n try {\n // Every parse problem is routed to `onError` and ignored; what matters is\n // whether a sitemap root came out the other side.\n const doc = new DOMParser({ onError: () => undefined }).parseFromString(text, \"text/xml\");\n root = doc.documentElement;\n } catch {\n return null;\n }\n if (root === null) return null;\n const kind = root.localName;\n if (kind !== \"sitemapindex\" && kind !== \"urlset\") return null;\n const entry = kind === \"sitemapindex\" ? \"sitemap\" : \"url\";\n const locs: string[] = [];\n for (const child of childElements(root, entry)) {\n for (const loc of childElements(child, \"loc\")) {\n const value = (loc.textContent ?? \"\").trim();\n if (value !== \"\") locs.push(value);\n }\n }\n return { kind: kind === \"sitemapindex\" ? \"index\" : \"urlset\", locs };\n}\n\ntype XmlDocument = ReturnType<DOMParser[\"parseFromString\"]>;\n/**\n * xmldom's `Node`, reached through the parser's own types rather than an\n * import so the alias tracks whatever the installed version declares. It is\n * enough here: `localName`, `textContent` and the sibling walk are all on\n * `Node`, and `documentElement` narrows to it.\n */\ntype XmlNode = NonNullable<XmlDocument[\"firstChild\"]>;\n\n/** Element children of `node` whose local name is `name`, in document order. */\nfunction childElements(node: XmlNode, name: string): XmlNode[] {\n const out: XmlNode[] = [];\n for (let n = node.firstChild; n !== null; n = n.nextSibling) {\n if (n.nodeType === 1 && n.localName === name) out.push(n);\n }\n return out;\n}\n\ninterface Walk {\n fetcher: Fetcher;\n /** Sitemap URLs already read, so an index that lists itself terminates. */\n seen: Set<string>;\n /** Child sitemaps still allowed; shared across the whole recursion. */\n childBudget: number;\n}\n\nasync function expand(parsed: ParsedSitemap, depth: number, walk: Walk): Promise<string[]> {\n if (parsed.kind === \"urlset\") return parsed.locs;\n if (depth >= MAX_INDEX_DEPTH) return [];\n const out: string[] = [];\n for (const child of parsed.locs) {\n if (walk.childBudget <= 0) break;\n if (!isHttpUrl(child) || walk.seen.has(child)) continue;\n walk.seen.add(child);\n walk.childBudget -= 1;\n const nested = await fetchSitemap(child, walk.fetcher);\n if (nested === null) continue;\n out.push(...(await expand(nested, depth + 1, walk)));\n }\n return out;\n}\n\n/**\n * The well-known sitemap file names in every directory of the seed's path,\n * nearest directory first, root last. Query and fragment are dropped; the\n * directory of `/manni/page.html` is `/manni/`, of `/manni/` is itself.\n */\nfunction wellKnownCandidates(seed: string): string[] {\n const url = new URL(seed);\n const directories = ancestorDirectories(url.pathname);\n return directories.flatMap((dir) =>\n WELL_KNOWN_SITEMAP_FILES.map((file) => `${url.origin}${dir}${file}`),\n );\n}\n\n/**\n * `/manni/meta/fix/` → `[\"/manni/meta/fix/\", \"/manni/meta/\", \"/manni/\", \"/\"]`;\n * `/manni/page.html` → `[\"/manni/\", \"/\"]`; `/` → `[\"/\"]`.\n */\nfunction ancestorDirectories(pathname: string): string[] {\n let dir = pathname.slice(0, pathname.lastIndexOf(\"/\") + 1);\n const out: string[] = [];\n for (;;) {\n out.push(dir);\n if (dir === \"/\") return out;\n // Drop the trailing slash, then everything after the previous one.\n const parent = dir.slice(0, dir.lastIndexOf(\"/\", dir.length - 2) + 1);\n dir = parent === \"\" ? \"/\" : parent;\n }\n}\n\n/** The `Sitemap:` candidates from a robots.txt, or none when it is missing. */\nasync function robotsSitemaps(url: string, fetcher: Fetcher): Promise<string[]> {\n const text = await fetchText(url, fetcher);\n if (text === null) return [];\n const out: string[] = [];\n for (const line of text.split(/\\r?\\n/)) {\n const match = /^\\s*sitemap\\s*:\\s*(\\S+)/i.exec(line);\n const candidate = match?.[1];\n if (candidate !== undefined && isHttpUrl(candidate) && !out.includes(candidate)) {\n out.push(candidate);\n }\n }\n return out;\n}\n\nasync function fetchSitemap(url: string, fetcher: Fetcher): Promise<ParsedSitemap | null> {\n const text = await fetchText(url, fetcher);\n return text === null ? null : parseSitemapXml(text);\n}\n\n/** The body of a 2xx response, or `null` for anything else, thrown included. */\nasync function fetchText(url: string, fetcher: Fetcher): Promise<string | null> {\n try {\n const response = await fetcher(url);\n if (!response.ok) return null;\n return await response.text();\n } catch {\n return null;\n }\n}\n\n/** Filter, normalize and dedupe the `<loc>` values into crawlable page URLs. */\nfunction pageUrls(seed: string, locs: string[]): string[] {\n const out: string[] = [];\n const seen = new Set<string>();\n for (const loc of locs) {\n if (!isHttpUrl(loc) || !sameHost(seed, loc) || !isPageLink(loc)) continue;\n const url = normalizeUrl(loc);\n if (seen.has(url)) continue;\n seen.add(url);\n out.push(url);\n }\n return out;\n}\n","/**\n * `manni a11y check`, the command core.\n *\n * Validates the seeds, finds the sitemap, runs the crawl, drops the findings\n * below the severity floor, scores each page and totals the summary. No CLI\n * and no IO of its own beyond the injected analyzer and fetcher, so it can be\n * tested end to end with neither a browser nor a network.\n */\nimport type { PageAnalyzer } from \"../core/analyzer.js\";\nimport { crawl, type CrawlOutcome } from \"../core/crawl.js\";\nimport { createExcludeFilter, type ExcludeGlob } from \"../core/exclude.js\";\nimport { NO_SEEDS_MESSAGE } from \"../core/seeds.js\";\nimport { discoverSitemap, type Fetcher, type SitemapDiscovery } from \"../core/sitemap.js\";\nimport { isHttpUrl, normalizeUrl } from \"../core/url.js\";\nimport {\n A11yError,\n meetsSeverity,\n type CheckRun,\n type CheckSummary,\n type Severity,\n type PageResult,\n type ProgressListener,\n} from \"../types.js\";\n\nexport interface CheckOptions {\n /** Seeds as typed (validated and normalized here). */\n urls: string[];\n /** Follow the sitemap and same-host links. Default `true`. */\n crawl: boolean;\n /** Stop after this many pages. Absent means no cap: every discovered page is checked. */\n maxPages?: number;\n /** axe tags to restrict to; empty is axe's default rule set. Default `[]`. */\n tags: string[];\n /** Minimum family severity reported and counted. Default `\"notice\"`, everything. */\n severity: Severity;\n /** Per-page navigation timeout in ms. Default `30000`. */\n timeout: number;\n /**\n * Globs matched against a URL's path; a match keeps the page out of the\n * crawl. Default `[]`, which excludes nothing. A pattern that excludes a\n * seed is an error, since the seed and the pattern are both the caller's\n * statement and a contradiction is not this command's to resolve. Each\n * pattern carries the name the refusal gives it, so the message points at\n * the flag or the config key the pattern actually came from.\n */\n exclude: ExcludeGlob[];\n}\n\nexport interface CheckDeps {\n analyzer: PageAnalyzer;\n /** Defaults to global `fetch`. */\n fetcher?: Fetcher;\n /**\n * Told about each step as it happens: `sitemap` once discovery is done\n * (only when crawling), then everything the crawl reports. Absent means\n * silent.\n */\n onProgress?: ProgressListener;\n}\n\n/**\n * `maxPages` is deliberately absent: the default is no cap. A capped crawl\n * reports a partial site as checked, so the cap is opt-in, through\n * `--max-pages` or the config key.\n */\nexport const CHECK_DEFAULTS: Readonly<Omit<CheckOptions, \"urls\">> = Object.freeze({\n crawl: true,\n tags: [],\n severity: \"notice\",\n timeout: 30000,\n exclude: [],\n});\n\n/**\n * 1. `urls.length === 0` → A11yError(NO_SEEDS_MESSAGE). The CLI resolves its\n * seeds with `resolveSeeds` and never arrives here empty; a programmatic\n * caller that passed none hears the same thing.\n * 2. Any non-http(s) url → A11yError(`Not an http(s) URL: \"<url>\".`)\n * 3. Any seed an `exclude` pattern matches → A11yError naming **every** such\n * seed, one per line, each under the pattern's own `source`. A user who\n * typed two wrong patterns should not need one run per fix, and nothing is\n * checked either way.\n * 4. When `crawl`: `discoverSitemap(firstSeed)` (one sitemap per run, the first seed's origin).\n * 5. `crawl(...)`, then per page: drop violations below `severity`, compute `score`.\n * 6. Build `CheckSummary`. Always awaits `analyzer.close()` in `finally`.\n */\nexport async function runCheck(opts: CheckOptions, deps: CheckDeps): Promise<CheckRun> {\n const { analyzer } = deps;\n try {\n if (opts.urls.length === 0) {\n throw new A11yError(NO_SEEDS_MESSAGE);\n }\n for (const url of opts.urls) {\n if (!isHttpUrl(url)) throw new A11yError(`Not an http(s) URL: \"${url}\".`);\n }\n const seeds = opts.urls.map(normalizeUrl);\n\n const exclude = createExcludeFilter(opts.exclude);\n const contradictions = seeds\n .map((seed) => {\n const pattern = exclude.match(seed);\n return pattern === null ? null : `${pattern.source} excludes the seed ${seed}.`;\n })\n .filter((line): line is string => line !== null);\n if (contradictions.length > 0) throw new A11yError(contradictions.join(\"\\n\"));\n\n let sitemap: SitemapDiscovery = { source: null, urls: [] };\n const first = seeds[0];\n if (opts.crawl && first !== undefined) {\n sitemap = await discoverSitemap(first, deps.fetcher);\n deps.onProgress?.({ kind: \"sitemap\", source: sitemap.source, urls: sitemap.urls.length });\n }\n\n const outcome = await crawl(\n {\n seeds,\n crawl: opts.crawl,\n maxPages: opts.maxPages,\n extra: sitemap.urls,\n exclude,\n analyze: { tags: opts.tags, timeout: opts.timeout },\n onProgress: deps.onProgress,\n },\n analyzer,\n );\n\n const results = outcome.pages.map((page) => finishPage(page, opts.severity));\n return {\n results,\n redirects: outcome.redirects,\n summary: summarize(results, outcome, sitemap, opts.crawl),\n };\n } finally {\n await analyzer.close();\n }\n}\n\n/** Apply the severity floor, then score what is left. */\nfunction finishPage(page: Omit<PageResult, \"score\">, floor: Severity): PageResult {\n if (page.error !== undefined) return { ...page, violations: [], score: null };\n const violations = page.violations.filter((v) => meetsSeverity(v.severity, floor));\n const applicable = page.passes + violations.length;\n const score = applicable === 0 ? null : Math.round((100 * page.passes) / applicable);\n return { ...page, violations, score };\n}\n\n/**\n * Does this page fail the run?\n *\n * The level is not read here, and that is the decision rather than an\n * oversight. `--severity` is the floor, and the floor is the gate: anything\n * `finishPage` kept fails the page, whatever its level. `manni meta validate`\n * and `manni cite check` fail on error-severity findings alone, because a\n * user decides there what becomes an error, through the schema or through\n * `cite.severity.<rule>`. axe assigns a11y's severities and nothing in the\n * config moves one, so the floor is the only lever this domain's shape\n * allows. Proposal 0064 records why, and supersedes the one paragraph of\n * 0035 that described the two as separable.\n */\nfunction fails(page: PageResult): boolean {\n return page.error !== undefined || page.violations.length > 0;\n}\n\nfunction summarize(\n results: PageResult[],\n { discovered, skipped, duplicates, redirects, excluded }: CrawlOutcome,\n sitemap: SitemapDiscovery,\n crawl: boolean,\n): CheckSummary {\n // Spelled out so the compiler, not a test, says when the family scale moves.\n const bySeverity: Record<Severity, number> = { notice: 0, warning: 0, error: 0 };\n let failed = 0;\n let violations = 0;\n for (const page of results) {\n if (fails(page)) failed += 1;\n for (const violation of page.violations) {\n violations += 1;\n bySeverity[violation.severity] += 1;\n }\n }\n return {\n discovered,\n checked: results.length,\n skipped,\n duplicates,\n redirects: redirects.length,\n excluded,\n failed,\n violations,\n bySeverity,\n sitemap: sitemap.source,\n // The count the progress line already reported as `(N pages)`, so the\n // report cannot disagree with the narration that preceded it.\n sitemapPages: sitemap.urls.length,\n crawl,\n };\n}\n","/**\n * The browser seam.\n *\n * Everything that needs a real page — navigation, the live DOM's links, axe\n * itself — sits behind `PageAnalyzer`, so the crawl and the check core can be\n * exercised with a canned analyzer and no browser. The Playwright-backed\n * implementation lives here too, behind the same interface.\n */\nimport { AxeBuilder } from \"@axe-core/playwright\";\nimport {\n chromium,\n type Browser,\n type BrowserContext,\n type Page,\n type Request,\n type Response,\n} from \"playwright-core\";\nimport {\n A11yError,\n isAxeImpact,\n type AxeImpact,\n type PageResult,\n type Severity,\n type Violation,\n type ViolationNode,\n} from \"../types.js\";\nimport { dedupeKey } from \"./url.js\";\n\nexport interface AnalyzeOptions {\n /** axe tags to restrict to; empty = axe defaults. */\n tags: string[];\n /** Navigation timeout in ms. */\n timeout: number;\n}\n\nexport interface AnalyzedPage {\n /** Raw result: every violation regardless of severity; `source` and `score` are filled in by `runCheck`. */\n result: Omit<PageResult, \"source\" | \"score\">;\n /** Absolute `href` of every `a[href]` in the live DOM after load, unfiltered. */\n links: string[];\n /**\n * The browser's URL once navigation and any redirects settled. The crawl\n * marks it visited so a later queued spelling of the same page is not\n * loaded again. Absent when the analyzer does not know it.\n */\n finalUrl?: string;\n}\n\n/**\n * A page that sent the browser elsewhere once it had loaded: a meta refresh\n * to another page, or a navigation while links or axe were being read. It was\n * not analyzed. Tell it from `AnalyzedPage` with `\"redirect\" in x`.\n */\nexport interface RedirectedPage {\n /** The absolute URL the page redirects to. */\n redirect: string;\n}\n\nexport interface PageAnalyzer {\n /**\n * Load `url` and run axe, or report where the page redirects in the\n * browser. Rejects with `A11yError` on navigation failure or timeout\n * (message names the URL and the underlying reason); the caller decides\n * whether that is fatal (seed) or a per-page `error` (crawled page).\n */\n analyze(url: string, opts: AnalyzeOptions): Promise<AnalyzedPage | RedirectedPage>;\n /** Close the browser. Safe to call when nothing was launched, and twice. */\n close(): Promise<void>;\n}\n\nexport type BrowserChannel = \"chrome\" | \"msedge\" | \"chromium\";\n\n/** The message when nothing launches; the same words the CLI's ladder promises. */\nexport const NO_BROWSER_MESSAGE =\n \"No browser found. Install one with `npx playwright install chromium`, or install Google Chrome or Microsoft Edge.\";\n\n/** The launch order: what the machine already has first, Playwright's own download last. */\nconst CHANNELS: readonly BrowserChannel[] = [\"chrome\", \"msedge\", \"chromium\"];\n\nfunction launch(channel: BrowserChannel): Promise<Browser> {\n return channel === \"chromium\"\n ? chromium.launch({ headless: true })\n : chromium.launch({ channel, headless: true });\n}\n\n/** The first channel that launches, still open, or `null` when none does. */\nasync function launchAny(): Promise<{ browser: Browser; channel: BrowserChannel } | null> {\n for (const channel of CHANNELS) {\n try {\n return { browser: await launch(channel), channel };\n } catch {\n // Not installed, or not launchable here. Try the next one.\n }\n }\n return null;\n}\n\n/**\n * Try, in order: `chromium.launch({ channel: \"chrome\", headless: true })`,\n * `{ channel: \"msedge\" }`, `chromium.launch()` (Playwright's own download).\n * Returns the first that launches, closed again, or `null`. Exported so the\n * integration suite can `describe.skipIf`.\n */\nexport async function findBrowser(): Promise<BrowserChannel | null> {\n const found = await launchAny();\n if (found === null) return null;\n await found.browser.close();\n return found.channel;\n}\n\n/** axe's result shapes, as `@axe-core/playwright` declares them; no direct axe-core import. */\ntype AxeResults = Awaited<ReturnType<AxeBuilder[\"analyze\"]>>;\ntype AxeResult = AxeResults[\"violations\"][number];\ntype AxeNode = AxeResult[\"nodes\"][number];\n\ninterface Session {\n browser: Browser;\n context: BrowserContext;\n}\n\n/**\n * Playwright-backed analyzer. Lazy: the browser launches on the first\n * `analyze`, and one context is reused for every URL. Each URL gets a page\n * of its own, so a navigation a page starts late (a script redirect after axe\n * returned, or a meta refresh reported without waiting for it) stays in that\n * page's tab instead of aborting the next load. A page is closed once the\n * next one exists, never before: Chrome can drop a context left with no page,\n * and `newPage` then fails with \"Failed to open a new tab\". The next load does\n * not wait for that close, which Chrome can lose.\n * - `page.goto(url, { waitUntil: \"load\", timeout })`; `finalUrl` is `page.url()` after it\n * - one in-page evaluation reads every `a[href]`'s absolute `href` and the\n * first meta refresh; a refresh to another page (by `dedupeKey`) is a\n * redirect, returned before axe runs\n * - a read or axe that rejects because the page navigated: wait up to\n * `timeout` for the URL to change and return the redirect, else rethrow\n * - `new AxeBuilder({ page })`, `.withTags(tags)` only when `tags.length > 0`, `.analyze()`\n * - map axe `Result` → `Violation` (`severity` from `severityOf(impact)`, `impact` kept as\n * axe's word with `null`/`undefined` → \"minor\"; node `target` joined with \" \";\n * `failureSummary ?? \"\"`), `passes.length`, `incomplete.length`\n * - launch failure on every channel → `A11yError(NO_BROWSER_MESSAGE)`\n */\nexport function createPlaywrightAnalyzer(): PageAnalyzer {\n let session: Promise<Session> | null = null;\n let current: Page | null = null;\n\n const open = (): Promise<Session> => {\n session ??= (async () => {\n const found = await launchAny();\n if (found === null) throw new A11yError(NO_BROWSER_MESSAGE);\n const context = await found.browser.newContext();\n return { browser: found.browser, context };\n })();\n return session;\n };\n\n return {\n async analyze(url, opts) {\n const { context } = await open();\n const page = await context.newPage();\n const previous = current;\n current = page;\n // Its outcome is settled, so its close is not this URL's to wait for,\n // nor is a failure to close it. Chrome answers a close that lands on\n // the tab's own commit (a late redirect) and then never closes the tab,\n // so an awaited close would wait for the browser to exit. That tab stays\n // open until the browser closes. Not reentrant: an overlapping call\n // would close a page still being read, so the caller (the crawl, one\n // page at a time) sequences its calls.\n void previous?.close().catch(() => undefined);\n // Every navigation the main frame starts, first hop only, so the one\n // that follows the load can be named even when it never commits (an\n // unresolvable host leaves the browser on its own error page).\n const navigations: Request[] = [];\n const onRequest = (request: Request): void => {\n if (\n request.isNavigationRequest() &&\n request.frame() === page.mainFrame() &&\n request.redirectedFrom() === null\n ) {\n navigations.push(request);\n }\n };\n page.on(\"request\", onRequest);\n try {\n return await analyzePage(page, url, opts, navigations);\n } finally {\n page.off(\"request\", onRequest);\n }\n },\n\n async close() {\n if (session === null) return;\n const pending = session;\n session = null;\n current = null;\n try {\n const { browser } = await pending;\n await browser.close();\n } catch {\n // The launch itself failed: there is nothing to close.\n }\n },\n };\n}\n\n/**\n * One `analyze`, on a page of its own. `navigations` is filled while it\n * runs: the first hop of every main-frame navigation, in order.\n */\nasync function analyzePage(\n page: Page,\n url: string,\n opts: AnalyzeOptions,\n navigations: readonly Request[],\n): Promise<AnalyzedPage | RedirectedPage> {\n let response: Response | null;\n try {\n response = await page.goto(url, { waitUntil: \"load\", timeout: opts.timeout });\n } catch (err) {\n throw new A11yError(`Could not load ${url}: ${reason(err)}`);\n }\n // Where the load settled, HTTP redirects included. The browser being\n // anywhere else later means the page navigated on its own.\n const loaded = response?.url() ?? page.url();\n\n /**\n * The first navigation the main frame started after the load's own, or\n * `undefined` when it started none. The load's own is found by walking its\n * HTTP redirect hops back to the first request. When `goto` gave no\n * response (a service worker answered it), the listener was attached just\n * before `goto`, so its navigation is the first one recorded.\n */\n const nextNavigation = (): Request | undefined => {\n let first = response?.request() ?? null;\n for (let from = first?.redirectedFrom() ?? null; from !== null; from = from.redirectedFrom()) {\n first = from;\n }\n // No response means a service worker answered `goto`: its navigation is [0].\n const own = first === null ? 0 : navigations.indexOf(first);\n return own === -1 ? undefined : navigations[own + 1];\n };\n\n /**\n * Where the page sent the browser. The navigation request is named even\n * when it never commits, since an unresolvable host leaves the frame on the\n * browser's own error page. Without one, the frame's URL is the answer:\n * every caller has already seen it move off `loaded`, and Playwright\n * reports the request before the URL changes, so this is a fallback only.\n */\n const destination = (): string => nextNavigation()?.url() ?? page.url();\n\n /**\n * After a read rejected: when the page started a navigation, wait for the\n * main frame to commit it and return the redirect. When it started none,\n * the error was not a navigation and stands at once, rather than after a\n * second wait of `timeout`.\n */\n const navigatedAway = async (): Promise<RedirectedPage | null> => {\n if (nextNavigation() === undefined && samePage(page.url(), loaded)) return null;\n try {\n await page.waitForURL((u) => !samePage(u.href, loaded), {\n waitUntil: \"commit\",\n timeout: opts.timeout,\n });\n return { redirect: destination() };\n } catch {\n return null;\n }\n };\n\n let read: InPage;\n try {\n read = await page.evaluate(readPage);\n } catch (err) {\n const moved = await navigatedAway();\n if (moved !== null) return moved;\n throw new A11yError(`Could not analyze ${url}: ${reason(err)}`);\n }\n const refresh = refreshTarget(read.refresh, page.url());\n if (refresh !== null) return { redirect: refresh };\n\n let builder = new AxeBuilder({ page });\n if (opts.tags.length > 0) builder = builder.withTags(opts.tags);\n let results: AxeResults;\n try {\n results = await builder.analyze();\n } catch (err) {\n const moved = await navigatedAway();\n if (moved !== null) return moved;\n throw new A11yError(`Could not analyze ${url}: ${reason(err)}`);\n }\n // The page can navigate between two reads without either rejecting, and\n // then what was read belongs to the destination, not to `url`. Where it\n // went comes from the recorded request, with the frame's URL as fallback.\n // A script redirect that fires after axe returns is not seen at all: the\n // page was analyzed as it stood, which is what it was when it was read.\n if (!samePage(page.url(), loaded)) return { redirect: destination() };\n return {\n result: {\n url,\n violations: results.violations.map(toViolation),\n passes: results.passes.length,\n incomplete: results.incomplete.length,\n },\n links: read.links,\n finalUrl: page.url(),\n };\n}\n\n/** What one in-page evaluation reads before axe runs. */\ninterface InPage {\n /** Every `a[href]`'s absolute `href`. */\n links: string[];\n /** The first `<meta http-equiv=\"refresh\">`'s `content`, or `null`. */\n refresh: string | null;\n}\n\n/** Runs in the page. The project has no DOM lib, so the DOM is typed as narrowly as it is used. */\nfunction readPage(): InPage {\n const doc = (\n globalThis as unknown as {\n document: {\n querySelectorAll(selector: string): ArrayLike<{ href: string }>;\n querySelector(selector: string): { getAttribute(name: string): string | null } | null;\n };\n }\n ).document;\n return {\n links: Array.from(doc.querySelectorAll(\"a[href]\"), (a) => a.href),\n refresh:\n doc.querySelector('meta[http-equiv=\"refresh\" i]')?.getAttribute(\"content\") ?? null,\n };\n}\n\n/**\n * The URL part of a meta refresh's `content`: `<delay>;url=<url>` or\n * `<delay>, <url>`, `url=` optional and any case, quotes around the URL\n * optional. `null` for a bare delay, which is a reload rather than a redirect.\n */\nexport function refreshUrl(content: string): string | null {\n // The delay may be fractional (\"0.5\"), hence the dot. A malformed delay\n // such as \"...\" also passes, which costs nothing: only the URL is used.\n const match = /^\\s*[\\d.]*\\s*[;,]\\s*(?:url\\s*=\\s*)?(.*)$/is.exec(content);\n let target = match?.[1]?.trim() ?? \"\";\n const quote = target[0];\n if (quote === \"'\" || quote === '\"') {\n const end = target.indexOf(quote, 1);\n target = (end === -1 ? target.slice(1) : target.slice(1, end)).trim();\n }\n return target === \"\" ? null : target;\n}\n\n/**\n * Where a meta refresh sends the browser, resolved against the page, or\n * `null` when there is no refresh, no URL in it, or it points back at the\n * page itself.\n */\nfunction refreshTarget(content: string | null, base: string): string | null {\n if (content === null) return null;\n const target = refreshUrl(content);\n if (target === null) return null;\n let to: string;\n try {\n to = new URL(target, base).href;\n } catch {\n return null;\n }\n return samePage(to, base) ? null : to;\n}\n\n/** One page by `dedupeKey`; a string that is not an http(s) URL compares as itself. */\nfunction samePage(a: string, b: string): boolean {\n try {\n return dedupeKey(a) === dedupeKey(b);\n } catch {\n return a === b;\n }\n}\n\n/** What axe may put in `impact`; the same union `@axe-core/playwright` declares. */\ntype ImpactValue = AxeResult[\"impact\"];\n\n/**\n * axe's impact onto the family severity scale (`src/shared/severity.ts`).\n * Four levels fold onto three: `critical` and `serious` are both `error`,\n * `moderate` is `warning`, `minor` is `notice`. A missing impact, which axe\n * reports as `null` for a rule with no impact set, is the lowest level. The\n * original word is kept on the violation as `impact`, so nothing is lost for\n * anyone looking the rule up where axe names it.\n */\nexport function severityOf(impact: ImpactValue | null | undefined): Severity {\n switch (impact) {\n case \"critical\":\n case \"serious\":\n return \"error\";\n case \"moderate\":\n return \"warning\";\n default:\n return \"notice\";\n }\n}\n\n/** axe's word as it stands, or `minor` when it gave none. */\nfunction impactOf(impact: ImpactValue | null | undefined): AxeImpact {\n return impact != null && isAxeImpact(impact) ? impact : \"minor\";\n}\n\nfunction toViolation(result: AxeResult): Violation {\n return {\n id: result.id,\n severity: severityOf(result.impact),\n impact: impactOf(result.impact),\n help: result.help,\n helpUrl: result.helpUrl,\n tags: result.tags,\n nodes: result.nodes.map(toNode),\n };\n}\n\nfunction toNode(node: AxeNode): ViolationNode {\n return {\n // A shadow-DOM target is a nested list of selectors; flatten it the same way.\n target: node.target.map((t) => (Array.isArray(t) ? t.join(\" \") : t)).join(\" \"),\n html: node.html,\n summary: node.failureSummary ?? \"\",\n };\n}\n\n/**\n * The first line of a Playwright error. The rest is a call log that repeats\n * the URL and the timeout, which the caller's message already carries.\n */\nfunction reason(err: unknown): string {\n const message = err instanceof Error ? err.message : String(err);\n return message.split(\"\\n\")[0]?.trim() ?? message;\n}\n","/**\n * The `a11y:` key of the family config file (`manni.config.yaml`).\n *\n * Finding the file is the shared layer's job (src/shared/config-file.ts);\n * what the section may contain is decided here. The posture is meta's: an\n * unknown key or a wrong type is an error that names the file and the key,\n * because a misspelled `maxPages:` that was silently ignored would run the\n * crawl on defaults and read as a clean pass.\n */\nimport type { CollectionConfig } from \"../../shared/collections.js\";\nimport {\n findConfigFile,\n readConfigFile,\n type ConfigFileOptions,\n} from \"../../shared/config-file.js\";\nimport { A11yError, SEVERITIES, isSeverity, type Severity } from \"../types.js\";\nimport { MUST_START_WITH_SLASH, isUrlPathGlob } from \"./exclude.js\";\nimport { isHttpUrl } from \"./url.js\";\n\nexport interface A11yConfig {\n urls?: string[];\n crawl?: boolean;\n /** Cap on pages checked. Absent means no cap. */\n maxPages?: number;\n tags?: string[];\n severity?: Severity;\n timeout?: number;\n /** Globs matched against a URL's path; a match keeps the page out of the crawl. */\n exclude?: string[];\n}\n\nexport interface LoadedA11yConfig {\n config: A11yConfig;\n /** Where it came from, for messages. `null` when no file was found or `--no-config`. */\n source: string | null;\n /**\n * The family file's top-level `collections:`, passed straight through: a\n * collection's `url` is a seed source (proposal 0041, rule 12), and the\n * declaration belongs to the family rather than to `a11y:`. `[]` when no\n * file was found and when none are declared.\n */\n collections: CollectionConfig[];\n}\n\n/** The tool's key in the family file. */\nconst SECTION = \"a11y\";\n\n/**\n * The keys the section may carry. Adding a key to `A11yConfig` means adding\n * it here too, or a config using it is rejected; that coupling is the point.\n */\nconst CONFIG_KEYS = [\"urls\", \"crawl\", \"maxPages\", \"tags\", \"severity\", \"timeout\", \"exclude\"] as const;\n\nconst CONFIG_FILE: ConfigFileOptions = {\n section: SECTION,\n // The a11y tool never had a pre-family file of its own.\n legacyNames: [],\n toError: (message) => new A11yError(message),\n};\n\n/**\n * Discover (or read `explicitPath`) through the shared family-file loader with\n * `{ section: \"a11y\", legacyNames: [], toError: (m) => new A11yError(m) }`.\n * Unknown keys, wrong types, empty `urls` entries and non-`http(s)` urls are\n * `A11yError`s naming the file and key. `null` config (empty section) is `{}`.\n * The document's `collections:` come back alongside, parsed by the shared\n * loader: the key is the family's, not this section's.\n */\nexport async function loadA11yConfig(\n cwd: string,\n explicitPath?: string,\n): Promise<LoadedA11yConfig> {\n const file =\n explicitPath === undefined\n ? await findConfigFile(cwd, CONFIG_FILE)\n : await readConfigFile(explicitPath, cwd, CONFIG_FILE);\n if (file === null) return { config: {}, source: null, collections: [] };\n return {\n config: parseA11yConfig(file.value, file.source),\n source: file.source,\n collections: file.collections,\n };\n}\n\n/** Pure parser, exported for tests. */\nexport function parseA11yConfig(value: unknown, source: string): A11yConfig {\n if (value == null) return {};\n if (typeof value !== \"object\" || Array.isArray(value)) {\n throw new A11yError(`${source}: \\`${SECTION}:\\` must be a mapping.`);\n }\n const obj = value as Record<string, unknown>;\n for (const key of Object.keys(obj)) {\n if (!(CONFIG_KEYS as readonly string[]).includes(key)) {\n throw new A11yError(\n `${source}: \\`${SECTION}:\\` has unknown key \"${key}\". Supported keys: ${CONFIG_KEYS.join(\", \")}.`,\n );\n }\n }\n\n const config: A11yConfig = {};\n if (obj.urls !== undefined) config.urls = asUrls(obj.urls, source);\n if (obj.crawl !== undefined) config.crawl = asBoolean(obj.crawl, \"crawl\", source);\n if (obj.maxPages !== undefined) {\n config.maxPages = asPositiveInteger(obj.maxPages, \"maxPages\", source);\n }\n if (obj.tags !== undefined) config.tags = asStringList(obj.tags, \"tags\", source);\n if (obj.severity !== undefined) config.severity = asSeverity(obj.severity, source);\n if (obj.timeout !== undefined) {\n config.timeout = asPositiveInteger(obj.timeout, \"timeout\", source);\n }\n if (obj.exclude !== undefined) config.exclude = asExcludes(obj.exclude, source);\n return config;\n}\n\n/**\n * How a message names one entry of `a11y.exclude:`: the file it came from and\n * the entry's position in the list. Both the parse errors below and the\n * excluded-seed refusal in the check core name an entry this way, so a run\n * whose patterns came from config never mentions a flag the user did not type.\n */\nexport function excludeEntryLabel(source: string, index: number): string {\n return `${source}: \"${SECTION}.exclude[${String(index)}]\"`;\n}\n\n/**\n * Each entry has to be able to match a path, which always starts with `/`. A\n * pattern that cannot is a silent near-miss rather than a filter, so it is\n * refused here, naming whichever entry is wrong by its position in the list.\n */\nfunction asExcludes(value: unknown, source: string): string[] {\n const globs = asStringList(value, \"exclude\", source);\n globs.forEach((glob, i) => {\n const at = excludeEntryLabel(source, i);\n // An empty string fails the slash check too, so this is only about which\n // message it gets: \"must be a non-empty string\" names the mistake, where\n // \"must start with /\" would describe a pattern that is not there.\n if (glob === \"\") throw new A11yError(`${at} must be a non-empty string.`);\n if (!isUrlPathGlob(glob)) throw new A11yError(`${at} ${MUST_START_WITH_SLASH}`);\n });\n return globs;\n}\n\nfunction asStringList(value: unknown, field: string, source: string): string[] {\n if (!Array.isArray(value) || !value.every((v) => typeof v === \"string\")) {\n throw new A11yError(`${source}: \"${SECTION}.${field}\" must be a list of strings.`);\n }\n return value;\n}\n\nfunction asUrls(value: unknown, source: string): string[] {\n const urls = asStringList(value, \"urls\", source);\n urls.forEach((url, i) => {\n if (!isHttpUrl(url)) {\n throw new A11yError(\n `${source}: \"${SECTION}.urls[${i}]\" must be an http(s) URL, got \"${url}\".`,\n );\n }\n });\n return urls;\n}\n\nfunction asBoolean(value: unknown, field: string, source: string): boolean {\n if (typeof value !== \"boolean\") {\n throw new A11yError(`${source}: \"${SECTION}.${field}\" must be a boolean.`);\n }\n return value;\n}\n\nfunction asPositiveInteger(value: unknown, field: string, source: string): number {\n if (typeof value !== \"number\" || !Number.isInteger(value) || value < 1) {\n throw new A11yError(`${source}: \"${SECTION}.${field}\" must be an integer >= 1.`);\n }\n return value;\n}\n\nfunction asSeverity(value: unknown, source: string): Severity {\n if (typeof value !== \"string\" || !isSeverity(value)) {\n throw new A11yError(\n `${source}: \"${SECTION}.severity\" must be one of ${SEVERITIES.join(\", \")}.`,\n );\n }\n return value;\n}\n","/**\n * `--format github`: one workflow-command annotation per finding.\n *\n * There is no file to anchor to, since the check ran against a URL, so the\n * annotation carries the rule id as its title and names the page in the\n * message. Empty when the run is clean, so a clean CI step logs nothing.\n */\nimport {\n escapeWorkflowCommandMessage,\n escapeWorkflowCommandProperty,\n} from \"../../shared/github.js\";\nimport type { CheckRun, Severity } from \"../types.js\";\n\n/** The three levels a workflow command can carry. */\nexport type AnnotationLevel = \"error\" | \"warning\" | \"notice\";\n\n/**\n * The annotation level for a finding of the given severity.\n *\n * The family scale (`src/shared/severity.ts`) was chosen to match GitHub's,\n * so the map is one-to-one and this is the identity. It stays a function,\n * and stays exported, because it is the seam: the translation from a\n * domain's severity to an output's levels happens here and nowhere else,\n * and a reporter for a sink with another scale (SARIF's `note`) would carry\n * its own. axe's four impacts were folded onto these three by the analyzer\n * (`severityOf`), before any reporter saw the finding. Proposal 0035,\n * stress test 10.\n */\nexport function annotationLevel(severity: Severity): AnnotationLevel {\n return severity;\n}\n\nexport function renderGithub(run: CheckRun): string {\n const lines: string[] = [];\n for (const page of run.results) {\n if (page.error !== undefined) {\n // A page that did not load has no severity to translate. It is the most\n // serious thing a run can hold, so it is always an error.\n lines.push(\n `::error title=a11y/load::${escapeWorkflowCommandMessage(`${page.url}: ${page.error}`)}`,\n );\n continue;\n }\n for (const v of page.violations) {\n const n = v.nodes.length;\n const title = escapeWorkflowCommandProperty(`a11y/${v.id}`);\n const msg = escapeWorkflowCommandMessage(\n `${v.help} — ${n} node${n === 1 ? \"\" : \"s\"} on ${page.url} (${v.helpUrl})`,\n );\n lines.push(`::${annotationLevel(v.severity)} title=${title}::${msg}`);\n }\n }\n return lines.join(\"\\n\");\n}\n","/**\n * `--format json`: the `CheckRun` as it is, pretty-printed. Key order is the\n * order the types declare, so the envelope is stable from run to run.\n */\nimport type { CheckRun } from \"../types.js\";\n\nexport function renderJson(run: CheckRun): string {\n return JSON.stringify(run, null, 2);\n}\n","/**\n * `--format pretty`: the report a person reads in a terminal.\n *\n * One line per page, and under a failing page one line per rule followed by\n * the first three elements that failed it, each with axe's own statement of\n * which condition was not met. That per-element line is the deterministic\n * remediation: which rule, which selector, what to change. After the pages,\n * one `↪` line per page that redirected in the browser, hidden by `--quiet`\n * as a passing page is.\n *\n * Colors carry the meanings meta already gave them: ✓ green, ✗ red, URLs\n * cyan, and severity from dim (notice) through yellow (warning) to red\n * (error).\n *\n * Each violation line leads with the family severity, which is what the\n * floor and the exit code are decided on. axe's own word follows the rule id\n * in parentheses, `(axe: critical)`, so the line can still be matched\n * against the Deque rule page and the axe DevTools report that use it.\n */\nimport { palette, type Colors } from \"../../shared/color.js\";\nimport {\n SEVERITIES,\n type CheckRun,\n type Severity,\n type PageResult,\n type Violation,\n} from \"../types.js\";\nimport type { RenderOptions } from \"./index.js\";\n\n/** How many failing elements are listed under one rule before `(+N more)`. */\nconst MAX_NODES = 3;\n\nexport function renderPretty(run: CheckRun, opts: RenderOptions): string {\n const c = palette(opts.color);\n const { summary } = run;\n const lines: string[] = [];\n\n lines.push(`Checked ${summary.checked} of ${summary.discovered} pages (${where(run, c)})`);\n\n for (const page of run.results) {\n if (page.error !== undefined) {\n lines.push(`${c.red(\"✗\")} ${c.cyan(page.url)} could not load: ${page.error}`);\n continue;\n }\n if (page.violations.length === 0) {\n if (!opts.quiet) lines.push(`${c.green(\"✓\")} ${c.cyan(page.url)} score ${scoreText(page)}`);\n continue;\n }\n lines.push(\n `${c.red(\"✗\")} ${c.cyan(page.url)} score ${scoreText(page)} ${severityCounts(page.violations, c)}`,\n );\n for (const v of page.violations) lines.push(...violationLines(v, c));\n }\n\n if (!opts.quiet) {\n for (const r of run.redirects) {\n lines.push(`${c.dim(\"↪\")} ${c.cyan(r.url)} redirects to ${c.cyan(r.to)}`);\n }\n }\n\n const failed = summary.failed;\n const footer =\n `${summary.violations} violation${summary.violations === 1 ? \"\" : \"s\"} on ${failed} of ${summary.checked} pages` +\n (summary.skipped > 0 ? `; ${summary.skipped} skipped (--max-pages)` : \"\") +\n (summary.duplicates > 0\n ? `; ${summary.duplicates} duplicate${summary.duplicates === 1 ? \"\" : \"s\"} dropped`\n : \"\") +\n (summary.redirects > 0\n ? `; ${summary.redirects} redirect${summary.redirects === 1 ? \"\" : \"s\"}`\n : \"\") +\n (summary.excluded > 0 ? `; ${summary.excluded} excluded` : \"\");\n lines.push(\"\");\n lines.push(failed > 0 ? c.red(footer) : c.green(footer));\n return lines.join(\"\\n\");\n}\n\n/**\n * How the pages were found. `--no-crawl` never looks for a sitemap, so a null\n * `sitemap` alone cannot tell \"no crawl\" from \"crawled, found no sitemap\".\n *\n * A sitemap that was found is not a sitemap that supplied pages. One whose\n * every `<loc>` is on another host parses and yields nothing, which is what a\n * built sitemap does when the built site is served on a local preview. So a\n * named sitemap carries its count whenever links did some of the work, and\n * the run that was wholly a sitemap's says so with the URL alone.\n */\nfunction where(run: CheckRun, c: Colors): string {\n const { summary } = run;\n if (!summary.crawl) return \"no crawl\";\n if (summary.sitemap === null) return \"no sitemap; followed links\";\n const found = `sitemap: ${c.cyan(summary.sitemap)}`;\n const n = summary.sitemapPages;\n if (n === 0) return `${found}, 0 pages; followed links`;\n if (n >= summary.discovered) return found;\n return `${found}, ${n} page${n === 1 ? \"\" : \"s\"}; followed links for the rest`;\n}\n\nfunction scoreText(page: PageResult): string {\n return page.score === null ? \"n/a\" : String(page.score);\n}\n\n/** `2 errors, 1 notice`: most severe first, pluralised, zeros omitted. */\nfunction severityCounts(violations: Violation[], c: Colors): string {\n const counts: Record<Severity, number> = { notice: 0, warning: 0, error: 0 };\n for (const v of violations) counts[v.severity] += 1;\n return [...SEVERITIES]\n .reverse()\n .filter((severity) => counts[severity] > 0)\n .map((severity) => {\n const n = counts[severity];\n return paintSeverity(`${n} ${severity}${n === 1 ? \"\" : \"s\"}`, severity, c);\n })\n .join(\", \");\n}\n\nfunction violationLines(v: Violation, c: Colors): string[] {\n const n = v.nodes.length;\n const lines = [\n ` ${paintSeverity(v.severity, v.severity, c)} ${v.id} ${c.dim(`(axe: ${v.impact})`)} ${n} node${n === 1 ? \"\" : \"s\"} ${v.help} ${c.dim(v.helpUrl)}`,\n ];\n for (const node of v.nodes.slice(0, MAX_NODES)) {\n lines.push(` ${node.target} → ${oneLine(node.summary)}`);\n }\n if (n > MAX_NODES) lines.push(c.dim(` (+${n - MAX_NODES} more)`));\n return lines;\n}\n\n/**\n * axe's failureSummary is a heading line followed by one indented line per\n * unmet condition. On one line: the heading, then the conditions joined by\n * `; `.\n */\nfunction oneLine(summary: string): string {\n const [head, ...rest] = summary\n .split(\"\\n\")\n .map((s) => s.trim())\n .filter((s) => s.length > 0);\n if (head === undefined) return \"\";\n return rest.length === 0 ? head : `${head} ${rest.join(\"; \")}`;\n}\n\nfunction paintSeverity(text: string, severity: Severity, c: Colors): string {\n switch (severity) {\n case \"notice\":\n return c.dim(text);\n case \"warning\":\n return c.yellow(text);\n case \"error\":\n return c.red(text);\n }\n}\n","/**\n * The a11y reporters render a `CheckRun` to a string. The command layer writes\n * the result to stdout; diagnostics go to stderr separately.\n */\nimport { A11yError, type CheckRun } from \"../types.js\";\nimport { renderGithub } from \"./github.js\";\nimport { renderJson } from \"./json.js\";\nimport { renderPretty } from \"./pretty.js\";\n\nexport { renderGithub, annotationLevel } from \"./github.js\";\nexport type { AnnotationLevel } from \"./github.js\";\nexport { renderJson } from \"./json.js\";\nexport { renderPretty } from \"./pretty.js\";\n\n/**\n * Every value `--format` accepts, in the order help and error messages list\n * them. Stated once, so the union, the guard, the option text and the error\n * cannot drift apart. SARIF and JUnit are deferred (proposal 0035).\n */\nexport const A11Y_FORMATS = [\"pretty\", \"json\", \"github\"] as const;\nexport type A11yFormat = (typeof A11Y_FORMATS)[number];\n\n/** `\"pretty | json | github\"`, for messages and help text. */\nexport const A11Y_FORMAT_LIST: string = A11Y_FORMATS.join(\" | \");\n\nexport function isA11yFormat(value: string): value is A11yFormat {\n return (A11Y_FORMATS as readonly string[]).includes(value);\n}\n\nexport interface RenderOptions {\n /** From shared `shouldColor`. */\n color: boolean;\n /** pretty only: hide pages with no remaining violations. */\n quiet: boolean;\n}\n\n/** Returns the full text without a trailing newline; `github` returns \"\" when clean. */\nexport function render(format: A11yFormat, run: CheckRun, opts: RenderOptions): string {\n switch (format) {\n case \"pretty\":\n return renderPretty(run, opts);\n case \"json\":\n return renderJson(run);\n case \"github\":\n return renderGithub(run);\n default: {\n // Exhaustive: a format added to `A11Y_FORMATS` without a case here is a\n // compile error; the throw is for a caller who bypassed the guard.\n const unreachable: never = format;\n throw new A11yError(\n `Unknown report format ${JSON.stringify(unreachable)}. Use ${A11Y_FORMAT_LIST}.`,\n );\n }\n }\n}\n","/**\n * Progress on stderr, while the crawl runs.\n *\n * The browser launch alone takes seconds and a fifty-page site takes a\n * minute, and a command that says nothing for that long reads as hung. So\n * the run narrates itself on stderr, where a diagnostic belongs; stdout stays\n * the report, and `-f json | jq` keeps working.\n *\n * Two renderings. On a terminal, one status line rewritten in place\n * (`\\r`, erase line, then the text, no newline) and cleared on `done`, so the\n * report on stdout is not preceded by a dangling line. Off a terminal, one\n * plain line per event, newline-terminated and prefixed the way `warn()`\n * writes, with no escape codes, since a CI log keeps every line.\n *\n * Colours keep the meanings meta gave them: ✓ green, ✗ red, URLs cyan, the\n * counter dim. They apply on a terminal only.\n */\nimport { palette, type Colors } from \"../../shared/color.js\";\nimport { programName } from \"../../shared/program-name.js\";\nimport type { ProgressEvent, ProgressListener } from \"../types.js\";\n\nexport interface ProgressOptions {\n /** Where to write: `process.stderr`, or a fake in tests. */\n stream: { write(s: string): boolean; isTTY?: boolean; columns?: number };\n /** Paint the status line. Ignored off a terminal. */\n color: boolean;\n /** Rewrite one line in place (true) or append a line per event (false). */\n tty: boolean;\n}\n\n/** Carriage return, then erase the whole line: the start of every status line. */\nexport const CLEAR_LINE = \"\\r\\x1b[2K\";\n\n/** The width a status line is fitted to when the stream does not say. */\nconst DEFAULT_COLUMNS = 80;\n\n/** Returns a listener that renders events to `stream`. */\nexport function createProgressReporter(opts: ProgressOptions): ProgressListener {\n return opts.tty ? terminalReporter(opts) : plainReporter(opts.stream);\n}\n\nfunction plural(n: number, noun: string): string {\n return `${n} ${noun}${n === 1 ? \"\" : \"s\"}`;\n}\n\n/** `[3/51]`, from the last `page` event; `checked` carries no `queued` of its own. */\nfunction counter(index: number, queued: number): string {\n return `[${index}/${queued}]`;\n}\n\nfunction terminalReporter(opts: ProgressOptions): ProgressListener {\n const { stream } = opts;\n const c = palette(opts.color);\n let queued = 0;\n\n const show = (text: string): void => {\n stream.write(`${CLEAR_LINE}${text}`);\n };\n /** `prefix`, the URL, then `suffix`; the URL shortened in the middle to fit the line. */\n const showUrl = (prefix: string, url: string, suffix = \"\"): void => {\n const columns = stream.columns ?? DEFAULT_COLUMNS;\n const fitted = truncateMiddle(url, columns - visibleLength(prefix) - suffix.length);\n show(`${prefix}${c.cyan(fitted)}${suffix}`);\n };\n\n return (event: ProgressEvent): void => {\n switch (event.kind) {\n case \"browser\":\n show(\"Starting browser…\");\n return;\n case \"sitemap\":\n if (event.source === null) show(\"No sitemap; following links\");\n else showUrl(\"Sitemap: \", event.source, ` (${plural(event.urls, \"page\")})`);\n return;\n case \"excluded\":\n show(`Excluded ${plural(event.urls, \"page\")} (${plural(event.patterns, \"pattern\")})`);\n return;\n case \"page\":\n queued = event.queued;\n showUrl(`${c.dim(counter(event.index, queued))} `, event.url);\n return;\n case \"checked\":\n showUrl(`${c.dim(counter(event.index, queued))} ${outcome(event, c)}`, event.url);\n return;\n case \"redirected\":\n showUrl(`${c.dim(counter(event.index, queued))} ${c.dim(\"↪\")} redirects to `, event.to);\n return;\n case \"done\":\n stream.write(CLEAR_LINE);\n return;\n }\n };\n}\n\n/** `✓ `, `✗ 2 violations `, or `✗ could not load: … `: what goes between the counter and the URL. */\nfunction outcome(event: Extract<ProgressEvent, { kind: \"checked\" }>, c: Colors): string {\n if (event.error !== undefined) return `${c.red(\"✗\")} could not load: ${event.error} `;\n if (event.violations === 0) return `${c.green(\"✓\")} `;\n return `${c.red(\"✗\")} ${plural(event.violations, \"violation\")} `;\n}\n\nfunction plainReporter(stream: ProgressOptions[\"stream\"]): ProgressListener {\n let queued = 0;\n const say = (text: string): void => {\n stream.write(`${programName()}: ${text}\\n`);\n };\n\n return (event: ProgressEvent): void => {\n switch (event.kind) {\n case \"browser\":\n say(\"starting browser\");\n return;\n case \"sitemap\":\n if (event.source === null) say(\"no sitemap; following links\");\n else say(`sitemap ${event.source} (${plural(event.urls, \"page\")})`);\n return;\n case \"excluded\":\n say(`excluded ${plural(event.urls, \"page\")} (${plural(event.patterns, \"pattern\")})`);\n return;\n case \"page\":\n queued = event.queued;\n say(`${counter(event.index, queued)} ${event.url}`);\n return;\n case \"checked\": {\n const head = counter(event.index, queued);\n if (event.error !== undefined) say(`${head} could not load: ${event.error}`);\n else if (event.violations === 0) say(`${head} ✓`);\n else say(`${head} ✗ ${plural(event.violations, \"violation\")}`);\n return;\n }\n case \"redirected\":\n say(`${counter(event.index, queued)} ↪ redirects to ${event.to}`);\n return;\n case \"done\":\n say(`checked ${plural(event.checked, \"page\")}, ${event.skipped} skipped`);\n return;\n }\n };\n}\n\n/** Length as the terminal shows it, with ANSI sequences taken out. */\nfunction visibleLength(text: string): number {\n return text.replace(/\\x1b\\[[0-9;]*m/g, \"\").length;\n}\n\n/**\n * Shorten `text` to `room` characters by replacing its middle with `…`, so\n * both the host and the page's own name survive. Never shorter than a few\n * characters, however narrow the terminal.\n */\nfunction truncateMiddle(text: string, room: number): string {\n const max = Math.max(room, 8);\n if (text.length <= max) return text;\n const head = Math.ceil((max - 1) / 2);\n const tail = max - 1 - head;\n return `${text.slice(0, head)}…${text.slice(text.length - tail)}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAAS,eAAe;;;ACcjB,IAAM,YAAN,cAAwB,UAAU;AAAA,EACvC,YAAY,SAAiB;AAC3B,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;AAOO,IAAM,cAAc,CAAC,SAAS,YAAY,WAAW,UAAU;AAG/D,SAAS,YAAY,OAAmC;AAC7D,SAAQ,YAAkC,SAAS,KAAK;AAC1D;;;ACzBO,SAAS,aAAa,KAAqB;AAChD,QAAM,SAAS,MAAM,GAAG;AACxB,MAAI,WAAW,KAAM,OAAM,IAAI,UAAU,qBAAqB,GAAG,IAAI;AACrE,SAAO,OAAO;AACd,SAAO,OAAO;AAChB;AAUO,SAAS,UAAU,KAAqB;AAC7C,QAAM,SAAS,IAAI,IAAI,aAAa,GAAG,CAAC;AACxC,MAAI,OAAO,SAAS,SAAS,KAAK,OAAO,SAAS,SAAS,GAAG,GAAG;AAC/D,WAAO,WAAW,OAAO,SAAS,MAAM,GAAG,EAAE;AAAA,EAC/C;AACA,SAAO,OAAO;AAChB;AAGO,SAAS,UAAU,KAAsB;AAC9C,QAAM,SAAS,MAAM,GAAG;AACxB,SAAO,WAAW,QAAQ,eAAe,MAAM;AACjD;AAOO,SAAS,SAAS,GAAW,GAAoB;AACtD,QAAM,OAAO,MAAM,CAAC;AACpB,QAAM,QAAQ,MAAM,CAAC;AACrB,MAAI,SAAS,QAAQ,UAAU,KAAM,QAAO;AAK5C,SACE,KAAK,SAAS,YAAY,MAAM,MAAM,SAAS,YAAY,KAC3D,KAAK,SAAS,MAAM;AAExB;AAMO,SAAS,WAAW,KAAsB;AAC/C,QAAM,SAAS,MAAM,GAAG;AACxB,MAAI,WAAW,QAAQ,CAAC,eAAe,MAAM,EAAG,QAAO;AACvD,QAAM,OAAO,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,KAAK,SAAS,KAAK,WAAW,UAAU;AAC1C,gBAAQ,OAAO,MAAM,GAAG,IAAI;AAAA,CAAI;AAAA,MAClC;AACA,cAAQ,WAAW,IAAI,QAAQ,SAAS,IAAI,IAAI;AAAA,IAClD,SAAS,KAAK;AACZ,oBAAc;AACd,WAAK,GAAG;AAAA,IACV;AAAA,EACF,CAAC;AAEH,SAAO;AACT;","names":["outcome","outcome","crawl"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lint/cli.ts"],"sourcesContent":["/**\n * The lint program. Named `lint` because that is where it is mounted\n * (`manni lint …`); `src/cli.ts` adds it to the umbrella and runs it. Thin\n * commander wrapper over the command cores. Follows clig.dev: primary output to\n * stdout, diagnostics to stderr, color only on a TTY (and never under\n * NO_COLOR/--no-color), meaningful exit codes.\n *\n * Grammar per proposal 0034: the verbs are `check`, `structure`, `templates`\n * and `tools`, and there is no default subcommand, so a bare `manni lint` is a\n * usage error that lists them. `check` runs every configured job; `structure`\n * runs one of them, and carries the options that belong to the tool performing\n * it.\n *\n * Exit codes are the contract CI reads:\n * 0 every file linted clean\n * 1 the run produced findings\n * 2 the tool could not do its job - bad usage, missing template, unreadable\n * input. A LintError is always this, never a lint failure.\n *\n * The 1/2 split is what lets a workflow tell \"the docs are wrong\" apart from\n * \"the linter is misconfigured\", which a single non-zero exit cannot.\n */\nimport { Command } from \"commander\";\nimport pkg from \"../../package.json\" with { type: \"json\" };\nimport {\n collect,\n configOption,\n explicitFalse,\n readStdin,\n reportConfig,\n splitList,\n} from \"../shared/cli-options.js\";\nimport { shouldColor } from \"../shared/color.js\";\nimport { fail } from \"../shared/run.js\";\nimport { notice } from \"../shared/warn.js\";\nimport {\n OMITTED_WHEN_CLEAN,\n REPORT_FORMAT_LIST,\n STDIN_TOKEN,\n} from \"../meta/internal.js\";\nimport {\n REPORT_FORMATS,\n isReportFormat,\n type ReportFormat as FamilyFormat,\n} from \"../meta/index.js\";\nimport { LintError } from \"./types.js\";\nimport { runLint } from \"./commands/lint.js\";\nimport { runTemplates, runTemplatesInfer } from \"./commands/templates.js\";\nimport { runTools } from \"./commands/tools.js\";\nimport { INFER_FORMATS, isInferFormat, type InferFormat } from \"./core/infer.js\";\nimport {\n LINT_JOBS,\n TOOLS_BY_JOB,\n loadConfig,\n rebaseConfig,\n} from \"./core/config.js\";\nimport { resolveStructureTool } from \"./tools/index.js\";\nimport {\n render,\n renderTemplates,\n renderTools,\n type ListFormat,\n type ReportFormat,\n} from \"./reporters/index.js\";\n\n/** The options `check` and `structure` share, in the family's spelling. */\ninterface InputCliOptions {\n /** `--collection <name>`, repeatable; commander's default value is `[]`. */\n collection: string[];\n /** `--ext <list>`; the command splits it. */\n ext?: string;\n /** `--exclude <glob>`, repeatable; commander's default value is `[]`. */\n exclude: string[];\n /** `--as <format>`: force a parser. */\n as?: string;\n /**\n * `-c, --config <path>` and `--no-config` share one commander attribute:\n * `undefined` with neither flag, the path with `-c`, `false` with\n * `--no-config`. Split by `configOption`.\n */\n config?: string | boolean;\n allowEmpty?: boolean;\n /** `--no-gitignore`. */\n gitignore: boolean;\n /** `-f, --format <format>`. Always a string: the declaration has a default. */\n format: string;\n}\n\n/** `structure` adds the options of the tool that performs the job. */\ninterface StructureCliOptions extends InputCliOptions {\n tool?: string;\n template?: string;\n /** `--templates <path>`, repeatable; commander's default value is `[]`. */\n templates: string[];\n explain?: boolean;\n}\n\n/** What commander parses for `templates`. */\ninterface TemplatesCommandOptions {\n templates: string[];\n config?: string | boolean;\n format: string;\n}\n\n/** What commander parses for `templates infer`. */\ninterface TemplatesInferCliOptions {\n as?: string;\n name?: string;\n config?: string | boolean;\n format: string;\n out?: string;\n force?: boolean;\n}\n\n/** What commander parses for `tools`. */\ninterface ToolsCommandOptions {\n config?: string | boolean;\n format: string;\n}\n\n// `explain` is reachable through `--explain`, not `-f`: it reports on\n// configuration rather than on documents, and offering it as a format would\n// invite `-f explain` alongside a lint that then never happens. The `-f` set\n// itself is the family's, from meta, rather than a fourth hand-kept copy of\n// the same five words.\nconst LIST_FORMATS = new Set<string>([\"pretty\", \"json\"]);\n\n/** The heading the tool's own options print under, after the shared ones. */\nconst TOOL_OPTIONS_GROUP = \"Tool options:\";\n\nfunction resolveColor(program: Command): boolean {\n // commander maps --no-color to opts.color === false.\n const noColor = program.opts().color === false;\n return shouldColor({ noColor, isTTY: process.stdout.isTTY });\n}\n\nfunction reportFormat(value: unknown): FamilyFormat {\n const format = String(value);\n if (!isReportFormat(format)) {\n throw new LintError(\n `Unknown --format \"${format}\". Use ${REPORT_FORMAT_LIST}.`,\n );\n }\n return format;\n}\n\n/**\n * Whether a clean run may print nothing at all in this format.\n *\n * Only `github` may: an empty annotation stream is a clean check. Every other\n * format owes its envelope - an empty JSON array, a SARIF log with no results,\n * a JUnit suite of passing testcases - because a consumer parsing stdout must\n * not have to treat \"no output\" as a third outcome. `explain` is never clean\n * or dirty; it always has something to say.\n */\nfunction omittedWhenClean(format: ReportFormat): boolean {\n return format !== \"explain\" && OMITTED_WHEN_CLEAN.has(format);\n}\n\nfunction listFormat(value: unknown): ListFormat {\n const format = String(value);\n if (!LIST_FORMATS.has(format)) {\n throw new LintError(\n `Unknown --format \"${format}\". Use pretty or json.`,\n );\n }\n return format as ListFormat;\n}\n\n/**\n * `templates infer -f`: the format a *template file* is written in, which is\n * not the set a report is rendered in. A template is YAML or JSON because those\n * are the two the loader reads back, and `pretty` would name a third thing the\n * tool cannot then load.\n */\nfunction inferFormat(value: unknown): InferFormat {\n const format = String(value);\n if (!isInferFormat(format)) {\n throw new LintError(`Unknown --format \"${format}\". Use yaml or json.`);\n }\n return format;\n}\n\n/**\n * `--tool <name>`: which tool performs the structure job. Refused by name\n * rather than ignored, because falling through to manni's engine would lint\n * with something other than what was asked for and say nothing.\n *\n * The refusal is the registry's, not a second copy of it here. `runLint`\n * refuses the same name with the same sentence for a caller that never touches\n * commander; this one fires first, so a bad `--tool` is reported before the\n * run asks what it was pointed at.\n */\nfunction assertStructureTool(value: string | undefined): void {\n if (value === undefined) return;\n resolveStructureTool(value);\n}\n\n/**\n * `-c/--config` and `--no-config`, in one place.\n *\n * Every verb here takes them, and they had been written out three times. A flag\n * two commands both have carries the same name *and* the same description, so\n * the declaration is shared rather than copied - which is what kept the fourth\n * copy, on `templates infer`, from spelling either of them slightly differently.\n */\nfunction withConfigOptions(command: Command): Command {\n return command\n .option(\"-c, --config <path>\", \"path to a manni config file\")\n .option(\"--no-config\", \"ignore any discovered config file\");\n}\n\n/**\n * The value of a flag a command and its parent both declare.\n *\n * Commander keeps parsing a parent's options past a subcommand name unless\n * `enablePositionalOptions()` is on, so `templates infer page.md -f json` sets\n * `format` on `templates` and leaves `infer` holding its own default. Both\n * commands declare `-f`, `-c` and `--no-config`, because \"commands must have\n * parallel behaviors\" and `infer` must list them in its own `--help`.\n *\n * Turning positional options on would fix it and move every other flag in this\n * program with it: `manni lint structure docs/ --no-color` is a root option\n * written after its command, and there are three more like it. So the lookup\n * changes instead. The nearest command actually *given* the flag wins, and the\n * subcommand's own default is the fallback - which is the reading a person\n * typing the line already has.\n */\nfunction optionValue(command: Command, key: string): unknown {\n for (\n let cmd: Command | null = command;\n cmd !== null;\n cmd = cmd.parent ?? null\n ) {\n if (cmd.getOptionValueSource(key) === \"cli\") return cmd.getOptionValue(key);\n }\n return command.getOptionValue(key);\n}\n\n/** The options every job verb takes, in one place so the two cannot drift. */\nfunction withInputOptions(command: Command): Command {\n command\n .argument(\n \"[paths...]\",\n \"files, directories, or globs to lint (use - for stdin)\",\n )\n .option(\n \"--collection <name>\",\n \"configured collection to run over; repeatable\",\n collect,\n [],\n )\n .option(\"--ext <list>\", \"comma-separated extensions for directory walks\")\n .option(\"--exclude <glob>\", \"glob to exclude; repeatable\", collect, [])\n .option(\"--as <format>\", \"force an input format (e.g. markdown, mdx)\")\n .option(\n \"-f, --format <format>\",\n `output: ${REPORT_FORMATS.join(\" | \")}`,\n \"pretty\",\n );\n return withConfigOptions(command)\n .option(\"--allow-empty\", \"treat zero matched files as success\")\n .option(\"--no-gitignore\", \"lint files .gitignore covers\");\n}\n\n/** The lint options every job verb turns its shared flags into. */\nfunction inputOptions(\n paths: string[],\n options: InputCliOptions,\n): {\n inputs: string[];\n collection: string[];\n exts?: string[];\n exclude: string[];\n as?: string;\n configPath?: string;\n noConfig?: boolean;\n allowEmpty?: boolean;\n respectGitignore?: boolean;\n onNotice: (message: string) => void;\n} {\n return {\n inputs: paths,\n collection: options.collection,\n ...(options.ext ? { exts: splitList(options.ext) } : {}),\n exclude: options.exclude,\n ...(options.as === undefined ? {} : { as: options.as }),\n ...configOption(options.config),\n // `undefined` rather than `false` when absent, so config still wins.\n ...(options.allowEmpty ? { allowEmpty: true } : {}),\n respectGitignore: explicitFalse(options.gitignore),\n onNotice: notice,\n };\n}\n\nexport function buildProgram(): Command {\n const program = new Command();\n program\n .name(\"lint\")\n .description(\n \"Validate document structure against doctype templates. Deterministic, CI-friendly.\",\n )\n .version(pkg.version, \"-V, --version\")\n .option(\"--no-color\", \"disable colored output\")\n .showHelpAfterError()\n // Exit code 1 is reserved for \"the docs are wrong\". Commander exits 1 on a\n // usage error by default, which would make a typo'd flag look exactly like\n // a failing lint to a workflow. With no callback, commander throws the\n // CommanderError instead, and the umbrella's runner maps it: help and\n // --version stay 0, every other usage error becomes 2. Commander has\n // already written its own message. This has to precede .command(), which\n // copies the callback into each subcommand.\n .exitOverride();\n\n /** Run one lint, render it, and settle the exit code. Both job verbs share it. */\n const lint = async (\n paths: string[],\n options: StructureCliOptions | InputCliOptions,\n command: Command,\n job: { tool?: StructureCliOptions } = {},\n ): Promise<void> => {\n const tool = job.tool;\n const format = reportFormat(options.format);\n const explain = tool?.explain === true;\n const stdinContent = paths.includes(STDIN_TOKEN) ? await readStdin() : undefined;\n const cwd = process.cwd();\n\n const run = await runLint({\n ...inputOptions(paths, options),\n ...(tool?.tool === undefined ? {} : { tool: tool.tool }),\n ...(tool?.template === undefined ? {} : { template: tool.template }),\n ...(tool && tool.templates.length > 0 ? { templates: tool.templates } : {}),\n ...(explain ? { explain: true } : {}),\n ...(stdinContent === undefined ? {} : { stdinContent }),\n // Which config governed the run, said where a report cannot be parsed\n // around: discovery walks up to the project boundary, so an unexpected\n // ancestor config is the difference between a five-minute diagnosis and\n // an hour of confusion.\n onConfigLoaded: reportConfig(format === \"pretty\", cwd),\n });\n\n const color = resolveColor(command.parent ?? command);\n const chosen: ReportFormat = explain ? \"explain\" : format;\n const text = render(run, chosen, { color });\n if (text.length > 0 || !omittedWhenClean(chosen)) {\n process.stdout.write(`${text}\\n`);\n }\n // `--explain` answers a question about configuration, so its exit code\n // reports whether it could answer it - not whether the docs are clean.\n //\n // That covers routing failures too: a page whose `type` matches no\n // template is a answered question, not an unanswered one, so it exits 0\n // like everything else here. Automation must not read this code as\n // \"everything routed\" - the ordinary run is what reports that, with exit\n // 1. Said in `--help` and the README, because the distinction is invisible\n // from the exit code alone.\n process.exitCode = explain ? 0 : run.summary.failed > 0 ? 1 : 0;\n };\n\n withInputOptions(\n program\n .command(\"check\")\n .description(\"Run every configured lint job over the given files/dirs/globs\"),\n )\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Jobs: structure.\",\n \"\",\n \"Examples:\",\n \" manni lint check docs/ # every configured job\",\n \" manni lint check # targets from collections:\",\n \" manni lint check --collection guides\",\n ' manni lint check \"**/*.md\" -f github # CI annotations',\n \" cat page.md | manni lint check - --as markdown\",\n ].join(\"\\n\"),\n )\n .action(async (paths: string[], options: InputCliOptions, command: Command) => {\n try {\n // Which jobs this run covered, said once, beside the config line. The\n // full form also names the jobs that exist and are not configured;\n // `structure` is the only job there is, so today it is one word.\n if (options.format === \"pretty\") {\n process.stderr.write(`Checked: ${LINT_JOBS.join(\", \")}.\\n`);\n }\n await lint(paths, options, command);\n } catch (err) {\n fail(err);\n }\n });\n\n const structure = withInputOptions(\n program\n .command(\"structure\")\n .description(\n \"Lint document structure against doctype templates, routing each page by its `type`\",\n ),\n );\n structure\n .optionsGroup(TOOL_OPTIONS_GROUP)\n .option(\n \"--tool <name>\",\n `tool that performs the job: ${TOOLS_BY_JOB.structure.join(\", \")}`,\n )\n .option(\n \"-t, --template <ref>\",\n \"apply this template to every file, overriding type routing\",\n )\n .option(\n \"--templates <path>\",\n \"template file to route by: its `types:` win over built-ins; repeatable\",\n collect,\n [],\n )\n .option(\n \"--explain\",\n \"print how each file's template was chosen, and lint nothing (always exits 0, unrouted pages included)\",\n )\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Examples:\",\n \" manni lint structure docs/ # route each page by its `type`\",\n \" manni lint structure docs/ --templates ./templates.yaml # add your own templates\",\n \" manni lint structure # targets from collections:\",\n \" manni lint structure docs/ --explain # show why each page routed where\",\n \" manni lint structure page.md -t tgdp:how-to:1.6 # force one template\",\n ' manni lint structure \"**/*.md\" -f github # CI annotations',\n \" manni lint structure docs/ --exclude '**/drafts/**'\",\n \" cat page.md | manni lint structure - -t tgdp:how-to:1.6 --as markdown\",\n ].join(\"\\n\"),\n )\n .action(\n async (paths: string[], options: StructureCliOptions, command: Command) => {\n try {\n assertStructureTool(options.tool);\n await lint(paths, options, command, { tool: options });\n } catch (err) {\n fail(err);\n }\n },\n );\n\n const templates = program\n .command(\"templates\")\n .description(\"List the templates that can be applied, and the types they serve\")\n .option(\n \"--templates <path>\",\n \"also list the templates in this file; repeatable\",\n collect,\n [],\n );\n withConfigOptions(templates)\n .option(\"-f, --format <format>\", \"output: pretty | json\", \"pretty\")\n .action(async (options: TemplatesCommandOptions, command: Command) => {\n try {\n const format = listFormat(options.format);\n // The listing answers \"what could route a page?\", so it has to see the\n // same template files a lint would - rebased the same way, or it would\n // answer for a different set of files depending on where it was run.\n const { configPath, noConfig } = configOption(options.config);\n const found = noConfig ? null : await loadConfig(configPath);\n const info = await runTemplates({\n templates:\n options.templates.length > 0\n ? options.templates\n : rebaseConfig(found).templates,\n });\n const color = resolveColor(command.parent ?? command);\n process.stdout.write(`${renderTemplates(info, format, { color })}\\n`);\n } catch (err) {\n fail(err);\n }\n });\n\n const inferCommand = templates\n .command(\"infer\")\n .description(\"Write a first template from a page that already has the shape you want\")\n .argument(\"<page>\", \"one file to infer from (use - for stdin)\")\n .option(\"--as <format>\", \"force an input format (e.g. markdown, mdx)\")\n .option(\n \"--name <name>\",\n \"name for the template; defaults to the page's `type`, else its filename\",\n )\n .option(\"-f, --format <format>\", `output: ${INFER_FORMATS.join(\" | \")}`, \"yaml\")\n .option(\"-o, --out <path>\", \"write the template here instead of to stdout\")\n .option(\"--force\", \"overwrite the --out path\");\n withConfigOptions(inferCommand)\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Examples:\",\n \" manni lint templates infer docs/guides/install.md\",\n \" manni lint templates infer docs/guides/install.md --name how-to\",\n \" manni lint templates infer page.mdx -f json\",\n \" manni lint templates infer page.md -o ./templates.yaml\",\n \" manni lint templates infer page.md -o ./templates.yaml --force\",\n \" cat page.md | manni lint templates infer - --as markdown\",\n \"\",\n \"One page, and every rule it writes is exactly one occurrence: a single\",\n \"page cannot show what varies. Loosening a heading into a list or a\",\n \"pattern, setting `min: 0`, and adding a trailing rule with no heading\",\n \"for the sections that may follow are your edits to make.\",\n ].join(\"\\n\"),\n )\n .action(\n async (\n page: string,\n options: TemplatesInferCliOptions,\n command: Command,\n ) => {\n try {\n // `-f`, `-c` and `--no-config` are read through `optionValue`: the\n // parent `templates` declares all three, and commander hands it any\n // of them typed after `infer`.\n const format = inferFormat(optionValue(command, \"format\"));\n const { configPath, noConfig } = configOption(\n optionValue(command, \"config\"),\n );\n const stdinContent =\n page === STDIN_TOKEN ? await readStdin() : undefined;\n const result = await runTemplatesInfer({\n page,\n format,\n ...(options.as === undefined ? {} : { as: options.as }),\n ...(options.name === undefined ? {} : { name: options.name }),\n ...(options.out === undefined ? {} : { out: options.out }),\n ...(options.force === undefined ? {} : { force: options.force }),\n ...(configPath === undefined ? {} : { configPath }),\n ...(noConfig === undefined ? {} : { noConfig }),\n ...(stdinContent === undefined ? {} : { stdinContent }),\n // The template is the primary output, so with no --out it owns\n // stdout and the config line goes to stderr beside it. With --out\n // stdout is free, and the line still belongs on stderr: a reader\n // piping nothing is not a reason to move a diagnostic.\n onConfigLoaded: reportConfig(false, process.cwd()),\n });\n\n if (result.written === undefined) {\n process.stdout.write(result.text);\n return;\n }\n // Said on stderr, so `-o` leaves stdout empty for a shell that is\n // watching it, and the template file is the whole output.\n process.stderr.write(\n `Wrote template \"${result.name}\" to ${result.written}\\n`,\n );\n } catch (err) {\n fail(err);\n }\n },\n );\n\n withConfigOptions(\n program\n .command(\"tools\")\n .description(\n \"List the lint jobs, the tool that performs each, and what it reads\",\n ),\n )\n .option(\"-f, --format <format>\", \"output: pretty | json\", \"pretty\")\n .action(async (options: ToolsCommandOptions, command: Command) => {\n try {\n const format = listFormat(options.format);\n const tools = await runTools(configOption(options.config));\n const color = resolveColor(command.parent ?? command);\n process.stdout.write(`${renderTools(tools, format, { color })}\\n`);\n } catch (err) {\n fail(err);\n }\n });\n\n return program;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,eAAe;AAuGxB,IAAM,eAAe,oBAAI,IAAY,CAAC,UAAU,MAAM,CAAC;AAGvD,IAAM,qBAAqB;AAE3B,SAAS,aAAa,SAA2B;AAE/C,QAAM,UAAU,QAAQ,KAAK,EAAE,UAAU;AACzC,SAAO,YAAY,EAAE,SAAS,OAAO,QAAQ,OAAO,MAAM,CAAC;AAC7D;AAEA,SAAS,aAAa,OAA8B;AAClD,QAAM,SAAS,OAAO,KAAK;AAC3B,MAAI,CAAC,eAAe,MAAM,GAAG;AAC3B,UAAM,IAAI;AAAA,MACR,qBAAqB,MAAM,UAAU,kBAAkB;AAAA,IACzD;AAAA,EACF;AACA,SAAO;AACT;AAWA,SAAS,iBAAiB,QAA+B;AACvD,SAAO,WAAW,aAAa,mBAAmB,IAAI,MAAM;AAC9D;AAEA,SAAS,WAAW,OAA4B;AAC9C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,QACF;AAGA,gBAAQ,OAAO;AAAA,UACb,mBAAmB,OAAO,IAAI,QAAQ,OAAO,OAAO;AAAA;AAAA,QACtD;AAAA,MACF,SAAS,KAAK;AACZ,aAAK,GAAG;AAAA,MACV;AAAA,IACF;AAAA,EACF;AAEF;AAAA,IACE,QACG,QAAQ,OAAO,EACf;AAAA,MACC;AAAA,IACF;AAAA,EACJ,EACG,OAAO,yBAAyB,yBAAyB,QAAQ,EACjE,OAAO,OAAO,SAA8B,YAAqB;AAChE,QAAI;AACF,YAAM,SAAS,WAAW,QAAQ,MAAM;AACxC,YAAM,QAAQ,MAAM,SAAS,aAAa,QAAQ,MAAM,CAAC;AACzD,YAAM,QAAQ,aAAa,QAAQ,UAAU,OAAO;AACpD,cAAQ,OAAO,MAAM,GAAG,YAAY,OAAO,QAAQ,EAAE,MAAM,CAAC,CAAC;AAAA,CAAI;AAAA,IACnE,SAAS,KAAK;AACZ,WAAK,GAAG;AAAA,IACV;AAAA,EACF,CAAC;AAEH,SAAO;AACT;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/graph/cli.ts","../src/graph/reporters/index.ts","../src/graph/commands/init.ts"],"sourcesContent":["/**\n * The graph program. Named `graph` because that is where it is mounted\n * (`manni graph …`); `src/cli.ts` adds it to the umbrella and runs it.\n *\n * Grammar per proposals 0034 and 0051 §2: the domain owns verbs and has no\n * default subcommand, `-f` means the output format everywhere and is checked\n * against the verb's list, and a list reaches a flag by exactly one\n * separator. The plumbing is the family's: `fail()` from `src/shared/run.ts`,\n * `warn()` from `src/shared/warn.ts`, and `--no-color` from\n * `src/shared/color.ts`.\n */\nimport { Command } from \"commander\";\nimport pkg from \"../../package.json\" with { type: \"json\" };\nimport {\n collect,\n configOption,\n readStdin,\n splitList,\n} from \"../shared/cli-options.js\";\nimport { shouldColor } from \"../shared/color.js\";\nimport { fail } from \"../shared/run.js\";\nimport { warn } from \"../shared/warn.js\";\nimport { GraphError } from \"./types.js\";\nimport { LOCAL_FLAG_HELP } from \"../shared/providers.js\";\nimport { ALL_FILL_FIELDS, type FillField } from \"./core/config.js\";\nimport {\n assertInputFormat,\n DEFAULT_EXTENSIONS,\n STDIN,\n} from \"./core/discover.js\";\nimport {\n CHECK_FORMATS,\n CHECK_FORMAT_LIST,\n GRAPH_FORMATS,\n GRAPH_FORMAT_LIST,\n type CheckFormat,\n type GraphFormat,\n} from \"./reporters/index.js\";\nimport { runBuild } from \"./commands/build.js\";\nimport { renderCheck, runCheck } from \"./commands/check.js\";\nimport {\n EXPORT_TARGETS,\n runExport,\n type ExportFormat,\n} from \"./commands/export.js\";\nimport { renderQuery, runQuery } from \"./commands/query.js\";\nimport { renderFill, runFill } from \"./commands/fill.js\";\nimport { runInit } from \"./commands/init.js\";\nimport { renderEmbed, runEmbed } from \"./commands/embed.js\";\nimport {\n renderSearch,\n runSearch,\n SEARCH_MODES,\n type SearchMode,\n} from \"./commands/search.js\";\nimport { renderStats, runStats } from \"./commands/stats.js\";\nimport { renderTraverse, runTraverse } from \"./commands/traverse.js\";\n\n/**\n * Whether `command`'s output gets colour: this domain's `--no-color` and\n * `NO_COLOR` turn it off, and otherwise only a TTY turns it on\n * (`shouldColor`). `isTTY` is passed uncoerced: Node leaves it undefined off\n * a terminal, never false, and `shouldColor` reads a missing one as \"not a\n * terminal\".\n *\n * Exported because this is where the decision is testable — a spawned bin is\n * never a TTY. graph's reporters print no colour yet; when one does, it takes\n * the boolean from here rather than consulting the environment itself.\n */\nexport function colorFor(\n command: Command,\n isTTY: boolean | undefined,\n env?: NodeJS.ProcessEnv,\n): boolean {\n // commander maps --no-color to opts.color === false, on the command that\n // declares it.\n const noColor = colorOwner(command).opts().color === false;\n return shouldColor({ noColor, isTTY, env });\n}\n\n/**\n * The nearest command, this one or an ancestor, that declares `--no-color`:\n * the `graph` program, wherever it is mounted. Not the root: under the umbrella\n * that is `manni`, which has no `--no-color` of its own.\n */\nfunction colorOwner(command: Command): Command {\n for (let c: Command | null = command; c !== null; c = c.parent) {\n if (c.options.some((o) => o.long === \"--no-color\")) return c;\n }\n return command;\n}\n\nexport function buildProgram(): Command {\nconst program = new Command();\n\nprogram\n .name(\"graph\")\n .description(\n \"Deterministic knowledge graphs derived from documentation frontmatter and formatting.\",\n )\n .version(pkg.version)\n .option(\"--no-color\", \"disable colored output\")\n // A pointer, not the whole help screen: the message that precedes it\n // already names the offending flag.\n .showHelpAfterError(\"(add --help for usage)\")\n // MUST come before the `.command()` calls below. `copyInheritedSettings`\n // copies `_exitCallback` by value at subcommand-creation time, so an\n // `exitOverride()` installed afterwards leaves every subcommand still\n // calling `process.exit(1)` — which reports a usage error as a finding.\n .exitOverride();\n\n/**\n * Parse a numeric CLI option, refusing what the config schema refuses.\n *\n * `Number.parseFloat`/`parseInt` return NaN for `abc` and silently accept\n * out-of-range values, and NaN then disables whatever gate it feeds — a cost\n * cap that never fires, a confidence gate that writes everything, a `--top`\n * that asks for a negative number of rows. The documented precedence is\n * config → Ajv → CLI override, so the override has to be held to the same range.\n */\nfunction numericOption(\n flag: string,\n { min, max, integer }: { min: number; max?: number; integer?: boolean },\n) {\n return (raw: string): number => {\n const value = Number.parseFloat(raw);\n if (!Number.isFinite(value)) {\n throw new GraphError(`${flag} expects a number, got \"${raw}\".`);\n }\n if (integer && !Number.isInteger(value)) {\n throw new GraphError(`${flag} expects a whole number, got ${value}.`);\n }\n if (value < min || (max !== undefined && value > max)) {\n const range = max === undefined ? `>= ${min}` : `${min}..${max}`;\n throw new GraphError(`${flag} must be ${range}, got ${value}.`);\n }\n return value;\n };\n}\n\n/** A count: a whole number, at least `min` (1 unless the flag allows zero). */\nfunction countOption(flag: string, min = 1) {\n return numericOption(flag, { min, integer: true });\n}\n\n/**\n * Hold a CLI override to the same list its config key is held to.\n *\n * `fill.provider` is Ajv-validated against the schema enum; the `--provider`\n * override was an arbitrary string cast straight to `ProviderName`, so the\n * documented config → Ajv → CLI precedence had a hole at the last step.\n */\nfunction enumOption<T extends string>(flag: string, allowed: readonly T[]) {\n return (raw: string): T => {\n if (!(allowed as readonly string[]).includes(raw)) {\n throw new GraphError(\n `${flag} must be one of ${allowed.join(\" | \")}, got \"${raw}\".`,\n );\n }\n return raw as T;\n };\n}\n\n/**\n * A flag whose value is one of a named set, refused in the family's words:\n * `Unknown --format \"xml\". Use pretty | json.` The check runs while the\n * options are parsed, so a typo costs a message rather than a graph load.\n */\nfunction choiceOption<T extends string>(flag: string, allowed: readonly T[]) {\n return (raw: string): T => {\n if (!(allowed as readonly string[]).includes(raw)) {\n throw new GraphError(`Unknown ${flag} \"${raw}\". Use ${allowed.join(\" | \")}.`);\n }\n return raw as T;\n };\n}\n\n/** `-f, --format`: every verb's list is `pretty | json` (0051 §2). */\nconst formatOption = choiceOption(\"--format\", GRAPH_FORMATS);\n\n/** `check`'s own, which adds `github` — the CI gate's annotation format. */\nconst checkFormatOption = choiceOption(\"--format\", CHECK_FORMATS);\n\n/**\n * `--fields <list>`: comma-separated and given once, never repeatable — one\n * separator per list (proposal 0034), and the spelling `meta fill --fields`\n * already uses. Each value is held to the same list `fill.fields` is.\n */\nconst fieldsOption = (raw: string): FillField[] =>\n splitList(raw).map((value) => enumOption(\"--fields\", ALL_FILL_FIELDS)(value));\n\n/**\n * The document-set surface the verbs that read documents share (proposals\n * 0041 and 0051 §1): positional `[paths...]` with `-` for stdin,\n * `--collection` and `--exclude` (each one value per occurrence), `--as`,\n * `--ext` (comma-separated, given once), `--allow-empty`, and\n * `-c`/`--no-config`. Declared once so the verbs cannot drift apart on a name\n * or a description, and worded as `meta` and `lint` word them.\n */\nfunction documentInputs(command: Command, verb: string): Command {\n return command\n .argument(\n \"[paths...]\",\n `files, directories, or globs to ${verb} (use - for stdin)`,\n )\n .option(\n \"--collection <name>\",\n \"Configured collection to read (repeatable)\",\n collect,\n [],\n )\n .option(\"--exclude <glob>\", \"Glob to exclude (repeatable)\", collect, [])\n .option(\n \"--as <format>\",\n \"Parse every input as asciidoc, html, markdown, mdx, rst or xml, whatever its extension. Required with -.\",\n )\n .option(\n \"--ext <list>\",\n \"comma-separated extensions for directory walks\",\n DEFAULT_EXTENSIONS.join(\",\"),\n )\n .option(\"--allow-empty\", \"treat zero matched files as success\")\n .option(\"-c, --config <path>\", \"Path to manni.config.yaml\")\n .option(\"--no-config\", \"Ignore any discovered config file\");\n}\n\n/** The input flags as commander hands them over. */\ninterface InputFlags {\n as?: string;\n ext: string;\n allowEmpty?: boolean;\n}\n\n/**\n * The input flags for a core, and stdin when `paths` holds `-`. `--as` is\n * checked first, so `-` without it is refused before anything waits on stdin.\n */\nasync function inputOptions(\n paths: string[],\n opts: InputFlags,\n): Promise<{\n as?: string;\n ext: string[];\n allowEmpty?: boolean;\n stdinContent?: string;\n}> {\n assertInputFormat(paths, opts.as);\n return {\n ...(opts.as === undefined ? {} : { as: opts.as }),\n ext: splitList(opts.ext),\n ...(opts.allowEmpty === true ? { allowEmpty: true } : {}),\n ...(paths.includes(STDIN) ? { stdinContent: await readStdin() } : {}),\n };\n}\n\n/**\n * `-c`/`--no-config` for a verb that reads a built graph rather than a\n * document set. They share one commander attribute, which `configOption`\n * splits.\n */\nfunction configInputs(command: Command): Command {\n return command\n .option(\"-c, --config <path>\", \"Path to manni.config.yaml\")\n .option(\"--no-config\", \"Ignore any discovered config file\");\n}\n\n/**\n * `opts` minus the one attribute `-c` and `--no-config` share. `documentOptions`\n * restates it as the two fields a core reads, and spreading the raw value over\n * them would put commander's `false` back where a path belongs.\n */\nfunction rest<T extends { config?: string | boolean }>(\n opts: T,\n): Omit<T, \"config\"> {\n const { config, ...others } = opts;\n return others;\n}\n\n/** The shared options as the command cores take them. */\nfunction documentOptions(opts: {\n collection?: string[];\n exclude?: string[];\n config?: string | boolean;\n}): {\n config?: string;\n noConfig?: boolean;\n collection?: string[];\n exclude?: string[];\n} {\n const { configPath, noConfig } = configOption(opts.config);\n return {\n ...(configPath === undefined ? {} : { config: configPath }),\n ...(noConfig === true ? { noConfig } : {}),\n ...(opts.collection === undefined ? {} : { collection: opts.collection }),\n ...(opts.exclude === undefined ? {} : { exclude: opts.exclude }),\n };\n}\n\nprogram\n .command(\"init\")\n .description(\"Add a starter `graph:` section to manni.config.yaml in the current directory\")\n .action(async () => {\n try {\n console.log(`Created ${await runInit()}`);\n } catch (e) {\n fail(e);\n }\n });\n\ndocumentInputs(\n program\n .command(\"build\")\n .description(\"Derive the knowledge graph and write deterministic Turtle\"),\n \"build\",\n)\n .option(\"-o, --out <path>\", \"Output .ttl path (default: config out)\")\n .action(async (paths: string[], opts: InputFlags & {\n config?: string | boolean;\n collection?: string[];\n exclude?: string[];\n out?: string;\n }) => {\n try {\n const result = await runBuild({\n paths,\n ...documentOptions(opts),\n ...(await inputOptions(paths, opts)),\n out: opts.out,\n });\n // Warnings go to stderr so stdout stays the machine-readable summary;\n // a degraded build is still a successful one, so the exit code is 0.\n for (const warning of result.warnings) warn(warning);\n const { total, fromTermbase } = result.concepts;\n const termbase = fromTermbase > 0 ? ` (${fromTermbase} from the termbase)` : \"\";\n console.log(\n `Wrote ${result.outPath} (${result.docs} docs, ${result.quads} triples, ${total} concepts${termbase})`,\n );\n } catch (e) {\n fail(e);\n }\n });\n\nconfigInputs(\n program\n .command(\"check\")\n .description(\n \"Validate the built graph against the bundled SHACL shapes (errors exit 1)\",\n ),\n)\n .option(\"-g, --graph <path>\", \"Graph .ttl path (default: config out)\")\n // One path per occurrence, never split on commas: a path may hold one.\n .option(\n \"--shapes <path>\",\n \"Shapes .ttl file; repeatable (default: config check.shapes, then bundled)\",\n collect,\n [],\n )\n .option(\n \"-f, --format <format>\",\n `Output: ${CHECK_FORMAT_LIST}`,\n checkFormatOption,\n \"pretty\",\n )\n .action(\n async (opts: {\n config?: string | boolean;\n graph?: string;\n shapes: string[];\n format: CheckFormat;\n }) => {\n try {\n const report = await runCheck({ ...rest(opts), ...documentOptions(opts) });\n console.log(renderCheck(report, opts.format));\n process.exitCode = report.exitCode;\n } catch (e) {\n fail(e);\n }\n },\n );\n\ndocumentInputs(\n program\n .command(\"fill\")\n .description(\n \"Propose `graph:` fields and sample questions with an LLM, gated by confidence, and write them back\",\n ),\n \"fill\",\n)\n .option(\n \"-f, --format <format>\",\n `Output: ${GRAPH_FORMAT_LIST}`,\n formatOption,\n \"pretty\",\n )\n .option(\"--dry-run\", \"Report proposals without writing files\")\n .option(\"--force\", \"Overwrite human-set graph fields\")\n .option(\"--no-cache\", \"Bypass the proposal cache\")\n .option(\"--no-validate-graph\", \"Skip the SHACL graph guardrail on proposals\")\n .option(\"--sections\", \"Also propose per-section metadata\")\n .option(\n \"--max-turns <n>\",\n \"Stop after this many inference calls (a cached page costs none)\",\n countOption(\"--max-turns\"),\n )\n .option(\n \"--confidence <n>\",\n \"Minimum model confidence (0..1) to write a field (default: config, 0.7)\",\n numericOption(\"--confidence\", { min: 0, max: 1 }),\n )\n .option(\n // Comma-separated and given once: one separator per list (proposal 0034).\n \"--fields <list>\",\n `Fields to propose (comma-separated; default: config, then every field)`,\n fieldsOption,\n )\n // The nameable providers, and `auto`. `mock` is the library's test double:\n // accepted when asked for by name, never offered.\n .option(\n \"--provider <name>\",\n \"Provider: auto (default) | anthropic | openai | claude-cli | llama-cpp\",\n )\n .option(\"--model <model>\", \"Model override; needs a named provider, from here or config\")\n .option(\"--local\", LOCAL_FLAG_HELP)\n .option(\n \"--offline\",\n \"no network egress: only a model already downloaded, never a remote provider\",\n )\n .option(\n \"--chunk-chars <n>\",\n \"characters of page per question request (default: config, then 12000)\",\n countOption(\"--chunk-chars\"),\n )\n // Typed inline, as every other action in this file is. The option parsers\n // above (`numericOption`, `choiceOption`, `fieldsOption`) have already thrown\n // on anything malformed by the time this runs, so a cast per field would be\n // safe — but it would also be the one command with the most options and the\n // least help from the compiler.\n .action(async (paths: string[], opts: InputFlags & {\n config?: string | boolean;\n collection?: string[];\n exclude?: string[];\n dryRun?: boolean;\n force?: boolean;\n cache?: boolean;\n validateGraph?: boolean;\n sections?: boolean;\n maxTurns?: number;\n confidence?: number;\n fields?: FillField[];\n provider?: string;\n model?: string;\n local?: boolean;\n offline?: boolean;\n chunkChars?: number;\n format: GraphFormat;\n }) => {\n try {\n const report = await runFill({\n paths,\n ...documentOptions(opts),\n ...(await inputOptions(paths, opts)),\n dryRun: opts.dryRun,\n force: opts.force,\n noCache: opts.cache === false,\n noValidateGraph: opts.validateGraph === false,\n sections: opts.sections,\n maxTurns: opts.maxTurns,\n confidence: opts.confidence,\n fields: opts.fields,\n provider: opts.provider,\n model: opts.model,\n local: opts.local,\n offline: opts.offline,\n chunkChars: opts.chunkChars,\n });\n // Same channel discipline as build: warnings on stderr, so stdout stays\n // the report, and a warning never changes the exit code.\n for (const warning of report.warnings) warn(warning);\n const rendered = renderFill(report, opts.format);\n if (paths.includes(STDIN)) {\n // With `-` the filled document owns stdout, as under `meta fill -`,\n // and the report in either format is a diagnostic on stderr.\n if (report.stdinDocument !== undefined) {\n process.stdout.write(report.stdinDocument);\n }\n if (rendered.length > 0) process.stderr.write(`${rendered}\\n`);\n } else {\n console.log(rendered);\n }\n process.exitCode = report.exitCode;\n } catch (e) {\n fail(e);\n }\n });\n\nprogram\n .command(\"query\")\n .description(\n \"Match triple patterns against the built graph (omit a term for wildcard)\",\n )\n // Long-only, and named for the triple position each one fills. `-o` is\n // `--out` on every other graph verb and `-s` is meta's schema flag; a\n // one-letter spelling that means two things in one family costs more than\n // the letters it saves.\n .option(\"--subject <term>\", \"Subject IRI or prefixed name\")\n .option(\"--predicate <term>\", \"Predicate IRI or prefixed name\")\n .option(\"--object <term>\", \"Object IRI, prefixed name, or literal value\")\n .option(\"-c, --config <path>\", \"Path to manni.config.yaml\")\n .option(\"--no-config\", \"Ignore any discovered config file\")\n .option(\"-g, --graph <path>\", \"Graph .ttl path (default: config out)\")\n .option(\n \"-f, --format <format>\",\n `Output: ${GRAPH_FORMAT_LIST}`,\n formatOption,\n \"pretty\",\n )\n .action(\n (opts: {\n subject?: string;\n predicate?: string;\n object?: string;\n config?: string | boolean;\n graph?: string;\n format: GraphFormat;\n }) => {\n try {\n const { subject, predicate, object, ...others } = rest(opts);\n const result = runQuery({\n ...others,\n ...documentOptions(opts),\n ...(subject === undefined ? {} : { s: subject }),\n ...(predicate === undefined ? {} : { p: predicate }),\n ...(object === undefined ? {} : { o: object }),\n });\n console.log(renderQuery(result, opts.format));\n } catch (e) {\n fail(e);\n }\n },\n );\n\nprogram\n .command(\"stats\")\n .description(\n \"Summarize the built graph: counts, orphans, broken links, hubs, metadata coverage\",\n )\n .option(\"-c, --config <path>\", \"Path to manni.config.yaml\")\n .option(\"--no-config\", \"Ignore any discovered config file\")\n .option(\"-g, --graph <path>\", \"Graph .ttl path (default: config out)\")\n .option(\n \"-f, --format <format>\",\n `Output: ${GRAPH_FORMAT_LIST}`,\n formatOption,\n \"pretty\",\n )\n .option(\n \"--check\",\n \"Exit 1 when broken internal links exist or coverage is below threshold\",\n )\n .option(\n \"--top <n>\",\n \"How many most-connected docs to list\",\n countOption(\"--top\"),\n )\n .option(\n \"--coverage-threshold <pct>\",\n \"Minimum metadata coverage % (all fields); overrides config for this run\",\n // A percentage, so 0..100 rather than the 0..1 of a confidence. NaN here is\n // worse than a wrong number: `pct < NaN` is false for every field, so the\n // gate this flag exists to tighten would silently pass instead.\n numericOption(\"--coverage-threshold\", { min: 0, max: 100 }),\n )\n .action(\n (opts: {\n config?: string | boolean;\n graph?: string;\n format: GraphFormat;\n check?: boolean;\n top?: number;\n coverageThreshold?: number;\n }) => {\n try {\n const report = runStats({ ...rest(opts), ...documentOptions(opts) });\n console.log(renderStats(report, opts.format));\n process.exitCode = report.exitCode;\n } catch (e) {\n fail(e);\n }\n },\n );\n\nprogram\n .command(\"search\")\n .description(\"Rank graph nodes for a text query (needs `export search`)\")\n .argument(\"<query>\", \"Text query\")\n .option(\"-c, --config <path>\", \"Path to manni.config.yaml\")\n .option(\"--no-config\", \"Ignore any discovered config file\")\n .option(\"-g, --graph <path>\", \"Graph .ttl path (default: config out)\")\n .option(\n \"-i, --index <dir>\",\n \"Directory holding the indexes and manifest (default: beside the graph)\",\n )\n .option(\n \"--lang <tag>\",\n \"Which localization to search (required when the corpus has more than one)\",\n )\n .option(\"--limit <n>\", \"Maximum results (default 10)\", countOption(\"--limit\"))\n .option(\n \"--vectors <path>\",\n \"Vector sidecar path (default: from the manifest)\",\n )\n .option(\n \"--mode <mode>\",\n `Which legs to run: ${SEARCH_MODES.join(\" | \")} (default: hybrid when vectors exist)`,\n choiceOption(\"--mode\", SEARCH_MODES),\n )\n .option(\n \"-f, --format <format>\",\n `Output: ${GRAPH_FORMAT_LIST}`,\n formatOption,\n \"pretty\",\n )\n .action(\n async (\n query: string,\n opts: {\n config?: string | boolean;\n graph?: string;\n index?: string;\n lang?: string;\n limit?: number;\n vectors?: string;\n mode?: SearchMode;\n format: GraphFormat;\n },\n ) => {\n try {\n const report = await runSearch({\n ...rest(opts),\n ...documentOptions(opts),\n query,\n });\n console.log(renderSearch(report, opts.format));\n } catch (e) {\n fail(e);\n }\n },\n );\n\nprogram\n .command(\"traverse\")\n .description(\n \"Walk the graph from a node, honoring scope rules, with the full trace\",\n )\n .argument(\"<node>\", \"Starting node: a full IRI or a prefix:local CURIE\")\n .option(\"-c, --config <path>\", \"Path to manni.config.yaml\")\n .option(\"--no-config\", \"Ignore any discovered config file\")\n .option(\"-g, --graph <path>\", \"Graph .ttl path (default: config out)\")\n .option(\n \"-d, --depth <n>\",\n \"Maximum hops from the node (default 1; 3 under --impact)\",\n // Zero is allowed: it means the node itself, which is a real answer.\n countOption(\"--depth\", 0),\n )\n // Comma-separated and given once: a CURIE holds no comma, so one separator\n // is enough, and a second spelling would be a second thing to document.\n .option(\n \"--predicates <list>\",\n \"Only follow these predicates (comma-separated)\",\n )\n .option(\"--reverse\", \"Follow inbound edges (who points at this node)\")\n .option(\"--impact\", \"Transitive inbound reach: what a change here affects\")\n .option(\n \"--variant <variant>\",\n \"Scope filter: product variant IRI, title, or slug\",\n )\n // Not `--subject`: on `query` that is a triple's subject, and one flag name\n // means one thing across the domain.\n .option(\"--software-subject <subject>\", \"Scope filter: software subject\")\n .option(\"--lang <tag>\", \"Scope filter: BCP-47 language tag, matched in any case\")\n .option(\"--limit <n>\", \"Stop after this many nodes\", countOption(\"--limit\"))\n .option(\n \"-f, --format <format>\",\n `Output: ${GRAPH_FORMAT_LIST}`,\n formatOption,\n \"pretty\",\n )\n .action(\n (\n node: string,\n opts: {\n config?: string | boolean;\n graph?: string;\n depth?: number;\n predicates?: string;\n reverse?: boolean;\n impact?: boolean;\n variant?: string;\n softwareSubject?: string;\n lang?: string;\n limit?: number;\n format: GraphFormat;\n },\n ) => {\n try {\n const { softwareSubject, ...others } = rest(opts);\n const report = runTraverse({\n ...others,\n ...documentOptions(opts),\n ...(softwareSubject === undefined ? {} : { subject: softwareSubject }),\n node,\n predicates:\n opts.predicates === undefined\n ? undefined\n : splitList(opts.predicates),\n });\n console.log(renderTraverse(report, opts.format));\n } catch (e) {\n fail(e);\n }\n },\n );\n\nprogram\n .command(\"embed\")\n .description(\n \"Compute local embeddings for the search index (needs @huggingface/transformers)\",\n )\n .option(\"-c, --config <path>\", \"Path to manni.config.yaml\")\n .option(\"--no-config\", \"Ignore any discovered config file\")\n .option(\"-g, --graph <path>\", \"Graph .ttl path (default: config out)\")\n .option(\n \"-i, --index <dir>\",\n \"Directory holding the indexes and manifest (default: beside the graph)\",\n )\n .option(\n \"-o, --out <dir>\",\n \"Directory for the sidecars (default: the index directory)\",\n )\n // Not `--model`: on `fill` that is the inference model, a different thing.\n .option(\n \"--embedding-model <id>\",\n \"Embedding model id (any id; `mock` for offline runs)\",\n )\n .option(\"--dtype <dtype>\", \"Weight quantization (default q8)\")\n .option(\"--no-cache\", \"Ignore the vector cache\")\n .option(\n \"-f, --format <format>\",\n `Output: ${GRAPH_FORMAT_LIST}`,\n formatOption,\n \"pretty\",\n )\n .action(\n async (opts: {\n config?: string | boolean;\n graph?: string;\n index?: string;\n out?: string;\n embeddingModel?: string;\n dtype?: string;\n cache?: boolean;\n format: GraphFormat;\n }) => {\n try {\n const { embeddingModel, ...others } = rest(opts);\n const report = await runEmbed({\n ...others,\n ...documentOptions(opts),\n ...(embeddingModel === undefined ? {} : { model: embeddingModel }),\n noCache: opts.cache === false,\n });\n console.log(renderEmbed(report, opts.format));\n } catch (e) {\n fail(e);\n }\n },\n );\n\nprogram\n .command(\"export\")\n .description(\n \"Reserialize the built graph into a consumer format (jsonld file, iirds package, search index, or question set)\",\n )\n // The target is a positional, not `-f`: `-f` is the output format in every\n // other verb of the family (0051 §2), and one flag cannot mean two things.\n .argument(\"<target>\", `What to write: ${EXPORT_TARGETS.join(\" | \")}`)\n .option(\"-c, --config <path>\", \"Path to manni.config.yaml\")\n .option(\"--no-config\", \"Ignore any discovered config file\")\n .option(\"-g, --graph <path>\", \"Graph .ttl path (default: config out)\")\n .option(\n \"-o, --out <path>\",\n \"Output path (default: the graph path with the target's extension)\",\n )\n .action(\n async (\n target: string,\n opts: { config?: string | boolean; graph?: string; out?: string },\n ) => {\n try {\n if (!(EXPORT_TARGETS as readonly string[]).includes(target)) {\n throw new GraphError(\n `Unknown export target \"${target}\". Use ${EXPORT_TARGETS.join(\" | \")}.`,\n );\n }\n const result = await runExport({\n ...documentOptions(opts),\n graph: opts.graph,\n format: target as ExportFormat,\n out: opts.out,\n });\n for (const warning of result.warnings) warn(warning);\n const noun = result.format === \"questions\" ? \"question\" : \"node\";\n console.log(\n `Wrote ${result.nodes} ${noun}${result.nodes === 1 ? \"\" : \"s\"} to ${result.outPath}`,\n );\n } catch (e) {\n fail(e);\n }\n },\n );\n\nreturn program;\n}\n","/**\n * What `-f` accepts, per verb.\n *\n * Each verb's renderer lives beside its command core (`renderCheck`,\n * `renderStats`, …); what belongs here is the *list*, stated once so the\n * union, the guard, the help text and the refusal sentence cannot drift\n * apart. It is the same shape a11y and cite keep (`A11Y_FORMATS`,\n * `REPORT_FORMATS`), which is why the sentence a user reads is the family's.\n *\n * Every verb takes `pretty | json`. `check` also takes `github`, because it is\n * the CI gate: it is the one graph verb whose output changes what a reviewer sees\n * on a pull request (proposal 0051 §2). It names its own list here rather than\n * widening the shared one, so no other verb advertises a format it cannot\n * render.\n */\n\n/** The list every graph verb's `-f` accepts, in the order messages list them. */\nexport const GRAPH_FORMATS = [\"pretty\", \"json\"] as const;\nexport type GraphFormat = (typeof GRAPH_FORMATS)[number];\n\n/** `\"pretty | json\"`, for help text and the refusal sentence. */\nexport const GRAPH_FORMAT_LIST: string = GRAPH_FORMATS.join(\" | \");\n\n/** `check`'s list: the shared two plus the CI annotation format. */\nexport const CHECK_FORMATS = [...GRAPH_FORMATS, \"github\"] as const;\nexport type CheckFormat = (typeof CHECK_FORMATS)[number];\n\n/** `\"pretty | json | github\"`, for help text and the refusal sentence. */\nexport const CHECK_FORMAT_LIST: string = CHECK_FORMATS.join(\" | \");\n","/**\n * `manni graph init` — scaffold a starter `graph:` section in manni.config.yaml.\n *\n * The family file is shared with the other tools, so a file that already\n * exists is not overwritten: the section is appended to it, leaving the\n * siblings' keys and comments exactly as they were. A file that already has a\n * `graph:` key is refused.\n */\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport { parse as parseYaml } from \"yaml\";\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { writeTextAtomic } from \"../../shared/write-file.js\";\nimport { GraphError } from \"../types.js\";\nimport { CONFIG_SECTION, DEFAULT_CONFIG_FILENAME } from \"../core/config.js\";\n\nconst HEADER = `# manni.config.yaml — shared configuration for the manni family of tools.\n# Each tool reads its own top-level key; manni graph reads \"graph:\".\n`;\n\nconst STARTER = `# Base IRI for every minted node. Set this to a namespace you control;\n# without it, IRIs fall back to the urn:manni:graph: placeholder.\n# baseIri: https://example.com/graph/\n\n# There is no document set here. \\`manni graph build\\` and \\`manni graph fill\\` read the\n# paths you name, or the collections declared once for every tool at the TOP\n# level of this file, beside \\`graph:\\` rather than inside it:\n#\n# collections:\n# - name: site\n# paths: [\"docs/**/*.md\"]\n#\n# Output of \\`manni graph build\\`.\nout: graph/graph.ttl\n\n# Map published-site routes back to source files so route-style links\n# (/docs/actions/find) become graph edges. A route may also carry the BCP-47\n# \\`language\\` labelling every document under its root; a page's own \\`lang\\`\n# frontmatter wins. Uncomment and adjust:\n# routes:\n# - basePath: /docs\n# root: docs\n# extensions: [.md, .mdx, .markdown]\n# indexFiles: [index, README]\n# - basePath: /docs/de\n# root: docs/de\n# language: de\n\n# What to derive triples from. Remove entries to opt out.\nbuild:\n derive: [frontmatter, sections, links, tags, images, code, provenance, terms]\n\n# PROV-O settings. Git history is detected, not switched: per-file dates and\n# author agents, rename -> prov:wasRevisionOf, and the build activity's HEAD\n# committer date are derived wherever git can run over a repository, and a run\n# that cannot says so once and builds the rest. Deterministic per commit;\n# wall-clock time never enters the graph.\n# qualified: emit prov:qualifiedAttribution/qualifiedAssociation nodes\n# with roles alongside the direct properties.\nprovenance:\n qualified: true\n\n# Which fields a published graph may carry is read from x-manni-graph-output in\n# the schema set \\`manni meta validate\\` resolves for each page. Set that under\n# meta: (schemas, strict, register), not here. The default set keeps the\n# stewardship people fields (owner, stakeholders, reviewed-by) out.\n\n# SHACL shapes \\`manni graph check\\` validates the built graph against. Default:\n# the shapes contract bundled with manni (shapes/graph/shapes-1.1.0.ttl).\n# check:\n# shapes: [\"./my-shapes.ttl\"]\n\n# Metadata coverage gate for \\`manni graph stats --check\\`. A number applies to\n# every measured field; a map gates named fields only. Unset gates nothing.\n# stats:\n# coverageThreshold:\n# title: 100\n# description: 50\n\n# Which provider \\`manni graph fill\\` sends pages to. Unset, the family's\n# top-level providers: map decides, and then \\`auto\\`, which detects one: an\n# Anthropic key, then an OpenAI key, then the Claude CLI, then a local model.\n# Connection settings (apiKeyEnv, baseUrl, command) live in that map, declared\n# once for every manni tool. \\`--provider\\` wins over this, \\`--local\\` over both.\n# provider: anthropic # auto | anthropic | openai | claude-cli | llama-cpp\n# model: claude-sonnet-4-5 # the provider's default when omitted\n\n# LLM settings for \\`manni graph fill\\` (SKOS frontmatter proposals and sample questions).\nfill:\n temperature: 0\n # Stop after this many inference calls. One page is one turn, and a cached\n # page spends none. Unset is unbounded.\n # maxTurns: 50\n cacheDir: .manni/graph/cache\n # fill proposes every field; confidence (0..1 per field) gates what is\n # written. Fields scored below the threshold are reported, not written.\n confidenceThreshold: 0.7\n # fields: defaults to every fillable field — uncomment to restrict.\n # Record meta-provenance (model + /graph/ pointers + confidence) on filled docs.\n writeProvenance: true\n # Reject proposals that would violate the SHACL shapes contract\n # (broader/narrower cycles, conflicting labels).\n validateGraph: true\n # Also propose per-section metadata. Off by default: it costs more output per\n # call, and section metadata is explicit-only, so review it as carefully.\n sections: false\n # Sample questions: draft until a page has perPage, each pinned to the lines\n # that answer it. A question request sends at most chunkChars of a page.\n questions:\n perPage: 3\n chunkChars: 12000\n # Send nothing off this machine: only a local model already downloaded.\n offline: false\n\n# Local embeddings for semantic search (\\`manni graph embed\\`). Needs the optional\n# peer: npm install @huggingface/transformers\n# embed:\n# model: onnx-community/granite-embedding-small-english-r2-ONNX\n# dtype: q8 # q8 keeps embedding reproducible across platforms\n# out: graph # directory for the per-language vector sidecars\n# cacheDir: .manni/graph/embed-cache\n\n# Optional enrichment for \\`manni graph export iirds\\` (the iiRDS package).\n# Absent, a minimal valid package is still produced.\n# export:\n# iirds:\n# title: My Docs # package title (default: \"manni graph export\")\n# creator: Acme Corp # Creator iirds:Party + vcard:Organization\n# version: \"1.3\" # iiRDS version literal: \"1.2\" | \"1.3\"\n`;\n\n/** The starter as a `graph:` section: every line nested one level. */\nfunction starterSection(): string {\n const body = STARTER.split(\"\\n\")\n .map((line) => (line === \"\" ? \"\" : ` ${line}`))\n .join(\"\\n\");\n return `${CONFIG_SECTION}:\\n${body}`;\n}\n\nexport async function runInit(cwd = process.cwd()): Promise<string> {\n const path = resolve(cwd, DEFAULT_CONFIG_FILENAME);\n if (!existsSync(path)) {\n await writeTextAtomic(path, `${HEADER}${starterSection()}`);\n return path;\n }\n\n // A family file is already here. Parse it to make sure a `graph:` key can be\n // appended: the document must be a mapping (or empty) without one.\n const text = readFileSync(path, \"utf8\");\n let doc: unknown;\n try {\n doc = parseYaml(text);\n } catch (e) {\n throw new GraphError(\n `Invalid YAML in ${DEFAULT_CONFIG_FILENAME}: ${errorMessage(e)}`,\n );\n }\n if (doc != null && (typeof doc !== \"object\" || Array.isArray(doc))) {\n throw new GraphError(\n `${DEFAULT_CONFIG_FILENAME}: top level must be a mapping — not adding a \\`${CONFIG_SECTION}:\\` section to it.`,\n );\n }\n if (doc != null && Object.hasOwn(doc, CONFIG_SECTION)) {\n throw new GraphError(\n `${DEFAULT_CONFIG_FILENAME} already has a \\`${CONFIG_SECTION}:\\` section — not overwriting.`,\n );\n }\n // Append as text rather than re-serialising the document, so the siblings'\n // keys and comments come out byte-for-byte as they went in.\n const separator = text === \"\" || text.endsWith(\"\\n\") ? \"\" : \"\\n\";\n const blank = text === \"\" ? \"\" : \"\\n\";\n await writeTextAtomic(\n path,\n `${text}${separator}${blank}${starterSection()}`,\n );\n return path;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,SAAS,eAAe;;;ACMjB,IAAM,gBAAgB,CAAC,UAAU,MAAM;AAIvC,IAAM,oBAA4B,cAAc,KAAK,KAAK;AAG1D,IAAM,gBAAgB,CAAC,GAAG,eAAe,QAAQ;AAIjD,IAAM,oBAA4B,cAAc,KAAK,KAAK;;;ACpBjE,SAAS,YAAY,oBAAoB;AACzC,SAAS,eAAe;AACxB,SAAS,SAAS,iBAAiB;AAMnC,IAAM,SAAS;AAAA;AAAA;AAIf,IAAM,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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