@eliya-oss/agent-diff 0.1.0-alpha.111 → 0.1.0-alpha.113
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 +18 -0
- package/dist/main.js +205 -33
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @eliya-oss/agent-diff
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.113
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- The reply box shows the thread you are answering. It used to quote code from wherever the diff cursor happened to be — often a different file — and never showed your comment or the agent's answer, so you replied to a question you could not see. It now shows the conversation, and names the range rather than only its last line.
|
|
8
|
+
|
|
9
|
+
The header says when a line runs off the right of the pane. Code was cut with no marker of any kind, so two lines that differ only past the edge looked identical.
|
|
10
|
+
|
|
11
|
+
## 0.1.0-alpha.112
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- The review panel says what state a thread is in. A question the agent asked back — the one thing that stops the review until you answer — was filed under "Answered" with the same mark as an ordinary answer. It now has a section of its own at the top, and settled threads have one at the bottom instead of sitting in place with one glyph missing. When there are more threads than fit, the panel says how many are above and below rather than ending mid-list.
|
|
16
|
+
|
|
17
|
+
The box a comment is written in stays on screen. Past about seven hundred characters at 80x24 it grew through the pane border, the send hint and the footer, and you carried on typing with the caret off the bottom of the terminal.
|
|
18
|
+
|
|
19
|
+
`a` says the terminal is too narrow for the review panel every time, not only the first — it used to toggle an invisible flag and look dead. A path that is not a git repository says so, instead of "nothing to review". The key sheet no longer says "4 of them" while drawing three. And the key sheet and the command palette answer to the words a reviewer would actually type: `resolve` finds settle, `search` finds find, `shortcuts` finds the key sheet.
|
|
20
|
+
|
|
3
21
|
## 0.1.0-alpha.111
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/main.js
CHANGED
|
@@ -9213,11 +9213,14 @@ var init_patch = __esmMin((() => {
|
|
|
9213
9213
|
init_parse$1();
|
|
9214
9214
|
init_sticky();
|
|
9215
9215
|
init_model$3();
|
|
9216
|
-
}))
|
|
9216
|
+
}));
|
|
9217
|
+
//#endregion
|
|
9218
|
+
//#region src/service/git/error.ts
|
|
9219
|
+
var GitCommandFailed, NotARepository, FileUnreadable;
|
|
9217
9220
|
var init_error$1 = __esmMin((() => {
|
|
9218
9221
|
init_dist();
|
|
9219
9222
|
GitCommandFailed = class extends TaggedError("GitCommandFailed") {};
|
|
9220
|
-
TaggedError("NotARepository");
|
|
9223
|
+
NotARepository = class extends TaggedError("NotARepository") {};
|
|
9221
9224
|
FileUnreadable = class extends TaggedError("FileUnreadable") {};
|
|
9222
9225
|
}));
|
|
9223
9226
|
//#endregion
|
|
@@ -9378,6 +9381,7 @@ var init_service = __esmMin((() => {
|
|
|
9378
9381
|
"list",
|
|
9379
9382
|
"--porcelain"
|
|
9380
9383
|
]);
|
|
9384
|
+
if (porcelain.trim().length === 0) return yield* new NotARepository({ path: repo });
|
|
9381
9385
|
const base = yield* defaultBranch(repo);
|
|
9382
9386
|
const entries = readEntries(porcelain);
|
|
9383
9387
|
const opened = yield* settled(repo);
|
|
@@ -10397,7 +10401,7 @@ var init_pane = __esmMin((() => {
|
|
|
10397
10401
|
init_drafts();
|
|
10398
10402
|
init_init();
|
|
10399
10403
|
init_pane();
|
|
10400
|
-
var version$1 = "0.1.0-alpha.
|
|
10404
|
+
var version$1 = "0.1.0-alpha.113";
|
|
10401
10405
|
//#endregion
|
|
10402
10406
|
//#region src/cli/upgrade.ts
|
|
10403
10407
|
var PACKAGE, TAG, RELEASES, REGISTRY, ASK_MS, RUN_MS, CELLAR, COMPILED, INSTALLED, BUN_GLOBAL, routeOf, ROUTES, asRoute, checkoutOf, assetOf, commandFor, NOTES, RUNNABLE, NUMBERS, numbersIn, compare$1, partsOf, newer, tagIn, fetched, askLatest, here, findUpgrade, willUpgrade, runUpgrade, statusOf$1, sayFound, sayDone, attempted, REFRESH_MS, refreshSkills, updatedIn, sayRefreshed, upgradeReport;
|
|
@@ -11902,7 +11906,7 @@ var init_report$1 = __esmMin((() => {
|
|
|
11902
11906
|
},
|
|
11903
11907
|
NotARepository: {
|
|
11904
11908
|
exit: 3,
|
|
11905
|
-
suggestion: "That path is not a git repository. Point --repo at one.",
|
|
11909
|
+
suggestion: "That path is not a git repository. Point --repo or --worktree at one, or run `adiff branch list` from inside the repository you mean.",
|
|
11906
11910
|
retriable: false
|
|
11907
11911
|
},
|
|
11908
11912
|
GitCommandFailed: {
|
|
@@ -12397,7 +12401,7 @@ var init_tree = __esmMin((() => {
|
|
|
12397
12401
|
return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
|
|
12398
12402
|
};
|
|
12399
12403
|
crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
|
|
12400
|
-
})), nothingReviewed, initialState, TREE_MAX, TREE_ROOMY, TREE_WIDE, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, tooSmall, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip, TITLE_ROWS, titleRows, shortDir, fileRow$1, shownFiles, dirOf, fileRows, layerRead, layerDone, countRow, layerBody, layerRows, nearFirst, layerFitted, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, kept, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, caretRow, caretColumn, caretOn, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, replyTarget, pickedText, selectedLines, shownMatches, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, answersIn, newerOf, spokeLast, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
|
|
12404
|
+
})), nothingReviewed, initialState, TREE_MAX, TREE_ROOMY, TREE_WIDE, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, tooSmall, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip, TITLE_ROWS, titleRows, shortDir, fileRow$1, shownFiles, dirOf, fileRows, layerRead, layerDone, countRow, layerBody, layerRows, nearFirst, layerFitted, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, kept, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, caretRow, caretColumn, caretOn, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, replyTarget, threadReplying, VOICES, threadQuote, pickedText, selectedLines, shownMatches, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
|
|
12401
12405
|
var init_model = __esmMin((() => {
|
|
12402
12406
|
init_dist();
|
|
12403
12407
|
init_patch();
|
|
@@ -12773,9 +12777,32 @@ var init_model = __esmMin((() => {
|
|
|
12773
12777
|
return span === "" ? `Comment on ${patch.path}` : `Comment on ${patch.path}:${span}`;
|
|
12774
12778
|
};
|
|
12775
12779
|
replyTarget = (state) => {
|
|
12776
|
-
const thread =
|
|
12780
|
+
const thread = threadReplying(state);
|
|
12777
12781
|
if (thread === void 0) return "Reply";
|
|
12778
|
-
|
|
12782
|
+
const span = thread.start === thread.end ? `${thread.end}` : `${thread.start}-${thread.end}`;
|
|
12783
|
+
return `Reply on ${thread.file}:${span}`;
|
|
12784
|
+
};
|
|
12785
|
+
threadReplying = (state) => state.replyTo === void 0 ? void 0 : state.sent.find((entry) => entry.id === state.replyTo);
|
|
12786
|
+
VOICES = {
|
|
12787
|
+
reviewer: "you",
|
|
12788
|
+
agent: "the agent"
|
|
12789
|
+
};
|
|
12790
|
+
threadQuote = (state, room) => {
|
|
12791
|
+
const thread = threadReplying(state);
|
|
12792
|
+
if (thread === void 0) return [];
|
|
12793
|
+
const spoken = (thread.answers ?? []).map((body) => ({
|
|
12794
|
+
voice: "agent",
|
|
12795
|
+
body
|
|
12796
|
+
}));
|
|
12797
|
+
const turns = thread.turns ?? [{
|
|
12798
|
+
voice: "reviewer",
|
|
12799
|
+
body: thread.body
|
|
12800
|
+
}, ...spoken];
|
|
12801
|
+
const saidBy = (turn) => {
|
|
12802
|
+
const lines = wrapped(turn.body, Math.max(8, room - 4)).map((line) => ` ${line}`);
|
|
12803
|
+
return [` ${VOICES[turn.voice]}`, ...lines];
|
|
12804
|
+
};
|
|
12805
|
+
return turns.flatMap(saidBy);
|
|
12779
12806
|
};
|
|
12780
12807
|
pickedText = (state) => {
|
|
12781
12808
|
const picked = state.picked;
|
|
@@ -12870,6 +12897,12 @@ var init_model = __esmMin((() => {
|
|
|
12870
12897
|
};
|
|
12871
12898
|
filesWithComments = (state) => state.patches.flatMap((patch, index) => state.sent.some((entry) => entry.file === patch.path) ? [index] : []);
|
|
12872
12899
|
answerCount = (comments) => comments.reduce((total, entry) => total + (entry.answers?.length ?? 0), 0);
|
|
12900
|
+
PANEL_SECTIONS = [
|
|
12901
|
+
"asked",
|
|
12902
|
+
"with",
|
|
12903
|
+
"answered",
|
|
12904
|
+
"settled"
|
|
12905
|
+
];
|
|
12873
12906
|
answersIn = (comment) => comment.answers?.length ?? 0;
|
|
12874
12907
|
newerOf = (state, comment) => {
|
|
12875
12908
|
if (comment.id === void 0) return comment;
|
|
@@ -12879,8 +12912,10 @@ var init_model = __esmMin((() => {
|
|
|
12879
12912
|
};
|
|
12880
12913
|
spokeLast = (comment) => comment.turns?.at(-1)?.voice;
|
|
12881
12914
|
sectionOf = (comment) => {
|
|
12882
|
-
if (
|
|
12883
|
-
|
|
12915
|
+
if (comment.settled === true) return "settled";
|
|
12916
|
+
if (comment.asks === true) return "asked";
|
|
12917
|
+
if (spokeLast(comment) === "reviewer") return "with";
|
|
12918
|
+
return answersIn(comment) > 0 ? "answered" : "with";
|
|
12884
12919
|
};
|
|
12885
12920
|
sentEntry = (state, comment) => {
|
|
12886
12921
|
const newer = newerOf(state, comment);
|
|
@@ -12897,7 +12932,7 @@ var init_model = __esmMin((() => {
|
|
|
12897
12932
|
const found = delivered.filter((entry) => entry.section === section);
|
|
12898
12933
|
return state.newestFirst ? found.toReversed() : found;
|
|
12899
12934
|
};
|
|
12900
|
-
return
|
|
12935
|
+
return PANEL_SECTIONS.flatMap((section) => ordered(section));
|
|
12901
12936
|
};
|
|
12902
12937
|
panelEntry = (state) => panelEntries(state)[state.panelIndex];
|
|
12903
12938
|
threadChosen = (state) => {
|
|
@@ -13075,6 +13110,7 @@ var init_command = __esmMin((() => {
|
|
|
13075
13110
|
command = (input) => ({
|
|
13076
13111
|
category: "Reading",
|
|
13077
13112
|
hint: "",
|
|
13113
|
+
also: [],
|
|
13078
13114
|
listed: true,
|
|
13079
13115
|
whenComments: false,
|
|
13080
13116
|
counted: false,
|
|
@@ -13266,6 +13302,11 @@ var init_command = __esmMin((() => {
|
|
|
13266
13302
|
}),
|
|
13267
13303
|
command({
|
|
13268
13304
|
action: "panel.toggle",
|
|
13305
|
+
also: [
|
|
13306
|
+
"comments",
|
|
13307
|
+
"threads",
|
|
13308
|
+
"conversation"
|
|
13309
|
+
],
|
|
13269
13310
|
title: "Show or hide the review panel",
|
|
13270
13311
|
category: "Comments",
|
|
13271
13312
|
keys: ["a"],
|
|
@@ -13274,6 +13315,11 @@ var init_command = __esmMin((() => {
|
|
|
13274
13315
|
}),
|
|
13275
13316
|
command({
|
|
13276
13317
|
action: "nav.zoom",
|
|
13318
|
+
also: [
|
|
13319
|
+
"fullscreen",
|
|
13320
|
+
"maximise",
|
|
13321
|
+
"wide"
|
|
13322
|
+
],
|
|
13277
13323
|
title: "Hide the file list and the review panel",
|
|
13278
13324
|
category: "Reading",
|
|
13279
13325
|
keys: ["z", "\\"],
|
|
@@ -13331,6 +13377,13 @@ var init_command = __esmMin((() => {
|
|
|
13331
13377
|
}),
|
|
13332
13378
|
command({
|
|
13333
13379
|
action: "search.open",
|
|
13380
|
+
also: [
|
|
13381
|
+
"search",
|
|
13382
|
+
"find",
|
|
13383
|
+
"grep",
|
|
13384
|
+
"look for",
|
|
13385
|
+
"where is"
|
|
13386
|
+
],
|
|
13334
13387
|
category: "Selecting",
|
|
13335
13388
|
title: "Find the selection elsewhere",
|
|
13336
13389
|
keys: ["/"],
|
|
@@ -13376,6 +13429,11 @@ var init_command = __esmMin((() => {
|
|
|
13376
13429
|
}),
|
|
13377
13430
|
command({
|
|
13378
13431
|
action: "wrap.toggle",
|
|
13432
|
+
also: [
|
|
13433
|
+
"wrap",
|
|
13434
|
+
"soft wrap",
|
|
13435
|
+
"long lines"
|
|
13436
|
+
],
|
|
13379
13437
|
title: "Wrap long lines",
|
|
13380
13438
|
category: "Reading",
|
|
13381
13439
|
keys: ["w"],
|
|
@@ -13413,6 +13471,12 @@ var init_command = __esmMin((() => {
|
|
|
13413
13471
|
}),
|
|
13414
13472
|
command({
|
|
13415
13473
|
action: "thread.settle",
|
|
13474
|
+
also: [
|
|
13475
|
+
"resolve",
|
|
13476
|
+
"close",
|
|
13477
|
+
"done",
|
|
13478
|
+
"accept"
|
|
13479
|
+
],
|
|
13416
13480
|
panes: ["diff", "review"],
|
|
13417
13481
|
title: "Settle the thread here",
|
|
13418
13482
|
category: "Comments",
|
|
@@ -13433,6 +13497,11 @@ var init_command = __esmMin((() => {
|
|
|
13433
13497
|
}),
|
|
13434
13498
|
command({
|
|
13435
13499
|
action: "thread.reply",
|
|
13500
|
+
also: [
|
|
13501
|
+
"respond",
|
|
13502
|
+
"answer",
|
|
13503
|
+
"write back"
|
|
13504
|
+
],
|
|
13436
13505
|
panes: ["review", "diff"],
|
|
13437
13506
|
hint: "reply",
|
|
13438
13507
|
rank: 1,
|
|
@@ -13444,6 +13513,12 @@ var init_command = __esmMin((() => {
|
|
|
13444
13513
|
}),
|
|
13445
13514
|
command({
|
|
13446
13515
|
action: "thread.remove",
|
|
13516
|
+
also: [
|
|
13517
|
+
"delete",
|
|
13518
|
+
"withdraw",
|
|
13519
|
+
"retract",
|
|
13520
|
+
"undo"
|
|
13521
|
+
],
|
|
13447
13522
|
panes: ["review"],
|
|
13448
13523
|
hint: "remove",
|
|
13449
13524
|
rank: 2,
|
|
@@ -13485,6 +13560,11 @@ var init_command = __esmMin((() => {
|
|
|
13485
13560
|
}),
|
|
13486
13561
|
command({
|
|
13487
13562
|
action: "layers.ask",
|
|
13563
|
+
also: [
|
|
13564
|
+
"reading order",
|
|
13565
|
+
"plan",
|
|
13566
|
+
"walkthrough"
|
|
13567
|
+
],
|
|
13488
13568
|
title: "Ask the agent for a reading order",
|
|
13489
13569
|
category: "Files",
|
|
13490
13570
|
keys: ["L"],
|
|
@@ -13492,6 +13572,11 @@ var init_command = __esmMin((() => {
|
|
|
13492
13572
|
}),
|
|
13493
13573
|
command({
|
|
13494
13574
|
action: "rail.toggle",
|
|
13575
|
+
also: [
|
|
13576
|
+
"sidebar",
|
|
13577
|
+
"outline",
|
|
13578
|
+
"toc"
|
|
13579
|
+
],
|
|
13495
13580
|
panes: ["tree", "diff"],
|
|
13496
13581
|
title: "Switch between layers and files",
|
|
13497
13582
|
category: "Files",
|
|
@@ -13503,6 +13588,11 @@ var init_command = __esmMin((() => {
|
|
|
13503
13588
|
}),
|
|
13504
13589
|
command({
|
|
13505
13590
|
action: "tree.collapse",
|
|
13591
|
+
also: [
|
|
13592
|
+
"fold",
|
|
13593
|
+
"hide",
|
|
13594
|
+
"shrink"
|
|
13595
|
+
],
|
|
13506
13596
|
title: "Close the folder, layer, gap, or settled thread",
|
|
13507
13597
|
category: "Files",
|
|
13508
13598
|
keys: ["h"],
|
|
@@ -13510,6 +13600,12 @@ var init_command = __esmMin((() => {
|
|
|
13510
13600
|
}),
|
|
13511
13601
|
command({
|
|
13512
13602
|
action: "tree.expand",
|
|
13603
|
+
also: [
|
|
13604
|
+
"expand",
|
|
13605
|
+
"unfold",
|
|
13606
|
+
"show more",
|
|
13607
|
+
"open"
|
|
13608
|
+
],
|
|
13513
13609
|
title: "Open the folder, layer, gap, or settled thread",
|
|
13514
13610
|
category: "Files",
|
|
13515
13611
|
keys: ["l"],
|
|
@@ -13517,6 +13613,12 @@ var init_command = __esmMin((() => {
|
|
|
13517
13613
|
}),
|
|
13518
13614
|
command({
|
|
13519
13615
|
action: "file.vouch",
|
|
13616
|
+
also: [
|
|
13617
|
+
"done",
|
|
13618
|
+
"approve",
|
|
13619
|
+
"tick",
|
|
13620
|
+
"check off"
|
|
13621
|
+
],
|
|
13520
13622
|
panes: ["tree", "diff"],
|
|
13521
13623
|
title: "Mark reviewed",
|
|
13522
13624
|
category: "Files",
|
|
@@ -13544,6 +13646,12 @@ var init_command = __esmMin((() => {
|
|
|
13544
13646
|
}),
|
|
13545
13647
|
command({
|
|
13546
13648
|
action: "compose.open",
|
|
13649
|
+
also: [
|
|
13650
|
+
"write",
|
|
13651
|
+
"note",
|
|
13652
|
+
"feedback",
|
|
13653
|
+
"say"
|
|
13654
|
+
],
|
|
13547
13655
|
panes: ["diff"],
|
|
13548
13656
|
category: "Comments",
|
|
13549
13657
|
title: "Comment on the selection",
|
|
@@ -13578,6 +13686,11 @@ var init_command = __esmMin((() => {
|
|
|
13578
13686
|
}),
|
|
13579
13687
|
command({
|
|
13580
13688
|
action: "palette.open",
|
|
13689
|
+
also: [
|
|
13690
|
+
"commands",
|
|
13691
|
+
"actions",
|
|
13692
|
+
"what can i do"
|
|
13693
|
+
],
|
|
13581
13694
|
title: "Find a command",
|
|
13582
13695
|
category: "App",
|
|
13583
13696
|
keys: ["ctrl+p"],
|
|
@@ -13604,6 +13717,12 @@ var init_command = __esmMin((() => {
|
|
|
13604
13717
|
}),
|
|
13605
13718
|
command({
|
|
13606
13719
|
action: "keys.open",
|
|
13720
|
+
also: [
|
|
13721
|
+
"help",
|
|
13722
|
+
"shortcuts",
|
|
13723
|
+
"bindings",
|
|
13724
|
+
"keys"
|
|
13725
|
+
],
|
|
13607
13726
|
title: "List every key",
|
|
13608
13727
|
category: "App",
|
|
13609
13728
|
keys: ["?"],
|
|
@@ -13714,7 +13833,7 @@ var init_match = __esmMin((() => {
|
|
|
13714
13833
|
}
|
|
13715
13834
|
return needle.length === 0;
|
|
13716
13835
|
};
|
|
13717
|
-
label = (entry) => `${entry.category} ${entry.title} ${entry.keys.join(" ")}`.toLowerCase();
|
|
13836
|
+
label = (entry) => `${entry.category} ${entry.title} ${entry.keys.join(" ")} ${entry.also.join(" ")}`.toLowerCase();
|
|
13718
13837
|
matches = (entry, query) => query.toLowerCase().split(/\s+/).filter((word) => word.length > 0).every((word) => subsequence(label(entry), word));
|
|
13719
13838
|
closeness = (entry, query) => {
|
|
13720
13839
|
const wanted = query.trim().toLowerCase();
|
|
@@ -13918,7 +14037,7 @@ var init_reduce = __esmMin((() => {
|
|
|
13918
14037
|
return shown[((at === -1 ? 0 : at) + delta + shown.length) % shown.length] ?? state.focus;
|
|
13919
14038
|
};
|
|
13920
14039
|
togglePanel = (state) => {
|
|
13921
|
-
if (!
|
|
14040
|
+
if (!panelFits(state)) return withNotice(state, "the terminal is too narrow for the review panel");
|
|
13922
14041
|
const panelOpen = !state.panelOpen;
|
|
13923
14042
|
return {
|
|
13924
14043
|
...state,
|
|
@@ -14586,7 +14705,7 @@ var init_theme = __esmMin((() => {
|
|
|
14586
14705
|
panel: "#0e1117",
|
|
14587
14706
|
overlay: "#181c26",
|
|
14588
14707
|
scrim: "#000000a0",
|
|
14589
|
-
rule: "#
|
|
14708
|
+
rule: "#3b4354",
|
|
14590
14709
|
note: "#9aa7c7",
|
|
14591
14710
|
cursor: "#232936",
|
|
14592
14711
|
selection: "#2b3854",
|
|
@@ -15296,7 +15415,7 @@ var init_diffview = __esmMin((() => {
|
|
|
15296
15415
|
}));
|
|
15297
15416
|
//#endregion
|
|
15298
15417
|
//#region src/tui/render.ts
|
|
15299
|
-
var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, DIFF_FLOOR, CRAMPED, CRAMPED_ROWS, DIFF_CHROME_MOST, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, keysOf, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, PLAIN_PICKED, PICKED, PLAIN_CURSOR, UNDER_CURSOR, GAP_PAINT, frameRoot, crampedBar, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking, makePaletteParts, makeChoices, LIST_LEAD, windowed, listText, stack, makeBody, makeHome, makeModals, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, chipWidth, WAYS_OUT, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, SUMMARY_LINES, summaryLines, contextLabel, nameRoom, stateRoom, columns, FORGE_SILENT, unaskedForge, branchHeading, atHome, layersCell, baseLabel, stateCell, branchCells, placeLabel, headerParts, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, GUTTER, DIR_LEAD, TITLE_LEAD, FILE_LEAD, STALE_ROOM, STALE_LONG, STALE_SHORT, staleBanner, layerRoom, layerMark, layerLead, layerGutter, layerText, litRow, leftOver, titlePaint, layerPaint, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, foundTitle, fileRow, blockOf, aroundRow, windowedBlocks, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelText, Screen;
|
|
15418
|
+
var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, keysTitle, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, DIFF_FLOOR, COMPOSE_EDGE, CRAMPED, CRAMPED_ROWS, DIFF_CHROME_MOST, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, keysOf, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, PLAIN_PICKED, PICKED, PLAIN_CURSOR, UNDER_CURSOR, GAP_PAINT, frameRoot, crampedBar, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking, makePaletteParts, makeChoices, LIST_LEAD, windowed, listText, stack, makeBody, makeHome, makeModals, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, quotedFor, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, chipWidth, WAYS_OUT, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, SUMMARY_LINES, summaryLines, contextLabel, nameRoom, stateRoom, columns, FORGE_SILENT, unaskedForge, branchHeading, atHome, layersCell, baseLabel, stateCell, branchCells, placeLabel, headerParts, panLabel, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, GUTTER, DIR_LEAD, TITLE_LEAD, FILE_LEAD, STALE_ROOM, STALE_LONG, STALE_SHORT, staleBanner, layerRoom, layerMark, layerLead, layerGutter, layerText, litRow, leftOver, titlePaint, layerPaint, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, foundTitle, fileRow, blockOf, aroundRow, windowedBlocks, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelText, Screen;
|
|
15300
15419
|
var init_render = __esmMin((() => {
|
|
15301
15420
|
init_command();
|
|
15302
15421
|
init_layers$1();
|
|
@@ -15321,7 +15440,12 @@ var init_render = __esmMin((() => {
|
|
|
15321
15440
|
PALETTE_TITLE = 60;
|
|
15322
15441
|
PALETTE_GAP = 2;
|
|
15323
15442
|
PALETTE_CHROME = 4;
|
|
15324
|
-
PENDING_CHROME =
|
|
15443
|
+
PENDING_CHROME = 4;
|
|
15444
|
+
keysTitle = (found, shown) => {
|
|
15445
|
+
if (found === 0) return "No key matches";
|
|
15446
|
+
if (found <= shown) return `Keys here, ${found} of them`;
|
|
15447
|
+
return `Keys here, ${found} of them — arrows for the rest`;
|
|
15448
|
+
};
|
|
15325
15449
|
PALETTE_WIDTH = 76;
|
|
15326
15450
|
PANEL_SHARE = .62;
|
|
15327
15451
|
PANEL_MAX = 120;
|
|
@@ -15333,6 +15457,7 @@ var init_render = __esmMin((() => {
|
|
|
15333
15457
|
PANE_EDGES = 2;
|
|
15334
15458
|
PANE_INSET = 1;
|
|
15335
15459
|
DIFF_FLOOR = 24;
|
|
15460
|
+
COMPOSE_EDGE = 4;
|
|
15336
15461
|
CRAMPED = "adiff needs more room than this";
|
|
15337
15462
|
CRAMPED_ROWS = 4;
|
|
15338
15463
|
DIFF_CHROME_MOST = 16;
|
|
@@ -15768,6 +15893,14 @@ var init_render = __esmMin((() => {
|
|
|
15768
15893
|
paddingBottom: 1,
|
|
15769
15894
|
flexDirection: "column"
|
|
15770
15895
|
});
|
|
15896
|
+
quotedFor = (state, shownLines, room) => {
|
|
15897
|
+
const said = threadQuote(state, room);
|
|
15898
|
+
if (said.length > 0) return said.slice(0, shownLines * 2).map((line) => clip(line, room));
|
|
15899
|
+
const snippet = snippetOf(state, shownLines);
|
|
15900
|
+
const more = selectedLineCount(state) - snippet.length;
|
|
15901
|
+
const tail = more > 0 ? [` … ${more} more lines`] : [];
|
|
15902
|
+
return [...snippet, ...tail].map((line) => clip(line, room));
|
|
15903
|
+
};
|
|
15771
15904
|
clipHead = (label, room) => label.length > room ? `…${label.slice(label.length - Math.max(0, room - 1))}` : label;
|
|
15772
15905
|
clipMiddle = (label, room) => {
|
|
15773
15906
|
if (label.length <= room) return label;
|
|
@@ -15903,7 +16036,7 @@ var init_render = __esmMin((() => {
|
|
|
15903
16036
|
const place = filePlace(state);
|
|
15904
16037
|
return `file ${place.at} of ${place.of}`;
|
|
15905
16038
|
};
|
|
15906
|
-
headerParts = (state, branch, path,
|
|
16039
|
+
headerParts = (state, branch, path, across) => [
|
|
15907
16040
|
branch,
|
|
15908
16041
|
path,
|
|
15909
16042
|
state.patches.length === 0 ? "nothing to read" : placeLabel(state),
|
|
@@ -15912,8 +16045,13 @@ var init_render = __esmMin((() => {
|
|
|
15912
16045
|
contextLabel(state.context),
|
|
15913
16046
|
state.layersStale ? "layers stale" : "",
|
|
15914
16047
|
hiddenLines(state) === 0 ? "" : `⋯ ${hiddenLines(state)} ${hiddenLines(state) === 1 ? "line" : "lines"} hidden`,
|
|
15915
|
-
|
|
16048
|
+
panLabel(state, across)
|
|
15916
16049
|
];
|
|
16050
|
+
panLabel = (state, across) => {
|
|
16051
|
+
if (across.pan > 0) return `→ ${across.pan} columns`;
|
|
16052
|
+
if (state.wrap || across.cutOff === 0) return "";
|
|
16053
|
+
return `→ ${across.cutOff} columns cut off`;
|
|
16054
|
+
};
|
|
15917
16055
|
HEADER_GAP = 2;
|
|
15918
16056
|
HEADER_PATH_MIN = 20;
|
|
15919
16057
|
headerRoom = (width) => Math.max(0, width - 2 - 4);
|
|
@@ -15991,10 +16129,12 @@ var init_render = __esmMin((() => {
|
|
|
15991
16129
|
return titlePaint(state, row.index);
|
|
15992
16130
|
};
|
|
15993
16131
|
PANEL_TITLES = {
|
|
16132
|
+
asked: "Waiting on you",
|
|
15994
16133
|
with: "With the agent",
|
|
15995
|
-
answered: "Answered"
|
|
16134
|
+
answered: "Answered, not settled",
|
|
16135
|
+
settled: "Settled"
|
|
15996
16136
|
};
|
|
15997
|
-
PANEL_ORDER =
|
|
16137
|
+
PANEL_ORDER = PANEL_SECTIONS;
|
|
15998
16138
|
PANEL_LEAD = 3;
|
|
15999
16139
|
PANEL_EMPTY = "No comment on this branch yet.";
|
|
16000
16140
|
restingOrHere = (focused) => focused ? palette.selection : palette.resting;
|
|
@@ -16079,7 +16219,26 @@ var init_render = __esmMin((() => {
|
|
|
16079
16219
|
];
|
|
16080
16220
|
};
|
|
16081
16221
|
PULL_HINT = "answered, press r to pull";
|
|
16082
|
-
|
|
16222
|
+
panelWindow = (lines, rows) => {
|
|
16223
|
+
if (lines.length <= rows) return {
|
|
16224
|
+
lines,
|
|
16225
|
+
above: 0,
|
|
16226
|
+
below: 0
|
|
16227
|
+
};
|
|
16228
|
+
const room = Math.max(1, rows - 2);
|
|
16229
|
+
const at = Math.max(0, lines.findIndex((line) => line.here === true));
|
|
16230
|
+
const start = Math.max(0, Math.min(lines.length - room, at - Math.floor(room / 2)));
|
|
16231
|
+
return {
|
|
16232
|
+
lines: lines.slice(start, start + room),
|
|
16233
|
+
above: start,
|
|
16234
|
+
below: lines.length - (start + room)
|
|
16235
|
+
};
|
|
16236
|
+
};
|
|
16237
|
+
moreLine = (count, mark, room) => count === 0 ? [] : [{
|
|
16238
|
+
text: clip(` ${mark} ${count} more`, room),
|
|
16239
|
+
tone: palette.faint
|
|
16240
|
+
}];
|
|
16241
|
+
panelText = (state, room, rows) => {
|
|
16083
16242
|
const placed = panelEntries(state).map((entry, at) => ({
|
|
16084
16243
|
entry,
|
|
16085
16244
|
at
|
|
@@ -16097,7 +16256,14 @@ var init_render = __esmMin((() => {
|
|
|
16097
16256
|
text: PANEL_EMPTY,
|
|
16098
16257
|
tone: palette.muted
|
|
16099
16258
|
}] : body;
|
|
16100
|
-
|
|
16259
|
+
const window = panelWindow(lines, Math.max(1, rows - banner.length));
|
|
16260
|
+
const shown = [
|
|
16261
|
+
...banner,
|
|
16262
|
+
...moreLine(window.above, "▲", room),
|
|
16263
|
+
...window.lines,
|
|
16264
|
+
...moreLine(window.below, "▼", room)
|
|
16265
|
+
];
|
|
16266
|
+
return new StyledText(shown.map((line) => {
|
|
16101
16267
|
const drawn = fg(line.tone)(`${line.text.padEnd(room)}\n`);
|
|
16102
16268
|
return line.here === true ? bg(restingOrHere(state.focus === "review"))(drawn) : drawn;
|
|
16103
16269
|
}));
|
|
@@ -16350,9 +16516,10 @@ var init_render = __esmMin((() => {
|
|
|
16350
16516
|
}
|
|
16351
16517
|
const rows = keyMatches(state);
|
|
16352
16518
|
const room = panelWidth(this.renderer.width);
|
|
16353
|
-
this.keysTitle.content = rows.length === 0 ? "No key matches" : `Keys here, ${rows.length} of them`;
|
|
16354
16519
|
const keysRoom = Math.min(panelRows(this.renderer.height, PANEL_QUARTER), rows.length + PENDING_CHROME);
|
|
16355
|
-
|
|
16520
|
+
const shown = Math.max(1, keysRoom - PENDING_CHROME);
|
|
16521
|
+
this.keysTitle.content = keysTitle(rows.length, shown);
|
|
16522
|
+
this.keysChoices.content = listText(rows.map((entry) => commandRow(entry, room - MODAL_ROOM)), Math.min(state.paletteIndex, Math.max(0, rows.length - 1)), shown);
|
|
16356
16523
|
this.keys.height = keysRoom;
|
|
16357
16524
|
this.keys.width = room;
|
|
16358
16525
|
this.keys.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
|
|
@@ -16362,7 +16529,10 @@ var init_render = __esmMin((() => {
|
|
|
16362
16529
|
const branch = selectedBranch(state);
|
|
16363
16530
|
if (atHome(state)) return t`${fg(palette.faint)("")}`;
|
|
16364
16531
|
const path = selectedPatch(state)?.path ?? "";
|
|
16365
|
-
const parts = headerParts(state, branch?.branch ?? "", path,
|
|
16532
|
+
const parts = headerParts(state, branch?.branch ?? "", path, {
|
|
16533
|
+
pan: Math.min(state.pan, this.view.panLimit()),
|
|
16534
|
+
cutOff: this.view.panLimit()
|
|
16535
|
+
}).filter((part) => part.length > 0);
|
|
16366
16536
|
const [name = "", ...rest] = headerFitted(parts, path, headerRoom(this.renderer.width));
|
|
16367
16537
|
return t`${fg(palette.ink)(name)} ${fg(palette.muted)(rest.join(" "))}`;
|
|
16368
16538
|
}
|
|
@@ -16404,7 +16574,8 @@ var init_render = __esmMin((() => {
|
|
|
16404
16574
|
this.panelPane.width = shown ? reviewWidth() : 0;
|
|
16405
16575
|
this.panelPane.paddingLeft = shown ? 1 : 0;
|
|
16406
16576
|
this.panelPane.paddingTop = 0;
|
|
16407
|
-
|
|
16577
|
+
const rows = Math.max(1, this.panelPane.height - PANE_EDGES);
|
|
16578
|
+
this.panel.content = shown ? panelText(state, reviewWidth() - PANE_CHROME, rows) : "";
|
|
16408
16579
|
}
|
|
16409
16580
|
listText(state) {
|
|
16410
16581
|
if (atHome(state)) return this.branchTable(state);
|
|
@@ -16660,7 +16831,8 @@ var init_render = __esmMin((() => {
|
|
|
16660
16831
|
this.composeTitle.content = "Report a bug";
|
|
16661
16832
|
this.composeQuoted.content = lead.join("\n");
|
|
16662
16833
|
this.composeQuoted.height = lead.length;
|
|
16663
|
-
const
|
|
16834
|
+
const spare = this.renderer.height - lead.length - COMPOSE_ACTION_ROWS - COMPOSE_CHROME - COMPOSE_EDGE;
|
|
16835
|
+
const written = this.fitBody(state, room.text, Math.max(1, spare));
|
|
16664
16836
|
this.composeActions.content = reportActions(state.reportFull);
|
|
16665
16837
|
this.compose.height = lead.length + written + COMPOSE_ACTION_ROWS + COMPOSE_CHROME;
|
|
16666
16838
|
this.compose.width = room.box;
|
|
@@ -16703,9 +16875,10 @@ var init_render = __esmMin((() => {
|
|
|
16703
16875
|
});
|
|
16704
16876
|
};
|
|
16705
16877
|
}
|
|
16706
|
-
fitBody(state, room) {
|
|
16878
|
+
fitBody(state, room, most) {
|
|
16707
16879
|
if (this.composeBody.width !== room) this.composeBody.width = room;
|
|
16708
|
-
const
|
|
16880
|
+
const wanted = Math.max(1, laidDraft(state.draft, room).length);
|
|
16881
|
+
const rows = Math.max(1, Math.min(most, wanted));
|
|
16709
16882
|
if (this.composeBody.height !== rows) this.composeBody.height = rows;
|
|
16710
16883
|
return rows;
|
|
16711
16884
|
}
|
|
@@ -16713,14 +16886,13 @@ var init_render = __esmMin((() => {
|
|
|
16713
16886
|
this.compose.visible = state.screen === "compose";
|
|
16714
16887
|
if (state.screen !== "compose") return;
|
|
16715
16888
|
const room = composeRoom(this.renderer.width);
|
|
16716
|
-
const
|
|
16717
|
-
const
|
|
16718
|
-
const tail = more > 0 ? [` … ${more} more lines`] : [];
|
|
16719
|
-
const quoted = [...snippet, ...tail].map((line) => clip(line, room.text));
|
|
16889
|
+
const shownLines = Math.max(1, Math.min(SNIPPET_LINES, Math.floor(this.renderer.height / 6)));
|
|
16890
|
+
const quoted = quotedFor(state, shownLines, room.text);
|
|
16720
16891
|
this.composeTitle.content = clip(composeTarget(state), room.text);
|
|
16721
16892
|
this.composeQuoted.content = [...quoted, ""].join("\n");
|
|
16722
16893
|
this.composeQuoted.height = quoted.length + 1;
|
|
16723
|
-
const
|
|
16894
|
+
const spare = this.renderer.height - quoted.length - 1 - COMPOSE_ACTION_ROWS - COMPOSE_CHROME - COMPOSE_EDGE;
|
|
16895
|
+
const written = this.fitBody(state, room.text, Math.max(1, spare));
|
|
16724
16896
|
this.composeActions.content = actionsText();
|
|
16725
16897
|
const height = quoted.length + 1 + written + COMPOSE_ACTION_ROWS + COMPOSE_CHROME;
|
|
16726
16898
|
this.compose.height = height;
|
package/package.json
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"bin": {
|
|
24
24
|
"adiff": "./bin/adiff.js"
|
|
25
25
|
},
|
|
26
|
-
"version": "0.1.0-alpha.
|
|
26
|
+
"version": "0.1.0-alpha.113",
|
|
27
27
|
"description": "Review the work an agent left you without losing the thread: comments live on the lines, the agent answers them, and each point stays open until you settle it.",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"repository": {
|