@primer/brand-mcp 0.0.0-20260626120119
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 +43 -0
- package/dist/brand/detect-framework.d.ts +13 -0
- package/dist/brand/detect-framework.js +48 -0
- package/dist/brand/detect-framework.js.map +1 -0
- package/dist/brand/docs-source.d.ts +40 -0
- package/dist/brand/docs-source.js +82 -0
- package/dist/brand/docs-source.js.map +1 -0
- package/dist/brand/resolve-assets.d.ts +14 -0
- package/dist/brand/resolve-assets.js +101 -0
- package/dist/brand/resolve-assets.js.map +1 -0
- package/dist/brand/resolve-install.d.ts +25 -0
- package/dist/brand/resolve-install.js +63 -0
- package/dist/brand/resolve-install.js.map +1 -0
- package/dist/catalog/load.d.ts +3 -0
- package/dist/catalog/load.js +18 -0
- package/dist/catalog/load.js.map +1 -0
- package/dist/catalog/types.d.ts +60 -0
- package/dist/catalog/types.js +15 -0
- package/dist/catalog/types.js.map +1 -0
- package/dist/catalog.json +9964 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +12 -0
- package/dist/logger.js +18 -0
- package/dist/logger.js.map +1 -0
- package/dist/review/rules.d.ts +5 -0
- package/dist/review/rules.js +235 -0
- package/dist/review/rules.js.map +1 -0
- package/dist/review/types.d.ts +15 -0
- package/dist/review/types.js +6 -0
- package/dist/review/types.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +53 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/format.d.ts +15 -0
- package/dist/tools/format.js +23 -0
- package/dist/tools/format.js.map +1 -0
- package/dist/tools/primer-brand-asset/index.d.ts +1 -0
- package/dist/tools/primer-brand-asset/index.js +2 -0
- package/dist/tools/primer-brand-asset/index.js.map +1 -0
- package/dist/tools/primer-brand-asset/primer-brand-asset.d.ts +18 -0
- package/dist/tools/primer-brand-asset/primer-brand-asset.js +43 -0
- package/dist/tools/primer-brand-asset/primer-brand-asset.js.map +1 -0
- package/dist/tools/primer-brand-component/index.d.ts +1 -0
- package/dist/tools/primer-brand-component/index.js +2 -0
- package/dist/tools/primer-brand-component/index.js.map +1 -0
- package/dist/tools/primer-brand-component/primer-brand-component.d.ts +12 -0
- package/dist/tools/primer-brand-component/primer-brand-component.js +72 -0
- package/dist/tools/primer-brand-component/primer-brand-component.js.map +1 -0
- package/dist/tools/primer-brand-docs/index.d.ts +1 -0
- package/dist/tools/primer-brand-docs/index.js +2 -0
- package/dist/tools/primer-brand-docs/index.js.map +1 -0
- package/dist/tools/primer-brand-docs/primer-brand-docs.d.ts +15 -0
- package/dist/tools/primer-brand-docs/primer-brand-docs.js +56 -0
- package/dist/tools/primer-brand-docs/primer-brand-docs.js.map +1 -0
- package/dist/tools/primer-brand-examples/index.d.ts +1 -0
- package/dist/tools/primer-brand-examples/index.js +2 -0
- package/dist/tools/primer-brand-examples/index.js.map +1 -0
- package/dist/tools/primer-brand-examples/primer-brand-examples.d.ts +12 -0
- package/dist/tools/primer-brand-examples/primer-brand-examples.js +48 -0
- package/dist/tools/primer-brand-examples/primer-brand-examples.js.map +1 -0
- package/dist/tools/primer-brand-review/index.d.ts +1 -0
- package/dist/tools/primer-brand-review/index.js +2 -0
- package/dist/tools/primer-brand-review/index.js.map +1 -0
- package/dist/tools/primer-brand-review/primer-brand-review.d.ts +15 -0
- package/dist/tools/primer-brand-review/primer-brand-review.js +63 -0
- package/dist/tools/primer-brand-review/primer-brand-review.js.map +1 -0
- package/dist/tools/primer-brand-setup/index.d.ts +1 -0
- package/dist/tools/primer-brand-setup/index.js +2 -0
- package/dist/tools/primer-brand-setup/index.js.map +1 -0
- package/dist/tools/primer-brand-setup/primer-brand-setup.d.ts +12 -0
- package/dist/tools/primer-brand-setup/primer-brand-setup.js +126 -0
- package/dist/tools/primer-brand-setup/primer-brand-setup.js.map +1 -0
- package/dist/tools/primer-brand-tokens/index.d.ts +1 -0
- package/dist/tools/primer-brand-tokens/index.js +2 -0
- package/dist/tools/primer-brand-tokens/index.js.map +1 -0
- package/dist/tools/primer-brand-tokens/primer-brand-tokens.d.ts +18 -0
- package/dist/tools/primer-brand-tokens/primer-brand-tokens.js +93 -0
- package/dist/tools/primer-brand-tokens/primer-brand-tokens.js.map +1 -0
- package/dist/tools/register.d.ts +3 -0
- package/dist/tools/register.js +45 -0
- package/dist/tools/register.js.map +1 -0
- package/dist/tools/types.d.ts +34 -0
- package/dist/tools/types.js +2 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/util/text.d.ts +8 -0
- package/dist/util/text.js +31 -0
- package/dist/util/text.js.map +1 -0
- package/package.json +65 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
|
+
import { createServer } from './server.js';
|
|
4
|
+
/**
|
|
5
|
+
* Entry point for MCP server. Transports over stdio.
|
|
6
|
+
*/
|
|
7
|
+
try {
|
|
8
|
+
const server = createServer();
|
|
9
|
+
await server.connect(new StdioServerTransport());
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
process.stderr.write(`[primer-brand-mcp] fatal: ${error.message}\n`);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,2CAA2C,CAAA;AAE9E,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAA;AAExC;;GAEG;AACH,IAAI,CAAC;IACH,MAAM,MAAM,GAAG,YAAY,EAAE,CAAA;IAC7B,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAA;AAClD,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA8B,KAAe,CAAC,OAAO,IAAI,CAAC,CAAA;IAC/E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC"}
|
package/dist/logger.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All diagnostic logging goes to stderr. Stdout is reserved exclusively for the MCP
|
|
3
|
+
* protocol stream (JSON-RPC over stdio), so an accidental `console.log` there would corrupt
|
|
4
|
+
* the transport. Keep this the only logging surface in the server.
|
|
5
|
+
*/
|
|
6
|
+
export interface Logger {
|
|
7
|
+
debug(message: string): void;
|
|
8
|
+
info(message: string): void;
|
|
9
|
+
warn(message: string): void;
|
|
10
|
+
error(message: string): void;
|
|
11
|
+
}
|
|
12
|
+
export declare function createLogger(enabled?: boolean): Logger;
|
package/dist/logger.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All diagnostic logging goes to stderr. Stdout is reserved exclusively for the MCP
|
|
3
|
+
* protocol stream (JSON-RPC over stdio), so an accidental `console.log` there would corrupt
|
|
4
|
+
* the transport. Keep this the only logging surface in the server.
|
|
5
|
+
*/
|
|
6
|
+
export function createLogger(enabled = true) {
|
|
7
|
+
const write = (level, message) => {
|
|
8
|
+
if (enabled)
|
|
9
|
+
process.stderr.write(`[primer-brand-mcp] ${level}: ${message}\n`);
|
|
10
|
+
};
|
|
11
|
+
return {
|
|
12
|
+
debug: message => write('debug', message),
|
|
13
|
+
info: message => write('info', message),
|
|
14
|
+
warn: message => write('warn', message),
|
|
15
|
+
error: message => write('error', message),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,MAAM,UAAU,YAAY,CAAC,OAAO,GAAG,IAAI;IACzC,MAAM,KAAK,GAAG,CAAC,KAA0C,EAAE,OAAe,EAAQ,EAAE;QAClF,IAAI,OAAO;YAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,KAAK,KAAK,OAAO,IAAI,CAAC,CAAA;IAChF,CAAC,CAAA;IACD,OAAO;QACL,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC;QACzC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC;QACvC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC;QACvC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC;KAC1C,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Catalog, CatalogComponent } from '../catalog/types.js';
|
|
2
|
+
import { type Rule } from './types.js';
|
|
3
|
+
/** Credit for actually importing approved brand components — surfaced as guidance, not a failure. */
|
|
4
|
+
export declare function brandComponentsUsed(code: string, catalog: Catalog): CatalogComponent[];
|
|
5
|
+
export declare const allRules: Rule[];
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { escapeRegExp } from '../util/text.js';
|
|
2
|
+
import { evidence } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The review rule set. Each rule is intentionally narrow and grounded in the catalog or in
|
|
5
|
+
* Primer Brand's published taste, so findings are objective ("this prop value is not allowed",
|
|
6
|
+
* "this is a retired GitHub style") rather than subjective. The set mirrors the brand checks
|
|
7
|
+
* an on-brand GitHub page is graded against: real components over raw HTML, design tokens over
|
|
8
|
+
* hardcoded values, and avoidance of well-known off-brand visual "tells".
|
|
9
|
+
*/
|
|
10
|
+
const componentUsage = (code, name) => [
|
|
11
|
+
...code.matchAll(new RegExp(`<${escapeRegExp(name)}\\b[^>]*>`, 'g')),
|
|
12
|
+
];
|
|
13
|
+
/** `<Hero.Heading>` style usages of `Root.Sub`. */
|
|
14
|
+
const unknownSubcomponents = {
|
|
15
|
+
id: 'unknown-subcomponent',
|
|
16
|
+
run(code, catalog) {
|
|
17
|
+
const byName = new Map(catalog.components.map(component => [component.name, component]));
|
|
18
|
+
const findings = [];
|
|
19
|
+
const seen = new Set();
|
|
20
|
+
for (const match of code.matchAll(/<([A-Z][A-Za-z0-9]*)\.([A-Z][A-Za-z0-9]*)/g)) {
|
|
21
|
+
const root = match[1];
|
|
22
|
+
const sub = match[2];
|
|
23
|
+
if (!root || !sub)
|
|
24
|
+
continue;
|
|
25
|
+
const component = byName.get(root);
|
|
26
|
+
if (!component)
|
|
27
|
+
continue;
|
|
28
|
+
const qualified = `${root}.${sub}`;
|
|
29
|
+
if (component.subcomponents.includes(qualified) || seen.has(qualified))
|
|
30
|
+
continue;
|
|
31
|
+
seen.add(qualified);
|
|
32
|
+
const known = component.subcomponents.length
|
|
33
|
+
? ` Known sub-components: ${component.subcomponents.join(', ')}.`
|
|
34
|
+
: '';
|
|
35
|
+
findings.push({
|
|
36
|
+
severity: 'error',
|
|
37
|
+
rule: this.id,
|
|
38
|
+
message: `\`${qualified}\` is not a sub-component of \`${root}\`.${known}`,
|
|
39
|
+
evidence: evidence(match[0]),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return findings;
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
/** `<Hero variant="fancy">` where the prop is an enum with a fixed value set. */
|
|
46
|
+
const invalidPropValue = {
|
|
47
|
+
id: 'invalid-prop-value',
|
|
48
|
+
run(code, catalog) {
|
|
49
|
+
const findings = [];
|
|
50
|
+
for (const component of catalog.components) {
|
|
51
|
+
const enums = component.props.filter(prop => prop.enum && prop.enum.length > 0);
|
|
52
|
+
if (enums.length === 0)
|
|
53
|
+
continue;
|
|
54
|
+
for (const usage of componentUsage(code, component.name)) {
|
|
55
|
+
for (const prop of enums) {
|
|
56
|
+
const re = new RegExp(`\\b${escapeRegExp(prop.name)}=["']([^"']+)["']`, 'g');
|
|
57
|
+
for (const attr of usage[0].matchAll(re)) {
|
|
58
|
+
const value = attr[1];
|
|
59
|
+
if (value && !prop.enum?.includes(value)) {
|
|
60
|
+
findings.push({
|
|
61
|
+
severity: 'error',
|
|
62
|
+
rule: this.id,
|
|
63
|
+
message: `\`${component.name}\` prop \`${prop.name}\` does not accept \`"${value}"\`. Allowed: ${prop.enum?.map(v => `\`${v}\``).join(', ')}.`,
|
|
64
|
+
evidence: evidence(usage[0]),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return findings;
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
const RAW_HTML_PATTERNS = [
|
|
75
|
+
{
|
|
76
|
+
id: 'raw-form-elements',
|
|
77
|
+
test: /<(input|select|textarea|form)\b/i,
|
|
78
|
+
message: 'Raw form elements detected. Use Primer Brand form components (e.g. `FormControl`, `TextInput`, `Select`).',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'raw-pricing-table',
|
|
82
|
+
test: /<table\b/i,
|
|
83
|
+
message: 'Raw `<table>` detected. Use `PricingOptions` / `ComparisonTable` instead of a hand-built table.',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: 'raw-card-div',
|
|
87
|
+
test: /<div\b[^>]*class(Name)?=["'`][^"'`]*\bcard\b/i,
|
|
88
|
+
message: 'A hand-rolled card `<div className="card">` was detected. Use the Primer Brand `Card` component.',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'styled-heading',
|
|
92
|
+
test: /<h[1-6]\b[^>]*\b(style|class|className)=/i,
|
|
93
|
+
message: 'A styled raw heading was detected. Use the `Heading` (or `Hero.Heading`) component for type styles.',
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
const rawHtml = {
|
|
97
|
+
id: 'component-fidelity',
|
|
98
|
+
run(code) {
|
|
99
|
+
const findings = [];
|
|
100
|
+
for (const pattern of RAW_HTML_PATTERNS) {
|
|
101
|
+
const match = pattern.test.exec(code);
|
|
102
|
+
if (match) {
|
|
103
|
+
findings.push({ severity: 'warning', rule: pattern.id, message: pattern.message, evidence: evidence(match[0]) });
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return findings;
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
const hardcodedValues = {
|
|
110
|
+
id: 'token-usage',
|
|
111
|
+
run(code) {
|
|
112
|
+
const findings = [];
|
|
113
|
+
const hex = [...new Set([...code.matchAll(/#[0-9a-fA-F]{3,8}\b/g)].map(match => match[0]))];
|
|
114
|
+
if (hex.length > 0) {
|
|
115
|
+
findings.push({
|
|
116
|
+
severity: 'warning',
|
|
117
|
+
rule: 'hardcoded-hex',
|
|
118
|
+
message: `Hardcoded hex colors found (${hex
|
|
119
|
+
.slice(0, 4)
|
|
120
|
+
.join(', ')}). Use Primer Brand color tokens — see \`primer_brand_tokens\`.`,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
const px = [...new Set([...code.matchAll(/\b(\d+)px\b/g)].map(match => match[0]))].filter(value => value !== '0px');
|
|
124
|
+
if (px.length > 0) {
|
|
125
|
+
findings.push({
|
|
126
|
+
severity: 'warning',
|
|
127
|
+
rule: 'hardcoded-px',
|
|
128
|
+
message: `Hardcoded pixel sizes found (${px
|
|
129
|
+
.slice(0, 4)
|
|
130
|
+
.join(', ')}). Use size, spacing, or border-width tokens — see \`primer_brand_tokens\`.`,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return findings;
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
/** Statically detectable versions of the off-brand "tells" the visual judge penalizes. */
|
|
137
|
+
const OFF_BRAND_TELLS = [
|
|
138
|
+
{
|
|
139
|
+
id: 'off-brand-gradient',
|
|
140
|
+
test: /linear-gradient\([^)]*(purple|indigo|violet|#[46-9a-f][0-9a-f]?[0-9a-f]*f)/i,
|
|
141
|
+
message: 'A purple/indigo gradient is the classic off-brand "SaaS" tell and is penalized hard. Use neutral surfaces with a sparing functional accent.',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: 'pill-button',
|
|
145
|
+
test: /border-?radius:\s*['"]?\s*(9999px|50%|100px)/i,
|
|
146
|
+
message: 'Pill / fully-rounded shapes are off-brand. GitHub uses a modest, consistent corner radius except on Label components.',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: 'shadow-and-gradient',
|
|
150
|
+
test: /box-shadow:[^;]+;[\s\S]{0,200}gradient|gradient[\s\S]{0,200}box-shadow:/i,
|
|
151
|
+
message: 'Combining box-shadow with a gradient is a retired GitHub style. Prefer flat surfaces with thin 1px borders.',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: 'glassmorphism',
|
|
155
|
+
test: /backdrop-filter:\s*blur|frosted/i,
|
|
156
|
+
message: 'Glassmorphism / frosted blur is off-brand. Use flat surfaces separated by subtle 1px borders.',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: 'placeholder-copy',
|
|
160
|
+
test: /lorem ipsum|your text here|placeholder text/i,
|
|
161
|
+
message: 'Placeholder copy detected. GitHub pages use real, specific, technical copy.',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: 'serif-font',
|
|
165
|
+
test: /font-family:\s*[^;]*\bserif\b(?!-)/i,
|
|
166
|
+
message: 'Serif/display fonts are off-brand. GitHub uses Mona Sans / a clean system sans.',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: 'heavy-font-weight',
|
|
170
|
+
test: /font-weight:\s*(800|900|bolder)\b/i,
|
|
171
|
+
message: 'Ultra-heavy/black weights are off-brand. Favour regular and medium, with bold for genuine emphasis.',
|
|
172
|
+
},
|
|
173
|
+
];
|
|
174
|
+
const offBrandTells = {
|
|
175
|
+
id: 'off-brand-tells',
|
|
176
|
+
run(code) {
|
|
177
|
+
const findings = [];
|
|
178
|
+
for (const tell of OFF_BRAND_TELLS) {
|
|
179
|
+
const match = tell.test.exec(code);
|
|
180
|
+
if (match) {
|
|
181
|
+
findings.push({ severity: 'warning', rule: tell.id, message: tell.message, evidence: evidence(match[0]) });
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return findings;
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* `<Heading>` derives its visual size from `as` when no `size` is given, and those defaults are
|
|
189
|
+
* often far too big for list items, cards, or body sections. Flag a standalone `Heading` with no explicit `size`; sub-component headings such as
|
|
190
|
+
* `Hero.Heading` carry their own context-appropriate sizing and are intentionally not matched.
|
|
191
|
+
*/
|
|
192
|
+
const headingExplicitSize = {
|
|
193
|
+
id: 'heading-explicit-size',
|
|
194
|
+
run(code) {
|
|
195
|
+
for (const match of code.matchAll(/<Heading\b[^>]*>/g)) {
|
|
196
|
+
const tag = match[0];
|
|
197
|
+
// A spread could carry `size`, so don't second-guess it.
|
|
198
|
+
if (/\bsize=/.test(tag) || /\{\.\.\./.test(tag))
|
|
199
|
+
continue;
|
|
200
|
+
return [
|
|
201
|
+
{
|
|
202
|
+
severity: 'warning',
|
|
203
|
+
rule: this.id,
|
|
204
|
+
message: '`Heading` `as` sets the semantic level, not the visual size — without an explicit `size` it renders at display scale, usually too big for list items, cards, or body sections. Set `size` for the context (e.g. `size="5"`, `size="6"`, or `size="subhead-medium"`).',
|
|
205
|
+
evidence: evidence(tag),
|
|
206
|
+
},
|
|
207
|
+
];
|
|
208
|
+
}
|
|
209
|
+
return [];
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
/** Credit for actually importing approved brand components — surfaced as guidance, not a failure. */
|
|
213
|
+
export function brandComponentsUsed(code, catalog) {
|
|
214
|
+
const imported = new Set();
|
|
215
|
+
for (const block of code.matchAll(/import\s*(?:type\s*)?\{([^}]*)\}\s*from\s*['"]@primer\/react-brand(?:\/[^'"]+)?['"]/g)) {
|
|
216
|
+
for (const part of (block[1] ?? '').split(',')) {
|
|
217
|
+
const name = part
|
|
218
|
+
.trim()
|
|
219
|
+
.split(/\s+as\s+/)[0]
|
|
220
|
+
?.trim();
|
|
221
|
+
if (name)
|
|
222
|
+
imported.add(name);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return catalog.components.filter(component => imported.has(component.name));
|
|
226
|
+
}
|
|
227
|
+
export const allRules = [
|
|
228
|
+
unknownSubcomponents,
|
|
229
|
+
invalidPropValue,
|
|
230
|
+
rawHtml,
|
|
231
|
+
hardcodedValues,
|
|
232
|
+
offBrandTells,
|
|
233
|
+
headingExplicitSize,
|
|
234
|
+
];
|
|
235
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/review/rules.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAA0B,QAAQ,EAAC,MAAM,YAAY,CAAA;AAE5D;;;;;;GAMG;AAEH,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,IAAY,EAAsB,EAAE,CAAC;IACzE,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;CACrE,CAAA;AAED,mDAAmD;AACnD,MAAM,oBAAoB,GAAS;IACjC,EAAE,EAAE,sBAAsB;IAC1B,GAAG,CAAC,IAAI,EAAE,OAAO;QACf,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;QACxF,MAAM,QAAQ,GAAc,EAAE,CAAA;QAC9B,M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AI,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC;gBAAE,SAAQ;YACzD,OAAO;gBACL;oBACE,QAAQ,EAAE,SAAS;oBACnB,IAAI,EAAE,IAAI,CAAC,EAAE;oBACb,OAAO,EACL,sQAAsQ;oBACxQ,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC;iBACxB;aACF,CAAA;QACH,CAAC;QACD,OAAO,EAAE,CAAA;IACX,CAAC;CACF,CAAA;AAED,qGAAqG;AACrG,MAAM,UAAU,mBAAmB,CAAC,IAAY,EAAE,OAAgB;IAChE,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAA;IAClC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,CAC/B,sFAAsF,CACvF,EAAE,CAAC;QACF,KAAK,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/C,MAAM,IAAI,GAAG,IAAI;iBACd,IAAI,EAAE;iBACN,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBACrB,EAAE,IAAI,EAAE,CAAA;YACV,IAAI,IAAI;gBAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC9B,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;AAC7E,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAW;IAC9B,oBAAoB;IACpB,gBAAgB;IAChB,OAAO;IACP,eAAe;IACf,aAAa;IACb,mBAAmB;CACpB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Catalog } from '../catalog/types.js';
|
|
2
|
+
export type Severity = 'error' | 'warning';
|
|
3
|
+
export interface Finding {
|
|
4
|
+
severity: Severity;
|
|
5
|
+
rule: string;
|
|
6
|
+
message: string;
|
|
7
|
+
/** A short snippet of the offending source, for context. */
|
|
8
|
+
evidence?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface Rule {
|
|
11
|
+
id: string;
|
|
12
|
+
run(code: string, catalog: Catalog): Finding[];
|
|
13
|
+
}
|
|
14
|
+
/** Trim a matched snippet so findings stay compact in the agent's context. */
|
|
15
|
+
export declare function evidence(snippet: string, max?: number): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Trim a matched snippet so findings stay compact in the agent's context. */
|
|
2
|
+
export function evidence(snippet, max = 80) {
|
|
3
|
+
const collapsed = snippet.replace(/\s+/g, ' ').trim();
|
|
4
|
+
return collapsed.length > max ? `${collapsed.slice(0, max - 1)}\u2026` : collapsed;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/review/types.ts"],"names":[],"mappings":"AAiBA,8EAA8E;AAC9E,MAAM,UAAU,QAAQ,CAAC,OAAe,EAAE,GAAG,GAAG,EAAE;IAChD,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAA;IACrD,OAAO,SAAS,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAA;AACpF,CAAC"}
|
package/dist/server.d.ts
ADDED
package/dist/server.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
|
+
import { createDocsSource } from './brand/docs-source.js';
|
|
5
|
+
import { resolveInstalledAssets } from './brand/resolve-assets.js';
|
|
6
|
+
import { looksLikeProductProject, resolveBrandInstall } from './brand/resolve-install.js';
|
|
7
|
+
import { loadCatalog } from './catalog/load.js';
|
|
8
|
+
import { createLogger } from './logger.js';
|
|
9
|
+
import { registerTools } from './tools/register.js';
|
|
10
|
+
const INSTRUCTIONS = `Primer Brand design system tools for building GitHub web-based marketing experiences and landing pages with @primer/react-brand.
|
|
11
|
+
|
|
12
|
+
Use these tools whenever a project builds marketing/landing pages, or depends on the @primer/react-brand design system.
|
|
13
|
+
This is NOT @primer/react (GitHub's product UI library); if you are building application/product UI,
|
|
14
|
+
use the Primer (product) tools instead.
|
|
15
|
+
|
|
16
|
+
Typical flow: primer_brand_setup once at the start of a new page or project, primer_brand_examples to start
|
|
17
|
+
from correct patterns, primer_brand_component for exact props, primer_brand_tokens / primer_brand_asset for tokens and
|
|
18
|
+
icons, primer_brand_docs for guidance, and primer_brand_review as the final gate over your complete output (JSX and
|
|
19
|
+
CSS together) before you finish.`;
|
|
20
|
+
export function createServer() {
|
|
21
|
+
const logger = createLogger();
|
|
22
|
+
let version = '0.0.0';
|
|
23
|
+
try {
|
|
24
|
+
const packagePath = fileURLToPath(new URL('../package.json', import.meta.url));
|
|
25
|
+
version = JSON.parse(readFileSync(packagePath, 'utf8')).version ?? version;
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
// No package.json next to the bundle at runtime — fall back to the default version.
|
|
29
|
+
}
|
|
30
|
+
const server = new McpServer({ name: 'Primer Brand', version }, { instructions: INSTRUCTIONS });
|
|
31
|
+
const catalog = loadCatalog(logger);
|
|
32
|
+
const brand = resolveBrandInstall();
|
|
33
|
+
if (brand.found) {
|
|
34
|
+
logger.info(`using @primer/react-brand@${brand.version ?? 'unknown'} from ${brand.packageDir}`);
|
|
35
|
+
}
|
|
36
|
+
else if (looksLikeProductProject()) {
|
|
37
|
+
logger.warn('project depends on @primer/react (product UI), not @primer/react-brand; tools describe Primer Brand');
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
logger.info('no installed @primer/react-brand found; using the bundled snapshot');
|
|
41
|
+
}
|
|
42
|
+
const installedAssets = resolveInstalledAssets();
|
|
43
|
+
const assetsOrigin = installedAssets.assets.length > 0 ? 'installed' : 'snapshot';
|
|
44
|
+
const assets = installedAssets.assets.length > 0 ? installedAssets.assets : catalog.assets;
|
|
45
|
+
if (assetsOrigin === 'installed') {
|
|
46
|
+
const versions = installedAssets.sources.map(source => `${source.module}@${source.version ?? '?'}`).join(', ');
|
|
47
|
+
logger.info(`resolved icons/illustrations from installed packages: ${versions}`);
|
|
48
|
+
}
|
|
49
|
+
const docs = createDocsSource(brand, logger);
|
|
50
|
+
registerTools(server, { catalog, brand, docs, logger, assets, assetsOrigin });
|
|
51
|
+
return server;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAA;AACpC,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAA;AAEtC,OAAO,EAAC,SAAS,EAAC,MAAM,yCAAyC,CAAA;AAEjE,OAAO,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAC,sBAAsB,EAAC,MAAM,2BAA2B,CAAA;AAChE,OAAO,EAAC,uBAAuB,EAAE,mBAAmB,EAAC,MAAM,4BAA4B,CAAA;AACvF,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAA;AACxC,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAA;AAEjD,MAAM,YAAY,GAAG;;;;;;;;;iCASY,CAAA;AAEjC,MAAM,UAAU,YAAY;IAC1B,MAAM,MAAM,GAAG,YAAY,EAAE,CAAA;IAE7B,IAAI,OAAO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W,EAAE,CAAC;QACjC,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,IAAI,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC9G,MAAM,CAAC,IAAI,CAAC,yDAAyD,QAAQ,EAAE,CAAC,CAAA;IAClF,CAAC;IAED,MAAM,IAAI,GAAG,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;IAC5C,aAAa,CAAC,MAAM,EAAE,EAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAC,CAAC,CAAA;IAC3E,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CatalogComponent } from '../catalog/types.js';
|
|
2
|
+
import type { ToolContext } from './types.js';
|
|
3
|
+
/** The fields a component is ranked against for relevance: name, description, and docs keywords. */
|
|
4
|
+
export declare function componentSearchFields(component: CatalogComponent): Array<string | undefined>;
|
|
5
|
+
/** A short, consistent provenance line so agents (and humans) know what version answered. */
|
|
6
|
+
export declare function versionNote(ctx: ToolContext): string;
|
|
7
|
+
/** Render a single prop as a markdown bullet. */
|
|
8
|
+
export declare function formatProp(prop: {
|
|
9
|
+
name: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
enum?: string[];
|
|
12
|
+
required?: boolean;
|
|
13
|
+
default?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
}): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** The fields a component is ranked against for relevance: name, description, and docs keywords. */
|
|
2
|
+
export function componentSearchFields(component) {
|
|
3
|
+
return [component.name, component.description, component.keywords?.join(' ')];
|
|
4
|
+
}
|
|
5
|
+
/** A short, consistent provenance line so agents (and humans) know what version answered. */
|
|
6
|
+
export function versionNote(ctx) {
|
|
7
|
+
if (ctx.brand.found && ctx.brand.version) {
|
|
8
|
+
return `_Source: \`@primer/react-brand@${ctx.brand.version}\` installed in this project._`;
|
|
9
|
+
}
|
|
10
|
+
if (ctx.catalog.generatedFromVersion !== 'unknown') {
|
|
11
|
+
return `_Source: bundled snapshot of \`@primer/react-brand@${ctx.catalog.generatedFromVersion}\` (no install detected in this project)._`;
|
|
12
|
+
}
|
|
13
|
+
return '_Source: bundled Primer Brand snapshot._';
|
|
14
|
+
}
|
|
15
|
+
/** Render a single prop as a markdown bullet. */
|
|
16
|
+
export function formatProp(prop) {
|
|
17
|
+
const optional = prop.required ? '' : '?';
|
|
18
|
+
const valueType = prop.enum && prop.enum.length > 0 ? prop.enum.map(value => `'${value}'`).join(' | ') : prop.type ?? 'unknown';
|
|
19
|
+
const defaultSuffix = prop.default ? ` _(default: \`${prop.default}\`)_` : '';
|
|
20
|
+
const descriptionSuffix = prop.description ? ` — ${prop.description}` : '';
|
|
21
|
+
return `- \`${prop.name}${optional}\`: \`${valueType}\`${defaultSuffix}${descriptionSuffix}`;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/tools/format.ts"],"names":[],"mappings":"AAIA,oGAAoG;AACpG,MAAM,UAAU,qBAAqB,CAAC,SAA2B;IAC/D,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AAC/E,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,WAAW,CAAC,GAAgB;IAC1C,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACzC,OAAO,kCAAkC,GAAG,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAA;IAC5F,CAAC;IACD,IAAI,GAAG,CAAC,OAAO,CAAC,oBAAoB,KAAK,SAAS,EAAE,CAAC;QACnD,OAAO,sDAAsD,GAAG,CAAC,OAAO,CAAC,oBAAoB,4CAA4C,CAAA;IAC3I,CAAC;IACD,OAAO,0CAA0C,CAAA;AACnD,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,UAAU,CAAC,IAO1B;IACC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;IACzC,MAAM,SAAS,GACb,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,SAAS,CAAA;IAC/G,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,IAAI,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;IAC7E,MAAM,iBAAiB,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC1E,OAAO,OAAO,IAAI,CAAC,IAAI,GAAG,QAAQ,SAAS,SAAS,KAAK,aAAa,GAAG,iBAAiB,EAAE,CAAA;AAC9F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './primer-brand-asset.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/primer-brand-asset/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolModule } from '../types.js';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
query: z.ZodString;
|
|
5
|
+
kind: z.ZodOptional<z.ZodEnum<["icon", "illustration"]>>;
|
|
6
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
query: string;
|
|
9
|
+
limit: number;
|
|
10
|
+
kind?: "icon" | "illustration" | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
query: string;
|
|
13
|
+
kind?: "icon" | "illustration" | undefined;
|
|
14
|
+
limit?: number | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
type Input = z.infer<typeof inputSchema>;
|
|
17
|
+
export declare const primerBrandAssetTool: ToolModule<Input>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { rank } from '../../util/text.js';
|
|
3
|
+
const inputSchema = z.object({
|
|
4
|
+
query: z.string().describe('What you are looking for, e.g. "arrow", "shield", "rocket", "logo".'),
|
|
5
|
+
kind: z
|
|
6
|
+
.enum(['icon', 'illustration'])
|
|
7
|
+
.optional()
|
|
8
|
+
.describe('Restrict to Octicons ("icon") or Octovisuals ("illustration").'),
|
|
9
|
+
limit: z.number().int().min(1).max(50).optional().default(12).describe('Max results.'),
|
|
10
|
+
});
|
|
11
|
+
const description = `Find approved Primer Brand visuals as code imports: Octicons (@primer/octicons-react) and Octovisuals (@primer/octovisuals-react). Use these instead of emoji, clip art, or random icon sets — mismatched or emoji icons are off-brand.`;
|
|
12
|
+
export const primerBrandAssetTool = {
|
|
13
|
+
name: 'primer_brand_asset',
|
|
14
|
+
title: 'Primer Brand icons & illustrations',
|
|
15
|
+
description,
|
|
16
|
+
inputShape: inputSchema.shape,
|
|
17
|
+
annotations: { readOnlyHint: true },
|
|
18
|
+
run(input, ctx) {
|
|
19
|
+
const origin = ctx.assetsOrigin === 'installed'
|
|
20
|
+
? '_Resolved from the icon packages installed in your project._'
|
|
21
|
+
: '_From the bundled snapshot; your project may have a newer icon package installed._';
|
|
22
|
+
let assets = ctx.assets;
|
|
23
|
+
if (assets.length === 0) {
|
|
24
|
+
return { text: `No icon/illustration data is available.\n\n${origin}`, isError: true };
|
|
25
|
+
}
|
|
26
|
+
if (input.kind) {
|
|
27
|
+
assets = assets.filter(asset => asset.kind === input.kind);
|
|
28
|
+
}
|
|
29
|
+
const ranked = rank(input.query, assets, asset => [asset.name]).map(entry => entry.item);
|
|
30
|
+
if (ranked.length === 0) {
|
|
31
|
+
return {
|
|
32
|
+
text: `No ${input.kind ?? 'asset'} matched "${input.query}". Try a simpler term (e.g. "arrow", "check", "shield").\n\n${origin}`,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const shown = ranked.slice(0, input.limit);
|
|
36
|
+
const more = ranked.length > shown.length ? `\n\n_${ranked.length - shown.length} more — refine your query._` : '';
|
|
37
|
+
const lines = shown
|
|
38
|
+
.map(asset => `- \`${asset.name}\` _(${asset.kind})_ — \`import {${asset.name}} from '${asset.module}'\``)
|
|
39
|
+
.join('\n');
|
|
40
|
+
return { text: `${lines}${more}\n\n${origin}` };
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=primer-brand-asset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primer-brand-asset.js","sourceRoot":"","sources":["../../../src/tools/primer-brand-asset/primer-brand-asset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAA;AAGvC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qEAAqE,CAAC;IACjG,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC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A;QACxF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO;gBACL,IAAI,EAAE,MAAM,KAAK,CAAC,IAAI,IAAI,OAAO,aAC/B,KAAK,CAAC,KACR,+DAA+D,MAAM,EAAE;aACxE,CAAA;QACH,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;QAC1C,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,6BAA6B,CAAC,CAAC,CAAC,EAAE,CAAA;QAClH,MAAM,KAAK,GAAG,KAAK;aAChB,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,KAAK,CAAC,IAAI,QAAQ,KAAK,CAAC,IAAI,kBAAkB,KAAK,CAAC,IAAI,WAAW,KAAK,CAAC,MAAM,KAAK,CAAC;aACzG,IAAI,CAAC,IAAI,CAAC,CAAA;QACb,OAAO,EAAC,IAAI,EAAE,GAAG,KAAK,GAAG,IAAI,OAAO,MAAM,EAAE,EAAC,CAAA;IAC/C,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './primer-brand-component.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/primer-brand-component/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolModule } from '../types.js';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodOptional<z.ZodString>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
name?: string | undefined;
|
|
7
|
+
}, {
|
|
8
|
+
name?: string | undefined;
|
|
9
|
+
}>;
|
|
10
|
+
type Input = z.infer<typeof inputSchema>;
|
|
11
|
+
export declare const primerBrandComponentTool: ToolModule<Input>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { rank } from '../../util/text.js';
|
|
3
|
+
import { componentSearchFields, formatProp, versionNote } from '../format.js';
|
|
4
|
+
const inputSchema = z.object({
|
|
5
|
+
name: z
|
|
6
|
+
.string()
|
|
7
|
+
.optional()
|
|
8
|
+
.describe('Component name to look up (e.g. "Hero"). Omit to list every available component.'),
|
|
9
|
+
});
|
|
10
|
+
const description = `Primer Brand (@primer/react-brand) component reference for GitHub marketing and landing pages. Omit \`name\` to list every approved component; pass a \`name\` for its import, sub-components, props with allowed values, and a canonical example. The example is a real story snippet, so it may include Storybook \`{...args}\` spreads or imported demo assets to adapt rather than copy verbatim. Use this to avoid invented components or props. This is Primer Brand, not @primer/react product UI.`;
|
|
11
|
+
function listComponents(ctx) {
|
|
12
|
+
const { components } = ctx.catalog;
|
|
13
|
+
if (components.length === 0) {
|
|
14
|
+
return { text: `No component catalog is available.\n\n${versionNote(ctx)}`, isError: true };
|
|
15
|
+
}
|
|
16
|
+
const lines = [...components]
|
|
17
|
+
.sort((a, b) => a.name.localeCompare(b.name))
|
|
18
|
+
.map(component => `- \`${component.name}\`${component.description ? ` — ${component.description}` : ''}`);
|
|
19
|
+
return {
|
|
20
|
+
text: `${components.length} Primer Brand components are available. Call \`primer_brand_component\` with a \`name\` for full details.\n\n${lines.join('\n')}\n\n${versionNote(ctx)}`,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function describeComponent(component, ctx) {
|
|
24
|
+
const sections = [`# ${component.name} — \`${component.module}\``];
|
|
25
|
+
sections.push(`\`\`\`tsx\nimport {${component.name}} from '${component.module}'\n\`\`\``);
|
|
26
|
+
if (component.note) {
|
|
27
|
+
sections.push(`> **Note:** ${component.note}`);
|
|
28
|
+
}
|
|
29
|
+
if (component.subcomponents.length > 0) {
|
|
30
|
+
sections.push(`**Sub-components:** ${component.subcomponents.map(name => `\`${name}\``).join(', ')}`);
|
|
31
|
+
}
|
|
32
|
+
if (component.props.length > 0) {
|
|
33
|
+
const props = [...component.props].sort((a, b) => a.name.localeCompare(b.name)).map(formatProp);
|
|
34
|
+
sections.push(`## Props\n${props.join('\n')}`);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
sections.push('## Props\n_No prop metadata was extracted for this component; check the docs with `primer_brand_docs`._');
|
|
38
|
+
}
|
|
39
|
+
const example = component.examples.find(entry => entry.code);
|
|
40
|
+
if (example?.code) {
|
|
41
|
+
sections.push(`## Example\n\`\`\`tsx\n${example.code.trim()}\n\`\`\``);
|
|
42
|
+
}
|
|
43
|
+
sections.push(versionNote(ctx));
|
|
44
|
+
return { text: sections.join('\n\n') };
|
|
45
|
+
}
|
|
46
|
+
function getComponent(name, ctx) {
|
|
47
|
+
const { components } = ctx.catalog;
|
|
48
|
+
const match = components.find(component => component.name.toLowerCase() === name.toLowerCase());
|
|
49
|
+
if (match)
|
|
50
|
+
return describeComponent(match, ctx);
|
|
51
|
+
const suggestions = rank(name, components, componentSearchFields)
|
|
52
|
+
.slice(0, 5)
|
|
53
|
+
.map(entry => `\`${entry.item.name}\``);
|
|
54
|
+
const hint = suggestions.length > 0
|
|
55
|
+
? `Did you mean: ${suggestions.join(', ')}?`
|
|
56
|
+
: 'Call `primer_brand_component` with no arguments to list every component.';
|
|
57
|
+
return {
|
|
58
|
+
text: `There is no Primer Brand component named \`${name}\`. ${hint}\n\n${versionNote(ctx)}`,
|
|
59
|
+
isError: true,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export const primerBrandComponentTool = {
|
|
63
|
+
name: 'primer_brand_component',
|
|
64
|
+
title: 'Primer Brand component reference',
|
|
65
|
+
description,
|
|
66
|
+
inputShape: inputSchema.shape,
|
|
67
|
+
annotations: { readOnlyHint: true },
|
|
68
|
+
run(input, ctx) {
|
|
69
|
+
return input.name ? getComponent(input.name, ctx) : listComponents(ctx);
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=primer-brand-component.js.map
|