@greenharness/greenrack-cli 0.0.0-reserved → 7.0.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 +334 -1
- package/agents/design-system-lookup.md +59 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +145 -0
- package/dist/bin.js.map +1 -0
- package/dist/catalog.d.ts +13 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +67 -0
- package/dist/catalog.js.map +1 -0
- package/dist/commands/context.d.ts +17 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +110 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/doctor.d.ts +75 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +1008 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/hook.d.ts +10 -0
- package/dist/commands/hook.d.ts.map +1 -0
- package/dist/commands/hook.js +323 -0
- package/dist/commands/hook.js.map +1 -0
- package/dist/commands/list.d.ts +4 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +59 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/lookup.d.ts +13 -0
- package/dist/commands/lookup.d.ts.map +1 -0
- package/dist/commands/lookup.js +66 -0
- package/dist/commands/lookup.js.map +1 -0
- package/dist/commands/manifest.d.ts +5 -0
- package/dist/commands/manifest.d.ts.map +1 -0
- package/dist/commands/manifest.js +33 -0
- package/dist/commands/manifest.js.map +1 -0
- package/dist/commands/mcp.d.ts +159 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +235 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/mockup.d.ts +80 -0
- package/dist/commands/mockup.d.ts.map +1 -0
- package/dist/commands/mockup.js +714 -0
- package/dist/commands/mockup.js.map +1 -0
- package/dist/commands/skill.d.ts +15 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +398 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/disambiguation.d.ts +24 -0
- package/dist/disambiguation.d.ts.map +1 -0
- package/dist/disambiguation.js +56 -0
- package/dist/disambiguation.js.map +1 -0
- package/dist/extension-pointer.d.ts +7 -0
- package/dist/extension-pointer.d.ts.map +1 -0
- package/dist/extension-pointer.js +30 -0
- package/dist/extension-pointer.js.map +1 -0
- package/dist/format.d.ts +19 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +213 -0
- package/dist/format.js.map +1 -0
- package/dist/hook-script.d.ts +73 -0
- package/dist/hook-script.d.ts.map +1 -0
- package/dist/hook-script.js +165 -0
- package/dist/hook-script.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/legacy-names.d.ts +26 -0
- package/dist/legacy-names.d.ts.map +1 -0
- package/dist/legacy-names.js +26 -0
- package/dist/legacy-names.js.map +1 -0
- package/dist/manifest.d.ts +51 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +229 -0
- package/dist/manifest.js.map +1 -0
- package/dist/registry-types.d.ts +106 -0
- package/dist/registry-types.d.ts.map +1 -0
- package/dist/registry-types.js +2 -0
- package/dist/registry-types.js.map +1 -0
- package/dist/registry.d.ts +52 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +95 -0
- package/dist/registry.js.map +1 -0
- package/dist/scan.d.ts +19 -0
- package/dist/scan.d.ts.map +1 -0
- package/dist/scan.js +29 -0
- package/dist/scan.js.map +1 -0
- package/dist/search.d.ts +16 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +75 -0
- package/dist/search.js.map +1 -0
- package/dist/skill-template.d.ts +24 -0
- package/dist/skill-template.d.ts.map +1 -0
- package/dist/skill-template.js +140 -0
- package/dist/skill-template.js.map +1 -0
- package/greenharness.toml +38 -0
- package/package.json +76 -4
- package/registry.json +12893 -0
- package/skills/colors/LICENSE +21 -0
- package/skills/colors/NOTICE.md +36 -0
- package/skills/colors/SKILL.md +101 -0
- package/skills/colors/color-formats.md +90 -0
- package/skills/colors/color-usage.md +109 -0
- package/skills/colors/contrast.md +70 -0
- package/skills/colors/palette-generation.md +108 -0
- package/skills/colors/palette-structure.md +72 -0
- package/skills/colors/token-naming.md +99 -0
- package/skills/greenrack-mockup/SKILL.md +115 -0
- package/skills/typography/LICENSE +21 -0
- package/skills/typography/NOTICE.md +36 -0
- package/skills/typography/SKILL.md +171 -0
- package/skills/typography/choosing-fonts.md +53 -0
- package/skills/typography/css-cheat-sheet.md +67 -0
- package/skills/typography/details-and-accessibility.md +84 -0
- package/skills/typography/spacing-and-sizing.md +87 -0
- package/skills/typography/variable-fonts-and-opentype.md +100 -0
- package/skills/typography/wrapping-and-punctuation.md +23 -0
- package/skills/ui/LICENSE +21 -0
- package/skills/ui/NOTICE.md +38 -0
- package/skills/ui/SKILL.md +141 -0
- package/skills/ui/animations.md +170 -0
- package/skills/ui/enter-exit.md +157 -0
- package/skills/ui/icon-transitions.md +72 -0
- package/skills/ui/icons.md +105 -0
- package/skills/ui/performance.md +63 -0
- package/skills/ui/surfaces.md +166 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Registry } from './registry-types.js';
|
|
2
|
+
/** `greenrack mockup <sub>`: the spec owns the names, the command dispatches on them. */
|
|
3
|
+
export declare const MOCKUP_SUBCOMMANDS: string[];
|
|
4
|
+
/**
|
|
5
|
+
* The single command spec. CLI dispatch, --help text, and MCP tool
|
|
6
|
+
* registration all derive from this object — one place to add a command.
|
|
7
|
+
*/
|
|
8
|
+
export interface CommandSpec {
|
|
9
|
+
name: string;
|
|
10
|
+
summary: string;
|
|
11
|
+
args: Array<{
|
|
12
|
+
name: string;
|
|
13
|
+
required: boolean;
|
|
14
|
+
description: string;
|
|
15
|
+
valuesFrom?: string;
|
|
16
|
+
}>;
|
|
17
|
+
flags: Array<{
|
|
18
|
+
name: string;
|
|
19
|
+
type: 'boolean' | 'string';
|
|
20
|
+
description: string;
|
|
21
|
+
}>;
|
|
22
|
+
returns: {
|
|
23
|
+
shape: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
examples: string[];
|
|
27
|
+
mcpTool?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const COMMANDS: CommandSpec[];
|
|
30
|
+
export declare function buildManifest(registry: Registry, version: string): {
|
|
31
|
+
name: string;
|
|
32
|
+
bin: string;
|
|
33
|
+
version: string;
|
|
34
|
+
schemaVersion: 1;
|
|
35
|
+
description: string;
|
|
36
|
+
usage: string;
|
|
37
|
+
globalFlags: {
|
|
38
|
+
name: string;
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
}[];
|
|
42
|
+
commands: CommandSpec[];
|
|
43
|
+
enums: {
|
|
44
|
+
names: string[];
|
|
45
|
+
kinds: string[];
|
|
46
|
+
events: string[];
|
|
47
|
+
mockupActions: string[];
|
|
48
|
+
skillActions: string[];
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAA;AAGjD,yFAAyF;AACzF,eAAO,MAAM,kBAAkB,UAA8B,CAAA;AAE7D;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC,CAAA;IACxF,KAAK,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAC,CAAC,CAAA;IAC7E,OAAO,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAC,CAAA;IAC7C,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,QAAQ,EAAE,WAAW,EA4NjC,CAAA;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;EAsBhE"}
|
package/dist/manifest.js
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { lookupNames } from './registry.js';
|
|
2
|
+
/** `greenrack mockup <sub>`: the spec owns the names, the command dispatches on them. */
|
|
3
|
+
export const MOCKUP_SUBCOMMANDS = ['seed', 'check', 'canvas'];
|
|
4
|
+
export const COMMANDS = [
|
|
5
|
+
{
|
|
6
|
+
name: 'lookup',
|
|
7
|
+
summary: 'Docs for anything by name: a component (props, usage, example), a recipe (runnable source), a token group, or the rules. Unknown names fall back to full-text search over the usage metadata.',
|
|
8
|
+
args: [
|
|
9
|
+
{
|
|
10
|
+
name: 'name',
|
|
11
|
+
required: true,
|
|
12
|
+
description: 'Component (Button), recipe (login-form), token group (spacing), icons, rules — or free text to search',
|
|
13
|
+
valuesFrom: 'names',
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
flags: [
|
|
17
|
+
{ name: 'part', type: 'string', description: 'Narrow a compound component to one part' },
|
|
18
|
+
{ name: 'props', type: 'boolean', description: 'Prop table only' },
|
|
19
|
+
{ name: 'source-only', type: 'boolean', description: 'Recipes: emit just the source file' },
|
|
20
|
+
],
|
|
21
|
+
returns: {
|
|
22
|
+
shape: 'ComponentEntry | RecipeEntry | TokenGroup | IconRegistry | RulesRegistry | SearchHit[]',
|
|
23
|
+
description: 'The registry entry, or ranked search hits when the name did not match',
|
|
24
|
+
},
|
|
25
|
+
examples: [
|
|
26
|
+
'greenrack Button',
|
|
27
|
+
'greenrack Select --part Root',
|
|
28
|
+
'greenrack login-form --source-only',
|
|
29
|
+
'greenrack "tags that wrap"',
|
|
30
|
+
],
|
|
31
|
+
mcpTool: 'greenrack_lookup',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'list',
|
|
35
|
+
summary: 'One-line index of everything documented',
|
|
36
|
+
args: [
|
|
37
|
+
{
|
|
38
|
+
name: 'kind',
|
|
39
|
+
required: false,
|
|
40
|
+
description: 'components | recipes | tokens (default: all)',
|
|
41
|
+
valuesFrom: 'kinds',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
flags: [],
|
|
45
|
+
returns: { shape: 'ListEntry[]', description: '{name, kind, importPath?, description}' },
|
|
46
|
+
examples: ['greenrack list', 'greenrack list recipes --json'],
|
|
47
|
+
mcpTool: 'greenrack_list',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'manifest',
|
|
51
|
+
summary: 'This command spec plus all valid lookup names — the one-call agent bootstrap',
|
|
52
|
+
args: [],
|
|
53
|
+
flags: [],
|
|
54
|
+
returns: { shape: 'Manifest', description: 'Commands, flags, shapes, and enums of valid names' },
|
|
55
|
+
examples: ['greenrack manifest --json'],
|
|
56
|
+
mcpTool: 'greenrack_manifest',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'hook',
|
|
60
|
+
summary: 'Claude Code hooks: session-start prints the consult-first preamble + full catalog; install wires it (SessionStart) plus a plan-mode mockup nudge (UserPromptSubmit) into the current repo',
|
|
61
|
+
args: [
|
|
62
|
+
{
|
|
63
|
+
name: 'event',
|
|
64
|
+
required: true,
|
|
65
|
+
description: 'session-start (print the bootstrap) | install (wire both hooks into this repo)',
|
|
66
|
+
valuesFrom: 'events',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
flags: [
|
|
70
|
+
{
|
|
71
|
+
name: 'check',
|
|
72
|
+
type: 'boolean',
|
|
73
|
+
description: 'install: report drift and exit 1 instead of writing (for CI)',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
returns: {
|
|
77
|
+
shape: '{preamble: string, entries: ListEntry[]} | {ok: boolean, changes: FileChange[]}',
|
|
78
|
+
description: 'session-start: the preamble plus the same entries as greenrack list. install: what each wired file did',
|
|
79
|
+
},
|
|
80
|
+
examples: [
|
|
81
|
+
'greenrack hook session-start',
|
|
82
|
+
'greenrack hook install',
|
|
83
|
+
'greenrack hook install --check',
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'skill',
|
|
88
|
+
summary: 'Claude Code skills — /greenrack-mockup (the mockup → implementation → proof workflow) plus the colors, typography and ui interface skills; install writes all four into the current repo; --force overwrites a skill directory of your own and removes the files in it that the package does not ship',
|
|
89
|
+
args: [
|
|
90
|
+
{
|
|
91
|
+
name: 'action',
|
|
92
|
+
required: true,
|
|
93
|
+
description: 'install (write .claude/skills/{greenrack-mockup,colors,typography,ui}/)',
|
|
94
|
+
valuesFrom: 'skillActions',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
flags: [
|
|
98
|
+
{
|
|
99
|
+
name: 'check',
|
|
100
|
+
type: 'boolean',
|
|
101
|
+
description: 'install: report drift and exit 1 instead of writing (for CI)',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'force',
|
|
105
|
+
type: 'boolean',
|
|
106
|
+
description: 'install: with --force, write into an existing colors, typography or ui skill directory that lacks the shipped NOTICE.md (a skill of your own); without --force install refuses. --force also removes the files of that overwritten directory the package does not ship',
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
returns: {
|
|
110
|
+
shape: '{ok: boolean, changes: FileChange[]}',
|
|
111
|
+
description: 'What each wired file did: written, unchanged, stale or removed',
|
|
112
|
+
},
|
|
113
|
+
examples: ['greenrack skill install', 'greenrack skill install --check'],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'mockup',
|
|
117
|
+
summary: 'Token-seeded mockup artboards: seed writes a .dc.html whose only design vocabulary is the resolved token block; check refuses raw colours/values and controls that name no component; canvas writes one review page of every direction in a directory, refusing any artboard that fails check',
|
|
118
|
+
args: [
|
|
119
|
+
{
|
|
120
|
+
name: 'action',
|
|
121
|
+
required: true,
|
|
122
|
+
description: 'seed (write <Name>.dc.html) | check <file.dc.html>... (exit 1 on findings) | canvas <dir> (write the review page; exit 1 on findings)',
|
|
123
|
+
valuesFrom: 'mockupActions',
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
flags: [
|
|
127
|
+
{
|
|
128
|
+
name: 'out',
|
|
129
|
+
type: 'string',
|
|
130
|
+
description: 'seed: directory (default docs/mockups/<name>); canvas: the page (default <dir>/canvas.html)',
|
|
131
|
+
},
|
|
132
|
+
{ name: 'name', type: 'string', description: 'seed: artboard stem (default Main)' },
|
|
133
|
+
{
|
|
134
|
+
name: 'theme',
|
|
135
|
+
type: 'string',
|
|
136
|
+
description: 'seed: dark (default) | light | high-contrast — sets <html data-theme>',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'overrides',
|
|
140
|
+
type: 'string',
|
|
141
|
+
description: 'seed: a theme JSON file, the tokens shape ThemeProvider takes ({colors?, typography?, radii?, sizes?, … for every themable group}, or a flat map of colour keys), validated by @greenharness/greenrack-tokens/theme and written into the token block as --gr-<group>-<key> rules',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'title',
|
|
145
|
+
type: 'string',
|
|
146
|
+
description: 'canvas: the page title (default "<dir> directions")',
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
returns: {
|
|
150
|
+
shape: '{ok: boolean, path: string} | {ok: boolean, findings: Finding[], skew?: {own, installed}} | {ok: boolean, path: string, artboards: number, skew?: {own, installed}}',
|
|
151
|
+
description: 'seed: where it wrote. check: {file, line, rule, message} per finding — raw-color, raw-length, raw-breakpoint, unknown-component, no-component-map, unannotated-control',
|
|
152
|
+
},
|
|
153
|
+
examples: [
|
|
154
|
+
'greenrack mockup seed --name Main --out docs/mockups/approvals',
|
|
155
|
+
'greenrack mockup check docs/mockups/approvals/*.dc.html',
|
|
156
|
+
'greenrack mockup check Main.dc.html --json',
|
|
157
|
+
'greenrack mockup canvas docs/mockups/approvals',
|
|
158
|
+
],
|
|
159
|
+
mcpTool: 'greenrack_mockup_check',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'context',
|
|
163
|
+
summary: 'The design-system session context for the repo in the cwd: the catalog that `hook session-start` prints, then the `doctor --session` block (re-run only when the build files change; cached under ${XDG_CACHE_HOME:-~/.cache}/greenrack). Prints nothing outside a greenrack consumer. Exits 0',
|
|
164
|
+
args: [],
|
|
165
|
+
flags: [
|
|
166
|
+
{
|
|
167
|
+
name: 'catalog-only',
|
|
168
|
+
type: 'boolean',
|
|
169
|
+
description: 'Leave the doctor block out',
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
returns: {
|
|
173
|
+
shape: '{preamble, entries, contrast, composition, doctor?: string} | {consumer: false}',
|
|
174
|
+
description: 'The catalog data, plus the doctor session text unless --catalog-only',
|
|
175
|
+
},
|
|
176
|
+
examples: ['greenrack context', 'greenrack context --catalog-only'],
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: 'doctor',
|
|
180
|
+
summary: "Check how the app in the cwd wires @greenharness/greenrack-ui into its build: runtimeInjection left on, unlayered StyleX extraction, the stylesheet missing from the entry, layers declared out of order, unlayered resets. Each one flattens component spacing while the design system's own CSS is fine. It also flags a StyleX build that never compiles @greenharness/greenrack-tokens, so css.create cannot import the tokens, and fresh built CSS whose @media reads a var() (media-var). Exits 1 on an error, 0 on warnings",
|
|
181
|
+
args: [],
|
|
182
|
+
flags: [
|
|
183
|
+
{
|
|
184
|
+
name: 'session',
|
|
185
|
+
type: 'boolean',
|
|
186
|
+
description: 'SessionStart mode: silent when healthy, an agent-facing block otherwise, always exit 0',
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
returns: {
|
|
190
|
+
shape: '{ok: boolean, findings: DoctorFinding[], checked: string[]}',
|
|
191
|
+
description: '{rule, severity, file, line?, message, fix} per finding — runtime-injection, layered-extraction, css-imported, css-load-order, unlayered-reset, version-skew. Exit 1 on any error',
|
|
192
|
+
},
|
|
193
|
+
examples: ['greenrack doctor', 'greenrack doctor --json', 'greenrack doctor --session'],
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: 'mcp',
|
|
197
|
+
summary: 'Run a stdio MCP server exposing greenrack_lookup / greenrack_list / greenrack_manifest / greenrack_mockup_check / greenrack_mockup_canvas',
|
|
198
|
+
args: [],
|
|
199
|
+
flags: [],
|
|
200
|
+
returns: { shape: 'never', description: 'Serves until stdin closes' },
|
|
201
|
+
examples: [
|
|
202
|
+
'claude mcp add greenrack -- npx -y -p @greenharness/greenrack-cli -p @modelcontextprotocol/sdk greenrack mcp',
|
|
203
|
+
],
|
|
204
|
+
},
|
|
205
|
+
];
|
|
206
|
+
export function buildManifest(registry, version) {
|
|
207
|
+
return {
|
|
208
|
+
name: '@greenharness/greenrack-cli',
|
|
209
|
+
bin: 'greenrack',
|
|
210
|
+
version,
|
|
211
|
+
schemaVersion: registry.schemaVersion,
|
|
212
|
+
description: 'Machine-queryable docs for the greenrack design system.',
|
|
213
|
+
usage: 'greenrack <name|command> [flags] [--json]',
|
|
214
|
+
globalFlags: [
|
|
215
|
+
{ name: 'json', type: 'boolean', description: 'Emit JSON on stdout' },
|
|
216
|
+
{ name: 'no-color', type: 'boolean', description: 'Disable ANSI styling' },
|
|
217
|
+
],
|
|
218
|
+
commands: COMMANDS,
|
|
219
|
+
enums: {
|
|
220
|
+
// Guides are fetched by name (guide:<skill>) and stay out of the manifest.
|
|
221
|
+
names: lookupNames(registry).filter((name) => !name.startsWith('guide:')),
|
|
222
|
+
kinds: ['components', 'recipes', 'tokens'],
|
|
223
|
+
events: ['session-start', 'install'],
|
|
224
|
+
mockupActions: MOCKUP_SUBCOMMANDS,
|
|
225
|
+
skillActions: ['install'],
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AAEzC,yFAAyF;AACzF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;AAgB7D,MAAM,CAAC,MAAM,QAAQ,GAAkB;IACrC;QACE,IAAI,EAAE,QAAQ;QACd,OAAO,EACL,+LAA+L;QACjM,IAAI,EAAE;YACJ;gBACE,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,IAAI;gBACd,WAAW,EACT,uGAAuG;gBACzG,UAAU,EAAE,OAAO;aACpB;SACF;QACD,KAAK,EAAE;YACL,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yCAAyC,EAAC;YACtF,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,iBAAiB,EAAC;YAChE,EAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,oCAAoC,EAAC;SAC1F;QACD,OAAO,EAAE;YACP,KAAK,EACH,wFAAwF;YAC1F,WAAW,EAAE,uEAAuE;SACrF;QACD,QAAQ,EAAE;YACR,kBAAkB;YAClB,8BAA8B;YAC9B,oCAAoC;YACpC,4BAA4B;SAC7B;QACD,OAAO,EAAE,kBAAkB;KAC5B;IACD;QACE,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,yCAAyC;QAClD,IAAI,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2EAA2E;YAC3E,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YACzE,KAAK,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,CAAC;YAC1C,MAAM,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC;YACpC,aAAa,EAAE,kBAAkB;YACjC,YAAY,EAAE,CAAC,SAAS,CAAC;SAC1B;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { ComponentMeta } from '@greenharness/greenrack-ui/component-meta';
|
|
2
|
+
export type { ComponentMeta };
|
|
3
|
+
export interface Registry {
|
|
4
|
+
/** Incompatible-shape counter. Consumers should refuse unknown versions. */
|
|
5
|
+
schemaVersion: 1;
|
|
6
|
+
components: Record<string, ComponentEntry>;
|
|
7
|
+
recipes: Record<string, RecipeEntry>;
|
|
8
|
+
tokens: TokenRegistry;
|
|
9
|
+
icons: IconRegistry;
|
|
10
|
+
rules: RulesRegistry;
|
|
11
|
+
/** Exported string-literal unions: ButtonVariant -> ['primary', ...]. */
|
|
12
|
+
unions: Record<string, string[]>;
|
|
13
|
+
/**
|
|
14
|
+
* The packaged interface skills (packages/cli/skills): skill name -> relative
|
|
15
|
+
* path -> file text. Absent in a registry built before guides existed.
|
|
16
|
+
*/
|
|
17
|
+
guides?: Record<string, Record<string, string>>;
|
|
18
|
+
}
|
|
19
|
+
export type ComponentKind = 'component' | 'compound' | 'provider' | 'hook' | 'function';
|
|
20
|
+
export interface ComponentEntry {
|
|
21
|
+
name: string;
|
|
22
|
+
kind: ComponentKind;
|
|
23
|
+
importPath: string;
|
|
24
|
+
/** Repo-relative POSIX path of the defining source file. */
|
|
25
|
+
sourcePath: string;
|
|
26
|
+
meta: ComponentMeta | null;
|
|
27
|
+
/** null for compound components — see `parts`. */
|
|
28
|
+
props: PropEntry[] | null;
|
|
29
|
+
parts?: Record<string, PartEntry>;
|
|
30
|
+
deprecated?: string;
|
|
31
|
+
/** Root `@greenharness/greenrack-ui` components only: exported on React Native (index.native.ts). */
|
|
32
|
+
native?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface PartEntry {
|
|
35
|
+
name: string;
|
|
36
|
+
sourcePath: string;
|
|
37
|
+
props: PropEntry[];
|
|
38
|
+
deprecated?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface PropEntry {
|
|
41
|
+
name: string;
|
|
42
|
+
/** Syntactic type text — the name a consumer should actually write. */
|
|
43
|
+
type: string;
|
|
44
|
+
required: boolean;
|
|
45
|
+
/** Verbatim initializer from the destructuring default. */
|
|
46
|
+
default?: string;
|
|
47
|
+
/** JSDoc description, collapsed to one paragraph. */
|
|
48
|
+
description?: string;
|
|
49
|
+
deprecated?: string;
|
|
50
|
+
/** Resolved members when `type` names an exported string-literal union. */
|
|
51
|
+
union?: string[];
|
|
52
|
+
}
|
|
53
|
+
export interface RecipeEntry {
|
|
54
|
+
name: string;
|
|
55
|
+
title: string;
|
|
56
|
+
/** The exported component function name. */
|
|
57
|
+
export: string;
|
|
58
|
+
meta: ComponentMeta;
|
|
59
|
+
/** Full source with imports rewritten to publishable specifiers. */
|
|
60
|
+
source: string;
|
|
61
|
+
sourcePath: string;
|
|
62
|
+
usesComponents: string[];
|
|
63
|
+
peerDeps: string[];
|
|
64
|
+
}
|
|
65
|
+
export interface TokenRegistry {
|
|
66
|
+
groups: Record<string, TokenGroup>;
|
|
67
|
+
/**
|
|
68
|
+
* The tokens as resolved CSS custom properties, every theme, for HTML that
|
|
69
|
+
* loads no stylesheet (`greenrack mockup seed` inlines it). Same names as
|
|
70
|
+
* `@greenharness/greenrack-tokens/vars.css`; generated by packages/tokens.
|
|
71
|
+
*/
|
|
72
|
+
mockupCss: string;
|
|
73
|
+
}
|
|
74
|
+
export interface TokenGroup {
|
|
75
|
+
/** The deep import a consumer must copy. */
|
|
76
|
+
importPath: string;
|
|
77
|
+
exportName: string;
|
|
78
|
+
entries: TokenEntry[];
|
|
79
|
+
}
|
|
80
|
+
export interface TokenEntry {
|
|
81
|
+
key: string;
|
|
82
|
+
value?: string | number;
|
|
83
|
+
/** Per-theme values (colors group). */
|
|
84
|
+
values?: Record<string, string>;
|
|
85
|
+
}
|
|
86
|
+
export interface IconRegistry {
|
|
87
|
+
names: string[];
|
|
88
|
+
sizes: Record<string, number>;
|
|
89
|
+
groups: Array<{
|
|
90
|
+
label: string | null;
|
|
91
|
+
names: string[];
|
|
92
|
+
}>;
|
|
93
|
+
}
|
|
94
|
+
export interface RulesRegistry {
|
|
95
|
+
/** Markdown slice lifted verbatim from CLAUDE.md's greenrack:rules region. */
|
|
96
|
+
critical: string;
|
|
97
|
+
lint: LintRule[];
|
|
98
|
+
}
|
|
99
|
+
export interface LintRule {
|
|
100
|
+
id: string;
|
|
101
|
+
severity: 'error' | 'warn' | 'off';
|
|
102
|
+
description: string;
|
|
103
|
+
fixable: 'autofix' | 'suggestion' | 'none';
|
|
104
|
+
messages: Record<string, string>;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=registry-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-types.d.ts","sourceRoot":"","sources":["../src/registry-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,2CAA2C,CAAA;AAE5E,YAAY,EAAC,aAAa,EAAC,CAAA;AAE3B,MAAM,WAAW,QAAQ;IACvB,4EAA4E;IAC5E,aAAa,EAAE,CAAC,CAAA;IAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAC1C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IACpC,MAAM,EAAE,aAAa,CAAA;IACrB,KAAK,EAAE,YAAY,CAAA;IACnB,KAAK,EAAE,aAAa,CAAA;IACpB,yEAAyE;IACzE,MAAM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AAO,EAAE,SAAS,GAAG,YAAY,GAAG,MAAM,CAAA;IAC1C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-types.js","sourceRoot":"","sources":["../src/registry-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Registry } from './registry-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Load the registry shipped next to dist/. readFileSync + JSON.parse rather
|
|
4
|
+
* than a JSON import — import attributes aren't stable across the supported
|
|
5
|
+
* Node range.
|
|
6
|
+
*/
|
|
7
|
+
export declare function loadRegistry(): Registry;
|
|
8
|
+
export type LookupResult = {
|
|
9
|
+
kind: 'component';
|
|
10
|
+
key: string;
|
|
11
|
+
entry: Registry['components'][string];
|
|
12
|
+
} | {
|
|
13
|
+
kind: 'recipe';
|
|
14
|
+
key: string;
|
|
15
|
+
entry: Registry['recipes'][string];
|
|
16
|
+
} | {
|
|
17
|
+
kind: 'tokens';
|
|
18
|
+
key: string;
|
|
19
|
+
entry: Registry['tokens']['groups'][string];
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'icons';
|
|
22
|
+
key: string;
|
|
23
|
+
entry: Registry['icons'];
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'rules';
|
|
26
|
+
key: string;
|
|
27
|
+
entry: Registry['rules'];
|
|
28
|
+
} | {
|
|
29
|
+
kind: 'guide';
|
|
30
|
+
key: string;
|
|
31
|
+
skill: string;
|
|
32
|
+
file: string;
|
|
33
|
+
content: string;
|
|
34
|
+
};
|
|
35
|
+
export declare const GUIDE_PREFIX = "guide:";
|
|
36
|
+
export type GuideLookup = {
|
|
37
|
+
ok: true;
|
|
38
|
+
skill: string;
|
|
39
|
+
file: string;
|
|
40
|
+
content: string;
|
|
41
|
+
} | {
|
|
42
|
+
ok: false;
|
|
43
|
+
message: string;
|
|
44
|
+
};
|
|
45
|
+
/** `guide:<skill>` is the skill's SKILL.md; `guide:<skill>/<file>` is one of its files. */
|
|
46
|
+
export declare function lookupGuide(registry: Registry, name: string): GuideLookup;
|
|
47
|
+
/** Lookup names of the guides: `guide:<skill>` and `guide:<skill>/<file>` for the rest. */
|
|
48
|
+
export declare function guideNames(registry: Registry): string[];
|
|
49
|
+
/** All lookup names, for suggestions and the manifest's enums. */
|
|
50
|
+
export declare function lookupNames(registry: Registry): string[];
|
|
51
|
+
export declare function lookup(registry: Registry, name: string): LookupResult | null;
|
|
52
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAA;AAIjD;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,QAAQ,CAkBvC;AAED,MAAM,MAAM,YAAY,GACpB;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;CAAC,GACvE;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAA;CAAC,GACjE;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;CAAC,GAC1E;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;CAAC,GACtD;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;CAAC,GACtD;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAA;AAE9E,eAAO,MAAM,YAAY,WAAW,CAAA;AAGpC,MAAM,MAAM,WAAW,GACnB;IAAC,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,GACxD;IAAC,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAA;AAEhC,2FAA2F;AAC3F,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAwBzE;AAED,2FAA2F;AAC3F,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,EAAE,CAMvD;AAED,kEAAkE;AAClE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,EAAE,CASxD;AAED,wBAAgB,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAoB5E"}
|
package/dist/registry.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
let cached = null;
|
|
3
|
+
/**
|
|
4
|
+
* Load the registry shipped next to dist/. readFileSync + JSON.parse rather
|
|
5
|
+
* than a JSON import — import attributes aren't stable across the supported
|
|
6
|
+
* Node range.
|
|
7
|
+
*/
|
|
8
|
+
export function loadRegistry() {
|
|
9
|
+
if (cached)
|
|
10
|
+
return cached;
|
|
11
|
+
const url = new URL('../registry.json', import.meta.url);
|
|
12
|
+
let parsed;
|
|
13
|
+
try {
|
|
14
|
+
parsed = JSON.parse(readFileSync(url, 'utf8'));
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
process.stderr.write(`greenrack: cannot read registry at ${url.pathname}: ${String(error)}\n`);
|
|
18
|
+
process.exit(3);
|
|
19
|
+
}
|
|
20
|
+
if (parsed.schemaVersion !== 1) {
|
|
21
|
+
process.stderr.write(`greenrack: registry schemaVersion ${String(parsed.schemaVersion)} is not supported by this CLI — update @greenharness/greenrack-cli\n`);
|
|
22
|
+
process.exit(3);
|
|
23
|
+
}
|
|
24
|
+
cached = parsed;
|
|
25
|
+
return parsed;
|
|
26
|
+
}
|
|
27
|
+
export const GUIDE_PREFIX = 'guide:';
|
|
28
|
+
const GUIDE_ENTRY = 'SKILL.md';
|
|
29
|
+
/** `guide:<skill>` is the skill's SKILL.md; `guide:<skill>/<file>` is one of its files. */
|
|
30
|
+
export function lookupGuide(registry, name) {
|
|
31
|
+
const guides = registry.guides;
|
|
32
|
+
const spec = name.slice(GUIDE_PREFIX.length);
|
|
33
|
+
const slash = spec.indexOf('/');
|
|
34
|
+
const skill = slash === -1 ? spec : spec.slice(0, slash);
|
|
35
|
+
const file = slash === -1 ? GUIDE_ENTRY : spec.slice(slash + 1);
|
|
36
|
+
if (!guides || Object.keys(guides).length === 0) {
|
|
37
|
+
return { ok: false, message: `unknown guide "${skill}" — this registry has no guides` };
|
|
38
|
+
}
|
|
39
|
+
const files = guides[skill];
|
|
40
|
+
if (!files) {
|
|
41
|
+
return {
|
|
42
|
+
ok: false,
|
|
43
|
+
message: `unknown guide "${skill}" — guides: ${Object.keys(guides).join(', ')}`,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const content = files[file];
|
|
47
|
+
if (content === undefined) {
|
|
48
|
+
return {
|
|
49
|
+
ok: false,
|
|
50
|
+
message: `unknown file "${file}" in guide "${skill}" — files: ${Object.keys(files).join(', ')}`,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return { ok: true, skill, file, content };
|
|
54
|
+
}
|
|
55
|
+
/** Lookup names of the guides: `guide:<skill>` and `guide:<skill>/<file>` for the rest. */
|
|
56
|
+
export function guideNames(registry) {
|
|
57
|
+
return Object.entries(registry.guides ?? {}).flatMap(([skill, files]) => Object.keys(files).map((file) => file === GUIDE_ENTRY ? `${GUIDE_PREFIX}${skill}` : `${GUIDE_PREFIX}${skill}/${file}`));
|
|
58
|
+
}
|
|
59
|
+
/** All lookup names, for suggestions and the manifest's enums. */
|
|
60
|
+
export function lookupNames(registry) {
|
|
61
|
+
return [
|
|
62
|
+
...Object.keys(registry.components),
|
|
63
|
+
...Object.keys(registry.recipes),
|
|
64
|
+
...Object.keys(registry.tokens.groups),
|
|
65
|
+
'icons',
|
|
66
|
+
'rules',
|
|
67
|
+
...guideNames(registry),
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
export function lookup(registry, name) {
|
|
71
|
+
// Resolved first: typography, colors and spacing are also token-group names.
|
|
72
|
+
if (name.startsWith(GUIDE_PREFIX)) {
|
|
73
|
+
const guide = lookupGuide(registry, GUIDE_PREFIX + name.slice(GUIDE_PREFIX.length));
|
|
74
|
+
return guide.ok ? { kind: 'guide', key: name, ...guide } : null;
|
|
75
|
+
}
|
|
76
|
+
if (name === 'rules')
|
|
77
|
+
return { kind: 'rules', key: name, entry: registry.rules };
|
|
78
|
+
if (name === 'icons')
|
|
79
|
+
return { kind: 'icons', key: name, entry: registry.icons };
|
|
80
|
+
if (registry.components[name]) {
|
|
81
|
+
return { kind: 'component', key: name, entry: registry.components[name] };
|
|
82
|
+
}
|
|
83
|
+
if (registry.recipes[name])
|
|
84
|
+
return { kind: 'recipe', key: name, entry: registry.recipes[name] };
|
|
85
|
+
if (registry.tokens.groups[name]) {
|
|
86
|
+
return { kind: 'tokens', key: name, entry: registry.tokens.groups[name] };
|
|
87
|
+
}
|
|
88
|
+
// Case-insensitive exact fallback (greenrack button).
|
|
89
|
+
const lower = name.toLowerCase();
|
|
90
|
+
const ciKey = lookupNames(registry).find((candidate) => candidate.toLowerCase() === lower);
|
|
91
|
+
if (ciKey && ciKey !== name)
|
|
92
|
+
return lookup(registry, ciKey);
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAA;AAGpC,IAAI,MAAM,GAAoB,IAAI,CAAA;AAElC;;;;GAIG;AACH,MAAM,UAAU,YAAY;IAC1B,IAAI,MAAM;QAAE,OAAO,MAAM,CAAA;IACzB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACxD,IAAI,MAAgB,CAAA;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,CAAa,CAAA;IAC5D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,sCAAsC,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IACD,IAAI,MAAM,CAAC,aAAa,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,qCAAqC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,sEAAsE,CACxI,CAAA;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IACD,MAAM,GAAG,MAAM,CAAA;IACf,OAAO,MAAM,CAAA;AACf,CAAC;AAUD,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAA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AK,CAAC,CAAA;IAC1F,IAAI,KAAK,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAC3D,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/dist/scan.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Offset-preserving text helpers shared by the file checkers (mockup check,
|
|
3
|
+
* doctor). They scan with regexes over masked source rather than parse, which
|
|
4
|
+
* keeps the CLI free of runtime dependencies — it runs under npx at session
|
|
5
|
+
* start, where every dependency is install time.
|
|
6
|
+
*/
|
|
7
|
+
/** 1-based line number of an offset. */
|
|
8
|
+
export declare function lineOf(source: string, index: number): number;
|
|
9
|
+
/**
|
|
10
|
+
* Blank out comments, keeping offsets, so prose that mentions a setting
|
|
11
|
+
* ("never set runtimeInjection: true") is never read as the setting.
|
|
12
|
+
* `line` also masks `//` comments (JS/TS); CSS has only block comments.
|
|
13
|
+
* String literals are skipped over, not masked, so a `//` inside a URL
|
|
14
|
+
* survives while the string's own content stays matchable.
|
|
15
|
+
*/
|
|
16
|
+
export declare function maskComments(source: string, { line }: {
|
|
17
|
+
line: boolean;
|
|
18
|
+
}): string;
|
|
19
|
+
//# sourceMappingURL=scan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../src/scan.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,wCAAwC;AACxC,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAI5D;AAID;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,EAAC,IAAI,EAAC,EAAE;IAAC,IAAI,EAAE,OAAO,CAAA;CAAC,GAAG,MAAM,CAO5E"}
|
package/dist/scan.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Offset-preserving text helpers shared by the file checkers (mockup check,
|
|
3
|
+
* doctor). They scan with regexes over masked source rather than parse, which
|
|
4
|
+
* keeps the CLI free of runtime dependencies — it runs under npx at session
|
|
5
|
+
* start, where every dependency is install time.
|
|
6
|
+
*/
|
|
7
|
+
/** 1-based line number of an offset. */
|
|
8
|
+
export function lineOf(source, index) {
|
|
9
|
+
let line = 1;
|
|
10
|
+
for (let i = 0; i < index && i < source.length; i++)
|
|
11
|
+
if (source[i] === '\n')
|
|
12
|
+
line++;
|
|
13
|
+
return line;
|
|
14
|
+
}
|
|
15
|
+
const blank = (text) => text.replace(/[^\n]/g, ' ');
|
|
16
|
+
/**
|
|
17
|
+
* Blank out comments, keeping offsets, so prose that mentions a setting
|
|
18
|
+
* ("never set runtimeInjection: true") is never read as the setting.
|
|
19
|
+
* `line` also masks `//` comments (JS/TS); CSS has only block comments.
|
|
20
|
+
* String literals are skipped over, not masked, so a `//` inside a URL
|
|
21
|
+
* survives while the string's own content stays matchable.
|
|
22
|
+
*/
|
|
23
|
+
export function maskComments(source, { line }) {
|
|
24
|
+
const re = line
|
|
25
|
+
? /("(?:\\.|[^"\\\n])*"|'(?:\\.|[^'\\\n])*'|`(?:\\.|[^`\\])*`)|\/\*[\s\S]*?\*\/|\/\/[^\n]*/g
|
|
26
|
+
: /("(?:\\.|[^"\\\n])*"|'(?:\\.|[^'\\\n])*')|\/\*[\s\S]*?\*\//g;
|
|
27
|
+
return source.replace(re, (match, literal) => literal === undefined ? blank(match) : match);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=scan.js.map
|
package/dist/scan.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../src/scan.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,wCAAwC;AACxC,MAAM,UAAU,MAAM,CAAC,MAAc,EAAE,KAAa;IAClD,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI;YAAE,IAAI,EAAE,CAAA;IACnF,OAAO,IAAI,CAAA;AACb,CAAC;AAED,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AAE3D;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,EAAC,IAAI,EAAkB;IAClE,MAAM,EAAE,GAAG,IAAI;QACb,CAAC,CAAC,0FAA0F;QAC5F,CAAC,CAAC,6DAA6D,CAAA;IACjE,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,OAA2B,EAAE,EAAE,CAC/D,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAC7C,CAAA;AACH,CAAC"}
|
package/dist/search.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Registry } from './registry-types.js';
|
|
2
|
+
export declare function levenshtein(a: string, b: string): number;
|
|
3
|
+
/** Closest names for "did you mean" — distance <= 2, best first. */
|
|
4
|
+
export declare function suggestions(registry: Registry, query: string): string[];
|
|
5
|
+
export interface SearchHit {
|
|
6
|
+
kind: 'component' | 'recipe';
|
|
7
|
+
key: string;
|
|
8
|
+
description: string;
|
|
9
|
+
score: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Full-text need-search over metas: agents rarely know the name — they know
|
|
13
|
+
* the need, and whenToUse text is exactly need-phrased.
|
|
14
|
+
*/
|
|
15
|
+
export declare function search(registry: Registry, query: string): SearchHit[];
|
|
16
|
+
//# sourceMappingURL=search.d.ts.map
|