@eliya-oss/agent-diff 0.1.0-alpha.131 → 0.1.0-alpha.132

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.132
4
+
5
+ ### Patch Changes
6
+
7
+ - Five things the layers rail got wrong about where you are.
8
+
9
+ Collapsing the layer you are reading took the cursor off the rail entirely — nothing said where you were, and the layer looked unstarted. A collapsed layer holding the cursor now carries it on its title row.
10
+
11
+ After `r` picked up layers the agent had rewritten, the layer holding your file was collapsed, the rail had no cursor, and `l` did nothing at all, because both were still keyed to the layer index from before the reload.
12
+
13
+ A first layer whose files are not in the diff — one bad path from the agent — opened the review at the *last* file of the reading order instead of the first.
14
+
15
+ A file two layers both claim reported the position of its first appearance, so the counter read `file 1 of 3` at the end of the walk, and `]` looked dead on the press that moved between the two copies. The cursor bar was also drawn on that file in every layer naming it, so the rail could not say which layer you were reading.
16
+
17
+ A layer whose spans name nothing in the diff drew a bare title with no explanation and lost its note. It now says what it was pointing at, and shows the note, since there is no file for the diff to carry it against.
18
+
3
19
  ## 0.1.0-alpha.131
4
20
 
5
21
  ### Patch Changes
package/dist/main.js CHANGED
@@ -9414,9 +9414,9 @@ var init_service$1 = __esmMin((() => {
9414
9414
  };
9415
9415
  };
9416
9416
  STATE_LOCK = {
9417
- tries: 240,
9417
+ tries: 1200,
9418
9418
  waitMs: 25,
9419
- staleMs: 15e3
9419
+ staleMs: 3e4
9420
9420
  };
9421
9421
  DRAFTS_LOCK = {
9422
9422
  tries: 600,
@@ -11046,7 +11046,7 @@ var init_pane = __esmMin((() => {
11046
11046
  init_drafts();
11047
11047
  init_init();
11048
11048
  init_pane();
11049
- var version$1 = "0.1.0-alpha.131";
11049
+ var version$1 = "0.1.0-alpha.132";
11050
11050
  //#endregion
11051
11051
  //#region src/cli/upgrade.ts
11052
11052
  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;
@@ -13079,7 +13079,7 @@ var init_tree = __esmMin((() => {
13079
13079
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
13080
13080
  };
13081
13081
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
13082
- })), 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, layerHolds, 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, 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, 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, SECTION_OF, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
13082
+ })), 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, 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, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, 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, 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, SECTION_OF, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
13083
13083
  var init_model = __esmMin((() => {
13084
13084
  init_dist();
13085
13085
  init_patch();
@@ -13207,7 +13207,7 @@ var init_model = __esmMin((() => {
13207
13207
  };
13208
13208
  clip = (label, room) => label.length > room ? `${label.slice(0, Math.max(0, room - 1))}…` : label;
13209
13209
  TITLE_ROWS = 2;
13210
- titleRows = (state, layerIndex, room) => {
13210
+ titleRows = (state, layerIndex, room, marked) => {
13211
13211
  const lines = wordWrapped(state.layers[layerIndex]?.title ?? "", room);
13212
13212
  const heldLines = lines.slice(0, TITLE_ROWS);
13213
13213
  const last = heldLines.at(-1) ?? "";
@@ -13215,7 +13215,8 @@ var init_model = __esmMin((() => {
13215
13215
  index: layerIndex,
13216
13216
  kind: "title",
13217
13217
  text,
13218
- lead: at === 0
13218
+ lead: at === 0,
13219
+ here: at === 0 && marked
13219
13220
  }));
13220
13221
  };
13221
13222
  shortDir = (dir, room) => {
@@ -13235,7 +13236,7 @@ var init_model = __esmMin((() => {
13235
13236
  lead: false,
13236
13237
  fileIndex: at,
13237
13238
  reviewed: isReviewed(state, at),
13238
- here: at === state.patchIndex
13239
+ here: at === state.patchIndex && layerIndex === state.layerIndex
13239
13240
  };
13240
13241
  };
13241
13242
  shownFiles = (state, layerIndex) => layerFiles(state, layerIndex).filter((at) => !(state.hideReviewed && isReviewed(state, at) && at !== state.patchIndex));
@@ -13281,21 +13282,38 @@ var init_model = __esmMin((() => {
13281
13282
  lead: false
13282
13283
  }];
13283
13284
  };
13285
+ NOTHING_LEFT = "nothing in this diff";
13286
+ textRows = (index, text, room, kind) => wrapped(text, room).map((line) => ({
13287
+ index,
13288
+ kind,
13289
+ text: line,
13290
+ lead: false
13291
+ }));
13292
+ emptyRows = (state, index, room) => {
13293
+ const layer = state.layers[index];
13294
+ if (layer === void 0) return [];
13295
+ const gone = layer.vanished;
13296
+ const said = gone.length === 0 ? NOTHING_LEFT : `${NOTHING_LEFT}: ${gone.join(", ")}`;
13297
+ return [...textRows(index, said, room, "count"), ...textRows(index, layer.note, room, "note")];
13298
+ };
13284
13299
  layerBody = (state, index, room, shown) => {
13300
+ if (layerRead(state, index).all === 0) return emptyRows(state, index, room.file);
13285
13301
  if (!layerOpen(state, index) || !shown.has(index)) return countRow(state, index, room.file);
13286
13302
  const rows = fileRows(state, index, room);
13287
13303
  return rows.length > 0 ? rows : countRow(state, index, room.file);
13288
13304
  };
13289
- layerRows = (state, room, shown) => state.layers.flatMap((_, index) => [
13290
- ...index > 0 ? [{
13291
- index,
13292
- kind: "gap",
13293
- text: "",
13294
- lead: false
13295
- }] : [],
13296
- ...titleRows(state, index, room.title),
13297
- ...layerBody(state, index, room, shown)
13298
- ]);
13305
+ holdsCursor = (state, index) => index === state.layerIndex && layerFiles(state, index).includes(state.patchIndex);
13306
+ layerCard = (state, index, room, shown) => {
13307
+ const body = layerBody(state, index, room, shown);
13308
+ const marked = holdsCursor(state, index) && !body.some((row) => row.here === true);
13309
+ return [...titleRows(state, index, room.title, marked), ...body];
13310
+ };
13311
+ layerRows = (state, room, shown) => state.layers.flatMap((_, index) => [...index > 0 ? [{
13312
+ index,
13313
+ kind: "gap",
13314
+ text: "",
13315
+ lead: false
13316
+ }] : [], ...layerCard(state, index, room, shown)]);
13299
13317
  nearFirst = (state) => state.layers.map((_, at) => at).filter((at) => layerOpen(state, at)).toSorted((one, two) => Math.abs(one - state.layerIndex) - Math.abs(two - state.layerIndex));
13300
13318
  layerFitted = (state, room, height) => {
13301
13319
  const every = new Set(state.layers.map((_, at) => at));
@@ -13678,8 +13696,8 @@ var init_model = __esmMin((() => {
13678
13696
  reviewedCount = (state) => `${state.vouched.length} reviewed`;
13679
13697
  fileOrder = (state) => onLayers(state) ? state.layers.flatMap((_, at) => layerFiles(state, at)) : flattenTree(treeOf(state), []).flatMap((row) => row.fileIndex === void 0 ? [] : [row.fileIndex]);
13680
13698
  filePlace = (state) => {
13681
- const order = [...new Set(fileOrder(state))];
13682
- const at = order.indexOf(state.patchIndex);
13699
+ const order = readingOrder(state);
13700
+ const at = placeIn(state);
13683
13701
  if (at === -1) return {
13684
13702
  at: state.patchIndex + 1,
13685
13703
  of: state.patches.length
@@ -14569,7 +14587,7 @@ var init_match = __esmMin((() => {
14569
14587
  }));
14570
14588
  //#endregion
14571
14589
  //#region src/tui/reduce.ts
14572
- 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, stepsToEnd, toTop, farOff, byHalf, boundedStep, PANEL_FAR, PANES, panesShown, focusStepped, togglePanel, packedAway, zoom, toggleRail, foldDirectory, foldLayer, foldThread, fold, moveBranch, landingOn, revealing, atTheEnd, moveFile, selectHunk, swapEnds, atBranch, grownBy, startSelection, draftMark, openCompose, outOfDiff, goBack, walkMatches, openPalette, openKeys, movePalette, paletteMatches, keyMatches, offered, paletteChoice, transitions, reduce, resumedAt, atFile, withContext, withFull, allRevealed, revealsAfter, gapShown, gapOpened, panBy, withSent, withArrived, withColumns, laidOver, withLayers, withPulls, withSilentForge, withBranches, withSource, withVouched, restoredTo, openedAt, withPatches, TAB_WIDTH, SPACE_CODE, ERASED_FROM, ERASED_TO, readable, legible, withDraft, paletteMoved, paletteClosed, withWaiting, withFinder, withMatches, withNoticeHere, withNotice;
14590
+ 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, stepsToEnd, toTop, farOff, byHalf, boundedStep, PANEL_FAR, PANES, panesShown, focusStepped, togglePanel, packedAway, zoom, toggleRail, foldDirectory, foldLayer, foldThread, fold, moveBranch, landingOn, revealing, atTheEnd, moveFile, selectHunk, swapEnds, atBranch, grownBy, startSelection, draftMark, openCompose, outOfDiff, goBack, walkMatches, openPalette, openKeys, movePalette, paletteMatches, keyMatches, offered, paletteChoice, transitions, reduce, resumedAt, atFile, withContext, withFull, allRevealed, revealsAfter, gapShown, gapOpened, panBy, withSent, withArrived, withColumns, laidOver, onLayerHolding, withLayers, withPulls, withSilentForge, withBranches, withSource, withVouched, restoredTo, openedAt, withPatches, TAB_WIDTH, SPACE_CODE, ERASED_FROM, ERASED_TO, readable, legible, withDraft, paletteMoved, paletteClosed, withWaiting, withFinder, withMatches, withNoticeHere, withNotice;
14573
14591
  var init_reduce = __esmMin((() => {
14574
14592
  init_dist();
14575
14593
  init_patch();
@@ -15223,14 +15241,27 @@ var init_reduce = __esmMin((() => {
15223
15241
  openLayers: anew ? told.layers.map((_, at) => at) : state.openLayers.filter((at) => at < told.layers.length),
15224
15242
  rail: told.layers.length === 0 ? "tree" : anew ? "layers" : state.rail
15225
15243
  });
15244
+ onLayerHolding = (state) => {
15245
+ if (!onLayers(state)) return state;
15246
+ const layer = layerHolding(state, state.patchIndex);
15247
+ return {
15248
+ ...state,
15249
+ layerIndex: layer,
15250
+ openLayers: state.openLayers.includes(layer) ? state.openLayers : [...state.openLayers, layer]
15251
+ };
15252
+ };
15226
15253
  withLayers = (state, told) => {
15227
15254
  const layers = told.layers;
15228
15255
  const anew = state.layers.length === 0;
15229
15256
  const opened = laidOver(state, told, anew);
15230
- if (layers.length === 0 || !anew) return opened;
15257
+ if (layers.length === 0) return opened;
15258
+ if (!anew) return onLayerHolding(opened);
15259
+ const first = readingOrder(opened)[0];
15260
+ if (first === void 0) return opened;
15231
15261
  return {
15232
15262
  ...opened,
15233
- patchIndex: layerFiles(opened, 0)[0] ?? opened.patchIndex,
15263
+ layerIndex: first.layer,
15264
+ patchIndex: first.file,
15234
15265
  cursor: 0,
15235
15266
  top: 0
15236
15267
  };
@@ -15263,12 +15294,12 @@ var init_reduce = __esmMin((() => {
15263
15294
  if (patch === void 0) return state;
15264
15295
  const cursor = line === void 0 ? 0 : rowAtSourceLine(patch, line);
15265
15296
  const top = clamp(cursor - Math.max(0, offset), 0, Math.max(0, patch.rows.length - 1));
15266
- return withCursorVisible({
15297
+ return withCursorVisible(onLayerHolding({
15267
15298
  ...state,
15268
15299
  patchIndex: index,
15269
15300
  cursor,
15270
15301
  top
15271
- });
15302
+ }));
15272
15303
  };
15273
15304
  openedAt = (state, patchIndex, line) => {
15274
15305
  const landed = {
@@ -16929,6 +16960,11 @@ var init_render = __esmMin((() => {
16929
16960
  mark: " ",
16930
16961
  paint: palette.faint
16931
16962
  };
16963
+ case "note": return {
16964
+ lead: FILE_LEAD,
16965
+ mark: " ",
16966
+ paint: palette.muted
16967
+ };
16932
16968
  case "title": return titleLook(state, row);
16933
16969
  default: return absurd(row.kind);
16934
16970
  }
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.131",
26
+ "version": "0.1.0-alpha.132",
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": {