@eliya-oss/agent-diff 0.1.0-alpha.183 → 0.1.0-alpha.185

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.185
4
+
5
+ ### Patch Changes
6
+
7
+ - fix(diff): a `.css` file is drawn in colour, with a property and its value in two colours.
8
+
9
+ <details><summary>What was wrong</summary>
10
+
11
+ The terminal library knows a `.css` file is CSS but carries no grammar for it, so every stylesheet read as plain text beside the coloured component that used it.
12
+
13
+ </details>
14
+
15
+ ## 0.1.0-alpha.184
16
+
17
+ ### Patch Changes
18
+
19
+ - feat(CLI): `adiff patch show` answers a branch's diff as JSON, with line numbers on both sides, and with binary and generated files listed and flagged.
20
+
21
+ <details><summary>What it is for</summary>
22
+
23
+ Another program on your machine, such as a review page in the browser, draws the same rows the terminal draws instead of diffing the files itself. `--file` narrows it to one file, and `--context all` answers whole files.
24
+
25
+ </details>
26
+
27
+ feat(comment delivery): an open review shows a comment filed from another program without a reload, and `adiff comment list` reports the code each comment was written against.
28
+
29
+ <details><summary>What changed</summary>
30
+
31
+ The terminal used to notice only the agent's answers. A comment sent with `adiff comment send` from elsewhere now draws in the open review as soon as it is filed.
32
+
33
+ </details>
34
+
3
35
  ## 0.1.0-alpha.183
4
36
 
5
37
  ### Patch Changes
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Max Brunsfeld
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,76 @@
1
+ (comment) @comment
2
+
3
+ (tag_name) @tag
4
+ (nesting_selector) @tag
5
+ (universal_selector) @tag
6
+
7
+ "~" @operator
8
+ ">" @operator
9
+ "+" @operator
10
+ "-" @operator
11
+ "*" @operator
12
+ "/" @operator
13
+ "=" @operator
14
+ "^=" @operator
15
+ "|=" @operator
16
+ "~=" @operator
17
+ "$=" @operator
18
+ "*=" @operator
19
+
20
+ "and" @operator
21
+ "or" @operator
22
+ "not" @operator
23
+ "only" @operator
24
+
25
+ (attribute_selector (plain_value) @string)
26
+
27
+ ((property_name) @variable
28
+ (#match? @variable "^--"))
29
+ ((plain_value) @variable
30
+ (#match? @variable "^--"))
31
+
32
+ (class_name) @property
33
+ (id_name) @property
34
+ (namespace_name) @property
35
+ (property_name) @property
36
+ (feature_name) @property
37
+
38
+ (pseudo_element_selector (tag_name) @attribute)
39
+ (pseudo_class_selector (class_name) @attribute)
40
+ (attribute_name) @attribute
41
+
42
+ (function_name) @function
43
+
44
+ "@media" @keyword
45
+ "@import" @keyword
46
+ "@charset" @keyword
47
+ "@namespace" @keyword
48
+ "@supports" @keyword
49
+ "@keyframes" @keyword
50
+ (at_keyword) @keyword
51
+ (to) @keyword
52
+ (from) @keyword
53
+ (important) @keyword
54
+
55
+ (string_value) @string
56
+ (color_value) @string.special
57
+
58
+ (integer_value) @number
59
+ (float_value) @number
60
+ (unit) @type
61
+
62
+ [
63
+ "#"
64
+ ","
65
+ "."
66
+ ":"
67
+ "::"
68
+ ";"
69
+ ] @punctuation.delimiter
70
+
71
+ [
72
+ "{"
73
+ ")"
74
+ "("
75
+ "}"
76
+ ] @punctuation.bracket
package/dist/main.js CHANGED
@@ -6,7 +6,7 @@ import { fileURLToPath } from "node:url";
6
6
  import { join, resolve } from "node:path";
7
7
  import { promisify } from "node:util";
8
8
  import { homedir, hostname, platform } from "node:os";
9
- import { ASCIIFontRenderable, BoxRenderable, CodeRenderable, KeyEvent, LineNumberRenderable, RGBA, StyledText, SyntaxStyle, TextRenderable, TextareaRenderable, bg, bold, createCliRenderer, defaultTextareaKeyBindings, fg, fonts, getTreeSitterClient, pathToFiletype, stripAnsiSequences, t } from "@opentui/core";
9
+ import { ASCIIFontRenderable, BoxRenderable, CodeRenderable, KeyEvent, LineNumberRenderable, RGBA, StyledText, SyntaxStyle, TextRenderable, TextareaRenderable, addDefaultParsers, bg, bold, createCliRenderer, defaultTextareaKeyBindings, fg, fonts, getTreeSitterClient, pathToFiletype, stripAnsiSequences, t } from "@opentui/core";
10
10
  import { existsSync, mkdirSync, watch } from "node:fs";
11
11
  //#region \0rolldown/runtime.js
12
12
  var __defProp = Object.defineProperty;
@@ -10042,7 +10042,7 @@ var init_config = __esmMin((() => {
10042
10042
  //#region package.json
10043
10043
  init_pane();
10044
10044
  init_config();
10045
- var version$1 = "0.1.0-alpha.183";
10045
+ var version$1 = "0.1.0-alpha.185";
10046
10046
  //#endregion
10047
10047
  //#region src/cli/error.ts
10048
10048
  var UnknownCommand, MissingOption, UnknownField, UnknownOption, BadOption, RegistryUnanswered;
@@ -10381,6 +10381,30 @@ var init_catalog = __esmMin((() => {
10381
10381
  dataKey: "pane",
10382
10382
  example: "adiff review pane --repo ."
10383
10383
  },
10384
+ {
10385
+ name: "patch show",
10386
+ about: "A branch's diff as rows with line numbers on both sides, read from the same parse the terminal draws. Binary and generated files are listed and flagged",
10387
+ group: READ_A_BRANCH,
10388
+ addresses: "review",
10389
+ safety: "read",
10390
+ options: [
10391
+ ...based,
10392
+ {
10393
+ name: "file",
10394
+ required: false,
10395
+ value: "path",
10396
+ about: "Answer for this one file only"
10397
+ },
10398
+ {
10399
+ name: "context",
10400
+ required: false,
10401
+ value: "lines|all",
10402
+ about: "Unchanged lines around each change. Defaults to 3; `all` answers whole files"
10403
+ }
10404
+ ],
10405
+ dataKey: "patch",
10406
+ example: "adiff patch show --repo . --branch add-invitations --file src/api.ts --context all"
10407
+ },
10384
10408
  {
10385
10409
  name: "file review",
10386
10410
  about: "Toggle a file as reviewed. Lapses on its own when the file changes",
@@ -10907,7 +10931,7 @@ var init_catalog = __esmMin((() => {
10907
10931
  }));
10908
10932
  //#endregion
10909
10933
  //#region src/cli/parse.ts
10910
- var FLAG, flagOn, tokenOn, optionsFrom, onlyKnown, oneOf, required, numeric, seconds;
10934
+ var FLAG, flagOn, tokenOn, optionsFrom, onlyKnown, oneOf, required, numeric, WHOLE, around$1, seconds;
10911
10935
  var init_parse$1 = __esmMin((() => {
10912
10936
  init_dist();
10913
10937
  init_catalog();
@@ -10987,6 +11011,18 @@ var init_parse$1 = __esmMin((() => {
10987
11011
  allowed: ["a whole number of 1 or more"]
10988
11012
  });
10989
11013
  });
11014
+ WHOLE = "all";
11015
+ around$1 = fn("Cli.around")(function* (options, name) {
11016
+ const raw = options[name];
11017
+ if (raw === void 0) return void 0;
11018
+ if (raw === WHOLE) return WHOLE;
11019
+ const parsed = Number(raw);
11020
+ return yield* Number.isInteger(parsed) && parsed >= 0 ? succeed$1(parsed) : new BadOption({
11021
+ option: name,
11022
+ given: raw,
11023
+ allowed: ["a whole number of 0 or more", WHOLE]
11024
+ });
11025
+ });
10990
11026
  seconds = fn("Cli.seconds")(function* (options, name) {
10991
11027
  const raw = options[name];
10992
11028
  if (raw === void 0) return 0;
@@ -11473,10 +11509,12 @@ var init_parse = __esmMin((() => {
11473
11509
  };
11474
11510
  FROM_MARKERS = [{
11475
11511
  marker: "rename from ",
11476
- said: "renamed from"
11512
+ said: "renamed from",
11513
+ status: "renamed"
11477
11514
  }, {
11478
11515
  marker: "copy from ",
11479
- said: "copied from"
11516
+ said: "copied from",
11517
+ status: "copied"
11480
11518
  }];
11481
11519
  draftFrom = (line) => {
11482
11520
  const named = FILE_HEADER.exec(line);
@@ -11488,6 +11526,8 @@ var init_parse = __esmMin((() => {
11488
11526
  notes: [],
11489
11527
  oldMode: "",
11490
11528
  made: "changed",
11529
+ status: "changed",
11530
+ binary: false,
11491
11531
  hunks: [],
11492
11532
  rows: [],
11493
11533
  added: 0,
@@ -11574,15 +11614,18 @@ var init_parse = __esmMin((() => {
11574
11614
  if (readMode(draft, line)) return true;
11575
11615
  if (line.startsWith(FILE_ADDED_MARKER) || line.startsWith(FILE_GONE_MARKER)) {
11576
11616
  draft.made = line.startsWith(FILE_ADDED_MARKER) ? "added" : "deleted";
11617
+ draft.status = draft.made;
11577
11618
  return true;
11578
11619
  }
11579
11620
  const from = FROM_MARKERS.find((entry) => line.startsWith(entry.marker));
11580
11621
  if (from === void 0) return false;
11581
11622
  draft.notes.push(`${from.said} ${line.slice(from.marker.length)}`);
11623
+ draft.status = from.status;
11582
11624
  return true;
11583
11625
  };
11584
11626
  readBinary = (draft, line) => {
11585
11627
  if (!line.startsWith(BINARY_MARKER)) return false;
11628
+ draft.binary = true;
11586
11629
  told(draft, draft.notes);
11587
11630
  openPlain(draft);
11588
11631
  appendRow(draft, "context", BINARY_SAID);
@@ -11710,7 +11753,7 @@ var init_run = __esmMin((() => {
11710
11753
  gitOrEmpty = fn("Git.runOrEmpty")(function* (cwd, args) {
11711
11754
  return yield* git(cwd, args).pipe(catchTag("GitCommandFailed", () => succeed$1("")));
11712
11755
  });
11713
- })), CACHE_SIZE, NAME_TTL, FRESH_TTL, SPLIT$1, DEFAULT_BRANCH_CANDIDATES, PLAIN_PATHS, STAT, Git, parseStat, readEntries, findDefaultBranch, partsOf$1, findMergeBase, toWorktree, branchTips, findParent, splitLines, absent, readText, settled, seenAs, listWorktrees, readDiff, readStat, readSource, readBlob, readGrep, findRepo, LINKED_GIT_DIR, HEAD_REF, gitDirOf, findCommonDir, readHead, REFS_MOST, readCommits, readRefs, refResolves, sharedCommit, makeCaches, shapeWith, makeGit, GitLive;
11756
+ })), CACHE_SIZE, NAME_TTL, FRESH_TTL, SPLIT$1, DEFAULT_BRANCH_CANDIDATES, PLAIN_PATHS, STAT, Git, parseStat, readEntries, findDefaultBranch, partsOf$1, findMergeBase, toWorktree, branchTips, findParent, splitLines, absent, readText, settled, seenAs, listWorktrees, readDiff, readStat, readSource, readBlob, readGrep, GENERATED_SAID, markedGenerated, readGenerated, findRepo, LINKED_GIT_DIR, HEAD_REF, gitDirOf, findCommonDir, readHead, REFS_MOST, readCommits, readRefs, refResolves, sharedCommit, makeCaches, shapeWith, makeGit, GitLive;
11714
11757
  var init_service$2 = __esmMin((() => {
11715
11758
  init_dist();
11716
11759
  init_error$4();
@@ -11877,6 +11920,24 @@ var init_service$2 = __esmMin((() => {
11877
11920
  term
11878
11921
  ]);
11879
11922
  });
11923
+ GENERATED_SAID = ": linguist-generated: ";
11924
+ markedGenerated = (line) => {
11925
+ const at = line.lastIndexOf(GENERATED_SAID);
11926
+ if (at === -1) return [];
11927
+ const value = line.slice(at + 22).trim();
11928
+ return value === "unspecified" || value === "unset" || value === "false" ? [] : [line.slice(0, at)];
11929
+ };
11930
+ readGenerated = fn("Git.generated")(function* (worktree, paths) {
11931
+ if (paths.length === 0) return /* @__PURE__ */ new Set();
11932
+ const raw = yield* gitOrEmpty(worktree.path, [
11933
+ ...PLAIN_PATHS,
11934
+ "check-attr",
11935
+ "linguist-generated",
11936
+ "--",
11937
+ ...paths
11938
+ ]);
11939
+ return new Set(raw.split("\n").flatMap(markedGenerated));
11940
+ });
11880
11941
  findRepo = fn("Git.repoOf")(function* (worktree) {
11881
11942
  const trimmed = (yield* gitOrEmpty(worktree, [
11882
11943
  "rev-parse",
@@ -11976,6 +12037,7 @@ var init_service$2 = __esmMin((() => {
11976
12037
  source: readSource,
11977
12038
  blob: readBlob,
11978
12039
  grep: readGrep,
12040
+ generated: readGenerated,
11979
12041
  defaultBranch: (repo) => get(caches.baseName, repo),
11980
12042
  stackParent: (repo, branch) => get(caches.baseName, repo).pipe(flatMap((fallback) => get(caches.parent, `${repo}${SPLIT$1}${branch}${SPLIT$1}${fallback}`))),
11981
12043
  refs: readRefs,
@@ -12635,7 +12697,7 @@ var init_error$2 = __esmMin((() => {
12635
12697
  PartlySent = class extends TaggedError("PartlySent") {};
12636
12698
  PullMoved = class extends TaggedError("PullMoved") {};
12637
12699
  NoLayers = class extends TaggedError("NoLayers") {};
12638
- })), realOf, AUTO, askedFor$1, basedOn, named$3, find, worktreeAt, patches, reading, waitingOn, summaryOf, summary, list$5, markOpened, lastOpened, repoOf, nameAt, saveReport, refs, forOne, recentBases, setBase, clearBase;
12700
+ })), 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;
12639
12701
  var init_branches$1 = __esmMin((() => {
12640
12702
  init_dist();
12641
12703
  init_patch();
@@ -12718,7 +12780,7 @@ var init_branches$1 = __esmMin((() => {
12718
12780
  find = fn("Review.Branch.find")(function* (repo, branch, base) {
12719
12781
  return (yield* basedOn(repo, yield* named$3(repo, branch), base)).worktree;
12720
12782
  });
12721
- worktreeAt = fn("Review.Branch.worktreeAt")(function* (worktreePath, base) {
12783
+ basedAt = fn("Review.Branch.basedAt")(function* (worktreePath, base) {
12722
12784
  const git = yield* Git;
12723
12785
  const asked = yield* git.realPathOf(worktreePath);
12724
12786
  const worktrees = yield* git.worktrees(asked);
@@ -12728,7 +12790,10 @@ var init_branches$1 = __esmMin((() => {
12728
12790
  known: worktrees.map((entry) => entry.path)
12729
12791
  });
12730
12792
  const repo = yield* git.repoOf(found.path);
12731
- return (yield* basedOn(repo, found, base)).worktree;
12793
+ return yield* basedOn(repo, found, base);
12794
+ });
12795
+ worktreeAt = fn("Review.Branch.worktreeAt")(function* (worktreePath, base) {
12796
+ return (yield* basedAt(worktreePath, base)).worktree;
12732
12797
  });
12733
12798
  patches = fn("Review.Branch.patches")(function* (worktree, context = 3, only) {
12734
12799
  const raw = yield* (yield* Git).diff(worktree, context, only);
@@ -12856,7 +12921,7 @@ var init_branches$1 = __esmMin((() => {
12856
12921
  }));
12857
12922
  //#endregion
12858
12923
  //#region src/review/patches.ts
12859
- var findPatch, blobOf, anchor, list$4, source, before;
12924
+ var findPatch, blobOf, anchor, list$4, source, before, linesAround, GENERATED_NAME, lineOf$2, isNote$1, shownRow, shownHunk, shownFile, show$2;
12860
12925
  var init_patches = __esmMin((() => {
12861
12926
  init_dist();
12862
12927
  init_patch();
@@ -12895,6 +12960,54 @@ var init_patches = __esmMin((() => {
12895
12960
  const found = yield* (yield* Git).blob(worktree, file);
12896
12961
  return getOrElse(found, () => []);
12897
12962
  });
12963
+ linesAround = (context) => {
12964
+ if (context === "all") return WHOLE_FILE;
12965
+ return context ?? 3;
12966
+ };
12967
+ GENERATED_NAME = /\.generated\./;
12968
+ lineOf$2 = (side, line) => match$3(line, {
12969
+ onNone: () => ({}),
12970
+ onSome: (at) => ({ [side]: at })
12971
+ });
12972
+ isNote$1 = (hunk, row) => hunk.marker.length === 0 || isNone(row.oldLine) && isNone(row.newLine);
12973
+ shownRow = (hunk, row) => isNote$1(hunk, row) ? {
12974
+ kind: "note",
12975
+ text: row.text
12976
+ } : {
12977
+ kind: row.kind,
12978
+ ...lineOf$2("old", row.oldLine),
12979
+ ...lineOf$2("new", row.newLine),
12980
+ text: row.text
12981
+ };
12982
+ shownHunk = (hunk) => ({
12983
+ header: hunk.marker,
12984
+ scope: hunk.scope,
12985
+ skipped: hunk.skipped,
12986
+ rows: hunk.rows.map((row) => shownRow(hunk, row))
12987
+ });
12988
+ shownFile = (patch, generated) => ({
12989
+ path: patch.path,
12990
+ previousPath: patch.previousPath,
12991
+ status: patch.status,
12992
+ binary: patch.binary,
12993
+ generated: generated.has(patch.path) || GENERATED_NAME.test(patch.path),
12994
+ added: patch.added,
12995
+ removed: patch.removed,
12996
+ hunks: patch.hunks.map(shownHunk)
12997
+ });
12998
+ show$2 = fn("Review.Diff.show")(function* (based, showing) {
12999
+ const git = yield* Git;
13000
+ const { worktree } = based;
13001
+ const patches$3 = yield* patches(worktree, linesAround(showing.context), showing.file);
13002
+ const generated = yield* git.generated(worktree, patches$3.map((patch) => patch.path));
13003
+ return {
13004
+ branch: worktree.branch,
13005
+ base: based.base,
13006
+ mergeBase: worktree.base,
13007
+ head: worktree.head,
13008
+ files: patches$3.map((patch) => shownFile(patch, generated))
13009
+ };
13010
+ });
12898
13011
  }));
12899
13012
  //#endregion
12900
13013
  //#region src/domain/layers/model.ts
@@ -13392,6 +13505,7 @@ var init_threads$1 = __esmMin((() => {
13392
13505
  side: comment.anchor.side,
13393
13506
  start: sits.start,
13394
13507
  end: sits.end,
13508
+ snippet: comment.anchor.snippet,
13395
13509
  body: comment.body,
13396
13510
  state: stateOf$2(turns, mine.at(-1)?.asks === true, settled, Object.hasOwn(conversation.removed, comment.id)),
13397
13511
  stale: batch.head !== conversation.head,
@@ -15117,29 +15231,48 @@ const helpUnder = (noun) => {
15117
15231
  };
15118
15232
  //#endregion
15119
15233
  //#region src/tui/watch.ts
15120
- var OUTBOX, SETTLE_MS, WatchUnavailable, answered, opened, holding$1, answers;
15234
+ var OUTBOX, FILED, SETTLE_MS, WatchUnavailable, answered, filed, opened, holding$1, changesTo, answers, filings;
15121
15235
  var init_watch = __esmMin((() => {
15122
15236
  init_dist();
15123
15237
  OUTBOX = "outbox.jsonl";
15238
+ FILED = ["inbox.jsonl", "state.json"];
15124
15239
  SETTLE_MS = 120;
15125
15240
  WatchUnavailable = class extends TaggedError("WatchUnavailable") {};
15126
- answered = (name) => name !== null && name.endsWith(OUTBOX);
15127
- opened = (branches, queue) => {
15241
+ answered = (name) => name.endsWith(OUTBOX);
15242
+ filed = (name) => FILED.some((file) => name.endsWith(file));
15243
+ opened = (branches, wanted, queue) => {
15128
15244
  mkdirSync(branches, { recursive: true });
15129
15245
  const watcher = watch(branches, { recursive: true }, (_event, name) => {
15130
- if (answered(name)) offerUnsafe(queue, void 0);
15246
+ if (name !== null && wanted(name)) offerUnsafe(queue, void 0);
15131
15247
  });
15132
15248
  watcher.on("error", () => void 0);
15133
15249
  return watcher;
15134
15250
  };
15135
- holding$1 = (branches, queue) => acquireRelease(try_({
15136
- try: () => opened(branches, queue),
15251
+ holding$1 = (branches, wanted, queue) => acquireRelease(try_({
15252
+ try: () => opened(branches, wanted, queue),
15137
15253
  catch: (cause) => new WatchUnavailable({
15138
15254
  root: branches,
15139
15255
  reason: String(cause)
15140
15256
  })
15141
15257
  }), (watcher) => sync(() => watcher.close()));
15142
- answers = (root) => callback((queue) => holding$1(join(root, "branches"), queue).pipe(catchTag("WatchUnavailable", () => void_))).pipe(debounce(SETTLE_MS));
15258
+ changesTo = (root, wanted) => callback((queue) => holding$1(join(root, "branches"), wanted, queue).pipe(catchTag("WatchUnavailable", () => void_))).pipe(debounce(SETTLE_MS));
15259
+ answers = (root) => changesTo(root, answered);
15260
+ filings = (root) => changesTo(root, filed);
15261
+ }));
15262
+ //#endregion
15263
+ //#region src/tui/grammars.ts
15264
+ var besideThis, css, grammarsAdded;
15265
+ var init_grammars = __esmMin((() => {
15266
+ init_dist();
15267
+ besideThis = (path) => fileURLToPath(new URL(`./grammars/${path}`, import.meta.url));
15268
+ css = {
15269
+ filetype: "css",
15270
+ queries: { highlights: [besideThis("css/highlights.scm")] },
15271
+ wasm: besideThis("css/tree-sitter-css.wasm")
15272
+ };
15273
+ grammarsAdded = sync(() => {
15274
+ if (existsSync(css.wasm)) addDefaultParsers([css]);
15275
+ });
15143
15276
  }));
15144
15277
  //#endregion
15145
15278
  //#region src/tui/command.ts
@@ -22423,7 +22556,7 @@ var init_remarks = __esmMin((() => {
22423
22556
  }));
22424
22557
  //#endregion
22425
22558
  //#region src/tui/branches.ts
22426
- var openedPull, openedOn, resumeAt, openBranch, readBranch, fillBranches, reloadList, reloadBranch, goBack, loadPulls, loadHeld, showPull, openBases, basedOnRef, clearBaseHere, afterBase, setBaseHere, noticeAnswers, noticeOnList;
22559
+ var openedPull, openedOn, resumeAt, openBranch, readBranch, fillBranches, reloadList, reloadBranch, goBack, loadPulls, loadHeld, showPull, openBases, basedOnRef, clearBaseHere, afterBase, setBaseHere, noticeAnswers, sameSent, noticeFiled, noticeOnList;
22427
22560
  var init_branches = __esmMin((() => {
22428
22561
  init_dist();
22429
22562
  init_forge();
@@ -22645,6 +22778,19 @@ var init_branches = __esmMin((() => {
22645
22778
  app.commit(withWaiting(withArrived(app.state, sent), `${said} answered · press r`));
22646
22779
  });
22647
22780
  };
22781
+ sameSent = (one, other) => JSON.stringify(one) === JSON.stringify(other);
22782
+ noticeFiled = (app) => {
22783
+ return gen(function* () {
22784
+ const branch = selectedBranch(app.state);
22785
+ if (branch === void 0) return;
22786
+ const sent = yield* loadSent(app, branch.branch);
22787
+ if (sameSent(app.state.sent, sent)) return;
22788
+ app.commit({
22789
+ ...app.state,
22790
+ sent
22791
+ });
22792
+ });
22793
+ };
22648
22794
  noticeOnList = (app) => {
22649
22795
  return sync(() => app.commit(withWaiting(app.state, "the agent answered · press r")));
22650
22796
  };
@@ -23987,13 +24133,14 @@ var init_vouching = __esmMin((() => {
23987
24133
  }));
23988
24134
  //#endregion
23989
24135
  //#region src/tui/app.ts
23990
- 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, launch, untilDestroyed, runOn, rendererMade, runTui;
24136
+ 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;
23991
24137
  var init_app = __esmMin((() => {
23992
24138
  init_dist();
23993
24139
  init_preferences$1();
23994
24140
  init_git();
23995
24141
  init_store();
23996
24142
  init_watch();
24143
+ init_grammars();
23997
24144
  init_command();
23998
24145
  init_keys();
23999
24146
  init_reduce();
@@ -24199,6 +24346,9 @@ var init_app = __esmMin((() => {
24199
24346
  answered() {
24200
24347
  this.dispatch(noticeAnswers(this));
24201
24348
  }
24349
+ filed() {
24350
+ this.dispatch(noticeFiled(this));
24351
+ }
24202
24352
  ticked() {
24203
24353
  this.commit({
24204
24354
  ...this.state,
@@ -24605,7 +24755,9 @@ var init_app = __esmMin((() => {
24605
24755
  painting = (screen, state) => runForEach(changes(state), shownOn(screen));
24606
24756
  ticking = (app) => repeat(sync(() => app.ticked()), spaced(AGE_TICK_MS));
24607
24757
  noticing = (app, root) => runForEach(answers(root), () => sync(() => app.answered()));
24758
+ noticingFiled = (app, root) => runForEach(filings(root), () => sync(() => app.filed()));
24608
24759
  launch = fn("Tui.launch")(function* (asked, renderer, options = {}) {
24760
+ yield* grammarsAdded;
24609
24761
  const repo = yield* (yield* Git).realPathOf(asked);
24610
24762
  const branches = yield* firstBranches(repo, options.branch, options.base);
24611
24763
  const opensOn = openingOn(branches, options.branch);
@@ -24641,6 +24793,7 @@ var init_app = __esmMin((() => {
24641
24793
  yield* forkScoped(app.consume());
24642
24794
  yield* forkScoped(ticking(app));
24643
24795
  yield* forkScoped(noticing(app, store.root));
24796
+ yield* forkScoped(noticingFiled(app, store.root));
24644
24797
  yield* treeSitterFreed;
24645
24798
  app.open(opensOn, session, options.branch !== void 0 && branches.length === 1);
24646
24799
  return app;
@@ -24885,6 +25038,14 @@ const layersShow = fn("Main.layersShow")(function* (options) {
24885
25038
  const layers = yield* show(yield* worktreeNamed(options));
24886
25039
  yield* answer(options, { layers });
24887
25040
  });
25041
+ const patchShow = fn("Main.patchShow")(function* (options) {
25042
+ const based = yield* basedAt(yield* required(options, "worktree"), options["base"]);
25043
+ const patch = yield* show$2(based, {
25044
+ file: options["file"],
25045
+ context: yield* around$1(options, "context")
25046
+ });
25047
+ yield* answer(options, { patch });
25048
+ });
24888
25049
  const configList = fn("Main.configList")(function* (options) {
24889
25050
  yield* answer(options, { preferences: yield* list$1() });
24890
25051
  });
@@ -24944,6 +25105,7 @@ const routes = {
24944
25105
  "review progress": reviewStatus,
24945
25106
  "layers set": layersSet,
24946
25107
  "layers show": layersShow,
25108
+ "patch show": patchShow,
24947
25109
  upgrade: fn("Main.upgrade")(function* (options) {
24948
25110
  const check = options["check"] !== void 0;
24949
25111
  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.183",
26
+ "version": "0.1.0-alpha.185",
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": {