@eliya-oss/agent-diff 0.1.0-alpha.219 → 0.1.0-alpha.220
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/CHANGELOG.md +15 -0
- package/dist/main.js +198 -113
- package/dist/web/nitro.json +1 -1
- package/dist/web/public/assets/{index-Drcgn18b.js → index-RB6aBuh0.js} +2 -2
- package/dist/web/public/assets/{review-n355efiY.js → review-DV4b3ziW.js} +1 -1
- package/dist/web/server/_ssr/{review-C9HjDh4D.mjs → review-CrJpbEai.mjs} +2 -2
- package/dist/web/server/_ssr/{router-D1afwNBo.mjs → router--oWwEEA0.mjs} +4 -4
- package/dist/web/server/_ssr/ssr.mjs +2 -2
- package/dist/web/server/{_tanstack-start-manifest_v-B_8y6kG9.mjs → _tanstack-start-manifest_v-Bp3WfTRd.mjs} +4 -4
- package/dist/web/server/index.mjs +14 -14
- package/package.json +1 -1
- package/skills/adiff/SKILL.md +8 -3
package/dist/main.js
CHANGED
|
@@ -10119,7 +10119,7 @@ var init_config = __esmMin((() => {
|
|
|
10119
10119
|
//#region package.json
|
|
10120
10120
|
init_pane();
|
|
10121
10121
|
init_config();
|
|
10122
|
-
var version$2 = "0.1.0-alpha.
|
|
10122
|
+
var version$2 = "0.1.0-alpha.220";
|
|
10123
10123
|
//#endregion
|
|
10124
10124
|
//#region src/cli/error.ts
|
|
10125
10125
|
var UnknownCommand, MissingOption, UnknownField, UnknownOption, RemovedOption, UnexpectedArgument, SeveralIds, IdGivenTwice, BadOption, RegistryUnanswered, NotServed, BadRequest, PageNotShipped, PageStopped;
|
|
@@ -10761,7 +10761,7 @@ var init_catalog = __esmMin((() => {
|
|
|
10761
10761
|
name: "file",
|
|
10762
10762
|
required: true,
|
|
10763
10763
|
value: "path|-",
|
|
10764
|
-
about: "The document, as a file path or - to read stdin: {\"summary\":\"…\",\"layers\":[{\"title\":\"…\",\"note\":\"…\",\"spans\":[{\"path\":\"…\",\"start\":1,\"end\":9}]}]}. A layer may carry blocks instead of spans, interleaving {\"kind\":\"prose\",\"markdown\":\"…\"} with {\"kind\":\"code\",\"path\":\"…\",\"start\":1,\"end\":9}. A layer may hold sublayers instead of code: {\"title\":\"…\",\"note\":\"…\",\"layers\":[…]} with two or more layers inside, each with its own spans or blocks and no layers of its own"
|
|
10764
|
+
about: "The document, as a file path or - to read stdin: {\"summary\":\"…\",\"layers\":[{\"title\":\"…\",\"note\":\"…\",\"spans\":[{\"path\":\"…\",\"start\":1,\"end\":9}]}]}. A layer may carry blocks instead of spans, interleaving {\"kind\":\"prose\",\"markdown\":\"…\"} with {\"kind\":\"code\",\"path\":\"…\",\"start\":1,\"end\":9}. Lines count on the new side, and a span holds the lines removed between them; a span with \"side\":\"old\" holds removed lines by their old line numbers. A layer may hold sublayers instead of code: {\"title\":\"…\",\"note\":\"…\",\"layers\":[…]} with two or more layers inside, each with its own spans or blocks and no layers of its own"
|
|
10765
10765
|
}],
|
|
10766
10766
|
dataKey: "layers",
|
|
10767
10767
|
example: "adiff layers set --file -"
|
|
@@ -11551,7 +11551,7 @@ var init_report$1 = __esmMin((() => {
|
|
|
11551
11551
|
},
|
|
11552
11552
|
MalformedLayers: {
|
|
11553
11553
|
exit: 2,
|
|
11554
|
-
suggestion: "A layers is {\"summary\":\"…\",\"layers\":[{\"title\":\"…\",\"spans\":[{\"path\":\"…\",\"start\":1,\"end\":9}]}]}. A layer may hold two or more sublayers in \"layers\" in place of its spans.",
|
|
11554
|
+
suggestion: "A layers is {\"summary\":\"…\",\"layers\":[{\"title\":\"…\",\"spans\":[{\"path\":\"…\",\"start\":1,\"end\":9}]}]}. A span counts new line numbers, or old ones with \"side\":\"old\". A layer may hold two or more sublayers in \"layers\" in place of its spans.",
|
|
11555
11555
|
retriable: false
|
|
11556
11556
|
},
|
|
11557
11557
|
NoLayers: {
|
|
@@ -12198,12 +12198,12 @@ var init_sticky = __esmMin((() => {
|
|
|
12198
12198
|
}));
|
|
12199
12199
|
//#endregion
|
|
12200
12200
|
//#region src/domain/patch/anchor.ts
|
|
12201
|
-
var sideOf$
|
|
12201
|
+
var sideOf$2, linesOn, anchorFor, rowsForRange, sideLines, runsAt, nearestRun, SHORTEST_NEAR, PER_EDIT, edits, isNear, nearestLike, exactlyIn, alikeIn, againIn, foundExactly, sourceLines, foundInScope;
|
|
12202
12202
|
var init_anchor = __esmMin((() => {
|
|
12203
12203
|
init_dist();
|
|
12204
12204
|
init_model$5();
|
|
12205
12205
|
init_sticky();
|
|
12206
|
-
sideOf$
|
|
12206
|
+
sideOf$2 = (rows) => rows.some((row) => isSome(row.newLine)) ? "new" : "old";
|
|
12207
12207
|
linesOn = (rows, side) => rows.flatMap((row) => match$3(lineOn(row, side), {
|
|
12208
12208
|
onNone: () => [],
|
|
12209
12209
|
onSome: (n) => [n]
|
|
@@ -12212,7 +12212,7 @@ var init_anchor = __esmMin((() => {
|
|
|
12212
12212
|
const [low, high] = from <= to ? [from, to] : [to, from];
|
|
12213
12213
|
const rows = patch.rows.slice(low, high + 1);
|
|
12214
12214
|
if (rows.length === 0) return none();
|
|
12215
|
-
const side = wanted ?? sideOf$
|
|
12215
|
+
const side = wanted ?? sideOf$2(rows);
|
|
12216
12216
|
const onSide = rows.filter((row) => isSome(lineOn(row, side)));
|
|
12217
12217
|
const lines = linesOn(onSide, side);
|
|
12218
12218
|
if (lines.length === 0) return none();
|
|
@@ -12404,7 +12404,7 @@ var init_order = __esmMin((() => {
|
|
|
12404
12404
|
}));
|
|
12405
12405
|
//#endregion
|
|
12406
12406
|
//#region src/domain/patch/reindent.ts
|
|
12407
|
-
var LCS_ROOM, body, isBlock, openBlock, sideOf, blocksOf$1, at, fillRow, lcsTable, joined, stepAt, walked, canFold, folded, rowsOf, reindexed, foldReindents;
|
|
12407
|
+
var LCS_ROOM, body, isBlock, openBlock, sideOf$1, blocksOf$1, at, fillRow, lcsTable, joined, stepAt, walked, canFold, folded, rowsOf, reindexed, foldReindents;
|
|
12408
12408
|
var init_reindent = __esmMin((() => {
|
|
12409
12409
|
LCS_ROOM = 1e6;
|
|
12410
12410
|
body = (row) => row.text.trimStart();
|
|
@@ -12413,7 +12413,7 @@ var init_reindent = __esmMin((() => {
|
|
|
12413
12413
|
removed: [],
|
|
12414
12414
|
added: []
|
|
12415
12415
|
});
|
|
12416
|
-
sideOf = (block, row) => row.kind === "removed" ? block.removed : block.added;
|
|
12416
|
+
sideOf$1 = (block, row) => row.kind === "removed" ? block.removed : block.added;
|
|
12417
12417
|
blocksOf$1 = (rows) => {
|
|
12418
12418
|
const out = [];
|
|
12419
12419
|
for (const row of rows) {
|
|
@@ -12424,7 +12424,7 @@ var init_reindent = __esmMin((() => {
|
|
|
12424
12424
|
const last = out.at(-1);
|
|
12425
12425
|
const block = last !== void 0 && isBlock(last) ? last : openBlock();
|
|
12426
12426
|
if (block !== last) out.push(block);
|
|
12427
|
-
sideOf(block, row).push(row);
|
|
12427
|
+
sideOf$1(block, row).push(row);
|
|
12428
12428
|
}
|
|
12429
12429
|
return out;
|
|
12430
12430
|
};
|
|
@@ -13259,6 +13259,7 @@ var init_schema = __esmMin((() => {
|
|
|
13259
13259
|
path: String$1,
|
|
13260
13260
|
start: Int,
|
|
13261
13261
|
end: Int,
|
|
13262
|
+
side: optionalKey(Side),
|
|
13262
13263
|
text: optionalKey(String$1)
|
|
13263
13264
|
});
|
|
13264
13265
|
Split = Struct({
|
|
@@ -13314,7 +13315,7 @@ var init_paths = __esmMin((() => {
|
|
|
13314
13315
|
}));
|
|
13315
13316
|
//#endregion
|
|
13316
13317
|
//#region src/service/store/service.ts
|
|
13317
|
-
var Store, ensureDir, readOptional, missing$2, damaged, jsonOf$2, decoded, unwritable, besideOf$1, wrote, added$1, INDENT, DRAFTS_VERSION, encoded, writes, appends, writeSettings, writeUpgradeCheck, writeState, writeLayers, writeRemarks, writeDrafts, writeBatch, writeAnswer, asSettings, asUpgradeCheck, asBatch, asAnswer, asState, asLayers, asRemarks, asDrafts, asWatching, asListening, linesOf, readLines, parseSettings, parseUpgradeCheck, parseState, parseLayers, parseRemarks, idsIn$1, takes, handedOps, cursorOps, waitOps, settingsOps, upgradeOps, reportOps, branchKeyIn, branchKeyOf, wasKeyOf, there, moved, adopt, SPLIT, ADOPT_SIZE, adopting, keyIn, answerOps, layersOps, remarksOps, inboxOps, STATE_LOCK, DRAFTS_LOCK, held$
|
|
13318
|
+
var Store, ensureDir, readOptional, missing$2, damaged, jsonOf$2, decoded, unwritable, besideOf$1, wrote, added$1, INDENT, DRAFTS_VERSION, encoded, writes, appends, writeSettings, writeUpgradeCheck, writeState, writeLayers, writeRemarks, writeDrafts, writeBatch, writeAnswer, asSettings, asUpgradeCheck, asBatch, asAnswer, asState, asLayers, asRemarks, asDrafts, asWatching, asListening, linesOf, readLines, parseSettings, parseUpgradeCheck, parseState, parseLayers, parseRemarks, idsIn$1, takes, handedOps, cursorOps, waitOps, settingsOps, upgradeOps, reportOps, branchKeyIn, branchKeyOf, wasKeyOf, there, moved, adopt, SPLIT, ADOPT_SIZE, adopting, keyIn, answerOps, layersOps, remarksOps, inboxOps, STATE_LOCK, DRAFTS_LOCK, held$3, stale$1, stolen, taken, freed, alone, watchOps, draftsOps, stateOps, makeStore, madeStore, storeAt;
|
|
13318
13319
|
var init_service$2 = __esmMin((() => {
|
|
13319
13320
|
init_dist();
|
|
13320
13321
|
init_git();
|
|
@@ -13645,7 +13646,7 @@ var init_service$2 = __esmMin((() => {
|
|
|
13645
13646
|
waitMs: 50,
|
|
13646
13647
|
staleMs: 3e4
|
|
13647
13648
|
};
|
|
13648
|
-
held$
|
|
13649
|
+
held$3 = (path) => tryPromise({
|
|
13649
13650
|
try: () => writeFile(path, `${process.pid}`, { flag: "wx" }),
|
|
13650
13651
|
catch: (cause) => new StoreUnwritable({
|
|
13651
13652
|
path,
|
|
@@ -13653,8 +13654,8 @@ var init_service$2 = __esmMin((() => {
|
|
|
13653
13654
|
})
|
|
13654
13655
|
});
|
|
13655
13656
|
stale$1 = (path, waiting) => promise(() => stat(path).then((found) => Date.now() - found.mtimeMs > waiting.staleMs, () => false));
|
|
13656
|
-
stolen = (path, waiting, cause) => flatMap(stale$1(path, waiting), (old) => old ? flatMap(promise(() => rm(path, { force: true })), () => held$
|
|
13657
|
-
taken = (path, waiting) => retry(held$
|
|
13657
|
+
stolen = (path, waiting, cause) => flatMap(stale$1(path, waiting), (old) => old ? flatMap(promise(() => rm(path, { force: true })), () => held$3(path)) : fail(cause));
|
|
13658
|
+
taken = (path, waiting) => retry(held$3(path).pipe(catchTag("StoreUnwritable", (cause) => stolen(path, waiting, cause))), {
|
|
13658
13659
|
times: waiting.tries,
|
|
13659
13660
|
schedule: spaced$1(waiting.waitMs)
|
|
13660
13661
|
});
|
|
@@ -13841,29 +13842,95 @@ var init_model$3 = __esmMin((() => {
|
|
|
13841
13842
|
REMAINDER_TITLE = "not in any layer";
|
|
13842
13843
|
}));
|
|
13843
13844
|
//#endregion
|
|
13845
|
+
//#region src/domain/layers/side.ts
|
|
13846
|
+
var sideOf, nearestBelow, nearestAbove, placedRows, linedOf, placedHunk, placedPatch, heldAt$1, holdsRow;
|
|
13847
|
+
var init_side = __esmMin((() => {
|
|
13848
|
+
init_dist();
|
|
13849
|
+
sideOf = (span) => span.side ?? "new";
|
|
13850
|
+
nearestBelow = (rows) => {
|
|
13851
|
+
const found = Array.from({ length: rows.length });
|
|
13852
|
+
let seen;
|
|
13853
|
+
for (let at = rows.length - 1; at >= 0; at--) {
|
|
13854
|
+
found[at] = seen;
|
|
13855
|
+
seen = rows[at]?.new ?? seen;
|
|
13856
|
+
}
|
|
13857
|
+
return found;
|
|
13858
|
+
};
|
|
13859
|
+
nearestAbove = (rows) => {
|
|
13860
|
+
const found = Array.from({ length: rows.length });
|
|
13861
|
+
let seen;
|
|
13862
|
+
for (const [at, row] of rows.entries()) {
|
|
13863
|
+
found[at] = seen;
|
|
13864
|
+
seen = row.new ?? seen;
|
|
13865
|
+
}
|
|
13866
|
+
return found;
|
|
13867
|
+
};
|
|
13868
|
+
placedRows = (rows) => {
|
|
13869
|
+
const below = nearestBelow(rows);
|
|
13870
|
+
const above = nearestAbove(rows);
|
|
13871
|
+
return rows.map((row, at) => {
|
|
13872
|
+
switch (row.kind) {
|
|
13873
|
+
case "added": return {
|
|
13874
|
+
kind: "added",
|
|
13875
|
+
new: row.new,
|
|
13876
|
+
old: void 0
|
|
13877
|
+
};
|
|
13878
|
+
case "removed": return {
|
|
13879
|
+
kind: "removed",
|
|
13880
|
+
new: below[at] ?? above[at],
|
|
13881
|
+
old: row.old
|
|
13882
|
+
};
|
|
13883
|
+
default: return;
|
|
13884
|
+
}
|
|
13885
|
+
});
|
|
13886
|
+
};
|
|
13887
|
+
linedOf = (row) => ({
|
|
13888
|
+
kind: row.kind,
|
|
13889
|
+
new: getOrUndefined$1(row.newLine),
|
|
13890
|
+
old: getOrUndefined$1(row.oldLine)
|
|
13891
|
+
});
|
|
13892
|
+
placedHunk = (hunk) => placedRows(hunk.rows.map(linedOf)).filter((placed) => placed !== void 0);
|
|
13893
|
+
placedPatch = (patch) => new Map(patch.hunks.flatMap((hunk) => {
|
|
13894
|
+
const placed = placedRows(hunk.rows.map(linedOf));
|
|
13895
|
+
return hunk.rows.flatMap((row, at) => {
|
|
13896
|
+
const one = placed[at];
|
|
13897
|
+
return one === void 0 ? [] : [[row, one]];
|
|
13898
|
+
});
|
|
13899
|
+
}));
|
|
13900
|
+
heldAt$1 = (placed, reaches) => {
|
|
13901
|
+
const onNew = placed.new ?? placed.old;
|
|
13902
|
+
if (onNew !== void 0 && reaches("new", onNew)) return true;
|
|
13903
|
+
return placed.kind === "removed" && placed.old !== void 0 && reaches("old", placed.old);
|
|
13904
|
+
};
|
|
13905
|
+
holdsRow = (spans, path, placed) => heldAt$1(placed, (side, line) => spans.some((span) => span.path === path && sideOf(span) === side && span.start <= line && span.end >= line));
|
|
13906
|
+
}));
|
|
13907
|
+
//#endregion
|
|
13844
13908
|
//#region src/domain/layers/coverage.ts
|
|
13845
|
-
var codeBlockOf$1, codeBlocks, noteOf$1, spansOf$1,
|
|
13909
|
+
var spanOf$1, codeBlockOf$1, codeBlocks, noteOf$1, spansOf$1, NOTHING, reachesOf, bySide, claimsOf, reaching, held$2, holdsAny$2, changedHunks, claimedRows, linesClaimed, runsOf, spanOn, missingRuns, tallyOf, coverage, sharedIn, sharedHunks, runsSaid, filesSaid, leftSaid, unordered, withFullCoverage, proseAnchors;
|
|
13846
13910
|
var init_coverage = __esmMin((() => {
|
|
13847
|
-
init_dist();
|
|
13848
13911
|
init_model$3();
|
|
13912
|
+
init_side();
|
|
13913
|
+
spanOf$1 = (block) => block.side === "old" ? {
|
|
13914
|
+
path: block.path,
|
|
13915
|
+
start: block.start,
|
|
13916
|
+
end: block.end,
|
|
13917
|
+
side: "old"
|
|
13918
|
+
} : {
|
|
13919
|
+
path: block.path,
|
|
13920
|
+
start: block.start,
|
|
13921
|
+
end: block.end
|
|
13922
|
+
};
|
|
13849
13923
|
codeBlockOf$1 = (span) => ({
|
|
13850
13924
|
kind: "code",
|
|
13851
|
-
|
|
13852
|
-
start: span.start,
|
|
13853
|
-
end: span.end
|
|
13925
|
+
...spanOf$1(span)
|
|
13854
13926
|
});
|
|
13855
13927
|
codeBlocks = (layer) => layer.blocks.filter((block) => block.kind === "code");
|
|
13856
13928
|
noteOf$1 = (layer) => layer.blocks.filter((block) => block.kind === "prose").map((block) => block.markdown.trim()).filter((markdown) => markdown.length > 0).join(" ");
|
|
13857
|
-
spansOf$1 = (layers) => layers.flatMap((layer) => codeBlocks(layer).map(
|
|
13858
|
-
|
|
13859
|
-
|
|
13860
|
-
|
|
13861
|
-
}
|
|
13862
|
-
changedLines = (hunk) => hunk.rows.filter((row) => row.kind !== "context").flatMap((row) => match$3(orElse(row.newLine, () => row.oldLine), {
|
|
13863
|
-
onNone: () => [],
|
|
13864
|
-
onSome: (line) => [line]
|
|
13865
|
-
}));
|
|
13866
|
-
NOTHING = [];
|
|
13929
|
+
spansOf$1 = (layers) => layers.flatMap((layer) => codeBlocks(layer).map(spanOf$1));
|
|
13930
|
+
NOTHING = {
|
|
13931
|
+
new: [],
|
|
13932
|
+
old: []
|
|
13933
|
+
};
|
|
13867
13934
|
reachesOf = (spans) => {
|
|
13868
13935
|
const reaches = [];
|
|
13869
13936
|
const ordered = spans.filter((span) => span.start <= span.end).toSorted((a, b) => a.start - b.start);
|
|
@@ -13877,6 +13944,10 @@ var init_coverage = __esmMin((() => {
|
|
|
13877
13944
|
}
|
|
13878
13945
|
return reaches;
|
|
13879
13946
|
};
|
|
13947
|
+
bySide = (spans) => ({
|
|
13948
|
+
new: reachesOf(spans.filter((span) => sideOf(span) === "new")),
|
|
13949
|
+
old: reachesOf(spans.filter((span) => sideOf(span) === "old"))
|
|
13950
|
+
});
|
|
13880
13951
|
claimsOf = (spans) => {
|
|
13881
13952
|
const byPath = /* @__PURE__ */ new Map();
|
|
13882
13953
|
for (const span of spans) {
|
|
@@ -13884,7 +13955,7 @@ var init_coverage = __esmMin((() => {
|
|
|
13884
13955
|
if (held === void 0) byPath.set(span.path, [span]);
|
|
13885
13956
|
else held.push(span);
|
|
13886
13957
|
}
|
|
13887
|
-
return new Map([...byPath].map(([path, held]) => [path,
|
|
13958
|
+
return new Map([...byPath].map(([path, held]) => [path, bySide(held)]));
|
|
13888
13959
|
};
|
|
13889
13960
|
reaching = (reaches, line) => {
|
|
13890
13961
|
let low = 0;
|
|
@@ -13898,15 +13969,13 @@ var init_coverage = __esmMin((() => {
|
|
|
13898
13969
|
const last = reaches[low - 1];
|
|
13899
13970
|
return last !== void 0 && last.end >= line;
|
|
13900
13971
|
};
|
|
13901
|
-
|
|
13902
|
-
|
|
13903
|
-
|
|
13904
|
-
onSome: (line) => reaching(reaches, line)
|
|
13905
|
-
});
|
|
13972
|
+
held$2 = (reaches, placed) => heldAt$1(placed, (side, line) => reaching(reaches[side], line));
|
|
13973
|
+
holdsAny$2 = (reaches, changed) => changed.some((placed) => held$2(reaches, placed));
|
|
13974
|
+
changedHunks = (patch) => patch.hunks.map(placedHunk).filter((changed) => changed.length > 0);
|
|
13906
13975
|
claimedRows = (claims, patch) => {
|
|
13907
|
-
const reaches = claims.get(patch.path)
|
|
13908
|
-
if (reaches
|
|
13909
|
-
return patch.
|
|
13976
|
+
const reaches = claims.get(patch.path);
|
|
13977
|
+
if (reaches === void 0) return [];
|
|
13978
|
+
return changedHunks(patch).flatMap((changed) => changed.filter((placed) => held$2(reaches, placed)));
|
|
13910
13979
|
};
|
|
13911
13980
|
linesClaimed = (patches, layer) => {
|
|
13912
13981
|
const claims = claimsOf(spansOf$1([layer]));
|
|
@@ -13916,50 +13985,64 @@ var init_coverage = __esmMin((() => {
|
|
|
13916
13985
|
removed: rows.filter((row) => row.kind === "removed").length
|
|
13917
13986
|
};
|
|
13918
13987
|
};
|
|
13919
|
-
runsOf = (path, lines) => {
|
|
13988
|
+
runsOf = (path, side, lines) => {
|
|
13920
13989
|
const runs = [];
|
|
13921
13990
|
for (const line of lines.toSorted((a, b) => a - b)) {
|
|
13922
13991
|
const open = runs.at(-1);
|
|
13923
13992
|
if (open !== void 0 && line <= open.end + 1) open.end = Math.max(open.end, line);
|
|
13924
13993
|
else runs.push({
|
|
13925
|
-
path,
|
|
13926
13994
|
start: line,
|
|
13927
13995
|
end: line
|
|
13928
13996
|
});
|
|
13929
13997
|
}
|
|
13930
|
-
return runs;
|
|
13998
|
+
return runs.map((run) => spanOn(path, side, run));
|
|
13999
|
+
};
|
|
14000
|
+
spanOn = (path, side, run) => side === "old" ? {
|
|
14001
|
+
path,
|
|
14002
|
+
start: run.start,
|
|
14003
|
+
end: run.end,
|
|
14004
|
+
side
|
|
14005
|
+
} : {
|
|
14006
|
+
path,
|
|
14007
|
+
start: run.start,
|
|
14008
|
+
end: run.end
|
|
13931
14009
|
};
|
|
13932
|
-
|
|
13933
|
-
|
|
14010
|
+
missingRuns = (path, loose) => [...runsOf(path, "new", loose.flatMap((placed) => placed.kind === "added" && placed.new !== void 0 ? [placed.new] : [])), ...runsOf(path, "old", loose.flatMap((placed) => placed.kind === "removed" && placed.old !== void 0 ? [placed.old] : []))];
|
|
14011
|
+
tallyOf = (changed, reaches) => {
|
|
14012
|
+
const loose = changed.filter((placed) => !held$2(reaches, placed));
|
|
13934
14013
|
const whole = changed.length > 0 && loose.length === 0;
|
|
13935
14014
|
const some = loose.length > 0 && loose.length < changed.length;
|
|
13936
14015
|
return {
|
|
13937
14016
|
covered: whole ? 1 : 0,
|
|
13938
14017
|
partial: some ? 1 : 0,
|
|
13939
|
-
|
|
14018
|
+
loose
|
|
13940
14019
|
};
|
|
13941
14020
|
};
|
|
13942
|
-
changedHunks = (patch) => patch.hunks.map(changedLines).filter((changed) => changed.length > 0);
|
|
13943
14021
|
coverage = (patches, layers) => {
|
|
13944
14022
|
const claims = claimsOf(spansOf$1(layers));
|
|
13945
|
-
const
|
|
14023
|
+
const files = patches.map((patch) => {
|
|
13946
14024
|
const reaches = claims.get(patch.path) ?? NOTHING;
|
|
13947
|
-
|
|
14025
|
+
const tallies = changedHunks(patch).map((changed) => tallyOf(changed, reaches));
|
|
14026
|
+
return {
|
|
14027
|
+
tallies,
|
|
14028
|
+
missing: missingRuns(patch.path, tallies.flatMap((tally) => tally.loose))
|
|
14029
|
+
};
|
|
13948
14030
|
});
|
|
14031
|
+
const tallies = files.flatMap((file) => file.tallies);
|
|
13949
14032
|
return {
|
|
13950
14033
|
total: tallies.length,
|
|
13951
14034
|
covered: tallies.reduce((sum, tally) => sum + tally.covered, 0),
|
|
13952
14035
|
partial: tallies.reduce((sum, tally) => sum + tally.partial, 0),
|
|
13953
|
-
missing:
|
|
14036
|
+
missing: files.flatMap((file) => file.missing)
|
|
13954
14037
|
};
|
|
13955
14038
|
};
|
|
13956
14039
|
sharedIn = (patch, claims) => {
|
|
13957
|
-
const
|
|
14040
|
+
const holding = claims.flatMap((claim) => {
|
|
13958
14041
|
const reaches = claim.get(patch.path);
|
|
13959
14042
|
return reaches === void 0 ? [] : [reaches];
|
|
13960
14043
|
});
|
|
13961
|
-
if (
|
|
13962
|
-
return changedHunks(patch).filter((changed) =>
|
|
14044
|
+
if (holding.length < 2) return 0;
|
|
14045
|
+
return changedHunks(patch).filter((changed) => holding.filter((reaches) => holdsAny$2(reaches, changed)).length > 1).length;
|
|
13963
14046
|
};
|
|
13964
14047
|
sharedHunks = (patches, layers) => {
|
|
13965
14048
|
const claims = layers.map((layer) => claimsOf(spansOf$1([layer])));
|
|
@@ -14048,10 +14131,11 @@ var init_version = __esmMin((() => {
|
|
|
14048
14131
|
total: gap.total
|
|
14049
14132
|
};
|
|
14050
14133
|
};
|
|
14051
|
-
})), lineOf$
|
|
14134
|
+
})), lineOf$2, quietRows, quietKey, holds, quietFor, quietLayers;
|
|
14052
14135
|
var init_quiet = __esmMin((() => {
|
|
14053
14136
|
init_dist();
|
|
14054
|
-
|
|
14137
|
+
init_side();
|
|
14138
|
+
lineOf$2 = (row) => getOrUndefined$1(orElse(row.newLine, () => row.oldLine));
|
|
14055
14139
|
quietRows = (hunk, mine) => {
|
|
14056
14140
|
const quiet = /* @__PURE__ */ new Set();
|
|
14057
14141
|
if (!hunk.rows.some((row) => row.kind !== "context" && mine(row))) return quiet;
|
|
@@ -14066,15 +14150,13 @@ var init_quiet = __esmMin((() => {
|
|
|
14066
14150
|
return quiet;
|
|
14067
14151
|
};
|
|
14068
14152
|
quietKey = (kind, line) => `${kind}:${line}`;
|
|
14069
|
-
holds = (spans, path,
|
|
14070
|
-
|
|
14071
|
-
return line !== void 0 && spans.some((span) => span.path === path && span.start <= line && span.end >= line);
|
|
14072
|
-
};
|
|
14073
|
-
quietFor = (patch, spans) => patch.hunks.flatMap((hunk) => [...quietRows(hunk, (row) => holds(spans, patch.path, row))]);
|
|
14153
|
+
holds = (spans, path, placed) => placed !== void 0 && holdsRow(spans, path, placed);
|
|
14154
|
+
quietFor = (patch, places, spans) => patch.hunks.flatMap((hunk) => [...quietRows(hunk, (row) => holds(spans, patch.path, places.get(row)))]);
|
|
14074
14155
|
quietLayers = (patch, layers) => {
|
|
14075
14156
|
const found = /* @__PURE__ */ new Map();
|
|
14076
|
-
|
|
14077
|
-
|
|
14157
|
+
const places = placedPatch(patch);
|
|
14158
|
+
for (const [at, spans] of layers.entries()) for (const row of quietFor(patch, places, spans)) {
|
|
14159
|
+
const line = lineOf$2(row);
|
|
14078
14160
|
if (line === void 0) continue;
|
|
14079
14161
|
const key = quietKey(row.kind, line);
|
|
14080
14162
|
found.set(key, [...found.get(key) ?? [], at + 1]);
|
|
@@ -14084,8 +14166,9 @@ var init_quiet = __esmMin((() => {
|
|
|
14084
14166
|
}));
|
|
14085
14167
|
//#endregion
|
|
14086
14168
|
//#region src/domain/layers/text.ts
|
|
14087
|
-
var OFFSET, PRIME, hashOf, textOf, stamped, outdatedSpans;
|
|
14169
|
+
var OFFSET, PRIME, hashOf, textOf, readsWorktree, stamped, outdatedSpans;
|
|
14088
14170
|
var init_text = __esmMin((() => {
|
|
14171
|
+
init_side();
|
|
14089
14172
|
OFFSET = 2166136261;
|
|
14090
14173
|
PRIME = 16777619;
|
|
14091
14174
|
hashOf = (text) => {
|
|
@@ -14094,15 +14177,16 @@ var init_text = __esmMin((() => {
|
|
|
14094
14177
|
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
14095
14178
|
};
|
|
14096
14179
|
textOf = (lines, start, end) => hashOf(lines.slice(start - 1, end).join("\n"));
|
|
14180
|
+
readsWorktree = (block) => block.kind === "code" && sideOf(block) === "new";
|
|
14097
14181
|
stamped = (layers, sources) => layers.map((layer) => ({
|
|
14098
14182
|
...layer,
|
|
14099
|
-
blocks: layer.blocks.map((block) => block
|
|
14183
|
+
blocks: layer.blocks.map((block) => readsWorktree(block) ? {
|
|
14100
14184
|
...block,
|
|
14101
14185
|
text: textOf(sources.get(block.path) ?? [], block.start, block.end)
|
|
14102
14186
|
} : block)
|
|
14103
14187
|
}));
|
|
14104
14188
|
outdatedSpans = (layers, sources) => layers.flatMap((layer, at) => layer.blocks.flatMap((block) => {
|
|
14105
|
-
if (block
|
|
14189
|
+
if (!readsWorktree(block) || block.text === void 0) return [];
|
|
14106
14190
|
const lines = sources.get(block.path);
|
|
14107
14191
|
if (lines === void 0 || textOf(lines, block.start, block.end) === block.text) return [];
|
|
14108
14192
|
return [{
|
|
@@ -14119,8 +14203,9 @@ var addedLines, claimsAny, sharedPaths, splitsIn;
|
|
|
14119
14203
|
var init_split = __esmMin((() => {
|
|
14120
14204
|
init_dist();
|
|
14121
14205
|
init_coverage();
|
|
14206
|
+
init_side();
|
|
14122
14207
|
addedLines = (patch) => patch.rows.filter((row) => row.kind === "added").flatMap((row) => toArray(row.newLine));
|
|
14123
|
-
claimsAny = (layer, path, lines) => codeBlocks(layer).some((block) => block.path === path && lines.some((line) => line >= block.start && line <= block.end));
|
|
14208
|
+
claimsAny = (layer, path, lines) => codeBlocks(layer).some((block) => block.path === path && sideOf(block) === "new" && lines.some((line) => line >= block.start && line <= block.end));
|
|
14124
14209
|
sharedPaths = (layers) => {
|
|
14125
14210
|
const claimed = layers.flatMap((layer) => [...new Set(codeBlocks(layer).map((block) => block.path))]);
|
|
14126
14211
|
return [...new Set(claimed.filter((path, at) => claimed.indexOf(path) !== at))];
|
|
@@ -14170,6 +14255,7 @@ var init_layers$1 = __esmMin((() => {
|
|
|
14170
14255
|
init_version();
|
|
14171
14256
|
init_quiet();
|
|
14172
14257
|
init_model$3();
|
|
14258
|
+
init_side();
|
|
14173
14259
|
init_text();
|
|
14174
14260
|
init_split();
|
|
14175
14261
|
init_nesting();
|
|
@@ -14460,7 +14546,7 @@ var init_branches$1 = __esmMin((() => {
|
|
|
14460
14546
|
}));
|
|
14461
14547
|
//#endregion
|
|
14462
14548
|
//#region src/review/patches.ts
|
|
14463
|
-
var findPatch, blobOf, wholeFile, rowAt, picked, anchorWith, anchor$1, list$4, source, before, linesAround, GENERATED_NAME, lineOf$
|
|
14549
|
+
var findPatch, blobOf, wholeFile, rowAt, picked, anchorWith, anchor$1, list$4, source, before, linesAround, GENERATED_NAME, lineOf$1, isNote$1, shownRow, shownHunk, scopesOf, shownFile, sourceShown, fileShown$1, shownAs, onDisk$2, show$3;
|
|
14464
14550
|
var init_patches = __esmMin((() => {
|
|
14465
14551
|
init_dist();
|
|
14466
14552
|
init_patch();
|
|
@@ -14533,7 +14619,7 @@ var init_patches = __esmMin((() => {
|
|
|
14533
14619
|
return context ?? 3;
|
|
14534
14620
|
};
|
|
14535
14621
|
GENERATED_NAME = /\.generated\./;
|
|
14536
|
-
lineOf$
|
|
14622
|
+
lineOf$1 = (side, line) => match$3(line, {
|
|
14537
14623
|
onNone: () => ({}),
|
|
14538
14624
|
onSome: (at) => ({ [side]: at })
|
|
14539
14625
|
});
|
|
@@ -14543,8 +14629,8 @@ var init_patches = __esmMin((() => {
|
|
|
14543
14629
|
text: row.text
|
|
14544
14630
|
} : {
|
|
14545
14631
|
kind: row.kind,
|
|
14546
|
-
...lineOf$
|
|
14547
|
-
...lineOf$
|
|
14632
|
+
...lineOf$1("old", row.oldLine),
|
|
14633
|
+
...lineOf$1("new", row.newLine),
|
|
14548
14634
|
text: row.text
|
|
14549
14635
|
};
|
|
14550
14636
|
shownHunk = (hunk) => ({
|
|
@@ -15126,7 +15212,7 @@ var init_vouch = __esmMin((() => {
|
|
|
15126
15212
|
};
|
|
15127
15213
|
};
|
|
15128
15214
|
partOf = (path, runs) => {
|
|
15129
|
-
return `${path}@${[...runs].toSorted((left, right) => left.start - right.start || left.end - right.end).map((run) => `${run.start}-${run.end}`).join(",")}`;
|
|
15215
|
+
return `${path}@${[...runs].toSorted((left, right) => left.start - right.start || left.end - right.end).map((run) => `${run.side === "old" ? "old:" : ""}${run.start}-${run.end}`).join(",")}`;
|
|
15130
15216
|
};
|
|
15131
15217
|
isPartVouched = (vouches, part, blob) => sameBlob(vouches[part], blob);
|
|
15132
15218
|
vouchPart$1 = (vouches, part, blob) => vouch$1(vouches, part, blob);
|
|
@@ -16220,10 +16306,11 @@ var init_remarks$1 = __esmMin((() => {
|
|
|
16220
16306
|
}));
|
|
16221
16307
|
//#endregion
|
|
16222
16308
|
//#region src/review/vouching.ts
|
|
16223
|
-
var pathOfMark, changedSince, readParts, restamped, now, keepMarked, fullBlob, blobIn, stateAfter, toggle, marksOf, newestFirst, speaking, contentNow, diffSince, placesIn, counted$1,
|
|
16309
|
+
var pathOfMark, changedSince, readParts, restamped, now, keepMarked, fullBlob, blobIn, stateAfter, toggle, marksOf, newestFirst, speaking, contentNow, diffSince, placesIn, counted$1, touchedRows, holdsAny, layersTouched, untouchedParts, partsStillRead, lapsedMarks, keptOf, stillRead, reportSince, isGone, goneSince, lapsedIn, sinceReview, progress, unchanged, markOf, since;
|
|
16224
16310
|
var init_vouching$1 = __esmMin((() => {
|
|
16225
16311
|
init_dist();
|
|
16226
16312
|
init_patch();
|
|
16313
|
+
init_layers$1();
|
|
16227
16314
|
init_review$1();
|
|
16228
16315
|
init_git();
|
|
16229
16316
|
init_store();
|
|
@@ -16344,22 +16431,17 @@ var init_vouching$1 = __esmMin((() => {
|
|
|
16344
16431
|
places: placesIn(found)
|
|
16345
16432
|
})
|
|
16346
16433
|
});
|
|
16347
|
-
|
|
16348
|
-
|
|
16349
|
-
|
|
16434
|
+
touchedRows = (patch) => [...placedPatch(patch).values()];
|
|
16435
|
+
holdsAny = (own, path, touched) => {
|
|
16436
|
+
const onNew = own.filter((span) => sideOf(span) === "new");
|
|
16437
|
+
return touched.some((placed) => holdsRow(onNew, path, placed));
|
|
16350
16438
|
};
|
|
16351
|
-
touchedIn = (rows) => rows.flatMap((row, at) => {
|
|
16352
|
-
if (row.kind === "context") return [];
|
|
16353
|
-
return isSome(row.newLine) ? [row.newLine.value] : nearestNew$1(rows, at);
|
|
16354
|
-
});
|
|
16355
|
-
touchedLines = (patch) => patch.hunks.flatMap((hunk) => touchedIn(hunk.rows));
|
|
16356
|
-
holdsAny = (own, path, lines) => own.some((span) => span.path === path && lines.some((line) => line >= span.start && line <= span.end));
|
|
16357
16439
|
layersTouched = (spans, path, patch) => {
|
|
16358
|
-
const
|
|
16440
|
+
const touched = match$3(patch, {
|
|
16359
16441
|
onNone: () => [],
|
|
16360
|
-
onSome:
|
|
16442
|
+
onSome: touchedRows
|
|
16361
16443
|
});
|
|
16362
|
-
return spans.flatMap((own, at) => holdsAny(own, path,
|
|
16444
|
+
return spans.flatMap((own, at) => holdsAny(own, path, touched) ? [at + 1] : []);
|
|
16363
16445
|
};
|
|
16364
16446
|
untouchedParts = (spans, path, touched) => spans.flatMap((own, at) => {
|
|
16365
16447
|
const mine = own.filter((span) => span.path === path);
|
|
@@ -16735,11 +16817,17 @@ var init_syntax = __esmMin((() => {
|
|
|
16735
16817
|
}));
|
|
16736
16818
|
//#endregion
|
|
16737
16819
|
//#region src/review/document.ts
|
|
16738
|
-
var tidyPath, spanFault, blockFault, codeBlockOf, tidyBlock, blocksOf, titleOf, layerFault, inputOf, sublayersOf$1, carries, holdsCode, nests, nestingFault, sublayerFault, ticketFault, entryFault, layerOf, noteOf, flattened, parsed, readLayers;
|
|
16820
|
+
var tidyPath, SIDES, sideFault, spanFault, blockFault, onOldSide, codeBlockOf, tidyBlock, blocksOf, titleOf, layerFault, inputOf, sublayersOf$1, carries, holdsCode, nests, nestingFault, sublayerFault, ticketFault, entryFault, layerOf, noteOf, flattened, parsed, readLayers;
|
|
16739
16821
|
var init_document = __esmMin((() => {
|
|
16740
16822
|
init_dist();
|
|
16741
16823
|
init_error$3();
|
|
16742
16824
|
tidyPath = (path) => path.replace(/^\.\/+/, "").replace(/^\/+/, "");
|
|
16825
|
+
SIDES = /* @__PURE__ */ new Set([
|
|
16826
|
+
void 0,
|
|
16827
|
+
"old",
|
|
16828
|
+
"new"
|
|
16829
|
+
]);
|
|
16830
|
+
sideFault = (span) => SIDES.has(span.side) ? void 0 : `the span on ${span.path} says side ${String(span.side)}, and a side is old or new`;
|
|
16743
16831
|
spanFault = (value) => {
|
|
16744
16832
|
const span = value;
|
|
16745
16833
|
if (typeof span?.path !== "string" || span.path.trim().length === 0) return "a span needs a path";
|
|
@@ -16748,6 +16836,7 @@ var init_document = __esmMin((() => {
|
|
|
16748
16836
|
const end = span.end;
|
|
16749
16837
|
if (start < 1) return `the span on ${span.path} starts at ${start}, and lines count from 1`;
|
|
16750
16838
|
if (end < start) return `the span on ${span.path} ends at ${end}, before it starts at ${start}`;
|
|
16839
|
+
return sideFault(span);
|
|
16751
16840
|
};
|
|
16752
16841
|
blockFault = (value) => {
|
|
16753
16842
|
const block = value;
|
|
@@ -16755,16 +16844,15 @@ var init_document = __esmMin((() => {
|
|
|
16755
16844
|
if (block?.kind !== "code") return `a block needs a kind of prose or code, not ${String(block?.kind)}`;
|
|
16756
16845
|
return spanFault(value);
|
|
16757
16846
|
};
|
|
16847
|
+
onOldSide = (side) => side === "old" ? { side } : {};
|
|
16758
16848
|
codeBlockOf = (span) => ({
|
|
16759
16849
|
kind: "code",
|
|
16760
16850
|
path: tidyPath(span.path),
|
|
16761
16851
|
start: span.start,
|
|
16762
|
-
end: span.end
|
|
16852
|
+
end: span.end,
|
|
16853
|
+
...onOldSide(span.side)
|
|
16763
16854
|
});
|
|
16764
|
-
tidyBlock = (block) => block.kind === "code" ?
|
|
16765
|
-
...block,
|
|
16766
|
-
path: tidyPath(block.path)
|
|
16767
|
-
} : block;
|
|
16855
|
+
tidyBlock = (block) => block.kind === "code" ? codeBlockOf(block) : block;
|
|
16768
16856
|
blocksOf = (layer) => {
|
|
16769
16857
|
const note = typeof layer.note === "string" && layer.note.trim().length > 0 ? [{
|
|
16770
16858
|
kind: "prose",
|
|
@@ -16871,7 +16959,7 @@ var init_document = __esmMin((() => {
|
|
|
16871
16959
|
}));
|
|
16872
16960
|
//#endregion
|
|
16873
16961
|
//#region src/review/layers.ts
|
|
16874
|
-
var STALE_ADVICE, OUTDATED_ADVICE, unique, spansOfLayer, fromStored, toStored, partIn, placedAt, reportedLayers, adviceOf, reportOf, pathsOfLayer, sourcesOf, changedSinceWritten, outdatedIn, splitsFound, storedLayers, set, readInLayer, withRead, coversThread, readsFile, lastHolding, layersHolding$1, loudest, partWithThreads, withThreads, readReport, view, show$1, placeThreads, spansIn,
|
|
16962
|
+
var STALE_ADVICE, OUTDATED_ADVICE, unique, spansOfLayer, fromStored, toStored, partIn, placedAt, reportedLayers, adviceOf, reportOf, pathsOfLayer, sourcesOf, changedSinceWritten, outdatedIn, splitsFound, storedLayers, set, readInLayer, withRead, coversThread, readsFile, lastHolding, layersHolding$1, loudest, partWithThreads, withThreads, readReport, view, show$1, placeThreads, spansIn, taggedRow, taggedHunk, taggedFile, onNewSide, tagSince, quietRow, quietFile, tagRows, read, partsOfFile, vouchPart, carriedStamps, unmarkedPart, markedPart, askingFor, openAskOf, askIn, seenOf, ask, claims, vouchIn, WHOLE, vouchAt;
|
|
16875
16963
|
var init_layers = __esmMin((() => {
|
|
16876
16964
|
init_dist();
|
|
16877
16965
|
init_layers$1();
|
|
@@ -16889,11 +16977,7 @@ var init_layers = __esmMin((() => {
|
|
|
16889
16977
|
STALE_ADVICE = "These layers describe an older commit. Read the diff again and write a new revision with layers set.";
|
|
16890
16978
|
OUTDATED_ADVICE = "The code under the outdated spans changed after these layers were written. Read those lines again and write a new revision with layers set.";
|
|
16891
16979
|
unique = (paths) => [...new Set(paths)];
|
|
16892
|
-
spansOfLayer = (layer) =>
|
|
16893
|
-
path,
|
|
16894
|
-
start,
|
|
16895
|
-
end
|
|
16896
|
-
}));
|
|
16980
|
+
spansOfLayer = (layer) => spansOf$1([layer]);
|
|
16897
16981
|
fromStored = (stored) => ({
|
|
16898
16982
|
...stored,
|
|
16899
16983
|
parent: fromNullishOr(stored.parent)
|
|
@@ -17049,7 +17133,7 @@ var init_layers = __esmMin((() => {
|
|
|
17049
17133
|
tickets: ticketsRead(report.tickets, layers)
|
|
17050
17134
|
};
|
|
17051
17135
|
};
|
|
17052
|
-
coversThread = (layer, thread) =>
|
|
17136
|
+
coversThread = (layer, thread) => layer.spans.some((span) => span.path === thread.file && sideOf(span) === thread.side && thread.start <= span.end && thread.end >= span.start);
|
|
17053
17137
|
readsFile = (layer, file) => layer.read?.includes(file) === true;
|
|
17054
17138
|
lastHolding = (layers, file, at) => layers.every((other, index) => index === at || !claims(other, file) || readsFile(other, file));
|
|
17055
17139
|
layersHolding$1 = (layers, thread) => {
|
|
@@ -17140,25 +17224,26 @@ var init_layers = __esmMin((() => {
|
|
|
17140
17224
|
onSome: (layers) => reportedLayers(reading.patches, layers).map((layer) => layer.spans)
|
|
17141
17225
|
});
|
|
17142
17226
|
});
|
|
17143
|
-
|
|
17144
|
-
|
|
17145
|
-
|
|
17146
|
-
const layers = layersAt(spans, path, line);
|
|
17227
|
+
taggedRow = (spans, path, row, placed) => {
|
|
17228
|
+
if (placed === void 0) return row;
|
|
17229
|
+
const layers = spans.flatMap((own, at) => holdsRow(own, path, placed) ? [at + 1] : []);
|
|
17147
17230
|
return layers.length === 0 ? row : {
|
|
17148
17231
|
...row,
|
|
17149
17232
|
layers
|
|
17150
17233
|
};
|
|
17151
17234
|
};
|
|
17152
|
-
|
|
17153
|
-
|
|
17154
|
-
|
|
17155
|
-
|
|
17235
|
+
taggedHunk = (spans, path, hunk) => {
|
|
17236
|
+
const placed = placedRows(hunk.rows);
|
|
17237
|
+
return Object.assign({}, hunk, { rows: hunk.rows.map((row, at) => taggedRow(spans, path, row, placed[at])) });
|
|
17238
|
+
};
|
|
17239
|
+
taggedFile = (spans, file) => Object.assign({}, file, { hunks: file.hunks.map((hunk) => taggedHunk(spans, file.path, hunk)) });
|
|
17240
|
+
onNewSide = (spans) => spans.map((own) => own.filter((span) => sideOf(span) === "new"));
|
|
17156
17241
|
tagSince = fn("Review.Layers.tagSince")(function* (worktree, shown) {
|
|
17157
17242
|
const spans = yield* spansIn({
|
|
17158
17243
|
worktree,
|
|
17159
17244
|
patches: yield* patches(worktree)
|
|
17160
17245
|
});
|
|
17161
|
-
return spans.length === 0 ? shown : taggedFile(spans, shown
|
|
17246
|
+
return spans.length === 0 ? shown : taggedFile(onNewSide(spans), shown);
|
|
17162
17247
|
});
|
|
17163
17248
|
quietRow = (quiet, row) => {
|
|
17164
17249
|
const line = row.new ?? row.old;
|
|
@@ -45257,7 +45342,7 @@ var init_keys = __esmMin((() => {
|
|
|
45257
45342
|
source: "raw"
|
|
45258
45343
|
});
|
|
45259
45344
|
};
|
|
45260
|
-
})), sourceLength, markerText, lastNewLine, spansOf, linesFrom, push, markGap, openOf, countOf, openAbove, openBelow, elsewhereText, markElsewhere, flushed, stays, keep, someRows, changedIn, firstChanged, makeRows, compose$1, cache, keyOf$1, saidOf,
|
|
45345
|
+
})), sourceLength, markerText, lastNewLine, spansOf, linesFrom, push, markGap, openOf, countOf, openAbove, openBelow, elsewhereText, markElsewhere, flushed, stays, keep, someRows, changedIn, firstChanged, makeRows, compose$1, cache, keyOf$1, saidOf, spansFor, claimOf, shownOf, gapAtRow, gapNumbered, gapRowSet;
|
|
45261
45346
|
var init_gaps = __esmMin((() => {
|
|
45262
45347
|
init_dist();
|
|
45263
45348
|
init_layers$1();
|
|
@@ -45417,7 +45502,7 @@ var init_gaps = __esmMin((() => {
|
|
|
45417
45502
|
total,
|
|
45418
45503
|
full === void 0 ? 0 : full.rows.length,
|
|
45419
45504
|
reveals.map((entry) => `${entry.gap}-${entry.lines}`).join(","),
|
|
45420
|
-
spans.map((span) => `${span.start}-${span.end}`).join(",")
|
|
45505
|
+
spans.map((span) => `${span.side ?? "new"}${span.start}-${span.end}`).join(",")
|
|
45421
45506
|
].join(":");
|
|
45422
45507
|
saidOf = (state, at) => {
|
|
45423
45508
|
if (at === -1) return "no layer claims them";
|
|
@@ -45425,21 +45510,20 @@ var init_gaps = __esmMin((() => {
|
|
|
45425
45510
|
if (layer === void 0 || layer.title === "not in any layer") return "no layer claims them";
|
|
45426
45511
|
return `layer ${layer.address} explains them`;
|
|
45427
45512
|
};
|
|
45428
|
-
lineOf$1 = (row) => getOrUndefined$1(orElse(row.newLine, () => row.oldLine));
|
|
45429
|
-
inSpans = (spans, path, line) => spans.some((span) => span.path === path && span.start <= line && span.end >= line);
|
|
45430
45513
|
spansFor = (state, path) => (state.layers[state.layerIndex]?.spans ?? []).filter((span) => span.path === path);
|
|
45431
45514
|
claimOf = (state, base) => {
|
|
45432
45515
|
if (state.rail !== "layers" || state.layers.length === 0) return void 0;
|
|
45433
45516
|
if (state.layers[state.layerIndex] === void 0) return void 0;
|
|
45434
45517
|
const mineSpans = spansFor(state, base.path);
|
|
45518
|
+
const places = placedPatch(base);
|
|
45435
45519
|
const mine = (row) => {
|
|
45436
|
-
const
|
|
45437
|
-
return
|
|
45520
|
+
const placed = places.get(row);
|
|
45521
|
+
return placed !== void 0 && holdsRow(mineSpans, base.path, placed);
|
|
45438
45522
|
};
|
|
45439
45523
|
const said = (row) => {
|
|
45440
|
-
const
|
|
45441
|
-
if (
|
|
45442
|
-
return saidOf(state, state.layers.findIndex((one) =>
|
|
45524
|
+
const placed = places.get(row);
|
|
45525
|
+
if (placed === void 0) return "no layer claims them";
|
|
45526
|
+
return saidOf(state, state.layers.findIndex((one) => holdsRow(one.spans, base.path, placed)));
|
|
45443
45527
|
};
|
|
45444
45528
|
const holds = (hunk) => hunk.rows.some((row) => row.kind !== "context" && mine(row));
|
|
45445
45529
|
return base.hunks.every(holds) && base.hunks.every((hunk) => hunk.rows.every((row) => row.kind === "context" || mine(row))) ? void 0 : {
|
|
@@ -46301,6 +46385,7 @@ var init_words = __esmMin((() => {
|
|
|
46301
46385
|
var openOn, threadsOnFiles, threadsOn, threadsOpenOn, askedRows, withAsking, firstLineOf, askedThreads, askingWords, markedStands, settledShown, settledInFile, settledAtRow, foldedAtRow, snippetOf, remarkAnswering, answerTarget, replyTarget, threadReplying, VOICES, remarkQuote, threadQuote, needingRowsIn, commentRowsIn, draftPlace, notesShown, threadsAtRow, remarkShown, remarksAtRow, remarkRowsIn, stopsIn, stopsAtRow, remarkAtStop, remarkAtRow, remarkInPanel, remarkInDiff, remarkUnderCursor, remarkHere, cursorOnThread, threadHere, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, answersSince, coveredBy, lastLayerOf, threadsInLayer, rewordTarget, composeTarget, anchoredTarget;
|
|
46302
46386
|
var init_notes = __esmMin((() => {
|
|
46303
46387
|
init_dist();
|
|
46388
|
+
init_layers$1();
|
|
46304
46389
|
init_patch();
|
|
46305
46390
|
init_cursor();
|
|
46306
46391
|
init_files();
|
|
@@ -46559,7 +46644,7 @@ var init_notes = __esmMin((() => {
|
|
|
46559
46644
|
filesWithComments = (state) => state.patches.flatMap((patch, index) => state.sent.some((entry) => entry.file === patch.path) || state.remarks.some((one) => one.file === patch.path && remarkShown(one)) ? [index] : []);
|
|
46560
46645
|
answerCount = (comments) => comments.reduce((total, entry) => total + (entry.answers?.length ?? 0), 0);
|
|
46561
46646
|
answersSince = (seen, now) => Math.max(0, answerCount(now) - answerCount(seen));
|
|
46562
|
-
coveredBy = (layer, path, entry) =>
|
|
46647
|
+
coveredBy = (layer, path, entry) => layer.spans.some((span) => span.path === path && sideOf(span) === entry.side && entry.start <= span.end && entry.end >= span.start);
|
|
46563
46648
|
lastLayerOf = (state, fileIndex, layerIndex) => state.layers.every((layer, at) => at === layerIndex || !layer.spans.some((span) => span.path === state.patches[fileIndex]?.path) || readIn(state, at, fileIndex));
|
|
46564
46649
|
threadsInLayer = (state, fileIndex, layerIndex) => {
|
|
46565
46650
|
const patch = state.patches[fileIndex];
|