@eliya-oss/agent-diff 0.1.0-alpha.166 → 0.1.0-alpha.168

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/main.js +109 -13
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.168
4
+
5
+ ### Patch Changes
6
+
7
+ - feat(branches): `b` offers the last five commits as bases, each named by the message of the newest commit it takes in, so reading just what the agent last did is one keypress and a return.
8
+
9
+ ## 0.1.0-alpha.167
10
+
11
+ ### Patch Changes
12
+
13
+ - fix(review): A comment the hunks cannot place is matched against every line of the code it quoted, so a comment about a deleted doc comment is no longer hung on the next `*/` in the file.
14
+
15
+ - feat(cli): `adiff resume` opens the review left last in the repository it is run from, and `adiff resume --check` names that branch without opening anything.
16
+
3
17
  ## 0.1.0-alpha.166
4
18
 
5
19
  ### Patch Changes
package/dist/main.js CHANGED
@@ -9245,6 +9245,7 @@ var init_model$6 = __esmMin((() => {
9245
9245
  taken: {},
9246
9246
  vouches: {},
9247
9247
  parts: {},
9248
+ openedAt: "",
9248
9249
  consumed: 0,
9249
9250
  settled: {},
9250
9251
  removed: {},
@@ -9305,6 +9306,7 @@ var init_schema = __esmMin((() => {
9305
9306
  taken: optionalKey(Record(String$1, String$1)),
9306
9307
  vouches: Stamps.pipe(noStamps),
9307
9308
  parts: Stamps.pipe(noStamps),
9309
+ openedAt: String$1.pipe(withDecodingDefaultKey(succeed$1(""))),
9308
9310
  consumed: Int.pipe(withDecodingDefaultKey(succeed$1(0))),
9309
9311
  settled: Stamps.pipe(noStamps),
9310
9312
  removed: Stamps.pipe(noStamps),
@@ -10214,7 +10216,7 @@ var init_run = __esmMin((() => {
10214
10216
  gitOrEmpty = fn("Git.runOrEmpty")(function* (cwd, args) {
10215
10217
  return yield* git(cwd, args).pipe(catchTag("GitCommandFailed", () => succeed$1("")));
10216
10218
  });
10217
- })), CACHE_SIZE, NAME_TTL, FRESH_TTL, SPLIT, DEFAULT_BRANCH_CANDIDATES, PLAIN_PATHS, STAT, Git, parseStat, readEntries, findDefaultBranch, partsOf$2, findMergeBase, toWorktree, branchTips, findParent, splitLines, absent, readText, settled, seenAs, listWorktrees, readDiff, readStat, readSource, readBlob, readGrep, findRepo, REFS_MOST, readRefs, refResolves, sharedCommit, makeCaches, shapeWith, makeGit, GitLive;
10219
+ })), CACHE_SIZE, NAME_TTL, FRESH_TTL, SPLIT, DEFAULT_BRANCH_CANDIDATES, PLAIN_PATHS, STAT, Git, parseStat, readEntries, findDefaultBranch, partsOf$2, findMergeBase, toWorktree, branchTips, findParent, splitLines, absent, readText, settled, seenAs, listWorktrees, readDiff, readStat, readSource, readBlob, readGrep, findRepo, REFS_MOST, readCommits, readRefs, refResolves, sharedCommit, makeCaches, shapeWith, makeGit, GitLive;
10218
10220
  var init_service = __esmMin((() => {
10219
10221
  init_dist();
10220
10222
  init_error$1();
@@ -10390,6 +10392,18 @@ var init_service = __esmMin((() => {
10390
10392
  return trimmed.length === 0 ? resolve(worktree) : resolve(trimmed, "..");
10391
10393
  });
10392
10394
  REFS_MOST = 200;
10395
+ readCommits = fn("Git.commits")(function* (repo, branch, most) {
10396
+ return (yield* gitOrEmpty(repo, [
10397
+ "log",
10398
+ `--max-count=${most}`,
10399
+ "--format=%h%x09%s",
10400
+ branch,
10401
+ "--"
10402
+ ])).split("\n").map((line) => line.split(" ")).flatMap(([sha, subject]) => sha === void 0 || sha.trim().length === 0 ? [] : [{
10403
+ sha: sha.trim(),
10404
+ said: (subject ?? "").trim()
10405
+ }]);
10406
+ });
10393
10407
  readRefs = fn("Git.refs")(function* (repo) {
10394
10408
  return (yield* gitOrEmpty(repo, [
10395
10409
  "for-each-ref",
@@ -10444,6 +10458,7 @@ var init_service = __esmMin((() => {
10444
10458
  defaultBranch: (repo) => get(caches.baseName, repo),
10445
10459
  stackParent: (repo, branch) => get(caches.baseName, repo).pipe(flatMap((fallback) => get(caches.parent, `${repo}${SPLIT}${branch}${SPLIT}${fallback}`))),
10446
10460
  refs: readRefs,
10461
+ commits: (repo, branch, most) => readCommits(repo, branch, most),
10447
10462
  resolves: refResolves,
10448
10463
  sharedWith: sharedCommit
10449
10464
  });
@@ -10577,7 +10592,7 @@ var init_error = __esmMin((() => {
10577
10592
  }));
10578
10593
  //#endregion
10579
10594
  //#region src/cli/commands.ts
10580
- var realOf, CONTEXT, POLL, AUTO, askedFor$1, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, waitingOn, summaryOf, summaryFor, listBranches, readParts, blobOf, vouchIn, toggleVouch, readingOf, progressIn, reviewProgress, bodyOf, saidTo, spunOf, sentOf, whereItSitsNow$1, linesIn, lastLineOf, nearestLine, stillInFile, foundOutsideTheHunks, sentIn, listSent, anchorIn, commentsIn, commentIn, submitComment, submitComments, without$2, submitReply, listPatches, patchIn, flatten, threadBefore, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, fileBefore, readPreferences, readPreference, ON, OFF, preferenceValue, savePreference, listRefs, setBase, clearBase, markRead;
10595
+ var realOf, CONTEXT, POLL, AUTO, askedFor$1, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, waitingOn, summaryOf, summaryFor, listBranches, readParts, blobOf, vouchIn, toggleVouch, readingOf, markOpened, lastOpenedIn, progressIn, reviewProgress, bodyOf, saidTo, spunOf, sentOf, whereItSitsNow$1, linesIn, trimmedLines, NAMES_SOMETHING, worthMatching, blockAt, wholeSnippetIn, stillInFile, foundOutsideTheHunks, sentIn, listSent, anchorIn, commentsIn, commentIn, submitComment, submitComments, without$2, submitReply, listPatches, patchIn, flatten, threadBefore, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, fileBefore, readPreferences, readPreference, ON, OFF, preferenceValue, savePreference, listRefs, forOne, recentBases, setBase, clearBase, markRead;
10581
10596
  var init_commands = __esmMin((() => {
10582
10597
  init_dist();
10583
10598
  init_patch();
@@ -10758,6 +10773,21 @@ var init_commands = __esmMin((() => {
10758
10773
  patches: yield* patchesOf(worktree)
10759
10774
  };
10760
10775
  });
10776
+ markOpened = fn("Cli.markOpened")(function* (worktreePath, at) {
10777
+ yield* (yield* Store).changeState(worktreePath, (was) => ({
10778
+ ...was,
10779
+ openedAt: at
10780
+ }));
10781
+ });
10782
+ lastOpenedIn = fn("Cli.lastOpenedIn")(function* (repo) {
10783
+ const store = yield* Store;
10784
+ const trees = yield* (yield* Git).worktrees(repo);
10785
+ const openedOf = (tree) => map(store.state(tree.path), (held) => ({
10786
+ branch: tree.branch,
10787
+ at: held.openedAt
10788
+ }));
10789
+ return (yield* forEach(trees, openedOf)).filter((one) => one.at.length > 0).toSorted((left, right) => right.at.localeCompare(left.at))[0];
10790
+ });
10761
10791
  progressIn = fn("Cli.progressIn")(function* (reading) {
10762
10792
  const current = yield* (yield* Store).state(reading.worktree.path);
10763
10793
  const files = reading.patches.map((patch) => ({
@@ -10845,14 +10875,19 @@ var init_commands = __esmMin((() => {
10845
10875
  });
10846
10876
  };
10847
10877
  linesIn = (found) => getOrElse$1(found, () => []);
10848
- lastLineOf = (snippet) => snippet.split("\n").map((line) => line.trim()).findLast((line) => line.length > 0) ?? "";
10849
- nearestLine = (source, wanted, was) => {
10850
- const found = source.flatMap((line, at) => line.trim() === wanted ? [at + 1] : []);
10878
+ trimmedLines = (snippet) => snippet.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
10879
+ NAMES_SOMETHING = /[A-Za-z0-9_$]{3}/;
10880
+ worthMatching = (wanted) => wanted.length > 1 || wanted[0] !== void 0 && NAMES_SOMETHING.test(wanted[0]);
10881
+ blockAt = (source, wanted, at) => wanted.every((line, step) => (source[at + step] ?? "").trim() === line);
10882
+ wholeSnippetIn = (source, wanted, was) => {
10883
+ const found = source.flatMap((_, at) => blockAt(source, wanted, at) ? [at + wanted.length] : []);
10851
10884
  if (found.length === 0) return void 0;
10852
10885
  return found.reduce((best, line) => Math.abs(line - was) < Math.abs(best - was) ? line : best);
10853
10886
  };
10854
10887
  stillInFile = (comment, source) => {
10855
- const line = nearestLine(source, lastLineOf(comment.snippet), comment.end);
10888
+ const wanted = trimmedLines(comment.snippet);
10889
+ if (!worthMatching(wanted)) return comment;
10890
+ const line = wholeSnippetIn(source, wanted, comment.end);
10856
10891
  if (line === void 0) return comment;
10857
10892
  const span = Math.max(0, comment.end - comment.start);
10858
10893
  return {
@@ -11102,6 +11137,19 @@ var init_commands = __esmMin((() => {
11102
11137
  listRefs = fn("Cli.listRefs")(function* (repo) {
11103
11138
  return yield* (yield* Git).refs(repo);
11104
11139
  });
11140
+ forOne = (count) => count === 1 ? "the last commit" : `the last ${count} commits`;
11141
+ recentBases = fn("Cli.recentBases")(function* (repo, branch) {
11142
+ const found = yield* (yield* Git).commits(repo, branch, 6);
11143
+ return found.flatMap((commit, at) => {
11144
+ if (at === 0) return [];
11145
+ const oldest = found[at - 1]?.said ?? "";
11146
+ const said = at === 1 ? oldest : `back to ${oldest}`;
11147
+ return [{
11148
+ ref: commit.sha,
11149
+ said: `${forOne(at)} · ${said}`
11150
+ }];
11151
+ });
11152
+ });
11105
11153
  setBase = fn("Cli.setBase")(function* (repo, branch, base) {
11106
11154
  const store = yield* Store;
11107
11155
  const based = yield* baseFor(repo, branch, base);
@@ -11373,7 +11421,7 @@ var init_pane = __esmMin((() => {
11373
11421
  //#region package.json
11374
11422
  init_drafts();
11375
11423
  init_pane();
11376
- var version$1 = "0.1.0-alpha.166";
11424
+ var version$1 = "0.1.0-alpha.168";
11377
11425
  //#endregion
11378
11426
  //#region src/cli/upgrade.ts
11379
11427
  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$1, newer, tagIn, fetched, askLatest, here, findUpgrade, willUpgrade, ranChild, runUpgrade, statusOf$1, sayFound, sayDone, attempted, SAY_SKILL_TOO, upgradeReport;
@@ -12930,6 +12978,26 @@ var init_catalog = __esmMin((() => {
12930
12978
  dataKey: "upgrade",
12931
12979
  example: "adiff upgrade --check --json --fields route,latest,current"
12932
12980
  },
12981
+ {
12982
+ name: "resume",
12983
+ about: "Open the review you left last in this repository. Opens the terminal, like `review open`, on the branch it was opened on most recently",
12984
+ group: SET_UP,
12985
+ addresses: "none",
12986
+ safety: "read",
12987
+ options: [{
12988
+ name: "repo",
12989
+ required: false,
12990
+ value: "path",
12991
+ about: "The repository, defaulting to where you are"
12992
+ }, {
12993
+ name: "check",
12994
+ required: false,
12995
+ value: "flag",
12996
+ about: "Name the branch that would open, without opening anything. Always exits 0"
12997
+ }],
12998
+ dataKey: "resume",
12999
+ example: "adiff resume"
13000
+ },
12933
13001
  {
12934
13002
  name: "describe",
12935
13003
  about: "This catalog, as JSON",
@@ -14017,7 +14085,7 @@ var init_tree = __esmMin((() => {
14017
14085
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
14018
14086
  };
14019
14087
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
14020
- })), HOLDS, chosenNow, withChosen, preferenceRows, nothingReviewed, nothingFound, 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, restingAt, railTop, PANE_CHROME$1, layerRoomIn, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, partHere, layersHolding, readIn, treeStart, treeWindow, MINUTE, HOUR, DAY, sinceThen, 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, remarkAnswering, answerTarget, replyTarget, threadReplying, VOICES, remarkQuote, threadQuote, pickedText, takenRows, selectedLines, shownMatches, refsShown, picking, refHere, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, needingRowsIn, commentRowsIn, threadsAtRow, remarkShown, remarksAtRow, remarkRowsIn, stopsIn, stopsAtRow, remarkAtStop, remarkAtRow, remarkInPanel, remarkInDiff, remarkUnderCursor, remarkToTakeOn, remarkHere, threadHere, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, SECTION_OF, movedPast, sectionOf, sentEntry, remarkRows, panelHolds, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
14088
+ })), HOLDS, chosenNow, withChosen, preferenceRows, nothingReviewed, nothingFound, 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, restingAt, railTop, PANE_CHROME$1, layerRoomIn, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, partHere, layersHolding, readIn, treeStart, treeWindow, MINUTE, HOUR, DAY, sinceThen, 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, remarkAnswering, answerTarget, replyTarget, threadReplying, VOICES, remarkQuote, threadQuote, pickedText, takenRows, selectedLines, shownMatches, refSaidOf, refsShown, picking, refHere, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, needingRowsIn, commentRowsIn, threadsAtRow, remarkShown, remarksAtRow, remarkRowsIn, stopsIn, stopsAtRow, remarkAtStop, remarkAtRow, remarkInPanel, remarkInDiff, remarkUnderCursor, remarkToTakeOn, remarkHere, threadHere, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, SECTION_OF, movedPast, sectionOf, sentEntry, remarkRows, panelHolds, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
14021
14089
  var init_model$1 = __esmMin((() => {
14022
14090
  init_dist();
14023
14091
  init_patch();
@@ -14106,6 +14174,7 @@ var init_model$1 = __esmMin((() => {
14106
14174
  vouched: [],
14107
14175
  partsRead: [],
14108
14176
  openMoved: false,
14177
+ refSaid: {},
14109
14178
  sent: [],
14110
14179
  remarks: [],
14111
14180
  viewport: 20,
@@ -14592,9 +14661,10 @@ var init_model$1 = __esmMin((() => {
14592
14661
  if (wanted.length === 0) return state.matches;
14593
14662
  return state.matches.filter((match) => `${match.path}:${match.line} ${match.text}`.toLowerCase().includes(wanted));
14594
14663
  };
14664
+ refSaidOf = (state, ref) => state.refSaid[ref] ?? "";
14595
14665
  refsShown = (state) => {
14596
14666
  const wanted = state.query.trim().toLowerCase();
14597
- const held = state.refs.filter((ref) => ref.toLowerCase().includes(wanted));
14667
+ const held = state.refs.filter((ref) => `${ref} ${refSaidOf(state, ref)}`.toLowerCase().includes(wanted));
14598
14668
  return wanted.length === 0 || held.some((ref) => ref.toLowerCase() === wanted) ? held : held.concat([state.query.trim()]);
14599
14669
  };
14600
14670
  picking = (state) => state.screen === "base" || state.screen === "editor";
@@ -16607,7 +16677,10 @@ var init_reduce = __esmMin((() => {
16607
16677
  refIndex: 0,
16608
16678
  query: ""
16609
16679
  });
16610
- withRefs = (state, refs) => withChoices(state, refs, "base");
16680
+ withRefs = (state, refs, said = {}) => ({
16681
+ ...withChoices(state, refs, "base"),
16682
+ refSaid: said
16683
+ });
16611
16684
  movePalette = (state, delta) => ({
16612
16685
  ...state,
16613
16686
  paletteIndex: clamp(state.paletteIndex + delta, 0, Math.max(0, offered(state).length - 1))
@@ -19398,7 +19471,7 @@ var init_render = __esmMin((() => {
19398
19471
  this.baseBox.query.visible = true;
19399
19472
  const tall = Math.min(panelRows(this.renderer.height, PANEL_QUARTER), shown.length + PALETTE_CHROME + 1);
19400
19473
  const typed = state.query.trim();
19401
- this.baseBox.choices.content = listText(shown.map((ref) => clip(` ${ref}${pickedTail(state, ref, typed)}`, room - MODAL_ROOM)), Math.min(state.refIndex, Math.max(0, shown.length - 1)), Math.max(1, tall - PALETTE_CHROME - 1));
19474
+ this.baseBox.choices.content = listText(shown.map((ref) => clip(` ${ref}${refSaidOf(state, ref).length === 0 ? "" : ` ${refSaidOf(state, ref)}`}${pickedTail(state, ref, typed)}`, room - MODAL_ROOM)), Math.min(state.refIndex, Math.max(0, shown.length - 1)), Math.max(1, tall - PALETTE_CHROME - 1));
19402
19475
  this.baseBox.box.height = tall;
19403
19476
  this.baseBox.box.width = room;
19404
19477
  this.baseBox.box.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
@@ -20743,8 +20816,10 @@ var init_app = __esmMin((() => {
20743
20816
  return gen({ self: this }, function* () {
20744
20817
  const branch = selectedBranch(this.state);
20745
20818
  if (branch === void 0) return;
20746
- const refs = yield* listRefs(this.repo);
20747
- this.commit(withRefs(this.state, refs.filter((ref) => ref !== branch.branch)));
20819
+ const [refs, recent] = yield* all([listRefs(this.repo), recentBases(this.repo, branch.branch)]);
20820
+ const said = Object.fromEntries(recent.map((one) => [one.ref, one.said]));
20821
+ const kept = refs.filter((ref) => ref !== branch.branch);
20822
+ this.commit(withRefs(this.state, [...recent.map((one) => one.ref), ...kept], said));
20748
20823
  });
20749
20824
  }
20750
20825
  basedOnRef(ref) {
@@ -20811,6 +20886,7 @@ var init_app = __esmMin((() => {
20811
20886
  return gen({ self: this }, function* () {
20812
20887
  const reading = yield* readingOf(this.repo, name, this.base);
20813
20888
  this.reading = reading;
20889
+ yield* markOpened(reading.worktree.path, (/* @__PURE__ */ new Date()).toISOString());
20814
20890
  const [progress, layers, sent, remarks] = yield* all([
20815
20891
  progressIn(reading),
20816
20892
  layersIn(reading),
@@ -22279,11 +22355,31 @@ const addressOf = fn("Main.addressOf")(function* (name, options) {
22279
22355
  if (worktree !== void 0) return yield* byWorktree(options, worktree);
22280
22356
  return yield* new MissingOption({ option: addressing[0]?.name ?? "worktree" });
22281
22357
  });
22358
+ const RESUME_ADVICE = "Nothing has been opened here yet. Run `adiff review open --repo .` and pick a branch.";
22359
+ const resume = fn("Main.resume")(function* (options) {
22360
+ const repo = options["repo"] ?? process.cwd();
22361
+ const found = yield* lastOpenedIn(repo);
22362
+ if (options["check"] !== void 0) return yield* answer(options, {
22363
+ resume: found === void 0 ? {} : found,
22364
+ advice: found === void 0 ? RESUME_ADVICE : ""
22365
+ });
22366
+ if (found === void 0) {
22367
+ process.stderr.write(`${RESUME_ADVICE}\n`);
22368
+ return yield* sync(() => process.exit(3));
22369
+ }
22370
+ const { runTui } = yield* promise(() => Promise.resolve().then(() => (init_tui(), tui_exports)));
22371
+ return yield* runTui(repo, {
22372
+ sessionPath: process.env["ADIFF_SESSION"],
22373
+ branch: found.branch,
22374
+ base: options["base"]
22375
+ });
22376
+ });
22282
22377
  const dispatch = fn("Main.dispatch")(function* (name, given) {
22283
22378
  const options = yield* addressOf(name, given);
22284
22379
  const route = Object.hasOwn(routes, name) ? routes[name] : void 0;
22285
22380
  if (route !== void 0) return yield* route(options);
22286
22381
  if (name === "file review") return yield* fileReview(options);
22382
+ if (name === "resume") return yield* resume(options);
22287
22383
  if (name === "review open") {
22288
22384
  const { runTui } = yield* promise(() => Promise.resolve().then(() => (init_tui(), tui_exports)));
22289
22385
  return yield* runTui(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.166",
26
+ "version": "0.1.0-alpha.168",
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": {