viewgate-mcp 1.0.36 → 1.0.38

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 +31 -38
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -66,7 +66,7 @@ function createMcpServer(apiKey, personalKey) {
66
66
  },
67
67
  {
68
68
  name: "mark_annotation_ready",
69
- description: "Mark as ready/applied. Use internal IDs.",
69
+ description: "Mark as ready/applied. Use internal IDs. IMPORTANT: appliedChanges must be in the project's preferredLanguage (e.g. SPANISH).",
70
70
  inputSchema: {
71
71
  type: "object",
72
72
  properties: {
@@ -76,7 +76,7 @@ function createMcpServer(apiKey, personalKey) {
76
76
  type: "object",
77
77
  properties: {
78
78
  id: { type: "string", description: "Internal ID." },
79
- appliedChanges: { type: "string", description: "Summary." }
79
+ appliedChanges: { type: "string", description: "Summary of changes. (IMPORTANT: Must be in SPANISH if project is ES)" }
80
80
  },
81
81
  required: ["id", "appliedChanges"]
82
82
  }
@@ -102,7 +102,7 @@ function createMcpServer(apiKey, personalKey) {
102
102
  },
103
103
  {
104
104
  name: "planning",
105
- description: "Planning tool for backlog tickets. Fetch tickets or submit analysis.",
105
+ description: "Planning tool for backlog tickets. Fetch tickets or submit analysis. IMPORTANT: aiAnalysis must be in the project's preferredLanguage (e.g. SPANISH).",
106
106
  inputSchema: {
107
107
  type: "object",
108
108
  properties: {
@@ -117,7 +117,7 @@ function createMcpServer(apiKey, personalKey) {
117
117
  impacto: { type: "number", minimum: 1, maximum: 3 },
118
118
  riesgo: { type: "number", minimum: 1, maximum: 3 },
119
119
  tipo: { type: "string", enum: ["AI-friendly", "AI-assisted", "Human-critical"] },
120
- aiAnalysis: { type: "string" }
120
+ aiAnalysis: { type: "string", description: "Detailed analysis. (IMPORTANT: Must be in SPANISH if project is ES)" }
121
121
  },
122
122
  required: ["id", "complejidad", "incertidumbre", "impacto", "riesgo", "tipo", "aiAnalysis"]
123
123
  }
@@ -260,40 +260,27 @@ function createMcpServer(apiKey, personalKey) {
260
260
  const annotationsWithTips = sortedAnnotations.map((ann) => {
261
261
  const file = ann.reference?.source?.split(':')[0];
262
262
  const line = ann.reference?.source?.split(':')[1];
263
- const pendingCorrection = Array.isArray(ann.corrections)
264
- ? ann.corrections.find((c) => c.status === 'pending')
265
- : (typeof ann.corrections === 'string' ? { text: ann.corrections } : null);
266
263
  const figmaLinks = Array.isArray(ann.figmaReference)
267
264
  ? ann.figmaReference.filter((fr) => fr.link).map((fr) => `[${fr.name || 'Design'}](${fr.link})`).join(', ')
268
265
  : (ann.figmaReference && typeof ann.figmaReference === 'string' ? ann.figmaReference : null);
269
266
  return {
270
- id: ann._id,
271
- key: ann.key,
272
- priority: ann.priority,
273
- status: ann.status,
274
- message: ann.message,
275
- corrections: ann.corrections,
276
- source: ann.reference?.source,
277
- filePath: ann.filePath || file,
278
- line: ann.line || (line ? parseInt(line) : undefined),
279
- vgId: ann.reference?.vgId,
280
- outerHtml: ann.reference?.outerHtml,
281
- focusAreas: ann.focusAreas || [],
282
- componentName: ann.componentName,
283
- figmaReference: ann.figmaReference,
284
- backendEndpoints: ann.backendEndpoints || [],
285
- _ia_fix_instruction: `[AUTONOMOUS_MODE: TRUE]
286
- Target: ${file} (data-vg-id="${ann.reference?.vgId}")
287
- Context: ${ann.reference?.parentContext?.slice(0, 40)}...
288
- ${figmaLinks ? `Figma: ${figmaLinks}` : ''}
289
- ${ann.backendEndpoints?.length ? `Endpoints: ${ann.backendEndpoints.join(', ')}` : ''}
290
- ${ann.corrections && Array.isArray(ann.corrections) && ann.corrections.length > 0 ? `Feedback: ${ann.corrections[ann.corrections.length - 1].text}` : ''}
291
- Task: ${ann.message}
292
- Lang: ${rawData.preferredLanguage === 'es' ? 'ES' : 'EN'}`
267
+ ...ann,
268
+ _ia_fix_instruction: `### INSTRUCCIONES PARA LA IA (IMPORTANTE) ###
269
+ A continuación se presenta un ticket que requiere tu atención.
270
+ DEBES RESPONDER EN ESPAÑOL.
271
+ Proyecto: ${rawData.name || 'ViewGate'}
272
+ Endpoints: ${ann.backendEndpoints?.length ? ann.backendEndpoints.join(', ') : 'Ninguno'}
273
+ Feedback previo: ${ann.corrections && Array.isArray(ann.corrections) && ann.corrections.length > 0 ? ann.corrections[ann.corrections.length - 1].text : 'Ninguno'}
274
+ Tarea: ${ann.message}
275
+ Lang: ${rawData.preferredLanguage === 'es' ? 'ES' : 'EN'}
276
+ (RECUERDA: Toda tu respuesta, comentarios y análisis DEBEN estar en ESPAÑOL)`
293
277
  };
294
278
  });
279
+ const langHint = rawData.preferredLanguage === 'es'
280
+ ? "\n*** [INSTRUCTION: Project is in SPANISH. Provide all comments, appliedChanges, and aiAnalysis in SPANISH ONLY.] ***\n\n"
281
+ : "\n*** [INSTRUCTION: Provide all comments and analysis in English.] ***\n\n";
295
282
  return {
296
- content: [{ type: "text", text: JSON.stringify({ preferredLanguage: rawData.preferredLanguage || 'en', annotations: annotationsWithTips }, null, 2) }],
283
+ content: [{ type: "text", text: langHint + JSON.stringify({ preferredLanguage: rawData.preferredLanguage || 'en', annotations: annotationsWithTips }, null, 2) }],
297
284
  };
298
285
  }
299
286
  case "mark_annotation_ready": {
@@ -313,7 +300,7 @@ Lang: ${rawData.preferredLanguage === 'es' ? 'ES' : 'EN'}`
313
300
  });
314
301
  if (!response.ok)
315
302
  throw new Error(`Backend responded with ${response.status}`);
316
- const data = await response.json();
303
+ const data = (await response.json());
317
304
  return {
318
305
  content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
319
306
  };
@@ -333,7 +320,7 @@ Lang: ${rawData.preferredLanguage === 'es' ? 'ES' : 'EN'}`
333
320
  });
334
321
  if (!response.ok)
335
322
  throw new Error(`Backend responded with ${response.status}`);
336
- const data = await response.json();
323
+ const data = (await response.json());
337
324
  return {
338
325
  content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
339
326
  };
@@ -349,8 +336,11 @@ Lang: ${rawData.preferredLanguage === 'es' ? 'ES' : 'EN'}`
349
336
  });
350
337
  if (!response.ok)
351
338
  throw new Error(`Backend responded with ${response.status}`);
352
- const data = await response.json();
353
- return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
339
+ const data = (await response.json());
340
+ const langHint = data.preferredLanguage === 'es'
341
+ ? "\n*** [INSTRUCTION: Project is in SPANISH. Provide all comments, appliedChanges, and aiAnalysis in SPANISH ONLY.] ***\n\n\n\n"
342
+ : (data.preferredLanguage === 'en' ? "\n*** [INSTRUCTION: Provide all comments and analysis in English.] ***\n\n\n\n" : "");
343
+ return { content: [{ type: "text", text: langHint + JSON.stringify(data, null, 2) }] };
354
344
  }
355
345
  case "sync_endpoints": {
356
346
  const args = request.params.arguments;
@@ -370,7 +360,7 @@ Lang: ${rawData.preferredLanguage === 'es' ? 'ES' : 'EN'}`
370
360
  });
371
361
  if (!response.ok)
372
362
  throw new Error(`Backend responded with ${response.status}`);
373
- const data = await response.json();
363
+ const data = (await response.json());
374
364
  return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
375
365
  }
376
366
  case "get_ai_resolved_tickets": {
@@ -379,8 +369,11 @@ Lang: ${rawData.preferredLanguage === 'es' ? 'ES' : 'EN'}`
379
369
  });
380
370
  if (!response.ok)
381
371
  throw new Error(`Backend responded with ${response.status}`);
382
- const data = await response.json();
383
- return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
372
+ const data = (await response.json());
373
+ const langHint = data.preferredLanguage === 'es'
374
+ ? "\n*** [INSTRUCTION: Project is in SPANISH. Provide all comments, appliedChanges, and aiAnalysis in SPANISH ONLY.] ***\n\n\n\n"
375
+ : (data.preferredLanguage === 'en' ? "\n*** [INSTRUCTION: Provide all comments and analysis in English.] ***\n\n\n\n" : "");
376
+ return { content: [{ type: "text", text: langHint + JSON.stringify(data, null, 2) }] };
384
377
  }
385
378
  default:
386
379
  throw new Error("Unknown tool");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewgate-mcp",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "main": "dist/index.js",
5
5
  "bin": {
6
6
  "viewgate-mcp": "./dist/index.js"