@eliya-oss/agent-diff 0.1.0-alpha.95 → 0.1.0-alpha.97

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,21 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.97
4
+
5
+ ### Patch Changes
6
+
7
+ - Every release writes its changes into CHANGELOG.md and says them on the release page, rather than only in an install line.
8
+
9
+ - Clicking a line puts the cursor on it rather than selecting it, so the arrows afterwards move the cursor and the diff stays where it is.
10
+
11
+ - Settling or removing a thread from the review panel leaves the cursor where it was, rather than sending it back to the first thread.
12
+
13
+ ## 0.1.0-alpha.96
14
+
15
+ ### Patch Changes
16
+
17
+ - Ctrl+C closes the box, key sheet, palette or search that is open over the review, and only leaves adiff when nothing is open over it.
18
+
3
19
  ## 0.1.0-alpha.95
4
20
 
5
21
  ### Minor Changes
package/dist/main.js CHANGED
@@ -9913,7 +9913,7 @@ var init_pane = __esmMin((() => {
9913
9913
  init_commands();
9914
9914
  init_init();
9915
9915
  init_pane();
9916
- var version$1 = "0.1.0-alpha.95";
9916
+ var version$1 = "0.1.0-alpha.97";
9917
9917
  //#endregion
9918
9918
  //#region src/cli/upgrade.ts
9919
9919
  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;
@@ -11749,7 +11749,7 @@ var init_tree = __esmMin((() => {
11749
11749
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
11750
11750
  };
11751
11751
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
11752
- })), nothingReviewed, initialState, TREE_MAX, TREE_ROOMY, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, NO_NOTE, noteRows$1, proseRow, proseRows$1, titleRows, clipEnd, FILE_LEAD, fileRows, layerRows, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, kept, treeOf, reviewedCountIn, 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, KEYWORDS, NAME, longestName$1, searchTerm, matchHere, selectionReadout, WHOLE_FILE, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, answersIn, newerOf, spokeLast, sectionOf, sentEntry, panelEntries, panelIndexOf, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, layerFile, selectionRange;
11752
+ })), nothingReviewed, initialState, TREE_MAX, TREE_ROOMY, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, NO_NOTE, noteRows$1, proseRow, proseRows$1, titleRows, clipEnd, FILE_LEAD, fileRows, layerRows, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, kept, treeOf, reviewedCountIn, 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, KEYWORDS, NAME, longestName$1, searchTerm, matchHere, selectionReadout, WHOLE_FILE, 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, layerFile, selectionRange;
11753
11753
  var init_model = __esmMin((() => {
11754
11754
  init_dist();
11755
11755
  init_patch();
@@ -12247,11 +12247,6 @@ var init_model = __esmMin((() => {
12247
12247
  };
12248
12248
  return [...ordered("with"), ...ordered("answered")];
12249
12249
  };
12250
- panelIndexOf = (state, id) => {
12251
- if (id === void 0) return state.panelIndex;
12252
- const at = panelEntries(state).findIndex((entry) => entry.comment.id === id);
12253
- return at === -1 ? state.panelIndex : at;
12254
- };
12255
12250
  panelEntry = (state) => panelEntries(state)[state.panelIndex];
12256
12251
  threadChosen = (state) => {
12257
12252
  if (state.focus !== "review") return void 0;
@@ -13045,7 +13040,7 @@ var init_match = __esmMin((() => {
13045
13040
  }));
13046
13041
  //#endregion
13047
13042
  //#region src/tui/reduce.ts
13048
- var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, draggedTo, pickedIn, atRow, noneLeft, layerHunk, nextFileWithComments, atComment, nothingOpen, layerComment, PAN_STEP, panned, moveLayer, inRail, railScrolled, movePanel, layerDown, PANES, panesShown, focusStepped, togglePanel, packedAway, zoom, toggleRail, foldDirectory, foldLayer, foldThread, fold, moveBranch, landingOn, revealing, moveFile, selectHunk, swapEnds, atBranch, grownBy, startSelection, openCompose, goBack, walkMatches, openPalette, openKeys, movePalette, paletteMatches, keyMatches, offered, paletteChoice, transitions, reduce, resumedAt, atFile, withContext, withFull, revealsAfter, gapOpened, panBy, withSent, withArrived, withColumns, withLayers, withPulls, withSilentForge, withBranches, withSource, withVouched, restoredTo, openedAt, withPatches, TAB_WIDTH, SPACE_CODE, ERASED_FROM, ERASED_TO, readable, legible, withDraft, paletteMoved, paletteClosed, withWaiting, withMatches, withNoticeHere, withNotice;
13043
+ var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, restingOn, draggedTo, pickedIn, atRow, noneLeft, layerHunk, nextFileWithComments, atComment, nothingOpen, layerComment, PAN_STEP, panned, moveLayer, inRail, railScrolled, movePanel, layerDown, PANES, panesShown, focusStepped, togglePanel, packedAway, zoom, toggleRail, foldDirectory, foldLayer, foldThread, fold, moveBranch, landingOn, revealing, moveFile, selectHunk, swapEnds, atBranch, grownBy, startSelection, openCompose, goBack, walkMatches, openPalette, openKeys, movePalette, paletteMatches, keyMatches, offered, paletteChoice, transitions, reduce, resumedAt, atFile, withContext, withFull, revealsAfter, gapOpened, panBy, withSent, withArrived, withColumns, withLayers, withPulls, withSilentForge, withBranches, withSource, withVouched, restoredTo, openedAt, withPatches, TAB_WIDTH, SPACE_CODE, ERASED_FROM, ERASED_TO, readable, legible, withDraft, paletteMoved, paletteClosed, withWaiting, withMatches, withNoticeHere, withNotice;
13049
13044
  var init_reduce = __esmMin((() => {
13050
13045
  init_dist();
13051
13046
  init_patch();
@@ -13106,6 +13101,14 @@ var init_reduce = __esmMin((() => {
13106
13101
  scroll: clamp(from + delta, 0, highest)
13107
13102
  };
13108
13103
  };
13104
+ restingOn = (state, row) => ({
13105
+ ...state,
13106
+ picked: void 0,
13107
+ selecting: false,
13108
+ stop: 0,
13109
+ anchorRow: clamp(row, 0, lastRow(selectedPatch(state))),
13110
+ cursor: clamp(row, 0, lastRow(selectedPatch(state)))
13111
+ });
13109
13112
  draggedTo = (state, from, to) => ({
13110
13113
  ...state,
13111
13114
  picked: void 0,
@@ -15997,7 +16000,7 @@ var init_upgrade = __esmMin((() => {
15997
16000
  return due ? `adiff ${latest} is out · adiff upgrade` : "";
15998
16001
  }).pipe(withSpan("Tui.upgradeHint"));
15999
16002
  upgradeHint = worded.pipe(orElseSucceed(() => ""));
16000
- })), KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, handOver, throughMultiplexer, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, writesInto, listens, laidOut, ARROWS, keyName, App, turnedOver, settledPath, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
16003
+ })), KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, handOver, throughMultiplexer, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, OVER, overReview, writesInto, listens, laidOut, ARROWS, keyName, App, turnedOver, settledPath, restsWhereItLanded, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
16001
16004
  var init_app = __esmMin((() => {
16002
16005
  init_dist();
16003
16006
  init_report();
@@ -16083,6 +16086,14 @@ var init_app = __esmMin((() => {
16083
16086
  };
16084
16087
  LISTENS = /* @__PURE__ */ new Set(["keys", "palette"]);
16085
16088
  WRITES = /* @__PURE__ */ new Set(["compose", "report"]);
16089
+ OVER = /* @__PURE__ */ new Set([
16090
+ "compose",
16091
+ "report",
16092
+ "keys",
16093
+ "palette",
16094
+ "search"
16095
+ ]);
16096
+ overReview = (screen) => OVER.has(screen);
16086
16097
  writesInto = (screen) => WRITES.has(screen);
16087
16098
  listens = (screen) => LISTENS.has(screen);
16088
16099
  laidOut = (key) => key.baseCode === void 0 || key.name.length !== 1 ? key.name : String.fromCodePoint(key.baseCode);
@@ -16113,6 +16124,7 @@ var init_app = __esmMin((() => {
16113
16124
  sessionPath;
16114
16125
  remembered = "";
16115
16126
  chosen = {};
16127
+ selectingNow = false;
16116
16128
  grewWithShift = false;
16117
16129
  keys = [];
16118
16130
  trail = [];
@@ -16479,6 +16491,10 @@ var init_app = __esmMin((() => {
16479
16491
  }
16480
16492
  onKey(key, forced) {
16481
16493
  return gen({ self: this }, function* () {
16494
+ if (forced === void 0 && keyName(key) === "ctrl+c") {
16495
+ yield* this.askedToLeave();
16496
+ return;
16497
+ }
16482
16498
  const action = forced ?? actionFor(this.state.screen, keyName(key), this.state.focus);
16483
16499
  this.grewWithShift = action === "select.grow" || action === "select.shrink";
16484
16500
  this.remember(action, key);
@@ -16566,10 +16582,15 @@ var init_app = __esmMin((() => {
16566
16582
  });
16567
16583
  }
16568
16584
  dragged(from, to, done) {
16569
- const along = from.row === to.row && from.column !== to.column;
16570
16585
  const held = this.measured();
16586
+ if (restsWhereItLanded(from, to) && !this.selectingNow) {
16587
+ this.commit(restingOn(held, from.row));
16588
+ return;
16589
+ }
16590
+ const along = from.row === to.row;
16591
+ this.selectingNow = !done;
16571
16592
  this.commit(along ? pickedIn(held, from.row, from.column, to.column) : draggedTo(held, from.row, to.row));
16572
- if (done && (along || from.row !== to.row)) this.copySelection(true);
16593
+ if (done) this.copySelection(true);
16573
16594
  }
16574
16595
  copyDragged() {
16575
16596
  const taken = this.renderer.getSelection()?.getSelectedText() ?? "";
@@ -16717,13 +16738,14 @@ var init_app = __esmMin((() => {
16717
16738
  this.commit(withNotice(this.state, "no thread here"));
16718
16739
  return;
16719
16740
  }
16741
+ const was = this.state.panelIndex;
16720
16742
  yield* this.settling(branch.branch, id);
16721
16743
  const sent = yield* this.loadSent(branch.branch);
16722
16744
  const held = withSent({
16723
16745
  ...this.state,
16724
- opened: this.state.opened.filter((was) => was !== id)
16746
+ opened: this.state.opened.filter((one) => one !== id)
16725
16747
  }, sent);
16726
- this.commit(withNotice(this.staying(held, id), "settled"));
16748
+ this.commit(withNotice(this.staying(held, id, was), "settled"));
16727
16749
  });
16728
16750
  }
16729
16751
  replyHere() {
@@ -16741,12 +16763,13 @@ var init_app = __esmMin((() => {
16741
16763
  });
16742
16764
  });
16743
16765
  }
16744
- staying(state, id) {
16745
- const at = panelIndexOf(state, id);
16746
- const last = Math.max(0, panelEntries(state).length - 1);
16766
+ staying(state, id, was) {
16767
+ const entries = panelEntries(state);
16768
+ const last = Math.max(0, entries.length - 1);
16769
+ const at = entries.findIndex((entry) => entry.comment.id === id);
16747
16770
  return {
16748
16771
  ...state,
16749
- panelIndex: Math.min(at, last)
16772
+ panelIndex: Math.min(at === -1 ? was : at, last)
16750
16773
  };
16751
16774
  }
16752
16775
  removeHere() {
@@ -16757,13 +16780,14 @@ var init_app = __esmMin((() => {
16757
16780
  this.commit(withNotice(this.state, "no thread here"));
16758
16781
  return;
16759
16782
  }
16783
+ const was = this.state.panelIndex;
16760
16784
  yield* this.removing(branch.branch, id);
16761
16785
  const sent = yield* this.loadSent(branch.branch);
16762
16786
  const held = withSent({
16763
16787
  ...this.state,
16764
- opened: this.state.opened.filter((was) => was !== id)
16788
+ opened: this.state.opened.filter((one) => one !== id)
16765
16789
  }, sent);
16766
- this.commit(withNotice(held, "removed, restore it with comment restore"));
16790
+ this.commit(withNotice(this.staying(held, id, was), "removed, restore it with comment restore"));
16767
16791
  });
16768
16792
  }
16769
16793
  fillBranches() {
@@ -16891,6 +16915,12 @@ var init_app = __esmMin((() => {
16891
16915
  this.commit(withNotice(atFile(next, target), `marked ${patch.path}`));
16892
16916
  });
16893
16917
  }
16918
+ askedToLeave() {
16919
+ return sync(() => {
16920
+ if (overReview(this.state.screen)) this.commit(reduce(this.measured(), "back"));
16921
+ else this.renderer.destroy();
16922
+ });
16923
+ }
16894
16924
  worktreeFor(branch) {
16895
16925
  const reading = this.reading;
16896
16926
  return reading === void 0 || reading.worktree.branch !== branch ? void 0 : reading.worktree;
@@ -17076,6 +17106,7 @@ var init_app = __esmMin((() => {
17076
17106
  anchorRow: state.cursor
17077
17107
  });
17078
17108
  settledPath = (path) => promise(() => realpath(path).catch(() => resolve(path)));
17109
+ restsWhereItLanded = (from, to) => from.row === to.row && from.column === to.column;
17079
17110
  chosenIn = (state) => ({
17080
17111
  wrap: state.wrap,
17081
17112
  sticky: state.sticky,
@@ -17162,7 +17193,7 @@ var init_app = __esmMin((() => {
17162
17193
  });
17163
17194
  runTui = fn("Tui.run")(function* (repo, sessionPath, branch) {
17164
17195
  const renderer = yield* promise(() => createCliRenderer({
17165
- exitOnCtrlC: true,
17196
+ exitOnCtrlC: false,
17166
17197
  useKittyKeyboard: {
17167
17198
  events: true,
17168
17199
  allKeysAsEscapes: true
@@ -17188,6 +17219,7 @@ var tui_exports = /* @__PURE__ */ __exportAll({
17188
17219
  launch: () => launch,
17189
17220
  listableFor: () => listableFor,
17190
17221
  noteKey: () => noteKey,
17222
+ overReview: () => overReview,
17191
17223
  palette: () => palette,
17192
17224
  runOn: () => runOn,
17193
17225
  runTui: () => runTui,
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.95",
26
+ "version": "0.1.0-alpha.97",
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": {