@hawkeyexl/manni 2.3.6 → 2.3.7

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.
@@ -70,7 +70,7 @@ import {
70
70
  withValueAt,
71
71
  writeEncryptionKey,
72
72
  writeFileAtomic
73
- } from "./chunk-UUXTFBWD.js";
73
+ } from "./chunk-D5FTEP3H.js";
74
74
 
75
75
  // src/meta/core/reencrypt.ts
76
76
  import { extname } from "node:path";
@@ -3213,6 +3213,9 @@ function rewriteOf(plan) {
3213
3213
  at: plan.unit.lines.start,
3214
3214
  text: normalizeWhitespace(plan.unit.text.join("\n"))
3215
3215
  };
3216
+ if (plan.result.anchor === "marker" && plan.result.markerLine !== void 0) {
3217
+ out.markerLine = plan.result.markerLine;
3218
+ }
3216
3219
  return out;
3217
3220
  }
3218
3221
  case "source-accepted": {
@@ -3600,6 +3603,22 @@ function claimLines(result, dim) {
3600
3603
  if (more > 0) out.push(dim(` \u2026 (${plural2(more, "more line")})`));
3601
3604
  return out;
3602
3605
  }
3606
+ function anchorSortLine(result) {
3607
+ if (result.anchor === "marker" && result.markerLine !== void 0) return result.markerLine;
3608
+ const first = result.claim?.fileLines?.split("-")[0];
3609
+ if (first === void 0) return void 0;
3610
+ const line = Number.parseInt(first, 10);
3611
+ return Number.isNaN(line) ? void 0 : line;
3612
+ }
3613
+ function rowOrder(citations) {
3614
+ return [...citations].sort((a, b) => {
3615
+ const left = anchorSortLine(a);
3616
+ const right = anchorSortLine(b);
3617
+ if (left === void 0) return right === void 0 ? 0 : 1;
3618
+ if (right === void 0) return -1;
3619
+ return left - right;
3620
+ });
3621
+ }
3603
3622
  function padTo(text, width, plain) {
3604
3623
  return width <= plain ? text : text + " ".repeat(width - plain);
3605
3624
  }
@@ -3628,7 +3647,7 @@ function renderCheckPretty(run3, opts) {
3628
3647
  const isBaselined = new Set(baselined2);
3629
3648
  const placed = /* @__PURE__ */ new Set();
3630
3649
  const rows = [];
3631
- for (const result of page.citations) {
3650
+ for (const result of rowOrder(page.citations)) {
3632
3651
  const own = page.findings.filter((f) => belongsTo(f, result) && !placed.has(f));
3633
3652
  for (const finding2 of own) placed.add(finding2);
3634
3653
  const live = own.filter((f) => !isBaselined.has(f));
@@ -3701,7 +3720,8 @@ function rewriteLine(rewrite) {
3701
3720
  return rewrite.end === "claim" ? `claim ${word} ${rewrite.from} -> ${rewrite.to} (moved)` : `source ${shortSrc(rewrite.from)} -> ${shortSrc(rewrite.to)} (moved)`;
3702
3721
  }
3703
3722
  if (rewrite.end === "claim") {
3704
- return `claim at line ${String(rewrite.at ?? 0)} re-pinned (${status}; now "${rewrite.text ?? ""}")`;
3723
+ const where = rewrite.markerLine === void 0 ? `line ${String(rewrite.at ?? 0)}` : `marker line ${String(rewrite.markerLine)}`;
3724
+ return `claim at ${where} re-pinned (${status}; now "${rewrite.text ?? ""}")`;
3705
3725
  }
3706
3726
  const at2 = rewrite.commitSha === void 0 ? "" : ` at ${shortCommit(rewrite.commitSha)}`;
3707
3727
  return `source ${shortSrc(rewrite.src ?? "")} re-pinned${at2} (${status}; ${shortPin(rewrite.from)} -> ${shortPin(rewrite.to)})`;
@@ -3781,7 +3801,11 @@ function renderCheckJson(run3) {
3781
3801
  return JSON.stringify({ summary: run3.summary, pages: run3.pages.map(publicPage) }, null, 2);
3782
3802
  }
3783
3803
  function renderUpdateJson(run3) {
3784
- return JSON.stringify(run3, null, 2);
3804
+ const pages = run3.pages.map((page) => ({
3805
+ ...page,
3806
+ rewritten: page.rewritten.map(({ markerLine: _pretty, ...rewrite }) => rewrite)
3807
+ }));
3808
+ return JSON.stringify({ ...run3, pages }, null, 2);
3785
3809
  }
3786
3810
 
3787
3811
  // src/cite/reporters/github.ts
@@ -4265,4 +4289,4 @@ export {
4265
4289
  runKeyRotate,
4266
4290
  runKeySet
4267
4291
  };
4268
- //# sourceMappingURL=chunk-CGE2SVW7.js.map
4292
+ //# sourceMappingURL=chunk-Y2XNDEM6.js.map