@eliya-oss/agent-diff 0.1.0-alpha.103 → 0.1.0-alpha.104

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.104
4
+
5
+ ### Patch Changes
6
+
7
+ - Looking for something shows the places as the words are typed, keeps a readable panel before there is anything to show, and never reads the clipboard.
8
+
3
9
  ## 0.1.0-alpha.103
4
10
 
5
11
  ### Minor Changes
package/dist/main.js CHANGED
@@ -3,7 +3,7 @@ import { appendFile, mkdir, readFile, realpath, rename, stat, writeFile } from "
3
3
  import { homedir, hostname, platform } from "node:os";
4
4
  import { text } from "node:stream/consumers";
5
5
  import { dirname, join, resolve } from "node:path";
6
- import { execFile, spawn, spawnSync } from "node:child_process";
6
+ import { execFile, spawn } from "node:child_process";
7
7
  import { promisify } from "node:util";
8
8
  import { existsSync, mkdirSync, readFileSync, realpathSync, watch } from "node:fs";
9
9
  import { fileURLToPath } from "node:url";
@@ -9926,7 +9926,7 @@ var init_pane = __esmMin((() => {
9926
9926
  init_commands();
9927
9927
  init_init();
9928
9928
  init_pane();
9929
- var version$1 = "0.1.0-alpha.103";
9929
+ var version$1 = "0.1.0-alpha.104";
9930
9930
  //#endregion
9931
9931
  //#region src/cli/upgrade.ts
9932
9932
  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;
@@ -14559,7 +14559,7 @@ var init_diffview = __esmMin((() => {
14559
14559
  }));
14560
14560
  //#endregion
14561
14561
  //#region src/tui/render.ts
14562
- var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, FRAME_PAD, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, SELECTION, CURSOR, ACCENT, GAP_PAINT, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking, makePaletteParts, makeChoices, LIST_LEAD, windowed, listText, stack, makeBody, makeHome, makeModals, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, clip, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, SUMMARY_LINES, summaryLines, contextLabel, nameRoom, stateRoom, columns, FORGE_SILENT, unaskedForge, branchHeading, atHome, layersCell, baseLabel, stateCell, branchCells, placeLabel, headerParts, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, STEP_NUMBER, STEP_LEAD, NOTE_LEAD, STEP_GAP, STALE_ROOM, STALE_LONG, STALE_SHORT, staleBanner, layerRoom, layerFold, layerHead, layerText, layerPaint, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, foundTitle, fileRow, blockOf, aroundRow, windowedBlocks, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelText, Screen;
14562
+ var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, FRAME_PAD, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, SELECTION, CURSOR, ACCENT, GAP_PAINT, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking, makePaletteParts, makeChoices, LIST_LEAD, windowed, listText, stack, makeBody, makeHome, makeModals, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, clip, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, SUMMARY_LINES, summaryLines, contextLabel, nameRoom, stateRoom, columns, FORGE_SILENT, unaskedForge, branchHeading, atHome, layersCell, baseLabel, stateCell, branchCells, placeLabel, headerParts, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, STEP_NUMBER, STEP_LEAD, NOTE_LEAD, STEP_GAP, STALE_ROOM, STALE_LONG, STALE_SHORT, staleBanner, layerRoom, layerFold, layerHead, layerText, layerPaint, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, foundTitle, fileRow, blockOf, aroundRow, windowedBlocks, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelText, Screen;
14563
14563
  var init_render = __esmMin((() => {
14564
14564
  init_command();
14565
14565
  init_patch();
@@ -14756,14 +14756,14 @@ var init_render = __esmMin((() => {
14756
14756
  box.width = PALETTE_WIDTH;
14757
14757
  return box;
14758
14758
  };
14759
- asking = (renderer, id) => new TextareaRenderable(renderer, {
14759
+ asking = (renderer, id, placeholder = "Type to filter…") => new TextareaRenderable(renderer, {
14760
14760
  id,
14761
14761
  height: ROW_HEIGHT,
14762
14762
  wrapMode: "none",
14763
14763
  flexShrink: 0,
14764
14764
  marginLeft: GUTTER_X,
14765
14765
  marginRight: GUTTER_X,
14766
- placeholder: "Type to filter…",
14766
+ placeholder,
14767
14767
  placeholderColor: palette.faint,
14768
14768
  backgroundColor: palette.panel,
14769
14769
  focusedBackgroundColor: palette.panel,
@@ -14844,7 +14844,7 @@ var init_render = __esmMin((() => {
14844
14844
  makeFoundParts = (renderer) => {
14845
14845
  const box = makePalette(renderer);
14846
14846
  const title = bar(renderer, "found-title", palette.faint);
14847
- const query = asking(renderer, "found-query");
14847
+ const query = asking(renderer, "found-query", "Type what to look for…");
14848
14848
  const peek = bar(renderer, "found-peek", palette.muted);
14849
14849
  const choices = makeChoices(renderer);
14850
14850
  box.id = "found";
@@ -15204,11 +15204,16 @@ var init_render = __esmMin((() => {
15204
15204
  PANEL_LEAD = 3;
15205
15205
  PANEL_EMPTY = "No comment on this branch yet.";
15206
15206
  restingOrHere = (focused) => focused ? palette.selection : palette.resting;
15207
+ FOUND_LEAST = 6;
15208
+ nothingYet = (state, room) => {
15209
+ const wanted = state.query.trim();
15210
+ if (wanted.length === 0 || state.term.length === 0) return "".padEnd(room);
15211
+ return clip(` nothing else uses ${wanted}`, room).padEnd(room);
15212
+ };
15207
15213
  foundTitle = (state) => {
15208
- const shown = shownMatches(state).length;
15209
15214
  const all = state.matches.length;
15210
- const said = shown === all ? `${all} elsewhere` : `${shown} of ${all} elsewhere`;
15211
- return `${state.term} · ${said}`;
15215
+ if (state.term.length === 0) return "Look for something";
15216
+ return `${state.term} · ${all === 1 ? "1 place" : `${all} places`} elsewhere`;
15212
15217
  };
15213
15218
  fileRow = (match, room) => {
15214
15219
  const said = ` ${match.changed ? marks().comment : " "} ${clipHead(match.path, Math.max(8, room - 3))}`;
@@ -15810,11 +15815,12 @@ var init_render = __esmMin((() => {
15810
15815
  if (at === state.matchIndex) chosen = blocks.length;
15811
15816
  blocks.push(blockOf(match, wide, at === state.matchIndex));
15812
15817
  }
15813
- const window = windowedBlocks(blocks, chosen, Math.max(3, most - PALETTE_CHROME));
15814
- this.foundChoices.content = new StyledText([...window.chunks]);
15818
+ const tall = Math.max(FOUND_LEAST, most - PALETTE_CHROME);
15819
+ const window = windowedBlocks(blocks, chosen, tall);
15820
+ this.foundChoices.content = blocks.length === 0 ? new StyledText([fg(palette.faint)(nothingYet(state, wide))]) : new StyledText([...window.chunks]);
15815
15821
  this.foundPeek.content = "";
15816
15822
  this.foundPeek.height = 0;
15817
- this.found.height = Math.min(most, window.rows + PALETTE_CHROME);
15823
+ this.found.height = Math.min(most, Math.max(FOUND_LEAST, window.rows) + PALETTE_CHROME);
15818
15824
  this.found.width = room;
15819
15825
  this.found.left = Math.max(FRAME_PAD, Math.floor((this.renderer.width - room) / 2));
15820
15826
  this.found.top = panelTop(this.renderer.height, PANEL_FIFTH);
@@ -16039,7 +16045,7 @@ var init_upgrade = __esmMin((() => {
16039
16045
  return due ? `adiff ${latest} is out · adiff upgrade` : "";
16040
16046
  }).pipe(withSpan("Tui.upgradeHint"));
16041
16047
  upgradeHint = worded.pipe(orElseSucceed(() => ""));
16042
- })), LEAVING_SAID, NOTICE_MS, KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, PASTERS, PASTE_MS, SEED_MOST, clipped, seedFor, handOver, throughMultiplexer, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, OVER, overReview, writesInto, listens, LETTER, laidOut, ARROWS, SHIFTED, keyName, App, turnedOver, settledPath, restsWhereItLanded, lonelyGaps, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
16048
+ })), LOOK_MS, LEAVING_SAID, NOTICE_MS, KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, seedFor, handOver, throughMultiplexer, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, OVER, overReview, writesInto, listens, LETTER, laidOut, ARROWS, SHIFTED, keyName, App, turnedOver, settledPath, restsWhereItLanded, lonelyGaps, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
16043
16049
  var init_app = __esmMin((() => {
16044
16050
  init_dist();
16045
16051
  init_report();
@@ -16057,6 +16063,7 @@ var init_app = __esmMin((() => {
16057
16063
  init_intent();
16058
16064
  init_session();
16059
16065
  init_upgrade();
16066
+ LOOK_MS = 220;
16060
16067
  LEAVING_SAID = "press ctrl+c again to leave";
16061
16068
  NOTICE_MS = 2200;
16062
16069
  KEY_HISTORY = 40;
@@ -16082,33 +16089,7 @@ var init_app = __esmMin((() => {
16082
16089
  win32: ["clip"]
16083
16090
  };
16084
16091
  wayland = () => process.env["WAYLAND_DISPLAY"] === void 0 ? void 0 : ["wl-copy"];
16085
- PASTERS = {
16086
- darwin: ["pbpaste"],
16087
- linux: [
16088
- "xclip",
16089
- "-selection",
16090
- "clipboard",
16091
- "-o"
16092
- ]
16093
- };
16094
- PASTE_MS = 300;
16095
- SEED_MOST = 120;
16096
- clipped = () => {
16097
- if (!process.stdout.isTTY) return "";
16098
- const [command, ...rest] = (process.env["WAYLAND_DISPLAY"] === void 0 ? PASTERS[platform()] : ["wl-paste"]) ?? [];
16099
- if (command === void 0) return "";
16100
- const read = spawnSync(command, [...rest], {
16101
- encoding: "utf8",
16102
- timeout: PASTE_MS
16103
- });
16104
- return read.status === 0 ? read.stdout ?? "" : "";
16105
- };
16106
- seedFor = (picked) => {
16107
- if (picked !== void 0 && picked.trim().length > 0) return picked.trim();
16108
- const held = clipped().trim();
16109
- const one = held.split("\n")[0] ?? "";
16110
- return one.length > 0 && one.length <= SEED_MOST && one === held ? one : "";
16111
- };
16092
+ seedFor = (picked) => picked?.trim() ?? "";
16112
16093
  handOver = (text) => {
16113
16094
  if (!process.stdout.isTTY) return;
16114
16095
  const named = wayland() ?? COPIERS[platform()];
@@ -16226,6 +16207,7 @@ var init_app = __esmMin((() => {
16226
16207
  chosen = {};
16227
16208
  selectingNow = false;
16228
16209
  leaving;
16210
+ looking;
16229
16211
  grewWithShift = false;
16230
16212
  keys = [];
16231
16213
  trail = [];
@@ -16263,6 +16245,7 @@ var init_app = __esmMin((() => {
16263
16245
  renderer.keyInput.on("keyrelease", (key) => this.letGo(key));
16264
16246
  renderer.on("destroy", () => this.stopWatching());
16265
16247
  renderer.on("destroy", () => this.stopFading());
16248
+ renderer.on("destroy", () => this.stopLooking());
16266
16249
  renderer.on("destroy", () => this.stopLighting());
16267
16250
  renderer.on("destroy", () => void getTreeSitterClient().destroy());
16268
16251
  renderer.on("destroy", () => this.stopPainting());
@@ -16636,6 +16619,7 @@ var init_app = __esmMin((() => {
16636
16619
  query: clean,
16637
16620
  paletteIndex: 0
16638
16621
  });
16622
+ if (this.state.screen === "search") this.lookSoon(clean);
16639
16623
  }
16640
16624
  readBack(text) {
16641
16625
  const clean = legible(stripAnsiSequences(text));
@@ -16732,10 +16716,28 @@ var init_app = __esmMin((() => {
16732
16716
  runSync(this.display.askWith(seed));
16733
16717
  });
16734
16718
  }
16719
+ lookSoon(wanted) {
16720
+ this.stopLooking();
16721
+ this.looking = setTimeout(() => {
16722
+ this.looking = void 0;
16723
+ const asked = wanted.trim();
16724
+ if (this.state.screen !== "search" || this.state.query.trim() !== asked) return;
16725
+ this.dispatchTask(asked.length === 0 ? this.forgetMatches() : this.lookFor(asked));
16726
+ }, LOOK_MS);
16727
+ }
16728
+ stopLooking() {
16729
+ if (this.looking === void 0) return;
16730
+ clearTimeout(this.looking);
16731
+ this.looking = void 0;
16732
+ }
16733
+ forgetMatches() {
16734
+ return sync(() => this.commit(withMatches(this.state, [], "")));
16735
+ }
16735
16736
  runFinder() {
16736
16737
  return gen({ self: this }, function* () {
16737
16738
  const wanted = this.state.query.trim();
16738
16739
  if (wanted.length > 0 && wanted !== this.state.term) {
16740
+ this.stopLooking();
16739
16741
  yield* this.lookFor(wanted);
16740
16742
  return;
16741
16743
  }
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.103",
26
+ "version": "0.1.0-alpha.104",
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": {