@decantr/mcp-server 1.0.0-beta.10 → 1.0.0-beta.11
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 +3 -5
- package/dist/bin.js +1 -1
- package/dist/{chunk-A5IEC7O2.js → chunk-ARK7P76H.js} +10 -43
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,17 +64,16 @@ Add to your Windsurf MCP config (`~/.windsurf/mcp.json`):
|
|
|
64
64
|
| `decantr_create_essence` | Generate an Essence spec skeleton from a project description | `{ "description": "SaaS dashboard with analytics and billing", "framework": "react" }` |
|
|
65
65
|
| `decantr_read_essence` | Read the current `decantr.essence.json` from the working directory | `{}` or `{ "path": "./custom.essence.json" }` |
|
|
66
66
|
| `decantr_validate` | Validate an Essence file against the schema and guard rules | `{ "path": "./decantr.essence.json" }` |
|
|
67
|
-
| `decantr_search_registry` | Search the community registry for patterns, archetypes,
|
|
67
|
+
| `decantr_search_registry` | Search the community registry for patterns, archetypes, themes, and shells | `{ "query": "kanban", "type": "pattern" }` |
|
|
68
68
|
| `decantr_resolve_pattern` | Get full pattern details: layout spec, components, presets, code examples | `{ "id": "data-table", "preset": "product" }` |
|
|
69
69
|
| `decantr_resolve_archetype` | Get archetype details: default pages, layouts, features, suggested theme | `{ "id": "saas-dashboard" }` |
|
|
70
|
-
| `decantr_resolve_recipe` | Get recipe decoration rules: shell styles, spatial hints, visual effects | `{ "id": "auradecantism" }` |
|
|
71
70
|
| `decantr_resolve_blueprint` | Get a full app composition with page structure and personality traits | `{ "id": "ecommerce" }` |
|
|
72
71
|
| `decantr_suggest_patterns` | Given a page description, get ranked pattern suggestions | `{ "description": "dashboard with metrics and charts" }` |
|
|
73
72
|
| `decantr_check_drift` | Check if generated code violates the design intent in the Essence spec | `{ "page_id": "overview", "components_used": ["Card", "LineChart"], "theme_used": "auradecantism" }` |
|
|
74
73
|
|
|
75
74
|
## How It Works
|
|
76
75
|
|
|
77
|
-
An Essence spec (`decantr.essence.json`) captures your design intent -- archetype, theme, page structure, patterns, and guard rules -- in a single declarative file. The MCP server exposes this spec and the Decantr registry to your AI assistant, giving it concrete layout specs, component lists, and
|
|
76
|
+
An Essence spec (`decantr.essence.json`) captures your design intent -- archetype, theme, page structure, patterns, and guard rules -- in a single declarative file. The MCP server exposes this spec and the Decantr registry to your AI assistant, giving it concrete layout specs, component lists, and visual treatments instead of relying on the model's generic training data. The result is generated code that follows a coherent design system, and drift detection that catches deviations before they ship.
|
|
78
77
|
|
|
79
78
|
## Example Workflow
|
|
80
79
|
|
|
@@ -86,8 +85,7 @@ The AI assistant calls these tools behind the scenes:
|
|
|
86
85
|
2. `decantr_resolve_archetype` -- pulls default pages, layouts, and features for a SaaS dashboard
|
|
87
86
|
3. `decantr_suggest_patterns` -- recommends `kpi-grid`, `chart-grid`, `data-table`, and `form-sections` for the described pages
|
|
88
87
|
4. `decantr_resolve_pattern` -- fetches layout specs and component lists for each pattern
|
|
89
|
-
5. `
|
|
90
|
-
6. `decantr_check_drift` -- validates the generated code against the Essence spec before presenting it
|
|
88
|
+
5. `decantr_check_drift` -- validates the generated code against the Essence spec before presenting it
|
|
91
89
|
|
|
92
90
|
The AI now generates code with the right layout structure, correct components, and consistent styling -- not a generic guess.
|
|
93
91
|
|
package/dist/bin.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-ARK7P76H.js";
|
|
@@ -893,12 +893,12 @@ var TOOLS = [
|
|
|
893
893
|
{
|
|
894
894
|
name: "decantr_search_registry",
|
|
895
895
|
title: "Search Registry",
|
|
896
|
-
description: "Search the Decantr community content registry for patterns, archetypes,
|
|
896
|
+
description: "Search the Decantr community content registry for patterns, archetypes, themes, and shells.",
|
|
897
897
|
inputSchema: {
|
|
898
898
|
type: "object",
|
|
899
899
|
properties: {
|
|
900
900
|
query: { type: "string", description: 'Search query (e.g. "kanban", "neon", "dashboard")' },
|
|
901
|
-
type: { type: "string", description: "Filter by type: pattern, archetype,
|
|
901
|
+
type: { type: "string", description: "Filter by type: pattern, archetype, theme, shell" }
|
|
902
902
|
},
|
|
903
903
|
required: ["query"]
|
|
904
904
|
},
|
|
@@ -935,22 +935,7 @@ var TOOLS = [
|
|
|
935
935
|
},
|
|
936
936
|
annotations: READ_ONLY_NETWORK
|
|
937
937
|
},
|
|
938
|
-
// 6.
|
|
939
|
-
{
|
|
940
|
-
name: "decantr_resolve_recipe",
|
|
941
|
-
title: "Resolve Recipe",
|
|
942
|
-
description: "Get recipe visual treatment overrides, decoration rules, shell styles, spatial hints, visual effects, and pattern preferences.",
|
|
943
|
-
inputSchema: {
|
|
944
|
-
type: "object",
|
|
945
|
-
properties: {
|
|
946
|
-
id: { type: "string", description: 'Recipe ID (e.g. "auradecantism")' },
|
|
947
|
-
namespace: { type: "string", description: 'Namespace (default: "@official")' }
|
|
948
|
-
},
|
|
949
|
-
required: ["id"]
|
|
950
|
-
},
|
|
951
|
-
annotations: READ_ONLY_NETWORK
|
|
952
|
-
},
|
|
953
|
-
// 7. decantr_resolve_blueprint — network
|
|
938
|
+
// 6. decantr_resolve_blueprint — network
|
|
954
939
|
{
|
|
955
940
|
name: "decantr_resolve_blueprint",
|
|
956
941
|
title: "Resolve Blueprint",
|
|
@@ -1075,7 +1060,7 @@ var TOOLS = [
|
|
|
1075
1060
|
{
|
|
1076
1061
|
name: "decantr_get_section_context",
|
|
1077
1062
|
title: "Get Section Context",
|
|
1078
|
-
description: "Get the self-contained context for a specific section of the project. Returns guard rules, theme tokens, visual treatments,
|
|
1063
|
+
description: "Get the self-contained context for a specific section of the project. Returns guard rules, theme tokens, visual treatments, pattern specs, zone context, and pages \u2014 everything an AI needs to work on that section.",
|
|
1079
1064
|
inputSchema: {
|
|
1080
1065
|
type: "object",
|
|
1081
1066
|
properties: {
|
|
@@ -1206,17 +1191,6 @@ async function handleTool(name, args) {
|
|
|
1206
1191
|
return { found: false, message: `Archetype "${args.id}" not found in ${namespace}.` };
|
|
1207
1192
|
}
|
|
1208
1193
|
}
|
|
1209
|
-
case "decantr_resolve_recipe": {
|
|
1210
|
-
const err = validateStringArg(args, "id");
|
|
1211
|
-
if (err) return { error: err };
|
|
1212
|
-
const namespace = args.namespace || "@official";
|
|
1213
|
-
try {
|
|
1214
|
-
const recipe = await apiClient.getRecipe(namespace, args.id);
|
|
1215
|
-
return { found: true, ...recipe };
|
|
1216
|
-
} catch {
|
|
1217
|
-
return { found: false, message: `Recipe "${args.id}" not found in ${namespace}.` };
|
|
1218
|
-
}
|
|
1219
|
-
}
|
|
1220
1194
|
case "decantr_resolve_blueprint": {
|
|
1221
1195
|
const err = validateStringArg(args, "id");
|
|
1222
1196
|
if (err) return { error: err };
|
|
@@ -1343,10 +1317,10 @@ async function handleTool(name, args) {
|
|
|
1343
1317
|
if (args.theme_used && typeof args.theme_used === "string") {
|
|
1344
1318
|
let expectedStyle;
|
|
1345
1319
|
if (isV32(essence)) {
|
|
1346
|
-
expectedStyle = essence.dna.theme.
|
|
1320
|
+
expectedStyle = essence.dna.theme.id;
|
|
1347
1321
|
} else {
|
|
1348
1322
|
const expectedTheme = essence.theme;
|
|
1349
|
-
expectedStyle = expectedTheme?.style;
|
|
1323
|
+
expectedStyle = expectedTheme?.id ?? expectedTheme?.style;
|
|
1350
1324
|
}
|
|
1351
1325
|
if (expectedStyle && args.theme_used !== expectedStyle) {
|
|
1352
1326
|
violations.push({
|
|
@@ -1504,9 +1478,8 @@ async function handleTool(name, args) {
|
|
|
1504
1478
|
version: "3.0.0",
|
|
1505
1479
|
dna: {
|
|
1506
1480
|
theme: {
|
|
1507
|
-
|
|
1481
|
+
id: "auradecantism",
|
|
1508
1482
|
mode: "dark",
|
|
1509
|
-
recipe: "auradecantism",
|
|
1510
1483
|
shape: "rounded"
|
|
1511
1484
|
},
|
|
1512
1485
|
spacing: {
|
|
@@ -1585,14 +1558,14 @@ async function handleTool(name, args) {
|
|
|
1585
1558
|
}
|
|
1586
1559
|
const hasDnaViolation = violations.some((v) => {
|
|
1587
1560
|
const rule = v.rule;
|
|
1588
|
-
return ["style", "
|
|
1561
|
+
return ["style", "density", "theme-mode", "accessibility", "theme-match"].includes(rule);
|
|
1589
1562
|
});
|
|
1590
1563
|
if (hasDnaViolation && resolution !== "reject" && resolution !== "defer" && !args.confirm_dna) {
|
|
1591
1564
|
return {
|
|
1592
1565
|
error: "DNA-layer violations detected. Set confirm_dna: true to accept changes to design axioms (theme, style, density, etc.).",
|
|
1593
1566
|
requires_confirmation: true,
|
|
1594
1567
|
dna_rules_affected: violations.filter(
|
|
1595
|
-
(v) => ["style", "
|
|
1568
|
+
(v) => ["style", "density", "theme-mode", "accessibility", "theme-match"].includes(v.rule)
|
|
1596
1569
|
).map((v) => v.rule)
|
|
1597
1570
|
};
|
|
1598
1571
|
}
|
|
@@ -1782,7 +1755,7 @@ function applyDriftAcceptance(essence, violation, resolution, scope) {
|
|
|
1782
1755
|
case "theme-match":
|
|
1783
1756
|
case "style": {
|
|
1784
1757
|
if (violation.details) {
|
|
1785
|
-
essence.dna.theme.
|
|
1758
|
+
essence.dna.theme.id = violation.details;
|
|
1786
1759
|
}
|
|
1787
1760
|
break;
|
|
1788
1761
|
}
|
|
@@ -1802,12 +1775,6 @@ function applyDriftAcceptance(essence, violation, resolution, scope) {
|
|
|
1802
1775
|
case "layout": {
|
|
1803
1776
|
break;
|
|
1804
1777
|
}
|
|
1805
|
-
case "recipe": {
|
|
1806
|
-
if (violation.details) {
|
|
1807
|
-
essence.dna.theme.recipe = violation.details;
|
|
1808
|
-
}
|
|
1809
|
-
break;
|
|
1810
|
-
}
|
|
1811
1778
|
case "density": {
|
|
1812
1779
|
break;
|
|
1813
1780
|
}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-ARK7P76H.js";
|