@urbicon-ui/mcp-server 6.30.1 → 6.31.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/package.json +3 -3
- package/src/tools/validate-design.ts +16 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@urbicon-ui/mcp-server",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.31.0",
|
|
4
4
|
"description": "Model Context Protocol server exposing the Urbicon UI component catalog, recipes and design intelligence to LLM agents",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
42
|
-
"@urbicon-ui/design-content": "6.
|
|
43
|
-
"@urbicon-ui/design-engine": "6.
|
|
42
|
+
"@urbicon-ui/design-content": "6.31.0",
|
|
43
|
+
"@urbicon-ui/design-engine": "6.31.0",
|
|
44
44
|
"zod": "^4.3.6"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
@@ -23,6 +23,19 @@ function renderFindings(findings: Finding[], severity: Severity): string {
|
|
|
23
23
|
return `${md}\n`;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
function renderSuppressed(report: LintReport): string {
|
|
27
|
+
const suppressed = report.suppressed ?? [];
|
|
28
|
+
if (suppressed.length === 0) return '';
|
|
29
|
+
let md = `### ⚪ Suppressed (${suppressed.reduce((a, s) => a + s.count, 0)})\n\n`;
|
|
30
|
+
md += 'Deliberate exemptions — excluded from counts/scores but always listed, never hidden:\n\n';
|
|
31
|
+
for (const s of suppressed) {
|
|
32
|
+
const via = s.source === 'pragma' ? '`urbicon-ignore` pragma' : 'caller `suppressRules`';
|
|
33
|
+
const unused = s.count === 0 ? ' — matched nothing (stale?)' : '';
|
|
34
|
+
md += `- **[${s.ruleId}]** ×${s.count} via ${via}${unused}\n`;
|
|
35
|
+
}
|
|
36
|
+
return `${md}\n`;
|
|
37
|
+
}
|
|
38
|
+
|
|
26
39
|
function renderReport(report: LintReport): string {
|
|
27
40
|
const { scores, counts, findings, filename } = report;
|
|
28
41
|
const hardFails = counts.error + counts.warning;
|
|
@@ -37,6 +50,7 @@ function renderReport(report: LintReport): string {
|
|
|
37
50
|
if (findings.length === 0) {
|
|
38
51
|
md +=
|
|
39
52
|
'No issues found. Tokens are valid, no `dark:`/`focus:`/hardcoded z-index, and the slop-floor heuristics are satisfied.\n';
|
|
53
|
+
md += renderSuppressed(report);
|
|
40
54
|
return md;
|
|
41
55
|
}
|
|
42
56
|
|
|
@@ -47,6 +61,7 @@ function renderReport(report: LintReport): string {
|
|
|
47
61
|
md += renderFindings(findings, 'error');
|
|
48
62
|
md += renderFindings(findings, 'warning');
|
|
49
63
|
md += renderFindings(findings, 'info');
|
|
64
|
+
md += renderSuppressed(report);
|
|
50
65
|
|
|
51
66
|
md += '---\n\n**Next steps:**\n';
|
|
52
67
|
md += '- `get_css_reference()` — exact valid token names (fixes hallucinated tokens)\n';
|
|
@@ -66,7 +81,7 @@ function renderReport(report: LintReport): string {
|
|
|
66
81
|
export function registerValidateDesignTool(server: McpServer): void {
|
|
67
82
|
server.tool(
|
|
68
83
|
'validate_design',
|
|
69
|
-
'Lint generated Svelte/HTML markup against the Urbicon UI design rules. Two axes, never mixed: (1) **correctness** — deterministic defects (raw Tailwind colours, `dark:`/`focus:` misuse, hardcoded z-index, broken dynamic classes, hallucinated tokens, foreign-library component APIs like `tone=`/`variant="outline"`, icon-only buttons with no accessible name), the blocking gate; (2) **slop-floor** — system-agnostic "looks generic" heuristics (generic fonts, animated width/height, magic-number sizes, low-contrast text on colour, inline styles, `!important`, placeholder copy, emoji-as-icon, heading-level skips, small touch targets, intent-colour rainbow, uniform spacing/weights, identical Cards), advisory. Returns a correctness score and a slop-floor score (both 0–100; correctness −10/error, −5/warning; slop −10 per signal; floored) plus per-finding fixes. Run in a generate → validate → fix loop after producing UI code. Pass `extraTokens` to whitelist semantic tokens your project defines on top of Urbicon’s so they are not flagged as hallucinated.',
|
|
84
|
+
'Lint generated Svelte/HTML markup against the Urbicon UI design rules. Two axes, never mixed: (1) **correctness** — deterministic defects (raw Tailwind colours, `dark:`/`focus:` misuse, hardcoded z-index, broken dynamic classes, hallucinated tokens, foreign-library component APIs like `tone=`/`variant="outline"`, icon-only buttons with no accessible name), the blocking gate; (2) **slop-floor** — system-agnostic "looks generic" heuristics (generic fonts, animated width/height, magic-number sizes, low-contrast text on colour, inline styles, `!important`, placeholder copy, emoji-as-icon, heading-level skips, small touch targets, intent-colour rainbow, uniform spacing/weights, identical Cards), advisory. Returns a correctness score and a slop-floor score (both 0–100; correctness −10/error, −5/warning; slop −10 per signal; floored) plus per-finding fixes. Run in a generate → validate → fix loop after producing UI code. Pass `extraTokens` to whitelist semantic tokens your project defines on top of Urbicon’s so they are not flagged as hallucinated. Class rules scan class attributes, slotClasses and tv()/script literals — prose that merely *quotes* an anti-pattern (docs, before/after examples) is not flagged. A deliberately off-system surface can exempt specific rules in-file via `<!-- urbicon-ignore rule-id … — reason -->`; suppressions are always reported, never silent.',
|
|
70
85
|
{
|
|
71
86
|
code: z
|
|
72
87
|
.string()
|