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

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.114
4
+
5
+ ### Patch Changes
6
+
7
+ - A comment you withdrew can be brought back from the terminal. `X` used to be a one-key destructive action with no confirm, no undo and no trace — the thread vanished from the diff, from the review panel and from the file counts, and the only way back was a CLI command the message named but the terminal could not run. A withdrawn thread now sits under "Withdrawn" in the review, out of the diff, and `X` on it brings it back.
8
+
3
9
  ## 0.1.0-alpha.113
4
10
 
5
11
  ### Patch Changes
package/dist/main.js CHANGED
@@ -9764,7 +9764,7 @@ var init_commands = __esmMin((() => {
9764
9764
  asks: entry.asks
9765
9765
  }))].toSorted((one, other) => one.at < other.at ? -1 : one.at > other.at ? 1 : 0);
9766
9766
  sentOf = (comment, replies, reading) => {
9767
- const { spoken, settled, head, shown, read } = reading;
9767
+ const { spoken, settled, removed, head, shown, read } = reading;
9768
9768
  const ids = /* @__PURE__ */ new Set([comment.id, ...replies.map((reply) => reply.id)]);
9769
9769
  const said = spoken.filter((entry) => ids.has(entry.comment));
9770
9770
  const seen = [...ids].reduce((total, id) => total + (read[id] ?? 0), 0);
@@ -9778,6 +9778,7 @@ var init_commands = __esmMin((() => {
9778
9778
  end: comment.end,
9779
9779
  body: comment.body,
9780
9780
  settled: Object.hasOwn(settled, comment.id),
9781
+ removed: Object.hasOwn(removed, comment.id),
9781
9782
  stale: comment.head !== head,
9782
9783
  outside: !shown.has(comment.file),
9783
9784
  unread: Math.max(0, said.length - seen),
@@ -9795,11 +9796,12 @@ var init_commands = __esmMin((() => {
9795
9796
  const spoken = yield* store.answers(worktree.path);
9796
9797
  const current = yield* store.state(worktree.path);
9797
9798
  const shown = new Set(reading.patches.map((patch) => patch.path));
9798
- const held = flatten(yield* store.inbox(worktree.path)).filter((comment) => !Object.hasOwn(current.removed, comment.id));
9799
+ const held = flatten(yield* store.inbox(worktree.path));
9799
9800
  const replies = held.filter((comment) => comment.replyTo !== void 0);
9800
9801
  const conversation = {
9801
9802
  spoken,
9802
9803
  settled: current.settled,
9804
+ removed: current.removed,
9803
9805
  head: worktree.head,
9804
9806
  shown,
9805
9807
  read: current.read
@@ -10401,7 +10403,7 @@ var init_pane = __esmMin((() => {
10401
10403
  init_drafts();
10402
10404
  init_init();
10403
10405
  init_pane();
10404
- var version$1 = "0.1.0-alpha.113";
10406
+ var version$1 = "0.1.0-alpha.114";
10405
10407
  //#endregion
10406
10408
  //#region src/cli/upgrade.ts
10407
10409
  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;
@@ -11007,7 +11009,7 @@ var init_layers = __esmMin((() => {
11007
11009
  }));
11008
11010
  //#endregion
11009
11011
  //#region src/cli/threads.ts
11010
- var stateOf, spoken$1, turnsOf, threadOf, threadsIn, idsIn, isKnown, listThreads, answerComment, settleIn, settleThread, removeIn, removeComment, without, restoreComment, settleRead;
11012
+ var stateOf, spoken$1, turnsOf, threadOf, threadsIn, idsIn, isKnown, listThreads, answerComment, settleIn, settleThread, removeIn, removeComment, without, restoreIn, restoreComment, settleRead;
11011
11013
  var init_threads = __esmMin((() => {
11012
11014
  init_dist();
11013
11015
  init_store();
@@ -11139,6 +11141,15 @@ var init_threads = __esmMin((() => {
11139
11141
  return yield* removeIn(yield* findBranch(repo, branch), id, at);
11140
11142
  });
11141
11143
  without = (entries, id) => Object.fromEntries(Object.entries(entries).filter(([key]) => key !== id));
11144
+ restoreIn = fn("Cli.restoreIn")(function* (worktree, id) {
11145
+ const store = yield* Store;
11146
+ if (!(yield* isKnown(worktree.path, id))) return yield* new UnknownComment({ id });
11147
+ yield* store.changeState(worktree.path, (was) => ({
11148
+ ...was,
11149
+ removed: without(was.removed, id)
11150
+ }));
11151
+ return { restored: id };
11152
+ });
11142
11153
  restoreComment = fn("Cli.restoreComment")(function* (repo, branch, id) {
11143
11154
  const store = yield* Store;
11144
11155
  const worktree = yield* findBranch(repo, branch);
@@ -12691,7 +12702,7 @@ var init_model = __esmMin((() => {
12691
12702
  commentsOn = (state, fileIndex) => {
12692
12703
  const patch = state.patches[fileIndex];
12693
12704
  if (patch === void 0) return 0;
12694
- return state.sent.filter((entry) => entry.file === patch.path).length;
12705
+ return state.sent.filter((entry) => entry.file === patch.path && entry.removed !== true).length;
12695
12706
  };
12696
12707
  hiddenLines = (state) => shownOf(state)?.gaps.reduce((total, gap) => total + gap.hidden, 0) ?? 0;
12697
12708
  markedRows = (state) => {
@@ -12879,7 +12890,7 @@ var init_model = __esmMin((() => {
12879
12890
  const patch = selectedPatch(state);
12880
12891
  const here = patch?.rows[row];
12881
12892
  if (patch === void 0 || here === void 0) return [];
12882
- return state.sent.filter((entry) => entry.file === patch.path && entry.id !== void 0 && lineOnSide(here, entry.side) === entry.end);
12893
+ return state.sent.filter((entry) => entry.file === patch.path && entry.id !== void 0 && entry.removed !== true && lineOnSide(here, entry.side) === entry.end);
12883
12894
  };
12884
12895
  stopsAtRow = (state, row) => 1 + threadsAtRow(state, row).length;
12885
12896
  threadAtStop = (state) => state.stop === 0 ? void 0 : threadsAtRow(state, state.cursor)[state.stop - 1];
@@ -12887,12 +12898,12 @@ var init_model = __esmMin((() => {
12887
12898
  const patch = selectedPatch(state);
12888
12899
  const here = patch?.rows[row];
12889
12900
  if (patch === void 0 || here === void 0) return void 0;
12890
- return state.sent.find((entry) => entry.file === patch.path && entry.id !== void 0 && lineOnSide(here, entry.side) === entry.end);
12901
+ return state.sent.find((entry) => entry.file === patch.path && entry.id !== void 0 && entry.removed !== true && lineOnSide(here, entry.side) === entry.end);
12891
12902
  };
12892
12903
  openCommentRows = (state) => {
12893
12904
  const patch = selectedPatch(state);
12894
12905
  if (patch === void 0) return [];
12895
- const open = state.sent.filter((entry) => entry.file === patch.path && entry.settled !== true);
12906
+ const open = state.sent.filter((entry) => entry.file === patch.path && entry.settled !== true && entry.removed !== true);
12896
12907
  return patch.rows.filter((row) => open.some((note) => lineOnSide(row, note.side) === note.end)).map((row) => row.index);
12897
12908
  };
12898
12909
  filesWithComments = (state) => state.patches.flatMap((patch, index) => state.sent.some((entry) => entry.file === patch.path) ? [index] : []);
@@ -12901,7 +12912,8 @@ var init_model = __esmMin((() => {
12901
12912
  "asked",
12902
12913
  "with",
12903
12914
  "answered",
12904
- "settled"
12915
+ "settled",
12916
+ "removed"
12905
12917
  ];
12906
12918
  answersIn = (comment) => comment.answers?.length ?? 0;
12907
12919
  newerOf = (state, comment) => {
@@ -12912,6 +12924,7 @@ var init_model = __esmMin((() => {
12912
12924
  };
12913
12925
  spokeLast = (comment) => comment.turns?.at(-1)?.voice;
12914
12926
  sectionOf = (comment) => {
12927
+ if (comment.removed === true) return "removed";
12915
12928
  if (comment.settled === true) return "settled";
12916
12929
  if (comment.asks === true) return "asked";
12917
12930
  if (spokeLast(comment) === "reviewer") return "with";
@@ -15415,7 +15428,7 @@ var init_diffview = __esmMin((() => {
15415
15428
  }));
15416
15429
  //#endregion
15417
15430
  //#region src/tui/render.ts
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;
15431
+ 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, stillThere, 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;
15419
15432
  var init_render = __esmMin((() => {
15420
15433
  init_command();
15421
15434
  init_layers$1();
@@ -15893,6 +15906,7 @@ var init_render = __esmMin((() => {
15893
15906
  paddingBottom: 1,
15894
15907
  flexDirection: "column"
15895
15908
  });
15909
+ stillThere = (sent) => sent.filter((one) => one.removed !== true);
15896
15910
  quotedFor = (state, shownLines, room) => {
15897
15911
  const said = threadQuote(state, room);
15898
15912
  if (said.length > 0) return said.slice(0, shownLines * 2).map((line) => clip(line, room));
@@ -15943,7 +15957,7 @@ var init_render = __esmMin((() => {
15943
15957
  answers: entry.answers ?? [],
15944
15958
  turns: entry.turns ?? []
15945
15959
  }));
15946
- notesFor = (state, path) => notesOf(state.sent, path, true, state.opened);
15960
+ notesFor = (state, path) => notesOf(stillThere(state.sent), path, true, state.opened);
15947
15961
  paired = (chunks) => {
15948
15962
  const chips = [];
15949
15963
  for (let at = 0; at < chunks.length; at += CHIP_CHUNKS) chips.push(chunks.slice(at, at + CHIP_CHUNKS));
@@ -16132,7 +16146,8 @@ var init_render = __esmMin((() => {
16132
16146
  asked: "Waiting on you",
16133
16147
  with: "With the agent",
16134
16148
  answered: "Answered, not settled",
16135
- settled: "Settled"
16149
+ settled: "Settled",
16150
+ removed: "Withdrawn"
16136
16151
  };
16137
16152
  PANEL_ORDER = PANEL_SECTIONS;
16138
16153
  PANEL_LEAD = 3;
@@ -17046,7 +17061,7 @@ var init_upgrade = __esmMin((() => {
17046
17061
  }));
17047
17062
  //#endregion
17048
17063
  //#region src/tui/app.ts
17049
- 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, sentAway, turnedOver, settledPath, restsWhereItLanded, lonelyGaps, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
17064
+ 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;
17050
17065
  var init_app = __esmMin((() => {
17051
17066
  init_dist();
17052
17067
  init_report();
@@ -17906,19 +17921,26 @@ var init_app = __esmMin((() => {
17906
17921
  removeHere() {
17907
17922
  return gen({ self: this }, function* () {
17908
17923
  const branch = selectedBranch(this.state);
17909
- const id = (threadChosen(this.state) ?? threadAtStop(this.state) ?? threadAtRow(this.state, this.state.cursor))?.id;
17924
+ const thread = threadHere(this.state);
17925
+ const id = thread?.id;
17910
17926
  if (branch === void 0 || id === void 0) {
17911
17927
  this.commit(withNotice(this.state, "no thread here"));
17912
17928
  return;
17913
17929
  }
17930
+ yield* this.turningOver(branch.branch, id, thread?.removed === true);
17931
+ });
17932
+ }
17933
+ turningOver(branch, id, back) {
17934
+ return gen({ self: this }, function* () {
17914
17935
  const was = this.state.panelIndex;
17915
- yield* this.removing(branch.branch, id);
17916
- const sent = yield* this.loadSent(branch.branch);
17917
- const held = withSent({
17936
+ yield* back ? this.restoring(branch, id) : this.removing(branch, id);
17937
+ const sent = yield* this.loadSent(branch);
17938
+ const kept = {
17918
17939
  ...this.state,
17919
17940
  opened: this.state.opened.filter((one) => one !== id)
17920
- }, sent);
17921
- this.commit(withNotice(this.staying(held, id, was), "removed, restore it with comment restore"));
17941
+ };
17942
+ const said = back ? "brought back" : "withdrawn, it is under Withdrawn in the review";
17943
+ this.commit(withNotice(this.staying(withSent(kept, sent), id, was), said));
17922
17944
  });
17923
17945
  }
17924
17946
  fillBranches() {
@@ -18083,6 +18105,10 @@ var init_app = __esmMin((() => {
18083
18105
  const worktree = this.worktreeFor(branch);
18084
18106
  return worktree === void 0 ? settleThread(this.repo, branch, id, at) : settleIn(worktree, id, at);
18085
18107
  }
18108
+ restoring(branch, id) {
18109
+ const worktree = this.worktreeFor(branch);
18110
+ return worktree === void 0 ? restoreComment(this.repo, branch, id) : restoreIn(worktree, id);
18111
+ }
18086
18112
  removing(branch, id) {
18087
18113
  const at = (/* @__PURE__ */ new Date()).toISOString();
18088
18114
  const worktree = this.worktreeFor(branch);
@@ -18281,6 +18307,7 @@ var init_app = __esmMin((() => {
18281
18307
  });
18282
18308
  }
18283
18309
  };
18310
+ threadHere = (state) => threadChosen(state) ?? threadAtStop(state) ?? threadAtRow(state, state.cursor);
18284
18311
  sentAway = (state) => ({
18285
18312
  ...state,
18286
18313
  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.113",
26
+ "version": "0.1.0-alpha.114",
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": {