@eliya-oss/agent-diff 0.1.0-alpha.192 → 0.1.0-alpha.193
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 +8 -0
- package/dist/main.js +306 -30
- package/package.json +1 -1
- package/skills/adiff/SKILL.md +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @eliya-oss/agent-diff
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.193
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat(CLI): `review progress` names, for each file changed since it was marked reviewed, when it was marked and how many lines changed since, and `patch since` prints that file's diff from the marked version.
|
|
8
|
+
|
|
9
|
+
feat(CLI): `file review --blob` marks the version of a file a client drew, and each file in `patch show` carries its `blob`.
|
|
10
|
+
|
|
3
11
|
## 0.1.0-alpha.192
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/main.js
CHANGED
|
@@ -1743,7 +1743,7 @@ var init_Order = __esmMin((() => {
|
|
|
1743
1743
|
}));
|
|
1744
1744
|
//#endregion
|
|
1745
1745
|
//#region node_modules/.pnpm/effect@4.0.0-rc.110/node_modules/effect/dist/Option.js
|
|
1746
|
-
var none, some, isNone, isSome, match$3, getOrElse, orElse, fromNullishOr, getOrUndefined$1, liftThrowable, map$5, flatMap$2, filter$
|
|
1746
|
+
var none, some, isNone, isSome, match$3, getOrElse, orElse, fromNullishOr, getOrUndefined$1, liftThrowable, map$5, flatMap$2, toArray, filter$3;
|
|
1747
1747
|
var init_Option = __esmMin((() => {
|
|
1748
1748
|
init_Function();
|
|
1749
1749
|
init_option();
|
|
@@ -1765,7 +1765,8 @@ var init_Option = __esmMin((() => {
|
|
|
1765
1765
|
};
|
|
1766
1766
|
map$5 = /*#__PURE__*/ dual(2, (self, f) => isNone(self) ? none() : some(f(self.value)));
|
|
1767
1767
|
flatMap$2 = /*#__PURE__*/ dual(2, (self, f) => isNone(self) ? none() : f(self.value));
|
|
1768
|
-
|
|
1768
|
+
toArray = (self) => isNone(self) ? [] : [self.value];
|
|
1769
|
+
filter$3 = /*#__PURE__*/ dual(2, (self, predicate) => isNone(self) ? none() : predicate(self.value) ? some(self.value) : none());
|
|
1769
1770
|
})), succeed$6, fail$3, isFailure$1;
|
|
1770
1771
|
var init_Result = __esmMin((() => {
|
|
1771
1772
|
init_Function();
|
|
@@ -2685,7 +2686,7 @@ var init_references = __esmMin((() => {
|
|
|
2685
2686
|
};
|
|
2686
2687
|
};
|
|
2687
2688
|
spanCleaner = /*#__PURE__*/ makeStackCleaner(3);
|
|
2688
|
-
})), Interrupt, causeInterrupt, findFail, findError$1, findDefect, hasInterrupts, causeFilterInterruptors, hasInterruptsOnly$1, 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, fiberJoin, fiberInterrupt, fiberInterruptAs, fiberInterruptAll, succeed$5, failCause$3, fail$2, sync$1, suspend$1, yieldNowWith, yieldNow, succeedNone$1, failCauseSync$1, die$1, 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$3, mapEager$1, mapErrorEager$1, catchEager$1, exitInterrupt$1, exitIsSuccess, exitIsFailure, exitFilterCause, exitHasInterrupts, exitVoid, exitMap, exitMapError, exitAsVoidAll, updateContext, updateService, context$1, getContext, contextWith$1, provideContext, provideService$1, provideServiceImpl, when$1, forever$2, catchCause$1, OnFailureProto, catchCauseFilter, catch_, catchDefect$1, catchIf, catchFilter, catchTag$1, catchTags$1, mapError$1, orDie$1, orElseSucceed$1, ignore$1, option$3, result$1, matchCauseEffect, OnSuccessAndFailureProto, matchEffect$1, match, matchEager, exit$1, exitPrimitive, ScopeTypeId, ScopeCloseableTypeId, scopeTag, scopeClose, scopeCloseUnsafe, scopeCloseFinalizers, scopeForkUnsafe, scopeAddFinalizerExit, scopeAddFinalizer, scopeAddFinalizerUnsafe, scopeRemoveFinalizerUnsafe, scopeMakeUnsafe, constScopeEmpty, scope, provideScope, scoped$1, scopedWith, acquireRelease$1, addFinalizer$2, onExitPrimitive, onExit$1, ensuring$1, onExitFilter, onError$1, onErrorFilter, onInterrupt$1, acquireUseRelease$1, interrupt$1, uninterruptible$1, setInterruptible, setInterruptibleTrue, setInterruptibleFalse, setFiberInterruptible, interruptible, uninterruptibleMask$1, all$1, whileLoop$1, forEach$1, forEachSequential, iterateEagerImpl, iterateEager, forEachConcurrent, forkUnsafe$1, forkIn$1, forkScoped$1, runForkWith$1, 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((() => {
|
|
2689
|
+
})), Interrupt, causeInterrupt, findFail, findError$1, findDefect, hasInterrupts, causeFilterInterruptors, hasInterruptsOnly$1, 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, fiberJoin, fiberInterrupt, fiberInterruptAs, fiberInterruptAll, succeed$5, failCause$3, fail$2, sync$1, suspend$1, yieldNowWith, yieldNow, succeedNone$1, failCauseSync$1, die$1, 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$3, mapEager$1, mapErrorEager$1, catchEager$1, exitInterrupt$1, exitIsSuccess, exitIsFailure, exitFilterCause, exitHasInterrupts, exitVoid, exitMap, exitMapError, exitAsVoidAll, updateContext, updateService, context$1, getContext, contextWith$1, provideContext, provideService$1, provideServiceImpl, when$1, forever$2, catchCause$1, OnFailureProto, catchCauseFilter, catch_, catchDefect$1, catchIf, catchFilter, catchTag$1, catchTags$1, mapError$1, orDie$1, orElseSucceed$1, ignore$1, option$3, result$1, matchCauseEffect, OnSuccessAndFailureProto, matchEffect$1, match, matchEager, exit$1, exitPrimitive, ScopeTypeId, ScopeCloseableTypeId, scopeTag, scopeClose, scopeCloseUnsafe, scopeCloseFinalizers, scopeForkUnsafe, scopeAddFinalizerExit, scopeAddFinalizer, scopeAddFinalizerUnsafe, scopeRemoveFinalizerUnsafe, scopeMakeUnsafe, constScopeEmpty, scope, provideScope, scoped$1, scopedWith, acquireRelease$1, addFinalizer$2, onExitPrimitive, onExit$1, ensuring$1, onExitFilter, onError$1, onErrorFilter, onInterrupt$1, acquireUseRelease$1, interrupt$1, uninterruptible$1, setInterruptible, setInterruptibleTrue, setInterruptibleFalse, setFiberInterruptible, interruptible, uninterruptibleMask$1, all$1, whileLoop$1, forEach$1, forEachSequential, iterateEagerImpl, iterateEager, forEachConcurrent, filter$2, forkUnsafe$1, forkIn$1, forkScoped$1, runForkWith$1, 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((() => {
|
|
2689
2690
|
init_Array();
|
|
2690
2691
|
init_Context();
|
|
2691
2692
|
init_Duration();
|
|
@@ -3949,6 +3950,22 @@ var init_references = __esmMin((() => {
|
|
|
3949
3950
|
else if (state.out) state.out[index] = exit.value;
|
|
3950
3951
|
}
|
|
3951
3952
|
});
|
|
3953
|
+
filter$2 = /*#__PURE__*/ dual((args) => isIterable(args[0]) && !isEffect$1(args[0]), (elements, predicate, options) => suspend$1(() => {
|
|
3954
|
+
const out = [];
|
|
3955
|
+
return as$1(forEach$1(elements, (a, i) => {
|
|
3956
|
+
const result = predicate(a, i);
|
|
3957
|
+
if (typeof result === "boolean") {
|
|
3958
|
+
if (result) out.push(a);
|
|
3959
|
+
return void_$2;
|
|
3960
|
+
}
|
|
3961
|
+
return map$3(result, (keep) => {
|
|
3962
|
+
if (keep) out.push(a);
|
|
3963
|
+
});
|
|
3964
|
+
}, {
|
|
3965
|
+
discard: true,
|
|
3966
|
+
concurrency: options?.concurrency
|
|
3967
|
+
}), out);
|
|
3968
|
+
}));
|
|
3952
3969
|
forkUnsafe$1 = (parent, effect, immediate = false, daemon = false, uninterruptible = false) => {
|
|
3953
3970
|
const parentRuntime = parent;
|
|
3954
3971
|
const interruptible = uninterruptible === "inherit" ? parentRuntime.interruptible : !uninterruptible;
|
|
@@ -4790,7 +4807,7 @@ var repeatOrElse, retryOrElse, repeat$1, retry$1, passthroughForever, buildFromO
|
|
|
4790
4807
|
if (options.times !== void 0) schedule = while_(schedule, ({ attempt }) => succeed$5(attempt <= options.times));
|
|
4791
4808
|
return schedule;
|
|
4792
4809
|
};
|
|
4793
|
-
})), isEffect, all, forEach, whileLoop, promise, tryPromise, succeed$1, succeedNone, suspend, sync, void_, callback$1, gen, fail, failCause, failCauseSync, die, try_, withFiber, flatMap, andThen, tap, result, option$2, exit, map$1, as, asVoid, catchTag, catchTags, catchCause, catchDefect, mapError, orDie, retry, ignore, orElseSucceed, sleep, raceFirst, when, context, contextWith, provide, provideService, scoped, acquireRelease, acquireUseRelease, addFinalizer, ensuring, onError, onExit, interrupt, onInterrupt, uninterruptible, uninterruptibleMask, forever, repeat, withSpan, forkIn, forkScoped, runFork, runForkWith, runPromise, runSync, runSyncExit, fnUntraced, fn, mapEager, mapErrorEager, flatMapEager, catchEager, fnUntracedEager;
|
|
4810
|
+
})), isEffect, all, forEach, whileLoop, promise, tryPromise, succeed$1, succeedNone, suspend, sync, void_, callback$1, gen, fail, failCause, failCauseSync, die, try_, withFiber, flatMap, andThen, tap, result, option$2, exit, map$1, as, asVoid, catchTag, catchTags, catchCause, catchDefect, mapError, orDie, retry, ignore, orElseSucceed, sleep, raceFirst, filter$1, when, context, contextWith, provide, provideService, scoped, acquireRelease, acquireUseRelease, addFinalizer, ensuring, onError, onExit, interrupt, onInterrupt, uninterruptible, uninterruptibleMask, forever, repeat, withSpan, forkIn, forkScoped, runFork, runForkWith, runPromise, runSync, runSyncExit, fnUntraced, fn, mapEager, mapErrorEager, flatMapEager, catchEager, fnUntracedEager;
|
|
4794
4811
|
var init_Effect = __esmMin((() => {
|
|
4795
4812
|
init_Context();
|
|
4796
4813
|
init_core();
|
|
@@ -4836,6 +4853,7 @@ var init_Effect = __esmMin((() => {
|
|
|
4836
4853
|
orElseSucceed = orElseSucceed$1;
|
|
4837
4854
|
sleep = sleep$1;
|
|
4838
4855
|
raceFirst = raceFirst$1;
|
|
4856
|
+
filter$1 = filter$2;
|
|
4839
4857
|
when = when$1;
|
|
4840
4858
|
context = context$1;
|
|
4841
4859
|
contextWith = contextWith$1;
|
|
@@ -5502,7 +5520,7 @@ function omit() {
|
|
|
5502
5520
|
*/
|
|
5503
5521
|
function withDefault$1(defaultValue) {
|
|
5504
5522
|
return new Getter((o) => {
|
|
5505
|
-
const filtered = filter$
|
|
5523
|
+
const filtered = filter$3(o, isNotUndefined);
|
|
5506
5524
|
return isSome(filtered) ? succeed$1(filtered) : mapEager(defaultValue, some);
|
|
5507
5525
|
});
|
|
5508
5526
|
}
|
|
@@ -10058,7 +10076,7 @@ var init_config = __esmMin((() => {
|
|
|
10058
10076
|
//#region package.json
|
|
10059
10077
|
init_pane();
|
|
10060
10078
|
init_config();
|
|
10061
|
-
var version$1 = "0.1.0-alpha.
|
|
10079
|
+
var version$1 = "0.1.0-alpha.193";
|
|
10062
10080
|
//#endregion
|
|
10063
10081
|
//#region src/cli/error.ts
|
|
10064
10082
|
var UnknownCommand, MissingOption, UnknownField, UnknownOption, BadOption, RegistryUnanswered, NotServed, BadRequest;
|
|
@@ -10458,6 +10476,25 @@ var init_catalog = __esmMin((() => {
|
|
|
10458
10476
|
dataKey: "patch",
|
|
10459
10477
|
example: "adiff patch show --repo . --branch add-invitations --file src/api.ts --context all"
|
|
10460
10478
|
},
|
|
10479
|
+
{
|
|
10480
|
+
name: "patch since",
|
|
10481
|
+
about: "One file's diff from the version the reviewer marked reviewed to the file now, in the shape of one file of `patch show`. The old side counts the marked version's lines",
|
|
10482
|
+
group: READ_A_BRANCH,
|
|
10483
|
+
addresses: "review",
|
|
10484
|
+
safety: "read",
|
|
10485
|
+
options: [
|
|
10486
|
+
...based,
|
|
10487
|
+
file,
|
|
10488
|
+
{
|
|
10489
|
+
name: "context",
|
|
10490
|
+
required: false,
|
|
10491
|
+
value: "lines|all",
|
|
10492
|
+
about: "Unchanged lines around each change. Defaults to 3; `all` answers the whole file"
|
|
10493
|
+
}
|
|
10494
|
+
],
|
|
10495
|
+
dataKey: "file",
|
|
10496
|
+
example: "adiff patch since --worktree . --file src/api.ts"
|
|
10497
|
+
},
|
|
10461
10498
|
{
|
|
10462
10499
|
name: "file review",
|
|
10463
10500
|
about: "Toggle a file as reviewed. Lapses on its own when the file changes",
|
|
@@ -10472,6 +10509,12 @@ var init_catalog = __esmMin((() => {
|
|
|
10472
10509
|
required: false,
|
|
10473
10510
|
value: "number",
|
|
10474
10511
|
about: "Mark the file read in this layer only, counting from 1, when more than one layer claims it"
|
|
10512
|
+
},
|
|
10513
|
+
{
|
|
10514
|
+
name: "blob",
|
|
10515
|
+
required: false,
|
|
10516
|
+
value: "sha",
|
|
10517
|
+
about: "Mark this version of the file: the `blob` patch show printed for it"
|
|
10475
10518
|
}
|
|
10476
10519
|
],
|
|
10477
10520
|
dataKey: "reviewed",
|
|
@@ -10504,7 +10547,7 @@ var init_catalog = __esmMin((() => {
|
|
|
10504
10547
|
},
|
|
10505
10548
|
{
|
|
10506
10549
|
name: "review progress",
|
|
10507
|
-
about: "Which files of a review are marked reviewed, and how many there are",
|
|
10550
|
+
about: "Which files of a review are marked reviewed, which changed since they were marked and by how much, and how many files there are",
|
|
10508
10551
|
group: READ_A_BRANCH,
|
|
10509
10552
|
addresses: "review",
|
|
10510
10553
|
safety: "read",
|
|
@@ -11367,6 +11410,16 @@ var init_report$1 = __esmMin((() => {
|
|
|
11367
11410
|
suggestion: "The pull request has moved since these comments were written, so they name lines that may no longer be there. Nothing was sent and nothing was lost. Read the diff again and check each draft still says what you mean.",
|
|
11368
11411
|
retriable: false
|
|
11369
11412
|
},
|
|
11413
|
+
NotVouched: {
|
|
11414
|
+
exit: 3,
|
|
11415
|
+
suggestion: "The file has no review mark, so nothing changed since one. Mark it with `adiff file review`, or read its diff against the base with `adiff patch show --file`.",
|
|
11416
|
+
retriable: false
|
|
11417
|
+
},
|
|
11418
|
+
VouchedVersionGone: {
|
|
11419
|
+
exit: 3,
|
|
11420
|
+
suggestion: "The version marked reviewed was not kept, as with a mark made by an older adiff. Read the file's diff against the base with `adiff patch show --file` instead.",
|
|
11421
|
+
retriable: false
|
|
11422
|
+
},
|
|
11370
11423
|
UnselectableRange: {
|
|
11371
11424
|
exit: 2,
|
|
11372
11425
|
suggestion: "Those lines are not in the diff. Check --side: new is the working tree, old is the version being replaced.",
|
|
@@ -12071,7 +12124,7 @@ var init_run = __esmMin((() => {
|
|
|
12071
12124
|
gitOrEmpty = fn("Git.runOrEmpty")(function* (cwd, args) {
|
|
12072
12125
|
return yield* git(cwd, args).pipe(catchTag("GitCommandFailed", () => succeed$1("")));
|
|
12073
12126
|
});
|
|
12074
|
-
})), CACHE_SIZE, NAME_TTL, FRESH_TTL, SPLIT$1, DEFAULT_BRANCH_CANDIDATES, PLAIN_PATHS, STAT, Git, parseStat, readEntries, verifiedIn, findDefaultBranch, partsOf$1, findMergeBase, toWorktree, branchTips, findParent, splitLines, absent, readText, settled, seenAs, listWorktrees, readDiff, readStat, readSource, readBlob, readGrep, GENERATED_SAID, markedGenerated, readGenerated, askRepo, LINKED_GIT_DIR, HEAD_REF, gitDirOf, findCommonDir, readHead, REFS_MOST, readCommits, readRefs, refResolves, sharedCommit, makeCaches, shapeWith, makeGit, GitLive;
|
|
12127
|
+
})), CACHE_SIZE, NAME_TTL, FRESH_TTL, SPLIT$1, DEFAULT_BRANCH_CANDIDATES, PLAIN_PATHS, STAT, Git, parseStat, readEntries, verifiedIn, findDefaultBranch, partsOf$1, findMergeBase, toWorktree, branchTips, findParent, splitLines, absent, readText, settled, seenAs, listWorktrees, readDiff, readStat, readSource, readBlob, NO_CONTENT, keepContent, findKept, readBetween, readGrep, GENERATED_SAID, markedGenerated, readGenerated, askRepo, LINKED_GIT_DIR, HEAD_REF, gitDirOf, findCommonDir, readHead, REFS_MOST, readCommits, readRefs, refResolves, sharedCommit, makeCaches, shapeWith, makeGit, GitLive;
|
|
12075
12128
|
var init_service$2 = __esmMin((() => {
|
|
12076
12129
|
init_dist();
|
|
12077
12130
|
init_error$4();
|
|
@@ -12225,6 +12278,35 @@ var init_service$2 = __esmMin((() => {
|
|
|
12225
12278
|
const raw = yield* gitOrEmpty(worktree.path, ["show", `${target}:${path}`]);
|
|
12226
12279
|
return raw.length === 0 ? none() : some(splitLines(raw));
|
|
12227
12280
|
});
|
|
12281
|
+
NO_CONTENT = "/dev/null";
|
|
12282
|
+
keepContent = fn("Git.keep")(function* (worktree, paths) {
|
|
12283
|
+
if (paths.length === 0) return [];
|
|
12284
|
+
return (yield* gitOrEmpty(worktree.path, [
|
|
12285
|
+
"hash-object",
|
|
12286
|
+
"-w",
|
|
12287
|
+
"--",
|
|
12288
|
+
...paths
|
|
12289
|
+
])).split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
|
|
12290
|
+
});
|
|
12291
|
+
findKept = fn("Git.kept")(function* (worktree, blob) {
|
|
12292
|
+
if (blob.length === 0) return none();
|
|
12293
|
+
const found = (yield* gitOrEmpty(worktree.path, [
|
|
12294
|
+
"rev-parse",
|
|
12295
|
+
"--verify",
|
|
12296
|
+
"--quiet",
|
|
12297
|
+
`${blob}^{blob}`
|
|
12298
|
+
])).trim();
|
|
12299
|
+
return found.length === 0 ? none() : some(found);
|
|
12300
|
+
});
|
|
12301
|
+
readBetween = fn("Git.between")(function* (worktree, from, to, context) {
|
|
12302
|
+
return yield* gitOrEmpty(worktree.path, [
|
|
12303
|
+
...PLAIN_PATHS,
|
|
12304
|
+
"diff",
|
|
12305
|
+
`-U${context}`,
|
|
12306
|
+
from,
|
|
12307
|
+
to
|
|
12308
|
+
]);
|
|
12309
|
+
});
|
|
12228
12310
|
readGrep = fn("Git.grep")(function* (worktree, term) {
|
|
12229
12311
|
return yield* gitOrEmpty(worktree.path, [
|
|
12230
12312
|
"grep",
|
|
@@ -12371,6 +12453,9 @@ var init_service$2 = __esmMin((() => {
|
|
|
12371
12453
|
stat: readStat,
|
|
12372
12454
|
source: readSource,
|
|
12373
12455
|
blob: readBlob,
|
|
12456
|
+
keep: keepContent,
|
|
12457
|
+
kept: findKept,
|
|
12458
|
+
between: readBetween,
|
|
12374
12459
|
grep: readGrep,
|
|
12375
12460
|
generated: readGenerated,
|
|
12376
12461
|
defaultBranch: (repo) => get(caches.baseName, repo),
|
|
@@ -12407,6 +12492,7 @@ var init_model$4 = __esmMin((() => {
|
|
|
12407
12492
|
taken: {},
|
|
12408
12493
|
vouches: {},
|
|
12409
12494
|
parts: {},
|
|
12495
|
+
vouchedAt: {},
|
|
12410
12496
|
openedAt: "",
|
|
12411
12497
|
consumed: 0,
|
|
12412
12498
|
settled: {},
|
|
@@ -12477,6 +12563,7 @@ var init_schema = __esmMin((() => {
|
|
|
12477
12563
|
taken: optionalKey(Record(String$1, String$1)),
|
|
12478
12564
|
vouches: Stamps.pipe(noStamps),
|
|
12479
12565
|
parts: Stamps.pipe(noStamps),
|
|
12566
|
+
vouchedAt: Stamps.pipe(noStamps),
|
|
12480
12567
|
openedAt: String$1.pipe(withDecodingDefaultKey(succeed$1(""))),
|
|
12481
12568
|
consumed: Int.pipe(withDecodingDefaultKey(succeed$1(0))),
|
|
12482
12569
|
settled: Stamps.pipe(noStamps),
|
|
@@ -13021,13 +13108,15 @@ var init_store = __esmMin((() => {
|
|
|
13021
13108
|
}));
|
|
13022
13109
|
//#endregion
|
|
13023
13110
|
//#region src/review/error.ts
|
|
13024
|
-
var UnknownBranch, BranchMoved, UnknownBase, UnknownFile, UnknownComment, UnknownRemark, NothingSaid, ThreadOpen, RemarkTaken, UnknownPreference, UnknownPreferenceValue, UnselectableRange, UnknownWorktree, MalformedLayers, UnknownDraft, NothingDrafted, PartlySent, PullMoved, NoLayers, NoPull, UnknownLayer;
|
|
13111
|
+
var UnknownBranch, BranchMoved, UnknownBase, UnknownFile, NotVouched, VouchedVersionGone, UnknownComment, UnknownRemark, NothingSaid, ThreadOpen, RemarkTaken, UnknownPreference, UnknownPreferenceValue, UnselectableRange, UnknownWorktree, MalformedLayers, UnknownDraft, NothingDrafted, PartlySent, PullMoved, NoLayers, NoPull, UnknownLayer;
|
|
13025
13112
|
var init_error$2 = __esmMin((() => {
|
|
13026
13113
|
init_dist();
|
|
13027
13114
|
UnknownBranch = class extends TaggedError("UnknownBranch") {};
|
|
13028
13115
|
BranchMoved = class extends TaggedError("BranchMoved") {};
|
|
13029
13116
|
UnknownBase = class extends TaggedError("UnknownBase") {};
|
|
13030
13117
|
UnknownFile = class extends TaggedError("UnknownFile") {};
|
|
13118
|
+
NotVouched = class extends TaggedError("NotVouched") {};
|
|
13119
|
+
VouchedVersionGone = class extends TaggedError("VouchedVersionGone") {};
|
|
13031
13120
|
UnknownComment = class extends TaggedError("UnknownComment") {};
|
|
13032
13121
|
UnknownRemark = class extends TaggedError("UnknownRemark") {};
|
|
13033
13122
|
NothingSaid = class extends TaggedError("NothingSaid") {};
|
|
@@ -13281,7 +13370,7 @@ var init_branches$1 = __esmMin((() => {
|
|
|
13281
13370
|
}));
|
|
13282
13371
|
//#endregion
|
|
13283
13372
|
//#region src/review/patches.ts
|
|
13284
|
-
var findPatch, blobOf, anchor, list$4, source, before, linesAround, GENERATED_NAME, lineOf$2, isNote$1, shownRow, shownHunk, scopesOf, shownFile, sourceShown, fileShown$1, show$3;
|
|
13373
|
+
var findPatch, blobOf, anchor, list$4, source, before, linesAround, GENERATED_NAME, lineOf$2, isNote$1, shownRow, shownHunk, scopesOf, shownFile, sourceShown, fileShown$1, shownAs, onDisk$1, show$3;
|
|
13285
13374
|
var init_patches = __esmMin((() => {
|
|
13286
13375
|
init_dist();
|
|
13287
13376
|
init_patch();
|
|
@@ -13357,6 +13446,7 @@ var init_patches = __esmMin((() => {
|
|
|
13357
13446
|
generated: generated.has(patch.path) || GENERATED_NAME.test(patch.path),
|
|
13358
13447
|
added: patch.added,
|
|
13359
13448
|
removed: patch.removed,
|
|
13449
|
+
blob: patch.blob,
|
|
13360
13450
|
hunks: patch.hunks.map(shownHunk),
|
|
13361
13451
|
enclosedBy: enclosedBy(lines),
|
|
13362
13452
|
scopes: scopesOf(lines)
|
|
@@ -13366,11 +13456,13 @@ var init_patches = __esmMin((() => {
|
|
|
13366
13456
|
return yield* source(worktree, patch.path);
|
|
13367
13457
|
});
|
|
13368
13458
|
fileShown$1 = (worktree, generated) => (patch) => map$1(sourceShown(worktree, patch), (lines) => shownFile(patch, generated, lines));
|
|
13459
|
+
shownAs = (patch, lines) => shownFile(patch, /* @__PURE__ */ new Set(), lines);
|
|
13460
|
+
onDisk$1 = (patches) => patches.filter((patch) => patch.status !== "deleted").map((patch) => patch.path);
|
|
13369
13461
|
show$3 = fn("Review.Diff.show")(function* (based, showing) {
|
|
13370
13462
|
const git = yield* Git;
|
|
13371
13463
|
const { worktree } = based;
|
|
13372
13464
|
const patches$3 = yield* patches(worktree, linesAround(showing.context), showing.file);
|
|
13373
|
-
const generated = yield* git.generated(worktree, patches$3.map((patch) => patch.path));
|
|
13465
|
+
const [generated] = yield* all([git.generated(worktree, patches$3.map((patch) => patch.path)), git.keep(worktree, onDisk$1(patches$3))], { concurrency: 2 });
|
|
13374
13466
|
return {
|
|
13375
13467
|
branch: worktree.branch,
|
|
13376
13468
|
base: based.base,
|
|
@@ -14115,7 +14207,7 @@ var init_error$1 = __esmMin((() => {
|
|
|
14115
14207
|
}));
|
|
14116
14208
|
//#endregion
|
|
14117
14209
|
//#region src/service/forge/service.ts
|
|
14118
|
-
var Forge, LIMIT, TIMEOUT_MS, SEND_TIMEOUT_MS, MOST_OUTPUT, FIELDS$1, Author, Row, Viewer, readViewer, decode$1, SAID, stateOf$1, ended, ask$1, show$2, whoseOf, pullOf, read$2, viewerOf, pulls, openPull, NUMBER_FIELDS, Named, readNamed, gh, named$2, head, sideName, commentBody, bodyFor, Landed, readLanded, jsonOf$1, keyOf$2, counted$
|
|
14210
|
+
var Forge, LIMIT, TIMEOUT_MS, SEND_TIMEOUT_MS, MOST_OUTPUT, FIELDS$1, Author, Row, Viewer, readViewer, decode$1, SAID, stateOf$1, ended, ask$1, show$2, whoseOf, pullOf, read$2, viewerOf, pulls, openPull, NUMBER_FIELDS, Named, readNamed, gh, named$2, head, sideName, commentBody, bodyFor, Landed, readLanded, jsonOf$1, keyOf$2, counted$2, acknowledged, landedIn, THREADS, Said, Thread, Page, Held$1, Threads, readThreads, ANONYMOUS, heardFrom$1, someLine, hasNoLine, quotedIn, spanIn, remarkOf, ownerOf, HERE, asked$1, whereOf, threadsIn, unresolved, PAGES, everyThread, answer$2, remarks, review, address, ForgeLive;
|
|
14119
14211
|
var init_service = __esmMin((() => {
|
|
14120
14212
|
init_dist();
|
|
14121
14213
|
init_error$1();
|
|
@@ -14317,7 +14409,7 @@ var init_service = __esmMin((() => {
|
|
|
14317
14409
|
readLanded = decodeUnknownOption(Landed);
|
|
14318
14410
|
jsonOf$1 = liftThrowable((raw) => JSON.parse(raw));
|
|
14319
14411
|
keyOf$2 = (path, line) => `${path}:${line}`;
|
|
14320
|
-
counted$
|
|
14412
|
+
counted$2 = (back) => {
|
|
14321
14413
|
const room = /* @__PURE__ */ new Map();
|
|
14322
14414
|
back.forEach((one) => {
|
|
14323
14415
|
const key = keyOf$2(one.path, one.line ?? 0);
|
|
@@ -14329,7 +14421,7 @@ var init_service = __esmMin((() => {
|
|
|
14329
14421
|
landedIn = (said, asked) => {
|
|
14330
14422
|
const back = acknowledged(said);
|
|
14331
14423
|
if (back === void 0) return [];
|
|
14332
|
-
const room = counted$
|
|
14424
|
+
const room = counted$2(back);
|
|
14333
14425
|
return asked.flatMap((one, at) => {
|
|
14334
14426
|
const key = keyOf$2(one.path, one.line);
|
|
14335
14427
|
const left = room.get(key) ?? 0;
|
|
@@ -14838,12 +14930,15 @@ var init_review$1 = __esmMin((() => {
|
|
|
14838
14930
|
}));
|
|
14839
14931
|
//#endregion
|
|
14840
14932
|
//#region src/review/vouching.ts
|
|
14841
|
-
var pathOfMark, changedSince, readParts, blobIn, toggle, progress;
|
|
14933
|
+
var pathOfMark, changedSince, readParts, restamped, now, keepMarked, blobIn, stateAfter, toggle, marksOf, newestFirst, speaking, contentNow, diffSince, placesIn, counted$1, reportSince, isGone, goneSince, lapsedIn, sinceReview, progress, unchanged, markOf, since;
|
|
14842
14934
|
var init_vouching$1 = __esmMin((() => {
|
|
14843
14935
|
init_dist();
|
|
14936
|
+
init_patch();
|
|
14844
14937
|
init_review$1();
|
|
14938
|
+
init_git();
|
|
14845
14939
|
init_store();
|
|
14846
14940
|
init_error$2();
|
|
14941
|
+
init_branches$1();
|
|
14847
14942
|
init_patches();
|
|
14848
14943
|
pathOfMark = (mark) => mark.split("@")[0] ?? "";
|
|
14849
14944
|
changedSince = (marks, files) => {
|
|
@@ -14859,6 +14954,17 @@ var init_vouching$1 = __esmMin((() => {
|
|
|
14859
14954
|
const blobs = new Map(files.map((file) => [file.path, file.blob]));
|
|
14860
14955
|
return Object.entries(parts).filter(([part, blob]) => blobs.get(pathOfMark(part)) === blob).map(([part]) => part);
|
|
14861
14956
|
};
|
|
14957
|
+
restamped = (stamps, before, after, at) => {
|
|
14958
|
+
const still = Object.entries(stamps).filter(([key]) => key in after && after[key] === before[key]);
|
|
14959
|
+
const fresh = Object.keys(after).filter((key) => before[key] !== after[key]).map((key) => [key, at]);
|
|
14960
|
+
return Object.fromEntries([...still, ...fresh]);
|
|
14961
|
+
};
|
|
14962
|
+
now = sync(() => (/* @__PURE__ */ new Date()).toISOString());
|
|
14963
|
+
keepMarked = fn("Review.Vouch.keepMarked")(function* (worktree, file, marked) {
|
|
14964
|
+
const git = yield* Git;
|
|
14965
|
+
if (marked.blob === marked.onDisk) yield* git.keep(worktree, [file]);
|
|
14966
|
+
return marked.at ?? (yield* now);
|
|
14967
|
+
});
|
|
14862
14968
|
blobIn = fn("Review.Vouch.blobIn")(function* (reading, file) {
|
|
14863
14969
|
return yield* match$3(blobOf(reading.patches, file), {
|
|
14864
14970
|
onNone: () => new UnknownFile({
|
|
@@ -14868,16 +14974,35 @@ var init_vouching$1 = __esmMin((() => {
|
|
|
14868
14974
|
onSome: succeed$1
|
|
14869
14975
|
});
|
|
14870
14976
|
});
|
|
14871
|
-
|
|
14977
|
+
stateAfter = (was, file, blob, at) => {
|
|
14978
|
+
const vouches = vouch$1(was.vouches, file, blob);
|
|
14979
|
+
const before = {
|
|
14980
|
+
...was.vouches,
|
|
14981
|
+
...was.parts
|
|
14982
|
+
};
|
|
14983
|
+
const after = {
|
|
14984
|
+
...vouches,
|
|
14985
|
+
...was.parts
|
|
14986
|
+
};
|
|
14987
|
+
return {
|
|
14988
|
+
...was,
|
|
14989
|
+
vouches,
|
|
14990
|
+
vouchedAt: restamped(was.vouchedAt, before, after, at)
|
|
14991
|
+
};
|
|
14992
|
+
};
|
|
14993
|
+
toggle = fn("Review.Vouch.toggle")(function* (reading, file, marking = {}) {
|
|
14872
14994
|
const store = yield* Store;
|
|
14873
14995
|
const patches = reading.patches;
|
|
14874
|
-
const
|
|
14996
|
+
const onDisk = yield* blobIn(reading, file);
|
|
14997
|
+
const blob = marking.blob ?? onDisk;
|
|
14998
|
+
const at = yield* keepMarked(reading.worktree, file, {
|
|
14999
|
+
blob,
|
|
15000
|
+
onDisk,
|
|
15001
|
+
at: marking.at
|
|
15002
|
+
});
|
|
14875
15003
|
const current = yield* store.state(reading.worktree.path);
|
|
14876
15004
|
const next = vouch$1(current.vouches, file, blob);
|
|
14877
|
-
yield* store.changeState(reading.worktree.path, (was) => (
|
|
14878
|
-
...was,
|
|
14879
|
-
vouches: vouch$1(was.vouches, file, blob)
|
|
14880
|
-
}));
|
|
15005
|
+
yield* store.changeState(reading.worktree.path, (was) => stateAfter(was, file, blob, at));
|
|
14881
15006
|
const files = patches.map((patch) => ({
|
|
14882
15007
|
path: patch.path,
|
|
14883
15008
|
blob: patch.blob
|
|
@@ -14888,19 +15013,146 @@ var init_vouching$1 = __esmMin((() => {
|
|
|
14888
15013
|
total: patches.length
|
|
14889
15014
|
};
|
|
14890
15015
|
});
|
|
15016
|
+
marksOf = (state) => [...Object.entries(state.vouches), ...Object.entries(state.parts)].map(([key, blob]) => ({
|
|
15017
|
+
key,
|
|
15018
|
+
path: pathOfMark(key),
|
|
15019
|
+
blob,
|
|
15020
|
+
at: state.vouchedAt[key] ?? ""
|
|
15021
|
+
}));
|
|
15022
|
+
newestFirst = (left, right) => right.at.localeCompare(left.at);
|
|
15023
|
+
speaking = (marks, path, blob) => {
|
|
15024
|
+
const own = marks.filter((mark) => mark.path === path && mark.blob !== blob);
|
|
15025
|
+
const whole = own.find((mark) => mark.key === path);
|
|
15026
|
+
return fromNullishOr(whole ?? own.toSorted(newestFirst)[0]);
|
|
15027
|
+
};
|
|
15028
|
+
contentNow = fn("Review.Vouch.contentNow")(function* (worktree, file) {
|
|
15029
|
+
const git = yield* Git;
|
|
15030
|
+
const [found] = yield* git.keep(worktree, [file]);
|
|
15031
|
+
if (found !== void 0) return found;
|
|
15032
|
+
const [nothing] = yield* git.keep(worktree, [NO_CONTENT]);
|
|
15033
|
+
return nothing ?? "";
|
|
15034
|
+
});
|
|
15035
|
+
diffSince = fn("Review.Vouch.diffSince")(function* (worktree, file, kept, context) {
|
|
15036
|
+
const raw = yield* (yield* Git).between(worktree, kept, yield* contentNow(worktree, file), context);
|
|
15037
|
+
return fromNullishOr(parsePatches(raw)[0]);
|
|
15038
|
+
});
|
|
15039
|
+
placesIn = (patch) => patch.hunks.filter((hunk) => hunk.marker.length > 0).length;
|
|
15040
|
+
counted$1 = (patch) => match$3(patch, {
|
|
15041
|
+
onNone: () => ({
|
|
15042
|
+
added: 0,
|
|
15043
|
+
removed: 0,
|
|
15044
|
+
places: 0
|
|
15045
|
+
}),
|
|
15046
|
+
onSome: (found) => ({
|
|
15047
|
+
added: found.added,
|
|
15048
|
+
removed: found.removed,
|
|
15049
|
+
places: placesIn(found)
|
|
15050
|
+
})
|
|
15051
|
+
});
|
|
15052
|
+
reportSince = fn("Review.Vouch.reportSince")(function* (worktree, asked) {
|
|
15053
|
+
const git = yield* Git;
|
|
15054
|
+
const { mark } = asked;
|
|
15055
|
+
const told = {
|
|
15056
|
+
path: mark.path,
|
|
15057
|
+
at: mark.at,
|
|
15058
|
+
reviewed: mark.blob,
|
|
15059
|
+
...asked.deleted ? { deleted: true } : {}
|
|
15060
|
+
};
|
|
15061
|
+
const kept = yield* git.kept(worktree, mark.blob);
|
|
15062
|
+
if (isNone(kept)) return {
|
|
15063
|
+
...told,
|
|
15064
|
+
added: 0,
|
|
15065
|
+
removed: 0,
|
|
15066
|
+
places: 0,
|
|
15067
|
+
kept: false
|
|
15068
|
+
};
|
|
15069
|
+
const patch = yield* diffSince(worktree, mark.path, kept.value, 3);
|
|
15070
|
+
return {
|
|
15071
|
+
...told,
|
|
15072
|
+
...counted$1(patch),
|
|
15073
|
+
kept: true
|
|
15074
|
+
};
|
|
15075
|
+
});
|
|
15076
|
+
isGone = fn("Review.Vouch.isGone")(function* (worktree, path) {
|
|
15077
|
+
const git = yield* Git;
|
|
15078
|
+
return isNone(yield* git.source(worktree, path));
|
|
15079
|
+
});
|
|
15080
|
+
goneSince = fn("Review.Vouch.goneSince")(function* (worktree, marks, patches) {
|
|
15081
|
+
const inDiff = new Set(patches.map((patch) => patch.path));
|
|
15082
|
+
const left = [...new Set(marks.map((mark) => mark.path))].filter((path) => !inDiff.has(path));
|
|
15083
|
+
return (yield* filter$1(left, (path) => isGone(worktree, path))).flatMap((path) => toArray(speaking(marks, path)));
|
|
15084
|
+
});
|
|
15085
|
+
lapsedIn = (patches, marks, changed) => patches.filter((patch) => changed.includes(patch.path)).flatMap((patch) => toArray(speaking(marks, patch.path, patch.blob)).map((mark) => ({
|
|
15086
|
+
mark,
|
|
15087
|
+
deleted: patch.status === "deleted"
|
|
15088
|
+
})));
|
|
15089
|
+
sinceReview = fn("Review.Vouch.sinceReview")(function* (reading, state, changed) {
|
|
15090
|
+
const marks = marksOf(state);
|
|
15091
|
+
const gone = yield* goneSince(reading.worktree, marks, reading.patches);
|
|
15092
|
+
const asked = [...lapsedIn(reading.patches, marks, changed), ...gone.map((mark) => ({
|
|
15093
|
+
mark,
|
|
15094
|
+
deleted: true
|
|
15095
|
+
}))];
|
|
15096
|
+
return yield* forEach(asked, (one) => reportSince(reading.worktree, one), { concurrency: 8 });
|
|
15097
|
+
});
|
|
14891
15098
|
progress = fn("Review.Vouch.progress")(function* (reading) {
|
|
14892
15099
|
const current = yield* (yield* Store).state(reading.worktree.path);
|
|
14893
15100
|
const files = reading.patches.map((patch) => ({
|
|
14894
15101
|
path: patch.path,
|
|
14895
15102
|
blob: patch.blob
|
|
14896
15103
|
}));
|
|
15104
|
+
const changed = changedSince([current.vouches, current.parts], files);
|
|
14897
15105
|
return {
|
|
14898
15106
|
vouched: files.filter((file) => isVouched(current.vouches, file.path, file.blob)).map((f) => f.path),
|
|
14899
15107
|
parts: readParts(current.parts, files),
|
|
14900
|
-
changed
|
|
15108
|
+
changed,
|
|
15109
|
+
since: yield* sinceReview(reading, current, changed),
|
|
14901
15110
|
total: reading.patches.length
|
|
14902
15111
|
};
|
|
14903
15112
|
});
|
|
15113
|
+
unchanged = (file) => ({
|
|
15114
|
+
path: file,
|
|
15115
|
+
previousPath: file,
|
|
15116
|
+
blob: "",
|
|
15117
|
+
headerLines: [],
|
|
15118
|
+
status: "changed",
|
|
15119
|
+
binary: false,
|
|
15120
|
+
hunks: [],
|
|
15121
|
+
rows: [],
|
|
15122
|
+
added: 0,
|
|
15123
|
+
removed: 0
|
|
15124
|
+
});
|
|
15125
|
+
markOf = fn("Review.Vouch.markOf")(function* (worktree, file) {
|
|
15126
|
+
const store = yield* Store;
|
|
15127
|
+
const git = yield* Git;
|
|
15128
|
+
const state = yield* store.state(worktree.path);
|
|
15129
|
+
const mark = yield* match$3(speaking(marksOf(state), file), {
|
|
15130
|
+
onNone: () => new NotVouched({ file }),
|
|
15131
|
+
onSome: succeed$1
|
|
15132
|
+
});
|
|
15133
|
+
const kept = yield* git.kept(worktree, mark.blob);
|
|
15134
|
+
if (isNone(kept)) return yield* new VouchedVersionGone({
|
|
15135
|
+
file,
|
|
15136
|
+
blob: mark.blob
|
|
15137
|
+
});
|
|
15138
|
+
return kept.value;
|
|
15139
|
+
});
|
|
15140
|
+
since = fn("Review.Vouch.since")(function* (based, file, showing) {
|
|
15141
|
+
const git = yield* Git;
|
|
15142
|
+
const { worktree } = based;
|
|
15143
|
+
const kept = yield* markOf(worktree, file);
|
|
15144
|
+
const inDiff = (yield* patches(worktree, 3, file)).find((patch) => patch.path === file);
|
|
15145
|
+
const found = yield* diffSince(worktree, file, kept, linesAround(showing.context));
|
|
15146
|
+
const lines = yield* git.source(worktree, file);
|
|
15147
|
+
const patch = {
|
|
15148
|
+
...getOrElse(found, () => unchanged(file)),
|
|
15149
|
+
path: file,
|
|
15150
|
+
previousPath: file,
|
|
15151
|
+
blob: inDiff?.blob ?? "",
|
|
15152
|
+
status: isNone(lines) ? "deleted" : "changed"
|
|
15153
|
+
};
|
|
15154
|
+
return shownAs(patch, getOrElse(lines, () => []));
|
|
15155
|
+
});
|
|
14904
15156
|
}));
|
|
14905
15157
|
//#endregion
|
|
14906
15158
|
//#region src/domain/preferences/model.ts
|
|
@@ -15250,18 +15502,31 @@ var init_layers = __esmMin((() => {
|
|
|
15250
15502
|
};
|
|
15251
15503
|
});
|
|
15252
15504
|
partsOfFile = (layers, file) => layers.map((layer) => layer.spans.filter((span) => span.path === file)).filter((spans) => spans.length > 0).map((spans) => partOf(file, spans));
|
|
15253
|
-
vouchPart = fn("Review.Layers.vouchPart")(function* (reading, file, part) {
|
|
15505
|
+
vouchPart = fn("Review.Layers.vouchPart")(function* (reading, file, part, marking = {}) {
|
|
15254
15506
|
const store = yield* Store;
|
|
15255
|
-
const
|
|
15507
|
+
const onDisk = reading.patches.find((one) => one.path === file)?.blob ?? "";
|
|
15508
|
+
const blob = marking.blob ?? onDisk;
|
|
15256
15509
|
const held = yield* read(reading);
|
|
15257
15510
|
const wanted = partsOfFile(held.layers, file);
|
|
15258
15511
|
const current = yield* store.state(reading.worktree.path);
|
|
15259
15512
|
const parts = vouchPart$1(current.parts, part, blob);
|
|
15260
15513
|
const vouches = (wanted.length > 0 && wanted.every((one) => isPartVouched(parts, one, blob))) === isVouched(current.vouches, file, blob) ? current.vouches : vouch$1(current.vouches, file, blob);
|
|
15514
|
+
const at = yield* keepMarked(reading.worktree, file, {
|
|
15515
|
+
blob,
|
|
15516
|
+
onDisk,
|
|
15517
|
+
at: marking.at
|
|
15518
|
+
});
|
|
15261
15519
|
yield* store.changeState(reading.worktree.path, (was) => ({
|
|
15262
15520
|
...was,
|
|
15263
15521
|
parts,
|
|
15264
|
-
vouches
|
|
15522
|
+
vouches,
|
|
15523
|
+
vouchedAt: restamped(was.vouchedAt, {
|
|
15524
|
+
...was.vouches,
|
|
15525
|
+
...was.parts
|
|
15526
|
+
}, {
|
|
15527
|
+
...vouches,
|
|
15528
|
+
...parts
|
|
15529
|
+
}, at)
|
|
15265
15530
|
}));
|
|
15266
15531
|
const files = reading.patches.map((one) => ({
|
|
15267
15532
|
path: one.path,
|
|
@@ -15302,7 +15567,7 @@ var init_layers = __esmMin((() => {
|
|
|
15302
15567
|
return { asked: body };
|
|
15303
15568
|
});
|
|
15304
15569
|
claims = (layer, file) => layer.spans.some((span) => span.path === file);
|
|
15305
|
-
vouchIn = fn("Review.Layers.vouchIn")(function* (reading, file, number) {
|
|
15570
|
+
vouchIn = fn("Review.Layers.vouchIn")(function* (reading, file, number, marking = {}) {
|
|
15306
15571
|
const held = yield* read(reading);
|
|
15307
15572
|
const layer = held.layers[number - 1];
|
|
15308
15573
|
if (layer === void 0) return yield* new UnknownLayer({
|
|
@@ -15311,8 +15576,8 @@ var init_layers = __esmMin((() => {
|
|
|
15311
15576
|
});
|
|
15312
15577
|
const holding = held.layers.filter((one) => claims(one, file)).length;
|
|
15313
15578
|
const spans = layer.spans.filter((span) => span.path === file);
|
|
15314
|
-
if (holding < 2 || spans.length === 0) return yield* toggle(reading, file);
|
|
15315
|
-
return yield* vouchPart(reading, file, partOf(file, spans));
|
|
15579
|
+
if (holding < 2 || spans.length === 0) return yield* toggle(reading, file, marking);
|
|
15580
|
+
return yield* vouchPart(reading, file, partOf(file, spans), marking);
|
|
15316
15581
|
});
|
|
15317
15582
|
}));
|
|
15318
15583
|
//#endregion
|
|
@@ -25651,8 +25916,12 @@ const commentReopen = fn("Main.commentReopen")(function* (options) {
|
|
|
25651
25916
|
const vouched = fn("Main.vouched")(function* (options) {
|
|
25652
25917
|
const reading = yield* readingIn(options);
|
|
25653
25918
|
const file = yield* required(options, "file");
|
|
25654
|
-
|
|
25655
|
-
|
|
25919
|
+
const marking = {
|
|
25920
|
+
blob: options["blob"],
|
|
25921
|
+
at: options["at"]
|
|
25922
|
+
};
|
|
25923
|
+
if (options["layer"] === void 0) return yield* toggle(reading, file, marking);
|
|
25924
|
+
return yield* vouchIn(reading, file, yield* numeric(options, "layer"), marking);
|
|
25656
25925
|
});
|
|
25657
25926
|
const fileReview = fn("Main.fileReview")(function* (options) {
|
|
25658
25927
|
const report = yield* vouched(options);
|
|
@@ -25666,6 +25935,7 @@ const reviewStatus = fn("Main.reviewStatus")(function* (options) {
|
|
|
25666
25935
|
yield* answer(options, {
|
|
25667
25936
|
reviewed: report.vouched,
|
|
25668
25937
|
changed: report.changed,
|
|
25938
|
+
since: report.since,
|
|
25669
25939
|
total: report.total
|
|
25670
25940
|
});
|
|
25671
25941
|
});
|
|
@@ -25692,6 +25962,11 @@ const patchShow = fn("Main.patchShow")(function* (options) {
|
|
|
25692
25962
|
});
|
|
25693
25963
|
yield* answer(options, { patch });
|
|
25694
25964
|
});
|
|
25965
|
+
const patchSince = fn("Main.patchSince")(function* (options) {
|
|
25966
|
+
const based = yield* basedAt(yield* required(options, "worktree"), options["base"]);
|
|
25967
|
+
const file = yield* since(based, yield* required(options, "file"), { context: yield* around$1(options, "context") });
|
|
25968
|
+
yield* answer(options, { file });
|
|
25969
|
+
});
|
|
25695
25970
|
const configList = fn("Main.configList")(function* (options) {
|
|
25696
25971
|
yield* answer(options, { preferences: yield* list$1() });
|
|
25697
25972
|
});
|
|
@@ -25758,6 +26033,7 @@ const routes = {
|
|
|
25758
26033
|
"layers set": layersSet,
|
|
25759
26034
|
"layers show": layersShow,
|
|
25760
26035
|
"patch show": patchShow,
|
|
26036
|
+
"patch since": patchSince,
|
|
25761
26037
|
upgrade: fn("Main.upgrade")(function* (options) {
|
|
25762
26038
|
const check = options["check"] !== void 0;
|
|
25763
26039
|
const quiet = options["json"] !== void 0;
|
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.
|
|
26
|
+
"version": "0.1.0-alpha.193",
|
|
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": {
|
package/skills/adiff/SKILL.md
CHANGED
|
@@ -237,7 +237,7 @@ adiff layers set --worktree . --json - <<'JSON'
|
|
|
237
237
|
"layers": [
|
|
238
238
|
{
|
|
239
239
|
"title": "Add the invitation data model",
|
|
240
|
-
"note": "The record every later layer leans on",
|
|
240
|
+
"note": "The record every later layer leans on.\n- `expiresAt` is required; nothing reads a missing one\n- One open invitation per email, enforced by an index",
|
|
241
241
|
"spans": [{ "path": "src/db/invites.ts", "start": 1, "end": 48 }]
|
|
242
242
|
},
|
|
243
243
|
{
|
|
@@ -263,6 +263,12 @@ Rules that make a layers worth reading:
|
|
|
263
263
|
- **A title is a claim, not a file name.** "Add the invitation API", never "changes to
|
|
264
264
|
src/api/invites.ts".
|
|
265
265
|
- **Line numbers are the new side of the diff**, the same numbers `adiff comment take` reports.
|
|
266
|
+
- **A note is a lead and a few points, not a paragraph.** The first line says how to read the
|
|
267
|
+
layer or what it claims, in one clause. Then up to four lines, each starting `- `, each one
|
|
268
|
+
decision or surprise the reviewer would otherwise miss. About 220 characters in all. Put names
|
|
269
|
+
from code in backticks, and a newline between points, not semicolons. Leave out the file list
|
|
270
|
+
(the review shows it), asides in parentheses (make one its own point if it matters) and anything
|
|
271
|
+
the title already says.
|
|
266
272
|
- **Cover everything.** adiff computes coverage itself and answers with the changed lines no layer
|
|
267
273
|
claims; those show up for the reviewer under "not in any layer" whatever you do. A layer set that
|
|
268
274
|
quietly skips a third of the diff is worse than none, so put the leftovers in a final layer and
|