viewgate-mcp 1.0.37 → 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 +20 -36
  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,41 +260,25 @@ 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
  });
295
279
  const langHint = rawData.preferredLanguage === 'es'
296
- ? "[INSTRUCTION: Project is in SPANISH. Provide all comments and aiAnalysis in SPANISH.]\n\n"
297
- : "[INSTRUCTION: Provide all comments and aiAnalysis in English.]\n\n";
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";
298
282
  return {
299
283
  content: [{ type: "text", text: langHint + JSON.stringify({ preferredLanguage: rawData.preferredLanguage || 'en', annotations: annotationsWithTips }, null, 2) }],
300
284
  };
@@ -354,8 +338,8 @@ Lang: ${rawData.preferredLanguage === 'es' ? 'ES' : 'EN'}`
354
338
  throw new Error(`Backend responded with ${response.status}`);
355
339
  const data = (await response.json());
356
340
  const langHint = data.preferredLanguage === 'es'
357
- ? "[INSTRUCTION: Project is in SPANISH. Provide all comments and aiAnalysis in SPANISH.]\n\n"
358
- : (data.preferredLanguage === 'en' ? "[INSTRUCTION: Provide all comments and aiAnalysis in English.]\n\n" : "");
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" : "");
359
343
  return { content: [{ type: "text", text: langHint + JSON.stringify(data, null, 2) }] };
360
344
  }
361
345
  case "sync_endpoints": {
@@ -387,8 +371,8 @@ Lang: ${rawData.preferredLanguage === 'es' ? 'ES' : 'EN'}`
387
371
  throw new Error(`Backend responded with ${response.status}`);
388
372
  const data = (await response.json());
389
373
  const langHint = data.preferredLanguage === 'es'
390
- ? "[INSTRUCTION: Project is in SPANISH. Provide all comments and aiAnalysis in SPANISH.]\n\n"
391
- : (data.preferredLanguage === 'en' ? "[INSTRUCTION: Provide all comments and aiAnalysis in English.]\n\n" : "");
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" : "");
392
376
  return { content: [{ type: "text", text: langHint + JSON.stringify(data, null, 2) }] };
393
377
  }
394
378
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewgate-mcp",
3
- "version": "1.0.37",
3
+ "version": "1.0.38",
4
4
  "main": "dist/index.js",
5
5
  "bin": {
6
6
  "viewgate-mcp": "./dist/index.js"