@eliya-oss/agent-diff 0.1.0-alpha.120 → 0.1.0-alpha.122

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,19 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.122
4
+
5
+ ### Patch Changes
6
+
7
+ - A file with no newline at the end says so. git reports it and adiff dropped the line, so the change to a file's last byte showed as two lines that read identically with nothing to tell them apart.
8
+
9
+ The lock around a review's state is patient enough for a loaded machine. Four writers arriving at once on a busy box could exhaust its retries and lose a write.
10
+
11
+ ## 0.1.0-alpha.121
12
+
13
+ ### Patch Changes
14
+
15
+ - Nothing about what adiff does changes. The test suite stopped repeating two setups 350 times, stopped reaching into functions no reviewer or agent can see, and stopped leaking `PATH` and a stub HTTP server between tests in the same worker. One existing test was writing to a store key nothing reads and passing anyway; it now derives the key from the store.
16
+
3
17
  ## 0.1.0-alpha.120
4
18
 
5
19
  ### Patch Changes
package/dist/main.js CHANGED
@@ -9159,7 +9159,7 @@ var init_paths = __esmMin((() => {
9159
9159
  }));
9160
9160
  //#endregion
9161
9161
  //#region src/service/store/service.ts
9162
- var Store, ensureDir, readOptional, missing$1, damaged, jsonOf$1, decoded, unwritable, wrote, added, INDENT, DRAFTS_VERSION, encoded, writes, appends, writeSettings, writeUpgradeCheck, writeState, writeLayers, writeDrafts, writeBatch, writeAnswer, asSettings, asUpgradeCheck, asBatch, asAnswer, asState, asLayers, asDrafts, linesOf, readLines, parseSettings, parseUpgradeCheck, parseState, parseLayers, cursorOps, settingsOps, upgradeOps, reportOps, HEAD_REF, gitDirOf, headOf$1, repoOf$2, keyOf$2, wasKeyOf, there, moved, adopt, SPLIT$1, ADOPT_SIZE, adopting, keyIn, answerOps, draftsOps, layersOps, inboxOps, LOCK_TRIES, LOCK_WAIT_MS, LOCK_STALE_MS, held$1, stale$1, stolen, taken, freed, stateOps, makeStore, madeStore, storeAt;
9162
+ var Store, ensureDir, readOptional, missing$1, damaged, jsonOf$1, decoded, unwritable, wrote, added, INDENT, DRAFTS_VERSION, encoded, writes, appends, writeSettings, writeUpgradeCheck, writeState, writeLayers, writeDrafts, writeBatch, writeAnswer, asSettings, asUpgradeCheck, asBatch, asAnswer, asState, asLayers, asDrafts, linesOf, readLines, parseSettings, parseUpgradeCheck, parseState, parseLayers, cursorOps, settingsOps, upgradeOps, reportOps, HEAD_REF, gitDirOf, headOf$1, repoOf$2, branchKeyOf, wasKeyOf, there, moved, adopt, SPLIT$1, ADOPT_SIZE, adopting, keyIn, answerOps, draftsOps, layersOps, inboxOps, LOCK_TRIES, LOCK_WAIT_MS, LOCK_STALE_MS, held$1, stale$1, stolen, taken, freed, stateOps, makeStore, madeStore, storeAt;
9163
9163
  var init_service$1 = __esmMin((() => {
9164
9164
  init_dist();
9165
9165
  init_error$2();
@@ -9321,7 +9321,7 @@ var init_service$1 = __esmMin((() => {
9321
9321
  return named?.[1] === void 0 ? raw.trim() : named[1];
9322
9322
  }).catch(() => "");
9323
9323
  repoOf$2 = (worktreePath) => gitDirOf(worktreePath).then((dir) => readFile(join(dir, "commondir"), "utf8").then((raw) => resolve(dir, raw.trim())).catch(() => dir));
9324
- keyOf$2 = (worktreePath) => map(all([promise(() => repoOf$2(worktreePath)), promise(() => headOf$1(worktreePath))], { concurrency: 2 }), ([repo, head]) => `${repo}#${head}`);
9324
+ branchKeyOf = (worktreePath) => map(all([promise(() => repoOf$2(worktreePath)), promise(() => headOf$1(worktreePath))], { concurrency: 2 }), ([repo, head]) => `${repo}#${head}`);
9325
9325
  wasKeyOf = (worktreePath) => promise(() => headOf$1(worktreePath).then((head) => `${worktreePath}#${head}`));
9326
9326
  there = (path) => stat(path).then(() => true, () => false);
9327
9327
  moved = (from, to) => rename(from, to).catch(() => void 0);
@@ -9340,7 +9340,7 @@ var init_service$1 = __esmMin((() => {
9340
9340
  if (key !== was) yield* adopt(root, key, was);
9341
9341
  return key;
9342
9342
  });
9343
- keyIn = (adopted, worktreePath) => flatMap(keyOf$2(worktreePath), (key) => get(adopted, `${key}${SPLIT$1}${worktreePath}`));
9343
+ keyIn = (adopted, worktreePath) => flatMap(branchKeyOf(worktreePath), (key) => get(adopted, `${key}${SPLIT$1}${worktreePath}`));
9344
9344
  answerOps = (root, adopted) => {
9345
9345
  return {
9346
9346
  answer: fn("Store.answer")(function* (worktreePath, entry) {
@@ -9417,9 +9417,9 @@ var init_service$1 = __esmMin((() => {
9417
9417
  })
9418
9418
  };
9419
9419
  };
9420
- LOCK_TRIES = 60;
9420
+ LOCK_TRIES = 240;
9421
9421
  LOCK_WAIT_MS = 25;
9422
- LOCK_STALE_MS = 5e3;
9422
+ LOCK_STALE_MS = 15e3;
9423
9423
  held$1 = (path) => tryPromise({
9424
9424
  try: () => writeFile(path, `${process.pid}`, { flag: "wx" }),
9425
9425
  catch: (cause) => new StoreUnwritable({
@@ -9552,12 +9552,14 @@ var init_anchor = __esmMin((() => {
9552
9552
  }));
9553
9553
  //#endregion
9554
9554
  //#region src/domain/patch/parse.ts
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;
9555
+ var FILE_MARKER, HUNK_MARKER, BINARY_MARKER, NO_NEWLINE_MARKER, NO_NEWLINE_SAID, BINARY_SAID, BLOB_MARKER, OLD_PATH_MARKER, NEW_PATH_MARKER, HUNK_HEADER, FILE_HEADER, SIGNS$1, draftFrom, openHunk, appendRow, appendMarker, 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
9560
  BINARY_MARKER = "Binary files ";
9561
+ NO_NEWLINE_MARKER = "\";
9562
+ NO_NEWLINE_SAID = "no newline at end of file";
9561
9563
  BINARY_SAID = "binary file, adiff cannot show what changed in it";
9562
9564
  BLOB_MARKER = "index ";
9563
9565
  OLD_PATH_MARKER = "--- ";
@@ -9613,7 +9615,22 @@ var init_parse$1 = __esmMin((() => {
9613
9615
  draft.rows.push(row);
9614
9616
  draft.hunks.at(-1)?.rows.push(row);
9615
9617
  };
9618
+ appendMarker = (draft, text) => {
9619
+ const row = {
9620
+ index: draft.rows.length,
9621
+ kind: "context",
9622
+ oldLine: none(),
9623
+ newLine: none(),
9624
+ text
9625
+ };
9626
+ draft.rows.push(row);
9627
+ draft.hunks.at(-1)?.rows.push(row);
9628
+ };
9616
9629
  readBody = (draft, line) => {
9630
+ if (line.startsWith(NO_NEWLINE_MARKER)) {
9631
+ appendMarker(draft, NO_NEWLINE_SAID);
9632
+ return;
9633
+ }
9617
9634
  const kind = SIGNS$1[line.slice(0, 1)];
9618
9635
  if (kind !== void 0) appendRow(draft, kind, line.slice(1));
9619
9636
  };
@@ -10912,7 +10929,7 @@ var init_pane = __esmMin((() => {
10912
10929
  init_drafts();
10913
10930
  init_init();
10914
10931
  init_pane();
10915
- var version$1 = "0.1.0-alpha.120";
10932
+ var version$1 = "0.1.0-alpha.122";
10916
10933
  //#endregion
10917
10934
  //#region src/cli/upgrade.ts
10918
10935
  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;
@@ -12923,7 +12940,7 @@ var init_tree = __esmMin((() => {
12923
12940
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
12924
12941
  };
12925
12942
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
12926
- })), nothingReviewed, 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, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip, TITLE_ROWS, titleRows, shortDir, fileRow$1, shownFiles, dirOf, fileRows, layerRead, layerDone, countRow, layerBody, layerRows, nearFirst, layerFitted, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, caretRow, caretColumn, caretOn, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, replyTarget, threadReplying, VOICES, threadQuote, pickedText, takenRows, selectedLines, shownMatches, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
12943
+ })), nothingReviewed, 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, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip, TITLE_ROWS, titleRows, shortDir, fileRow$1, shownFiles, dirOf, fileRows, layerRead, layerDone, countRow, layerBody, layerRows, nearFirst, layerFitted, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, replyTarget, threadReplying, VOICES, threadQuote, pickedText, takenRows, selectedLines, shownMatches, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
12927
12944
  var init_model = __esmMin((() => {
12928
12945
  init_dist();
12929
12946
  init_patch();
@@ -13269,17 +13286,6 @@ var init_model = __esmMin((() => {
13269
13286
  }
13270
13287
  return rows;
13271
13288
  };
13272
- caretRow = (rows, caret) => {
13273
- const at = rows.findIndex((row) => caret >= row.from && caret <= row.from + row.text.length);
13274
- return at === -1 ? Math.max(0, rows.length - 1) : at;
13275
- };
13276
- caretColumn = (rows, caret) => caret - (rows[caretRow(rows, caret)]?.from ?? 0);
13277
- caretOn = (rows, row, column) => {
13278
- const held = rows[Math.max(0, Math.min(rows.length - 1, row))];
13279
- if (held === void 0) return 0;
13280
- const last = held.text.endsWith(" ") ? held.text.length - 1 : held.text.length;
13281
- return held.from + Math.min(column, Math.max(0, last));
13282
- };
13283
13289
  COMPOSE_BOX = 72;
13284
13290
  COMPOSE_MARGIN = 4;
13285
13291
  COMPOSE_PAD = 5;
@@ -19027,18 +19033,12 @@ var tui_exports = /* @__PURE__ */ __exportAll({
19027
19033
  App: () => App,
19028
19034
  Screen: () => Screen,
19029
19035
  actionFor: () => actionFor,
19030
- caretColumn: () => caretColumn,
19031
- caretOn: () => caretOn,
19032
- caretRow: () => caretRow,
19033
19036
  commands: () => commands,
19034
19037
  commandsFor: () => commandsFor,
19035
19038
  hintsFor: () => hintsFor,
19036
19039
  initialState: () => initialState,
19037
- laidDraft: () => laidDraft,
19038
19040
  launch: () => launch,
19039
19041
  listableFor: () => listableFor,
19040
- noteKey: () => noteKey,
19041
- overReview: () => overReview,
19042
19042
  palette: () => palette,
19043
19043
  runOn: () => runOn,
19044
19044
  runTui: () => runTui,
@@ -19051,7 +19051,6 @@ var init_tui = __esmMin((() => {
19051
19051
  init_command();
19052
19052
  init_match();
19053
19053
  init_model();
19054
- init_diffview();
19055
19054
  init_render();
19056
19055
  init_reduce();
19057
19056
  init_theme();
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.120",
26
+ "version": "0.1.0-alpha.122",
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": {