@eliya-oss/agent-diff 0.1.0-alpha.80 → 0.1.0-alpha.81

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.81
4
+
5
+ ### Patch Changes
6
+
7
+ - Opening a branch asks git for its diff once rather than four times over, which takes about forty milliseconds off every branch opened or reopened.
8
+
3
9
  ## 0.1.0-alpha.80
4
10
 
5
11
  ### Patch Changes
package/dist/main.js CHANGED
@@ -9107,7 +9107,7 @@ var init_error$1 = __esmMin((() => {
9107
9107
  }));
9108
9108
  //#endregion
9109
9109
  //#region src/cli/commands.ts
9110
- var CONTEXT, WHOLE_FILE$1, POLL, AUTO, askedFor, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, rowsCovering, waitingOn, AT_ONCE, summaryOf, summaryFor, listBranches, blobOf, toggleVouch, reviewProgress, bodyOf, sentOf, listSent, submitComment, listPatches, flatten, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, fileBefore, saveWrap, saveSticky, setBase, clearBase, markRead;
9110
+ 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, sentOf, sentIn, listSent, submitComment, listPatches, flatten, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, fileBefore, saveWrap, saveSticky, setBase, clearBase, markRead;
9111
9111
  var init_commands = __esmMin((() => {
9112
9112
  init_dist();
9113
9113
  init_patch();
@@ -9271,19 +9271,26 @@ var init_commands = __esmMin((() => {
9271
9271
  total: patches.length
9272
9272
  };
9273
9273
  });
9274
- reviewProgress = fn("Cli.reviewProgress")(function* (repo, branch, base) {
9275
- const store = yield* Store;
9274
+ readingOf = fn("Cli.readingOf")(function* (repo, branch, base) {
9276
9275
  const worktree = yield* findBranch(repo, branch, base);
9277
- const patches = yield* patchesOf(worktree);
9278
- const current = yield* store.state(worktree.path);
9279
9276
  return {
9280
- vouched: patches.map((patch) => ({
9277
+ worktree,
9278
+ patches: yield* patchesOf(worktree)
9279
+ };
9280
+ });
9281
+ progressIn = fn("Cli.progressIn")(function* (reading) {
9282
+ const current = yield* (yield* Store).state(reading.worktree.path);
9283
+ return {
9284
+ vouched: reading.patches.map((patch) => ({
9281
9285
  path: patch.path,
9282
9286
  blob: patch.blob
9283
9287
  })).filter((file) => isVouched(current.vouches, file.path, file.blob)).map((f) => f.path),
9284
- total: patches.length
9288
+ total: reading.patches.length
9285
9289
  };
9286
9290
  });
9291
+ reviewProgress = fn("Cli.reviewProgress")(function* (repo, branch, base) {
9292
+ return yield* progressIn(yield* readingOf(repo, branch, base));
9293
+ });
9287
9294
  bodyOf = (entry) => entry.body;
9288
9295
  sentOf = (comment, reading) => {
9289
9296
  const { spoken, settled, head, shown, read } = reading;
@@ -9303,12 +9310,12 @@ var init_commands = __esmMin((() => {
9303
9310
  answers: mine.map(bodyOf)
9304
9311
  };
9305
9312
  };
9306
- listSent = fn("Cli.listSent")(function* (repo, branch, base) {
9313
+ sentIn = fn("Cli.sentIn")(function* (reading) {
9307
9314
  const store = yield* Store;
9308
- const worktree = yield* findBranch(repo, branch, base);
9315
+ const worktree = reading.worktree;
9309
9316
  const spoken = yield* store.answers(worktree.path);
9310
9317
  const current = yield* store.state(worktree.path);
9311
- const shown = new Set((yield* patchesOf(worktree)).map((patch) => patch.path));
9318
+ const shown = new Set(reading.patches.map((patch) => patch.path));
9312
9319
  return flatten(yield* store.inbox(worktree.path)).filter((comment) => !Object.hasOwn(current.removed, comment.id)).map((comment) => sentOf(comment, {
9313
9320
  spoken,
9314
9321
  settled: current.settled,
@@ -9317,6 +9324,9 @@ var init_commands = __esmMin((() => {
9317
9324
  read: current.read
9318
9325
  }));
9319
9326
  });
9327
+ listSent = fn("Cli.listSent")(function* (repo, branch, base) {
9328
+ return yield* sentIn(yield* readingOf(repo, branch, base));
9329
+ });
9320
9330
  submitComment = fn("Cli.submitComment")(function* (request) {
9321
9331
  const store = yield* Store;
9322
9332
  const worktree = yield* findBranch(request.repo, request.branch);
@@ -9723,7 +9733,7 @@ var init_pane = __esmMin((() => {
9723
9733
  init_commands();
9724
9734
  init_init();
9725
9735
  init_pane();
9726
- var version$1 = "0.1.0-alpha.80";
9736
+ var version$1 = "0.1.0-alpha.81";
9727
9737
  //#endregion
9728
9738
  //#region src/cli/upgrade.ts
9729
9739
  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;
@@ -10111,10 +10121,7 @@ var init_layers$1 = __esmMin((() => {
10111
10121
  init_coverage();
10112
10122
  init_version();
10113
10123
  init_model$1();
10114
- }));
10115
- //#endregion
10116
- //#region src/cli/layers.ts
10117
- var STALE_ADVICE, unique, spansOfLayer, isSpan, isBlock, codeBlockOf, blocksOf, layerOf, parsed, readLayers, fromStored, toStored, reportedLayers, reportOf, resolve$1, resolveAll, worktreeAt, storedLayers, setLayers, showLayers, listLayers;
10124
+ })), STALE_ADVICE, unique, spansOfLayer, isSpan, isBlock, codeBlockOf, blocksOf, layerOf, parsed, readLayers, fromStored, toStored, reportedLayers, reportOf, resolve$1, resolveAll, worktreeAt, storedLayers, setLayers, showLayers, layersIn;
10118
10125
  var init_layers = __esmMin((() => {
10119
10126
  init_dist();
10120
10127
  init_layers$1();
@@ -10275,20 +10282,22 @@ var init_layers = __esmMin((() => {
10275
10282
  });
10276
10283
  return reportOf(patches, layers, worktree.head);
10277
10284
  });
10278
- listLayers = fn("Cli.listLayers")(function* (repo, branch) {
10279
- const worktree = yield* findBranch(repo, branch);
10285
+ layersIn = fn("Cli.layersIn")(function* (reading) {
10286
+ const worktree = reading.worktree;
10280
10287
  const found = yield* storedLayers(worktree);
10281
10288
  if (isNone(found)) return {
10282
10289
  layers: [],
10283
10290
  stale: false
10284
10291
  };
10285
- const patches = yield* patchesOf(worktree);
10286
10292
  return {
10287
- layers: reportedLayers(patches, found.value),
10293
+ layers: reportedLayers(reading.patches, found.value),
10288
10294
  stale: found.value.head !== worktree.head,
10289
10295
  rebased: found.value.base !== worktree.base
10290
10296
  };
10291
10297
  });
10298
+ fn("Cli.listLayers")(function* (repo, branch) {
10299
+ return yield* layersIn(yield* readingOf(repo, branch));
10300
+ });
10292
10301
  }));
10293
10302
  //#endregion
10294
10303
  //#region src/cli/threads.ts
@@ -16158,13 +16167,13 @@ var init_app = __esmMin((() => {
16158
16167
  }
16159
16168
  readBranch(name) {
16160
16169
  return gen({ self: this }, function* () {
16161
- const [patches, progress, layers, sent] = yield* all([
16162
- listPatches(this.repo, name),
16163
- reviewProgress(this.repo, name),
16164
- listLayers(this.repo, name),
16165
- this.loadSent(name)
16170
+ const reading = yield* readingOf(this.repo, name);
16171
+ const [progress, layers, sent] = yield* all([
16172
+ progressIn(reading),
16173
+ layersIn(reading),
16174
+ sentIn(reading)
16166
16175
  ], { concurrency: "unbounded" });
16167
- const opened = withVouched(withPatches(this.state, patches), progress.vouched);
16176
+ const opened = withVouched(withPatches(this.state, reading.patches), progress.vouched);
16168
16177
  return withLayers(withSent(opened, sent), layers);
16169
16178
  });
16170
16179
  }
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.80",
26
+ "version": "0.1.0-alpha.81",
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": {