@eliya-oss/agent-diff 0.1.0-alpha.76 → 0.1.0-alpha.77

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.77
4
+
5
+ ### Patch Changes
6
+
7
+ - Copying reaches the clipboard inside tmux and screen, and on Linux and Windows rather than only on a Mac. The terminal is handed back if the review fails to open. The parser the diff is coloured by is shut down with the screen.
8
+
3
9
  ## 0.1.0-alpha.76
4
10
 
5
11
  ### Patch Changes
package/dist/main.js CHANGED
@@ -2565,7 +2565,7 @@ var CurrentStackFrame, TracerEnabled, TracerTimingEnabled, TracerSpanAnnotations
2565
2565
  };
2566
2566
  };
2567
2567
  spanCleaner = /*#__PURE__*/ makeStackCleaner(3);
2568
- })), Interrupt, causeInterrupt, findFail, findError$1, hasInterrupts, causeFilterInterruptors, causeCombine, causeMap, causePartition, causeSquash, causePrettyErrors, causePrettyError, causePrettyMessage, locationRegExp, cleanErrorStack, addStackAnnotations, interruptCauseStack, currentStackTrace, causePretty, renderPrettyError, renderErrorCause, FiberTypeId, fiberVariance, fiberIdStore, getCurrentFiber, FiberImpl, deferredInterruptCont, fiberMiddleware, fiberStackAnnotations, fiberAwait, fiberAwaitAll, fiberInterrupt, fiberInterruptAs, fiberInterruptAll, succeed$5, failCause$3, fail$2, sync$2, suspend$1, yieldNowWith, yieldNow, succeedNone$1, failCauseSync$1, die, failSync, void_$2, try_$1, promise$1, tryPromise$1, withFiberId, callbackOptions, asyncFinalizer, callback$2, never, gen$1, fnUntraced$1, defineFunctionLength, fnStackCleaner, fn$1, makeFn, fnUntracedEager$1, fromIteratorEagerUnsafe, fromIteratorUnsafe, as$1, asSome, andThen$1, tap$1, asVoid$1, raceAllFirst, raceFirst$1, flatMap$1, OnSuccessProto, effectIsExit, flatMapEager$1, map$2, mapEager$1, exitInterrupt$1, exitIsSuccess, exitFilterCause, exitVoid, exitMap, exitAsVoidAll, updateContext, updateService, contextWith$1, provideContext, provideService, provideServiceImpl, when$1, forever$1, catchCause$1, OnFailureProto, catchCauseFilter, catch_, catchIf, catchTag$1, mapError$1, orElseSucceed$1, ignore$1, option$2, matchCauseEffect, OnSuccessAndFailureProto, matchEffect, match, exit$1, exitPrimitive, ScopeTypeId, ScopeCloseableTypeId, scopeTag, scopeClose, scopeCloseUnsafe, scopeCloseFinalizers, scopeForkUnsafe, scopeAddFinalizerExit, scopeAddFinalizer, scopeAddFinalizerUnsafe, scopeRemoveFinalizerUnsafe, scopeMakeUnsafe, constScopeEmpty, scope, provideScope, scopedWith, acquireRelease$1, onExitPrimitive, onExit$1, onExitFilter, onError$1, onErrorFilter, onInterrupt$1, interrupt$2, uninterruptible$1, setInterruptible, setInterruptibleTrue, setInterruptibleFalse, setFiberInterruptible, interruptible, uninterruptibleMask, whileLoop$1, forEach$1, forEachSequential, iterateEagerImpl, iterateEager, forEachConcurrent, forkUnsafe$1, forkDetach$1, forkIn$1, runForkWith, runFork$1, runPromiseExitWith, runPromiseWith, runPromise$1, runSyncExitWith, runSyncExit$1, runSyncWith, runSync$1, succeedTrue, succeedFalse, Latch, makeLatchUnsafe, bigint0, NoopSpanProto, noopSpan, filterDisablePropagation, makeSpanUnsafe, provideSpanStackFrame, endSpan, useSpan, provideParentSpan, withParentSpan, withSpan$1, ClockRef, MAX_TIMER_MILLIS, ClockImpl, nanosPerMilli, monotonicNowNanos, wallTimeNanos, clockWith, sleep$1, AsyncFiberErrorTypeId, AsyncFiberError, UnknownErrorTypeId, UnknownError, ConsoleRef, logLevelToOrder, LogLevelOrder, isLogLevelGreaterThan, CurrentLoggers, LogToStderr, LoggerTypeId, LoggerProto, loggerMake, formatLabel, formatLogSpan, logWithLevel, colors, defaultDateFormat, defaultLogger, tracerLogger, init_effect = __esmMin((() => {
2568
+ })), Interrupt, causeInterrupt, findFail, findError$1, hasInterrupts, causeFilterInterruptors, causeCombine, causeMap, causePartition, causeSquash, causePrettyErrors, causePrettyError, causePrettyMessage, locationRegExp, cleanErrorStack, addStackAnnotations, interruptCauseStack, currentStackTrace, causePretty, renderPrettyError, renderErrorCause, FiberTypeId, fiberVariance, fiberIdStore, getCurrentFiber, FiberImpl, deferredInterruptCont, fiberMiddleware, fiberStackAnnotations, fiberAwait, fiberAwaitAll, fiberInterrupt, fiberInterruptAs, fiberInterruptAll, succeed$5, failCause$3, fail$2, sync$2, suspend$1, yieldNowWith, yieldNow, succeedNone$1, failCauseSync$1, die, failSync, void_$2, try_$1, promise$1, tryPromise$1, withFiberId, callbackOptions, asyncFinalizer, callback$2, never, gen$1, fnUntraced$1, defineFunctionLength, fnStackCleaner, fn$1, makeFn, fnUntracedEager$1, fromIteratorEagerUnsafe, fromIteratorUnsafe, as$1, asSome, andThen$1, tap$1, asVoid$1, raceAllFirst, raceFirst$1, flatMap$1, OnSuccessProto, effectIsExit, flatMapEager$1, map$2, mapEager$1, exitInterrupt$1, exitIsSuccess, exitFilterCause, exitVoid, exitMap, exitAsVoidAll, updateContext, updateService, contextWith$1, provideContext, provideService, provideServiceImpl, when$1, forever$1, catchCause$1, OnFailureProto, catchCauseFilter, catch_, catchIf, catchTag$1, mapError$1, orElseSucceed$1, ignore$1, option$2, matchCauseEffect, OnSuccessAndFailureProto, matchEffect, match, exit$1, exitPrimitive, ScopeTypeId, ScopeCloseableTypeId, scopeTag, scopeClose, scopeCloseUnsafe, scopeCloseFinalizers, scopeForkUnsafe, scopeAddFinalizerExit, scopeAddFinalizer, scopeAddFinalizerUnsafe, scopeRemoveFinalizerUnsafe, scopeMakeUnsafe, constScopeEmpty, scope, provideScope, scopedWith, acquireRelease$1, onExitPrimitive, onExit$1, ensuring$1, onExitFilter, onError$1, onErrorFilter, onInterrupt$1, interrupt$2, uninterruptible$1, setInterruptible, setInterruptibleTrue, setInterruptibleFalse, setFiberInterruptible, interruptible, uninterruptibleMask, whileLoop$1, forEach$1, forEachSequential, iterateEagerImpl, iterateEager, forEachConcurrent, forkUnsafe$1, forkDetach$1, forkIn$1, runForkWith, runFork$1, runPromiseExitWith, runPromiseWith, runPromise$1, runSyncExitWith, runSyncExit$1, runSyncWith, runSync$1, succeedTrue, succeedFalse, Latch, makeLatchUnsafe, bigint0, NoopSpanProto, noopSpan, filterDisablePropagation, makeSpanUnsafe, provideSpanStackFrame, endSpan, useSpan, provideParentSpan, withParentSpan, withSpan$1, ClockRef, MAX_TIMER_MILLIS, ClockImpl, nanosPerMilli, monotonicNowNanos, wallTimeNanos, clockWith, sleep$1, AsyncFiberErrorTypeId, AsyncFiberError, UnknownErrorTypeId, UnknownError, ConsoleRef, logLevelToOrder, LogLevelOrder, isLogLevelGreaterThan, CurrentLoggers, LogToStderr, LoggerTypeId, LoggerProto, loggerMake, formatLabel, formatLogSpan, logWithLevel, colors, defaultDateFormat, defaultLogger, tracerLogger, init_effect = __esmMin((() => {
2569
2569
  init_Array();
2570
2570
  init_Context();
2571
2571
  init_Duration();
@@ -3517,6 +3517,7 @@ var CurrentStackFrame, TracerEnabled, TracerTimingEnabled, TracerSpanAnnotations
3517
3517
  }
3518
3518
  });
3519
3519
  onExit$1 = /*#__PURE__*/ dual(2, onExitPrimitive);
3520
+ ensuring$1 = /*#__PURE__*/ dual(2, (self, finalizer) => onExit$1(self, (_) => finalizer));
3520
3521
  onExitFilter = /*#__PURE__*/ dual(3, (self, filter, f) => onExit$1(self, (exit) => {
3521
3522
  const b = filter(exit);
3522
3523
  return isFailure(b) ? void_$2 : f(b.success, exit);
@@ -4414,7 +4415,7 @@ var init_Pull = __esmMin((() => {
4414
4415
  init_effect();
4415
4416
  provideLayer = (self, layer, options) => scopedWith((scope) => flatMap$1(options?.local ? buildWithMemoMap(layer, makeMemoMapUnsafe(), scope) : buildWithScope(layer, scope), (context) => provideContext(self, context)));
4416
4417
  provide$1 = /*#__PURE__*/ dual((args) => isEffect(args[0]), (self, source, options) => isContext(source) ? provideContext(self, source) : provideLayer(self, Array.isArray(source) ? mergeAll(...source) : source, options));
4417
- })), forEach, whileLoop, promise, tryPromise, succeed$1, suspend, sync, void_, callback$1, gen, fail, failCause, failCauseSync, try_, withFiber, flatMap, andThen, tap, option$1, exit, map, as, asVoid, catchTag, catchCause, mapError, ignore, orElseSucceed, sleep, raceFirst, when, contextWith, provide, acquireRelease, onError, onExit, interrupt$1, onInterrupt, uninterruptible, forever, withSpan, forkIn, forkDetach, runFork, runPromise, runSync, runSyncExit, fnUntraced, fn, mapEager, flatMapEager, fnUntracedEager;
4418
+ })), forEach, whileLoop, promise, tryPromise, succeed$1, suspend, sync, void_, callback$1, gen, fail, failCause, failCauseSync, try_, withFiber, flatMap, andThen, tap, option$1, exit, map, as, asVoid, catchTag, catchCause, mapError, ignore, orElseSucceed, sleep, raceFirst, when, contextWith, provide, acquireRelease, ensuring, onError, onExit, interrupt$1, onInterrupt, uninterruptible, forever, withSpan, forkIn, forkDetach, runFork, runPromise, runSync, runSyncExit, fnUntraced, fn, mapEager, flatMapEager, fnUntracedEager;
4418
4419
  var init_Effect = __esmMin((() => {
4419
4420
  init_Context();
4420
4421
  init_core();
@@ -4454,6 +4455,7 @@ var init_Effect = __esmMin((() => {
4454
4455
  contextWith = contextWith$1;
4455
4456
  provide = provide$1;
4456
4457
  acquireRelease = acquireRelease$1;
4458
+ ensuring = ensuring$1;
4457
4459
  onError = onError$1;
4458
4460
  onExit = onExit$1;
4459
4461
  interrupt$1 = interrupt$2;
@@ -9661,7 +9663,7 @@ var init_pane = __esmMin((() => {
9661
9663
  init_commands();
9662
9664
  init_init();
9663
9665
  init_pane();
9664
- var version$1 = "0.1.0-alpha.76";
9666
+ var version$1 = "0.1.0-alpha.77";
9665
9667
  //#endregion
9666
9668
  //#region src/cli/upgrade.ts
9667
9669
  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;
@@ -11429,7 +11431,6 @@ var init_model = __esmMin((() => {
11429
11431
  anchorRow: 0,
11430
11432
  selecting: false,
11431
11433
  draft: "",
11432
- caret: 0,
11433
11434
  notice: "",
11434
11435
  waiting: "",
11435
11436
  query: "",
@@ -12950,7 +12951,6 @@ var init_reduce = __esmMin((() => {
12950
12951
  ...state,
12951
12952
  screen: "compose",
12952
12953
  draft: "",
12953
- caret: 0,
12954
12954
  anchorRow: state.selecting ? state.anchorRow : state.cursor
12955
12955
  };
12956
12956
  };
@@ -12964,8 +12964,7 @@ var init_reduce = __esmMin((() => {
12964
12964
  if (state.screen === "report") return {
12965
12965
  ...state,
12966
12966
  screen: state.returnTo,
12967
- draft: "",
12968
- caret: 0
12967
+ draft: ""
12969
12968
  };
12970
12969
  if (state.screen === "palette") return {
12971
12970
  ...state,
@@ -12980,8 +12979,7 @@ var init_reduce = __esmMin((() => {
12980
12979
  if (state.screen === "compose") return {
12981
12980
  ...state,
12982
12981
  screen: "review",
12983
- draft: "",
12984
- caret: 0
12982
+ draft: ""
12985
12983
  };
12986
12984
  if (state.selecting) return {
12987
12985
  ...state,
@@ -13103,7 +13101,6 @@ var init_reduce = __esmMin((() => {
13103
13101
  ...state,
13104
13102
  screen: "report",
13105
13103
  draft: "",
13106
- caret: 0,
13107
13104
  returnTo: state.screen
13108
13105
  }),
13109
13106
  "report.send": (state) => state,
@@ -13289,8 +13286,7 @@ var init_reduce = __esmMin((() => {
13289
13286
  legible = (text) => Array.from(text.replace(/\r\n?/g, "\n").replace(/\t/g, " ".repeat(TAB_WIDTH))).filter(readable).join("");
13290
13287
  withDraft = (state, draft) => ({
13291
13288
  ...state,
13292
- draft,
13293
- caret: draft.length
13289
+ draft
13294
13290
  });
13295
13291
  paletteMoved = (state, delta) => movePalette(state, delta);
13296
13292
  paletteClosed = (state) => ({
@@ -13318,7 +13314,6 @@ var init_reduce = __esmMin((() => {
13318
13314
  ...state,
13319
13315
  screen: "review",
13320
13316
  draft: "",
13321
- caret: 0,
13322
13317
  selecting: false,
13323
13318
  notice
13324
13319
  });
@@ -15518,7 +15513,7 @@ var init_upgrade = __esmMin((() => {
15518
15513
  return due ? `adiff ${latest} is out · adiff upgrade` : "";
15519
15514
  }).pipe(withSpan("Tui.upgradeHint"));
15520
15515
  upgradeHint = worded.pipe(orElseSucceed(() => ""));
15521
- })), KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, handOver, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, writesInto, listens, laidOut, ARROWS, keyName, App, turnedOver, settledPath, openingOn, launch, told, untilDestroyed, runOn, runTui;
15516
+ })), KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, handOver, throughMultiplexer, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, writesInto, listens, laidOut, ARROWS, keyName, App, turnedOver, settledPath, openingOn, launch, told, untilDestroyed, runOn, runTui;
15522
15517
  var init_app = __esmMin((() => {
15523
15518
  init_dist();
15524
15519
  init_report();
@@ -15548,9 +15543,23 @@ var init_app = __esmMin((() => {
15548
15543
  return `${clockOf(elapsed)} ${named.padEnd(16)} ${place.padEnd(16)} row ${String(state.cursor + 1).padStart(5)} ${file}`;
15549
15544
  };
15550
15545
  noticeOf = (notice, elapsed) => `${clockOf(elapsed)} ${"said".padEnd(16)} ${notice}`;
15546
+ COPIERS = {
15547
+ darwin: ["pbcopy"],
15548
+ linux: [
15549
+ "xclip",
15550
+ "-selection",
15551
+ "clipboard"
15552
+ ],
15553
+ win32: ["clip"]
15554
+ };
15555
+ wayland = () => process.env["WAYLAND_DISPLAY"] === void 0 ? void 0 : ["wl-copy"];
15551
15556
  handOver = (text) => {
15552
- if (platform() !== "darwin" || !process.stdout.isTTY) return;
15553
- const pipe = spawn("pbcopy", { stdio: [
15557
+ if (!process.stdout.isTTY) return;
15558
+ const named = wayland() ?? COPIERS[platform()];
15559
+ if (named === void 0) return;
15560
+ const [command, ...rest] = named;
15561
+ if (command === void 0) return;
15562
+ const pipe = spawn(command, [...rest], { stdio: [
15554
15563
  "pipe",
15555
15564
  "ignore",
15556
15565
  "ignore"
@@ -15559,9 +15568,13 @@ var init_app = __esmMin((() => {
15559
15568
  pipe.stdin.on("error", () => void 0);
15560
15569
  pipe.stdin.end(text);
15561
15570
  };
15571
+ throughMultiplexer = (sequence) => {
15572
+ if (process.env["TMUX"] !== void 0) return `\u001BPtmux;\u001B${sequence}\u001B\\`;
15573
+ return process.env["STY"] === void 0 ? sequence : `\u001BP${sequence}\u001B\\`;
15574
+ };
15562
15575
  copyToClipboard = (text) => {
15563
15576
  const encoded = Buffer.from(text, "utf8").toString("base64");
15564
- process.stdout.write(`\u001B]52;c;${encoded}\u0007`);
15577
+ process.stdout.write(throughMultiplexer(`\u001B]52;c;${encoded}\u0007`));
15565
15578
  handOver(text);
15566
15579
  };
15567
15580
  lineUnder = (state) => {
@@ -15651,6 +15664,7 @@ var init_app = __esmMin((() => {
15651
15664
  renderer.on("destroy", () => this.stopWatching());
15652
15665
  renderer.on("destroy", () => this.stopFading());
15653
15666
  renderer.on("destroy", () => this.stopLighting());
15667
+ renderer.on("destroy", () => void getTreeSitterClient().destroy());
15654
15668
  renderer.on("destroy", () => this.stopPainting());
15655
15669
  renderer.on("destroy", () => this.stopConsuming());
15656
15670
  renderer.on("frame", () => this.syncGeometry());
@@ -16445,8 +16459,7 @@ var init_app = __esmMin((() => {
16445
16459
  const closed = {
16446
16460
  ...this.state,
16447
16461
  screen: this.state.returnTo,
16448
- draft: "",
16449
- caret: 0
16462
+ draft: ""
16450
16463
  };
16451
16464
  this.commit(withNotice(closed, `report copied — ${path}`));
16452
16465
  });
@@ -16469,7 +16482,7 @@ var init_app = __esmMin((() => {
16469
16482
  side: anchor.value.side,
16470
16483
  start: anchor.value.start,
16471
16484
  end: anchor.value.end,
16472
- body: this.state.draft,
16485
+ body: yield* this.display.written,
16473
16486
  id: randomUUID(),
16474
16487
  at: (/* @__PURE__ */ new Date()).toISOString()
16475
16488
  });
@@ -16551,7 +16564,7 @@ var init_app = __esmMin((() => {
16551
16564
  exitOnCtrlC: true,
16552
16565
  useKittyKeyboard: { events: true }
16553
16566
  }));
16554
- yield* runOn(repo, renderer, sessionPath, branch);
16567
+ yield* ensuring(runOn(repo, renderer, sessionPath, branch), sync(() => renderer.destroy()));
16555
16568
  });
16556
16569
  }));
16557
16570
  //#endregion
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.76",
26
+ "version": "0.1.0-alpha.77",
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": {