@solidnumber/cli 1.25.0 → 2.1.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 +40 -1
- package/dist/commands/audit.js +61 -0
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/graph.d.ts.map +1 -1
- package/dist/commands/graph.js +17 -7
- package/dist/commands/graph.js.map +1 -1
- package/dist/commands/render.d.ts +28 -0
- package/dist/commands/render.d.ts.map +1 -0
- package/dist/commands/render.js +243 -0
- package/dist/commands/render.js.map +1 -0
- package/dist/commands/schema.js +57 -0
- package/dist/commands/schema.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +45 -0
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/block-example-synth.d.ts +31 -0
- package/dist/lib/block-example-synth.d.ts.map +1 -0
- package/dist/lib/block-example-synth.js +148 -0
- package/dist/lib/block-example-synth.js.map +1 -0
- package/dist/lib/block-types.d.ts +28 -0
- package/dist/lib/block-types.d.ts.map +1 -0
- package/dist/lib/block-types.js +7 -0
- package/dist/lib/block-types.js.map +1 -0
- package/dist/lib/browser-install.d.ts +66 -0
- package/dist/lib/browser-install.d.ts.map +1 -0
- package/dist/lib/browser-install.js +178 -0
- package/dist/lib/browser-install.js.map +1 -0
- package/dist/lib/error-codes.d.ts +7 -3
- package/dist/lib/error-codes.d.ts.map +1 -1
- package/dist/lib/error-codes.js +12 -5
- package/dist/lib/error-codes.js.map +1 -1
- package/dist/lib/lighthouse-runner.d.ts +64 -0
- package/dist/lib/lighthouse-runner.d.ts.map +1 -0
- package/dist/lib/lighthouse-runner.js +168 -0
- package/dist/lib/lighthouse-runner.js.map +1 -0
- package/dist/lib/render-utils.d.ts +35 -0
- package/dist/lib/render-utils.d.ts.map +1 -0
- package/dist/lib/render-utils.js +78 -0
- package/dist/lib/render-utils.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block example synthesizer for `solid schema blocks --examples` (A.3).
|
|
3
|
+
*
|
|
4
|
+
* The block schema (cms-blocks.json) has a `props` map of `name → type`.
|
|
5
|
+
* For blocks without a hand-written `example`, we synthesize one using
|
|
6
|
+
* realistic placeholders so the agent gets shape AND context, not just
|
|
7
|
+
* `{ "headline": "string" }`.
|
|
8
|
+
*
|
|
9
|
+
* Pure module — no side effects. Unit tested.
|
|
10
|
+
*/
|
|
11
|
+
import type { BlockDef } from './block-types';
|
|
12
|
+
/**
|
|
13
|
+
* Generate a placeholder value for a single prop based on its type
|
|
14
|
+
* declaration (e.g. "string", "number", "boolean", "string[]") and
|
|
15
|
+
* its name.
|
|
16
|
+
*/
|
|
17
|
+
export declare function placeholderForProp(name: string, type: string): unknown;
|
|
18
|
+
/**
|
|
19
|
+
* Synthesize a JSON-LD-shaped block example from a BlockDef.
|
|
20
|
+
*
|
|
21
|
+
* Result shape: `{ type: <block type>, ...prop-defaults }`
|
|
22
|
+
*
|
|
23
|
+
* If the BlockDef already carries a hand-written `example`, that wins
|
|
24
|
+
* — synthesized output is a fallback, not a replacement.
|
|
25
|
+
*/
|
|
26
|
+
export declare function synthesizeExample(block: BlockDef): Record<string, unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* Build the full {blockType: example} map for `--examples --json`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function synthesizeAllExamples(blocks: BlockDef[]): Record<string, Record<string, unknown>>;
|
|
31
|
+
//# sourceMappingURL=block-example-synth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-example-synth.d.ts","sourceRoot":"","sources":["../../src/lib/block-example-synth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAiD9C;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAmCtE;AAeD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoB1E;AAGD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAMjG"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Block example synthesizer for `solid schema blocks --examples` (A.3).
|
|
4
|
+
*
|
|
5
|
+
* The block schema (cms-blocks.json) has a `props` map of `name → type`.
|
|
6
|
+
* For blocks without a hand-written `example`, we synthesize one using
|
|
7
|
+
* realistic placeholders so the agent gets shape AND context, not just
|
|
8
|
+
* `{ "headline": "string" }`.
|
|
9
|
+
*
|
|
10
|
+
* Pure module — no side effects. Unit tested.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.placeholderForProp = placeholderForProp;
|
|
14
|
+
exports.synthesizeExample = synthesizeExample;
|
|
15
|
+
exports.synthesizeAllExamples = synthesizeAllExamples;
|
|
16
|
+
const STRING_PLACEHOLDERS = {
|
|
17
|
+
// Marketing copy patterns the agent recognizes immediately
|
|
18
|
+
headline: 'Your business, on autopilot',
|
|
19
|
+
subheadline: 'AI agents handle the work so you can focus on what matters',
|
|
20
|
+
title: 'Section title',
|
|
21
|
+
subtitle: 'Section subtitle',
|
|
22
|
+
description: 'Short description that explains the value clearly',
|
|
23
|
+
body: 'Longer body copy. Markdown is supported. Keep it tight.',
|
|
24
|
+
text: 'Inline text content',
|
|
25
|
+
caption: 'Image caption',
|
|
26
|
+
cta_text: 'Get started',
|
|
27
|
+
cta_url: '/signup',
|
|
28
|
+
link_text: 'Learn more',
|
|
29
|
+
link_url: '/about',
|
|
30
|
+
// Identity / branding
|
|
31
|
+
name: 'Acme, Inc.',
|
|
32
|
+
brand: 'Acme',
|
|
33
|
+
slug: 'home',
|
|
34
|
+
category: 'general',
|
|
35
|
+
// Contact / location
|
|
36
|
+
email: 'hello@acme.com',
|
|
37
|
+
phone: '+1 (555) 123-4567',
|
|
38
|
+
address: '123 Main St, San Francisco, CA 94103',
|
|
39
|
+
hours: 'Mon–Fri 9am–6pm',
|
|
40
|
+
// Media URLs — use placehold.co so the example renders without
|
|
41
|
+
// hitting a 404 in dev
|
|
42
|
+
image: 'https://placehold.co/1200x600',
|
|
43
|
+
image_url: 'https://placehold.co/1200x600',
|
|
44
|
+
background: 'https://placehold.co/1920x1080',
|
|
45
|
+
video: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
|
|
46
|
+
video_url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
|
|
47
|
+
logo: 'https://placehold.co/200x80',
|
|
48
|
+
avatar: 'https://placehold.co/100x100',
|
|
49
|
+
icon: 'sparkles',
|
|
50
|
+
// Pricing / numbers
|
|
51
|
+
price: '99',
|
|
52
|
+
currency: 'USD',
|
|
53
|
+
amount: '99',
|
|
54
|
+
count: '12',
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Generate a placeholder value for a single prop based on its type
|
|
58
|
+
* declaration (e.g. "string", "number", "boolean", "string[]") and
|
|
59
|
+
* its name.
|
|
60
|
+
*/
|
|
61
|
+
function placeholderForProp(name, type) {
|
|
62
|
+
const lower = name.toLowerCase();
|
|
63
|
+
const typeLower = type.toLowerCase().trim();
|
|
64
|
+
// Arrays — recurse into element type if we can detect it
|
|
65
|
+
if (typeLower.endsWith('[]')) {
|
|
66
|
+
const inner = typeLower.slice(0, -2).trim();
|
|
67
|
+
return [placeholderForProp(name, inner), placeholderForProp(name, inner)];
|
|
68
|
+
}
|
|
69
|
+
if (typeLower === 'boolean' || typeLower === 'bool')
|
|
70
|
+
return true;
|
|
71
|
+
if (typeLower === 'number' || typeLower === 'integer' || typeLower === 'int') {
|
|
72
|
+
// Some props are obviously numeric — use the named placeholder if present
|
|
73
|
+
const named = STRING_PLACEHOLDERS[lower];
|
|
74
|
+
if (named && /^-?\d+$/.test(named))
|
|
75
|
+
return parseInt(named, 10);
|
|
76
|
+
return 0;
|
|
77
|
+
}
|
|
78
|
+
// Object shorthand — return an empty object the agent can fill in
|
|
79
|
+
if (typeLower === 'object' || typeLower.startsWith('{'))
|
|
80
|
+
return {};
|
|
81
|
+
// String + everything else — try the placeholder map, fall back to a
|
|
82
|
+
// descriptive default
|
|
83
|
+
const named = STRING_PLACEHOLDERS[lower];
|
|
84
|
+
if (named)
|
|
85
|
+
return named;
|
|
86
|
+
// Match suffix patterns
|
|
87
|
+
if (lower.endsWith('_url') || lower.endsWith('url'))
|
|
88
|
+
return 'https://example.com';
|
|
89
|
+
if (lower.endsWith('_email') || lower === 'email')
|
|
90
|
+
return 'hello@example.com';
|
|
91
|
+
if (lower.endsWith('_phone') || lower === 'phone')
|
|
92
|
+
return '+1 (555) 000-0000';
|
|
93
|
+
if (lower.endsWith('_image') || lower.endsWith('image') || lower.endsWith('_img'))
|
|
94
|
+
return 'https://placehold.co/600x400';
|
|
95
|
+
// Default: a descriptive placeholder mentioning the prop name so the
|
|
96
|
+
// agent knows exactly what to fill in
|
|
97
|
+
return `<${name}>`;
|
|
98
|
+
}
|
|
99
|
+
/** Pick a sensible value from an enum's allowed values. */
|
|
100
|
+
function pickEnumValue(values) {
|
|
101
|
+
if (values.length === 0)
|
|
102
|
+
return '';
|
|
103
|
+
// Prefer common-sense defaults if present
|
|
104
|
+
const preferred = ['default', 'primary', 'medium', 'center', 'left', 'normal'];
|
|
105
|
+
for (const p of preferred) {
|
|
106
|
+
if (values.includes(p))
|
|
107
|
+
return p;
|
|
108
|
+
}
|
|
109
|
+
return values[0];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Synthesize a JSON-LD-shaped block example from a BlockDef.
|
|
113
|
+
*
|
|
114
|
+
* Result shape: `{ type: <block type>, ...prop-defaults }`
|
|
115
|
+
*
|
|
116
|
+
* If the BlockDef already carries a hand-written `example`, that wins
|
|
117
|
+
* — synthesized output is a fallback, not a replacement.
|
|
118
|
+
*/
|
|
119
|
+
function synthesizeExample(block) {
|
|
120
|
+
// Hand-written examples beat synthesized ones every time
|
|
121
|
+
if (block.example && typeof block.example === 'object' && !Array.isArray(block.example)) {
|
|
122
|
+
return block.example;
|
|
123
|
+
}
|
|
124
|
+
const out = { type: block.type };
|
|
125
|
+
if (block.props) {
|
|
126
|
+
for (const [name, type] of Object.entries(block.props)) {
|
|
127
|
+
// Enum-typed props get an enum value, not a free placeholder
|
|
128
|
+
if (block.enums && block.enums[name]) {
|
|
129
|
+
out[name] = pickEnumValue(block.enums[name]);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
out[name] = placeholderForProp(name, type);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return out;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Build the full {blockType: example} map for `--examples --json`.
|
|
140
|
+
*/
|
|
141
|
+
function synthesizeAllExamples(blocks) {
|
|
142
|
+
const out = {};
|
|
143
|
+
for (const block of blocks) {
|
|
144
|
+
out[block.type] = synthesizeExample(block);
|
|
145
|
+
}
|
|
146
|
+
return out;
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=block-example-synth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-example-synth.js","sourceRoot":"","sources":["../../src/lib/block-example-synth.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAwDH,gDAmCC;AAuBD,8CAoBC;AAMD,sDAMC;AA7ID,MAAM,mBAAmB,GAA2B;IAClD,2DAA2D;IAC3D,QAAQ,EAAK,6BAA6B;IAC1C,WAAW,EAAE,4DAA4D;IACzE,KAAK,EAAQ,eAAe;IAC5B,QAAQ,EAAK,kB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IAAI,CAAC,GAAG,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAGD;;GAEG;AACH,SAAgB,qBAAqB,CAAC,MAAkB;IACtD,MAAM,GAAG,GAA4C,EAAE,CAAC;IACxD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared block-schema types so `commands/schema.ts`, the synthesizer
|
|
3
|
+
* (`block-example-synth.ts`), and any future consumer agree on shape.
|
|
4
|
+
*/
|
|
5
|
+
export interface BlockDef {
|
|
6
|
+
type: string;
|
|
7
|
+
component: string;
|
|
8
|
+
category: string;
|
|
9
|
+
aliases?: string[];
|
|
10
|
+
props?: Record<string, string>;
|
|
11
|
+
enums?: Record<string, string[]>;
|
|
12
|
+
notes?: string;
|
|
13
|
+
example?: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface SchemaDoc {
|
|
16
|
+
_meta: {
|
|
17
|
+
version: string;
|
|
18
|
+
source: string;
|
|
19
|
+
note: string;
|
|
20
|
+
extracted_from: string;
|
|
21
|
+
};
|
|
22
|
+
envelope: {
|
|
23
|
+
sections: string;
|
|
24
|
+
notes: string[];
|
|
25
|
+
};
|
|
26
|
+
blocks: BlockDef[];
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=block-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-types.d.ts","sourceRoot":"","sources":["../../src/lib/block-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC;IACjF,QAAQ,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAChD,MAAM,EAAE,QAAQ,EAAE,CAAC;CACpB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared block-schema types so `commands/schema.ts`, the synthesizer
|
|
4
|
+
* (`block-example-synth.ts`), and any future consumer agree on shape.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
//# sourceMappingURL=block-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-types.js","sourceRoot":"","sources":["../../src/lib/block-types.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chromium installer for `solid render` and `solid audit` (A.1 + A.5).
|
|
3
|
+
*
|
|
4
|
+
* Sprint: SPRINT-CLI-AGENT-CAN-SHIP.md § A.1
|
|
5
|
+
*
|
|
6
|
+
* Strategy
|
|
7
|
+
* --------
|
|
8
|
+
* `puppeteer-core` ships ~9 MB; the actual Chromium binary is ~150 MB.
|
|
9
|
+
* We don't ship Chromium with every CLI install — most users never
|
|
10
|
+
* touch the screenshot/audit commands. Instead, on first `solid render`
|
|
11
|
+
* or `solid audit` invocation:
|
|
12
|
+
*
|
|
13
|
+
* 1. Look for an already-cached Chromium at `~/.solid/chromium/`.
|
|
14
|
+
* 2. Look for a system Chrome (macOS bundle, Linux PATH).
|
|
15
|
+
* 3. If neither, prompt + download via `@puppeteer/browsers`. In
|
|
16
|
+
* non-interactive contexts (no TTY, CI, agent) we honor
|
|
17
|
+
* `SOLID_AUTO_INSTALL=1` for unattended download; otherwise
|
|
18
|
+
* print the explicit `solid render --install` recovery command.
|
|
19
|
+
*
|
|
20
|
+
* Cache layout: `~/.solid/chromium/chrome/<platform>-<buildId>/...`
|
|
21
|
+
* (whatever `@puppeteer/browsers` decides). We never write outside
|
|
22
|
+
* `~/.solid/`.
|
|
23
|
+
*/
|
|
24
|
+
/** Where we cache downloaded browsers. Lives under ~/.solid/ so it
|
|
25
|
+
* inherits the existing tenant-scoped directory and tracks with the
|
|
26
|
+
* CLI install. */
|
|
27
|
+
export declare function browserCacheDir(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Resolve a Chromium executable path the renderer can launch.
|
|
30
|
+
*
|
|
31
|
+
* Order of preference (highest → lowest):
|
|
32
|
+
* 1. SOLID_CHROMIUM_PATH env (operator override)
|
|
33
|
+
* 2. Cached download under ~/.solid/chromium/
|
|
34
|
+
* 3. System Chrome (macOS bundle, Linux PATH)
|
|
35
|
+
*
|
|
36
|
+
* Returns `null` when nothing is available — caller decides whether
|
|
37
|
+
* to prompt for install or fail with a hint.
|
|
38
|
+
*/
|
|
39
|
+
export declare function findChromiumExecutable(): Promise<string | null>;
|
|
40
|
+
export interface InstallResult {
|
|
41
|
+
/** Absolute path to the launchable Chromium executable. */
|
|
42
|
+
executablePath: string;
|
|
43
|
+
/** Build ID (Chrome version) we installed. */
|
|
44
|
+
buildId: string;
|
|
45
|
+
/** Whether we downloaded (true) or found an existing install (false). */
|
|
46
|
+
downloaded: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Ensure a Chromium binary is available, downloading if necessary.
|
|
50
|
+
*
|
|
51
|
+
* Behavior:
|
|
52
|
+
* - If a Chromium is already findable (env override / cache /
|
|
53
|
+
* system), return it without touching the network.
|
|
54
|
+
* - Otherwise download the latest Chrome stable into the cache dir.
|
|
55
|
+
*
|
|
56
|
+
* Args:
|
|
57
|
+
* onProgress — invoked with bytes (downloaded, total). Caller renders
|
|
58
|
+
* the progress bar; we don't lock that to ora/cli-progress here so
|
|
59
|
+
* the lib stays UI-free and unit-testable.
|
|
60
|
+
*/
|
|
61
|
+
export declare function ensureChromium(onProgress?: (downloadedBytes: number, totalBytes: number) => void): Promise<InstallResult>;
|
|
62
|
+
/** Best-effort uninstall — used by `solid render --install --force`
|
|
63
|
+
* to nuke a corrupted cache. Pure rm-rf of the cache dir; system
|
|
64
|
+
* Chrome and any SOLID_CHROMIUM_PATH override are untouched. */
|
|
65
|
+
export declare function uninstallCachedBrowsers(): void;
|
|
66
|
+
//# sourceMappingURL=browser-install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-install.d.ts","sourceRoot":"","sources":["../../src/lib/browser-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAkBH;;mBAEmB;AACnB,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAoCrE;AAGD,MAAM,WAAW,aAAa;IAC5B,2DAA2D;IAC3D,cAAc,EAAE,MAAM,CAAC;IACvB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAClC,UAAU,CAAC,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,GACjE,OAAO,CAAC,aAAa,CAAC,CA2CxB;AAGD;;iEAEiE;AACjE,wBAAgB,uBAAuB,IAAI,IAAI,CAK9C"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Chromium installer for `solid render` and `solid audit` (A.1 + A.5).
|
|
4
|
+
*
|
|
5
|
+
* Sprint: SPRINT-CLI-AGENT-CAN-SHIP.md § A.1
|
|
6
|
+
*
|
|
7
|
+
* Strategy
|
|
8
|
+
* --------
|
|
9
|
+
* `puppeteer-core` ships ~9 MB; the actual Chromium binary is ~150 MB.
|
|
10
|
+
* We don't ship Chromium with every CLI install — most users never
|
|
11
|
+
* touch the screenshot/audit commands. Instead, on first `solid render`
|
|
12
|
+
* or `solid audit` invocation:
|
|
13
|
+
*
|
|
14
|
+
* 1. Look for an already-cached Chromium at `~/.solid/chromium/`.
|
|
15
|
+
* 2. Look for a system Chrome (macOS bundle, Linux PATH).
|
|
16
|
+
* 3. If neither, prompt + download via `@puppeteer/browsers`. In
|
|
17
|
+
* non-interactive contexts (no TTY, CI, agent) we honor
|
|
18
|
+
* `SOLID_AUTO_INSTALL=1` for unattended download; otherwise
|
|
19
|
+
* print the explicit `solid render --install` recovery command.
|
|
20
|
+
*
|
|
21
|
+
* Cache layout: `~/.solid/chromium/chrome/<platform>-<buildId>/...`
|
|
22
|
+
* (whatever `@puppeteer/browsers` decides). We never write outside
|
|
23
|
+
* `~/.solid/`.
|
|
24
|
+
*/
|
|
25
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
26
|
+
if (k2 === undefined) k2 = k;
|
|
27
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
28
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
29
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
30
|
+
}
|
|
31
|
+
Object.defineProperty(o, k2, desc);
|
|
32
|
+
}) : (function(o, m, k, k2) {
|
|
33
|
+
if (k2 === undefined) k2 = k;
|
|
34
|
+
o[k2] = m[k];
|
|
35
|
+
}));
|
|
36
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
37
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
38
|
+
}) : function(o, v) {
|
|
39
|
+
o["default"] = v;
|
|
40
|
+
});
|
|
41
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
42
|
+
var ownKeys = function(o) {
|
|
43
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
44
|
+
var ar = [];
|
|
45
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
46
|
+
return ar;
|
|
47
|
+
};
|
|
48
|
+
return ownKeys(o);
|
|
49
|
+
};
|
|
50
|
+
return function (mod) {
|
|
51
|
+
if (mod && mod.__esModule) return mod;
|
|
52
|
+
var result = {};
|
|
53
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
54
|
+
__setModuleDefault(result, mod);
|
|
55
|
+
return result;
|
|
56
|
+
};
|
|
57
|
+
})();
|
|
58
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
+
exports.browserCacheDir = browserCacheDir;
|
|
60
|
+
exports.findChromiumExecutable = findChromiumExecutable;
|
|
61
|
+
exports.ensureChromium = ensureChromium;
|
|
62
|
+
exports.uninstallCachedBrowsers = uninstallCachedBrowsers;
|
|
63
|
+
const fs = __importStar(require("fs"));
|
|
64
|
+
const os = __importStar(require("os"));
|
|
65
|
+
const path = __importStar(require("path"));
|
|
66
|
+
const browsers_1 = require("@puppeteer/browsers");
|
|
67
|
+
/** Where we cache downloaded browsers. Lives under ~/.solid/ so it
|
|
68
|
+
* inherits the existing tenant-scoped directory and tracks with the
|
|
69
|
+
* CLI install. */
|
|
70
|
+
function browserCacheDir() {
|
|
71
|
+
return path.join(os.homedir(), '.solid', 'chromium');
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Resolve a Chromium executable path the renderer can launch.
|
|
75
|
+
*
|
|
76
|
+
* Order of preference (highest → lowest):
|
|
77
|
+
* 1. SOLID_CHROMIUM_PATH env (operator override)
|
|
78
|
+
* 2. Cached download under ~/.solid/chromium/
|
|
79
|
+
* 3. System Chrome (macOS bundle, Linux PATH)
|
|
80
|
+
*
|
|
81
|
+
* Returns `null` when nothing is available — caller decides whether
|
|
82
|
+
* to prompt for install or fail with a hint.
|
|
83
|
+
*/
|
|
84
|
+
async function findChromiumExecutable() {
|
|
85
|
+
const envPath = process.env.SOLID_CHROMIUM_PATH;
|
|
86
|
+
if (envPath && fs.existsSync(envPath))
|
|
87
|
+
return envPath;
|
|
88
|
+
// 2. Cached download from a previous install
|
|
89
|
+
try {
|
|
90
|
+
const cacheDir = browserCacheDir();
|
|
91
|
+
if (fs.existsSync(cacheDir)) {
|
|
92
|
+
const installed = await (0, browsers_1.getInstalledBrowsers)({ cacheDir });
|
|
93
|
+
const chrome = installed.find((b) => b.browser === browsers_1.Browser.CHROME);
|
|
94
|
+
if (chrome) {
|
|
95
|
+
const exe = (0, browsers_1.computeExecutablePath)({
|
|
96
|
+
browser: browsers_1.Browser.CHROME,
|
|
97
|
+
buildId: chrome.buildId,
|
|
98
|
+
cacheDir,
|
|
99
|
+
});
|
|
100
|
+
if (fs.existsSync(exe))
|
|
101
|
+
return exe;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
// fall through to system check
|
|
107
|
+
}
|
|
108
|
+
// 3. System Chrome — macOS bundle, Linux PATH, Windows registry
|
|
109
|
+
try {
|
|
110
|
+
const platform = (0, browsers_1.detectBrowserPlatform)();
|
|
111
|
+
if (platform) {
|
|
112
|
+
const sys = (0, browsers_1.computeSystemExecutablePath)({ browser: browsers_1.Browser.CHROME, channel: 'stable', platform });
|
|
113
|
+
if (sys && fs.existsSync(sys))
|
|
114
|
+
return sys;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
// computeSystemExecutablePath throws when no system Chrome —
|
|
119
|
+
// expected on Linux servers. Fall through.
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Ensure a Chromium binary is available, downloading if necessary.
|
|
125
|
+
*
|
|
126
|
+
* Behavior:
|
|
127
|
+
* - If a Chromium is already findable (env override / cache /
|
|
128
|
+
* system), return it without touching the network.
|
|
129
|
+
* - Otherwise download the latest Chrome stable into the cache dir.
|
|
130
|
+
*
|
|
131
|
+
* Args:
|
|
132
|
+
* onProgress — invoked with bytes (downloaded, total). Caller renders
|
|
133
|
+
* the progress bar; we don't lock that to ora/cli-progress here so
|
|
134
|
+
* the lib stays UI-free and unit-testable.
|
|
135
|
+
*/
|
|
136
|
+
async function ensureChromium(onProgress) {
|
|
137
|
+
const existing = await findChromiumExecutable();
|
|
138
|
+
if (existing) {
|
|
139
|
+
return { executablePath: existing, buildId: 'system-or-cached', downloaded: false };
|
|
140
|
+
}
|
|
141
|
+
const platform = (0, browsers_1.detectBrowserPlatform)();
|
|
142
|
+
if (!platform) {
|
|
143
|
+
throw new Error('Could not detect platform — @puppeteer/browsers does not support this OS/arch combination. ' +
|
|
144
|
+
'Set SOLID_CHROMIUM_PATH to point at an existing Chromium binary.');
|
|
145
|
+
}
|
|
146
|
+
const cacheDir = browserCacheDir();
|
|
147
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
148
|
+
// Resolve the latest Chrome stable build ID for this platform.
|
|
149
|
+
const buildId = await (0, browsers_1.resolveBuildId)(browsers_1.Browser.CHROME, platform, 'stable');
|
|
150
|
+
await (0, browsers_1.install)({
|
|
151
|
+
browser: browsers_1.Browser.CHROME,
|
|
152
|
+
buildId,
|
|
153
|
+
cacheDir,
|
|
154
|
+
downloadProgressCallback: onProgress
|
|
155
|
+
? (downloaded, total) => onProgress(downloaded, total)
|
|
156
|
+
: (0, browsers_1.makeProgressCallback)(browsers_1.Browser.CHROME, buildId),
|
|
157
|
+
});
|
|
158
|
+
const executablePath = (0, browsers_1.computeExecutablePath)({
|
|
159
|
+
browser: browsers_1.Browser.CHROME,
|
|
160
|
+
buildId,
|
|
161
|
+
cacheDir,
|
|
162
|
+
});
|
|
163
|
+
if (!fs.existsSync(executablePath)) {
|
|
164
|
+
throw new Error(`@puppeteer/browsers reported success but the executable is missing at ${executablePath}. ` +
|
|
165
|
+
'Try removing ~/.solid/chromium/ and rerunning.');
|
|
166
|
+
}
|
|
167
|
+
return { executablePath, buildId, downloaded: true };
|
|
168
|
+
}
|
|
169
|
+
/** Best-effort uninstall — used by `solid render --install --force`
|
|
170
|
+
* to nuke a corrupted cache. Pure rm-rf of the cache dir; system
|
|
171
|
+
* Chrome and any SOLID_CHROMIUM_PATH override are untouched. */
|
|
172
|
+
function uninstallCachedBrowsers() {
|
|
173
|
+
const cacheDir = browserCacheDir();
|
|
174
|
+
if (fs.existsSync(cacheDir)) {
|
|
175
|
+
fs.rmSync(cacheDir, { recursive: true, force: true });
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=browser-install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-install.js","sourceRoot":"","sources":["../../src/lib/browser-install.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBH,0CAEC;AAaD,wDAoCC;AAyBD,wCA6CC;AAMD,0DAKC;AAvJD,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAE7B,kDAS6B;AAG7B;;mBAEmB;AACnB,SAAgB,eAAe;IAC7B,OAAO,IAAI,CAAC,IAAI,CAAC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,CAAC,MAAM;QACvB,OAAO;QACP,QAAQ;KACT,CAAC,CAAC;IAEH,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CACb,yEAAyE,cAAc,IAAI;YAC3F,gDAAgD,CACjD,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;AACvD,CAAC;AAGD;;iEAEiE;AACjE,SAAgB,uBAAuB;IACrC,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAC;IACnC,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5B,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;AACH,CAAC"}
|
|
@@ -73,9 +73,13 @@ export interface ErrorEnvelope {
|
|
|
73
73
|
}
|
|
74
74
|
export declare function toErrorEnvelope(classified: ClassifiedError, status: number, message: string): ErrorEnvelope;
|
|
75
75
|
/**
|
|
76
|
-
* True when the caller
|
|
77
|
-
*
|
|
78
|
-
*
|
|
76
|
+
* True when the caller wants structured JSON errors. Default flipped
|
|
77
|
+
* to ON in v2.0.0 (was opt-in via SOLID_JSON_V2 in 1.x). Callers that
|
|
78
|
+
* still want the legacy prose-style errors can set SOLID_LEGACY_ERRORS=1.
|
|
79
|
+
*
|
|
80
|
+
* The old SOLID_JSON_V2 env var is still honored for backward
|
|
81
|
+
* compatibility with scripts that explicitly opt in — it just no
|
|
82
|
+
* longer matters because the default is already on.
|
|
79
83
|
*/
|
|
80
84
|
export declare function jsonErrorEnvelopeEnabled(): boolean;
|
|
81
85
|
//# sourceMappingURL=error-codes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/lib/error-codes.ts"],"names":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CAAC,EAAE,MAAM,CAAC;CACpB;AAWD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAI1E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,eAAe,CAkGnE;AAoBD;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE;QACL,IAAI,EAAE,SAAS,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,wBAAgB,eAAe,CAC7B,UAAU,EAAE,eAAe,EAC3B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,aAAa,CAaf;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAMlD"}
|
package/dist/lib/error-codes.js
CHANGED
|
@@ -155,12 +155,19 @@ function toErrorEnvelope(classified, status, message) {
|
|
|
155
155
|
return { error: envelope };
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
|
-
* True when the caller
|
|
159
|
-
*
|
|
160
|
-
*
|
|
158
|
+
* True when the caller wants structured JSON errors. Default flipped
|
|
159
|
+
* to ON in v2.0.0 (was opt-in via SOLID_JSON_V2 in 1.x). Callers that
|
|
160
|
+
* still want the legacy prose-style errors can set SOLID_LEGACY_ERRORS=1.
|
|
161
|
+
*
|
|
162
|
+
* The old SOLID_JSON_V2 env var is still honored for backward
|
|
163
|
+
* compatibility with scripts that explicitly opt in — it just no
|
|
164
|
+
* longer matters because the default is already on.
|
|
161
165
|
*/
|
|
162
166
|
function jsonErrorEnvelopeEnabled() {
|
|
163
|
-
const
|
|
164
|
-
|
|
167
|
+
const legacy = process.env.SOLID_LEGACY_ERRORS;
|
|
168
|
+
if (typeof legacy === 'string' && /^(1|true|yes|on)$/i.test(legacy)) {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
return true;
|
|
165
172
|
}
|
|
166
173
|
//# sourceMappingURL=error-codes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.js","sourceRoot":"","sources":["../../src/lib/error-codes.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AA0EH,wDAIC;AAMD,sCAkGC;AAuCD,0CAiBC;
|
|
1
|
+
{"version":3,"file":"error-codes.js","sourceRoot":"","sources":["../../src/lib/error-codes.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AA0EH,wDAIC;AAMD,sCAkGC;AAuCD,0CAiBC;AAWD,4DAMC;AA9OY,QAAA,WAAW,GAAgB;IACtC,eAAe;IACf,WAAW;IACX,eAAe;IACf,eAAe;IACf,WAAW;IACX,mBAAmB;IACnB,UAAU;IACV,cAAc;IACd,cAAc;IACd,eAAe;IACf,SAAS;IACT,iBAAiB;CAClB,CAAC;AA8BF,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAE,CAA6B,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1E,CAAC;AAED,SAAS,UAAU,CAAC,GAA4B,EAAE,GAAW;IAC3D,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/D,CAAC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CAAC,MAAe;IACpD,IAAI,OAAO,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|
2
|
+
* Lighthouse driver for `solid audit a11y|perf|mobile` (A.5).
|
|
3
|
+
*
|
|
4
|
+
* Wraps the `lighthouse` npm package + the same Chromium that powers
|
|
5
|
+
* `solid render` (via `lib/browser-install.ts`). Lighthouse expects to
|
|
6
|
+
* connect to a Chrome with --remote-debugging-port; puppeteer-core
|
|
7
|
+
* gives us that for free.
|
|
8
|
+
*
|
|
9
|
+
* Pure plumbing: launches Chrome, runs lighthouse, returns the trimmed
|
|
10
|
+
* audit. No Commander, no UI — those live in `commands/audit.ts`.
|
|
11
|
+
*/
|
|
12
|
+
export type LighthouseCategory = 'a11y' | 'perf' | 'mobile';
|
|
13
|
+
export interface LighthouseIssue {
|
|
14
|
+
rule: string;
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
/** Lighthouse score 0..1, OR null if not applicable. */
|
|
18
|
+
score: number | null;
|
|
19
|
+
/** Numeric severity for sorting: 'serious'|'moderate'|'minor'|'pass'. */
|
|
20
|
+
severity: 'serious' | 'moderate' | 'minor' | 'pass';
|
|
21
|
+
}
|
|
22
|
+
export interface LighthouseAuditResult {
|
|
23
|
+
/** 0..100 — Lighthouse's category score, scaled. */
|
|
24
|
+
score: number;
|
|
25
|
+
/** Category we audited. */
|
|
26
|
+
category: LighthouseCategory;
|
|
27
|
+
/** URL we audited. */
|
|
28
|
+
url: string;
|
|
29
|
+
/** Issues sorted by severity (worst first). Capped at 50 to keep
|
|
30
|
+
* agent context budgets reasonable; full report is in `raw`. */
|
|
31
|
+
issues: LighthouseIssue[];
|
|
32
|
+
/** Optional raw Lighthouse JSON. Excluded by default; opt-in via
|
|
33
|
+
* `keepRaw: true` for callers that want the full ~5MB report. */
|
|
34
|
+
raw?: unknown;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Trim a full Lighthouse report down to the issues that matter for
|
|
38
|
+
* the chosen category. Pure function — exported for unit testing.
|
|
39
|
+
*/
|
|
40
|
+
export declare function extractIssues(rawReport: {
|
|
41
|
+
audits?: Record<string, {
|
|
42
|
+
id?: string;
|
|
43
|
+
title?: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
score?: number | null;
|
|
46
|
+
scoreDisplayMode?: string;
|
|
47
|
+
}>;
|
|
48
|
+
categories?: Record<string, {
|
|
49
|
+
auditRefs?: Array<{
|
|
50
|
+
id: string;
|
|
51
|
+
}>;
|
|
52
|
+
}>;
|
|
53
|
+
}, categoryId: string): LighthouseIssue[];
|
|
54
|
+
/**
|
|
55
|
+
* Run Lighthouse against a URL. Launches its own Chromium so the call
|
|
56
|
+
* is self-contained; auto-installs Chromium if needed.
|
|
57
|
+
*
|
|
58
|
+
* @throws if the URL doesn't load, Chrome can't launch, or Lighthouse
|
|
59
|
+
* returns no result.
|
|
60
|
+
*/
|
|
61
|
+
export declare function runLighthouse(url: string, category: LighthouseCategory, opts?: {
|
|
62
|
+
keepRaw?: boolean;
|
|
63
|
+
}): Promise<LighthouseAuditResult>;
|
|
64
|
+
//# sourceMappingURL=lighthouse-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lighthouse-runner.d.ts","sourceRoot":"","sources":["../../src/lib/lighthouse-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAgB5D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,yEAAyE;IACzE,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;CACrD;AAGD,MAAM,WAAW,qBAAqB;IACpC,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,QAAQ,EAAE,kBAAkB,CAAC;IAC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