@eliya-oss/agent-diff 0.1.0-alpha.157 → 0.1.0-alpha.158
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 +157 -35
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @eliya-oss/agent-diff
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.158
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat(diff): `e` opens the line under the cursor in your editor, found from the environment or set in the settings file.
|
|
8
|
+
|
|
9
|
+
<details><summary>Why</summary>
|
|
10
|
+
|
|
11
|
+
Reading a diff is where a reviewer decides to change something, and the file and line are already
|
|
12
|
+
under the cursor. `$VISUAL`, then `$EDITOR`, then whatever launched adiff — VS Code, Cursor,
|
|
13
|
+
Windsurf, Zed and JetBrains all say so in the environment — and a known editor gets its own line
|
|
14
|
+
flag, so `code` becomes `code --goto file:line`. Set `editor` in the settings file to override it.
|
|
15
|
+
|
|
16
|
+
</details>
|
|
17
|
+
|
|
3
18
|
## 0.1.0-alpha.157
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/main.js
CHANGED
|
@@ -8822,7 +8822,7 @@ var init_error$3 = __esmMin((() => {
|
|
|
8822
8822
|
}));
|
|
8823
8823
|
//#endregion
|
|
8824
8824
|
//#region src/service/forge/service.ts
|
|
8825
|
-
var Forge, LIMIT, TIMEOUT_MS$1, SEND_TIMEOUT_MS, MOST_OUTPUT, FIELDS$1, Row, decode$1, SAID, stateOf$2, ended, ask, show, read, pulls, openPull, NUMBER_FIELDS, Named, readNamed, gh, named$
|
|
8825
|
+
var Forge, LIMIT, TIMEOUT_MS$1, SEND_TIMEOUT_MS, MOST_OUTPUT, FIELDS$1, Row, decode$1, SAID, stateOf$2, ended, ask, show, read, pulls, openPull, NUMBER_FIELDS, Named, readNamed, gh, named$2, head, sideName, commentBody, bodyFor, Landed, readLanded, keyOf$2, counted, acknowledged, landedIn, THREADS, Said, Thread, Page, Held$1, Threads, readThreads, ANONYMOUS, heardFrom$1, someLine, hasNoLine, quotedIn, spanIn, remarkOf, ownerOf, HERE, asked, whereOf, threadsIn$1, unresolved, PAGES, everyThread, answer$1, remarks, review, ForgeLive;
|
|
8826
8826
|
var init_service$2 = __esmMin((() => {
|
|
8827
8827
|
init_dist();
|
|
8828
8828
|
init_error$3();
|
|
@@ -8943,7 +8943,7 @@ var init_service$2 = __esmMin((() => {
|
|
|
8943
8943
|
if (input !== void 0) child.stdin?.end(input);
|
|
8944
8944
|
return ended(child);
|
|
8945
8945
|
});
|
|
8946
|
-
named$
|
|
8946
|
+
named$2 = fn("Forge.named")(function* (repo, branch) {
|
|
8947
8947
|
const raw = yield* gh(repo, [
|
|
8948
8948
|
"pr",
|
|
8949
8949
|
"view",
|
|
@@ -8964,7 +8964,7 @@ var init_service$2 = __esmMin((() => {
|
|
|
8964
8964
|
}));
|
|
8965
8965
|
});
|
|
8966
8966
|
head = fn("Forge.head")(function* (repo, branch) {
|
|
8967
|
-
return (yield* named$
|
|
8967
|
+
return (yield* named$2(repo, branch)).headRefOid;
|
|
8968
8968
|
});
|
|
8969
8969
|
sideName = (side) => side === "old" ? "LEFT" : "RIGHT";
|
|
8970
8970
|
commentBody = (one) => ({
|
|
@@ -9122,7 +9122,7 @@ var init_service$2 = __esmMin((() => {
|
|
|
9122
9122
|
...after === void 0 ? [] : ["-f", `after=${after}`]
|
|
9123
9123
|
]);
|
|
9124
9124
|
whereOf = fn("Forge.whereOf")(function* (repo, branch) {
|
|
9125
|
-
const pull = yield* named$
|
|
9125
|
+
const pull = yield* named$2(repo, branch);
|
|
9126
9126
|
const here = yield* ownerOf(repo);
|
|
9127
9127
|
return {
|
|
9128
9128
|
owner: here.owner,
|
|
@@ -9192,7 +9192,7 @@ var init_service$2 = __esmMin((() => {
|
|
|
9192
9192
|
return unresolved(yield* everyThread(repo, branch));
|
|
9193
9193
|
});
|
|
9194
9194
|
review = fn("Forge.review")(function* (repo, branch, comments) {
|
|
9195
|
-
const pull = yield* named$
|
|
9195
|
+
const pull = yield* named$2(repo, branch);
|
|
9196
9196
|
const route = `repos/${(yield* gh(repo, [
|
|
9197
9197
|
"repo",
|
|
9198
9198
|
"view",
|
|
@@ -9240,7 +9240,7 @@ var init_error$2 = __esmMin((() => {
|
|
|
9240
9240
|
//#endregion
|
|
9241
9241
|
//#region src/service/store/model.ts
|
|
9242
9242
|
var emptyBranchState;
|
|
9243
|
-
var init_model$
|
|
9243
|
+
var init_model$6 = __esmMin((() => {
|
|
9244
9244
|
emptyBranchState = {
|
|
9245
9245
|
taken: {},
|
|
9246
9246
|
vouches: {},
|
|
@@ -9343,7 +9343,8 @@ var init_schema = __esmMin((() => {
|
|
|
9343
9343
|
hideSettled: optionalKey(Boolean),
|
|
9344
9344
|
newestFirst: optionalKey(Boolean),
|
|
9345
9345
|
remarks: optionalKey(Boolean),
|
|
9346
|
-
hold: optionalKey(Boolean)
|
|
9346
|
+
hold: optionalKey(Boolean),
|
|
9347
|
+
editor: optionalKey(String$1)
|
|
9347
9348
|
});
|
|
9348
9349
|
Watching = Struct({ lookedAt: String$1 });
|
|
9349
9350
|
UpgradeCheck = Struct({
|
|
@@ -9402,7 +9403,7 @@ var Store, ensureDir, readOptional, missing$1, damaged, jsonOf$1, decoded, unwri
|
|
|
9402
9403
|
var init_service$1 = __esmMin((() => {
|
|
9403
9404
|
init_dist();
|
|
9404
9405
|
init_error$2();
|
|
9405
|
-
init_model$
|
|
9406
|
+
init_model$6();
|
|
9406
9407
|
init_schema();
|
|
9407
9408
|
init_paths();
|
|
9408
9409
|
Store = class extends Service()("adiff/Store") {};
|
|
@@ -9830,12 +9831,12 @@ var init_store = __esmMin((() => {
|
|
|
9830
9831
|
init_service$1();
|
|
9831
9832
|
init_error$2();
|
|
9832
9833
|
init_paths();
|
|
9833
|
-
init_model$
|
|
9834
|
+
init_model$6();
|
|
9834
9835
|
}));
|
|
9835
9836
|
//#endregion
|
|
9836
9837
|
//#region src/domain/patch/model.ts
|
|
9837
9838
|
var WHOLE_FILE, lineOn;
|
|
9838
|
-
var init_model$
|
|
9839
|
+
var init_model$5 = __esmMin((() => {
|
|
9839
9840
|
WHOLE_FILE = 1e5;
|
|
9840
9841
|
lineOn = (row, side) => side === "new" ? row.newLine : row.oldLine;
|
|
9841
9842
|
}));
|
|
@@ -9844,7 +9845,7 @@ var init_model$4 = __esmMin((() => {
|
|
|
9844
9845
|
var sideOf, linesOn, anchorFor, rowsForRange, sideLines, runsAt, nearestRun, SHORTEST_NEAR, PER_EDIT, edits, isNear, nearestLike, foundExactly, foundAlike, foundAgain;
|
|
9845
9846
|
var init_anchor = __esmMin((() => {
|
|
9846
9847
|
init_dist();
|
|
9847
|
-
init_model$
|
|
9848
|
+
init_model$5();
|
|
9848
9849
|
sideOf = (rows) => rows.some((row) => isSome(row.newLine)) ? "new" : "old";
|
|
9849
9850
|
linesOn = (rows, side) => rows.flatMap((row) => match$3(lineOn(row, side), {
|
|
9850
9851
|
onNone: () => [],
|
|
@@ -10174,7 +10175,7 @@ var init_patch = __esmMin((() => {
|
|
|
10174
10175
|
init_anchor();
|
|
10175
10176
|
init_parse$1();
|
|
10176
10177
|
init_sticky();
|
|
10177
|
-
init_model$
|
|
10178
|
+
init_model$5();
|
|
10178
10179
|
}));
|
|
10179
10180
|
//#endregion
|
|
10180
10181
|
//#region src/service/git/error.ts
|
|
@@ -10478,8 +10479,8 @@ var init_review = __esmMin((() => {
|
|
|
10478
10479
|
}));
|
|
10479
10480
|
//#endregion
|
|
10480
10481
|
//#region src/domain/preferences/model.ts
|
|
10481
|
-
var preferences, preferenceNames, preferenceNamed, heldValue, heldValues;
|
|
10482
|
-
var init_model$
|
|
10482
|
+
var preferences, preferenceNames, preferenceNamed, asFlag, heldValue, heldValues;
|
|
10483
|
+
var init_model$4 = __esmMin((() => {
|
|
10483
10484
|
preferences = [
|
|
10484
10485
|
{
|
|
10485
10486
|
name: "wrap",
|
|
@@ -10532,13 +10533,14 @@ var init_model$3 = __esmMin((() => {
|
|
|
10532
10533
|
];
|
|
10533
10534
|
preferenceNames = preferences.map((one) => one.name);
|
|
10534
10535
|
preferenceNamed = (name) => preferences.find((one) => one.name === name);
|
|
10535
|
-
|
|
10536
|
+
asFlag = (held) => typeof held === "boolean" ? held : void 0;
|
|
10537
|
+
heldValue = (kept, name) => asFlag(kept[name]) ?? preferenceNamed(name)?.byDefault ?? false;
|
|
10536
10538
|
heldValues = (kept) => Object.fromEntries(preferences.map((one) => [one.name, heldValue(kept, one.name)]));
|
|
10537
10539
|
}));
|
|
10538
10540
|
//#endregion
|
|
10539
10541
|
//#region src/domain/preferences/index.ts
|
|
10540
10542
|
var init_preferences = __esmMin((() => {
|
|
10541
|
-
init_model$
|
|
10543
|
+
init_model$4();
|
|
10542
10544
|
})), UnknownBranch, UnknownBase, UnknownFile, UnknownComment, UnknownRemark, NothingSaid, RemarkTaken, UnknownPreference, UnknownPreferenceValue, UnselectableRange, UnknownCommand, MissingOption, UnknownWorktree, MalformedLayers, UnknownField, UnknownOption, BadOption, UnknownDraft, NothingDrafted, PartlySent, PullMoved, NoLayers;
|
|
10543
10545
|
var init_error = __esmMin((() => {
|
|
10544
10546
|
init_dist();
|
|
@@ -11219,7 +11221,7 @@ var init_drafts = __esmMin((() => {
|
|
|
11219
11221
|
}));
|
|
11220
11222
|
//#endregion
|
|
11221
11223
|
//#region src/cli/pane.ts
|
|
11222
|
-
var TIMEOUT_MS, set, splitters, named, selfInvocation, ran, split, openPane;
|
|
11224
|
+
var TIMEOUT_MS, set, splitters, named$1, selfInvocation, ran, split, openPane;
|
|
11223
11225
|
var init_pane = __esmMin((() => {
|
|
11224
11226
|
init_dist();
|
|
11225
11227
|
TIMEOUT_MS = 5e3;
|
|
@@ -11280,7 +11282,7 @@ var init_pane = __esmMin((() => {
|
|
|
11280
11282
|
]
|
|
11281
11283
|
}
|
|
11282
11284
|
];
|
|
11283
|
-
named = (option, value) => value === void 0 ? [] : [`--${option}`, value];
|
|
11285
|
+
named$1 = (option, value) => value === void 0 ? [] : [`--${option}`, value];
|
|
11284
11286
|
selfInvocation = (repo, branch, base) => {
|
|
11285
11287
|
const entry = process.argv[1];
|
|
11286
11288
|
return [
|
|
@@ -11293,8 +11295,8 @@ var init_pane = __esmMin((() => {
|
|
|
11293
11295
|
"open",
|
|
11294
11296
|
"--repo",
|
|
11295
11297
|
repo,
|
|
11296
|
-
...named("branch", branch),
|
|
11297
|
-
...named("base", base)
|
|
11298
|
+
...named$1("branch", branch),
|
|
11299
|
+
...named$1("base", base)
|
|
11298
11300
|
];
|
|
11299
11301
|
};
|
|
11300
11302
|
ran = (binary, args) => callback$1((resume) => {
|
|
@@ -11305,7 +11307,7 @@ var init_pane = __esmMin((() => {
|
|
|
11305
11307
|
return yield* ran(chosen.binary, chosen.args(repo, selfInvocation(repo, branch, base)));
|
|
11306
11308
|
});
|
|
11307
11309
|
openPane = fn("Cli.openPane")(function* (repo, branch, base) {
|
|
11308
|
-
const said = [...named("branch", branch), ...named("base", base)].join(" ");
|
|
11310
|
+
const said = [...named$1("branch", branch), ...named$1("base", base)].join(" ");
|
|
11309
11311
|
const command = `adiff review open --repo ${repo}${said.length === 0 ? "" : ` ${said}`}`;
|
|
11310
11312
|
const chosen = splitters.find((candidate) => candidate.present());
|
|
11311
11313
|
if (chosen === void 0) return {
|
|
@@ -11324,7 +11326,7 @@ var init_pane = __esmMin((() => {
|
|
|
11324
11326
|
//#region package.json
|
|
11325
11327
|
init_drafts();
|
|
11326
11328
|
init_pane();
|
|
11327
|
-
var version$1 = "0.1.0-alpha.
|
|
11329
|
+
var version$1 = "0.1.0-alpha.158";
|
|
11328
11330
|
//#endregion
|
|
11329
11331
|
//#region src/cli/upgrade.ts
|
|
11330
11332
|
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$1, newer, tagIn, fetched, askLatest, here, findUpgrade, willUpgrade, ranChild, runUpgrade, statusOf$1, sayFound, sayDone, attempted, SAY_SKILL_TOO, upgradeReport;
|
|
@@ -11494,7 +11496,7 @@ var init_upgrade$1 = __esmMin((() => {
|
|
|
11494
11496
|
};
|
|
11495
11497
|
};
|
|
11496
11498
|
})), DATA_ENDS, DATA_NAMES, DATA_STARTS, DATA_PARTS, TEST_PARTS, TEST_ENDS, partsOf, nameOf$1, isData, isTest, tierOf, KEYWORDS, escaped, BORROWS, declaresIn, bandOf, TIERS, BANDS, rankOf, inFile, byRank, byFile, countedIn, ranked;
|
|
11497
|
-
var init_model$
|
|
11499
|
+
var init_model$3 = __esmMin((() => {
|
|
11498
11500
|
DATA_ENDS = [
|
|
11499
11501
|
".txt",
|
|
11500
11502
|
".csv",
|
|
@@ -11658,7 +11660,7 @@ var init_model$2 = __esmMin((() => {
|
|
|
11658
11660
|
//#endregion
|
|
11659
11661
|
//#region src/domain/search/index.ts
|
|
11660
11662
|
var init_search$1 = __esmMin((() => {
|
|
11661
|
-
init_model$
|
|
11663
|
+
init_model$3();
|
|
11662
11664
|
}));
|
|
11663
11665
|
//#endregion
|
|
11664
11666
|
//#region src/cli/search.ts
|
|
@@ -11725,7 +11727,7 @@ var init_search = __esmMin((() => {
|
|
|
11725
11727
|
//#endregion
|
|
11726
11728
|
//#region src/domain/layers/model.ts
|
|
11727
11729
|
var REMAINDER_TITLE;
|
|
11728
|
-
var init_model$
|
|
11730
|
+
var init_model$2 = __esmMin((() => {
|
|
11729
11731
|
REMAINDER_TITLE = "not in any layer";
|
|
11730
11732
|
}));
|
|
11731
11733
|
//#endregion
|
|
@@ -11733,7 +11735,7 @@ var init_model$1 = __esmMin((() => {
|
|
|
11733
11735
|
var codeBlockOf$1, codeBlocks, noteOf, spansOf$1, changedLines, holds, claimsHunk, runsOf, tallyOf, coverage, sharedHunks, runsSaid, filesSaid, leftSaid, unordered, withFullCoverage, proseAnchors;
|
|
11734
11736
|
var init_coverage = __esmMin((() => {
|
|
11735
11737
|
init_dist();
|
|
11736
|
-
init_model$
|
|
11738
|
+
init_model$2();
|
|
11737
11739
|
codeBlockOf$1 = (span) => ({
|
|
11738
11740
|
kind: "code",
|
|
11739
11741
|
path: span.path,
|
|
@@ -11880,7 +11882,7 @@ var init_version = __esmMin((() => {
|
|
|
11880
11882
|
var init_layers$1 = __esmMin((() => {
|
|
11881
11883
|
init_coverage();
|
|
11882
11884
|
init_version();
|
|
11883
|
-
init_model$
|
|
11885
|
+
init_model$2();
|
|
11884
11886
|
}));
|
|
11885
11887
|
//#endregion
|
|
11886
11888
|
//#region src/cli/layers.ts
|
|
@@ -13943,7 +13945,7 @@ var init_tree = __esmMin((() => {
|
|
|
13943
13945
|
};
|
|
13944
13946
|
crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
|
|
13945
13947
|
})), HOLDS, chosenNow, withChosen, preferenceRows, nothingReviewed, nothingFound, initialState, TREE_MAX, TREE_ROOMY, TREE_WIDE, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, tooSmall, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, kept, layerHolds, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip, TITLE_ROWS, titleRows, shortDir, fileRow$1, shownFiles, dirOf, fileRows, layerRead, layerDone, countRow, NOTHING_LEFT, textRows, emptyRows, layerBody, holdsCursor, layerCard, layerRows, nearFirst, layerFitted, restingAt, railTop, PANE_CHROME$1, layerRoomIn, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, MINUTE, HOUR, DAY, sinceThen, threadStand, STAND_WEIGHT, louder, threadsOn, hiddenLines, rowsUnder, markedStands, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, remarkAnswering, answerTarget, replyTarget, threadReplying, VOICES, remarkQuote, threadQuote, pickedText, takenRows, selectedLines, shownMatches, refsShown, refHere, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, needingRowsIn, commentRowsIn, threadsAtRow, remarkShown, remarksAtRow, remarkRowsIn, stopsIn, stopsAtRow, remarkAtStop, remarkAtRow, remarkInPanel, remarkInDiff, remarkUnderCursor, remarkToTakeOn, remarkHere, threadHere, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, SECTION_OF, sectionOf, sentEntry, remarkRows, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
|
|
13946
|
-
var init_model = __esmMin((() => {
|
|
13948
|
+
var init_model$1 = __esmMin((() => {
|
|
13947
13949
|
init_dist();
|
|
13948
13950
|
init_patch();
|
|
13949
13951
|
init_preferences();
|
|
@@ -14792,7 +14794,7 @@ var init_model = __esmMin((() => {
|
|
|
14792
14794
|
var AROUND_CURSOR, TREE_ROWS, sign, visibleRows, visibleTree, whereabouts, said$1, chosenAway, standingOn, layersLine, remarksLine, shapeLine, tookLine, facts, fenced, fully, minimal, lastFailure, buildReport;
|
|
14793
14795
|
var init_report = __esmMin((() => {
|
|
14794
14796
|
init_dist();
|
|
14795
|
-
init_model();
|
|
14797
|
+
init_model$1();
|
|
14796
14798
|
init_preferences();
|
|
14797
14799
|
AROUND_CURSOR = 8;
|
|
14798
14800
|
TREE_ROWS = 12;
|
|
@@ -14897,6 +14899,56 @@ var init_report = __esmMin((() => {
|
|
|
14897
14899
|
};
|
|
14898
14900
|
}));
|
|
14899
14901
|
//#endregion
|
|
14902
|
+
//#region src/domain/editor/model.ts
|
|
14903
|
+
var KNOWN, LINED, named, shaped, guessed, templateFor, openingOf;
|
|
14904
|
+
var init_model = __esmMin((() => {
|
|
14905
|
+
KNOWN = [
|
|
14906
|
+
["vscode", "code --goto {file}:{line}"],
|
|
14907
|
+
["cursor", "cursor --goto {file}:{line}"],
|
|
14908
|
+
["windsurf", "windsurf --goto {file}:{line}"],
|
|
14909
|
+
["zed", "zed {file}:{line}"],
|
|
14910
|
+
["jetbrains", "idea --line {line} {file}"]
|
|
14911
|
+
];
|
|
14912
|
+
LINED = [
|
|
14913
|
+
["code", "{command} --goto {file}:{line}"],
|
|
14914
|
+
["cursor", "{command} --goto {file}:{line}"],
|
|
14915
|
+
["zed", "{command} {file}:{line}"],
|
|
14916
|
+
["idea", "{command} --line {line} {file}"],
|
|
14917
|
+
["subl", "{command} {file}:{line}"],
|
|
14918
|
+
["vim", "{command} +{line} {file}"],
|
|
14919
|
+
["nvim", "{command} +{line} {file}"],
|
|
14920
|
+
["hx", "{command} {file}:{line}"],
|
|
14921
|
+
["nano", "{command} +{line} {file}"],
|
|
14922
|
+
["emacs", "{command} +{line} {file}"]
|
|
14923
|
+
];
|
|
14924
|
+
named = (said) => said.trim().split(/\s+/)[0]?.split("/").at(-1) ?? "";
|
|
14925
|
+
shaped = (said) => {
|
|
14926
|
+
if (said.includes("{file}")) return said;
|
|
14927
|
+
const known = LINED.find(([name]) => name === named(said));
|
|
14928
|
+
return known === void 0 ? `${said} {file}` : known[1].replace("{command}", said);
|
|
14929
|
+
};
|
|
14930
|
+
guessed = (told) => {
|
|
14931
|
+
const marks = `${told.termProgram ?? ""} ${told.terminalEmulator ?? ""}`.toLowerCase();
|
|
14932
|
+
return KNOWN.find(([mark]) => marks.includes(mark))?.[1];
|
|
14933
|
+
};
|
|
14934
|
+
templateFor = (told) => {
|
|
14935
|
+
const asked = told.editor ?? told.visual ?? told.fallback;
|
|
14936
|
+
return asked === void 0 || asked.trim().length === 0 ? guessed(told) : shaped(asked);
|
|
14937
|
+
};
|
|
14938
|
+
openingOf = (template, file, line) => {
|
|
14939
|
+
const [command, ...args] = template.replaceAll("{file}", file).replaceAll("{line}", String(line)).trim().split(/\s+/);
|
|
14940
|
+
return command === void 0 ? void 0 : {
|
|
14941
|
+
command,
|
|
14942
|
+
args
|
|
14943
|
+
};
|
|
14944
|
+
};
|
|
14945
|
+
}));
|
|
14946
|
+
//#endregion
|
|
14947
|
+
//#region src/domain/editor/index.ts
|
|
14948
|
+
var init_editor = __esmMin((() => {
|
|
14949
|
+
init_model();
|
|
14950
|
+
}));
|
|
14951
|
+
//#endregion
|
|
14900
14952
|
//#region src/tui/watch.ts
|
|
14901
14953
|
var OUTBOX, SETTLE_MS, WatchUnavailable, answered, opened, holding, answers;
|
|
14902
14954
|
var init_watch = __esmMin((() => {
|
|
@@ -15329,6 +15381,23 @@ var init_command = __esmMin((() => {
|
|
|
15329
15381
|
screens: ["base"],
|
|
15330
15382
|
listed: false
|
|
15331
15383
|
}),
|
|
15384
|
+
command({
|
|
15385
|
+
action: "line.open",
|
|
15386
|
+
also: [
|
|
15387
|
+
"editor",
|
|
15388
|
+
"ide",
|
|
15389
|
+
"vscode",
|
|
15390
|
+
"open in",
|
|
15391
|
+
"jump to"
|
|
15392
|
+
],
|
|
15393
|
+
panes: ["diff"],
|
|
15394
|
+
title: "Open this line in your editor",
|
|
15395
|
+
category: "Reading",
|
|
15396
|
+
keys: ["e"],
|
|
15397
|
+
screens: ["review"],
|
|
15398
|
+
hint: "editor",
|
|
15399
|
+
rank: 5
|
|
15400
|
+
}),
|
|
15332
15401
|
command({
|
|
15333
15402
|
action: "review.reload",
|
|
15334
15403
|
title: "Read the branches again",
|
|
@@ -15863,7 +15932,7 @@ var init_reduce = __esmMin((() => {
|
|
|
15863
15932
|
init_gaps();
|
|
15864
15933
|
init_match();
|
|
15865
15934
|
init_preferences();
|
|
15866
|
-
init_model();
|
|
15935
|
+
init_model$1();
|
|
15867
15936
|
clamp = (value, low, high) => Math.max(low, Math.min(high, value));
|
|
15868
15937
|
lastRow = (patch) => Math.max(0, (patch?.rows.length ?? 1) - 1);
|
|
15869
15938
|
rowsIn = (state) => selectedPatch(state)?.rows.length ?? 0;
|
|
@@ -16430,6 +16499,7 @@ var init_reduce = __esmMin((() => {
|
|
|
16430
16499
|
"base.clear": (state) => state,
|
|
16431
16500
|
"base.next": (state) => moveRef(state, 1),
|
|
16432
16501
|
"base.prev": (state) => moveRef(state, -1),
|
|
16502
|
+
"line.open": (state) => state,
|
|
16433
16503
|
"thread.settle": (state) => state,
|
|
16434
16504
|
"thread.settleRead": (state) => state,
|
|
16435
16505
|
"thread.remove": (state) => state,
|
|
@@ -16915,7 +16985,7 @@ var init_diffview = __esmMin((() => {
|
|
|
16915
16985
|
init_dist();
|
|
16916
16986
|
init_patch();
|
|
16917
16987
|
init_marks();
|
|
16918
|
-
init_model();
|
|
16988
|
+
init_model$1();
|
|
16919
16989
|
init_theme();
|
|
16920
16990
|
WASH = {
|
|
16921
16991
|
added: {
|
|
@@ -17624,7 +17694,7 @@ var init_render = __esmMin((() => {
|
|
|
17624
17694
|
init_diffview();
|
|
17625
17695
|
init_gaps();
|
|
17626
17696
|
init_reduce();
|
|
17627
|
-
init_model();
|
|
17697
|
+
init_model$1();
|
|
17628
17698
|
init_marks();
|
|
17629
17699
|
init_theme();
|
|
17630
17700
|
ROW_HEIGHT = 1;
|
|
@@ -19538,11 +19608,12 @@ var init_upgrade = __esmMin((() => {
|
|
|
19538
19608
|
}));
|
|
19539
19609
|
//#endregion
|
|
19540
19610
|
//#region src/tui/app.ts
|
|
19541
|
-
var LEAVING_MS, LOOK_MS, LEAST_TERM, AGE_TICK_MS, LEAVING_SAID, NOTHING_WRITTEN, WORTH_TIMING_MS, TIMES_KEPT, SLOWEST_KEPT, NOTHING_COUNTED, READING_PULL, FORGE_QUIET, countOf, leavingSaid, LAYERS_ASK_LEAD, layersAsk, askedFor, alongFrom, NOTICE_MS, KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, seedFor, handOver, throughMultiplexer, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, OVER, overReview, writesInto, listens, LETTER, laidOut, ARROWS, SHIFTED, keyName, App, sentAway, turnedOver, settledPath, restsWhereItLanded, lonelyGaps, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
|
|
19611
|
+
var LEAVING_MS, LOOK_MS, LEAST_TERM, AGE_TICK_MS, LEAVING_SAID, NOTHING_WRITTEN, NO_EDITOR, WORTH_TIMING_MS, TIMES_KEPT, SLOWEST_KEPT, NOTHING_COUNTED, READING_PULL, FORGE_QUIET, countOf, leavingSaid, LAYERS_ASK_LEAD, layersAsk, askedFor, alongFrom, NOTICE_MS, KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, seedFor, handOver, throughMultiplexer, ranAside, editorTold, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, OVER, overReview, writesInto, listens, LETTER, laidOut, ARROWS, SHIFTED, keyName, App, sentAway, turnedOver, settledPath, restsWhereItLanded, lonelyGaps, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
|
|
19542
19612
|
var init_app = __esmMin((() => {
|
|
19543
19613
|
init_dist();
|
|
19544
19614
|
init_report();
|
|
19545
19615
|
init_patch();
|
|
19616
|
+
init_editor();
|
|
19546
19617
|
init_cli();
|
|
19547
19618
|
init_preferences();
|
|
19548
19619
|
init_store();
|
|
@@ -19550,7 +19621,7 @@ var init_app = __esmMin((() => {
|
|
|
19550
19621
|
init_forge();
|
|
19551
19622
|
init_command();
|
|
19552
19623
|
init_gaps();
|
|
19553
|
-
init_model();
|
|
19624
|
+
init_model$1();
|
|
19554
19625
|
init_reduce();
|
|
19555
19626
|
init_display();
|
|
19556
19627
|
init_intent();
|
|
@@ -19562,6 +19633,7 @@ var init_app = __esmMin((() => {
|
|
|
19562
19633
|
AGE_TICK_MS = 3e4;
|
|
19563
19634
|
LEAVING_SAID = "press ctrl+c again to leave";
|
|
19564
19635
|
NOTHING_WRITTEN = "nothing written yet";
|
|
19636
|
+
NO_EDITOR = "no editor to open it in: set $VISUAL, or editor in the settings file";
|
|
19565
19637
|
WORTH_TIMING_MS = 250;
|
|
19566
19638
|
TIMES_KEPT = 40;
|
|
19567
19639
|
SLOWEST_KEPT = 3;
|
|
@@ -19629,6 +19701,29 @@ var init_app = __esmMin((() => {
|
|
|
19629
19701
|
if (process.env["TMUX"] !== void 0) return `\u001BPtmux;\u001B${sequence}\u001B\\`;
|
|
19630
19702
|
return process.env["STY"] === void 0 ? sequence : `\u001BP${sequence}\u001B\\`;
|
|
19631
19703
|
};
|
|
19704
|
+
ranAside = (command, args) => {
|
|
19705
|
+
try {
|
|
19706
|
+
const child = spawn(command, [...args], {
|
|
19707
|
+
detached: true,
|
|
19708
|
+
stdio: "ignore"
|
|
19709
|
+
});
|
|
19710
|
+
child.on("error", () => void 0);
|
|
19711
|
+
child.unref();
|
|
19712
|
+
return true;
|
|
19713
|
+
} catch {
|
|
19714
|
+
return false;
|
|
19715
|
+
}
|
|
19716
|
+
};
|
|
19717
|
+
editorTold = gen(function* () {
|
|
19718
|
+
const held = (yield* (yield* Store).settings)["editor"];
|
|
19719
|
+
return {
|
|
19720
|
+
editor: typeof held === "string" ? held : void 0,
|
|
19721
|
+
visual: process.env["VISUAL"],
|
|
19722
|
+
fallback: process.env["EDITOR"],
|
|
19723
|
+
termProgram: process.env["TERM_PROGRAM"],
|
|
19724
|
+
terminalEmulator: process.env["TERMINAL_EMULATOR"]
|
|
19725
|
+
};
|
|
19726
|
+
});
|
|
19632
19727
|
copyToClipboard = (text) => {
|
|
19633
19728
|
const encoded = Buffer.from(text, "utf8").toString("base64");
|
|
19634
19729
|
process.stdout.write(throughMultiplexer(`\u001B]52;c;${encoded}\u0007`));
|
|
@@ -20123,6 +20218,7 @@ var init_app = __esmMin((() => {
|
|
|
20123
20218
|
"base.open": () => this.openBases(),
|
|
20124
20219
|
"base.set": () => this.setBaseHere(),
|
|
20125
20220
|
"base.clear": () => this.clearBaseHere(),
|
|
20221
|
+
"line.open": () => this.openInEditor(),
|
|
20126
20222
|
"report.open": () => sync(() => this.commit(reduce(this.measured(), "report.open"))),
|
|
20127
20223
|
back: () => this.goBack(),
|
|
20128
20224
|
"report.send": () => this.sendReport(),
|
|
@@ -20972,10 +21068,36 @@ var init_app = __esmMin((() => {
|
|
|
20972
21068
|
const reading = this.reading;
|
|
20973
21069
|
return reading === void 0 || reading.worktree.branch !== branch ? listSent(this.repo, branch) : sentIn(reading);
|
|
20974
21070
|
}
|
|
21071
|
+
whereTheLineIs() {
|
|
21072
|
+
const branch = selectedBranch(this.state);
|
|
21073
|
+
const patch = selectedPatch(this.state);
|
|
21074
|
+
if (branch === void 0 || patch === void 0) return void 0;
|
|
21075
|
+
const held = this.worktreeFor(branch.branch)?.path ?? this.repo;
|
|
21076
|
+
return {
|
|
21077
|
+
file: resolve(held, patch.path),
|
|
21078
|
+
path: patch.path,
|
|
21079
|
+
line: sourceLineAt(this.state, this.state.cursor) ?? 1
|
|
21080
|
+
};
|
|
21081
|
+
}
|
|
21082
|
+
openInEditor() {
|
|
21083
|
+
return gen({ self: this }, function* () {
|
|
21084
|
+
const where = this.whereTheLineIs();
|
|
21085
|
+
if (where === void 0) return;
|
|
21086
|
+
const template = templateFor(yield* editorTold);
|
|
21087
|
+
const opening = template === void 0 ? void 0 : openingOf(template, where.file, where.line);
|
|
21088
|
+
if (opening === void 0) {
|
|
21089
|
+
this.commit(withNoticeHere(this.state, NO_EDITOR));
|
|
21090
|
+
return;
|
|
21091
|
+
}
|
|
21092
|
+
const said = ranAside(opening.command, opening.args) ? `${where.path}:${where.line} in ${opening.command}` : `${opening.command} would not start`;
|
|
21093
|
+
this.commit(withNoticeHere(this.state, said));
|
|
21094
|
+
});
|
|
21095
|
+
}
|
|
20975
21096
|
showPull() {
|
|
20976
21097
|
return gen({ self: this }, function* () {
|
|
20977
21098
|
const branch = selectedBranch(this.state);
|
|
20978
21099
|
if (branch === void 0) return;
|
|
21100
|
+
if (pullHere(this.state).length === 0) yield* this.loadPulls();
|
|
20979
21101
|
if (knownToHaveNoPull(this.state)) {
|
|
20980
21102
|
this.commit(withNoticeHere(this.state, "no pull request for this branch"));
|
|
20981
21103
|
return;
|
|
@@ -21369,7 +21491,7 @@ var init_tui = __esmMin((() => {
|
|
|
21369
21491
|
init_app();
|
|
21370
21492
|
init_command();
|
|
21371
21493
|
init_match();
|
|
21372
|
-
init_model();
|
|
21494
|
+
init_model$1();
|
|
21373
21495
|
init_render();
|
|
21374
21496
|
init_reduce();
|
|
21375
21497
|
init_theme();
|
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.158",
|
|
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": {
|