@eliya-oss/agent-diff 0.1.0-alpha.167 → 0.1.0-alpha.168

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.168
4
+
5
+ ### Patch Changes
6
+
7
+ - feat(branches): `b` offers the last five commits as bases, each named by the message of the newest commit it takes in, so reading just what the agent last did is one keypress and a return.
8
+
3
9
  ## 0.1.0-alpha.167
4
10
 
5
11
  ### Patch Changes
package/dist/main.js CHANGED
@@ -10216,7 +10216,7 @@ var init_run = __esmMin((() => {
10216
10216
  gitOrEmpty = fn("Git.runOrEmpty")(function* (cwd, args) {
10217
10217
  return yield* git(cwd, args).pipe(catchTag("GitCommandFailed", () => succeed$1("")));
10218
10218
  });
10219
- })), CACHE_SIZE, NAME_TTL, FRESH_TTL, SPLIT, DEFAULT_BRANCH_CANDIDATES, PLAIN_PATHS, STAT, Git, parseStat, readEntries, findDefaultBranch, partsOf$2, findMergeBase, toWorktree, branchTips, findParent, splitLines, absent, readText, settled, seenAs, listWorktrees, readDiff, readStat, readSource, readBlob, readGrep, findRepo, REFS_MOST, readRefs, refResolves, sharedCommit, makeCaches, shapeWith, makeGit, GitLive;
10219
+ })), CACHE_SIZE, NAME_TTL, FRESH_TTL, SPLIT, DEFAULT_BRANCH_CANDIDATES, PLAIN_PATHS, STAT, Git, parseStat, readEntries, findDefaultBranch, partsOf$2, findMergeBase, toWorktree, branchTips, findParent, splitLines, absent, readText, settled, seenAs, listWorktrees, readDiff, readStat, readSource, readBlob, readGrep, findRepo, REFS_MOST, readCommits, readRefs, refResolves, sharedCommit, makeCaches, shapeWith, makeGit, GitLive;
10220
10220
  var init_service = __esmMin((() => {
10221
10221
  init_dist();
10222
10222
  init_error$1();
@@ -10392,6 +10392,18 @@ var init_service = __esmMin((() => {
10392
10392
  return trimmed.length === 0 ? resolve(worktree) : resolve(trimmed, "..");
10393
10393
  });
10394
10394
  REFS_MOST = 200;
10395
+ readCommits = fn("Git.commits")(function* (repo, branch, most) {
10396
+ return (yield* gitOrEmpty(repo, [
10397
+ "log",
10398
+ `--max-count=${most}`,
10399
+ "--format=%h%x09%s",
10400
+ branch,
10401
+ "--"
10402
+ ])).split("\n").map((line) => line.split(" ")).flatMap(([sha, subject]) => sha === void 0 || sha.trim().length === 0 ? [] : [{
10403
+ sha: sha.trim(),
10404
+ said: (subject ?? "").trim()
10405
+ }]);
10406
+ });
10395
10407
  readRefs = fn("Git.refs")(function* (repo) {
10396
10408
  return (yield* gitOrEmpty(repo, [
10397
10409
  "for-each-ref",
@@ -10446,6 +10458,7 @@ var init_service = __esmMin((() => {
10446
10458
  defaultBranch: (repo) => get(caches.baseName, repo),
10447
10459
  stackParent: (repo, branch) => get(caches.baseName, repo).pipe(flatMap((fallback) => get(caches.parent, `${repo}${SPLIT}${branch}${SPLIT}${fallback}`))),
10448
10460
  refs: readRefs,
10461
+ commits: (repo, branch, most) => readCommits(repo, branch, most),
10449
10462
  resolves: refResolves,
10450
10463
  sharedWith: sharedCommit
10451
10464
  });
@@ -10579,7 +10592,7 @@ var init_error = __esmMin((() => {
10579
10592
  }));
10580
10593
  //#endregion
10581
10594
  //#region src/cli/commands.ts
10582
- var realOf, CONTEXT, POLL, AUTO, askedFor$1, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, waitingOn, summaryOf, summaryFor, listBranches, readParts, blobOf, vouchIn, toggleVouch, readingOf, markOpened, lastOpenedIn, progressIn, reviewProgress, bodyOf, saidTo, spunOf, sentOf, whereItSitsNow$1, linesIn, trimmedLines, NAMES_SOMETHING, worthMatching, blockAt, wholeSnippetIn, stillInFile, foundOutsideTheHunks, sentIn, listSent, anchorIn, commentsIn, commentIn, submitComment, submitComments, without$2, submitReply, listPatches, patchIn, flatten, threadBefore, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, fileBefore, readPreferences, readPreference, ON, OFF, preferenceValue, savePreference, listRefs, setBase, clearBase, markRead;
10595
+ var realOf, CONTEXT, POLL, AUTO, askedFor$1, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, waitingOn, summaryOf, summaryFor, listBranches, readParts, blobOf, vouchIn, toggleVouch, readingOf, markOpened, lastOpenedIn, progressIn, reviewProgress, bodyOf, saidTo, spunOf, sentOf, whereItSitsNow$1, linesIn, trimmedLines, NAMES_SOMETHING, worthMatching, blockAt, wholeSnippetIn, stillInFile, foundOutsideTheHunks, sentIn, listSent, anchorIn, commentsIn, commentIn, submitComment, submitComments, without$2, submitReply, listPatches, patchIn, flatten, threadBefore, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, fileBefore, readPreferences, readPreference, ON, OFF, preferenceValue, savePreference, listRefs, forOne, recentBases, setBase, clearBase, markRead;
10583
10596
  var init_commands = __esmMin((() => {
10584
10597
  init_dist();
10585
10598
  init_patch();
@@ -11124,6 +11137,19 @@ var init_commands = __esmMin((() => {
11124
11137
  listRefs = fn("Cli.listRefs")(function* (repo) {
11125
11138
  return yield* (yield* Git).refs(repo);
11126
11139
  });
11140
+ forOne = (count) => count === 1 ? "the last commit" : `the last ${count} commits`;
11141
+ recentBases = fn("Cli.recentBases")(function* (repo, branch) {
11142
+ const found = yield* (yield* Git).commits(repo, branch, 6);
11143
+ return found.flatMap((commit, at) => {
11144
+ if (at === 0) return [];
11145
+ const oldest = found[at - 1]?.said ?? "";
11146
+ const said = at === 1 ? oldest : `back to ${oldest}`;
11147
+ return [{
11148
+ ref: commit.sha,
11149
+ said: `${forOne(at)} · ${said}`
11150
+ }];
11151
+ });
11152
+ });
11127
11153
  setBase = fn("Cli.setBase")(function* (repo, branch, base) {
11128
11154
  const store = yield* Store;
11129
11155
  const based = yield* baseFor(repo, branch, base);
@@ -11395,7 +11421,7 @@ var init_pane = __esmMin((() => {
11395
11421
  //#region package.json
11396
11422
  init_drafts();
11397
11423
  init_pane();
11398
- var version$1 = "0.1.0-alpha.167";
11424
+ var version$1 = "0.1.0-alpha.168";
11399
11425
  //#endregion
11400
11426
  //#region src/cli/upgrade.ts
11401
11427
  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;
@@ -14059,7 +14085,7 @@ var init_tree = __esmMin((() => {
14059
14085
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
14060
14086
  };
14061
14087
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
14062
- })), 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, partHere, layersHolding, readIn, 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, picking, 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, movedPast, sectionOf, sentEntry, remarkRows, panelHolds, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
14088
+ })), 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, partHere, layersHolding, readIn, 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, refSaidOf, refsShown, picking, 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, movedPast, sectionOf, sentEntry, remarkRows, panelHolds, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
14063
14089
  var init_model$1 = __esmMin((() => {
14064
14090
  init_dist();
14065
14091
  init_patch();
@@ -14148,6 +14174,7 @@ var init_model$1 = __esmMin((() => {
14148
14174
  vouched: [],
14149
14175
  partsRead: [],
14150
14176
  openMoved: false,
14177
+ refSaid: {},
14151
14178
  sent: [],
14152
14179
  remarks: [],
14153
14180
  viewport: 20,
@@ -14634,9 +14661,10 @@ var init_model$1 = __esmMin((() => {
14634
14661
  if (wanted.length === 0) return state.matches;
14635
14662
  return state.matches.filter((match) => `${match.path}:${match.line} ${match.text}`.toLowerCase().includes(wanted));
14636
14663
  };
14664
+ refSaidOf = (state, ref) => state.refSaid[ref] ?? "";
14637
14665
  refsShown = (state) => {
14638
14666
  const wanted = state.query.trim().toLowerCase();
14639
- const held = state.refs.filter((ref) => ref.toLowerCase().includes(wanted));
14667
+ const held = state.refs.filter((ref) => `${ref} ${refSaidOf(state, ref)}`.toLowerCase().includes(wanted));
14640
14668
  return wanted.length === 0 || held.some((ref) => ref.toLowerCase() === wanted) ? held : held.concat([state.query.trim()]);
14641
14669
  };
14642
14670
  picking = (state) => state.screen === "base" || state.screen === "editor";
@@ -16649,7 +16677,10 @@ var init_reduce = __esmMin((() => {
16649
16677
  refIndex: 0,
16650
16678
  query: ""
16651
16679
  });
16652
- withRefs = (state, refs) => withChoices(state, refs, "base");
16680
+ withRefs = (state, refs, said = {}) => ({
16681
+ ...withChoices(state, refs, "base"),
16682
+ refSaid: said
16683
+ });
16653
16684
  movePalette = (state, delta) => ({
16654
16685
  ...state,
16655
16686
  paletteIndex: clamp(state.paletteIndex + delta, 0, Math.max(0, offered(state).length - 1))
@@ -19440,7 +19471,7 @@ var init_render = __esmMin((() => {
19440
19471
  this.baseBox.query.visible = true;
19441
19472
  const tall = Math.min(panelRows(this.renderer.height, PANEL_QUARTER), shown.length + PALETTE_CHROME + 1);
19442
19473
  const typed = state.query.trim();
19443
- this.baseBox.choices.content = listText(shown.map((ref) => clip(` ${ref}${pickedTail(state, ref, typed)}`, room - MODAL_ROOM)), Math.min(state.refIndex, Math.max(0, shown.length - 1)), Math.max(1, tall - PALETTE_CHROME - 1));
19474
+ this.baseBox.choices.content = listText(shown.map((ref) => clip(` ${ref}${refSaidOf(state, ref).length === 0 ? "" : ` ${refSaidOf(state, ref)}`}${pickedTail(state, ref, typed)}`, room - MODAL_ROOM)), Math.min(state.refIndex, Math.max(0, shown.length - 1)), Math.max(1, tall - PALETTE_CHROME - 1));
19444
19475
  this.baseBox.box.height = tall;
19445
19476
  this.baseBox.box.width = room;
19446
19477
  this.baseBox.box.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
@@ -20785,8 +20816,10 @@ var init_app = __esmMin((() => {
20785
20816
  return gen({ self: this }, function* () {
20786
20817
  const branch = selectedBranch(this.state);
20787
20818
  if (branch === void 0) return;
20788
- const refs = yield* listRefs(this.repo);
20789
- this.commit(withRefs(this.state, refs.filter((ref) => ref !== branch.branch)));
20819
+ const [refs, recent] = yield* all([listRefs(this.repo), recentBases(this.repo, branch.branch)]);
20820
+ const said = Object.fromEntries(recent.map((one) => [one.ref, one.said]));
20821
+ const kept = refs.filter((ref) => ref !== branch.branch);
20822
+ this.commit(withRefs(this.state, [...recent.map((one) => one.ref), ...kept], said));
20790
20823
  });
20791
20824
  }
20792
20825
  basedOnRef(ref) {
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.167",
26
+ "version": "0.1.0-alpha.168",
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": {