@eliya-oss/agent-diff 0.1.0-alpha.191 → 0.1.0-alpha.192
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 +34 -0
- package/dist/main.js +201 -35
- package/package.json +1 -1
- package/skills/adiff/SKILL.md +23 -2
|
@@ -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,39 @@
|
|
|
1
1
|
# @eliya-oss/agent-diff
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.192
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
|
|
9
|
+
<details><summary>What was wrong</summary>
|
|
10
|
+
|
|
11
|
+
Review state is filed under the branch the directory is on. Checking out another branch there
|
|
12
|
+
mid-review sent every new mark to that branch and showed its marks in the file list, so a review
|
|
13
|
+
with twenty-eight files ticked suddenly showed four.
|
|
14
|
+
|
|
15
|
+
</details>
|
|
16
|
+
|
|
17
|
+
- 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.
|
|
18
|
+
|
|
19
|
+
<details><summary>Why</summary>
|
|
20
|
+
|
|
21
|
+
Between taking a comment and answering it, a comment the agent was ten minutes into looked the same as one it had dropped.
|
|
22
|
+
|
|
23
|
+
</details>
|
|
24
|
+
|
|
25
|
+
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`.
|
|
26
|
+
|
|
27
|
+
feat(CLI): `adiff review progress` names the files marked reviewed whose content changed since, as `changed`.
|
|
28
|
+
|
|
29
|
+
<details><summary>Why</summary>
|
|
30
|
+
|
|
31
|
+
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.
|
|
32
|
+
|
|
33
|
+
</details>
|
|
34
|
+
|
|
35
|
+
- feat(CLI): in a Harbor terminal, `adiff review pane` opens the review as a child terminal under the agent's.
|
|
36
|
+
|
|
3
37
|
## 0.1.0-alpha.191
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
package/dist/main.js
CHANGED
|
@@ -9989,6 +9989,20 @@ var init_pane = __esmMin((() => {
|
|
|
9989
9989
|
repo,
|
|
9990
9990
|
...run
|
|
9991
9991
|
]
|
|
9992
|
+
},
|
|
9993
|
+
{
|
|
9994
|
+
pane: "harbor",
|
|
9995
|
+
binary: "harbor",
|
|
9996
|
+
present: () => set$1("HARBOR_SOCKET") && set$1("HARBOR_PANE_ID"),
|
|
9997
|
+
args: (repo, run) => [
|
|
9998
|
+
"open",
|
|
9999
|
+
"--child",
|
|
10000
|
+
"--cwd",
|
|
10001
|
+
repo,
|
|
10002
|
+
"--",
|
|
10003
|
+
"adiff",
|
|
10004
|
+
...run.slice(run.indexOf("review"))
|
|
10005
|
+
]
|
|
9992
10006
|
}
|
|
9993
10007
|
];
|
|
9994
10008
|
named$4 = (option, value) => value === void 0 ? [] : [`--${option}`, value];
|
|
@@ -10044,7 +10058,7 @@ var init_config = __esmMin((() => {
|
|
|
10044
10058
|
//#region package.json
|
|
10045
10059
|
init_pane();
|
|
10046
10060
|
init_config();
|
|
10047
|
-
var version$1 = "0.1.0-alpha.
|
|
10061
|
+
var version$1 = "0.1.0-alpha.192";
|
|
10048
10062
|
//#endregion
|
|
10049
10063
|
//#region src/cli/error.ts
|
|
10050
10064
|
var UnknownCommand, MissingOption, UnknownField, UnknownOption, BadOption, RegistryUnanswered, NotServed, BadRequest;
|
|
@@ -10572,11 +10586,41 @@ var init_catalog = __esmMin((() => {
|
|
|
10572
10586
|
required: false,
|
|
10573
10587
|
value: "flag",
|
|
10574
10588
|
about: "The answer is a question, and the work waits for a reply"
|
|
10589
|
+
},
|
|
10590
|
+
{
|
|
10591
|
+
name: "choice",
|
|
10592
|
+
required: false,
|
|
10593
|
+
value: "text",
|
|
10594
|
+
about: "One answer the reviewer can pick. Give it 2 to 4 times, in order; it makes the answer a question"
|
|
10575
10595
|
}
|
|
10576
10596
|
],
|
|
10577
10597
|
dataKey: "answered",
|
|
10578
10598
|
example: "adiff comment answer --worktree . --id c1 --body \"dropped it, and the import with it\""
|
|
10579
10599
|
},
|
|
10600
|
+
{
|
|
10601
|
+
name: "comment doing",
|
|
10602
|
+
about: "Say in one line what you are doing on a comment you took. Replaces the last line; an answer clears it",
|
|
10603
|
+
group: ANSWER_COMMENTS,
|
|
10604
|
+
addresses: "review",
|
|
10605
|
+
safety: "write",
|
|
10606
|
+
options: [
|
|
10607
|
+
...addressing,
|
|
10608
|
+
{
|
|
10609
|
+
name: "id",
|
|
10610
|
+
required: true,
|
|
10611
|
+
value: "id",
|
|
10612
|
+
about: "The comment being worked on, as `comment take` reported it"
|
|
10613
|
+
},
|
|
10614
|
+
{
|
|
10615
|
+
name: "body",
|
|
10616
|
+
required: true,
|
|
10617
|
+
value: "text",
|
|
10618
|
+
about: "One short line, such as Editing driver.ts"
|
|
10619
|
+
}
|
|
10620
|
+
],
|
|
10621
|
+
dataKey: "doing",
|
|
10622
|
+
example: "adiff comment doing --worktree . --id c1 --body \"Editing driver.ts\""
|
|
10623
|
+
},
|
|
10580
10624
|
{
|
|
10581
10625
|
name: "layers set",
|
|
10582
10626
|
about: "Write the reading order for this review's diff: ordered layers over spans of files",
|
|
@@ -11023,22 +11067,32 @@ var init_catalog = __esmMin((() => {
|
|
|
11023
11067
|
}));
|
|
11024
11068
|
//#endregion
|
|
11025
11069
|
//#region src/cli/parse.ts
|
|
11026
|
-
var FLAG, flagOn, tokenOn, optionsFrom, onlyKnown, oneOf, required, numeric, WHOLE, around$1, seconds;
|
|
11070
|
+
var FLAG, REPEATED, MANY, withValue, flagOn, tokenOn, optionsFrom, onlyKnown, oneOf, required, numeric, WHOLE, around$1, seconds, many, CHOICES_FEWEST, CHOICES_MOST, choices, oneLine;
|
|
11027
11071
|
var init_parse$1 = __esmMin((() => {
|
|
11028
11072
|
init_dist();
|
|
11029
11073
|
init_catalog();
|
|
11030
11074
|
init_error$5();
|
|
11031
11075
|
FLAG = /^--(?<name>[^=]+)(?:=(?<value>[\s\S]*))?$/;
|
|
11076
|
+
REPEATED = /* @__PURE__ */ new Set(["choice"]);
|
|
11077
|
+
MANY = "\n";
|
|
11078
|
+
withValue = (options, name, value) => {
|
|
11079
|
+
const before = options[name];
|
|
11080
|
+
if (before === void 0 || !REPEATED.has(name)) return {
|
|
11081
|
+
...options,
|
|
11082
|
+
[name]: value
|
|
11083
|
+
};
|
|
11084
|
+
return {
|
|
11085
|
+
...options,
|
|
11086
|
+
[name]: `${before}${MANY}${value}`
|
|
11087
|
+
};
|
|
11088
|
+
};
|
|
11032
11089
|
flagOn = (taken, token, valued) => {
|
|
11033
11090
|
const found = FLAG.exec(token)?.groups;
|
|
11034
11091
|
if (found === void 0) return taken;
|
|
11035
11092
|
const name = found["name"] ?? "";
|
|
11036
|
-
const
|
|
11037
|
-
if (
|
|
11038
|
-
options:
|
|
11039
|
-
...taken.options,
|
|
11040
|
-
[name]: given
|
|
11041
|
-
},
|
|
11093
|
+
const value = found["value"];
|
|
11094
|
+
if (value !== void 0) return {
|
|
11095
|
+
options: withValue(taken.options, name, value),
|
|
11042
11096
|
held: void 0
|
|
11043
11097
|
};
|
|
11044
11098
|
if (valued.has(name)) return {
|
|
@@ -11054,10 +11108,7 @@ var init_parse$1 = __esmMin((() => {
|
|
|
11054
11108
|
};
|
|
11055
11109
|
};
|
|
11056
11110
|
tokenOn = (taken, token, valued) => taken.held === void 0 ? flagOn(taken, token, valued) : {
|
|
11057
|
-
options:
|
|
11058
|
-
...taken.options,
|
|
11059
|
-
[taken.held]: token
|
|
11060
|
-
},
|
|
11111
|
+
options: withValue(taken.options, taken.held, token),
|
|
11061
11112
|
held: void 0
|
|
11062
11113
|
};
|
|
11063
11114
|
optionsFrom = (argv, valued = /* @__PURE__ */ new Set()) => {
|
|
@@ -11125,6 +11176,29 @@ var init_parse$1 = __esmMin((() => {
|
|
|
11125
11176
|
allowed: [`a whole number of seconds from 1 to ${WAIT_MOST}`]
|
|
11126
11177
|
});
|
|
11127
11178
|
});
|
|
11179
|
+
many = (options, name) => {
|
|
11180
|
+
const raw = options[name];
|
|
11181
|
+
return raw === void 0 ? [] : raw.split(MANY);
|
|
11182
|
+
};
|
|
11183
|
+
CHOICES_FEWEST = 2;
|
|
11184
|
+
CHOICES_MOST = 4;
|
|
11185
|
+
choices = fn("Cli.choices")(function* (options, name) {
|
|
11186
|
+
const offered = many(options, name).map((choice) => choice.trim());
|
|
11187
|
+
if (offered.length === 0) return offered;
|
|
11188
|
+
return yield* offered.length >= CHOICES_FEWEST && offered.length <= CHOICES_MOST && offered.every((choice) => choice.length > 0) ? succeed$1(offered) : new BadOption({
|
|
11189
|
+
option: name,
|
|
11190
|
+
given: offered.join(" | "),
|
|
11191
|
+
allowed: [`${CHOICES_FEWEST} to ${CHOICES_MOST} choices, none of them empty`]
|
|
11192
|
+
});
|
|
11193
|
+
});
|
|
11194
|
+
oneLine = fn("Cli.oneLine")(function* (options, name) {
|
|
11195
|
+
const said = (yield* required(options, name)).trim();
|
|
11196
|
+
return yield* said.length > 0 && !said.includes("\n") ? succeed$1(said) : new BadOption({
|
|
11197
|
+
option: name,
|
|
11198
|
+
given: said,
|
|
11199
|
+
allowed: ["one line of text, not empty"]
|
|
11200
|
+
});
|
|
11201
|
+
});
|
|
11128
11202
|
})), ADVICE, FALLBACK, tagOf, project, fieldsOf, narrow, keysIn, strangeField, sharpen, failure;
|
|
11129
11203
|
var init_report$1 = __esmMin((() => {
|
|
11130
11204
|
ADVICE = {
|
|
@@ -12340,12 +12414,13 @@ var init_model$4 = __esmMin((() => {
|
|
|
12340
12414
|
base: "",
|
|
12341
12415
|
read: {},
|
|
12342
12416
|
dismissed: {},
|
|
12343
|
-
seen: {}
|
|
12417
|
+
seen: {},
|
|
12418
|
+
doing: {}
|
|
12344
12419
|
};
|
|
12345
12420
|
}));
|
|
12346
12421
|
//#endregion
|
|
12347
12422
|
//#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;
|
|
12423
|
+
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
12424
|
var init_schema = __esmMin((() => {
|
|
12350
12425
|
init_dist();
|
|
12351
12426
|
Side = Literals(["old", "new"]);
|
|
@@ -12382,7 +12457,8 @@ var init_schema = __esmMin((() => {
|
|
|
12382
12457
|
body: String$1,
|
|
12383
12458
|
head: String$1,
|
|
12384
12459
|
asks: Boolean,
|
|
12385
|
-
at: String$1
|
|
12460
|
+
at: String$1,
|
|
12461
|
+
choices: optionalKey(ArraySchema(String$1))
|
|
12386
12462
|
});
|
|
12387
12463
|
Batch = Struct({
|
|
12388
12464
|
id: String$1,
|
|
@@ -12392,6 +12468,10 @@ var init_schema = __esmMin((() => {
|
|
|
12392
12468
|
});
|
|
12393
12469
|
Stamps = Record(String$1, String$1);
|
|
12394
12470
|
Counts = Record(String$1, Int);
|
|
12471
|
+
Doing = Record(String$1, Struct({
|
|
12472
|
+
body: String$1,
|
|
12473
|
+
at: String$1
|
|
12474
|
+
}));
|
|
12395
12475
|
noStamps = withDecodingDefaultKey(succeed$1({}));
|
|
12396
12476
|
BranchState = Struct({
|
|
12397
12477
|
taken: optionalKey(Record(String$1, String$1)),
|
|
@@ -12404,7 +12484,8 @@ var init_schema = __esmMin((() => {
|
|
|
12404
12484
|
base: String$1.pipe(withDecodingDefaultKey(succeed$1(""))),
|
|
12405
12485
|
read: Counts.pipe(withDecodingDefaultKey(succeed$1({}))),
|
|
12406
12486
|
dismissed: Stamps.pipe(noStamps),
|
|
12407
|
-
seen: Stamps.pipe(noStamps)
|
|
12487
|
+
seen: Stamps.pipe(noStamps),
|
|
12488
|
+
doing: Doing.pipe(withDecodingDefaultKey(succeed$1({})))
|
|
12408
12489
|
});
|
|
12409
12490
|
StoredSaid = Struct({
|
|
12410
12491
|
by: String$1,
|
|
@@ -12940,10 +13021,11 @@ var init_store = __esmMin((() => {
|
|
|
12940
13021
|
}));
|
|
12941
13022
|
//#endregion
|
|
12942
13023
|
//#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;
|
|
13024
|
+
var UnknownBranch, BranchMoved, UnknownBase, UnknownFile, UnknownComment, UnknownRemark, NothingSaid, ThreadOpen, RemarkTaken, UnknownPreference, UnknownPreferenceValue, UnselectableRange, UnknownWorktree, MalformedLayers, UnknownDraft, NothingDrafted, PartlySent, PullMoved, NoLayers, NoPull, UnknownLayer;
|
|
12944
13025
|
var init_error$2 = __esmMin((() => {
|
|
12945
13026
|
init_dist();
|
|
12946
13027
|
UnknownBranch = class extends TaggedError("UnknownBranch") {};
|
|
13028
|
+
BranchMoved = class extends TaggedError("BranchMoved") {};
|
|
12947
13029
|
UnknownBase = class extends TaggedError("UnknownBase") {};
|
|
12948
13030
|
UnknownFile = class extends TaggedError("UnknownFile") {};
|
|
12949
13031
|
UnknownComment = class extends TaggedError("UnknownComment") {};
|
|
@@ -12963,7 +13045,7 @@ var init_error$2 = __esmMin((() => {
|
|
|
12963
13045
|
NoLayers = class extends TaggedError("NoLayers") {};
|
|
12964
13046
|
NoPull = class extends TaggedError("NoPull") {};
|
|
12965
13047
|
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;
|
|
13048
|
+
})), 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
13049
|
var init_branches$1 = __esmMin((() => {
|
|
12968
13050
|
init_dist();
|
|
12969
13051
|
init_patch();
|
|
@@ -13043,6 +13125,18 @@ var init_branches$1 = __esmMin((() => {
|
|
|
13043
13125
|
known: worktrees.map((w) => w.branch)
|
|
13044
13126
|
}) : succeed$1(found);
|
|
13045
13127
|
});
|
|
13128
|
+
SHORT = 8;
|
|
13129
|
+
onNow = (worktree, head) => worktree.detached ? `(detached ${head.slice(0, SHORT)})` : head;
|
|
13130
|
+
stillOn = fn("Review.Branch.stillOn")(function* (worktree) {
|
|
13131
|
+
const git = yield* Git;
|
|
13132
|
+
const now = onNow(worktree, yield* git.headOf(worktree.path));
|
|
13133
|
+
if (now === worktree.branch) return worktree;
|
|
13134
|
+
return yield* new BranchMoved({
|
|
13135
|
+
branch: worktree.branch,
|
|
13136
|
+
path: worktree.path,
|
|
13137
|
+
now
|
|
13138
|
+
});
|
|
13139
|
+
});
|
|
13046
13140
|
find = fn("Review.Branch.find")(function* (repo, branch, base) {
|
|
13047
13141
|
return (yield* basedOn(repo, yield* named$3(repo, branch), base)).worktree;
|
|
13048
13142
|
});
|
|
@@ -13765,7 +13859,7 @@ var init_comments$1 = __esmMin((() => {
|
|
|
13765
13859
|
}));
|
|
13766
13860
|
//#endregion
|
|
13767
13861
|
//#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;
|
|
13862
|
+
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
13863
|
var init_threads$1 = __esmMin((() => {
|
|
13770
13864
|
init_dist();
|
|
13771
13865
|
init_patch();
|
|
@@ -13799,10 +13893,12 @@ var init_threads$1 = __esmMin((() => {
|
|
|
13799
13893
|
})
|
|
13800
13894
|
});
|
|
13801
13895
|
};
|
|
13896
|
+
choicesOf = (entry) => entry.choices === void 0 ? {} : { choices: entry.choices };
|
|
13802
13897
|
answerOf = (entry) => ({
|
|
13803
13898
|
body: entry.body,
|
|
13804
13899
|
at: entry.at,
|
|
13805
|
-
asks: entry.asks
|
|
13900
|
+
asks: entry.asks,
|
|
13901
|
+
...choicesOf(entry)
|
|
13806
13902
|
});
|
|
13807
13903
|
turnsOf = (replies, said) => [...replies.map((held) => ({
|
|
13808
13904
|
voice: "reviewer",
|
|
@@ -13811,7 +13907,8 @@ var init_threads$1 = __esmMin((() => {
|
|
|
13811
13907
|
})), ...said.map((entry) => ({
|
|
13812
13908
|
voice: "agent",
|
|
13813
13909
|
body: entry.body,
|
|
13814
|
-
at: entry.at
|
|
13910
|
+
at: entry.at,
|
|
13911
|
+
...choicesOf(entry)
|
|
13815
13912
|
}))].toSorted((one, other) => one.at < other.at ? -1 : one.at > other.at ? 1 : 0);
|
|
13816
13913
|
threadOf = (held, replies, conversation) => {
|
|
13817
13914
|
const { comment, batch } = held;
|
|
@@ -13821,6 +13918,7 @@ var init_threads$1 = __esmMin((() => {
|
|
|
13821
13918
|
const turns = turnsOf(replies, mine);
|
|
13822
13919
|
const settled = Object.hasOwn(conversation.settled, comment.id);
|
|
13823
13920
|
const sits = placedNow$1(conversation.patches, comment.anchor);
|
|
13921
|
+
const doing = conversation.doing[comment.id];
|
|
13824
13922
|
return {
|
|
13825
13923
|
id: comment.id,
|
|
13826
13924
|
file: comment.anchor.path,
|
|
@@ -13837,7 +13935,8 @@ var init_threads$1 = __esmMin((() => {
|
|
|
13837
13935
|
taken: [...ids].some((id) => Object.hasOwn(conversation.taken, id)),
|
|
13838
13936
|
answers: mine.map(answerOf),
|
|
13839
13937
|
turns,
|
|
13840
|
-
settled
|
|
13938
|
+
settled,
|
|
13939
|
+
...doing === void 0 ? {} : { doing }
|
|
13841
13940
|
};
|
|
13842
13941
|
};
|
|
13843
13942
|
threadsIn$1 = (batches, conversation) => {
|
|
@@ -13850,6 +13949,15 @@ var init_threads$1 = __esmMin((() => {
|
|
|
13850
13949
|
return held.filter((one) => one.comment.replyTo === void 0).map((one) => threadOf(one, under(one), conversation));
|
|
13851
13950
|
};
|
|
13852
13951
|
idsIn = (batches) => batches.flatMap((batch) => batch.comments.map((comment) => comment.id));
|
|
13952
|
+
rootIn = (batches, id) => {
|
|
13953
|
+
const found = batches.flatMap((batch) => batch.comments).find((comment) => comment.id === id);
|
|
13954
|
+
return found === void 0 ? void 0 : found.replyTo ?? found.id;
|
|
13955
|
+
};
|
|
13956
|
+
rootOf = fn("Review.Thread.rootOf")(function* (worktree, id) {
|
|
13957
|
+
const store = yield* Store;
|
|
13958
|
+
const root = rootIn(yield* store.inbox(worktree.path), id);
|
|
13959
|
+
return root === void 0 ? yield* new UnknownComment({ id }) : root;
|
|
13960
|
+
});
|
|
13853
13961
|
isKnown = fn("Review.Thread.isKnown")(function* (worktree, id) {
|
|
13854
13962
|
const store = yield* Store;
|
|
13855
13963
|
return idsIn(yield* store.inbox(worktree.path)).includes(id);
|
|
@@ -13867,19 +13975,52 @@ var init_threads$1 = __esmMin((() => {
|
|
|
13867
13975
|
shown: new Set(patches.map((patch) => patch.path)),
|
|
13868
13976
|
patches,
|
|
13869
13977
|
read: current.read,
|
|
13870
|
-
taken: current.taken ?? {}
|
|
13978
|
+
taken: current.taken ?? {},
|
|
13979
|
+
doing: current.doing
|
|
13871
13980
|
});
|
|
13872
13981
|
});
|
|
13982
|
+
clearDoing = fn("Review.Thread.clearDoing")(function* (worktree, root) {
|
|
13983
|
+
const store = yield* Store;
|
|
13984
|
+
const current = yield* store.state(worktree.path);
|
|
13985
|
+
if (!Object.hasOwn(current.doing, root)) return;
|
|
13986
|
+
yield* store.changeState(worktree.path, (was) => ({
|
|
13987
|
+
...was,
|
|
13988
|
+
doing: without$1(was.doing, root)
|
|
13989
|
+
}));
|
|
13990
|
+
});
|
|
13991
|
+
doing = fn("Review.Thread.doing")(function* (worktree, request) {
|
|
13992
|
+
const store = yield* Store;
|
|
13993
|
+
const root = yield* rootOf(worktree, request.id);
|
|
13994
|
+
const said = {
|
|
13995
|
+
body: request.body,
|
|
13996
|
+
at: request.at
|
|
13997
|
+
};
|
|
13998
|
+
yield* store.changeState(worktree.path, (was) => ({
|
|
13999
|
+
...was,
|
|
14000
|
+
doing: {
|
|
14001
|
+
...was.doing,
|
|
14002
|
+
[root]: said
|
|
14003
|
+
}
|
|
14004
|
+
}));
|
|
14005
|
+
yield* ignore(store.noteWatching(worktree.path, request.at));
|
|
14006
|
+
return { doing: {
|
|
14007
|
+
id: root,
|
|
14008
|
+
...said
|
|
14009
|
+
} };
|
|
14010
|
+
});
|
|
13873
14011
|
answer$3 = fn("Review.Thread.answer")(function* (worktree, request) {
|
|
13874
14012
|
const store = yield* Store;
|
|
13875
|
-
yield*
|
|
14013
|
+
const root = yield* rootOf(worktree, request.id);
|
|
14014
|
+
const offered = request.choices.length > 0;
|
|
13876
14015
|
yield* store.answer(worktree.path, {
|
|
13877
14016
|
comment: request.id,
|
|
13878
14017
|
body: request.body,
|
|
13879
14018
|
head: worktree.head,
|
|
13880
|
-
asks: request.asks,
|
|
13881
|
-
at: request.at
|
|
14019
|
+
asks: request.asks || offered,
|
|
14020
|
+
at: request.at,
|
|
14021
|
+
...offered ? { choices: request.choices } : {}
|
|
13882
14022
|
});
|
|
14023
|
+
yield* clearDoing(worktree, root);
|
|
13883
14024
|
yield* ignore(store.noteWatching(worktree.path, request.at));
|
|
13884
14025
|
return { answered: (yield* store.answers(worktree.path)).filter((entry) => entry.comment === request.id).length };
|
|
13885
14026
|
});
|
|
@@ -13899,7 +14040,8 @@ var init_threads$1 = __esmMin((() => {
|
|
|
13899
14040
|
read: {
|
|
13900
14041
|
...was.read,
|
|
13901
14042
|
[id]: replies
|
|
13902
|
-
}
|
|
14043
|
+
},
|
|
14044
|
+
doing: without$1(was.doing, id)
|
|
13903
14045
|
}));
|
|
13904
14046
|
return { settled: id };
|
|
13905
14047
|
});
|
|
@@ -13929,7 +14071,8 @@ var init_threads$1 = __esmMin((() => {
|
|
|
13929
14071
|
read: {
|
|
13930
14072
|
...was.read,
|
|
13931
14073
|
[id]: replies
|
|
13932
|
-
}
|
|
14074
|
+
},
|
|
14075
|
+
doing: without$1(was.doing, id)
|
|
13933
14076
|
}));
|
|
13934
14077
|
return { removed: id };
|
|
13935
14078
|
});
|
|
@@ -14695,16 +14838,26 @@ var init_review$1 = __esmMin((() => {
|
|
|
14695
14838
|
}));
|
|
14696
14839
|
//#endregion
|
|
14697
14840
|
//#region src/review/vouching.ts
|
|
14698
|
-
var readParts, blobIn, toggle, progress;
|
|
14841
|
+
var pathOfMark, changedSince, readParts, blobIn, toggle, progress;
|
|
14699
14842
|
var init_vouching$1 = __esmMin((() => {
|
|
14700
14843
|
init_dist();
|
|
14701
14844
|
init_review$1();
|
|
14702
14845
|
init_store();
|
|
14703
14846
|
init_error$2();
|
|
14704
14847
|
init_patches();
|
|
14848
|
+
pathOfMark = (mark) => mark.split("@")[0] ?? "";
|
|
14849
|
+
changedSince = (marks, files) => {
|
|
14850
|
+
const recorded = marks.flatMap((held) => Object.entries(held));
|
|
14851
|
+
const blobsOf = (file) => recorded.filter(([mark]) => pathOfMark(mark) === file.path).map(([, blob]) => blob);
|
|
14852
|
+
const lapsed = (file) => {
|
|
14853
|
+
const blobs = blobsOf(file);
|
|
14854
|
+
return blobs.length > 0 && !blobs.includes(file.blob);
|
|
14855
|
+
};
|
|
14856
|
+
return files.filter(lapsed).map((file) => file.path);
|
|
14857
|
+
};
|
|
14705
14858
|
readParts = (parts, files) => {
|
|
14706
14859
|
const blobs = new Map(files.map((file) => [file.path, file.blob]));
|
|
14707
|
-
return Object.entries(parts).filter(([part, blob]) => blobs.get(part
|
|
14860
|
+
return Object.entries(parts).filter(([part, blob]) => blobs.get(pathOfMark(part)) === blob).map(([part]) => part);
|
|
14708
14861
|
};
|
|
14709
14862
|
blobIn = fn("Review.Vouch.blobIn")(function* (reading, file) {
|
|
14710
14863
|
return yield* match$3(blobOf(reading.patches, file), {
|
|
@@ -14744,6 +14897,7 @@ var init_vouching$1 = __esmMin((() => {
|
|
|
14744
14897
|
return {
|
|
14745
14898
|
vouched: files.filter((file) => isVouched(current.vouches, file.path, file.blob)).map((f) => f.path),
|
|
14746
14899
|
parts: readParts(current.parts, files),
|
|
14900
|
+
changed: changedSince([current.vouches, current.parts], files),
|
|
14747
14901
|
total: reading.patches.length
|
|
14748
14902
|
};
|
|
14749
14903
|
});
|
|
@@ -22711,11 +22865,11 @@ var init_reading = __esmMin((() => {
|
|
|
22711
22865
|
worktreeFor = (app, branch) => readingHeld(app, branch)?.worktree;
|
|
22712
22866
|
worktreeOf = (app, branch) => {
|
|
22713
22867
|
const held = worktreeFor(app, branch);
|
|
22714
|
-
return held === void 0 ? find(app.repo, branch) :
|
|
22868
|
+
return held === void 0 ? find(app.repo, branch) : stillOn(held);
|
|
22715
22869
|
};
|
|
22716
22870
|
readingOf = (app, branch) => {
|
|
22717
22871
|
const held = readingHeld(app, branch);
|
|
22718
|
-
return held === void 0 ? reading(app.repo, branch) :
|
|
22872
|
+
return held === void 0 ? reading(app.repo, branch) : as(stillOn(held.worktree), held);
|
|
22719
22873
|
};
|
|
22720
22874
|
loadSent = (app, branch) => flatMap(readingOf(app, branch), listSent);
|
|
22721
22875
|
remarksHeld = (app, reading) => app.state.remarksOn ? list$2(reading) : succeed$1([]);
|
|
@@ -24568,7 +24722,7 @@ var init_vouching = __esmMin((() => {
|
|
|
24568
24722
|
}));
|
|
24569
24723
|
//#endregion
|
|
24570
24724
|
//#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;
|
|
24725
|
+
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
24726
|
var init_app = __esmMin((() => {
|
|
24573
24727
|
init_dist();
|
|
24574
24728
|
init_preferences$1();
|
|
@@ -24694,6 +24848,7 @@ var init_app = __esmMin((() => {
|
|
|
24694
24848
|
"match.next": (app) => walkMatches(app, 1),
|
|
24695
24849
|
"match.prev": (app) => walkMatches(app, -1)
|
|
24696
24850
|
};
|
|
24851
|
+
movedSaid = (moved) => `nothing recorded: the directory of ${moved.branch} is on ${moved.now} now`;
|
|
24697
24852
|
App = class {
|
|
24698
24853
|
renderer;
|
|
24699
24854
|
screen;
|
|
@@ -24798,7 +24953,7 @@ var init_app = __esmMin((() => {
|
|
|
24798
24953
|
}
|
|
24799
24954
|
act(intent) {
|
|
24800
24955
|
const began = Date.now();
|
|
24801
|
-
return this.answer(intent).pipe(catchCause((cause) => sync(() => this.fail(squash(cause)))), ensuring(sync(() => this.timed(began))));
|
|
24956
|
+
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
24957
|
}
|
|
24803
24958
|
answer(intent) {
|
|
24804
24959
|
return Intent.$match(intent, {
|
|
@@ -25393,10 +25548,19 @@ const commentAnswer = fn("Main.commentAnswer")(function* (options) {
|
|
|
25393
25548
|
id: yield* required(options, "id"),
|
|
25394
25549
|
body: yield* required(options, "body"),
|
|
25395
25550
|
asks: options["question"] !== void 0,
|
|
25396
|
-
at: stamp(options)
|
|
25551
|
+
at: stamp(options),
|
|
25552
|
+
choices: yield* choices(options, "choice")
|
|
25397
25553
|
});
|
|
25398
25554
|
yield* answer(options, { answered: report.answered });
|
|
25399
25555
|
});
|
|
25556
|
+
const commentDoing = fn("Main.commentDoing")(function* (options) {
|
|
25557
|
+
const report = yield* doing(yield* worktreeNamed(options), {
|
|
25558
|
+
id: yield* required(options, "id"),
|
|
25559
|
+
body: yield* oneLine(options, "body"),
|
|
25560
|
+
at: stamp(options)
|
|
25561
|
+
});
|
|
25562
|
+
yield* answer(options, report);
|
|
25563
|
+
});
|
|
25400
25564
|
const remarkList = fn("Main.remarkList")(function* (options) {
|
|
25401
25565
|
const remarks = yield* fetch$1(yield* required(options, "repo"), yield* readingIn(options));
|
|
25402
25566
|
yield* answer(options, { remarks });
|
|
@@ -25501,6 +25665,7 @@ const reviewStatus = fn("Main.reviewStatus")(function* (options) {
|
|
|
25501
25665
|
const report = yield* progress(yield* readingIn(options));
|
|
25502
25666
|
yield* answer(options, {
|
|
25503
25667
|
reviewed: report.vouched,
|
|
25668
|
+
changed: report.changed,
|
|
25504
25669
|
total: report.total
|
|
25505
25670
|
});
|
|
25506
25671
|
});
|
|
@@ -25564,6 +25729,7 @@ const routes = {
|
|
|
25564
25729
|
"comment reply": commentReply,
|
|
25565
25730
|
"comment take": commentTake,
|
|
25566
25731
|
"comment answer": commentAnswer,
|
|
25732
|
+
"comment doing": commentDoing,
|
|
25567
25733
|
"comment list": commentList,
|
|
25568
25734
|
"remark list": remarkList,
|
|
25569
25735
|
"remark accept": remarkAccept,
|
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.192",
|
|
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
|