@hawkeyexl/manni 4.14.0 → 4.15.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.
- package/README.md +1 -1
- package/dist/{batch-TKNIUBLK.js → batch-OMDKRGUE.js} +13 -13
- package/dist/{build-6G7PEAG4.js → build-YCY5MUHA.js} +13 -13
- package/dist/{calibrate-BDCXDZV5.js → calibrate-RN2NJ4FS.js} +14 -14
- package/dist/{capture-NQJLZD66.js → capture-2WYROZKA.js} +13 -13
- package/dist/{check-BSB4FF4L.js → check-KRVWHF7E.js} +12 -12
- package/dist/{check-QIZCTAIR.js → check-LVUTWAGR.js} +14 -14
- package/dist/{check-552X5I2J.js → check-MR7IG7IP.js} +14 -14
- package/dist/{check-5HMDJOFP.js → check-OIRJ6OBW.js} +13 -13
- package/dist/{chunk-7PENJOI6.js → chunk-3CSEHHKB.js} +6 -6
- package/dist/{chunk-Y36PNW6J.js → chunk-3EJVJDMX.js} +6 -6
- package/dist/{chunk-V6OCE4ND.js → chunk-3WQMMLIO.js} +7 -7
- package/dist/{chunk-742G2QCV.js → chunk-46OWIAAX.js} +3 -3
- package/dist/{chunk-742G2QCV.js.map → chunk-46OWIAAX.js.map} +1 -1
- package/dist/{chunk-36FJWJSK.js → chunk-476DMDJ5.js} +2 -2
- package/dist/{chunk-7KOWE4F4.js → chunk-4MYW2D2U.js} +8 -8
- package/dist/{chunk-6XFSZCLT.js → chunk-525KMBZS.js} +4 -4
- package/dist/{chunk-ZRQUQS7P.js → chunk-57DHX65T.js} +3 -3
- package/dist/{chunk-PCE7QHXJ.js → chunk-5D24C6WM.js} +6 -1
- package/dist/chunk-5D24C6WM.js.map +1 -0
- package/dist/{chunk-QF7EIRMU.js → chunk-6DYFWAZA.js} +541 -343
- package/dist/chunk-6DYFWAZA.js.map +1 -0
- package/dist/{chunk-7WVWGULD.js → chunk-7EKXSSEO.js} +5 -5
- package/dist/{chunk-LCRBR7KW.js → chunk-7SVFBJBE.js} +2 -2
- package/dist/{chunk-Y37VJFX2.js → chunk-7XHW5DZA.js} +3 -3
- package/dist/{chunk-3MTZZJKH.js → chunk-AL4HRKSZ.js} +2 -2
- package/dist/{chunk-T3BBNLAT.js → chunk-C37OVJ35.js} +2 -2
- package/dist/{chunk-T3BBNLAT.js.map → chunk-C37OVJ35.js.map} +1 -1
- package/dist/{chunk-3BMTCS4H.js → chunk-CWGBRWP7.js} +3 -3
- package/dist/{chunk-7AXJY4FX.js → chunk-DN4LCWSA.js} +3 -3
- package/dist/{chunk-W5DO426O.js → chunk-DW22KCLN.js} +5 -6
- package/dist/chunk-DW22KCLN.js.map +1 -0
- package/dist/{chunk-BA4TCCOO.js → chunk-FEEO7ET6.js} +3 -3
- package/dist/{chunk-ZPLIXZZ6.js → chunk-FYWQS35G.js} +2 -2
- package/dist/{chunk-W6B24IMO.js → chunk-GLQCSDFS.js} +2 -2
- package/dist/{chunk-GHZAOPGK.js → chunk-GUTAKJIF.js} +4 -4
- package/dist/{chunk-AJYUJ37M.js → chunk-GZHBMMDC.js} +17 -10
- package/dist/chunk-GZHBMMDC.js.map +1 -0
- package/dist/{chunk-D2TIZOMN.js → chunk-IE5PXI6M.js} +3 -3
- package/dist/{chunk-2A6XYSXO.js → chunk-JHE3CYWS.js} +2 -2
- package/dist/{chunk-M534DYAJ.js → chunk-JQPZKWIP.js} +2 -2
- package/dist/{chunk-JTEWU4C6.js → chunk-JTATFPWB.js} +7 -6
- package/dist/chunk-JTATFPWB.js.map +1 -0
- package/dist/{chunk-M43NTWVH.js → chunk-JULE3EU3.js} +5 -5
- package/dist/{chunk-BAWKNF6U.js → chunk-KCXQXKOL.js} +2 -2
- package/dist/{chunk-A7MNH4YI.js → chunk-KN37BXVY.js} +7 -7
- package/dist/{chunk-CZJNYHK7.js → chunk-MAOX3524.js} +2 -2
- package/dist/{chunk-56URKBXQ.js → chunk-NIQ2JSZO.js} +23 -14
- package/dist/chunk-NIQ2JSZO.js.map +1 -0
- package/dist/{chunk-BIRGZEWO.js → chunk-OFOIBV5J.js} +2 -2
- package/dist/{chunk-VBBJGFME.js → chunk-Q2VOXKAQ.js} +4 -4
- package/dist/{chunk-6VT3Z352.js → chunk-Q62Q7CDI.js} +67 -4
- package/dist/chunk-Q62Q7CDI.js.map +1 -0
- package/dist/{chunk-2HQSMZ4N.js → chunk-QDO5JFFV.js} +2 -2
- package/dist/{chunk-JWBS7YDI.js → chunk-QEJ4GH25.js} +3 -3
- package/dist/{chunk-3CCY7M3R.js → chunk-QS3K57OJ.js} +4 -4
- package/dist/{chunk-YJ3EG2D5.js → chunk-RGRNAQG5.js} +3 -3
- package/dist/{chunk-USKTLEPZ.js → chunk-SLGCRXHM.js} +3 -3
- package/dist/{chunk-WIPTWZVH.js → chunk-SVF3WCC7.js} +5 -5
- package/dist/{chunk-66MKBRTA.js → chunk-T62SFCQY.js} +6 -6
- package/dist/{chunk-EXAZ7K25.js → chunk-TXZJESES.js} +2 -2
- package/dist/{chunk-4U3X7LYV.js → chunk-UPUJJOKB.js} +4 -4
- package/dist/{chunk-MIGFQP5N.js → chunk-URGALOZY.js} +2 -2
- package/dist/{chunk-QEZQ7MGH.js → chunk-UVLQRP6O.js} +4 -4
- package/dist/chunk-UVLQRP6O.js.map +1 -0
- package/dist/{chunk-IOYEPB27.js → chunk-Y3GWQBJP.js} +2 -2
- package/dist/{chunk-B6GUSA53.js → chunk-YT5HKJWV.js} +489 -15
- package/dist/chunk-YT5HKJWV.js.map +1 -0
- package/dist/{chunk-HGU4FDRY.js → chunk-Z6PZKXSP.js} +4 -4
- package/dist/{chunk-STM3G7WJ.js → chunk-ZC2MZZR5.js} +4 -4
- package/dist/{cli-XAT673VB.js → cli-33E3B2FK.js} +2 -2
- package/dist/{cli-SOA2E26G.js → cli-7JV4RM66.js} +14 -14
- package/dist/{cli-X6IWTDFK.js → cli-B4DTJ2KC.js} +20 -20
- package/dist/{cli-VQYB3663.js → cli-D4WXCDTS.js} +18 -18
- package/dist/{cli-BUV3DRUH.js → cli-DDLLZHZW.js} +79 -19
- package/dist/cli-DDLLZHZW.js.map +1 -0
- package/dist/{cli-5XKHMRZ5.js → cli-EVACAD7K.js} +16 -16
- package/dist/{cli-LOND37OA.js → cli-LIKI7WPR.js} +36 -36
- package/dist/{cli-O6Y2KVWD.js → cli-MWUFAS2X.js} +9 -9
- package/dist/{cli-7QHJW5GH.js → cli-OKPRTVG6.js} +2 -2
- package/dist/{cli-IKDX2I5X.js → cli-QEPVGLQ3.js} +15 -15
- package/dist/{cli-QTLOAVOY.js → cli-VP6JTPFS.js} +9 -9
- package/dist/cli.js +14 -14
- package/dist/docmeta.js +8 -8
- package/dist/{github-XM36D7ZH.js → github-DV57TW5L.js} +12 -12
- package/dist/{github-IPBOTQBN.js → github-SGX2EARO.js} +14 -14
- package/dist/index.d.ts +130 -25
- package/dist/index.js +38 -38
- package/dist/{json-7WV7KL6H.js → json-5EQCGVCV.js} +4 -2
- package/dist/{json-225TND7K.js → json-SHPUCD64.js} +12 -12
- package/dist/{labels-CTLHIRC4.js → labels-3GCGYYV3.js} +11 -11
- package/dist/{lint-NP3PC3SO.js → lint-RE4DMI6E.js} +12 -12
- package/dist/{list-JJGNKO6S.js → list-F56MEJXR.js} +12 -12
- package/dist/{list-Q457TIMA.js → list-ZR3KY556.js} +12 -12
- package/dist/{page-FJW7J2EU.js → page-G7XSO4FD.js} +11 -11
- package/dist/{prepare-RKJEKHAG.js → prepare-WHMWP7BG.js} +12 -12
- package/dist/{pretty-QFEN2SIA.js → pretty-VTJVXWRK.js} +12 -12
- package/dist/{pretty-ECBO3EVT.js → pretty-YVRRWBWN.js} +21 -15
- package/dist/{reporters-TDQDQHKE.js → reporters-FSXJ42EB.js} +2 -2
- package/dist/{reporters-WGLQKW2Y.js → reporters-G5R4SURQ.js} +4 -4
- package/dist/{reporters-IKKL5RHS.js → reporters-MHPY4HRA.js} +11 -11
- package/dist/{run-BTETGGLW.js → run-FSYOYEPR.js} +13 -13
- package/dist/{sarif-K4SMB563.js → sarif-HBQIDY7T.js} +10 -10
- package/dist/{sarif-ZHFK6PZY.js → sarif-RRUFJZUL.js} +15 -15
- package/dist/{term-2M7APX2A.js → term-ABHGACYE.js} +17 -17
- package/dist/{validate-GBM5STKS.js → validate-DXYUUGUD.js} +5 -5
- package/package.json +1 -1
- package/plugin/manni/.claude-plugin/plugin.json +1 -1
- package/dist/chunk-56URKBXQ.js.map +0 -1
- package/dist/chunk-6VT3Z352.js.map +0 -1
- package/dist/chunk-AJYUJ37M.js.map +0 -1
- package/dist/chunk-B6GUSA53.js.map +0 -1
- package/dist/chunk-JTEWU4C6.js.map +0 -1
- package/dist/chunk-PCE7QHXJ.js.map +0 -1
- package/dist/chunk-QEZQ7MGH.js.map +0 -1
- package/dist/chunk-QF7EIRMU.js.map +0 -1
- package/dist/chunk-W5DO426O.js.map +0 -1
- package/dist/cli-BUV3DRUH.js.map +0 -1
- /package/dist/{batch-TKNIUBLK.js.map → batch-OMDKRGUE.js.map} +0 -0
- /package/dist/{build-6G7PEAG4.js.map → build-YCY5MUHA.js.map} +0 -0
- /package/dist/{calibrate-BDCXDZV5.js.map → calibrate-RN2NJ4FS.js.map} +0 -0
- /package/dist/{capture-NQJLZD66.js.map → capture-2WYROZKA.js.map} +0 -0
- /package/dist/{check-552X5I2J.js.map → check-KRVWHF7E.js.map} +0 -0
- /package/dist/{check-QIZCTAIR.js.map → check-LVUTWAGR.js.map} +0 -0
- /package/dist/{check-5HMDJOFP.js.map → check-MR7IG7IP.js.map} +0 -0
- /package/dist/{check-BSB4FF4L.js.map → check-OIRJ6OBW.js.map} +0 -0
- /package/dist/{chunk-7PENJOI6.js.map → chunk-3CSEHHKB.js.map} +0 -0
- /package/dist/{chunk-Y36PNW6J.js.map → chunk-3EJVJDMX.js.map} +0 -0
- /package/dist/{chunk-V6OCE4ND.js.map → chunk-3WQMMLIO.js.map} +0 -0
- /package/dist/{chunk-36FJWJSK.js.map → chunk-476DMDJ5.js.map} +0 -0
- /package/dist/{chunk-7KOWE4F4.js.map → chunk-4MYW2D2U.js.map} +0 -0
- /package/dist/{chunk-6XFSZCLT.js.map → chunk-525KMBZS.js.map} +0 -0
- /package/dist/{chunk-ZRQUQS7P.js.map → chunk-57DHX65T.js.map} +0 -0
- /package/dist/{chunk-7WVWGULD.js.map → chunk-7EKXSSEO.js.map} +0 -0
- /package/dist/{chunk-LCRBR7KW.js.map → chunk-7SVFBJBE.js.map} +0 -0
- /package/dist/{chunk-Y37VJFX2.js.map → chunk-7XHW5DZA.js.map} +0 -0
- /package/dist/{chunk-3MTZZJKH.js.map → chunk-AL4HRKSZ.js.map} +0 -0
- /package/dist/{chunk-3BMTCS4H.js.map → chunk-CWGBRWP7.js.map} +0 -0
- /package/dist/{chunk-7AXJY4FX.js.map → chunk-DN4LCWSA.js.map} +0 -0
- /package/dist/{chunk-BA4TCCOO.js.map → chunk-FEEO7ET6.js.map} +0 -0
- /package/dist/{chunk-ZPLIXZZ6.js.map → chunk-FYWQS35G.js.map} +0 -0
- /package/dist/{chunk-W6B24IMO.js.map → chunk-GLQCSDFS.js.map} +0 -0
- /package/dist/{chunk-GHZAOPGK.js.map → chunk-GUTAKJIF.js.map} +0 -0
- /package/dist/{chunk-D2TIZOMN.js.map → chunk-IE5PXI6M.js.map} +0 -0
- /package/dist/{chunk-2A6XYSXO.js.map → chunk-JHE3CYWS.js.map} +0 -0
- /package/dist/{chunk-M534DYAJ.js.map → chunk-JQPZKWIP.js.map} +0 -0
- /package/dist/{chunk-M43NTWVH.js.map → chunk-JULE3EU3.js.map} +0 -0
- /package/dist/{chunk-BAWKNF6U.js.map → chunk-KCXQXKOL.js.map} +0 -0
- /package/dist/{chunk-A7MNH4YI.js.map → chunk-KN37BXVY.js.map} +0 -0
- /package/dist/{chunk-CZJNYHK7.js.map → chunk-MAOX3524.js.map} +0 -0
- /package/dist/{chunk-BIRGZEWO.js.map → chunk-OFOIBV5J.js.map} +0 -0
- /package/dist/{chunk-VBBJGFME.js.map → chunk-Q2VOXKAQ.js.map} +0 -0
- /package/dist/{chunk-2HQSMZ4N.js.map → chunk-QDO5JFFV.js.map} +0 -0
- /package/dist/{chunk-JWBS7YDI.js.map → chunk-QEJ4GH25.js.map} +0 -0
- /package/dist/{chunk-3CCY7M3R.js.map → chunk-QS3K57OJ.js.map} +0 -0
- /package/dist/{chunk-YJ3EG2D5.js.map → chunk-RGRNAQG5.js.map} +0 -0
- /package/dist/{chunk-USKTLEPZ.js.map → chunk-SLGCRXHM.js.map} +0 -0
- /package/dist/{chunk-WIPTWZVH.js.map → chunk-SVF3WCC7.js.map} +0 -0
- /package/dist/{chunk-66MKBRTA.js.map → chunk-T62SFCQY.js.map} +0 -0
- /package/dist/{chunk-EXAZ7K25.js.map → chunk-TXZJESES.js.map} +0 -0
- /package/dist/{chunk-4U3X7LYV.js.map → chunk-UPUJJOKB.js.map} +0 -0
- /package/dist/{chunk-MIGFQP5N.js.map → chunk-URGALOZY.js.map} +0 -0
- /package/dist/{chunk-IOYEPB27.js.map → chunk-Y3GWQBJP.js.map} +0 -0
- /package/dist/{chunk-HGU4FDRY.js.map → chunk-Z6PZKXSP.js.map} +0 -0
- /package/dist/{chunk-STM3G7WJ.js.map → chunk-ZC2MZZR5.js.map} +0 -0
- /package/dist/{cli-XAT673VB.js.map → cli-33E3B2FK.js.map} +0 -0
- /package/dist/{cli-SOA2E26G.js.map → cli-7JV4RM66.js.map} +0 -0
- /package/dist/{cli-X6IWTDFK.js.map → cli-B4DTJ2KC.js.map} +0 -0
- /package/dist/{cli-VQYB3663.js.map → cli-D4WXCDTS.js.map} +0 -0
- /package/dist/{cli-5XKHMRZ5.js.map → cli-EVACAD7K.js.map} +0 -0
- /package/dist/{cli-LOND37OA.js.map → cli-LIKI7WPR.js.map} +0 -0
- /package/dist/{cli-O6Y2KVWD.js.map → cli-MWUFAS2X.js.map} +0 -0
- /package/dist/{cli-7QHJW5GH.js.map → cli-OKPRTVG6.js.map} +0 -0
- /package/dist/{cli-IKDX2I5X.js.map → cli-QEPVGLQ3.js.map} +0 -0
- /package/dist/{cli-QTLOAVOY.js.map → cli-VP6JTPFS.js.map} +0 -0
- /package/dist/{github-IPBOTQBN.js.map → github-DV57TW5L.js.map} +0 -0
- /package/dist/{github-XM36D7ZH.js.map → github-SGX2EARO.js.map} +0 -0
- /package/dist/{json-225TND7K.js.map → json-5EQCGVCV.js.map} +0 -0
- /package/dist/{json-7WV7KL6H.js.map → json-SHPUCD64.js.map} +0 -0
- /package/dist/{labels-CTLHIRC4.js.map → labels-3GCGYYV3.js.map} +0 -0
- /package/dist/{lint-NP3PC3SO.js.map → lint-RE4DMI6E.js.map} +0 -0
- /package/dist/{list-JJGNKO6S.js.map → list-F56MEJXR.js.map} +0 -0
- /package/dist/{list-Q457TIMA.js.map → list-ZR3KY556.js.map} +0 -0
- /package/dist/{page-FJW7J2EU.js.map → page-G7XSO4FD.js.map} +0 -0
- /package/dist/{prepare-RKJEKHAG.js.map → prepare-WHMWP7BG.js.map} +0 -0
- /package/dist/{pretty-ECBO3EVT.js.map → pretty-VTJVXWRK.js.map} +0 -0
- /package/dist/{pretty-QFEN2SIA.js.map → pretty-YVRRWBWN.js.map} +0 -0
- /package/dist/{reporters-IKKL5RHS.js.map → reporters-FSXJ42EB.js.map} +0 -0
- /package/dist/{reporters-TDQDQHKE.js.map → reporters-G5R4SURQ.js.map} +0 -0
- /package/dist/{reporters-WGLQKW2Y.js.map → reporters-MHPY4HRA.js.map} +0 -0
- /package/dist/{run-BTETGGLW.js.map → run-FSYOYEPR.js.map} +0 -0
- /package/dist/{sarif-K4SMB563.js.map → sarif-HBQIDY7T.js.map} +0 -0
- /package/dist/{sarif-ZHFK6PZY.js.map → sarif-RRUFJZUL.js.map} +0 -0
- /package/dist/{term-2M7APX2A.js.map → term-ABHGACYE.js.map} +0 -0
- /package/dist/{validate-GBM5STKS.js.map → validate-DXYUUGUD.js.map} +0 -0
|
@@ -3,25 +3,37 @@ import {
|
|
|
3
3
|
CITATIONS_KEY,
|
|
4
4
|
GIT_UNAVAILABLE_COMMIT,
|
|
5
5
|
SHALLOW_RECOMMIT,
|
|
6
|
+
arrivalOf,
|
|
6
7
|
assertNoOrphanJoins,
|
|
7
8
|
assertNoOrphans,
|
|
9
|
+
blobReader,
|
|
8
10
|
buildSourceIndex,
|
|
9
11
|
checkCitations,
|
|
10
12
|
claimWords,
|
|
13
|
+
classifyCitation,
|
|
14
|
+
commitGraph,
|
|
15
|
+
createSourceCache,
|
|
11
16
|
encryptSourcePath,
|
|
17
|
+
firstParentLog,
|
|
12
18
|
gitClient,
|
|
13
19
|
historyOf,
|
|
14
20
|
joinHits,
|
|
21
|
+
loadCitationSidecars,
|
|
22
|
+
parseCiteConfig,
|
|
15
23
|
prepareRun,
|
|
24
|
+
readCiteConfigFile,
|
|
16
25
|
readSource,
|
|
17
26
|
readTarget,
|
|
18
27
|
resolveCiteRun,
|
|
28
|
+
resolveSourcePath,
|
|
19
29
|
sayNotices,
|
|
20
30
|
sharesSentence,
|
|
21
31
|
sidecarsFor,
|
|
22
32
|
sourceIndexFor,
|
|
33
|
+
tagCommits,
|
|
34
|
+
topLevel,
|
|
23
35
|
wordShare
|
|
24
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-6DYFWAZA.js";
|
|
25
37
|
import {
|
|
26
38
|
applyMarkerMoves,
|
|
27
39
|
blockMatches,
|
|
@@ -31,11 +43,12 @@ import {
|
|
|
31
43
|
normalizeWhitespace,
|
|
32
44
|
otherClaimSpans,
|
|
33
45
|
remedyFor,
|
|
46
|
+
shortCommit,
|
|
34
47
|
shortSrc,
|
|
35
48
|
spellAt,
|
|
36
49
|
spellElsewhere,
|
|
37
50
|
unitAt
|
|
38
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-GZHBMMDC.js";
|
|
39
52
|
import {
|
|
40
53
|
ANY_FENCE,
|
|
41
54
|
CiteError,
|
|
@@ -62,10 +75,10 @@ import {
|
|
|
62
75
|
spellSource,
|
|
63
76
|
tooWide,
|
|
64
77
|
unitHolding
|
|
65
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-UVLQRP6O.js";
|
|
66
79
|
import {
|
|
67
80
|
ensureEncryptionKey
|
|
68
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-T62SFCQY.js";
|
|
69
82
|
import {
|
|
70
83
|
ENCRYPTION_KEY_ENV,
|
|
71
84
|
STDIN_REQUIRES_AS,
|
|
@@ -85,18 +98,27 @@ import {
|
|
|
85
98
|
splitLines,
|
|
86
99
|
toBodyLines,
|
|
87
100
|
toFileLines
|
|
88
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-476DMDJ5.js";
|
|
89
102
|
import {
|
|
90
103
|
DocmetaError,
|
|
91
104
|
STDIN_LABEL,
|
|
92
105
|
STDIN_TOKEN,
|
|
106
|
+
classifyRef,
|
|
93
107
|
extractorByName,
|
|
94
108
|
locateFrontmatter,
|
|
95
109
|
writeFileAtomic
|
|
96
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-OFOIBV5J.js";
|
|
97
111
|
import {
|
|
98
|
-
|
|
112
|
+
SEVERITIES
|
|
113
|
+
} from "./chunk-77AINBYM.js";
|
|
114
|
+
import {
|
|
115
|
+
hasPagePlaceholder,
|
|
116
|
+
isEncryptedValue,
|
|
117
|
+
pageManifestPath
|
|
99
118
|
} from "./chunk-B2242FYO.js";
|
|
119
|
+
import {
|
|
120
|
+
parseDuration
|
|
121
|
+
} from "./chunk-VM7VAFJW.js";
|
|
100
122
|
|
|
101
123
|
// src/cite/commands/add.ts
|
|
102
124
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
@@ -618,7 +640,7 @@ function splice(text, options) {
|
|
|
618
640
|
throw error;
|
|
619
641
|
}
|
|
620
642
|
}
|
|
621
|
-
function itemLine(text, entry, index,
|
|
643
|
+
function itemLine(text, entry, index, join3) {
|
|
622
644
|
const lc = new LineCounter();
|
|
623
645
|
const doc = parseDocument(text, { lineCounter: lc, uniqueKeys: false });
|
|
624
646
|
if (doc.errors.length > 0) return void 0;
|
|
@@ -626,7 +648,7 @@ function itemLine(text, entry, index, join) {
|
|
|
626
648
|
if (!isMap(root)) return void 0;
|
|
627
649
|
const same = (key) => {
|
|
628
650
|
const spelled = isScalar(key) ? String(key.value) : String(key);
|
|
629
|
-
return
|
|
651
|
+
return join3 === "path" ? posix.normalize(spelled) === posix.normalize(entry) : spelled === entry;
|
|
630
652
|
};
|
|
631
653
|
const pair = root.items.find((p) => same(p.key));
|
|
632
654
|
const value = pair?.value;
|
|
@@ -991,8 +1013,457 @@ async function runAdd(opts) {
|
|
|
991
1013
|
return result;
|
|
992
1014
|
}
|
|
993
1015
|
|
|
1016
|
+
// src/cite/commands/history.ts
|
|
1017
|
+
import { realpath } from "node:fs/promises";
|
|
1018
|
+
import { join as join2, relative as relative3, resolve as resolve3, sep as sep2 } from "node:path";
|
|
1019
|
+
|
|
1020
|
+
// src/cite/core/timeline.ts
|
|
1021
|
+
import { mkdtemp, rm } from "node:fs/promises";
|
|
1022
|
+
import { tmpdir } from "node:os";
|
|
1023
|
+
import { dirname, isAbsolute, join, posix as posix2, relative as relative2, resolve as resolve2, sep } from "node:path";
|
|
1024
|
+
function trackRenames(commits, pages, start) {
|
|
1025
|
+
const paths = new Map(pages.map((page) => [page.label, page.path]));
|
|
1026
|
+
const renames = /* @__PURE__ */ new Map();
|
|
1027
|
+
for (let i = commits.length - 1; i > start; i--) {
|
|
1028
|
+
const from = /* @__PURE__ */ new Map();
|
|
1029
|
+
for (const change of commits[i]?.changes ?? []) {
|
|
1030
|
+
if (change.from !== void 0) from.set(change.path, change.from);
|
|
1031
|
+
}
|
|
1032
|
+
if (from.size === 0) continue;
|
|
1033
|
+
for (const [label, path] of paths) {
|
|
1034
|
+
const old = from.get(path);
|
|
1035
|
+
if (old === void 0) continue;
|
|
1036
|
+
const at = renames.get(i) ?? [];
|
|
1037
|
+
at.push({ label, to: path });
|
|
1038
|
+
renames.set(i, at);
|
|
1039
|
+
paths.set(label, old);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
return { paths, renames };
|
|
1043
|
+
}
|
|
1044
|
+
var toPosix2 = (path) => path.split(sep).join("/");
|
|
1045
|
+
var isFile = (leaf) => leaf.mode !== "120000" && leaf.mode !== "160000";
|
|
1046
|
+
function ruleOf(status) {
|
|
1047
|
+
if (status === "changed" || status === "missing" || status === "never-true") return `source-${status}`;
|
|
1048
|
+
return void 0;
|
|
1049
|
+
}
|
|
1050
|
+
async function buildTimeline(input) {
|
|
1051
|
+
const commits = await firstParentLog(input.top);
|
|
1052
|
+
const head = commits[commits.length - 1];
|
|
1053
|
+
const since = input.within === void 0 || head === void 0 ? void 0 : head.time - input.within;
|
|
1054
|
+
const bound = since === void 0 ? 0 : commits.findIndex((commit) => commit.time >= since);
|
|
1055
|
+
let start = bound === -1 ? commits.length : bound;
|
|
1056
|
+
const { paths, renames } = trackRenames(commits, input.pages, start);
|
|
1057
|
+
const blobs = blobReader(input.top);
|
|
1058
|
+
const snap = await mkdtemp(join(tmpdir(), "manni-cite-history-"));
|
|
1059
|
+
try {
|
|
1060
|
+
const walk = new Walk(input, blobs, snap, paths);
|
|
1061
|
+
const tree = /* @__PURE__ */ new Map();
|
|
1062
|
+
let unread = false;
|
|
1063
|
+
for (const [i, commit] of commits.entries()) {
|
|
1064
|
+
for (const change of commit.changes) {
|
|
1065
|
+
if (change.blob === void 0) tree.delete(change.path);
|
|
1066
|
+
else tree.set(change.path, { blob: change.blob, ...change.mode === void 0 ? {} : { mode: change.mode } });
|
|
1067
|
+
}
|
|
1068
|
+
if (i < start) continue;
|
|
1069
|
+
for (const { label, to } of renames.get(i) ?? []) paths.set(label, to);
|
|
1070
|
+
if (!await walk.read(i, commit, tree, i === start)) {
|
|
1071
|
+
walk.reset();
|
|
1072
|
+
start = i + 1;
|
|
1073
|
+
unread = true;
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
return {
|
|
1077
|
+
commits,
|
|
1078
|
+
start,
|
|
1079
|
+
windows: walk.windows(),
|
|
1080
|
+
citations: walk.seen.size,
|
|
1081
|
+
encrypted: walk.encrypted.size,
|
|
1082
|
+
unread
|
|
1083
|
+
};
|
|
1084
|
+
} finally {
|
|
1085
|
+
blobs.close();
|
|
1086
|
+
await rm(snap, { recursive: true, force: true });
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
var Walk = class {
|
|
1090
|
+
constructor(input, blobs, snap, paths) {
|
|
1091
|
+
this.input = input;
|
|
1092
|
+
this.blobs = blobs;
|
|
1093
|
+
this.snap = snap;
|
|
1094
|
+
this.paths = paths;
|
|
1095
|
+
const rel = toPosix2(relative2(input.top, input.root));
|
|
1096
|
+
this.prefix = rel === "" ? "" : `${rel}/`;
|
|
1097
|
+
}
|
|
1098
|
+
input;
|
|
1099
|
+
blobs;
|
|
1100
|
+
snap;
|
|
1101
|
+
paths;
|
|
1102
|
+
seen = /* @__PURE__ */ new Set();
|
|
1103
|
+
encrypted = /* @__PURE__ */ new Set();
|
|
1104
|
+
open = /* @__PURE__ */ new Map();
|
|
1105
|
+
closed = [];
|
|
1106
|
+
states = /* @__PURE__ */ new Map();
|
|
1107
|
+
pages = /* @__PURE__ */ new Map();
|
|
1108
|
+
/** What each scratch path holds now, by repository path. */
|
|
1109
|
+
written = /* @__PURE__ */ new Map();
|
|
1110
|
+
configBlob = null;
|
|
1111
|
+
config = null;
|
|
1112
|
+
prefix;
|
|
1113
|
+
/** Forget everything read so far: the history before this point is unread. */
|
|
1114
|
+
reset() {
|
|
1115
|
+
this.open.clear();
|
|
1116
|
+
this.closed = [];
|
|
1117
|
+
this.states.clear();
|
|
1118
|
+
this.pages.clear();
|
|
1119
|
+
this.seen.clear();
|
|
1120
|
+
this.encrypted.clear();
|
|
1121
|
+
this.configBlob = null;
|
|
1122
|
+
}
|
|
1123
|
+
windows() {
|
|
1124
|
+
const strip = ({ pinAtOpen: _, ...window }) => window;
|
|
1125
|
+
return [...this.closed, ...[...this.open.values()].map(strip)];
|
|
1126
|
+
}
|
|
1127
|
+
/** Read one commit. False when its config or citation manifests do not load. */
|
|
1128
|
+
async read(i, commit, tree, first) {
|
|
1129
|
+
const configBlob = this.input.config === void 0 ? void 0 : tree.get(this.input.config)?.blob;
|
|
1130
|
+
if (configBlob !== this.configBlob) {
|
|
1131
|
+
if (!await this.loadConfig(configBlob)) return false;
|
|
1132
|
+
this.configBlob = configBlob;
|
|
1133
|
+
this.pages.clear();
|
|
1134
|
+
}
|
|
1135
|
+
if (!await this.readPages(tree)) return false;
|
|
1136
|
+
await this.classify(i, commit, tree, first);
|
|
1137
|
+
return true;
|
|
1138
|
+
}
|
|
1139
|
+
async loadConfig(blob) {
|
|
1140
|
+
const at = this.input.config;
|
|
1141
|
+
if (blob === void 0 || at === void 0) {
|
|
1142
|
+
this.config = null;
|
|
1143
|
+
return true;
|
|
1144
|
+
}
|
|
1145
|
+
await this.sync(at, blob);
|
|
1146
|
+
const abs = join(this.snap, at);
|
|
1147
|
+
try {
|
|
1148
|
+
const file = await readCiteConfigFile(abs, dirname(abs));
|
|
1149
|
+
if (file !== null) parseCiteConfig(file.value, file.source);
|
|
1150
|
+
this.config = file;
|
|
1151
|
+
return true;
|
|
1152
|
+
} catch {
|
|
1153
|
+
return false;
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
/** Write a repository path's blob to the scratch directory, or remove it. */
|
|
1157
|
+
async sync(path, blob) {
|
|
1158
|
+
if (this.written.get(path) === blob) return;
|
|
1159
|
+
const abs = join(this.snap, path);
|
|
1160
|
+
if (blob === void 0) {
|
|
1161
|
+
await rm(abs, { force: true });
|
|
1162
|
+
this.written.delete(path);
|
|
1163
|
+
return;
|
|
1164
|
+
}
|
|
1165
|
+
await writeFileAtomic(abs, await this.blobs.read(blob), { createParents: true });
|
|
1166
|
+
this.written.set(path, blob);
|
|
1167
|
+
}
|
|
1168
|
+
/** The repository paths of the manifests that may keep a page's citations at this commit. */
|
|
1169
|
+
manifestsFor(pagePath) {
|
|
1170
|
+
const config = this.config;
|
|
1171
|
+
if (config === null) return [];
|
|
1172
|
+
const out = [];
|
|
1173
|
+
for (const collection of config.collections) {
|
|
1174
|
+
for (const manifest of collection.externalMetadata) {
|
|
1175
|
+
if (manifest.keys !== void 0 && !manifest.keys.includes(CITATIONS_KEY)) continue;
|
|
1176
|
+
if (classifyRef(manifest.file).kind === "url") continue;
|
|
1177
|
+
const abs = hasPagePlaceholder(manifest.file) ? pageManifestPath(manifest.file, config.dir, join(this.snap, pagePath)) : { abs: isAbsolute(manifest.file) ? manifest.file : resolve2(config.dir, manifest.file) };
|
|
1178
|
+
if (!("abs" in abs)) continue;
|
|
1179
|
+
const rel = toPosix2(relative2(this.snap, abs.abs));
|
|
1180
|
+
if (rel.startsWith("../") || isAbsolute(rel)) continue;
|
|
1181
|
+
out.push(rel);
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
return out;
|
|
1185
|
+
}
|
|
1186
|
+
/** Re-read the entries of every page whose text, manifests or config changed. False when the manifests do not load. */
|
|
1187
|
+
async readPages(tree) {
|
|
1188
|
+
const dirty = [];
|
|
1189
|
+
for (const page of this.input.pages) {
|
|
1190
|
+
const path = this.paths.get(page.label) ?? page.path;
|
|
1191
|
+
const blob = tree.get(path)?.blob;
|
|
1192
|
+
const manifests = blob === void 0 ? [] : this.manifestsFor(path);
|
|
1193
|
+
const key = [String(this.configBlob), path, String(blob), ...manifests.map((m) => `${m}:${String(tree.get(m)?.blob)}`)].join("\0");
|
|
1194
|
+
if (this.pages.get(page.label)?.key === key) continue;
|
|
1195
|
+
if (blob === void 0) this.pages.set(page.label, { key, entries: [] });
|
|
1196
|
+
else dirty.push({ label: page.label, path, blob, key, manifests });
|
|
1197
|
+
}
|
|
1198
|
+
if (dirty.length === 0) return true;
|
|
1199
|
+
const config = this.config;
|
|
1200
|
+
const base = join(this.snap, this.input.base);
|
|
1201
|
+
let sidecars = null;
|
|
1202
|
+
if (config !== null && config.collections.length > 0) {
|
|
1203
|
+
for (const manifest of new Set(dirty.flatMap((page) => page.manifests))) {
|
|
1204
|
+
await this.sync(manifest, tree.get(manifest)?.blob);
|
|
1205
|
+
}
|
|
1206
|
+
try {
|
|
1207
|
+
sidecars = await loadCitationSidecars({
|
|
1208
|
+
collections: config.collections,
|
|
1209
|
+
configDir: config.dir,
|
|
1210
|
+
base,
|
|
1211
|
+
configSource: config.source,
|
|
1212
|
+
...this.input.key === void 0 ? {} : { key: this.input.key },
|
|
1213
|
+
pages: dirty.map((page) => join(this.snap, page.path))
|
|
1214
|
+
});
|
|
1215
|
+
} catch {
|
|
1216
|
+
return false;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
for (const page of dirty) {
|
|
1220
|
+
const label = toPosix2(relative2(base, join(this.snap, page.path)));
|
|
1221
|
+
const before = this.pages.get(page.label)?.entries ?? [];
|
|
1222
|
+
try {
|
|
1223
|
+
const content = await this.blobs.read(page.blob);
|
|
1224
|
+
const setup = await sidecars?.forPage(label, content, this.input.format);
|
|
1225
|
+
const owner = setup?.owner;
|
|
1226
|
+
const read = readPage(label, content, {
|
|
1227
|
+
...this.input.format === void 0 ? {} : { format: this.input.format },
|
|
1228
|
+
...owner === void 0 ? {} : { owned: { file: owner.file, collection: owner.collection } },
|
|
1229
|
+
...owner === void 0 || setup?.citations === void 0 ? {} : { citations: setup.citations }
|
|
1230
|
+
});
|
|
1231
|
+
this.pages.set(page.label, { key: page.key, entries: read.citations });
|
|
1232
|
+
} catch {
|
|
1233
|
+
this.pages.set(page.label, { key: page.key, entries: before });
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
return true;
|
|
1237
|
+
}
|
|
1238
|
+
/** The index and client a commit's classification reads through, built once per commit when first needed. */
|
|
1239
|
+
atCommit(commit, tree) {
|
|
1240
|
+
const { prefix } = this;
|
|
1241
|
+
let files;
|
|
1242
|
+
const leaf = (path) => {
|
|
1243
|
+
const found = tree.get(prefix + path);
|
|
1244
|
+
return found !== void 0 && isFile(found) ? found : void 0;
|
|
1245
|
+
};
|
|
1246
|
+
const index = {
|
|
1247
|
+
files: () => files ??= [...tree.entries()].filter(([path, found]) => path.startsWith(prefix) && isFile(found)).map(([path]) => path.slice(prefix.length)).sort(),
|
|
1248
|
+
has: (path) => leaf(path) !== void 0,
|
|
1249
|
+
read: async (path) => {
|
|
1250
|
+
const found = leaf(path);
|
|
1251
|
+
if (found === void 0) return void 0;
|
|
1252
|
+
try {
|
|
1253
|
+
return await this.blobs.read(found.blob);
|
|
1254
|
+
} catch {
|
|
1255
|
+
return void 0;
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
};
|
|
1259
|
+
return {
|
|
1260
|
+
root: this.input.root,
|
|
1261
|
+
index,
|
|
1262
|
+
git: gitClient(this.input.root, commit.sha),
|
|
1263
|
+
cache: createSourceCache(),
|
|
1264
|
+
...this.input.key === void 0 ? {} : { key: this.input.key }
|
|
1265
|
+
};
|
|
1266
|
+
}
|
|
1267
|
+
async classify(i, commit, tree, first) {
|
|
1268
|
+
let options;
|
|
1269
|
+
const present = /* @__PURE__ */ new Set();
|
|
1270
|
+
for (const page of this.input.pages) {
|
|
1271
|
+
const path = this.paths.get(page.label) ?? page.path;
|
|
1272
|
+
for (const entry of this.pages.get(page.label)?.entries ?? []) {
|
|
1273
|
+
const { source } = entry.citation;
|
|
1274
|
+
const id = entry.citation.id ?? `/citations/${String(entry.origin.index)}`;
|
|
1275
|
+
const key = `${page.label}\0${id}`;
|
|
1276
|
+
if (present.has(key)) continue;
|
|
1277
|
+
const range = sourceRange(source);
|
|
1278
|
+
const resolved = resolveSourcePath(range, this.input.key);
|
|
1279
|
+
if ("reason" in resolved && resolved.reason === "no-key") {
|
|
1280
|
+
this.encrypted.add(key);
|
|
1281
|
+
continue;
|
|
1282
|
+
}
|
|
1283
|
+
present.add(key);
|
|
1284
|
+
this.seen.add(key);
|
|
1285
|
+
const pin = JSON.stringify([source.file, source.lines ?? null, source.integrity]);
|
|
1286
|
+
const blob = "path" in resolved ? tree.get(this.prefix + resolved.path)?.blob : void 0;
|
|
1287
|
+
const held = this.states.get(key);
|
|
1288
|
+
let status;
|
|
1289
|
+
if (held !== void 0 && held.stable && held.pin === pin && held.blob === blob) {
|
|
1290
|
+
status = held.status;
|
|
1291
|
+
} else {
|
|
1292
|
+
options ??= this.atCommit(commit, tree);
|
|
1293
|
+
const end = await classifyCitation(entry, options);
|
|
1294
|
+
status = end.status;
|
|
1295
|
+
const own = (src) => parseSrc(src).path === range.path;
|
|
1296
|
+
const stable = status === "current" || status === "moved" && own(end.newSrc ?? "") || status === "moved-ambiguous" && (end.candidates ?? []).every(own);
|
|
1297
|
+
this.states.set(key, { pin, blob, status, stable });
|
|
1298
|
+
}
|
|
1299
|
+
const rule = ruleOf(status);
|
|
1300
|
+
const window = this.open.get(key);
|
|
1301
|
+
if (rule !== void 0 && window === void 0) {
|
|
1302
|
+
this.open.set(key, {
|
|
1303
|
+
page: page.label,
|
|
1304
|
+
id,
|
|
1305
|
+
index: entry.origin.index,
|
|
1306
|
+
source: spellSource(source),
|
|
1307
|
+
rule,
|
|
1308
|
+
opened: i,
|
|
1309
|
+
bounded: first,
|
|
1310
|
+
paths: [path],
|
|
1311
|
+
pinAtOpen: pin
|
|
1312
|
+
});
|
|
1313
|
+
} else if (rule !== void 0 && window !== void 0) {
|
|
1314
|
+
if (window.paths[window.paths.length - 1] !== path) window.paths.push(path);
|
|
1315
|
+
} else if (window !== void 0) {
|
|
1316
|
+
this.close(key, window, i, pin === window.pinAtOpen ? "source-restored" : "re-pinned");
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
for (const [key, window] of this.open) {
|
|
1321
|
+
if (!present.has(key)) this.close(key, window, i, "removed");
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
close(key, window, at, by) {
|
|
1325
|
+
this.open.delete(key);
|
|
1326
|
+
const { pinAtOpen: _, ...done } = window;
|
|
1327
|
+
this.closed.push({ ...done, closed: { at, by } });
|
|
1328
|
+
}
|
|
1329
|
+
};
|
|
1330
|
+
function repoPath(top, abs) {
|
|
1331
|
+
return posix2.normalize(toPosix2(relative2(top, abs)));
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
// src/cite/commands/history.ts
|
|
1335
|
+
var HISTORY_STDIN_REFUSAL = "cite history reads each page's past from git, and stdin has none. Name the page's path instead of -.";
|
|
1336
|
+
var HISTORY_SHALLOW_REFUSAL = "this clone is shallow, so cite history would start at its oldest commit. Fetch the full history with fetch-depth: 0, or git fetch --unshallow.";
|
|
1337
|
+
function notInGitRefusal(root) {
|
|
1338
|
+
return `cite history reads git, and ${root} is not inside a git repository.`;
|
|
1339
|
+
}
|
|
1340
|
+
function noCommitsRefusal(root) {
|
|
1341
|
+
return `cite history reads git, and ${root} has no commits yet.`;
|
|
1342
|
+
}
|
|
1343
|
+
function unreadNotice(sha) {
|
|
1344
|
+
return `history before ${shortCommit(sha)} is unread: its config or citation manifests do not load under this version. Windows open there are marked bounded.`;
|
|
1345
|
+
}
|
|
1346
|
+
function encryptedNotice(count) {
|
|
1347
|
+
const what = count === 1 ? "1 encrypted citation was" : `${String(count)} encrypted citations were`;
|
|
1348
|
+
return `${what} skipped: no encryption key. Set MANNI_ENCRYPTION_KEY or encryptionKey: to include them.`;
|
|
1349
|
+
}
|
|
1350
|
+
function isoOf(seconds) {
|
|
1351
|
+
return new Date(seconds * 1e3).toISOString().replace(/\.\d{3}Z$/, "Z");
|
|
1352
|
+
}
|
|
1353
|
+
var toPosix3 = (path) => path.split(sep2).join("/");
|
|
1354
|
+
async function runHistory(opts) {
|
|
1355
|
+
const within = opts.newerThan === void 0 ? void 0 : parseDuration(opts.newerThan, (message) => new CiteError(message)) / 1e3;
|
|
1356
|
+
if (opts.inputs.includes(STDIN_TOKEN)) throw new CiteError(HISTORY_STDIN_REFUSAL);
|
|
1357
|
+
const prepared = await prepareRun({ ...opts, checkSources: true }, "read", "read", { resolve: false });
|
|
1358
|
+
const { run, files } = prepared;
|
|
1359
|
+
const top = await topLevel(run.root);
|
|
1360
|
+
if (top === null) throw new CiteError(notInGitRefusal(run.root));
|
|
1361
|
+
if (await prepared.git.head() === null) throw new CiteError(noCommitsRefusal(run.root));
|
|
1362
|
+
if (await prepared.git.shallow?.()) throw new CiteError(HISTORY_SHALLOW_REFUSAL);
|
|
1363
|
+
const realTop = await realpath(top);
|
|
1364
|
+
const base = await realpath(run.base);
|
|
1365
|
+
const pages = await Promise.all(
|
|
1366
|
+
files.map(async (file) => ({ label: file, path: repoPath(realTop, await realpath(resolve3(run.base, file))) }))
|
|
1367
|
+
);
|
|
1368
|
+
const timeline = await buildTimeline({
|
|
1369
|
+
top: realTop,
|
|
1370
|
+
root: await realpath(run.root),
|
|
1371
|
+
pages,
|
|
1372
|
+
...run.configPath === void 0 ? {} : { config: repoPath(realTop, await realpath(run.configPath)) },
|
|
1373
|
+
base: repoPath(realTop, base),
|
|
1374
|
+
...run.key === void 0 ? {} : { key: run.key },
|
|
1375
|
+
...prepared.forced === void 0 ? {} : { format: prepared.forced.name },
|
|
1376
|
+
...within === void 0 ? {} : { within }
|
|
1377
|
+
});
|
|
1378
|
+
const { commits, start } = timeline;
|
|
1379
|
+
const head = commits[commits.length - 1];
|
|
1380
|
+
if (head === void 0) throw new Error("history walk returned no commits for an existing HEAD");
|
|
1381
|
+
if (timeline.unread) opts.onNotice?.(unreadNotice((commits[start] ?? head).sha));
|
|
1382
|
+
if (timeline.encrypted > 0) opts.onNotice?.(encryptedNotice(timeline.encrypted));
|
|
1383
|
+
const releasesOf = await releaseFinder(realTop);
|
|
1384
|
+
const severity = resolveSeverity(run.config?.severity);
|
|
1385
|
+
const at = (i) => {
|
|
1386
|
+
const commit = commits[i] ?? head;
|
|
1387
|
+
return { commit: commit.sha, date: isoOf(commit.time), subject: commit.subject };
|
|
1388
|
+
};
|
|
1389
|
+
const label = (path) => toPosix3(relative3(base, join2(realTop, path)));
|
|
1390
|
+
const staleWindow = (window, level) => {
|
|
1391
|
+
const opened = commits[window.opened] ?? head;
|
|
1392
|
+
const closed = window.closed === void 0 ? void 0 : commits[window.closed.at] ?? head;
|
|
1393
|
+
const home = pages.find((page) => page.label === window.page);
|
|
1394
|
+
if (home === void 0) throw new Error(`window for unknown page: ${window.page}`);
|
|
1395
|
+
const now = label(home.path);
|
|
1396
|
+
return {
|
|
1397
|
+
id: window.id,
|
|
1398
|
+
source: window.source,
|
|
1399
|
+
rule: window.rule,
|
|
1400
|
+
severity: level,
|
|
1401
|
+
opened: { ...at(window.opened), bounded: window.bounded },
|
|
1402
|
+
closed: window.closed === void 0 ? null : { ...at(window.closed.at), by: window.closed.by },
|
|
1403
|
+
seconds: (closed ?? head).time - opened.time,
|
|
1404
|
+
releases: releasesOf(opened.sha, closed?.sha),
|
|
1405
|
+
formerly: [...new Set(window.paths.map(label))].filter((path) => path !== now)
|
|
1406
|
+
};
|
|
1407
|
+
};
|
|
1408
|
+
const byPage = new Map(files.map((file) => [file, []]));
|
|
1409
|
+
const ordered = [...timeline.windows].sort((a, b) => a.opened - b.opened || a.index - b.index);
|
|
1410
|
+
for (const window of ordered) {
|
|
1411
|
+
const level = severity[window.rule];
|
|
1412
|
+
if (level === "off") continue;
|
|
1413
|
+
byPage.get(window.page)?.push(staleWindow(window, level));
|
|
1414
|
+
}
|
|
1415
|
+
const out = [...byPage.entries()].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([file, windows]) => ({ file, windows }));
|
|
1416
|
+
const all = out.flatMap((page) => page.windows);
|
|
1417
|
+
const bySeverity = Object.fromEntries(SEVERITIES.map((s) => [s, 0]));
|
|
1418
|
+
for (const window of all) bySeverity[window.severity] += 1;
|
|
1419
|
+
const shipped = new Set(all.flatMap((window) => window.releases));
|
|
1420
|
+
const first = commits[start] ?? head;
|
|
1421
|
+
return {
|
|
1422
|
+
summary: {
|
|
1423
|
+
head: head.sha,
|
|
1424
|
+
walked: { commits: commits.length - start, from: isoOf(first.time), to: isoOf(head.time) },
|
|
1425
|
+
files: files.length,
|
|
1426
|
+
citations: timeline.citations,
|
|
1427
|
+
windows: all.length,
|
|
1428
|
+
open: all.filter((window) => window.closed === null).length,
|
|
1429
|
+
staleSeconds: all.reduce((sum, window) => sum + window.seconds, 0),
|
|
1430
|
+
bySeverity,
|
|
1431
|
+
releases: releasesOf.order([...shipped]),
|
|
1432
|
+
skipped: { encrypted: timeline.encrypted }
|
|
1433
|
+
},
|
|
1434
|
+
pages: out
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
async function releaseFinder(top) {
|
|
1438
|
+
const graph = await commitGraph(top);
|
|
1439
|
+
const tags = (await tagCommits(top)).filter((tag) => graph.has(tag.commit));
|
|
1440
|
+
const ancestry = /* @__PURE__ */ new Map();
|
|
1441
|
+
const ancestorsOf = (commit) => {
|
|
1442
|
+
const held = ancestry.get(commit);
|
|
1443
|
+
if (held !== void 0) return held;
|
|
1444
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1445
|
+
const stack = [commit];
|
|
1446
|
+
for (let next = stack.pop(); next !== void 0; next = stack.pop()) {
|
|
1447
|
+
if (seen.has(next)) continue;
|
|
1448
|
+
seen.add(next);
|
|
1449
|
+
stack.push(...graph.get(next)?.parents ?? []);
|
|
1450
|
+
}
|
|
1451
|
+
ancestry.set(commit, seen);
|
|
1452
|
+
return seen;
|
|
1453
|
+
};
|
|
1454
|
+
const time = (name) => graph.get(tags.find((tag) => tag.name === name)?.commit ?? "")?.time ?? 0;
|
|
1455
|
+
const order = (names) => [...names].sort((a, b) => time(a) - time(b) || (a < b ? -1 : a > b ? 1 : 0));
|
|
1456
|
+
const find = (opened, closed) => order(
|
|
1457
|
+
tags.filter((tag) => {
|
|
1458
|
+
const contains = ancestorsOf(tag.commit);
|
|
1459
|
+
return contains.has(opened) && (closed === void 0 || !contains.has(closed));
|
|
1460
|
+
}).map((tag) => tag.name)
|
|
1461
|
+
);
|
|
1462
|
+
return Object.assign(find, { order });
|
|
1463
|
+
}
|
|
1464
|
+
|
|
994
1465
|
// src/cite/commands/remove.ts
|
|
995
|
-
import { resolve as
|
|
1466
|
+
import { resolve as resolve4 } from "node:path";
|
|
996
1467
|
var POINTER = /^\/citations\/(0|[1-9][0-9]*)$/;
|
|
997
1468
|
function entryCount(n) {
|
|
998
1469
|
return `${String(n)} ${n === 1 ? "entry" : "entries"}`;
|
|
@@ -1160,7 +1631,7 @@ async function runRemove(opts) {
|
|
|
1160
1631
|
};
|
|
1161
1632
|
if (usingStdin) await removeOne(STDIN_LABEL, opts.stdinContent ?? "");
|
|
1162
1633
|
for (const file of files) {
|
|
1163
|
-
await removeOne(file, await readTarget(run, file),
|
|
1634
|
+
await removeOne(file, await readTarget(run, file), resolve4(run.base, file));
|
|
1164
1635
|
}
|
|
1165
1636
|
assertNoOrphanJoins(prepared, hits);
|
|
1166
1637
|
const missing = only.find((value) => !matched.has(value));
|
|
@@ -1190,7 +1661,7 @@ async function runRemove(opts) {
|
|
|
1190
1661
|
}
|
|
1191
1662
|
|
|
1192
1663
|
// src/cite/commands/update.ts
|
|
1193
|
-
import { resolve as
|
|
1664
|
+
import { resolve as resolve5 } from "node:path";
|
|
1194
1665
|
function sayNoUnit(reason) {
|
|
1195
1666
|
switch (reason) {
|
|
1196
1667
|
case "outside":
|
|
@@ -1707,7 +2178,9 @@ async function runUpdate(opts) {
|
|
|
1707
2178
|
because = "not-contained";
|
|
1708
2179
|
}
|
|
1709
2180
|
const now = await historyOf(git, head, path, range, pin, key, void 0);
|
|
1710
|
-
|
|
2181
|
+
if (now.kind !== "original") return void 0;
|
|
2182
|
+
const arrived = await arrivalOf(git, path, range, pin, key);
|
|
2183
|
+
return { commit: arrived ?? head, because };
|
|
1711
2184
|
};
|
|
1712
2185
|
const plansFor = async (result, entry, page, lines, lineNow, declined) => {
|
|
1713
2186
|
const out = [];
|
|
@@ -2102,7 +2575,7 @@ async function runUpdate(opts) {
|
|
|
2102
2575
|
const reports = [];
|
|
2103
2576
|
if (usingStdin) reports.push(await updateOne(STDIN_LABEL, opts.stdinContent ?? ""));
|
|
2104
2577
|
for (const file of files) {
|
|
2105
|
-
reports.push(await updateOne(file, await readTarget(run, file),
|
|
2578
|
+
reports.push(await updateOne(file, await readTarget(run, file), resolve5(run.base, file)));
|
|
2106
2579
|
}
|
|
2107
2580
|
assertNoOrphanJoins(prepared, hits);
|
|
2108
2581
|
const write = opts.dryRun !== true;
|
|
@@ -2162,7 +2635,8 @@ export {
|
|
|
2162
2635
|
splice,
|
|
2163
2636
|
itemLine,
|
|
2164
2637
|
runAdd,
|
|
2638
|
+
runHistory,
|
|
2165
2639
|
runRemove,
|
|
2166
2640
|
runUpdate
|
|
2167
2641
|
};
|
|
2168
|
-
//# sourceMappingURL=chunk-
|
|
2642
|
+
//# sourceMappingURL=chunk-YT5HKJWV.js.map
|