mindweave 2.2.0 → 2.3.0

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.
Files changed (91) hide show
  1. package/README.md +6 -2
  2. package/dist/alternator/chassis/lsp.js +47 -2
  3. package/dist/alternator/chassis/lsp.js.map +1 -1
  4. package/dist/cli/App.js +104 -39
  5. package/dist/cli/App.js.map +1 -1
  6. package/dist/cli/altScreen.js +17 -1
  7. package/dist/cli/altScreen.js.map +1 -1
  8. package/dist/cli/blockSpacing.js +29 -0
  9. package/dist/cli/blockSpacing.js.map +1 -0
  10. package/dist/cli/commandLabel.js +85 -0
  11. package/dist/cli/commandLabel.js.map +1 -0
  12. package/dist/cli/commands.js +40 -0
  13. package/dist/cli/commands.js.map +1 -0
  14. package/dist/cli/components/PromptInput.js +8 -1
  15. package/dist/cli/components/PromptInput.js.map +1 -1
  16. package/dist/cli/components/ToolGroup.js +5 -1
  17. package/dist/cli/components/ToolGroup.js.map +1 -1
  18. package/dist/cli/components/ToolLine.js +61 -6
  19. package/dist/cli/components/ToolLine.js.map +1 -1
  20. package/dist/cli/framebuffer/parse.js +10 -4
  21. package/dist/cli/framebuffer/parse.js.map +1 -1
  22. package/dist/cli/framebuffer/screen.js +26 -0
  23. package/dist/cli/framebuffer/screen.js.map +1 -1
  24. package/dist/cli/framebuffer/writer.js +131 -23
  25. package/dist/cli/framebuffer/writer.js.map +1 -1
  26. package/dist/cli/restart.js +99 -0
  27. package/dist/cli/restart.js.map +1 -0
  28. package/dist/cli/selfUpdate.js +124 -0
  29. package/dist/cli/selfUpdate.js.map +1 -0
  30. package/dist/cli/startupArgs.js +29 -2
  31. package/dist/cli/startupArgs.js.map +1 -1
  32. package/dist/cli/terminalRestore.js +9 -1
  33. package/dist/cli/terminalRestore.js.map +1 -1
  34. package/dist/cli/toolDisplay.js +15 -6
  35. package/dist/cli/toolDisplay.js.map +1 -1
  36. package/dist/cli/transcript.js +1 -1
  37. package/dist/cli/transcript.js.map +1 -1
  38. package/dist/cli/updateRunner.js +105 -0
  39. package/dist/cli/updateRunner.js.map +1 -0
  40. package/dist/drivers/gemini/manifest.js +16 -11
  41. package/dist/drivers/gemini/manifest.js.map +1 -1
  42. package/dist/drivers/meta/client.js +15 -4
  43. package/dist/drivers/meta/client.js.map +1 -1
  44. package/dist/drivers/meta/manifest.js +40 -13
  45. package/dist/drivers/meta/manifest.js.map +1 -1
  46. package/dist/dynamo/engine.js +30 -4
  47. package/dist/dynamo/engine.js.map +1 -1
  48. package/dist/dynamo/prompt.js +7 -4
  49. package/dist/dynamo/prompt.js.map +1 -1
  50. package/dist/dynamo/verify.js +8 -5
  51. package/dist/dynamo/verify.js.map +1 -1
  52. package/dist/index.js +32 -2
  53. package/dist/index.js.map +1 -1
  54. package/dist/memory/types.js.map +1 -1
  55. package/dist/tools/askUser.js +17 -5
  56. package/dist/tools/askUser.js.map +1 -1
  57. package/dist/tools/detail.js +69 -11
  58. package/dist/tools/detail.js.map +1 -1
  59. package/dist/tools/exitPlan.js +17 -1
  60. package/dist/tools/exitPlan.js.map +1 -1
  61. package/dist/tools/outputShape.js +137 -0
  62. package/dist/tools/outputShape.js.map +1 -0
  63. package/dist/tools/registry.js +0 -2
  64. package/dist/tools/registry.js.map +1 -1
  65. package/dist/tools/runCommand.js +31 -7
  66. package/dist/tools/runCommand.js.map +1 -1
  67. package/dist/tools/screenshot.js +33 -5
  68. package/dist/tools/screenshot.js.map +1 -1
  69. package/dist/tools/testSummary.js +211 -0
  70. package/dist/tools/testSummary.js.map +1 -0
  71. package/package.json +2 -2
  72. package/dist/alternator/chassis/rank.js +0 -72
  73. package/dist/alternator/chassis/rank.js.map +0 -1
  74. package/dist/cli/components/MenuFrame.js +0 -24
  75. package/dist/cli/components/MenuFrame.js.map +0 -1
  76. package/dist/cli/reveal.js +0 -32
  77. package/dist/cli/reveal.js.map +0 -1
  78. package/dist/cli/smoothScroll.js +0 -74
  79. package/dist/cli/smoothScroll.js.map +0 -1
  80. package/dist/cli/viewport.js +0 -179
  81. package/dist/cli/viewport.js.map +0 -1
  82. package/dist/dynamo/_probe.tmp.js +0 -20
  83. package/dist/dynamo/_probe.tmp.js.map +0 -1
  84. package/dist/tools/captureSweep.js +0 -77
  85. package/dist/tools/captureSweep.js.map +0 -1
  86. package/dist/tools/diagnostics.js +0 -174
  87. package/dist/tools/diagnostics.js.map +0 -1
  88. package/dist/tools/editFile.js +0 -183
  89. package/dist/tools/editFile.js.map +0 -1
  90. package/dist/tools/multiEdit.js +0 -168
  91. package/dist/tools/multiEdit.js.map +0 -1
@@ -1,179 +0,0 @@
1
- /**
2
- * viewport.ts — which transcript blocks are actually on screen.
3
- *
4
- * In the alternate screen there is no terminal scrollback to lean on: the app
5
- * owns every row, so it must decide for itself what fits between the pinned
6
- * header and the pinned footer.
7
- *
8
- * The obvious approach — hand every block to a fixed-height, `overflow: hidden`
9
- * flex box and let the layout engine clip — DOES NOT WORK, and it fails in the
10
- * worst possible direction. Measured against Ink 5.2.1 / Yoga 3.2.1:
11
- *
12
- * - Children default to `flexShrink: 1`, so an overfull column does not clip at
13
- * all, it COMPRESSES: 30 one-line blocks in a 17-row box rendered as
14
- * `block-00, block-02, block-04…` — a strided sample with rows silently
15
- * dropped out of the middle.
16
- * - With `flexShrink: 0` the blocks stay whole, but every layout tried
17
- * (`column-reverse`, `column` + `justifyContent: flex-end`, plain `column`)
18
- * clips the END of the layout — which is the NEWEST message. The reply you
19
- * just received is the first thing to disappear off the bottom.
20
- *
21
- * So the slice is computed here instead, walking BACKWARD from the newest block
22
- * and taking blocks until the next one would not fit. The heights are estimated
23
- * rather than measured — Ink can only measure by rendering, and rendering to
24
- * decide what to render is a loop — so the estimate deliberately errs HIGH:
25
- * over-estimating leaves a blank row at the top (harmless), under-estimating
26
- * would push the pinned footer off the bottom (the bug this file exists to
27
- * prevent).
28
- */
29
- import { renderMarkdown } from "./markdown.js";
30
- import { collapseAdjacent } from "./toolItems.js";
31
- import { GROUP_MAX_ROWS } from "./components/ToolGroup.js";
32
- /**
33
- * The newest blocks that fit in `maxRows`, oldest-first (render order).
34
- *
35
- * `scrollBack` skips that many blocks from the newest end, which is how paging
36
- * up works: the window slides toward older history without the block list or
37
- * the estimator needing to know anything about scrolling.
38
- */
39
- export function visibleBlocks(all, columns, maxRows, scrollBack = 0) {
40
- if (maxRows <= 0 || all.length === 0)
41
- return { blocks: [], hiddenAbove: 0 };
42
- // Anything scrolled past is simply not a candidate — the window's newest end.
43
- const end = Math.max(0, all.length - clampScroll(all.length, scrollBack));
44
- const taken = [];
45
- let used = 0;
46
- for (let i = end - 1; i >= 0; i--) {
47
- const block = all[i];
48
- const height = blockHeight(block, columns, isTight(all, i));
49
- // Always take at least one block: a single block taller than the whole
50
- // viewport must still render (clipped) rather than leaving a blank screen.
51
- if (taken.length > 0 && used + height > maxRows)
52
- break;
53
- taken.push(block);
54
- used += height;
55
- }
56
- taken.reverse();
57
- return { blocks: taken, hiddenAbove: end - taken.length };
58
- }
59
- /**
60
- * Whether block `i` hugs the one above it (no blank line between).
61
- *
62
- * Exported because the height estimate and the actual render MUST agree: if the
63
- * renderer hugs a row the estimate padded, the arithmetic drifts by a line per
64
- * tool call and the footer walks off the bottom. One definition, used by both.
65
- */
66
- export function isTight(all, i) {
67
- const block = all[i];
68
- const prev = i > 0 ? all[i - 1] : undefined;
69
- return !!block && block.kind === "tool" && !!prev && prev.kind === "tool";
70
- }
71
- /** Clamp a scroll offset so paging can never run past either end of history. */
72
- export function clampScroll(total, scrollBack) {
73
- if (!Number.isFinite(scrollBack) || scrollBack <= 0)
74
- return 0;
75
- // One block must always remain visible, so the newest end can always be found.
76
- return Math.min(Math.floor(scrollBack), Math.max(0, total - 1));
77
- }
78
- /**
79
- * Rows one block occupies, matching BlockView's structure (margins included).
80
- *
81
- * Kept deliberately close to BlockView: when a block type's rendering changes,
82
- * this is the other half of that change. A drifted estimate degrades (a blank
83
- * row, or a partially clipped top block) rather than breaking, which is why the
84
- * coupling is acceptable — but it IS coupling, so the cases are in the same
85
- * order as the switch in BlockView.tsx.
86
- */
87
- export function blockHeight(block, columns, tight = false) {
88
- const textWidth = Math.max(8, columns - 4);
89
- const top = tight ? 0 : 1;
90
- switch (block.kind) {
91
- case "user":
92
- return 1 + wrappedLines(block.text, textWidth);
93
- case "assistant":
94
- if (!block.text)
95
- return 0; // BlockView renders null
96
- return 1 + countLines(renderMarkdown(block.text, textWidth));
97
- case "tool": {
98
- const branch = block.status !== "running" ? branchLineCount(block) : 0;
99
- return top + 1 + branch;
100
- }
101
- case "tools": {
102
- // Header, plus (once done) the calls listed under it, capped — see ToolGroup.
103
- if (!block.done)
104
- return top + 1;
105
- const listed = collapseAdjacent(block.items).length;
106
- const shown = Math.min(listed, GROUP_MAX_ROWS);
107
- return top + 1 + shown + (listed > shown ? 1 : 0);
108
- }
109
- case "subagent": {
110
- const items = collapseAdjacent(block.items).length;
111
- const summary = block.done && block.summary ? 1 : 0;
112
- return top + 1 + items + summary;
113
- }
114
- case "error":
115
- return 1 + wrappedLines(block.text, textWidth);
116
- case "completion":
117
- return 1 + 1; // marginTop + a single truncated line
118
- case "note":
119
- return wrappedLines(`· ${block.text}`, Math.max(8, columns));
120
- case "context":
121
- return 1 + 1 + 1; // marginTop + one truncated line + marginBottom
122
- }
123
- }
124
- /** The `⎿` branch rows under a resolved tool row (detail wins over summary). */
125
- function branchLineCount(block) {
126
- if (block.detail)
127
- return countLines(block.detail);
128
- return block.summary ? 1 : 0;
129
- }
130
- function countLines(s) {
131
- return s === "" ? 0 : s.split("\n").length;
132
- }
133
- /**
134
- * Rows a string takes when word-wrapped to `width` (pure).
135
- *
136
- * Greedy word wrapping, matching how Ink wraps `<Text wrap="wrap">`, because the
137
- * cheap `ceil(length / width)` under-counts exactly when it matters: a line of
138
- * long words breaks earlier than its character count suggests, and under-counting
139
- * is the direction that pushes the footer off screen.
140
- */
141
- export function wrappedLines(text, width) {
142
- if (width <= 0)
143
- return 1;
144
- let rows = 0;
145
- for (const line of text.split("\n")) {
146
- if (line === "") {
147
- rows += 1;
148
- continue;
149
- }
150
- let col = 0;
151
- for (const word of line.split(/\s+/).filter(Boolean)) {
152
- // A word longer than the line wraps across as many rows as it needs.
153
- // `rows` counts only COMPLETED rows and `col` carries the row still being
154
- // filled, so this takes the floor and lets the trailing check below close
155
- // the partial row — taking the ceiling here counts that last row twice.
156
- if (word.length > width) {
157
- if (col > 0) {
158
- rows += 1;
159
- col = 0;
160
- }
161
- rows += Math.floor(word.length / width);
162
- col = word.length % width;
163
- continue;
164
- }
165
- const needed = col === 0 ? word.length : col + 1 + word.length;
166
- if (needed > width) {
167
- rows += 1;
168
- col = word.length;
169
- }
170
- else {
171
- col = needed;
172
- }
173
- }
174
- if (col > 0 || rows === 0)
175
- rows += 1;
176
- }
177
- return Math.max(1, rows);
178
- }
179
- //# sourceMappingURL=viewport.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"viewport.js","sourceRoot":"","sources":["../../src/cli/viewport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAU3D;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAC3B,GAAqB,EACrB,OAAe,EACf,OAAe,EACf,UAAU,GAAG,CAAC;IAEd,IAAI,OAAO,IAAI,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC;IAE5E,8EAA8E;IAC9E,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;IAC1E,MAAM,KAAK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N,GAAG,GAAG,MAAM,CAAC;YACf,CAAC;QACH,CAAC;QACD,IAAI,GAAG,GAAG,CAAC,IAAI,IAAI,KAAK,CAAC;YAAE,IAAI,IAAI,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC"}
@@ -1,20 +0,0 @@
1
- import { staticSystemPrompt } from "./engine.js";
2
- import { toolSchemas } from "../tools/registry.js";
3
- import { basePrompt } from "./prompt.js";
4
- import { estimateTokens } from "../memory/compaction.js";
5
- import { readFileSync, existsSync } from "node:fs";
6
- const root = "D:\Kleopatra";
7
- const memIdx = "";
8
- const projMem = existsSync(root + "\GODEN.md") ? readFileSync(root + "\GODEN.md", "utf8") : "";
9
- const gov = { forbidden: "", skills: "", rules: [] };
10
- const sys = staticSystemPrompt("", projMem, root + "\memory", memIdx, gov, "", 3);
11
- const ctx = { cwd: root, governance: { rules: [], skills: [], forbidden: [] } };
12
- const tools = toolSchemas({ ctx });
13
- let toolTok = 0;
14
- for (const t of tools)
15
- toolTok += estimateTokens(JSON.stringify(t));
16
- console.log("basePrompt ", estimateTokens(basePrompt("PowerShell")));
17
- console.log("staticSystemPrompt", estimateTokens(sys), `(${sys.length} chars)`);
18
- console.log("tools ", toolTok, `over ${tools.length}`);
19
- console.log("PREFIX TOTAL ", estimateTokens(sys) + toolTok);
20
- //# sourceMappingURL=_probe.tmp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_probe.tmp.js","sourceRoot":"","sources":["../../src/dynamo/_probe.tmp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,UA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oBAAoB,EAAE,cAAc,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC"}
@@ -1,77 +0,0 @@
1
- /**
2
- * captureSweep.ts — clear out screenshots that have outlived their usefulness.
3
- *
4
- * `screenshot` writes each capture to its own temp directory so the model can be
5
- * handed the file and compaction can drop and restore the reference. Nothing removed
6
- * them, so every window ever photographed stayed on disk indefinitely — and unlike
7
- * the rest of the agent's temp files, a capture holds whatever happened to be on
8
- * screen at the time.
9
- *
10
- * Deleting immediately after sending was considered and rejected: the reference
11
- * survives in the transcript, compaction can bring an image back, and a capture the
12
- * model may still be asked about should not be a dangling path. So they live for a
13
- * few days and are swept by age at startup, which also catches anything left behind
14
- * by a crash — the case a shutdown hook would miss.
15
- *
16
- * Best-effort throughout. A sweep that cannot read the temp directory, or that races
17
- * another Mindweave deleting the same folder, must never keep the CLI from starting.
18
- */
19
- import { readdir, rm, stat } from "node:fs/promises";
20
- import { tmpdir } from "node:os";
21
- import { join } from "node:path";
22
- /** How long a capture is kept. One edit changes the policy. */
23
- export const CAPTURE_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1000; // 7 days
24
- /** Temp directory prefixes this sweep owns. Must match what creates them. */
25
- export const SWEPT_PREFIXES = ["mindweave-shot-"];
26
- /** Does this directory name belong to us? (pure) */
27
- export function isSweptName(name) {
28
- return SWEPT_PREFIXES.some((p) => name.startsWith(p));
29
- }
30
- /**
31
- * Should an entry be removed, given its age? (pure)
32
- *
33
- * Split out from the I/O so the policy can be tested without fabricating timestamps
34
- * on a real filesystem, and so "how old is too old" is one comparison in one place.
35
- */
36
- export function isExpired(mtimeMs, now, maxAgeMs = CAPTURE_MAX_AGE_MS) {
37
- return now - mtimeMs > maxAgeMs;
38
- }
39
- /**
40
- * Remove expired capture directories. Returns how many went.
41
- *
42
- * `dir` and `now` are parameters so tests drive a fabricated tree rather than the
43
- * real temp directory, where a stray match would delete a developer's actual files.
44
- */
45
- export async function sweepCaptures(dir = tmpdir(), now = Date.now(), maxAgeMs = CAPTURE_MAX_AGE_MS) {
46
- let removed = 0;
47
- let names;
48
- try {
49
- names = await readdir(dir);
50
- }
51
- catch {
52
- return 0; // unreadable temp directory is not our problem to solve
53
- }
54
- for (const name of names) {
55
- if (!isSweptName(name))
56
- continue;
57
- const full = join(dir, name);
58
- try {
59
- const info = await stat(full);
60
- if (!info.isDirectory())
61
- continue;
62
- if (!isExpired(info.mtimeMs, now, maxAgeMs))
63
- continue;
64
- await rm(full, { recursive: true, force: true });
65
- removed++;
66
- }
67
- catch {
68
- // Vanished under us, locked, or not ours to delete. Skip it.
69
- }
70
- }
71
- return removed;
72
- }
73
- /** Fire-and-forget sweep for startup: never awaited, never throws, never logs. */
74
- export function sweepCapturesInBackground() {
75
- void sweepCaptures().catch(() => { });
76
- }
77
- //# sourceMappingURL=captureSweep.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"captureSweep.js","sourceRoot":"","sources":["../../src/tools/captureSweep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,SAAS;AAEpE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,iBAAiB,CAAU,CAAC;AAE3D,oDAAoD;AACpD,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CA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- /**
2
- * diagnostics.ts — surface compiler/linter errors from the language servers.
3
- *
4
- * Mindweave already runs language servers (for def/ref); this reads their *diagnostics*
5
- * — the type errors, syntax errors, and warnings they publish — so the model can
6
- * check what it just wrote and fix it, instead of editing blind. Rather than running
7
- * diagnostics automatically after every edit, here it's an explicit tool the model calls
8
- * after changing code, plus prompt guidance to do so.
9
- *
10
- * Read-only: it only reads what the servers report. Degrade-safe: no server for the
11
- * language (or none reported) → a clean "no diagnostics" result.
12
- */
13
- import { promises as fs } from "node:fs";
14
- import { chassisForPath } from "./chassisMux.js";
15
- import { relativize, resolvePath } from "./paths.js";
16
- import { selectActiveFiles } from "../memory/workingSet.js";
17
- /** When no path is given, check this many of the most-recently-touched files.
18
- * Exported so the number quoted in the description is pinned to the real value. */
19
- export const MAX_WORKING_SET = 3;
20
- const MAX_SHOWN = 50;
21
- /** Full caret context is built for at most this many diagnostics (errors first) —
22
- * reading source lines and drawing a caret for all 50 shown would bury the ones
23
- * that matter under a wall of low-value warnings. */
24
- const MAX_CARETS = 5;
25
- export const diagnosticsTool = {
26
- name: "diagnostics",
27
- readOnly: true,
28
- // Written against the failure this tool is supposed to PREVENT: the model edits,
29
- // asks for diagnostics, is told "no diagnostics", and moves on with broken code.
30
- // Three things made that possible and none of them were in the text — the check is
31
- // per-file so a broken CALLER is never seen, a clean answer is not proof (no server,
32
- // a slow server, and an unreadable path all render identically), and the no-path
33
- // form only reaches a few files.
34
- description: "Report compiler and linter diagnostics (type errors, syntax errors, warnings) for " +
35
- "a file, from its language server. It re-syncs the file from disk first, so it " +
36
- "reflects what you actually just wrote, not a stale copy. Call it after editing " +
37
- "code, and fix what it reports before moving on.\n" +
38
- "SCOPE: it checks the FILES YOU NAME and nothing else. Diagnostics are per-file, " +
39
- `so if you omit path it checks only the ${MAX_WORKING_SET} files you touched most ` +
40
- "recently. A change that breaks code elsewhere — you renamed a symbol, changed a " +
41
- "signature, altered an exported type — will NOT show up here, because the broken " +
42
- "file is the CALLER. After that kind of edit, find the callers with `references` " +
43
- "and check those paths too.\n" +
44
- "A clean result is weaker evidence than it looks: you also get \"no diagnostics\" " +
45
- "when no language server handles that file type, when the server is too slow to " +
46
- "answer, and when the path does not exist or cannot be read. So it confirms " +
47
- "problems, it does not prove their absence. Treat a clean answer on code you " +
48
- "expected to be broken as a reason to check the path and verify another way " +
49
- "(build it, run the tests) rather than as a passing grade.",
50
- parameters: {
51
- type: "object",
52
- additionalProperties: false,
53
- properties: {
54
- path: {
55
- type: "string",
56
- description: "File to check. Omit to check the most recently read/edited files.",
57
- },
58
- },
59
- },
60
- async execute(args, ctx) {
61
- const targets = pickTargets(ctx, typeof args.path === "string" ? args.path.trim() : "");
62
- if (targets.length === 0) {
63
- return { output: "No file to check — edit or read a file first, or pass a `path`.", summary: "no target" };
64
- }
65
- const results = await Promise.all(targets.map(async (abs) => {
66
- const chassis = chassisForPath(ctx, abs);
67
- const diags = chassis ? await chassis.diagnostics(abs) : [];
68
- return { abs, diags };
69
- }));
70
- const all = [];
71
- for (const r of results)
72
- all.push(...r.diags);
73
- if (all.length === 0) {
74
- const label = targets.map((t) => relativize(ctx, t)).join(", ");
75
- // Silent when it finds nothing. A model runs this in a burst right after editing,
76
- // and a row per file saying "no diagnostics" is a wall of rows reporting the
77
- // absence of news. The model still gets the answer; the user gets the screen back.
78
- return { output: `No diagnostics for ${label}.`, summary: "no diagnostics", quiet: true };
79
- }
80
- const output = formatDiagnostics(all.map((d) => ({ ...d, file: relativize(ctx, d.file) })));
81
- const errors = all.filter((d) => d.severity === "error").length;
82
- const warnings = all.filter((d) => d.severity === "warning").length;
83
- return {
84
- output,
85
- summary: `${errors} error${errors === 1 ? "" : "s"}, ${warnings} warning${warnings === 1 ? "" : "s"}`,
86
- detail: await buildCaretDetail(all, ctx),
87
- // Named for what it IS. "Check(app.ts)" reads as a routine step that happened to
88
- // return something; the caret block under it is a compiler error, and the header
89
- // should say so before the user has read a single line of it.
90
- displayName: errors > 0 ? "Build Error" : "Check",
91
- };
92
- },
93
- };
94
- /**
95
- * The UI-only compiler-caret block — never sent to the model (`formatDiagnostics`'s
96
- * flat text is what the model sees). Reads each diagnostic's own source line fresh
97
- * from disk (never sent, so a fetch failure just drops that one caret rather than
98
- * failing the tool) and draws a `~~~~~~~~` under the exact failing token when the
99
- * server gave us an end column (see CodeDiagnostic.endColumn).
100
- */
101
- async function buildCaretDetail(all, ctx) {
102
- const rank = { error: 0, warning: 1, info: 2, hint: 3 };
103
- const sorted = [...all].sort((a, b) => rank[a.severity] - rank[b.severity]);
104
- const shown = sorted.slice(0, MAX_CARETS);
105
- const blocks = await Promise.all(shown.map((d) => caretBlock(d, ctx)));
106
- const parts = blocks.filter((b) => b !== null);
107
- const hidden = sorted.length - shown.length;
108
- if (hidden > 0)
109
- parts.push(`(+${hidden} more — see the full list above)`);
110
- return parts.join("\n\n");
111
- }
112
- /** One diagnostic's caret block, or null if its source line couldn't be read. */
113
- async function caretBlock(d, ctx) {
114
- const lines = await readLines(d.file);
115
- if (!lines)
116
- return null;
117
- const line = lines[d.line - 1];
118
- if (line == null)
119
- return null;
120
- const rel = relativize(ctx, d.file);
121
- const lineLabel = `${d.line}: `;
122
- const out = [`${rel}:${d.line}:${d.column}`];
123
- const prev = lines[d.line - 2];
124
- if (prev != null)
125
- out.push(`│ ${String(d.line - 1).padStart(lineLabel.length - 2)}: ${prev}`);
126
- out.push(`│ ${lineLabel}${line}`);
127
- out.push(caretLine(d, lineLabel.length));
128
- const codeLabel = d.source ? `${d.source}: ` : "";
129
- out.push(`⎿ ${codeLabel}${d.message}`); // same branch glyph ToolLine/SubagentView use, not the mockup's literal "└─"
130
- return out.join("\n");
131
- }
132
- /** The `~~~~~~~~` (or `^` when no end column is known) aligned under the failing
133
- * token, indented to match the `│ N: ` gutter the source line itself sits under. */
134
- function caretLine(d, gutterWidth) {
135
- const indent = " ".repeat(2 + gutterWidth + Math.max(0, d.column - 1));
136
- const width = d.endColumn != null ? Math.max(1, d.endColumn - d.column) : 1;
137
- return indent + (d.endColumn != null ? "~".repeat(width) : "^");
138
- }
139
- /** The file's lines, or null if it can't be read — a caret is a nice-to-have, not
140
- * worth failing the whole diagnostics call over. */
141
- async function readLines(absPath) {
142
- try {
143
- return (await fs.readFile(absPath, "utf8")).split("\n");
144
- }
145
- catch {
146
- return null;
147
- }
148
- }
149
- /**
150
- * The absolute paths to check: the given path, else the most recently touched files.
151
- *
152
- * This used to read `reads.keys()` in Map order, which is INSERTION order — and
153
- * `reads.set()` on a key that already exists does not move it. So a file read early
154
- * and edited last kept its original position and fell outside the window, and the tool
155
- * answered "No diagnostics" for files it had never looked at while the file just
156
- * edited was broken. `touchedAt` is the recency stamp that survives a re-touch, and
157
- * `selectActiveFiles` is the same ordering the working set already uses.
158
- */
159
- function pickTargets(ctx, rawPath) {
160
- if (rawPath)
161
- return [resolvePath(ctx, rawPath)];
162
- return selectActiveFiles(ctx.reads, MAX_WORKING_SET).map((f) => f.path);
163
- }
164
- /** Render diagnostics as `file:line:col severity: message`, errors first. Pure. */
165
- export function formatDiagnostics(diags) {
166
- const rank = { error: 0, warning: 1, info: 2, hint: 3 };
167
- const sorted = [...diags].sort((a, b) => rank[a.severity] - rank[b.severity] || a.file.localeCompare(b.file) || a.line - b.line);
168
- const shown = sorted.slice(0, MAX_SHOWN);
169
- const lines = shown.map((d) => `${d.file}:${d.line}:${d.column} ${d.severity}: ${d.message}${d.source ? ` (${d.source})` : ""}`);
170
- if (sorted.length > shown.length)
171
- lines.push(`… (${sorted.length - shown.length} more)`);
172
- return lines.join("\n");
173
- }
174
- //# sourceMappingURL=diagnostics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../../src/tools/diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,U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