@eliya-oss/agent-diff 0.1.0-alpha.85 → 0.1.0-alpha.87

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,17 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.87
4
+
5
+ ### Patch Changes
6
+
7
+ - Marking a file reviewed no longer re-reads the whole branch from git, taking it from about 124ms to about 37ms on a branch of 131 files.
8
+
9
+ ## 0.1.0-alpha.86
10
+
11
+ ### Patch Changes
12
+
13
+ - Turning past the last file says "last file" instead of doing nothing, and the same at the first file going back.
14
+
3
15
  ## 0.1.0-alpha.85
4
16
 
5
17
  ### Patch Changes
package/dist/main.js CHANGED
@@ -9108,7 +9108,7 @@ var init_error$1 = __esmMin((() => {
9108
9108
  }));
9109
9109
  //#endregion
9110
9110
  //#region src/cli/commands.ts
9111
- var CONTEXT, WHOLE_FILE$1, POLL, AUTO, askedFor, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, rowsCovering, waitingOn, AT_ONCE, summaryOf, summaryFor, listBranches, blobOf, toggleVouch, readingOf, progressIn, reviewProgress, bodyOf, saidTo, spunOf, sentOf, sentIn, listSent, submitComment, without$1, submitReply, listPatches, flatten, threadBefore, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, fileBefore, saveWrap, saveSticky, setBase, clearBase, markRead;
9111
+ var CONTEXT, WHOLE_FILE$1, POLL, AUTO, askedFor, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, rowsCovering, waitingOn, AT_ONCE, summaryOf, summaryFor, listBranches, blobOf, vouchIn, toggleVouch, readingOf, progressIn, reviewProgress, bodyOf, saidTo, spunOf, sentOf, sentIn, listSent, submitComment, without$1, submitReply, listPatches, flatten, threadBefore, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, fileBefore, saveWrap, saveSticky, setBase, clearBase, markRead;
9112
9112
  var init_commands = __esmMin((() => {
9113
9113
  init_dist();
9114
9114
  init_patch();
@@ -9247,20 +9247,19 @@ var init_commands = __esmMin((() => {
9247
9247
  return (yield* forEach(worktrees, (found) => summaryOf(repo, found, base), { concurrency: AT_ONCE })).filter((summary) => summary.files > 0);
9248
9248
  });
9249
9249
  blobOf = (patches, file) => map$4(findPatch(patches, file), (patch) => patch.blob);
9250
- toggleVouch = fn("Cli.toggleVouch")(function* (request) {
9250
+ vouchIn = fn("Cli.vouchIn")(function* (reading, file) {
9251
9251
  const store = yield* Store;
9252
- const worktree = yield* findBranch(request.repo, request.branch);
9253
- const patches = yield* patchesOf(worktree);
9254
- const blob = yield* match$3(blobOf(patches, request.file), {
9252
+ const patches = reading.patches;
9253
+ const blob = yield* match$3(blobOf(patches, file), {
9255
9254
  onNone: () => new UnknownFile({
9256
- file: request.file,
9255
+ file,
9257
9256
  known: patches.map((patch) => patch.path)
9258
9257
  }),
9259
9258
  onSome: succeed$1
9260
9259
  });
9261
- const current = yield* store.state(worktree.path);
9262
- const next = vouch(current.vouches, request.file, blob);
9263
- yield* store.saveState(worktree.path, {
9260
+ const current = yield* store.state(reading.worktree.path);
9261
+ const next = vouch(current.vouches, file, blob);
9262
+ yield* store.saveState(reading.worktree.path, {
9264
9263
  ...current,
9265
9264
  vouches: next
9266
9265
  });
@@ -9268,10 +9267,13 @@ var init_commands = __esmMin((() => {
9268
9267
  vouched: patches.map((patch) => ({
9269
9268
  path: patch.path,
9270
9269
  blob: patch.blob
9271
- })).filter((file) => isVouched(next, file.path, file.blob)).map((file) => file.path),
9270
+ })).filter((one) => isVouched(next, one.path, one.blob)).map((one) => one.path),
9272
9271
  total: patches.length
9273
9272
  };
9274
9273
  });
9274
+ toggleVouch = fn("Cli.toggleVouch")(function* (request) {
9275
+ return yield* vouchIn(yield* readingOf(request.repo, request.branch), request.file);
9276
+ });
9275
9277
  readingOf = fn("Cli.readingOf")(function* (repo, branch, base) {
9276
9278
  const worktree = yield* findBranch(repo, branch, base);
9277
9279
  return {
@@ -9804,7 +9806,7 @@ var init_pane = __esmMin((() => {
9804
9806
  init_commands();
9805
9807
  init_init();
9806
9808
  init_pane();
9807
- var version$1 = "0.1.0-alpha.85";
9809
+ var version$1 = "0.1.0-alpha.87";
9808
9810
  //#endregion
9809
9811
  //#region src/cli/upgrade.ts
9810
9812
  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;
@@ -13144,15 +13146,20 @@ var init_reduce = __esmMin((() => {
13144
13146
  }, patchIndex);
13145
13147
  return state.closed.filter((path) => !wanted.includes(path));
13146
13148
  };
13147
- moveFile = (state, delta) => ({
13148
- ...state,
13149
- closed: revealing(state, layerFile(state, delta)),
13150
- patchIndex: layerFile(state, delta),
13151
- top: 0,
13152
- cursor: landingOn(state, layerFile(state, delta)),
13153
- anchorRow: 0,
13154
- selecting: false
13155
- });
13149
+ moveFile = (state, delta) => {
13150
+ const next = layerFile(state, delta);
13151
+ if (next === state.patchIndex) return withNoticeHere(state, delta > 0 ? "last file" : "first file");
13152
+ return {
13153
+ ...state,
13154
+ notice: "",
13155
+ closed: revealing(state, next),
13156
+ patchIndex: next,
13157
+ top: 0,
13158
+ cursor: landingOn(state, next),
13159
+ anchorRow: 0,
13160
+ selecting: false
13161
+ };
13162
+ };
13156
13163
  selectHunk = (state) => {
13157
13164
  const found = changeAround(state);
13158
13165
  if (found === void 0) return withNotice(state, "no change under the cursor");
@@ -15908,6 +15915,7 @@ var init_app = __esmMin((() => {
15908
15915
  intents;
15909
15916
  consuming;
15910
15917
  failure = "";
15918
+ reading;
15911
15919
  renderer;
15912
15920
  repo;
15913
15921
  noticeMs;
@@ -16349,6 +16357,7 @@ var init_app = __esmMin((() => {
16349
16357
  readBranch(name) {
16350
16358
  return gen({ self: this }, function* () {
16351
16359
  const reading = yield* readingOf(this.repo, name);
16360
+ this.reading = reading;
16352
16361
  const [progress, layers, sent] = yield* all([
16353
16362
  progressIn(reading),
16354
16363
  layersIn(reading),
@@ -16677,11 +16686,7 @@ var init_app = __esmMin((() => {
16677
16686
  const branch = selectedBranch(this.state);
16678
16687
  const patch = selectedPatch(this.state);
16679
16688
  if (branch === void 0 || patch === void 0) return;
16680
- const report = yield* toggleVouch({
16681
- repo: this.repo,
16682
- branch: branch.branch,
16683
- file: patch.path
16684
- });
16689
+ const report = yield* this.vouching(branch.branch, patch.path);
16685
16690
  const marked = report.vouched.includes(patch.path);
16686
16691
  const next = withVouched(this.state, report.vouched);
16687
16692
  if (!advance) {
@@ -16696,6 +16701,14 @@ var init_app = __esmMin((() => {
16696
16701
  this.commit(withNotice(atFile(next, target), `marked ${patch.path}`));
16697
16702
  });
16698
16703
  }
16704
+ vouching(branch, file) {
16705
+ const held = this.reading;
16706
+ return held === void 0 || held.worktree.branch !== branch ? toggleVouch({
16707
+ repo: this.repo,
16708
+ branch,
16709
+ file
16710
+ }) : vouchIn(held, file);
16711
+ }
16699
16712
  loadSent(branch) {
16700
16713
  return listSent(this.repo, branch);
16701
16714
  }
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.85",
26
+ "version": "0.1.0-alpha.87",
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": {