@eliya-oss/agent-diff 0.1.0-alpha.52 → 0.1.0-alpha.53

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.53
4
+
5
+ ### Patch Changes
6
+
7
+ - Three places where the screen did something and said nothing about it. `}` and `{` now name the edge they hit instead of absorbing the keystroke, and when a file has been widened into a single change they name the context ladder as the reason — `+` quietly trades the changes you were stepping between for the lines around them. The review panel settles and removes the comment it is standing on, so a comment the diff cannot reach — its file deleted since, or just not the file on screen — stops being one you can see but not answer. And `… N more` counts what is below it rather than every row outside the window, so scrolling to the last file no longer promises seventeen more that are not there.
8
+
3
9
  ## 0.1.0-alpha.52
4
10
 
5
11
  ### Patch Changes
package/dist/main.js CHANGED
@@ -8407,7 +8407,7 @@ var init_service$1 = __esmMin((() => {
8407
8407
  parent: held.parent
8408
8408
  };
8409
8409
  });
8410
- cursorOps = (state, saveState, inbox) => {
8410
+ cursorOps = (state, saveState, inbox, spoken) => {
8411
8411
  return {
8412
8412
  stage: fn("Store.stage")(function* (worktreePath, comment) {
8413
8413
  const current = yield* state(worktreePath);
@@ -8441,12 +8441,17 @@ var init_service$1 = __esmMin((() => {
8441
8441
  take: fn("Store.take")(function* (worktreePath) {
8442
8442
  const batches = yield* inbox(worktreePath);
8443
8443
  const current = yield* state(worktreePath);
8444
- const pending = batches.slice(current.consumed);
8445
- if (pending.length > 0) yield* saveState(worktreePath, {
8446
- ...current,
8447
- consumed: batches.length
8444
+ const answered = new Set((yield* spoken(worktreePath)).map((entry) => entry.comment));
8445
+ const owed = (comment) => !answered.has(comment.id) && !Object.hasOwn(current.settled, comment.id) && !Object.hasOwn(current.removed, comment.id);
8446
+ return batches.flatMap((batch) => {
8447
+ const comments = batch.comments.filter(owed);
8448
+ return comments.length === 0 ? [] : [{
8449
+ id: batch.id,
8450
+ at: batch.at,
8451
+ head: batch.head,
8452
+ comments
8453
+ }];
8448
8454
  });
8449
- return pending;
8450
8455
  })
8451
8456
  };
8452
8457
  };
@@ -8618,7 +8623,8 @@ var init_service$1 = __esmMin((() => {
8618
8623
  makeStore = (root) => {
8619
8624
  const { submit, inbox } = inboxOps(root);
8620
8625
  const { state, saveState } = stateOps(root);
8621
- const cursors = cursorOps(state, saveState, inbox);
8626
+ const talk = answerOps(root);
8627
+ const cursors = cursorOps(state, saveState, inbox, talk.answers);
8622
8628
  return {
8623
8629
  root,
8624
8630
  branchAt: (worktreePath) => promise(() => headOf$1(worktreePath)),
@@ -8629,7 +8635,7 @@ var init_service$1 = __esmMin((() => {
8629
8635
  saveReport: reportOps(root),
8630
8636
  ...settingsOps(root),
8631
8637
  ...upgradeOps(root),
8632
- ...answerOps(root),
8638
+ ...talk,
8633
8639
  ...layersOps(root),
8634
8640
  ...cursors
8635
8641
  };
@@ -8696,11 +8702,11 @@ var init_commands = __esmMin((() => {
8696
8702
  waitingOn = fn("Cli.waitingOn")(function* (worktree) {
8697
8703
  const store = yield* Store;
8698
8704
  const state = yield* store.state(worktree.path);
8699
- const batches = yield* store.inbox(worktree.path);
8705
+ const owed = yield* store.take(worktree.path);
8700
8706
  const told = yield* store.layers(worktree.path);
8701
8707
  return {
8702
8708
  staged: state.pending.length,
8703
- unread: Math.max(0, batches.length - state.consumed),
8709
+ unread: owed.reduce((total, batch) => total + batch.comments.length, 0),
8704
8710
  layers: match$3(told, {
8705
8711
  onNone: () => 0,
8706
8712
  onSome: (layers) => layers.layers.length
@@ -9230,7 +9236,7 @@ var init_pane = __esmMin((() => {
9230
9236
  init_commands();
9231
9237
  init_init();
9232
9238
  init_pane();
9233
- var version$1 = "0.1.0-alpha.52";
9239
+ var version$1 = "0.1.0-alpha.53";
9234
9240
  //#endregion
9235
9241
  //#region src/cli/upgrade.ts
9236
9242
  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;
@@ -10135,10 +10141,10 @@ var init_catalog = __esmMin((() => {
10135
10141
  },
10136
10142
  {
10137
10143
  name: "comment take",
10138
- about: "Collect the comments this review has not handed over yet. Exactly-once",
10144
+ about: "Collect the comments this review is still owed an answer on. Repeats until answered",
10139
10145
  group: ANSWER_COMMENTS,
10140
10146
  addresses: "review",
10141
- safety: "write",
10147
+ safety: "read",
10142
10148
  options: [...addressing, {
10143
10149
  name: "wait",
10144
10150
  required: false,
@@ -10951,7 +10957,7 @@ var init_tree = __esmMin((() => {
10951
10957
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
10952
10958
  };
10953
10959
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
10954
- })), nothingReviewed, initialState, BODY_BORDER, TREE_MAX, TREE_MIN, TREE_SHARE, DIFF_MIN, PANEL_WIDTH, 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, treeOf, treeRows, crowdedOf, foldersOfFile, isReviewed, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, caretAt, drafted, WORD, wordLeft, wordRight, caretByWord, lineStart, lineEnd, caretToEdge, editedComment, composeTarget, selectedLines, KEYWORDS, NAME, longestName$1, searchTerm, matchHere, selectionReadout, WHOLE_FILE, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, answersIn, newerOf, sectionOf, sentEntry, panelEntries, panelEntry, spokenSince, hunkStarts, changeAround, nextUnreviewed, reviewedCount, fileOrder, layerFile, selectionRange;
10960
+ })), nothingReviewed, initialState, BODY_BORDER, TREE_MAX, TREE_MIN, TREE_SHARE, DIFF_MIN, PANEL_WIDTH, 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, treeOf, treeRows, crowdedOf, foldersOfFile, isReviewed, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, caretAt, drafted, WORD, wordLeft, wordRight, caretByWord, lineStart, lineEnd, caretToEdge, editedComment, composeTarget, selectedLines, KEYWORDS, NAME, longestName$1, searchTerm, matchHere, selectionReadout, WHOLE_FILE, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, answersIn, newerOf, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, changeAround, nextUnreviewed, reviewedCount, fileOrder, layerFile, selectionRange;
10955
10961
  var init_model = __esmMin((() => {
10956
10962
  init_dist();
10957
10963
  init_patch();
@@ -11131,7 +11137,7 @@ var init_model = __esmMin((() => {
11131
11137
  const start = Math.max(0, Math.min(rows.length - height, wanted));
11132
11138
  return {
11133
11139
  rows: rows.slice(start, start + height),
11134
- more: rows.length - height
11140
+ more: rows.length - (start + height)
11135
11141
  };
11136
11142
  };
11137
11143
  selectedBranch = (state) => state.branches[state.branchIndex];
@@ -11166,7 +11172,7 @@ var init_model = __esmMin((() => {
11166
11172
  const start = Math.max(0, Math.min(rows.length - height, anchor - Math.floor(height / 2)));
11167
11173
  return {
11168
11174
  rows: rows.slice(start, start + height),
11169
- more: rows.length - height
11175
+ more: rows.length - (start + height)
11170
11176
  };
11171
11177
  };
11172
11178
  commentsOn = (state, fileIndex) => {
@@ -11399,6 +11405,11 @@ var init_model = __esmMin((() => {
11399
11405
  ];
11400
11406
  };
11401
11407
  panelEntry = (state) => panelEntries(state)[state.panelIndex];
11408
+ threadChosen = (state) => {
11409
+ if (state.focus !== "review") return void 0;
11410
+ const entry = panelEntry(state);
11411
+ return entry === void 0 || entry.section === "staged" ? void 0 : entry.comment;
11412
+ };
11402
11413
  spokenSince = (seen, now) => Math.max(0, answerCount(now) - answerCount(seen));
11403
11414
  hunkStarts = (state) => {
11404
11415
  const patch = selectedPatch(state);
@@ -12092,7 +12103,7 @@ var init_match = __esmMin((() => {
12092
12103
  }));
12093
12104
  //#endregion
12094
12105
  //#region src/tui/reduce.ts
12095
- var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, draggedTo, atRow, layerHunk, nextFileWithComments, atComment, nothingOpen, layerComment, PAN_STEP, panned, movePending, moveLayer, inRail, movePanel, layerDown, nextFocus, togglePanel, packedAway, zoom, toggleRail, foldDirectory, foldLayer, foldThread, fold, moveBranch, moveFile, selectHunk, swapEnds, atBranch, startSelection, openCompose, goBack, walkMatches, openPalette, openKeys, movePalette, paletteMatches, offered, paletteChoice, transitions, reduce, atFile, withContext, withFull, revealsAfter, gapOpened, withPending, panBy, withSent, withArrived, withColumns, withLayers, withPulls, withSilentForge, withBranches, withSource, withVouched, restoredTo, withPatches, inserted, typed, TAB_WIDTH, SPACE_CODE, ERASED_FROM, ERASED_TO, readable, legible, pasted, backspaced, deleted, caretMoved, caretJumped, caretHomed, withDraft, paletteMoved, paletteClosed, withWaiting, withMatches, withNoticeHere, withNotice;
12106
+ var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, draggedTo, atRow, noneLeft, layerHunk, nextFileWithComments, atComment, nothingOpen, layerComment, PAN_STEP, panned, movePending, moveLayer, inRail, movePanel, layerDown, nextFocus, togglePanel, packedAway, zoom, toggleRail, foldDirectory, foldLayer, foldThread, fold, moveBranch, moveFile, selectHunk, swapEnds, atBranch, startSelection, openCompose, goBack, walkMatches, openPalette, openKeys, movePalette, paletteMatches, offered, paletteChoice, transitions, reduce, atFile, withContext, withFull, revealsAfter, gapOpened, withPending, panBy, withSent, withArrived, withColumns, withLayers, withPulls, withSilentForge, withBranches, withSource, withVouched, restoredTo, withPatches, inserted, typed, TAB_WIDTH, SPACE_CODE, ERASED_FROM, ERASED_TO, readable, legible, pasted, backspaced, deleted, caretMoved, caretJumped, caretHomed, withDraft, paletteMoved, paletteClosed, withWaiting, withMatches, withNoticeHere, withNotice;
12096
12107
  var init_reduce = __esmMin((() => {
12097
12108
  init_dist();
12098
12109
  init_patch();
@@ -12157,10 +12168,14 @@ var init_reduce = __esmMin((() => {
12157
12168
  stop: 0,
12158
12169
  cursor: clamp(row, 0, lastRow(selectedPatch(state)))
12159
12170
  });
12171
+ noneLeft = (state, delta) => {
12172
+ const only = hunkStarts(state).length <= 1;
12173
+ return withNotice(state, only ? "this file reads as one change · press - for less context to split it" : `no change ${delta > 0 ? "after" : "before"} this one`);
12174
+ };
12160
12175
  layerHunk = (state, delta) => {
12161
12176
  const starts = hunkStarts(state);
12162
12177
  const target = delta > 0 ? starts.find((start) => start > state.cursor) : starts.findLast((start) => start < state.cursor);
12163
- return target === void 0 ? state : atRow(state, target);
12178
+ return target === void 0 ? noneLeft(state, delta) : atRow(state, target);
12164
12179
  };
12165
12180
  nextFileWithComments = (state, delta) => {
12166
12181
  const elsewhere = filesWithComments(state).filter((index) => index !== state.patchIndex);
@@ -13731,7 +13746,7 @@ var init_render = __esmMin((() => {
13731
13746
  };
13732
13747
  waitingLabel = (branch) => {
13733
13748
  if (branch.staged > 0) return `${branch.staged} staged`;
13734
- return branch.unread > 0 ? `${branch.unread} unread` : "";
13749
+ return branch.unread > 0 ? `${branch.unread} unanswered` : "";
13735
13750
  };
13736
13751
  inRange = (state, row, from, to) => state.selecting && row >= from && row <= to;
13737
13752
  notesOf = (comments, path, sent, opened = []) => comments.filter((entry) => entry.file === path).map((entry) => ({
@@ -14093,7 +14108,7 @@ var init_render = __esmMin((() => {
14093
14108
  this.chips = hintsFor(state.screen, {
14094
14109
  staged: state.staged,
14095
14110
  layers: state.layers.length,
14096
- onThread: state.stop > 0,
14111
+ onThread: state.stop > 0 || threadChosen(state) !== void 0,
14097
14112
  pull: pullHere(state).length > 0
14098
14113
  });
14099
14114
  this.header.content = this.headerText(state);
@@ -15123,7 +15138,7 @@ var init_app = __esmMin((() => {
15123
15138
  settleHere() {
15124
15139
  return gen({ self: this }, function* () {
15125
15140
  const branch = selectedBranch(this.state);
15126
- const id = (threadAtStop(this.state) ?? threadAtRow(this.state, this.state.cursor))?.id;
15141
+ const id = (threadChosen(this.state) ?? threadAtStop(this.state) ?? threadAtRow(this.state, this.state.cursor))?.id;
15127
15142
  if (branch === void 0 || id === void 0) {
15128
15143
  this.commit(withNotice(this.state, "no thread here"));
15129
15144
  return;
@@ -15140,7 +15155,7 @@ var init_app = __esmMin((() => {
15140
15155
  removeHere() {
15141
15156
  return gen({ self: this }, function* () {
15142
15157
  const branch = selectedBranch(this.state);
15143
- const id = (threadAtStop(this.state) ?? threadAtRow(this.state, this.state.cursor))?.id;
15158
+ const id = (threadChosen(this.state) ?? threadAtStop(this.state) ?? threadAtRow(this.state, this.state.cursor))?.id;
15144
15159
  if (branch === void 0 || id === void 0) {
15145
15160
  this.commit(withNotice(this.state, "no thread here"));
15146
15161
  return;
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.52",
26
+ "version": "0.1.0-alpha.53",
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": {