sonance-brand-mcp 1.3.65 → 1.3.66

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.
@@ -3,7 +3,7 @@ import * as fs from "fs";
3
3
  import * as path from "path";
4
4
  import Anthropic from "@anthropic-ai/sdk";
5
5
  import { randomUUID } from "crypto";
6
- import { discoverTheme } from "./theme-discovery";
6
+ import { discoverTheme, formatThemeForPrompt } from "./theme-discovery";
7
7
  import * as babelParser from "@babel/parser";
8
8
 
9
9
  /**
@@ -935,14 +935,18 @@ ${linesWithNumbers}
935
935
  // NOTE: We intentionally skip SUPPORTING COMPONENTS to reduce noise
936
936
  // The LLM only needs the TARGET file to make accurate edits
937
937
 
938
- // ========== THEME DISCOVERY (REFERENCE ONLY) ==========
939
- // Dynamically discover theme tokens (minimal - just for logging)
938
+ // ========== THEME DISCOVERY ==========
939
+ // Discover theme tokens and contrast analysis to help LLM make informed color decisions
940
940
  const discoveredTheme = await discoverTheme(projectRoot);
941
941
 
942
942
  if (discoveredTheme.discoveredFiles.length > 0) {
943
943
  debugLog("Theme discovery complete", {
944
944
  filesFound: discoveredTheme.discoveredFiles,
945
945
  });
946
+
947
+ // Add theme context to the prompt so LLM knows actual color values and safe combinations
948
+ const themeContext = formatThemeForPrompt(discoveredTheme);
949
+ textContent += `\n${themeContext}\n`;
946
950
  }
947
951
 
948
952
  // ========== SIMPLIFIED INSTRUCTIONS ==========
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
2
2
  import * as fs from "fs";
3
3
  import * as path from "path";
4
4
  import Anthropic from "@anthropic-ai/sdk";
5
- import { discoverTheme } from "../sonance-vision-apply/theme-discovery";
5
+ import { discoverTheme, formatThemeForPrompt } from "../sonance-vision-apply/theme-discovery";
6
6
  import * as babelParser from "@babel/parser";
7
7
 
8
8
  /**
@@ -904,13 +904,18 @@ ${linesWithNumbers}
904
904
  // NOTE: We intentionally skip SUPPORTING COMPONENTS to reduce noise
905
905
  // The LLM only needs the TARGET file to make accurate edits
906
906
 
907
- // Dynamically discover theme tokens (minimal - just for logging)
907
+ // ========== THEME DISCOVERY ==========
908
+ // Discover theme tokens and contrast analysis to help LLM make informed color decisions
908
909
  const discoveredTheme = await discoverTheme(projectRoot);
909
910
 
910
911
  if (discoveredTheme.discoveredFiles.length > 0) {
911
912
  debugLog("Theme discovery complete", {
912
913
  filesFound: discoveredTheme.discoveredFiles,
913
914
  });
915
+
916
+ // Add theme context to the prompt so LLM knows actual color values and safe combinations
917
+ const themeContext = formatThemeForPrompt(discoveredTheme);
918
+ textContent += `\n${themeContext}\n`;
914
919
  }
915
920
 
916
921
  // ========== SIMPLIFIED INSTRUCTIONS ==========
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sonance-brand-mcp",
3
- "version": "1.3.65",
3
+ "version": "1.3.66",
4
4
  "description": "MCP Server for Sonance Brand Guidelines and Component Library - gives Claude instant access to brand colors, typography, and UI components.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",