@eliya-oss/agent-diff 0.1.0-alpha.112 → 0.1.0-alpha.113

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,13 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.113
4
+
5
+ ### Patch Changes
6
+
7
+ - The reply box shows the thread you are answering. It used to quote code from wherever the diff cursor happened to be — often a different file — and never showed your comment or the agent's answer, so you replied to a question you could not see. It now shows the conversation, and names the range rather than only its last line.
8
+
9
+ The header says when a line runs off the right of the pane. Code was cut with no marker of any kind, so two lines that differ only past the edge looked identical.
10
+
3
11
  ## 0.1.0-alpha.112
4
12
 
5
13
  ### Patch Changes
package/dist/main.js CHANGED
@@ -10401,7 +10401,7 @@ var init_pane = __esmMin((() => {
10401
10401
  init_drafts();
10402
10402
  init_init();
10403
10403
  init_pane();
10404
- var version$1 = "0.1.0-alpha.112";
10404
+ var version$1 = "0.1.0-alpha.113";
10405
10405
  //#endregion
10406
10406
  //#region src/cli/upgrade.ts
10407
10407
  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;
@@ -12401,7 +12401,7 @@ var init_tree = __esmMin((() => {
12401
12401
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
12402
12402
  };
12403
12403
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
12404
- })), 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, 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, kept, treeOf, reviewedCountIn, CROWDED, 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, 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;
12404
+ })), 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, 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, kept, treeOf, reviewedCountIn, CROWDED, 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, threadReplying, VOICES, threadQuote, pickedText, 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;
12405
12405
  var init_model = __esmMin((() => {
12406
12406
  init_dist();
12407
12407
  init_patch();
@@ -12777,9 +12777,32 @@ var init_model = __esmMin((() => {
12777
12777
  return span === "" ? `Comment on ${patch.path}` : `Comment on ${patch.path}:${span}`;
12778
12778
  };
12779
12779
  replyTarget = (state) => {
12780
- const thread = state.sent.find((entry) => entry.id === state.replyTo);
12780
+ const thread = threadReplying(state);
12781
12781
  if (thread === void 0) return "Reply";
12782
- return `Reply on ${thread.file}:${thread.end}`;
12782
+ const span = thread.start === thread.end ? `${thread.end}` : `${thread.start}-${thread.end}`;
12783
+ return `Reply on ${thread.file}:${span}`;
12784
+ };
12785
+ threadReplying = (state) => state.replyTo === void 0 ? void 0 : state.sent.find((entry) => entry.id === state.replyTo);
12786
+ VOICES = {
12787
+ reviewer: "you",
12788
+ agent: "the agent"
12789
+ };
12790
+ threadQuote = (state, room) => {
12791
+ const thread = threadReplying(state);
12792
+ if (thread === void 0) return [];
12793
+ const spoken = (thread.answers ?? []).map((body) => ({
12794
+ voice: "agent",
12795
+ body
12796
+ }));
12797
+ const turns = thread.turns ?? [{
12798
+ voice: "reviewer",
12799
+ body: thread.body
12800
+ }, ...spoken];
12801
+ const saidBy = (turn) => {
12802
+ const lines = wrapped(turn.body, Math.max(8, room - 4)).map((line) => ` ${line}`);
12803
+ return [` ${VOICES[turn.voice]}`, ...lines];
12804
+ };
12805
+ return turns.flatMap(saidBy);
12783
12806
  };
12784
12807
  pickedText = (state) => {
12785
12808
  const picked = state.picked;
@@ -15392,7 +15415,7 @@ var init_diffview = __esmMin((() => {
15392
15415
  }));
15393
15416
  //#endregion
15394
15417
  //#region src/tui/render.ts
15395
- var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, keysTitle, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, DIFF_FLOOR, COMPOSE_EDGE, CRAMPED, CRAMPED_ROWS, DIFF_CHROME_MOST, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, keysOf, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, PLAIN_PICKED, PICKED, PLAIN_CURSOR, UNDER_CURSOR, GAP_PAINT, frameRoot, crampedBar, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking, makePaletteParts, makeChoices, LIST_LEAD, windowed, listText, stack, makeBody, makeHome, makeModals, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, chipWidth, WAYS_OUT, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, SUMMARY_LINES, summaryLines, contextLabel, nameRoom, stateRoom, columns, FORGE_SILENT, unaskedForge, branchHeading, atHome, layersCell, baseLabel, stateCell, branchCells, placeLabel, headerParts, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, GUTTER, DIR_LEAD, TITLE_LEAD, FILE_LEAD, STALE_ROOM, STALE_LONG, STALE_SHORT, staleBanner, layerRoom, layerMark, layerLead, layerGutter, layerText, litRow, leftOver, titlePaint, layerPaint, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, foundTitle, fileRow, blockOf, aroundRow, windowedBlocks, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelText, Screen;
15418
+ var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, keysTitle, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, DIFF_FLOOR, COMPOSE_EDGE, CRAMPED, CRAMPED_ROWS, DIFF_CHROME_MOST, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, keysOf, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, PLAIN_PICKED, PICKED, PLAIN_CURSOR, UNDER_CURSOR, GAP_PAINT, frameRoot, crampedBar, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking, makePaletteParts, makeChoices, LIST_LEAD, windowed, listText, stack, makeBody, makeHome, makeModals, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, quotedFor, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, chipWidth, WAYS_OUT, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, SUMMARY_LINES, summaryLines, contextLabel, nameRoom, stateRoom, columns, FORGE_SILENT, unaskedForge, branchHeading, atHome, layersCell, baseLabel, stateCell, branchCells, placeLabel, headerParts, panLabel, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, GUTTER, DIR_LEAD, TITLE_LEAD, FILE_LEAD, STALE_ROOM, STALE_LONG, STALE_SHORT, staleBanner, layerRoom, layerMark, layerLead, layerGutter, layerText, litRow, leftOver, titlePaint, layerPaint, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, foundTitle, fileRow, blockOf, aroundRow, windowedBlocks, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelText, Screen;
15396
15419
  var init_render = __esmMin((() => {
15397
15420
  init_command();
15398
15421
  init_layers$1();
@@ -15870,6 +15893,14 @@ var init_render = __esmMin((() => {
15870
15893
  paddingBottom: 1,
15871
15894
  flexDirection: "column"
15872
15895
  });
15896
+ quotedFor = (state, shownLines, room) => {
15897
+ const said = threadQuote(state, room);
15898
+ if (said.length > 0) return said.slice(0, shownLines * 2).map((line) => clip(line, room));
15899
+ const snippet = snippetOf(state, shownLines);
15900
+ const more = selectedLineCount(state) - snippet.length;
15901
+ const tail = more > 0 ? [` … ${more} more lines`] : [];
15902
+ return [...snippet, ...tail].map((line) => clip(line, room));
15903
+ };
15873
15904
  clipHead = (label, room) => label.length > room ? `…${label.slice(label.length - Math.max(0, room - 1))}` : label;
15874
15905
  clipMiddle = (label, room) => {
15875
15906
  if (label.length <= room) return label;
@@ -16005,7 +16036,7 @@ var init_render = __esmMin((() => {
16005
16036
  const place = filePlace(state);
16006
16037
  return `file ${place.at} of ${place.of}`;
16007
16038
  };
16008
- headerParts = (state, branch, path, pan) => [
16039
+ headerParts = (state, branch, path, across) => [
16009
16040
  branch,
16010
16041
  path,
16011
16042
  state.patches.length === 0 ? "nothing to read" : placeLabel(state),
@@ -16014,8 +16045,13 @@ var init_render = __esmMin((() => {
16014
16045
  contextLabel(state.context),
16015
16046
  state.layersStale ? "layers stale" : "",
16016
16047
  hiddenLines(state) === 0 ? "" : `⋯ ${hiddenLines(state)} ${hiddenLines(state) === 1 ? "line" : "lines"} hidden`,
16017
- pan === 0 ? "" : `→ ${pan} columns`
16048
+ panLabel(state, across)
16018
16049
  ];
16050
+ panLabel = (state, across) => {
16051
+ if (across.pan > 0) return `→ ${across.pan} columns`;
16052
+ if (state.wrap || across.cutOff === 0) return "";
16053
+ return `→ ${across.cutOff} columns cut off`;
16054
+ };
16019
16055
  HEADER_GAP = 2;
16020
16056
  HEADER_PATH_MIN = 20;
16021
16057
  headerRoom = (width) => Math.max(0, width - 2 - 4);
@@ -16493,7 +16529,10 @@ var init_render = __esmMin((() => {
16493
16529
  const branch = selectedBranch(state);
16494
16530
  if (atHome(state)) return t`${fg(palette.faint)("")}`;
16495
16531
  const path = selectedPatch(state)?.path ?? "";
16496
- const parts = headerParts(state, branch?.branch ?? "", path, Math.min(state.pan, this.view.panLimit())).filter((part) => part.length > 0);
16532
+ const parts = headerParts(state, branch?.branch ?? "", path, {
16533
+ pan: Math.min(state.pan, this.view.panLimit()),
16534
+ cutOff: this.view.panLimit()
16535
+ }).filter((part) => part.length > 0);
16497
16536
  const [name = "", ...rest] = headerFitted(parts, path, headerRoom(this.renderer.width));
16498
16537
  return t`${fg(palette.ink)(name)} ${fg(palette.muted)(rest.join(" "))}`;
16499
16538
  }
@@ -16848,10 +16887,7 @@ var init_render = __esmMin((() => {
16848
16887
  if (state.screen !== "compose") return;
16849
16888
  const room = composeRoom(this.renderer.width);
16850
16889
  const shownLines = Math.max(1, Math.min(SNIPPET_LINES, Math.floor(this.renderer.height / 6)));
16851
- const snippet = snippetOf(state, shownLines);
16852
- const more = selectedLineCount(state) - snippet.length;
16853
- const tail = more > 0 ? [` … ${more} more lines`] : [];
16854
- const quoted = [...snippet, ...tail].map((line) => clip(line, room.text));
16890
+ const quoted = quotedFor(state, shownLines, room.text);
16855
16891
  this.composeTitle.content = clip(composeTarget(state), room.text);
16856
16892
  this.composeQuoted.content = [...quoted, ""].join("\n");
16857
16893
  this.composeQuoted.height = quoted.length + 1;
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.112",
26
+ "version": "0.1.0-alpha.113",
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": {