@eliya-oss/agent-diff 0.1.0-alpha.116 → 0.1.0-alpha.117

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.117
4
+
5
+ ### Patch Changes
6
+
7
+ - A binary file says it is binary instead of drawing an empty pane. git reports it as changed and adiff listed it in the file tree, but opening it showed a pane with nothing in it — indistinguishable from a rendering failure.
8
+
3
9
  ## 0.1.0-alpha.116
4
10
 
5
11
  ### Patch Changes
package/dist/main.js CHANGED
@@ -9552,11 +9552,13 @@ var init_anchor = __esmMin((() => {
9552
9552
  }));
9553
9553
  //#endregion
9554
9554
  //#region src/domain/patch/parse.ts
9555
- var FILE_MARKER, HUNK_MARKER, BLOB_MARKER, OLD_PATH_MARKER, NEW_PATH_MARKER, HUNK_HEADER, FILE_HEADER, SIGNS$1, draftFrom, openHunk, appendRow, readBody, readHeader, parsePatches;
9555
+ var FILE_MARKER, HUNK_MARKER, BINARY_MARKER, BINARY_SAID, BLOB_MARKER, OLD_PATH_MARKER, NEW_PATH_MARKER, HUNK_HEADER, FILE_HEADER, SIGNS$1, draftFrom, openHunk, appendRow, readBody, readBinary, readHeader, parsePatches;
9556
9556
  var init_parse$1 = __esmMin((() => {
9557
9557
  init_dist();
9558
9558
  FILE_MARKER = "diff --git ";
9559
9559
  HUNK_MARKER = "@@";
9560
+ BINARY_MARKER = "Binary files ";
9561
+ BINARY_SAID = "binary file, adiff cannot show what changed in it";
9560
9562
  BLOB_MARKER = "index ";
9561
9563
  OLD_PATH_MARKER = "--- ";
9562
9564
  NEW_PATH_MARKER = "+++ ";
@@ -9615,6 +9617,19 @@ var init_parse$1 = __esmMin((() => {
9615
9617
  const kind = SIGNS$1[line.slice(0, 1)];
9616
9618
  if (kind !== void 0) appendRow(draft, kind, line.slice(1));
9617
9619
  };
9620
+ readBinary = (draft, line) => {
9621
+ if (!line.startsWith(BINARY_MARKER)) return false;
9622
+ draft.hunks.push({
9623
+ marker: "",
9624
+ scope: "",
9625
+ startRow: 0,
9626
+ newStart: 1,
9627
+ rows: [],
9628
+ skipped: 0
9629
+ });
9630
+ appendRow(draft, "context", BINARY_SAID);
9631
+ return true;
9632
+ };
9618
9633
  readHeader = (draft, line) => {
9619
9634
  if (line.startsWith(BLOB_MARKER)) {
9620
9635
  draft.blob = line.slice(6).split("..")[1]?.split(" ")[0] ?? "";
@@ -9637,6 +9652,7 @@ var init_parse$1 = __esmMin((() => {
9637
9652
  const draft = drafts.at(-1);
9638
9653
  if (draft === void 0) continue;
9639
9654
  if (readHeader(draft, line)) continue;
9655
+ if (readBinary(draft, line)) continue;
9640
9656
  if (line.startsWith(HUNK_MARKER)) openHunk(draft, line);
9641
9657
  else readBody(draft, line);
9642
9658
  }
@@ -10896,7 +10912,7 @@ var init_pane = __esmMin((() => {
10896
10912
  init_drafts();
10897
10913
  init_init();
10898
10914
  init_pane();
10899
- var version$1 = "0.1.0-alpha.116";
10915
+ var version$1 = "0.1.0-alpha.117";
10900
10916
  //#endregion
10901
10917
  //#region src/cli/upgrade.ts
10902
10918
  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, ranChild, runUpgrade, statusOf$1, sayFound, sayDone, attempted, REFRESH_MS, refreshSkills, updatedIn, sayRefreshed, upgradeReport;
@@ -13897,8 +13913,8 @@ var init_command = __esmMin((() => {
13897
13913
  "look for",
13898
13914
  "where is"
13899
13915
  ],
13900
- category: "Selecting",
13901
- title: "Find the selection elsewhere",
13916
+ category: "Reading",
13917
+ title: "Search this branch",
13902
13918
  keys: ["/"],
13903
13919
  screens: ["review"]
13904
13920
  }),
@@ -13985,6 +14001,7 @@ var init_command = __esmMin((() => {
13985
14001
  command({
13986
14002
  action: "thread.settle",
13987
14003
  also: [
14004
+ "settle",
13988
14005
  "resolve",
13989
14006
  "close",
13990
14007
  "done",
@@ -14011,6 +14028,7 @@ var init_command = __esmMin((() => {
14011
14028
  command({
14012
14029
  action: "thread.reply",
14013
14030
  also: [
14031
+ "reply",
14014
14032
  "respond",
14015
14033
  "answer",
14016
14034
  "write back"
@@ -14027,6 +14045,7 @@ var init_command = __esmMin((() => {
14027
14045
  command({
14028
14046
  action: "thread.remove",
14029
14047
  also: [
14048
+ "remove",
14030
14049
  "delete",
14031
14050
  "withdraw",
14032
14051
  "retract",
@@ -14350,14 +14369,15 @@ var init_match = __esmMin((() => {
14350
14369
  matches = (entry, query) => query.toLowerCase().split(/\s+/).filter((word) => word.length > 0).every((word) => subsequence(label(entry), word));
14351
14370
  closeness = (entry, query) => {
14352
14371
  const wanted = query.trim().toLowerCase();
14353
- if (wanted.length === 0) return 2;
14372
+ if (wanted.length === 0) return 3;
14354
14373
  const title = entry.title.toLowerCase();
14355
14374
  if (title.startsWith(wanted)) return 0;
14356
- if (title.includes(wanted)) return 1;
14357
- return label(entry).includes(wanted) ? 2 : 3;
14375
+ if (entry.also.some((one) => one.toLowerCase() === wanted)) return 1;
14376
+ if (title.includes(wanted)) return 2;
14377
+ return label(entry).includes(wanted) ? 3 : 4;
14358
14378
  };
14359
14379
  searchCommands = (screen, query) => listableFor(screen).filter((entry) => matches(entry, query)).toSorted((left, right) => closeness(left, query) - closeness(right, query));
14360
- searchGlossary = (screen, query) => glossaryFor(screen).filter((entry) => matches(entry, query));
14380
+ searchGlossary = (screen, query) => glossaryFor(screen).filter((entry) => matches(entry, query)).toSorted((left, right) => closeness(left, query) - closeness(right, query));
14361
14381
  }));
14362
14382
  //#endregion
14363
14383
  //#region src/tui/reduce.ts
@@ -16553,8 +16573,8 @@ var init_render = __esmMin((() => {
16553
16573
  nameRoom = (pane, longest = pane) => Math.max(BRANCH_NAME_MIN, Math.min(longest, pane - BRANCH_FIXED - STATE_MIN));
16554
16574
  stateRoom = (pane, name) => Math.max(0, pane - name - BRANCH_FIXED);
16555
16575
  columns = (cells, room) => `${clip(cells.name, room).padEnd(room)}${cells.files.padStart(5)}${cells.added.padStart(8)}${cells.gone.padStart(8)} ${cells.layers.padStart(8)} ${cells.state}`;
16556
- FORGE_SILENT = " could not find out which of these have a pull request";
16557
- unaskedForge = (state) => state.forge === "silent" ? [fg(palette.faint)(`\n${FORGE_SILENT}`)] : [];
16576
+ FORGE_SILENT = " could not reach the forge, so no pull request is shown";
16577
+ unaskedForge = (state) => state.forge === "silent" ? [fg(palette.attention)(`\n${FORGE_SILENT}`)] : [];
16558
16578
  branchHeading = (room) => ` ${columns({
16559
16579
  name: "WORKTREE",
16560
16580
  files: "FILES",
@@ -17042,7 +17062,7 @@ var init_render = __esmMin((() => {
17042
17062
  const pane = this.homeRoom(state);
17043
17063
  const room = Math.max(HOME_PATH_MIN, pane - many.length - HOME_PATH_CHROME);
17044
17064
  this.landing.content = `${elide(shortPath(this.repo), room)} · ${many}`;
17045
- this.landingKeys.content = this.homeKeys(state);
17065
+ this.landingKeys.visible = false;
17046
17066
  this.diffPane.visible = state.screen !== "branches" && !atHome(state);
17047
17067
  this.paintPanel(state);
17048
17068
  this.paintPane(state);
@@ -17300,21 +17320,11 @@ var init_render = __esmMin((() => {
17300
17320
  });
17301
17321
  if (found === this.hovered) return;
17302
17322
  this.hovered = found;
17303
- this.landingKeys.content = this.chipRow();
17304
17323
  if (this.shown !== void 0) this.footer.content = this.footerText(this.shown);
17305
17324
  }
17306
17325
  homeRoom(state) {
17307
17326
  return homeWidth(this.renderer.width, longestName(state), longestState(state));
17308
17327
  }
17309
- homeKeys(state) {
17310
- const said = state.notice.length === 0 ? state.waiting : state.notice;
17311
- const tail = said.length === 0 ? "" : ` ${said}`;
17312
- const room = Math.max(0, this.homeRoom(state) - tail.length);
17313
- const chips = keptWithin(this.chipRow().chunks, room);
17314
- if (tail.length === 0) return new StyledText([...chips]);
17315
- const colour = state.notice.length === 0 ? palette.accent : palette.attention;
17316
- return new StyledText([...chips, fg(colour)(tail)]);
17317
- }
17318
17328
  chipRow() {
17319
17329
  return new StyledText(this.chips.flatMap((chip, index) => {
17320
17330
  const lit = index === this.hovered;
@@ -18365,9 +18375,15 @@ var init_app = __esmMin((() => {
18365
18375
  matches: [],
18366
18376
  term: ""
18367
18377
  }, at);
18368
- this.commit({
18378
+ const shown = selectedPatch(landed);
18379
+ const opened = shown !== void 0 && rowShowing(shown, match.line) !== void 0 ? landed : {
18369
18380
  ...landed,
18370
- cursor: rowAtSourceLine(patch, match.line)
18381
+ revealed: allRevealed(landed)
18382
+ };
18383
+ const found = selectedPatch(opened) ?? patch;
18384
+ this.commit({
18385
+ ...opened,
18386
+ cursor: rowAtSourceLine(found, match.line)
18371
18387
  });
18372
18388
  yield* this.loadSource();
18373
18389
  });
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.116",
26
+ "version": "0.1.0-alpha.117",
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": {