mindweave 2.2.1 → 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.
- package/README.md +6 -2
- package/dist/cli/App.js +104 -39
- package/dist/cli/App.js.map +1 -1
- package/dist/cli/altScreen.js +17 -1
- package/dist/cli/altScreen.js.map +1 -1
- package/dist/cli/blockSpacing.js +29 -0
- package/dist/cli/blockSpacing.js.map +1 -0
- package/dist/cli/commandLabel.js +85 -0
- package/dist/cli/commandLabel.js.map +1 -0
- package/dist/cli/commands.js +40 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/components/PromptInput.js +8 -1
- package/dist/cli/components/PromptInput.js.map +1 -1
- package/dist/cli/components/ToolGroup.js +5 -1
- package/dist/cli/components/ToolGroup.js.map +1 -1
- package/dist/cli/components/ToolLine.js +61 -6
- package/dist/cli/components/ToolLine.js.map +1 -1
- package/dist/cli/framebuffer/parse.js +10 -4
- package/dist/cli/framebuffer/parse.js.map +1 -1
- package/dist/cli/framebuffer/screen.js +26 -0
- package/dist/cli/framebuffer/screen.js.map +1 -1
- package/dist/cli/framebuffer/writer.js +131 -23
- package/dist/cli/framebuffer/writer.js.map +1 -1
- package/dist/cli/restart.js +99 -0
- package/dist/cli/restart.js.map +1 -0
- package/dist/cli/selfUpdate.js +124 -0
- package/dist/cli/selfUpdate.js.map +1 -0
- package/dist/cli/startupArgs.js +29 -2
- package/dist/cli/startupArgs.js.map +1 -1
- package/dist/cli/terminalRestore.js +9 -1
- package/dist/cli/terminalRestore.js.map +1 -1
- package/dist/cli/toolDisplay.js +15 -6
- package/dist/cli/toolDisplay.js.map +1 -1
- package/dist/cli/transcript.js +1 -1
- package/dist/cli/transcript.js.map +1 -1
- package/dist/cli/updateRunner.js +105 -0
- package/dist/cli/updateRunner.js.map +1 -0
- package/dist/drivers/gemini/manifest.js +16 -11
- package/dist/drivers/gemini/manifest.js.map +1 -1
- package/dist/dynamo/engine.js +30 -4
- package/dist/dynamo/engine.js.map +1 -1
- package/dist/dynamo/prompt.js +7 -4
- package/dist/dynamo/prompt.js.map +1 -1
- package/dist/dynamo/verify.js +8 -5
- package/dist/dynamo/verify.js.map +1 -1
- package/dist/index.js +32 -2
- package/dist/index.js.map +1 -1
- package/dist/memory/types.js.map +1 -1
- package/dist/tools/askUser.js +17 -5
- package/dist/tools/askUser.js.map +1 -1
- package/dist/tools/detail.js +69 -11
- package/dist/tools/detail.js.map +1 -1
- package/dist/tools/exitPlan.js +17 -1
- package/dist/tools/exitPlan.js.map +1 -1
- package/dist/tools/outputShape.js +137 -0
- package/dist/tools/outputShape.js.map +1 -0
- package/dist/tools/registry.js +0 -2
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/runCommand.js +31 -7
- package/dist/tools/runCommand.js.map +1 -1
- package/dist/tools/screenshot.js +33 -5
- package/dist/tools/screenshot.js.map +1 -1
- package/dist/tools/testSummary.js +211 -0
- package/dist/tools/testSummary.js.map +1 -0
- package/package.json +2 -2
- package/dist/alternator/chassis/rank.js +0 -72
- package/dist/alternator/chassis/rank.js.map +0 -1
- package/dist/cli/components/MenuFrame.js +0 -24
- package/dist/cli/components/MenuFrame.js.map +0 -1
- package/dist/cli/reveal.js +0 -32
- package/dist/cli/reveal.js.map +0 -1
- package/dist/cli/smoothScroll.js +0 -74
- package/dist/cli/smoothScroll.js.map +0 -1
- package/dist/cli/viewport.js +0 -179
- package/dist/cli/viewport.js.map +0 -1
- package/dist/dynamo/_probe.tmp.js +0 -20
- package/dist/dynamo/_probe.tmp.js.map +0 -1
- package/dist/tools/captureSweep.js +0 -77
- package/dist/tools/captureSweep.js.map +0 -1
- package/dist/tools/diagnostics.js +0 -174
- package/dist/tools/diagnostics.js.map +0 -1
- package/dist/tools/editFile.js +0 -183
- package/dist/tools/editFile.js.map +0 -1
- package/dist/tools/multiEdit.js +0 -168
- package/dist/tools/multiEdit.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../src/tools/screenshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAmB,MAAM,oBAAoB,CAAC;AAEjF,oFAAoF;AACpF,MAAM,UAAU,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../src/tools/screenshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAmB,MAAM,oBAAoB,CAAC;AAEjF,oFAAoF;AACpF,MAAM,UAAU,GAAG,EAAE,CAAC;AAUtB;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,KAAyB,EAAE,OAAqB;IACzE,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,IAAI,E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AO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACxF,OAAO,OAAO,CAAC,WAAW,EAAE,IAAI,QAAQ,CAAC;AAC3C,CAAC;AAED,SAAS,OAAO,CAAC,KAAc;IAC7B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,2EAA2E;AAC3E,SAAS,OAAO,CAAC,MAAc,EAAE,OAAe;IAC9C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC;AAED,SAAS,IAAI,CAAC,IAAY;IACxB,OAAO,EAAE,MAAM,EAAE,UAAU,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* testSummary.ts — recognising a test run in a command's output, and saying what it did
|
|
3
|
+
* in one row.
|
|
4
|
+
*
|
|
5
|
+
* A test run is the one command whose output is almost entirely noise on success. Two
|
|
6
|
+
* thousand passing tests print two thousand lines to say "nothing is wrong", and the
|
|
7
|
+
* three lines that matter on a failure are buried among them. Every other command is
|
|
8
|
+
* shown as output; this one is worth reading as a RESULT.
|
|
9
|
+
*
|
|
10
|
+
* ✓ 2,171 passed · 8 skipped · 39.8s
|
|
11
|
+
*
|
|
12
|
+
* ✗ 3 failed · 2,168 passed · 41.2s
|
|
13
|
+
* ✗ caret at end of a full row
|
|
14
|
+
* expected "abcd", got "abc…" inputView.test.ts:64
|
|
15
|
+
*
|
|
16
|
+
* ## The rule this file lives under
|
|
17
|
+
*
|
|
18
|
+
* A runner that is not RECOGNISED must fall through to the ordinary shell block, whole
|
|
19
|
+
* and untouched. Recognising output means matching a format somebody else owns and may
|
|
20
|
+
* change, so the failure mode has to be "this looks like an ordinary command", never a
|
|
21
|
+
* confident summary of numbers that were never there. Every matcher below returns
|
|
22
|
+
* `undefined` rather than a guess, and the counts come from the runner's own totals line
|
|
23
|
+
* rather than from counting ticks — a reporter that prints per-file totals as well as a
|
|
24
|
+
* grand total would otherwise be added up twice.
|
|
25
|
+
*/
|
|
26
|
+
import { FAIL_MARK, OK_MARK } from "./detail.js";
|
|
27
|
+
/** Failures listed under the summary row. The rest are hidden: a failing run must not
|
|
28
|
+
* take the screen, and thirty stack traces are not more useful than three. */
|
|
29
|
+
export const SHOWN_FAILURES = 3;
|
|
30
|
+
const num = (s) => {
|
|
31
|
+
const n = Number((s ?? "").replace(/,/g, ""));
|
|
32
|
+
return Number.isFinite(n) ? n : 0;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* `node --test`, whose spec reporter ends with its own totals block.
|
|
36
|
+
*
|
|
37
|
+
* ℹ tests 2171
|
|
38
|
+
* ℹ pass 2168
|
|
39
|
+
* ℹ fail 3
|
|
40
|
+
* ℹ skipped 8
|
|
41
|
+
* ℹ duration_ms 41213.4
|
|
42
|
+
*/
|
|
43
|
+
function nodeTest(output) {
|
|
44
|
+
const field = (name) => new RegExp(`^\\s*(?:ℹ|i)\\s+${name}\\s+([\\d.,]+)\\s*$`, "m").exec(output)?.[1];
|
|
45
|
+
const pass = field("pass");
|
|
46
|
+
const fail = field("fail");
|
|
47
|
+
if (pass === undefined || fail === undefined)
|
|
48
|
+
return undefined;
|
|
49
|
+
const duration = field("duration_ms");
|
|
50
|
+
return {
|
|
51
|
+
passed: num(pass),
|
|
52
|
+
failed: num(fail),
|
|
53
|
+
skipped: num(field("skipped")),
|
|
54
|
+
...(duration === undefined ? {} : { durationMs: num(duration) }),
|
|
55
|
+
failures: nodeFailures(output),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The failing tests from a `node --test` run.
|
|
60
|
+
*
|
|
61
|
+
* Read from the body rather than from the trailing "failing tests:" recap, because the
|
|
62
|
+
* recap repeats each name without the assertion under it, and the assertion is the only
|
|
63
|
+
* part worth a row.
|
|
64
|
+
*/
|
|
65
|
+
function nodeFailures(output) {
|
|
66
|
+
const lines = output.split("\n");
|
|
67
|
+
const out = [];
|
|
68
|
+
const seen = new Set();
|
|
69
|
+
for (let i = 0; i < lines.length; i++) {
|
|
70
|
+
const head = /^\s*(?:✖|not ok \d+ -)\s+(.+?)(?:\s+\(\d[\d.]*ms\))?\s*$/.exec(lines[i]);
|
|
71
|
+
if (!head)
|
|
72
|
+
continue;
|
|
73
|
+
const name = head[1].trim();
|
|
74
|
+
// The recap's own header, and the recap entries that follow it.
|
|
75
|
+
if (name === "failing tests:" || seen.has(name))
|
|
76
|
+
continue;
|
|
77
|
+
seen.add(name);
|
|
78
|
+
const failure = { name };
|
|
79
|
+
// The assertion sits in the indented block under the name; the file and line arrive
|
|
80
|
+
// a little further down, in the first frame of the stack that is not node's own.
|
|
81
|
+
for (let j = i + 1; j < Math.min(i + 12, lines.length); j++) {
|
|
82
|
+
const line = lines[j];
|
|
83
|
+
if (/^\s*(?:✔|✖|ℹ)/.test(line))
|
|
84
|
+
break;
|
|
85
|
+
const detail = /^\s{2,}(\w*(?:Error|Assertion)[^\n]*|expected[^\n]*|actual[^\n]*)$/.exec(line);
|
|
86
|
+
if (detail && failure.detail === undefined)
|
|
87
|
+
failure.detail = detail[1].trim();
|
|
88
|
+
const where = /([\w.-]+\.(?:test|spec)\.[cm]?[jt]sx?):(\d+)/.exec(line);
|
|
89
|
+
if (where && failure.location === undefined)
|
|
90
|
+
failure.location = `${where[1]}:${where[2]}`;
|
|
91
|
+
}
|
|
92
|
+
out.push(failure);
|
|
93
|
+
}
|
|
94
|
+
return out;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Vitest, whose summary counts test FILES and tests on separate lines. Only the second
|
|
98
|
+
* is a count of tests, and reading the first as one reports three failures as one.
|
|
99
|
+
*/
|
|
100
|
+
function vitest(output) {
|
|
101
|
+
const line = /^\s*Tests\s+(.+)$/m.exec(output)?.[1];
|
|
102
|
+
if (line === undefined)
|
|
103
|
+
return undefined;
|
|
104
|
+
const passed = /(\d[\d,]*)\s+passed/.exec(line);
|
|
105
|
+
if (!passed)
|
|
106
|
+
return undefined;
|
|
107
|
+
const duration = /^\s*Duration\s+([\d.]+)(m?s)/m.exec(output);
|
|
108
|
+
return {
|
|
109
|
+
passed: num(passed[1]),
|
|
110
|
+
failed: num(/(\d[\d,]*)\s+failed/.exec(line)?.[1]),
|
|
111
|
+
skipped: num(/(\d[\d,]*)\s+(?:skipped|todo)/.exec(line)?.[1]),
|
|
112
|
+
...(duration ? { durationMs: duration[2] === "s" ? num(duration[1]) * 1000 : num(duration[1]) } : {}),
|
|
113
|
+
failures: taggedFailures(output, /^\s*(?:FAIL|×|✕)\s+(.+?)\s*$/gm),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/** Jest, which puts every count on one line and its time on another. */
|
|
117
|
+
function jest(output) {
|
|
118
|
+
const line = /^\s*Tests:\s+(.+)$/m.exec(output)?.[1];
|
|
119
|
+
if (line === undefined)
|
|
120
|
+
return undefined;
|
|
121
|
+
const passed = /(\d[\d,]*)\s+passed/.exec(line);
|
|
122
|
+
if (!passed)
|
|
123
|
+
return undefined;
|
|
124
|
+
const seconds = /^\s*Time:\s+([\d.]+)\s*s/m.exec(output)?.[1];
|
|
125
|
+
return {
|
|
126
|
+
passed: num(passed[1]),
|
|
127
|
+
failed: num(/(\d[\d,]*)\s+failed/.exec(line)?.[1]),
|
|
128
|
+
skipped: num(/(\d[\d,]*)\s+(?:skipped|todo)/.exec(line)?.[1]),
|
|
129
|
+
...(seconds === undefined ? {} : { durationMs: num(seconds) * 1000 }),
|
|
130
|
+
failures: taggedFailures(output, /^\s*●\s+(.+?)\s*$/gm),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
/** pytest, which reports everything on one banner line at the end. */
|
|
134
|
+
function pytest(output) {
|
|
135
|
+
const banner = /^=+ (.*\b(?:passed|failed|error)\b.*?) =+$/m.exec(output)?.[1];
|
|
136
|
+
if (banner === undefined)
|
|
137
|
+
return undefined;
|
|
138
|
+
const seconds = /in ([\d.]+)s/.exec(banner)?.[1];
|
|
139
|
+
return {
|
|
140
|
+
passed: num(/(\d+)\s+passed/.exec(banner)?.[1]),
|
|
141
|
+
failed: num(/(\d+)\s+(?:failed|error)/.exec(banner)?.[1]),
|
|
142
|
+
skipped: num(/(\d+)\s+(?:skipped|deselected)/.exec(banner)?.[1]),
|
|
143
|
+
...(seconds === undefined ? {} : { durationMs: num(seconds) * 1000 }),
|
|
144
|
+
failures: taggedFailures(output, /^FAILED\s+(.+?)(?:\s+-\s+.*)?$/gm),
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/** Failure names from formats that mark each one with a tag on its own line. */
|
|
148
|
+
function taggedFailures(output, pattern) {
|
|
149
|
+
const out = [];
|
|
150
|
+
const seen = new Set();
|
|
151
|
+
for (const m of output.matchAll(pattern)) {
|
|
152
|
+
const name = m[1].trim();
|
|
153
|
+
if (name === "" || seen.has(name))
|
|
154
|
+
continue;
|
|
155
|
+
seen.add(name);
|
|
156
|
+
out.push({ name });
|
|
157
|
+
}
|
|
158
|
+
return out;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Read a test run out of a command's output, or return `undefined`.
|
|
162
|
+
*
|
|
163
|
+
* Order matters only in that each matcher looks for a totals line the others do not have,
|
|
164
|
+
* so a run is claimed by the one runner that actually wrote it.
|
|
165
|
+
*/
|
|
166
|
+
export function parseTestRun(output) {
|
|
167
|
+
if (output.trim() === "")
|
|
168
|
+
return undefined;
|
|
169
|
+
for (const matcher of [nodeTest, vitest, jest, pytest]) {
|
|
170
|
+
const run = matcher(output);
|
|
171
|
+
// A run with nothing in it at all is a false positive: a totals line matched, but
|
|
172
|
+
// there were no tests, so this was not a test run.
|
|
173
|
+
if (run && run.passed + run.failed + run.skipped > 0)
|
|
174
|
+
return run;
|
|
175
|
+
}
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* A test run as the row shows it: a verdict, then the first few failures.
|
|
180
|
+
*
|
|
181
|
+
* The verdict leads with `✓`/`✖` because the renderer lifts that line out and sets it
|
|
182
|
+
* against the right margin of the command's header — see `ToolLine`. A green run is that
|
|
183
|
+
* line and nothing else, which is the whole point: a run where nothing is wrong should
|
|
184
|
+
* cost one row and a run where something is should show what.
|
|
185
|
+
*
|
|
186
|
+
* `formatDuration` is passed in rather than imported so this module stays free of the
|
|
187
|
+
* display layer; it is one function and the alternative is a cycle.
|
|
188
|
+
*/
|
|
189
|
+
export function testDetail(run, formatDuration) {
|
|
190
|
+
const counts = [];
|
|
191
|
+
if (run.failed > 0)
|
|
192
|
+
counts.push(`${run.failed.toLocaleString("en-US")} failed`);
|
|
193
|
+
counts.push(`${run.passed.toLocaleString("en-US")} passed`);
|
|
194
|
+
if (run.skipped > 0)
|
|
195
|
+
counts.push(`${run.skipped.toLocaleString("en-US")} skipped`);
|
|
196
|
+
if (run.durationMs !== undefined)
|
|
197
|
+
counts.push(formatDuration(run.durationMs));
|
|
198
|
+
const verdict = `${run.failed > 0 ? FAIL_MARK : OK_MARK} ${counts.join(" · ")}`;
|
|
199
|
+
const rows = [];
|
|
200
|
+
for (const failure of run.failures.slice(0, SHOWN_FAILURES)) {
|
|
201
|
+
rows.push(`${FAIL_MARK} ${failure.name}`);
|
|
202
|
+
const where = [failure.detail, failure.location].filter((s) => s !== undefined && s !== "");
|
|
203
|
+
if (where.length > 0)
|
|
204
|
+
rows.push(` ${where.join(" ")}`);
|
|
205
|
+
}
|
|
206
|
+
const hidden = run.failures.length - SHOWN_FAILURES;
|
|
207
|
+
if (hidden > 0)
|
|
208
|
+
rows.push(`… ${hidden.toLocaleString("en-US")} more failure${hidden === 1 ? "" : "s"}`);
|
|
209
|
+
return [...rows, verdict].join("\n");
|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Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"install-global": "npm run build && npm link",
|
|
37
37
|
"typecheck": "tsc --noEmit",
|
|
38
38
|
"test": "npm run test:main && npm run test:lang",
|
|
39
|
-
"test:main": "node --max-old-space-size=4096 --import tsx --import ./scripts/testState.mjs --test --test-concurrency=4 --test-timeout=120000 src/drivers/clientId.test.ts src/drivers/contextOverflow.test.ts src/drivers/retryPolicy.test.ts src/drivers/partialTurn.test.ts src/drivers/retryTransport.test.ts src/tools/tools.test.ts src/tools/quietFailures.test.ts src/tools/readBatch.test.ts src/tools/readBudget.test.ts src/tools/search.test.ts src/tools/searchPrecision.test.ts src/tools/ripgrepBundle.test.ts src/tools/shellLint.test.ts src/tools/askUser.test.ts src/tools/
|
|
39
|
+
"test:main": "node --max-old-space-size=4096 --import tsx --import ./scripts/testState.mjs --test --test-concurrency=4 --test-timeout=120000 src/drivers/clientId.test.ts src/drivers/contextOverflow.test.ts src/drivers/retryPolicy.test.ts src/drivers/partialTurn.test.ts src/drivers/retryTransport.test.ts src/tools/tools.test.ts src/tools/quietFailures.test.ts src/tools/readBatch.test.ts src/tools/readBudget.test.ts src/tools/search.test.ts src/tools/searchPrecision.test.ts src/tools/ripgrepBundle.test.ts src/tools/shellLint.test.ts src/tools/askUser.test.ts src/tools/newtools.test.ts src/tools/webSearch.test.ts src/tools/webFetch.test.ts src/tools/screenshot.test.ts src/tools/runCommandExit.test.ts src/tools/exitPlan.test.ts src/dynamo/planLifecycle.test.ts src/cli/approvalText.probe.test.tsx src/tools/webSecurity.test.ts src/tools/codeIntel.test.ts src/memory/resumeFidelity.test.ts src/memory/memory.test.ts src/memory/durability.test.ts src/memory/memoryIndex.test.ts src/memory/callLog.test.ts src/memory/auditFixes.test.ts src/memory/compactionHygiene.test.ts src/memory/rounds.test.ts src/memory/subagentCost.test.ts src/memory/sessionMemory.test.ts src/memory/sessionMemoryCompact.test.ts src/memory/restore.test.ts src/memory/autoMemory.test.ts src/memory/projectMemory.test.ts src/memory/projectNotes.test.ts src/memory/workingSet.test.ts src/memory/presence.test.ts src/memory/images.test.ts src/dynamo/contextWindow.test.ts src/dynamo/compactPaths.test.ts src/dynamo/cacheBreak.test.ts src/dynamo/coldCache.test.ts src/drivers/anthropic/cachePoints.test.ts src/dynamo/planArtifact.test.ts src/tools/focus.test.ts src/tools/workingSetTools.test.ts src/project/context.test.ts src/cli/version.test.ts src/cli/updateCheck.test.ts src/cli/keyField.test.ts src/cli/keyStore.test.ts src/cli/keyManager.probe.test.tsx src/cli/trust.probe.test.tsx src/cli/firstRunFrame.probe.test.tsx src/cli/keySetup.probe.test.tsx src/cli/firstRun.test.ts src/cli/startupArgs.test.ts src/cli/markdown.test.ts src/cli/help.test.ts src/cli/providerSwitch.test.ts src/cli/attachments.test.ts src/cli/pasteAssembler.test.ts src/cli/approvalQueue.test.ts src/cli/transcript.test.ts src/cli/compaction.test.ts src/cli/commandLabel.test.ts src/cli/restart.test.ts src/cli/selfUpdate.test.ts src/cli/blockSpacing.test.ts src/cli/inputView.test.ts src/cli/caret.probe.test.tsx src/cli/shuttle.probe.test.tsx src/cli/toolReveal.test.tsx src/cli/blockPerf.probe.test.tsx src/cli/blockSpacing.probe.test.tsx src/cli/workingVerb.test.ts src/cli/typingPerf.probe.test.tsx src/cli/scrollPerf.probe.test.tsx src/cli/virtualWindow.test.ts src/cli/virtualRender.probe.test.tsx src/cli/incrementalResize.probe.test.tsx src/cli/framebuffer/paint.test.ts src/cli/framebuffer/terminalAgreement.test.ts src/cli/framebuffer/writer.test.tsx src/cli/framebuffer/resizeCorruption.probe.test.tsx src/cli/toolItems.test.ts src/cli/toolDisplay.test.ts src/cli/toolColour.probe.test.tsx src/cli/mouse.test.ts src/cli/terminalRestore.test.ts src/cli/wrap.test.ts src/cli/chatAnchor.test.ts src/cli/chatAnchor.probe.test.tsx src/cli/reflowAnchor.test.ts src/cli/groupReveal.test.ts src/cli/revealPace.test.ts src/cli/messageQueue.test.ts src/cli/resumeParity.test.ts src/cli/commands.test.ts src/cli/commandRoute.test.ts src/cli/commandArgs.test.ts src/cli/clearSession.test.ts src/cli/queuePop.probe.test.tsx src/cli/menuContinuity.probe.test.tsx src/dynamo/model.test.ts src/dynamo/engine.test.ts src/drivers/docsCurrent.test.ts src/drivers/registry.test.ts src/drivers/providerSwitch.test.ts src/drivers/dynamicManifest.test.ts src/drivers/newProviders.test.ts src/drivers/providerError.test.ts src/cli/refusalNotice.probe.test.tsx src/drivers/deepseek/client.test.ts src/drivers/deepseek/vision.test.ts src/drivers/deepseek/live.test.ts src/drivers/anthropic/client.test.ts src/drivers/openai/client.test.ts src/drivers/qwen/client.test.ts src/drivers/kimi/client.test.ts src/drivers/glm/client.test.ts src/drivers/tencent/client.test.ts src/drivers/gemini/client.test.ts src/drivers/gemini/thoughtSignature.test.ts src/drivers/meta/client.test.ts src/drivers/minimax/client.test.ts src/dynamo/pricing.test.ts src/dynamo/spend.test.ts src/dynamo/liveMeter.test.ts src/drivers/deepseek/inlineTools.test.ts src/dynamo/verify.test.ts src/dynamo/promptAssembly.test.ts src/dynamo/prefixStability.test.ts src/dynamo/providerNeutrality.test.ts src/dynamo/guard.test.ts src/cli/modes.test.ts src/tools/sessionTools.test.ts src/tools/registry.test.ts src/tools/toolSurface.test.ts src/tools/runCommandShell.test.ts src/tools/runCommandCross.test.ts src/tools/posixShell.test.ts src/tools/processOwnership.test.ts src/tools/editRipple.test.ts src/tools/editCore.test.ts src/tools/workspaceBoundary.test.ts src/tools/atomicWrite.test.ts src/tools/edit.test.ts src/tools/checkpoints.test.ts src/tools/shellCheckpoint.test.ts src/tools/spanCore.test.ts src/tools/symbolTools.test.ts src/tools/subagent.test.ts src/tools/subagentReport.test.ts src/tools/testSummary.test.ts src/tools/outputShape.test.ts src/tools/detail.test.ts src/tools/approval.test.ts src/tools/agentData.test.ts src/tools/multiroot.test.ts src/tools/gitignore.test.ts src/tools/chassisMux.test.ts src/tools/workspaceDiscover.test.ts src/tools/backgroundShells.test.ts src/tools/killTree.test.ts src/governor/scope.test.ts src/governor/freshness.test.ts src/governor/governor.test.ts src/tools/governorTools.test.ts src/alternator/chassis/chassis.test.ts src/alternator/chassis/domRefs.test.ts src/alternator/chassis/servers.test.ts src/alternator/chassis/provision.test.ts src/alternator/chassis/lsp.test.ts src/mcp/protocol.test.ts src/mcp/mrtr.test.ts src/mcp/discover.test.ts src/mcp/catalog.test.ts src/mcp/paramHeaders.test.ts src/mcp/paramHeadersLive.test.ts src/mcp/transport/stdio.test.ts src/mcp/config.test.ts src/mcp/transport/http.test.ts src/mcp/manager.test.ts src/mcp/subscriptions.test.ts src/mcp/deferred.test.ts src/tools/mcpSearch.test.ts src/mcp/trust.test.ts src/mcp/governance.test.ts src/mcp/configWrite.test.ts src/tools/mcpAdd.test.ts src/mcp/resultStore.test.ts src/mcp/resources.test.ts src/mcp/prompts.test.ts src/tools/editMatching.test.ts src/tools/editScope.test.ts src/tools/editFreshness.test.ts src/dynamo/batchEdit.test.ts",
|
|
40
40
|
"test:lang": "node --max-old-space-size=4096 --import tsx --import ./scripts/testState.mjs --test --test-concurrency=1 src/alternator/chassis/treesitter.test.ts src/alternator/chassis/treesitterIsolation.test.ts src/alternator/chassis/markup.test.ts src/alternator/chassis/treesitterLangs.test.ts src/alternator/chassis/treesitterLangs2.test.ts src/alternator/chassis/treesitterLangs3.test.ts src/alternator/chassis/treesitterLangs4.test.ts src/alternator/chassis/langBudget.test.ts"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
const DAMPING = 0.85;
|
|
2
|
-
const ITERATIONS = 30;
|
|
3
|
-
const FOCUS_BOOST = 25; // restart weight for symbols in the focus files
|
|
4
|
-
// Guard against pathological repos: skip ranking past this many symbols (the
|
|
5
|
-
// caller falls back to a cheaper heuristic). Tunable later.
|
|
6
|
-
const MAX_NODES = 50_000;
|
|
7
|
-
export function rankSymbols(graph, focusFiles, limit) {
|
|
8
|
-
const nodes = graph.allSymbols();
|
|
9
|
-
const n = nodes.length;
|
|
10
|
-
if (n === 0 || n > MAX_NODES)
|
|
11
|
-
return [];
|
|
12
|
-
const index = new Map();
|
|
13
|
-
nodes.forEach((node, i) => index.set(node.id, i));
|
|
14
|
-
// Build out-adjacency: referrer-symbol → referenced-symbol.
|
|
15
|
-
const out = Array.from({ length: n }, () => []);
|
|
16
|
-
const byName = graph.byNameMap();
|
|
17
|
-
for (const [name, refs] of graph.allRefs()) {
|
|
18
|
-
const targets = (byName.get(name) ?? [])
|
|
19
|
-
.map((id) => index.get(id))
|
|
20
|
-
.filter((i) => i !== undefined);
|
|
21
|
-
if (targets.length === 0)
|
|
22
|
-
continue;
|
|
23
|
-
for (const ref of refs) {
|
|
24
|
-
for (const referrer of graph.symbolsInFile(ref.file)) {
|
|
25
|
-
const ri = index.get(referrer.id);
|
|
26
|
-
if (ri === undefined)
|
|
27
|
-
continue;
|
|
28
|
-
for (const t of targets)
|
|
29
|
-
if (t !== ri)
|
|
30
|
-
out[ri].push(t);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
// Personalization vector: boost symbols defined in the focus files.
|
|
35
|
-
const focus = new Set(focusFiles);
|
|
36
|
-
const pers = new Float64Array(n);
|
|
37
|
-
let persSum = 0;
|
|
38
|
-
for (let i = 0; i < n; i++) {
|
|
39
|
-
const w = focus.has(nodes[i].file) ? FOCUS_BOOST : 1;
|
|
40
|
-
pers[i] = w;
|
|
41
|
-
persSum += w;
|
|
42
|
-
}
|
|
43
|
-
for (let i = 0; i < n; i++)
|
|
44
|
-
pers[i] /= persSum;
|
|
45
|
-
// Power iteration.
|
|
46
|
-
let rank = new Float64Array(n).fill(1 / n);
|
|
47
|
-
for (let iter = 0; iter < ITERATIONS; iter++) {
|
|
48
|
-
const next = new Float64Array(n);
|
|
49
|
-
for (let i = 0; i < n; i++)
|
|
50
|
-
next[i] = (1 - DAMPING) * pers[i];
|
|
51
|
-
let dangling = 0;
|
|
52
|
-
for (let i = 0; i < n; i++) {
|
|
53
|
-
const edges = out[i];
|
|
54
|
-
if (edges.length === 0) {
|
|
55
|
-
dangling += rank[i];
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
const share = (DAMPING * rank[i]) / edges.length;
|
|
59
|
-
for (const t of edges)
|
|
60
|
-
next[t] += share;
|
|
61
|
-
}
|
|
62
|
-
// Dangling mass redistributed along the personalization vector.
|
|
63
|
-
for (let i = 0; i < n; i++)
|
|
64
|
-
next[i] += DAMPING * dangling * pers[i];
|
|
65
|
-
rank = next;
|
|
66
|
-
}
|
|
67
|
-
return nodes
|
|
68
|
-
.map((symbol, i) => ({ symbol, score: rank[i] }))
|
|
69
|
-
.sort((a, b) => b.score - a.score)
|
|
70
|
-
.slice(0, limit);
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=rank.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rank.js","sourceRoot":"","sources":["../../../src/alternator/chassis/rank.ts"],"names":[],"mappings":"AAeA,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,WAAW,GAAG,EAAE,CAAC,CAAC,gDAAgD;AACxE,6EAA6E;AAC7E,4DAA4D;AAC5D,MAAM,SAAS,GAAG,MAAM,CAAC;AAEzB,MAAM,UAAU,WAAW,CACzB,KAAgB,EAChB,UAA6B,EAC7B,KAAa;IAEb,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;IACjC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;IACvB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS;QAAE,OAAO,EAAE,CAAC;IAExC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC1C,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,G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,CAAC;YACD,MAAM,KAAK,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;YACjD,KAAK,MAAM,CAAC,IAAI,KAAK;gBAAE,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC;QAC1C,CAAC;QACD,gEAAgE;QAChE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;YAAE,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpE,IAAI,GAAG,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK;SACT,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAChD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;SACjC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* MenuFrame — the ONE bordered box every navigation/decision surface renders inside.
|
|
4
|
-
*
|
|
5
|
-
* It is a pure wrapper: just the border, padding and top separation. The `/` command
|
|
6
|
-
* menu and every Picker (provider, model, reasoning, session resume, shells, MCP,
|
|
7
|
-
* forbidden-lift) render their own header/rows/hint as this box's CHILDREN. The point
|
|
8
|
-
* is that the caller renders exactly one MenuFrame at one position, so as you move from
|
|
9
|
-
* `/` into an option React keeps this box mounted and only its children change — the box
|
|
10
|
-
* never gets torn down and rebuilt, so it doesn't flicker or jump. One box, always the
|
|
11
|
-
* same; the content inside is what changes. Keeping the border in one place is also what
|
|
12
|
-
* stops the surfaces drifting into different looks.
|
|
13
|
-
*
|
|
14
|
-
* Same box treatment as the input field above it — single gray border, one column of
|
|
15
|
-
* horizontal padding, a blank row of separation above. `flexShrink:0` on the frame (and
|
|
16
|
-
* on every row a caller puts inside it) so a footer that's over budget clips cleanly at
|
|
17
|
-
* the bottom rather than compressing its own border lines into the rows (confirmed with
|
|
18
|
-
* a bare Ink render; see the chat viewport's own rows in App.tsx for the same reason).
|
|
19
|
-
*/
|
|
20
|
-
import { Box } from "ink";
|
|
21
|
-
export function MenuFrame({ width, children }) {
|
|
22
|
-
return (_jsx(Box, { flexDirection: "column", width: width, flexShrink: 0, borderStyle: "single", borderColor: "gray", paddingX: 1, marginTop: 1, children: children }));
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=MenuFrame.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MenuFrame.js","sourceRoot":"","sources":["../../../src/cli/components/MenuFrame.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAG1B,MAAM,UAAU,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAA0C;IACnF,OAAO,CACL,KAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,CAAC,EACb,WAAW,EAAC,QAAQ,EACpB,WAAW,EAAC,MAAM,EAClB,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,CAAC,YAEX,QAAQ,GACL,CACP,CAAC;AACJ,CAAC"}
|
package/dist/cli/reveal.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* reveal.ts — the pure decision for HOW to reveal a tool row.
|
|
3
|
-
*
|
|
4
|
-
* The old behavior revealed a tool the instant it started (a bare `● Run(cmd)`
|
|
5
|
-
* header) and only expanded its output — the `⎿` block — later, when the result
|
|
6
|
-
* landed. That reads as a two-step "header, then pop": jarring, and worse in a
|
|
7
|
-
* burst where every header shows first and every body expands at once.
|
|
8
|
-
*
|
|
9
|
-
* Instead we prefer to reveal a row ALREADY RESOLVED (header + output together, in
|
|
10
|
-
* one step). A just-started tool is held for a short grace window: if it finishes
|
|
11
|
-
* within it, the row appears complete; only a genuinely slower tool (still running
|
|
12
|
-
* after the grace) falls back to a running header so it never looks frozen. This
|
|
13
|
-
* function is the whole policy — pure, so it can be unit-tested away from timers.
|
|
14
|
-
*/
|
|
15
|
-
/** How long to hold a just-started tool before showing a running header, giving a
|
|
16
|
-
* fast tool the chance to finish so its row can appear already-resolved. Tunable. */
|
|
17
|
-
export const TOOL_GRACE_MS = 350;
|
|
18
|
-
/**
|
|
19
|
-
* Decide how to reveal a tool row.
|
|
20
|
-
* - result already available → "resolved" (the row appears complete at once).
|
|
21
|
-
* - flushing (Esc: drain with no pacing) and not resolved → "running" now.
|
|
22
|
-
* - still within the grace window → "hold" (come back once it resolves or grace ends).
|
|
23
|
-
* - grace elapsed and still running → "running" (a running header, expands later).
|
|
24
|
-
*/
|
|
25
|
-
export function planToolReveal(endAvailable, heldMs, graceMs, flush) {
|
|
26
|
-
if (endAvailable)
|
|
27
|
-
return "resolved";
|
|
28
|
-
if (flush)
|
|
29
|
-
return "running";
|
|
30
|
-
return heldMs >= graceMs ? "running" : "hold";
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=reveal.js.map
|
package/dist/cli/reveal.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reveal.js","sourceRoot":"","sources":["../../src/cli/reveal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;sFACsF;AACtF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC;AAOjC;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,YAAqB,EACrB,MAAc,EACd,OAAe,EACf,KAAc;IAEd,IAAI,YAAY;QAAE,OAAO,UAAU,CAAC;IACpC,IAAI,KAAK;QAAE,OAAO,SAAS,CAAC;IAC5B,OAAO,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AAChD,CAAC"}
|
package/dist/cli/smoothScroll.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* smoothScroll.ts — the scroll travels to where it was sent, instead of teleporting.
|
|
3
|
-
*
|
|
4
|
-
* A wheel notch used to move the transcript three lines in a single frame. Mechanically
|
|
5
|
-
* correct, and it reads as a jerk: the eye has nothing to track between the two
|
|
6
|
-
* positions, so a flick of the wheel becomes a stack of discrete jumps rather than
|
|
7
|
-
* movement. Gemini CLI's ScrollableList solves it the same way this does, with the same
|
|
8
|
-
* numbers — an ease-in-out cubic run over ~200ms at ~30fps, driving the same `scrollTo`
|
|
9
|
-
* the instant version called.
|
|
10
|
-
*
|
|
11
|
-
* This module is only the arithmetic, deliberately: no timers, no state, no React. The
|
|
12
|
-
* caller owns the clock and asks "where should the scroll be at this instant", which is
|
|
13
|
-
* what makes the easing testable without rendering anything or waiting for real time.
|
|
14
|
-
*
|
|
15
|
-
* NOTE ON WHY THIS IS NOT A REGRESSION OF THE FROZEN SCROLL MECHANISM. It does not
|
|
16
|
-
* change where the scroll ends up, ever — `target` is exactly the value the old code
|
|
17
|
-
* assigned directly, and the animation always terminates on it (`progress >= 1` returns
|
|
18
|
-
* `to` itself, not an interpolation that might land a fraction short). All it changes is
|
|
19
|
-
* the values passed through on the way there.
|
|
20
|
-
*/
|
|
21
|
-
/** Total travel time for one scroll, in milliseconds. */
|
|
22
|
-
export const SCROLL_ANIM_MS = 200;
|
|
23
|
-
/** Interval between animation frames, in milliseconds — about 30fps. Matching Ink's
|
|
24
|
-
* own ~32ms render throttle: asking for frames faster than the renderer will draw
|
|
25
|
-
* them buys nothing and costs a timer wakeup each time. */
|
|
26
|
-
export const SCROLL_FRAME_MS = 33;
|
|
27
|
-
/**
|
|
28
|
-
* Ease-in-out cubic.
|
|
29
|
-
*
|
|
30
|
-
* Slow at both ends and quickest through the middle, which is what makes the movement
|
|
31
|
-
* read as one gesture rather than a start and a stop. Linear interpolation was tried
|
|
32
|
-
* first and is visibly worse: it begins and ends abruptly, so it looks like a jump with
|
|
33
|
-
* extra steps.
|
|
34
|
-
*/
|
|
35
|
-
export function ease(t) {
|
|
36
|
-
const p = Math.min(1, Math.max(0, t));
|
|
37
|
-
return p < 0.5 ? 4 * p * p * p : 1 - Math.pow(-2 * p + 2, 3) / 2;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Where the scroll should be at `now`, in lines.
|
|
41
|
-
*
|
|
42
|
-
* Returns a whole number of lines because the transcript can only be offset by whole
|
|
43
|
-
* rows — a fractional offset would be rounded by the renderer anyway, and rounding here
|
|
44
|
-
* means the caller can compare against the current value and skip a render when the
|
|
45
|
-
* frame would be identical.
|
|
46
|
-
*/
|
|
47
|
-
export function scrollAt(anim, now) {
|
|
48
|
-
const elapsed = now - anim.startedAt;
|
|
49
|
-
// Land exactly on the target rather than on an interpolation of it. Guarantees the
|
|
50
|
-
// animation cannot finish a line short of where it was sent, which over a few flicks
|
|
51
|
-
// would drift the view somewhere the user never scrolled to.
|
|
52
|
-
if (elapsed >= SCROLL_ANIM_MS)
|
|
53
|
-
return anim.to;
|
|
54
|
-
if (elapsed <= 0)
|
|
55
|
-
return anim.from;
|
|
56
|
-
return Math.round(anim.from + (anim.to - anim.from) * ease(elapsed / SCROLL_ANIM_MS));
|
|
57
|
-
}
|
|
58
|
-
/** Whether the animation has reached its target and the timer can stop. */
|
|
59
|
-
export function scrollDone(anim, now) {
|
|
60
|
-
return now - anim.startedAt >= SCROLL_ANIM_MS;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Start (or redirect) an animation towards `to`.
|
|
64
|
-
*
|
|
65
|
-
* A wheel flick sends several notches in quick succession, and each one must extend the
|
|
66
|
-
* gesture rather than restart it: the new animation begins from where the previous one
|
|
67
|
-
* had actually reached, so the movement stays continuous instead of snapping back to an
|
|
68
|
-
* older position and re-running. This is the whole reason `current` is a parameter
|
|
69
|
-
* rather than being read from the previous animation's `from`.
|
|
70
|
-
*/
|
|
71
|
-
export function retarget(current, to, now) {
|
|
72
|
-
return { from: current, to, startedAt: now };
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=smoothScroll.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"smoothScroll.js","sourceRoot":"","sources":["../../src/cli/smoothScroll.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,yDAAyD;AACzD,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAElC;;4DAE4D;AAC5D,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,UAAU,IAAI,CAAC,CAAS;IAC5B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACtC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;AACnE,CAAC;AAUD;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAgB,EAAE,GAAW;IACpD,MAAM,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC;IACrC,mFAAmF;IACnF,qFAAqF;IACrF,6DAA6D;IAC7D,IAAI,OAAO,IAAI,cAAc;QAAE,OAAO,IAAI,CAAC,EAAE,CAAC;IAC9C,IAAI,OAAO,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC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