@eliya-oss/agent-diff 0.1.0-alpha.133 → 0.1.0-alpha.135

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.
@@ -0,0 +1,160 @@
1
+ ---
2
+ name: release-notes
3
+ description: Write the change intent, the PR description and the release note for a change to adiff. Use when opening a PR here, when adding or editing a file in .changeset/, when asked to fix up a PR body or a release note, or when deciding whether a change is worth a release at all.
4
+ ---
5
+
6
+ # Release notes for adiff
7
+
8
+ Every release note in this repo comes from one place: a change intent file in `.changeset/`.
9
+ `scripts/changelog.ts` reads those files, groups them, and writes `CHANGELOG.md` and the text on
10
+ the GitHub release page. Nothing else is edited by hand — do not edit `CHANGELOG.md` yourself.
11
+
12
+ A reader of a release note wants two things in this order: **which part of adiff changed**, and
13
+ **what it does now**. Give them that in one sentence. Everything else goes behind a fold.
14
+
15
+ ## Does this change deserve a release at all?
16
+
17
+ Only four kinds of change ship a note:
18
+
19
+ | Kind | Write it as | Lands under |
20
+ | --- | --- | --- |
21
+ | Something adiff could not do before | `feat(area): …` | `### Added` |
22
+ | Something adiff did wrong | `fix(area): …` | `### Fixed` |
23
+ | Something measurably faster or smaller | `perf(area): …` | `### Performance` |
24
+ | Something that changes what an existing command or key means | `breaking(area): …` | `### Breaking` |
25
+
26
+ **A refactor, a test, a doc, a CI change or a rename gets no change intent file.** No file, no
27
+ version bump, no note. If the change is invisible to a reviewer using adiff, it is invisible in the
28
+ changelog too. Say so in the PR body instead. A PR that touches only `src/testing/`, `.agents/`,
29
+ `.github/`, `README.md` or `ARCHITECTURE.md` almost never needs one.
30
+
31
+ If you are unsure, ask: would someone who upgraded notice? If no, no file.
32
+
33
+ ## The shape of a change intent
34
+
35
+ `.changeset/<name>.md`:
36
+
37
+ ```markdown
38
+ ---
39
+ "@eliya-oss/agent-diff": patch
40
+ ---
41
+
42
+ fix(layers rail): the cursor stays on the rail when you collapse the layer you are reading.
43
+
44
+ <details><summary>What was wrong</summary>
45
+
46
+ Collapsing took the cursor off the whole rail — nothing said where you were, and the layer read
47
+ like one you had not started.
48
+
49
+ </details>
50
+ ```
51
+
52
+ which renders as:
53
+
54
+ ```markdown
55
+ ## 0.1.0-alpha.132
56
+
57
+ ### Fixed
58
+
59
+ - **Layers rail** — the cursor stays on the rail when you collapse the layer you are reading.
60
+
61
+ <details><summary>What was wrong</summary>
62
+ …
63
+ </details>
64
+ ```
65
+
66
+ Rules the generator and `a-changelog-that-says-what-kind-of-change.test.ts` enforce:
67
+
68
+ - The first line of every entry is `kind(area): one sentence.` — a full stop at the end, no
69
+ capital at the start, no line break inside it.
70
+ - `kind` is exactly one of `feat`, `fix`, `perf`, `breaking`.
71
+ - `area` is lowercase, and is capitalised for you when it is rendered. Write `CLI` and `README` in
72
+ the case you want them.
73
+ - Anything between one entry and the next belongs to the entry above it, and is indented under its
74
+ bullet.
75
+
76
+ ## One entry per thing that changed
77
+
78
+ A PR that fixes five things writes **five entries in one file**, not one paragraph covering five.
79
+ This is the single biggest difference from how this repo used to write notes.
80
+
81
+ ```markdown
82
+ fix(layers rail): the cursor stays on the rail when you collapse the layer you are reading.
83
+
84
+ <details>…</details>
85
+
86
+ fix(reading order): a first layer naming no file in the diff opens at the first file, not the last.
87
+
88
+ <details>…</details>
89
+ ```
90
+
91
+ Each one gets its own bullet, under the right heading, and can be found by someone searching for
92
+ the part of adiff it names.
93
+
94
+ ## Naming the area
95
+
96
+ Use the name a reviewer would use for the thing on screen. The ones already in use:
97
+
98
+ `diff` · `file tree` · `layers` · `layers rail` · `reading order` · `review panel` · `footer` ·
99
+ `marks` · `keys` · `search` · `key sheet` · `command palette` · `home screen` · `comment delivery` ·
100
+ `store` · `preferences` · `upgrade` · `CLI` · `changelog`
101
+
102
+ Reuse one before inventing another, and check `.agents/prd/CONTEXT.md` — never invent a word the
103
+ glossary already has.
104
+
105
+ ## The sentence
106
+
107
+ Write what is true **now**, in the present tense, from the reviewer's side of the screen.
108
+
109
+ - `fix(diff): a binary file says it is binary instead of drawing an empty pane.`
110
+ - `feat(search): typing narrows the matches as you type.`
111
+ - `perf(review): opening a 131-file branch takes 1.5s, down from 2.85s.`
112
+
113
+ Not:
114
+
115
+ - ~~`fix(diff): fixed the binary file handling`~~ — says nothing about what a reader will see.
116
+ - ~~`fix(diff): refactored patch parsing so binary blobs short-circuit`~~ — describes the code.
117
+ - ~~`fix(diff): a binary file that adiff cannot show`~~ — a title, not a statement.
118
+
119
+ **No gerund titles.** "Saying what is not there", "Opening onto one branch", "Asking before
120
+ leaving" are all wrong. Write a statement with a verb in it: "a file with no newline says so".
121
+ This holds for the sentence, the branch name, the changeset filename, the PR title and the test
122
+ filename.
123
+
124
+ For `perf`, give both numbers and what they were measured on. A speed claim with no measurement is
125
+ not a release note.
126
+
127
+ ## What goes behind the fold
128
+
129
+ The `<details>` block is for the reader who hits the bug and wants to know it is the one they hit.
130
+ Put the symptom there, in the words someone would use to describe what they saw. Keep it to a
131
+ paragraph or two.
132
+
133
+ Leave it out entirely when the sentence is the whole story — most `feat` entries need nothing.
134
+
135
+ Do not put in it: the file you changed, the function you added, the test you wrote, a count of
136
+ tests, or how long it took you. Those belong in the PR.
137
+
138
+ ## The PR description
139
+
140
+ Same discipline, one level up.
141
+
142
+ - The title is the sentence you would have written as the entry, without the `kind(area):` prefix.
143
+ - The body opens with two or three sentences on what changed and why. Then, if the PR fixes several
144
+ things, one `##` heading per thing, matching the entries in the change intent.
145
+ - Reproduction steps and the reasoning go in the body. That is what the body is for, and it is why
146
+ the changelog does not need them.
147
+ - Never paste raw command output, a directory listing, or a shell transcript into a PR body. Check
148
+ what you wrote actually renders before you open the PR.
149
+ - No test counts, no "full suite green", no self-assessment.
150
+
151
+ ## Before you open the PR
152
+
153
+ ```bash
154
+ node scripts/changelog.ts # rewrites CHANGELOG.md from every change intent
155
+ node scripts/changelog.ts 0.1.0-alpha.133 # prints one release's note, as the release page shows it
156
+ ```
157
+
158
+ `CHANGELOG.md` is regenerated by the release workflow, so it does not need to be committed with the
159
+ change intent — but run the generator and read the output. If your entry looks wrong there, it will
160
+ look wrong on the release page.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.135
4
+
5
+ ### Patch Changes
6
+
7
+ - feat(changelog): a release note groups what changed under Breaking, Added, Fixed and Performance, and names the part of adiff each entry is about.
8
+
9
+ <details><summary>What it looked like before</summary>
10
+
11
+ A release was a run of paragraphs. Five fixes in one pull request arrived as one story, with no way to tell a fix from a new behaviour, or to find the part of adiff a line was about without reading all of it.
12
+
13
+ </details>
14
+
15
+ - fix(review panel): a thread says whether the agent has actually picked your comment up.
16
+
17
+ <details><summary>What was wrong</summary>
18
+
19
+ Everything unanswered was filed under "With the agent", which claimed custody adiff had no way to know about. `comment take` returned everything still owed an answer and left no trace, so a comment sent a second ago, one an agent had been working on for ten minutes, and one on a branch where no agent has ever run were the same thing on screen. Threads sit under "Not picked up" until something collects them, and "Picked up, no answer" after.
20
+
21
+ </details>
22
+
23
+ fix(diff): a thread head says how long ago the comment was picked up.
24
+
25
+ <details><summary>What was wrong</summary>
26
+
27
+ Every unanswered thread read `sent`. A comment an agent collected and then went away without answering — the case worth noticing — looked exactly like one written a second ago. It reads `picked up 40m ago` now.
28
+
29
+ </details>
30
+
31
+ ## 0.1.0-alpha.134
32
+
33
+ ### Patch Changes
34
+
35
+ - A wheel over the layers rail still moves a file at a time, but stops when you do. Each tick was queued behind a file load, so a trackpad flick left a backlog that carried on walking the review long after the gesture ended. Ticks that arrive while a move is still loading are dropped rather than queued.
36
+
37
+ The rail's columns line up. A directory sat one column left of the layer title above it and two right of the file names below it — three ragged edges. The three levels now step in evenly, the way the file tree already did, and a directory too long for the rail is shortened rather than cut off at the pane edge.
38
+
3
39
  ## 0.1.0-alpha.133
4
40
 
5
41
  ### Patch Changes
package/dist/main.js CHANGED
@@ -9054,6 +9054,7 @@ var init_error$2 = __esmMin((() => {
9054
9054
  var emptyBranchState;
9055
9055
  var init_model$4 = __esmMin((() => {
9056
9056
  emptyBranchState = {
9057
+ taken: {},
9057
9058
  vouches: {},
9058
9059
  consumed: 0,
9059
9060
  settled: {},
@@ -9064,7 +9065,7 @@ var init_model$4 = __esmMin((() => {
9064
9065
  }));
9065
9066
  //#endregion
9066
9067
  //#region src/service/store/schema.ts
9067
- var Side, Anchor, StoredComment, StoredDraft, Drafts, StoredAnswer, Batch, Stamps, Counts, noStamps, BranchState, Settings, UpgradeCheck, Prose, Code, StoredLayer, StoredLayers;
9068
+ var Side, Anchor, StoredComment, StoredDraft, Drafts, StoredAnswer, Batch, Stamps, Counts, noStamps, BranchState, Settings, Watching, UpgradeCheck, Prose, Code, StoredLayer, StoredLayers;
9068
9069
  var init_schema = __esmMin((() => {
9069
9070
  init_dist();
9070
9071
  Side = Literals(["old", "new"]);
@@ -9110,6 +9111,7 @@ var init_schema = __esmMin((() => {
9110
9111
  Counts = Record(String$1, Int);
9111
9112
  noStamps = withDecodingDefaultKey(succeed$1({}));
9112
9113
  BranchState = Struct({
9114
+ taken: optionalKey(Record(String$1, String$1)),
9113
9115
  vouches: Stamps.pipe(noStamps),
9114
9116
  consumed: Int.pipe(withDecodingDefaultKey(succeed$1(0))),
9115
9117
  settled: Stamps.pipe(noStamps),
@@ -9126,6 +9128,7 @@ var init_schema = __esmMin((() => {
9126
9128
  newestFirst: optionalKey(Boolean),
9127
9129
  hold: optionalKey(Boolean)
9128
9130
  });
9131
+ Watching = Struct({ lookedAt: String$1 });
9129
9132
  UpgradeCheck = Struct({
9130
9133
  note: optionalKey(String$1),
9131
9134
  checkedAt: optionalKey(String$1),
@@ -9158,7 +9161,7 @@ var init_schema = __esmMin((() => {
9158
9161
  }));
9159
9162
  //#endregion
9160
9163
  //#region src/service/store/paths.ts
9161
- var NON_SLUG, slugOf, defaultRoot, branchDir, inboxPath, outboxPath, statePath, draftsPath, layersPath, settingsPath, upgradePath, reportsDir, reportPath;
9164
+ var NON_SLUG, slugOf, defaultRoot, branchDir, inboxPath, outboxPath, statePath, watchPath, draftsPath, layersPath, settingsPath, upgradePath, reportsDir, reportPath;
9162
9165
  var init_paths = __esmMin((() => {
9163
9166
  NON_SLUG = /[^a-zA-Z0-9]+/g;
9164
9167
  slugOf = (worktreePath) => worktreePath.replace(NON_SLUG, "-");
@@ -9167,6 +9170,7 @@ var init_paths = __esmMin((() => {
9167
9170
  inboxPath = (root, worktreePath) => join(branchDir(root, worktreePath), "inbox.jsonl");
9168
9171
  outboxPath = (root, worktreePath) => join(branchDir(root, worktreePath), "outbox.jsonl");
9169
9172
  statePath = (root, worktreePath) => join(branchDir(root, worktreePath), "state.json");
9173
+ watchPath = (root, worktreePath) => join(branchDir(root, worktreePath), "watch.json");
9170
9174
  draftsPath = (root, worktreePath) => join(branchDir(root, worktreePath), "drafts.json");
9171
9175
  layersPath = (root, worktreePath) => join(branchDir(root, worktreePath), "layers.json");
9172
9176
  settingsPath = (root) => join(root, "settings.json");
@@ -9176,7 +9180,7 @@ var init_paths = __esmMin((() => {
9176
9180
  }));
9177
9181
  //#endregion
9178
9182
  //#region src/service/store/service.ts
9179
- var Store, ensureDir, readOptional, missing$1, damaged, jsonOf$1, decoded, unwritable, wrote, added, INDENT, DRAFTS_VERSION, encoded, writes, appends, writeSettings, writeUpgradeCheck, writeState, writeLayers, writeDrafts, writeBatch, writeAnswer, asSettings, asUpgradeCheck, asBatch, asAnswer, asState, asLayers, asDrafts, linesOf, readLines, parseSettings, parseUpgradeCheck, parseState, parseLayers, cursorOps, settingsOps, upgradeOps, reportOps, HEAD_REF, gitDirOf, headOf$1, repoOf$2, branchKeyOf, wasKeyOf, there, moved, adopt, SPLIT$1, ADOPT_SIZE, adopting, keyIn, answerOps, layersOps, inboxOps, STATE_LOCK, DRAFTS_LOCK, held$1, stale$1, stolen, taken, freed, alone, draftsOps, stateOps, makeStore, madeStore, storeAt;
9183
+ var Store, ensureDir, readOptional, missing$1, damaged, jsonOf$1, decoded, unwritable, wrote, added, INDENT, DRAFTS_VERSION, encoded, writes, appends, writeSettings, writeUpgradeCheck, writeState, writeLayers, writeDrafts, writeBatch, writeAnswer, asSettings, asUpgradeCheck, asBatch, asAnswer, asState, asLayers, asDrafts, asWatching, linesOf, readLines, parseSettings, parseUpgradeCheck, parseState, parseLayers, idsIn$1, takes, cursorOps, settingsOps, upgradeOps, reportOps, HEAD_REF, gitDirOf, headOf$1, repoOf$2, branchKeyOf, wasKeyOf, there, moved, adopt, SPLIT$1, ADOPT_SIZE, adopting, keyIn, answerOps, layersOps, inboxOps, STATE_LOCK, DRAFTS_LOCK, held$1, stale$1, stolen, taken, freed, alone, watchOps, draftsOps, stateOps, makeStore, madeStore, storeAt;
9180
9184
  var init_service$1 = __esmMin((() => {
9181
9185
  init_dist();
9182
9186
  init_error$2();
@@ -9255,6 +9259,7 @@ var init_service$1 = __esmMin((() => {
9255
9259
  asState = decoded(BranchState);
9256
9260
  asLayers = decoded(StoredLayers);
9257
9261
  asDrafts = decoded(Drafts);
9262
+ asWatching = decoded(Watching);
9258
9263
  linesOf = (raw) => raw.split("\n").filter((line) => line.trim().length > 0);
9259
9264
  readLines = (path, raw, as) => forEach(linesOf(raw), (line) => jsonOf$1(path, line).pipe(flatMap((value) => as(path, value))));
9260
9265
  parseSettings = fn("Store.parseSettings")(function* (path, raw) {
@@ -9271,8 +9276,16 @@ var init_service$1 = __esmMin((() => {
9271
9276
  parseLayers = fn("Store.parseLayers")(function* (path, raw) {
9272
9277
  return yield* asLayers(path, yield* jsonOf$1(path, raw));
9273
9278
  });
9274
- cursorOps = (state, inbox, spoken) => {
9275
- return { take: fn("Store.take")(function* (worktreePath) {
9279
+ idsIn$1 = (batches) => batches.flatMap((batch) => batch.comments.map((one) => one.id));
9280
+ takes = (ids, at) => (was) => ({
9281
+ ...was,
9282
+ taken: {
9283
+ ...Object.fromEntries(ids.map((id) => [id, at])),
9284
+ ...was.taken
9285
+ }
9286
+ });
9287
+ cursorOps = (state, inbox, spoken, changeState) => {
9288
+ const owedIn = fn("Store.owedIn")(function* (worktreePath) {
9276
9289
  const batches = yield* inbox(worktreePath);
9277
9290
  const current = yield* state(worktreePath);
9278
9291
  const answered = new Set((yield* spoken(worktreePath)).map((entry) => entry.comment));
@@ -9286,7 +9299,16 @@ var init_service$1 = __esmMin((() => {
9286
9299
  comments
9287
9300
  }];
9288
9301
  });
9289
- }) };
9302
+ });
9303
+ return {
9304
+ take: fn("Store.take")(function* (worktreePath, at) {
9305
+ const batches = yield* owedIn(worktreePath);
9306
+ const ids = idsIn$1(batches);
9307
+ if (ids.length > 0) yield* changeState(worktreePath, takes(ids, at));
9308
+ return batches;
9309
+ }),
9310
+ owed: owedIn
9311
+ };
9290
9312
  };
9291
9313
  settingsOps = (root) => {
9292
9314
  return {
@@ -9438,6 +9460,30 @@ var init_service$1 = __esmMin((() => {
9438
9460
  });
9439
9461
  freed = (path) => promise(() => rm(path, { force: true }));
9440
9462
  alone = (path, waiting, work) => acquireUseRelease(taken(path, waiting), () => work, () => freed(path));
9463
+ watchOps = (root, adopted) => {
9464
+ return {
9465
+ watching: fn("Store.watching")(function* (worktreePath) {
9466
+ const key = yield* keyIn(adopted, worktreePath);
9467
+ const path = watchPath(root, key);
9468
+ const raw = yield* readOptional(path);
9469
+ if (isNone(raw)) return none();
9470
+ const value = yield* jsonOf$1(path, raw.value);
9471
+ return some(yield* asWatching(path, value));
9472
+ }),
9473
+ noteWatching: fn("Store.noteWatching")(function* (worktreePath, at) {
9474
+ const key = yield* keyIn(adopted, worktreePath);
9475
+ const path = watchPath(root, key);
9476
+ yield* ensureDir(branchDir(root, key));
9477
+ yield* tryPromise({
9478
+ try: () => writeFile(path, JSON.stringify({ lookedAt: at }), "utf8"),
9479
+ catch: (cause) => new StoreUnwritable({
9480
+ path,
9481
+ reason: String(cause)
9482
+ })
9483
+ });
9484
+ })
9485
+ };
9486
+ };
9441
9487
  draftsOps = (root, adopted) => {
9442
9488
  const drafts = fn("Store.drafts")(function* (worktreePath) {
9443
9489
  const key = yield* keyIn(adopted, worktreePath);
@@ -9501,7 +9547,7 @@ var init_service$1 = __esmMin((() => {
9501
9547
  const { submit, inbox } = inboxOps(root, adopted);
9502
9548
  const { state, saveState, changeState } = stateOps(root, adopted);
9503
9549
  const talk = answerOps(root, adopted);
9504
- const cursors = cursorOps(state, inbox, talk.answers);
9550
+ const cursors = cursorOps(state, inbox, talk.answers, changeState);
9505
9551
  return {
9506
9552
  root,
9507
9553
  branchAt: (worktreePath) => promise(() => headOf$1(worktreePath)),
@@ -9515,6 +9561,7 @@ var init_service$1 = __esmMin((() => {
9515
9561
  ...upgradeOps(root),
9516
9562
  ...talk,
9517
9563
  ...layersOps(root, adopted),
9564
+ ...watchOps(root, adopted),
9518
9565
  ...draftsOps(root, adopted),
9519
9566
  ...cursors
9520
9567
  };
@@ -10286,7 +10333,7 @@ var init_commands = __esmMin((() => {
10286
10333
  findPatch = (patches, file) => fromNullishOr(patches.find((patch) => patch.path === file));
10287
10334
  waitingOn = fn("Cli.waitingOn")(function* (worktree) {
10288
10335
  const store = yield* Store;
10289
- const owed = yield* store.take(worktree.path);
10336
+ const owed = yield* store.owed(worktree.path);
10290
10337
  const told = yield* store.layers(worktree.path);
10291
10338
  return {
10292
10339
  unanswered: owed.reduce((total, batch) => total + batch.comments.length, 0),
@@ -10391,12 +10438,13 @@ var init_commands = __esmMin((() => {
10391
10438
  asks: entry.asks
10392
10439
  }))].toSorted((one, other) => one.at < other.at ? -1 : one.at > other.at ? 1 : 0);
10393
10440
  sentOf = (comment, replies, reading) => {
10394
- const { spoken, settled, removed, head, shown, read } = reading;
10441
+ const { spoken, settled, removed, head, shown, read, taken } = reading;
10395
10442
  const ids = /* @__PURE__ */ new Set([comment.id, ...replies.map((reply) => reply.id)]);
10396
10443
  const said = spoken.filter((entry) => ids.has(entry.comment));
10397
10444
  const seen = [...ids].reduce((total, id) => total + (read[id] ?? 0), 0);
10398
10445
  const spun = spunOf(replies, said);
10399
10446
  const last = spun.at(-1);
10447
+ const takenAt = [...ids].flatMap((id) => taken[id] ?? []).toSorted().at(-1);
10400
10448
  return {
10401
10449
  id: comment.id,
10402
10450
  file: comment.file,
@@ -10410,6 +10458,7 @@ var init_commands = __esmMin((() => {
10410
10458
  outside: !shown.has(comment.file),
10411
10459
  unread: Math.max(0, said.length - seen),
10412
10460
  asks: last?.voice === "agent" && last.asks,
10461
+ ...takenAt === void 0 ? {} : { takenAt },
10413
10462
  answers: said.map(bodyOf),
10414
10463
  turns: spun.map((turn) => ({
10415
10464
  voice: turn.voice,
@@ -10431,7 +10480,8 @@ var init_commands = __esmMin((() => {
10431
10480
  removed: current.removed,
10432
10481
  head: worktree.head,
10433
10482
  shown,
10434
- read: current.read
10483
+ read: current.read,
10484
+ taken: current.taken ?? {}
10435
10485
  };
10436
10486
  const under = (comment) => replies.filter((reply) => reply.replyTo === comment.id);
10437
10487
  return held.filter((comment) => comment.replyTo === void 0).map((comment) => sentOf(comment, under(comment), conversation));
@@ -10539,7 +10589,9 @@ var init_commands = __esmMin((() => {
10539
10589
  takeComments = fn("Cli.takeComments")(function* (worktree) {
10540
10590
  const store = yield* Store;
10541
10591
  const resolved = yield* realOf(worktree);
10542
- const owed = flatten(yield* store.take(resolved));
10592
+ const at = (/* @__PURE__ */ new Date()).toISOString();
10593
+ yield* ignore(store.noteWatching(resolved, at));
10594
+ const owed = flatten(yield* store.take(resolved, at));
10543
10595
  if (owed.every((one) => one.replyTo === void 0)) return owed;
10544
10596
  const held = flatten(yield* store.inbox(resolved));
10545
10597
  const spoken = yield* store.answers(resolved);
@@ -11046,7 +11098,7 @@ var init_pane = __esmMin((() => {
11046
11098
  init_drafts();
11047
11099
  init_init();
11048
11100
  init_pane();
11049
- var version$1 = "0.1.0-alpha.133";
11101
+ var version$1 = "0.1.0-alpha.135";
11050
11102
  //#endregion
11051
11103
  //#region src/cli/upgrade.ts
11052
11104
  var PACKAGE, TAG, RELEASES, REGISTRY, ASK_MS, RUN_MS, CELLAR, COMPILED, INSTALLED, BUN_GLOBAL, routeOf, ROUTES, asRoute, checkoutOf, assetOf, commandFor, NOTES, RUNNABLE, NUMBERS, numbersIn, compare$1, partsOf, newer, tagIn, fetched, askLatest, here, findUpgrade, willUpgrade, ranChild, runUpgrade, statusOf$1, sayFound, sayDone, attempted, REFRESH_MS, refreshSkills, updatedIn, sayRefreshed, upgradeReport;
@@ -11757,6 +11809,7 @@ var init_threads = __esmMin((() => {
11757
11809
  asks: request.asks,
11758
11810
  at: request.at
11759
11811
  });
11812
+ yield* ignore(store.noteWatching(worktree.path, request.at));
11760
11813
  return { answered: (yield* store.answers(worktree.path)).filter((entry) => entry.comment === request.id).length };
11761
11814
  });
11762
11815
  settleIn = fn("Cli.settleIn")(function* (worktree, id, at) {
@@ -13079,7 +13132,7 @@ var init_tree = __esmMin((() => {
13079
13132
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
13080
13133
  };
13081
13134
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
13082
- })), nothingReviewed, initialState, TREE_MAX, TREE_ROOMY, TREE_WIDE, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, tooSmall, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, kept, layerHolds, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip, TITLE_ROWS, titleRows, shortDir, fileRow$1, shownFiles, dirOf, fileRows, layerRead, layerDone, countRow, NOTHING_LEFT, textRows, emptyRows, layerBody, holdsCursor, layerCard, layerRows, nearFirst, layerFitted, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, threadStand, STAND_WEIGHT, louder, threadsOn, hiddenLines, rowsUnder, markedStands, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, replyTarget, threadReplying, VOICES, threadQuote, pickedText, takenRows, selectedLines, shownMatches, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadHere, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, SECTION_OF, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
13135
+ })), nothingReviewed, initialState, TREE_MAX, TREE_ROOMY, TREE_WIDE, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, tooSmall, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, kept, layerHolds, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip, TITLE_ROWS, titleRows, shortDir, fileRow$1, shownFiles, dirOf, fileRows, layerRead, layerDone, countRow, NOTHING_LEFT, textRows, emptyRows, layerBody, holdsCursor, layerCard, layerRows, nearFirst, layerFitted, restingAt, railTop, PANE_CHROME$1, layerRoomIn, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, MINUTE, HOUR, DAY, sinceThen, threadStand, STAND_WEIGHT, louder, threadsOn, hiddenLines, rowsUnder, markedStands, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, replyTarget, threadReplying, VOICES, threadQuote, pickedText, takenRows, selectedLines, shownMatches, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadHere, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, SECTION_OF, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
13083
13136
  var init_model = __esmMin((() => {
13084
13137
  init_dist();
13085
13138
  init_patch();
@@ -13100,7 +13153,8 @@ var init_model = __esmMin((() => {
13100
13153
  tallest: 0,
13101
13154
  scroll: -1,
13102
13155
  railRows: 12,
13103
- railScroll: -1
13156
+ railScroll: -1,
13157
+ now: 0
13104
13158
  };
13105
13159
  initialState = (branches) => ({
13106
13160
  ...nothingReviewed,
@@ -13223,8 +13277,12 @@ var init_model = __esmMin((() => {
13223
13277
  const whole = `${dir}/`;
13224
13278
  if (whole.length <= room) return whole;
13225
13279
  const parts = dir.split("/");
13226
- if (parts.length < 3) return `${clip(dir, Math.max(1, room - 1))}/`;
13227
- return `${parts[0] ?? ""}/…/${parts.at(-1) ?? ""}/`;
13280
+ const last = parts.at(-1) ?? "";
13281
+ const shrunk = parts.length < 3 ? "" : `${parts[0] ?? ""}/…/${last}/`;
13282
+ if (shrunk.length > 0 && shrunk.length <= room) return shrunk;
13283
+ const tail = `…/${last}/`;
13284
+ if (tail.length <= room) return tail;
13285
+ return `${clip(last, Math.max(1, room - 1))}/`;
13228
13286
  };
13229
13287
  fileRow$1 = (state, layerIndex, at, room) => {
13230
13288
  const path = state.patches[at]?.path ?? "";
@@ -13327,16 +13385,31 @@ var init_model = __esmMin((() => {
13327
13385
  shown.add(state.layerIndex);
13328
13386
  return layerRows(state, room, shown);
13329
13387
  };
13330
- railWindow = (rows, height, layerIndex) => {
13388
+ restingAt = (rows, height, layerIndex) => {
13389
+ const first = Math.max(0, rows.findIndex((row) => row.index === layerIndex));
13390
+ const block = rows.findLastIndex((row) => row.index === layerIndex) - first + 1;
13391
+ return block >= height ? first : first - Math.floor((height - block) / 2);
13392
+ };
13393
+ railTop = (rows, height, layerIndex, scroll) => {
13394
+ const wanted = scroll >= 0 ? scroll : restingAt(rows, height, layerIndex);
13395
+ return Math.max(0, Math.min(Math.max(0, rows.length - height), wanted));
13396
+ };
13397
+ PANE_CHROME$1 = 3;
13398
+ layerRoomIn = (state) => {
13399
+ const whole = Math.max(8, treeWidth(state.columns) - PANE_CHROME$1);
13400
+ return {
13401
+ title: Math.max(4, whole - 4),
13402
+ dir: Math.max(4, whole - 6),
13403
+ file: Math.max(4, whole - 8)
13404
+ };
13405
+ };
13406
+ railWindow = (rows, height, layerIndex, scroll = -1) => {
13331
13407
  if (rows.length <= height) return {
13332
13408
  rows,
13333
13409
  more: 0,
13334
13410
  above: 0
13335
13411
  };
13336
- const first = Math.max(0, rows.findIndex((row) => row.index === layerIndex));
13337
- const block = rows.findLastIndex((row) => row.index === layerIndex) - first + 1;
13338
- const wanted = block >= height ? first : first - Math.floor((height - block) / 2);
13339
- const start = Math.max(0, Math.min(rows.length - height, wanted));
13412
+ const start = railTop(rows, height, layerIndex, scroll);
13340
13413
  const shown = rows.slice(start, start + height);
13341
13414
  const here = new Set(shown.map((row) => row.index));
13342
13415
  const seen = (from) => new Set(from.filter((row) => !here.has(row.index)).map((row) => row.index)).size;
@@ -13389,16 +13462,27 @@ var init_model = __esmMin((() => {
13389
13462
  more: rows.length - (start + height)
13390
13463
  };
13391
13464
  };
13465
+ MINUTE = 6e4;
13466
+ HOUR = 60 * MINUTE;
13467
+ DAY = 24 * HOUR;
13468
+ sinceThen = (at, now = Date.now()) => {
13469
+ const gap = now - Date.parse(at);
13470
+ if (!Number.isFinite(gap) || gap < MINUTE) return "just now";
13471
+ if (gap < HOUR) return `${Math.floor(gap / MINUTE)}m ago`;
13472
+ if (gap < DAY) return `${Math.floor(gap / HOUR)}h ago`;
13473
+ return `${Math.floor(gap / DAY)}d ago`;
13474
+ };
13392
13475
  threadStand = (thread) => {
13393
13476
  if (thread.removed === true) return "gone";
13394
13477
  if (thread.settled === true) return "settled";
13395
13478
  if (thread.asks === true) return "asked";
13396
- if (spokeLast(thread) === "reviewer") return "waiting";
13397
- return answersIn(thread) > 0 ? "answered" : "waiting";
13479
+ if (spokeLast(thread) === "agent" && answersIn(thread) > 0) return "answered";
13480
+ return thread.takenAt === void 0 ? "filed" : "waiting";
13398
13481
  };
13399
13482
  STAND_WEIGHT = {
13400
13483
  gone: 0,
13401
13484
  settled: 1,
13485
+ filed: 2,
13402
13486
  waiting: 2,
13403
13487
  answered: 3,
13404
13488
  asked: 4
@@ -13616,6 +13700,7 @@ var init_model = __esmMin((() => {
13616
13700
  answerCount = (comments) => comments.reduce((total, entry) => total + (entry.answers?.length ?? 0), 0);
13617
13701
  PANEL_SECTIONS = [
13618
13702
  "asked",
13703
+ "filed",
13619
13704
  "with",
13620
13705
  "answered",
13621
13706
  "settled",
@@ -13630,6 +13715,7 @@ var init_model = __esmMin((() => {
13630
13715
  };
13631
13716
  spokeLast = (comment) => comment.turns?.at(-1)?.voice;
13632
13717
  SECTION_OF = {
13718
+ filed: "filed",
13633
13719
  gone: "removed",
13634
13720
  settled: "settled",
13635
13721
  asked: "asked",
@@ -14737,6 +14823,7 @@ var init_reduce = __esmMin((() => {
14737
14823
  layerIndex: landed.layer,
14738
14824
  openLayers: state.openLayers.includes(landed.layer) ? state.openLayers : [...state.openLayers, landed.layer],
14739
14825
  patchIndex: landed.file,
14826
+ railScroll: -1,
14740
14827
  top: 0,
14741
14828
  cursor: landingOn(state, landed.file),
14742
14829
  anchorRow: 0,
@@ -15411,7 +15498,8 @@ var init_marks = __esmMin((() => {
15411
15498
  };
15412
15499
  ring = {
15413
15500
  ...shared,
15414
- waiting: "○",
15501
+ filed: "○",
15502
+ waiting: "◔",
15415
15503
  answered: "◐",
15416
15504
  asked: "●",
15417
15505
  rule: "│"
@@ -15420,7 +15508,8 @@ var init_marks = __esmMin((() => {
15420
15508
  ring,
15421
15509
  bubble: {
15422
15510
  ...shared,
15423
- waiting: "◌",
15511
+ filed: "◌",
15512
+ waiting: "◔",
15424
15513
  answered: "◑",
15425
15514
  asked: "◗",
15426
15515
  rule: "┃",
@@ -15428,21 +15517,24 @@ var init_marks = __esmMin((() => {
15428
15517
  },
15429
15518
  quote: {
15430
15519
  ...shared,
15431
- waiting: "❞",
15520
+ filed: "❞",
15521
+ waiting: "❟",
15432
15522
  answered: "❠",
15433
15523
  asked: "❝",
15434
15524
  rule: "┊"
15435
15525
  },
15436
15526
  diamond: {
15437
15527
  ...shared,
15438
- waiting: "◇",
15528
+ filed: "◇",
15529
+ waiting: "◊",
15439
15530
  answered: "◈",
15440
15531
  asked: "◆",
15441
15532
  rule: "╎"
15442
15533
  },
15443
15534
  dot: {
15444
15535
  ...shared,
15445
- waiting: "○",
15536
+ filed: "○",
15537
+ waiting: "◔",
15446
15538
  answered: "◉",
15447
15539
  asked: "●",
15448
15540
  rule: "▏"
@@ -15455,6 +15547,7 @@ var init_marks = __esmMin((() => {
15455
15547
  };
15456
15548
  marks = () => chosen;
15457
15549
  STAND_KEY = {
15550
+ filed: "filed",
15458
15551
  waiting: "waiting",
15459
15552
  answered: "answered",
15460
15553
  asked: "asked",
@@ -15553,6 +15646,7 @@ var init_diffview = __esmMin((() => {
15553
15646
  init_dist();
15554
15647
  init_patch();
15555
15648
  init_marks();
15649
+ init_model();
15556
15650
  init_theme();
15557
15651
  WASH = {
15558
15652
  added: {
@@ -16119,7 +16213,8 @@ var init_diffview = __esmMin((() => {
16119
16213
  if (note.asks) return `${marks().asked} asked back${moved}`;
16120
16214
  if (note.turns.at(-1)?.voice === "reviewer") return `${marks().waiting} replied${moved}`;
16121
16215
  if (note.answers.length > 0) return `${marks().answered} answered${moved}`;
16122
- return `${marks().sent} sent${moved}`;
16216
+ if (note.takenAt === void 0) return `${marks().sent} sent${moved}`;
16217
+ return `${marks().waiting} picked up ${sinceThen(note.takenAt, note.now)}${moved}`;
16123
16218
  };
16124
16219
  spokenLines = (body, room, mark) => {
16125
16220
  return wrap(body.replaceAll("\n", " "), Math.max(NOTE_MIN, room - 2)).map((text, at) => at === 0 ? `${mark} ${text}` : ` ${text}`);
@@ -16235,7 +16330,7 @@ var init_diffview = __esmMin((() => {
16235
16330
  }));
16236
16331
  //#endregion
16237
16332
  //#region src/tui/render.ts
16238
- var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, keysTitle, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, DIFF_FLOOR, COMPOSE_EDGE, CRAMPED, CRAMPED_ROWS, DIFF_CHROME_MOST, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, keysOf, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, PLAIN_PICKED, PICKED, PLAIN_CURSOR, UNDER_CURSOR, GAP_PAINT, frameRoot, crampedBar, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking, makePaletteParts, makeChoices, LIST_LEAD, windowed, listText, stack, makeBody, makeHome, makeModals, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, stillThere, quotedFor, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, chipWidth, WAYS_OUT, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, SUMMARY_LINES, summaryLines, contextLabel, nameRoom, stateRoom, columns, FORGE_SILENT, unaskedForge, branchHeading, atHome, layersCell, baseLabel, stateCell, branchCells, placeLabel, headerParts, panLabel, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, GUTTER, DIR_LEAD, TITLE_LEAD, FILE_LEAD, STALE_ROOM, STALE_LONG, STALE_SHORT, staleBanner, layerRoom, litRow, leftOver, titlePaint, titleMark, titleLook, fileMark, fileLook, layerLook, layerGutter, layerText, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, foundTitle, CHANGED_MARK, fileRow, blockOf, aroundRow, windowedBlocks, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelText, Screen;
16333
+ var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, keysTitle, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, DIFF_FLOOR, COMPOSE_EDGE, CRAMPED, CRAMPED_ROWS, DIFF_CHROME_MOST, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, keysOf, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, PLAIN_PICKED, PICKED, PLAIN_CURSOR, UNDER_CURSOR, GAP_PAINT, frameRoot, crampedBar, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking, makePaletteParts, makeChoices, LIST_LEAD, windowed, listText, stack, makeBody, makeHome, makeModals, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, stillThere, quotedFor, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, chipWidth, WAYS_OUT, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, SUMMARY_LINES, summaryLines, contextLabel, nameRoom, stateRoom, columns, FORGE_SILENT, unaskedForge, branchHeading, atHome, layersCell, baseLabel, stateCell, branchCells, placeLabel, headerParts, panLabel, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, GUTTER, DIR_LEAD, TITLE_LEAD, FILE_LEAD, STALE_ROOM, STALE_ASKING, STALE_LONG, STALE_MIDDLE, STALE_SHORT, staleSaid, staleBanner, litRow, leftOver, titlePaint, titleMark, titleLook, fileMark, fileLook, layerLook, layerGutter, layerText, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, foundTitle, CHANGED_MARK, fileRow, blockOf, aroundRow, windowedBlocks, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelText, Screen;
16239
16334
  var init_render = __esmMin((() => {
16240
16335
  init_dist();
16241
16336
  init_command();
@@ -16751,9 +16846,12 @@ var init_render = __esmMin((() => {
16751
16846
  };
16752
16847
  waitingLabel = (branch) => branch.unanswered > 0 ? `${branch.unanswered} unanswered` : "";
16753
16848
  inRange = (state, row, from, to) => state.selecting && row >= from && row <= to;
16754
- notesOf = (comments, path, sent, opened = []) => comments.filter((entry) => entry.file === path).map((entry) => ({
16849
+ notesOf = (comments, path, sent, shown = {
16850
+ opened: [],
16851
+ now: Date.now()
16852
+ }) => comments.filter((entry) => entry.file === path).map((entry) => ({
16755
16853
  id: entry.id ?? "",
16756
- folded: entry.settled === true && !(entry.id !== void 0 && opened.includes(entry.id)),
16854
+ folded: entry.settled === true && !(entry.id !== void 0 && shown.opened.includes(entry.id)),
16757
16855
  side: entry.side,
16758
16856
  line: entry.end,
16759
16857
  body: entry.body,
@@ -16762,9 +16860,14 @@ var init_render = __esmMin((() => {
16762
16860
  stale: entry.stale === true,
16763
16861
  asks: entry.asks === true,
16764
16862
  answers: entry.answers ?? [],
16765
- turns: entry.turns ?? []
16863
+ turns: entry.turns ?? [],
16864
+ takenAt: entry.takenAt,
16865
+ now: shown.now
16766
16866
  }));
16767
- notesFor = (state, path) => notesOf(stillThere(state.sent), path, true, state.opened);
16867
+ notesFor = (state, path) => notesOf(stillThere(state.sent), path, true, {
16868
+ opened: state.opened,
16869
+ now: state.now
16870
+ });
16768
16871
  paired = (chunks) => {
16769
16872
  const chips = [];
16770
16873
  for (let at = 0; at < chunks.length; at += CHIP_CHUNKS) chips.push(chunks.slice(at, at + CHIP_CHUNKS));
@@ -16902,21 +17005,19 @@ var init_render = __esmMin((() => {
16902
17005
  return `${treeMarks(state, row)}${clip(treeLabel(state, row, room), room).padEnd(room)}${tail}`;
16903
17006
  };
16904
17007
  GUTTER = 3;
16905
- DIR_LEAD = GUTTER;
17008
+ DIR_LEAD = 6;
16906
17009
  TITLE_LEAD = 4;
16907
- FILE_LEAD = 6;
17010
+ FILE_LEAD = 8;
16908
17011
  STALE_ROOM = 13;
16909
- STALE_LONG = "stale, the branch moved on";
17012
+ STALE_ASKING = 24;
17013
+ STALE_LONG = "stale, the branch moved on — press L to ask for a new one";
17014
+ STALE_MIDDLE = "stale, the branch moved on";
16910
17015
  STALE_SHORT = "stale";
16911
- staleBanner = (room) => wrapped(room >= STALE_ROOM ? STALE_LONG : STALE_SHORT, room).map((line) => ` ${line}`).join("\n");
16912
- layerRoom = (pane) => {
16913
- const whole = Math.max(8, pane - PANE_CHROME);
16914
- return {
16915
- title: Math.max(4, whole - TITLE_LEAD),
16916
- dir: Math.max(4, whole - DIR_LEAD),
16917
- file: Math.max(4, whole - FILE_LEAD)
16918
- };
17016
+ staleSaid = (room) => {
17017
+ if (room >= STALE_ASKING) return STALE_LONG;
17018
+ return room >= STALE_ROOM ? STALE_MIDDLE : STALE_SHORT;
16919
17019
  };
17020
+ staleBanner = (room) => wrapped(staleSaid(room), room).map((line) => ` ${line}`).join("\n");
16920
17021
  litRow = (row, state, drawn) => row.here === true ? bg(restingOrHere(state.focus === "tree"))(drawn) : drawn;
16921
17022
  leftOver = (state, layerIndex) => state.layers[layerIndex]?.title === REMAINDER_TITLE;
16922
17023
  titlePaint = (state, layerIndex) => {
@@ -16954,7 +17055,11 @@ var init_render = __esmMin((() => {
16954
17055
  mark: " ",
16955
17056
  paint: palette.faint
16956
17057
  };
16957
- case "count":
17058
+ case "count": return {
17059
+ lead: DIR_LEAD,
17060
+ mark: " ",
17061
+ paint: palette.faint
17062
+ };
16958
17063
  case "gap": return {
16959
17064
  lead: TITLE_LEAD,
16960
17065
  mark: " ",
@@ -16970,12 +17075,13 @@ var init_render = __esmMin((() => {
16970
17075
  }
16971
17076
  };
16972
17077
  layerGutter = (row, look) => {
16973
- return `${row.here === true ? marks().cursor : " "}${look.mark.padStart(2)}`;
17078
+ return `${row.here === true ? marks().cursor : " "}${look.mark.padStart(GUTTER - 1)}`;
16974
17079
  };
16975
17080
  layerText = (row, look, room) => row.kind === "gap" ? "" : `${layerGutter(row, look)}${" ".repeat(look.lead - GUTTER)}${row.text}`.padEnd(room.title + TITLE_LEAD);
16976
17081
  PANEL_TITLES = {
16977
17082
  asked: "Waiting on you",
16978
- with: "With the agent",
17083
+ filed: "Not picked up",
17084
+ with: "Picked up, no answer",
16979
17085
  answered: "Answered, not settled",
16980
17086
  settled: "Settled",
16981
17087
  removed: "Removed"
@@ -17453,7 +17559,7 @@ var init_render = __esmMin((() => {
17453
17559
  return Math.max(1, this.listPane.height - edges);
17454
17560
  }
17455
17561
  layerRail(state) {
17456
- const room = layerRoom(this.paneRoom());
17562
+ const room = layerRoomIn(state);
17457
17563
  const said = summaryLines(state.summary, room.title, this.listRoom());
17458
17564
  const banner = (state.layersStale ? 1 : 0) + said.length;
17459
17565
  const height = Math.max(1, this.listRoom() - banner);
@@ -17479,11 +17585,11 @@ var init_render = __esmMin((() => {
17479
17585
  return [fg(row.here === true ? palette.marker : palette.faint)(drawn.slice(0, 1)), litRow(row, state, body)];
17480
17586
  }
17481
17587
  railFitted(state, all, height) {
17482
- const whole = railWindow(all, height, state.layerIndex);
17588
+ const whole = railWindow(all, height, state.layerIndex, state.railScroll);
17483
17589
  if (whole.more === 0 && whole.above === 0) return whole;
17484
- const once = railWindow(all, Math.max(1, height - 1), state.layerIndex);
17590
+ const once = railWindow(all, Math.max(1, height - 1), state.layerIndex, state.railScroll);
17485
17591
  if (once.above === 0 || once.more === 0) return once;
17486
- return railWindow(all, Math.max(1, height - 2), state.layerIndex);
17592
+ return railWindow(all, Math.max(1, height - 2), state.layerIndex, state.railScroll);
17487
17593
  }
17488
17594
  paintDiff(state) {
17489
17595
  const shown = shownOf(state);
@@ -17895,7 +18001,7 @@ var init_upgrade = __esmMin((() => {
17895
18001
  }));
17896
18002
  //#endregion
17897
18003
  //#region src/tui/app.ts
17898
- var LEAVING_MS, LOOK_MS, LEAVING_SAID, NOTHING_WRITTEN, LAYERS_ASK_LEAD, layersAsk, askedFor, alongFrom, NOTICE_MS, KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, seedFor, handOver, throughMultiplexer, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, OVER, overReview, writesInto, listens, LETTER, laidOut, ARROWS, SHIFTED, keyName, App, sentAway, turnedOver, settledPath, restsWhereItLanded, lonelyGaps, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
18004
+ var LEAVING_MS, LOOK_MS, AGE_TICK_MS, LEAVING_SAID, NOTHING_WRITTEN, LAYERS_ASK_LEAD, layersAsk, askedFor, alongFrom, NOTICE_MS, KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, seedFor, handOver, throughMultiplexer, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, OVER, overReview, writesInto, listens, LETTER, laidOut, ARROWS, SHIFTED, keyName, App, sentAway, turnedOver, settledPath, restsWhereItLanded, lonelyGaps, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
17899
18005
  var init_app = __esmMin((() => {
17900
18006
  init_dist();
17901
18007
  init_report();
@@ -17915,6 +18021,7 @@ var init_app = __esmMin((() => {
17915
18021
  init_upgrade();
17916
18022
  LEAVING_MS = 3e3;
17917
18023
  LOOK_MS = 110;
18024
+ AGE_TICK_MS = 3e4;
17918
18025
  LEAVING_SAID = "press ctrl+c again to leave";
17919
18026
  NOTHING_WRITTEN = "nothing written yet";
17920
18027
  LAYERS_ASK_LEAD = "About this branch, not about this line.";
@@ -18071,6 +18178,8 @@ var init_app = __esmMin((() => {
18071
18178
  selectingNow = false;
18072
18179
  leaving;
18073
18180
  looking;
18181
+ rolling = false;
18182
+ ticking;
18074
18183
  grewWithShift = false;
18075
18184
  keys = [];
18076
18185
  trail = [];
@@ -18099,7 +18208,7 @@ var init_app = __esmMin((() => {
18099
18208
  onPan: (delta) => this.onPanWheel(delta),
18100
18209
  onDrag: (from, to, done) => this.dragged(from, to, done),
18101
18210
  onChip: (key) => this.dispatchTask(this.onKey(asKey(key))),
18102
- onRail: (delta) => this.dispatchTask(this.rolled(delta))
18211
+ onRail: (delta) => this.rollFrom(delta)
18103
18212
  }));
18104
18213
  renderer.on("selection", () => this.copyDragged());
18105
18214
  runSync(options.display.onWritten((text) => this.readBack(text)));
@@ -18109,6 +18218,8 @@ var init_app = __esmMin((() => {
18109
18218
  renderer.on("destroy", () => this.stopWatching());
18110
18219
  renderer.on("destroy", () => this.stopFading());
18111
18220
  renderer.on("destroy", () => this.stopLooking());
18221
+ renderer.on("destroy", () => this.stopTicking());
18222
+ this.startTicking();
18112
18223
  renderer.on("destroy", () => this.stopLighting());
18113
18224
  renderer.on("destroy", () => void getTreeSitterClient().destroy());
18114
18225
  renderer.on("destroy", () => this.stopPainting());
@@ -18364,6 +18475,24 @@ var init_app = __esmMin((() => {
18364
18475
  this.lighting = void 0;
18365
18476
  if (fiber !== void 0) runFork(interrupt(fiber));
18366
18477
  }
18478
+ startTicking() {
18479
+ this.commit({
18480
+ ...this.state,
18481
+ now: Date.now()
18482
+ });
18483
+ this.ticking = setInterval(() => {
18484
+ this.commit({
18485
+ ...this.state,
18486
+ now: Date.now()
18487
+ });
18488
+ }, AGE_TICK_MS);
18489
+ this.ticking.unref?.();
18490
+ }
18491
+ stopTicking() {
18492
+ if (this.ticking === void 0) return;
18493
+ clearInterval(this.ticking);
18494
+ this.ticking = void 0;
18495
+ }
18367
18496
  stopFading() {
18368
18497
  const fiber = this.fading;
18369
18498
  this.fading = void 0;
@@ -18857,8 +18986,15 @@ var init_app = __esmMin((() => {
18857
18986
  const was = this.state.patchIndex;
18858
18987
  this.commit(reduce(this.measured(), delta > 0 ? "comment.next" : "comment.prev"));
18859
18988
  if (this.state.patchIndex !== was) yield* this.turnedTo();
18989
+ this.rolling = false;
18860
18990
  });
18861
18991
  }
18992
+ rollFrom(delta) {
18993
+ const costly = onLayers(this.state);
18994
+ if (costly && this.rolling) return;
18995
+ this.rolling = costly;
18996
+ this.dispatchTask(this.rolled(delta));
18997
+ }
18862
18998
  stepped(delta) {
18863
18999
  return gen({ self: this }, function* () {
18864
19000
  if (this.paged(delta)) return;
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.133",
26
+ "version": "0.1.0-alpha.135",
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": {