@decantr/mcp-server 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -136,7 +136,7 @@ The server exposes Decantr registry, context, benchmark, and verification tools.
136
136
  | `decantr_suggest_patterns` | Given a page description plus optional route/source excerpt, get ranked pattern suggestions | `{ "description": "recipe feed with avatars and infinite scroll", "route": "/feed" }` |
137
137
  | `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" }` |
138
138
  | `decantr_get_execution_pack` | Read compiled scaffold, section, page, review, or mutation execution packs, with hosted fallback when local context is missing | `{ "pack_type": "page", "id": "overview", "format": "json" }` |
139
- | `decantr_prepare_task_context` | Resolve compact route/task context, authority lane, local law, evidence, and changed-file impact before editing a Brownfield, Hybrid, or Essence route | `{ "route": "/feed", "task": "improve recipe card loading" }` |
139
+ | `decantr_prepare_task_context` | Resolve compact route/task context, authority lane, local law, style bridge mappings, evidence, and changed-file impact before editing a Brownfield, Hybrid, or Essence route | `{ "route": "/feed", "task": "improve recipe card loading" }` |
140
140
  | `decantr_compile_execution_packs` | Compile a hosted execution-pack bundle from a local or inline essence document | `{ "path": "./decantr.essence.json", "namespace": "@official" }` |
141
141
  | `decantr_audit_project` | Run the schema-backed Decantr project audit against essence and compiled packs, with hosted fallback when local pack artifacts are missing | `{ "namespace": "@official" }` |
142
142
  | `decantr_critique` | Critique a file against the compiled review contract, with hosted fallback when local review packs are missing | `{ "file_path": "./src/pages/Overview.tsx", "namespace": "@official" }` |
@@ -177,7 +177,7 @@ The AI assistant calls these tools behind the scenes:
177
177
  3. `decantr_suggest_patterns` -- recommends `kpi-grid`, `chart-grid`, `data-table`, and `form-sections` for the described pages
178
178
  4. `decantr_resolve_pattern` -- fetches layout specs and component lists for each pattern
179
179
  5. `decantr_get_execution_pack` -- loads the compiled scaffold/page/review packs as the task contract, falling back to hosted compilation when local pack artifacts are missing
180
- 6. `decantr_prepare_task_context` -- resolves route-local Brownfield/Hybrid context, active authority, accepted local law, changed-file impact, visual evidence, and theme inventory before editing an existing app
180
+ 6. `decantr_prepare_task_context` -- resolves route-local Brownfield/Hybrid context, active authority, accepted local law, accepted style bridge mappings, changed-file impact, visual evidence, and theme inventory before editing an existing app
181
181
  7. `decantr_compile_execution_packs` -- compiles the hosted pack bundle when the task needs a fresh remote contract from the essence document
182
182
  8. `decantr_check_drift` -- validates the generated code against the Essence spec before presenting it
183
183
  9. `decantr_critique` -- critiques a specific file, falling back to the hosted verifier when the local review pack is missing
package/dist/bin.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-P2K3R43N.js";
2
+ import "./chunk-J2UBHHEI.js";
@@ -191,12 +191,29 @@ function localLawSummary(projectRoot) {
191
191
  })) ?? []
192
192
  };
193
193
  }
194
+ function styleBridgeSummary(projectRoot) {
195
+ const bridge = readJsonIfExists(join2(projectRoot, ".decantr", "style-bridge.json"));
196
+ return {
197
+ path: bridge ? ".decantr/style-bridge.json" : null,
198
+ status: bridge?.status ?? null,
199
+ styling_approach: bridge?.styling?.approach ?? null,
200
+ theme_modes: bridge?.styling?.themeModes ?? [],
201
+ mappings: bridge?.mappings?.map((mapping) => ({
202
+ id: mapping.id ?? "unknown",
203
+ label: mapping.label ?? null,
204
+ token_hints: mapping.tokenHints?.slice(0, 6) ?? [],
205
+ class_hints: mapping.classHints?.slice(0, 4) ?? [],
206
+ guardrails: mapping.guardrails?.slice(0, 3) ?? []
207
+ })) ?? []
208
+ };
209
+ }
194
210
  function mentionsWord(text, term) {
195
211
  const escaped = term.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
196
212
  return new RegExp(`\\b${escaped}\\b`, "i").test(text);
197
213
  }
198
214
  function taskAuthoritySummary(input) {
199
215
  const hasLocalLaw = input.localLaw.patterns.length > 0 || input.localLaw.rules.length > 0;
216
+ const hasStyleBridge = Boolean(input.styleBridge.path) || input.adoptionMode === "style-bridge";
200
217
  let lane = "Brownfield contract-only";
201
218
  let sourceAuthority = "Existing app is authoritative; Decantr supplies contract context.";
202
219
  let styleAuthority = "Use the existing styling system.";
@@ -209,11 +226,11 @@ function taskAuthoritySummary(input) {
209
226
  sourceAuthority = "Existing app remains authoritative except where Decantr CSS is explicitly adopted.";
210
227
  styleAuthority = "Decantr CSS runtime is active where adopted.";
211
228
  activeAuthorities.push("Decantr CSS runtime");
212
- } else if (input.workflowMode === "brownfield-attach" && input.adoptionMode === "style-bridge") {
229
+ } else if (input.workflowMode === "brownfield-attach" && hasStyleBridge) {
213
230
  lane = "Hybrid style bridge";
214
231
  sourceAuthority = "Existing app remains authoritative; Decantr intent maps through the style bridge.";
215
232
  styleAuthority = "Use bridge tokens/classes as a mapping layer onto the app styling system.";
216
- activeAuthorities.push("style bridge");
233
+ activeAuthorities.push("accepted style bridge");
217
234
  } else if (input.workflowMode === "brownfield-attach" && hasLocalLaw) {
218
235
  lane = "Hybrid local law";
219
236
  sourceAuthority = "Existing app plus accepted project-owned UI law are authoritative.";
@@ -2483,6 +2500,7 @@ async function handleTool(name, args) {
2483
2500
  join2(process.cwd(), ".decantr", "theme-inventory.json")
2484
2501
  );
2485
2502
  const localLaw = localLawSummary(process.cwd());
2503
+ const styleBridge = styleBridgeSummary(process.cwd());
2486
2504
  const projectJson = readJsonIfExists(join2(process.cwd(), ".decantr", "project.json"));
2487
2505
  const changedFiles = changedFilesForTask(process.cwd());
2488
2506
  const changedRoutes = impactedRoutesForFiles(process.cwd(), changedFiles);
@@ -2535,10 +2553,12 @@ async function handleTool(name, args) {
2535
2553
  path: ".decantr/theme-inventory.json"
2536
2554
  } : null,
2537
2555
  local_law: localLaw,
2556
+ style_bridge: styleBridge,
2538
2557
  authority: taskAuthoritySummary({
2539
2558
  workflowMode: projectJson?.initialized?.workflowMode ?? null,
2540
2559
  adoptionMode: projectJson?.initialized?.adoptionMode ?? null,
2541
2560
  localLaw,
2561
+ styleBridge,
2542
2562
  hasPackManifest: Boolean(manifest),
2543
2563
  task
2544
2564
  }),
@@ -2554,6 +2574,7 @@ async function handleTool(name, args) {
2554
2574
  section_context: existsSync(sectionContextPath) ? `.decantr/context/section-${section.id}.md` : null,
2555
2575
  local_patterns: localLaw.patterns_path,
2556
2576
  local_rules: localLaw.rules_path,
2577
+ style_bridge: styleBridge.path,
2557
2578
  visual_manifest: existsSync(
2558
2579
  join2(process.cwd(), ".decantr", "evidence", "visual-manifest.json")
2559
2580
  ) ? ".decantr/evidence/visual-manifest.json" : null
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import "./chunk-P2K3R43N.js";
1
+ import "./chunk-J2UBHHEI.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decantr/mcp-server",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "mcpName": "io.github.decantr-ai/mcp-server",
5
5
  "description": "MCP server for Decantr — exposes design intelligence, packs, and verification to AI coding assistants",
6
6
  "keywords": [
@@ -50,7 +50,7 @@
50
50
  "dependencies": {
51
51
  "@modelcontextprotocol/sdk": "^1.29.0",
52
52
  "@decantr/essence-spec": "2.0.1",
53
- "@decantr/verifier": "2.3.3",
53
+ "@decantr/verifier": "2.5.0",
54
54
  "@decantr/registry": "2.2.0"
55
55
  },
56
56
  "scripts": {