viewgate-mcp 1.0.30 → 1.0.32
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/dist/index.js +13 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -181,7 +181,8 @@ function createMcpServer(apiKey, personalKey) {
|
|
|
181
181
|
keysToFetch = keysToFetch.concat(args.keys);
|
|
182
182
|
const combinedKey = keysToFetch.filter(k => k).join(',');
|
|
183
183
|
const idsToFetch = args.ids || '';
|
|
184
|
-
|
|
184
|
+
const agentId = personalKey || 'mcp-agent-' + (apiKey?.slice(-6) || 'generic');
|
|
185
|
+
let fetchUrl = `${BACKEND_URL}/api/mcp/annotations?lock=true&agentId=${encodeURIComponent(agentId)}`;
|
|
185
186
|
if (statuses && statuses !== 'all')
|
|
186
187
|
fetchUrl += `&status=${statuses}`;
|
|
187
188
|
if (limit)
|
|
@@ -252,6 +253,9 @@ function createMcpServer(apiKey, personalKey) {
|
|
|
252
253
|
const pendingCorrection = Array.isArray(ann.corrections)
|
|
253
254
|
? ann.corrections.find((c) => c.status === 'pending')
|
|
254
255
|
: (typeof ann.corrections === 'string' ? { text: ann.corrections } : null);
|
|
256
|
+
const figmaLinks = Array.isArray(ann.figmaReference)
|
|
257
|
+
? ann.figmaReference.filter((fr) => fr.link).map((fr) => `[${fr.name || 'Design'}](${fr.link})`).join(', ')
|
|
258
|
+
: (ann.figmaReference && typeof ann.figmaReference === 'string' ? ann.figmaReference : null);
|
|
255
259
|
return {
|
|
256
260
|
id: ann._id,
|
|
257
261
|
key: ann.key,
|
|
@@ -264,10 +268,16 @@ function createMcpServer(apiKey, personalKey) {
|
|
|
264
268
|
line: ann.line || (line ? parseInt(line) : undefined),
|
|
265
269
|
vgId: ann.reference?.vgId,
|
|
266
270
|
outerHtml: ann.reference?.outerHtml,
|
|
271
|
+
focusAreas: ann.focusAreas || [],
|
|
272
|
+
componentName: ann.componentName,
|
|
273
|
+
figmaReference: ann.figmaReference,
|
|
274
|
+
backendEndpoints: ann.backendEndpoints || [],
|
|
267
275
|
_ia_fix_instruction: `### 🎯 DESIGN CONTEXT (Figma)
|
|
268
|
-
${
|
|
276
|
+
${figmaLinks ? `Design references: ${figmaLinks}` : 'No explicit design linked.'}
|
|
269
277
|
|
|
270
|
-
${
|
|
278
|
+
${ann.backendEndpoints?.length ? `### 🔌 BACKEND CONTEXT\nRelated endpoints: ${ann.backendEndpoints.join(', ')}` : ''}
|
|
279
|
+
|
|
280
|
+
${ann.corrections && Array.isArray(ann.corrections) && ann.corrections.length > 0 ? `### ⚠️ CORRECTION HISTORY\n${ann.corrections.map((c, i) => `Correction ${i + 1}: "${c.text}" (Status: ${c.status})`).join('\n')}` : ''}
|
|
271
281
|
|
|
272
282
|
### 🔬 FIX PROTOCOL
|
|
273
283
|
1. **Target**: \`data-vg-id="${ann.reference?.vgId}"\` in \`${file}\`.
|