@eliya-oss/agent-diff 0.1.0-alpha.160 → 0.1.0-alpha.161

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.161
4
+
5
+ ### Patch Changes
6
+
7
+ - fix(diff): `e` opens a line inside its project — an editor that takes a folder is handed the branch's worktree with the file, and every editor is started in that worktree — and a command you type yourself is offered back as the command to keep.
8
+
3
9
  ## 0.1.0-alpha.160
4
10
 
5
11
  ### Patch Changes
package/dist/main.js CHANGED
@@ -11328,7 +11328,7 @@ var init_pane = __esmMin((() => {
11328
11328
  //#region package.json
11329
11329
  init_drafts();
11330
11330
  init_pane();
11331
- var version$1 = "0.1.0-alpha.160";
11331
+ var version$1 = "0.1.0-alpha.161";
11332
11332
  //#endregion
11333
11333
  //#region src/cli/upgrade.ts
11334
11334
  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$1, newer, tagIn, fetched, askLatest, here, findUpgrade, willUpgrade, ranChild, runUpgrade, statusOf$1, sayFound, sayDone, attempted, SAY_SKILL_TOO, upgradeReport;
@@ -14908,18 +14908,19 @@ var init_report = __esmMin((() => {
14908
14908
  var KNOWN, LINED, named, shaped, guessed, KNOWN_EDITORS, editorsAround, templateFor, openingOf;
14909
14909
  var init_model = __esmMin((() => {
14910
14910
  KNOWN = [
14911
- ["vscode", "code --goto {file}:{line}"],
14912
- ["cursor", "cursor --goto {file}:{line}"],
14913
- ["windsurf", "windsurf --goto {file}:{line}"],
14914
- ["zed", "zed {file}:{line}"],
14911
+ ["vscode", "code {repo} --goto {file}:{line}"],
14912
+ ["cursor", "cursor {repo} --goto {file}:{line}"],
14913
+ ["windsurf", "windsurf {repo} --goto {file}:{line}"],
14914
+ ["zed", "zed {repo} {file}:{line}"],
14915
14915
  ["jetbrains", "idea --line {line} {file}"]
14916
14916
  ];
14917
14917
  LINED = [
14918
- ["code", "{command} --goto {file}:{line}"],
14919
- ["cursor", "{command} --goto {file}:{line}"],
14920
- ["zed", "{command} {file}:{line}"],
14918
+ ["code", "{command} {repo} --goto {file}:{line}"],
14919
+ ["cursor", "{command} {repo} --goto {file}:{line}"],
14920
+ ["windsurf", "{command} {repo} --goto {file}:{line}"],
14921
+ ["zed", "{command} {repo} {file}:{line}"],
14921
14922
  ["idea", "{command} --line {line} {file}"],
14922
- ["subl", "{command} {file}:{line}"],
14923
+ ["subl", "{command} {repo} {file}:{line}"],
14923
14924
  ["vim", "{command} +{line} {file}"],
14924
14925
  ["nvim", "{command} +{line} {file}"],
14925
14926
  ["hx", "{command} {file}:{line}"],
@@ -14954,8 +14955,8 @@ var init_model = __esmMin((() => {
14954
14955
  const asked = told.editor ?? told.visual ?? told.fallback;
14955
14956
  return asked === void 0 || asked.trim().length === 0 ? guessed(told) : shaped(asked);
14956
14957
  };
14957
- openingOf = (template, file, line) => {
14958
- const [command, ...args] = template.replaceAll("{file}", file).replaceAll("{line}", String(line)).trim().split(/\s+/);
14958
+ openingOf = (template, file, line, repo) => {
14959
+ const [command, ...args] = template.replaceAll("{repo}", repo).replaceAll("{file}", file).replaceAll("{line}", String(line)).trim().split(/\s+/);
14959
14960
  return command === void 0 ? void 0 : {
14960
14961
  command,
14961
14962
  args
@@ -17726,7 +17727,7 @@ var init_diffview = __esmMin((() => {
17726
17727
  }));
17727
17728
  //#endregion
17728
17729
  //#region src/tui/render.ts
17729
- var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, SENDS, REPLIES, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, LEGEND_ROWS, LEGEND, legendText, keysTitle, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, DIFF_FLOOR, COMPOSE_EDGE, CRAMPED, CRAMPED_ROWS, DIFF_CHROME_MOST, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, keysOf, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, PLAIN_PICKED, PICKED, PLAIN_CURSOR, UNDER_CURSOR, GAP_PAINT, frameRoot, crampedBar, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking, makePaletteParts, makeChoices, LIST_LEAD, windowed, listText, SHEET_GAP, sheetRow, groupedBy, sheetBlock, splitInTwo, sheetPaint, sheetDeep, sheetText, SETTING_LEAD, settingsText, stack, makeBody, makeHome, makeModals, makeBaseParts, makeSettingsParts, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, stillThere, quotedFor, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, remarksOf, notesFor, paired, chipWidth, WAYS_OUT, 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, panLabel, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, GUTTER, DIR_LEAD, TITLE_LEAD, FILE_LEAD, STALE_ROOM, STALE_ASKING, STALE_LONG, STALE_MIDDLE, STALE_SHORT, staleSaid, staleBanner, litRow, leftOver, titlePaint, titleMark, titleLook, fileMark, fileLook, layerLook, layerGutter, layerText, standingOnThread, standingOnRemark, standingOnDismissed, offeredIn, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, counting, foundBlocks, JOIN, foundTitle, CHANGED_MARK, DECLARED, fileRow, leftRow, placeRow, blockOf, aroundRow, windowedBlocks, pickingTitle, REMARK_MARK, remarkWhere, wherePart, panelFile, panelWhere, panelBody, panelMark, lostCode, lostEntry, writtenOn, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelText, Screen;
17730
+ var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, SENDS, REPLIES, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, LEGEND_ROWS, LEGEND, legendText, keysTitle, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, DIFF_FLOOR, COMPOSE_EDGE, CRAMPED, CRAMPED_ROWS, DIFF_CHROME_MOST, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, keysOf, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, PLAIN_PICKED, PICKED, PLAIN_CURSOR, UNDER_CURSOR, GAP_PAINT, frameRoot, crampedBar, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking, makePaletteParts, makeChoices, LIST_LEAD, windowed, listText, SHEET_GAP, sheetRow, groupedBy, sheetBlock, splitInTwo, sheetPaint, sheetDeep, sheetText, SETTING_LEAD, settingsText, stack, makeBody, makeHome, makeModals, makeBaseParts, makeSettingsParts, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, stillThere, quotedFor, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, remarksOf, notesFor, paired, chipWidth, WAYS_OUT, 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, panLabel, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, GUTTER, DIR_LEAD, TITLE_LEAD, FILE_LEAD, STALE_ROOM, STALE_ASKING, STALE_LONG, STALE_MIDDLE, STALE_SHORT, staleSaid, staleBanner, litRow, leftOver, titlePaint, titleMark, titleLook, fileMark, fileLook, layerLook, layerGutter, layerText, standingOnThread, standingOnRemark, standingOnDismissed, offeredIn, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, counting, foundBlocks, JOIN, foundTitle, CHANGED_MARK, DECLARED, fileRow, leftRow, placeRow, blockOf, aroundRow, windowedBlocks, pickingTitle, YOURS, YOUR_REF, pickedTail, REMARK_MARK, remarkWhere, wherePart, panelFile, panelWhere, panelBody, panelMark, lostCode, lostEntry, writtenOn, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelText, Screen;
17730
17731
  var init_render = __esmMin((() => {
17731
17732
  init_dist();
17732
17733
  init_command();
@@ -18765,6 +18766,12 @@ var init_render = __esmMin((() => {
18765
18766
  const on = here === void 0 ? "" : `${here.base}${here.basis === "set" ? "" : ", adiff's guess"}`;
18766
18767
  return `Base for ${here?.branch ?? "this branch"}${on.length === 0 ? "" : ` — now ${on}`}`;
18767
18768
  };
18769
+ YOURS = " ← the command you typed";
18770
+ YOUR_REF = " ← the ref you typed";
18771
+ pickedTail = (state, ref, typed) => {
18772
+ if (typed.length === 0 || ref !== typed || state.refs.includes(ref)) return "";
18773
+ return state.screen === "editor" ? YOURS : YOUR_REF;
18774
+ };
18768
18775
  REMARK_MARK = "◇";
18769
18776
  remarkWhere = (remark, known) => {
18770
18777
  if (remark.placed) return `:${remark.end}`;
@@ -19156,7 +19163,8 @@ var init_render = __esmMin((() => {
19156
19163
  this.baseBox.title.content = clip(pickingTitle(state), room - MODAL_ROOM);
19157
19164
  this.baseBox.query.visible = true;
19158
19165
  const tall = Math.min(panelRows(this.renderer.height, PANEL_QUARTER), shown.length + PALETTE_CHROME + 1);
19159
- this.baseBox.choices.content = listText(shown.map((ref) => clip(` ${ref}`, room - MODAL_ROOM)), Math.min(state.refIndex, Math.max(0, shown.length - 1)), Math.max(1, tall - PALETTE_CHROME - 1));
19166
+ const typed = state.query.trim();
19167
+ this.baseBox.choices.content = listText(shown.map((ref) => clip(` ${ref}${pickedTail(state, ref, typed)}`, room - MODAL_ROOM)), Math.min(state.refIndex, Math.max(0, shown.length - 1)), Math.max(1, tall - PALETTE_CHROME - 1));
19160
19168
  this.baseBox.box.height = tall;
19161
19169
  this.baseBox.box.width = room;
19162
19170
  this.baseBox.box.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
@@ -19806,11 +19814,12 @@ var init_app = __esmMin((() => {
19806
19814
  if (process.env["TMUX"] !== void 0) return `\u001BPtmux;\u001B${sequence}\u001B\\`;
19807
19815
  return process.env["STY"] === void 0 ? sequence : `\u001BP${sequence}\u001B\\`;
19808
19816
  };
19809
- ranAside = (command, args) => {
19817
+ ranAside = (command, args, from) => {
19810
19818
  try {
19811
19819
  const child = spawn(command, [...args], {
19812
19820
  detached: true,
19813
- stdio: "ignore"
19821
+ stdio: "ignore",
19822
+ cwd: from
19814
19823
  });
19815
19824
  child.on("error", () => void 0);
19816
19825
  child.unref();
@@ -21194,6 +21203,7 @@ var init_app = __esmMin((() => {
21194
21203
  return {
21195
21204
  file: resolve(held, patch.path),
21196
21205
  path: patch.path,
21206
+ root: held,
21197
21207
  line: sourceLineAt(this.state, this.state.cursor) ?? 1
21198
21208
  };
21199
21209
  }
@@ -21234,12 +21244,12 @@ var init_app = __esmMin((() => {
21234
21244
  const where = this.whereTheLineIs();
21235
21245
  if (where === void 0) return;
21236
21246
  const template = templateFor(yield* editorTold);
21237
- const opening = template === void 0 ? void 0 : openingOf(template, where.file, where.line);
21247
+ const opening = template === void 0 ? void 0 : openingOf(template, where.file, where.line, where.root);
21238
21248
  if (opening === void 0) {
21239
21249
  yield* this.chooseEditor();
21240
21250
  return;
21241
21251
  }
21242
- const said = ranAside(opening.command, opening.args) ? `${where.path}:${where.line} in ${opening.command}` : `${opening.command} would not start`;
21252
+ const said = ranAside(opening.command, opening.args, where.root) ? `${where.path}:${where.line} in ${opening.command}` : `${opening.command} would not start`;
21243
21253
  this.commit(withNoticeHere(this.state, said));
21244
21254
  });
21245
21255
  }
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.160",
26
+ "version": "0.1.0-alpha.161",
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": {