@hawkeyexl/manni 4.17.1 → 4.18.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 (200) hide show
  1. package/README.md +1 -1
  2. package/dist/{batch-SAW4E46C.js → batch-5TPNK5BQ.js} +13 -13
  3. package/dist/{build-F6S3W77I.js → build-GGKCRWKH.js} +14 -14
  4. package/dist/{calibrate-3DW2VV7F.js → calibrate-OGOLLGXY.js} +14 -14
  5. package/dist/{capture-PKEYY2VO.js → capture-CNHRHTA7.js} +13 -13
  6. package/dist/{check-EZN7YNVF.js → check-BAMOJMOJ.js} +15 -13
  7. package/dist/{check-LRX2YFDF.js → check-XLIS5A7G.js} +12 -12
  8. package/dist/check-XYGABPXI.js +47 -0
  9. package/dist/{check-7PUIHLFM.js → check-ZFI7H7LS.js} +14 -14
  10. package/dist/{chunk-DU6CXY5R.js → chunk-27FP4KKD.js} +6 -6
  11. package/dist/{chunk-B5R5BWMY.js → chunk-2QZCPPVE.js} +32 -11
  12. package/dist/chunk-2QZCPPVE.js.map +1 -0
  13. package/dist/{chunk-VRMQSP7O.js → chunk-327CWO33.js} +3 -3
  14. package/dist/{chunk-JK56UPNQ.js → chunk-33FIOHJ4.js} +10 -10
  15. package/dist/{chunk-QIWSEKA6.js → chunk-3COYAAR7.js} +2 -2
  16. package/dist/{chunk-3446DW4W.js → chunk-3LZ6AYB4.js} +2 -2
  17. package/dist/{chunk-ABAFKOQF.js → chunk-4A445ALG.js} +3 -3
  18. package/dist/{chunk-M6DNOHJO.js → chunk-4KY2RUXQ.js} +3 -3
  19. package/dist/{chunk-PS4Y7EPP.js → chunk-5VA3ZOB7.js} +3 -3
  20. package/dist/{chunk-XPGK4ECA.js → chunk-6E6Z6UQL.js} +7 -7
  21. package/dist/{chunk-TUMR35B3.js → chunk-6ZYXK3JT.js} +3 -3
  22. package/dist/{chunk-KUXAHHDE.js → chunk-7RZQAMA2.js} +4 -4
  23. package/dist/{chunk-ZEYNLKOH.js → chunk-CWVL7XZR.js} +4 -4
  24. package/dist/{chunk-FEURGKJC.js → chunk-E3YXGLEU.js} +2 -2
  25. package/dist/{chunk-W7XOMNYC.js → chunk-E76WPNYO.js} +2 -2
  26. package/dist/{chunk-Q7E43SXN.js → chunk-EITEHOSX.js} +5 -5
  27. package/dist/{chunk-U5NSIZRS.js → chunk-EU5QLSNN.js} +3 -3
  28. package/dist/{chunk-TNYIXIYV.js → chunk-F7GYY373.js} +5 -5
  29. package/dist/{chunk-WBXVQW57.js → chunk-FE3US7FR.js} +3 -3
  30. package/dist/{chunk-YJHHXM5B.js → chunk-FNQE3RAW.js} +2 -2
  31. package/dist/{chunk-WRSWZEVU.js → chunk-FO6MNXOF.js} +5 -5
  32. package/dist/{chunk-5D24C6WM.js → chunk-GMOAW2EG.js} +6 -2
  33. package/dist/chunk-GMOAW2EG.js.map +1 -0
  34. package/dist/{chunk-OZL5M764.js → chunk-GNZKLUZW.js} +29 -13
  35. package/dist/chunk-GNZKLUZW.js.map +1 -0
  36. package/dist/{chunk-2A5OIZHT.js → chunk-ICRYIYMJ.js} +7 -7
  37. package/dist/{chunk-KCNBM42T.js → chunk-IIBVQCCR.js} +4 -4
  38. package/dist/{chunk-KB4MNUKC.js → chunk-JFB45L7D.js} +2 -2
  39. package/dist/{chunk-HEVYEI6O.js → chunk-JFPCDIES.js} +2 -2
  40. package/dist/{chunk-5VNFO2RT.js → chunk-JHUEACRT.js} +23 -13
  41. package/dist/chunk-JHUEACRT.js.map +1 -0
  42. package/dist/{chunk-2TLNAGVJ.js → chunk-JS5NCZYC.js} +5 -5
  43. package/dist/{chunk-QIKCIREY.js → chunk-KRQTN5KE.js} +4 -4
  44. package/dist/{chunk-AIZBZYQM.js → chunk-MH5MX4B3.js} +2 -2
  45. package/dist/{chunk-MBLVLQWI.js → chunk-NUAVQQMC.js} +2 -2
  46. package/dist/{chunk-WP5EKWTU.js → chunk-O2TE5X25.js} +5 -5
  47. package/dist/{chunk-LDIUA4ZG.js → chunk-OVQDZOMU.js} +2 -2
  48. package/dist/{chunk-FAS3SRQB.js → chunk-OZWV27SE.js} +379 -21
  49. package/dist/chunk-OZWV27SE.js.map +1 -0
  50. package/dist/{chunk-IGE6CIKZ.js → chunk-PCTJ7P6U.js} +2 -2
  51. package/dist/{chunk-IGE6CIKZ.js.map → chunk-PCTJ7P6U.js.map} +1 -1
  52. package/dist/{chunk-DSJTYRI5.js → chunk-PLN2LJDM.js} +3 -3
  53. package/dist/{chunk-XWUIFSWK.js → chunk-QGJA43DX.js} +3 -3
  54. package/dist/{chunk-64EDFJ5S.js → chunk-QWYE3S3U.js} +5 -5
  55. package/dist/{chunk-XCEEJEVA.js → chunk-QXTL5MGT.js} +4 -4
  56. package/dist/{chunk-XRWQQHBR.js → chunk-RCWP63XT.js} +2 -2
  57. package/dist/{chunk-W7IEP7IG.js → chunk-RMKMJ43W.js} +2 -2
  58. package/dist/{chunk-FPPHEHPZ.js → chunk-RVSUMNCR.js} +2 -2
  59. package/dist/{chunk-4GGADKTU.js → chunk-SVB45M54.js} +5 -5
  60. package/dist/{chunk-MDXDTO7E.js → chunk-T3VFO2LO.js} +6 -6
  61. package/dist/{chunk-2LCJNH73.js → chunk-TFTGMYDR.js} +2 -2
  62. package/dist/{chunk-WZSL7KF2.js → chunk-V2IP2ZMD.js} +2 -2
  63. package/dist/{chunk-ZIXU7A4C.js → chunk-V5QTIP2M.js} +168 -80
  64. package/dist/chunk-V5QTIP2M.js.map +1 -0
  65. package/dist/{chunk-KAWS7H4C.js → chunk-VV4YM6VM.js} +8 -8
  66. package/dist/{chunk-3UYSONT4.js → chunk-XKZZRG3Z.js} +20 -10
  67. package/dist/chunk-XKZZRG3Z.js.map +1 -0
  68. package/dist/{chunk-D3AO2PMV.js → chunk-XTQTA262.js} +142 -23
  69. package/dist/chunk-XTQTA262.js.map +1 -0
  70. package/dist/{chunk-6J2ED4ED.js → chunk-YLU4H2H3.js} +6 -6
  71. package/dist/{chunk-5QOTR53S.js → chunk-ZLOLC6WD.js} +4 -4
  72. package/dist/{cli-LRKBCQRS.js → cli-6UQ3QV2G.js} +9 -9
  73. package/dist/{cli-5ZQXVWWC.js → cli-GH42HLFK.js} +41 -22
  74. package/dist/cli-GH42HLFK.js.map +1 -0
  75. package/dist/{cli-D5WYQVUF.js → cli-GND6TVRG.js} +14 -14
  76. package/dist/{cli-FCGGNZ5C.js → cli-JHULEOH2.js} +2 -2
  77. package/dist/{cli-TJDQ5GUW.js → cli-LVHZCC2O.js} +14 -14
  78. package/dist/{cli-NJC3H3CW.js → cli-NWU77YRZ.js} +14 -14
  79. package/dist/{cli-OHKWCJIJ.js → cli-PUO75R3L.js} +20 -20
  80. package/dist/{cli-VC3BXCVR.js → cli-Q2RJMCVE.js} +27 -19
  81. package/dist/cli-Q2RJMCVE.js.map +1 -0
  82. package/dist/{cli-FNX4LXMI.js → cli-RUNYBUIV.js} +35 -35
  83. package/dist/{cli-RKYIZ6KU.js → cli-T7UJF3BF.js} +26 -26
  84. package/dist/{cli-LQRHK23G.js → cli-WUFQGIUG.js} +9 -9
  85. package/dist/cli.js +14 -14
  86. package/dist/docmeta.js +8 -8
  87. package/dist/{github-6PV2JTZ7.js → github-BV42LSW2.js} +12 -12
  88. package/dist/{github-7ZT4KYQU.js → github-XZ7OLATY.js} +14 -14
  89. package/dist/index.d.ts +172 -87
  90. package/dist/index.js +41 -41
  91. package/dist/{json-VWXLDTXR.js → json-LEEXKSGP.js} +12 -12
  92. package/dist/{json-5EQCGVCV.js → json-YTKUFNO3.js} +2 -2
  93. package/dist/{labels-ZJK27RL3.js → labels-E256WRAI.js} +11 -11
  94. package/dist/{lint-5OERIERT.js → lint-W4CM3EIO.js} +12 -12
  95. package/dist/{list-MANBRF7Z.js → list-TB4R6AP4.js} +12 -12
  96. package/dist/{list-SEEANTU6.js → list-UDDGL2OI.js} +12 -12
  97. package/dist/{page-O4M65KMJ.js → page-L64NO57W.js} +11 -11
  98. package/dist/{prepare-3WULLZER.js → prepare-GFTAYDTP.js} +12 -12
  99. package/dist/{pretty-D3M366JD.js → pretty-HYCYKYHB.js} +13 -13
  100. package/dist/{pretty-5FRBLTXU.js → pretty-Q43TCD6D.js} +12 -12
  101. package/dist/{reporters-4WWZRHKI.js → reporters-4HRBSMUF.js} +4 -4
  102. package/dist/{reporters-GDCZ5P7C.js → reporters-E3FUVBQ6.js} +11 -11
  103. package/dist/{run-TZDLG6EN.js → run-UDX2C54M.js} +12 -12
  104. package/dist/{sarif-SSSPOUCK.js → sarif-WL353VTA.js} +10 -10
  105. package/dist/{sarif-PUZAMEFQ.js → sarif-XZFJ5VIJ.js} +15 -15
  106. package/dist/{term-DHWMUL5N.js → term-OZ7ZR5KB.js} +17 -17
  107. package/dist/{validate-4AW7KIIY.js → validate-CR3TI7GP.js} +5 -5
  108. package/package.json +1 -1
  109. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  110. package/dist/check-NW7GHSX6.js +0 -47
  111. package/dist/chunk-3UYSONT4.js.map +0 -1
  112. package/dist/chunk-5D24C6WM.js.map +0 -1
  113. package/dist/chunk-5VNFO2RT.js.map +0 -1
  114. package/dist/chunk-B5R5BWMY.js.map +0 -1
  115. package/dist/chunk-D3AO2PMV.js.map +0 -1
  116. package/dist/chunk-FAS3SRQB.js.map +0 -1
  117. package/dist/chunk-OZL5M764.js.map +0 -1
  118. package/dist/chunk-ZIXU7A4C.js.map +0 -1
  119. package/dist/cli-5ZQXVWWC.js.map +0 -1
  120. package/dist/cli-VC3BXCVR.js.map +0 -1
  121. /package/dist/{batch-SAW4E46C.js.map → batch-5TPNK5BQ.js.map} +0 -0
  122. /package/dist/{build-F6S3W77I.js.map → build-GGKCRWKH.js.map} +0 -0
  123. /package/dist/{calibrate-3DW2VV7F.js.map → calibrate-OGOLLGXY.js.map} +0 -0
  124. /package/dist/{capture-PKEYY2VO.js.map → capture-CNHRHTA7.js.map} +0 -0
  125. /package/dist/{check-EZN7YNVF.js.map → check-BAMOJMOJ.js.map} +0 -0
  126. /package/dist/{check-LRX2YFDF.js.map → check-XLIS5A7G.js.map} +0 -0
  127. /package/dist/{check-NW7GHSX6.js.map → check-XYGABPXI.js.map} +0 -0
  128. /package/dist/{check-7PUIHLFM.js.map → check-ZFI7H7LS.js.map} +0 -0
  129. /package/dist/{chunk-DU6CXY5R.js.map → chunk-27FP4KKD.js.map} +0 -0
  130. /package/dist/{chunk-VRMQSP7O.js.map → chunk-327CWO33.js.map} +0 -0
  131. /package/dist/{chunk-JK56UPNQ.js.map → chunk-33FIOHJ4.js.map} +0 -0
  132. /package/dist/{chunk-QIWSEKA6.js.map → chunk-3COYAAR7.js.map} +0 -0
  133. /package/dist/{chunk-3446DW4W.js.map → chunk-3LZ6AYB4.js.map} +0 -0
  134. /package/dist/{chunk-ABAFKOQF.js.map → chunk-4A445ALG.js.map} +0 -0
  135. /package/dist/{chunk-M6DNOHJO.js.map → chunk-4KY2RUXQ.js.map} +0 -0
  136. /package/dist/{chunk-PS4Y7EPP.js.map → chunk-5VA3ZOB7.js.map} +0 -0
  137. /package/dist/{chunk-XPGK4ECA.js.map → chunk-6E6Z6UQL.js.map} +0 -0
  138. /package/dist/{chunk-TUMR35B3.js.map → chunk-6ZYXK3JT.js.map} +0 -0
  139. /package/dist/{chunk-KUXAHHDE.js.map → chunk-7RZQAMA2.js.map} +0 -0
  140. /package/dist/{chunk-ZEYNLKOH.js.map → chunk-CWVL7XZR.js.map} +0 -0
  141. /package/dist/{chunk-FEURGKJC.js.map → chunk-E3YXGLEU.js.map} +0 -0
  142. /package/dist/{chunk-W7XOMNYC.js.map → chunk-E76WPNYO.js.map} +0 -0
  143. /package/dist/{chunk-Q7E43SXN.js.map → chunk-EITEHOSX.js.map} +0 -0
  144. /package/dist/{chunk-U5NSIZRS.js.map → chunk-EU5QLSNN.js.map} +0 -0
  145. /package/dist/{chunk-TNYIXIYV.js.map → chunk-F7GYY373.js.map} +0 -0
  146. /package/dist/{chunk-WBXVQW57.js.map → chunk-FE3US7FR.js.map} +0 -0
  147. /package/dist/{chunk-YJHHXM5B.js.map → chunk-FNQE3RAW.js.map} +0 -0
  148. /package/dist/{chunk-WRSWZEVU.js.map → chunk-FO6MNXOF.js.map} +0 -0
  149. /package/dist/{chunk-2A5OIZHT.js.map → chunk-ICRYIYMJ.js.map} +0 -0
  150. /package/dist/{chunk-KCNBM42T.js.map → chunk-IIBVQCCR.js.map} +0 -0
  151. /package/dist/{chunk-KB4MNUKC.js.map → chunk-JFB45L7D.js.map} +0 -0
  152. /package/dist/{chunk-HEVYEI6O.js.map → chunk-JFPCDIES.js.map} +0 -0
  153. /package/dist/{chunk-2TLNAGVJ.js.map → chunk-JS5NCZYC.js.map} +0 -0
  154. /package/dist/{chunk-QIKCIREY.js.map → chunk-KRQTN5KE.js.map} +0 -0
  155. /package/dist/{chunk-AIZBZYQM.js.map → chunk-MH5MX4B3.js.map} +0 -0
  156. /package/dist/{chunk-MBLVLQWI.js.map → chunk-NUAVQQMC.js.map} +0 -0
  157. /package/dist/{chunk-WP5EKWTU.js.map → chunk-O2TE5X25.js.map} +0 -0
  158. /package/dist/{chunk-LDIUA4ZG.js.map → chunk-OVQDZOMU.js.map} +0 -0
  159. /package/dist/{chunk-DSJTYRI5.js.map → chunk-PLN2LJDM.js.map} +0 -0
  160. /package/dist/{chunk-XWUIFSWK.js.map → chunk-QGJA43DX.js.map} +0 -0
  161. /package/dist/{chunk-64EDFJ5S.js.map → chunk-QWYE3S3U.js.map} +0 -0
  162. /package/dist/{chunk-XCEEJEVA.js.map → chunk-QXTL5MGT.js.map} +0 -0
  163. /package/dist/{chunk-XRWQQHBR.js.map → chunk-RCWP63XT.js.map} +0 -0
  164. /package/dist/{chunk-W7IEP7IG.js.map → chunk-RMKMJ43W.js.map} +0 -0
  165. /package/dist/{chunk-FPPHEHPZ.js.map → chunk-RVSUMNCR.js.map} +0 -0
  166. /package/dist/{chunk-4GGADKTU.js.map → chunk-SVB45M54.js.map} +0 -0
  167. /package/dist/{chunk-MDXDTO7E.js.map → chunk-T3VFO2LO.js.map} +0 -0
  168. /package/dist/{chunk-2LCJNH73.js.map → chunk-TFTGMYDR.js.map} +0 -0
  169. /package/dist/{chunk-WZSL7KF2.js.map → chunk-V2IP2ZMD.js.map} +0 -0
  170. /package/dist/{chunk-KAWS7H4C.js.map → chunk-VV4YM6VM.js.map} +0 -0
  171. /package/dist/{chunk-6J2ED4ED.js.map → chunk-YLU4H2H3.js.map} +0 -0
  172. /package/dist/{chunk-5QOTR53S.js.map → chunk-ZLOLC6WD.js.map} +0 -0
  173. /package/dist/{cli-LRKBCQRS.js.map → cli-6UQ3QV2G.js.map} +0 -0
  174. /package/dist/{cli-D5WYQVUF.js.map → cli-GND6TVRG.js.map} +0 -0
  175. /package/dist/{cli-FCGGNZ5C.js.map → cli-JHULEOH2.js.map} +0 -0
  176. /package/dist/{cli-TJDQ5GUW.js.map → cli-LVHZCC2O.js.map} +0 -0
  177. /package/dist/{cli-NJC3H3CW.js.map → cli-NWU77YRZ.js.map} +0 -0
  178. /package/dist/{cli-OHKWCJIJ.js.map → cli-PUO75R3L.js.map} +0 -0
  179. /package/dist/{cli-FNX4LXMI.js.map → cli-RUNYBUIV.js.map} +0 -0
  180. /package/dist/{cli-RKYIZ6KU.js.map → cli-T7UJF3BF.js.map} +0 -0
  181. /package/dist/{cli-LQRHK23G.js.map → cli-WUFQGIUG.js.map} +0 -0
  182. /package/dist/{github-6PV2JTZ7.js.map → github-BV42LSW2.js.map} +0 -0
  183. /package/dist/{github-7ZT4KYQU.js.map → github-XZ7OLATY.js.map} +0 -0
  184. /package/dist/{json-5EQCGVCV.js.map → json-LEEXKSGP.js.map} +0 -0
  185. /package/dist/{json-VWXLDTXR.js.map → json-YTKUFNO3.js.map} +0 -0
  186. /package/dist/{labels-ZJK27RL3.js.map → labels-E256WRAI.js.map} +0 -0
  187. /package/dist/{lint-5OERIERT.js.map → lint-W4CM3EIO.js.map} +0 -0
  188. /package/dist/{list-MANBRF7Z.js.map → list-TB4R6AP4.js.map} +0 -0
  189. /package/dist/{list-SEEANTU6.js.map → list-UDDGL2OI.js.map} +0 -0
  190. /package/dist/{page-O4M65KMJ.js.map → page-L64NO57W.js.map} +0 -0
  191. /package/dist/{prepare-3WULLZER.js.map → prepare-GFTAYDTP.js.map} +0 -0
  192. /package/dist/{pretty-5FRBLTXU.js.map → pretty-HYCYKYHB.js.map} +0 -0
  193. /package/dist/{pretty-D3M366JD.js.map → pretty-Q43TCD6D.js.map} +0 -0
  194. /package/dist/{reporters-4WWZRHKI.js.map → reporters-4HRBSMUF.js.map} +0 -0
  195. /package/dist/{reporters-GDCZ5P7C.js.map → reporters-E3FUVBQ6.js.map} +0 -0
  196. /package/dist/{run-TZDLG6EN.js.map → run-UDX2C54M.js.map} +0 -0
  197. /package/dist/{sarif-PUZAMEFQ.js.map → sarif-WL353VTA.js.map} +0 -0
  198. /package/dist/{sarif-SSSPOUCK.js.map → sarif-XZFJ5VIJ.js.map} +0 -0
  199. /package/dist/{term-DHWMUL5N.js.map → term-OZ7ZR5KB.js.map} +0 -0
  200. /package/dist/{validate-4AW7KIIY.js.map → validate-CR3TI7GP.js.map} +0 -0
@@ -13,7 +13,7 @@ import {
13
13
  resolveVariant,
14
14
  traverse,
15
15
  withholds
16
- } from "./chunk-HEVYEI6O.js";
16
+ } from "./chunk-JFPCDIES.js";
17
17
  import {
18
18
  COPIED_SHARE,
19
19
  copiedPairs,
@@ -24,7 +24,7 @@ import {
24
24
  readQuestionFile,
25
25
  readSampleQuestions,
26
26
  withExternalMetadata
27
- } from "./chunk-KUXAHHDE.js";
27
+ } from "./chunk-7RZQAMA2.js";
28
28
  import {
29
29
  DEFAULT_MODEL,
30
30
  GraphError,
@@ -50,16 +50,16 @@ import {
50
50
  profileFor,
51
51
  routesFrom,
52
52
  withPrefix
53
- } from "./chunk-4GGADKTU.js";
53
+ } from "./chunk-SVB45M54.js";
54
54
  import {
55
55
  runCheck
56
- } from "./chunk-D3AO2PMV.js";
56
+ } from "./chunk-XTQTA262.js";
57
57
  import {
58
58
  packageRoot
59
59
  } from "./chunk-TIUTIOFB.js";
60
60
  import {
61
61
  runDerive
62
- } from "./chunk-DU6CXY5R.js";
62
+ } from "./chunk-27FP4KKD.js";
63
63
  import {
64
64
  bodyLineOf,
65
65
  findWindows,
@@ -67,11 +67,11 @@ import {
67
67
  spellLines,
68
68
  splitLines,
69
69
  toFileLines
70
- } from "./chunk-AIZBZYQM.js";
70
+ } from "./chunk-MH5MX4B3.js";
71
71
  import {
72
72
  integrityOf,
73
73
  locateFrontmatter
74
- } from "./chunk-FAS3SRQB.js";
74
+ } from "./chunk-OZWV27SE.js";
75
75
  import {
76
76
  warn
77
77
  } from "./chunk-HX44GB4Z.js";
@@ -2721,4 +2721,4 @@ export {
2721
2721
  shapeText,
2722
2722
  validateGraph
2723
2723
  };
2724
- //# sourceMappingURL=chunk-KAWS7H4C.js.map
2724
+ //# sourceMappingURL=chunk-VV4YM6VM.js.map
@@ -10,7 +10,7 @@ import {
10
10
  parseStatements,
11
11
  sliceLines,
12
12
  statementForms
13
- } from "./chunk-AIZBZYQM.js";
13
+ } from "./chunk-MH5MX4B3.js";
14
14
  import {
15
15
  __default4 as __default,
16
16
  extractorByName,
@@ -18,7 +18,7 @@ import {
18
18
  hasFrontmatterFence,
19
19
  locateFrontmatter,
20
20
  supportedExtensions
21
- } from "./chunk-FAS3SRQB.js";
21
+ } from "./chunk-OZWV27SE.js";
22
22
  import {
23
23
  isEncryptedValue
24
24
  } from "./chunk-B2242FYO.js";
@@ -57,17 +57,23 @@ function hashRange2(text, range, key) {
57
57
  // src/cite/core/range.ts
58
58
  var FILE_PATTERN = /^(?:~[A-Za-z0-9_-]{82,}|(?!~)(?:(?!\.\.?(?:\/|$))[^/\\:\r\n\t]+)(?:\/(?:(?!\.\.?(?:\/|$))[^/\\:\r\n\t]+))*)$/;
59
59
  var SRC_PATTERN = /^(?:~[A-Za-z0-9_-]{82,}|(?!~)(?:(?!\.\.?(?:\/|:|$))[^/\\:\r\n\t]+)(?:\/(?:(?!\.\.?(?:\/|:|$))[^/\\:\r\n\t]+))*)(?::[1-9][0-9]*(?:-[1-9][0-9]*)?)?$/;
60
+ var REPO_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
61
+ var LINES_TAIL = /^[0-9-]*$/;
60
62
  function parseSrc(src) {
61
- if (!SRC_PATTERN.test(src)) {
63
+ const first = src.indexOf(":");
64
+ const repo = first !== -1 && !LINES_TAIL.test(src.slice(first + 1)) ? src.slice(0, first) : void 0;
65
+ const rest = repo === void 0 ? src : src.slice(first + 1);
66
+ if (repo !== void 0 && !REPO_PATTERN.test(repo) || !SRC_PATTERN.test(rest)) {
62
67
  throw new CiteError(
63
- `Invalid src "${src}": expected path, path:L, path:L1-L2, or an encrypted source (~ and at least 82 base64url characters) with the same line forms; the path is repo-root-relative, posix, and free of . and .. segments.`
68
+ `Invalid src "${src}": expected path, path:L, path:L1-L2, or an encrypted source (~ and at least 82 base64url characters) with the same line forms, each optionally prefixed with a repo name and a colon; the path is relative to its checkout, posix, and free of . and .. segments.`
64
69
  );
65
70
  }
66
- const colon = src.indexOf(":");
67
- const path = colon === -1 ? src : src.slice(0, colon);
71
+ const colon = rest.indexOf(":");
72
+ const path = colon === -1 ? rest : rest.slice(0, colon);
68
73
  const range = { path, encrypted: isEncryptedValue(path) };
74
+ if (repo !== void 0) range.repo = repo;
69
75
  if (colon === -1) return range;
70
- const [startText, endText] = src.slice(colon + 1).split("-");
76
+ const [startText, endText] = rest.slice(colon + 1).split("-");
71
77
  const start = Number(startText);
72
78
  const end = endText === void 0 ? start : Number(endText);
73
79
  if (end < start) {
@@ -82,13 +88,15 @@ function tooWide(lines) {
82
88
  return width > MAX_RANGE_LINES ? `spans ${String(width)} lines, more than ${String(MAX_RANGE_LINES)}` : void 0;
83
89
  }
84
90
  function formatSrc(range) {
85
- const { path, start, end } = range;
91
+ const { start, end } = range;
92
+ const path = range.repo === void 0 ? range.path : `${range.repo}:${range.path}`;
86
93
  if (start === void 0) return path;
87
94
  if (end === void 0 || end === start) return `${path}:${start}`;
88
95
  return `${path}:${start}-${end}`;
89
96
  }
90
97
  function sourceRange(source) {
91
98
  const range = { path: source.file, encrypted: isEncryptedValue(source.file) };
99
+ if (source.repo !== void 0) range.repo = source.repo;
92
100
  if (source.lines === void 0) return range;
93
101
  const lines = parseLines(source.lines);
94
102
  if (lines !== void 0) {
@@ -151,7 +159,7 @@ var RULE_DESCRIPTIONS = {
151
159
  "source-moved-ambiguous": "The cited lines now occur in more than one place.",
152
160
  "source-changed": "The cited lines are not what they were.",
153
161
  "source-never-true": "The pin held at no commit in the source's history.",
154
- "source-missing": "The path names no tracked file, or an encrypted source cannot be decrypted.",
162
+ "source-missing": "The path names no tracked file, names an undeclared repo, or an encrypted source cannot be decrypted.",
155
163
  "claim-moved": "The pinned page text sits at a different line.",
156
164
  "claim-moved-ambiguous": "The pinned page text now occurs in more than one place.",
157
165
  "claim-reanchored": "The pinned words are unchanged, and only the layout around them moved.",
@@ -239,6 +247,7 @@ function toCitation(entry) {
239
247
  if (typeof source["commit-sha"] === "string") {
240
248
  citation.source["commit-sha"] = source["commit-sha"];
241
249
  }
250
+ if (typeof source.repo === "string") citation.source.repo = source.repo;
242
251
  if (typeof entry.id === "string") citation.id = entry.id;
243
252
  if (isRecord(entry.claim)) {
244
253
  const claim = entry.claim;
@@ -543,6 +552,7 @@ export {
543
552
  hashRange2 as hashRange,
544
553
  FILE_PATTERN,
545
554
  SRC_PATTERN,
555
+ REPO_PATTERN,
546
556
  parseSrc,
547
557
  tooWide,
548
558
  formatSrc,
@@ -565,4 +575,4 @@ export {
565
575
  citationInputs,
566
576
  readPage
567
577
  };
568
- //# sourceMappingURL=chunk-3UYSONT4.js.map
578
+ //# sourceMappingURL=chunk-XKZZRG3Z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cite/core/page.ts","../src/cite/errors.ts","../src/cite/core/hash.ts","../src/cite/core/range.ts","../src/cite/types.ts","../src/cite/core/severity.ts","../src/cite/core/statements.ts"],"sourcesContent":["/**\n * Read a page's citations and its markers.\n *\n * Entries come from the frontmatter (via meta's extractor for the format), or\n * from `CheckPageOptions.citations` when a manifest owns them; either way each\n * one is validated against the registered `manni:citations:1.2.0` schema and\n * carries where it sits.\n * Markers are `cite <id> [<id>…]` comments in the body, resolved to the\n * entries they name, so each citation knows what anchors it. Every id one\n * marker names anchors the same text, so every claim under it pins the same\n * bytes and holds the same hash (proposal 0056).\n *\n * The findings made here are the ones that need no source: `entry-invalid`,\n * `marker-invalid`, `marker-orphan`, `marker-repeated` and `anchor-invalid`.\n */\nimport { extname } from \"node:path\";\nimport * as Ajv2020Ns from \"ajv/dist/2020.js\";\nimport type { ValidateFunction } from \"ajv/dist/2020.js\";\nimport citationsSchema from \"../../meta/schemas/citations/1.2.0.json\" with { type: \"json\" };\nimport {\n extractorForExtension,\n locateFrontmatter,\n supportedExtensions,\n type ExtractedMetadata,\n type MetadataExtractor,\n} from \"../../meta/index.js\";\nimport { extractorByName, hasFrontmatterFence } from \"../../meta/internal.js\";\nimport { isEncryptedValue } from \"../../shared/encryption.js\";\nimport { CiteError } from \"../errors.js\";\nimport type {\n Citation,\n CitationFinding,\n CitationInput,\n CitationOrigin,\n CiteRule,\n PageCitation,\n PageCitations,\n} from \"../types.js\";\nimport { isKeyedPin } from \"./hash.js\";\nimport { parseLines, spellSource, tooWide } from \"./range.js\";\nimport { DEFAULT_SEVERITY, ruleId } from \"./severity.js\";\nimport { bodyLineOf } from \"../../shared/pin.js\";\nimport { parseStatements } from \"./statements.js\";\n\nexport { MAX_IDS_PER_MARKER } from \"./statements.js\";\nexport { bodyLineOf };\n\nexport const MAX_MARKERS_PER_PAGE = 500;\n\n/** Formats whose leading fenced block is frontmatter meta would read. */\nconst ELEMENT_BACKED = new Set([\"html\", \"xml\"]);\n/** Formats whose only metadata channel is a fenced block. */\nconst FENCE_ONLY = new Set([\"markdown\", \"mdx\"]);\n\n/** What a marker with a JSON payload is told, since an entry never lives in the body. */\nexport const MARKER_JSON =\n \"invalid marker: a marker names entry ids, not an entry. Move the entry to citations:, in frontmatter or the sidecar, and name its id.\";\n\nexport interface ReadPageOptions {\n /** Extractor name; derived from the file's extension when absent. */\n format?: string;\n /**\n * The page's citations as a manifest owns them, already merged. Given, the\n * page's own frontmatter `citations` is not read.\n */\n citations?: readonly CitationInput[];\n /**\n * The manifest that owns this page's `citations`, when one does. A page\n * that also carries its own is `entry-invalid`: neither channel wins, and\n * the discarded value would be exactly the one nobody checked.\n */\n owned?: { file: string; collection: string };\n /**\n * `false` reads the entries alone, for a caller that only counts them: no\n * marker is parsed, so no marker finding is raised and none is anchored.\n */\n markers?: boolean;\n}\n\n/** Meta's `external:owned` sentence, said by `cite check` under `entry-invalid`. */\nexport function ownedMessage(owner: { file: string; collection: string }): string {\n return `\"citations\" is owned by manifest ${owner.file} (collection ${owner.collection}); remove it from the document`;\n}\n\n// ajv is CommonJS with a default export; under NodeNext the constructor lives\n// on `.default`, as src/meta/core/validator.ts notes.\ntype AjvCtor = typeof import(\"ajv/dist/2020.js\").default;\nconst Ajv2020 = Ajv2020Ns.default as unknown as AjvCtor;\n\nlet entryValidator: ValidateFunction | undefined;\n\nfunction compileEntryValidator(): ValidateFunction {\n if (entryValidator) return entryValidator;\n const ajv = new Ajv2020({ allErrors: false, strict: false });\n ajv.addSchema(citationsSchema);\n entryValidator = ajv.compile({\n $ref: `${citationsSchema.$id}#/$defs/citationEntry`,\n });\n return entryValidator;\n}\n\n/** Ajv validation of one entry object against `$defs.citationEntry`; the first error text, or undefined. */\nexport function validateEntry(entry: unknown): string | undefined {\n const validate = compileEntryValidator();\n if (validate(entry)) return undefined;\n const first = validate.errors?.[0];\n if (!first) return \"invalid entry\";\n return `${first.instancePath} ${first.message ?? \"is invalid\"}`.trim();\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/** Copy a validated entry into the `Citation` shape, field by field. */\nfunction toCitation(entry: Record<string, unknown>): Citation {\n const source = isRecord(entry.source) ? entry.source : {};\n const citation: Citation = {\n source: {\n file: String(source.file),\n integrity: String(source.integrity),\n },\n };\n if (typeof source.lines === \"number\" || typeof source.lines === \"string\") {\n citation.source.lines = source.lines;\n }\n if (typeof source[\"commit-sha\"] === \"string\") {\n citation.source[\"commit-sha\"] = source[\"commit-sha\"];\n }\n if (typeof source.repo === \"string\") citation.source.repo = source.repo;\n if (typeof entry.id === \"string\") citation.id = entry.id;\n if (isRecord(entry.claim)) {\n const claim = entry.claim;\n citation.claim = { integrity: String(claim.integrity) };\n if (typeof claim.lines === \"number\" || typeof claim.lines === \"string\") {\n citation.claim.lines = claim.lines;\n }\n }\n if (typeof entry.quote === \"boolean\") citation.quote = entry.quote;\n return citation;\n}\n\ntype FindingExtra = Pick<CitationFinding, \"line\" | \"id\" | \"src\" | \"index\" | \"file\">;\n\nfunction finding(rule: CiteRule, message: string, extra: FindingExtra): CitationFinding {\n const level = DEFAULT_SEVERITY[rule];\n const out: CitationFinding = {\n rule,\n ruleId: ruleId(rule),\n // The caller re-applies the configured severity table; no page-side rule\n // defaults to `off`, so there is nothing to collapse.\n severity: level === \"off\" ? \"error\" : level,\n message,\n };\n if (extra.line !== undefined) out.line = extra.line;\n if (extra.file !== undefined) out.file = extra.file;\n if (extra.id !== undefined) out.id = extra.id;\n if (extra.src !== undefined) out.src = extra.src;\n if (extra.index !== undefined) out.index = extra.index;\n return out;\n}\n\n/** `<id>: <text>`, or the text alone for an entry with no id. */\nfunction named(id: string | undefined, text: string): string {\n return id === undefined ? text : `${id}: ${text}`;\n}\n\n/** The `id`/`src` a finding carries for an entry that may not have validated. */\nfunction subjectOf(entry: unknown): Pick<FindingExtra, \"id\" | \"src\"> {\n const out: Pick<FindingExtra, \"id\" | \"src\"> = {};\n if (!isRecord(entry)) return out;\n if (typeof entry.id === \"string\") out.id = entry.id;\n if (isRecord(entry.source) && typeof entry.source.file === \"string\") out.src = entry.source.file;\n return out;\n}\n\nexport function pickExtractor(file: string, format: string | undefined): MetadataExtractor {\n if (format !== undefined) {\n const forced = extractorByName(format);\n if (forced === undefined) {\n throw new CiteError(\n `Unknown format \"${format}\". Supported extensions: ${supportedExtensions().join(\", \")}.`,\n );\n }\n return forced;\n }\n const extension = extname(file);\n const byExt = extractorForExtension(extension);\n if (!byExt) {\n throw new CiteError(\n `Unsupported file type \"${extension}\" for \"${file}\". Supported: ${supportedExtensions().join(\", \")}. Use --as to override.`,\n );\n }\n return byExt;\n}\n\nfunction byLine(a: CitationFinding, b: CitationFinding): number {\n return (a.line ?? Number.MAX_SAFE_INTEGER) - (b.line ?? Number.MAX_SAFE_INTEGER);\n}\n\n\n/**\n * A page's citation entries as they are written, each with where it sits: the\n * manifest's when one owns them, else the page's own frontmatter. The entries\n * are raw, so one the schema refuses is still in the list at its own index,\n * which is how `remove` reaches an entry `check` can only report.\n */\nexport function citationInputs(\n file: string,\n extracted: ExtractedMetadata,\n injected?: readonly CitationInput[],\n): CitationInput[] {\n if (injected !== undefined) return [...injected];\n const raw: unknown = extracted.data.citations;\n const list: unknown[] = Array.isArray(raw) ? (raw as unknown[]) : [];\n return list.map((entry, index) => {\n const origin: CitationInput[\"origin\"] = { kind: \"frontmatter\", file };\n const line = extracted.lineFor(`/citations/${String(index)}`);\n if (line !== undefined) origin.line = line;\n return { entry, origin };\n });\n}\n\nexport function readPage(\n file: string,\n content: string,\n opts?: ReadPageOptions,\n): PageCitations {\n const extractor = pickExtractor(file, opts?.format);\n const format = extractor.name;\n // An opening fence with no close is not a block, so the extractor reads no\n // metadata and every entry the page carries would silently vanish. rst and\n // asciidoc read a stray fence as body on purpose, ahead of their native\n // headers; the fence-only formats have no such reading.\n if (FENCE_ONLY.has(format) && hasFrontmatterFence(content) && locateFrontmatter(content) === null) {\n throw new CiteError(\n `${file}: Unterminated front matter fence: the opening fence has no matching close, so the page's citations cannot be read. Add a closing fence.`,\n );\n }\n const extracted = extractor.extract(content, file);\n const data = extracted.data;\n const bodyOffset = ELEMENT_BACKED.has(format)\n ? 0\n : (locateFrontmatter(content)?.closeEnd ?? 0);\n const bodyLine = bodyLineOf(content, bodyOffset);\n\n const findings: CitationFinding[] = [];\n const citations: PageCitation[] = [];\n /** Entries by id, for marker resolution. */\n const byId = new Map<string, PageCitation>();\n /** Every id seen, for uniqueness. */\n const ids = new Set<string>();\n /** The first marker naming an entry, by entry. */\n const markedAt = new Map<PageCitation, number>();\n\n // The page root reserves the whole `citation-` prefix, so a typo fails\n // loudly rather than passing as a key of somebody else's.\n for (const key of Object.keys(data)) {\n if (!key.startsWith(\"citation-\")) continue;\n findings.push(\n finding(\n \"entry-invalid\",\n `\"${key}\" is not a citations key; the page root reserves the citation- prefix`,\n { line: extracted.lineFor(`/${key}`) },\n ),\n );\n }\n\n const injected = opts?.citations;\n const rawCitations = data.citations;\n // The page carries a key a manifest owns (0020 across files). The page's\n // own entries are still read and checked, so the report shows what the\n // page would publish; the finding says the manifest is the one authority.\n if (opts?.owned !== undefined && rawCitations !== undefined) {\n findings.push(\n finding(\"entry-invalid\", ownedMessage(opts.owned), {\n line: extracted.lineFor(\"/citations\"),\n }),\n );\n }\n if (injected === undefined && rawCitations !== undefined && !Array.isArray(rawCitations)) {\n findings.push(\n finding(\"entry-invalid\", \"citations must be an array of entries\", {\n line: extracted.lineFor(\"/citations\"),\n }),\n );\n }\n const inputs = citationInputs(file, extracted, injected);\n\n inputs.forEach((input, index) => {\n const origin: CitationOrigin = { ...input.origin, index };\n /** Where a finding about the entry itself sits: the entry's own line, in its own file. */\n const where: FindingExtra = { index };\n if (origin.line !== undefined) where.line = origin.line;\n if (origin.kind === \"manifest\") where.file = origin.file;\n\n const entry = input.entry;\n const error = validateEntry(entry);\n if (error !== undefined || !isRecord(entry)) {\n findings.push(finding(\"entry-invalid\", error ?? \"must be object\", { ...where, ...subjectOf(entry) }));\n return;\n }\n const citation = toCitation(entry);\n const subject: FindingExtra = { ...where, src: spellSource(citation.source) };\n if (citation.id !== undefined) subject.id = citation.id;\n\n // A range that ends before it starts: the schema cannot compare two\n // numbers, so the rule is kept here.\n const bad = ([\"claim\", \"source\"] as const).find((end) => {\n const lines = end === \"claim\" ? citation.claim?.lines : citation.source.lines;\n return lines !== undefined && parseLines(lines) === undefined;\n });\n if (bad !== undefined) {\n const lines = bad === \"claim\" ? citation.claim?.lines : citation.source.lines;\n findings.push(\n finding(\n \"entry-invalid\",\n named(citation.id, `${bad}.lines \"${String(lines)}\" ends before it starts`),\n subject,\n ),\n );\n return;\n }\n\n // A range wider than the cap is refused at either end (proposal 0044).\n const wide = ([\"claim\", \"source\"] as const)\n .map((end) => {\n const lines = end === \"claim\" ? citation.claim?.lines : citation.source.lines;\n const parsed = lines === undefined ? undefined : parseLines(lines);\n const reason = parsed === undefined ? undefined : tooWide(parsed);\n return reason === undefined ? undefined : `${end}.lines \"${String(lines)}\" ${reason}`;\n })\n .find((message) => message !== undefined);\n if (wide !== undefined) {\n findings.push(finding(\"entry-invalid\", named(citation.id, wide), subject));\n return;\n }\n\n // The pin's prefix says how it was taken, and only an encrypted source\n // carries a keyed one.\n const encrypted = isEncryptedValue(citation.source.file);\n if (encrypted !== isKeyedPin(citation.source.integrity)) {\n findings.push(\n finding(\n \"entry-invalid\",\n named(\n citation.id,\n encrypted\n ? \"an encrypted source is pinned with hmac-sha256-, not sha256-.\"\n : \"a plain source is pinned with sha256-, not hmac-sha256-.\",\n ),\n subject,\n ),\n );\n return;\n }\n\n const page: PageCitation = { citation, origin };\n citations.push(page);\n if (citation.id !== undefined) {\n if (ids.has(citation.id)) {\n findings.push(\n finding(\"entry-invalid\", `duplicate id \"${citation.id}\". Give each entry its own id.`, subject),\n );\n } else {\n ids.add(citation.id);\n byId.set(citation.id, page);\n }\n }\n });\n\n // Markers.\n const body = content.slice(bodyOffset);\n const statements =\n opts?.markers === false ? [] : parseStatements(body, format, { offset: bodyOffset, line: bodyLine });\n if (statements.length > MAX_MARKERS_PER_PAGE) {\n findings.push(\n finding(\n \"marker-invalid\",\n `more than ${String(MAX_MARKERS_PER_PAGE)} markers on one page (${String(statements.length)}); the rest are not read`,\n { line: statements[MAX_MARKERS_PER_PAGE]?.line },\n ),\n );\n }\n\n for (const statement of statements.slice(0, MAX_MARKERS_PER_PAGE)) {\n const { payload } = statement;\n if (payload.kind === \"bad\") {\n findings.push(\n finding(\n \"marker-invalid\",\n payload.json === true ? MARKER_JSON : `invalid marker: ${payload.reason}`,\n { line: statement.line },\n ),\n );\n continue;\n }\n // Each named id reports on its own: an orphan is a well-formed id with a\n // missing entry, so each one is its own subject and its own fix. A\n // malformed marker is one line and one fix, and was handled above.\n // The entries this marker actually anchors. An id the marker repeats is\n // reported and left to the marker that won it, so it never lands here.\n const anchored: PageCitation[] = [];\n for (const id of payload.ids) {\n const target = byId.get(id);\n if (target === undefined) {\n findings.push(\n finding(\"marker-orphan\", `no entry has id \"${id}\". Fix the marker's id, or add the entry with manni cite add.`, {\n line: statement.line,\n id,\n }),\n );\n continue;\n }\n const first = markedAt.get(target);\n if (first !== undefined) {\n findings.push(\n finding(\n \"marker-repeated\",\n `${id} is named by markers at lines ${String(first)} and ${String(statement.line)}; the first anchors it. Remove ${id} from the marker at line ${String(statement.line)}.`,\n {\n line: statement.line,\n id,\n index: target.origin.index,\n src: spellSource(target.citation.source),\n },\n ),\n );\n continue;\n }\n markedAt.set(target, statement.line);\n target.marker = statement;\n anchored.push(target);\n }\n // A quote entry anchors the next fenced block and a plain one anchors the\n // paragraph, so a list that mixes them would mean two spans on one line,\n // and the page would not say which id got which.\n const quoted = anchored.find((entry) => entry.citation.quote === true);\n const plain = anchored.find((entry) => entry.citation.quote !== true);\n if (quoted !== undefined && plain !== undefined) {\n const mixed: FindingExtra = {\n line: statement.line,\n index: quoted.origin.index,\n src: spellSource(quoted.citation.source),\n };\n if (quoted.citation.id !== undefined) mixed.id = quoted.citation.id;\n findings.push(\n finding(\n \"anchor-invalid\",\n named(\n quoted.citation.id,\n \"a quote entry shares a marker with a non-quote entry. Give the quote its own marker.\",\n ),\n mixed,\n ),\n );\n }\n }\n\n // Anchors: exactly one way in, and a quote needs one of them.\n for (const entry of citations) {\n const { citation, origin, marker } = entry;\n const subject: FindingExtra = { index: origin.index, src: spellSource(citation.source) };\n if (citation.id !== undefined) subject.id = citation.id;\n if (origin.line !== undefined) subject.line = origin.line;\n if (origin.kind === \"manifest\") subject.file = origin.file;\n\n if (citation.claim?.lines !== undefined && marker !== undefined) {\n // A marker names an id, so an entry with both always has one. The\n // finding sits on the marker, which is the half a reader can see.\n const onPage: FindingExtra = { index: origin.index, line: marker.line, src: subject.src };\n if (citation.id !== undefined) onPage.id = citation.id;\n findings.push(\n finding(\n \"anchor-invalid\",\n `${citation.id ?? \"the entry\"} has claim lines and a marker. Keep one.`,\n onPage,\n ),\n );\n continue;\n }\n if (citation.quote === true && citation.claim?.lines === undefined && marker === undefined) {\n findings.push(\n finding(\n \"anchor-invalid\",\n named(citation.id, \"quote needs a claim or a marker. Add claim.lines over the block, or a marker above it.\"),\n subject,\n ),\n );\n }\n }\n\n return {\n file,\n format,\n content,\n bodyOffset,\n bodyLine,\n citations,\n statements,\n findings: findings.sort(byLine),\n };\n}\n","import { ToolError } from \"../shared/errors.js\";\nimport { LineRangeError } from \"../shared/pin.js\";\n\n/** An operational or usage error in the citation tool: exit 2. */\nexport class CiteError extends ToolError {\n constructor(message: string) {\n super(message);\n this.name = \"CiteError\";\n }\n}\n\n/**\n * Run a shared pin-engine call under cite's error contract: a\n * `LineRangeError` comes back as a `CiteError` with the same message, which is\n * what cite's callers (and library users of the `cite` namespace) match on.\n */\nexport function asCiteError<T>(call: () => T): T {\n try {\n return call();\n } catch (error) {\n if (error instanceof LineRangeError) throw new CiteError(error.message);\n throw error;\n }\n}\n","/**\n * The hashing rule, as cite uses it. The engine is `src/shared/pin.ts`, shared\n * with meta; this module keeps cite's import path and its error contract: a\n * range past the end of the text throws `CiteError`.\n */\nimport {\n hashRange as sharedHashRange,\n sliceLines as sharedSliceLines,\n type LineRange,\n} from \"../../shared/pin.js\";\nimport { asCiteError } from \"../errors.js\";\n\nexport { hashLines, isKeyedPin, normalizeText, splitLines } from \"../../shared/pin.js\";\n\n/**\n * The cited lines joined by LF. Throws `CiteError` when the range runs past\n * the end of the text (`<path> has N lines; line M is out of range`).\n */\nexport function sliceLines(lines: readonly string[], range?: LineRange, label?: string): string {\n return asCiteError(() => sharedSliceLines(lines, range, label));\n}\n\n/** The pin of the cited lines: plain, or the keyed pin under `key` when one is given. Throws `CiteError` past the end. */\nexport function hashRange(text: string, range?: LineRange, key?: string): string {\n return asCiteError(() => sharedHashRange(text, range, key));\n}\n","/**\n * Source and line grammar.\n *\n * An entry's `source.file` is a path or an encrypted source (`~` and at least\n * 82 base64url characters, proposal 0045), and its `lines` an integer or\n * `\"L1-L2\"`. `FILE_PATTERN` is the schema's `$defs.fileRef.pattern`, spelled\n * once here and once in the registered `manni:citations:1.0.0` schema\n * (`src/meta/schemas/citations/1.0.0.json`); `test/cite/range.test.ts` pins\n * the two equal.\n *\n * The command line spells a source as one string, `path`, `path:L` or\n * `path:L1-L2` (`SRC_PATTERN`), and reports spell it that way too. A source in\n * another checkout carries its repo name in front, `sdk:src/client.ts:2`\n * (proposal 0100).\n */\nimport { isEncryptedValue } from \"../../shared/encryption.js\";\nimport { MAX_RANGE_LINES, lineSpec, parseLines } from \"../../shared/pin.js\";\nimport { CiteError } from \"../errors.js\";\nimport type { CitationSource, LineSpec, PageLines, SourceRange } from \"../types.js\";\n\n// The line grammar is the shared pin engine's; this path keeps cite's imports working.\nexport { lineSpec, parseLines, spellLines } from \"../../shared/pin.js\";\n\n/** The schema's `$defs.fileRef.pattern`, as a RegExp. */\nexport const FILE_PATTERN =\n /^(?:~[A-Za-z0-9_-]{82,}|(?!~)(?:(?!\\.\\.?(?:\\/|$))[^/\\\\:\\r\\n\\t]+)(?:\\/(?:(?!\\.\\.?(?:\\/|$))[^/\\\\:\\r\\n\\t]+))*)$/;\n\n/** A source on the command line after any repo prefix: a `file`, then an optional `:L` or `:L1-L2`. */\nexport const SRC_PATTERN =\n /^(?:~[A-Za-z0-9_-]{82,}|(?!~)(?:(?!\\.\\.?(?:\\/|:|$))[^/\\\\:\\r\\n\\t]+)(?:\\/(?:(?!\\.\\.?(?:\\/|:|$))[^/\\\\:\\r\\n\\t]+))*)(?::[1-9][0-9]*(?:-[1-9][0-9]*)?)?$/;\n\n/** A repo name, as `source.repo`, `cite.repos` and `--repo` spell it. */\nexport const REPO_PATTERN = /^[a-z0-9][a-z0-9-]*$/;\n\n/**\n * A tail that can only be meant as lines: digits and hyphens. A malformed one\n * (`:0`, `:1-`) stays lines, so the grammar refuses it as it always has.\n */\nconst LINES_TAIL = /^[0-9-]*$/;\n\n/**\n * Parse a command-line source, `[<repo>:]<path>[:<L>[-<L2>]]`. Throws\n * `CiteError` on bad grammar or an end line before the start. A one-line\n * `path:L` comes back with `end` equal to `start`, so a range's width is\n * always `end - start + 1`.\n *\n * A path never holds a colon, so the first colon splits the string. When what\n * follows it is digits and hyphens, the head is a path (`api:2` is line 2 of\n * a file named `api`, as before repos existed); otherwise the head is a repo.\n */\nexport function parseSrc(src: string): SourceRange {\n const first = src.indexOf(\":\");\n const repo = first !== -1 && !LINES_TAIL.test(src.slice(first + 1)) ? src.slice(0, first) : undefined;\n const rest = repo === undefined ? src : src.slice(first + 1);\n if ((repo !== undefined && !REPO_PATTERN.test(repo)) || !SRC_PATTERN.test(rest)) {\n throw new CiteError(\n `Invalid src \"${src}\": expected path, path:L, path:L1-L2, or an encrypted source (~ and at least 82 base64url characters) with the same line forms, each optionally prefixed with a repo name and a colon; ` +\n \"the path is relative to its checkout, posix, and free of . and .. segments.\",\n );\n }\n // The grammar keeps `:` out of every path segment and out of the base64url\n // alphabet, so the first one after any repo starts the line suffix.\n const colon = rest.indexOf(\":\");\n const path = colon === -1 ? rest : rest.slice(0, colon);\n const range: SourceRange = { path, encrypted: isEncryptedValue(path) };\n if (repo !== undefined) range.repo = repo;\n if (colon === -1) return range;\n const [startText, endText] = rest.slice(colon + 1).split(\"-\");\n const start = Number(startText);\n const end = endText === undefined ? start : Number(endText);\n if (end < start) {\n throw new CiteError(`Invalid range \"${src}\": end line ${end} is before start line ${start}.`);\n }\n range.start = start;\n range.end = end;\n return range;\n}\n\n/**\n * How a range too wide to cite is refused: `spans N lines, more than 5000`.\n * Undefined for a range of at most `MAX_RANGE_LINES` lines.\n */\nexport function tooWide(lines: PageLines): string | undefined {\n const width = lines.end - lines.start + 1;\n return width > MAX_RANGE_LINES\n ? `spans ${String(width)} lines, more than ${String(MAX_RANGE_LINES)}`\n : undefined;\n}\n\n/** The canonical spelling: `path:L` for one line, `path:L1-L2` otherwise, after `repo:` for a repo. */\nexport function formatSrc(range: SourceRange): string {\n const { start, end } = range;\n const path = range.repo === undefined ? range.path : `${range.repo}:${range.path}`;\n if (start === undefined) return path;\n if (end === undefined || end === start) return `${path}:${start}`;\n return `${path}:${start}-${end}`;\n}\n\n/** An entry's source as a range. Its lines must already be valid (see `parseLines`). */\nexport function sourceRange(source: CitationSource): SourceRange {\n const range: SourceRange = { path: source.file, encrypted: isEncryptedValue(source.file) };\n if (source.repo !== undefined) range.repo = source.repo;\n if (source.lines === undefined) return range;\n const lines = parseLines(source.lines);\n if (lines !== undefined) {\n range.start = lines.start;\n range.end = lines.end;\n }\n return range;\n}\n\n/** An entry's source spelled as one string, `[repo:]path:L1-L2`, the way the command line takes it. */\nexport function spellSource(source: CitationSource): string {\n return formatSrc(sourceRange(source));\n}\n\n/** A range's lines as an entry writes them; undefined for a whole file. */\nexport function rangeLines(range: SourceRange): LineSpec | undefined {\n if (range.start === undefined) return undefined;\n return lineSpec({ start: range.start, end: range.end ?? range.start });\n}\n","/**\n * The citation tool's types. Proposal 0044 is the record, and stress test 25\n * the shape: an entry has two ends, `claim` and `source`, each a line range\n * and a hash, and a check classifies both with one set of rules.\n *\n * Vocabulary: a page's `citations` live in its frontmatter, or in a manifest\n * a collection declares (handed in through `CheckPageOptions.citations`). A\n * body marker, `cite <id>` in the format's comment syntax, is the other way\n * to anchor an entry's claim.\n */\nimport type { ValidationResult } from \"../meta/index.js\";\nimport type { ClassifyOptions } from \"./core/classify.js\";\nimport type { CollectionConfig } from \"../shared/collections.js\";\nimport type { ConfigFile } from \"../shared/config-file.js\";\nimport type { KeySource } from \"../shared/encryption-key.js\";\nimport type { LineSpec, PageLines } from \"../shared/pin.js\";\nimport type { Guidance } from \"../shared/guidance.js\";\nimport type { Confirm } from \"../shared/prompt.js\";\nimport type { Severity } from \"../shared/severity.js\";\nimport type { InlineStatement } from \"../shared/statements.js\";\n\n/** A parsed `<src>` or `source`: a path or `~` ciphertext, and an optional line range. */\nexport interface SourceRange {\n /** The checkout `path` is in, by its `cite.repos` name; absent for the root. */\n repo?: string;\n /** Checkout-relative posix path, or the `~` ciphertext when `encrypted`. */\n path: string;\n /** `true` when `path` is an encrypted source (`~` and 82+ base64url characters) rather than a path. */\n encrypted: boolean;\n /** 1-based, inclusive. Both absent for a whole-file citation. */\n start?: number;\n end?: number;\n}\n\n// The line shapes are the shared pin engine's, re-exported so cite's imports and its namespace keep them.\nexport type { LineSpec, PageLines };\n\n/** The page text a citation supports. */\nexport interface CitationClaim {\n /** Body lines: counted from the first line after the frontmatter. Absent when a marker anchors the entry. */\n lines?: LineSpec;\n /** `sha256-<64 hex>` over the claimed lines, always plain. */\n integrity: string;\n}\n\n/** The lines a claim rests on. */\nexport interface CitationSource {\n /** The checkout `file` is in, by its `cite.repos` name; absent for the root. */\n repo?: string;\n /** Checkout-relative posix path, or `~` and the path encrypted with the family key. */\n file: string;\n /** File lines. Absent pins the whole file. */\n lines?: LineSpec;\n /** `sha256-<64 hex>`, or `hmac-sha256-<64 hex>` exactly when `file` is encrypted. */\n integrity: string;\n /** The git commit hash the pin was taken at: 7 to 64 lowercase hex. */\n \"commit-sha\"?: string;\n}\n\n/** One entry of `citations`, as the schema (`manni:citations:1.2.0`) spells it. */\nexport interface Citation {\n id?: string;\n claim?: CitationClaim;\n source: CitationSource;\n quote?: boolean;\n}\n\n/** Where an entry is kept: the page's frontmatter, or a manifest a collection declares. */\nexport type OriginKind = \"frontmatter\" | \"manifest\";\n\n/** Where an entry sits. */\nexport interface CitationOrigin {\n kind: OriginKind;\n /** The file the entry sits in: the page for frontmatter, the manifest otherwise. */\n file: string;\n /** Line of the entry in that file. */\n line?: number;\n /** Index in the page's `citations` list. */\n index: number;\n}\n\n/**\n * One entry handed to `checkCitations` from outside the page, already merged\n * from a manifest. `entry` is the raw value and is validated as a frontmatter\n * entry is; its index is its position in the list.\n */\nexport interface CitationInput {\n entry: unknown;\n origin: { kind: OriginKind; file: string; line?: number };\n}\n\n/** How a citation's claim is anchored: by its lines, by a body marker, or not at all. */\nexport type CitationAnchor = \"claim\" | \"marker\" | null;\n\nexport type SourceStatus =\n | \"current\"\n | \"moved\"\n | \"moved-ambiguous\"\n | \"changed\"\n | \"missing\"\n | \"never-true\"\n | \"skipped\";\n\nexport type ClaimStatus =\n | \"current\"\n | \"moved\"\n | \"moved-ambiguous\"\n | \"reanchored\"\n | \"changed\"\n | \"skipped\";\n\n/** Where a misplaced marker is, and where it belongs (proposal 0054). */\nexport interface MisplacedMarkerReport {\n /** The paragraph the marker's run splits, in file lines. */\n unit: string;\n /** The file line the marker takes once its run has moved. */\n to: number;\n}\n\n/** The marker that anchors a citation: its line, and its misplacement when it has one. */\nexport interface MarkerEnd {\n /** File line of the marker. */\n line: number;\n /** Present only when the marker line sits inside a paragraph. */\n misplaced?: MisplacedMarkerReport;\n}\n\n/**\n * Why a source could not be read: not a tracked file in its checkout, an\n * encrypted source with no key to decrypt it, one that does not decrypt under\n * the key there is, a tracked file that could not be read, or a `source.repo`\n * no `cite.repos` or `--repo` declares.\n */\nexport type MissingReason = \"untracked\" | \"no-key\" | \"undecryptable\" | \"unreadable\" | \"unknown-repo\";\n\n/**\n * Every rule a finding can carry, stated once. The union and the default\n * severity table are derived from this array so the three cannot disagree.\n */\nexport const CITE_RULES = [\n \"source-moved\",\n \"source-moved-ambiguous\",\n \"source-changed\",\n \"source-never-true\",\n \"source-missing\",\n \"claim-moved\",\n \"claim-moved-ambiguous\",\n \"claim-reanchored\",\n \"claim-changed\",\n \"marker-orphan\",\n \"marker-invalid\",\n \"marker-repeated\",\n \"marker-misplaced\",\n \"anchor-invalid\",\n \"entry-invalid\",\n \"quote-drift\",\n] as const;\nexport type CiteRule = (typeof CITE_RULES)[number];\n\n/**\n * A rule's level: the family scale (`src/shared/severity.ts`) plus `off`,\n * which drops the rule's findings altogether.\n */\nexport type CiteSeverity = Severity | \"off\";\n\n/** The claim end of a classified citation. Line specs are `\"L\"` or `\"L1-L2\"`. */\nexport interface ClaimEnd {\n /** The entry's body lines. Absent when a marker anchors the claim. */\n lines?: string;\n /** Where the claim is judged, in file lines: the recorded lines, or what the marker anchors. */\n fileLines?: string;\n status: ClaimStatus;\n /** For `moved`: the new body lines. */\n newLines?: string;\n /** For `moved-ambiguous`: every candidate, in body lines. */\n candidates?: string[];\n /** For `moved`: the new file lines. Pretty-only. */\n newFileLines?: string;\n /** For `moved-ambiguous`: every candidate, in file lines. Pretty-only. */\n candidateFileLines?: string[];\n /** For `changed`: the page lines at the claim now, for `--show-diff`. Pretty-only. */\n text?: string[];\n /**\n * For `changed` and `reanchored`: the baseline, the newest commit whose\n * page held the pin. Derived from the page's history, never stored (0053).\n */\n commitSha?: string;\n /** For `changed`: `false` when the walk hit a shallow boundary or its cap. */\n historyAvailable?: boolean;\n /** Subjects of the commits that touched the page since the baseline. Pretty-only. */\n commitsSince?: string[];\n /** Unified diff of the claim's lines since the baseline. Pretty-only, `--show-diff`. */\n diff?: string;\n /**\n * The claim's lines as they were at the baseline. Never serialized: it is\n * what `update --accept` reads to tell an edit from a replacement.\n */\n baselineText?: string[];\n}\n\n/** The source end of a classified citation. */\nexport interface SourceEnd {\n /** `file` and `lines` as the entry spells them: `path`, `path:L`, `path:L1-L2`, the ciphertext for `path`, after `repo:` for a repo entry. */\n src: string;\n /** The checkout the source is in, by its `cite.repos` name; absent for the root. */\n repo?: string;\n status: SourceStatus;\n /**\n * The path an encrypted source decrypted to. Never printed except by the\n * pretty reporter under `--reveal`; never serialized to a machine format.\n */\n resolvedPath?: string;\n /**\n * The path a moved encrypted source's `newSrc` decrypts to. Printed only by\n * the pretty reporter under `--reveal`; never serialized to a machine format.\n */\n resolvedNewPath?: string;\n /** For `missing`: why the source could not be read. Composes the message, which never names a path. */\n missingReason?: MissingReason;\n /**\n * For `moved`: the new file lines. For `changed`: the span the pinned\n * range's old first and last lines now cover, when each sits exactly once\n * and in order (proposal 0055).\n */\n newLines?: string;\n /**\n * For `moved`: the new `src`, spelled as the entry spells sources. It names\n * another file when the pin followed its text across one, and carries the\n * new path encrypted for an encrypted source.\n */\n newSrc?: string;\n /** For `moved-ambiguous`: every candidate `src`. */\n candidates?: string[];\n /** The entry's recorded `commit-sha`: a hint, where the pin was minted (0097). */\n commitSha?: string;\n /**\n * The full hash the verdict was read against: the recorded commit when it\n * is an ancestor of HEAD and holds the pin, else the newest commit in the\n * source's history that does. Derived, never stored (0097).\n */\n baselineSha?: string;\n /** For `changed`: `false` when the walk hit a shallow boundary or its cap. */\n historyAvailable?: boolean;\n /** Subjects of commits touching the path since the baseline. Pretty-only. */\n commitsSince?: string[];\n /** Unified diff of the path since the baseline. Pretty-only, `--show-diff`. */\n diff?: string;\n /** The move search hit its byte budget before covering the file. */\n truncatedSearch?: boolean;\n /**\n * The truncation happened across the files a commit touched rather than\n * inside one file, which is the other half of the notice a run raises. Never\n * serialized: `truncatedSearch` stays the one boolean the output carries.\n */\n truncatedAcross?: boolean;\n}\n\n/** One classified citation: both ends, and how it is anchored. */\nexport interface CitationResult {\n citation: Citation;\n origin: CitationOrigin;\n anchor: CitationAnchor;\n /** File line of the marker that names the entry, when one does. */\n markerLine?: number;\n /**\n * File line the citation anchors to now: the claim's first line, or the\n * first line of the text a marker anchors. Where its findings sit.\n */\n anchorLine?: number;\n /** The marker that names the entry, when one does, and its misplacement. */\n marker?: MarkerEnd;\n /** `null` for an entry with no `claim`: a bare pin, or a marker with no drift check. */\n claim: ClaimEnd | null;\n source: SourceEnd;\n}\n\nexport interface CitationFinding {\n rule: CiteRule;\n /** `manni:cite/<rule>`. */\n ruleId: string;\n /** On the family scale: an `error` fails the file; a `warning` or a `notice` is reported and never does. */\n severity: Severity;\n message: string;\n /** Line the finding anchors to: in the page, or in `file` when that is set. */\n line?: number;\n /** The manifest, when the finding sits there rather than on the page. */\n file?: string;\n id?: string;\n /** The source, spelled as the entry spells it. */\n src?: string;\n newSrc?: string;\n /** Index in the page's `citations` for a finding about one entry. */\n index?: number;\n /** The rule behind the finding: what it means, and its section of the fix page. */\n guidance?: Guidance | null;\n}\n\nexport interface PageCitationReport {\n file: string;\n format: string;\n citations: CitationResult[];\n findings: CitationFinding[];\n /** Run-level advice, said once per run by the caller: shallow clone, root fallback. */\n notices: string[];\n}\n\n/** What `showFile` answers: the bytes, or why it could not. */\nexport type ShownFile = { text: string } | { missing: \"commit\" | \"path\" };\n\n/** One commit that touched a path. */\nexport interface PageCommit {\n /** The full hash. */\n sha: string;\n subject: string;\n}\n\n/**\n * What `pageCommits` answers: the commits that touched a path, newest first.\n * `shallow` is a repository whose oldest commit may have an unfetched parent,\n * and `truncated` a list the cap cut short. Either means a walk that exhausts\n * the list cannot say the pin never held.\n */\nexport interface PageHistory {\n commits: PageCommit[];\n shallow: boolean;\n truncated: boolean;\n}\n\n/**\n * A thin git client over `execFile(\"git\", …)`, memoized per call shape so a\n * page with a thousand citations against one path runs one `git show`.\n */\nexport interface GitClient {\n available(): Promise<boolean>;\n head(): Promise<string | null>;\n /** Tracked files, posix, relative to the root. */\n lsFiles(): Promise<string[]>;\n showFile(commit: string, path: string): Promise<ShownFile>;\n subjectsSince(commit: string, path: string): Promise<string[]>;\n diffSince(commit: string, path: string): Promise<string>;\n /**\n * Paths whose content differs between `commit` and `HEAD`: committed\n * changes only. The candidate list a pin is followed across (proposal\n * 0055). A client without it follows no source out of its own file.\n */\n changedSince?(commit: string): Promise<string[]>;\n /**\n * The commits that touched `path`, newest first, at most `cap` of them. A\n * client without it reads no claim history, so a claim that no longer holds\n * is `changed` with no baseline.\n */\n pageCommits?(path: string, cap: number): Promise<PageHistory>;\n /**\n * Whether the clone is shallow, so a commit it lacks may still be in the\n * history. A client without it, or without `isAncestor`, never re-records\n * a commit for being outside the history.\n */\n shallow?(): Promise<boolean>;\n /**\n * Whether `commit` is `of` or one of its ancestors. A commit the clone does\n * not have is not.\n */\n isAncestor?(commit: string, of: string): Promise<boolean>;\n}\n\n/**\n * The files a source may resolve to. Built from `git ls-files` when git is\n * available, else from a walk that follows no symlinks. Every entry is\n * realpath-contained in the root.\n */\nexport interface SourceIndex {\n files(): readonly string[];\n /** Whether `path` is a tracked file under the root. An encrypted source is decrypted first, then asked here. */\n has(path: string): boolean;\n /**\n * The bytes of a file the index holds. Absent, a file is read from disk\n * under the root. An index over a commit's tree reads them from git, so the\n * classifier answers as of that commit (proposal 0092).\n */\n read?(path: string): Promise<string | undefined>;\n}\n\n/**\n * What one run has read so far: each tracked file once, with its lines split\n * once. A run makes one with `createSourceCache` and passes it to every\n * `readSource` it makes, so a source cited a hundred times is read once. It\n * holds whatever the files said when first read, so a run that rewrites files\n * it may later read as sources makes none.\n */\nexport type SourceCache = Map<string, Promise<{ text: string; lines: readonly string[] } | undefined>>;\n\n/**\n * One checkout a source resolves in: its directory, its tracked files and its\n * git, the triple `classifyCitation` takes. `repo` is its `cite.repos` name,\n * absent for the root (proposal 0100).\n */\nexport type Checkout = Pick<ClassifyOptions, \"root\" | \"index\" | \"git\"> & { repo?: string };\n\n/**\n * The checkout an entry's `source.repo` names: the root for none, `undefined`\n * for a name nothing declares. A declared checkout is opened on first use and\n * kept, and one whose directory is missing rejects with a `CiteError`.\n */\nexport type CheckoutResolver = (repo: string | undefined) => Promise<Checkout | undefined>;\n\nexport interface CheckPageOptions {\n /** Absolute directory source paths resolve from. */\n root: string;\n /** Default true. False: page-side rules only; every source status is `skipped`. Claim ends are still judged. */\n checkSources?: boolean;\n /**\n * The encryption key: decrypts encrypted sources and keys their pins.\n * Absent, an encrypted citation is `missing` (no key to decrypt it).\n */\n key?: string;\n severity?: Partial<Record<CiteRule, CiteSeverity>>;\n /**\n * The git client the source index and history are read through. Defaults\n * to one over the root, which is used whenever git is on PATH and the root\n * is inside a work tree. A caller that wants no git at all passes `noGit()`.\n */\n gitClient?: GitClient;\n /**\n * Directory the page's own path resolves from, and so the repository its\n * history is read in. Defaults to `root`, the same directory unless\n * `--root` sent the sources to another checkout.\n */\n pageRoot?: string;\n /** The client the page's history is read through. Defaults to one over `pageRoot`. */\n pageGitClient?: GitClient;\n /** How many commits the claim history walk reads. Defaults to `MAX_PAGE_COMMITS`. */\n pageCommitCap?: number;\n sourceIndex?: SourceIndex;\n /**\n * The checkouts an entry's `source.repo` may name. Absent, an entry with no\n * repo resolves under `root` and every repo is undeclared.\n */\n checkouts?: CheckoutResolver;\n /** Source files already read this run (`createSourceCache`); absent, each citation reads its own. */\n sourceCache?: SourceCache;\n /**\n * The page's citations as merged from a manifest, each with where it sits.\n * Given, the page's own frontmatter `citations` is not read. Without it, a\n * grader calling `checkCitations` on a sidecar page would find no citations.\n */\n citations?: readonly CitationInput[];\n /**\n * The manifest that owns this page's `citations`, when one does. A page\n * that carries its own anyway is `entry-invalid`, in meta's `external:owned`\n * words.\n */\n owned?: { file: string; collection: string };\n}\n\nexport interface MintOptions {\n root: string;\n /** `path`, `path:L`, `path:L1-L2`, or an encrypted `~file` with the same line forms. */\n src: string;\n id?: string;\n /** The claim pin, already taken over the page lines. */\n claim?: CitationClaim;\n quote?: boolean;\n /** A commit to record; `false` records none; absent records HEAD when git has one. */\n commitSha?: string | false;\n /**\n * Write `file` encrypted and pin the lines with the keyed pin; needs `key`.\n * A source that is already encrypted stays encrypted either way.\n */\n encrypt?: boolean;\n /** The encryption key: encrypts, decrypts an encrypted source, and keys its pin. */\n key?: string;\n gitClient?: GitClient;\n sourceIndex?: SourceIndex;\n}\n\nexport type { InlineStatement, TextEdit } from \"../shared/statements.js\";\n/** A validated citation with where it sits and the marker that names it, before classification. */\nexport interface PageCitation {\n citation: Citation;\n origin: CitationOrigin;\n /** The first marker naming the entry's id. */\n marker?: InlineStatement;\n}\n\n/** What `readPage` returns: the entries, the markers, and page-side findings. */\nexport interface PageCitations {\n file: string;\n format: string;\n content: string;\n /** Offset where the body starts (just past the closing fence, or 0). */\n bodyOffset: number;\n /** File line of body line 1: the first line after the frontmatter, or 1. */\n bodyLine: number;\n citations: PageCitation[];\n statements: InlineStatement[];\n findings: CitationFinding[];\n}\n\nexport interface CheckOptions {\n /** Positional inputs; empty means the configured collections' `paths:` (0041). */\n inputs: string[];\n /**\n * `--collection <name>`, repeatable: the collections this run covers. Empty\n * or absent means every declared one; see `selectCollections`.\n */\n collection?: string[];\n exts?: string[];\n /** `--exclude`, appended to the selected collections' `exclude:` when the run reads from them. */\n exclude?: string[];\n as?: string;\n configPath?: string;\n noConfig?: boolean;\n cwd?: string;\n stdinContent?: string;\n allowEmpty?: boolean;\n respectGitignore?: boolean;\n onNotice?: (message: string) => void;\n onConfigLoaded?: (info: { path: string; dir: string }) => void;\n baseline?: string | boolean;\n writeBaseline?: string | boolean;\n /** `--no-check-sources` (false): page-side rules only. Absent leaves `checkSources:` in charge. */\n checkSources?: boolean;\n /**\n * `--show-diff`: the report will want diffs and commit subjects. The check\n * is the same either way; the run only says, once, when git is not there\n * to give them.\n */\n showDiff?: boolean;\n root?: string;\n /**\n * `--repo`, already split: name -> checkout directory, cwd-relative. Each\n * overrides `cite.repos` for its name (proposal 0100).\n */\n repos?: Record<string, string>;\n /**\n * The git client every page is checked through. Defaults to one over the\n * root, used whenever git is on PATH and the root is inside a work tree; a\n * test hands in a fake.\n */\n gitClient?: GitClient;\n /**\n * The client every page's own history is read through, over the directory\n * the page paths resolve from. Defaults to one there; a test hands in a fake.\n */\n pageGitClient?: GitClient;\n /** Defaults to `process.env`; read for `MANNI_ENCRYPTION_KEY`. A test hands in its own. */\n env?: NodeJS.ProcessEnv;\n}\n\nexport interface CheckRun {\n results: ValidationResult[];\n summary: import(\"../meta/index.js\").RunSummary;\n frame: import(\"../meta/index.js\").FingerprintContext;\n pages: PageCitationReport[];\n warnings: number;\n notices: number;\n}\n\n/** `manni cite history` (proposal 0092): `check`'s input surface, and the walk's bound. */\nexport interface HistoryOptions\n extends Pick<\n CheckOptions,\n | \"inputs\"\n | \"collection\"\n | \"exts\"\n | \"exclude\"\n | \"as\"\n | \"configPath\"\n | \"noConfig\"\n | \"cwd\"\n | \"allowEmpty\"\n | \"respectGitignore\"\n | \"onNotice\"\n | \"onConfigLoaded\"\n | \"root\"\n | \"env\"\n > {\n /** `--newer-than <duration>`: walk only the commits within that span of `HEAD`'s committer time. */\n newerThan?: string;\n}\n\n/** A commit a window opened or closed at. */\nexport interface WindowCommit {\n commit: string;\n /** Committer time, ISO 8601 in UTC, to the second. */\n date: string;\n subject: string;\n}\n\n/** One run of first-parent commits at which a citation's source pin did not hold. */\nexport interface StaleWindow {\n /** The entry's id, or its pointer (`/citations/N`) when it has none. */\n id: string;\n /** The entry's source as it stood when the window opened. */\n source: string;\n rule: \"source-changed\" | \"source-missing\" | \"source-never-true\";\n severity: Severity;\n opened: WindowCommit & { bounded: boolean };\n closed: (WindowCommit & { by: \"re-pinned\" | \"source-restored\" | \"removed\" }) | null;\n /** Committer time to committer time; an open window runs to `HEAD`'s. */\n seconds: number;\n /** Tags reachable from `HEAD` that contain the opening commit and not the closing one, oldest first. */\n releases: string[];\n /** The page's earlier paths while the window was open, oldest first. */\n formerly: string[];\n}\n\nexport interface HistoryPage {\n file: string;\n windows: StaleWindow[];\n}\n\nexport interface HistorySummary {\n head: string;\n walked: { commits: number; from: string; to: string };\n files: number;\n citations: number;\n windows: number;\n open: number;\n staleSeconds: number;\n bySeverity: Record<Severity, number>;\n releases: string[];\n skipped: { encrypted: number };\n}\n\nexport interface HistoryRun {\n summary: HistorySummary;\n pages: HistoryPage[];\n}\n\n\nexport interface AddOptions {\n page: string;\n /** The claim's lines as an editor numbers them (`page:L`, `page:L1-L2`). Absent: a bare pin. */\n pageLines?: PageLines;\n src: string;\n id?: string;\n /** Write a marker above the page lines instead of claim lines, and pin the text it anchors. Needs `pageLines` and `id`. */\n marker?: boolean;\n /** The page lines are a fenced block that reproduces the source. Needs `pageLines`. */\n quote?: boolean;\n /**\n * `--encrypt`: write `file` encrypted, with a keyed pin, even when no key is\n * available yet, in which case `confirm` is asked whether to generate one.\n * An available key encrypts every add without it, so `false` and absent\n * are the same.\n */\n encrypt?: boolean;\n /** `false` records no `commit-sha`. */\n commitSha?: boolean;\n dryRun?: boolean;\n as?: string;\n configPath?: string;\n noConfig?: boolean;\n cwd?: string;\n stdinContent?: string;\n root?: string;\n /**\n * `--repo`, already split: name -> checkout directory, cwd-relative. Each\n * overrides `cite.repos` for its name (proposal 0100).\n */\n repos?: Record<string, string>;\n /**\n * The git client HEAD and the source index are read through. Defaults to\n * one over the root; a test hands in a fake.\n */\n gitClient?: GitClient;\n /** Defaults to `process.env`; read for `MANNI_ENCRYPTION_KEY`. A test hands in its own. */\n env?: NodeJS.ProcessEnv;\n onNotice?: (message: string) => void;\n onConfigLoaded?: (info: { path: string; dir: string }) => void;\n /**\n * Asked when `encrypt` needs a key and there is none; the CLI passes\n * `terminalConfirm()`. Absent, the add refuses instead of asking.\n */\n confirm?: Confirm;\n}\n\n/** The manifest half of a write: what it says now, and whether it was saved. */\nexport interface ManifestWrite {\n /** The manifest as the run reports it. */\n file: string;\n /** 1-based line the written entry now sits on. */\n line: number;\n /** The whole manifest, rewritten. */\n content: string;\n diff: string;\n written: boolean;\n}\n\nexport interface AddResult {\n file: string;\n citation: Citation;\n /**\n * Where the entry was written: the page's frontmatter, or the manifest the\n * page's collection declares. The config decides, not a flag.\n */\n placed: \"frontmatter\" | \"manifest\";\n /** The manifest the entry went to, under `placed: \"manifest\"`. */\n manifest?: ManifestWrite;\n /** File lines of the claim after the write: the claim lines, or the text the marker anchors. */\n claimLines?: PageLines;\n /** File line of the marker that names the entry, under `marker`. */\n markerLine?: number;\n /**\n * Whether the id joined the list of a marker already there, rather than\n * getting a marker line of its own. A join moves no line on the page.\n */\n markerJoined?: boolean;\n /**\n * The first pinned source line, as the file holds it, so a mis-typed range\n * is visible at write time. Absent for a whole file, which has no first\n * line worth naming, and for an encrypted source, which no output reveals.\n */\n sourceLine?: string;\n /** The rewritten page. */\n content: string;\n diff: string;\n written: boolean;\n}\n\nexport interface UpdateOptions extends Omit<CheckOptions, \"baseline\" | \"writeBaseline\"> {\n accept?: boolean;\n only?: string[];\n dryRun?: boolean;\n /**\n * Re-record `commit-sha` where the recorded commit does not contain the\n * pinned lines. Rewrites that one field and nothing else.\n */\n recommit?: boolean;\n}\n\n/**\n * One end `update` rewrote.\n *\n * Read the typed pairs: `fromLines`/`toLines` for lines, `fromPin`/`toPin`\n * for pins. `from` and `to` carry the same values, but which of the two a row\n * holds depends on the row, so they are easy to misuse.\n */\n/** Why `--recommit` re-recorded a commit. */\nexport type RecommitReason = \"not-contained\" | \"not-in-history\";\n\nexport interface UpdateRewrite {\n id?: string;\n /** Index in the page's `citations`. */\n index: number;\n /** File line of the entry. */\n line?: number;\n end: \"claim\" | \"source\" | \"marker\";\n /**\n * `re-anchored` covers both re-pins: the pin held over another span (0054),\n * and the words held while the anchor moved (0053). `status` is what tells\n * those apart. `replaced` is a claim `--accept` refused to re-pin.\n */\n reason: \"moved\" | \"accepted\" | \"re-anchored\" | \"shifted\" | \"replaced\" | \"recommitted\";\n /**\n * The status that was repaired. `replaced` is a claim whose line held\n * wholly other text, accepted because `--only` named it.\n */\n status: \"moved\" | \"changed\" | \"reanchored\" | \"replaced\" | \"never-true\" | \"misplaced\" | \"current\";\n /**\n * Before and after. A moved or shifted claim, and a moved marker: file\n * lines. A moved source: its `src`. An accepted or re-anchored end: its pin.\n * The typed pairs below say which, so prefer them.\n */\n from: string;\n to: string;\n /** A moved marker, or a moved or shifted claim: its file lines, before and after. */\n fromLines?: string;\n toLines?: string;\n /** An accepted or re-anchored end: its pin, before and after. */\n fromPin?: string;\n toPin?: string;\n /** A re-committed source: the commit it recorded, and the one it records now. */\n fromCommit?: string;\n toCommit?: string;\n /**\n * A re-committed source: why the recorded commit could not stand.\n * `not-contained`: it does not hold the pinned lines. `not-in-history`: it\n * holds them, but is not in the history of HEAD.\n */\n because?: RecommitReason;\n /** A re-anchored claim: the span that held, in file lines. */\n lines?: string;\n /** A re-anchored claim: the span now pinned, in file lines. */\n newLines?: string;\n /** An accepted, re-anchored or refused claim: the file line of its first body line. */\n at?: number;\n /** An accepted claim a marker anchors: the marker's file line. Pretty-only. */\n markerLine?: number;\n /** An accepted claim: the text now pinned, whitespace collapsed. */\n text?: string;\n /** An accepted source: its `src`. */\n src?: string;\n /**\n * An accepted source: the commit recorded in the entry, when it records\n * one. A re-anchored or refused claim: the baseline its words were read\n * against.\n */\n commitSha?: string;\n /**\n * A refused claim the word-overlap test refused: the share of the claim's\n * words, from 0 to 1, that its line still holds. Absent on a claim the\n * sentence test refused, which is how a report tells the two apart.\n */\n wordShare?: number;\n}\n\nexport interface UpdatePage {\n file: string;\n rewritten: UpdateRewrite[];\n /**\n * Claims `--accept` refused to re-pin, because the stored first line now\n * holds text that shares no sentence with the claim at its baseline, or too\n * few of its words. Each carries `reason: \"replaced\"`, and each is work left\n * undone: exit 1.\n */\n refused: UpdateRewrite[];\n skipped: CitationFinding[];\n diff: string;\n written: boolean;\n /** The rewritten page, for the stdin input only: it has no file to be written to. */\n content?: string;\n}\n\n/** One manifest a run rewrote: what changed in it, and whether it was saved. */\nexport interface ManifestChange {\n /** The manifest as the run reports it. */\n file: string;\n diff: string;\n written: boolean;\n}\n\nexport interface UpdateRun {\n pages: UpdatePage[];\n rewritten: number;\n skipped: number;\n /** The manifests this run rewrote, each written once however many pages it holds. */\n manifests?: ManifestChange[];\n exitCode: 0 | 1;\n}\n\nexport interface RemoveOptions\n extends Omit<CheckOptions, \"baseline\" | \"writeBaseline\" | \"checkSources\" | \"showDiff\" | \"repos\"> {\n /**\n * `--only <id>`, repeatable: the entries to remove, each named by its id or\n * by its pointer (`/citations/N`). Required, and an empty list is a\n * refusal: `remove` never takes every citation off a page.\n */\n only: string[];\n dryRun?: boolean;\n}\n\n/** One entry `remove` took out, and the markers that went with it. */\nexport interface Removal {\n id?: string;\n /** Index in the page's `citations`. Absent for a marker that named no entry. */\n index?: number;\n /** Where the entry was kept. Absent for a marker that named no entry. */\n origin?: { kind: OriginKind; file: string; line?: number };\n /** File lines of the markers removed with it, in the page as it was. */\n markerLines: number[];\n}\n\nexport interface RemovePage {\n file: string;\n removed: Removal[];\n diff: string;\n written: boolean;\n /** The rewritten page, for the stdin input only: it has no file to be written to. */\n content?: string;\n}\n\nexport interface RemoveRun {\n pages: RemovePage[];\n /** Entries removed, counting a marker that named no entry as one. */\n removed: number;\n /** The manifests this run rewrote, each written once however many pages it holds. */\n manifests?: ManifestChange[];\n}\n\n/** One citation `reencryptCitations` rewrote: where it sits, and its source before and after. */\nexport interface ReencryptedCitation {\n id?: string;\n /** Index in `citations`. */\n index?: number;\n /** File line of the entry. */\n line?: number;\n /** `file` and its line suffix, under the old key and under the new. */\n from: string;\n to: string;\n}\n\n/** What `reencryptCitations` did to one page. */\nexport interface ReencryptCitationsResult {\n /** The page with every re-encrypted citation rewritten; the input itself when none was. */\n content: string;\n rewritten: ReencryptedCitation[];\n /** Citations that could not be re-encrypted, and why. A message never names a path. */\n skipped: { id?: string; index?: number; line?: number; message: string }[];\n}\n\n/**\n * Config under `cite:` in manni.config.yaml, camelCase as `meta:` is. The\n * document set is not here: proposal 0041 moved `paths` and `exclude` to the\n * family-level `collections:` list, which every tool reads. Neither is the\n * encryption key, the top-level `encryptionKey:` every tool reads (0045).\n */\nexport interface CiteConfig {\n allowEmpty?: boolean;\n respectGitignore?: boolean;\n root?: string;\n /** `cite.repos`: name -> checkout directory, relative to the config file (proposal 0100). */\n repos?: Record<string, string>;\n baseline?: string;\n checkSources?: boolean;\n severity?: Partial<Record<CiteRule, CiteSeverity>>;\n}\n\nexport interface LoadedCiteConfig {\n config: CiteConfig;\n path: string;\n dir: string;\n /** The file as the user would name it, for messages. */\n source: string;\n /** The family file's top-level `collections:`, parsed by the shared layer (0041). */\n collections: CollectionConfig[];\n}\n\n/** What every command core resolves before touching a file. */\nexport interface CiteRun {\n config: CiteConfig | null;\n /** The positional inputs, or the selected collections' `paths:` in declaration order. */\n inputs: string[];\n /** Directory the inputs resolve from: cwd for positional inputs, the config directory for collections. */\n base: string;\n /**\n * The collections this run covers: every declared one, or the ones\n * `--collection` named. `[]` when no config governs the run.\n */\n collections: CollectionConfig[];\n /** Whether `inputs` came from the collections rather than the command line. */\n fromCollections: boolean;\n configDir?: string;\n configPath?: string;\n /** The config file as the user would name it, for messages. */\n configSource?: string;\n /** Absolute root source paths resolve from. */\n root: string;\n /**\n * Each checkout an entry's `source.repo` may name, as an absolute\n * directory: `cite.repos` against the config directory, overridden per\n * name by `--repo` against cwd. `{}` when none is declared.\n */\n repos: Record<string, string>;\n /**\n * The family encryption key (proposal 0045): `MANNI_ENCRYPTION_KEY`, else\n * the config's top-level `encryptionKey:`. Absent when neither is set.\n */\n key?: string;\n /** Where `key` came from. The environment wins over the config. */\n keySource: KeySource;\n /**\n * The config file that governs the run, as discovery found it. A write\n * that needs a key (`add --encrypt` with none) puts one there.\n */\n configFile?: ConfigFile;\n}\n","/**\n * Which rules fail a run, which only warn, and which are notices.\n *\n * Warnings and notices never affect the exit code (docevals' rule).\n * `source-moved` is a warning because `cite update` fixes it mechanically,\n * and a PR job that failed on it would make the ratchet noisy. `claim-moved`\n * is a notice: the text is found verbatim, so nothing drifted.\n * `claim-reanchored` is a notice for the same reason (proposal 0053): the\n * words the pin covered are found unchanged since the baseline, so only the\n * layout moved, and plain `cite update` re-pins it.\n * `claim-changed` is a warning, since it fires on any edit to a pinned\n * paragraph, a typo fix beside the cited sentence included. A repository that\n * wants either hard sets `severity: { claim-changed: error }`.\n * `marker-misplaced` is a warning too: it annotates the pull request, and one\n * `cite update` clears it, so a job that failed on it would block on a page\n * that was fine yesterday (proposal 0054, stress test 15).\n */\nimport type { Guidance } from \"../../shared/guidance.js\";\nimport { CITE_RULES, type CiteRule, type CiteSeverity } from \"../types.js\";\n\nexport const DEFAULT_SEVERITY: Readonly<Record<CiteRule, CiteSeverity>> = {\n \"source-moved\": \"warning\",\n \"source-moved-ambiguous\": \"error\",\n \"source-changed\": \"error\",\n \"source-never-true\": \"error\",\n \"source-missing\": \"error\",\n \"claim-moved\": \"notice\",\n \"claim-moved-ambiguous\": \"warning\",\n \"claim-reanchored\": \"notice\",\n \"claim-changed\": \"warning\",\n \"marker-orphan\": \"error\",\n \"marker-invalid\": \"error\",\n \"marker-repeated\": \"warning\",\n \"marker-misplaced\": \"warning\",\n \"anchor-invalid\": \"error\",\n \"entry-invalid\": \"error\",\n \"quote-drift\": \"error\",\n};\n\nexport const RULE_ID_PREFIX = \"manni:cite\";\n\n/** The fix page, whose sections are anchored by rule name. */\nexport const FIX_URI = \"https://hawkeyexl.github.io/manni/cite/fix/\";\n\n/**\n * What each rule means, for the person who fixes it. The fix page's \"It\n * means\" column says the same, and a test holds the two equal.\n */\nexport const RULE_DESCRIPTIONS: Readonly<Record<CiteRule, string>> = {\n \"source-moved\": \"The cited lines are intact, at a different line number.\",\n \"source-moved-ambiguous\": \"The cited lines now occur in more than one place.\",\n \"source-changed\": \"The cited lines are not what they were.\",\n \"source-never-true\": \"The pin held at no commit in the source's history.\",\n \"source-missing\": \"The path names no tracked file, names an undeclared repo, or an encrypted source cannot be decrypted.\",\n \"claim-moved\": \"The pinned page text sits at a different line.\",\n \"claim-moved-ambiguous\": \"The pinned page text now occurs in more than one place.\",\n \"claim-reanchored\": \"The pinned words are unchanged, and only the layout around them moved.\",\n \"claim-changed\": \"The sentence was edited since it was pinned.\",\n \"marker-orphan\": \"A marker names an id no entry has.\",\n \"marker-invalid\": \"A marker the tool cannot read, including one carrying JSON.\",\n \"marker-repeated\": \"Two markers name one id.\",\n \"marker-misplaced\": \"A marker line sits inside a paragraph and splits it.\",\n \"anchor-invalid\": \"The entry's anchor cannot work.\",\n \"entry-invalid\": \"An entry is malformed, or an id is repeated.\",\n \"quote-drift\": \"The fenced block does not reproduce the cited lines.\",\n};\n\n/** The rule behind a finding: what it means, and its section of the fix page. */\nexport function guidanceFor(rule: CiteRule): Guidance {\n return {\n id: RULE_ID_PREFIX,\n rule,\n description: RULE_DESCRIPTIONS[rule],\n guide: `${FIX_URI}#${rule}`,\n };\n}\n\n/** `manni:cite/<rule>`: the SARIF rule id and the JUnit failure type. */\nexport function ruleId(rule: CiteRule): string {\n return `${RULE_ID_PREFIX}/${rule}`;\n}\n\nexport function isCiteRule(value: string): value is CiteRule {\n return (CITE_RULES as readonly string[]).includes(value);\n}\n\n/** The effective severity table: defaults with the config's overrides. */\nexport function resolveSeverity(\n overrides?: Partial<Record<CiteRule, CiteSeverity>>,\n): Record<CiteRule, CiteSeverity> {\n return { ...DEFAULT_SEVERITY, ...(overrides ?? {}) };\n}\n","/**\n * The marker scanner lives in `src/shared/statements.ts`, which cite and meta\n * share (proposal 0099). This module keeps cite's import path and adds the one\n * piece that is cite's alone: rendering a new marker, whose refusal is a\n * `CiteError`.\n */\nimport { CiteError } from \"../errors.js\";\nimport { statementForms, type StatementForm } from \"../../shared/statements.js\";\n\nexport * from \"../../shared/statements.js\";\n\n/** The form `formatStatement` writes for a format, or a refusal naming the format. */\nfunction writtenForm(format: string): StatementForm {\n const form = statementForms(format)[0];\n if (!form) {\n throw new CiteError(`No marker syntax for format \"${format}\".`);\n }\n return form;\n}\n\n/** Render a marker in the format's first form, e.g. `<!-- cite fetch-timeout -->`. */\nexport function formatStatement(\n format: string,\n payload: { kind: \"ref\"; ids: readonly [string, ...string[]] },\n): string {\n const form = writtenForm(format);\n // `[comment]: # (`, `// (` and `.. (` hug their parentheses; the comment\n // forms take a space inside each delimiter.\n const pad = form.open.endsWith(\"(\") ? \"\" : \"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