@hawkeyexl/manni 4.3.1 → 4.4.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 (224) hide show
  1. package/README.md +9 -1
  2. package/dist/batch-DFRCLY77.js +36 -0
  3. package/dist/build-Q5C6SX5J.js +31 -0
  4. package/dist/calibrate-XQILKXS3.js +31 -0
  5. package/dist/capture-JQMOC3BW.js +32 -0
  6. package/dist/check-HYNGXYJV.js +18 -0
  7. package/dist/check-HYNGXYJV.js.map +1 -0
  8. package/dist/check-NFZQLJKN.js +27 -0
  9. package/dist/check-NFZQLJKN.js.map +1 -0
  10. package/dist/check-U54XV6BP.js +40 -0
  11. package/dist/check-U54XV6BP.js.map +1 -0
  12. package/dist/chunk-252LNOEG.js +622 -0
  13. package/dist/chunk-252LNOEG.js.map +1 -0
  14. package/dist/chunk-2H7UOFLK.js +11 -0
  15. package/dist/chunk-2H7UOFLK.js.map +1 -0
  16. package/dist/chunk-2U3ORT6D.js +230 -0
  17. package/dist/chunk-2U3ORT6D.js.map +1 -0
  18. package/dist/chunk-3AFUD75K.js +23 -0
  19. package/dist/chunk-3AFUD75K.js.map +1 -0
  20. package/dist/{chunk-3R23C5DT.js → chunk-4TSWU2SU.js} +2 -14
  21. package/dist/chunk-4TSWU2SU.js.map +1 -0
  22. package/dist/chunk-5KHIFVD2.js +1192 -0
  23. package/dist/chunk-5KHIFVD2.js.map +1 -0
  24. package/dist/chunk-5YXBLLAC.js +2165 -0
  25. package/dist/chunk-5YXBLLAC.js.map +1 -0
  26. package/dist/chunk-644JVKJ4.js +3872 -0
  27. package/dist/chunk-644JVKJ4.js.map +1 -0
  28. package/dist/chunk-6OYEI2VV.js +88 -0
  29. package/dist/chunk-6OYEI2VV.js.map +1 -0
  30. package/dist/chunk-77AINBYM.js +19 -0
  31. package/dist/chunk-77AINBYM.js.map +1 -0
  32. package/dist/chunk-77HX34KD.js +1287 -0
  33. package/dist/chunk-77HX34KD.js.map +1 -0
  34. package/dist/{chunk-CFDUZRM2.js → chunk-7QMCHA4N.js} +32 -240
  35. package/dist/chunk-7QMCHA4N.js.map +1 -0
  36. package/dist/chunk-BUXDLRDT.js +455 -0
  37. package/dist/chunk-BUXDLRDT.js.map +1 -0
  38. package/dist/chunk-C6OH6CNF.js +388 -0
  39. package/dist/chunk-C6OH6CNF.js.map +1 -0
  40. package/dist/chunk-CK7SKVHR.js +1042 -0
  41. package/dist/chunk-CK7SKVHR.js.map +1 -0
  42. package/dist/chunk-CYWHFSRT.js +6737 -0
  43. package/dist/chunk-CYWHFSRT.js.map +1 -0
  44. package/dist/chunk-ERMSO34F.js +17 -0
  45. package/dist/chunk-ERMSO34F.js.map +1 -0
  46. package/dist/{chunk-IOYXPBCL.js → chunk-G3T47CFV.js} +1 -7
  47. package/dist/{chunk-IOYXPBCL.js.map → chunk-G3T47CFV.js.map} +1 -1
  48. package/dist/chunk-G7NJSREW.js +979 -0
  49. package/dist/chunk-G7NJSREW.js.map +1 -0
  50. package/dist/chunk-GLP5PSXB.js +72 -0
  51. package/dist/chunk-GLP5PSXB.js.map +1 -0
  52. package/dist/chunk-H2DLH2JI.js +198 -0
  53. package/dist/chunk-H2DLH2JI.js.map +1 -0
  54. package/dist/chunk-H6FZ66XR.js +634 -0
  55. package/dist/chunk-H6FZ66XR.js.map +1 -0
  56. package/dist/{chunk-KJR7OVDX.js → chunk-IEQHSCZG.js} +56 -137
  57. package/dist/chunk-IEQHSCZG.js.map +1 -0
  58. package/dist/chunk-IKEWBMCN.js +98 -0
  59. package/dist/chunk-IKEWBMCN.js.map +1 -0
  60. package/dist/chunk-JOHKIAVH.js +5440 -0
  61. package/dist/chunk-JOHKIAVH.js.map +1 -0
  62. package/dist/chunk-JVTNMVYU.js +10921 -0
  63. package/dist/chunk-JVTNMVYU.js.map +1 -0
  64. package/dist/chunk-K3D6FPV6.js +164 -0
  65. package/dist/chunk-K3D6FPV6.js.map +1 -0
  66. package/dist/{chunk-UBMMXS2Y.js → chunk-KCGV52AM.js} +69 -48
  67. package/dist/{chunk-UBMMXS2Y.js.map → chunk-KCGV52AM.js.map} +1 -1
  68. package/dist/chunk-LAKAWRV5.js +1651 -0
  69. package/dist/chunk-LAKAWRV5.js.map +1 -0
  70. package/dist/chunk-LJ2RDH3F.js +49 -0
  71. package/dist/chunk-LJ2RDH3F.js.map +1 -0
  72. package/dist/chunk-M2JCK5F6.js +805 -0
  73. package/dist/chunk-M2JCK5F6.js.map +1 -0
  74. package/dist/chunk-MNH7QO4Z.js +15 -0
  75. package/dist/chunk-MNH7QO4Z.js.map +1 -0
  76. package/dist/{chunk-HAPTXWU2.js → chunk-MYC3O5EJ.js} +4 -4
  77. package/dist/chunk-MYMBCTDE.js +387 -0
  78. package/dist/chunk-MYMBCTDE.js.map +1 -0
  79. package/dist/chunk-NCPWXHDO.js +683 -0
  80. package/dist/chunk-NCPWXHDO.js.map +1 -0
  81. package/dist/chunk-NWZ2SLYL.js +2957 -0
  82. package/dist/chunk-NWZ2SLYL.js.map +1 -0
  83. package/dist/chunk-OBFENF3U.js +934 -0
  84. package/dist/chunk-OBFENF3U.js.map +1 -0
  85. package/dist/chunk-OWBRDNRZ.js +16 -0
  86. package/dist/chunk-OWBRDNRZ.js.map +1 -0
  87. package/dist/{chunk-KTSJ2ZHA.js → chunk-PAU352SV.js} +5 -3
  88. package/dist/{chunk-KTSJ2ZHA.js.map → chunk-PAU352SV.js.map} +1 -1
  89. package/dist/chunk-PCE7QHXJ.js +68 -0
  90. package/dist/chunk-PCE7QHXJ.js.map +1 -0
  91. package/dist/chunk-PCHZY2I7.js +299 -0
  92. package/dist/chunk-PCHZY2I7.js.map +1 -0
  93. package/dist/chunk-PHF3D7ER.js +1042 -0
  94. package/dist/chunk-PHF3D7ER.js.map +1 -0
  95. package/dist/chunk-Q35YIDBV.js +1202 -0
  96. package/dist/chunk-Q35YIDBV.js.map +1 -0
  97. package/dist/chunk-RLR4TKUZ.js +4398 -0
  98. package/dist/chunk-RLR4TKUZ.js.map +1 -0
  99. package/dist/chunk-RNVYGWIC.js +30 -0
  100. package/dist/chunk-RNVYGWIC.js.map +1 -0
  101. package/dist/chunk-SE4JN5XN.js +19 -0
  102. package/dist/chunk-SE4JN5XN.js.map +1 -0
  103. package/dist/chunk-TIUTIOFB.js +25 -0
  104. package/dist/chunk-TIUTIOFB.js.map +1 -0
  105. package/dist/chunk-TU2WUBVZ.js +2 -0
  106. package/dist/chunk-TU2WUBVZ.js.map +1 -0
  107. package/dist/chunk-TZOYZK2E.js +98 -0
  108. package/dist/chunk-TZOYZK2E.js.map +1 -0
  109. package/dist/chunk-UKZNLVJW.js +17 -0
  110. package/dist/chunk-UKZNLVJW.js.map +1 -0
  111. package/dist/chunk-UZC7LDAQ.js +178 -0
  112. package/dist/chunk-UZC7LDAQ.js.map +1 -0
  113. package/dist/chunk-V46OILVC.js +3090 -0
  114. package/dist/chunk-V46OILVC.js.map +1 -0
  115. package/dist/chunk-WQE54PNH.js +1975 -0
  116. package/dist/chunk-WQE54PNH.js.map +1 -0
  117. package/dist/chunk-X3BPBDGQ.js +52 -0
  118. package/dist/chunk-X3BPBDGQ.js.map +1 -0
  119. package/dist/chunk-XSLV76YK.js +54 -0
  120. package/dist/chunk-XSLV76YK.js.map +1 -0
  121. package/dist/{chunk-5HNHEUD5.js → chunk-XYLUCIKQ.js} +3 -3
  122. package/dist/chunk-YEUYKR62.js +72 -0
  123. package/dist/chunk-YEUYKR62.js.map +1 -0
  124. package/dist/{chunk-G5CM2VGQ.js → chunk-YFQBFNQS.js} +8 -94
  125. package/dist/chunk-YFQBFNQS.js.map +1 -0
  126. package/dist/chunk-YIL4XLLJ.js +1661 -0
  127. package/dist/chunk-YIL4XLLJ.js.map +1 -0
  128. package/dist/chunk-YNHZHSSM.js +41 -0
  129. package/dist/chunk-YNHZHSSM.js.map +1 -0
  130. package/dist/chunk-YTCZRLTU.js +96 -0
  131. package/dist/chunk-YTCZRLTU.js.map +1 -0
  132. package/dist/chunk-YYBFZLAJ.js +374 -0
  133. package/dist/chunk-YYBFZLAJ.js.map +1 -0
  134. package/dist/chunk-ZXRAE55H.js +31 -0
  135. package/dist/chunk-ZXRAE55H.js.map +1 -0
  136. package/dist/cli-2QPR2OZG.js +232 -0
  137. package/dist/cli-2QPR2OZG.js.map +1 -0
  138. package/dist/cli-4IOPGZHR.js +1203 -0
  139. package/dist/cli-4IOPGZHR.js.map +1 -0
  140. package/dist/cli-5FL73WHA.js +346 -0
  141. package/dist/cli-5FL73WHA.js.map +1 -0
  142. package/dist/cli-C262QOWM.js +739 -0
  143. package/dist/cli-C262QOWM.js.map +1 -0
  144. package/dist/cli-LJLLIQB2.js +423 -0
  145. package/dist/cli-LJLLIQB2.js.map +1 -0
  146. package/dist/cli-OFPZ5MAS.js +626 -0
  147. package/dist/cli-OFPZ5MAS.js.map +1 -0
  148. package/dist/cli-SHSMSRQY.js +28 -0
  149. package/dist/cli-SHSMSRQY.js.map +1 -0
  150. package/dist/cli-SRHFUZHA.js +473 -0
  151. package/dist/cli-SRHFUZHA.js.map +1 -0
  152. package/dist/cli-URZQXL4K.js +552 -0
  153. package/dist/cli-URZQXL4K.js.map +1 -0
  154. package/dist/cli.d.ts +12 -2
  155. package/dist/cli.js +109 -7661
  156. package/dist/cli.js.map +1 -1
  157. package/dist/docmeta.js +15 -3
  158. package/dist/docmeta.js.map +1 -1
  159. package/dist/github-FE6KCNYJ.js +27 -0
  160. package/dist/github-FE6KCNYJ.js.map +1 -0
  161. package/dist/github-QXL3VMK2.js +32 -0
  162. package/dist/github-QXL3VMK2.js.map +1 -0
  163. package/dist/index.d.ts +65 -3
  164. package/dist/index.js +407 -337
  165. package/dist/index.js.map +1 -1
  166. package/dist/json-7WV7KL6H.js +17 -0
  167. package/dist/json-7WV7KL6H.js.map +1 -0
  168. package/dist/json-SGZ6ZRFD.js +35 -0
  169. package/dist/json-SGZ6ZRFD.js.map +1 -0
  170. package/dist/lint-DL4LJRAY.js +28 -0
  171. package/dist/lint-DL4LJRAY.js.map +1 -0
  172. package/dist/list-6BAXTZUM.js +29 -0
  173. package/dist/list-6BAXTZUM.js.map +1 -0
  174. package/dist/list-7BKNYPSB.js +31 -0
  175. package/dist/list-7BKNYPSB.js.map +1 -0
  176. package/dist/page-3U2GCFNE.js +41 -0
  177. package/dist/page-3U2GCFNE.js.map +1 -0
  178. package/dist/picker-3XF36MJF.js +14 -0
  179. package/dist/picker-3XF36MJF.js.map +1 -0
  180. package/dist/pretty-2H57QVTY.js +43 -0
  181. package/dist/pretty-2H57QVTY.js.map +1 -0
  182. package/dist/pretty-N6DO4OOL.js +37 -0
  183. package/dist/pretty-N6DO4OOL.js.map +1 -0
  184. package/dist/reporters-M6LJ2IYU.js +21 -0
  185. package/dist/reporters-M6LJ2IYU.js.map +1 -0
  186. package/dist/reporters-N6GHXSS7.js +42 -0
  187. package/dist/reporters-N6GHXSS7.js.map +1 -0
  188. package/dist/reporters-UCNEV7PH.js +71 -0
  189. package/dist/reporters-UCNEV7PH.js.map +1 -0
  190. package/dist/run-XZDAREJE.js +33 -0
  191. package/dist/run-XZDAREJE.js.map +1 -0
  192. package/dist/term-5ICGKPC3.js +1592 -0
  193. package/dist/term-5ICGKPC3.js.map +1 -0
  194. package/dist/types-Y6TXHM7M.js +10 -0
  195. package/dist/types-Y6TXHM7M.js.map +1 -0
  196. package/dist/validate-GQRM77YN.js +16 -0
  197. package/dist/validate-GQRM77YN.js.map +1 -0
  198. package/package.json +1 -1
  199. package/plugin/manni/.claude-plugin/plugin.json +9 -0
  200. package/plugin/manni/hooks/hooks.json +52 -0
  201. package/plugin/manni/skills/check/SKILL.md +20 -0
  202. package/plugin/manni/skills/evals/SKILL.md +27 -0
  203. package/plugin/manni/skills/fix/SKILL.md +56 -0
  204. package/plugin/manni/skills/setup/SKILL.md +41 -0
  205. package/dist/batch-A5HZKYIW.js +0 -18
  206. package/dist/calibrate-S5K6QHUY.js +0 -13
  207. package/dist/capture-OZEZDABQ.js +0 -15
  208. package/dist/chunk-3R23C5DT.js.map +0 -1
  209. package/dist/chunk-CFDUZRM2.js.map +0 -1
  210. package/dist/chunk-G5CM2VGQ.js.map +0 -1
  211. package/dist/chunk-KJR7OVDX.js.map +0 -1
  212. package/dist/chunk-V4KUVE47.js +0 -27170
  213. package/dist/chunk-V4KUVE47.js.map +0 -1
  214. package/dist/chunk-ZQBTK3DO.js +0 -26518
  215. package/dist/chunk-ZQBTK3DO.js.map +0 -1
  216. package/dist/picker-6HRMETE7.js +0 -12
  217. package/plugin/tracevals/.claude-plugin/plugin.json +0 -9
  218. package/plugin/tracevals/hooks/hooks.json +0 -17
  219. /package/dist/{batch-A5HZKYIW.js.map → batch-DFRCLY77.js.map} +0 -0
  220. /package/dist/{calibrate-S5K6QHUY.js.map → build-Q5C6SX5J.js.map} +0 -0
  221. /package/dist/{capture-OZEZDABQ.js.map → calibrate-XQILKXS3.js.map} +0 -0
  222. /package/dist/{picker-6HRMETE7.js.map → capture-JQMOC3BW.js.map} +0 -0
  223. /package/dist/{chunk-HAPTXWU2.js.map → chunk-MYC3O5EJ.js.map} +0 -0
  224. /package/dist/{chunk-5HNHEUD5.js.map → chunk-XYLUCIKQ.js.map} +0 -0
@@ -0,0 +1,455 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ errorSite,
4
+ messageFor,
5
+ shortCommit,
6
+ shortPin,
7
+ shortSrc,
8
+ spellAt
9
+ } from "./chunk-252LNOEG.js";
10
+ import {
11
+ parseSrc
12
+ } from "./chunk-G7NJSREW.js";
13
+ import {
14
+ palette
15
+ } from "./chunk-RNVYGWIC.js";
16
+
17
+ // src/cite/reporters/pretty.ts
18
+ var DIFF_LINE_CAP = 60;
19
+ var plural = (n, one, many = `${one}s`) => `${String(n)} ${n === 1 ? one : many}`;
20
+ function severityMark(severity, c) {
21
+ switch (severity) {
22
+ case "error":
23
+ return c.red("\u2717");
24
+ case "warning":
25
+ return c.yellow("\u2195");
26
+ case "notice":
27
+ return c.dim("\u2139");
28
+ }
29
+ }
30
+ function splitBaselined(page, result) {
31
+ if (result === void 0) return { reported: [...page.findings], baselined: [] };
32
+ const pool = [...result.errors];
33
+ const out = { reported: [], baselined: [] };
34
+ for (const finding of page.findings) {
35
+ const instancePath = finding.index === void 0 ? "" : `/citations/${String(finding.index)}`;
36
+ const line = errorSite(finding).line;
37
+ const at = pool.findIndex(
38
+ (e) => e.keyword === finding.rule && e.instancePath === instancePath && e.message === finding.message && (e.line ?? null) === (line ?? null)
39
+ );
40
+ if (at === -1) {
41
+ out.baselined.push(finding);
42
+ } else {
43
+ pool.splice(at, 1);
44
+ out.reported.push(finding);
45
+ }
46
+ }
47
+ return out;
48
+ }
49
+ function resultFor(run, index) {
50
+ const page = run.pages[index];
51
+ if (page === void 0) return void 0;
52
+ const aligned = run.results[index];
53
+ if (aligned !== void 0 && aligned.file === page.file) return aligned;
54
+ return run.results.find((r) => r.file === page.file);
55
+ }
56
+ function belongsTo(finding, result) {
57
+ return finding.index !== void 0 && finding.index === result.origin.index;
58
+ }
59
+ function labelOf(result) {
60
+ return result.citation.id ?? "";
61
+ }
62
+ function labelOfFinding(finding) {
63
+ if (finding.id !== void 0) return finding.id;
64
+ if (finding.index !== void 0) return `#${String(finding.index)}`;
65
+ return finding.src ?? "page";
66
+ }
67
+ function citesEncrypted(src) {
68
+ try {
69
+ return parseSrc(src).encrypted;
70
+ } catch {
71
+ return false;
72
+ }
73
+ }
74
+ function claimColumn(result) {
75
+ const { claim, marker } = result;
76
+ const anchoredByMarker = result.anchor === "marker" && result.markerLine !== void 0;
77
+ const moves = marker?.misplaced === void 0 ? "" : ` -> :${String(marker.misplaced.to)}`;
78
+ const where = anchoredByMarker ? `marker :${String(result.markerLine ?? 0)}${moves}` : claim?.fileLines === void 0 ? "" : `:${claim.fileLines}`;
79
+ if (claim === null) return where;
80
+ let status;
81
+ switch (claim.status) {
82
+ case "moved":
83
+ status = anchoredByMarker ? "moved" : `moved -> :${claim.newFileLines ?? "?"}`;
84
+ break;
85
+ case "moved-ambiguous": {
86
+ const at = (claim.candidateFileLines ?? []).map((lines) => `:${lines}`);
87
+ status = `moved, ${plural(at.length, "candidate")} (${at.join(", ")})`;
88
+ break;
89
+ }
90
+ case "reanchored": {
91
+ const since = claim.commitSha === void 0 ? "" : ` since ${shortCommit(claim.commitSha)}`;
92
+ const to = claim.newFileLines === void 0 ? "" : ` -> :${claim.newFileLines}`;
93
+ status = `reanchored${since}${to}`;
94
+ break;
95
+ }
96
+ case "changed":
97
+ status = changedText(claim);
98
+ break;
99
+ default:
100
+ status = claim.status;
101
+ }
102
+ return where === "" ? status : `${where} ${status}`;
103
+ }
104
+ function changedText(claim) {
105
+ if (claim.historyAvailable === false) return "changed (history unavailable; fetch-depth: 0)";
106
+ if (claim.commitSha === void 0) return "changed";
107
+ const since = claim.commitsSince ?? [];
108
+ const count = since.length === 0 ? "uncommitted" : plural(since.length, "commit");
109
+ return `changed since ${shortCommit(claim.commitSha)}, ${count}`;
110
+ }
111
+ function sourceColumn(result, opts, dim) {
112
+ const { source } = result;
113
+ const src = shortSrc(source.src);
114
+ const encrypted = citesEncrypted(source.src);
115
+ const reveal = (path) => opts.reveal === true && path !== void 0 && encrypted ? ` ${dim(`(${path})`)}` : "";
116
+ return `${src}${reveal(source.resolvedPath)} ${messageFor(source)}${reveal(source.resolvedNewPath)}`;
117
+ }
118
+ function diffLines(result, dim) {
119
+ const out = [];
120
+ for (const subject of result.source.commitsSince ?? []) out.push(dim(` ${subject}`));
121
+ const diff = result.source.diff;
122
+ if (diff === void 0 || diff === "") return out;
123
+ const lines = diff.split(/\r?\n/);
124
+ while (lines.length > 0 && lines[lines.length - 1] === "") lines.pop();
125
+ const shown = lines.slice(0, DIFF_LINE_CAP);
126
+ for (const line of shown) out.push(dim(` ${line}`));
127
+ const more = lines.length - shown.length;
128
+ if (more > 0) out.push(dim(` \u2026 (${plural(more, "more line")})`));
129
+ return out;
130
+ }
131
+ function claimLines(result, dim) {
132
+ const claim = result.claim;
133
+ const diff = claim?.diff;
134
+ if (claim === null || diff === void 0 || diff === "") {
135
+ return capped(claim?.text ?? [], dim);
136
+ }
137
+ const out = [];
138
+ for (const subject of claim.commitsSince ?? []) out.push(dim(` ${subject}`));
139
+ return [...out, ...capped(diff.split(/\r?\n/), dim)];
140
+ }
141
+ function capped(lines, dim) {
142
+ const shown = lines.slice(0, DIFF_LINE_CAP);
143
+ const out = shown.map((line) => dim(` ${line}`));
144
+ const more = lines.length - shown.length;
145
+ if (more > 0) out.push(dim(` \u2026 (${plural(more, "more line")})`));
146
+ return out;
147
+ }
148
+ function anchorSortLine(result) {
149
+ if (result.anchor === "marker" && result.markerLine !== void 0) return result.markerLine;
150
+ const first = result.claim?.fileLines?.split("-")[0];
151
+ if (first === void 0) return void 0;
152
+ const line = Number.parseInt(first, 10);
153
+ return Number.isNaN(line) ? void 0 : line;
154
+ }
155
+ function rowOrder(citations) {
156
+ return [...citations].sort((a, b) => {
157
+ const left = anchorSortLine(a);
158
+ const right = anchorSortLine(b);
159
+ if (left === void 0) return right === void 0 ? 0 : 1;
160
+ if (right === void 0) return -1;
161
+ return left - right;
162
+ });
163
+ }
164
+ function oneManifest(citations) {
165
+ const files = new Set(
166
+ citations.map((result) => result.origin.kind === "manifest" ? result.origin.file : void 0)
167
+ );
168
+ const [only, ...rest] = [...files];
169
+ return rest.length === 0 ? only : void 0;
170
+ }
171
+ function padTo(text, width, plain) {
172
+ return width <= plain ? text : text + " ".repeat(width - plain);
173
+ }
174
+ function renderCheckPretty(run, opts) {
175
+ const c = palette(opts.color);
176
+ const lines = [];
177
+ const quiet = opts.quiet ?? false;
178
+ const location = (finding) => {
179
+ const { file, line } = errorSite(finding);
180
+ if (line === void 0) return "";
181
+ if (file === void 0) return c.dim(` (line ${String(line)})`);
182
+ return c.dim(` (${file}:${String(line)})`);
183
+ };
184
+ run.pages.forEach((page, index) => {
185
+ const { reported, baselined: baselined2 } = splitBaselined(page, resultFor(run, index));
186
+ const errors = reported.filter((f) => f.severity === "error").length;
187
+ const warned = reported.some((f) => f.severity === "warning");
188
+ const forgiven = baselined2.length > 0 ? c.dim(` (${String(baselined2.length)} baselined)`) : "";
189
+ const manifest = oneManifest(page.citations);
190
+ const heading = manifest === void 0 ? page.file : `${page.file} ${c.dim(manifest)}`;
191
+ if (reported.length === 0) {
192
+ if (quiet) return;
193
+ lines.push(`${c.green("\u2713")} ${heading}${forgiven}`);
194
+ } else {
195
+ const mark = errors > 0 ? c.red("\u2717") : warned ? c.yellow("\u26A0") : c.dim("\u2139");
196
+ lines.push(`${mark} ${heading}${forgiven}`);
197
+ }
198
+ const isBaselined = new Set(baselined2);
199
+ const placed = /* @__PURE__ */ new Set();
200
+ const rows = [];
201
+ for (const result of rowOrder(page.citations)) {
202
+ const own = page.findings.filter((f) => belongsTo(f, result) && !placed.has(f));
203
+ for (const finding of own) placed.add(finding);
204
+ const live = own.filter((f) => !isBaselined.has(f));
205
+ if (own.length === 0 && quiet) continue;
206
+ const worst = live.find((f) => f.severity === "error") ?? live.find((f) => f.severity === "warning") ?? live[0];
207
+ const mark = worst !== void 0 ? severityMark(worst.severity, c) : own.length > 0 ? c.dim("\xB7") : result.source.status === "skipped" && result.claim === null ? c.dim("\xB7") : c.green("\u2713");
208
+ const endRules = /* @__PURE__ */ new Set(["claim-", "source-", "marker-misplaced"]);
209
+ const under = [];
210
+ for (const finding of own) {
211
+ const isEnd = [...endRules].some((prefix) => finding.rule.startsWith(prefix));
212
+ if (isEnd) continue;
213
+ const text = isBaselined.has(finding) ? c.dim(`${finding.message} (baselined)`) : finding.message;
214
+ under.push(` ${severityMark(finding.severity, c)} ${text}${location(finding)}`);
215
+ }
216
+ if (opts.showDiff) {
217
+ if (own.some((f) => f.rule === "source-changed")) under.push(...diffLines(result, c.dim));
218
+ if (own.some((f) => f.rule === "claim-changed" || f.rule === "claim-reanchored")) {
219
+ under.push(...claimLines(result, c.dim));
220
+ }
221
+ }
222
+ const forgivenEnd = own.length > 0 && live.length === 0 ? c.dim(" (baselined)") : "";
223
+ rows.push({
224
+ mark,
225
+ label: labelOf(result),
226
+ claim: claimColumn(result),
227
+ source: `${sourceColumn(result, opts, c.dim)}${forgivenEnd}`,
228
+ where: result.origin.kind === "manifest" && manifest === void 0 ? `${result.origin.file}${result.origin.line === void 0 ? "" : `:${String(result.origin.line)}`}` : "",
229
+ under
230
+ });
231
+ }
232
+ const width = (pick) => rows.reduce((n, row) => Math.max(n, pick(row).length), 0);
233
+ const labelWidth = width((row) => row.label);
234
+ const claimWidth = width((row) => row.claim);
235
+ const anyWhere = rows.some((row) => row.where !== "");
236
+ const sourceWidth = anyWhere ? width((row) => row.source) : 0;
237
+ for (const row of rows) {
238
+ const label = padTo(c.cyan(row.label), labelWidth, row.label.length);
239
+ const source = padTo(row.source, sourceWidth, row.source.length);
240
+ const text = ` ${row.mark} ${label} ${padTo(row.claim, claimWidth, row.claim.length)} ${source}${row.where === "" ? "" : ` ${c.dim(row.where)}`}`;
241
+ lines.push(text.replace(/\s+$/, ""));
242
+ lines.push(...row.under);
243
+ }
244
+ for (const finding of page.findings) {
245
+ if (placed.has(finding)) continue;
246
+ const label = c.cyan(labelOfFinding(finding));
247
+ lines.push(
248
+ isBaselined.has(finding) ? ` ${c.dim("\xB7")} ${label} ${c.dim(`${finding.message} (baselined)`)}${location(finding)}` : ` ${severityMark(finding.severity, c)} ${label} ${finding.message}${location(finding)}`
249
+ );
250
+ }
251
+ });
252
+ const { summary } = run;
253
+ const warnings = summary.warnings ?? 0;
254
+ const notices = summary.notices ?? 0;
255
+ const baselined = summary.baseline?.suppressed ?? 0;
256
+ const findings = summary.errors + warnings + notices + baselined;
257
+ const parts = [plural(findings, "finding")];
258
+ if (warnings > 0) parts.push(`(${plural(warnings, "warning")})`);
259
+ if (notices > 0) parts.push(`(${plural(notices, "notice")})`);
260
+ if (baselined > 0) parts.push(`(${String(baselined)} baselined)`);
261
+ const summaryText = `${plural(summary.files, "file")} checked, ${String(summary.passed)} passed, ${String(summary.failed)} failed, ${parts.join(" ")}`;
262
+ if (lines.length > 0) lines.push("");
263
+ lines.push(summary.failed > 0 ? c.red(summaryText) : c.green(summaryText));
264
+ if (summary.baseline?.written) {
265
+ lines.push(c.dim(`Baseline written to ${summary.baseline.path}`));
266
+ }
267
+ return lines.join("\n");
268
+ }
269
+ function spellAtSpec(spec) {
270
+ const span = spanOf(spec);
271
+ return span === void 0 ? `lines ${spec}` : spellAt(span);
272
+ }
273
+ function spanOf(spec) {
274
+ const [first, second] = spec.split("-");
275
+ const start = Number(first);
276
+ const end = second === void 0 ? start : Number(second);
277
+ if (!Number.isFinite(start) || !Number.isFinite(end)) return void 0;
278
+ return { start, end };
279
+ }
280
+ function widening(held, now) {
281
+ const was = spanOf(held);
282
+ const is = spanOf(now);
283
+ if (was === void 0 || is === void 0) return "";
284
+ const parts = [];
285
+ if (is.start < was.start) {
286
+ parts.push(spellAt({ start: is.start, end: Math.min(was.start - 1, is.end) }));
287
+ }
288
+ if (is.end > was.end) {
289
+ parts.push(spellAt({ start: Math.max(was.end + 1, is.start), end: is.end }));
290
+ }
291
+ if (parts.length === 0) return ", which held a marker line";
292
+ return `, ${parts.join(" and ")} newly pinned`;
293
+ }
294
+ function widened(rewrite) {
295
+ return rewrite.fromLines !== void 0 && rewrite.toLines !== void 0 && rewrite.fromLines !== rewrite.toLines;
296
+ }
297
+ function movedSpan(rewrite) {
298
+ if (widened(rewrite)) return `lines ${rewrite.fromLines ?? ""} -> ${rewrite.toLines ?? ""}`;
299
+ const at = rewrite.toLines ?? rewrite.fromLines ?? String(rewrite.at ?? 0);
300
+ return `at ${spellAtSpec(at)}`;
301
+ }
302
+ function refusalLine(rewrite) {
303
+ const at = shortCommit(rewrite.commitSha ?? "");
304
+ const where = `claim at ${spellAtSpec(String(rewrite.at ?? 0))} skipped:`;
305
+ if (rewrite.wordShare !== void 0) {
306
+ const share = Math.round(rewrite.wordShare * 100);
307
+ return `${where} that line now holds text sharing ${String(share)}% of the claim's words at ${at}. Re-add it with cite add.`;
308
+ }
309
+ return `${where} that line now holds different text than the claim at ${at}. Re-add it with cite add.`;
310
+ }
311
+ function recommitWhy(because) {
312
+ switch (because) {
313
+ case "not-in-history":
314
+ return "not in this branch's history";
315
+ case "not-contained":
316
+ case void 0:
317
+ return "did not contain the pinned lines";
318
+ }
319
+ }
320
+ function rewriteLine(rewrite) {
321
+ const word = rewrite.from.includes("-") ? "lines" : "line";
322
+ const status = rewrite.status === "never-true" ? "never true" : rewrite.status;
323
+ if (rewrite.end === "marker") {
324
+ return `marker line ${rewrite.from} -> ${rewrite.to} (misplaced)`;
325
+ }
326
+ if (rewrite.reason === "recommitted") {
327
+ const from = shortCommit(rewrite.fromCommit ?? "");
328
+ const to = shortCommit(rewrite.toCommit ?? "");
329
+ return `source ${shortSrc(rewrite.src ?? "")} commit ${from} -> ${to} (${recommitWhy(rewrite.because)})`;
330
+ }
331
+ if (rewrite.reason === "shifted") {
332
+ return `claim ${word} ${rewrite.from} -> ${rewrite.to} (shifted by a marker)`;
333
+ }
334
+ if (rewrite.reason === "re-anchored" && rewrite.status === "reanchored") {
335
+ const since = rewrite.commitSha === void 0 ? "" : ` since ${shortCommit(rewrite.commitSha)}`;
336
+ return `claim ${movedSpan(rewrite)} re-pinned (reanchored; words unchanged${since})`;
337
+ }
338
+ if (rewrite.reason === "re-anchored") {
339
+ const held = rewrite.lines ?? "";
340
+ const now = rewrite.newLines ?? "";
341
+ return `claim re-pinned over ${spellAtSpec(now)} (moved; was ${spellAtSpec(held)}${widening(held, now)})`;
342
+ }
343
+ if (rewrite.reason === "moved") {
344
+ return rewrite.end === "claim" ? `claim ${word} ${rewrite.from} -> ${rewrite.to} (moved)` : `source ${shortSrc(rewrite.from)} -> ${shortSrc(rewrite.to)} (moved)`;
345
+ }
346
+ if (rewrite.end === "claim") {
347
+ if (widened(rewrite)) {
348
+ return `claim ${movedSpan(rewrite)} re-pinned (${status}; now "${rewrite.text ?? ""}")`;
349
+ }
350
+ const where2 = rewrite.markerLine === void 0 ? `line ${String(rewrite.at ?? 0)}` : `marker line ${String(rewrite.markerLine)}`;
351
+ return `claim at ${where2} re-pinned (${status}; now "${rewrite.text ?? ""}")`;
352
+ }
353
+ const at = rewrite.commitSha === void 0 ? "" : ` at ${shortCommit(rewrite.commitSha)}`;
354
+ const src = shortSrc(rewrite.src ?? "");
355
+ const where = rewrite.toLines === void 0 ? src : `${src} -> ${atLines(src, rewrite.toLines)}`;
356
+ return `source ${where} re-pinned${at} (${status}; ${shortPin(rewrite.from)} -> ${shortPin(rewrite.to)})`;
357
+ }
358
+ function atLines(src, lines) {
359
+ const colon = src.lastIndexOf(":");
360
+ return `${colon === -1 ? src : src.slice(0, colon)}:${lines}`;
361
+ }
362
+ function renderUpdatePretty(run, opts) {
363
+ const c = palette(opts.color);
364
+ const lines = [];
365
+ let files = 0;
366
+ for (const page of run.pages) {
367
+ if (page.rewritten.length > 0) files += 1;
368
+ if (opts.showDiff && page.diff !== "") {
369
+ for (const line of page.diff.split(/\r?\n/)) {
370
+ if (line !== "") lines.push(c.dim(line));
371
+ }
372
+ }
373
+ for (const rewrite of page.rewritten) {
374
+ const label = rewrite.id ?? `#${String(rewrite.index)}`;
375
+ lines.push(`${page.file}: ${c.cyan(label)} ${rewriteLine(rewrite)}`);
376
+ }
377
+ for (const rewrite of page.refused) {
378
+ const label = rewrite.id ?? `#${String(rewrite.index)}`;
379
+ lines.push(`${page.file}: ${c.cyan(label)} ${refusalLine(rewrite)}`);
380
+ }
381
+ for (const finding of page.skipped) {
382
+ const mark = severityMark(finding.severity, c);
383
+ lines.push(
384
+ `${page.file}: ${c.cyan(labelOfFinding(finding))} ${mark} skipped: ${finding.message}`
385
+ );
386
+ }
387
+ }
388
+ if (opts.showDiff) {
389
+ for (const manifest of run.manifests ?? []) {
390
+ for (const line of manifest.diff.split(/\r?\n/)) {
391
+ if (line !== "") lines.push(c.dim(line));
392
+ }
393
+ }
394
+ }
395
+ const summary = `${plural(run.rewritten, "citation")} rewritten in ${plural(files, "file")}, ${String(run.skipped)} skipped`;
396
+ lines.push(run.exitCode === 0 ? c.green(summary) : c.red(summary));
397
+ return lines.join("\n");
398
+ }
399
+ function spellLineList(at, noun) {
400
+ if (at.length === 0) return noun;
401
+ const spelled = at.map((line) => String(line));
402
+ if (spelled.length === 1) return `${noun} ${spelled[0] ?? ""}`;
403
+ const last = spelled[spelled.length - 1] ?? "";
404
+ return `${noun}s ${spelled.slice(0, -1).join(", ")} and ${last}`;
405
+ }
406
+ function removalLine(removal, c) {
407
+ const markers = spellLineList(removal.markerLines, "line");
408
+ if (removal.origin === void 0) {
409
+ const named = removal.markerLines.length === 1 ? "the marker" : "the markers";
410
+ return `removed ${named} ${c.cyan(removal.id ?? "")} at ${markers}, which named no entry`;
411
+ }
412
+ const name = removal.id ?? `/citations/${String(removal.index ?? 0)}`;
413
+ const where = removal.origin.kind === "manifest" ? `${removal.origin.file}${removal.origin.line === void 0 ? "" : `:${String(removal.origin.line)}`}` : "frontmatter";
414
+ const also = removal.markerLines.length === 0 ? "" : `, and ${removal.markerLines.length === 1 ? "its marker" : "its markers"} at ${markers}`;
415
+ return `removed ${c.cyan(name)} from ${where}${also}`;
416
+ }
417
+ function renderRemovePretty(run, opts) {
418
+ const c = palette(opts.color);
419
+ const lines = [];
420
+ let files = 0;
421
+ for (const page of run.pages) {
422
+ if (page.removed.length > 0) files += 1;
423
+ if (opts.showDiff && page.diff !== "") {
424
+ for (const line of page.diff.split(/\r?\n/)) {
425
+ if (line !== "") lines.push(c.dim(line));
426
+ }
427
+ }
428
+ for (const removal of page.removed) {
429
+ lines.push(`${page.file}: ${removalLine(removal, c)}`);
430
+ }
431
+ }
432
+ if (opts.showDiff) {
433
+ for (const manifest of run.manifests ?? []) {
434
+ for (const line of manifest.diff.split(/\r?\n/)) {
435
+ if (line !== "") lines.push(c.dim(line));
436
+ }
437
+ }
438
+ }
439
+ const verb = opts.dryRun === true ? "would be removed" : "removed";
440
+ lines.push(c.green(`${plural(run.removed, "citation")} ${verb} from ${plural(files, "file")}`));
441
+ return lines.join("\n");
442
+ }
443
+
444
+ export {
445
+ DIFF_LINE_CAP,
446
+ splitBaselined,
447
+ resultFor,
448
+ renderCheckPretty,
449
+ refusalLine,
450
+ rewriteLine,
451
+ renderUpdatePretty,
452
+ removalLine,
453
+ renderRemovePretty
454
+ };
455
+ //# sourceMappingURL=chunk-BUXDLRDT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cite/reporters/pretty.ts"],"sourcesContent":["/**\n * Pretty output for `check` and `update`.\n *\n * A citation is one row: its name, its claim end, its source end, and, when a\n * manifest owns the entry, where that is. Both ends read in file lines, the\n * only lines a person sees. Marks: ✓ current, ✗ error, ↕ warning, ℹ notice,\n * · skipped or baselined; a file line is ✓, ✗ (an error), ⚠ (a warning, no\n * error) or ℹ (notices only). Diffs, commit subjects and a changed claim's\n * current lines print only under `showDiff`; a decrypted path only under\n * `reveal`. Colour via `shouldColor`; never under `--no-color`/`NO_COLOR`.\n */\nimport type { ValidationResult } from \"../../meta/index.js\";\nimport { palette } from \"../../shared/color.js\";\nimport { errorSite, messageFor } from \"../core/adapt.js\";\nimport { parseSrc } from \"../core/range.js\";\nimport { shortCommit, shortPin, shortSrc, spellAt } from \"../core/spell.js\";\nimport type {\n CheckRun,\n CitationFinding,\n CitationResult,\n PageCitationReport,\n RecommitReason,\n Removal,\n RemoveRun,\n UpdateRewrite,\n UpdateRun,\n} from \"../types.js\";\n\nexport interface PrettyOptions {\n color: boolean;\n quiet?: boolean;\n showDiff?: boolean;\n reveal?: boolean;\n /** `remove --dry-run`: the footer says what the run would have removed. */\n dryRun?: boolean;\n}\n\n/** Diff lines printed under a `changed` row before the rest is elided. */\nexport const DIFF_LINE_CAP = 60;\n\nconst plural = (n: number, one: string, many = `${one}s`): string =>\n `${String(n)} ${n === 1 ? one : many}`;\n\n/** A finding's mark, by severity: ✗ error, ↕ warning, ℹ notice. */\nfunction severityMark(severity: CitationFinding[\"severity\"], c: ReturnType<typeof palette>): string {\n switch (severity) {\n case \"error\":\n return c.red(\"✗\");\n case \"warning\":\n return c.yellow(\"↕\");\n case \"notice\":\n return c.dim(\"ℹ\");\n }\n}\n\n/** A page's findings, split into the ones the baseline let through and the ones it forgave. */\nexport interface SplitFindings {\n reported: CitationFinding[];\n baselined: CitationFinding[];\n}\n\n/**\n * Which of a page's findings the run actually reported.\n *\n * The baseline works on the adapted `ValidationResult`: a forgiven finding is\n * removed from `errors` and counted in `baselined`, while `pages[].findings`\n * keeps every finding the check produced. So a finding is baselined exactly\n * when no error in the adapted result is left to account for it. Each error\n * is consumed once, so two identical findings need two identical errors.\n */\nexport function splitBaselined(\n page: PageCitationReport,\n result: ValidationResult | undefined,\n): SplitFindings {\n if (result === undefined) return { reported: [...page.findings], baselined: [] };\n const pool = [...result.errors];\n const out: SplitFindings = { reported: [], baselined: [] };\n for (const finding of page.findings) {\n const instancePath =\n finding.index === undefined ? \"\" : `/citations/${String(finding.index)}`;\n // A finding that sits on a manifest carries that file's line, and one\n // whose manifest lies outside the tree carries no line at all.\n const line = errorSite(finding).line;\n const at = pool.findIndex(\n (e) =>\n e.keyword === finding.rule &&\n e.instancePath === instancePath &&\n e.message === finding.message &&\n (e.line ?? null) === (line ?? null),\n );\n if (at === -1) {\n out.baselined.push(finding);\n } else {\n pool.splice(at, 1);\n out.reported.push(finding);\n }\n }\n return out;\n}\n\n/** The adapted result for a page: same position first, then by file label. */\nexport function resultFor(run: CheckRun, index: number): ValidationResult | undefined {\n const page = run.pages[index];\n if (page === undefined) return undefined;\n const aligned = run.results[index];\n if (aligned !== undefined && aligned.file === page.file) return aligned;\n return run.results.find((r) => r.file === page.file);\n}\n\n/** Whether a finding is about this citation. Every entry has an index, in either channel. */\nfunction belongsTo(finding: CitationFinding, result: CitationResult): boolean {\n return finding.index !== undefined && finding.index === result.origin.index;\n}\n\n/** `<id>`, else nothing: the ends say which entry it is. */\nfunction labelOf(result: CitationResult): string {\n return result.citation.id ?? \"\";\n}\n\n/** A page-level finding's label: its id, its index, or the source it names. */\nfunction labelOfFinding(finding: CitationFinding): string {\n if (finding.id !== undefined) return finding.id;\n if (finding.index !== undefined) return `#${String(finding.index)}`;\n return finding.src ?? \"page\";\n}\n\n/** Whether the entry spelled this source encrypted. */\nfunction citesEncrypted(src: string): boolean {\n try {\n return parseSrc(src).encrypted;\n } catch {\n return false;\n }\n}\n\n/**\n * The claim end column: where it is, in file lines, and how it reads. A marker\n * says where it is and, when it is misplaced, where it belongs. Its claim\n * status reads bare: the marker's own line is what a reader acts on.\n */\nfunction claimColumn(result: CitationResult): string {\n const { claim, marker } = result;\n const anchoredByMarker = result.anchor === \"marker\" && result.markerLine !== undefined;\n const moves = marker?.misplaced === undefined ? \"\" : ` -> :${String(marker.misplaced.to)}`;\n const where = anchoredByMarker\n ? `marker :${String(result.markerLine ?? 0)}${moves}`\n : claim?.fileLines === undefined\n ? \"\"\n : `:${claim.fileLines}`;\n if (claim === null) return where;\n let status: string;\n switch (claim.status) {\n case \"moved\":\n status = anchoredByMarker ? \"moved\" : `moved -> :${claim.newFileLines ?? \"?\"}`;\n break;\n case \"moved-ambiguous\": {\n const at = (claim.candidateFileLines ?? []).map((lines) => `:${lines}`);\n status = `moved, ${plural(at.length, \"candidate\")} (${at.join(\", \")})`;\n break;\n }\n case \"reanchored\": {\n const since = claim.commitSha === undefined ? \"\" : ` since ${shortCommit(claim.commitSha)}`;\n const to = claim.newFileLines === undefined ? \"\" : ` -> :${claim.newFileLines}`;\n status = `reanchored${since}${to}`;\n break;\n }\n case \"changed\":\n status = changedText(claim);\n break;\n default:\n status = claim.status;\n }\n return where === \"\" ? status : `${where} ${status}`;\n}\n\n/** How a changed claim's column says since when, as the source column does. */\nfunction changedText(claim: NonNullable<CitationResult[\"claim\"]>): string {\n if (claim.historyAvailable === false) return \"changed (history unavailable; fetch-depth: 0)\";\n if (claim.commitSha === undefined) return \"changed\";\n const since = claim.commitsSince ?? [];\n const count = since.length === 0 ? \"uncommitted\" : plural(since.length, \"commit\");\n return `changed since ${shortCommit(claim.commitSha)}, ${count}`;\n}\n\n/**\n * The source end column: the source as the entry spelled it, plus the\n * decrypted path only under `reveal`, and only beside an encrypted source,\n * the one spelling that hides it.\n */\nfunction sourceColumn(\n result: CitationResult,\n opts: PrettyOptions,\n dim: (s: string) => string,\n): string {\n const { source } = result;\n const src = shortSrc(source.src);\n const encrypted = citesEncrypted(source.src);\n const reveal = (path: string | undefined): string =>\n opts.reveal === true && path !== undefined && encrypted ? ` ${dim(`(${path})`)}` : \"\";\n // A source that followed its text to another file has a second ciphertext\n // in the message, and `--reveal` is the one place either is a path.\n return `${src}${reveal(source.resolvedPath)} ${messageFor(source)}${reveal(source.resolvedNewPath)}`;\n}\n\n/** The subjects and diff under a changed source, dim, the diff capped. */\nfunction diffLines(result: CitationResult, dim: (s: string) => string): string[] {\n const out: string[] = [];\n for (const subject of result.source.commitsSince ?? []) out.push(dim(` ${subject}`));\n const diff = result.source.diff;\n if (diff === undefined || diff === \"\") return out;\n const lines = diff.split(/\\r?\\n/);\n while (lines.length > 0 && lines[lines.length - 1] === \"\") lines.pop();\n const shown = lines.slice(0, DIFF_LINE_CAP);\n for (const line of shown) out.push(dim(` ${line}`));\n const more = lines.length - shown.length;\n if (more > 0) out.push(dim(` … (${plural(more, \"more line\")})`));\n return out;\n}\n\n/**\n * What `--show-diff` adds under a claim row: the page's commit subjects since\n * the baseline and the claim's own diff. With no baseline there is no diff to\n * print, so a changed claim shows the lines it covers now instead.\n */\nfunction claimLines(result: CitationResult, dim: (s: string) => string): string[] {\n const claim = result.claim;\n const diff = claim?.diff;\n if (claim === null || diff === undefined || diff === \"\") {\n return capped(claim?.text ?? [], dim);\n }\n const out: string[] = [];\n for (const subject of claim.commitsSince ?? []) out.push(dim(` ${subject}`));\n return [...out, ...capped(diff.split(/\\r?\\n/), dim)];\n}\n\n/** Lines under a row, dim and capped, with a count of the ones left out. */\nfunction capped(lines: readonly string[], dim: (s: string) => string): string[] {\n const shown = lines.slice(0, DIFF_LINE_CAP);\n const out = shown.map((line) => dim(` ${line}`));\n const more = lines.length - shown.length;\n if (more > 0) out.push(dim(` … (${plural(more, \"more line\")})`));\n return out;\n}\n\n/**\n * The line a row sorts on: the marker's line for a marker-anchored entry,\n * else the claim's first file line. That is the line the row opens with, so\n * the claim column climbs down the page. A bare pin anchors nowhere and has\n * none.\n */\nfunction anchorSortLine(result: CitationResult): number | undefined {\n if (result.anchor === \"marker\" && result.markerLine !== undefined) return result.markerLine;\n const first = result.claim?.fileLines?.split(\"-\")[0];\n if (first === undefined) return undefined;\n const line = Number.parseInt(first, 10);\n return Number.isNaN(line) ? undefined : line;\n}\n\n/**\n * A page's citations in the order their rows print: by anchor line, with the\n * bare pins after them in the order the page keeps them. The entries\n * themselves are left alone, so json and the findings keep frontmatter order.\n */\nfunction rowOrder(citations: readonly CitationResult[]): CitationResult[] {\n return [...citations].sort((a, b) => {\n const left = anchorSortLine(a);\n const right = anchorSortLine(b);\n if (left === undefined) return right === undefined ? 0 : 1;\n if (right === undefined) return -1;\n return left - right;\n });\n}\n\n/** One row of a page's citation table, before the columns are padded. */\ninterface Row {\n mark: string;\n label: string;\n claim: string;\n source: string;\n where: string;\n /** Lines printed under the row: findings that are not an end, and diffs. */\n under: string[];\n}\n\n/**\n * The one manifest every citation of a page came from, or `undefined` when\n * the page has none, or when its rows come from more than one place (a\n * frontmatter entry among them counts as another place).\n */\nfunction oneManifest(citations: readonly CitationResult[]): string | undefined {\n const files = new Set(\n citations.map((result) => (result.origin.kind === \"manifest\" ? result.origin.file : undefined)),\n );\n const [only, ...rest] = [...files];\n return rest.length === 0 ? only : undefined;\n}\n\nfunction padTo(text: string, width: number, plain: number): string {\n // Colour codes are not width, so the visible length is passed in.\n return width <= plain ? text : text + \" \".repeat(width - plain);\n}\n\nexport function renderCheckPretty(run: CheckRun, opts: PrettyOptions): string {\n const c = palette(opts.color);\n const lines: string[] = [];\n const quiet = opts.quiet ?? false;\n // A finding about an entry a manifest owns names the manifest, because\n // its line is a line of that file and not of the page above it.\n const location = (finding: CitationFinding): string => {\n const { file, line } = errorSite(finding);\n if (line === undefined) return \"\";\n if (file === undefined) return c.dim(` (line ${String(line)})`);\n return c.dim(` (${file}:${String(line)})`);\n };\n\n run.pages.forEach((page, index) => {\n const { reported, baselined } = splitBaselined(page, resultFor(run, index));\n const errors = reported.filter((f) => f.severity === \"error\").length;\n const warned = reported.some((f) => f.severity === \"warning\");\n // \"baselined\" is a participle, not a noun: 1 baselined, 2 baselined.\n const forgiven =\n baselined.length > 0 ? c.dim(` (${String(baselined.length)} baselined)`) : \"\";\n // Every row names one manifest: a page's own under `{page}` (proposal\n // 0058), or a shared one. Said once on the page's line, not on each row.\n const manifest = oneManifest(page.citations);\n const heading = manifest === undefined ? page.file : `${page.file} ${c.dim(manifest)}`;\n\n if (reported.length === 0) {\n if (quiet) return;\n lines.push(`${c.green(\"✓\")} ${heading}${forgiven}`);\n } else {\n // The most severe finding marks the file. Only ✗ is a failure.\n const mark = errors > 0 ? c.red(\"✗\") : warned ? c.yellow(\"⚠\") : c.dim(\"ℹ\");\n lines.push(`${mark} ${heading}${forgiven}`);\n }\n\n const isBaselined = new Set(baselined);\n const placed = new Set<CitationFinding>();\n const rows: Row[] = [];\n\n for (const result of rowOrder(page.citations)) {\n const own = page.findings.filter((f) => belongsTo(f, result) && !placed.has(f));\n for (const finding of own) placed.add(finding);\n const live = own.filter((f) => !isBaselined.has(f));\n if (own.length === 0 && quiet) continue;\n const worst =\n live.find((f) => f.severity === \"error\") ??\n live.find((f) => f.severity === \"warning\") ??\n live[0];\n const mark =\n worst !== undefined\n ? severityMark(worst.severity, c)\n : own.length > 0\n ? c.dim(\"·\")\n : result.source.status === \"skipped\" && result.claim === null\n ? c.dim(\"·\")\n : c.green(\"✓\");\n\n // The ends are the row; anything else about the entry is a line under\n // it. A misplaced marker is part of the row too: it reads there as\n // `marker :<line> -> :<place>`.\n const endRules = new Set([\"claim-\", \"source-\", \"marker-misplaced\"]);\n const under: string[] = [];\n for (const finding of own) {\n const isEnd = [...endRules].some((prefix) => finding.rule.startsWith(prefix));\n if (isEnd) continue;\n const text = isBaselined.has(finding)\n ? c.dim(`${finding.message} (baselined)`)\n : finding.message;\n under.push(` ${severityMark(finding.severity, c)} ${text}${location(finding)}`);\n }\n if (opts.showDiff) {\n if (own.some((f) => f.rule === \"source-changed\")) under.push(...diffLines(result, c.dim));\n if (own.some((f) => f.rule === \"claim-changed\" || f.rule === \"claim-reanchored\")) {\n under.push(...claimLines(result, c.dim));\n }\n }\n const forgivenEnd = own.length > 0 && live.length === 0 ? c.dim(\" (baselined)\") : \"\";\n rows.push({\n mark,\n label: labelOf(result),\n claim: claimColumn(result),\n source: `${sourceColumn(result, opts, c.dim)}${forgivenEnd}`,\n where:\n result.origin.kind === \"manifest\" && manifest === undefined\n ? `${result.origin.file}${result.origin.line === undefined ? \"\" : `:${String(result.origin.line)}`}`\n : \"\",\n under,\n });\n }\n\n // Columns are as wide as this page needs them, and no wider.\n const width = (pick: (row: Row) => string): number =>\n rows.reduce((n, row) => Math.max(n, pick(row).length), 0);\n const labelWidth = width((row) => row.label);\n const claimWidth = width((row) => row.claim);\n const anyWhere = rows.some((row) => row.where !== \"\");\n const sourceWidth = anyWhere ? width((row) => row.source) : 0;\n for (const row of rows) {\n const label = padTo(c.cyan(row.label), labelWidth, row.label.length);\n const source = padTo(row.source, sourceWidth, row.source.length);\n const text = ` ${row.mark} ${label} ${padTo(row.claim, claimWidth, row.claim.length)} ${source}${row.where === \"\" ? \"\" : ` ${c.dim(row.where)}`}`;\n lines.push(text.replace(/\\s+$/, \"\"));\n lines.push(...row.under);\n }\n\n // Findings about no entry: a marker naming nothing, a reserved page key.\n for (const finding of page.findings) {\n if (placed.has(finding)) continue;\n const label = c.cyan(labelOfFinding(finding));\n lines.push(\n isBaselined.has(finding)\n ? ` ${c.dim(\"·\")} ${label} ${c.dim(`${finding.message} (baselined)`)}${location(finding)}`\n : ` ${severityMark(finding.severity, c)} ${label} ${finding.message}${location(finding)}`,\n );\n }\n });\n\n const { summary } = run;\n const warnings = summary.warnings ?? 0;\n const notices = summary.notices ?? 0;\n const baselined = summary.baseline?.suppressed ?? 0;\n const findings = summary.errors + warnings + notices + baselined;\n const parts = [plural(findings, \"finding\")];\n if (warnings > 0) parts.push(`(${plural(warnings, \"warning\")})`);\n if (notices > 0) parts.push(`(${plural(notices, \"notice\")})`);\n if (baselined > 0) parts.push(`(${String(baselined)} baselined)`);\n const summaryText = `${plural(summary.files, \"file\")} checked, ${String(summary.passed)} passed, ${String(summary.failed)} failed, ${parts.join(\" \")}`;\n if (lines.length > 0) lines.push(\"\");\n lines.push(summary.failed > 0 ? c.red(summaryText) : c.green(summaryText));\n if (summary.baseline?.written) {\n lines.push(c.dim(`Baseline written to ${summary.baseline.path}`));\n }\n return lines.join(\"\\n\");\n}\n\n/** `line 9`, or `lines 9-12`, from a line spec. */\nfunction spellAtSpec(spec: string): string {\n const span = spanOf(spec);\n return span === undefined ? `lines ${spec}` : spellAt(span);\n}\n\n/** A line spec as numbers, or undefined when it does not read as one. */\nfunction spanOf(spec: string): { start: number; end: number } | undefined {\n const [first, second] = spec.split(\"-\");\n const start = Number(first);\n const end = second === undefined ? start : Number(second);\n if (!Number.isFinite(start) || !Number.isFinite(end)) return undefined;\n return { start, end };\n}\n\n/**\n * What a re-pin over the unit newly covers, so the widening is in the log as\n * well as in the diff. A span that only lost marker lines gains nothing, and\n * says that instead.\n */\nfunction widening(held: string, now: string): string {\n const was = spanOf(held);\n const is = spanOf(now);\n if (was === undefined || is === undefined) return \"\";\n const parts: string[] = [];\n if (is.start < was.start) {\n parts.push(spellAt({ start: is.start, end: Math.min(was.start - 1, is.end) }));\n }\n if (is.end > was.end) {\n parts.push(spellAt({ start: Math.max(was.end + 1, is.start), end: is.end }));\n }\n if (parts.length === 0) return \", which held a marker line\";\n return `, ${parts.join(\" and \")} newly pinned`;\n}\n\n/** Whether a re-pin covered a span other than the stored one. */\nfunction widened(rewrite: UpdateRewrite): boolean {\n return (\n rewrite.fromLines !== undefined &&\n rewrite.toLines !== undefined &&\n rewrite.fromLines !== rewrite.toLines\n );\n}\n\n/** `lines 9 -> 9-12` for a re-pin that moved, `at line 9` for one that did not. */\nfunction movedSpan(rewrite: UpdateRewrite): string {\n if (widened(rewrite)) return `lines ${rewrite.fromLines ?? \"\"} -> ${rewrite.toLines ?? \"\"}`;\n const at = rewrite.toLines ?? rewrite.fromLines ?? String(rewrite.at ?? 0);\n return `at ${spellAtSpec(at)}`;\n}\n\n/**\n * What one claim `--accept` refused to re-pin says, and what to do about it.\n * The line names which test refused it: the share is printed when overlap is\n * what fired, and the text is called different when no sentence was shared.\n */\nexport function refusalLine(rewrite: UpdateRewrite): string {\n const at = shortCommit(rewrite.commitSha ?? \"\");\n const where = `claim at ${spellAtSpec(String(rewrite.at ?? 0))} skipped:`;\n if (rewrite.wordShare !== undefined) {\n const share = Math.round(rewrite.wordShare * 100);\n return `${where} that line now holds text sharing ${String(share)}% of the claim's words at ${at}. Re-add it with cite add.`;\n }\n return `${where} that line now holds different text than the claim at ${at}. Re-add it with cite add.`;\n}\n\n/**\n * Why a pin was re-committed, as its row says it. Exhaustive, so a new reason\n * is a type error here rather than a row that quietly reads as the old one. No\n * reason at all is the containment case, which is all `--recommit` once knew.\n */\nfunction recommitWhy(because: RecommitReason | undefined): string {\n switch (because) {\n case \"not-in-history\":\n return \"not in this branch's history\";\n case \"not-contained\":\n case undefined:\n return \"did not contain the pinned lines\";\n }\n}\n\n/** What one rewritten end says it did. */\nexport function rewriteLine(rewrite: UpdateRewrite): string {\n const word = rewrite.from.includes(\"-\") ? \"lines\" : \"line\";\n const status = rewrite.status === \"never-true\" ? \"never true\" : rewrite.status;\n if (rewrite.end === \"marker\") {\n return `marker line ${rewrite.from} -> ${rewrite.to} (misplaced)`;\n }\n // The pin held; only its date was wrong. The row names both commits, so the\n // log says what the entry claimed before it was corrected.\n if (rewrite.reason === \"recommitted\") {\n const from = shortCommit(rewrite.fromCommit ?? \"\");\n const to = shortCommit(rewrite.toCommit ?? \"\");\n return `source ${shortSrc(rewrite.src ?? \"\")} commit ${from} -> ${to} (${recommitWhy(rewrite.because)})`;\n }\n if (rewrite.reason === \"shifted\") {\n return `claim ${word} ${rewrite.from} -> ${rewrite.to} (shifted by a marker)`;\n }\n // The words held while the anchor moved (0053). A claim-lines entry moved\n // onto its new run, so the row names both spans.\n if (rewrite.reason === \"re-anchored\" && rewrite.status === \"reanchored\") {\n const since = rewrite.commitSha === undefined ? \"\" : ` since ${shortCommit(rewrite.commitSha)}`;\n return `claim ${movedSpan(rewrite)} re-pinned (reanchored; words unchanged${since})`;\n }\n if (rewrite.reason === \"re-anchored\") {\n const held = rewrite.lines ?? \"\";\n const now = rewrite.newLines ?? \"\";\n return `claim re-pinned over ${spellAtSpec(now)} (moved; was ${spellAtSpec(held)}${widening(held, now)})`;\n }\n if (rewrite.reason === \"moved\") {\n return rewrite.end === \"claim\"\n ? `claim ${word} ${rewrite.from} -> ${rewrite.to} (moved)`\n : `source ${shortSrc(rewrite.from)} -> ${shortSrc(rewrite.to)} (moved)`;\n }\n if (rewrite.end === \"claim\") {\n // A re-pin over a unit wider than the stored lines names both spans, so\n // the widening is in the log as well as in the diff.\n if (widened(rewrite)) {\n return `claim ${movedSpan(rewrite)} re-pinned (${status}; now \"${rewrite.text ?? \"\"}\")`;\n }\n // A marker anchors its claim, so the marker's line is where the entry is,\n // as `check` reports it. A claim-lines entry reads at the claim.\n const where =\n rewrite.markerLine === undefined\n ? `line ${String(rewrite.at ?? 0)}`\n : `marker line ${String(rewrite.markerLine)}`;\n return `claim at ${where} re-pinned (${status}; now \"${rewrite.text ?? \"\"}\")`;\n }\n const at = rewrite.commitSha === undefined ? \"\" : ` at ${shortCommit(rewrite.commitSha)}`;\n const src = shortSrc(rewrite.src ?? \"\");\n // A re-mint over the span the old first and last line now bracket names both\n // ranges, so the log says which lines were accepted.\n const where = rewrite.toLines === undefined ? src : `${src} -> ${atLines(src, rewrite.toLines)}`;\n return `source ${where} re-pinned${at} (${status}; ${shortPin(rewrite.from)} -> ${shortPin(rewrite.to)})`;\n}\n\n/** The same source spelled at other lines: `path:200-212` and `\"200-215\"` read `path:200-215`. */\nfunction atLines(src: string, lines: string): string {\n const colon = src.lastIndexOf(\":\");\n return `${colon === -1 ? src : src.slice(0, colon)}:${lines}`;\n}\n\nexport function renderUpdatePretty(run: UpdateRun, opts: PrettyOptions): string {\n const c = palette(opts.color);\n const lines: string[] = [];\n let files = 0;\n for (const page of run.pages) {\n if (page.rewritten.length > 0) files += 1;\n if (opts.showDiff && page.diff !== \"\") {\n for (const line of page.diff.split(/\\r?\\n/)) {\n if (line !== \"\") lines.push(c.dim(line));\n }\n }\n for (const rewrite of page.rewritten) {\n const label = rewrite.id ?? `#${String(rewrite.index)}`;\n lines.push(`${page.file}: ${c.cyan(label)} ${rewriteLine(rewrite)}`);\n }\n // A claim `--accept` refused reads beside the rewrites, because it is the\n // one row `--accept` was asked for and did not write.\n for (const rewrite of page.refused) {\n const label = rewrite.id ?? `#${String(rewrite.index)}`;\n lines.push(`${page.file}: ${c.cyan(label)} ${refusalLine(rewrite)}`);\n }\n for (const finding of page.skipped) {\n const mark = severityMark(finding.severity, c);\n lines.push(\n `${page.file}: ${c.cyan(labelOfFinding(finding))} ${mark} skipped: ${finding.message}`,\n );\n }\n }\n // The manifests, after the pages: a dry run owes the diff of every file it\n // would have written, and an entry a manifest owns is written there.\n if (opts.showDiff) {\n for (const manifest of run.manifests ?? []) {\n for (const line of manifest.diff.split(/\\r?\\n/)) {\n if (line !== \"\") lines.push(c.dim(line));\n }\n }\n }\n const summary = `${plural(run.rewritten, \"citation\")} rewritten in ${plural(files, \"file\")}, ${String(run.skipped)} skipped`;\n lines.push(run.exitCode === 0 ? c.green(summary) : c.red(summary));\n return lines.join(\"\\n\");\n}\n\n/** `line 30`, or `lines 30 and 42` for several, as a sentence reads them. */\nfunction spellLineList(at: readonly number[], noun: string): string {\n // No lines is the noun alone. Every caller has at least one, and a\n // sentence reading \"lines and \" would be the only sign that one did not.\n if (at.length === 0) return noun;\n const spelled = at.map((line) => String(line));\n if (spelled.length === 1) return `${noun} ${spelled[0] ?? \"\"}`;\n const last = spelled[spelled.length - 1] ?? \"\";\n return `${noun}s ${spelled.slice(0, -1).join(\", \")} and ${last}`;\n}\n\n/** What one removal says it did: the entry, where it was kept, and its markers. */\nexport function removalLine(removal: Removal, c: ReturnType<typeof palette>): string {\n const markers = spellLineList(removal.markerLines, \"line\");\n if (removal.origin === undefined) {\n // A marker naming no entry: there is nothing else to report about it.\n const named = removal.markerLines.length === 1 ? \"the marker\" : \"the markers\";\n return `removed ${named} ${c.cyan(removal.id ?? \"\")} at ${markers}, which named no entry`;\n }\n const name = removal.id ?? `/citations/${String(removal.index ?? 0)}`;\n const where =\n removal.origin.kind === \"manifest\"\n ? `${removal.origin.file}${removal.origin.line === undefined ? \"\" : `:${String(removal.origin.line)}`}`\n : \"frontmatter\";\n const also =\n removal.markerLines.length === 0\n ? \"\"\n : `, and ${removal.markerLines.length === 1 ? \"its marker\" : \"its markers\"} at ${markers}`;\n return `removed ${c.cyan(name)} from ${where}${also}`;\n}\n\nexport function renderRemovePretty(run: RemoveRun, opts: PrettyOptions): string {\n const c = palette(opts.color);\n const lines: string[] = [];\n let files = 0;\n for (const page of run.pages) {\n if (page.removed.length > 0) files += 1;\n if (opts.showDiff && page.diff !== \"\") {\n for (const line of page.diff.split(/\\r?\\n/)) {\n if (line !== \"\") lines.push(c.dim(line));\n }\n }\n for (const removal of page.removed) {\n lines.push(`${page.file}: ${removalLine(removal, c)}`);\n }\n }\n // The manifests, after the pages, as `update` prints them.\n if (opts.showDiff) {\n for (const manifest of run.manifests ?? []) {\n for (const line of manifest.diff.split(/\\r?\\n/)) {\n if (line !== \"\") lines.push(c.dim(line));\n }\n }\n }\n const verb = opts.dryRun === true ? \"would be removed\" : \"removed\";\n lines.push(c.green(`${plural(run.removed, \"citation\")} ${verb} from ${plural(files, \"file\")}`));\n return lines.join(\"\\n\");\n}\n"],"mappings":";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