@eliya-oss/agent-diff 0.1.0-alpha.191 → 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/.claude/skills/create-pr/SKILL.md +3 -1
- package/CHANGELOG.md +42 -0
- package/dist/main.js +503 -61
- package/package.json +1 -1
- package/skills/adiff/SKILL.md +30 -3
|
@@ -51,7 +51,9 @@ a test fails, nothing is recorded — a green run is the precondition, not a cla
|
|
|
51
51
|
## A recording replays keys, and nothing else
|
|
52
52
|
|
|
53
53
|
The replay rebuilds the world from the trace — the branch fixture and the layers, and nothing more —
|
|
54
|
-
then presses the keys.
|
|
54
|
+
then presses the keys. The one exception is a branch checked out in the directory under review with
|
|
55
|
+
`driver.branch.switchTo`: the trace keeps it as a step, and the replay checks out the same branch at
|
|
56
|
+
the same moment. Anything else a test does by another route is not there: a file changed or
|
|
55
57
|
committed after the world was built, a comment or an answer seeded through the store or the command
|
|
56
58
|
line, a preference set from outside. A test that does any of those marks its trace unreplayable, and
|
|
57
59
|
`pnpm record` skips it and says which route it took.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
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
|
+
|
|
11
|
+
## 0.1.0-alpha.192
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- fix(marks): marking a file after its directory was switched to another branch records nothing, and the footer names the branch the directory is on now.
|
|
16
|
+
|
|
17
|
+
<details><summary>What was wrong</summary>
|
|
18
|
+
|
|
19
|
+
Review state is filed under the branch the directory is on. Checking out another branch there
|
|
20
|
+
mid-review sent every new mark to that branch and showed its marks in the file list, so a review
|
|
21
|
+
with twenty-eight files ticked suddenly showed four.
|
|
22
|
+
|
|
23
|
+
</details>
|
|
24
|
+
|
|
25
|
+
- feat(comment delivery): `adiff comment doing` records one line of what the agent is doing on a comment it took, and `comment list` reports it as `doing` until an answer, a settle or a remove clears it.
|
|
26
|
+
|
|
27
|
+
<details><summary>Why</summary>
|
|
28
|
+
|
|
29
|
+
Between taking a comment and answering it, a comment the agent was ten minutes into looked the same as one it had dropped.
|
|
30
|
+
|
|
31
|
+
</details>
|
|
32
|
+
|
|
33
|
+
feat(comment delivery): `adiff comment answer --choice`, given two to four times, offers the reviewer answers to a question, and `comment list` carries them on that turn as `choices`.
|
|
34
|
+
|
|
35
|
+
feat(CLI): `adiff review progress` names the files marked reviewed whose content changed since, as `changed`.
|
|
36
|
+
|
|
37
|
+
<details><summary>Why</summary>
|
|
38
|
+
|
|
39
|
+
A lapsed mark used to drop silently out of the count, so a file read before the agent rewrote it looked like one never read at all. The mark already held the blob it was made at, so a mark written by an older adiff reports the same way.
|
|
40
|
+
|
|
41
|
+
</details>
|
|
42
|
+
|
|
43
|
+
- feat(CLI): in a Harbor terminal, `adiff review pane` opens the review as a child terminal under the agent's.
|
|
44
|
+
|
|
3
45
|
## 0.1.0-alpha.191
|
|
4
46
|
|
|
5
47
|
### 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
|
}
|
|
@@ -9989,6 +10007,20 @@ var init_pane = __esmMin((() => {
|
|
|
9989
10007
|
repo,
|
|
9990
10008
|
...run
|
|
9991
10009
|
]
|
|
10010
|
+
},
|
|
10011
|
+
{
|
|
10012
|
+
pane: "harbor",
|
|
10013
|
+
binary: "harbor",
|
|
10014
|
+
present: () => set$1("HARBOR_SOCKET") && set$1("HARBOR_PANE_ID"),
|
|
10015
|
+
args: (repo, run) => [
|
|
10016
|
+
"open",
|
|
10017
|
+
"--child",
|
|
10018
|
+
"--cwd",
|
|
10019
|
+
repo,
|
|
10020
|
+
"--",
|
|
10021
|
+
"adiff",
|
|
10022
|
+
...run.slice(run.indexOf("review"))
|
|
10023
|
+
]
|
|
9992
10024
|
}
|
|
9993
10025
|
];
|
|
9994
10026
|
named$4 = (option, value) => value === void 0 ? [] : [`--${option}`, value];
|
|
@@ -10044,7 +10076,7 @@ var init_config = __esmMin((() => {
|
|
|
10044
10076
|
//#region package.json
|
|
10045
10077
|
init_pane();
|
|
10046
10078
|
init_config();
|
|
10047
|
-
var version$1 = "0.1.0-alpha.
|
|
10079
|
+
var version$1 = "0.1.0-alpha.193";
|
|
10048
10080
|
//#endregion
|
|
10049
10081
|
//#region src/cli/error.ts
|
|
10050
10082
|
var UnknownCommand, MissingOption, UnknownField, UnknownOption, BadOption, RegistryUnanswered, NotServed, BadRequest;
|
|
@@ -10444,6 +10476,25 @@ var init_catalog = __esmMin((() => {
|
|
|
10444
10476
|
dataKey: "patch",
|
|
10445
10477
|
example: "adiff patch show --repo . --branch add-invitations --file src/api.ts --context all"
|
|
10446
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
|
+
},
|
|
10447
10498
|
{
|
|
10448
10499
|
name: "file review",
|
|
10449
10500
|
about: "Toggle a file as reviewed. Lapses on its own when the file changes",
|
|
@@ -10458,6 +10509,12 @@ var init_catalog = __esmMin((() => {
|
|
|
10458
10509
|
required: false,
|
|
10459
10510
|
value: "number",
|
|
10460
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"
|
|
10461
10518
|
}
|
|
10462
10519
|
],
|
|
10463
10520
|
dataKey: "reviewed",
|
|
@@ -10490,7 +10547,7 @@ var init_catalog = __esmMin((() => {
|
|
|
10490
10547
|
},
|
|
10491
10548
|
{
|
|
10492
10549
|
name: "review progress",
|
|
10493
|
-
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",
|
|
10494
10551
|
group: READ_A_BRANCH,
|
|
10495
10552
|
addresses: "review",
|
|
10496
10553
|
safety: "read",
|
|
@@ -10572,11 +10629,41 @@ var init_catalog = __esmMin((() => {
|
|
|
10572
10629
|
required: false,
|
|
10573
10630
|
value: "flag",
|
|
10574
10631
|
about: "The answer is a question, and the work waits for a reply"
|
|
10632
|
+
},
|
|
10633
|
+
{
|
|
10634
|
+
name: "choice",
|
|
10635
|
+
required: false,
|
|
10636
|
+
value: "text",
|
|
10637
|
+
about: "One answer the reviewer can pick. Give it 2 to 4 times, in order; it makes the answer a question"
|
|
10575
10638
|
}
|
|
10576
10639
|
],
|
|
10577
10640
|
dataKey: "answered",
|
|
10578
10641
|
example: "adiff comment answer --worktree . --id c1 --body \"dropped it, and the import with it\""
|
|
10579
10642
|
},
|
|
10643
|
+
{
|
|
10644
|
+
name: "comment doing",
|
|
10645
|
+
about: "Say in one line what you are doing on a comment you took. Replaces the last line; an answer clears it",
|
|
10646
|
+
group: ANSWER_COMMENTS,
|
|
10647
|
+
addresses: "review",
|
|
10648
|
+
safety: "write",
|
|
10649
|
+
options: [
|
|
10650
|
+
...addressing,
|
|
10651
|
+
{
|
|
10652
|
+
name: "id",
|
|
10653
|
+
required: true,
|
|
10654
|
+
value: "id",
|
|
10655
|
+
about: "The comment being worked on, as `comment take` reported it"
|
|
10656
|
+
},
|
|
10657
|
+
{
|
|
10658
|
+
name: "body",
|
|
10659
|
+
required: true,
|
|
10660
|
+
value: "text",
|
|
10661
|
+
about: "One short line, such as Editing driver.ts"
|
|
10662
|
+
}
|
|
10663
|
+
],
|
|
10664
|
+
dataKey: "doing",
|
|
10665
|
+
example: "adiff comment doing --worktree . --id c1 --body \"Editing driver.ts\""
|
|
10666
|
+
},
|
|
10580
10667
|
{
|
|
10581
10668
|
name: "layers set",
|
|
10582
10669
|
about: "Write the reading order for this review's diff: ordered layers over spans of files",
|
|
@@ -11023,22 +11110,32 @@ var init_catalog = __esmMin((() => {
|
|
|
11023
11110
|
}));
|
|
11024
11111
|
//#endregion
|
|
11025
11112
|
//#region src/cli/parse.ts
|
|
11026
|
-
var FLAG, flagOn, tokenOn, optionsFrom, onlyKnown, oneOf, required, numeric, WHOLE, around$1, seconds;
|
|
11113
|
+
var FLAG, REPEATED, MANY, withValue, flagOn, tokenOn, optionsFrom, onlyKnown, oneOf, required, numeric, WHOLE, around$1, seconds, many, CHOICES_FEWEST, CHOICES_MOST, choices, oneLine;
|
|
11027
11114
|
var init_parse$1 = __esmMin((() => {
|
|
11028
11115
|
init_dist();
|
|
11029
11116
|
init_catalog();
|
|
11030
11117
|
init_error$5();
|
|
11031
11118
|
FLAG = /^--(?<name>[^=]+)(?:=(?<value>[\s\S]*))?$/;
|
|
11119
|
+
REPEATED = /* @__PURE__ */ new Set(["choice"]);
|
|
11120
|
+
MANY = "\n";
|
|
11121
|
+
withValue = (options, name, value) => {
|
|
11122
|
+
const before = options[name];
|
|
11123
|
+
if (before === void 0 || !REPEATED.has(name)) return {
|
|
11124
|
+
...options,
|
|
11125
|
+
[name]: value
|
|
11126
|
+
};
|
|
11127
|
+
return {
|
|
11128
|
+
...options,
|
|
11129
|
+
[name]: `${before}${MANY}${value}`
|
|
11130
|
+
};
|
|
11131
|
+
};
|
|
11032
11132
|
flagOn = (taken, token, valued) => {
|
|
11033
11133
|
const found = FLAG.exec(token)?.groups;
|
|
11034
11134
|
if (found === void 0) return taken;
|
|
11035
11135
|
const name = found["name"] ?? "";
|
|
11036
|
-
const
|
|
11037
|
-
if (
|
|
11038
|
-
options:
|
|
11039
|
-
...taken.options,
|
|
11040
|
-
[name]: given
|
|
11041
|
-
},
|
|
11136
|
+
const value = found["value"];
|
|
11137
|
+
if (value !== void 0) return {
|
|
11138
|
+
options: withValue(taken.options, name, value),
|
|
11042
11139
|
held: void 0
|
|
11043
11140
|
};
|
|
11044
11141
|
if (valued.has(name)) return {
|
|
@@ -11054,10 +11151,7 @@ var init_parse$1 = __esmMin((() => {
|
|
|
11054
11151
|
};
|
|
11055
11152
|
};
|
|
11056
11153
|
tokenOn = (taken, token, valued) => taken.held === void 0 ? flagOn(taken, token, valued) : {
|
|
11057
|
-
options:
|
|
11058
|
-
...taken.options,
|
|
11059
|
-
[taken.held]: token
|
|
11060
|
-
},
|
|
11154
|
+
options: withValue(taken.options, taken.held, token),
|
|
11061
11155
|
held: void 0
|
|
11062
11156
|
};
|
|
11063
11157
|
optionsFrom = (argv, valued = /* @__PURE__ */ new Set()) => {
|
|
@@ -11125,6 +11219,29 @@ var init_parse$1 = __esmMin((() => {
|
|
|
11125
11219
|
allowed: [`a whole number of seconds from 1 to ${WAIT_MOST}`]
|
|
11126
11220
|
});
|
|
11127
11221
|
});
|
|
11222
|
+
many = (options, name) => {
|
|
11223
|
+
const raw = options[name];
|
|
11224
|
+
return raw === void 0 ? [] : raw.split(MANY);
|
|
11225
|
+
};
|
|
11226
|
+
CHOICES_FEWEST = 2;
|
|
11227
|
+
CHOICES_MOST = 4;
|
|
11228
|
+
choices = fn("Cli.choices")(function* (options, name) {
|
|
11229
|
+
const offered = many(options, name).map((choice) => choice.trim());
|
|
11230
|
+
if (offered.length === 0) return offered;
|
|
11231
|
+
return yield* offered.length >= CHOICES_FEWEST && offered.length <= CHOICES_MOST && offered.every((choice) => choice.length > 0) ? succeed$1(offered) : new BadOption({
|
|
11232
|
+
option: name,
|
|
11233
|
+
given: offered.join(" | "),
|
|
11234
|
+
allowed: [`${CHOICES_FEWEST} to ${CHOICES_MOST} choices, none of them empty`]
|
|
11235
|
+
});
|
|
11236
|
+
});
|
|
11237
|
+
oneLine = fn("Cli.oneLine")(function* (options, name) {
|
|
11238
|
+
const said = (yield* required(options, name)).trim();
|
|
11239
|
+
return yield* said.length > 0 && !said.includes("\n") ? succeed$1(said) : new BadOption({
|
|
11240
|
+
option: name,
|
|
11241
|
+
given: said,
|
|
11242
|
+
allowed: ["one line of text, not empty"]
|
|
11243
|
+
});
|
|
11244
|
+
});
|
|
11128
11245
|
})), ADVICE, FALLBACK, tagOf, project, fieldsOf, narrow, keysIn, strangeField, sharpen, failure;
|
|
11129
11246
|
var init_report$1 = __esmMin((() => {
|
|
11130
11247
|
ADVICE = {
|
|
@@ -11293,6 +11410,16 @@ var init_report$1 = __esmMin((() => {
|
|
|
11293
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.",
|
|
11294
11411
|
retriable: false
|
|
11295
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
|
+
},
|
|
11296
11423
|
UnselectableRange: {
|
|
11297
11424
|
exit: 2,
|
|
11298
11425
|
suggestion: "Those lines are not in the diff. Check --side: new is the working tree, old is the version being replaced.",
|
|
@@ -11997,7 +12124,7 @@ var init_run = __esmMin((() => {
|
|
|
11997
12124
|
gitOrEmpty = fn("Git.runOrEmpty")(function* (cwd, args) {
|
|
11998
12125
|
return yield* git(cwd, args).pipe(catchTag("GitCommandFailed", () => succeed$1("")));
|
|
11999
12126
|
});
|
|
12000
|
-
})), 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;
|
|
12001
12128
|
var init_service$2 = __esmMin((() => {
|
|
12002
12129
|
init_dist();
|
|
12003
12130
|
init_error$4();
|
|
@@ -12151,6 +12278,35 @@ var init_service$2 = __esmMin((() => {
|
|
|
12151
12278
|
const raw = yield* gitOrEmpty(worktree.path, ["show", `${target}:${path}`]);
|
|
12152
12279
|
return raw.length === 0 ? none() : some(splitLines(raw));
|
|
12153
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
|
+
});
|
|
12154
12310
|
readGrep = fn("Git.grep")(function* (worktree, term) {
|
|
12155
12311
|
return yield* gitOrEmpty(worktree.path, [
|
|
12156
12312
|
"grep",
|
|
@@ -12297,6 +12453,9 @@ var init_service$2 = __esmMin((() => {
|
|
|
12297
12453
|
stat: readStat,
|
|
12298
12454
|
source: readSource,
|
|
12299
12455
|
blob: readBlob,
|
|
12456
|
+
keep: keepContent,
|
|
12457
|
+
kept: findKept,
|
|
12458
|
+
between: readBetween,
|
|
12300
12459
|
grep: readGrep,
|
|
12301
12460
|
generated: readGenerated,
|
|
12302
12461
|
defaultBranch: (repo) => get(caches.baseName, repo),
|
|
@@ -12333,6 +12492,7 @@ var init_model$4 = __esmMin((() => {
|
|
|
12333
12492
|
taken: {},
|
|
12334
12493
|
vouches: {},
|
|
12335
12494
|
parts: {},
|
|
12495
|
+
vouchedAt: {},
|
|
12336
12496
|
openedAt: "",
|
|
12337
12497
|
consumed: 0,
|
|
12338
12498
|
settled: {},
|
|
@@ -12340,12 +12500,13 @@ var init_model$4 = __esmMin((() => {
|
|
|
12340
12500
|
base: "",
|
|
12341
12501
|
read: {},
|
|
12342
12502
|
dismissed: {},
|
|
12343
|
-
seen: {}
|
|
12503
|
+
seen: {},
|
|
12504
|
+
doing: {}
|
|
12344
12505
|
};
|
|
12345
12506
|
}));
|
|
12346
12507
|
//#endregion
|
|
12347
12508
|
//#region src/service/store/schema.ts
|
|
12348
|
-
var Side, Anchor, StoredComment, StoredDraft, Drafts, StoredAnswer, Batch, Stamps, Counts, noStamps, BranchState, StoredSaid, StoredRemark, StoredRemarks, Settings, Watching, UpgradeCheck, Prose, Code$1, StoredLayer, StoredLayers;
|
|
12509
|
+
var Side, Anchor, StoredComment, StoredDraft, Drafts, StoredAnswer, Batch, Stamps, Counts, Doing, noStamps, BranchState, StoredSaid, StoredRemark, StoredRemarks, Settings, Watching, UpgradeCheck, Prose, Code$1, StoredLayer, StoredLayers;
|
|
12349
12510
|
var init_schema = __esmMin((() => {
|
|
12350
12511
|
init_dist();
|
|
12351
12512
|
Side = Literals(["old", "new"]);
|
|
@@ -12382,7 +12543,8 @@ var init_schema = __esmMin((() => {
|
|
|
12382
12543
|
body: String$1,
|
|
12383
12544
|
head: String$1,
|
|
12384
12545
|
asks: Boolean,
|
|
12385
|
-
at: String$1
|
|
12546
|
+
at: String$1,
|
|
12547
|
+
choices: optionalKey(ArraySchema(String$1))
|
|
12386
12548
|
});
|
|
12387
12549
|
Batch = Struct({
|
|
12388
12550
|
id: String$1,
|
|
@@ -12392,11 +12554,16 @@ var init_schema = __esmMin((() => {
|
|
|
12392
12554
|
});
|
|
12393
12555
|
Stamps = Record(String$1, String$1);
|
|
12394
12556
|
Counts = Record(String$1, Int);
|
|
12557
|
+
Doing = Record(String$1, Struct({
|
|
12558
|
+
body: String$1,
|
|
12559
|
+
at: String$1
|
|
12560
|
+
}));
|
|
12395
12561
|
noStamps = withDecodingDefaultKey(succeed$1({}));
|
|
12396
12562
|
BranchState = Struct({
|
|
12397
12563
|
taken: optionalKey(Record(String$1, String$1)),
|
|
12398
12564
|
vouches: Stamps.pipe(noStamps),
|
|
12399
12565
|
parts: Stamps.pipe(noStamps),
|
|
12566
|
+
vouchedAt: Stamps.pipe(noStamps),
|
|
12400
12567
|
openedAt: String$1.pipe(withDecodingDefaultKey(succeed$1(""))),
|
|
12401
12568
|
consumed: Int.pipe(withDecodingDefaultKey(succeed$1(0))),
|
|
12402
12569
|
settled: Stamps.pipe(noStamps),
|
|
@@ -12404,7 +12571,8 @@ var init_schema = __esmMin((() => {
|
|
|
12404
12571
|
base: String$1.pipe(withDecodingDefaultKey(succeed$1(""))),
|
|
12405
12572
|
read: Counts.pipe(withDecodingDefaultKey(succeed$1({}))),
|
|
12406
12573
|
dismissed: Stamps.pipe(noStamps),
|
|
12407
|
-
seen: Stamps.pipe(noStamps)
|
|
12574
|
+
seen: Stamps.pipe(noStamps),
|
|
12575
|
+
doing: Doing.pipe(withDecodingDefaultKey(succeed$1({})))
|
|
12408
12576
|
});
|
|
12409
12577
|
StoredSaid = Struct({
|
|
12410
12578
|
by: String$1,
|
|
@@ -12940,12 +13108,15 @@ var init_store = __esmMin((() => {
|
|
|
12940
13108
|
}));
|
|
12941
13109
|
//#endregion
|
|
12942
13110
|
//#region src/review/error.ts
|
|
12943
|
-
var UnknownBranch, 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;
|
|
12944
13112
|
var init_error$2 = __esmMin((() => {
|
|
12945
13113
|
init_dist();
|
|
12946
13114
|
UnknownBranch = class extends TaggedError("UnknownBranch") {};
|
|
13115
|
+
BranchMoved = class extends TaggedError("BranchMoved") {};
|
|
12947
13116
|
UnknownBase = class extends TaggedError("UnknownBase") {};
|
|
12948
13117
|
UnknownFile = class extends TaggedError("UnknownFile") {};
|
|
13118
|
+
NotVouched = class extends TaggedError("NotVouched") {};
|
|
13119
|
+
VouchedVersionGone = class extends TaggedError("VouchedVersionGone") {};
|
|
12949
13120
|
UnknownComment = class extends TaggedError("UnknownComment") {};
|
|
12950
13121
|
UnknownRemark = class extends TaggedError("UnknownRemark") {};
|
|
12951
13122
|
NothingSaid = class extends TaggedError("NothingSaid") {};
|
|
@@ -12963,7 +13134,7 @@ var init_error$2 = __esmMin((() => {
|
|
|
12963
13134
|
NoLayers = class extends TaggedError("NoLayers") {};
|
|
12964
13135
|
NoPull = class extends TaggedError("NoPull") {};
|
|
12965
13136
|
UnknownLayer = class extends TaggedError("UnknownLayer") {};
|
|
12966
|
-
})), realOf, AUTO, askedFor$1, basedOn, named$3, find, basedAt, worktreeAt, patches, reading, waitingOn, summaryOf, summary, list$5, markOpened, lastOpened, repoOf, nameAt, saveReport, refs, forOne, recentBases, setBase, clearBase;
|
|
13137
|
+
})), realOf, AUTO, askedFor$1, basedOn, named$3, SHORT, onNow, stillOn, find, basedAt, worktreeAt, patches, reading, waitingOn, summaryOf, summary, list$5, markOpened, lastOpened, repoOf, nameAt, saveReport, refs, forOne, recentBases, setBase, clearBase;
|
|
12967
13138
|
var init_branches$1 = __esmMin((() => {
|
|
12968
13139
|
init_dist();
|
|
12969
13140
|
init_patch();
|
|
@@ -13043,6 +13214,18 @@ var init_branches$1 = __esmMin((() => {
|
|
|
13043
13214
|
known: worktrees.map((w) => w.branch)
|
|
13044
13215
|
}) : succeed$1(found);
|
|
13045
13216
|
});
|
|
13217
|
+
SHORT = 8;
|
|
13218
|
+
onNow = (worktree, head) => worktree.detached ? `(detached ${head.slice(0, SHORT)})` : head;
|
|
13219
|
+
stillOn = fn("Review.Branch.stillOn")(function* (worktree) {
|
|
13220
|
+
const git = yield* Git;
|
|
13221
|
+
const now = onNow(worktree, yield* git.headOf(worktree.path));
|
|
13222
|
+
if (now === worktree.branch) return worktree;
|
|
13223
|
+
return yield* new BranchMoved({
|
|
13224
|
+
branch: worktree.branch,
|
|
13225
|
+
path: worktree.path,
|
|
13226
|
+
now
|
|
13227
|
+
});
|
|
13228
|
+
});
|
|
13046
13229
|
find = fn("Review.Branch.find")(function* (repo, branch, base) {
|
|
13047
13230
|
return (yield* basedOn(repo, yield* named$3(repo, branch), base)).worktree;
|
|
13048
13231
|
});
|
|
@@ -13187,7 +13370,7 @@ var init_branches$1 = __esmMin((() => {
|
|
|
13187
13370
|
}));
|
|
13188
13371
|
//#endregion
|
|
13189
13372
|
//#region src/review/patches.ts
|
|
13190
|
-
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;
|
|
13191
13374
|
var init_patches = __esmMin((() => {
|
|
13192
13375
|
init_dist();
|
|
13193
13376
|
init_patch();
|
|
@@ -13263,6 +13446,7 @@ var init_patches = __esmMin((() => {
|
|
|
13263
13446
|
generated: generated.has(patch.path) || GENERATED_NAME.test(patch.path),
|
|
13264
13447
|
added: patch.added,
|
|
13265
13448
|
removed: patch.removed,
|
|
13449
|
+
blob: patch.blob,
|
|
13266
13450
|
hunks: patch.hunks.map(shownHunk),
|
|
13267
13451
|
enclosedBy: enclosedBy(lines),
|
|
13268
13452
|
scopes: scopesOf(lines)
|
|
@@ -13272,11 +13456,13 @@ var init_patches = __esmMin((() => {
|
|
|
13272
13456
|
return yield* source(worktree, patch.path);
|
|
13273
13457
|
});
|
|
13274
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);
|
|
13275
13461
|
show$3 = fn("Review.Diff.show")(function* (based, showing) {
|
|
13276
13462
|
const git = yield* Git;
|
|
13277
13463
|
const { worktree } = based;
|
|
13278
13464
|
const patches$3 = yield* patches(worktree, linesAround(showing.context), showing.file);
|
|
13279
|
-
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 });
|
|
13280
13466
|
return {
|
|
13281
13467
|
branch: worktree.branch,
|
|
13282
13468
|
base: based.base,
|
|
@@ -13765,7 +13951,7 @@ var init_comments$1 = __esmMin((() => {
|
|
|
13765
13951
|
}));
|
|
13766
13952
|
//#endregion
|
|
13767
13953
|
//#region src/review/threads.ts
|
|
13768
|
-
var stateOf$2, placedNow$1, answerOf, turnsOf, threadOf, threadsIn$1, idsIn, isKnown, known, list$3, answer$3, repliesTo, settle, without$1, unsettle, remove, restore$1, settleRead;
|
|
13954
|
+
var stateOf$2, placedNow$1, choicesOf, answerOf, turnsOf, threadOf, threadsIn$1, idsIn, rootIn, rootOf, isKnown, known, list$3, clearDoing, doing, answer$3, repliesTo, settle, without$1, unsettle, remove, restore$1, settleRead;
|
|
13769
13955
|
var init_threads$1 = __esmMin((() => {
|
|
13770
13956
|
init_dist();
|
|
13771
13957
|
init_patch();
|
|
@@ -13799,10 +13985,12 @@ var init_threads$1 = __esmMin((() => {
|
|
|
13799
13985
|
})
|
|
13800
13986
|
});
|
|
13801
13987
|
};
|
|
13988
|
+
choicesOf = (entry) => entry.choices === void 0 ? {} : { choices: entry.choices };
|
|
13802
13989
|
answerOf = (entry) => ({
|
|
13803
13990
|
body: entry.body,
|
|
13804
13991
|
at: entry.at,
|
|
13805
|
-
asks: entry.asks
|
|
13992
|
+
asks: entry.asks,
|
|
13993
|
+
...choicesOf(entry)
|
|
13806
13994
|
});
|
|
13807
13995
|
turnsOf = (replies, said) => [...replies.map((held) => ({
|
|
13808
13996
|
voice: "reviewer",
|
|
@@ -13811,7 +13999,8 @@ var init_threads$1 = __esmMin((() => {
|
|
|
13811
13999
|
})), ...said.map((entry) => ({
|
|
13812
14000
|
voice: "agent",
|
|
13813
14001
|
body: entry.body,
|
|
13814
|
-
at: entry.at
|
|
14002
|
+
at: entry.at,
|
|
14003
|
+
...choicesOf(entry)
|
|
13815
14004
|
}))].toSorted((one, other) => one.at < other.at ? -1 : one.at > other.at ? 1 : 0);
|
|
13816
14005
|
threadOf = (held, replies, conversation) => {
|
|
13817
14006
|
const { comment, batch } = held;
|
|
@@ -13821,6 +14010,7 @@ var init_threads$1 = __esmMin((() => {
|
|
|
13821
14010
|
const turns = turnsOf(replies, mine);
|
|
13822
14011
|
const settled = Object.hasOwn(conversation.settled, comment.id);
|
|
13823
14012
|
const sits = placedNow$1(conversation.patches, comment.anchor);
|
|
14013
|
+
const doing = conversation.doing[comment.id];
|
|
13824
14014
|
return {
|
|
13825
14015
|
id: comment.id,
|
|
13826
14016
|
file: comment.anchor.path,
|
|
@@ -13837,7 +14027,8 @@ var init_threads$1 = __esmMin((() => {
|
|
|
13837
14027
|
taken: [...ids].some((id) => Object.hasOwn(conversation.taken, id)),
|
|
13838
14028
|
answers: mine.map(answerOf),
|
|
13839
14029
|
turns,
|
|
13840
|
-
settled
|
|
14030
|
+
settled,
|
|
14031
|
+
...doing === void 0 ? {} : { doing }
|
|
13841
14032
|
};
|
|
13842
14033
|
};
|
|
13843
14034
|
threadsIn$1 = (batches, conversation) => {
|
|
@@ -13850,6 +14041,15 @@ var init_threads$1 = __esmMin((() => {
|
|
|
13850
14041
|
return held.filter((one) => one.comment.replyTo === void 0).map((one) => threadOf(one, under(one), conversation));
|
|
13851
14042
|
};
|
|
13852
14043
|
idsIn = (batches) => batches.flatMap((batch) => batch.comments.map((comment) => comment.id));
|
|
14044
|
+
rootIn = (batches, id) => {
|
|
14045
|
+
const found = batches.flatMap((batch) => batch.comments).find((comment) => comment.id === id);
|
|
14046
|
+
return found === void 0 ? void 0 : found.replyTo ?? found.id;
|
|
14047
|
+
};
|
|
14048
|
+
rootOf = fn("Review.Thread.rootOf")(function* (worktree, id) {
|
|
14049
|
+
const store = yield* Store;
|
|
14050
|
+
const root = rootIn(yield* store.inbox(worktree.path), id);
|
|
14051
|
+
return root === void 0 ? yield* new UnknownComment({ id }) : root;
|
|
14052
|
+
});
|
|
13853
14053
|
isKnown = fn("Review.Thread.isKnown")(function* (worktree, id) {
|
|
13854
14054
|
const store = yield* Store;
|
|
13855
14055
|
return idsIn(yield* store.inbox(worktree.path)).includes(id);
|
|
@@ -13867,19 +14067,52 @@ var init_threads$1 = __esmMin((() => {
|
|
|
13867
14067
|
shown: new Set(patches.map((patch) => patch.path)),
|
|
13868
14068
|
patches,
|
|
13869
14069
|
read: current.read,
|
|
13870
|
-
taken: current.taken ?? {}
|
|
14070
|
+
taken: current.taken ?? {},
|
|
14071
|
+
doing: current.doing
|
|
13871
14072
|
});
|
|
13872
14073
|
});
|
|
14074
|
+
clearDoing = fn("Review.Thread.clearDoing")(function* (worktree, root) {
|
|
14075
|
+
const store = yield* Store;
|
|
14076
|
+
const current = yield* store.state(worktree.path);
|
|
14077
|
+
if (!Object.hasOwn(current.doing, root)) return;
|
|
14078
|
+
yield* store.changeState(worktree.path, (was) => ({
|
|
14079
|
+
...was,
|
|
14080
|
+
doing: without$1(was.doing, root)
|
|
14081
|
+
}));
|
|
14082
|
+
});
|
|
14083
|
+
doing = fn("Review.Thread.doing")(function* (worktree, request) {
|
|
14084
|
+
const store = yield* Store;
|
|
14085
|
+
const root = yield* rootOf(worktree, request.id);
|
|
14086
|
+
const said = {
|
|
14087
|
+
body: request.body,
|
|
14088
|
+
at: request.at
|
|
14089
|
+
};
|
|
14090
|
+
yield* store.changeState(worktree.path, (was) => ({
|
|
14091
|
+
...was,
|
|
14092
|
+
doing: {
|
|
14093
|
+
...was.doing,
|
|
14094
|
+
[root]: said
|
|
14095
|
+
}
|
|
14096
|
+
}));
|
|
14097
|
+
yield* ignore(store.noteWatching(worktree.path, request.at));
|
|
14098
|
+
return { doing: {
|
|
14099
|
+
id: root,
|
|
14100
|
+
...said
|
|
14101
|
+
} };
|
|
14102
|
+
});
|
|
13873
14103
|
answer$3 = fn("Review.Thread.answer")(function* (worktree, request) {
|
|
13874
14104
|
const store = yield* Store;
|
|
13875
|
-
yield*
|
|
14105
|
+
const root = yield* rootOf(worktree, request.id);
|
|
14106
|
+
const offered = request.choices.length > 0;
|
|
13876
14107
|
yield* store.answer(worktree.path, {
|
|
13877
14108
|
comment: request.id,
|
|
13878
14109
|
body: request.body,
|
|
13879
14110
|
head: worktree.head,
|
|
13880
|
-
asks: request.asks,
|
|
13881
|
-
at: request.at
|
|
14111
|
+
asks: request.asks || offered,
|
|
14112
|
+
at: request.at,
|
|
14113
|
+
...offered ? { choices: request.choices } : {}
|
|
13882
14114
|
});
|
|
14115
|
+
yield* clearDoing(worktree, root);
|
|
13883
14116
|
yield* ignore(store.noteWatching(worktree.path, request.at));
|
|
13884
14117
|
return { answered: (yield* store.answers(worktree.path)).filter((entry) => entry.comment === request.id).length };
|
|
13885
14118
|
});
|
|
@@ -13899,7 +14132,8 @@ var init_threads$1 = __esmMin((() => {
|
|
|
13899
14132
|
read: {
|
|
13900
14133
|
...was.read,
|
|
13901
14134
|
[id]: replies
|
|
13902
|
-
}
|
|
14135
|
+
},
|
|
14136
|
+
doing: without$1(was.doing, id)
|
|
13903
14137
|
}));
|
|
13904
14138
|
return { settled: id };
|
|
13905
14139
|
});
|
|
@@ -13929,7 +14163,8 @@ var init_threads$1 = __esmMin((() => {
|
|
|
13929
14163
|
read: {
|
|
13930
14164
|
...was.read,
|
|
13931
14165
|
[id]: replies
|
|
13932
|
-
}
|
|
14166
|
+
},
|
|
14167
|
+
doing: without$1(was.doing, id)
|
|
13933
14168
|
}));
|
|
13934
14169
|
return { removed: id };
|
|
13935
14170
|
});
|
|
@@ -13972,7 +14207,7 @@ var init_error$1 = __esmMin((() => {
|
|
|
13972
14207
|
}));
|
|
13973
14208
|
//#endregion
|
|
13974
14209
|
//#region src/service/forge/service.ts
|
|
13975
|
-
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;
|
|
13976
14211
|
var init_service = __esmMin((() => {
|
|
13977
14212
|
init_dist();
|
|
13978
14213
|
init_error$1();
|
|
@@ -14174,7 +14409,7 @@ var init_service = __esmMin((() => {
|
|
|
14174
14409
|
readLanded = decodeUnknownOption(Landed);
|
|
14175
14410
|
jsonOf$1 = liftThrowable((raw) => JSON.parse(raw));
|
|
14176
14411
|
keyOf$2 = (path, line) => `${path}:${line}`;
|
|
14177
|
-
counted$
|
|
14412
|
+
counted$2 = (back) => {
|
|
14178
14413
|
const room = /* @__PURE__ */ new Map();
|
|
14179
14414
|
back.forEach((one) => {
|
|
14180
14415
|
const key = keyOf$2(one.path, one.line ?? 0);
|
|
@@ -14186,7 +14421,7 @@ var init_service = __esmMin((() => {
|
|
|
14186
14421
|
landedIn = (said, asked) => {
|
|
14187
14422
|
const back = acknowledged(said);
|
|
14188
14423
|
if (back === void 0) return [];
|
|
14189
|
-
const room = counted$
|
|
14424
|
+
const room = counted$2(back);
|
|
14190
14425
|
return asked.flatMap((one, at) => {
|
|
14191
14426
|
const key = keyOf$2(one.path, one.line);
|
|
14192
14427
|
const left = room.get(key) ?? 0;
|
|
@@ -14695,17 +14930,41 @@ var init_review$1 = __esmMin((() => {
|
|
|
14695
14930
|
}));
|
|
14696
14931
|
//#endregion
|
|
14697
14932
|
//#region src/review/vouching.ts
|
|
14698
|
-
var 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;
|
|
14699
14934
|
var init_vouching$1 = __esmMin((() => {
|
|
14700
14935
|
init_dist();
|
|
14936
|
+
init_patch();
|
|
14701
14937
|
init_review$1();
|
|
14938
|
+
init_git();
|
|
14702
14939
|
init_store();
|
|
14703
14940
|
init_error$2();
|
|
14941
|
+
init_branches$1();
|
|
14704
14942
|
init_patches();
|
|
14943
|
+
pathOfMark = (mark) => mark.split("@")[0] ?? "";
|
|
14944
|
+
changedSince = (marks, files) => {
|
|
14945
|
+
const recorded = marks.flatMap((held) => Object.entries(held));
|
|
14946
|
+
const blobsOf = (file) => recorded.filter(([mark]) => pathOfMark(mark) === file.path).map(([, blob]) => blob);
|
|
14947
|
+
const lapsed = (file) => {
|
|
14948
|
+
const blobs = blobsOf(file);
|
|
14949
|
+
return blobs.length > 0 && !blobs.includes(file.blob);
|
|
14950
|
+
};
|
|
14951
|
+
return files.filter(lapsed).map((file) => file.path);
|
|
14952
|
+
};
|
|
14705
14953
|
readParts = (parts, files) => {
|
|
14706
14954
|
const blobs = new Map(files.map((file) => [file.path, file.blob]));
|
|
14707
|
-
return Object.entries(parts).filter(([part, blob]) => blobs.get(part
|
|
14955
|
+
return Object.entries(parts).filter(([part, blob]) => blobs.get(pathOfMark(part)) === blob).map(([part]) => part);
|
|
14708
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
|
+
});
|
|
14709
14968
|
blobIn = fn("Review.Vouch.blobIn")(function* (reading, file) {
|
|
14710
14969
|
return yield* match$3(blobOf(reading.patches, file), {
|
|
14711
14970
|
onNone: () => new UnknownFile({
|
|
@@ -14715,16 +14974,35 @@ var init_vouching$1 = __esmMin((() => {
|
|
|
14715
14974
|
onSome: succeed$1
|
|
14716
14975
|
});
|
|
14717
14976
|
});
|
|
14718
|
-
|
|
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 = {}) {
|
|
14719
14994
|
const store = yield* Store;
|
|
14720
14995
|
const patches = reading.patches;
|
|
14721
|
-
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
|
+
});
|
|
14722
15003
|
const current = yield* store.state(reading.worktree.path);
|
|
14723
15004
|
const next = vouch$1(current.vouches, file, blob);
|
|
14724
|
-
yield* store.changeState(reading.worktree.path, (was) => (
|
|
14725
|
-
...was,
|
|
14726
|
-
vouches: vouch$1(was.vouches, file, blob)
|
|
14727
|
-
}));
|
|
15005
|
+
yield* store.changeState(reading.worktree.path, (was) => stateAfter(was, file, blob, at));
|
|
14728
15006
|
const files = patches.map((patch) => ({
|
|
14729
15007
|
path: patch.path,
|
|
14730
15008
|
blob: patch.blob
|
|
@@ -14735,18 +15013,146 @@ var init_vouching$1 = __esmMin((() => {
|
|
|
14735
15013
|
total: patches.length
|
|
14736
15014
|
};
|
|
14737
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
|
+
});
|
|
14738
15098
|
progress = fn("Review.Vouch.progress")(function* (reading) {
|
|
14739
15099
|
const current = yield* (yield* Store).state(reading.worktree.path);
|
|
14740
15100
|
const files = reading.patches.map((patch) => ({
|
|
14741
15101
|
path: patch.path,
|
|
14742
15102
|
blob: patch.blob
|
|
14743
15103
|
}));
|
|
15104
|
+
const changed = changedSince([current.vouches, current.parts], files);
|
|
14744
15105
|
return {
|
|
14745
15106
|
vouched: files.filter((file) => isVouched(current.vouches, file.path, file.blob)).map((f) => f.path),
|
|
14746
15107
|
parts: readParts(current.parts, files),
|
|
15108
|
+
changed,
|
|
15109
|
+
since: yield* sinceReview(reading, current, changed),
|
|
14747
15110
|
total: reading.patches.length
|
|
14748
15111
|
};
|
|
14749
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
|
+
});
|
|
14750
15156
|
}));
|
|
14751
15157
|
//#endregion
|
|
14752
15158
|
//#region src/domain/preferences/model.ts
|
|
@@ -15096,18 +15502,31 @@ var init_layers = __esmMin((() => {
|
|
|
15096
15502
|
};
|
|
15097
15503
|
});
|
|
15098
15504
|
partsOfFile = (layers, file) => layers.map((layer) => layer.spans.filter((span) => span.path === file)).filter((spans) => spans.length > 0).map((spans) => partOf(file, spans));
|
|
15099
|
-
vouchPart = fn("Review.Layers.vouchPart")(function* (reading, file, part) {
|
|
15505
|
+
vouchPart = fn("Review.Layers.vouchPart")(function* (reading, file, part, marking = {}) {
|
|
15100
15506
|
const store = yield* Store;
|
|
15101
|
-
const
|
|
15507
|
+
const onDisk = reading.patches.find((one) => one.path === file)?.blob ?? "";
|
|
15508
|
+
const blob = marking.blob ?? onDisk;
|
|
15102
15509
|
const held = yield* read(reading);
|
|
15103
15510
|
const wanted = partsOfFile(held.layers, file);
|
|
15104
15511
|
const current = yield* store.state(reading.worktree.path);
|
|
15105
15512
|
const parts = vouchPart$1(current.parts, part, blob);
|
|
15106
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
|
+
});
|
|
15107
15519
|
yield* store.changeState(reading.worktree.path, (was) => ({
|
|
15108
15520
|
...was,
|
|
15109
15521
|
parts,
|
|
15110
|
-
vouches
|
|
15522
|
+
vouches,
|
|
15523
|
+
vouchedAt: restamped(was.vouchedAt, {
|
|
15524
|
+
...was.vouches,
|
|
15525
|
+
...was.parts
|
|
15526
|
+
}, {
|
|
15527
|
+
...vouches,
|
|
15528
|
+
...parts
|
|
15529
|
+
}, at)
|
|
15111
15530
|
}));
|
|
15112
15531
|
const files = reading.patches.map((one) => ({
|
|
15113
15532
|
path: one.path,
|
|
@@ -15148,7 +15567,7 @@ var init_layers = __esmMin((() => {
|
|
|
15148
15567
|
return { asked: body };
|
|
15149
15568
|
});
|
|
15150
15569
|
claims = (layer, file) => layer.spans.some((span) => span.path === file);
|
|
15151
|
-
vouchIn = fn("Review.Layers.vouchIn")(function* (reading, file, number) {
|
|
15570
|
+
vouchIn = fn("Review.Layers.vouchIn")(function* (reading, file, number, marking = {}) {
|
|
15152
15571
|
const held = yield* read(reading);
|
|
15153
15572
|
const layer = held.layers[number - 1];
|
|
15154
15573
|
if (layer === void 0) return yield* new UnknownLayer({
|
|
@@ -15157,8 +15576,8 @@ var init_layers = __esmMin((() => {
|
|
|
15157
15576
|
});
|
|
15158
15577
|
const holding = held.layers.filter((one) => claims(one, file)).length;
|
|
15159
15578
|
const spans = layer.spans.filter((span) => span.path === file);
|
|
15160
|
-
if (holding < 2 || spans.length === 0) return yield* toggle(reading, file);
|
|
15161
|
-
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);
|
|
15162
15581
|
});
|
|
15163
15582
|
}));
|
|
15164
15583
|
//#endregion
|
|
@@ -22711,11 +23130,11 @@ var init_reading = __esmMin((() => {
|
|
|
22711
23130
|
worktreeFor = (app, branch) => readingHeld(app, branch)?.worktree;
|
|
22712
23131
|
worktreeOf = (app, branch) => {
|
|
22713
23132
|
const held = worktreeFor(app, branch);
|
|
22714
|
-
return held === void 0 ? find(app.repo, branch) :
|
|
23133
|
+
return held === void 0 ? find(app.repo, branch) : stillOn(held);
|
|
22715
23134
|
};
|
|
22716
23135
|
readingOf = (app, branch) => {
|
|
22717
23136
|
const held = readingHeld(app, branch);
|
|
22718
|
-
return held === void 0 ? reading(app.repo, branch) :
|
|
23137
|
+
return held === void 0 ? reading(app.repo, branch) : as(stillOn(held.worktree), held);
|
|
22719
23138
|
};
|
|
22720
23139
|
loadSent = (app, branch) => flatMap(readingOf(app, branch), listSent);
|
|
22721
23140
|
remarksHeld = (app, reading) => app.state.remarksOn ? list$2(reading) : succeed$1([]);
|
|
@@ -24568,7 +24987,7 @@ var init_vouching = __esmMin((() => {
|
|
|
24568
24987
|
}));
|
|
24569
24988
|
//#endregion
|
|
24570
24989
|
//#region src/tui/app.ts
|
|
24571
|
-
var LEAVING_MS, LOOK_MS, AGE_TICK_MS, NOTICE_MS, WORTH_TIMING_MS, TIMES_KEPT, SLOWEST_KEPT, KEY_HISTORY, TRAIL_HISTORY, DRAIN_PASSES, LEAVING_SAID, leavingSaid, clockOf, momentOf, noticeOf, turnedOver, unmoved, chosenIn, EFFECTS, App, settingsHeld, firstBranches, missing, openingOn, sessionToResume, asidesMade, treeSitterFreed, shownOn, painting, ticking, noticing, noticingFiled, launch, untilDestroyed, runOn, rendererMade, runTui;
|
|
24990
|
+
var LEAVING_MS, LOOK_MS, AGE_TICK_MS, NOTICE_MS, WORTH_TIMING_MS, TIMES_KEPT, SLOWEST_KEPT, KEY_HISTORY, TRAIL_HISTORY, DRAIN_PASSES, LEAVING_SAID, leavingSaid, clockOf, momentOf, noticeOf, turnedOver, unmoved, chosenIn, EFFECTS, movedSaid, App, settingsHeld, firstBranches, missing, openingOn, sessionToResume, asidesMade, treeSitterFreed, shownOn, painting, ticking, noticing, noticingFiled, launch, untilDestroyed, runOn, rendererMade, runTui;
|
|
24572
24991
|
var init_app = __esmMin((() => {
|
|
24573
24992
|
init_dist();
|
|
24574
24993
|
init_preferences$1();
|
|
@@ -24694,6 +25113,7 @@ var init_app = __esmMin((() => {
|
|
|
24694
25113
|
"match.next": (app) => walkMatches(app, 1),
|
|
24695
25114
|
"match.prev": (app) => walkMatches(app, -1)
|
|
24696
25115
|
};
|
|
25116
|
+
movedSaid = (moved) => `nothing recorded: the directory of ${moved.branch} is on ${moved.now} now`;
|
|
24697
25117
|
App = class {
|
|
24698
25118
|
renderer;
|
|
24699
25119
|
screen;
|
|
@@ -24798,7 +25218,7 @@ var init_app = __esmMin((() => {
|
|
|
24798
25218
|
}
|
|
24799
25219
|
act(intent) {
|
|
24800
25220
|
const began = Date.now();
|
|
24801
|
-
return this.answer(intent).pipe(catchCause((cause) => sync(() => this.fail(squash(cause)))), ensuring(sync(() => this.timed(began))));
|
|
25221
|
+
return this.answer(intent).pipe(catchTag("BranchMoved", (moved) => sync(() => this.commit(withNotice(this.state, movedSaid(moved))))), catchCause((cause) => sync(() => this.fail(squash(cause)))), ensuring(sync(() => this.timed(began))));
|
|
24802
25222
|
}
|
|
24803
25223
|
answer(intent) {
|
|
24804
25224
|
return Intent.$match(intent, {
|
|
@@ -25393,10 +25813,19 @@ const commentAnswer = fn("Main.commentAnswer")(function* (options) {
|
|
|
25393
25813
|
id: yield* required(options, "id"),
|
|
25394
25814
|
body: yield* required(options, "body"),
|
|
25395
25815
|
asks: options["question"] !== void 0,
|
|
25396
|
-
at: stamp(options)
|
|
25816
|
+
at: stamp(options),
|
|
25817
|
+
choices: yield* choices(options, "choice")
|
|
25397
25818
|
});
|
|
25398
25819
|
yield* answer(options, { answered: report.answered });
|
|
25399
25820
|
});
|
|
25821
|
+
const commentDoing = fn("Main.commentDoing")(function* (options) {
|
|
25822
|
+
const report = yield* doing(yield* worktreeNamed(options), {
|
|
25823
|
+
id: yield* required(options, "id"),
|
|
25824
|
+
body: yield* oneLine(options, "body"),
|
|
25825
|
+
at: stamp(options)
|
|
25826
|
+
});
|
|
25827
|
+
yield* answer(options, report);
|
|
25828
|
+
});
|
|
25400
25829
|
const remarkList = fn("Main.remarkList")(function* (options) {
|
|
25401
25830
|
const remarks = yield* fetch$1(yield* required(options, "repo"), yield* readingIn(options));
|
|
25402
25831
|
yield* answer(options, { remarks });
|
|
@@ -25487,8 +25916,12 @@ const commentReopen = fn("Main.commentReopen")(function* (options) {
|
|
|
25487
25916
|
const vouched = fn("Main.vouched")(function* (options) {
|
|
25488
25917
|
const reading = yield* readingIn(options);
|
|
25489
25918
|
const file = yield* required(options, "file");
|
|
25490
|
-
|
|
25491
|
-
|
|
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);
|
|
25492
25925
|
});
|
|
25493
25926
|
const fileReview = fn("Main.fileReview")(function* (options) {
|
|
25494
25927
|
const report = yield* vouched(options);
|
|
@@ -25501,6 +25934,8 @@ const reviewStatus = fn("Main.reviewStatus")(function* (options) {
|
|
|
25501
25934
|
const report = yield* progress(yield* readingIn(options));
|
|
25502
25935
|
yield* answer(options, {
|
|
25503
25936
|
reviewed: report.vouched,
|
|
25937
|
+
changed: report.changed,
|
|
25938
|
+
since: report.since,
|
|
25504
25939
|
total: report.total
|
|
25505
25940
|
});
|
|
25506
25941
|
});
|
|
@@ -25527,6 +25962,11 @@ const patchShow = fn("Main.patchShow")(function* (options) {
|
|
|
25527
25962
|
});
|
|
25528
25963
|
yield* answer(options, { patch });
|
|
25529
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
|
+
});
|
|
25530
25970
|
const configList = fn("Main.configList")(function* (options) {
|
|
25531
25971
|
yield* answer(options, { preferences: yield* list$1() });
|
|
25532
25972
|
});
|
|
@@ -25564,6 +26004,7 @@ const routes = {
|
|
|
25564
26004
|
"comment reply": commentReply,
|
|
25565
26005
|
"comment take": commentTake,
|
|
25566
26006
|
"comment answer": commentAnswer,
|
|
26007
|
+
"comment doing": commentDoing,
|
|
25567
26008
|
"comment list": commentList,
|
|
25568
26009
|
"remark list": remarkList,
|
|
25569
26010
|
"remark accept": remarkAccept,
|
|
@@ -25592,6 +26033,7 @@ const routes = {
|
|
|
25592
26033
|
"layers set": layersSet,
|
|
25593
26034
|
"layers show": layersShow,
|
|
25594
26035
|
"patch show": patchShow,
|
|
26036
|
+
"patch since": patchSince,
|
|
25595
26037
|
upgrade: fn("Main.upgrade")(function* (options) {
|
|
25596
26038
|
const check = options["check"] !== void 0;
|
|
25597
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
|
@@ -98,6 +98,26 @@ adiff comment answer --worktree . --id <id> --question --body "Drop it, or keep
|
|
|
98
98
|
That marks the thread as waiting on them rather than on you. Do not use it to check in; use it when
|
|
99
99
|
the work genuinely stops without an answer.
|
|
100
100
|
|
|
101
|
+
When the answers you expect are few and short, offer them with `--choice`, two to four times. The
|
|
102
|
+
reviewer can pick one instead of typing it, and it reaches you as an ordinary reply carrying those
|
|
103
|
+
words. `--choice` marks the answer a question on its own:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
adiff comment answer --worktree . --id <id> --body "Drop it, or keep it and map the error?" --choice "Drop it" --choice "Keep it and map the error"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Say what you are doing on a comment
|
|
110
|
+
|
|
111
|
+
A comment that takes more than a minute looks to the reviewer exactly like one you dropped. After
|
|
112
|
+
you take it, say in one short line what you are doing on it, and say it again when that changes:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
adiff comment doing --worktree . --id <id> --body "Editing driver.ts"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The reviewer sees the latest line on the comment. Your answer clears it, so there is nothing to
|
|
119
|
+
take back when you finish. Keep it to what you are doing now, not a plan.
|
|
120
|
+
|
|
101
121
|
## When the reviewer writes back
|
|
102
122
|
|
|
103
123
|
A reviewer can reply to an answer, and the reply arrives through `comment take` like any other
|
|
@@ -166,8 +186,9 @@ type. The answer says what happened:
|
|
|
166
186
|
{"ok":true,"opened":true,"pane":"tmux","command":"adiff review open --repo /work/api --branch add-invitations"}
|
|
167
187
|
```
|
|
168
188
|
|
|
169
|
-
|
|
170
|
-
|
|
189
|
+
In Harbor the review opens as a child terminal under yours instead of a split. `opened:false` means
|
|
190
|
+
nothing could be split, which is ordinary: a terminal without tmux, Zellij, WezTerm, kitty or Harbor
|
|
191
|
+
has nowhere to put a pane. The answer carries `command` either way, so quote that
|
|
171
192
|
line and let them run it.
|
|
172
193
|
|
|
173
194
|
Open a pane when a review was asked for. Finishing work is not a reason on its own, and taking over
|
|
@@ -216,7 +237,7 @@ adiff layers set --worktree . --json - <<'JSON'
|
|
|
216
237
|
"layers": [
|
|
217
238
|
{
|
|
218
239
|
"title": "Add the invitation data model",
|
|
219
|
-
"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",
|
|
220
241
|
"spans": [{ "path": "src/db/invites.ts", "start": 1, "end": 48 }]
|
|
221
242
|
},
|
|
222
243
|
{
|
|
@@ -242,6 +263,12 @@ Rules that make a layers worth reading:
|
|
|
242
263
|
- **A title is a claim, not a file name.** "Add the invitation API", never "changes to
|
|
243
264
|
src/api/invites.ts".
|
|
244
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.
|
|
245
272
|
- **Cover everything.** adiff computes coverage itself and answers with the changed lines no layer
|
|
246
273
|
claims; those show up for the reviewer under "not in any layer" whatever you do. A layer set that
|
|
247
274
|
quietly skips a third of the diff is worse than none, so put the leftovers in a final layer and
|