sonance-brand-mcp 1.3.40 → 1.3.41
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.
|
@@ -597,22 +597,6 @@ User Request: "${userPrompt}"
|
|
|
597
597
|
|
|
598
598
|
`;
|
|
599
599
|
|
|
600
|
-
// Add recommendation if smart search identified a best match
|
|
601
|
-
if (recommendedFile) {
|
|
602
|
-
textContent += `═══════════════════════════════════════════════════════════════════════════════
|
|
603
|
-
⚡ RECOMMENDED FILE TO EDIT
|
|
604
|
-
═══════════════════════════════════════════════════════════════════════════════
|
|
605
|
-
|
|
606
|
-
Based on the screenshot analysis, the component you should edit is:
|
|
607
|
-
**${recommendedFile.path}**
|
|
608
|
-
Reason: ${recommendedFile.reason}
|
|
609
|
-
|
|
610
|
-
The page file (${pageContext.pageFile}) is just a wrapper - the actual UI elements are in the component above.
|
|
611
|
-
STRONGLY PREFER editing the recommended file unless you have a specific reason not to.
|
|
612
|
-
|
|
613
|
-
`;
|
|
614
|
-
}
|
|
615
|
-
|
|
616
600
|
if (focusedElements && focusedElements.length > 0) {
|
|
617
601
|
textContent += `FOCUSED ELEMENTS (user clicked on these):
|
|
618
602
|
${focusedElements.map((el) => `- ${el.name} (${el.type}) at (${el.coordinates.x}, ${el.coordinates.y})`).join("\n")}
|
|
@@ -669,9 +653,47 @@ GLOBALS.CSS (relevant theme variables):
|
|
|
669
653
|
${pageContext.globalsCSS.substring(0, 2000)}${pageContext.globalsCSS.length > 2000 ? "\n/* ... (truncated) */" : ""}
|
|
670
654
|
\`\`\`
|
|
671
655
|
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
656
|
+
`;
|
|
657
|
+
|
|
658
|
+
// Add recommendation block just before VALID FILES if we have one
|
|
659
|
+
if (recommendedFile) {
|
|
660
|
+
textContent += `═══════════════════════════════════════════════════════════════════════════════
|
|
661
|
+
⚡ RECOMMENDED FILE TO EDIT
|
|
662
|
+
═══════════════════════════════════════════════════════════════════════════════
|
|
663
|
+
|
|
664
|
+
Based on the screenshot analysis, the component you should edit is:
|
|
665
|
+
**${recommendedFile.path}**
|
|
666
|
+
Reason: ${recommendedFile.reason}
|
|
667
|
+
|
|
668
|
+
The page file (${pageContext.pageFile}) is just a wrapper - the actual UI elements are in the component above.
|
|
669
|
+
YOU MUST edit the recommended file unless you have a specific reason not to.
|
|
670
|
+
|
|
671
|
+
`;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
// Build VALID FILES list with recommended file first and marked
|
|
675
|
+
const validFilesList: string[] = [];
|
|
676
|
+
const recommendedPath = recommendedFile?.path;
|
|
677
|
+
|
|
678
|
+
// Add recommended file first with marker
|
|
679
|
+
if (recommendedPath) {
|
|
680
|
+
validFilesList.push(`- ${recommendedPath} (*** RECOMMENDED - EDIT THIS FILE ***)`);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
// Add page file (if not the recommended file)
|
|
684
|
+
if (pageContext.pageFile && pageContext.pageFile !== recommendedPath) {
|
|
685
|
+
validFilesList.push(`- ${pageContext.pageFile}`);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
// Add other component sources (excluding recommended file)
|
|
689
|
+
for (const comp of pageContext.componentSources) {
|
|
690
|
+
if (comp.path !== recommendedPath) {
|
|
691
|
+
validFilesList.push(`- ${comp.path}`);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
textContent += `VALID FILES YOU MAY EDIT:
|
|
696
|
+
${validFilesList.join("\n")}
|
|
675
697
|
|
|
676
698
|
INSTRUCTIONS:
|
|
677
699
|
1. Look at the screenshot and identify elements mentioned in the user's request
|
|
@@ -680,6 +702,7 @@ INSTRUCTIONS:
|
|
|
680
702
|
4. PRESERVE all existing logic, hooks, API calls, and error handling
|
|
681
703
|
5. Return the FULL file content (no truncation, no "// ... existing ..." comments)
|
|
682
704
|
6. Only use file paths from the VALID FILES list above
|
|
705
|
+
7. ALWAYS prioritize the (*** RECOMMENDED ***) file if one is marked - it contains the UI you see in the screenshot
|
|
683
706
|
|
|
684
707
|
CRITICAL: Your modified file should have approximately the same number of lines as the original. If the original has 200 lines and your output has 50 lines, you have made a mistake.`;
|
|
685
708
|
|
|
@@ -607,22 +607,6 @@ User Request: "${userPrompt}"
|
|
|
607
607
|
|
|
608
608
|
`;
|
|
609
609
|
|
|
610
|
-
// Add recommendation if smart search identified a best match
|
|
611
|
-
if (recommendedFile) {
|
|
612
|
-
textContent += `═══════════════════════════════════════════════════════════════════════════════
|
|
613
|
-
⚡ RECOMMENDED FILE TO EDIT
|
|
614
|
-
═══════════════════════════════════════════════════════════════════════════════
|
|
615
|
-
|
|
616
|
-
Based on the screenshot analysis, the component you should edit is:
|
|
617
|
-
**${recommendedFile.path}**
|
|
618
|
-
Reason: ${recommendedFile.reason}
|
|
619
|
-
|
|
620
|
-
The page file (${pageContext.pageFile}) is just a wrapper - the actual UI elements are in the component above.
|
|
621
|
-
STRONGLY PREFER editing the recommended file unless you have a specific reason not to.
|
|
622
|
-
|
|
623
|
-
`;
|
|
624
|
-
}
|
|
625
|
-
|
|
626
610
|
if (focusedElements && focusedElements.length > 0) {
|
|
627
611
|
textContent += `FOCUSED ELEMENTS (user clicked on these):
|
|
628
612
|
${focusedElements.map((el) => `- ${el.name} (${el.type}) at (${el.coordinates.x}, ${el.coordinates.y})`).join("\n")}
|
|
@@ -679,9 +663,47 @@ GLOBALS.CSS (relevant theme variables):
|
|
|
679
663
|
${pageContext.globalsCSS.substring(0, 2000)}${pageContext.globalsCSS.length > 2000 ? "\n/* ... (truncated) */" : ""}
|
|
680
664
|
\`\`\`
|
|
681
665
|
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
666
|
+
`;
|
|
667
|
+
|
|
668
|
+
// Add recommendation block just before VALID FILES if we have one
|
|
669
|
+
if (recommendedFile) {
|
|
670
|
+
textContent += `═══════════════════════════════════════════════════════════════════════════════
|
|
671
|
+
⚡ RECOMMENDED FILE TO EDIT
|
|
672
|
+
═══════════════════════════════════════════════════════════════════════════════
|
|
673
|
+
|
|
674
|
+
Based on the screenshot analysis, the component you should edit is:
|
|
675
|
+
**${recommendedFile.path}**
|
|
676
|
+
Reason: ${recommendedFile.reason}
|
|
677
|
+
|
|
678
|
+
The page file (${pageContext.pageFile}) is just a wrapper - the actual UI elements are in the component above.
|
|
679
|
+
YOU MUST edit the recommended file unless you have a specific reason not to.
|
|
680
|
+
|
|
681
|
+
`;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
// Build VALID FILES list with recommended file first and marked
|
|
685
|
+
const validFilesList: string[] = [];
|
|
686
|
+
const recommendedPath = recommendedFile?.path;
|
|
687
|
+
|
|
688
|
+
// Add recommended file first with marker
|
|
689
|
+
if (recommendedPath) {
|
|
690
|
+
validFilesList.push(`- ${recommendedPath} (*** RECOMMENDED - EDIT THIS FILE ***)`);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
// Add page file (if not the recommended file)
|
|
694
|
+
if (pageContext.pageFile && pageContext.pageFile !== recommendedPath) {
|
|
695
|
+
validFilesList.push(`- ${pageContext.pageFile}`);
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
// Add other component sources (excluding recommended file)
|
|
699
|
+
for (const comp of pageContext.componentSources) {
|
|
700
|
+
if (comp.path !== recommendedPath) {
|
|
701
|
+
validFilesList.push(`- ${comp.path}`);
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
textContent += `VALID FILES YOU MAY EDIT:
|
|
706
|
+
${validFilesList.join("\n")}
|
|
685
707
|
|
|
686
708
|
INSTRUCTIONS:
|
|
687
709
|
1. Look at the screenshot and identify elements mentioned in the user's request
|
|
@@ -690,6 +712,7 @@ INSTRUCTIONS:
|
|
|
690
712
|
4. Generate complete modified code for each file
|
|
691
713
|
5. Provide previewCSS for immediate visual feedback
|
|
692
714
|
6. Return as JSON in the specified format
|
|
715
|
+
7. ALWAYS prioritize the (*** RECOMMENDED ***) file if one is marked - it contains the UI you see in the screenshot
|
|
693
716
|
|
|
694
717
|
CRITICAL: Only use file paths from the VALID FILES list above. Do NOT create new files.`;
|
|
695
718
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sonance-brand-mcp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.41",
|
|
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",
|