@hawkeyexl/manni 4.16.0 → 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 (239) hide show
  1. package/README.md +1 -1
  2. package/dist/{batch-L5W4JS7A.js → batch-5TPNK5BQ.js} +14 -14
  3. package/dist/{build-GNZUVDZX.js → build-GGKCRWKH.js} +15 -14
  4. package/dist/{calibrate-2LYIDN6U.js → calibrate-OGOLLGXY.js} +15 -15
  5. package/dist/{capture-OEDMFU5Z.js → capture-CNHRHTA7.js} +14 -14
  6. package/dist/{check-NLLFHNWG.js → check-BAMOJMOJ.js} +16 -15
  7. package/dist/{check-Z5VGDSDT.js → check-XLIS5A7G.js} +13 -14
  8. package/dist/check-XYGABPXI.js +47 -0
  9. package/dist/{check-JR2TYL2Y.js → check-ZFI7H7LS.js} +15 -15
  10. package/dist/{cli-THEU2QG2.js → chunk-245W2Q7C.js} +133 -365
  11. package/dist/chunk-245W2Q7C.js.map +1 -0
  12. package/dist/{chunk-OJ7FEM2G.js → chunk-27FP4KKD.js} +47 -10
  13. package/dist/chunk-27FP4KKD.js.map +1 -0
  14. package/dist/{chunk-GQQ2AX63.js → chunk-2QZCPPVE.js} +38 -432
  15. package/dist/chunk-2QZCPPVE.js.map +1 -0
  16. package/dist/{chunk-BMYCLTFK.js → chunk-327CWO33.js} +3 -3
  17. package/dist/{chunk-WT3AATHC.js → chunk-33FIOHJ4.js} +252 -425
  18. package/dist/chunk-33FIOHJ4.js.map +1 -0
  19. package/dist/{chunk-ZJZQPOJO.js → chunk-3COYAAR7.js} +2 -2
  20. package/dist/{chunk-6ANTGYNT.js → chunk-3LZ6AYB4.js} +2 -2
  21. package/dist/{chunk-2AUULNIJ.js → chunk-4A445ALG.js} +3 -3
  22. package/dist/{chunk-L3YGGYBG.js → chunk-4KY2RUXQ.js} +3 -3
  23. package/dist/{chunk-NDBISART.js → chunk-5VA3ZOB7.js} +3 -3
  24. package/dist/{chunk-4LLYPDNG.js → chunk-6E6Z6UQL.js} +7 -7
  25. package/dist/{chunk-CSLJMML4.js → chunk-6ZYXK3JT.js} +4 -4
  26. package/dist/chunk-7RZQAMA2.js +314 -0
  27. package/dist/chunk-7RZQAMA2.js.map +1 -0
  28. package/dist/{chunk-NH6B6DDI.js → chunk-CWVL7XZR.js} +4 -4
  29. package/dist/{chunk-DTG6S2UG.js → chunk-E3YXGLEU.js} +2 -2
  30. package/dist/{chunk-5PO2BWZF.js → chunk-E76WPNYO.js} +2 -2
  31. package/dist/{chunk-F4GXZMEO.js → chunk-EITEHOSX.js} +12 -7
  32. package/dist/{chunk-F4GXZMEO.js.map → chunk-EITEHOSX.js.map} +1 -1
  33. package/dist/{chunk-DSTRT6YD.js → chunk-EU5QLSNN.js} +3 -3
  34. package/dist/{chunk-F6B2TNXU.js → chunk-F7GYY373.js} +6 -6
  35. package/dist/{chunk-6NTNLKNQ.js → chunk-FE3US7FR.js} +6 -5
  36. package/dist/{chunk-6NTNLKNQ.js.map → chunk-FE3US7FR.js.map} +1 -1
  37. package/dist/{chunk-IL62WATF.js → chunk-FNQE3RAW.js} +2 -2
  38. package/dist/chunk-FO6MNXOF.js +580 -0
  39. package/dist/chunk-FO6MNXOF.js.map +1 -0
  40. package/dist/{chunk-5D24C6WM.js → chunk-GMOAW2EG.js} +6 -2
  41. package/dist/chunk-GMOAW2EG.js.map +1 -0
  42. package/dist/chunk-GNZKLUZW.js +459 -0
  43. package/dist/chunk-GNZKLUZW.js.map +1 -0
  44. package/dist/{chunk-LEOQO3S6.js → chunk-ICRYIYMJ.js} +7 -7
  45. package/dist/{chunk-GR6QQ7GM.js → chunk-IIBVQCCR.js} +4 -4
  46. package/dist/{chunk-O6YTTBSN.js → chunk-JFB45L7D.js} +2 -2
  47. package/dist/chunk-JFPCDIES.js +1338 -0
  48. package/dist/chunk-JFPCDIES.js.map +1 -0
  49. package/dist/{chunk-2XRET3ZG.js → chunk-JHUEACRT.js} +31 -47
  50. package/dist/chunk-JHUEACRT.js.map +1 -0
  51. package/dist/{chunk-7UC55CAU.js → chunk-JS5NCZYC.js} +187 -159
  52. package/dist/chunk-JS5NCZYC.js.map +1 -0
  53. package/dist/{chunk-63GILHR5.js → chunk-KRQTN5KE.js} +4 -4
  54. package/dist/{chunk-WDENIUC7.js → chunk-MDZXRHIJ.js} +1 -1
  55. package/dist/chunk-MDZXRHIJ.js.map +1 -0
  56. package/dist/{chunk-3GLDB7MZ.js → chunk-MH5MX4B3.js} +1311 -18
  57. package/dist/chunk-MH5MX4B3.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-4L3JBAW4.js → chunk-NUAVQQMC.js} +2 -2
  61. package/dist/{chunk-PBZZUNDV.js → chunk-O2TE5X25.js} +7 -7
  62. package/dist/{chunk-EOSQENQF.js → chunk-OVQDZOMU.js} +2 -2
  63. package/dist/{chunk-WD33LE5A.js → chunk-OZWV27SE.js} +1313 -127
  64. package/dist/chunk-OZWV27SE.js.map +1 -0
  65. package/dist/{chunk-5OOQ3HQ3.js → chunk-PCTJ7P6U.js} +11 -2
  66. package/dist/chunk-PCTJ7P6U.js.map +1 -0
  67. package/dist/{chunk-EZCJPF72.js → chunk-PLN2LJDM.js} +3 -3
  68. package/dist/{chunk-D4ANAOY7.js → chunk-QGJA43DX.js} +20 -6
  69. package/dist/chunk-QGJA43DX.js.map +1 -0
  70. package/dist/{chunk-6YFEV7CM.js → chunk-QWYE3S3U.js} +5 -5
  71. package/dist/{chunk-GC47NBGO.js → chunk-QXTL5MGT.js} +4 -4
  72. package/dist/{chunk-AWAXAJ6R.js → chunk-RCWP63XT.js} +2 -2
  73. package/dist/{chunk-IM67NRUW.js → chunk-RMKMJ43W.js} +2 -2
  74. package/dist/{chunk-EA5KKIFG.js → chunk-RVSUMNCR.js} +3 -3
  75. package/dist/{chunk-NFJGIBES.js → chunk-SVB45M54.js} +82 -238
  76. package/dist/chunk-SVB45M54.js.map +1 -0
  77. package/dist/{chunk-4HEEXPVX.js → chunk-T3VFO2LO.js} +6 -6
  78. package/dist/{chunk-FU3OCYYH.js → chunk-TFTGMYDR.js} +2 -2
  79. package/dist/chunk-UP6NBQ62.js +2 -0
  80. package/dist/{chunk-LPBVWUKS.js → chunk-V2IP2ZMD.js} +2 -2
  81. package/dist/{chunk-PHNAQ4QX.js → chunk-V5QTIP2M.js} +182 -94
  82. package/dist/chunk-V5QTIP2M.js.map +1 -0
  83. package/dist/{chunk-B3XXCDYW.js → chunk-VV4YM6VM.js} +2385 -2061
  84. package/dist/chunk-VV4YM6VM.js.map +1 -0
  85. package/dist/{chunk-7GB3KEEM.js → chunk-XKZZRG3Z.js} +24 -460
  86. package/dist/chunk-XKZZRG3Z.js.map +1 -0
  87. package/dist/{chunk-ZT5NUSZA.js → chunk-XTQTA262.js} +146 -27
  88. package/dist/chunk-XTQTA262.js.map +1 -0
  89. package/dist/chunk-YLU4H2H3.js +545 -0
  90. package/dist/chunk-YLU4H2H3.js.map +1 -0
  91. package/dist/{chunk-YF6IZXAC.js → chunk-ZLOLC6WD.js} +7 -7
  92. package/dist/{cli-RWRYV5FB.js → cli-6UQ3QV2G.js} +9 -9
  93. package/dist/{cli-LZW6Z33F.js → cli-GH42HLFK.js} +42 -24
  94. package/dist/cli-GH42HLFK.js.map +1 -0
  95. package/dist/{cli-5QTSTGTX.js → cli-GND6TVRG.js} +18 -18
  96. package/dist/{cli-4Y2XY52B.js → cli-JHULEOH2.js} +2 -2
  97. package/dist/cli-LVHZCC2O.js +379 -0
  98. package/dist/cli-LVHZCC2O.js.map +1 -0
  99. package/dist/{cli-2EKRURBU.js → cli-NWU77YRZ.js} +15 -15
  100. package/dist/{cli-2SDBEUER.js → cli-PUO75R3L.js} +21 -21
  101. package/dist/{cli-TZ2OHF3H.js → cli-Q2RJMCVE.js} +28 -20
  102. package/dist/cli-Q2RJMCVE.js.map +1 -0
  103. package/dist/{cli-DBMPGGOV.js → cli-RUNYBUIV.js} +38 -38
  104. package/dist/{cli-BXUZ3KEQ.js → cli-T7UJF3BF.js} +634 -36
  105. package/dist/cli-T7UJF3BF.js.map +1 -0
  106. package/dist/{cli-KAUXC7EZ.js → cli-WUFQGIUG.js} +9 -9
  107. package/dist/cli.js +14 -14
  108. package/dist/docmeta.js +8 -8
  109. package/dist/{github-UR6LMUMW.js → github-BV42LSW2.js} +13 -14
  110. package/dist/github-XZ7OLATY.js +35 -0
  111. package/dist/graph/runtime.d.ts +633 -217
  112. package/dist/graph/runtime.js +1001 -370
  113. package/dist/graph/runtime.js.map +1 -1
  114. package/dist/index.d.ts +2734 -1977
  115. package/dist/index.js +109 -65
  116. package/dist/index.js.map +1 -1
  117. package/dist/{json-QTYN2JQB.js → json-LEEXKSGP.js} +13 -14
  118. package/dist/{json-5EQCGVCV.js → json-YTKUFNO3.js} +2 -2
  119. package/dist/{labels-UM2AFR5S.js → labels-E256WRAI.js} +12 -13
  120. package/dist/{labels-UM2AFR5S.js.map → labels-E256WRAI.js.map} +1 -1
  121. package/dist/{lint-LOFNZZPR.js → lint-W4CM3EIO.js} +13 -13
  122. package/dist/{list-GU7S6KEX.js → list-TB4R6AP4.js} +13 -14
  123. package/dist/{list-EPMHOU7T.js → list-UDDGL2OI.js} +15 -15
  124. package/dist/{page-25CN3AFY.js → page-L64NO57W.js} +13 -14
  125. package/dist/{prepare-5GYMBF4P.js → prepare-GFTAYDTP.js} +13 -13
  126. package/dist/{pretty-52Z74O6F.js → pretty-HYCYKYHB.js} +14 -15
  127. package/dist/{pretty-QW6OSYRS.js → pretty-Q43TCD6D.js} +13 -14
  128. package/dist/{reporters-WT53GD4P.js → reporters-4HRBSMUF.js} +4 -4
  129. package/dist/{reporters-FSXJ42EB.js → reporters-6TEJDXXO.js} +4 -4
  130. package/dist/{reporters-3FXX2W4X.js → reporters-E3FUVBQ6.js} +12 -12
  131. package/dist/{run-H7XJMUWK.js → run-UDX2C54M.js} +16 -16
  132. package/dist/{sarif-C427U3NA.js → sarif-WL353VTA.js} +11 -11
  133. package/dist/sarif-XZFJ5VIJ.js +36 -0
  134. package/dist/site/rehype.d.ts +33 -0
  135. package/dist/site/rehype.js +49 -0
  136. package/dist/site/rehype.js.map +1 -0
  137. package/dist/{term-VG65JRNR.js → term-OZ7ZR5KB.js} +18 -19
  138. package/dist/{term-VG65JRNR.js.map → term-OZ7ZR5KB.js.map} +1 -1
  139. package/dist/{types-VMOT7RAL.js → types-7N7ETP3W.js} +2 -2
  140. package/dist/{validate-K36F54UB.js → validate-CR3TI7GP.js} +5 -5
  141. package/package.json +10 -1
  142. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  143. package/shapes/graph/shapes-1.2.0.ttl +1161 -0
  144. package/dist/check-LVO4HZ3F.js +0 -36
  145. package/dist/chunk-2XRET3ZG.js.map +0 -1
  146. package/dist/chunk-3GLDB7MZ.js.map +0 -1
  147. package/dist/chunk-3WZQ2FR3.js +0 -236
  148. package/dist/chunk-3WZQ2FR3.js.map +0 -1
  149. package/dist/chunk-5D24C6WM.js.map +0 -1
  150. package/dist/chunk-5OOQ3HQ3.js.map +0 -1
  151. package/dist/chunk-7GB3KEEM.js.map +0 -1
  152. package/dist/chunk-7UC55CAU.js.map +0 -1
  153. package/dist/chunk-B3XXCDYW.js.map +0 -1
  154. package/dist/chunk-D4ANAOY7.js.map +0 -1
  155. package/dist/chunk-GQQ2AX63.js.map +0 -1
  156. package/dist/chunk-IKEWBMCN.js +0 -98
  157. package/dist/chunk-IKEWBMCN.js.map +0 -1
  158. package/dist/chunk-NFJGIBES.js.map +0 -1
  159. package/dist/chunk-OJ7FEM2G.js.map +0 -1
  160. package/dist/chunk-PHNAQ4QX.js.map +0 -1
  161. package/dist/chunk-WD33LE5A.js.map +0 -1
  162. package/dist/chunk-WDENIUC7.js.map +0 -1
  163. package/dist/chunk-WT3AATHC.js.map +0 -1
  164. package/dist/chunk-YUTVAMWW.js +0 -2
  165. package/dist/chunk-ZT5NUSZA.js.map +0 -1
  166. package/dist/cli-BXUZ3KEQ.js.map +0 -1
  167. package/dist/cli-LZW6Z33F.js.map +0 -1
  168. package/dist/cli-THEU2QG2.js.map +0 -1
  169. package/dist/cli-TZ2OHF3H.js.map +0 -1
  170. package/dist/github-ICZ5UDGX.js +0 -36
  171. package/dist/sarif-UVAFWZKS.js +0 -37
  172. /package/dist/{batch-L5W4JS7A.js.map → batch-5TPNK5BQ.js.map} +0 -0
  173. /package/dist/{build-GNZUVDZX.js.map → build-GGKCRWKH.js.map} +0 -0
  174. /package/dist/{calibrate-2LYIDN6U.js.map → calibrate-OGOLLGXY.js.map} +0 -0
  175. /package/dist/{capture-OEDMFU5Z.js.map → capture-CNHRHTA7.js.map} +0 -0
  176. /package/dist/{check-LVO4HZ3F.js.map → check-BAMOJMOJ.js.map} +0 -0
  177. /package/dist/{check-NLLFHNWG.js.map → check-XLIS5A7G.js.map} +0 -0
  178. /package/dist/{check-Z5VGDSDT.js.map → check-XYGABPXI.js.map} +0 -0
  179. /package/dist/{check-JR2TYL2Y.js.map → check-ZFI7H7LS.js.map} +0 -0
  180. /package/dist/{chunk-BMYCLTFK.js.map → chunk-327CWO33.js.map} +0 -0
  181. /package/dist/{chunk-ZJZQPOJO.js.map → chunk-3COYAAR7.js.map} +0 -0
  182. /package/dist/{chunk-6ANTGYNT.js.map → chunk-3LZ6AYB4.js.map} +0 -0
  183. /package/dist/{chunk-2AUULNIJ.js.map → chunk-4A445ALG.js.map} +0 -0
  184. /package/dist/{chunk-L3YGGYBG.js.map → chunk-4KY2RUXQ.js.map} +0 -0
  185. /package/dist/{chunk-NDBISART.js.map → chunk-5VA3ZOB7.js.map} +0 -0
  186. /package/dist/{chunk-4LLYPDNG.js.map → chunk-6E6Z6UQL.js.map} +0 -0
  187. /package/dist/{chunk-CSLJMML4.js.map → chunk-6ZYXK3JT.js.map} +0 -0
  188. /package/dist/{chunk-NH6B6DDI.js.map → chunk-CWVL7XZR.js.map} +0 -0
  189. /package/dist/{chunk-DTG6S2UG.js.map → chunk-E3YXGLEU.js.map} +0 -0
  190. /package/dist/{chunk-5PO2BWZF.js.map → chunk-E76WPNYO.js.map} +0 -0
  191. /package/dist/{chunk-DSTRT6YD.js.map → chunk-EU5QLSNN.js.map} +0 -0
  192. /package/dist/{chunk-F6B2TNXU.js.map → chunk-F7GYY373.js.map} +0 -0
  193. /package/dist/{chunk-IL62WATF.js.map → chunk-FNQE3RAW.js.map} +0 -0
  194. /package/dist/{chunk-LEOQO3S6.js.map → chunk-ICRYIYMJ.js.map} +0 -0
  195. /package/dist/{chunk-GR6QQ7GM.js.map → chunk-IIBVQCCR.js.map} +0 -0
  196. /package/dist/{chunk-O6YTTBSN.js.map → chunk-JFB45L7D.js.map} +0 -0
  197. /package/dist/{chunk-63GILHR5.js.map → chunk-KRQTN5KE.js.map} +0 -0
  198. /package/dist/{chunk-IGRXQC3H.js.map → chunk-N25KDXOV.js.map} +0 -0
  199. /package/dist/{chunk-DW22KCLN.js.map → chunk-NPZWOPOH.js.map} +0 -0
  200. /package/dist/{chunk-4L3JBAW4.js.map → chunk-NUAVQQMC.js.map} +0 -0
  201. /package/dist/{chunk-PBZZUNDV.js.map → chunk-O2TE5X25.js.map} +0 -0
  202. /package/dist/{chunk-EOSQENQF.js.map → chunk-OVQDZOMU.js.map} +0 -0
  203. /package/dist/{chunk-EZCJPF72.js.map → chunk-PLN2LJDM.js.map} +0 -0
  204. /package/dist/{chunk-6YFEV7CM.js.map → chunk-QWYE3S3U.js.map} +0 -0
  205. /package/dist/{chunk-GC47NBGO.js.map → chunk-QXTL5MGT.js.map} +0 -0
  206. /package/dist/{chunk-AWAXAJ6R.js.map → chunk-RCWP63XT.js.map} +0 -0
  207. /package/dist/{chunk-IM67NRUW.js.map → chunk-RMKMJ43W.js.map} +0 -0
  208. /package/dist/{chunk-EA5KKIFG.js.map → chunk-RVSUMNCR.js.map} +0 -0
  209. /package/dist/{chunk-4HEEXPVX.js.map → chunk-T3VFO2LO.js.map} +0 -0
  210. /package/dist/{chunk-FU3OCYYH.js.map → chunk-TFTGMYDR.js.map} +0 -0
  211. /package/dist/{chunk-YUTVAMWW.js.map → chunk-UP6NBQ62.js.map} +0 -0
  212. /package/dist/{chunk-LPBVWUKS.js.map → chunk-V2IP2ZMD.js.map} +0 -0
  213. /package/dist/{chunk-YF6IZXAC.js.map → chunk-ZLOLC6WD.js.map} +0 -0
  214. /package/dist/{cli-RWRYV5FB.js.map → cli-6UQ3QV2G.js.map} +0 -0
  215. /package/dist/{cli-5QTSTGTX.js.map → cli-GND6TVRG.js.map} +0 -0
  216. /package/dist/{cli-4Y2XY52B.js.map → cli-JHULEOH2.js.map} +0 -0
  217. /package/dist/{cli-2EKRURBU.js.map → cli-NWU77YRZ.js.map} +0 -0
  218. /package/dist/{cli-2SDBEUER.js.map → cli-PUO75R3L.js.map} +0 -0
  219. /package/dist/{cli-DBMPGGOV.js.map → cli-RUNYBUIV.js.map} +0 -0
  220. /package/dist/{cli-KAUXC7EZ.js.map → cli-WUFQGIUG.js.map} +0 -0
  221. /package/dist/{github-ICZ5UDGX.js.map → github-BV42LSW2.js.map} +0 -0
  222. /package/dist/{github-UR6LMUMW.js.map → github-XZ7OLATY.js.map} +0 -0
  223. /package/dist/{json-5EQCGVCV.js.map → json-LEEXKSGP.js.map} +0 -0
  224. /package/dist/{json-QTYN2JQB.js.map → json-YTKUFNO3.js.map} +0 -0
  225. /package/dist/{lint-LOFNZZPR.js.map → lint-W4CM3EIO.js.map} +0 -0
  226. /package/dist/{list-EPMHOU7T.js.map → list-TB4R6AP4.js.map} +0 -0
  227. /package/dist/{list-GU7S6KEX.js.map → list-UDDGL2OI.js.map} +0 -0
  228. /package/dist/{page-25CN3AFY.js.map → page-L64NO57W.js.map} +0 -0
  229. /package/dist/{prepare-5GYMBF4P.js.map → prepare-GFTAYDTP.js.map} +0 -0
  230. /package/dist/{pretty-52Z74O6F.js.map → pretty-HYCYKYHB.js.map} +0 -0
  231. /package/dist/{pretty-QW6OSYRS.js.map → pretty-Q43TCD6D.js.map} +0 -0
  232. /package/dist/{reporters-3FXX2W4X.js.map → reporters-4HRBSMUF.js.map} +0 -0
  233. /package/dist/{reporters-FSXJ42EB.js.map → reporters-6TEJDXXO.js.map} +0 -0
  234. /package/dist/{reporters-WT53GD4P.js.map → reporters-E3FUVBQ6.js.map} +0 -0
  235. /package/dist/{run-H7XJMUWK.js.map → run-UDX2C54M.js.map} +0 -0
  236. /package/dist/{sarif-C427U3NA.js.map → sarif-WL353VTA.js.map} +0 -0
  237. /package/dist/{sarif-UVAFWZKS.js.map → sarif-XZFJ5VIJ.js.map} +0 -0
  238. /package/dist/{types-VMOT7RAL.js.map → types-7N7ETP3W.js.map} +0 -0
  239. /package/dist/{validate-K36F54UB.js.map → validate-CR3TI7GP.js.map} +0 -0
@@ -1,181 +1,40 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- ManifestSet,
4
- appendFrontmatterCitation,
5
- entryObject,
6
- insertStatementBefore,
7
- itemLine,
8
- mintCitation,
9
- removeFrontmatterCitations,
10
- removeLine,
11
- runAdd,
12
- runHistory,
13
- runRemove,
14
- runUpdate,
15
- shiftedEntries,
16
- splice,
17
- spliceEntryField,
18
- unifiedDiff,
19
- withClaimLines
20
- } from "./chunk-PHNAQ4QX.js";
3
+ reencryptCitationEntries,
4
+ reencryptCitations
5
+ } from "./chunk-GNZKLUZW.js";
6
+ import {
7
+ ManifestSet
8
+ } from "./chunk-V5QTIP2M.js";
21
9
  import {
22
- CITATIONS_KEY,
23
- CITE_SECTION,
24
10
  DEFAULT_CITE_BASELINE_PATH,
25
- GIT_UNAVAILABLE_COMMIT,
26
11
  GIT_UNAVAILABLE_HISTORY,
27
- MAX_PAGE_COMMITS,
28
- PAGE_HISTORY_UNAVAILABLE,
29
- SOURCE_HISTORY_UNAVAILABLE,
30
12
  buildSourceIndex,
31
- checkCitations,
32
- claimDiff,
33
- claimHistory,
34
- claimWords,
35
- classifyCitation,
36
- decryptSourcePath,
37
- duplicateJoinRefusal,
38
- encryptSourcePath,
13
+ checkoutResolver,
39
14
  gitClient,
40
- historyOf,
41
- holdsWords,
42
15
  loadCitationSidecars,
43
- loadCiteConfig,
44
- noGit,
45
- orphanRefusal,
46
- parseCiteConfig,
47
- readCiteConfigFile,
48
- readSource,
49
- refineClaim,
50
- resolveCiteRun,
51
- runCheck,
52
- runsHolding,
53
- sentencesOf,
54
- sharesSentence,
55
- sidecarsFor,
56
- sourceBaseline,
57
- stripMarkers,
58
- twoManifestsRefusal,
59
- urlManifestRefusal
60
- } from "./chunk-ZT5NUSZA.js";
61
- import {
62
- renderCheckJson,
63
- renderHistoryJson,
64
- renderRemoveJson,
65
- renderUpdateJson
66
- } from "./chunk-5D24C6WM.js";
67
- import {
68
- renderCheckGithub
69
- } from "./chunk-BMYCLTFK.js";
70
- import {
71
- refusalLine,
72
- removalLine,
73
- renderCheckPretty,
74
- renderHistoryPretty,
75
- renderRemovePretty,
76
- renderUpdatePretty,
77
- rewriteLine
78
- } from "./chunk-NDBISART.js";
79
- import {
80
- blockMatches,
81
- claimEnd,
82
- claimLine,
83
- claimMessageFor,
84
- errorSite,
85
- findingsFor,
86
- isUnitText,
87
- markerClaimEnd,
88
- markerRunAt,
89
- markerUnit,
90
- messageFor,
91
- misplacedMarkerAt,
92
- misplacedMarkers,
93
- misplacedMessageFor,
94
- movedUnit,
95
- noUnitAt,
96
- normalizeWhitespace,
97
- pre43Span,
98
- shortCommit,
99
- shortLine,
100
- shortPin,
101
- shortSrc,
102
- spellAt,
103
- splitUnit,
104
- toValidationResult,
105
- unitAt,
106
- unitText
107
- } from "./chunk-2XRET3ZG.js";
16
+ parseCiteConfig
17
+ } from "./chunk-XTQTA262.js";
108
18
  import {
109
- CITE_RULES,
110
- CiteError,
111
- DEFAULT_SEVERITY,
112
- FILE_PATTERN,
113
- MARKER_JSON,
114
- MAX_MARKERS_PER_PAGE,
115
- RULE_ID_PREFIX,
116
- SRC_PATTERN,
117
- anchoredLines,
118
- citationInputs,
119
- detectEol,
120
- fenceSpanAt,
121
- fencedBlockAfter,
122
- fencedBlockAt,
123
- fencedBlocks,
124
- formatSrc,
125
- formatStatement,
126
- hashRange,
127
- insideFence,
128
- isBoundLine,
129
- isCiteRule,
130
- isTableRow,
131
- lineAt,
132
- offsetOfLine,
133
- ownedMessage,
134
- paragraphAfter,
135
- parseSrc,
136
- parseStatements,
137
- pickExtractor,
138
- rangeLines,
139
19
  readPage,
140
- resolveSeverity,
141
- ruleId,
142
- sliceLines,
143
- sourceRange,
144
- spellSource,
145
- statementForms,
146
- validateEntry
147
- } from "./chunk-7GB3KEEM.js";
20
+ sourceRange
21
+ } from "./chunk-XKZZRG3Z.js";
148
22
  import {
149
23
  reencryptData,
150
24
  reencryptMetadata
151
- } from "./chunk-EZCJPF72.js";
25
+ } from "./chunk-PLN2LJDM.js";
152
26
  import {
153
27
  ENCRYPTION_KEY_ENV,
154
- MAX_RANGE_LINES,
155
- MOVE_BUDGET_BYTES,
156
- MOVE_WINDOW_LINES,
157
28
  PATH_JOIN,
158
- bodyLineOf,
159
29
  committedKeyWarning,
160
30
  configMarks,
161
31
  externalMetadataJoin,
162
- findWindows,
163
- hashLines,
164
32
  isIgnoredByGit,
165
- isKeyedPin,
166
- lineSpec,
167
33
  loadExternalMetadata,
168
- normalizeText,
169
- parseLines,
170
- pinOfLines,
171
34
  resolveEncryptionKey,
172
- spellLines,
173
35
  spliceManifestValue,
174
- splitLines,
175
- toBodyLines,
176
- toFileLines,
177
36
  writeEncryptionKey
178
- } from "./chunk-3GLDB7MZ.js";
37
+ } from "./chunk-MH5MX4B3.js";
179
38
  import {
180
39
  LEGACY_CONFIG_NAMES,
181
40
  STDIN_TOKEN,
@@ -186,7 +45,7 @@ import {
186
45
  resolveTargetSet,
187
46
  supportedExtensions,
188
47
  writeFileAtomic
189
- } from "./chunk-WD33LE5A.js";
48
+ } from "./chunk-OZWV27SE.js";
190
49
  import {
191
50
  findConfigFile,
192
51
  findFamilyConfigFile,
@@ -204,278 +63,6 @@ import {
204
63
  import {
205
64
  ToolError
206
65
  } from "./chunk-G3T47CFV.js";
207
- import {
208
- __export
209
- } from "./chunk-2H7UOFLK.js";
210
-
211
- // src/cite/index.ts
212
- var cite_exports = {};
213
- __export(cite_exports, {
214
- CITATIONS_KEY: () => CITATIONS_KEY,
215
- CITE_RULES: () => CITE_RULES,
216
- CITE_SECTION: () => CITE_SECTION,
217
- CiteError: () => CiteError,
218
- DEFAULT_CITE_BASELINE_PATH: () => DEFAULT_CITE_BASELINE_PATH,
219
- DEFAULT_SEVERITY: () => DEFAULT_SEVERITY,
220
- FILE_PATTERN: () => FILE_PATTERN,
221
- GIT_UNAVAILABLE_COMMIT: () => GIT_UNAVAILABLE_COMMIT,
222
- GIT_UNAVAILABLE_HISTORY: () => GIT_UNAVAILABLE_HISTORY,
223
- MARKER_JSON: () => MARKER_JSON,
224
- MAX_MARKERS_PER_PAGE: () => MAX_MARKERS_PER_PAGE,
225
- MAX_PAGE_COMMITS: () => MAX_PAGE_COMMITS,
226
- MAX_RANGE_LINES: () => MAX_RANGE_LINES,
227
- MOVE_BUDGET_BYTES: () => MOVE_BUDGET_BYTES,
228
- MOVE_WINDOW_LINES: () => MOVE_WINDOW_LINES,
229
- ManifestSet: () => ManifestSet,
230
- PAGE_HISTORY_UNAVAILABLE: () => PAGE_HISTORY_UNAVAILABLE,
231
- RULE_ID_PREFIX: () => RULE_ID_PREFIX,
232
- SOURCE_HISTORY_UNAVAILABLE: () => SOURCE_HISTORY_UNAVAILABLE,
233
- SRC_PATTERN: () => SRC_PATTERN,
234
- anchoredLines: () => anchoredLines,
235
- appendFrontmatterCitation: () => appendFrontmatterCitation,
236
- blockMatches: () => blockMatches,
237
- bodyLineOf: () => bodyLineOf,
238
- buildSourceIndex: () => buildSourceIndex,
239
- checkCitations: () => checkCitations,
240
- citationInputs: () => citationInputs,
241
- claimDiff: () => claimDiff,
242
- claimEnd: () => claimEnd,
243
- claimHistory: () => claimHistory,
244
- claimLine: () => claimLine,
245
- claimMessageFor: () => claimMessageFor,
246
- claimWords: () => claimWords,
247
- classifyCitation: () => classifyCitation,
248
- detectEol: () => detectEol,
249
- duplicateJoinRefusal: () => duplicateJoinRefusal,
250
- entryObject: () => entryObject,
251
- errorSite: () => errorSite,
252
- fenceSpanAt: () => fenceSpanAt,
253
- fencedBlockAfter: () => fencedBlockAfter,
254
- fencedBlockAt: () => fencedBlockAt,
255
- fencedBlocks: () => fencedBlocks,
256
- findWindows: () => findWindows,
257
- findingsFor: () => findingsFor,
258
- formatSrc: () => formatSrc,
259
- formatStatement: () => formatStatement,
260
- gitClient: () => gitClient,
261
- hashLines: () => hashLines,
262
- hashRange: () => hashRange,
263
- historyOf: () => historyOf,
264
- holdsWords: () => holdsWords,
265
- insertStatementBefore: () => insertStatementBefore,
266
- insideFence: () => insideFence,
267
- isBoundLine: () => isBoundLine,
268
- isCiteRule: () => isCiteRule,
269
- isKeyedPin: () => isKeyedPin,
270
- isTableRow: () => isTableRow,
271
- isUnitText: () => isUnitText,
272
- itemLine: () => itemLine,
273
- lineAt: () => lineAt,
274
- lineSpec: () => lineSpec,
275
- loadCitationSidecars: () => loadCitationSidecars,
276
- loadCiteConfig: () => loadCiteConfig,
277
- markerClaimEnd: () => markerClaimEnd,
278
- markerRunAt: () => markerRunAt,
279
- markerUnit: () => markerUnit,
280
- messageFor: () => messageFor,
281
- mintCitation: () => mintCitation,
282
- misplacedMarkerAt: () => misplacedMarkerAt,
283
- misplacedMarkers: () => misplacedMarkers,
284
- misplacedMessageFor: () => misplacedMessageFor,
285
- movedUnit: () => movedUnit,
286
- noGit: () => noGit,
287
- noUnitAt: () => noUnitAt,
288
- normalizeText: () => normalizeText,
289
- normalizeWhitespace: () => normalizeWhitespace,
290
- offsetOfLine: () => offsetOfLine,
291
- orphanRefusal: () => orphanRefusal,
292
- ownedMessage: () => ownedMessage,
293
- paragraphAfter: () => paragraphAfter,
294
- parseCiteConfig: () => parseCiteConfig,
295
- parseLines: () => parseLines,
296
- parseSrc: () => parseSrc,
297
- parseStatements: () => parseStatements,
298
- pickExtractor: () => pickExtractor,
299
- pinOfLines: () => pinOfLines,
300
- pre43Span: () => pre43Span,
301
- rangeLines: () => rangeLines,
302
- readCiteConfigFile: () => readCiteConfigFile,
303
- readPage: () => readPage,
304
- readSource: () => readSource,
305
- reencryptCitationEntries: () => reencryptCitationEntries,
306
- reencryptCitations: () => reencryptCitations,
307
- refineClaim: () => refineClaim,
308
- refusalLine: () => refusalLine,
309
- removalLine: () => removalLine,
310
- removeFrontmatterCitations: () => removeFrontmatterCitations,
311
- removeLine: () => removeLine,
312
- renderCheckGithub: () => renderCheckGithub,
313
- renderCheckJson: () => renderCheckJson,
314
- renderCheckPretty: () => renderCheckPretty,
315
- renderHistoryJson: () => renderHistoryJson,
316
- renderHistoryPretty: () => renderHistoryPretty,
317
- renderRemoveJson: () => renderRemoveJson,
318
- renderRemovePretty: () => renderRemovePretty,
319
- renderUpdateJson: () => renderUpdateJson,
320
- renderUpdatePretty: () => renderUpdatePretty,
321
- resolveCiteRun: () => resolveCiteRun,
322
- resolveSeverity: () => resolveSeverity,
323
- rewriteLine: () => rewriteLine,
324
- ruleId: () => ruleId,
325
- runAdd: () => runAdd,
326
- runCheck: () => runCheck,
327
- runHistory: () => runHistory,
328
- runRemove: () => runRemove,
329
- runUpdate: () => runUpdate,
330
- runsHolding: () => runsHolding,
331
- sentencesOf: () => sentencesOf,
332
- sharesSentence: () => sharesSentence,
333
- shiftedEntries: () => shiftedEntries,
334
- shortCommit: () => shortCommit,
335
- shortLine: () => shortLine,
336
- shortPin: () => shortPin,
337
- shortSrc: () => shortSrc,
338
- sidecarsFor: () => sidecarsFor,
339
- sliceLines: () => sliceLines,
340
- sourceRange: () => sourceRange,
341
- spellAt: () => spellAt,
342
- spellLines: () => spellLines,
343
- spellSource: () => spellSource,
344
- splice: () => splice,
345
- spliceEntryField: () => spliceEntryField,
346
- splitLines: () => splitLines,
347
- splitUnit: () => splitUnit,
348
- statementForms: () => statementForms,
349
- stripMarkers: () => stripMarkers,
350
- toBodyLines: () => toBodyLines,
351
- toFileLines: () => toFileLines,
352
- toValidationResult: () => toValidationResult,
353
- twoManifestsRefusal: () => twoManifestsRefusal,
354
- unifiedDiff: () => unifiedDiff,
355
- unitAt: () => unitAt,
356
- unitText: () => unitText,
357
- urlManifestRefusal: () => urlManifestRefusal,
358
- validateEntry: () => validateEntry,
359
- withClaimLines: () => withClaimLines
360
- });
361
-
362
- // src/cite/core/reencrypt.ts
363
- var UNDECRYPTABLE = "does not decrypt under the current key";
364
- var MISSING = "missing (no tracked file matches)";
365
- var CHANGED = "changed; run `manni cite update --accept` before rotating";
366
- function whereOf(citation, origin) {
367
- const where = { index: origin.index };
368
- if (citation.id !== void 0) where.id = citation.id;
369
- if (origin.line !== void 0) where.line = origin.line;
370
- return where;
371
- }
372
- async function pinnedLines(ctx, citation, range, path, key) {
373
- const source = await readSource(ctx.root, ctx.index, { ...range, path, encrypted: false });
374
- if (source.kind === "missing") return { skip: MISSING };
375
- const pin = citation.source.integrity;
376
- let joined;
377
- try {
378
- joined = sliceLines(splitLines(source.text), range);
379
- } catch {
380
- joined = void 0;
381
- }
382
- if (joined !== void 0 && hashLines(joined, key) === pin) return { joined };
383
- if (await ctx.git.available()) {
384
- const recorded = citation.source["commit-sha"];
385
- const { history } = await sourceBaseline(ctx.git, recorded, path, range, pin, key, void 0);
386
- if (history.kind === "original") return { joined: history.lines.join("\n") };
387
- }
388
- return { skip: CHANGED };
389
- }
390
- async function verdictFor(ctx, citation, opts) {
391
- const range = sourceRange(citation.source);
392
- const underNew = decryptSourcePath(range.path, opts.toKey);
393
- if (underNew !== void 0) {
394
- const held = await pinnedLines(ctx, citation, range, underNew, opts.toKey);
395
- if ("joined" in held) return { kind: "done" };
396
- }
397
- const path = underNew ?? decryptSourcePath(range.path, opts.fromKey);
398
- if (path === void 0) return { kind: "skip", message: UNDECRYPTABLE };
399
- const lines = await pinnedLines(ctx, citation, range, path, opts.fromKey);
400
- if ("skip" in lines) return { kind: "skip", message: lines.skip };
401
- const file = underNew === void 0 ? encryptSourcePath(path, opts.toKey) : range.path;
402
- return {
403
- kind: "write",
404
- file,
405
- integrity: hashLines(lines.joined, opts.toKey),
406
- to: formatSrc({ ...range, path: file })
407
- };
408
- }
409
- async function contextFor(opts) {
410
- const git = opts.gitClient ?? gitClient(opts.root);
411
- const index = opts.sourceIndex ?? await buildSourceIndex(opts.root, { gitClient: git });
412
- return { root: opts.root, index, git };
413
- }
414
- async function reencryptCitations(page, opts) {
415
- const read = readPage(page.file, page.content, page.format === void 0 ? void 0 : { format: page.format });
416
- const result = { content: page.content, rewritten: [], skipped: [] };
417
- const encrypted = read.citations.filter(({ citation }) => sourceRange(citation.source).encrypted);
418
- if (encrypted.length === 0) return result;
419
- const ctx = await contextFor(opts);
420
- let after = page.content;
421
- for (const { citation, origin } of encrypted) {
422
- const range = sourceRange(citation.source);
423
- const where = whereOf(citation, origin);
424
- const verdict = await verdictFor(ctx, citation, opts);
425
- if (verdict.kind === "done") continue;
426
- if (verdict.kind === "skip") {
427
- result.skipped.push({ ...where, message: verdict.message });
428
- continue;
429
- }
430
- if (verdict.file !== range.path) {
431
- after = spliceEntryField(after, read.format, origin.index, ["source", "file"], verdict.file);
432
- }
433
- after = spliceEntryField(
434
- after,
435
- read.format,
436
- origin.index,
437
- ["source", "integrity"],
438
- verdict.integrity
439
- );
440
- result.rewritten.push({ ...where, from: spellSource(citation.source), to: verdict.to });
441
- }
442
- result.content = after;
443
- return result;
444
- }
445
- async function reencryptCitationEntries(page, opts) {
446
- const entries = JSON.parse(
447
- JSON.stringify(page.citations.map((input) => input.entry))
448
- );
449
- const out = { entries, changed: false, rewritten: [], skipped: [] };
450
- const read = readPage(page.file, page.content, {
451
- ...page.format === void 0 ? {} : { format: page.format },
452
- citations: page.citations
453
- });
454
- const encrypted = read.citations.filter(({ citation }) => sourceRange(citation.source).encrypted);
455
- if (encrypted.length === 0) return out;
456
- const ctx = await contextFor(opts);
457
- for (const { citation, origin } of encrypted) {
458
- const where = whereOf(citation, origin);
459
- const verdict = await verdictFor(ctx, citation, opts);
460
- if (verdict.kind === "done") continue;
461
- if (verdict.kind === "skip") {
462
- out.skipped.push({ ...where, message: verdict.message });
463
- continue;
464
- }
465
- const entry = entries[origin.index];
466
- const source = typeof entry === "object" && entry !== null && !Array.isArray(entry) ? entry.source : void 0;
467
- if (typeof source !== "object" || source === null || Array.isArray(source)) {
468
- out.skipped.push({ ...where, message: UNDECRYPTABLE });
469
- continue;
470
- }
471
- const fields = source;
472
- fields.file = verdict.file;
473
- fields.integrity = verdict.integrity;
474
- out.changed = true;
475
- out.rewritten.push({ ...where, from: spellSource(citation.source), to: verdict.to });
476
- }
477
- return out;
478
- }
479
66
 
480
67
  // src/key/errors.ts
481
68
  var KeyError = class extends ToolError {
@@ -531,6 +118,12 @@ function rootFor(flag, cite, file, cwd) {
531
118
  const gitRoot = findGitRoot(cwd);
532
119
  return gitRoot === null ? { root: cwd, fellBack: true } : { root: gitRoot, fellBack: false };
533
120
  }
121
+ function reposFor(flags, cite, file, cwd) {
122
+ const repos = {};
123
+ if (file !== null) for (const [name, dir] of Object.entries(cite.repos ?? {})) repos[name] = resolve(file.dir, dir);
124
+ for (const [name, dir] of Object.entries(flags ?? {})) repos[name] = resolve(cwd, dir);
125
+ return repos;
126
+ }
534
127
  function isEnoent(error) {
535
128
  return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
536
129
  }
@@ -566,7 +159,8 @@ async function rotateManifestCitations(sidecars, manifests, page, opts) {
566
159
  fromKey: opts.fromKey,
567
160
  toKey: opts.toKey,
568
161
  gitClient: opts.gitClient,
569
- sourceIndex: await opts.sourceIndex()
162
+ sourceIndex: await opts.sourceIndex(),
163
+ checkouts: await opts.checkouts()
570
164
  }
571
165
  );
572
166
  if (result.changed && sidecar.entry !== void 0) {
@@ -766,6 +360,11 @@ async function runKeyRotate(opts) {
766
360
  }
767
361
  return index;
768
362
  };
363
+ const repos = reposFor(opts.repos, cite, file, cwd);
364
+ let resolver;
365
+ const checkouts = () => resolver ??= sourceIndex().then(
366
+ (rootIndex) => checkoutResolver({ root, index: rootIndex, git: client }, repos)
367
+ );
769
368
  const sidecars = file === null ? null : await loadCitationSidecars({
770
369
  collections: file.collections,
771
370
  configDir: file.dir,
@@ -790,7 +389,8 @@ async function runKeyRotate(opts) {
790
389
  fromKey,
791
390
  toKey,
792
391
  gitClient: client,
793
- sourceIndex
392
+ sourceIndex,
393
+ checkouts
794
394
  });
795
395
  if (sidecarWork.wantsHistory) wantsHistory = true;
796
396
  if (!ANY_CIPHERTEXT.test(before)) {
@@ -808,7 +408,14 @@ async function runKeyRotate(opts) {
808
408
  if (encrypted.withCommit) wantsHistory = true;
809
409
  const cited = encrypted.any ? await reencryptCitations(
810
410
  { ...page, content: meta.content },
811
- { root, fromKey, toKey, gitClient: client, sourceIndex: await sourceIndex() }
411
+ {
412
+ root,
413
+ fromKey,
414
+ toKey,
415
+ gitClient: client,
416
+ sourceIndex: await sourceIndex(),
417
+ checkouts: await checkouts()
418
+ }
812
419
  ) : { content: meta.content, rewritten: [], skipped: [] };
813
420
  const rewritten = [
814
421
  ...meta.rewritten.map((r) => ({ kind: "metadata", ...r })),
@@ -935,9 +542,8 @@ async function runKeySet(opts) {
935
542
  }
936
543
 
937
544
  export {
938
- cite_exports,
939
545
  KeyError,
940
546
  runKeyRotate,
941
547
  runKeySet
942
548
  };
943
- //# sourceMappingURL=chunk-GQQ2AX63.js.map
549
+ //# sourceMappingURL=chunk-2QZCPPVE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/key/errors.ts","../src/key/commands/rotate.ts","../src/key/core/config.ts","../src/key/commands/set.ts"],"sourcesContent":["import { ToolError } from \"../shared/errors.js\";\n\n/** An operational or usage error in the key domain: exit 2. */\nexport class KeyError extends ToolError {\n constructor(message: string) {\n super(message);\n this.name = \"KeyError\";\n }\n}\n","/**\n * `manni key rotate [paths...]`: re-encrypt every encrypted value under a new\n * key, then write the key (proposal 0045).\n *\n * Values are found by their ciphertext, never through schema marks: meta's\n * `reencryptMetadata` takes every string of the ciphertext shape in a page's\n * metadata, and cite's `reencryptCitations` every encrypted `source.file` with its\n * keyed pin. A value already under the new key counts as done, so a run can\n * always be repeated.\n *\n * A value does not have to sit in a page. An external-metadata manifest\n * (proposal 0037) holds the private half of the same documents, which is\n * where an encrypted value most often lives, so the local manifests of the\n * collections a run covers are re-encrypted with the pages. See\n * `planManifests`.\n *\n * Input resolution is `cite check`'s: positional paths from `cwd`, else the\n * selected collections' `paths:` from the config's directory, `--exclude`\n * added to a collection's own `exclude:`, and zero files an error unless\n * `--allow-empty`.\n *\n * Every page and manifest is re-encrypted in memory first. One skip and\n * nothing is written (exit 1). Otherwise a whole run whose key comes from the\n * config writes in three steps, so that an interruption at any point leaves\n * every value readable by the next run:\n *\n * 1. the config: `encryptionKey:` the new key, `encryptionKeyPrevious:` the\n * old one, in one atomic write;\n * 2. the pages, then the manifests;\n * 3. the config again, without `encryptionKeyPrevious:`.\n *\n * A run that finds `encryptionKeyPrevious:` finishes that rotation: from the\n * previous key to the current one. A narrowed run (paths or `--collection`)\n * and a run whose key comes from `MANNI_ENCRYPTION_KEY` write pages and\n * manifests and never the config. `--dry-run` writes nothing at all.\n */\nimport { existsSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { isAbsolute, join, relative, resolve, sep } from \"node:path\";\nimport { parse as parseYaml } from \"yaml\";\nimport {\n DEFAULT_CITE_BASELINE_PATH,\n GIT_UNAVAILABLE_HISTORY,\n ManifestSet,\n buildSourceIndex,\n checkoutResolver,\n gitClient,\n loadCitationSidecars,\n parseCiteConfig,\n readPage,\n sourceRange,\n reencryptCitationEntries,\n reencryptCitations,\n type CiteConfig,\n type CheckoutResolver,\n type CitationSidecars,\n type GitClient,\n type ReencryptCitationsResult,\n type SourceIndex,\n} from \"../../cite/index.js\";\nimport {\n PATH_JOIN,\n classifyRef,\n externalMetadataJoin,\n loadExternalMetadata,\n reencryptMetadata,\n supportedExtensions,\n writeFileAtomic,\n type ExternalMetadataEntry,\n type ExternalMetadataIndex,\n type ExternalMetadataValue,\n} from \"../../meta/index.js\";\nimport {\n STDIN_TOKEN,\n assertNonEmpty,\n configMarks,\n extractorByName,\n gitignoreOptions,\n reencryptData,\n resolveTargetSet,\n spliceManifestValue,\n} from \"../../meta/internal.js\";\nimport { isMember, selectCollections, type CollectionConfig } from \"../../shared/collections.js\";\nimport type { ConfigFile } from \"../../shared/config-file.js\";\nimport { resolveEncryptionKey, writeEncryptionKey } from \"../../shared/encryption-key.js\";\nimport { generateEncryptionKey, isValidEncryptionKey } from \"../../shared/encryption.js\";\nimport { findGitRoot } from \"../../shared/git-root.js\";\nimport {\n findPageManifests,\n hasPagePlaceholder,\n pageManifestPath,\n} from \"../../shared/page-manifest.js\";\nimport { readRotateConfig, toKeyError, unfinishedRotation } from \"../core/config.js\";\nimport { KeyError } from \"../errors.js\";\nimport type {\n KeyRotateOptions,\n KeyRotateResult,\n RotateManifest,\n RotateOutcome,\n RotatePage,\n RotatedValue,\n SkippedValue,\n} from \"../types.js\";\n\nconst BAD_TO = \"--to must be at least 32 hex or base64url characters.\";\nconst NO_STDIN =\n \"key rotate reads and writes files, so it takes no stdin (`-`). Name the files instead.\";\nconst WITH_PATHS =\n \"--collection selects a configured collection; it cannot be combined with paths.\";\nconst NEEDS_CONFIG = \"--collection needs a config file to select from.\";\nconst NO_KEY =\n \"No encryption key is available, so nothing can be re-encrypted. Run `manni key set` first.\";\nconst ENV_NEEDS_TO =\n \"The key comes from MANNI_ENCRYPTION_KEY; pass --to <value>, re-encrypt with it, then update the secret. Nothing is written to config.\";\nconst NARROWED_NEEDS_TO = \"A run over part of the family needs --to, and never writes the key.\";\nconst NO_FILES =\n \"No files to re-encrypt. Pass paths/globs, or declare a collection under `collections:` in manni.config.yaml.\";\n\n/**\n * Any ciphertext at all. A page without one has nothing to rotate, so it costs\n * no parse; with one, the page is parsed and the tag decides.\n */\nconst ANY_CIPHERTEXT = /~[A-Za-z0-9_-]{82,}/;\n\n/** The `cite:` section of the file, for `root:`, `repos:` and `baseline:`; `{}` without one. */\nfunction citeSection(file: ConfigFile | null): CiteConfig {\n if (file === null) return {};\n const doc: unknown = parseYaml(file.text);\n if (typeof doc !== \"object\" || doc === null || !(\"cite\" in doc)) return {};\n return parseCiteConfig(doc.cite, file.source);\n}\n\n/**\n * Where cited sources resolve from, as `cite` resolves it: `--root` (cwd\n * relative) > `cite.root` (config relative) > the git root > `cwd`.\n */\nfunction rootFor(\n flag: string | undefined,\n cite: CiteConfig,\n file: ConfigFile | null,\n cwd: string,\n): { root: string; fellBack: boolean } {\n if (flag !== undefined) return { root: resolve(cwd, flag), fellBack: false };\n if (file !== null && cite.root !== undefined) {\n return { root: resolve(file.dir, cite.root), fellBack: false };\n }\n const gitRoot = findGitRoot(cwd);\n return gitRoot === null ? { root: cwd, fellBack: true } : { root: gitRoot, fellBack: false };\n}\n\n/**\n * The checkouts an entry's `source.repo` may name, as `cite` resolves them:\n * `cite.repos` from the config's directory, then `--repo` from `cwd`, the\n * flag winning per name.\n */\nfunction reposFor(\n flags: Readonly<Record<string, string>> | undefined,\n cite: CiteConfig,\n file: ConfigFile | null,\n cwd: string,\n): Record<string, string> {\n const repos: Record<string, string> = {};\n // `cite` is `{}` without a file, so a config repo always has a directory to sit beside.\n if (file !== null) for (const [name, dir] of Object.entries(cite.repos ?? {})) repos[name] = resolve(file.dir, dir);\n for (const [name, dir] of Object.entries(flags ?? {})) repos[name] = resolve(cwd, dir);\n return repos;\n}\n\nfunction isEnoent(error: unknown): boolean {\n return typeof error === \"object\" && error !== null && \"code\" in error && error.code === \"ENOENT\";\n}\n\nasync function indexFor(root: string, client: GitClient): Promise<SourceIndex> {\n try {\n return await buildSourceIndex(root, { gitClient: client });\n } catch (error) {\n if (isEnoent(error)) throw new KeyError(`Root directory not found: ${root}. Fix --root, or cite.root in manni.config.yaml.`);\n throw error;\n }\n}\n\n/**\n * The page's encrypted citations, the only ones a rotation reads sources\n * for: whether it has any, and whether one carries a commit (its own or the\n * page's), which is when history would be read.\n */\nfunction encryptedCitations(\n file: string,\n content: string,\n format: string | undefined,\n): { any: boolean; withCommit: boolean } {\n const read = readPage(file, content, format === undefined ? undefined : { format });\n const encrypted = read.citations.filter(({ citation }) => sourceRange(citation.source).encrypted);\n return {\n any: encrypted.length > 0,\n withCommit: encrypted.some(({ citation }) => citation.source[\"commit-sha\"] !== undefined),\n };\n}\n\ninterface Planned {\n page: RotatePage;\n path: string;\n content: string;\n changed: boolean;\n}\n\n/**\n * The citations of one page that a manifest owns (proposal 0044). They are\n * re-encrypted exactly as a page's own are — a citation counts as done only\n * when its `source.file` decrypts under the new key *and* its pin holds —\n * and written back as one value per page, each manifest written once.\n *\n * Kept in its own function, and reached from one place in the loop below, so\n * nothing about how *meta* values are rotated changes.\n */\nasync function rotateManifestCitations(\n sidecars: CitationSidecars | null,\n manifests: ManifestSet,\n page: { file: string; content: string; format?: string },\n opts: {\n root: string;\n fromKey: string;\n toKey: string;\n gitClient: GitClient;\n sourceIndex: () => Promise<SourceIndex>;\n checkouts: () => Promise<CheckoutResolver>;\n },\n): Promise<{ rewritten: RotatedValue[]; skipped: SkippedValue[]; wantsHistory: boolean }> {\n const none = { rewritten: [], skipped: [], wantsHistory: false };\n if (sidecars === null) return none;\n const sidecar = await sidecars.forPage(page.file, page.content, page.format);\n const owner = sidecar.owner;\n if (owner === undefined || sidecar.citations === undefined) return none;\n // Only a manifest entry that actually holds a ciphertext costs an index.\n if (!sidecar.citations.some((input) => ANY_CIPHERTEXT.test(JSON.stringify(input.entry)))) {\n return none;\n }\n const result = await reencryptCitationEntries(\n { ...page, citations: sidecar.citations },\n {\n root: opts.root,\n fromKey: opts.fromKey,\n toKey: opts.toKey,\n gitClient: opts.gitClient,\n sourceIndex: await opts.sourceIndex(),\n checkouts: await opts.checkouts(),\n },\n );\n if (result.changed && sidecar.entry !== undefined) {\n await manifests.write(owner, sidecar.entry, result.entries, 0);\n }\n return {\n rewritten: result.rewritten.map((r) => ({ kind: \"citation\" as const, ...r })),\n skipped: result.skipped.map((s) => ({ kind: \"citation\" as const, ...s })),\n // A pin that no longer holds is re-keyed from the lines at its commit.\n wantsHistory: sidecar.citations.some((input) =>\n /\"commit-sha\"\\s*:/.test(JSON.stringify(input.entry)),\n ),\n };\n}\n\ninterface PlannedManifest {\n manifest: RotateManifest;\n path: string;\n /** The manifest's text, with every rewritten value spliced into it. */\n text: string;\n changed: boolean;\n}\n\n/** How a run spells a manifest: relative to its base, like every file label. */\nfunction reportedPath(abs: string, base: string): string {\n const rel = relative(base, abs);\n return rel === \"\" ? \".\" : rel.split(sep).join(\"/\");\n}\n\n/**\n * The collections whose manifests this run covers. A run over every\n * collection, and one narrowed by `--collection`, covers the collections it\n * selected. A run over positional paths covers the collections those files\n * belong to, so the private half of a page a run re-encrypts moves with it.\n */\nfunction manifestCollections(\n collections: readonly CollectionConfig[],\n opts: {\n fromCollections: boolean;\n files: readonly string[];\n base: string;\n configDir: string;\n },\n): CollectionConfig[] {\n if (opts.fromCollections) return [...collections];\n const rels = opts.files.map((rel) =>\n reportedPath(resolve(opts.base, rel), opts.configDir),\n );\n return collections.filter((c) => rels.some((rel) => isMember(c, rel)));\n}\n\n/** The owned values one manifest entry supplies, or an empty map. */\nfunction valuesOf(\n index: ExternalMetadataIndex,\n entry: ExternalMetadataEntry,\n): ReadonlyMap<string, ExternalMetadataValue> {\n const empty = new Map<string, ExternalMetadataValue>();\n if (entry.join === PATH_JOIN) {\n return entry.abs === undefined ? empty : (index.byPath.get(entry.abs) ?? empty);\n }\n return index.byField.get(entry.join)?.get(entry.spelled) ?? empty;\n}\n\n/**\n * Re-encrypt the metadata values that live in the selected collections' local\n * manifests (proposals 0037, 0039 and 0041).\n *\n * A manifest is private by construction, so it is where an encrypted value is\n * most likely to sit. Rotation would otherwise leave it under the old key and\n * `meta validate` would report `encrypted:unreadable` on every page the\n * manifest feeds.\n *\n * Two things are left alone. A URL manifest is somebody else's file and\n * read-only (0038), so it is never loaded, and a rotation reaches no network.\n * The `citations` key is cite's: it re-keys a citation's source together with\n * its pin, under its own context, and re-encrypting the source alone would\n * break the pin. `reencryptData` skips it for the same reason\n * `reencryptMetadata` does on a page.\n *\n * Text in, text out. Each value is spliced into the manifest by\n * `spliceManifestValue`, which replaces that value's range and keeps every\n * other byte: the comments, the key order, the quoting and the line endings.\n * Nothing is written here; the caller writes when every value could be\n * re-encrypted.\n */\nasync function planManifests(opts: {\n collections: readonly CollectionConfig[];\n configDir: string;\n base: string;\n fromKey: string;\n toKey: string;\n /** The run's pages, as absolute paths, which a `{page}` manifest (0058) is read for. */\n pages: readonly string[];\n /** A run over the whole family: no paths and no `--collection`. */\n whole: boolean;\n}): Promise<PlannedManifest[]> {\n const local = opts.collections\n .map((c) => ({\n ...c,\n externalMetadata: c.externalMetadata.filter(\n (m) => classifyRef(m.file).kind !== \"url\",\n ),\n }))\n .filter((c) => c.externalMetadata.length > 0);\n if (local.length === 0) return [];\n\n // A `{page}` entry (proposal 0058) is one manifest per page, so its files\n // are enumerated rather than named: each page of the run resolves its own,\n // and a whole run adds every file the pattern's glob finds, so a manifest\n // whose page is gone is re-encrypted too (0058 stress test 12). The pages\n // those files name are handed to the loader like the run's own.\n const pages = new Set(opts.pages);\n if (opts.whole) {\n for (const c of local) {\n for (const m of c.externalMetadata) {\n if (!hasPagePlaceholder(m.file)) continue;\n for (const found of findPageManifests(m.file, opts.configDir, (rel) => isMember(c, rel))) {\n for (const entry of found.entries) pages.add(entry.pageAbs);\n }\n }\n }\n }\n\n const index = await loadExternalMetadata(local, {\n configDir: opts.configDir,\n base: opts.base,\n pages: [...pages],\n });\n if (index === null) return [];\n\n // One plan per manifest file, so a manifest two collections declare is read\n // once and spliced once. Its reported path and collection identify it the\n // way `index.entries` does. A plan is made when an entry first names its\n // file, and only a plan with a value to report is kept.\n const plans = new Map<string, PlannedManifest>();\n const located = new Map<string, { abs: string; collection: string }>();\n const locate = (collection: string, abs: string, join: string): void => {\n located.set(`${collection}\\u0000${reportedPath(abs, opts.base)}\\u0000${join}`, { abs, collection });\n };\n for (const c of local) {\n for (const m of c.externalMetadata) {\n const join = externalMetadataJoin(m);\n if (!hasPagePlaceholder(m.file)) {\n locate(c.name, isAbsolute(m.file) ? m.file : resolve(opts.configDir, m.file), join);\n continue;\n }\n for (const page of pages) {\n const resolved = pageManifestPath(m.file, opts.configDir, page);\n if (!(\"outside\" in resolved)) locate(c.name, resolved.abs, join);\n }\n }\n }\n const planFor = async (key: string): Promise<PlannedManifest | undefined> => {\n const where = located.get(key);\n if (where === undefined) return undefined;\n const known = plans.get(where.abs);\n if (known !== undefined) return known;\n const plan: PlannedManifest = {\n manifest: {\n file: reportedPath(where.abs, opts.base),\n collection: where.collection,\n rewritten: [],\n skipped: [],\n written: false,\n },\n path: where.abs,\n text: await readFile(where.abs, \"utf8\"),\n changed: false,\n };\n plans.set(where.abs, plan);\n return plan;\n };\n\n for (const entry of index.entries) {\n const plan = await planFor(`${entry.collection}\\u0000${entry.file}\\u0000${entry.join}`);\n if (plan === undefined) continue;\n const data: Record<string, unknown> = {};\n for (const [key, supplied] of valuesOf(index, entry)) {\n if (supplied.file === entry.file && supplied.collection === entry.collection) {\n data[key] = supplied.value;\n }\n }\n const done = reencryptData(data, { fromKey: opts.fromKey, toKey: opts.toKey });\n for (const r of done.rewritten) {\n plan.manifest.rewritten.push({ entry: entry.spelled, ...r });\n }\n for (const s of done.skipped) {\n plan.manifest.skipped.push({ entry: entry.spelled, ...s });\n }\n for (const key of done.keys) {\n plan.text = spliceManifestValue(plan.text, {\n entry: entry.spelled,\n key,\n value: done.data[key],\n join: entry.join,\n file: plan.manifest.file,\n }).text;\n plan.changed = true;\n }\n }\n\n return [...plans.values()].filter(\n (p) => p.manifest.rewritten.length > 0 || p.manifest.skipped.length > 0,\n );\n}\n\nexport async function runKeyRotate(opts: KeyRotateOptions): Promise<KeyRotateResult> {\n const cwd = resolve(opts.cwd ?? process.cwd());\n const env = opts.env ?? process.env;\n if (opts.to !== undefined && !isValidEncryptionKey(opts.to)) throw new KeyError(BAD_TO);\n if (opts.inputs.includes(STDIN_TOKEN)) throw new KeyError(NO_STDIN);\n const wanted = opts.collection ?? [];\n if (wanted.length > 0 && opts.inputs.length > 0) throw new KeyError(WITH_PATHS);\n\n const file = await readRotateConfig(opts.configPath, cwd);\n if (wanted.length > 0 && file === null) throw new KeyError(NEEDS_CONFIG);\n const { key: current, source: keySource } = resolveEncryptionKey({\n env,\n file,\n toError: toKeyError,\n });\n if (current === undefined) throw new KeyError(NO_KEY);\n const narrowed = opts.inputs.length > 0 || wanted.length > 0;\n\n // Only a key from the config has a config a rotation can be finished in.\n const keyFile = keySource === \"config\" ? file : null;\n const previous = keyFile?.encryptionKeyPrevious;\n if (\n keyFile !== null &&\n previous !== undefined &&\n (narrowed || (opts.to !== undefined && opts.to !== current))\n ) {\n throw new KeyError(unfinishedRotation(keyFile.source));\n }\n if (keySource === \"env\" && opts.to === undefined) throw new KeyError(ENV_NEEDS_TO);\n if (narrowed && opts.to === undefined) throw new KeyError(NARROWED_NEEDS_TO);\n\n // Finishing an interrupted rotation goes from the key it replaced to the one\n // the config already holds; otherwise from the current key to the new one.\n const fromKey = previous ?? current;\n const toKey = previous === undefined ? (opts.to ?? generateEncryptionKey()) : current;\n\n const collections =\n file === null ? [] : selectCollections(file.collections, wanted, file.source, toKeyError);\n const fromCollections = opts.inputs.length === 0;\n const inputs = fromCollections ? collections.flatMap((c) => c.paths) : opts.inputs;\n if (inputs.length === 0) throw new KeyError(NO_FILES);\n // One base per run, as in cite and meta: typed paths from cwd, a\n // collection's `paths:` from the config's directory.\n const base = fromCollections && file !== null ? file.dir : cwd;\n\n const forced = opts.as === undefined ? undefined : extractorByName(opts.as);\n if (opts.as !== undefined && forced === undefined) {\n throw new KeyError(\n `Unknown format \"${opts.as}\". Supported extensions: ${supportedExtensions().join(\", \")}.`,\n );\n }\n const format = forced?.name;\n const exts = opts.exts ?? forced?.extensions;\n const exclude = [\n ...new Set([\n ...(opts.exclude ?? []),\n ...(fromCollections ? collections.flatMap((c) => c.exclude) : []),\n ]),\n ];\n const { files, gitignoreSkipped } = await resolveTargetSet({\n inputs,\n exts,\n exclude,\n cwd: base,\n allowEmpty: opts.allowEmpty,\n ...gitignoreOptions({ flag: opts.respectGitignore, onNotice: opts.onNotice }),\n });\n assertNonEmpty({\n files,\n inputs,\n usingStdin: false,\n allowEmpty: opts.allowEmpty,\n exclude,\n exts,\n gitignoreSkipped,\n action: \"re-encrypted\",\n });\n\n const cite = citeSection(file);\n const { root, fellBack } = rootFor(opts.root, cite, file, cwd);\n const client = opts.gitClient ?? gitClient(root);\n // Built once, and only when a page cites an encrypted source.\n let index: Promise<SourceIndex> | undefined;\n const sourceIndex = (): Promise<SourceIndex> => {\n if (index === undefined) {\n if (fellBack) opts.onNotice?.(`No git root found; resolving src: paths from ${cwd}`);\n index = indexFor(root, client);\n }\n return index;\n };\n // The root's checkout and the declared ones, opened as an entry names them.\n const repos = reposFor(opts.repos, cite, file, cwd);\n let resolver: Promise<CheckoutResolver> | undefined;\n const checkouts = (): Promise<CheckoutResolver> =>\n (resolver ??= sourceIndex().then((rootIndex) =>\n checkoutResolver({ root, index: rootIndex, git: client }, repos),\n ));\n\n // The manifests that own `citations` (proposal 0044): a page whose entries\n // live in one carries no ciphertext of its own, so they are read for every\n // page of the run, not only the ones the shortcut below lets through.\n const sidecars =\n file === null\n ? null\n : await loadCitationSidecars({\n collections: file.collections,\n configDir: file.dir,\n base,\n configSource: file.source,\n key: current,\n toError: toKeyError,\n // A keyless manifest (proposal 0068) keeps what a page's schemas mark.\n marks: () => configMarks(file.path, file.dir),\n // A `{page}` manifest (0058) is read for exactly the pages rotated.\n pages: files.map((rel) => resolve(base, rel)),\n });\n const manifests = new ManifestSet();\n\n const planned: Planned[] = [];\n let wantsHistory = false;\n for (const rel of files) {\n const path = resolve(base, rel);\n const before = await readFile(path, \"utf8\");\n const page = { file: rel, content: before, ...(format === undefined ? {} : { format }) };\n // A page's own values first, then the entries its manifest holds.\n const sidecarWork = await rotateManifestCitations(sidecars, manifests, page, {\n root,\n fromKey,\n toKey,\n gitClient: client,\n sourceIndex,\n checkouts,\n });\n if (sidecarWork.wantsHistory) wantsHistory = true;\n if (!ANY_CIPHERTEXT.test(before)) {\n if (sidecarWork.rewritten.length === 0 && sidecarWork.skipped.length === 0) continue;\n planned.push({\n page: { file: rel, rewritten: sidecarWork.rewritten, skipped: sidecarWork.skipped, written: false },\n path,\n content: before,\n changed: false,\n });\n continue;\n }\n const meta = reencryptMetadata(page, { fromKey, toKey });\n const encrypted = encryptedCitations(rel, meta.content, format);\n if (encrypted.withCommit) wantsHistory = true;\n const cited: ReencryptCitationsResult = encrypted.any\n ? await reencryptCitations(\n { ...page, content: meta.content },\n {\n root,\n fromKey,\n toKey,\n gitClient: client,\n sourceIndex: await sourceIndex(),\n checkouts: await checkouts(),\n },\n )\n : { content: meta.content, rewritten: [], skipped: [] };\n const rewritten: RotatedValue[] = [\n ...meta.rewritten.map((r) => ({ kind: \"metadata\" as const, ...r })),\n ...cited.rewritten.map((r) => ({ kind: \"citation\" as const, ...r })),\n ...sidecarWork.rewritten,\n ];\n const skipped: SkippedValue[] = [\n ...meta.skipped.map((s) => ({ kind: \"metadata\" as const, ...s })),\n ...cited.skipped.map((s) => ({ kind: \"citation\" as const, ...s })),\n ...sidecarWork.skipped,\n ];\n if (rewritten.length === 0 && skipped.length === 0) continue;\n planned.push({\n page: { file: rel, rewritten, skipped, written: false },\n path,\n content: cited.content,\n changed: cited.content !== before,\n });\n }\n\n // A pin that no longer holds is re-keyed from the lines at its commit, so a\n // citation with one wants git. Where git is not there, said once.\n if (wantsHistory && !(await client.available())) opts.onNotice?.(GIT_UNAVAILABLE_HISTORY);\n\n // The private half of the same documents: every local manifest of the\n // collections this run covers. Planned in memory like the pages, and\n // counted with them, so one unreadable value anywhere stops the whole run.\n const valueManifests =\n file === null\n ? []\n : await planManifests({\n collections: manifestCollections(collections, {\n fromCollections,\n files,\n base,\n configDir: file.dir,\n }),\n configDir: file.dir,\n base,\n fromKey,\n toKey,\n pages: files.map((rel) => resolve(base, rel)),\n whole: !narrowed,\n });\n\n const reencrypted =\n planned.reduce((n, p) => n + p.page.rewritten.length, 0) +\n valueManifests.reduce((n, m) => n + m.manifest.rewritten.length, 0);\n const skipped =\n planned.reduce((n, p) => n + p.page.skipped.length, 0) +\n valueManifests.reduce((n, m) => n + m.manifest.skipped.length, 0);\n const writePage = opts.writePage ?? ((path: string, content: string) => writeFileAtomic(path, content));\n\n let outcome: RotateOutcome;\n if (skipped > 0) {\n // The new key is never written beside a value it cannot decrypt, and no\n // page is written without the key: nothing at all.\n outcome = \"skipped\";\n } else if (opts.dryRun === true) {\n outcome = \"dry-run\";\n } else {\n const writesKey = !narrowed && keyFile !== null;\n // (1) The new key, with the old one beside it. A rotation being finished\n // already has both.\n if (!narrowed && keyFile !== null && previous === undefined) {\n await writeEncryptionKey({ file: keyFile, key: toKey, previous: fromKey, cwd, toError: toKeyError });\n }\n // (2) The pages, then the manifests: the citations one owns, and the\n // encrypted values another holds. Each manifest is written once,\n // however many pages it keeps entries for.\n for (const p of planned) {\n if (!p.changed) continue;\n await writePage(p.path, p.content);\n p.page.written = true;\n }\n for (const changed of manifests.changed()) await writePage(changed.path, changed.text);\n for (const m of valueManifests) {\n if (!m.changed) continue;\n await writePage(m.path, m.text);\n m.manifest.written = true;\n }\n // (3) The old key goes, now that nothing is under it.\n if (!narrowed && keyFile !== null) {\n await writeEncryptionKey({ file: keyFile, key: toKey, previous: null, cwd, toError: toKeyError });\n }\n if (narrowed) outcome = \"narrowed\";\n else if (!writesKey) outcome = \"env\";\n else outcome = previous === undefined ? \"written\" : \"finished\";\n }\n\n const wrote = outcome !== \"skipped\" && outcome !== \"dry-run\";\n const baseline =\n file !== null && cite.baseline !== undefined\n ? resolve(file.dir, cite.baseline)\n : join(file?.dir ?? cwd, DEFAULT_CITE_BASELINE_PATH);\n\n return {\n pages: planned.map((p) => p.page),\n manifests: valueManifests.map((m) => m.manifest),\n reencrypted,\n skipped,\n keyWritten: outcome === \"written\" || outcome === \"finished\",\n outcome,\n ...(keyFile === null ? {} : { configSource: keyFile.source }),\n baselineStale: wrote && existsSync(baseline),\n exitCode: skipped > 0 ? 1 : 0,\n };\n}\n","/**\n * Which config file `manni key` reads and writes. `key` has no section of its\n * own (proposal 0045): the key it manages sits at the top of the family file,\n * beside `collections:`.\n *\n * - `set` writes the nearest family file whatever it carries, or the one `-c`\n * names, read as a family file (`findFamilyConfigFile`,\n * `readFamilyConfigFile`).\n * - `rotate` reads its key and collections from the file every sibling\n * without a section there would read them from: the nearest family file\n * carrying `collections:` or `encryptionKey:`. That is discovery with a\n * section name nothing uses.\n */\nimport {\n findConfigFile,\n findFamilyConfigFile,\n readConfigFile,\n readFamilyConfigFile,\n type ConfigFile,\n type ConfigFileOptions,\n} from \"../../shared/config-file.js\";\nimport { KeyError } from \"../errors.js\";\n\nexport const toKeyError = (message: string): KeyError => new KeyError(message);\n\nconst KEY_CONFIG: ConfigFileOptions = {\n section: \"key\",\n // The key never had a file of its own.\n legacyNames: [],\n toError: toKeyError,\n};\n\n/** The config `rotate` reads the current key and the collections from. */\nexport function readRotateConfig(\n configPath: string | undefined,\n cwd: string,\n): Promise<ConfigFile | null> {\n return configPath === undefined\n ? findConfigFile(cwd, KEY_CONFIG)\n : readConfigFile(configPath, cwd, KEY_CONFIG);\n}\n\n/** The config `set` writes to; `null` when discovery finds no family file. */\nexport function readSetConfig(\n configPath: string | undefined,\n cwd: string,\n): Promise<ConfigFile | null> {\n return configPath === undefined\n ? findFamilyConfigFile(cwd, toKeyError)\n : readFamilyConfigFile(configPath, cwd, toKeyError);\n}\n\n/** The refusal while `encryptionKeyPrevious:` says a rotation is unfinished. */\nexport const unfinishedRotation = (source: string): string =>\n `A rotation is unfinished in ${source}. Run \\`manni key rotate\\` with no --to to finish it.`;\n","/**\n * `manni key set [value]`: write the family encryption key (proposal 0045).\n *\n * Refusals, each exit 2 and none echoing a value: a value of the wrong shape;\n * `MANNI_ENCRYPTION_KEY` set, because it wins and the written key would never\n * be read; a rotation left unfinished; a key already configured, because\n * replacing one in place strands every value encrypted under it (`rotate` is\n * what replaces a key); and a new `manni.config.yaml` beside a legacy\n * `docmeta.config.yaml`, which the new file would hide from `manni meta`.\n *\n * It warns, and still writes, when git would publish the file.\n */\nimport { existsSync } from \"node:fs\";\nimport { basename, dirname, join, relative, resolve } from \"node:path\";\nimport { LEGACY_CONFIG_NAMES } from \"../../meta/internal.js\";\nimport {\n ENCRYPTION_KEY_ENV,\n committedKeyWarning,\n isIgnoredByGit,\n writeEncryptionKey,\n} from \"../../shared/encryption-key.js\";\nimport { generateEncryptionKey, isValidEncryptionKey } from \"../../shared/encryption.js\";\nimport { readSetConfig, toKeyError, unfinishedRotation } from \"../core/config.js\";\nimport { KeyError } from \"../errors.js\";\nimport type { KeySetOptions, KeySetResult } from \"../types.js\";\n\nconst BAD_VALUE =\n \"The key must be at least 32 hex or base64url characters. Run `manni key set` with no value to generate one.\";\nconst ENV_SET = `${ENCRYPTION_KEY_ENV} is set, so a key written to config would never be read. Unset it, or keep the key in the secret.`;\n\nconst alreadyConfigured = (source: string): string =>\n `An encryption key is already configured in ${source}. Run \\`manni key rotate\\` to replace it and re-encrypt every value.`;\n\n/**\n * A new family file beside a legacy per-tool file hides it: discovery reads\n * the family file first in a directory, and one holding only a key is every\n * tool's config, so `manni meta` would stop reading the options it had.\n */\nfunction refuseBesideLegacy(path: string, cwd: string): void {\n const dir = dirname(path);\n const name = basename(path);\n for (const legacy of LEGACY_CONFIG_NAMES) {\n const found = join(dir, legacy);\n if (!existsSync(found)) continue;\n const source = relative(cwd, found).replace(/\\\\/g, \"/\");\n throw new KeyError(\n `${source} is a single-tool config; a ${name} beside it would hide it. Move its keys under meta: in ${name} first.`,\n );\n }\n}\n\nexport async function runKeySet(opts: KeySetOptions): Promise<KeySetResult> {\n const cwd = resolve(opts.cwd ?? process.cwd());\n const env = opts.env ?? process.env;\n if (opts.value !== undefined && !isValidEncryptionKey(opts.value)) {\n throw new KeyError(BAD_VALUE);\n }\n // Empty counts as unset, as `resolveEncryptionKey` has it.\n const fromEnv = env[ENCRYPTION_KEY_ENV];\n if (fromEnv !== undefined && fromEnv !== \"\") throw new KeyError(ENV_SET);\n\n const file = await readSetConfig(opts.configPath, cwd);\n if (file?.encryptionKeyPrevious !== undefined) {\n throw new KeyError(unfinishedRotation(file.source));\n }\n if (file?.encryptionKey !== undefined) {\n throw new KeyError(alreadyConfigured(file.source));\n }\n\n const generated = opts.value === undefined;\n const key = opts.value ?? generateEncryptionKey();\n const dryRun = opts.dryRun === true;\n // Name the target before writing to it: the legacy check and the git\n // warning are both about the file the key is about to land in.\n const target = await writeEncryptionKey({ file, key, cwd, toError: toKeyError, dryRun: true });\n if (target.created) refuseBesideLegacy(target.path, cwd);\n if (isIgnoredByGit(target.path) === false) {\n opts.onNotice?.(committedKeyWarning(target.source));\n }\n if (!dryRun) await writeEncryptionKey({ file, key, cwd, toError: toKeyError });\n return { path: target.path, source: target.source, created: target.created, generated, dryRun };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAM,WAAN,cAAuB,UAAU;AAAA,EACtC,YAAY,SAAiB;AAC3B,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;;;AC4BA,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,YAAY,MAAM,UAAU,SAAS,WAAW;AACzD,SAAS,SAAS,iBAAiB;;;AChB5B,IAAM,aAAa,CAAC,YAA8B,IAAI,SAAS,OAAO;AAE7E,IAAM,aAAgC;AAAA,EACpC,SAAS;AAAA;AAAA,EAET,aAAa,CAAC;AAAA,EACd,SAAS;AACX;AAGO,SAAS,iBACd,YACA,KAC4B;AAC5B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ChC,MAAI,KAAK,UAAU,UAAa,CAAC,qBAAqB,KAAK,KAAK,GAAG;AACjE,UAAM,IAAI,SAAS,SAAS;AAAA,EAC9B;AAEA,QAAM,UAAU,IAAI,kBAAkB;AACtC,MAAI,YAAY,UAAa,YAAY,GAAI,OAAM,IAAI,SAAS,OAAO;AAEvE,QAAM,OAAO,MAAM,cAAc,KAAK,YAAY,GAAG;AACrD,MAAI,MAAM,0BAA0B,QAAW;AAC7C,UAAM,IAAI,SAAS,mBAAmB,KAAK,MAAM,CAAC;AAAA,EACpD;AACA,MAAI,MAAM,kBAAkB,QAAW;AACrC,UAAM,IAAI,SAAS,kBAAkB,KAAK,MAAM,CAAC;AAAA,EACnD;AAEA,QAAM,YAAY,KAAK,UAAU;AACjC,QAAM,MAAM,KAAK,SAAS,sBAAsB;AAChD,QAAM,SAAS,KAAK,WAAW;AAG/B,QAAM,SAAS,MAAM,mBAAmB,EAAE,MAAM,KAAK,KAAK,SAAS,YAAY,QAAQ,KAAK,CAAC;AAC7F,MAAI,OAAO,QAAS,oBAAmB,OAAO,MAAM,GAAG;AACvD,MAAI,eAAe,OAAO,IAAI,MAAM,OAAO;AACzC,SAAK,WAAW,oBAAoB,OAAO,MAAM,CAAC;AAAA,EACpD;AACA,MAAI,CAAC,OAAQ,OAAM,mBAAmB,EAAE,MAAM,KAAK,KAAK,SAAS,WAAW,CAAC;AAC7E,SAAO,EAAE,MAAM,OAAO,MAAM,QAAQ,OAAO,QAAQ,SAAS,OAAO,SAAS,WAAW,OAAO;AAChG;","names":["join","skipped","existsSync","join","relative","resolve","join","existsSync","relative","resolve"]}
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  resultFor,
4
4
  splitBaselined
5
- } from "./chunk-NDBISART.js";
5
+ } from "./chunk-5VA3ZOB7.js";
6
6
  import {
7
7
  errorSite
8
- } from "./chunk-2XRET3ZG.js";
8
+ } from "./chunk-JHUEACRT.js";
9
9
  import {
10
10
  escapeWorkflowCommandMessage,
11
11
  escapeWorkflowCommandProperty,
@@ -51,4 +51,4 @@ export {
51
51
  findingMessage,
52
52
  renderCheckGithub
53
53
  };
54
- //# sourceMappingURL=chunk-BMYCLTFK.js.map
54
+ //# sourceMappingURL=chunk-327CWO33.js.map