viewgate-mcp 1.0.15 → 1.0.16

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -228,7 +228,7 @@ function createMcpServer(apiKey, personalKey) {
228
228
  figmaReference: ann.figmaReference,
229
229
  backendEndpoints: ann.backendEndpoints || [ann.backendEndpoint].filter(Boolean),
230
230
  _ia_fix_instruction: `### 🎨 DESIGN CONTEXT (Figma)
231
- ${ann.figmaReference ? `A design reference is available: ${ann.figmaReference}. Use the 'get_figma_preview' tool to fetch design details and image previews before implementing.` : 'No explicit figma design linked.'}
231
+ ${ann.figmaReference ? `A design reference is available: ${Array.isArray(ann.figmaReference) ? (ann.figmaReference[0]?.link || ann.figmaReference[0]) : (ann.figmaReference.link || ann.figmaReference)}. Use the 'get_figma_preview' tool to fetch design details and image previews before implementing.` : 'No explicit figma design linked.'}
232
232
 
233
233
  ### 🔬 SURGICAL FIX PROTOCOL (Language: ${data.preferredLanguage || 'en'})
234
234
  1. **PRIMARY**: Search for \`data-vg-id="${ann.reference?.vgId}"\`.
@@ -431,16 +431,20 @@ Instruction: ${ann.message}`
431
431
  };
432
432
  }
433
433
  // 2. Parse Figma URL
434
- const fileKeyMatch = url.match(/(file|design)\/([a-zA-Z0-9]+)/);
434
+ const fileKeyMatch = url.match(/(?:file|design)\/([a-zA-Z0-9]+)/);
435
435
  if (!fileKeyMatch) {
436
436
  throw new Error("Invalid Figma URL format. File key not found.");
437
437
  }
438
- const fileKey = fileKeyMatch[2];
438
+ const fileKey = fileKeyMatch[1];
439
439
  // Extract node-id if present
440
440
  const urlObj = new URL(url.replace(/#/g, '?')); // Handle hash-based node-id
441
441
  let nodeId = urlObj.searchParams.get('node-id') || urlObj.searchParams.get('m');
442
442
  if (!nodeId && url.includes('node-id=')) {
443
- nodeId = url.split('node-id=')[1].split('&')[0].replace('%3A', ':');
443
+ nodeId = url.split('node-id=')[1].split('&')[0];
444
+ }
445
+ // Figma API expects node-id with : instead of - (which is used in browser URL)
446
+ if (nodeId) {
447
+ nodeId = nodeId.replace(/%3A/g, ':').replace(/-/g, ':');
444
448
  }
445
449
  // 3. Fetch Data from Figma
446
450
  // First get file info
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewgate-mcp",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "main": "dist/index.js",
5
5
  "bin": {
6
6
  "viewgate-mcp": "./dist/index.js"