@eliya-oss/agent-diff 0.1.0-alpha.124 → 0.1.0-alpha.125

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,17 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.125
4
+
5
+ ### Patch Changes
6
+
7
+ - A key that toggles something says which way it will go. `f hide read` read the same whether files were hidden or shown — and the filter survives a restart, so you could open a review with files missing and nothing on screen saying so. It now reads `f show read` while hiding. Same for `f hide settled`, and `X` offers `restore` when the thread under the cursor has been removed.
8
+
9
+ `L` asks about the branch, not about the line the cursor happened to be on. The request landed as a comment card on an arbitrary import, so the agent was told to write a reading order in a thread about a line that had nothing to do with it. It is anchored to the start of the diff and says up front that it is about the branch.
10
+
11
+ Every changed file has a place in the layers rail. A file with no changed lines — a binary one, say — belonged to no layer and never reached the leftover layer either, so the rail listed seven of eight files, the two rails disagreed about the count, and `]` could never reach the eighth.
12
+
13
+ `→ N columns cut off` counted three columns that were not cut, and did not name the key that pans.
14
+
3
15
  ## 0.1.0-alpha.124
4
16
 
5
17
  ### Patch Changes
package/dist/main.js CHANGED
@@ -10977,7 +10977,7 @@ var init_pane = __esmMin((() => {
10977
10977
  init_drafts();
10978
10978
  init_init();
10979
10979
  init_pane();
10980
- var version$1 = "0.1.0-alpha.124";
10980
+ var version$1 = "0.1.0-alpha.125";
10981
10981
  //#endregion
10982
10982
  //#region src/cli/upgrade.ts
10983
10983
  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, ranChild, runUpgrade, statusOf$1, sayFound, sayDone, attempted, REFRESH_MS, refreshSkills, updatedIn, sayRefreshed, upgradeReport;
@@ -11239,7 +11239,7 @@ var init_model$1 = __esmMin((() => {
11239
11239
  }));
11240
11240
  //#endregion
11241
11241
  //#region src/domain/layers/coverage.ts
11242
- var codeBlockOf$1, codeBlocks, noteOf, spansOf$1, changedLines, holds, runsOf, tallyOf, coverage, missingSaid, withFullCoverage, proseAnchors;
11242
+ var codeBlockOf$1, codeBlocks, noteOf, spansOf$1, changedLines, holds, runsOf, tallyOf, coverage, missingSaid, unordered, withFullCoverage, proseAnchors;
11243
11243
  var init_coverage = __esmMin((() => {
11244
11244
  init_dist();
11245
11245
  init_model$1();
@@ -11296,15 +11296,25 @@ var init_coverage = __esmMin((() => {
11296
11296
  };
11297
11297
  };
11298
11298
  missingSaid = (count) => count === 1 ? "One run of changed lines the layers do not account for." : `${count} runs of changed lines the layers do not account for.`;
11299
+ unordered = (patches, layers, missing) => {
11300
+ const named = /* @__PURE__ */ new Set([...spansOf$1(layers).map((span) => span.path), ...missing.map((span) => span.path)]);
11301
+ return patches.filter((patch) => !named.has(patch.path)).map((patch) => ({
11302
+ path: patch.path,
11303
+ start: 1,
11304
+ end: 1
11305
+ }));
11306
+ };
11299
11307
  withFullCoverage = (patches, layers) => {
11300
11308
  const gap = coverage(patches, layers.layers);
11301
- if (gap.missing.length === 0) return layers;
11309
+ const left = unordered(patches, layers.layers, gap.missing);
11310
+ const spans = [...gap.missing, ...left];
11311
+ if (spans.length === 0) return layers;
11302
11312
  const remainder = {
11303
11313
  title: REMAINDER_TITLE,
11304
11314
  blocks: [{
11305
11315
  kind: "prose",
11306
11316
  markdown: missingSaid(gap.missing.length)
11307
- }, ...gap.missing.map((span) => codeBlockOf$1(span))]
11317
+ }, ...spans.map((span) => codeBlockOf$1(span))]
11308
11318
  };
11309
11319
  return {
11310
11320
  ...layers,
@@ -12993,7 +13003,7 @@ var init_tree = __esmMin((() => {
12993
13003
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
12994
13004
  };
12995
13005
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
12996
- })), 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, kept, 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, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, replyTarget, threadReplying, VOICES, threadQuote, pickedText, takenRows, 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;
13006
+ })), 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, kept, 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, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, replyTarget, threadReplying, VOICES, threadQuote, pickedText, takenRows, selectedLines, shownMatches, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadHere, 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;
12997
13007
  var init_model = __esmMin((() => {
12998
13008
  init_dist();
12999
13009
  init_patch();
@@ -13465,6 +13475,7 @@ var init_model = __esmMin((() => {
13465
13475
  return state.sent.filter((entry) => entry.file === patch.path && entry.id !== void 0 && entry.removed !== true && lineOnSide(here, entry.side) === entry.end);
13466
13476
  };
13467
13477
  stopsAtRow = (state, row) => 1 + threadsAtRow(state, row).length;
13478
+ threadHere = (state) => threadChosen(state) ?? threadAtStop(state) ?? threadAtRow(state, state.cursor);
13468
13479
  threadAtStop = (state) => state.stop === 0 ? void 0 : threadsAtRow(state, state.cursor)[state.stop - 1];
13469
13480
  threadAtRow = (state, row) => {
13470
13481
  const patch = selectedPatch(state);
@@ -13693,7 +13704,7 @@ var init_watch = __esmMin((() => {
13693
13704
  }));
13694
13705
  //#endregion
13695
13706
  //#region src/tui/command.ts
13696
- var EVERY_PANE, command, commands, TEXT_SCREENS, PRINTABLE_KEY, takesText, commandsFor, listableFor, glossaryFor, actionFor, GLYPHS, displayKey, hintOf, hintsFor;
13707
+ var EVERY_PANE, command, commands, TEXT_SCREENS, PRINTABLE_KEY, takesText, commandsFor, listableFor, glossaryFor, actionFor, GLYPHS, displayKey, SWAPPED, hintOf, hintsFor;
13697
13708
  var init_command = __esmMin((() => {
13698
13709
  EVERY_PANE = [
13699
13710
  "tree",
@@ -14406,8 +14417,15 @@ var init_command = __esmMin((() => {
14406
14417
  if (key.startsWith("ctrl+")) return `^${key.slice(5)}`;
14407
14418
  return GLYPHS[key] ?? key;
14408
14419
  };
14420
+ SWAPPED = {
14421
+ "rail.toggle": (offered) => offered.onLayers ? "file tree" : "layers",
14422
+ "tree.winnow": (offered) => offered.hidingRead ? "show read" : "hide read",
14423
+ "panel.winnow": (offered) => offered.hidingSettled ? "show settled" : "hide settled",
14424
+ "thread.remove": (offered) => offered.onRemoved ? "restore" : "remove"
14425
+ };
14409
14426
  hintOf = (entry, offered) => {
14410
- if (entry.action === "rail.toggle") return offered.onLayers ? "file tree" : "layers";
14427
+ const swapped = SWAPPED[entry.action];
14428
+ if (swapped !== void 0) return swapped(offered);
14411
14429
  return entry.counted ? `${entry.hint} ${offered.comments}` : entry.hint;
14412
14430
  };
14413
14431
  hintsFor = (screen, offered) => commandsFor(screen).filter((entry) => entry.hint.length > 0).filter((entry) => !entry.whenComments || offered.comments > 0).filter((entry) => !entry.whenLayers || offered.layers > 0).filter((entry) => !entry.whenThread || offered.onThread).filter((entry) => !entry.whenSelecting || offered.selecting).filter((entry) => !entry.whenReviewed || offered.reviewed > 0).filter((entry) => !entry.whenPull || offered.pull).filter((entry) => entry.panes.includes(offered.pane)).toSorted((left, right) => left.rank - right.rank).map((entry) => ({
@@ -15712,6 +15730,9 @@ var init_diffview = __esmMin((() => {
15712
15730
  panLimit() {
15713
15731
  return this.wrapped ? 0 : Math.max(this.code.maxScrollX, this.pinned.maxScrollX);
15714
15732
  }
15733
+ cutOff() {
15734
+ return this.wrapped ? 0 : this.code.maxScrollX;
15735
+ }
15715
15736
  setPan(columns) {
15716
15737
  const wanted = Math.max(0, Math.min(this.panLimit(), columns));
15717
15738
  if (wanted !== this.held) {
@@ -16704,7 +16725,7 @@ var init_render = __esmMin((() => {
16704
16725
  panLabel = (state, across) => {
16705
16726
  if (across.pan > 0) return `→ ${across.pan} columns`;
16706
16727
  if (state.wrap || across.cutOff === 0) return "";
16707
- return `→ ${across.cutOff} columns cut off`;
16728
+ return `→ ${across.cutOff} columns cut off, > pans`;
16708
16729
  };
16709
16730
  HEADER_GAP = 2;
16710
16731
  HEADER_PATH_MIN = 20;
@@ -17135,7 +17156,10 @@ var init_render = __esmMin((() => {
17135
17156
  reviewed: reviewedCountIn(state),
17136
17157
  pull: pullHere(state).length > 0,
17137
17158
  pane: state.screen === "review" ? state.focus : "diff",
17138
- onLayers: onLayers(state)
17159
+ onLayers: onLayers(state),
17160
+ hidingRead: state.hideReviewed,
17161
+ hidingSettled: state.hideSettled,
17162
+ onRemoved: threadHere(state)?.removed === true
17139
17163
  });
17140
17164
  this.header.content = this.headerText(state);
17141
17165
  this.footer.content = this.footerText(state);
@@ -17206,7 +17230,7 @@ var init_render = __esmMin((() => {
17206
17230
  const path = selectedPatch(state)?.path ?? "";
17207
17231
  const parts = headerParts(state, branch?.branch ?? "", path, {
17208
17232
  pan: Math.min(state.pan, this.view.panLimit()),
17209
- cutOff: this.view.panLimit()
17233
+ cutOff: this.view.cutOff()
17210
17234
  }).filter((part) => part.length > 0);
17211
17235
  const [name = "", ...rest] = headerFitted(parts, path, headerRoom(this.renderer.width));
17212
17236
  return t`${fg(palette.ink)(name)} ${fg(palette.muted)(rest.join(" "))}`;
@@ -17712,7 +17736,7 @@ var init_upgrade = __esmMin((() => {
17712
17736
  }));
17713
17737
  //#endregion
17714
17738
  //#region src/tui/app.ts
17715
- var LEAVING_MS, LOOK_MS, LEAVING_SAID, NOTHING_WRITTEN, 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, threadHere, sentAway, turnedOver, settledPath, restsWhereItLanded, lonelyGaps, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
17739
+ var LEAVING_MS, LOOK_MS, LEAVING_SAID, NOTHING_WRITTEN, 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;
17716
17740
  var init_app = __esmMin((() => {
17717
17741
  init_dist();
17718
17742
  init_report();
@@ -17734,10 +17758,11 @@ var init_app = __esmMin((() => {
17734
17758
  LOOK_MS = 110;
17735
17759
  LEAVING_SAID = "press ctrl+c again to leave";
17736
17760
  NOTHING_WRITTEN = "nothing written yet";
17761
+ LAYERS_ASK_LEAD = "About this branch, not about this line.";
17737
17762
  layersAsk = (state) => {
17738
- if (state.layers.length === 0) return "Please write a reading order for this branch with `adiff layers set`, so the diff can be read in the order the change was made rather than by filename.";
17739
- if (state.layersStale) return "The reading order on this branch describes an older commit. Please read the diff again and write a new one with `adiff layers set`.";
17740
- return "Please revise the reading order on this branch with `adiff layers set`.";
17763
+ if (state.layers.length === 0) return `${LAYERS_ASK_LEAD} Please write a reading order for it with \`adiff layers set\`, so the diff can be read in the order the change was made rather than by filename.`;
17764
+ if (state.layersStale) return `${LAYERS_ASK_LEAD} The reading order on it describes an older commit — please read the diff again and write a new one with \`adiff layers set\`.`;
17765
+ return `${LAYERS_ASK_LEAD} Please revise its reading order with \`adiff layers set\`.`;
17741
17766
  };
17742
17767
  askedFor = (state) => state.layers.length === 0 ? "asked for a reading order" : "asked for a new reading order";
17743
17768
  alongFrom = (state) => {
@@ -18935,7 +18960,7 @@ var init_app = __esmMin((() => {
18935
18960
  }
18936
18961
  askForLayers() {
18937
18962
  return gen({ self: this }, function* () {
18938
- const patch = selectedPatch(this.state);
18963
+ const patch = this.state.patches[0];
18939
18964
  const branch = selectedBranch(this.state);
18940
18965
  if (patch === void 0 || branch === void 0) return;
18941
18966
  yield* this.commenting(branch.branch, {
@@ -18984,7 +19009,6 @@ var init_app = __esmMin((() => {
18984
19009
  });
18985
19010
  }
18986
19011
  };
18987
- threadHere = (state) => threadChosen(state) ?? threadAtStop(state) ?? threadAtRow(state, state.cursor);
18988
19012
  sentAway = (state) => ({
18989
19013
  ...state,
18990
19014
  screen: "review",
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.124",
26
+ "version": "0.1.0-alpha.125",
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": {