web-stylebook-mcp 0.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/LICENSE +21 -0
- package/README.md +100 -0
- package/dist/catalog/repository.d.ts +72 -0
- package/dist/catalog/repository.js +111 -0
- package/dist/catalog/repository.js.map +1 -0
- package/dist/catalog/validate.d.ts +7 -0
- package/dist/catalog/validate.js +49 -0
- package/dist/catalog/validate.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +59 -0
- package/dist/cli.js.map +1 -0
- package/dist/localization.d.ts +5 -0
- package/dist/localization.js +10 -0
- package/dist/localization.js.map +1 -0
- package/dist/protocol/errors.d.ts +20 -0
- package/dist/protocol/errors.js +46 -0
- package/dist/protocol/errors.js.map +1 -0
- package/dist/protocol/register-prompts.d.ts +2 -0
- package/dist/protocol/register-prompts.js +76 -0
- package/dist/protocol/register-prompts.js.map +1 -0
- package/dist/protocol/register-resources.d.ts +3 -0
- package/dist/protocol/register-resources.js +85 -0
- package/dist/protocol/register-resources.js.map +1 -0
- package/dist/protocol/register-tools.d.ts +3 -0
- package/dist/protocol/register-tools.js +184 -0
- package/dist/protocol/register-tools.js.map +1 -0
- package/dist/protocol/result.d.ts +5 -0
- package/dist/protocol/result.js +26 -0
- package/dist/protocol/result.js.map +1 -0
- package/dist/recommendation/compare.d.ts +35 -0
- package/dist/recommendation/compare.js +118 -0
- package/dist/recommendation/compare.js.map +1 -0
- package/dist/recommendation/explain.d.ts +5 -0
- package/dist/recommendation/explain.js +88 -0
- package/dist/recommendation/explain.js.map +1 -0
- package/dist/recommendation/index.d.ts +4 -0
- package/dist/recommendation/index.js +11 -0
- package/dist/recommendation/index.js.map +1 -0
- package/dist/recommendation/normalize-context.d.ts +3 -0
- package/dist/recommendation/normalize-context.js +177 -0
- package/dist/recommendation/normalize-context.js.map +1 -0
- package/dist/recommendation/scoring.d.ts +8 -0
- package/dist/recommendation/scoring.js +370 -0
- package/dist/recommendation/scoring.js.map +1 -0
- package/dist/recommendation/types.d.ts +72 -0
- package/dist/recommendation/types.js +3 -0
- package/dist/recommendation/types.js.map +1 -0
- package/dist/server-info.d.ts +4 -0
- package/dist/server-info.js +16 -0
- package/dist/server-info.js.map +1 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.js +25 -0
- package/dist/server.js.map +1 -0
- package/dist/state-atlas/planner.d.ts +42 -0
- package/dist/state-atlas/planner.js +82 -0
- package/dist/state-atlas/planner.js.map +1 -0
- package/dist/tokens/compile.d.ts +27 -0
- package/dist/tokens/compile.js +304 -0
- package/dist/tokens/compile.js.map +1 -0
- package/dist/tokens/contrast.d.ts +18 -0
- package/dist/tokens/contrast.js +51 -0
- package/dist/tokens/contrast.js.map +1 -0
- package/dist/types.d.ts +287 -0
- package/dist/types.js +36 -0
- package/dist/types.js.map +1 -0
- package/generated/catalog.v1.json +18533 -0
- package/generated/manifest.v1.json +27 -0
- package/package.json +47 -0
- package/skill/CLAUDE.md +36 -0
- package/skill/web-stylebook-design/SKILL.md +95 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Web Stylebook
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# web-stylebook-mcp
|
|
2
|
+
|
|
3
|
+
**Design intelligence for coding agents.**
|
|
4
|
+
|
|
5
|
+
Give your coding agent a design vocabulary. Web Stylebook MCP helps AI coding agents
|
|
6
|
+
choose a product‑fit visual direction, plan screens, cover real UI states, compose
|
|
7
|
+
design tokens, and avoid generic AI‑looking interfaces — without writing the code for them.
|
|
8
|
+
|
|
9
|
+
- **No API key. No model call. No network. No project access.** Deterministic, read‑only design knowledge packaged locally.
|
|
10
|
+
- Same catalog as [Web Stylebook](https://webstylebook.com).
|
|
11
|
+
- English · Korean · Japanese.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"mcpServers": {
|
|
18
|
+
"web-stylebook": {
|
|
19
|
+
"command": "npx",
|
|
20
|
+
"args": ["-y", "web-stylebook-mcp@latest"]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Then ask your agent to design something. For the best results, also install the
|
|
27
|
+
companion skill / CLAUDE.md fragment (it tells the agent *when* to call these tools).
|
|
28
|
+
|
|
29
|
+
## Companion skill
|
|
30
|
+
|
|
31
|
+
This package ships the trigger + usage logic in `skill/`:
|
|
32
|
+
|
|
33
|
+
- **Claude Code / skill-aware hosts:** point your skills directory at `skill/web-stylebook-design/`.
|
|
34
|
+
- **Other hosts:** copy the block in `skill/CLAUDE.md` into your project's `CLAUDE.md` (or rules file).
|
|
35
|
+
|
|
36
|
+
It encodes *when* to call these tools and how to use the results — compose, don't recolor; offer
|
|
37
|
+
multiple fully-composed candidates; earn trust, don't fake it; component-owned states; land on
|
|
38
|
+
reusable components.
|
|
39
|
+
|
|
40
|
+
## Tools (4 compute tools)
|
|
41
|
+
|
|
42
|
+
| Tool | What it does |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `recommend_design_direction` | Scored style candidates + reason codes + rejected styles with reasons + secondary pairings + confidence. Evidence‑provider: your model makes the final pick. |
|
|
45
|
+
| `compare_design_directions` | Compares 2–4 directions across product fit, repeated‑use, density, trust, distinctiveness, accessibility risk, motion and maintenance. No single winner. |
|
|
46
|
+
| `get_ui_state_plan` | Required / recommended / domain‑specific UI states for a surface (data‑table, form, checkout, chat, developer‑console) with triggers, must‑show, must‑not, a11y and motion. |
|
|
47
|
+
| `compose_design_tokens` | Role‑based design tokens (color, type, spacing, radius, motion, density) in json / css‑variables / tailwind / typescript, light/dark/both, with WCAG contrast warnings. |
|
|
48
|
+
|
|
49
|
+
Prose‑shaped work (search, brief composition, screen planning, and the “when to call” trigger)
|
|
50
|
+
is carried by the companion **skill**, not by extra tools.
|
|
51
|
+
|
|
52
|
+
## Resources
|
|
53
|
+
|
|
54
|
+
`webstylebook://manifest` · `…/styles` · `…/styles/{id}` · `…/motion` · `…/motion/{id}`
|
|
55
|
+
· `…/components` · `…/components/{id}` · `…/states/surfaces` · `…/states/{surface}`
|
|
56
|
+
· `…/states/{surface}/{state}` · `…/products` · `…/products/{id}`
|
|
57
|
+
· `…/policies/anti-patterns` · `…/policies/verification`
|
|
58
|
+
|
|
59
|
+
## Prompts
|
|
60
|
+
|
|
61
|
+
`design-product` · `design-screen` · `complete-ui-states` · `redesign-with-style` · `audit-design-direction`
|
|
62
|
+
|
|
63
|
+
## CLI
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
web-stylebook-mcp # start MCP server over stdio (default)
|
|
67
|
+
web-stylebook-mcp --version
|
|
68
|
+
web-stylebook-mcp --catalog-info
|
|
69
|
+
web-stylebook-mcp --validate-catalog
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Demo
|
|
73
|
+
|
|
74
|
+
> Design a high‑density monitoring dashboard for SREs. Used daily. Keep it calm and technical. Avoid cyberpunk decoration.
|
|
75
|
+
|
|
76
|
+
`recommend_design_direction` surfaces calm operational styles like `quiet-utility`,
|
|
77
|
+
`platform-core`, and `runtime-signal` among the scored candidates, **rejects** `cyberpunk-glitch`
|
|
78
|
+
(`EXPLICITLY_AVOIDED`), suggests a secondary pairing for quieter forms/navigation surfaces, and
|
|
79
|
+
records its assumptions and confidence. The agent then reads
|
|
80
|
+
the chosen style resources, plans the data‑table states with `get_ui_state_plan`, and emits a
|
|
81
|
+
starting token set with `compose_design_tokens`.
|
|
82
|
+
|
|
83
|
+
## Privacy & security
|
|
84
|
+
|
|
85
|
+
v0.1 reads only the immutable catalog packaged with this module. It does not access your
|
|
86
|
+
filesystem, git, environment, shell, browser, network, or any model API. All output is a
|
|
87
|
+
deterministic function of the input — the same request always yields the same result.
|
|
88
|
+
|
|
89
|
+
## Compatibility
|
|
90
|
+
|
|
91
|
+
- Node ≥ 20.
|
|
92
|
+
- Built on `@modelcontextprotocol/sdk` 1.x (stdio transport).
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
MIT — covers both the code and the bundled catalog snapshot. Use this package, including its
|
|
97
|
+
catalog data, freely and commercially.
|
|
98
|
+
|
|
99
|
+
> The [Web Stylebook](https://webstylebook.com) website is separately licensed CC BY-NC; this
|
|
100
|
+
> package's MIT grant is provided by the same copyright holder for the catalog snapshot shipped here.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { CatalogEnvelope, WebStylebookCatalogV1, CatalogStyle, MotionPattern, ComponentTerm, ProductArchetype, StateSurface, StateRecipe, StyleFamily, Ontology, NotIdealMap, Policies, Lang } from '../types.js';
|
|
2
|
+
export interface StyleSummary {
|
|
3
|
+
id: string;
|
|
4
|
+
kind: 'style' | 'fusion';
|
|
5
|
+
name: string;
|
|
6
|
+
summary: string;
|
|
7
|
+
tags: string[];
|
|
8
|
+
bestFor: string[];
|
|
9
|
+
notIdealFor: string[];
|
|
10
|
+
resourceUri: string;
|
|
11
|
+
}
|
|
12
|
+
export interface MotionSummary {
|
|
13
|
+
id: string;
|
|
14
|
+
category: string;
|
|
15
|
+
name: string;
|
|
16
|
+
summary: string;
|
|
17
|
+
intensity: string;
|
|
18
|
+
resourceUri: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ComponentSummary {
|
|
21
|
+
id: string;
|
|
22
|
+
category: string;
|
|
23
|
+
name: string;
|
|
24
|
+
resourceUri: string;
|
|
25
|
+
}
|
|
26
|
+
export interface SurfaceSummary {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
requiredStateIds: string[];
|
|
30
|
+
recommendedStateIds: string[];
|
|
31
|
+
resourceUri: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ProductSummary {
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
resourceUri: string;
|
|
37
|
+
}
|
|
38
|
+
export declare const SCHEMA_ID = "webstylebook.catalog.v1";
|
|
39
|
+
export declare class CatalogRepository {
|
|
40
|
+
readonly envelope: CatalogEnvelope;
|
|
41
|
+
readonly data: WebStylebookCatalogV1;
|
|
42
|
+
private readonly styleById;
|
|
43
|
+
private readonly motionById;
|
|
44
|
+
private readonly componentById;
|
|
45
|
+
private readonly productById;
|
|
46
|
+
private readonly surfaceById;
|
|
47
|
+
private readonly recipeById;
|
|
48
|
+
private readonly familyById;
|
|
49
|
+
private readonly recipesBySurface;
|
|
50
|
+
constructor(envelope: CatalogEnvelope);
|
|
51
|
+
static load(path?: string): CatalogRepository;
|
|
52
|
+
get ontology(): Ontology;
|
|
53
|
+
get notIdealMap(): NotIdealMap;
|
|
54
|
+
get policies(): Policies;
|
|
55
|
+
get styleFamilies(): StyleFamily[];
|
|
56
|
+
get catalogVersion(): string;
|
|
57
|
+
get contentHash(): string;
|
|
58
|
+
allStyles(): CatalogStyle[];
|
|
59
|
+
getStyle(id: string): CatalogStyle | undefined;
|
|
60
|
+
getFamily(id: string): StyleFamily | undefined;
|
|
61
|
+
getMotion(id: string): MotionPattern | undefined;
|
|
62
|
+
getComponent(id: string): ComponentTerm | undefined;
|
|
63
|
+
getProduct(id: string): ProductArchetype | undefined;
|
|
64
|
+
getSurface(id: string): StateSurface | undefined;
|
|
65
|
+
getRecipe(id: string): StateRecipe | undefined;
|
|
66
|
+
recipesForSurface(surfaceId: string): StateRecipe[];
|
|
67
|
+
listStyles(locale?: Lang): StyleSummary[];
|
|
68
|
+
listMotion(locale?: Lang): MotionSummary[];
|
|
69
|
+
listComponents(locale?: Lang): ComponentSummary[];
|
|
70
|
+
listSurfaces(locale?: Lang): SurfaceSummary[];
|
|
71
|
+
listProducts(locale?: Lang): ProductSummary[];
|
|
72
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// Runtime catalog repository. Loads the committed catalog.v1.json (ADR-003: the
|
|
2
|
+
// only thing the MCP runtime reads), verifies the schema id, and builds id indexes
|
|
3
|
+
// once at startup. Per-request schema validation is NOT repeated (02 §7).
|
|
4
|
+
import { readFileSync } from 'node:fs';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { dirname, join } from 'node:path';
|
|
7
|
+
import { text } from '../localization.js';
|
|
8
|
+
export const SCHEMA_ID = 'webstylebook.catalog.v1';
|
|
9
|
+
function locateCatalog() {
|
|
10
|
+
const here = dirname(fileURLToPath(import.meta.url)); // dist/catalog (or src/catalog under tsx)
|
|
11
|
+
return join(here, '..', '..', 'generated', 'catalog.v1.json');
|
|
12
|
+
}
|
|
13
|
+
export class CatalogRepository {
|
|
14
|
+
envelope;
|
|
15
|
+
data;
|
|
16
|
+
styleById = new Map();
|
|
17
|
+
motionById = new Map();
|
|
18
|
+
componentById = new Map();
|
|
19
|
+
productById = new Map();
|
|
20
|
+
surfaceById = new Map();
|
|
21
|
+
recipeById = new Map();
|
|
22
|
+
familyById = new Map();
|
|
23
|
+
recipesBySurface = new Map();
|
|
24
|
+
constructor(envelope) {
|
|
25
|
+
if (envelope.schema !== SCHEMA_ID) {
|
|
26
|
+
throw new Error(`unexpected catalog schema '${envelope.schema}', expected '${SCHEMA_ID}'`);
|
|
27
|
+
}
|
|
28
|
+
this.envelope = envelope;
|
|
29
|
+
this.data = envelope.data;
|
|
30
|
+
for (const s of this.data.styles)
|
|
31
|
+
this.styleById.set(s.id, s);
|
|
32
|
+
for (const m of this.data.motionPatterns)
|
|
33
|
+
this.motionById.set(m.id, m);
|
|
34
|
+
for (const c of this.data.components)
|
|
35
|
+
this.componentById.set(c.id, c);
|
|
36
|
+
for (const p of this.data.productArchetypes)
|
|
37
|
+
this.productById.set(p.id, p);
|
|
38
|
+
for (const f of this.data.styleFamilies)
|
|
39
|
+
this.familyById.set(f.id, f);
|
|
40
|
+
for (const surf of this.data.stateSurfaces) {
|
|
41
|
+
this.surfaceById.set(surf.id, surf);
|
|
42
|
+
this.recipesBySurface.set(surf.id, []);
|
|
43
|
+
}
|
|
44
|
+
for (const r of this.data.stateRecipes) {
|
|
45
|
+
this.recipeById.set(r.id, r);
|
|
46
|
+
for (const sid of r.surfaceIds) {
|
|
47
|
+
const list = this.recipesBySurface.get(sid);
|
|
48
|
+
if (list)
|
|
49
|
+
list.push(r);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
static load(path = locateCatalog()) {
|
|
54
|
+
let raw;
|
|
55
|
+
try {
|
|
56
|
+
raw = readFileSync(path, 'utf8');
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
throw new Error(`failed to read catalog at ${path}: ${err.message}`, { cause: err });
|
|
60
|
+
}
|
|
61
|
+
const envelope = JSON.parse(raw);
|
|
62
|
+
return new CatalogRepository(envelope);
|
|
63
|
+
}
|
|
64
|
+
get ontology() { return this.data.ontology; }
|
|
65
|
+
get notIdealMap() { return this.data.notIdealMap; }
|
|
66
|
+
get policies() { return this.data.policies; }
|
|
67
|
+
get styleFamilies() { return this.data.styleFamilies; }
|
|
68
|
+
get catalogVersion() { return this.envelope.catalogVersion; }
|
|
69
|
+
get contentHash() { return this.envelope.contentHash; }
|
|
70
|
+
allStyles() { return this.data.styles; }
|
|
71
|
+
getStyle(id) { return this.styleById.get(id); }
|
|
72
|
+
getFamily(id) { return this.familyById.get(id); }
|
|
73
|
+
getMotion(id) { return this.motionById.get(id); }
|
|
74
|
+
getComponent(id) { return this.componentById.get(id); }
|
|
75
|
+
getProduct(id) { return this.productById.get(id); }
|
|
76
|
+
getSurface(id) { return this.surfaceById.get(id); }
|
|
77
|
+
getRecipe(id) { return this.recipeById.get(id); }
|
|
78
|
+
recipesForSurface(surfaceId) { return this.recipesBySurface.get(surfaceId) ?? []; }
|
|
79
|
+
listStyles(locale = 'en') {
|
|
80
|
+
return this.data.styles.map((s) => ({
|
|
81
|
+
id: s.id, kind: s.kind, name: text(s.name, locale), summary: text(s.summary, locale),
|
|
82
|
+
tags: s.tags, bestFor: s.bestFor, notIdealFor: s.notIdealFor,
|
|
83
|
+
resourceUri: `webstylebook://styles/${s.id}`,
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
listMotion(locale = 'en') {
|
|
87
|
+
return this.data.motionPatterns.map((m) => ({
|
|
88
|
+
id: m.id, category: m.category, name: text(m.name, locale), summary: text(m.summary, locale),
|
|
89
|
+
intensity: m.intensity, resourceUri: `webstylebook://motion/${m.id}`,
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
listComponents(locale = 'en') {
|
|
93
|
+
return this.data.components.map((c) => ({
|
|
94
|
+
id: c.id, category: c.category, name: text(c.name, locale),
|
|
95
|
+
resourceUri: `webstylebook://components/${c.id}`,
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
listSurfaces(locale = 'en') {
|
|
99
|
+
return this.data.stateSurfaces.map((s) => ({
|
|
100
|
+
id: s.id, name: text(s.name, locale),
|
|
101
|
+
requiredStateIds: s.requiredStateIds, recommendedStateIds: s.recommendedStateIds,
|
|
102
|
+
resourceUri: `webstylebook://states/${s.id}`,
|
|
103
|
+
}));
|
|
104
|
+
}
|
|
105
|
+
listProducts(locale = 'en') {
|
|
106
|
+
return this.data.productArchetypes.map((p) => ({
|
|
107
|
+
id: p.id, name: text(p.name, locale), resourceUri: `webstylebook://products/${p.id}`,
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.js","sourceRoot":"","sources":["../../src/catalog/repository.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,mFAAmF;AACnF,0EAA0E;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAM1C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAmB1C,MAAM,CAAC,MAAM,SAAS,GAAG,yBAAyB,CAAC;AAEnD,SAAS,aAAa;IACpB,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,0CAA0C;IAChG,OAAO,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,OAAO,iBAAiB;IACnB,QAAQ,CAAkB;IAC1B,IAAI,CAAwB;IAEpB,SAAS,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC5C,UAAU,GAAG,IAAI,GAAG,EAA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AC,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC;YAC1D,WAAW,EAAE,6BAA6B,CAAC,CAAC,EAAE,EAAE;SACjD,CAAC,CAAC,CAAC;IACN,CAAC;IACD,YAAY,CAAC,SAAe,IAAI;QAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACzC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC;YACpC,gBAAgB,EAAE,CAAC,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,CAAC,CAAC,mBAAmB;YAChF,WAAW,EAAE,yBAAyB,CAAC,CAAC,EAAE,EAAE;SAC7C,CAAC,CAAC,CAAC;IACN,CAAC;IACD,YAAY,CAAC,SAAe,IAAI;QAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC7C,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,2BAA2B,CAAC,CAAC,EAAE,EAAE;SACrF,CAAC,CAAC,CAAC;IACN,CAAC;CACF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Lightweight runtime validation of the packaged catalog (CLI --validate-catalog).
|
|
2
|
+
// Deep zod/reference validation lives in the repo's build scripts; this is a fast
|
|
3
|
+
// load-time sanity check that the shipped artifact is intact.
|
|
4
|
+
import { LANGS } from '../types.js';
|
|
5
|
+
function localeComplete(v) {
|
|
6
|
+
return LANGS.every((l) => typeof v[l] === 'string' && v[l].trim().length > 0);
|
|
7
|
+
}
|
|
8
|
+
export function validateLoaded(repo) {
|
|
9
|
+
const errors = [];
|
|
10
|
+
const data = repo.data;
|
|
11
|
+
if (!/^sha256:[0-9a-f]{64}$/.test(repo.contentHash))
|
|
12
|
+
errors.push('contentHash malformed');
|
|
13
|
+
const ids = new Set();
|
|
14
|
+
for (const s of data.styles) {
|
|
15
|
+
if (ids.has(`style:${s.id}`))
|
|
16
|
+
errors.push(`duplicate style id ${s.id}`);
|
|
17
|
+
ids.add(`style:${s.id}`);
|
|
18
|
+
if (!s.recommendationFacets)
|
|
19
|
+
errors.push(`style ${s.id} missing facets`);
|
|
20
|
+
if (!localeComplete(s.name))
|
|
21
|
+
errors.push(`style ${s.id} name not locale-complete`);
|
|
22
|
+
}
|
|
23
|
+
for (const r of data.stateRecipes) {
|
|
24
|
+
if (!r.mustShow.length || !r.mustNot.length)
|
|
25
|
+
errors.push(`recipe ${r.id} missing mustShow/mustNot`);
|
|
26
|
+
for (const sid of r.surfaceIds)
|
|
27
|
+
if (!repo.getSurface(sid))
|
|
28
|
+
errors.push(`recipe ${r.id} -> unknown surface ${sid}`);
|
|
29
|
+
}
|
|
30
|
+
for (const surf of data.stateSurfaces) {
|
|
31
|
+
for (const sid of [...surf.requiredStateIds, ...surf.recommendedStateIds]) {
|
|
32
|
+
if (!repo.getRecipe(sid))
|
|
33
|
+
errors.push(`surface ${surf.id} -> unknown state ${sid}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
ok: errors.length === 0,
|
|
38
|
+
errors,
|
|
39
|
+
summary: {
|
|
40
|
+
styles: data.styles.length,
|
|
41
|
+
motion: data.motionPatterns.length,
|
|
42
|
+
components: data.components.length,
|
|
43
|
+
surfaces: data.stateSurfaces.length,
|
|
44
|
+
recipes: data.stateRecipes.length,
|
|
45
|
+
products: data.productArchetypes.length,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// CLI entry. Default action is stdio. stdout carries JSON-RPC only; everything
|
|
3
|
+
// human-readable goes to stderr (or stdout for explicit --version/info commands).
|
|
4
|
+
import { runStdio } from './server.js';
|
|
5
|
+
import { CatalogRepository } from './catalog/repository.js';
|
|
6
|
+
import { validateLoaded } from './catalog/validate.js';
|
|
7
|
+
import { SERVER_NAME, SERVER_VERSION, TOOL_NAMES } from './server-info.js';
|
|
8
|
+
const HELP = `${SERVER_NAME}-mcp v${SERVER_VERSION}
|
|
9
|
+
Usage: web-stylebook-mcp [options]
|
|
10
|
+
|
|
11
|
+
(no args) start the MCP server over stdio
|
|
12
|
+
--stdio same as no args
|
|
13
|
+
--version print version and exit
|
|
14
|
+
--catalog-info print catalog version, hash and counts
|
|
15
|
+
--validate-catalog validate the packaged catalog and exit (non-zero on failure)
|
|
16
|
+
--help this help
|
|
17
|
+
`;
|
|
18
|
+
async function main() {
|
|
19
|
+
const args = process.argv.slice(2);
|
|
20
|
+
const has = (f) => args.includes(f);
|
|
21
|
+
if (has('--help') || has('-h')) {
|
|
22
|
+
process.stdout.write(HELP);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (has('--version')) {
|
|
26
|
+
process.stdout.write(`${SERVER_VERSION}\n`);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (has('--catalog-info')) {
|
|
30
|
+
const r = CatalogRepository.load();
|
|
31
|
+
process.stdout.write(`${JSON.stringify({
|
|
32
|
+
server: SERVER_VERSION, catalogVersion: r.catalogVersion, contentHash: r.contentHash,
|
|
33
|
+
tools: TOOL_NAMES, counts: validateLoaded(r).summary,
|
|
34
|
+
}, null, 2)}\n`);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (has('--validate-catalog')) {
|
|
38
|
+
const report = validateLoaded(CatalogRepository.load());
|
|
39
|
+
if (report.ok) {
|
|
40
|
+
process.stderr.write(`[${SERVER_NAME}-mcp] catalog OK ${JSON.stringify(report.summary)}\n`);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
process.stderr.write(`[${SERVER_NAME}-mcp] catalog INVALID:\n${report.errors.map((e) => ` - ${e}`).join('\n')}\n`);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const unknown = args.filter((a) => a.startsWith('-') && a !== '--stdio');
|
|
49
|
+
if (unknown.length) {
|
|
50
|
+
process.stderr.write(`unknown option(s): ${unknown.join(' ')}\n${HELP}`);
|
|
51
|
+
process.exit(2);
|
|
52
|
+
}
|
|
53
|
+
await runStdio();
|
|
54
|
+
}
|
|
55
|
+
main().catch((err) => {
|
|
56
|
+
process.stderr.write(`[${SERVER_NAME}-mcp] fatal: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
57
|
+
process.exit(1);
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,+EAA+E;AAC/E,kFAAkF;AAElF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE3E,MAAM,IAAI,GAAG,GAAG,WAAW,SAAS,cAAc;;;;;;;;;CASjD,CAAC;AAEF,KAAK,UAAU,IAAI;IACjB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CA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AI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC;IACzE,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,QAAQ,EAAE,CAAC;AACnB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,WAAW,gBAAgB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1G,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Lang, LocalizedText } from './types.js';
|
|
2
|
+
/** Materialize a single locale at the presentation/protocol boundary. Falls back to en. */
|
|
3
|
+
export declare function text(value: LocalizedText, lang?: Lang): string;
|
|
4
|
+
/** Materialize an array of LocalizedText. */
|
|
5
|
+
export declare function texts(values: LocalizedText[], lang?: Lang): string[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DEFAULT_LANG } from './types.js';
|
|
2
|
+
/** Materialize a single locale at the presentation/protocol boundary. Falls back to en. */
|
|
3
|
+
export function text(value, lang = DEFAULT_LANG) {
|
|
4
|
+
return value[lang] || value.en;
|
|
5
|
+
}
|
|
6
|
+
/** Materialize an array of LocalizedText. */
|
|
7
|
+
export function texts(values, lang = DEFAULT_LANG) {
|
|
8
|
+
return values.map((v) => text(v, lang));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=localization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localization.js","sourceRoot":"","sources":["../src/localization.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,2FAA2F;AAC3F,MAAM,UAAU,IAAI,CAAC,KAAoB,EAAE,OAAa,YAAY;IAClE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;AACjC,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,KAAK,CAAC,MAAuB,EAAE,OAAa,YAAY;IACtE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ErrorCode = 'INVALID_INPUT' | 'UNSUPPORTED_LOCALE' | 'STYLE_NOT_FOUND' | 'MOTION_NOT_FOUND' | 'COMPONENT_NOT_FOUND' | 'STATE_SURFACE_NOT_FOUND' | 'STATE_RECIPE_NOT_FOUND' | 'PRODUCT_NOT_FOUND' | 'NO_COMPATIBLE_STYLE' | 'CATALOG_SCHEMA_MISMATCH' | 'CATALOG_INTEGRITY_ERROR' | 'OUTPUT_TOO_LARGE';
|
|
2
|
+
export interface ToolErrorPayload {
|
|
3
|
+
error: {
|
|
4
|
+
code: ErrorCode;
|
|
5
|
+
message: string;
|
|
6
|
+
details?: Record<string, unknown>;
|
|
7
|
+
};
|
|
8
|
+
suggestions?: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare class ToolError extends Error {
|
|
11
|
+
readonly code: ErrorCode;
|
|
12
|
+
readonly suggestions?: string[] | undefined;
|
|
13
|
+
readonly details?: Record<string, unknown> | undefined;
|
|
14
|
+
constructor(code: ErrorCode, message: string, suggestions?: string[] | undefined, details?: Record<string, unknown> | undefined);
|
|
15
|
+
payload(): ToolErrorPayload;
|
|
16
|
+
}
|
|
17
|
+
/** Levenshtein distance (small inputs only). */
|
|
18
|
+
export declare function editDistance(a: string, b: string): number;
|
|
19
|
+
/** Near-miss ids (edit distance <= 3), closest first, max 3. */
|
|
20
|
+
export declare function nearestIds(target: string, ids: string[]): string[];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Error model (02 §15, 04 §11). Stable error codes are public API (ADR-009).
|
|
2
|
+
export class ToolError extends Error {
|
|
3
|
+
code;
|
|
4
|
+
suggestions;
|
|
5
|
+
details;
|
|
6
|
+
constructor(code, message, suggestions, details) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.code = code;
|
|
9
|
+
this.suggestions = suggestions;
|
|
10
|
+
this.details = details;
|
|
11
|
+
this.name = 'ToolError';
|
|
12
|
+
}
|
|
13
|
+
payload() {
|
|
14
|
+
return {
|
|
15
|
+
error: { code: this.code, message: this.message, ...(this.details ? { details: this.details } : {}) },
|
|
16
|
+
...(this.suggestions && this.suggestions.length ? { suggestions: this.suggestions } : {}),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/** Levenshtein distance (small inputs only). */
|
|
21
|
+
export function editDistance(a, b) {
|
|
22
|
+
const m = a.length;
|
|
23
|
+
const n = b.length;
|
|
24
|
+
const dp = Array.from({ length: n + 1 }, (_, j) => j);
|
|
25
|
+
for (let i = 1; i <= m; i++) {
|
|
26
|
+
let prev = dp[0] ?? 0;
|
|
27
|
+
dp[0] = i;
|
|
28
|
+
for (let j = 1; j <= n; j++) {
|
|
29
|
+
const tmp = dp[j] ?? 0;
|
|
30
|
+
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
31
|
+
dp[j] = Math.min((dp[j] ?? 0) + 1, (dp[j - 1] ?? 0) + 1, prev + cost);
|
|
32
|
+
prev = tmp;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return dp[n] ?? 0;
|
|
36
|
+
}
|
|
37
|
+
/** Near-miss ids (edit distance <= 3), closest first, max 3. */
|
|
38
|
+
export function nearestIds(target, ids) {
|
|
39
|
+
return ids
|
|
40
|
+
.map((id) => ({ id, d: editDistance(target, id) }))
|
|
41
|
+
.filter((x) => x.d <= 3)
|
|
42
|
+
.sort((a, b) => a.d - b.d || (a.id < b.id ? -1 : 1))
|
|
43
|
+
.slice(0, 3)
|
|
44
|
+
.map((x) => x.id);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/protocol/errors.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAqB7E,MAAM,OAAO,SAAU,SAAQ,KAAK;IAEvB;IAEA;IACA;IAJX,YACW,IAAe,EACxB,OAAe,EACN,WAAsB,EACtB,OAAiC;QAE1C,KAAK,CAAC,OAAO,CAAC,CAAC;QALN,SAAI,GAAJ,IAAI,CAAW;QAEf,gBAAW,GAAX,WAAW,CAAW;QACtB,YAAO,GAAP,OAAO,CAA0B;QAG1C,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC1B,CAAC;IACD,OAAO;QACL,OAAO;YACL,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;YACrG,GAAG,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE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AC,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,UAAU,CAAC,MAAc,EAAE,GAAa;IACtD,OAAO,GAAG;SACP,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;SAClD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SACvB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACnD,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Workflow prompts (01 §9). Prompts do NOT call tools; they hand the host model a
|
|
2
|
+
// recommended order. The companion skill (ADR-011) is the primary trigger; prompts
|
|
3
|
+
// are a secondary affordance for clients that surface them.
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
function userMessage(text) {
|
|
6
|
+
return { messages: [{ role: 'user', content: { type: 'text', text } }] };
|
|
7
|
+
}
|
|
8
|
+
export function registerPrompts(server) {
|
|
9
|
+
server.registerPrompt('design-product', {
|
|
10
|
+
title: 'Design a product with Web Stylebook',
|
|
11
|
+
description: 'Choose a visual direction, compose a brief, plan screens, and cover UI states.',
|
|
12
|
+
argsSchema: {
|
|
13
|
+
product: z.string(),
|
|
14
|
+
audience: z.string().optional(),
|
|
15
|
+
pages: z.string().optional(),
|
|
16
|
+
constraints: z.string().optional(),
|
|
17
|
+
},
|
|
18
|
+
}, ({ product, audience, pages, constraints }) => userMessage([
|
|
19
|
+
'Use the Web Stylebook MCP in this order:',
|
|
20
|
+
'1. recommend_design_direction (treat candidates as scored evidence; pick using product context)',
|
|
21
|
+
'2. read the chosen webstylebook://styles/{id} resources',
|
|
22
|
+
'3. write design.md from the full brief skeleton (intent → verification checklist; never leave a section empty)',
|
|
23
|
+
'4. plan each screen (hierarchy by user task, not a generic Hero+Features template)',
|
|
24
|
+
'5. get_ui_state_plan for each surface (cover the non-happy-path states)',
|
|
25
|
+
'6. compose_design_tokens for a starting token set; heed contrast warnings',
|
|
26
|
+
'7. implement, then self-audit against webstylebook://policies/verification',
|
|
27
|
+
'',
|
|
28
|
+
`Product: ${product}`,
|
|
29
|
+
`Audience: ${audience ?? 'infer conservatively and record the assumption'}`,
|
|
30
|
+
`Pages: ${pages ?? 'infer the minimum usable set'}`,
|
|
31
|
+
`Constraints: ${constraints ?? 'none provided'}`,
|
|
32
|
+
].join('\n')));
|
|
33
|
+
server.registerPrompt('design-screen', {
|
|
34
|
+
title: 'Design one screen',
|
|
35
|
+
description: 'Plan hierarchy, components, states, responsive and motion for a single screen.',
|
|
36
|
+
argsSchema: { screenType: z.string(), goal: z.string(), styleId: z.string().optional() },
|
|
37
|
+
}, ({ screenType, goal, styleId }) => userMessage([
|
|
38
|
+
`Design a ${screenType} screen. Goal: ${goal}.`,
|
|
39
|
+
styleId ? `Use style ${styleId} (read webstylebook://styles/${styleId}).` : 'If no style is chosen yet, call recommend_design_direction first.',
|
|
40
|
+
'Organize hierarchy by the primary user task. Look up relevant components in webstylebook://components.',
|
|
41
|
+
'Call get_ui_state_plan for the matching surface and cover required + recommended states.',
|
|
42
|
+
'State responsive and motion rules (use AND avoid). Do not default to Hero + Features + Testimonial + CTA.',
|
|
43
|
+
].join('\n')));
|
|
44
|
+
server.registerPrompt('complete-ui-states', {
|
|
45
|
+
title: 'Complete the UI states of a surface',
|
|
46
|
+
description: 'Find missing states for a surface and implement them.',
|
|
47
|
+
argsSchema: { surfaceId: z.string(), existingStates: z.string().optional() },
|
|
48
|
+
}, ({ surfaceId, existingStates }) => userMessage([
|
|
49
|
+
`Complete the UI states for the ${surfaceId} surface.`,
|
|
50
|
+
`Already implemented: ${existingStates ?? '(unknown — infer from the code)'}.`,
|
|
51
|
+
'Call get_ui_state_plan to get required / recommended / domain-specific states.',
|
|
52
|
+
'Diff against what exists, read webstylebook://states/{surfaceId}/{stateId} for each missing one, and implement in the returned order.',
|
|
53
|
+
'Pay attention to must-not rules (e.g. silent auto-retry, losing user input, implying a charge that did not happen).',
|
|
54
|
+
].join('\n')));
|
|
55
|
+
server.registerPrompt('redesign-with-style', {
|
|
56
|
+
title: 'Redesign an existing screen with a new direction',
|
|
57
|
+
description: 'Keep structure, change the visual direction, verify fidelity.',
|
|
58
|
+
argsSchema: { current: z.string(), goal: z.string() },
|
|
59
|
+
}, ({ current, goal }) => userMessage([
|
|
60
|
+
`Redesign this screen toward: ${goal}. Keep what works structurally.`,
|
|
61
|
+
`Current state: ${current}.`,
|
|
62
|
+
'Use compare_design_directions on 2-3 candidate styles, choose primary + secondary roles, then draft the design.md brief notes and call compose_design_tokens.',
|
|
63
|
+
'Finish with the audit-design-direction checklist.',
|
|
64
|
+
].join('\n')));
|
|
65
|
+
server.registerPrompt('audit-design-direction', {
|
|
66
|
+
title: 'Audit an implemented design',
|
|
67
|
+
description: 'Check style fidelity, anti-patterns, state coverage, accessibility and motion.',
|
|
68
|
+
argsSchema: { styleId: z.string(), summary: z.string() },
|
|
69
|
+
}, ({ styleId, summary }) => userMessage([
|
|
70
|
+
`Audit this implementation against the ${styleId} direction.`,
|
|
71
|
+
`Implementation summary: ${summary}.`,
|
|
72
|
+
'Check: style fidelity, anti-patterns (webstylebook://policies/anti-patterns), UI state coverage, accessibility, motion restraint.',
|
|
73
|
+
'Return a verdict per item: PASS / FIX-NOW / RISK, with a concrete fix for each FIX-NOW.',
|
|
74
|
+
].join('\n')));
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=register-prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-prompts.js","sourceRoot":"","sources":["../../src/protocol/register-prompts.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,mFAAmF;AACnF,4DAA4D;AAE5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;AAC7F,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC/C,MAAM,CAAC,cAAc,CAAC,gBAAgB,EAAE;QACtC,KAAK,EAAE,qCAAqC;QAC5C,WAAW,EAAE,gFAAgF;QAC7F,UAAU,EAAE;YACV,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;YACnB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC/B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC5B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SACnC;KACF,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC;QAC5D,0CAA0C;QAC1C,iGAAiG;QACjG,yDAAyD;QACzD,gHAAgH;QAChH,oFAAoF;QACpF,yEAAyE;QACzE,2EAA2E;QAC3E,4EAA4E;QAC5E,EAAE;QACF,YAAY,OAAO,EAAE;QACrB,aAAa,QAAQ,IAAI,gDAAgD,EAAE;QAC3E,UAAU,KAAK,IAAI,8BAA8B,EAAE;QACnD,gBAAgB,WAAW,IAAI,eAAe,EAAE;KACjD,CAAC,IAAI,CAAC,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