@eliya-oss/agent-diff 0.1.0-alpha.34 → 0.1.0-alpha.35

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.35
4
+
5
+ ### Patch Changes
6
+
7
+ - A comment can be removed from the review and restored, and the record keeps it either way.
8
+
3
9
  ## 0.1.0-alpha.34
4
10
 
5
11
  ### Patch Changes
package/dist/main.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { randomUUID } from "node:crypto";
2
2
  import { appendFile, mkdir, readFile, realpath, writeFile } from "node:fs/promises";
3
3
  import { text } from "node:stream/consumers";
4
- import { dirname, join } from "node:path";
4
+ import { dirname, join, resolve } from "node:path";
5
5
  import { execFile } from "node:child_process";
6
6
  import { promisify } from "node:util";
7
7
  import { homedir, hostname, platform } from "node:os";
@@ -4028,12 +4028,12 @@ var init_Effect = __esmMin((() => {
4028
4028
  //#endregion
4029
4029
  //#region node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/schema/annotations.js
4030
4030
  /** @internal */
4031
- function resolve$1(ast) {
4031
+ function resolve$2(ast) {
4032
4032
  return ast.checks ? ast.checks[ast.checks.length - 1].annotations : ast.annotations;
4033
4033
  }
4034
4034
  /** @internal */
4035
4035
  function resolveAt(key) {
4036
- return (ast) => resolve$1(ast)?.[key];
4036
+ return (ast) => resolve$2(ast)?.[key];
4037
4037
  }
4038
4038
  var SENTINELS_ANNOTATION_KEY, resolveIdentifier, resolveBrands, getExpected;
4039
4039
  var init_annotations = __esmMin((() => {
@@ -7946,7 +7946,8 @@ var init_model$2 = __esmMin((() => {
7946
7946
  vouches: {},
7947
7947
  consumed: 0,
7948
7948
  pending: [],
7949
- settled: {}
7949
+ settled: {},
7950
+ removed: {}
7950
7951
  };
7951
7952
  }));
7952
7953
  //#endregion
@@ -7985,7 +7986,8 @@ var init_schema = __esmMin((() => {
7985
7986
  vouches: optionalKey(Record(String$1, String$1)),
7986
7987
  consumed: optionalKey(Int),
7987
7988
  pending: optionalKey(ArraySchema(StoredComment)),
7988
- settled: optionalKey(Record(String$1, String$1))
7989
+ settled: optionalKey(Record(String$1, String$1)),
7990
+ removed: optionalKey(Record(String$1, String$1))
7989
7991
  });
7990
7992
  Settings = Struct({ wrap: optionalKey(Boolean) });
7991
7993
  Prose = Struct({
@@ -8507,7 +8509,7 @@ var init_commands = __esmMin((() => {
8507
8509
  const worktree = yield* findBranch(repo, branch);
8508
8510
  const spoken = yield* store.answers(worktree.path);
8509
8511
  const current = yield* store.state(worktree.path);
8510
- return flatten(yield* store.inbox(worktree.path)).map((comment) => sentOf(comment, spoken, current.settled, worktree.head));
8512
+ return flatten(yield* store.inbox(worktree.path)).filter((comment) => !Object.hasOwn(current.removed, comment.id)).map((comment) => sentOf(comment, spoken, current.settled, worktree.head));
8511
8513
  });
8512
8514
  submitReview = fn("Cli.submitReview")(function* (repo, branch, id, at) {
8513
8515
  const store = yield* Store;
@@ -9025,7 +9027,7 @@ var init_layers$1 = __esmMin((() => {
9025
9027
  }));
9026
9028
  //#endregion
9027
9029
  //#region src/cli/layers.ts
9028
- var STALE_ADVICE, unique, spansOfLayer, isSpan, isBlock, codeBlockOf, blocksOf, layerOf, parsed, readLayers, fromStored, toStored, reportedLayers, reportOf, resolve, resolveAll, worktreeAt, storedLayers, setLayers, showLayers, listLayers;
9030
+ var STALE_ADVICE, unique, spansOfLayer, isSpan, isBlock, codeBlockOf, blocksOf, layerOf, parsed, readLayers, fromStored, toStored, reportedLayers, reportOf, resolve$1, resolveAll, worktreeAt, storedLayers, setLayers, showLayers, listLayers;
9029
9031
  var init_layers = __esmMin((() => {
9030
9032
  init_dist();
9031
9033
  init_layers$1();
@@ -9136,11 +9138,11 @@ var init_layers = __esmMin((() => {
9136
9138
  layers: reportedLayers(patches, layers)
9137
9139
  };
9138
9140
  };
9139
- resolve = (path) => realpath(path).catch(() => path);
9140
- resolveAll = (paths) => Promise.all(paths.map(resolve));
9141
+ resolve$1 = (path) => realpath(path).catch(() => path);
9142
+ resolveAll = (paths) => Promise.all(paths.map(resolve$1));
9141
9143
  worktreeAt = fn("Cli.worktreeAt")(function* (worktreePath) {
9142
9144
  const git = yield* Git;
9143
- const asked = yield* promise(() => resolve(worktreePath));
9145
+ const asked = yield* promise(() => resolve$1(worktreePath));
9144
9146
  const worktrees = yield* git.worktrees(asked);
9145
9147
  const paths = worktrees.map((entry) => entry.path);
9146
9148
  const found = worktrees[(yield* promise(() => resolveAll(paths))).indexOf(asked)];
@@ -9200,14 +9202,15 @@ var init_layers = __esmMin((() => {
9200
9202
  }));
9201
9203
  //#endregion
9202
9204
  //#region src/cli/threads.ts
9203
- var stateOf$1, spoken$1, threadOf, threadsIn, idsIn, isKnown, listThreads, answerComment, settleThread;
9205
+ var stateOf$1, spoken$1, threadOf, threadsIn, idsIn, isKnown, listThreads, answerComment, settleThread, removeComment, without, restoreComment;
9204
9206
  var init_threads = __esmMin((() => {
9205
9207
  init_dist();
9206
9208
  init_store();
9207
9209
  init_commands();
9208
9210
  init_layers();
9209
9211
  init_error$1();
9210
- stateOf$1 = (answers, isSettled) => {
9212
+ stateOf$1 = (answers, isSettled, isRemoved) => {
9213
+ if (isRemoved) return "removed";
9211
9214
  if (isSettled) return "done";
9212
9215
  const last = answers.at(-1);
9213
9216
  if (last === void 0) return "submitted";
@@ -9227,7 +9230,7 @@ var init_threads = __esmMin((() => {
9227
9230
  start: comment.anchor.start,
9228
9231
  end: comment.anchor.end,
9229
9232
  body: comment.body,
9230
- state: stateOf$1(mine, Object.hasOwn(reading.settled, comment.id)),
9233
+ state: stateOf$1(mine, Object.hasOwn(reading.settled, comment.id), Object.hasOwn(reading.removed, comment.id)),
9231
9234
  stale: batch.head !== reading.head,
9232
9235
  answers: mine.map(spoken$1)
9233
9236
  };
@@ -9245,6 +9248,7 @@ var init_threads = __esmMin((() => {
9245
9248
  return threadsIn(yield* store.inbox(worktree.path), {
9246
9249
  answers: yield* store.answers(worktree.path),
9247
9250
  settled: current.settled,
9251
+ removed: current.removed,
9248
9252
  head: worktree.head
9249
9253
  });
9250
9254
  });
@@ -9275,6 +9279,32 @@ var init_threads = __esmMin((() => {
9275
9279
  });
9276
9280
  return { settled: id };
9277
9281
  });
9282
+ removeComment = fn("Cli.removeComment")(function* (repo, branch, id, at) {
9283
+ const store = yield* Store;
9284
+ const worktree = yield* findBranch(repo, branch);
9285
+ if (!(yield* isKnown(worktree.path, id))) return yield* new UnknownComment({ id });
9286
+ const current = yield* store.state(worktree.path);
9287
+ yield* store.saveState(worktree.path, {
9288
+ ...current,
9289
+ removed: {
9290
+ ...current.removed,
9291
+ [id]: at
9292
+ }
9293
+ });
9294
+ return { removed: id };
9295
+ });
9296
+ without = (entries, id) => Object.fromEntries(Object.entries(entries).filter(([key]) => key !== id));
9297
+ restoreComment = fn("Cli.restoreComment")(function* (repo, branch, id) {
9298
+ const store = yield* Store;
9299
+ const worktree = yield* findBranch(repo, branch);
9300
+ if (!(yield* isKnown(worktree.path, id))) return yield* new UnknownComment({ id });
9301
+ const current = yield* store.state(worktree.path);
9302
+ yield* store.saveState(worktree.path, {
9303
+ ...current,
9304
+ removed: without(current.removed, id)
9305
+ });
9306
+ return { restored: id };
9307
+ });
9278
9308
  }));
9279
9309
  //#endregion
9280
9310
  //#region src/cli/parse.ts
@@ -9524,6 +9554,40 @@ var init_catalog = __esmMin((() => {
9524
9554
  dataKey: "settled",
9525
9555
  example: "adiff comment resolve --repo . --branch add-teammate-invitations --id c1"
9526
9556
  },
9557
+ {
9558
+ name: "comment remove",
9559
+ about: "Take a comment out of the review. It stays in the record as removed",
9560
+ safety: "write",
9561
+ options: [
9562
+ repo,
9563
+ branch,
9564
+ {
9565
+ name: "id",
9566
+ required: true,
9567
+ value: "id",
9568
+ about: "The comment to remove"
9569
+ }
9570
+ ],
9571
+ dataKey: "removed",
9572
+ example: "adiff comment remove --repo . --branch add-teammate-invitations --id c1"
9573
+ },
9574
+ {
9575
+ name: "comment restore",
9576
+ about: "Put a removed comment back into the review",
9577
+ safety: "write",
9578
+ options: [
9579
+ repo,
9580
+ branch,
9581
+ {
9582
+ name: "id",
9583
+ required: true,
9584
+ value: "id",
9585
+ about: "The comment to restore"
9586
+ }
9587
+ ],
9588
+ dataKey: "restored",
9589
+ example: "adiff comment restore --repo . --branch add-teammate-invitations --id c1"
9590
+ },
9527
9591
  {
9528
9592
  name: "file vouch",
9529
9593
  about: "Toggle a file as reviewed. Lapses on its own when the file changes",
@@ -10157,7 +10221,7 @@ var init_tree = __esmMin((() => {
10157
10221
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
10158
10222
  };
10159
10223
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
10160
- })), initialState, onLayers, selectedLayer, proseFor, layerFiles, layerHolding, layerOpen, chunked, packed, wrapped, NO_NOTE, noteRows$1, proseRow, proseRows$1, titleRows, clipEnd, FILE_LEAD, fileRows, layerRows, railWindow, selectedBranch, selectedPatch, treeOf, treeRows, crowdedOf, directoryOfFile, isReviewed, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, editedComment, composeTarget, selectedLines, KEYWORDS, NAME, longestName, searchTerm, matchHere, selectionReadout, WHOLE_FILE, CONTEXT_STEPS, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, spokenSince, hunkStarts, changeAround, nextUnreviewed, reviewedCount, fileOrder, layerFile, selectionRange;
10224
+ })), initialState, 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, treeOf, treeRows, crowdedOf, directoryOfFile, isReviewed, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, editedComment, composeTarget, selectedLines, KEYWORDS, NAME, longestName, searchTerm, matchHere, selectionReadout, WHOLE_FILE, CONTEXT_STEPS, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, spokenSince, hunkStarts, changeAround, nextUnreviewed, reviewedCount, fileOrder, layerFile, selectionRange;
10161
10225
  var init_model = __esmMin((() => {
10162
10226
  init_dist();
10163
10227
  init_patch();
@@ -10235,6 +10299,11 @@ var init_model = __esmMin((() => {
10235
10299
  if (last === void 0 || last.length + 1 + word.length > room) return [...lines, word];
10236
10300
  return [...lines.slice(0, -1), `${last} ${word}`];
10237
10301
  };
10302
+ shortened = (word, room) => word.length <= room ? word : `${word.slice(0, Math.max(1, room - 1))}\u2026`;
10303
+ wordWrapped = (text, room) => {
10304
+ const width = Math.max(1, room);
10305
+ return text.split(/\s+/).filter((word) => word.length > 0).map((word) => shortened(word, width)).reduce((lines, word) => packed(lines, word, width), []);
10306
+ };
10238
10307
  wrapped = (text, room) => {
10239
10308
  const width = Math.max(1, room);
10240
10309
  return text.split(/\s+/).filter((word) => word.length > 0).flatMap((word) => chunked(word, width)).reduce((lines, word) => packed(lines, word, width), []);
@@ -10270,7 +10339,7 @@ var init_model = __esmMin((() => {
10270
10339
  }
10271
10340
  return rows;
10272
10341
  };
10273
- titleRows = (state, layerIndex, room) => wrapped(state.layers[layerIndex]?.title ?? "", room).map((text, at) => ({
10342
+ titleRows = (state, layerIndex, room) => wordWrapped(state.layers[layerIndex]?.title ?? "", room).map((text, at) => ({
10274
10343
  index: layerIndex,
10275
10344
  kind: "title",
10276
10345
  text,
@@ -10874,6 +10943,13 @@ var init_command = __esmMin((() => {
10874
10943
  screens: ["review"],
10875
10944
  hint: "settle"
10876
10945
  }),
10946
+ command({
10947
+ action: "thread.remove",
10948
+ title: "Remove the comment here",
10949
+ category: "Review",
10950
+ keys: ["X"],
10951
+ screens: ["review"]
10952
+ }),
10877
10953
  command({
10878
10954
  action: "rail.toggle",
10879
10955
  title: "Switch between layers and files",
@@ -11439,6 +11515,7 @@ var init_reduce = __esmMin((() => {
11439
11515
  "pan.left": (state) => panned(state, -8),
11440
11516
  "review.reload": (state) => state,
11441
11517
  "thread.settle": (state) => state,
11518
+ "thread.remove": (state) => state,
11442
11519
  "rail.toggle": toggleRail,
11443
11520
  "file.vouch": (state) => state,
11444
11521
  "file.vouch.next": (state) => state,
@@ -11915,6 +11992,9 @@ var init_diffview = __esmMin((() => {
11915
11992
  noteRoom() {
11916
11993
  return Math.max(NOTE_MIN, this.code.width - this.gutterWidth() - 3);
11917
11994
  }
11995
+ room() {
11996
+ return this.noteRoom();
11997
+ }
11918
11998
  gutterWidth() {
11919
11999
  return Math.max(0, this.code.x - this.numbers.x) + SIGN_WIDTH;
11920
12000
  }
@@ -12230,7 +12310,7 @@ var init_diffview = __esmMin((() => {
12230
12310
  }));
12231
12311
  //#endregion
12232
12312
  //#region src/tui/render.ts
12233
- var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, FRAME_PAD, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, COMPOSE_PAD, COMPOSE_MIN_TEXT, reportActions, actionsText, SNIPPET_LINES, PALETTE_TITLE, PALETTE_MAX, PALETTE_CHROME, PENDING_CHROME, PALETTE_WIDTH, TREE_MAX, TREE_MIN, TREE_SHARE, DIFF_MIN, BODY_BORDER, PANE_CHROME, BRANCH_WIDTH, BRANCH_NAME, BRANCH_NAME_MIN, BRANCH_TAIL, EMPTY_LIST, MODAL_MARGIN, bodyRoom, treeWidth, homeWidth, modalWidth, composeRoom, laidOut, STICKY_MAX, pickPaint, SELECTION, CURSOR, ACCENT, GAP_PAINT, bar, makeList, makeDiffPane, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, makePaletteParts, makePendingParts, makeChoices, stack, makeBody, makeHome, makeModals, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, makeComposeParts, makeCompose, clip, clipHead, clipPath, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, contextLabel, nameRoom, columns, branchHeading, atHome, layersCell, stateCell, branchCells, headerParts, fallbackScope, treeMarks, treeTail, treeLine, STEP_NUMBER, STEP_LEAD, NOTE_LEAD, STEP_GAP, staleBanner, layerRoom, layerFold, layerHead, layerText, layerPaint, Screen;
12313
+ var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, FRAME_PAD, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, COMPOSE_PAD, COMPOSE_MIN_TEXT, reportActions, actionsText, SNIPPET_LINES, PALETTE_TITLE, PALETTE_MAX, PALETTE_CHROME, PENDING_CHROME, PALETTE_WIDTH, TREE_MAX, TREE_MIN, TREE_SHARE, DIFF_MIN, BODY_BORDER, PANE_CHROME, BRANCH_WIDTH, BRANCH_NAME, BRANCH_NAME_MIN, BRANCH_TAIL, EMPTY_LIST, MODAL_MARGIN, bodyRoom, treeWidth, homeWidth, modalWidth, composeRoom, laidOut, STICKY_MAX, pickPaint, SELECTION, CURSOR, ACCENT, GAP_PAINT, bar, makeList, makeDiffPane, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, makePaletteParts, makePendingParts, makeChoices, stack, makeBody, makeHome, makeModals, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, makeComposeParts, makeCompose, clip, clipHead, clipPath, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, contextLabel, nameRoom, columns, branchHeading, atHome, layersCell, stateCell, branchCells, headerParts, fallbackScope, treeMarks, treeTail, treeLine, STEP_NUMBER, STEP_LEAD, NOTE_LEAD, STEP_GAP, STALE_ROOM, STALE_LONG, STALE_SHORT, staleBanner, layerRoom, layerFold, layerHead, layerText, layerPaint, Screen;
12234
12314
  var init_render = __esmMin((() => {
12235
12315
  init_command();
12236
12316
  init_patch();
@@ -12676,7 +12756,10 @@ var init_render = __esmMin((() => {
12676
12756
  STEP_LEAD = 8;
12677
12757
  NOTE_LEAD = 10;
12678
12758
  STEP_GAP = 1;
12679
- staleBanner = (room) => wrapped("stale, the branch moved on", room).map((line) => ` ${line}`).join("\n");
12759
+ STALE_ROOM = 13;
12760
+ STALE_LONG = "stale, the branch moved on";
12761
+ STALE_SHORT = "stale";
12762
+ staleBanner = (room) => wrapped(room >= STALE_ROOM ? STALE_LONG : STALE_SHORT, room).map((line) => ` ${line}`).join("\n");
12680
12763
  layerRoom = (state, pane) => {
12681
12764
  const tally = Math.max(1, ...state.layers.map((layer) => `${layer.files.length}`.length));
12682
12765
  return {
@@ -12810,6 +12893,9 @@ var init_render = __esmMin((() => {
12810
12893
  viewportRows() {
12811
12894
  return this.diffRows();
12812
12895
  }
12896
+ noteRoom() {
12897
+ return this.view.room();
12898
+ }
12813
12899
  diffRows() {
12814
12900
  return Math.max(1, this.diffScroll.height);
12815
12901
  }
@@ -13188,6 +13274,7 @@ var init_display = __esmMin((() => {
13188
13274
  shapeOf = (screen) => ({
13189
13275
  paint: paintWith(screen),
13190
13276
  rows: sync(() => screen.viewportRows()),
13277
+ room: sync(() => screen.noteRoom()),
13191
13278
  listen: listenWith(screen)
13192
13279
  });
13193
13280
  displayOn = (renderer, repo) => sync$1(Display)(() => shapeOf(new Screen(renderer, repo)));
@@ -13229,7 +13316,7 @@ var init_session = __esmMin((() => {
13229
13316
  writeSession = fn("Tui.writeSession")(function* (path, session) {
13230
13317
  yield* promise(() => saved(path, session));
13231
13318
  });
13232
- })), PRINTABLE, KEY_HISTORY, copyToClipboard, asKey, keyName, App, launch, told, untilDestroyed, runOn, runTui;
13319
+ })), PRINTABLE, KEY_HISTORY, copyToClipboard, asKey, keyName, App, settledPath, launch, told, untilDestroyed, runOn, runTui;
13233
13320
  var init_app = __esmMin((() => {
13234
13321
  init_dist();
13235
13322
  init_report();
@@ -13275,6 +13362,7 @@ var init_app = __esmMin((() => {
13275
13362
  renderer;
13276
13363
  repo;
13277
13364
  noticeMs;
13365
+ roomed = 0;
13278
13366
  sessionPath;
13279
13367
  remembered = "";
13280
13368
  wrapKept = false;
@@ -13423,11 +13511,17 @@ var init_app = __esmMin((() => {
13423
13511
  }
13424
13512
  syncGeometry() {
13425
13513
  const rows = runSync(this.display.rows);
13426
- if (rows === this.state.viewport) return;
13427
- this.commit({
13428
- ...this.state,
13429
- viewport: rows
13430
- });
13514
+ if (rows !== this.state.viewport) {
13515
+ this.commit({
13516
+ ...this.state,
13517
+ viewport: rows
13518
+ });
13519
+ return;
13520
+ }
13521
+ const room = runSync(this.display.room);
13522
+ if (room === this.roomed) return;
13523
+ this.roomed = room;
13524
+ runSync(this.display.paint(this.state));
13431
13525
  }
13432
13526
  measured() {
13433
13527
  return {
@@ -13495,6 +13589,7 @@ var init_app = __esmMin((() => {
13495
13589
  "file.vouch": () => this.vouch(false),
13496
13590
  "file.vouch.next": () => this.vouch(true),
13497
13591
  "thread.settle": () => this.settleHere(),
13592
+ "thread.remove": () => this.removeHere(),
13498
13593
  "selection.copy": () => sync(() => this.copySelection()),
13499
13594
  "search.open": () => this.findSelection(),
13500
13595
  "search.jump": () => this.openMatch(),
@@ -13670,6 +13765,23 @@ var init_app = __esmMin((() => {
13670
13765
  this.commit(withNotice(held, "settled"));
13671
13766
  });
13672
13767
  }
13768
+ removeHere() {
13769
+ return gen({ self: this }, function* () {
13770
+ const branch = selectedBranch(this.state);
13771
+ const id = (threadAtStop(this.state) ?? threadAtRow(this.state, this.state.cursor))?.id;
13772
+ if (branch === void 0 || id === void 0) {
13773
+ this.commit(withNotice(this.state, "no thread here"));
13774
+ return;
13775
+ }
13776
+ yield* removeComment(this.repo, branch.branch, id, (/* @__PURE__ */ new Date()).toISOString());
13777
+ const sent = yield* this.loadSent(branch.branch);
13778
+ const held = withSent({
13779
+ ...this.state,
13780
+ opened: this.state.opened.filter((was) => was !== id)
13781
+ }, sent);
13782
+ this.commit(withNotice(held, "removed, restore it with comment restore"));
13783
+ });
13784
+ }
13673
13785
  reloadList() {
13674
13786
  return gen({ self: this }, function* () {
13675
13787
  const here = selectedBranch(this.state)?.branch;
@@ -13937,7 +14049,9 @@ var init_app = __esmMin((() => {
13937
14049
  });
13938
14050
  }
13939
14051
  };
13940
- launch = fn("Tui.launch")(function* (repo, renderer, noticeMs, sessionPath) {
14052
+ settledPath = (path) => promise(() => realpath(path).catch(() => resolve(path)));
14053
+ launch = fn("Tui.launch")(function* (asked, renderer, noticeMs, sessionPath) {
14054
+ const repo = yield* settledPath(asked);
13941
14055
  const branches = yield* listBranches(repo);
13942
14056
  const resume = sessionPath === void 0 ? none() : yield* readSession(sessionPath);
13943
14057
  const store = yield* Store;
@@ -14067,6 +14181,14 @@ const commentResolve = fn("Main.commentResolve")(function* (options) {
14067
14181
  const report = yield* settleThread(yield* required(options, "repo"), yield* required(options, "branch"), yield* required(options, "id"), options["at"] ?? (/* @__PURE__ */ new Date()).toISOString());
14068
14182
  yield* answer(options, { settled: report.settled });
14069
14183
  });
14184
+ const commentRemove = fn("Main.commentRemove")(function* (options) {
14185
+ const report = yield* removeComment(yield* required(options, "repo"), yield* required(options, "branch"), yield* required(options, "id"), options["at"] ?? (/* @__PURE__ */ new Date()).toISOString());
14186
+ yield* answer(options, { removed: report.removed });
14187
+ });
14188
+ const commentRestore = fn("Main.commentRestore")(function* (options) {
14189
+ const report = yield* restoreComment(yield* required(options, "repo"), yield* required(options, "branch"), yield* required(options, "id"));
14190
+ yield* answer(options, { restored: report.restored });
14191
+ });
14070
14192
  const commentStage = fn("Main.commentStage")(function* (options) {
14071
14193
  const report = yield* stageComment({
14072
14194
  repo: yield* required(options, "repo"),
@@ -14153,6 +14275,8 @@ const routes = {
14153
14275
  "comment answer": commentAnswer,
14154
14276
  "comment threads": commentThreads,
14155
14277
  "comment resolve": commentResolve,
14278
+ "comment remove": commentRemove,
14279
+ "comment restore": commentRestore,
14156
14280
  "review submit": reviewSubmit,
14157
14281
  "review pane": fn("Main.reviewPane")(function* (options) {
14158
14282
  const report = yield* openPane(yield* required(options, "repo"));
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.34",
26
+ "version": "0.1.0-alpha.35",
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": {