@hawkeyexl/manni 4.16.0 → 4.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/README.md +1 -1
  2. package/dist/{batch-L5W4JS7A.js → batch-SAW4E46C.js} +14 -14
  3. package/dist/{build-GNZUVDZX.js → build-F6S3W77I.js} +15 -14
  4. package/dist/{calibrate-2LYIDN6U.js → calibrate-3DW2VV7F.js} +15 -15
  5. package/dist/{capture-OEDMFU5Z.js → capture-PKEYY2VO.js} +14 -14
  6. package/dist/{check-JR2TYL2Y.js → check-7PUIHLFM.js} +15 -15
  7. package/dist/{check-NLLFHNWG.js → check-EZN7YNVF.js} +14 -15
  8. package/dist/{check-Z5VGDSDT.js → check-LRX2YFDF.js} +13 -14
  9. package/dist/check-NW7GHSX6.js +47 -0
  10. package/dist/{cli-THEU2QG2.js → chunk-245W2Q7C.js} +133 -365
  11. package/dist/chunk-245W2Q7C.js.map +1 -0
  12. package/dist/{chunk-LEOQO3S6.js → chunk-2A5OIZHT.js} +7 -7
  13. package/dist/{chunk-FU3OCYYH.js → chunk-2LCJNH73.js} +2 -2
  14. package/dist/{chunk-7UC55CAU.js → chunk-2TLNAGVJ.js} +187 -159
  15. package/dist/chunk-2TLNAGVJ.js.map +1 -0
  16. package/dist/{chunk-6ANTGYNT.js → chunk-3446DW4W.js} +2 -2
  17. package/dist/{chunk-7GB3KEEM.js → chunk-3UYSONT4.js} +7 -453
  18. package/dist/chunk-3UYSONT4.js.map +1 -0
  19. package/dist/{chunk-NFJGIBES.js → chunk-4GGADKTU.js} +82 -238
  20. package/dist/chunk-4GGADKTU.js.map +1 -0
  21. package/dist/{chunk-YF6IZXAC.js → chunk-5QOTR53S.js} +7 -7
  22. package/dist/{chunk-2XRET3ZG.js → chunk-5VNFO2RT.js} +12 -38
  23. package/dist/chunk-5VNFO2RT.js.map +1 -0
  24. package/dist/{chunk-6YFEV7CM.js → chunk-64EDFJ5S.js} +5 -5
  25. package/dist/chunk-6J2ED4ED.js +545 -0
  26. package/dist/chunk-6J2ED4ED.js.map +1 -0
  27. package/dist/{chunk-2AUULNIJ.js → chunk-ABAFKOQF.js} +3 -3
  28. package/dist/{chunk-3GLDB7MZ.js → chunk-AIZBZYQM.js} +1311 -18
  29. package/dist/chunk-AIZBZYQM.js.map +1 -0
  30. package/dist/{chunk-GQQ2AX63.js → chunk-B5R5BWMY.js} +14 -429
  31. package/dist/chunk-B5R5BWMY.js.map +1 -0
  32. package/dist/{chunk-ZT5NUSZA.js → chunk-D3AO2PMV.js} +9 -9
  33. package/dist/{chunk-EZCJPF72.js → chunk-DSJTYRI5.js} +3 -3
  34. package/dist/{chunk-OJ7FEM2G.js → chunk-DU6CXY5R.js} +47 -10
  35. package/dist/chunk-DU6CXY5R.js.map +1 -0
  36. package/dist/{chunk-WD33LE5A.js → chunk-FAS3SRQB.js} +927 -99
  37. package/dist/chunk-FAS3SRQB.js.map +1 -0
  38. package/dist/{chunk-DTG6S2UG.js → chunk-FEURGKJC.js} +2 -2
  39. package/dist/{chunk-EA5KKIFG.js → chunk-FPPHEHPZ.js} +3 -3
  40. package/dist/chunk-HEVYEI6O.js +1338 -0
  41. package/dist/chunk-HEVYEI6O.js.map +1 -0
  42. package/dist/{chunk-5OOQ3HQ3.js → chunk-IGE6CIKZ.js} +11 -2
  43. package/dist/chunk-IGE6CIKZ.js.map +1 -0
  44. package/dist/{chunk-WT3AATHC.js → chunk-JK56UPNQ.js} +252 -425
  45. package/dist/chunk-JK56UPNQ.js.map +1 -0
  46. package/dist/{chunk-B3XXCDYW.js → chunk-KAWS7H4C.js} +2385 -2061
  47. package/dist/chunk-KAWS7H4C.js.map +1 -0
  48. package/dist/{chunk-O6YTTBSN.js → chunk-KB4MNUKC.js} +2 -2
  49. package/dist/{chunk-GR6QQ7GM.js → chunk-KCNBM42T.js} +4 -4
  50. package/dist/chunk-KUXAHHDE.js +314 -0
  51. package/dist/chunk-KUXAHHDE.js.map +1 -0
  52. package/dist/{chunk-EOSQENQF.js → chunk-LDIUA4ZG.js} +2 -2
  53. package/dist/{chunk-L3YGGYBG.js → chunk-M6DNOHJO.js} +3 -3
  54. package/dist/{chunk-4L3JBAW4.js → chunk-MBLVLQWI.js} +2 -2
  55. package/dist/{chunk-4HEEXPVX.js → chunk-MDXDTO7E.js} +6 -6
  56. package/dist/{chunk-WDENIUC7.js → chunk-MDZXRHIJ.js} +1 -1
  57. package/dist/chunk-MDZXRHIJ.js.map +1 -0
  58. package/dist/{chunk-IGRXQC3H.js → chunk-N25KDXOV.js} +2 -2
  59. package/dist/{chunk-DW22KCLN.js → chunk-NPZWOPOH.js} +3 -3
  60. package/dist/chunk-OZL5M764.js +443 -0
  61. package/dist/chunk-OZL5M764.js.map +1 -0
  62. package/dist/{chunk-NDBISART.js → chunk-PS4Y7EPP.js} +3 -3
  63. package/dist/{chunk-F4GXZMEO.js → chunk-Q7E43SXN.js} +12 -7
  64. package/dist/{chunk-F4GXZMEO.js.map → chunk-Q7E43SXN.js.map} +1 -1
  65. package/dist/{chunk-63GILHR5.js → chunk-QIKCIREY.js} +4 -4
  66. package/dist/{chunk-ZJZQPOJO.js → chunk-QIWSEKA6.js} +2 -2
  67. package/dist/{chunk-F6B2TNXU.js → chunk-TNYIXIYV.js} +6 -6
  68. package/dist/{chunk-CSLJMML4.js → chunk-TUMR35B3.js} +4 -4
  69. package/dist/{chunk-DSTRT6YD.js → chunk-U5NSIZRS.js} +3 -3
  70. package/dist/chunk-UP6NBQ62.js +2 -0
  71. package/dist/{chunk-BMYCLTFK.js → chunk-VRMQSP7O.js} +3 -3
  72. package/dist/{chunk-IM67NRUW.js → chunk-W7IEP7IG.js} +2 -2
  73. package/dist/{chunk-5PO2BWZF.js → chunk-W7XOMNYC.js} +2 -2
  74. package/dist/{chunk-6NTNLKNQ.js → chunk-WBXVQW57.js} +6 -5
  75. package/dist/{chunk-6NTNLKNQ.js.map → chunk-WBXVQW57.js.map} +1 -1
  76. package/dist/{chunk-PBZZUNDV.js → chunk-WP5EKWTU.js} +7 -7
  77. package/dist/chunk-WRSWZEVU.js +580 -0
  78. package/dist/chunk-WRSWZEVU.js.map +1 -0
  79. package/dist/{chunk-LPBVWUKS.js → chunk-WZSL7KF2.js} +2 -2
  80. package/dist/{chunk-GC47NBGO.js → chunk-XCEEJEVA.js} +4 -4
  81. package/dist/{chunk-4LLYPDNG.js → chunk-XPGK4ECA.js} +7 -7
  82. package/dist/{chunk-AWAXAJ6R.js → chunk-XRWQQHBR.js} +2 -2
  83. package/dist/{chunk-D4ANAOY7.js → chunk-XWUIFSWK.js} +20 -6
  84. package/dist/chunk-XWUIFSWK.js.map +1 -0
  85. package/dist/{chunk-IL62WATF.js → chunk-YJHHXM5B.js} +2 -2
  86. package/dist/{chunk-NH6B6DDI.js → chunk-ZEYNLKOH.js} +4 -4
  87. package/dist/{chunk-PHNAQ4QX.js → chunk-ZIXU7A4C.js} +21 -21
  88. package/dist/{cli-LZW6Z33F.js → cli-5ZQXVWWC.js} +18 -19
  89. package/dist/{cli-LZW6Z33F.js.map → cli-5ZQXVWWC.js.map} +1 -1
  90. package/dist/{cli-5QTSTGTX.js → cli-D5WYQVUF.js} +18 -18
  91. package/dist/{cli-4Y2XY52B.js → cli-FCGGNZ5C.js} +2 -2
  92. package/dist/{cli-DBMPGGOV.js → cli-FNX4LXMI.js} +37 -37
  93. package/dist/{cli-KAUXC7EZ.js → cli-LQRHK23G.js} +9 -9
  94. package/dist/{cli-RWRYV5FB.js → cli-LRKBCQRS.js} +9 -9
  95. package/dist/{cli-2EKRURBU.js → cli-NJC3H3CW.js} +15 -15
  96. package/dist/{cli-2SDBEUER.js → cli-OHKWCJIJ.js} +21 -21
  97. package/dist/{cli-BXUZ3KEQ.js → cli-RKYIZ6KU.js} +634 -36
  98. package/dist/cli-RKYIZ6KU.js.map +1 -0
  99. package/dist/cli-TJDQ5GUW.js +379 -0
  100. package/dist/cli-TJDQ5GUW.js.map +1 -0
  101. package/dist/{cli-TZ2OHF3H.js → cli-VC3BXCVR.js} +19 -19
  102. package/dist/cli.js +14 -14
  103. package/dist/docmeta.js +8 -8
  104. package/dist/{github-UR6LMUMW.js → github-6PV2JTZ7.js} +13 -14
  105. package/dist/github-7ZT4KYQU.js +35 -0
  106. package/dist/graph/runtime.d.ts +633 -217
  107. package/dist/graph/runtime.js +1001 -370
  108. package/dist/graph/runtime.js.map +1 -1
  109. package/dist/index.d.ts +2617 -1945
  110. package/dist/index.js +108 -64
  111. package/dist/index.js.map +1 -1
  112. package/dist/{json-QTYN2JQB.js → json-VWXLDTXR.js} +13 -14
  113. package/dist/{labels-UM2AFR5S.js → labels-ZJK27RL3.js} +12 -13
  114. package/dist/{labels-UM2AFR5S.js.map → labels-ZJK27RL3.js.map} +1 -1
  115. package/dist/{lint-LOFNZZPR.js → lint-5OERIERT.js} +13 -13
  116. package/dist/{list-GU7S6KEX.js → list-MANBRF7Z.js} +13 -14
  117. package/dist/{list-EPMHOU7T.js → list-SEEANTU6.js} +15 -15
  118. package/dist/{page-25CN3AFY.js → page-O4M65KMJ.js} +13 -14
  119. package/dist/{prepare-5GYMBF4P.js → prepare-3WULLZER.js} +13 -13
  120. package/dist/{pretty-QW6OSYRS.js → pretty-5FRBLTXU.js} +13 -14
  121. package/dist/{pretty-52Z74O6F.js → pretty-D3M366JD.js} +14 -15
  122. package/dist/{reporters-WT53GD4P.js → reporters-4WWZRHKI.js} +4 -4
  123. package/dist/{reporters-FSXJ42EB.js → reporters-6TEJDXXO.js} +4 -4
  124. package/dist/{reporters-3FXX2W4X.js → reporters-GDCZ5P7C.js} +12 -12
  125. package/dist/{run-H7XJMUWK.js → run-TZDLG6EN.js} +16 -16
  126. package/dist/sarif-PUZAMEFQ.js +36 -0
  127. package/dist/{sarif-C427U3NA.js → sarif-SSSPOUCK.js} +11 -11
  128. package/dist/site/rehype.d.ts +33 -0
  129. package/dist/site/rehype.js +49 -0
  130. package/dist/site/rehype.js.map +1 -0
  131. package/dist/{term-VG65JRNR.js → term-DHWMUL5N.js} +18 -19
  132. package/dist/{term-VG65JRNR.js.map → term-DHWMUL5N.js.map} +1 -1
  133. package/dist/{types-VMOT7RAL.js → types-7N7ETP3W.js} +2 -2
  134. package/dist/{validate-K36F54UB.js → validate-4AW7KIIY.js} +5 -5
  135. package/package.json +10 -1
  136. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  137. package/shapes/graph/shapes-1.2.0.ttl +1161 -0
  138. package/dist/check-LVO4HZ3F.js +0 -36
  139. package/dist/chunk-2XRET3ZG.js.map +0 -1
  140. package/dist/chunk-3GLDB7MZ.js.map +0 -1
  141. package/dist/chunk-3WZQ2FR3.js +0 -236
  142. package/dist/chunk-3WZQ2FR3.js.map +0 -1
  143. package/dist/chunk-5OOQ3HQ3.js.map +0 -1
  144. package/dist/chunk-7GB3KEEM.js.map +0 -1
  145. package/dist/chunk-7UC55CAU.js.map +0 -1
  146. package/dist/chunk-B3XXCDYW.js.map +0 -1
  147. package/dist/chunk-D4ANAOY7.js.map +0 -1
  148. package/dist/chunk-GQQ2AX63.js.map +0 -1
  149. package/dist/chunk-IKEWBMCN.js +0 -98
  150. package/dist/chunk-IKEWBMCN.js.map +0 -1
  151. package/dist/chunk-NFJGIBES.js.map +0 -1
  152. package/dist/chunk-OJ7FEM2G.js.map +0 -1
  153. package/dist/chunk-WD33LE5A.js.map +0 -1
  154. package/dist/chunk-WDENIUC7.js.map +0 -1
  155. package/dist/chunk-WT3AATHC.js.map +0 -1
  156. package/dist/chunk-YUTVAMWW.js +0 -2
  157. package/dist/cli-BXUZ3KEQ.js.map +0 -1
  158. package/dist/cli-THEU2QG2.js.map +0 -1
  159. package/dist/github-ICZ5UDGX.js +0 -36
  160. package/dist/sarif-UVAFWZKS.js +0 -37
  161. /package/dist/{batch-L5W4JS7A.js.map → batch-SAW4E46C.js.map} +0 -0
  162. /package/dist/{build-GNZUVDZX.js.map → build-F6S3W77I.js.map} +0 -0
  163. /package/dist/{calibrate-2LYIDN6U.js.map → calibrate-3DW2VV7F.js.map} +0 -0
  164. /package/dist/{capture-OEDMFU5Z.js.map → capture-PKEYY2VO.js.map} +0 -0
  165. /package/dist/{check-JR2TYL2Y.js.map → check-7PUIHLFM.js.map} +0 -0
  166. /package/dist/{check-LVO4HZ3F.js.map → check-EZN7YNVF.js.map} +0 -0
  167. /package/dist/{check-NLLFHNWG.js.map → check-LRX2YFDF.js.map} +0 -0
  168. /package/dist/{check-Z5VGDSDT.js.map → check-NW7GHSX6.js.map} +0 -0
  169. /package/dist/{chunk-LEOQO3S6.js.map → chunk-2A5OIZHT.js.map} +0 -0
  170. /package/dist/{chunk-FU3OCYYH.js.map → chunk-2LCJNH73.js.map} +0 -0
  171. /package/dist/{chunk-6ANTGYNT.js.map → chunk-3446DW4W.js.map} +0 -0
  172. /package/dist/{chunk-YF6IZXAC.js.map → chunk-5QOTR53S.js.map} +0 -0
  173. /package/dist/{chunk-6YFEV7CM.js.map → chunk-64EDFJ5S.js.map} +0 -0
  174. /package/dist/{chunk-2AUULNIJ.js.map → chunk-ABAFKOQF.js.map} +0 -0
  175. /package/dist/{chunk-ZT5NUSZA.js.map → chunk-D3AO2PMV.js.map} +0 -0
  176. /package/dist/{chunk-EZCJPF72.js.map → chunk-DSJTYRI5.js.map} +0 -0
  177. /package/dist/{chunk-DTG6S2UG.js.map → chunk-FEURGKJC.js.map} +0 -0
  178. /package/dist/{chunk-EA5KKIFG.js.map → chunk-FPPHEHPZ.js.map} +0 -0
  179. /package/dist/{chunk-O6YTTBSN.js.map → chunk-KB4MNUKC.js.map} +0 -0
  180. /package/dist/{chunk-GR6QQ7GM.js.map → chunk-KCNBM42T.js.map} +0 -0
  181. /package/dist/{chunk-EOSQENQF.js.map → chunk-LDIUA4ZG.js.map} +0 -0
  182. /package/dist/{chunk-L3YGGYBG.js.map → chunk-M6DNOHJO.js.map} +0 -0
  183. /package/dist/{chunk-4L3JBAW4.js.map → chunk-MBLVLQWI.js.map} +0 -0
  184. /package/dist/{chunk-4HEEXPVX.js.map → chunk-MDXDTO7E.js.map} +0 -0
  185. /package/dist/{chunk-IGRXQC3H.js.map → chunk-N25KDXOV.js.map} +0 -0
  186. /package/dist/{chunk-DW22KCLN.js.map → chunk-NPZWOPOH.js.map} +0 -0
  187. /package/dist/{chunk-NDBISART.js.map → chunk-PS4Y7EPP.js.map} +0 -0
  188. /package/dist/{chunk-63GILHR5.js.map → chunk-QIKCIREY.js.map} +0 -0
  189. /package/dist/{chunk-ZJZQPOJO.js.map → chunk-QIWSEKA6.js.map} +0 -0
  190. /package/dist/{chunk-F6B2TNXU.js.map → chunk-TNYIXIYV.js.map} +0 -0
  191. /package/dist/{chunk-CSLJMML4.js.map → chunk-TUMR35B3.js.map} +0 -0
  192. /package/dist/{chunk-DSTRT6YD.js.map → chunk-U5NSIZRS.js.map} +0 -0
  193. /package/dist/{chunk-YUTVAMWW.js.map → chunk-UP6NBQ62.js.map} +0 -0
  194. /package/dist/{chunk-BMYCLTFK.js.map → chunk-VRMQSP7O.js.map} +0 -0
  195. /package/dist/{chunk-IM67NRUW.js.map → chunk-W7IEP7IG.js.map} +0 -0
  196. /package/dist/{chunk-5PO2BWZF.js.map → chunk-W7XOMNYC.js.map} +0 -0
  197. /package/dist/{chunk-PBZZUNDV.js.map → chunk-WP5EKWTU.js.map} +0 -0
  198. /package/dist/{chunk-LPBVWUKS.js.map → chunk-WZSL7KF2.js.map} +0 -0
  199. /package/dist/{chunk-GC47NBGO.js.map → chunk-XCEEJEVA.js.map} +0 -0
  200. /package/dist/{chunk-4LLYPDNG.js.map → chunk-XPGK4ECA.js.map} +0 -0
  201. /package/dist/{chunk-AWAXAJ6R.js.map → chunk-XRWQQHBR.js.map} +0 -0
  202. /package/dist/{chunk-IL62WATF.js.map → chunk-YJHHXM5B.js.map} +0 -0
  203. /package/dist/{chunk-NH6B6DDI.js.map → chunk-ZEYNLKOH.js.map} +0 -0
  204. /package/dist/{chunk-PHNAQ4QX.js.map → chunk-ZIXU7A4C.js.map} +0 -0
  205. /package/dist/{cli-5QTSTGTX.js.map → cli-D5WYQVUF.js.map} +0 -0
  206. /package/dist/{cli-4Y2XY52B.js.map → cli-FCGGNZ5C.js.map} +0 -0
  207. /package/dist/{cli-DBMPGGOV.js.map → cli-FNX4LXMI.js.map} +0 -0
  208. /package/dist/{cli-KAUXC7EZ.js.map → cli-LQRHK23G.js.map} +0 -0
  209. /package/dist/{cli-RWRYV5FB.js.map → cli-LRKBCQRS.js.map} +0 -0
  210. /package/dist/{cli-2EKRURBU.js.map → cli-NJC3H3CW.js.map} +0 -0
  211. /package/dist/{cli-2SDBEUER.js.map → cli-OHKWCJIJ.js.map} +0 -0
  212. /package/dist/{cli-TZ2OHF3H.js.map → cli-VC3BXCVR.js.map} +0 -0
  213. /package/dist/{github-ICZ5UDGX.js.map → github-6PV2JTZ7.js.map} +0 -0
  214. /package/dist/{github-UR6LMUMW.js.map → github-7ZT4KYQU.js.map} +0 -0
  215. /package/dist/{json-QTYN2JQB.js.map → json-VWXLDTXR.js.map} +0 -0
  216. /package/dist/{lint-LOFNZZPR.js.map → lint-5OERIERT.js.map} +0 -0
  217. /package/dist/{list-EPMHOU7T.js.map → list-MANBRF7Z.js.map} +0 -0
  218. /package/dist/{list-GU7S6KEX.js.map → list-SEEANTU6.js.map} +0 -0
  219. /package/dist/{page-25CN3AFY.js.map → page-O4M65KMJ.js.map} +0 -0
  220. /package/dist/{prepare-5GYMBF4P.js.map → prepare-3WULLZER.js.map} +0 -0
  221. /package/dist/{pretty-52Z74O6F.js.map → pretty-5FRBLTXU.js.map} +0 -0
  222. /package/dist/{pretty-QW6OSYRS.js.map → pretty-D3M366JD.js.map} +0 -0
  223. /package/dist/{reporters-3FXX2W4X.js.map → reporters-4WWZRHKI.js.map} +0 -0
  224. /package/dist/{reporters-FSXJ42EB.js.map → reporters-6TEJDXXO.js.map} +0 -0
  225. /package/dist/{reporters-WT53GD4P.js.map → reporters-GDCZ5P7C.js.map} +0 -0
  226. /package/dist/{run-H7XJMUWK.js.map → run-TZDLG6EN.js.map} +0 -0
  227. /package/dist/{sarif-C427U3NA.js.map → sarif-PUZAMEFQ.js.map} +0 -0
  228. /package/dist/{sarif-UVAFWZKS.js.map → sarif-SSSPOUCK.js.map} +0 -0
  229. /package/dist/{types-VMOT7RAL.js.map → types-7N7ETP3W.js.map} +0 -0
  230. /package/dist/{validate-K36F54UB.js.map → validate-4AW7KIIY.js.map} +0 -0
@@ -5,7 +5,7 @@ import {
5
5
  offerPrompt,
6
6
  planRelocation,
7
7
  relocationOffers
8
- } from "./chunk-3GLDB7MZ.js";
8
+ } from "./chunk-AIZBZYQM.js";
9
9
 
10
10
  // src/meta/core/location-writes.ts
11
11
  import { LineCounter, isMap, isNode, isScalar, parseDocument } from "yaml";
@@ -161,4 +161,4 @@ export {
161
161
  mergeMetaProvenance,
162
162
  metaProvenanceEntries
163
163
  };
164
- //# sourceMappingURL=chunk-O6YTTBSN.js.map
164
+ //# sourceMappingURL=chunk-KB4MNUKC.js.map
@@ -8,12 +8,12 @@ import {
8
8
  loadTemplateFile,
9
9
  resolveLintRun,
10
10
  resolveStructureTool
11
- } from "./chunk-NH6B6DDI.js";
11
+ } from "./chunk-ZEYNLKOH.js";
12
12
  import {
13
13
  parserByName,
14
14
  parserForExtension,
15
15
  unsupportedFormatMessage
16
- } from "./chunk-6ANTGYNT.js";
16
+ } from "./chunk-3446DW4W.js";
17
17
  import {
18
18
  BLOCK_KINDS,
19
19
  BLOCK_KIND_NODE,
@@ -25,7 +25,7 @@ import {
25
25
  } from "./chunk-TKINOTVS.js";
26
26
  import {
27
27
  writeTextAtomic
28
- } from "./chunk-3GLDB7MZ.js";
28
+ } from "./chunk-AIZBZYQM.js";
29
29
  import {
30
30
  palette
31
31
  } from "./chunk-RNVYGWIC.js";
@@ -525,4 +525,4 @@ export {
525
525
  occurrenceWords,
526
526
  renderTemplateShow
527
527
  };
528
- //# sourceMappingURL=chunk-GR6QQ7GM.js.map
528
+ //# sourceMappingURL=chunk-KCNBM42T.js.map
@@ -0,0 +1,314 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ GraphError,
4
+ STDIN_PATH
5
+ } from "./chunk-4GGADKTU.js";
6
+ import {
7
+ metaPageView
8
+ } from "./chunk-M6DNOHJO.js";
9
+ import {
10
+ parseLines
11
+ } from "./chunk-AIZBZYQM.js";
12
+ import {
13
+ errorMessage
14
+ } from "./chunk-G3T47CFV.js";
15
+
16
+ // src/graph/core/graph-output.ts
17
+ async function suppressGraphOutput(docs, sets) {
18
+ const out = [];
19
+ for (const doc of docs) {
20
+ let refs;
21
+ let frontmatter;
22
+ let statements;
23
+ try {
24
+ refs = sets.refsFor(doc.path, doc.frontmatter);
25
+ frontmatter = await allowed(doc.frontmatter, refs, sets.validator);
26
+ statements = doc.statements && await Promise.all(
27
+ doc.statements.map(async (s) => {
28
+ const data = await allowed(s.data, refs, sets.validator);
29
+ return data === s.data ? s : { ...s, data };
30
+ })
31
+ );
32
+ } catch (e) {
33
+ throw new GraphError(
34
+ `${doc.path}: cannot read which fields the graph may carry: ${errorMessage(e)}`
35
+ );
36
+ }
37
+ const same = frontmatter === doc.frontmatter && (statements ?? []).every((s, i) => s === doc.statements?.[i]);
38
+ out.push(same ? doc : { ...doc, frontmatter, ...statements ? { statements } : {} });
39
+ }
40
+ return out;
41
+ }
42
+ async function deliveredFields(data, refs, validator) {
43
+ const pointers = await validator.deliveryExclusions(data, refs);
44
+ if (pointers.length === 0) return data;
45
+ const copy = structuredClone(data);
46
+ const paths = pointers.map((p) => p.slice(1).split("/").map((s) => s.replace(/~1/g, "/").replace(/~0/g, "~")));
47
+ paths.sort((a, b) => -comparePaths(a, b));
48
+ for (const path of paths) removeAt(copy, path);
49
+ return copy;
50
+ }
51
+ function comparePaths(a, b) {
52
+ for (let i = 0; i < Math.min(a.length, b.length); i++) {
53
+ const x = a[i] ?? "";
54
+ const y = b[i] ?? "";
55
+ if (x === y) continue;
56
+ const nx = /^\d+$/.test(x) ? Number(x) : Number.NaN;
57
+ const ny = /^\d+$/.test(y) ? Number(y) : Number.NaN;
58
+ if (!Number.isNaN(nx) && !Number.isNaN(ny)) return nx - ny;
59
+ return x < y ? -1 : 1;
60
+ }
61
+ return a.length - b.length;
62
+ }
63
+ function removeAt(root, path) {
64
+ let node = root;
65
+ for (const segment of path.slice(0, -1)) {
66
+ if (typeof node !== "object" || node === null) return;
67
+ node = node[segment];
68
+ }
69
+ const last = path[path.length - 1];
70
+ if (last === void 0 || typeof node !== "object" || node === null) return;
71
+ if (Array.isArray(node)) {
72
+ const index = Number(last);
73
+ if (Number.isInteger(index) && index < node.length) node.splice(index, 1);
74
+ return;
75
+ }
76
+ Reflect.deleteProperty(node, last);
77
+ }
78
+ async function allowed(data, refs, validator) {
79
+ const preferences = await validator.graphOutputPreferences(data, refs);
80
+ const suppressed = [...preferences].filter(([, ok]) => !ok).map(([key]) => key);
81
+ if (suppressed.length === 0) return data;
82
+ const kept = { ...data };
83
+ for (const key of suppressed) Reflect.deleteProperty(kept, key);
84
+ return kept;
85
+ }
86
+
87
+ // src/graph/core/external.ts
88
+ import { resolve } from "node:path";
89
+ async function openMetaView(source, cwd, paths, base = cwd) {
90
+ try {
91
+ return await metaPageView({
92
+ cwd: base,
93
+ ...source.configPath === void 0 ? {} : { configPath: resolve(cwd, source.configPath) },
94
+ ...source.noConfig === void 0 ? {} : { noConfig: source.noConfig },
95
+ pages: paths.filter((p) => p !== STDIN_PATH).map((p) => resolve(base, p))
96
+ });
97
+ } catch (e) {
98
+ throw new GraphError(errorMessage(e));
99
+ }
100
+ }
101
+ function pointerOf(key) {
102
+ return `/${key.replace(/~/g, "~0").replace(/\//g, "~1")}`;
103
+ }
104
+ async function mergePage(view, path, frontmatter, present, format) {
105
+ let merged;
106
+ try {
107
+ merged = await view.merge(path, {
108
+ data: frontmatter,
109
+ present,
110
+ format,
111
+ lineFor: () => void 0
112
+ });
113
+ } catch (e) {
114
+ throw new GraphError(errorMessage(e));
115
+ }
116
+ const data = merged.extracted.data;
117
+ const supplied = {};
118
+ for (const key of Object.keys(data)) {
119
+ if (merged.locate(pointerOf(key)) !== void 0) supplied[key] = data[key];
120
+ }
121
+ return { data, supplied };
122
+ }
123
+ async function withExternalMetadata(docs, view) {
124
+ const out = [];
125
+ for (const doc of docs) {
126
+ const { data } = await mergePage(
127
+ view,
128
+ doc.path,
129
+ doc.frontmatter,
130
+ doc.frontmatterPresent,
131
+ doc.format
132
+ );
133
+ out.push(data === doc.frontmatter ? doc : { ...doc, frontmatter: data });
134
+ }
135
+ return out;
136
+ }
137
+
138
+ // src/graph/core/questions.ts
139
+ import { existsSync, readFileSync } from "node:fs";
140
+ import { Ajv2020 } from "ajv/dist/2020.js";
141
+ import { isNode, isSeq, LineCounter, parseDocument } from "yaml";
142
+
143
+ // src/graph/core/questions-schema.json
144
+ var questions_schema_default = {
145
+ $schema: "https://json-schema.org/draft/2020-12/schema",
146
+ $id: "manni:graph:questions",
147
+ title: "manni graph golden-set file",
148
+ description: "A list of reader questions that span pages or that the docs don't answer (proposal 0087). Each item is a page sample question's object form, plus `answers[].file` and `language`. `graph.questionFiles` names the files, and `manni graph check` asks their questions.",
149
+ type: "array",
150
+ items: {
151
+ type: "object",
152
+ additionalProperties: false,
153
+ required: ["question", "answers"],
154
+ properties: {
155
+ question: {
156
+ type: "string",
157
+ minLength: 1,
158
+ description: "The question, as a reader would ask it."
159
+ },
160
+ answers: {
161
+ type: "array",
162
+ items: {
163
+ type: "object",
164
+ additionalProperties: false,
165
+ required: ["file", "lines"],
166
+ properties: {
167
+ file: {
168
+ type: "string",
169
+ minLength: 1,
170
+ description: "The page that holds this answer, relative to the config file."
171
+ },
172
+ lines: {
173
+ oneOf: [
174
+ { type: "integer", minimum: 1 },
175
+ { type: "string", pattern: "^[1-9][0-9]*-[1-9][0-9]*$" }
176
+ ],
177
+ description: "Body lines of that page, counted as for a citation's claim."
178
+ },
179
+ integrity: {
180
+ type: "string",
181
+ pattern: "^sha256-[0-9a-f]{64}$",
182
+ description: "The pin over those lines, under cite's hashing rule. Without it, the lines are not checked for change."
183
+ },
184
+ reviewed: {
185
+ type: "boolean",
186
+ description: "`false` marks a pin nobody has confirmed. Absent means `true`."
187
+ }
188
+ }
189
+ },
190
+ description: "The lines that answer the question, on one page or several. An empty list marks a known gap: a question the docs don't answer."
191
+ },
192
+ language: {
193
+ type: "string",
194
+ pattern: "^[A-Za-z]{2,3}(-[A-Za-z]{4})?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*$",
195
+ description: "The question's language, as a BCP-47 tag. Absent, it is the first answer's page language."
196
+ },
197
+ "generated-by": {
198
+ type: "string",
199
+ minLength: 1,
200
+ description: "The model that drafted the question or any of its pins, as `provider/model`."
201
+ },
202
+ confidence: {
203
+ type: "number",
204
+ minimum: 0,
205
+ maximum: 1,
206
+ description: "The drafting model's confidence, 0..1."
207
+ },
208
+ reviewed: {
209
+ type: "boolean",
210
+ description: "`false` marks a drafted question, and its pins are drafts with it. Absent means `true`."
211
+ },
212
+ "reviewed-by": {
213
+ type: "string",
214
+ minLength: 1,
215
+ description: "Who confirmed the question. An optional record."
216
+ }
217
+ }
218
+ }
219
+ };
220
+
221
+ // src/graph/core/questions.ts
222
+ function isRecord(value) {
223
+ return typeof value === "object" && value !== null && !Array.isArray(value);
224
+ }
225
+ function readPin(value) {
226
+ if (!isRecord(value)) return void 0;
227
+ const spec = value.lines;
228
+ const lines = typeof spec === "number" || typeof spec === "string" ? parseLines(spec) : void 0;
229
+ if (lines === void 0) return void 0;
230
+ const integrity = value.integrity;
231
+ return {
232
+ lines,
233
+ ...typeof integrity === "string" ? { integrity } : {},
234
+ reviewed: value.reviewed !== false
235
+ };
236
+ }
237
+ function readItem(item) {
238
+ if (typeof item === "string") {
239
+ return item === "" ? void 0 : { question: item, answers: [], reviewed: true };
240
+ }
241
+ if (!isRecord(item) || typeof item.question !== "string") return void 0;
242
+ const question = item.question;
243
+ if (question === "") return void 0;
244
+ const answers = Array.isArray(item.answers) ? item.answers.flatMap((a) => readPin(a) ?? []) : [];
245
+ return { question, answers, reviewed: item.reviewed !== false };
246
+ }
247
+ function readSampleQuestions(value) {
248
+ const items = Array.isArray(value) ? value : value === void 0 ? [] : [value];
249
+ return items.flatMap((item) => readItem(item) ?? []);
250
+ }
251
+ var validateFile;
252
+ function readQuestionFile(abs, label, text) {
253
+ if (text === void 0 && !existsSync(abs)) {
254
+ throw new GraphError(
255
+ `graph.questionFiles names ${label}, which does not exist. Fix the path, or remove it from graph.questionFiles.`
256
+ );
257
+ }
258
+ const counter = new LineCounter();
259
+ const doc = parseDocument(text ?? readFileSync(abs, "utf8"), { lineCounter: counter });
260
+ const [error] = doc.errors;
261
+ if (error) throw new GraphError(`${label}: ${error.message}`);
262
+ const value = doc.toJS() ?? [];
263
+ validateFile ??= new Ajv2020({ allowUnionTypes: true }).compile(questions_schema_default);
264
+ if (!validateFile(value) || !Array.isArray(value)) {
265
+ const [first] = validateFile.errors ?? [];
266
+ const where = [first?.instancePath, first?.message ?? "is invalid"].filter(Boolean).join(" ");
267
+ throw new GraphError(`${label}: ${where}.`);
268
+ }
269
+ const nodes = isSeq(doc.contents) ? doc.contents.items : [];
270
+ return value.flatMap((item, n) => {
271
+ if (!isRecord(item) || typeof item.question !== "string") return [];
272
+ const node = nodes[n];
273
+ const offset = isNode(node) ? node.range[0] : void 0;
274
+ const answers = Array.isArray(item.answers) ? item.answers.flatMap((a) => {
275
+ const pin = readPin(a);
276
+ return pin && isRecord(a) && typeof a.file === "string" ? [{ ...pin, file: a.file }] : [];
277
+ }) : [];
278
+ return [
279
+ {
280
+ question: item.question,
281
+ answers,
282
+ reviewed: item.reviewed !== false,
283
+ ...typeof item.language === "string" ? { language: item.language } : {},
284
+ line: offset === void 0 ? 1 : counter.linePos(offset).line
285
+ }
286
+ ];
287
+ });
288
+ }
289
+ function questionKey(question) {
290
+ return question.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu, "").replace(/\s+/gu, " ").trim();
291
+ }
292
+ var COPIED_SHARE = 0.5;
293
+ function copiedPairs(question, ...answers) {
294
+ const words = (text) => text.toLowerCase().match(/[\p{L}\p{N}]+/gu) ?? [];
295
+ const pairs = (list) => list.slice(1).map((w, i) => `${list[i] ?? ""} ${w}`);
296
+ const asked = pairs(words(question));
297
+ if (asked.length === 0) return void 0;
298
+ const said = new Set(answers.flatMap((a) => pairs(words(a))));
299
+ return { copied: asked.filter((p) => said.has(p)).length, of: asked.length };
300
+ }
301
+
302
+ export {
303
+ readSampleQuestions,
304
+ readQuestionFile,
305
+ questionKey,
306
+ COPIED_SHARE,
307
+ copiedPairs,
308
+ suppressGraphOutput,
309
+ deliveredFields,
310
+ openMetaView,
311
+ mergePage,
312
+ withExternalMetadata
313
+ };
314
+ //# sourceMappingURL=chunk-KUXAHHDE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/graph/core/graph-output.ts","../src/graph/core/external.ts","../src/graph/core/questions.ts","../src/graph/core/questions-schema.json"],"sourcesContent":["/**\n * `x-manni-graph-output` (proposal 0051 §5), on graph's side of the seam.\n *\n * Which fields belong in a published graph is a property of the field, not of\n * this tool, so it is recorded where the field is defined. The keyword is a\n * boolean beside a top-level property, registered on every Ajv `manni meta`\n * builds and read back through `Validator.graphOutputPreferences`. Absent means\n * `true`: every field is harvested. A mark nested inside `graph` is ignored, as\n * 0047 rule 2 ignores an `x-manni-location` there — the mark governs a\n * top-level key, and `graph` is the top-level key.\n *\n * The filter runs once, before `deriveGraph`, because all four published\n * outputs descend from what derivation produces: `emitTurtle` writes the graph,\n * and JSON-LD, the iiRDS package and the search index are all built by reading\n * that graph back. Dropping the field here keeps it out of every one of them.\n *\n * Encrypted values (proposal 0045) are harvested like any other value. graph\n * never decrypts, so what lands in the graph is the `~…` token, which says a\n * value exists and nothing about what it is. A field that should not reach a\n * published graph at all is marked `false` — one mechanism for \"keep this out\n * of the output\", rather than one rule for encryption and another for\n * everything else (0051 stress test 4).\n */\nimport type { MetaPageView } from \"../../meta/internal.js\";\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { GraphError } from \"../types.js\";\nimport type { DocModel } from \"../types.js\";\n\n/**\n * `docs`, with every top-level frontmatter key its schemas mark\n * `x-manni-graph-output: false` removed, and every such field of its inline\n * `meta` statements.\n *\n * A page's schemas are the set `manni meta validate` resolves for it (proposal\n * 0074): its own `$schema`, then meta's overrides, `schemas:`, `strict` and\n * the default set, read from meta's section of the same config. graph keeps\n * no schema set of its own, so one config answers both what a page is checked\n * against and what its published graph may carry.\n *\n * The docs arrive with their manifests' values already merged\n * (`withExternalMetadata`), so a field kept beside the page is filtered by\n * the same mark as one kept on it.\n *\n * A document whose schemas mark nothing is returned as it came in, so the\n * common case allocates nothing.\n */\nexport async function suppressGraphOutput(\n docs: readonly DocModel[],\n sets: Pick<MetaPageView, \"validator\" | \"refsFor\">,\n): Promise<DocModel[]> {\n const out: DocModel[] = [];\n for (const doc of docs) {\n let refs: string[];\n let frontmatter: Record<string, unknown>;\n let statements: DocModel[\"statements\"];\n try {\n refs = sets.refsFor(doc.path, doc.frontmatter);\n frontmatter = await allowed(doc.frontmatter, refs, sets.validator);\n // A statement's fields validate against the page's own schemas\n // (proposal 0099), so the same marks govern them.\n statements =\n doc.statements &&\n (await Promise.all(\n doc.statements.map(async (s) => {\n const data = await allowed(s.data, refs, sets.validator);\n return data === s.data ? s : { ...s, data };\n }),\n ));\n } catch (e) {\n // Loudly, and for the whole run. The schema is what decides which fields\n // a published graph may carry; a graph built while it could not be read\n // is a graph nobody checked, and quietly building one is the failure\n // this keyword exists to prevent.\n throw new GraphError(\n `${doc.path}: cannot read which fields the graph may carry: ${errorMessage(e)}`,\n );\n }\n const same =\n frontmatter === doc.frontmatter &&\n (statements ?? []).every((s, i) => s === doc.statements?.[i]);\n out.push(same ? doc : { ...doc, frontmatter, ...(statements ? { statements } : {}) });\n }\n return out;\n}\n\n/**\n * `data` as agent-facing output carries it (proposal 0090, decision 12): every\n * value its schemas mark `x-manni-graph-output: false` or\n * `x-manni-location: external` removed, at any depth, so an answer pin inside\n * a `sample-questions` item goes while its question stays. `data` itself when\n * nothing is marked, and a copy otherwise; the input is never changed.\n *\n * This is the rule for the chunk artifact's metadata. The graph build keeps\n * `suppressGraphOutput`'s top-level rule, because the graph is linked data,\n * not agent context.\n */\nexport async function deliveredFields(\n data: Record<string, unknown>,\n refs: string[],\n validator: Pick<MetaPageView[\"validator\"], \"deliveryExclusions\">,\n): Promise<Record<string, unknown>> {\n const pointers = await validator.deliveryExclusions(data, refs);\n if (pointers.length === 0) return data;\n const copy = structuredClone(data);\n // Deepest and highest index first, so removing one never shifts another.\n const paths = pointers.map((p) => p.slice(1).split(\"/\").map((s) => s.replace(/~1/g, \"/\").replace(/~0/g, \"~\")));\n paths.sort((a, b) => -comparePaths(a, b));\n for (const path of paths) removeAt(copy, path);\n return copy;\n}\n\n/** Segment by segment, numbers as numbers, a prefix first. */\nfunction comparePaths(a: readonly string[], b: readonly string[]): number {\n for (let i = 0; i < Math.min(a.length, b.length); i++) {\n const x = a[i] ?? \"\";\n const y = b[i] ?? \"\";\n if (x === y) continue;\n const nx = /^\\d+$/.test(x) ? Number(x) : Number.NaN;\n const ny = /^\\d+$/.test(y) ? Number(y) : Number.NaN;\n if (!Number.isNaN(nx) && !Number.isNaN(ny)) return nx - ny;\n return x < y ? -1 : 1;\n }\n return a.length - b.length;\n}\n\nfunction removeAt(root: unknown, path: readonly string[]): void {\n let node: unknown = root;\n for (const segment of path.slice(0, -1)) {\n if (typeof node !== \"object\" || node === null) return;\n node = (node as Record<string, unknown>)[segment];\n }\n const last = path[path.length - 1];\n if (last === undefined || typeof node !== \"object\" || node === null) return;\n if (Array.isArray(node)) {\n const index = Number(last);\n if (Number.isInteger(index) && index < node.length) node.splice(index, 1);\n return;\n }\n Reflect.deleteProperty(node, last);\n}\n\n/** `data` without the keys its schemas mark `false`, or `data` itself when none are. */\nasync function allowed(\n data: Record<string, unknown>,\n refs: string[],\n validator: MetaPageView[\"validator\"],\n): Promise<Record<string, unknown>> {\n const preferences = await validator.graphOutputPreferences(data, refs);\n const suppressed = [...preferences].filter(([, ok]) => !ok).map(([key]) => key);\n if (suppressed.length === 0) return data;\n const kept: Record<string, unknown> = { ...data };\n for (const key of suppressed) Reflect.deleteProperty(kept, key);\n return kept;\n}\n","/**\n * A page's metadata as `manni meta validate` reads it: its frontmatter, plus\n * every key an external-metadata manifest of one of its collections owns\n * (proposals 0037, 0041, 0047, 0058 and 0068).\n *\n * A corpus that keeps `owner`, `last-updated` or `meta-provenance` in a\n * `{page}.meta.yaml` beside each page would otherwise read to graph as a set\n * of pages that declare none of them. So graph reads through meta's merge,\n * not a loader of its own: the join, ownership and keyless-manifest rules are\n * the ones `meta validate` applies, and so are its refusals, which reach the\n * user in meta's words and exit 2.\n *\n * The config is meta's section of the file the run is under, the same one\n * graph already reads the output marks from (proposal 0074). `--no-config`\n * declares no collection, so no manifest is read, exactly as meta reads none.\n * A page read from stdin belongs to no collection, so no manifest supplies it.\n *\n * Encrypted values (proposal 0045) are merged as the manifest holds them.\n * graph never decrypts, so the graph carries the `~…` token.\n */\nimport { resolve } from \"node:path\";\nimport { metaPageView, type MetaPageView } from \"../../meta/internal.js\";\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { GraphError, type DocModel } from \"../types.js\";\nimport type { DocFormat } from \"./analyze.js\";\nimport { STDIN_PATH } from \"./iri.js\";\n\n/** Which config a run reads meta's section of, as its flags said. */\nexport interface MetaViewSource {\n /** `-c/--config`. */\n configPath?: string;\n /** `--no-config`. */\n noConfig?: boolean;\n}\n\n/**\n * Meta's view of the run's pages. `paths` are the run's documents relative\n * to `base` (`documentBase`), and the view's labels are too. `-c` stays\n * relative to `cwd`, where it was typed. A `{page}` manifest is read for\n * exactly these. A manifest meta refuses is refused here in meta's sentence,\n * as an operational error.\n */\nexport async function openMetaView(\n source: MetaViewSource,\n cwd: string,\n paths: readonly string[],\n base = cwd,\n): Promise<MetaPageView> {\n try {\n return await metaPageView({\n cwd: base,\n ...(source.configPath === undefined\n ? {}\n : { configPath: resolve(cwd, source.configPath) }),\n ...(source.noConfig === undefined ? {} : { noConfig: source.noConfig }),\n pages: paths.filter((p) => p !== STDIN_PATH).map((p) => resolve(base, p)),\n });\n } catch (e) {\n throw new GraphError(errorMessage(e));\n }\n}\n\n/** A page's own metadata and what its manifests add to it. */\nexport interface MergedPage {\n /** The page's metadata with every manifest-supplied key in place. */\n data: Record<string, unknown>;\n /** The top-level keys a manifest supplied, with their merged values. */\n supplied: Record<string, unknown>;\n}\n\n/** The `/key` pointer of a top-level key, RFC 6901 escaped. */\nfunction pointerOf(key: string): string {\n return `/${key.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")}`;\n}\n\n/**\n * Merge one page's frontmatter with its manifests. `present` is whether the\n * page has a frontmatter block at all, and `format` is what graph parsed it as.\n */\nexport async function mergePage(\n view: MetaPageView,\n path: string,\n frontmatter: Record<string, unknown>,\n present: boolean,\n format: DocFormat,\n): Promise<MergedPage> {\n let merged;\n try {\n merged = await view.merge(path, {\n data: frontmatter,\n present,\n format,\n lineFor: () => undefined,\n });\n } catch (e) {\n throw new GraphError(errorMessage(e));\n }\n const data = merged.extracted.data;\n const supplied: Record<string, unknown> = {};\n for (const key of Object.keys(data)) {\n if (merged.locate(pointerOf(key)) !== undefined) supplied[key] = data[key];\n }\n return { data, supplied };\n}\n\n/** `docs`, each with its manifests' values merged into its frontmatter. */\nexport async function withExternalMetadata(\n docs: readonly DocModel[],\n view: MetaPageView,\n): Promise<DocModel[]> {\n const out: DocModel[] = [];\n for (const doc of docs) {\n const { data } = await mergePage(\n view,\n doc.path,\n doc.frontmatter,\n doc.frontmatterPresent,\n doc.format,\n );\n // A run with no manifest hands the page's own object back, so the common\n // case allocates nothing.\n out.push(data === doc.frontmatter ? doc : { ...doc, frontmatter: data });\n }\n return out;\n}\n","/**\n * A page's `sample-questions`, read into one shape (manni:ai-context:1.1.0,\n * proposal 0087). An item is a string, or an object whose `answers` pin the\n * body lines that answer it. `build` derives only the question text; `check`\n * reads the pins and the review state, which never reach the graph.\n *\n * Reading is lenient: `meta validate` owns the schema, so an item it would\n * refuse is skipped here, and a malformed pin is dropped, rather than failing\n * a build or a check over a shape another command already reports.\n */\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { Ajv2020 } from \"ajv/dist/2020.js\";\nimport { isNode, isSeq, LineCounter, parseDocument } from \"yaml\";\nimport { parseLines, type PageLines } from \"../../shared/pin.js\";\nimport { GraphError } from \"../types.js\";\nimport questionsSchema from \"./questions-schema.json\" with { type: \"json\" };\n\n/** One pinned answer: body lines of the page, and the pin over them. */\nexport interface AnswerPin {\n lines: PageLines;\n integrity?: string;\n /** `false` only when the pin says so; absent means confirmed. */\n reviewed: boolean;\n}\n\nexport interface SampleQuestion {\n question: string;\n /** Empty for an unpinned question, which must find the page itself. */\n answers: AnswerPin[];\n /** `false` only when the item says so; absent means confirmed. */\n reviewed: boolean;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction readPin(value: unknown): AnswerPin | undefined {\n if (!isRecord(value)) return undefined;\n const spec = value.lines;\n const lines =\n typeof spec === \"number\" || typeof spec === \"string\" ? parseLines(spec) : undefined;\n if (lines === undefined) return undefined;\n const integrity = value.integrity;\n return {\n lines,\n ...(typeof integrity === \"string\" ? { integrity } : {}),\n reviewed: value.reviewed !== false,\n };\n}\n\nfunction readItem(item: unknown): SampleQuestion | undefined {\n if (typeof item === \"string\") {\n return item === \"\" ? undefined : { question: item, answers: [], reviewed: true };\n }\n if (!isRecord(item) || typeof item.question !== \"string\") return undefined;\n const question = item.question;\n if (question === \"\") return undefined;\n const answers = Array.isArray(item.answers)\n ? item.answers.flatMap((a) => readPin(a) ?? [])\n : [];\n return { question, answers, reviewed: item.reviewed !== false };\n}\n\n/** The questions a `sample-questions` value holds: one item, or a list of them. */\nexport function readSampleQuestions(value: unknown): SampleQuestion[] {\n const items: unknown[] = Array.isArray(value) ? value : value === undefined ? [] : [value];\n return items.flatMap((item) => readItem(item) ?? []);\n}\n\n/** One answer in a golden-set file: a pin on the page `file` names. */\nexport interface FileAnswerPin extends AnswerPin {\n /** The page, relative to the config file, as the item names it. */\n file: string;\n}\n\n/** One question in a golden-set file (proposal 0087). */\nexport interface FileQuestion {\n question: string;\n /** Empty for a known gap, a question the docs don't answer. */\n answers: FileAnswerPin[];\n reviewed: boolean;\n /** The item's own `language`, when it names one. */\n language?: string;\n /** The file line the item starts on, 1-based. */\n line: number;\n}\n\nlet validateFile: ReturnType<Ajv2020[\"compile\"]> | undefined;\n\n/**\n * The questions of one golden-set file. `abs` is where it is read from, and\n * `label` is how messages name it. A missing file, a YAML error and a schema\n * failure are each a `GraphError`, an operational error: a golden set that\n * cannot be read gates nothing.\n */\nexport function readQuestionFile(abs: string, label: string, text?: string): FileQuestion[] {\n if (text === undefined && !existsSync(abs)) {\n throw new GraphError(\n `graph.questionFiles names ${label}, which does not exist. Fix the path, or remove it from graph.questionFiles.`,\n );\n }\n const counter = new LineCounter();\n const doc = parseDocument(text ?? readFileSync(abs, \"utf8\"), { lineCounter: counter });\n const [error] = doc.errors;\n if (error) throw new GraphError(`${label}: ${error.message}`);\n const value: unknown = doc.toJS() ?? [];\n validateFile ??= new Ajv2020({ allowUnionTypes: true }).compile(questionsSchema);\n if (!validateFile(value) || !Array.isArray(value)) {\n const [first] = validateFile.errors ?? [];\n const where = [first?.instancePath, first?.message ?? \"is invalid\"].filter(Boolean).join(\" \");\n throw new GraphError(`${label}: ${where}.`);\n }\n const nodes = isSeq(doc.contents) ? doc.contents.items : [];\n return value.flatMap((item: unknown, n): FileQuestion[] => {\n if (!isRecord(item) || typeof item.question !== \"string\") return [];\n const node = nodes[n];\n const offset = isNode(node) ? node.range[0] : undefined;\n const answers = Array.isArray(item.answers)\n ? item.answers.flatMap((a: unknown): FileAnswerPin[] => {\n const pin = readPin(a);\n return pin && isRecord(a) && typeof a.file === \"string\" ? [{ ...pin, file: a.file }] : [];\n })\n : [];\n return [\n {\n question: item.question,\n answers,\n reviewed: item.reviewed !== false,\n ...(typeof item.language === \"string\" ? { language: item.language } : {}),\n line: offset === undefined ? 1 : counter.linePos(offset).line,\n },\n ];\n });\n}\n\n/**\n * A question as duplicates are compared: lowercased, punctuation dropped,\n * and runs of spaces folded to one.\n */\nexport function questionKey(question: string): string {\n return question\n .toLowerCase()\n .replace(/[^\\p{L}\\p{N}\\s]/gu, \"\")\n .replace(/\\s+/gu, \" \")\n .trim();\n}\n\n/** The share of a question its answer already says, past which it copies. */\nexport const COPIED_SHARE = 0.5;\n\n/**\n * How many of the question's adjacent word pairs, lowercased, the text of its\n * answers also holds. Undefined under two words, where there is no pair to measure.\n */\nexport function copiedPairs(\n question: string,\n ...answers: string[]\n): { copied: number; of: number } | undefined {\n const words = (text: string): string[] => text.toLowerCase().match(/[\\p{L}\\p{N}]+/gu) ?? [];\n const pairs = (list: string[]): string[] => list.slice(1).map((w, i) => `${list[i] ?? \"\"} ${w}`);\n const asked = pairs(words(question));\n if (asked.length === 0) return undefined;\n // Each answer on its own, so no pair spans two of them.\n const said = new Set(answers.flatMap((a) => pairs(words(a))));\n return { copied: asked.filter((p) => said.has(p)).length, of: asked.length };\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"manni:graph:questions\",\n \"title\": \"manni graph golden-set file\",\n \"description\": \"A list of reader questions that span pages or that the docs don't answer (proposal 0087). Each item is a page sample question's object form, plus `answers[].file` and `language`. `graph.questionFiles` names the files, and `manni graph check` asks their questions.\",\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"question\", \"answers\"],\n \"properties\": {\n \"question\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"The question, as a reader would ask it.\"\n },\n \"answers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"file\", \"lines\"],\n \"properties\": {\n \"file\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"The page that holds this answer, relative to the config file.\"\n },\n \"lines\": {\n \"oneOf\": [\n { \"type\": \"integer\", \"minimum\": 1 },\n { \"type\": \"string\", \"pattern\": \"^[1-9][0-9]*-[1-9][0-9]*$\" }\n ],\n \"description\": \"Body lines of that page, counted as for a citation's claim.\"\n },\n \"integrity\": {\n \"type\": \"string\",\n \"pattern\": \"^sha256-[0-9a-f]{64}$\",\n \"description\": \"The pin over those lines, under cite's hashing rule. Without it, the lines are not checked for change.\"\n },\n \"reviewed\": {\n \"type\": \"boolean\",\n \"description\": \"`false` marks a pin nobody has confirmed. Absent means `true`.\"\n }\n }\n },\n \"description\": \"The lines that answer the question, on one page or several. An empty list marks a known gap: a question the docs don't answer.\"\n },\n \"language\": {\n \"type\": \"string\",\n \"pattern\": \"^[A-Za-z]{2,3}(-[A-Za-z]{4})?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*$\",\n \"description\": \"The question's language, as a BCP-47 tag. Absent, it is the first answer's page language.\"\n },\n \"generated-by\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"The model that drafted the question or any of its pins, as `provider/model`.\"\n },\n \"confidence\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1,\n \"description\": \"The drafting model's confidence, 0..1.\"\n },\n \"reviewed\": {\n \"type\": \"boolean\",\n \"description\": \"`false` marks a drafted question, and its pins are drafts with it. Absent means `true`.\"\n },\n \"reviewed-by\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Who confirmed the question. An optional record.\"\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA8CA,eAAsB,oBACpB,MACA,MACqB;AACrB,QAAM,MAAkB,CAAC;AACzB,aAAW,OAAO,MAAM;AACtB,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACF,aAAO,KAA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,OAAO;AAC7E;","names":[]}
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  displayPath
4
- } from "./chunk-YF6IZXAC.js";
4
+ } from "./chunk-5QOTR53S.js";
5
5
  import {
6
6
  TERM_FIELDS
7
7
  } from "./chunk-MC7U5IH4.js";
@@ -55,4 +55,4 @@ export {
55
55
  renderFindingsJson,
56
56
  renderFormatsJson
57
57
  };
58
- //# sourceMappingURL=chunk-EOSQENQF.js.map
58
+ //# sourceMappingURL=chunk-LDIUA4ZG.js.map
@@ -8,12 +8,12 @@ import {
8
8
  mergeWithMarks,
9
9
  pageMarks,
10
10
  pageSchemaSet
11
- } from "./chunk-3GLDB7MZ.js";
11
+ } from "./chunk-AIZBZYQM.js";
12
12
  import {
13
13
  loadMetaSection,
14
14
  rebaseConfigSchemaRefs,
15
15
  schemaTrustRoot
16
- } from "./chunk-WD33LE5A.js";
16
+ } from "./chunk-FAS3SRQB.js";
17
17
 
18
18
  // src/meta/core/page-view.ts
19
19
  async function metaPageView(opts) {
@@ -80,4 +80,4 @@ export {
80
80
  metaPageView,
81
81
  declaredAt
82
82
  };
83
- //# sourceMappingURL=chunk-L3YGGYBG.js.map
83
+ //# sourceMappingURL=chunk-M6DNOHJO.js.map
@@ -8,7 +8,7 @@ import {
8
8
  newAvailability,
9
9
  newReplay,
10
10
  remapAvailability
11
- } from "./chunk-CSLJMML4.js";
11
+ } from "./chunk-TUMR35B3.js";
12
12
  import {
13
13
  makeRedactor
14
14
  } from "./chunk-6WJUZQQX.js";
@@ -864,4 +864,4 @@ export {
864
864
  parseTraceContent,
865
865
  renderTrace
866
866
  };
867
- //# sourceMappingURL=chunk-4L3JBAW4.js.map
867
+ //# sourceMappingURL=chunk-MBLVLQWI.js.map
@@ -7,10 +7,10 @@ import {
7
7
  loadGraderPlugins,
8
8
  parseNewerThan,
9
9
  urlManifestRefusal
10
- } from "./chunk-4LLYPDNG.js";
10
+ } from "./chunk-XPGK4ECA.js";
11
11
  import {
12
12
  discoverArtifacts
13
- } from "./chunk-IL62WATF.js";
13
+ } from "./chunk-YJHHXM5B.js";
14
14
  import {
15
15
  discoverConfig
16
16
  } from "./chunk-QSPH4F56.js";
@@ -33,7 +33,7 @@ import {
33
33
  externalWriteWarnings,
34
34
  mergeMetaProvenance,
35
35
  offerExternalHomes
36
- } from "./chunk-O6YTTBSN.js";
36
+ } from "./chunk-KB4MNUKC.js";
37
37
  import {
38
38
  keyHome,
39
39
  marksValidator,
@@ -41,12 +41,12 @@ import {
41
41
  readManifestOrEmpty,
42
42
  readManifestValue,
43
43
  spliceManifestValue
44
- } from "./chunk-3GLDB7MZ.js";
44
+ } from "./chunk-AIZBZYQM.js";
45
45
  import {
46
46
  DocmetaError,
47
47
  extractFrontmatter,
48
48
  writeFileAtomic
49
- } from "./chunk-WD33LE5A.js";
49
+ } from "./chunk-FAS3SRQB.js";
50
50
  import {
51
51
  SEVERITIES
52
52
  } from "./chunk-77AINBYM.js";
@@ -1191,4 +1191,4 @@ export {
1191
1191
  runFill,
1192
1192
  renderFill
1193
1193
  };
1194
- //# sourceMappingURL=chunk-4HEEXPVX.js.map
1194
+ //# sourceMappingURL=chunk-MDXDTO7E.js.map
@@ -18,4 +18,4 @@ export {
18
18
  FIX_GUIDE,
19
19
  DocevalsError
20
20
  };
21
- //# sourceMappingURL=chunk-WDENIUC7.js.map
21
+ //# sourceMappingURL=chunk-MDZXRHIJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/docevals/types.ts"],"sourcesContent":["/**\n * Shared result model for manni docevals.\n *\n * Vocabulary follows the \"Docs as Evals\" methodology (Docs as Tests with AI):\n * every check is an *eval*; what differs is its *grader* (code-based, LLM-as-\n * judge, or human). Verdicts are binary pass/fail — aggregate rates emerge from\n * binary judgments, they are never assigned per item.\n */\nimport { ToolError } from \"../shared/errors.js\";\nimport type { Severity } from \"../shared/severity.js\";\nimport type { Guidance } from \"../shared/guidance.js\";\n\n// The judge vocabulary is shared with the inference layer and is re-exported\n// here so manni docevals code and its consumers keep one import site. A second local\n// definition would be a second thing to keep in sync.\n//\n// Match — a single run's verdict; `partial` counts as fail\n// Zone — confidence-zone routing for AI-judged evals\n// JudgeVerdict — the structured verdict of one run (the book's shape)\n// JudgeRun — one run within an ensemble\n// ConsensusResult — the aggregated outcome for one (page, eval) pair\nimport type { ConsensusResult } from \"@hawkeyexl/inference\";\n\nexport type {\n ConsensusResult,\n JudgeRun,\n JudgeVerdict,\n Match,\n Zone,\n} from \"@hawkeyexl/inference\";\n\n/**\n * Regression evals guard behavior that must keep working (~100% target pass\n * rate). Capability evals probe what the docs/system can do (~70% target).\n */\nexport type EvalType = \"capability\" | \"regression\";\n\n/**\n * Finding severity for deterministically graded evals: the family scale,\n * `notice | warning | error`, from `src/shared/severity.ts`. Only `error`\n * affects exit codes.\n */\nexport type { Severity };\n\n/** The page every docevals finding links to. */\nexport const FIX_GUIDE = \"https://hawkeyexl.github.io/manni/docevals/fix/\";\n\n/** How an eval is graded. `tool:regex` is the built-in `tool:*` kind; `registerGrader` adds others. */\nexport type GraderKind = \"ai\" | \"command\" | \"human\" | `tool:${string}`;\n\n/** A normalized finding from a deterministically graded eval (command or tool). */\nexport interface Finding {\n /** Name of the eval that produced this finding. */\n evalName: string;\n /** Repo-relative path of the page the finding applies to. */\n file: string;\n /** Grader-specific rule id (e.g. \"regex/found\"), when available. */\n ruleId?: string;\n message: string;\n severity: Severity;\n /**\n * This finding is about the *grader*, not the page: the tool could not be\n * run, or its output could not be read. It fails the eval whatever severity\n * the eval is configured at, because an eval configured `severity: warning`\n * would otherwise pass while its check never executed (ADR 01022).\n *\n * A finding about the page carries the eval's severity as usual.\n */\n diagnostic?: boolean;\n line?: number;\n col?: number;\n}\n\n/** Result of one eval applied to one page. */\nexport interface EvalResult {\n evalName: string;\n /**\n * Suite this result reports under. Stamped centrally by the engine, which\n * already computes the mapping for the suite summaries — the alternative is\n * threading it through every one of the ~30 places a result is constructed.\n */\n suite?: string;\n type: EvalType;\n grader: GraderKind;\n file: string;\n /**\n * Where the page declares the eval: the item of its `evals` key that names\n * it, in the page or in the manifest that supplied the key (proposal 0037).\n * A suite eval the page never names points at its `eval-suite` key, or at\n * the page alone when the suite is the config's default. `file` is spelled\n * like `file`, and `line` is 1-based and absent when nothing records one.\n *\n * Stamped centrally by the engine, like `suite`, on every result it\n * reports.\n */\n location?: { file: string; line?: number };\n /**\n * The page content this result judged, as `sha256-<hex>`: the SHA-256 of\n * the whole file as the run read it, frontmatter included (proposal 0090).\n * Every result for one page carries the same value. Stamped centrally by\n * the engine, like `suite`.\n */\n integrity?: string;\n /**\n * What the eval asks for (proposal 0089): `id` is the file that declares\n * it, `rule` its name, `description` its assertion, and `guide` the fix\n * page. Stamped centrally by the engine on every result, passing ones too.\n */\n guidance?: Guidance | null;\n outcome: \"pass\" | \"fail\" | \"needs-review\" | \"skipped\" | \"error\";\n /** Present for ai-graded evals. */\n consensus?: ConsensusResult;\n /** Present for command/tool-graded evals that produced findings. */\n findings?: Finding[];\n /** True when this run generated the eval's check script. */\n generated?: boolean;\n /** Set when a persisted human review resolved a needs-review outcome. */\n via?: \"human-review\";\n /**\n * Findings the baseline already recorded and this run therefore suppressed\n * (ADR 01017). Present only on a run with a baseline in effect, so its\n * absence means \"no baseline\", not \"nothing was forgiven\".\n */\n baselined?: number;\n skipReason?: string;\n /**\n * The eval's weight in its suite's pass rate. Stamped centrally by the\n * engine alongside `suite`, and for the same reason: threading it through\n * the ~30 sites that construct a result would be thirty chances to forget.\n */\n weight?: number;\n /**\n * Set when the model that judged this eval also produced what it graded.\n *\n * `content` — the machines attributed for what the eval's `target` reads\n * name this model (`provenance` for the body, the `fields` of\n * `meta-provenance` for the frontmatter, both for `raw`): the judge wrote\n * what it grades. `criterion` — a `meta-provenance` entry for this model\n * lists this eval under `evals`: the judge wrote the question. Both bias a\n * verdict without invalidating it, so this rides along with a real outcome\n * rather than replacing it, and reaches every reporter instead of stderr.\n */\n selfPreference?: { axis: \"content\" | \"criterion\"; model: string };\n durationMs: number;\n}\n\n/** Per-suite aggregate. Pass rates emerge from binary outcomes. */\nexport interface SuiteSummary {\n suite: string;\n total: number;\n passed: number;\n failed: number;\n needsReview: number;\n skipped: number;\n errored: number;\n /**\n * Weighted share of the graded set that passed, 1 when nothing ran.\n *\n * The graded set is pass + fail + error, as it has always been —\n * `needs-review` and `skipped` are in neither half, so a page awaiting review\n * neither helps nor hurts. Each eval contributes its `weight` (1 unless it\n * says otherwise), and an eval that belongs to a criterion contributes\n * nothing on its own: the criterion contributes once, for the group.\n */\n passRate: number;\n /** From config: ~1.0 for regression suites, ~0.7 for capability suites. */\n targetPassRate: number;\n meetsTarget: boolean;\n /**\n * Set when a selection filter (`--eval` / `--suite`) was active, meaning the\n * run measured part of this suite. `meetsTarget` is then always false and the\n * suite cannot fail the run either: it has numbers, but no verdict.\n */\n partial?: boolean;\n /**\n * Criteria scored in this suite. Present only when the suite declares any,\n * so its absence means \"none\", never \"none passed\".\n *\n * `suspended` counts criteria whose members were not all graded in this run.\n * They are out of the rate entirely rather than counted as failures — the\n * same reasoning as `partial` one level down (ADR 01018): a group measured\n * in part has numbers but no verdict.\n */\n criteria?: {\n total: number;\n passed: number;\n failed: number;\n suspended: number;\n };\n}\n\n/** Full run output consumed by reporters. */\nexport interface RunReport {\n pages: number;\n evalResults: EvalResult[];\n suites: SuiteSummary[];\n /**\n * Judge telemetry. Counts, not money: the dollar figure this block used to\n * carry was only as good as a price table this repo does not own, and was\n * absent entirely for `claude-cli` and self-hosted endpoints (ADR 01019).\n */\n usage: {\n totalTokens: number;\n cachedEvals: number;\n judgedEvals: number;\n };\n /** Script generations performed during this run (paths written). */\n generated: string[];\n exitCode: 0 | 1;\n}\n\n/** Operational/usage error → exit code 2. */\nexport class DocevalsError extends ToolError {\n constructor(\n message: string,\n /**\n * Set where a caller acts on the kind of error rather than reporting it.\n * `nothing-resolved`: no page this run would check resolves an eval.\n */\n readonly code?: \"nothing-resolved\",\n ) {\n super(message);\n this.name = \"DocevalsError\";\n }\n}\n"],"mappings":";;;;;;AA6CO,IAAM,YAAY;AAuKlB,IAAM,gBAAN,cAA4B,UAAU;AAAA,EAC3C,YACE,SAKS,MACT;AACA,UAAM,OAAO;AAFJ;AAGT,SAAK,OAAO;AAAA,EACd;AAAA,EAJW;AAKb;","names":[]}
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  DocevalsError
4
- } from "./chunk-WDENIUC7.js";
4
+ } from "./chunk-MDZXRHIJ.js";
5
5
 
6
6
  // src/docevals/reporters/format.ts
7
7
  var REPORT_FORMATS = [
@@ -28,4 +28,4 @@ export {
28
28
  SUMMARY_FORMATS,
29
29
  parseFormat
30
30
  };
31
- //# sourceMappingURL=chunk-IGRXQC3H.js.map
31
+ //# sourceMappingURL=chunk-N25KDXOV.js.map
@@ -6,10 +6,10 @@ import {
6
6
  import {
7
7
  REPORT_FORMATS,
8
8
  parseFormat
9
- } from "./chunk-IGRXQC3H.js";
9
+ } from "./chunk-N25KDXOV.js";
10
10
  import {
11
11
  FIX_GUIDE
12
- } from "./chunk-WDENIUC7.js";
12
+ } from "./chunk-MDZXRHIJ.js";
13
13
  import {
14
14
  escapeWorkflowCommandMessage,
15
15
  escapeWorkflowCommandProperty,
@@ -723,4 +723,4 @@ function render(report, format, opts = {}) {
723
723
  export {
724
724
  render
725
725
  };
726
- //# sourceMappingURL=chunk-DW22KCLN.js.map
726
+ //# sourceMappingURL=chunk-NPZWOPOH.js.map