@hawkeyexl/manni 4.30.0 → 4.31.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 (244) hide show
  1. package/README.md +1 -1
  2. package/dist/{batch-23GVYKFP.js → batch-P6LTMOZP.js} +12 -12
  3. package/dist/{build-CRK3HT5F.js → build-V5JPMFTR.js} +14 -14
  4. package/dist/{calibrate-2RFP3QX2.js → calibrate-YS4NLIC3.js} +13 -13
  5. package/dist/{capture-267IEE6B.js → capture-YQDJSSKZ.js} +12 -12
  6. package/dist/check-DVMU74U3.js +58 -0
  7. package/dist/{check-2HIBGMXD.js → check-FVL7G5PJ.js} +13 -13
  8. package/dist/{check-5QX33J6O.js → check-OWGSBBU7.js} +13 -13
  9. package/dist/{check-6FCVYM62.js → check-QAVEMKP2.js} +10 -10
  10. package/dist/{check-VKQ6GM5D.js → check-TUP4RG7G.js} +23 -23
  11. package/dist/{chunk-5MKSZSXH.js → chunk-2KGDXZMS.js} +3 -3
  12. package/dist/{chunk-K5VWSQ4K.js → chunk-2NB7MT5I.js} +2 -2
  13. package/dist/{chunk-5DER6O26.js → chunk-3WX73ME2.js} +3 -3
  14. package/dist/{chunk-TU7T6YRR.js → chunk-4JDOHAHR.js} +6 -6
  15. package/dist/{chunk-VCIC7XJB.js → chunk-66A5PPWF.js} +4 -4
  16. package/dist/{chunk-MWWPADYI.js → chunk-66U7KHZE.js} +5 -5
  17. package/dist/{chunk-ERXM4UF7.js → chunk-672TCM2Q.js} +4 -4
  18. package/dist/{chunk-OZH46DBT.js → chunk-7OMLNFP7.js} +6 -1
  19. package/dist/chunk-7OMLNFP7.js.map +1 -0
  20. package/dist/{chunk-NIXJOL7G.js → chunk-7S6H5UML.js} +2 -2
  21. package/dist/{chunk-VGGIJMDA.js → chunk-7URMU7S5.js} +2 -2
  22. package/dist/{chunk-GBZVXEVE.js → chunk-AD7IRC5T.js} +3 -3
  23. package/dist/{chunk-RKZ2NPO4.js → chunk-AXIYZIHN.js} +4 -4
  24. package/dist/{chunk-GK3F3FIP.js → chunk-AXSCHC34.js} +5 -5
  25. package/dist/{chunk-MYYTLNO5.js → chunk-BBIEWUO6.js} +6 -6
  26. package/dist/{chunk-4YCPB67J.js → chunk-BKLXSWGX.js} +3 -3
  27. package/dist/{chunk-YLWI7FR2.js → chunk-BR6NGHRG.js} +3 -3
  28. package/dist/{chunk-DKV6BVW5.js → chunk-BVQEOF23.js} +3 -3
  29. package/dist/{chunk-U4CWWG2Y.js → chunk-CCBIO2CB.js} +2 -2
  30. package/dist/{chunk-67GJRC62.js → chunk-CEPNSI4V.js} +2 -2
  31. package/dist/{chunk-2FGWZH7A.js → chunk-CY4RNLFN.js} +3 -3
  32. package/dist/{chunk-WMI2RDSG.js → chunk-D2N3SAV6.js} +4 -4
  33. package/dist/{chunk-V52AGLNN.js → chunk-DLIQJJAE.js} +3 -3
  34. package/dist/{chunk-AP3PCNKS.js → chunk-DO5CJVXR.js} +3 -3
  35. package/dist/{chunk-TAGYZJQA.js → chunk-DOXZ3U4O.js} +50 -20
  36. package/dist/chunk-DOXZ3U4O.js.map +1 -0
  37. package/dist/{chunk-77U6NQKQ.js → chunk-DSHAY6YM.js} +3 -3
  38. package/dist/{chunk-LGHJFEEH.js → chunk-EZBWGI25.js} +2 -2
  39. package/dist/{chunk-F76DU7FH.js → chunk-F6FDIOKE.js} +3 -3
  40. package/dist/{chunk-O2STKCTP.js → chunk-FJZZYY7Q.js} +8 -8
  41. package/dist/{chunk-YGUAY67B.js → chunk-GTT7EQEV.js} +2 -2
  42. package/dist/{chunk-3YA6TGWH.js → chunk-GWOVEW53.js} +5 -5
  43. package/dist/{chunk-JG2QWMDX.js → chunk-HVYVIGBP.js} +10 -10
  44. package/dist/{chunk-ZE3BXQED.js → chunk-I52GL7N6.js} +3 -3
  45. package/dist/{chunk-6U3XF5VY.js → chunk-ICUKYSPX.js} +2 -2
  46. package/dist/{chunk-6KNIQ2SK.js → chunk-INDMEKFB.js} +6 -6
  47. package/dist/{chunk-RRAJMTHV.js → chunk-J7OFPDCD.js} +4 -4
  48. package/dist/{chunk-HXILODV5.js → chunk-JVZAJBSS.js} +2 -2
  49. package/dist/{chunk-SXMTWMZZ.js → chunk-KPQFF62T.js} +40 -12
  50. package/dist/chunk-KPQFF62T.js.map +1 -0
  51. package/dist/{chunk-7INXFEI7.js → chunk-KWK6VVK2.js} +7 -7
  52. package/dist/{chunk-7ZRX2OPC.js → chunk-LU6HSA2N.js} +10 -10
  53. package/dist/{chunk-KNMDIR7D.js → chunk-M5HDMQCI.js} +2 -2
  54. package/dist/{chunk-OPF3NOKF.js → chunk-M77SIRUX.js} +1 -1
  55. package/dist/{chunk-OPF3NOKF.js.map → chunk-M77SIRUX.js.map} +1 -1
  56. package/dist/{chunk-UYKRP3M3.js → chunk-MCUN2JP3.js} +3 -3
  57. package/dist/{chunk-OXFNU2IO.js → chunk-MQ34D4OP.js} +4 -4
  58. package/dist/{chunk-UUZJP47H.js → chunk-MREXYXMW.js} +8 -8
  59. package/dist/{chunk-4MD2JG2F.js → chunk-N7VIVL42.js} +2 -2
  60. package/dist/{chunk-SWCFJC7W.js → chunk-NH4RQUSD.js} +3 -3
  61. package/dist/{chunk-4L62A7YB.js → chunk-P676AEK6.js} +4 -4
  62. package/dist/{chunk-QEFVMOWF.js → chunk-QYKTIRRE.js} +2 -2
  63. package/dist/{chunk-3VBEUMKQ.js → chunk-R64PJYCT.js} +2 -2
  64. package/dist/{chunk-KAIJHQR2.js → chunk-SORYKTNP.js} +2 -2
  65. package/dist/{chunk-KAIJHQR2.js.map → chunk-SORYKTNP.js.map} +1 -1
  66. package/dist/{chunk-O632I7AB.js → chunk-SPYYVEWP.js} +8 -8
  67. package/dist/{chunk-CZFP6Q5O.js → chunk-STPT3WEC.js} +7 -7
  68. package/dist/{chunk-5S5DYW7W.js → chunk-TE6SQVNO.js} +8 -8
  69. package/dist/{chunk-7PF47O3H.js → chunk-TX7NPCCT.js} +6 -6
  70. package/dist/{chunk-XZFJAVX7.js → chunk-UH7KFBBM.js} +9 -8
  71. package/dist/chunk-UH7KFBBM.js.map +1 -0
  72. package/dist/{chunk-E6S3VGN6.js → chunk-VKAE3W6H.js} +4 -4
  73. package/dist/{chunk-Z3YNYZR2.js → chunk-VXZ2CIH7.js} +2 -2
  74. package/dist/{chunk-ZI7RMN3H.js → chunk-WX77JHTU.js} +3 -3
  75. package/dist/{chunk-SXNK6FPC.js → chunk-X7UWDGQQ.js} +11 -8
  76. package/dist/chunk-X7UWDGQQ.js.map +1 -0
  77. package/dist/{chunk-7YDGDI26.js → chunk-XIEUUETR.js} +6 -6
  78. package/dist/{chunk-OJZOKTTX.js → chunk-YH6MWLDA.js} +2 -2
  79. package/dist/{chunk-CMJEB5V5.js → chunk-YT55M4VQ.js} +6 -6
  80. package/dist/{chunk-N3J22ZRL.js → chunk-Z7HBBFSZ.js} +578 -28
  81. package/dist/chunk-Z7HBBFSZ.js.map +1 -0
  82. package/dist/{chunk-C5NE3ZIC.js → chunk-ZGLLJSL7.js} +2 -2
  83. package/dist/{chunk-5RCCJ446.js → chunk-ZMFSFXQX.js} +7 -7
  84. package/dist/chunk-ZMFSFXQX.js.map +1 -0
  85. package/dist/{chunk-MBJINPKU.js → chunk-ZY2XP3AS.js} +13 -13
  86. package/dist/{cli-B7QCMRWR.js → cli-5NIVQZIE.js} +31 -31
  87. package/dist/{cli-MT4EPC63.js → cli-7TW4HTQN.js} +14 -14
  88. package/dist/{cli-KUMDTVHH.js → cli-BG6WXYWT.js} +56 -56
  89. package/dist/{cli-2MHUVZH2.js → cli-ME4U7S7Q.js} +28 -28
  90. package/dist/{cli-A5TGO26R.js → cli-NKGQZKXS.js} +34 -34
  91. package/dist/{cli-NKRJ5C4G.js → cli-R5XYFIOY.js} +14 -14
  92. package/dist/{cli-S5CSPYEZ.js → cli-T2AZSUSY.js} +19 -19
  93. package/dist/{cli-NIHSHMIV.js → cli-TA2IQRYK.js} +7 -7
  94. package/dist/{cli-CCUZFOPQ.js → cli-UAM4MBRM.js} +17 -17
  95. package/dist/{cli-GKRMSA26.js → cli-XVJ5G4EO.js} +27 -27
  96. package/dist/{cli-Y4ARUWKJ.js → cli-YKM5YZHY.js} +2 -2
  97. package/dist/cli.js +15 -15
  98. package/dist/docmeta.js +6 -6
  99. package/dist/{github-2PYSX7EK.js → github-SQ2ATTLV.js} +10 -10
  100. package/dist/{github-POT6K5GH.js → github-X6F2FQL3.js} +13 -13
  101. package/dist/github-ZCA7TOJO.js +49 -0
  102. package/dist/index.d.ts +55 -3
  103. package/dist/index.js +57 -55
  104. package/dist/index.js.map +1 -1
  105. package/dist/{json-ZWSUMRI5.js → json-L7QDREEX.js} +10 -10
  106. package/dist/{json-3HPHYGQC.js → json-NSLJFPWD.js} +14 -14
  107. package/dist/{labels-5P4CKGPW.js → labels-C4HCKZMZ.js} +9 -9
  108. package/dist/{lint-K7R4WNMG.js → lint-ODALAI2I.js} +12 -12
  109. package/dist/list-4JLKJOGX.js +56 -0
  110. package/dist/{list-HOTRWPC7.js → list-CAE7T5HA.js} +10 -10
  111. package/dist/{list-3C7Q6VMU.js → list-TQK3FWC2.js} +13 -13
  112. package/dist/{page-6U3CEGTB.js → page-GB5LHRHX.js} +9 -9
  113. package/dist/{prepare-PZVX2VVT.js → prepare-VCJRE3EY.js} +11 -11
  114. package/dist/{pretty-ODBO2IIJ.js → pretty-GP4R3UII.js} +10 -10
  115. package/dist/{pretty-53N5ZMM3.js → pretty-GXLKMUT4.js} +13 -13
  116. package/dist/{pretty-ENVCHUYG.js → pretty-KZPED6KN.js} +23 -23
  117. package/dist/{reporters-3GE5FK5L.js → reporters-GGP4YLIM.js} +11 -11
  118. package/dist/{reporters-FWSJ3O4V.js → reporters-GQ2PUWQA.js} +4 -4
  119. package/dist/{reporters-MK62LRGW.js → reporters-Y2AUVODK.js} +4 -4
  120. package/dist/run-SVH32CBO.js +59 -0
  121. package/dist/sarif-CFQJ5HHP.js +50 -0
  122. package/dist/{sarif-2L4MLVF5.js → sarif-UG7F3WQD.js} +8 -8
  123. package/dist/{sarif-IFFO37SO.js → sarif-UHZD2CJ3.js} +8 -8
  124. package/dist/{strategy-BCRB4A55.js → strategy-Y4NEJRSH.js} +20 -20
  125. package/dist/{term-HPRQBB2A.js → term-LQ2F5WEN.js} +15 -15
  126. package/dist/{types-GV2THIRC.js → types-YREQ2DQG.js} +6 -4
  127. package/dist/{validate-TEYFOGI5.js → validate-6WBRKEV5.js} +4 -4
  128. package/package.json +1 -1
  129. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  130. package/dist/check-MYUFZGKO.js +0 -58
  131. package/dist/chunk-5RCCJ446.js.map +0 -1
  132. package/dist/chunk-N3J22ZRL.js.map +0 -1
  133. package/dist/chunk-OZH46DBT.js.map +0 -1
  134. package/dist/chunk-SXMTWMZZ.js.map +0 -1
  135. package/dist/chunk-SXNK6FPC.js.map +0 -1
  136. package/dist/chunk-TAGYZJQA.js.map +0 -1
  137. package/dist/chunk-XZFJAVX7.js.map +0 -1
  138. package/dist/github-M4QRPNXT.js +0 -49
  139. package/dist/list-O7IREFT2.js +0 -56
  140. package/dist/run-GUHRZ3OX.js +0 -59
  141. package/dist/sarif-2BGXPVSR.js +0 -50
  142. /package/dist/{batch-23GVYKFP.js.map → batch-P6LTMOZP.js.map} +0 -0
  143. /package/dist/{build-CRK3HT5F.js.map → build-V5JPMFTR.js.map} +0 -0
  144. /package/dist/{calibrate-2RFP3QX2.js.map → calibrate-YS4NLIC3.js.map} +0 -0
  145. /package/dist/{capture-267IEE6B.js.map → capture-YQDJSSKZ.js.map} +0 -0
  146. /package/dist/{check-2HIBGMXD.js.map → check-DVMU74U3.js.map} +0 -0
  147. /package/dist/{check-6FCVYM62.js.map → check-FVL7G5PJ.js.map} +0 -0
  148. /package/dist/{check-5QX33J6O.js.map → check-OWGSBBU7.js.map} +0 -0
  149. /package/dist/{check-MYUFZGKO.js.map → check-QAVEMKP2.js.map} +0 -0
  150. /package/dist/{check-VKQ6GM5D.js.map → check-TUP4RG7G.js.map} +0 -0
  151. /package/dist/{chunk-5MKSZSXH.js.map → chunk-2KGDXZMS.js.map} +0 -0
  152. /package/dist/{chunk-K5VWSQ4K.js.map → chunk-2NB7MT5I.js.map} +0 -0
  153. /package/dist/{chunk-5DER6O26.js.map → chunk-3WX73ME2.js.map} +0 -0
  154. /package/dist/{chunk-TU7T6YRR.js.map → chunk-4JDOHAHR.js.map} +0 -0
  155. /package/dist/{chunk-VCIC7XJB.js.map → chunk-66A5PPWF.js.map} +0 -0
  156. /package/dist/{chunk-MWWPADYI.js.map → chunk-66U7KHZE.js.map} +0 -0
  157. /package/dist/{chunk-ERXM4UF7.js.map → chunk-672TCM2Q.js.map} +0 -0
  158. /package/dist/{chunk-NIXJOL7G.js.map → chunk-7S6H5UML.js.map} +0 -0
  159. /package/dist/{chunk-VGGIJMDA.js.map → chunk-7URMU7S5.js.map} +0 -0
  160. /package/dist/{chunk-GBZVXEVE.js.map → chunk-AD7IRC5T.js.map} +0 -0
  161. /package/dist/{chunk-RKZ2NPO4.js.map → chunk-AXIYZIHN.js.map} +0 -0
  162. /package/dist/{chunk-GK3F3FIP.js.map → chunk-AXSCHC34.js.map} +0 -0
  163. /package/dist/{chunk-MYYTLNO5.js.map → chunk-BBIEWUO6.js.map} +0 -0
  164. /package/dist/{chunk-4YCPB67J.js.map → chunk-BKLXSWGX.js.map} +0 -0
  165. /package/dist/{chunk-YLWI7FR2.js.map → chunk-BR6NGHRG.js.map} +0 -0
  166. /package/dist/{chunk-DKV6BVW5.js.map → chunk-BVQEOF23.js.map} +0 -0
  167. /package/dist/{chunk-U4CWWG2Y.js.map → chunk-CCBIO2CB.js.map} +0 -0
  168. /package/dist/{chunk-67GJRC62.js.map → chunk-CEPNSI4V.js.map} +0 -0
  169. /package/dist/{chunk-2FGWZH7A.js.map → chunk-CY4RNLFN.js.map} +0 -0
  170. /package/dist/{chunk-WMI2RDSG.js.map → chunk-D2N3SAV6.js.map} +0 -0
  171. /package/dist/{chunk-V52AGLNN.js.map → chunk-DLIQJJAE.js.map} +0 -0
  172. /package/dist/{chunk-AP3PCNKS.js.map → chunk-DO5CJVXR.js.map} +0 -0
  173. /package/dist/{chunk-77U6NQKQ.js.map → chunk-DSHAY6YM.js.map} +0 -0
  174. /package/dist/{chunk-LGHJFEEH.js.map → chunk-EZBWGI25.js.map} +0 -0
  175. /package/dist/{chunk-F76DU7FH.js.map → chunk-F6FDIOKE.js.map} +0 -0
  176. /package/dist/{chunk-O2STKCTP.js.map → chunk-FJZZYY7Q.js.map} +0 -0
  177. /package/dist/{chunk-YGUAY67B.js.map → chunk-GTT7EQEV.js.map} +0 -0
  178. /package/dist/{chunk-3YA6TGWH.js.map → chunk-GWOVEW53.js.map} +0 -0
  179. /package/dist/{chunk-JG2QWMDX.js.map → chunk-HVYVIGBP.js.map} +0 -0
  180. /package/dist/{chunk-ZE3BXQED.js.map → chunk-I52GL7N6.js.map} +0 -0
  181. /package/dist/{chunk-6U3XF5VY.js.map → chunk-ICUKYSPX.js.map} +0 -0
  182. /package/dist/{chunk-6KNIQ2SK.js.map → chunk-INDMEKFB.js.map} +0 -0
  183. /package/dist/{chunk-RRAJMTHV.js.map → chunk-J7OFPDCD.js.map} +0 -0
  184. /package/dist/{chunk-HXILODV5.js.map → chunk-JVZAJBSS.js.map} +0 -0
  185. /package/dist/{chunk-7INXFEI7.js.map → chunk-KWK6VVK2.js.map} +0 -0
  186. /package/dist/{chunk-7ZRX2OPC.js.map → chunk-LU6HSA2N.js.map} +0 -0
  187. /package/dist/{chunk-KNMDIR7D.js.map → chunk-M5HDMQCI.js.map} +0 -0
  188. /package/dist/{chunk-UYKRP3M3.js.map → chunk-MCUN2JP3.js.map} +0 -0
  189. /package/dist/{chunk-OXFNU2IO.js.map → chunk-MQ34D4OP.js.map} +0 -0
  190. /package/dist/{chunk-UUZJP47H.js.map → chunk-MREXYXMW.js.map} +0 -0
  191. /package/dist/{chunk-4MD2JG2F.js.map → chunk-N7VIVL42.js.map} +0 -0
  192. /package/dist/{chunk-SWCFJC7W.js.map → chunk-NH4RQUSD.js.map} +0 -0
  193. /package/dist/{chunk-4L62A7YB.js.map → chunk-P676AEK6.js.map} +0 -0
  194. /package/dist/{chunk-QEFVMOWF.js.map → chunk-QYKTIRRE.js.map} +0 -0
  195. /package/dist/{chunk-3VBEUMKQ.js.map → chunk-R64PJYCT.js.map} +0 -0
  196. /package/dist/{chunk-O632I7AB.js.map → chunk-SPYYVEWP.js.map} +0 -0
  197. /package/dist/{chunk-CZFP6Q5O.js.map → chunk-STPT3WEC.js.map} +0 -0
  198. /package/dist/{chunk-5S5DYW7W.js.map → chunk-TE6SQVNO.js.map} +0 -0
  199. /package/dist/{chunk-7PF47O3H.js.map → chunk-TX7NPCCT.js.map} +0 -0
  200. /package/dist/{chunk-E6S3VGN6.js.map → chunk-VKAE3W6H.js.map} +0 -0
  201. /package/dist/{chunk-Z3YNYZR2.js.map → chunk-VXZ2CIH7.js.map} +0 -0
  202. /package/dist/{chunk-ZI7RMN3H.js.map → chunk-WX77JHTU.js.map} +0 -0
  203. /package/dist/{chunk-7YDGDI26.js.map → chunk-XIEUUETR.js.map} +0 -0
  204. /package/dist/{chunk-OJZOKTTX.js.map → chunk-YH6MWLDA.js.map} +0 -0
  205. /package/dist/{chunk-CMJEB5V5.js.map → chunk-YT55M4VQ.js.map} +0 -0
  206. /package/dist/{chunk-C5NE3ZIC.js.map → chunk-ZGLLJSL7.js.map} +0 -0
  207. /package/dist/{chunk-MBJINPKU.js.map → chunk-ZY2XP3AS.js.map} +0 -0
  208. /package/dist/{cli-B7QCMRWR.js.map → cli-5NIVQZIE.js.map} +0 -0
  209. /package/dist/{cli-MT4EPC63.js.map → cli-7TW4HTQN.js.map} +0 -0
  210. /package/dist/{cli-KUMDTVHH.js.map → cli-BG6WXYWT.js.map} +0 -0
  211. /package/dist/{cli-2MHUVZH2.js.map → cli-ME4U7S7Q.js.map} +0 -0
  212. /package/dist/{cli-A5TGO26R.js.map → cli-NKGQZKXS.js.map} +0 -0
  213. /package/dist/{cli-NKRJ5C4G.js.map → cli-R5XYFIOY.js.map} +0 -0
  214. /package/dist/{cli-S5CSPYEZ.js.map → cli-T2AZSUSY.js.map} +0 -0
  215. /package/dist/{cli-NIHSHMIV.js.map → cli-TA2IQRYK.js.map} +0 -0
  216. /package/dist/{cli-CCUZFOPQ.js.map → cli-UAM4MBRM.js.map} +0 -0
  217. /package/dist/{cli-GKRMSA26.js.map → cli-XVJ5G4EO.js.map} +0 -0
  218. /package/dist/{cli-Y4ARUWKJ.js.map → cli-YKM5YZHY.js.map} +0 -0
  219. /package/dist/{github-2PYSX7EK.js.map → github-SQ2ATTLV.js.map} +0 -0
  220. /package/dist/{github-M4QRPNXT.js.map → github-X6F2FQL3.js.map} +0 -0
  221. /package/dist/{github-POT6K5GH.js.map → github-ZCA7TOJO.js.map} +0 -0
  222. /package/dist/{json-3HPHYGQC.js.map → json-L7QDREEX.js.map} +0 -0
  223. /package/dist/{json-ZWSUMRI5.js.map → json-NSLJFPWD.js.map} +0 -0
  224. /package/dist/{labels-5P4CKGPW.js.map → labels-C4HCKZMZ.js.map} +0 -0
  225. /package/dist/{lint-K7R4WNMG.js.map → lint-ODALAI2I.js.map} +0 -0
  226. /package/dist/{list-3C7Q6VMU.js.map → list-4JLKJOGX.js.map} +0 -0
  227. /package/dist/{list-HOTRWPC7.js.map → list-CAE7T5HA.js.map} +0 -0
  228. /package/dist/{list-O7IREFT2.js.map → list-TQK3FWC2.js.map} +0 -0
  229. /package/dist/{page-6U3CEGTB.js.map → page-GB5LHRHX.js.map} +0 -0
  230. /package/dist/{prepare-PZVX2VVT.js.map → prepare-VCJRE3EY.js.map} +0 -0
  231. /package/dist/{pretty-53N5ZMM3.js.map → pretty-GP4R3UII.js.map} +0 -0
  232. /package/dist/{pretty-ENVCHUYG.js.map → pretty-GXLKMUT4.js.map} +0 -0
  233. /package/dist/{pretty-ODBO2IIJ.js.map → pretty-KZPED6KN.js.map} +0 -0
  234. /package/dist/{reporters-3GE5FK5L.js.map → reporters-GGP4YLIM.js.map} +0 -0
  235. /package/dist/{reporters-FWSJ3O4V.js.map → reporters-GQ2PUWQA.js.map} +0 -0
  236. /package/dist/{reporters-MK62LRGW.js.map → reporters-Y2AUVODK.js.map} +0 -0
  237. /package/dist/{run-GUHRZ3OX.js.map → run-SVH32CBO.js.map} +0 -0
  238. /package/dist/{sarif-2BGXPVSR.js.map → sarif-CFQJ5HHP.js.map} +0 -0
  239. /package/dist/{sarif-2L4MLVF5.js.map → sarif-UG7F3WQD.js.map} +0 -0
  240. /package/dist/{sarif-IFFO37SO.js.map → sarif-UHZD2CJ3.js.map} +0 -0
  241. /package/dist/{strategy-BCRB4A55.js.map → strategy-Y4NEJRSH.js.map} +0 -0
  242. /package/dist/{term-HPRQBB2A.js.map → term-LQ2F5WEN.js.map} +0 -0
  243. /package/dist/{types-GV2THIRC.js.map → types-YREQ2DQG.js.map} +0 -0
  244. /package/dist/{validate-TEYFOGI5.js.map → validate-6WBRKEV5.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "manni",
3
3
  "description": "Checks the docs an agent edits against everything the repository set up in manni, blocks on errors, records the session manifest tracevals reads for a user who turns tracevals on, serves the docs graph to the agent, and hands the agent a page's metadata when it reads one.",
4
- "version": "4.30.0",
4
+ "version": "4.31.0",
5
5
  "author": { "name": "hawkeyexl" },
6
6
  "homepage": "https://hawkeyexl.github.io/manni/",
7
7
  "repository": "https://github.com/hawkeyexl/manni",
@@ -1,58 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- renderCheck,
4
- runCheck
5
- } from "./chunk-7PF47O3H.js";
6
- import "./chunk-7ZRX2OPC.js";
7
- import "./chunk-UUZJP47H.js";
8
- import "./chunk-4YCPB67J.js";
9
- import "./chunk-RKZ2NPO4.js";
10
- import "./chunk-KNMDIR7D.js";
11
- import "./chunk-CZFP6Q5O.js";
12
- import "./chunk-6KNIQ2SK.js";
13
- import "./chunk-IM7C3H4W.js";
14
- import "./chunk-DKV6BVW5.js";
15
- import "./chunk-WMI2RDSG.js";
16
- import "./chunk-RRAJMTHV.js";
17
- import "./chunk-TIUTIOFB.js";
18
- import "./chunk-GLP5PSXB.js";
19
- import "./chunk-4L62A7YB.js";
20
- import "./chunk-MBJINPKU.js";
21
- import "./chunk-AP3PCNKS.js";
22
- import "./chunk-77U6NQKQ.js";
23
- import "./chunk-GBZVXEVE.js";
24
- import "./chunk-3VBEUMKQ.js";
25
- import "./chunk-5MKSZSXH.js";
26
- import "./chunk-ZE3BXQED.js";
27
- import "./chunk-TU7T6YRR.js";
28
- import "./chunk-GK3F3FIP.js";
29
- import "./chunk-XTKJNRJ6.js";
30
- import "./chunk-5DER6O26.js";
31
- import "./chunk-OPF3NOKF.js";
32
- import "./chunk-U4CWWG2Y.js";
33
- import "./chunk-BXQLKOOR.js";
34
- import "./chunk-JBOXCSTN.js";
35
- import "./chunk-HMJZHUCJ.js";
36
- import "./chunk-YLWI7FR2.js";
37
- import "./chunk-ZI7RMN3H.js";
38
- import "./chunk-ERXM4UF7.js";
39
- import "./chunk-SWCFJC7W.js";
40
- import "./chunk-C5NE3ZIC.js";
41
- import "./chunk-DSWKBZWW.js";
42
- import "./chunk-K5VWSQ4K.js";
43
- import "./chunk-77AINBYM.js";
44
- import "./chunk-QK6VYJHV.js";
45
- import "./chunk-RNVYGWIC.js";
46
- import "./chunk-YEUYKR62.js";
47
- import "./chunk-CDX4QK6O.js";
48
- import "./chunk-HX44GB4Z.js";
49
- import "./chunk-NVYDWVXN.js";
50
- import "./chunk-KAIJHQR2.js";
51
- import "./chunk-OWBRDNRZ.js";
52
- import "./chunk-G3T47CFV.js";
53
- import "./chunk-2H7UOFLK.js";
54
- export {
55
- renderCheck,
56
- runCheck
57
- };
58
- //# sourceMappingURL=check-MYUFZGKO.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/test/errors.ts","../src/test/commands/procedures.ts","../src/test/core/doc-detective.ts","../src/test/core/results.ts","../src/test/commands/tasks.ts","../src/test/core/claude-code.ts","../src/test/core/judge-run.ts","../src/test/core/evidence.ts","../src/test/core/prompts.ts","../src/test/core/task-records.ts","../src/test/core/workspace.ts","../src/test/reporters/finding.ts","../src/test/reporters/summary.ts","../src/test/reporters/github.ts","../src/test/reporters/json.ts","../src/test/reporters/pretty.ts","../src/test/reporters/tasks.ts"],"sourcesContent":["import { ToolError } from \"../shared/errors.js\";\n\n/** An operational or usage error in the test domain: exit 2. */\nexport class TestError extends ToolError {\n constructor(message: string) {\n super(message);\n this.name = \"TestError\";\n }\n}\n","/**\n * `manni test procedures`: run Doc Detective and read its verdict from its results.\n *\n * Input precedence is positional paths, then `--collection`, then Doc\n * Detective's own config `input`. Without `--collection`, manni's collections\n * are not read: Doc Detective's config is this tool's default input.\n *\n * Doc Detective exits 0 when tests fail, so the exit code only says whether it\n * ran. The verdict is the results file it writes under `-o`, which is a temp\n * directory removed afterwards.\n */\nimport { existsSync } from \"node:fs\";\nimport { mkdtemp, readdir, readFile, rm } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { join, relative, resolve } from \"node:path\";\nimport fg from \"fast-glob\";\nimport picomatch from \"picomatch\";\nimport { selectCollections } from \"../../shared/collections.js\";\nimport { findConfigFile, readConfigFile, type ConfigFile } from \"../../shared/config-file.js\";\nimport { ToolError } from \"../../shared/errors.js\";\nimport { outputTail } from \"../../shared/exec.js\";\nimport { docDetectiveConfigPath } from \"../../shared/tools.js\";\nimport { DEFAULT_IGNORE, notFoundMessage, resolveTargetSet, STDIN_TOKEN } from \"../../meta/internal.js\";\nimport { NOT_ON_PATH, realSpawn, type DocDetectiveSpawn } from \"../core/doc-detective.js\";\nimport {\n anyFailed,\n collectFindings,\n parseResults,\n testCounts,\n type DocDetectiveResults,\n type ResultCounts,\n type TestFinding,\n} from \"../core/results.js\";\nimport { TestError } from \"../errors.js\";\n\nexport interface RunProceduresOptions {\n /** Positional files, directories and globs. */\n paths?: string[];\n /** `--collection <name>`, repeatable. */\n collection?: string[];\n /** `-c, --config`: a manni config file. */\n configPath?: string;\n cwd?: string;\n /** Finding no tests, or no inputs, is a pass. */\n allowEmpty?: boolean;\n /** Stream Doc Detective's output to stderr as it runs. */\n progress?: boolean;\n /** Test seam: how Doc Detective is started. */\n spawn?: DocDetectiveSpawn;\n}\n\nexport interface ProceduresResult {\n /** Doc Detective's results object as it wrote it; `null` when it found no tests. */\n results: DocDetectiveResults | null;\n /** Every FAIL and WARNING step. */\n findings: TestFinding[];\n /** The test-level counts. */\n tests: ResultCounts;\n /** 1 when anything failed. */\n exitCode: 0 | 1;\n}\n\n/** What Doc Detective finds on its own in the working directory. */\nconst DOC_DETECTIVE_CONFIG_NAMES = [\".doc-detective.json\", \".doc-detective.yaml\", \".doc-detective.yml\"];\n\nconst NO_RESULTS = \"Doc Detective wrote no results to read. Run doc-detective directly to see why.\";\n\n/** A run with nothing to report; a fresh object each time, so no caller shares one. */\nfunction empty(results: DocDetectiveResults | null = null): ProceduresResult {\n return { results, findings: [], tests: { pass: 0, fail: 0, warning: 0, skipped: 0 }, exitCode: 0 };\n}\n\nconst toError = (message: string): Error => new TestError(message);\n\n/** A sibling's `ToolError` (meta's walk, say) reported as this domain's. */\nasync function asTestError<T>(work: () => Promise<T>): Promise<T> {\n try {\n return await work();\n } catch (err) {\n if (err instanceof ToolError && !(err instanceof TestError)) throw new TestError(err.message);\n throw err;\n }\n}\n\nasync function loadConfig(cwd: string, configPath: string | undefined): Promise<ConfigFile | null> {\n const opts = { section: \"test\", legacyNames: [], toError };\n const file =\n configPath === undefined ? await findConfigFile(cwd, opts) : await readConfigFile(configPath, cwd, opts);\n // The domain has no keys of its own, so a `test:` section is a setting that\n // would otherwise read as configured and do nothing.\n if (file !== null && file.wrapped && file.value !== null) {\n throw new TestError(\n `${file.source}: test has no keys. Doc Detective's settings live under tools.doc-detective, and Claude Code's under tools.claude-cli.`,\n );\n }\n return file;\n}\n\n/**\n * Positional inputs as Doc Detective takes them. Files and directories go as\n * typed, and Doc Detective walks a directory itself. A glob is expanded here.\n * A name that does not exist is refused, because Doc Detective skips one in\n * silence.\n */\nasync function positionalInputs(paths: string[], cwd: string, allowEmpty: boolean): Promise<string[]> {\n const inputs: string[] = [];\n const missing: string[] = [];\n for (const path of paths) {\n const posix = path.replace(/\\\\/g, \"/\");\n if (existsSync(resolve(cwd, posix))) {\n inputs.push(path);\n } else if (picomatch.scan(posix).isGlob) {\n const found = await fg(posix, { cwd, ignore: DEFAULT_IGNORE, onlyFiles: true, dot: false });\n inputs.push(...found.sort());\n } else {\n missing.push(posix);\n }\n }\n if (missing.length > 0 && !allowEmpty) throw new TestError(notFoundMessage(missing));\n return inputs;\n}\n\n/** The selected collections' files, minus their excludes, relative to `cwd`. */\nasync function collectionInputs(\n file: ConfigFile,\n names: string[],\n cwd: string,\n allowEmpty: boolean,\n): Promise<string[]> {\n const collections = selectCollections(file.collections, names, file.source, toError);\n const { files } = await asTestError(() =>\n resolveTargetSet({\n inputs: collections.flatMap((c) => c.paths),\n exclude: collections.flatMap((c) => c.exclude),\n cwd: file.dir,\n allowEmpty,\n }),\n );\n return files.map((f) => relative(cwd, resolve(file.dir, f)).replace(/\\\\/g, \"/\"));\n}\n\nasync function readResults(outDir: string): Promise<DocDetectiveResults | null> {\n const names = (await readdir(outDir)).filter((n) => /^testResults-.*\\.json$/.test(n)).sort();\n const last = names.at(-1);\n if (last === undefined) throw new TestError(NO_RESULTS);\n const results = parseResults(await readFile(join(outDir, last), \"utf8\"));\n if (results === undefined) throw new TestError(NO_RESULTS);\n return results;\n}\n\nexport async function runProcedures(opts: RunProceduresOptions = {}): Promise<ProceduresResult> {\n const cwd = resolve(opts.cwd ?? process.cwd());\n const paths = opts.paths ?? [];\n const wanted = opts.collection ?? [];\n const allowEmpty = opts.allowEmpty ?? false;\n\n if (paths.includes(STDIN_TOKEN)) {\n throw new TestError(\"test procedures reads files; Doc Detective has no stdin. Pass a path.\");\n }\n // lint's two sentences: a collection is a set the operator did not type, so\n // it composes with no typed path, and only a config can define one.\n if (wanted.length > 0 && paths.length > 0) {\n throw new TestError(\n \"--collection selects a configured collection; it cannot be combined with paths.\",\n );\n }\n const file = await loadConfig(cwd, opts.configPath);\n if (wanted.length > 0 && file === null) {\n throw new TestError(\"--collection needs a config file to select from.\");\n }\n\n // The path as written names the file in the refusal; the resolved one is\n // what Doc Detective is given.\n const written = file?.tools[\"doc-detective\"]?.config;\n let ddConfig: string | undefined;\n if (file !== null && written !== undefined) {\n ddConfig = docDetectiveConfigPath(file.tools, file.dir);\n if (ddConfig !== undefined && !existsSync(ddConfig)) {\n throw new TestError(`${file.source}: tools.doc-detective.config \"${written}\" does not exist.`);\n }\n }\n\n let inputs: string[] | undefined;\n if (paths.length > 0) {\n inputs = await positionalInputs(paths, cwd, allowEmpty);\n if (inputs.length === 0) {\n if (allowEmpty) return empty();\n const tried = paths.map((p) => `\"${p}\"`).join(\", \");\n throw new TestError(\n `No files matched. Patterns tried: ${tried}. Pass --allow-empty if that is expected.`,\n );\n }\n } else if (file !== null && wanted.length > 0) {\n inputs = await collectionInputs(file, wanted, cwd, allowEmpty);\n if (inputs.length === 0) {\n if (allowEmpty) return empty();\n throw new TestError(\"--collection matched no files. Pass --allow-empty if that is expected.\");\n }\n } else if (\n ddConfig === undefined &&\n !DOC_DETECTIVE_CONFIG_NAMES.some((name) => existsSync(join(cwd, name)))\n ) {\n throw new TestError(\n \"test procedures needs paths or a Doc Detective config. Pass paths, or add .doc-detective.json.\",\n );\n }\n\n const outDir = await mkdtemp(join(tmpdir(), \"manni-test-\"));\n try {\n const args = [\n // ponytail: Doc Detective splits -i on commas, so a path holding a comma\n // is two inputs. Upgrade path: a generated config whose input is a list.\n ...(inputs === undefined ? [] : [\"-i\", inputs.join(\",\")]),\n ...(ddConfig === undefined ? [] : [\"-c\", ddConfig]),\n \"-r\",\n \"json\",\n // A file, not the folder: Doc Detective 5.6.3 refuses a folder for -o,\n // and earlier releases write a named file there too.\n \"-o\",\n join(outDir, \"testResults-manni.json\"),\n ];\n const run = await (opts.spawn ?? realSpawn)(args, { cwd, progress: opts.progress ?? false });\n if (run.spawnError !== undefined) throw new TestError(NOT_ON_PATH);\n // Doc Detective 5.x exits 1 when a test fails, and its results still carry\n // the verdict. Exit 1 with no results file is the operational failure it was.\n const failed = (): TestError => {\n const how = run.code === null ? \"killed before exiting\" : `exit ${String(run.code)}`;\n return new TestError(`Doc Detective failed (${how}):\\n${outputTail(run)}`);\n };\n if (run.code !== 0 && run.code !== 1) throw failed();\n const results =\n run.code === 0 ? await readResults(outDir) : await readResults(outDir).catch(() => { throw failed(); });\n const tests = testCounts(results);\n const total = tests.pass + tests.fail + tests.warning + tests.skipped;\n // A `null` results file counts as zero tests, so `total` covers it.\n if (total === 0) {\n if (allowEmpty) return empty(results);\n throw new TestError(\n \"Doc Detective found no tests in the inputs. Pass --allow-empty if that is expected.\",\n );\n }\n return {\n results,\n findings: collectFindings(results, cwd),\n tests,\n exitCode: anyFailed(results) ? 1 : 0,\n };\n } finally {\n await rm(outDir, { recursive: true, force: true });\n }\n}\n","/**\n * The Doc Detective process seam: the only module that starts `doc-detective`.\n * Unit tests inject a `DocDetectiveSpawn`; the real one is `realSpawn`.\n *\n * On Windows an npm global install puts a `.cmd` shim on PATH, and `cmd.exe`\n * caps the command line it runs at 8191 characters, which a collection of a\n * few hundred pages passes. So the bin script the shim points at is run with\n * node directly. Only when no script sits beside the shim does the shim run,\n * through `realExec`, which knows how to start one without a shell.\n */\nimport { spawn } from \"node:child_process\";\nimport { statSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { ExecResult } from \"@hawkeyexl/inference\";\nimport { realExec } from \"../../shared/exec.js\";\nimport { TestError } from \"../errors.js\";\n\n/**\n * Start Doc Detective with `args` (its own flags, no program name) and wait\n * for it. `progress` streams its output to stderr as it runs; the output is\n * captured either way.\n */\nexport type DocDetectiveSpawn = (\n args: string[],\n opts: { cwd: string; progress: boolean },\n) => Promise<ExecResult>;\n\n/** How Doc Detective is started on this host. */\nexport interface Launch {\n command: string;\n args: string[];\n /** Started through a Windows `.cmd` shim, so `cmd.exe`'s cap applies. */\n viaShim: boolean;\n}\n\nexport const NOT_ON_PATH =\n \"doc-detective is not on PATH. Install Doc Detective (npm install -g doc-detective) to run doc tests.\";\n\nconst COMMAND_LINE_LIMIT =\n \"the selected inputs exceed the command-line limit. Narrow the collection, or set input in the Doc Detective config.\";\n\n/** No timeout: a docs suite runs as long as its tests do. */\nconst NO_TIMEOUT = 2 ** 31 - 1;\n\nexport function launchFor(\n args: string[],\n host: { platform: NodeJS.Platform; path: string; isFile: (path: string) => boolean },\n): Launch {\n if (host.platform !== \"win32\") return { command: \"doc-detective\", args, viaShim: false };\n // Windows lets a PATH entry be quoted, as in \"C:\\Program Files\\nodejs\".\n for (const entry of host.path.split(\";\")) {\n const dir = entry.replace(/^\"(.*)\"$/, \"$1\");\n if (dir === \"\" || !host.isFile(join(dir, \"doc-detective.cmd\"))) continue;\n const script = join(dir, \"node_modules\", \"doc-detective\", \"bin\", \"doc-detective.js\");\n if (host.isFile(script)) {\n return { command: process.execPath, args: [script, ...args], viaShim: false };\n }\n break;\n }\n return { command: \"doc-detective\", args, viaShim: true };\n}\n\n/**\n * Refuse a command line Windows would truncate or reject.\n *\n * ponytail: Windows caps a command line at 32,767 characters, and at 8,191\n * through a `.cmd` shim. Past the cap the run is refused. The upgrade path is\n * running the inputs in batches and merging the results files.\n */\nexport function assertFitsCommandLine(launch: Launch, platform: NodeJS.Platform): void {\n if (platform !== \"win32\") return;\n // Each argument costs its quotes and the space before it.\n const length = [launch.command, ...launch.args].reduce((n, arg) => n + arg.length + 3, 0);\n if (length > (launch.viaShim ? 8_191 : 32_767)) throw new TestError(COMMAND_LINE_LIMIT);\n}\n\nfunction isFile(path: string): boolean {\n try {\n return statSync(path).isFile();\n } catch {\n return false;\n }\n}\n\nfunction streamed(launch: Launch, opts: { cwd: string; progress: boolean }): Promise<ExecResult> {\n return new Promise((settle) => {\n let stdout = \"\";\n let stderr = \"\";\n const child = spawn(launch.command, launch.args, {\n cwd: opts.cwd,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n windowsHide: true,\n });\n child.stdout.setEncoding(\"utf8\");\n child.stderr.setEncoding(\"utf8\");\n child.stdout.on(\"data\", (chunk: string) => {\n stdout += chunk;\n if (opts.progress) process.stderr.write(chunk);\n });\n child.stderr.on(\"data\", (chunk: string) => {\n stderr += chunk;\n if (opts.progress) process.stderr.write(chunk);\n });\n child.on(\"error\", (err) => {\n settle({ code: null, stdout, stderr, timedOut: false, spawnError: err.message });\n });\n child.on(\"close\", (code) => {\n settle({ code, stdout, stderr, timedOut: false });\n });\n });\n}\n\nexport const realSpawn: DocDetectiveSpawn = async (args, opts) => {\n const launch = launchFor(args, {\n platform: process.platform,\n path: process.env[\"PATH\"] ?? \"\",\n isFile,\n });\n assertFitsCommandLine(launch, process.platform);\n if (!launch.viaShim) return streamed(launch, opts);\n // ponytail: the shim path captures and replays rather than streaming live.\n // It runs only when a shim has no bin script beside it.\n const result = await realExec([launch.command, ...launch.args], {\n cwd: opts.cwd,\n timeoutMs: NO_TIMEOUT,\n });\n if (opts.progress) process.stderr.write(result.stdout + result.stderr);\n return result;\n};\n","/**\n * Doc Detective's results file, read across a process boundary.\n *\n * The object is kept as Doc Detective wrote it, because `-f json` prints it\n * verbatim. Only the parts the verdict and the reports need are checked: the\n * test-level counts, and each step's result, description, line and action.\n */\nimport { relative } from \"node:path\";\nimport type { Guidance } from \"../../shared/guidance.js\";\n\n/** One level's counts in Doc Detective's `summary`. */\nexport interface ResultCounts {\n pass: number;\n fail: number;\n warning: number;\n skipped: number;\n}\n\n/** Doc Detective's results object, as it wrote it. */\nexport type DocDetectiveResults = Record<string, unknown>;\n\n/** A step that FAILed or WARNed, named by the page it came from. */\nexport interface TestFinding {\n /** The page, posix and relative to the run's working directory. */\n file: string;\n /** The step's line in the page, when Doc Detective located it. */\n line?: number;\n result: \"FAIL\" | \"WARNING\";\n /** Doc Detective's `resultDescription`, as it wrote it. */\n description: string;\n /** The Doc Detective action the step ran, such as `runShell`, when it is one Doc Detective documents. */\n action?: string;\n /** `Doc Detective`, the action, the step's own `description` and the action's guide. */\n guidance?: Guidance | null;\n}\n\n/** The step actions Doc Detective documents, each on a page of its own under `ACTIONS_GUIDE`. */\nconst ACTIONS = new Set([\n \"checkLink\",\n \"click\",\n \"dragAndDrop\",\n \"find\",\n \"goTo\",\n \"httpRequest\",\n \"loadCookie\",\n \"loadVariables\",\n \"record\",\n \"runCode\",\n \"runShell\",\n \"saveCookie\",\n \"screenshot\",\n \"stopRecord\",\n \"type\",\n \"wait\",\n]);\n\n// Each page is the action name lowercased with nothing between the words:\n// `draganddrop`, `checklink`, `httprequest`. Kebab-case slugs 404 there.\nconst ACTIONS_GUIDE = \"https://docs.doc-detective.com/docs/actions/\";\n\nexport const ZERO_COUNTS: ResultCounts = { pass: 0, fail: 0, warning: 0, skipped: 0 };\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction records(value: unknown): Record<string, unknown>[] {\n return Array.isArray(value) ? value.filter(isRecord) : [];\n}\n\nfunction counts(value: unknown): ResultCounts | undefined {\n if (!isRecord(value)) return undefined;\n const out = { ...ZERO_COUNTS };\n for (const key of Object.keys(out) as (keyof ResultCounts)[]) {\n const n = value[key];\n if (typeof n !== \"number\") return undefined;\n out[key] = n;\n }\n return out;\n}\n\n/**\n * Parse a results file. `null` is what Doc Detective writes when it found no\n * tests. `undefined` is a file that is not a results object at all.\n */\nexport function parseResults(text: string): DocDetectiveResults | null | undefined {\n let parsed: unknown;\n try {\n parsed = JSON.parse(text);\n } catch {\n return undefined;\n }\n if (parsed === null) return null;\n if (!isRecord(parsed) || !isRecord(parsed[\"summary\"])) return undefined;\n if (counts(parsed[\"summary\"][\"tests\"]) === undefined) return undefined;\n if (!Array.isArray(parsed[\"specs\"])) return undefined;\n return parsed;\n}\n\n/** The test-level counts, which the summary line reports. */\nexport function testCounts(results: DocDetectiveResults | null): ResultCounts {\n if (results === null || !isRecord(results[\"summary\"])) return { ...ZERO_COUNTS };\n return counts(results[\"summary\"][\"tests\"]) ?? { ...ZERO_COUNTS };\n}\n\n/** Whether anything failed, at any level Doc Detective counts. */\nexport function anyFailed(results: DocDetectiveResults | null): boolean {\n if (results === null) return false;\n const summary = results[\"summary\"];\n if (!isRecord(summary)) return false;\n return Object.values(summary).some((level) => (counts(level)?.fail ?? 0) > 0);\n}\n\n/**\n * Every FAIL and WARNING step, in the order Doc Detective ran them. A step\n * that fails the same way in several contexts, one per browser or platform,\n * is one finding.\n */\nexport function collectFindings(results: DocDetectiveResults | null, cwd: string): TestFinding[] {\n if (results === null) return [];\n const out: TestFinding[] = [];\n const seen = new Set<string>();\n for (const spec of records(results[\"specs\"])) {\n for (const test of records(spec[\"tests\"])) {\n const contentPath = test[\"contentPath\"] ?? spec[\"contentPath\"];\n // Without a contentPath the file is unknown, and `\"\"` says so: the\n // github reporter then leaves `file=` off the annotation. A URL input\n // is reported as Doc Detective names it; only a file path is relative.\n const file =\n typeof contentPath !== \"string\"\n ? \"\"\n : /^[a-z][a-z0-9+.-]*:\\/\\//i.test(contentPath)\n ? contentPath\n : relative(cwd, contentPath).replace(/\\\\/g, \"/\");\n for (const context of records(test[\"contexts\"])) {\n for (const step of records(context[\"steps\"])) {\n const result = step[\"result\"];\n if (result !== \"FAIL\" && result !== \"WARNING\") continue;\n const location = step[\"location\"];\n const line = isRecord(location) ? location[\"line\"] : undefined;\n const resultDescription = step[\"resultDescription\"];\n const description = typeof resultDescription === \"string\" ? resultDescription : \"\";\n const action = Object.keys(step).find((key) => ACTIONS.has(key));\n const key = JSON.stringify([file, line, action, result, description]);\n if (seen.has(key)) continue;\n seen.add(key);\n const stated = step[\"description\"];\n out.push({\n file,\n ...(typeof line === \"number\" ? { line } : {}),\n result,\n description,\n ...(action === undefined ? {} : { action }),\n guidance: {\n id: \"Doc Detective\",\n rule: action ?? null,\n description: typeof stated === \"string\" && stated !== \"\" ? stated : null,\n guide: action === undefined ? null : `${ACTIONS_GUIDE}${action.toLowerCase()}`,\n },\n });\n }\n }\n }\n }\n return out;\n}\n","/**\n * `manni test tasks`: a synthetic user attempts a task from a page, a URL or\n * a journey, and its trace and workspace are judged against the docs.\n *\n * A run is one start, one task and one persona (plan §4.2). Every run is\n * assembled and validated before the first starts, so a bad id or a missing\n * page stops the command before Claude Code spends a turn. Runs go one after\n * another. Each gets a fresh temp directory, its stream is saved under\n * `.manni/test/tasks/<run-id>/` as it arrives, and the judge reads the rest.\n */\nimport { existsSync } from \"node:fs\";\nimport { appendFile, mkdir, rm, writeFile } from \"node:fs/promises\";\nimport { join, relative, resolve, sep } from \"node:path\";\nimport type { InferenceProvider } from \"@hawkeyexl/inference\";\nimport { findConfigFile, readConfigFile, type ConfigFile } from \"../../shared/config-file.js\";\nimport { errorMessage, ToolError } from \"../../shared/errors.js\";\nimport { claudeCliMcpConfigPath, DEFAULT_CLAUDE_CLI_MAX_TURNS } from \"../../shared/tools.js\";\nimport { notice, warn } from \"../../shared/warn.js\";\nimport { notFoundMessage, STDIN_TOKEN } from \"../../meta/internal.js\";\nimport { parseTraceFile } from \"../../tracevals/trace/claude.js\";\nimport {\n claudeCodeArgs,\n claudeCodeEnv,\n classifyRun,\n lineSplitter,\n mcpServerNames,\n progressLine,\n realClaudeCodeSpawn,\n toolUses,\n type ClaudeCodeSpawn,\n} from \"../core/claude-code.js\";\nimport { judgeRun } from \"../core/judge-run.js\";\nimport { rolePrompt, taskBriefFor } from \"../core/prompts.js\";\nimport { loadTaskRecords } from \"../core/task-records.js\";\nimport type {\n JudgeRun,\n SourceLocation,\n TaskEval,\n TaskJourney,\n TaskPersona,\n TaskSpec,\n TaskStart,\n WorkspaceChanges,\n} from \"../core/task-types.js\";\nimport { prepareRun, workspaceChanges } from \"../core/workspace.js\";\nimport { TestError } from \"../errors.js\";\n\nexport type { TaskEval } from \"../core/task-types.js\";\n\nexport interface RunTasksOptions {\n /** Page paths and `http(s)://` URLs: where the synthetic user starts. */\n targets?: string[];\n /** `--task <text>`. */\n task?: string;\n /** `--journey <id>`, repeatable. */\n journeys?: string[];\n /** `--persona <id>`, repeatable. */\n personas?: string[];\n /** `--workspace <dir>`: the seed, overriding a journey's. */\n workspace?: string;\n /** `-c, --config`. */\n configPath?: string;\n cwd?: string;\n /** `--provider`, the judge's. */\n provider?: string;\n /** `--model`, the judge's. */\n model?: string;\n /** Keep each run's temp directory and name it on stderr. */\n keep?: boolean;\n /** An empty golden set is a pass. */\n allowEmpty?: boolean;\n /** Stream each action to stderr. */\n progress?: boolean;\n /** Test seam: how Claude Code is started. */\n spawn?: ClaudeCodeSpawn;\n /** Test seam: the judge. */\n judge?: JudgeRun;\n /** Test seam: the judge's provider, handed to the judge. */\n judgeProvider?: InferenceProvider;\n /** Test seam: the clock run ids are stamped from. */\n now?: () => Date;\n}\n\nexport interface TaskRun {\n /** `<UTC timestamp>-<journey id or \"task\">-<persona id or \"newcomer\">`. */\n id: string;\n journey: string | null;\n /** The `--task` text, or the journey's title. */\n task: string;\n persona: string | null;\n /** The start: a path as given, or the URL. */\n start: string;\n /** The seed as given, or null for an empty workspace. */\n workspace: string | null;\n /** The kept workspace's absolute path under `--keep`. */\n kept: string | null;\n /** The saved stream, relative to the working directory. */\n trace: string;\n turns: number;\n durationMs: number;\n stoppedAtLimit: boolean;\n /** The turn limit the run had. */\n maxTurns: number;\n usage: { inputTokens: number; outputTokens: number; costUsd?: number };\n docs: string[];\n changes: WorkspaceChanges;\n /** The synthetic user's last message. */\n account: string;\n evals: TaskEval[];\n outcome: \"pass\" | \"fail\";\n}\n\nexport interface TasksReport {\n runs: TaskRun[];\n summary: { runs: number; passed: number; failed: number; warnings: number };\n exitCode: 0 | 1;\n}\n\nconst NOTHING_TO_RUN =\n \"nothing to run: no journey declares evals:. Pass --task with a page or URL, or --journey <id>.\";\n\nconst isUrl = (target: string): boolean => /^https?:\\/\\//i.test(target);\n\nconst toPosix = (path: string): string => path.split(sep).join(\"/\");\n\n/** A sibling's `ToolError` reported as this domain's. */\nasync function asTestError<T>(work: () => Promise<T>): Promise<T> {\n try {\n return await work();\n } catch (err) {\n if (err instanceof ToolError && !(err instanceof TestError)) throw new TestError(err.message);\n throw err;\n }\n}\n\nconst toError = (message: string): Error => new TestError(message);\n\nasync function loadConfig(cwd: string, configPath: string | undefined): Promise<ConfigFile | null> {\n const opts = { section: \"test\", legacyNames: [], toError };\n const file =\n configPath === undefined ? await findConfigFile(cwd, opts) : await readConfigFile(configPath, cwd, opts);\n if (file !== null && file.wrapped && file.value !== null) {\n throw new TestError(\n `${file.source}: test has no keys. Doc Detective's settings live under tools.doc-detective, and Claude Code's under tools.claude-cli.`,\n );\n }\n return file;\n}\n\n/** `20261023T140211Z`. */\nfunction stamp(date: Date): string {\n return date.toISOString().replace(/[-:]/g, \"\").replace(/\\.\\d+Z$/, \"Z\");\n}\n\nexport function labelOf(spec: Pick<TaskSpec, \"journey\" | \"persona\">): string {\n return `${spec.journey?.id ?? \"task\"} as ${spec.persona?.id ?? \"newcomer\"}`;\n}\n\n/** The run passes when no `error` eval failed, errored or needs review. */\nfunction runOutcome(evals: TaskEval[]): \"pass\" | \"fail\" {\n return evals.some((e) => e.severity === \"error\" && (e.outcome === \"fail\" || e.outcome === \"error\" || e.outcome === \"needs-review\"))\n ? \"fail\"\n : \"pass\";\n}\n\nexport async function runTasks(opts: RunTasksOptions = {}): Promise<TasksReport> {\n const cwd = resolve(opts.cwd ?? process.cwd());\n const targets = opts.targets ?? [];\n const journeyIds = opts.journeys ?? [];\n const personaIds = opts.personas ?? [];\n const task = opts.task;\n\n // Usage first: none of these needs a file read.\n if (targets.includes(STDIN_TOKEN)) {\n throw new TestError(\"manni test tasks reads no stdin. Pass a page path or URL.\");\n }\n if (task !== undefined && journeyIds.length > 0) {\n throw new TestError(\"--task and --journey both name the task. Pass one.\");\n }\n if (task !== undefined && targets.length === 0) {\n throw new TestError(\"--task needs a page or URL to start from.\");\n }\n if (task === undefined && journeyIds.length === 0 && targets.length > 0) {\n throw new TestError('a start page needs a task. Pass --task \"<what the reader wants>\" or --journey <id>.');\n }\n const missing = targets.filter((t) => !isUrl(t) && !existsSync(resolve(cwd, t))).map((t) => t.replace(/\\\\/g, \"/\"));\n if (missing.length > 0) throw new TestError(notFoundMessage(missing));\n let workspaceOverride: { abs: string; display: string } | undefined;\n if (opts.workspace !== undefined) {\n const abs = resolve(cwd, opts.workspace);\n if (!existsSync(abs)) throw new TestError(`--workspace \"${opts.workspace}\" does not exist.`);\n workspaceOverride = { abs, display: opts.workspace.replace(/\\\\/g, \"/\") };\n }\n\n const file = await loadConfig(cwd, opts.configPath);\n const configDir = file?.dir ?? cwd;\n const claude = file?.tools[\"claude-cli\"] ?? {};\n const mcpConfig = file === null ? undefined : claudeCliMcpConfigPath(file.tools, file.dir);\n let mcpServers: string[] = [];\n if (file !== null && mcpConfig !== undefined) {\n const label = `${file.source}: tools.claude-cli.mcpConfig \"${claude.mcpConfig ?? \"\"}\"`;\n if (!existsSync(mcpConfig)) throw new TestError(`${label} does not exist.`);\n mcpServers = mcpServerNames(mcpConfig, label);\n }\n const maxTurns = claude.maxTurns ?? DEFAULT_CLAUDE_CLI_MAX_TURNS;\n\n const records = loadTaskRecords(file, cwd);\n const pathStart = (abs: string): TaskStart => ({ kind: \"path\", display: toPosix(relative(cwd, abs)) || \".\", abs });\n const targetStarts: TaskStart[] = targets.map((t) =>\n isUrl(t) ? { kind: \"url\", url: t } : { kind: \"path\", display: t.replace(/\\\\/g, \"/\"), abs: resolve(cwd, t) },\n );\n const explicitPersonas: TaskPersona[] = [];\n for (const id of personaIds) explicitPersonas.push(await records.persona(id));\n\n // Each task with the journey it came from (none for `--task`).\n let journeys: TaskJourney[] = [];\n if (task === undefined) {\n if (journeyIds.length > 0) {\n for (const id of journeyIds) journeys.push(await records.journey(id));\n } else {\n journeys = await records.golden();\n if (journeys.length === 0) {\n if (opts.allowEmpty === true) return { runs: [], summary: { runs: 0, passed: 0, failed: 0, warnings: 0 }, exitCode: 0 };\n throw new TestError(NOTHING_TO_RUN);\n }\n }\n }\n\n const specs: TaskSpec[] = [];\n if (task !== undefined) {\n const personas = explicitPersonas.length > 0 ? explicitPersonas : [null];\n for (const start of targetStarts) {\n for (const persona of personas) {\n specs.push({\n task,\n journey: null,\n persona,\n start,\n workspaceSeed: workspaceOverride?.abs ?? null,\n workspaceDisplay: workspaceOverride?.display ?? null,\n });\n }\n }\n }\n for (const journey of journeys) {\n let starts = targetStarts;\n if (starts.length === 0) {\n const entry = journey.entryPoint;\n if (entry === undefined) {\n throw new TestError(\n `journey \"${journey.id}\" has no entry-point:. Add one to ${journey.file}, or pass the page to start from.`,\n );\n }\n if (isUrl(entry.value)) {\n starts = [{ kind: \"url\", url: entry.value }];\n } else {\n starts = [pathStart(recordedPath(\"entry-point\", entry, configDir))];\n }\n }\n let seed = workspaceOverride ?? null;\n if (seed === null && journey.workspace !== undefined) {\n const abs = recordedPath(\"workspace\", journey.workspace, configDir);\n seed = { abs, display: toPosix(relative(cwd, abs)) || \".\" };\n }\n let personas: (TaskPersona | null)[] = explicitPersonas;\n if (personas.length === 0) {\n personas = [];\n for (const id of journey.personas) personas.push(await records.persona(id, journey));\n if (personas.length === 0) personas = [null];\n }\n for (const start of starts) {\n for (const persona of personas) {\n specs.push({\n task: journey.title,\n journey,\n persona,\n start,\n workspaceSeed: seed?.abs ?? null,\n workspaceDisplay: seed?.display ?? null,\n });\n }\n }\n }\n\n const runs: TaskRun[] = [];\n for (const spec of specs) {\n runs.push(\n await asTestError(() =>\n runOne(spec, {\n cwd,\n file,\n configDir,\n maxTurns,\n ...(claude.model === undefined ? {} : { model: claude.model }),\n ...(mcpConfig === undefined ? {} : { mcpConfig }),\n mcpServers,\n opts,\n }),\n ),\n );\n }\n const passed = runs.filter((r) => r.outcome === \"pass\").length;\n const warnings = runs\n .flatMap((r) => r.evals)\n .filter((e) => e.severity === \"warning\" && e.outcome !== \"pass\" && e.outcome !== \"skipped\").length;\n return {\n runs,\n summary: { runs: runs.length, passed, failed: runs.length - passed, warnings },\n exitCode: passed === runs.length ? 0 : 1,\n };\n}\n\ninterface RunContext {\n cwd: string;\n file: ConfigFile | null;\n configDir: string;\n maxTurns: number;\n model?: string;\n mcpConfig?: string;\n mcpServers: string[];\n opts: RunTasksOptions;\n}\n\n/** A path a journey names, resolved; one that is not there is a broken record. */\nfunction recordedPath(\n key: string,\n path: { value: string; location: SourceLocation },\n configDir: string,\n): string {\n const abs = resolve(configDir, path.value);\n if (!existsSync(abs)) {\n throw new TestError(`${path.location.file}:${String(path.location.line)}: ${key} \"${path.value}\" does not exist.`);\n }\n return abs;\n}\n\n/**\n * Claim a run directory and return its id. Creating a directory either\n * succeeds or fails with `EEXIST`, so two runs started in the same second, in\n * this process or another, never share one; the later takes `-2`, `-3`, ….\n */\nasync function claimRunDir(dir: string, base: string): Promise<string> {\n await mkdir(dir, { recursive: true });\n for (let n = 1; ; n++) {\n const id = n === 1 ? base : `${base}-${String(n)}`;\n try {\n await mkdir(join(dir, id));\n return id;\n } catch (err) {\n if (!(err instanceof Error && \"code\" in err && err.code === \"EEXIST\")) throw err;\n }\n }\n}\n\nasync function runOne(spec: TaskSpec, ctx: RunContext): Promise<TaskRun> {\n const { opts } = ctx;\n const label = labelOf(spec);\n const who = spec.persona?.id ?? \"newcomer\";\n const tasksDir = join(ctx.configDir, \".manni\", \"test\", \"tasks\");\n const id = await claimRunDir(tasksDir, `${stamp((opts.now ?? (() => new Date()))())}-${spec.journey?.id ?? \"task\"}-${who}`);\n const runDir = join(tasksDir, id);\n const tracePath = join(runDir, \"trace.jsonl\");\n await writeFile(tracePath, \"\");\n\n const dirs = await prepareRun(spec.start, spec.workspaceSeed, ctx.file);\n try {\n const role = rolePrompt(spec.persona);\n const roleFile = join(dirs.root, \"role.md\");\n const startFromWorkspace =\n dirs.startCopy === null ? null : toPosix(relative(dirs.workspaceDir, dirs.startCopy));\n const brief = taskBriefFor(spec, startFromWorkspace);\n await writeFile(roleFile, role);\n await writeFile(join(runDir, \"role.md\"), role);\n await writeFile(join(runDir, \"brief.md\"), brief);\n\n if (opts.progress === true) {\n const where =\n spec.workspaceDisplay === null ? \"in an empty directory\" : `in a fresh copy of ${spec.workspaceDisplay}`;\n process.stderr.write(`${label}: starting ${where}\\n`);\n }\n const lines = lineSplitter((line) => {\n if (opts.progress !== true || line === \"\") return;\n for (const use of toolUses(line)) {\n process.stderr.write(`${progressLine(who, use.name, use.input, dirs.workspaceDir)}\\n`);\n }\n });\n // Appends are chained so the file keeps the stream's order.\n let writing = Promise.resolve();\n const result = await (opts.spawn ?? realClaudeCodeSpawn)(\n claudeCodeArgs({\n roleFile,\n maxTurns: ctx.maxTurns,\n ...(ctx.model === undefined ? {} : { model: ctx.model }),\n ...(ctx.mcpConfig === undefined ? {} : { mcpConfig: ctx.mcpConfig }),\n mcpServers: ctx.mcpServers,\n docsDir: dirs.docsDir,\n }),\n {\n cwd: dirs.workspaceDir,\n stdin: brief,\n env: claudeCodeEnv(dirs.globalDir),\n onStdout: (chunk) => {\n writing = writing.then(() => appendFile(tracePath, chunk));\n lines.push(chunk);\n },\n },\n );\n lines.end();\n await writing;\n const outcome = classifyRun(result, label);\n\n const trace = await parseTraceFile(tracePath);\n const changes = await workspaceChanges(spec.workspaceSeed, dirs.workspaceDir);\n const account = trace.assistantTexts.at(-1) ?? \"\";\n const judged = await (opts.judge ?? judgeRun)(\n {\n spec,\n trace,\n tracePath,\n workspaceDir: dirs.workspaceDir,\n docsDir: dirs.docsDir,\n startCopy: dirs.startCopy,\n account,\n changes,\n configDir: ctx.configDir,\n },\n {\n ...(opts.provider === undefined ? {} : { provider: opts.provider }),\n ...(opts.model === undefined ? {} : { model: opts.model }),\n providers: ctx.file?.providers ?? {},\n ...(opts.judgeProvider === undefined ? {} : { judgeProvider: opts.judgeProvider }),\n },\n );\n let kept: string | null = null;\n if (opts.keep === true) {\n kept = dirs.workspaceDir;\n notice(`kept ${label}'s workspace: ${kept}`);\n }\n const usage = trace.usage;\n return {\n id,\n journey: spec.journey?.id ?? null,\n task: spec.task,\n persona: spec.persona?.id ?? null,\n start: spec.start.kind === \"url\" ? spec.start.url : spec.start.display,\n workspace: spec.workspaceDisplay,\n kept,\n trace: toPosix(relative(ctx.cwd, tracePath)),\n turns: trace.turnCount,\n durationMs: outcome.durationMs,\n stoppedAtLimit: outcome.stoppedAtLimit,\n maxTurns: ctx.maxTurns,\n usage: {\n inputTokens: usage?.inputTokens ?? 0,\n outputTokens: usage?.outputTokens ?? 0,\n ...(usage?.totalCostUsd === undefined ? {} : { costUsd: usage.totalCostUsd }),\n },\n docs: judged.docs,\n changes,\n account,\n evals: judged.evals,\n outcome: runOutcome(judged.evals),\n };\n } finally {\n if (opts.keep !== true) await removeRunDir(dirs.root, label);\n }\n}\n\n/**\n * Remove a run's temp directory, or say why not. A process the synthetic\n * user started, such as a browser, can outlive Claude Code and hold a file\n * open, and on Windows that fails the removal. The run is over by then, so\n * its report still prints and its exit code stands.\n */\nasync function removeRunDir(root: string, label: string): Promise<void> {\n try {\n // Retries cover a process that is still exiting.\n await rm(root, { recursive: true, force: true, maxRetries: 3, retryDelay: 500 });\n } catch (err) {\n warn(\n `could not remove ${root} after ${label}: ${errorMessage(err)}. ` +\n \"A process the synthetic user started may still hold it; remove it by hand.\",\n );\n }\n}\n","/**\n * The Claude Code process seam: the only module that starts `claude`. Unit\n * tests inject a `ClaudeCodeSpawn`; the real one is `realClaudeCodeSpawn`.\n *\n * The argv is the one the build's spike settled (plan §4.5): stream-json out,\n * no session saved, none of the user's settings, plugins, hooks or MCP\n * servers, a fixed tool set, and permission to use exactly that set without\n * asking. Whether a run produced a result is read from its final `result`\n * event, never from the exit code, which is 1 both at the turn limit and\n * when Claude Code is signed out.\n */\nimport { spawn } from \"node:child_process\";\nimport { readFileSync, statSync } from \"node:fs\";\nimport { isAbsolute, join, relative, sep, win32 } from \"node:path\";\nimport type { ExecResult } from \"@hawkeyexl/inference\";\nimport { outputTail, realExec } from \"../../shared/exec.js\";\nimport { TestError } from \"../errors.js\";\n\n/**\n * Start Claude Code with `args` (its own flags, no program name), feed it\n * `stdin`, and wait. Each stdout chunk is handed to `onStdout` as it arrives;\n * the output is also returned whole.\n */\nexport type ClaudeCodeSpawn = (\n args: string[],\n opts: {\n cwd: string;\n stdin: string;\n env: Record<string, string | undefined>;\n onStdout: (chunk: string) => void;\n },\n) => Promise<ExecResult>;\n\nexport const CLAUDE_CODE_NOT_ON_PATH =\n \"Claude Code is not on PATH. Install it with npm install -g @anthropic-ai/claude-code, sign in, and run again.\";\n\n/** The tools the synthetic user gets. `Bash` and no `PowerShell`, so a golden eval naming `Bash` holds on Windows. */\nexport const TASK_TOOLS = [\"Read\", \"Write\", \"Edit\", \"Glob\", \"Grep\", \"Bash\", \"WebFetch\"] as const;\n\n/** No timeout: the turn limit bounds a run. */\nconst NO_TIMEOUT = 2 ** 31 - 1;\n\nexport interface ClaudeCodeArgs {\n roleFile: string;\n maxTurns: number;\n model?: string;\n /** Absolute. */\n mcpConfig?: string;\n /** The server names in `mcpConfig`, each allowed as `mcp__<name>`. */\n mcpServers: string[];\n /** The docs copy, for a path start. */\n docsDir: string | null;\n}\n\nexport function claudeCodeArgs(opts: ClaudeCodeArgs): string[] {\n // On purpose, the two lists differ. `--tools` picks from Claude Code's\n // built-in tools only; MCP tools arrive through `--mcp-config` and need\n // naming in `--allowedTools` alone to run without a prompt.\n const tools = TASK_TOOLS.join(\",\");\n const allowed = [...TASK_TOOLS, ...opts.mcpServers.map((name) => `mcp__${name}`)].join(\",\");\n return [\n \"-p\",\n \"--output-format\",\n \"stream-json\",\n \"--verbose\",\n \"--no-session-persistence\",\n \"--setting-sources\",\n \"\",\n \"--strict-mcp-config\",\n ...(opts.mcpConfig === undefined ? [] : [\"--mcp-config\", opts.mcpConfig]),\n \"--tools\",\n tools,\n \"--allowedTools\",\n allowed,\n \"--permission-mode\",\n \"dontAsk\",\n \"--append-system-prompt-file\",\n opts.roleFile,\n \"--max-turns\",\n String(opts.maxTurns),\n ...(opts.model === undefined ? [] : [\"--model\", opts.model]),\n ...(opts.docsDir === null ? [] : [\"--add-dir\", opts.docsDir]),\n ];\n}\n\n/** The `mcpServers` names in an MCP config file. */\nexport function mcpServerNames(path: string, label: string): string[] {\n let parsed: unknown;\n try {\n parsed = JSON.parse(readFileSync(path, \"utf8\"));\n } catch {\n throw new TestError(`${label} is not a JSON file Claude Code can read.`);\n }\n const servers =\n typeof parsed === \"object\" && parsed !== null ? (parsed as Record<string, unknown>)[\"mcpServers\"] : undefined;\n return typeof servers === \"object\" && servers !== null && !Array.isArray(servers) ? Object.keys(servers) : [];\n}\n\n/**\n * The environment Claude Code runs in: the caller's, with the npm global\n * prefix moved into the run, and that prefix's bin first on PATH, so a\n * global install the docs ask for lands in the run and goes with it.\n */\nexport function claudeCodeEnv(\n globalDir: string,\n env: NodeJS.ProcessEnv = process.env,\n platform: NodeJS.Platform = process.platform,\n): Record<string, string | undefined> {\n // Windows keeps the variable as `Path`; a second `PATH` beside it is ambiguous.\n const pathKey = Object.keys(env).find((key) => key.toUpperCase() === \"PATH\") ?? \"PATH\";\n const bin = platform === \"win32\" ? globalDir : join(globalDir, \"bin\");\n const current = env[pathKey];\n const sepr = platform === \"win32\" ? \";\" : \":\";\n return {\n ...env,\n NPM_CONFIG_PREFIX: globalDir,\n [pathKey]: current === undefined || current === \"\" ? bin : `${bin}${sepr}${current}`,\n };\n}\n\n/** One line per tool call, for `--progress`. */\nexport function progressLine(who: string, tool: string, input: Record<string, unknown>, workspaceDir: string): string {\n const main =\n [\"file_path\", \"path\", \"command\", \"pattern\", \"url\", \"query\"].map((k) => input[k]).find((v) => typeof v === \"string\") ??\n Object.values(input).find((v) => typeof v === \"string\");\n let shown = typeof main === \"string\" ? main.replace(/\\s+/g, \" \").trim() : \"\";\n if (isAbsolute(shown) && !/\\s/.test(shown)) {\n shown = relative(workspaceDir, shown).split(sep).join(\"/\");\n }\n return ` ${who} › ${tool}${shown === \"\" ? \"\" : ` ${shown.slice(0, 80)}`}`;\n}\n\n/** The `tool_use` blocks in one stream-json line. */\nexport function toolUses(line: string): { name: string; input: Record<string, unknown> }[] {\n const rec = parseLine(line);\n if (rec?.[\"type\"] !== \"assistant\") return [];\n const message = rec[\"message\"];\n const content =\n typeof message === \"object\" && message !== null ? (message as Record<string, unknown>)[\"content\"] : undefined;\n if (!Array.isArray(content)) return [];\n return content.flatMap((block: unknown) => {\n if (typeof block !== \"object\" || block === null) return [];\n const b = block as Record<string, unknown>;\n if (b[\"type\"] !== \"tool_use\" || typeof b[\"name\"] !== \"string\") return [];\n const input = typeof b[\"input\"] === \"object\" && b[\"input\"] !== null ? (b[\"input\"] as Record<string, unknown>) : {};\n return [{ name: b[\"name\"], input }];\n });\n}\n\nfunction parseLine(line: string): Record<string, unknown> | undefined {\n try {\n const rec: unknown = JSON.parse(line);\n return typeof rec === \"object\" && rec !== null && !Array.isArray(rec) ? (rec as Record<string, unknown>) : undefined;\n } catch {\n return undefined;\n }\n}\n\n/** Calls `onLine` with each complete line of a stream fed in chunks. */\nexport function lineSplitter(onLine: (line: string) => void): { push(chunk: string): void; end(): void } {\n let buffer = \"\";\n return {\n push(chunk) {\n buffer += chunk;\n let at = buffer.indexOf(\"\\n\");\n while (at !== -1) {\n onLine(buffer.slice(0, at).trim());\n buffer = buffer.slice(at + 1);\n at = buffer.indexOf(\"\\n\");\n }\n },\n end() {\n if (buffer.trim() !== \"\") onLine(buffer.trim());\n buffer = \"\";\n },\n };\n}\n\nexport interface RunOutcome {\n stoppedAtLimit: boolean;\n durationMs: number;\n}\n\n/**\n * Read the run's final `result` event. The turn limit is a normal end; an\n * error result, or none at all, means Claude Code never did the task.\n */\nexport function classifyRun(result: ExecResult, label: string): RunOutcome {\n if (result.spawnError !== undefined) throw new TestError(CLAUDE_CODE_NOT_ON_PATH);\n let last: Record<string, unknown> | undefined;\n for (const line of result.stdout.split(\"\\n\")) {\n const rec = parseLine(line.trim());\n if (rec?.[\"type\"] === \"result\") last = rec;\n }\n const durationMs = typeof last?.[\"duration_ms\"] === \"number\" ? last[\"duration_ms\"] : 0;\n if (last?.[\"subtype\"] === \"error_max_turns\") return { stoppedAtLimit: true, durationMs };\n if (last !== undefined && last[\"is_error\"] !== true) return { stoppedAtLimit: false, durationMs };\n const said = typeof last?.[\"result\"] === \"string\" && last[\"result\"].trim() !== \"\" ? last[\"result\"].trim() : undefined;\n const why = said ?? (outputTail(result) || `exit ${String(result.code)}`);\n throw new TestError(`Claude Code stopped without a result for ${label}: ${why}`);\n}\n\n/** How Claude Code is started on this host. */\nexport interface ClaudeLaunch {\n command: string;\n args: string[];\n /** Only a `.cmd` shim with no script to run directly: started through `realExec`, without streaming. */\n viaShim: boolean;\n}\n\n/**\n * On Windows, Node starts a `.exe` on PATH but not a `.cmd` shim. An npm\n * global install puts a shim there, so the program it points at is run\n * directly: a script with node, an executable as is.\n */\nexport function claudeLaunchFor(\n args: string[],\n host: { platform: NodeJS.Platform; path: string; isFile: (path: string) => boolean; read: (path: string) => string },\n): ClaudeLaunch {\n if (host.platform !== \"win32\") return { command: \"claude\", args, viaShim: false };\n for (const entry of host.path.split(\";\")) {\n const dir = entry.replace(/^\"(.*)\"$/, \"$1\");\n if (dir === \"\") continue;\n const exe = win32.join(dir, \"claude.exe\");\n if (host.isFile(exe)) return { command: exe, args, viaShim: false };\n const shim = win32.join(dir, \"claude.cmd\");\n if (!host.isFile(shim)) continue;\n const target = /\"%~?dp0%?\\\\([^\"]+)\"/.exec(host.read(shim))?.[1];\n const abs = target === undefined ? undefined : win32.resolve(win32.dirname(shim), target);\n if (abs !== undefined && host.isFile(abs)) {\n const ext = win32.extname(abs).toLowerCase();\n if (ext === \".js\" || ext === \".cjs\" || ext === \".mjs\") {\n return { command: process.execPath, args: [abs, ...args], viaShim: false };\n }\n if (ext === \".exe\") return { command: abs, args, viaShim: false };\n }\n break;\n }\n return { command: \"claude\", args, viaShim: true };\n}\n\nfunction isFile(path: string): boolean {\n try {\n return statSync(path).isFile();\n } catch {\n return false;\n }\n}\n\nexport const realClaudeCodeSpawn: ClaudeCodeSpawn = async (args, opts) => {\n const launch = claudeLaunchFor(args, {\n platform: process.platform,\n path: process.env[\"PATH\"] ?? \"\",\n isFile,\n read: (path) => readFileSync(path, \"utf8\"),\n });\n if (launch.viaShim) {\n // ponytail: a shim with no script beside it is captured and replayed\n // rather than streamed live.\n const result = await realExec([launch.command, ...launch.args], {\n cwd: opts.cwd,\n env: opts.env,\n input: opts.stdin,\n timeoutMs: NO_TIMEOUT,\n });\n opts.onStdout(result.stdout);\n return result;\n }\n return new Promise((settle) => {\n let stdout = \"\";\n let stderr = \"\";\n const child = spawn(launch.command, launch.args, {\n cwd: opts.cwd,\n env: opts.env,\n stdio: [\"pipe\", \"pipe\", \"pipe\"],\n windowsHide: true,\n });\n child.stdin.on(\"error\", () => undefined);\n child.stdin.end(opts.stdin);\n child.stdout.setEncoding(\"utf8\");\n child.stderr.setEncoding(\"utf8\");\n child.stdout.on(\"data\", (chunk: string) => {\n stdout += chunk;\n opts.onStdout(chunk);\n });\n child.stderr.on(\"data\", (chunk: string) => {\n stderr += chunk;\n });\n child.on(\"error\", (err) => {\n settle({ code: null, stdout, stderr, timedOut: false, spawnError: err.message });\n });\n child.on(\"close\", (code) => {\n settle({ code, stdout, stderr, timedOut: false });\n });\n });\n};\n","/**\n * Judging a finished run (plan §4.6, §4.7): the evals it carries, graded\n * against its trace, its workspace and the docs the reader had.\n *\n * Nothing here grades on its own. Deterministic evals run through tracevals'\n * grader registry with the workspace as the project root, judged evals through\n * tracevals' ensemble judge, and the judge's provider comes from tracevals'\n * own selection. A run is one session governed by one task, so each eval plan\n * carries a synthetic project-rules artifact: its window is the whole session,\n * and its content is the task brief the judge reads as the source.\n */\nimport { join, relative, sep } from \"node:path\";\nimport type { InferenceProvider } from \"@hawkeyexl/inference\";\nimport { mapConcurrent } from \"../../shared/concurrency.js\";\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { LOCAL_PROVIDER } from \"../../shared/providers.js\";\nimport { evidenceVerdict } from \"../../shared/verdict-lines.js\";\nimport type { ResolvedArtifact } from \"../../tracevals/artifacts/types.js\";\nimport { parseConfig } from \"../../tracevals/core/config.js\";\nimport type { EvalLocation, EvalPlan } from \"../../tracevals/core/plan.js\";\nimport type { EvalEntry } from \"../../tracevals/evals/extract.js\";\nimport { graderFor } from \"../../tracevals/graders/registry.js\";\nimport { REDO_OR_FIX } from \"../../tracevals/graders/util.js\";\nimport {\n constructProvider,\n makeJudgeProvider,\n resolveProviderIdentity,\n} from \"../../tracevals/judge/provider.js\";\nimport { makeTraceJudge, type JudgedEval } from \"../../tracevals/judge/trace-judge.js\";\nimport { TracevalsError } from \"../../tracevals/types.js\";\nimport { TestError } from \"../errors.js\";\nimport { renderEvidence, taskBrief } from \"./evidence.js\";\nimport type {\n JudgeRun,\n JudgeRunOptions,\n RunEvidence,\n SourceLocation,\n TaskEval,\n} from \"./task-types.js\";\n\nexport const FOLLOWED_THE_DOCS_ID = \"followed-the-docs\";\nexport const FOLLOWED_THE_DOCS =\n \"Every step the reader took came from the docs it had, or from what the persona already knows. It did not guess or lean on outside knowledge.\";\nexport const SUCCESS_ID = \"success\";\nexport const COMPLETED_ID = \"completed\";\nexport const CONSTRAINT_ID = \"constraint\";\n\n/** One eval as reported, and the plan that grades it. */\ninterface Slot {\n base: Omit<TaskEval, \"outcome\">;\n plan: EvalPlan;\n}\n\nexport const judgeRun: JudgeRun = async (evidence, options) => {\n const { spec } = evidence;\n const seen = renderEvidence(evidence);\n const artifact: ResolvedArtifact = {\n name: spec.journey?.id ?? \"task\",\n type: \"project-rules\",\n path: spec.journey === null ? \"task\" : join(evidence.configDir, spec.journey.file),\n content: taskBrief(evidence),\n origin: \"project\",\n };\n const providers = await providersFor(options);\n const source = taskSource(evidence);\n\n const slots: Slot[] = [];\n const judged = (\n id: string,\n assertion: string,\n severity: TaskEval[\"severity\"],\n location: SourceLocation | null,\n ): Slot => ({\n base: { id, grader: \"ai\", severity, assertion, location },\n plan: {\n artifact,\n evalName: id,\n assertion,\n grader: \"ai\",\n severity,\n implicit: false,\n location: planLocation(location),\n },\n });\n\n const journey = spec.journey;\n if (journey?.successCriteria !== undefined) {\n const { text, location } = journey.successCriteria;\n slots.push(judged(SUCCESS_ID, text, \"error\", location));\n }\n for (const { entry, location } of journey?.evals ?? []) {\n slots.push({\n base: {\n id: entry.id,\n grader: entry.grader,\n severity: entry.severity,\n assertion: entry.assertion,\n location,\n },\n plan: planFor(entry, artifact, location),\n });\n }\n // A write-in task, or a journey that says nothing about done, is judged on\n // the task alone. Nothing is derived: evals drawn from the docs asked for\n // the docs' own extras (a screenshot the sample took) and failed runs the\n // trace showed were done.\n if (slots.length === 0) {\n slots.push(judged(COMPLETED_ID, `The reader completed the task: ${spec.task}`, \"error\", source));\n }\n slots.push(judged(FOLLOWED_THE_DOCS_ID, FOLLOWED_THE_DOCS, \"warning\", source));\n for (const c of spec.persona?.constraints ?? []) {\n slots.push(judged(CONSTRAINT_ID, c.text, \"warning\", c.location));\n }\n\n const outcomes: (Pick<TaskEval, \"outcome\" | \"message\" | \"consensus\"> | undefined)[] = [];\n const toJudge: { i: number; plan: EvalPlan }[] = [];\n for (const [i, slot] of slots.entries()) {\n if (slot.plan.skipped === true) {\n outcomes[i] = { outcome: \"skipped\", message: slot.plan.skipReason };\n } else if (slot.plan.grader === \"ai\") {\n toJudge.push({ i, plan: slot.plan });\n } else {\n outcomes[i] = await gradeDeterministic(slot.plan, evidence);\n }\n }\n\n if (toJudge.length > 0) {\n const judge = makeTraceJudge({\n provider: providers.judge,\n ...(providers.providerFor === undefined ? {} : { providerFor: providers.providerFor }),\n noCache: true,\n });\n // One eval per call, several calls at once: each is an ensemble of\n // model calls, and judged one after another a run's seven evals took\n // twelve minutes on claude-cli.\n const verdicts = await mapConcurrent(toJudge, providers.concurrency, async (j) =>\n judge([j.plan], () => seen.text, { trace: evidence.trace, projectRoot: evidence.workspaceDir }),\n );\n verdicts.forEach(([v], n) => {\n const i = toJudge[n]?.i;\n if (i !== undefined && v !== undefined) outcomes[i] = fromVerdict(v);\n });\n }\n\n return {\n evals: slots.map((slot, i) => ({\n ...slot.base,\n ...(outcomes[i] ?? { outcome: \"error\", message: \"the judge returned no verdict for this eval\" }),\n })),\n docs: seen.docs,\n };\n};\n\n/** Judged evals in flight at once, except on a local model. */\nconst JUDGE_CONCURRENCY = 4;\n\ninterface Providers {\n judge: InferenceProvider;\n /** One local model context at a time: four exhausted memory (docevals ADR 01039). */\n concurrency: number;\n providerFor?: (choice: { provider?: string; model?: string; origin?: string }) => Promise<InferenceProvider>;\n}\n\n/**\n * The judge. Selection is tracevals'\n * own (`--provider`/`--model`, then `providers:`, then `auto`); its errors\n * leave as `TestError`s, so the CLI exits 2 with the message unchanged.\n */\nasync function providersFor(options: JudgeRunOptions): Promise<Providers> {\n if (options.judgeProvider !== undefined) {\n return { judge: options.judgeProvider, concurrency: 1 };\n }\n try {\n const config = parseConfig({}, { providers: options.providers });\n const flags = {\n ...(options.provider === undefined ? {} : { provider: options.provider }),\n ...(options.model === undefined ? {} : { model: options.model }),\n };\n const identity = await resolveProviderIdentity(config, flags);\n return {\n judge: constructProvider(config, identity),\n providerFor: (choice) => makeJudgeProvider(config, flags, choice),\n concurrency: identity.provider === LOCAL_PROVIDER ? 1 : JUDGE_CONCURRENCY,\n };\n } catch (err) {\n if (err instanceof TracevalsError) throw new TestError(err.message);\n throw err;\n }\n}\n\n/**\n * Where `completed` and `followed-the-docs` are annotated: the journey's\n * `title:` line, the start page's first line, or nowhere for a URL.\n */\nfunction taskSource(evidence: RunEvidence): SourceLocation | null {\n const { journey, start } = evidence.spec;\n if (journey !== null) return journey.titleLocation;\n if (start.kind === \"url\") return null;\n return {\n file: relative(evidence.configDir, start.abs).split(sep).join(\"/\"),\n line: 1,\n };\n}\n\nfunction planLocation(location: SourceLocation | null): EvalLocation {\n return location ?? { file: \"task\" };\n}\n\n/** A golden eval as tracevals' graders and judge read it. */\nfunction planFor(entry: EvalEntry, artifact: ResolvedArtifact, location: SourceLocation): EvalPlan {\n return {\n artifact,\n evalName: entry.id,\n assertion: entry.assertion,\n grader: entry.grader,\n severity: entry.severity,\n implicit: false,\n location: planLocation(location),\n options: entry.options,\n evidence: entry.evidence,\n examples: entry.examples,\n provider: entry.provider,\n model: entry.model,\n runs: entry.runs,\n target: entry.target,\n command: entry.command,\n successExitCodes: entry.successExitCodes,\n timeoutMs: entry.timeoutMs,\n generatedAssertionHash: entry.generatedAssertionHash,\n ...(entry.skip === true ? { skipped: true, skipReason: \"eval skipped via its own skip: true\" } : {}),\n };\n}\n\n/**\n * A deterministic eval, graded in the workspace: `command` runs there and a\n * `{ source: file }` target reads it. Any finding fails the eval; whether\n * that fails the run is the eval's severity, which the caller reads.\n */\nasync function gradeDeterministic(\n plan: EvalPlan,\n evidence: RunEvidence,\n): Promise<Pick<TaskEval, \"outcome\" | \"message\">> {\n const grader = graderFor(plan.grader);\n if (grader === undefined) {\n return { outcome: \"error\", message: `no grader \"${plan.grader}\"` };\n }\n try {\n const result = await grader.grade({\n trace: evidence.trace,\n plan,\n projectRoot: evidence.workspaceDir,\n });\n if (result.error !== undefined) return { outcome: \"error\", message: result.error };\n if (result.skipped !== undefined) return { outcome: \"skipped\", message: result.skipped };\n if (result.findings.length === 0) return { outcome: \"pass\" };\n return {\n outcome: \"fail\",\n // tracevals' advice names an artifact; a run is graded against a task.\n message: result.findings.map((f) => f.message.replace(` ${REDO_OR_FIX}`, \"\")).join(\" \"),\n };\n } catch (err) {\n return { outcome: \"error\", message: `${plan.grader}: ${errorMessage(err)}` };\n }\n}\n\nfunction fromVerdict(v: JudgedEval): Pick<TaskEval, \"outcome\" | \"message\" | \"consensus\"> {\n const reasoning = v.consensus === undefined ? undefined : evidenceVerdict(v.consensus)?.reasoning;\n return {\n outcome: v.outcome,\n message: v.error ?? v.skipReason ?? reasoning,\n ...(v.consensus === undefined\n ? {}\n : {\n consensus: {\n votes: { ...v.consensus.votes },\n meanConfidence: v.consensus.meanConfidence,\n },\n }),\n };\n}\n","/**\n * What the judge sees of a finished run (proposal plan §4.6): the trace, the\n * workspace's changes and the docs the reader had. Built once per run, and\n * every judged eval reads the same text.\n *\n * Every block is redacted before it is cut, as tracevals' own render does, so\n * a cap never leaves the prefix of a secret behind.\n */\nimport { readFileSync, realpathSync } from \"node:fs\";\nimport { isAbsolute, join, relative, resolve, sep } from \"node:path\";\nimport { makeRedactor } from \"../../tracevals/judge/redact.js\";\nimport type { TraceEvent } from \"../../tracevals/trace/types.js\";\nimport type { RunEvidence, TaskSpec } from \"./task-types.js\";\n\nexport const MAX_TOOL_RESULT_CHARS = 2_000;\nexport const MAX_FILE_CHARS = 4_000;\nexport const MAX_WORKSPACE_CHARS = 20_000;\nexport const MAX_DOCS_CHARS = 40_000;\n\nconst scrub = makeRedactor();\n\n/**\n * Redact, then cut to `max`, saying how much was left out. The note says the\n * cut is the judge's copy: a judge once read \"left out\" as the reader having\n * skimmed, and failed a constraint over it.\n */\nfunction clip(text: string, max: number): string {\n return budgeted(text, max).body;\n}\n\n/**\n * `clip`, plus how much of a shared budget the result uses: the redacted\n * text the judge is sent, never the raw length a redaction shortened.\n */\nfunction budgeted(text: string, max: number): { body: string; used: number } {\n const safe = scrub(text);\n if (safe.length <= max) return { body: safe, used: safe.length };\n return {\n body: `${safe.slice(0, max)} [manni shortened this for the judge; the reader received ${String(safe.length - max)} more characters]`,\n used: max,\n };\n}\n\n/** A page the reader had: its name in the `docs` list and its text. */\ninterface DocPage {\n name: string;\n text: string;\n}\n\nexport interface Evidence {\n /** The judge's view of the run, §4.6's three sections. */\n text: string;\n /** The docs section alone, as it appears inside `text`. */\n docsText: string;\n /** The pages in `docsText`, start page first: docs-relative POSIX paths, or URLs. */\n docs: string[];\n}\n\nexport function renderEvidence(evidence: RunEvidence): Evidence {\n const results = toolResults(evidence.trace.events);\n const { text: docsText, docs } = renderDocs(evidence, results);\n const text = [\n \"## The trace\",\n renderTrace(evidence, results),\n \"## The workspace\",\n renderWorkspace(evidence),\n \"## The docs the reader had\",\n docsText,\n ].join(\"\\n\\n\");\n return { text, docsText, docs };\n}\n\n/**\n * The task as the reader was told it: the task, what started it, when it is\n * done, and where to start. The judge reads it as the source its evals come\n * from.\n */\nexport function taskBrief(evidence: RunEvidence): string {\n const { spec } = evidence;\n const lines = [spec.task];\n if (spec.journey?.trigger !== undefined) lines.push(`What started this: ${spec.journey.trigger}`);\n if (spec.journey?.successCriteria !== undefined) {\n lines.push(`You're done when: ${spec.journey.successCriteria.text}`);\n }\n lines.push(`Start here: ${startName(evidence)}`);\n return [...lines, \"\", whoTheReaderIs(spec)].join(\"\\n\");\n}\n\n/** The start page as the docs list names it: docs-relative, or the URL. */\nfunction startName(evidence: RunEvidence): string {\n const { start } = evidence.spec;\n if (start.kind === \"url\") return start.url;\n if (evidence.docsDir !== null && evidence.startCopy !== null) {\n return toPosix(relative(real(evidence.docsDir), real(evidence.startCopy)));\n }\n return start.display;\n}\n\n/**\n * Who the reader played, so `followed-the-docs` can tell what the persona\n * already knew from what it guessed. Never the record's body.\n */\nfunction whoTheReaderIs(spec: TaskSpec): string {\n const p = spec.persona;\n if (p === null) return \"The reader: someone new to this product, with the task above and no other context.\";\n const lines = [`The reader: ${[p.title ?? p.id, p.description].filter(Boolean).join(\". \")}`];\n if (p.role !== undefined) lines.push(`Role: ${p.role}`);\n if (p.proficiency.length > 0) lines.push(`Already good at: ${p.proficiency.join(\"; \")}`);\n if (p.prerequisites.length > 0) lines.push(`Knows before starting: ${p.prerequisites.join(\"; \")}`);\n return lines.join(\"\\n\");\n}\n\n/** A tool result's text and the call it answers, keyed by `tool_use_id`. */\ninterface ToolResult {\n id: string;\n text: string;\n}\n\n/**\n * Each tool result in the stream, in order, keyed by the event it rode in.\n * One user record can carry several results.\n */\nfunction toolResults(events: TraceEvent[]): Map<number, ToolResult[]> {\n const out = new Map<number, ToolResult[]>();\n for (const event of events) {\n if (event.kind !== \"tool_result\") continue;\n const message = event.raw.message;\n const content = isRecord(message) ? message.content : undefined;\n if (!Array.isArray(content)) continue;\n const found: ToolResult[] = [];\n for (const block of content as unknown[]) {\n if (!isRecord(block) || block.type !== \"tool_result\") continue;\n if (typeof block.tool_use_id !== \"string\") continue;\n found.push({ id: block.tool_use_id, text: resultText(block.content) });\n }\n out.set(event.index, found);\n }\n return out;\n}\n\nfunction resultText(content: unknown): string {\n if (typeof content === \"string\") return content;\n if (!Array.isArray(content)) return \"\";\n return (content as unknown[])\n .map((b) => (isRecord(b) && typeof b.text === \"string\" ? b.text : \"\"))\n .filter((t) => t !== \"\")\n .join(\"\\n\");\n}\n\nfunction renderTrace(evidence: RunEvidence, results: Map<number, ToolResult[]>): string {\n const { trace } = evidence;\n const callName = new Map<string, string>();\n const lines: string[] = [];\n for (const event of trace.events) {\n switch (event.kind) {\n case \"user\":\n if (event.text) lines.push(`[user] ${clip(event.text, MAX_TOOL_RESULT_CHARS)}`);\n break;\n case \"assistant\":\n if (event.text) lines.push(`[assistant] ${clip(event.text, MAX_TOOL_RESULT_CHARS)}`);\n break;\n case \"tool_call\": {\n const name = event.toolName ?? \"?\";\n if (typeof event.raw.id === \"string\") callName.set(event.raw.id, name);\n const input = JSON.stringify(event.raw.input ?? {});\n lines.push(`[tool] ${name} ${clip(input, MAX_TOOL_RESULT_CHARS)}`);\n break;\n }\n case \"tool_result\":\n for (const r of results.get(event.index) ?? []) {\n lines.push(`[result of ${callName.get(r.id) ?? r.id}] ${clip(r.text, MAX_TOOL_RESULT_CHARS)}`);\n }\n break;\n default:\n break;\n }\n }\n return lines.length > 0 ? lines.join(\"\\n\") : \"(no events)\";\n}\n\nfunction renderWorkspace(evidence: RunEvidence): string {\n const { added, changed, removed } = evidence.changes;\n const lines: string[] = [];\n if (added.length > 0) lines.push(`added: ${added.join(\", \")}`);\n if (changed.length > 0) lines.push(`changed: ${changed.join(\", \")}`);\n if (removed.length > 0) lines.push(`removed: ${removed.join(\", \")}`);\n if (lines.length === 0) return \"No file was added, changed or removed.\";\n\n let room = MAX_WORKSPACE_CHARS;\n for (const file of [...added, ...changed]) {\n const content = readText(join(evidence.workspaceDir, file));\n if (content === undefined) continue;\n if (room <= 0) {\n lines.push(`\\n### ${file}\\n[left out: the workspace's ${String(MAX_WORKSPACE_CHARS)}-character limit is reached]`);\n continue;\n }\n const { body, used } = budgeted(content, Math.min(MAX_FILE_CHARS, room));\n room -= used;\n lines.push(`\\n### ${file}\\n${body}`);\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * The start page, then each page the reader opened, in order and once each:\n * a Read inside the docs copy, or a WebFetch and what it returned.\n */\nfunction renderDocs(\n evidence: RunEvidence,\n results: Map<number, ToolResult[]>,\n): { text: string; docs: string[] } {\n const { trace, spec, docsDir, startCopy } = evidence;\n const fetched = new Map<string, string>();\n const byId = new Map<string, string>();\n for (const list of results.values()) for (const r of list) byId.set(r.id, r.text);\n\n const pages: DocPage[] = [];\n const seen = new Set<string>();\n const add = (key: string, page: DocPage | undefined): void => {\n if (page === undefined || seen.has(key)) return;\n seen.add(key);\n pages.push(page);\n };\n const docsRoot = docsDir === null ? null : real(docsDir);\n const docPage = (file: string): DocPage | undefined => {\n if (docsRoot === null) return undefined;\n const rel = relative(docsRoot, real(file));\n if (rel === \"\" || rel === \"..\" || rel.startsWith(`..${sep}`) || isAbsolute(rel)) return undefined;\n const text = readText(file);\n return text === undefined ? undefined : { name: toPosix(rel), text };\n };\n\n // WebFetch results by URL, for a URL start the reader fetched.\n for (const event of trace.events) {\n if (event.kind !== \"tool_call\" || event.toolName !== \"WebFetch\") continue;\n const url = inputOf(event).url;\n const id = event.raw.id;\n if (typeof url === \"string\" && typeof id === \"string\" && !fetched.has(url)) {\n fetched.set(url, byId.get(id) ?? \"\");\n }\n }\n\n if (spec.start.kind === \"url\") {\n const text = fetched.get(spec.start.url);\n if (text !== undefined) add(urlKey(spec.start.url), { name: spec.start.url, text });\n } else if (startCopy !== null) {\n add(pathKey(startCopy), docPage(startCopy));\n }\n\n for (const event of trace.events) {\n if (event.kind !== \"tool_call\") continue;\n const input = inputOf(event);\n if (event.toolName === \"Read\" && typeof input.file_path === \"string\") {\n add(pathKey(input.file_path), docPage(input.file_path));\n } else if (event.toolName === \"WebFetch\" && typeof input.url === \"string\") {\n add(urlKey(input.url), { name: input.url, text: fetched.get(input.url) ?? \"\" });\n }\n }\n\n const blocks: string[] = [];\n const docs: string[] = [];\n let room = MAX_DOCS_CHARS;\n for (const page of pages) {\n if (room <= 0) break;\n const { body, used } = budgeted(page.text, room);\n blocks.push(`### ${page.name}\\n${body}`);\n room -= used;\n docs.push(page.name);\n }\n return {\n text: blocks.length > 0 ? blocks.join(\"\\n\\n\") : \"The reader opened no page of the docs.\",\n docs,\n };\n}\n\nfunction inputOf(event: TraceEvent): Record<string, unknown> {\n const input = event.raw.input;\n return isRecord(input) ? input : {};\n}\n\n/**\n * One spelling per file. The stream can name the docs copy by its 8.3 short\n * form on Windows (`C:\\Users\\HAWKEY~1\\...`) and the long form elsewhere, and\n * Windows paths compare without case.\n */\nfunction pathKey(file: string): string {\n const key = real(file);\n return process.platform === \"win32\" ? `file:${key.toLowerCase()}` : `file:${key}`;\n}\n\nfunction urlKey(url: string): string {\n return `url:${url}`;\n}\n\n/** The long, canonical spelling of a path that exists; the resolved one otherwise. */\nfunction real(file: string): string {\n try {\n return realpathSync.native(file);\n } catch {\n return resolve(file);\n }\n}\n\n/** A text file's contents, or undefined for a missing or binary one. */\nfunction readText(file: string): string | undefined {\n let bytes: Buffer;\n try {\n bytes = readFileSync(file);\n } catch {\n return undefined;\n }\n if (bytes.subarray(0, 8_000).includes(0)) return undefined;\n return bytes.toString(\"utf8\");\n}\n\nfunction toPosix(path: string): string {\n return path.split(sep).join(\"/\");\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","/**\n * What the synthetic user is told (plan §4.5): the role prompt, appended to\n * Claude Code's system prompt, and the task brief, its first message. A\n * persona's fields go in, one line each when set; its body never does.\n */\nimport type { TaskPersona, TaskSpec } from \"./task-types.js\";\n\nconst NEWCOMER = \"Someone new to this product, with the task below and no other context.\";\n\nconst HOW_TO_WORK = [\n \"How to work:\",\n \"- Use what the documentation tells you, and what this person would already know.\",\n \"- Nobody is available to answer questions. When stuck, do what this person\",\n \" would do, or give up.\",\n \"- The current directory is yours. Treat the documentation as read-only.\",\n \"- When you finish or give up, end with a short account in this person's voice:\",\n \" whether you got it done, where you got stuck, and what in the docs helped or\",\n \" confused you.\",\n];\n\n/** A label and its items, one per line, or nothing when there are none. */\nfunction items(label: string, values: string[]): string[] {\n return values.length === 0 ? [] : [`${label}:`, ...values.map((v) => `- ${v}`)];\n}\n\nfunction whoYouAre(persona: TaskPersona | null): string[] {\n if (persona === null) return [NEWCOMER];\n const lines = [[persona.title ?? persona.id, persona.description].filter((v): v is string => v !== undefined).join(\". \")];\n if (persona.role !== undefined) lines.push(`Role: ${persona.role}`);\n if (persona.teamContext !== undefined) lines.push(`Team: ${persona.teamContext}`);\n lines.push(\n ...items(\"Already good at\", persona.proficiency),\n ...items(\"Knows before starting\", persona.prerequisites),\n ...items(\"Wants\", persona.goals),\n ...items(\"Frustrated by\", persona.pains),\n ...items(\n \"Your constraints\",\n persona.constraints.map((c) => c.text),\n ),\n );\n return lines;\n}\n\nexport function rolePrompt(persona: TaskPersona | null): string {\n return [\n \"You are taking part in a usability test of some documentation. You are playing\",\n \"a person, not an assistant. Stay in that person's shoes for the whole session.\",\n \"\",\n \"Who you are:\",\n ...whoYouAre(persona),\n \"\",\n ...HOW_TO_WORK,\n \"\",\n ].join(\"\\n\");\n}\n\n/**\n * The task, what started it and when it is done (a journey's, when set), and\n * where to start: the URL, or the start page's copy as seen from the workspace.\n */\nexport function taskBriefFor(spec: TaskSpec, startFromWorkspace: string | null): string {\n const lines = [spec.task];\n if (spec.journey?.trigger !== undefined) lines.push(`What started this: ${spec.journey.trigger}`);\n if (spec.journey?.successCriteria !== undefined) {\n lines.push(`You're done when: ${spec.journey.successCriteria.text}`);\n }\n const start = spec.start.kind === \"url\" ? spec.start.url : (startFromWorkspace ?? spec.start.display);\n lines.push(`Start here: ${start}`);\n return `${lines.join(\"\\n\")}\\n`;\n}\n","/**\n * The journey and persona records `manni test tasks` reads (plan §4.3).\n *\n * Which records exist, and which id names which, is the strategy domain's\n * answer: its loader reads the config's collections and its index resolves an\n * id. Each record used is then re-read through meta's extractor for the\n * fields strategy does not keep, with the line each sits on. A persona's body\n * is never read into anything.\n */\nimport { readFile } from \"node:fs/promises\";\nimport { extname, relative, resolve, sep } from \"node:path\";\nimport { extractorForExtension } from \"../../meta/internal.js\";\nimport type { ConfigFile } from \"../../shared/config-file.js\";\nimport { errorMessage, ToolError } from \"../../shared/errors.js\";\nimport { indexSet, type StrategyIndex } from \"../../strategy/core/check.js\";\nimport { unknownRecordMessage } from \"../../strategy/commands/get.js\";\nimport { loadStrategy } from \"../../strategy/commands/run.js\";\nimport type { RecordType, StrategyRecord, StrategySet } from \"../../strategy/types.js\";\nimport { artifactEvalsErrors } from \"../../tracevals/evals/schema.js\";\nimport { normalizeEntry } from \"../../tracevals/evals/extract.js\";\nimport { graderFor } from \"../../tracevals/graders/registry.js\";\nimport { TestError } from \"../errors.js\";\nimport type { SourceLocation, TaskJourney, TaskPersona } from \"./task-types.js\";\n\n/** The graders a task's eval may name. */\nexport const TASK_GRADERS = [\n \"ai\",\n \"command\",\n \"regex\",\n \"file-access\",\n \"tool-usage\",\n \"tool-order\",\n \"turn-count\",\n \"cost\",\n] as const;\n\nconst GRADER_LIST = `${TASK_GRADERS.slice(0, -1).join(\", \")} or ${TASK_GRADERS.at(-1) ?? \"\"}`;\n\nexport interface TaskRecords {\n /** `--journey <id>`: the journey, or a usage error. */\n journey(id: string): Promise<TaskJourney>;\n /** `--persona <id>`, or a name in a journey's `personas:` when `journey` is given. */\n persona(id: string, journey?: TaskJourney): Promise<TaskPersona>;\n /** Every journey that declares `evals:`, in set order. */\n golden(): Promise<TaskJourney[]>;\n}\n\n/** The fields read off a record file: its frontmatter and where each value sits. */\ninterface RecordFile {\n file: string;\n /** The config file's directory, which the record's paths resolve against. */\n dir: string;\n data: Record<string, unknown>;\n lineFor: (pointer: string) => number | undefined;\n}\n\nfunction text(value: unknown): string | undefined {\n return typeof value === \"string\" && value.trim() !== \"\" ? value : undefined;\n}\n\n/** A string or a list of strings, as a list. */\nfunction list(value: unknown): string[] {\n if (typeof value === \"string\") return value.trim() === \"\" ? [] : [value];\n if (!Array.isArray(value)) return [];\n return value.filter((v): v is string => typeof v === \"string\" && v.trim() !== \"\");\n}\n\n/** A sibling domain's `ToolError` reported as this domain's. */\nasync function asTestError<T>(work: () => Promise<T>): Promise<T> {\n try {\n return await work();\n } catch (err) {\n if (err instanceof ToolError && !(err instanceof TestError)) throw new TestError(err.message);\n throw err;\n }\n}\n\n/**\n * The records in the config's collections. A config with no collections holds\n * none, which is not an error until a record is asked for.\n */\nexport function loadTaskRecords(file: ConfigFile | null, cwd: string): TaskRecords {\n const configDir = file?.dir ?? cwd;\n let loaded: Promise<{ set: StrategySet; index: StrategyIndex; base: string }> | undefined;\n const load = (): Promise<{ set: StrategySet; index: StrategyIndex; base: string }> => {\n loaded ??= asTestError(async () => {\n if (file === null || file.collections.length === 0) {\n const set: StrategySet = { records: [], references: [] };\n return { set, index: indexSet(set), base: configDir };\n }\n const { set, run } = await loadStrategy({ cwd, inputs: [], configPath: file.path, allowEmpty: true });\n return { set, index: indexSet(set), base: run.base };\n });\n return loaded;\n };\n\n const readRecord = async (record: StrategyRecord, base: string): Promise<RecordFile> => {\n const abs = resolve(base, record.file);\n const file = relative(configDir, abs).split(sep).join(\"/\");\n const extractor = extractorForExtension(extname(abs));\n if (extractor === undefined) throw new TestError(`${file}: no reader for its extension.`);\n try {\n const extracted = extractor.extract(await readFile(abs, \"utf8\"), abs);\n return { file, dir: configDir, data: extracted.data, lineFor: extracted.lineFor };\n } catch (err) {\n throw new TestError(`${file}: could not be read: ${errorMessage(err)}`);\n }\n };\n\n const byId = async (id: string, type: RecordType, flag: string): Promise<RecordFile & { record: StrategyRecord }> => {\n const { set, index, base } = await load();\n const record = index.anyWithId(id);\n if (record === undefined) throw new TestError(unknownRecordMessage(id, set.records));\n if (record.type !== type) throw new TestError(`\"${id}\" is a ${record.type}; ${flag} takes a ${type}.`);\n return { record, ...(await readRecord(record, base)) };\n };\n\n const persona = async (id: string, journey?: TaskJourney): Promise<TaskPersona> => {\n if (journey === undefined) {\n const { record, ...rf } = await byId(id, \"persona\", \"--persona\");\n return personaOf(record.id, rf);\n }\n const { index, base } = await load();\n const record = index.resolve(\"persona\", id);\n if (record === undefined) {\n throw new TestError(`journey \"${journey.id}\" names persona \"${id}\", which has no record.`);\n }\n return personaOf(record.id, await readRecord(record, base));\n };\n\n return {\n journey: async (id) => {\n const { record, ...rf } = await byId(id, \"journey\", \"--journey\");\n return journeyOf(record.id, rf);\n },\n persona,\n golden: async () => {\n const { set, base } = await load();\n const out: TaskJourney[] = [];\n for (const record of set.records) {\n if (record.type !== \"journey\") continue;\n const rf = await readRecord(record, base);\n if (rf.data[\"evals\"] === undefined) continue;\n out.push(journeyOf(record.id, rf));\n }\n return out;\n },\n };\n}\n\nfunction at(rf: RecordFile, pointer: string): SourceLocation {\n return { file: rf.file, line: rf.lineFor(pointer) ?? 1 };\n}\n\nfunction personaOf(id: string, rf: RecordFile): TaskPersona {\n const { data } = rf;\n const title = text(data[\"title\"]);\n const description = text(data[\"description\"]);\n const role = text(data[\"role\"]);\n const teamContext = text(data[\"team-context\"]);\n const raw = data[\"constraints\"];\n const constraints = Array.isArray(raw)\n ? raw.flatMap((item: unknown, i) =>\n typeof item === \"string\" && item.trim() !== \"\"\n ? [{ text: item, location: at(rf, `/constraints/${String(i)}`) }]\n : [],\n )\n : list(raw).map((item) => ({ text: item, location: at(rf, \"/constraints\") }));\n return {\n id,\n file: rf.file,\n ...(title === undefined ? {} : { title }),\n ...(description === undefined ? {} : { description }),\n ...(role === undefined ? {} : { role }),\n ...(teamContext === undefined ? {} : { teamContext }),\n proficiency: list(data[\"proficiency\"]),\n prerequisites: list(data[\"prerequisites\"]),\n goals: list(data[\"goals\"]),\n pains: list(data[\"pains\"]),\n constraints,\n };\n}\n\nfunction journeyOf(id: string, rf: RecordFile): TaskJourney {\n const { data } = rf;\n const title = text(data[\"title\"]);\n const trigger = text(data[\"trigger\"]);\n const success = text(data[\"success-criteria\"]);\n const entryPoint = text(data[\"entry-point\"]);\n const workspace = text(data[\"workspace\"]);\n // Whether these exist is checked where they are used: a target or\n // `--workspace` that replaces one makes a missing path irrelevant.\n return {\n id,\n file: rf.file,\n title: title ?? id,\n titleLocation: title === undefined ? { file: rf.file, line: 1 } : at(rf, \"/title\"),\n ...(trigger === undefined ? {} : { trigger }),\n ...(success === undefined ? {} : { successCriteria: { text: success, location: at(rf, \"/success-criteria\") } }),\n ...(entryPoint === undefined ? {} : { entryPoint: { value: entryPoint, location: at(rf, \"/entry-point\") } }),\n ...(workspace === undefined ? {} : { workspace: { value: workspace, location: at(rf, \"/workspace\") } }),\n personas: list(data[\"personas\"]),\n evals: journeyEvals(rf),\n };\n}\n\n/**\n * A journey's `evals:`, validated as tracevals validates an artifact's block,\n * plus what a task adds: an id on every entry, ids unique, and only the\n * graders a synthetic run can be graded by. The first problem is the error.\n */\nfunction journeyEvals(rf: RecordFile): TaskJourney[\"evals\"] {\n const raw = rf.data[\"evals\"];\n if (raw === undefined) return [];\n const where = (pointer: string): string => `${rf.file}:${String(rf.lineFor(pointer) ?? 1)}`;\n if (!Array.isArray(raw)) throw new TestError(`${where(\"/evals\")}: evals must be a list of eval entries.`);\n\n const seen = new Map<string, number>();\n for (const [i, entry] of raw.entries()) {\n const n = String(i);\n const obj: Record<string, unknown> =\n typeof entry === \"object\" && entry !== null && !Array.isArray(entry) ? (entry as Record<string, unknown>) : {};\n const id = text(obj[\"id\"]);\n if (id === undefined) throw new TestError(`${where(`/evals/${n}`)}: evals[${n}] needs an id.`);\n const grader = typeof obj[\"grader\"] === \"string\" ? obj[\"grader\"] : \"ai\";\n if (!(TASK_GRADERS as readonly string[]).includes(grader)) {\n throw new TestError(\n `${where(`/evals/${n}/grader`)}: evals[${n}].grader \"${grader}\" cannot grade a task. Use ${GRADER_LIST}.`,\n );\n }\n const first = seen.get(id);\n if (first !== undefined) {\n throw new TestError(`${where(`/evals/${n}/id`)}: evals[${n}].id \"${id}\" repeats evals[${String(first)}].`);\n }\n seen.set(id, i);\n }\n\n // The vocabulary is document-rooted, so the list is validated where an\n // artifact keeps it, and each pointer is mapped back to the journey's.\n const errors = artifactEvalsErrors({ metadata: { evals: raw } }, (pointer) =>\n rf.lineFor(pointer.replace(/^\\/metadata/, \"\")),\n );\n const firstError = errors[0];\n if (firstError !== undefined) {\n const path = firstError.instancePath.replace(/^\\/metadata/, \"\");\n const m = /^\\/evals\\/(\\d+)(.*)$/.exec(path);\n const label = m === null ? \"evals\" : `evals[${m[1] ?? \"\"}]${(m[2] ?? \"\").replaceAll(\"/\", \".\")}`;\n throw new TestError(`${where(path)}: ${label} ${firstError.message}.`);\n }\n\n return raw.map((entry: unknown, i) => {\n const n = String(i);\n const normalized = normalizeEntry(entry, i);\n const validate = graderFor(normalized.grader)?.validateOptions;\n const invalid = validate?.(normalized.options ?? {});\n if (invalid !== undefined) {\n const pointer = normalized.options === undefined ? `/evals/${n}` : `/evals/${n}/options`;\n throw new TestError(`${where(pointer)}: evals[${n}] ${invalid}`);\n }\n return { entry: normalized, location: at(rf, `/evals/${n}`) };\n });\n}\n","/**\n * A run's temp directory (plan §4.5): the workspace the synthetic user works\n * in, a copy of the docs for a path start, and its own npm global prefix.\n * Nothing it does touches the checkout.\n *\n * The directory is spelled the long way (`realpathSync.native`), because on\n * Windows `os.tmpdir()` can be an 8.3 short name, and Claude Code reports the\n * long one: paths compared or relativized across the two would never match.\n */\nimport { createHash } from \"node:crypto\";\nimport { realpathSync, statSync } from \"node:fs\";\nimport { cp, mkdir, mkdtemp, readdir, readFile } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { basename, dirname, isAbsolute, join, relative, resolve, sep } from \"node:path\";\nimport picomatch from \"picomatch\";\nimport { resolveTargetSet } from \"../../meta/internal.js\";\nimport { selectCollections } from \"../../shared/collections.js\";\nimport type { ConfigFile } from \"../../shared/config-file.js\";\nimport { TestError } from \"../errors.js\";\nimport type { TaskStart, WorkspaceChanges } from \"./task-types.js\";\n\nexport interface RunDirs {\n root: string;\n workspaceDir: string;\n /** The npm global prefix Claude Code is given. */\n globalDir: string;\n /** Null for a URL start. */\n docsDir: string | null;\n /** The start page's copy; null for a URL start. */\n startCopy: string | null;\n}\n\n/**\n * ponytail: dependency and VCS trees are not part of what a reader changed,\n * and a `npm install` would bury the list. Skipped on both sides of the diff\n * and in the docs copy.\n */\nconst SKIPPED_DIRS = new Set([\"node_modules\", \".git\"]);\n\nconst keep = (src: string): boolean => !SKIPPED_DIRS.has(basename(src));\n\nconst toPosix = (path: string): string => path.split(sep).join(\"/\");\n\nexport async function prepareRun(\n start: TaskStart,\n seed: string | null,\n file: ConfigFile | null,\n): Promise<RunDirs> {\n const root = realpathSync.native(await mkdtemp(join(tmpdir(), \"manni-task-\")));\n const workspaceDir = join(root, \"workspace\");\n const globalDir = join(root, \"global\");\n await mkdir(workspaceDir);\n await mkdir(globalDir);\n if (seed !== null) await cp(seed, workspaceDir, { recursive: true, filter: keep });\n if (start.kind === \"url\") return { root, workspaceDir, globalDir, docsDir: null, startCopy: null };\n\n const docsDir = join(root, \"docs\");\n const startCopy = join(docsDir, await copyDocs(start.abs, file, docsDir));\n return { root, workspaceDir, globalDir, docsDir, startCopy };\n}\n\n/**\n * Copy the collection holding `page` into `docsDir`, relative to the\n * collection's glob base, or the page's own directory when no collection\n * holds it. Returns the page's path inside the copy.\n */\nasync function copyDocs(page: string, file: ConfigFile | null, docsDir: string): Promise<string> {\n const collections = file === null ? [] : selectCollections(file.collections, [], file.source, (m) => new TestError(m));\n for (const collection of collections) {\n const dir = file?.dir ?? dirname(page);\n const { files } = await resolveTargetSet({\n inputs: collection.paths,\n exclude: collection.exclude,\n cwd: dir,\n allowEmpty: true,\n });\n const abs = files.map((f) => resolve(dir, f));\n if (!abs.some((f) => samePath(f, page))) continue;\n const base = globBase(collection.paths, dir);\n // A start page outside the base would have no place in the copy, so its\n // own directory is copied instead, below.\n const pageRel = copyPathFor(base, page);\n if (pageRel === undefined) break;\n for (const f of abs) {\n const rel = copyPathFor(base, f);\n if (rel === undefined) continue;\n const dest = join(docsDir, rel);\n await mkdir(dirname(dest), { recursive: true });\n await cp(f, dest);\n }\n return pageRel;\n }\n await cp(dirname(page), docsDir, { recursive: true, filter: keep });\n return basename(page);\n}\n\n/**\n * Where a collection file goes inside the docs copy, relative to the copy, or\n * `undefined` for a file that resolves outside the collection's base (through\n * a symlink, or on another drive). Nothing is ever written outside the copy.\n */\nexport function copyPathFor(base: string, file: string): string | undefined {\n const rel = relative(base, file);\n if (rel === \"\" || isAbsolute(rel) || rel === \"..\" || rel.startsWith(`..${sep}`)) return undefined;\n return rel;\n}\n\nfunction samePath(a: string, b: string): boolean {\n return process.platform === \"win32\" ? a.toLowerCase() === b.toLowerCase() : a === b;\n}\n\n/** The deepest directory every one of a collection's paths sits under. */\nfunction globBase(paths: string[], dir: string): string {\n const bases = paths.map((p) => {\n const scan = picomatch.scan(p.replace(/\\\\/g, \"/\"));\n const abs = resolve(dir, scan.isGlob ? scan.base : p);\n return scan.isGlob || isDirectory(abs) ? abs : dirname(abs);\n });\n const [first, ...rest] = bases.map((b) => b.split(sep));\n if (first === undefined) return dir;\n let depth = first.length;\n for (const parts of rest) {\n let i = 0;\n while (i < depth && i < parts.length && parts[i] === first[i]) i++;\n depth = i;\n }\n return first.slice(0, depth).join(sep) || sep;\n}\n\nfunction isDirectory(path: string): boolean {\n try {\n return statSync(path).isDirectory();\n } catch {\n return false;\n }\n}\n\n/** Every file under `dir` as a POSIX relative path → sha256 of its bytes. */\nasync function hashTree(dir: string): Promise<Map<string, string>> {\n const out = new Map<string, string>();\n const walk = async (at: string): Promise<void> => {\n for (const entry of await readdir(at, { withFileTypes: true })) {\n const abs = join(at, entry.name);\n if (entry.isDirectory()) {\n if (!SKIPPED_DIRS.has(entry.name)) await walk(abs);\n } else if (entry.isFile()) {\n out.set(toPosix(relative(dir, abs)), createHash(\"sha256\").update(await readFile(abs)).digest(\"hex\"));\n }\n }\n };\n await walk(dir);\n return out;\n}\n\n/** What the run added, changed and removed against the seed, by content. */\nexport async function workspaceChanges(seed: string | null, workspaceDir: string): Promise<WorkspaceChanges> {\n const before = seed === null ? new Map<string, string>() : await hashTree(seed);\n const after = await hashTree(workspaceDir);\n const added: string[] = [];\n const changed: string[] = [];\n for (const [path, hash] of after) {\n const was = before.get(path);\n if (was === undefined) added.push(path);\n else if (was !== hash) changed.push(path);\n }\n const removed = [...before.keys()].filter((path) => !after.has(path));\n return { added: added.sort(), changed: changed.sort(), removed: removed.sort() };\n}\n","import type { TestFinding } from \"../core/results.js\";\n\n/**\n * What a failed step asks of its reader. Doc Detective reports only what the\n * step expected against what happened, so it cannot tell which of the three\n * is wrong, and the sentence says so.\n */\nconst FAIL_ADVICE = \"Fix the step, fix the procedure it documents, or report a product regression.\";\n\n/** Doc Detective's description, and for a FAIL the advice after it. A WARNING is left as written. */\nexport function findingMessage(f: TestFinding): string {\n if (f.result !== \"FAIL\") return f.description;\n if (f.description === \"\") return FAIL_ADVICE;\n const stop = f.description.endsWith(\".\") ? \"\" : \".\";\n return `${f.description}${stop} ${FAIL_ADVICE}`;\n}\n","import type { ResultCounts } from \"../core/results.js\";\n\n/** `2 tests: 1 passed, 1 failed, 0 warnings, 0 skipped`, test-level counts. */\nexport function summaryLine(tests: ResultCounts): string {\n const total = tests.pass + tests.fail + tests.warning + tests.skipped;\n const plural = (n: number, word: string): string => `${String(n)} ${word}${n === 1 ? \"\" : \"s\"}`;\n return `${plural(total, \"test\")}: ${String(tests.pass)} passed, ${String(tests.fail)} failed, ${plural(tests.warning, \"warning\")}, ${String(tests.skipped)} skipped`;\n}\n","import {\n escapeWorkflowCommandMessage,\n escapeWorkflowCommandProperty,\n} from \"../../shared/github.js\";\nimport { guidanceLines } from \"../../shared/guidance.js\";\nimport type { ProceduresResult } from \"../commands/procedures.js\";\nimport { findingMessage } from \"./finding.js\";\nimport { summaryLine } from \"./summary.js\";\n\n/**\n * One workflow command per FAIL or WARNING step, then the summary line. The\n * step's action and its guide follow the message after `%0A`.\n */\nexport function renderGithub(result: ProceduresResult): string {\n const commands = result.findings.map((f) => {\n const level = f.result === \"FAIL\" ? \"error\" : \"warning\";\n const props = [\n ...(f.file === \"\" ? [] : [`file=${escapeWorkflowCommandProperty(f.file)}`]),\n ...(f.line === undefined ? [] : [`line=${String(f.line)}`]),\n \"title=Doc Detective\",\n ].join(\",\");\n const message = [findingMessage(f), ...guidanceLines(f.guidance)].join(\"\\n\");\n return `::${level} ${props}::${escapeWorkflowCommandMessage(message)}`;\n });\n return [...commands, summaryLine(result.tests)].join(\"\\n\");\n}\n","import type { ProceduresResult } from \"../commands/procedures.js\";\n\n/**\n * Doc Detective's results object, verbatim, so a script written against its\n * schema reads manni's output unchanged. `null` when it found no tests.\n */\nexport function renderJson(result: ProceduresResult): string {\n return JSON.stringify(result.results, null, 2);\n}\n","import { palette } from \"../../shared/color.js\";\nimport { guidanceLines } from \"../../shared/guidance.js\";\nimport type { ProceduresResult } from \"../commands/procedures.js\";\nimport type { TestFinding } from \"../core/results.js\";\nimport { findingMessage } from \"./finding.js\";\nimport { summaryLine } from \"./summary.js\";\n\n/**\n * Each FAIL and WARNING step under its page, with its line, then the\n * test-level summary. The step's action and its guide follow, dim, under the\n * message. A run with neither prints the summary alone.\n */\nexport function renderPretty(result: ProceduresResult, opts: { color: boolean }): string {\n const c = palette(opts.color);\n const byFile = new Map<string, TestFinding[]>();\n for (const finding of result.findings) {\n const list = byFile.get(finding.file);\n if (list === undefined) byFile.set(finding.file, [finding]);\n else list.push(finding);\n }\n const width = Math.max(0, ...result.findings.map((f) => String(f.line ?? \"\").length));\n // The guidance lines sit under the message column: the line, the result, and their gaps.\n const indent = \" \".repeat(2 + width + 2 + 7 + 2);\n const blocks = [...byFile].map(([file, findings]) =>\n [\n c.bold(file),\n ...findings.flatMap((f) => {\n const label = f.result.padEnd(7);\n const tag = f.result === \"FAIL\" ? c.red(label) : c.yellow(label);\n return [\n ` ${String(f.line ?? \"\").padStart(width)} ${tag} ${findingMessage(f)}`,\n ...guidanceLines(f.guidance).map((line) => c.dim(`${indent}${line}`)),\n ];\n }),\n ].join(\"\\n\"),\n );\n return [...blocks, summaryLine(result.tests)].join(\"\\n\\n\");\n}\n","/**\n * `manni test tasks`'s three formats (plan §4.8): a block per run then a\n * total, the report as JSON, or a workflow command per eval that did not pass.\n */\nimport { palette, type Colors } from \"../../shared/color.js\";\nimport { escapeWorkflowCommandMessage, escapeWorkflowCommandProperty } from \"../../shared/github.js\";\nimport type { TaskRun, TasksReport } from \"../commands/tasks.js\";\nimport type { TaskEval } from \"../core/task-types.js\";\n\nexport type TasksFormat = \"pretty\" | \"json\" | \"github\";\n\nconst WIDTH = 78;\n\nconst plural = (n: number, one: string): string => `${String(n)} ${one}${n === 1 ? \"\" : \"s\"}`;\n\n/** `1 run: 0 passed, 1 failed · 1 warning`, zero failures and warnings left out. */\nexport function tasksTotal(summary: TasksReport[\"summary\"]): string {\n let line = `${plural(summary.runs, \"run\")}: ${String(summary.passed)} passed`;\n if (summary.failed > 0) line += `, ${String(summary.failed)} failed`;\n if (summary.warnings > 0) line += ` · ${plural(summary.warnings, \"warning\")}`;\n return line;\n}\n\nexport function renderTasks(report: TasksReport, format: TasksFormat, opts: { color: boolean }): string {\n if (format === \"json\") return renderJson(report);\n if (report.runs.length === 0) return \"No tasks to run.\";\n if (format === \"github\") return renderGithub(report);\n const c = palette(opts.color);\n return [...report.runs.map((run) => runBlock(run, c)), tasksTotal(report.summary)].join(\"\\n\\n\");\n}\n\nfunction renderJson(report: TasksReport): string {\n const runs = report.runs.map(({ maxTurns: _maxTurns, ...run }) => run);\n return JSON.stringify({ runs, summary: report.summary, exitCode: report.exitCode }, null, 2);\n}\n\nconst label = (run: TaskRun): string => `${run.journey ?? \"task\"} as ${run.persona ?? \"newcomer\"}`;\n\nconst at = (e: TaskEval): string => (e.location === null ? \"(no location)\" : `${e.location.file}:${String(e.location.line)}`);\n\nfunction tag(e: TaskEval): string {\n if (e.outcome === \"pass\") return \"PASS\";\n if (e.outcome === \"skipped\") return \"SKIP\";\n if (e.severity === \"warning\") return \"WARN\";\n if (e.severity === \"notice\") return \"NOTE\";\n return e.outcome === \"fail\" ? \"FAIL\" : e.outcome === \"error\" ? \"ERROR\" : \"REVIEW\";\n}\n\nfunction paint(text: string, e: TaskEval, c: Colors): string {\n const t = tag(e);\n if (t === \"PASS\") return c.green(text);\n if (t === \"WARN\") return c.yellow(text);\n if (t === \"NOTE\" || t === \"SKIP\") return c.dim(text);\n return c.red(text);\n}\n\nfunction duration(ms: number): string {\n const s = Math.round(ms / 1000);\n return `${String(Math.floor(s / 60))}m ${String(s % 60).padStart(2, \"0\")}s`;\n}\n\n/** `text` wrapped at the report's width, each line indented. */\nfunction wrap(text: string, indent: string): string[] {\n const out: string[] = [];\n for (const paragraph of text.split(\"\\n\")) {\n let line = \"\";\n for (const word of paragraph.split(/\\s+/).filter((w) => w !== \"\")) {\n if (line !== \"\" && indent.length + line.length + 1 + word.length > WIDTH) {\n out.push(indent + line);\n line = word;\n } else {\n line = line === \"\" ? word : `${line} ${word}`;\n }\n }\n out.push(line === \"\" ? \"\" : indent + line);\n }\n return out;\n}\n\n/** What a judged eval's verdict says, or the grader's own message. */\nfunction said(e: TaskEval): string | undefined {\n if (e.consensus !== undefined) {\n const verdict = `AI judge: ${e.outcome} (confidence ${e.consensus.meanConfidence.toFixed(2)}).`;\n return e.message === undefined ? verdict : `${verdict} ${e.message}`;\n }\n return e.message;\n}\n\nfunction runBlock(run: TaskRun, c: Colors): string {\n const title = run.journey === null && run.task.length > 60 ? `${run.task.slice(0, 60)}…` : run.task;\n const lines = [c.bold(`${run.journey ?? \"task\"} · ${title} · as ${run.persona ?? \"newcomer\"}`)];\n const field = (name: string, value: string): string => ` ${name.padEnd(10)}${value}`;\n lines.push(field(\"start\", run.start));\n if (run.docs.length > 0) lines.push(field(\"docs\", run.docs.join(\", \")));\n if (run.changes.added.length > 0) lines.push(field(\"added\", run.changes.added.join(\", \")));\n if (run.changes.changed.length > 0) lines.push(field(\"changed\", run.changes.changed.join(\", \")));\n if (run.changes.removed.length > 0) lines.push(field(\"removed\", run.changes.removed.join(\", \")));\n lines.push(` ${plural(run.turns, \"turn\")} · ${duration(run.durationMs)}`);\n\n const tagWidth = Math.max(4, ...run.evals.map((e) => tag(e).length));\n const idWidth = Math.max(0, ...run.evals.map((e) => e.id.length)) + 5;\n const detail = \" \".repeat(2 + tagWidth + 1);\n for (const e of run.evals) {\n lines.push(` ${paint(tag(e).padEnd(tagWidth), e, c)} ${e.id.padEnd(idWidth)}${c.dim(at(e))}`);\n if (e.outcome === \"pass\") continue;\n if (e.assertion !== undefined) lines.push(...wrap(e.assertion, detail));\n const message = said(e);\n if (message !== undefined) lines.push(...wrap(message, detail).map((l) => c.dim(l)));\n }\n if (run.stoppedAtLimit) lines.push(` stopped at the ${String(run.maxTurns)}-turn limit`);\n if (run.account.trim() !== \"\") lines.push(\" Account\", ...wrap(run.account.trim(), \" \"));\n if (run.kept !== null) lines.push(field(\"kept\", run.kept));\n lines.push(field(\"trace\", run.trace));\n return lines.join(\"\\n\");\n}\n\nfunction githubLine(run: TaskRun, e: TaskEval): string {\n const level = e.severity === \"notice\" ? \"notice\" : e.severity === \"warning\" ? \"warning\" : \"error\";\n const props = [\n ...(e.location === null\n ? []\n : [`file=${escapeWorkflowCommandProperty(e.location.file)}`, `line=${String(e.location.line)}`]),\n \"title=manni test tasks\",\n ].join(\",\");\n const what =\n e.id === \"constraint\" && e.outcome === \"fail\"\n ? `constraint \"${e.assertion ?? \"\"}\" not honored.`\n : `${e.id} ${e.outcome === \"fail\" ? \"failed\" : e.outcome === \"error\" ? \"could not be graded\" : \"needs review\"}.`;\n const message = [`${label(run)}: ${what}`, e.message].filter((m) => m !== undefined && m !== \"\").join(\" \");\n return `::${level} ${props}::${escapeWorkflowCommandMessage(message)}`;\n}\n\nfunction renderGithub(report: TasksReport): string {\n const commands = report.runs.flatMap((run) =>\n run.evals.filter((e) => e.outcome !== \"pass\" && e.outcome !== \"skipped\").map((e) => githubLine(run, e)),\n );\n return [...commands, tasksTotal(report.summary)].join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAM,YAAN,cAAwB,UAAU;AAAA,EACvC,YAAY,SAAiB;AAC3B,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;;;ACGA,SAAS,kBAAkB;AAC3B,SAAS,SAAS,SAAS,UAAU,UAAU;AAC/C,SAAS,cAAc;AACvB,SAAS,QAAAA,OAAM,YAAAC,WAAU,eAAe;AACxC,OAAO,QAAQ;AACf,OAAO,eAAe;;;ACNtB,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAS,YAAY;AAuBd,IAAM,cACX;AAEF,IAAM,qBACJ;AAGF,IAAM,aAAa,KAAK,KAAK;AAEtB,SAAS,UACd,MACA,MACQ;AACR,MAAI,KAAK,aAAa,QAAS,QAAO,EAAE,SAAS,iBAAiB,MAAM,SAAS,MAAM;AAEvF,aAAW,SAAS,KAAK,KAAK,MAAM,GAAG,GAAG;AACxC,UAAM,MAAM,MAAM,QAAQ,YAAY,IAAI;AAC1C,QAAI,QAAQ,MAAM,CAAC,KAAK,OAAO,KAAK,KAAK,mBAAmB,CAAC,EAAG;AAChE,UAAM,SAAS,KAAK,KAAK,gBAAgB,iBAAiB,OAAO,kBAAkB;AACnF,QAAI,KAAK,OAAO,MAAM,GAAG;AACvB,aAA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,WAAW,EAAE,aAAa,YAAY,YAAY;AAC1F,QAAM,QAAQ;AAAA,IACZ,GAAI,EAAE,aAAa,OACf,CAAC,IACD,CAAC,QAAQ,8BAA8B,EAAE,SAAS,IAAI,CAAC,IAAI,QAAQ,OAAO,EAAE,SAAS,IAAI,CAAC,EAAE;AAAA,IAChG;AAAA,EACF,EAAE,KAAK,GAAG;AACV,QAAM,OACJ,EAAE,OAAO,gBAAgB,EAAE,YAAY,SACnC,eAAe,EAAE,aAAa,EAAE,mBAChC,GAAG,EAAE,EAAE,IAAI,EAAE,YAAY,SAAS,WAAW,EAAE,YAAY,UAAU,wBAAwB,cAAc;AACjH,QAAM,UAAU,CAAC,GAAG,MAAM,GAAG,CAAC,KAAK,IAAI,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,MAAM,UAAa,MAAM,EAAE,EAAE,KAAK,GAAG;AACzG,SAAO,KAAK,KAAK,IAAI,KAAK,KAAK,6BAA6B,OAAO,CAAC;AACtE;AAEA,SAASD,cAAa,QAA6B;AACjD,QAAM,WAAW,OAAO,KAAK;AAAA,IAAQ,CAAC,QACpC,IAAI,MAAM,OAAO,CAAC,MAAM,EAAE,YAAY,UAAU,EAAE,YAAY,SAAS,EAAE,IAAI,CAAC,MAAM,WAAW,KAAK,CAAC,CAAC;AAAA,EACxG;AACA,SAAO,CAAC,GAAG,UAAU,WAAW,OAAO,OAAO,CAAC,EAAE,KAAK,IAAI;AAC5D;","names":["join","relative","text","key","relative","join","existsSync","mkdir","rm","join","relative","resolve","sep","spawn","statSync","join","relative","NO_TIMEOUT","label","pathKey","join","relative","at","said","isFile","statSync","spawn","join","relative","sep","readFileSync","isAbsolute","join","relative","resolve","sep","text","relative","isRecord","join","list","sep","isAbsolute","resolve","readFileSync","join","text","relative","sep","label","readFile","relative","resolve","sep","asTestError","set","resolve","file","relative","sep","readFile","record","label","realpathSync","statSync","mkdtemp","readdir","readFile","tmpdir","isAbsolute","join","relative","resolve","sep","picomatch","toPosix","sep","realpathSync","mkdtemp","join","tmpdir","resolve","relative","isAbsolute","picomatch","statSync","at","readdir","readFile","toPosix","sep","asTestError","toError","loadConfig","resolve","existsSync","label","records","relative","mkdir","join","rm","plural","list","label","tag","renderJson","renderGithub","at","text"]}