@stag-build/phonebook 0.1.2 → 0.1.4
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 +10 -1
- package/dist/cli.js +22 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/init.d.ts +21 -2
- package/dist/commands/init.js +33 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/engines/android.d.ts +54 -0
- package/dist/engines/android.js +152 -6
- package/dist/engines/android.js.map +1 -1
- package/dist/engines/ios.d.ts +53 -4
- package/dist/engines/ios.js +142 -27
- package/dist/engines/ios.js.map +1 -1
- package/dist/errors.js +12 -1
- package/dist/errors.js.map +1 -1
- package/dist/ios/snapshotTestClass.d.ts +44 -0
- package/dist/ios/snapshotTestClass.js +115 -0
- package/dist/ios/snapshotTestClass.js.map +1 -1
- package/dist/ios/unrendered.d.ts +38 -0
- package/dist/ios/unrendered.js +92 -0
- package/dist/ios/unrendered.js.map +1 -0
- package/dist/manifest.d.ts +23 -2
- package/dist/manifest.js +58 -0
- package/dist/manifest.js.map +1 -1
- package/dist/mcp/server.d.ts +28 -0
- package/dist/mcp/server.js +232 -11
- package/dist/mcp/server.js.map +1 -1
- package/dist/png.d.ts +18 -0
- package/dist/png.js +44 -0
- package/dist/png.js.map +1 -0
- package/dist/scan/android.js +142 -16
- package/dist/scan/android.js.map +1 -1
- package/dist/scan/gaps.d.ts +52 -0
- package/dist/scan/gaps.js +169 -0
- package/dist/scan/gaps.js.map +1 -0
- package/dist/scan/ios.d.ts +44 -0
- package/dist/scan/ios.js +445 -41
- package/dist/scan/ios.js.map +1 -1
- package/dist/scan/scope.d.ts +30 -0
- package/dist/scan/scope.js +208 -0
- package/dist/scan/scope.js.map +1 -0
- package/dist/scan/stats.d.ts +12 -0
- package/dist/scan/stats.js +24 -0
- package/dist/scan/stats.js.map +1 -0
- package/dist/scan/types.d.ts +87 -1
- package/dist/site/build.js +0 -0
- package/dist/site/build.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotTestClass.js","sourceRoot":"","sources":["../../src/ios/snapshotTestClass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"snapshotTestClass.js","sourceRoot":"","sources":["../../src/ios/snapshotTestClass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,GAAG,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAEhC;;;;;;;;;;GAUG;AAEH,MAAM,8BAA8B,GAAG,oCAAoC,CAAC;AAC5E,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAExF,KAAK,UAAU,gBAAgB,CAAC,IAAY;IAC1C,IAAI,CAAC;QACH,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,UAAkB;IAElB,KAAK,UAAU,IAAI,CAAC,GAAW;QAC7B,IAAI,OAAO,CAAC;QACZ,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QACxD,CA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AAC;IAC7E,CAAC;SAAM,IAAI,gBAAgB,CAAC,OAAO,EAAE,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACjC,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC;QACnG,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAC/D,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { IncompleteRenderError } from '../engines/ios.js';
|
|
2
|
+
import type { ManifestEntry } from '../manifest.js';
|
|
3
|
+
import type { ScannedPreview } from '../scan/types.js';
|
|
4
|
+
/**
|
|
5
|
+
* The container of every preview test the runner reported failed, one per test.
|
|
6
|
+
*
|
|
7
|
+
* A snapshot test asserts nothing, so a failure is the preview trapping: the
|
|
8
|
+
* host app goes down with it and the runner relaunches it before carrying on.
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseFailedPreviews(output: string): string[];
|
|
11
|
+
export interface FailedContainer {
|
|
12
|
+
/** The container SnapshotPreviews reported, e.g. "Status Row Detail View". */
|
|
13
|
+
container: string;
|
|
14
|
+
failures: number;
|
|
15
|
+
/** The previews in that container's file that did not come back as images.
|
|
16
|
+
* Empty when the source holds no file matching the container. */
|
|
17
|
+
unrendered: {
|
|
18
|
+
file: string;
|
|
19
|
+
line: number;
|
|
20
|
+
name: string;
|
|
21
|
+
}[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Turns failed preview tests into previews a reader can open.
|
|
25
|
+
*
|
|
26
|
+
* The test name says which file and nothing more: its index follows discovery
|
|
27
|
+
* order, not source order. What pins the preview down is subtraction — the
|
|
28
|
+
* previews the file declares, minus the ones that rendered. When the run was cut
|
|
29
|
+
* short that difference can also hold previews that were never reached, which
|
|
30
|
+
* is why the list is "did not render" and the count is kept apart from it.
|
|
31
|
+
*/
|
|
32
|
+
export declare function explainFailedPreviews(failed: string[], rendered: ManifestEntry[], scanned: ScannedPreview[]): FailedContainer[];
|
|
33
|
+
/**
|
|
34
|
+
* The answer to a render that crashed previews. Leads with where to look, because
|
|
35
|
+
* each crash costs about a minute and a half on the next run too, and the reader
|
|
36
|
+
* can only fix the ones it can find.
|
|
37
|
+
*/
|
|
38
|
+
export declare function summarizeIncompleteRender(error: IncompleteRenderError, explained: FailedContainer[]): string;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { basename } from 'node:path';
|
|
2
|
+
import { spaceCamelCase } from '../naming.js';
|
|
3
|
+
/**
|
|
4
|
+
* SnapshotPreviews names each preview test `<orientation>-<container>-<j>-<i>`,
|
|
5
|
+
* where the container is the display name it derives from the preview's file
|
|
6
|
+
* or type and `i` is a position in its own discovery order. The container can
|
|
7
|
+
* carry hyphens, so the numbers are anchored at the end.
|
|
8
|
+
*/
|
|
9
|
+
const FAILED_PREVIEW_TEST = /Test case '[^']*?\.[A-Za-z]+-(.+)-\d+-\d+\(\)' failed/g;
|
|
10
|
+
/**
|
|
11
|
+
* The container of every preview test the runner reported failed, one per test.
|
|
12
|
+
*
|
|
13
|
+
* A snapshot test asserts nothing, so a failure is the preview trapping: the
|
|
14
|
+
* host app goes down with it and the runner relaunches it before carrying on.
|
|
15
|
+
*/
|
|
16
|
+
export function parseFailedPreviews(output) {
|
|
17
|
+
return [...output.matchAll(FAILED_PREVIEW_TEST)].map((m) => m[1]);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Turns failed preview tests into previews a reader can open.
|
|
21
|
+
*
|
|
22
|
+
* The test name says which file and nothing more: its index follows discovery
|
|
23
|
+
* order, not source order. What pins the preview down is subtraction — the
|
|
24
|
+
* previews the file declares, minus the ones that rendered. When the run was cut
|
|
25
|
+
* short that difference can also hold previews that were never reached, which
|
|
26
|
+
* is why the list is "did not render" and the count is kept apart from it.
|
|
27
|
+
*/
|
|
28
|
+
export function explainFailedPreviews(failed, rendered, scanned) {
|
|
29
|
+
const failures = new Map();
|
|
30
|
+
for (const container of failed)
|
|
31
|
+
failures.set(container, (failures.get(container) ?? 0) + 1);
|
|
32
|
+
return [...failures].map(([container, count]) => {
|
|
33
|
+
const declared = scanned.filter((p) => spaceCamelCase(basename(p.file, '.swift')) === container);
|
|
34
|
+
const renderedLabels = new Set(rendered.flatMap((e) => {
|
|
35
|
+
if (!e.sourceFile || !declared.some((p) => sameSource(p.file, e.sourceFile)))
|
|
36
|
+
return [];
|
|
37
|
+
return [e.previewName.slice(e.sourceFile.length + 1)];
|
|
38
|
+
}));
|
|
39
|
+
return {
|
|
40
|
+
container,
|
|
41
|
+
failures: count,
|
|
42
|
+
unrendered: declared
|
|
43
|
+
.filter((p) => !renderedLabels.has(sidecarLabel(p)))
|
|
44
|
+
.map((p) => ({ file: p.file, line: p.line, name: p.displayName ?? container })),
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/** What SnapshotPreviews writes as a preview's label: its display name, or
|
|
49
|
+
* Xcode's placeholder for an unnamed one. */
|
|
50
|
+
function sidecarLabel(preview) {
|
|
51
|
+
return preview.displayName ?? `At line #${preview.line}`;
|
|
52
|
+
}
|
|
53
|
+
/** Whether a scanned path is the file a `Module/File.swift` file ID names. */
|
|
54
|
+
function sameSource(path, fileId) {
|
|
55
|
+
const slash = fileId.indexOf('/');
|
|
56
|
+
const file = fileId.slice(slash + 1);
|
|
57
|
+
if (path !== file && !path.endsWith(`/${file}`))
|
|
58
|
+
return false;
|
|
59
|
+
return slash === -1 || path.split('/').includes(fileId.slice(0, slash));
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The answer to a render that crashed previews. Leads with where to look, because
|
|
63
|
+
* each crash costs about a minute and a half on the next run too, and the reader
|
|
64
|
+
* can only fix the ones it can find.
|
|
65
|
+
*/
|
|
66
|
+
export function summarizeIncompleteRender(error, explained) {
|
|
67
|
+
const crashed = error.failedPreviews.length;
|
|
68
|
+
const lines = [
|
|
69
|
+
`Rendered ${error.manifest.entries.length} previews into ${error.outputDir}; ${crashed} crashed.`,
|
|
70
|
+
'',
|
|
71
|
+
];
|
|
72
|
+
if (crashed > 0) {
|
|
73
|
+
lines.push('A preview that crashes takes the app hosting the render down with it, and every relaunch costs about a', 'minute and a half of the next run as well. Open each one: a trap at render is often an @Environment', 'object the preview does not supply, which analyze_coverage reports as env-missing.');
|
|
74
|
+
for (const c of explained) {
|
|
75
|
+
if (c.unrendered.length === 0) {
|
|
76
|
+
lines.push(` ${c.container}`);
|
|
77
|
+
}
|
|
78
|
+
else if (c.unrendered.length === c.failures) {
|
|
79
|
+
lines.push(...c.unrendered.map((p) => ` ${p.file}:${p.line} ${p.name}`));
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
lines.push(` ${c.container}: ${c.failures} crashed, and these ${c.unrendered.length} did not render`);
|
|
83
|
+
lines.push(...c.unrendered.map((p) => ` ${p.file}:${p.line} ${p.name}`));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
lines.push('');
|
|
87
|
+
}
|
|
88
|
+
lines.push(...error.diagnosis);
|
|
89
|
+
lines.push('Recorded:', ...error.manifest.entries.map((e) => ` ${e.component}/${e.state}`).sort());
|
|
90
|
+
return lines.join('\n');
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=unrendered.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YAC9E,CAAC;QACH,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;IAC/B,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACpG,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/manifest.d.ts
CHANGED
|
@@ -9,15 +9,19 @@ export interface ManifestEntry {
|
|
|
9
9
|
module: string;
|
|
10
10
|
/** Path of the source file containing the preview, relative to the project root, when known */
|
|
11
11
|
sourceFile?: string;
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Stable, unique identifier for the preview within the project: a fully
|
|
14
|
+
* qualified name on Android, `<source file>:<label>` on iOS. This is
|
|
15
|
+
* identity, not display text — `component` and `state` are what a reader sees.
|
|
16
|
+
*/
|
|
13
17
|
previewName: string;
|
|
14
18
|
/** Image path relative to the bundle root, e.g. "images/ab12cd.png" */
|
|
15
19
|
image: string;
|
|
20
|
+
/** Pixel dimensions of `image`, read from its PNG header at generate time */
|
|
16
21
|
width?: number;
|
|
17
22
|
height?: number;
|
|
18
23
|
theme?: 'light' | 'dark';
|
|
19
24
|
device?: string;
|
|
20
|
-
tags?: string[];
|
|
21
25
|
}
|
|
22
26
|
export interface Manifest {
|
|
23
27
|
schemaVersion: typeof SCHEMA_VERSION;
|
|
@@ -29,4 +33,21 @@ export interface Manifest {
|
|
|
29
33
|
};
|
|
30
34
|
entries: ManifestEntry[];
|
|
31
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* A manifest is untrusted input: it is JSON on disk, and a bundle can be moved,
|
|
38
|
+
* hand-edited, or produced by something other than `phonebook generate`. Both
|
|
39
|
+
* path-bearing fields are documented as relative — `image` to the bundle root,
|
|
40
|
+
* `sourceFile` to the project root — but nothing enforced it, and `phonebook
|
|
41
|
+
* build` renders `image` directly into `<img src>` and into the modal's "Open
|
|
42
|
+
* file" link. An entry claiming `../../../../etc/passwd`, an absolute
|
|
43
|
+
* `/Users/someone/.ssh/id_rsa`, or `file:///etc/hosts` was passed through
|
|
44
|
+
* verbatim; HTML escaping stops markup injection but does nothing about the
|
|
45
|
+
* path itself, and any consumer resolving it against the bundle root reads
|
|
46
|
+
* outside the bundle.
|
|
47
|
+
*
|
|
48
|
+
* A manifest path must therefore be relative, forward-slash separated, and stay
|
|
49
|
+
* inside the root it is resolved against. Both engines only ever emit
|
|
50
|
+
* `images/<sha256-prefix>.png`, so this rejects nothing a real run produces.
|
|
51
|
+
*/
|
|
52
|
+
export declare function assertContainedPath(value: unknown, field: string, where: string): void;
|
|
32
53
|
export declare function validateManifest(data: unknown): Manifest;
|
package/dist/manifest.js
CHANGED
|
@@ -1,4 +1,56 @@
|
|
|
1
|
+
import { posix } from 'node:path';
|
|
1
2
|
export const SCHEMA_VERSION = 1;
|
|
3
|
+
/** Matches "http:", "file:", "data:", "javascript:", and a Windows drive like "C:". */
|
|
4
|
+
const URL_SCHEME_OR_DRIVE = /^[a-zA-Z][a-zA-Z0-9+.-]*:/;
|
|
5
|
+
/**
|
|
6
|
+
* A manifest is untrusted input: it is JSON on disk, and a bundle can be moved,
|
|
7
|
+
* hand-edited, or produced by something other than `phonebook generate`. Both
|
|
8
|
+
* path-bearing fields are documented as relative — `image` to the bundle root,
|
|
9
|
+
* `sourceFile` to the project root — but nothing enforced it, and `phonebook
|
|
10
|
+
* build` renders `image` directly into `<img src>` and into the modal's "Open
|
|
11
|
+
* file" link. An entry claiming `../../../../etc/passwd`, an absolute
|
|
12
|
+
* `/Users/someone/.ssh/id_rsa`, or `file:///etc/hosts` was passed through
|
|
13
|
+
* verbatim; HTML escaping stops markup injection but does nothing about the
|
|
14
|
+
* path itself, and any consumer resolving it against the bundle root reads
|
|
15
|
+
* outside the bundle.
|
|
16
|
+
*
|
|
17
|
+
* A manifest path must therefore be relative, forward-slash separated, and stay
|
|
18
|
+
* inside the root it is resolved against. Both engines only ever emit
|
|
19
|
+
* `images/<sha256-prefix>.png`, so this rejects nothing a real run produces.
|
|
20
|
+
*/
|
|
21
|
+
export function assertContainedPath(value, field, where) {
|
|
22
|
+
const at = `${where} "${field}"`;
|
|
23
|
+
if (typeof value !== 'string' || value.length === 0) {
|
|
24
|
+
throw new Error(`${at} must be a non-empty string: ${JSON.stringify(value)}`);
|
|
25
|
+
}
|
|
26
|
+
// Control characters, quotes and angle brackets never appear in a path either
|
|
27
|
+
// engine emits (`images/<sha256-prefix>.png`) or in a source filename, and
|
|
28
|
+
// they are exactly what forces every downstream consumer to escape correctly.
|
|
29
|
+
// Refusing them here means the path is safe to interpolate, not merely
|
|
30
|
+
// contained.
|
|
31
|
+
const unsafe = value.match(/[\u0000-\u001f\u007f"'<>`]/);
|
|
32
|
+
if (unsafe) {
|
|
33
|
+
throw new Error(`${at} contains an unsafe character ${JSON.stringify(unsafe[0])}: ${JSON.stringify(value)}`);
|
|
34
|
+
}
|
|
35
|
+
if (value.includes('\\')) {
|
|
36
|
+
throw new Error(`${at} must use forward slashes, not backslashes: ${JSON.stringify(value)}`);
|
|
37
|
+
}
|
|
38
|
+
if (URL_SCHEME_OR_DRIVE.test(value)) {
|
|
39
|
+
throw new Error(`${at} must be a relative path, not a URL or drive-qualified path: ${JSON.stringify(value)}`);
|
|
40
|
+
}
|
|
41
|
+
if (value.startsWith('/')) {
|
|
42
|
+
throw new Error(`${at} must be relative to the bundle root, not absolute: ${JSON.stringify(value)}`);
|
|
43
|
+
}
|
|
44
|
+
// Not an escape under posix join semantics, but a trap for any consumer that
|
|
45
|
+
// expands "~" before resolving. No real bundle path starts with one.
|
|
46
|
+
if (value === '~' || value.startsWith('~/')) {
|
|
47
|
+
throw new Error(`${at} must not start with "~": ${JSON.stringify(value)}`);
|
|
48
|
+
}
|
|
49
|
+
const normalized = posix.normalize(value);
|
|
50
|
+
if (normalized === '..' || normalized.startsWith('../') || normalized.startsWith('/')) {
|
|
51
|
+
throw new Error(`${at} escapes the bundle root: ${JSON.stringify(value)}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
2
54
|
export function validateManifest(data) {
|
|
3
55
|
const m = data;
|
|
4
56
|
if (!m || typeof m !== 'object')
|
|
@@ -11,12 +63,18 @@ export function validateManifest(data) {
|
|
|
11
63
|
}
|
|
12
64
|
if (!Array.isArray(m.entries))
|
|
13
65
|
throw new Error('manifest.entries is not an array');
|
|
66
|
+
let index = 0;
|
|
14
67
|
for (const e of m.entries) {
|
|
15
68
|
for (const key of ['component', 'state', 'module', 'previewName', 'image']) {
|
|
16
69
|
if (typeof e[key] !== 'string' || e[key].length === 0) {
|
|
17
70
|
throw new Error(`manifest entry missing "${key}": ${JSON.stringify(e)}`);
|
|
18
71
|
}
|
|
19
72
|
}
|
|
73
|
+
const where = `manifest entry ${index}`;
|
|
74
|
+
assertContainedPath(e.image, 'image', where);
|
|
75
|
+
if (e.sourceFile !== undefined)
|
|
76
|
+
assertContainedPath(e.sourceFile, 'sourceFile', where);
|
|
77
|
+
index += 1;
|
|
20
78
|
}
|
|
21
79
|
return m;
|
|
22
80
|
}
|
package/dist/manifest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,MAAM,CAAC,MAAM,cAAc,GAAG,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kCAAkC,CAAC,CAAC;IACnF,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QAC1B,KAAK,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAU,EAAE,CAAC;YACpF,IAAI,OAAO,CAAC,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACtD,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAC3E,CAAC;QACH,CAAC;QACD,MAAM,KAAK,GAAG,kBAAkB,KAAK,EAAE,CAAC;QACxC,mBAAmB,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,CAAC,UAAU,KAAK,SAAS;YAAE,mBAAmB,CAAC,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;QACvF,KAAK,IAAI,CAAC,CAAC;IACb,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -1 +1,29 @@
|
|
|
1
|
+
import type { CoverageReport } from '../scan/types.js';
|
|
2
|
+
export declare function summarizeCoverage(report: CoverageReport): string;
|
|
3
|
+
/**
|
|
4
|
+
* What a scoped report would otherwise hide: previews and views outside the
|
|
5
|
+
* scope that show a component inside it.
|
|
6
|
+
*
|
|
7
|
+
* Kept apart from the gaps above, and worded differently, because they are not
|
|
8
|
+
* the same kind of claim. A gap is a defect with a fix. The first list here is
|
|
9
|
+
* a fact — these previews show what you changed, and only their source says
|
|
10
|
+
* whether that matters. The second is a question: nothing renders that context
|
|
11
|
+
* at all, and whether it deserves a preview is a judgment about the product
|
|
12
|
+
* rather than about the code.
|
|
13
|
+
*/
|
|
14
|
+
export declare function summarizeReach(report: CoverageReport): string;
|
|
15
|
+
/**
|
|
16
|
+
* What each component is missing, which is the half `summarizeHints` cannot
|
|
17
|
+
* see: a hint needs a preview to exist before it can say anything about it.
|
|
18
|
+
*
|
|
19
|
+
* Grouped by component rather than listed flat. A flat list sorted by severity
|
|
20
|
+
* put every "has no preview" first, and on a repository with a hundred of them
|
|
21
|
+
* the cap fell before a single state gap was reached — the specific, useful
|
|
22
|
+
* half of the report never reached the reader. Components carrying the most
|
|
23
|
+
* missing states come first for the same reason.
|
|
24
|
+
*
|
|
25
|
+
* It reports; it never edits.
|
|
26
|
+
*/
|
|
27
|
+
export declare function summarizeGaps(report: CoverageReport): string;
|
|
28
|
+
export declare function summarizeHints(report: CoverageReport): string;
|
|
1
29
|
export declare function runMcpServer(): Promise<void>;
|