viewgate-mcp 1.0.2 → 1.0.4

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 +82 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -42,7 +42,7 @@ function createMcpServer(apiKey) {
42
42
  tools: [
43
43
  {
44
44
  name: "get_annotations",
45
- description: "Retrieves all feedback annotations. For each annotation, follow the '_ia_fix_instruction' to perform a FAST, SURGICAL fix. Use 'outerHtml' and 'source' (file:line) to locate the exact code block without manual searching.",
45
+ description: "Retrieves all feedback annotations. For each annotation, follow the '_ia_fix_instruction' to perform a FAST, SURGICAL fix. Use 'outerHtml' and 'source' (file:line) to locate the exact code block without manual searching. IMPORTANT: All AI analysis and comments MUST be in the 'preferredLanguage' specified in the output.",
46
46
  inputSchema: {
47
47
  type: "object",
48
48
  properties: {},
@@ -69,6 +69,35 @@ function createMcpServer(apiKey) {
69
69
  },
70
70
  required: ["id", "originalMessage", "appliedChanges"]
71
71
  },
72
+ },
73
+ {
74
+ name: "planning",
75
+ description: "Planning tool for backlog tickets. CALL WITHOUT ARGUMENTS to fetch backlog tickets that need analysis. CALL WITH 'results' to submit AI analysis in batch. Rules: complejidad (1-3), incertidumbre (1-3), impacto (1-3), riesgo (1-3), tipo (AI-friendly|AI-assisted|Human-critical). IMPORTANT: All AI analysis and comments MUST be in the 'preferredLanguage' specified in the output.",
76
+ inputSchema: {
77
+ type: "object",
78
+ properties: {
79
+ results: {
80
+ type: "array",
81
+ items: {
82
+ type: "object",
83
+ properties: {
84
+ id: { type: "string", description: "The ticket/annotation ID" },
85
+ complejidad: { type: "number", minimum: 1, maximum: 3 },
86
+ incertidumbre: { type: "number", minimum: 1, maximum: 3 },
87
+ impacto: { type: "number", minimum: 1, maximum: 3 },
88
+ riesgo: { type: "number", minimum: 1, maximum: 3 },
89
+ tipo: { type: "string", enum: ["AI-friendly", "AI-assisted", "Human-critical"] },
90
+ aiAnalysis: { type: "string", description: "Reasoning or summary of the analysis" }
91
+ },
92
+ required: ["id", "complejidad", "incertidumbre", "impacto", "riesgo", "tipo", "aiAnalysis"]
93
+ }
94
+ },
95
+ force: {
96
+ type: "boolean",
97
+ description: "If true, overwrites existing planning data."
98
+ }
99
+ }
100
+ }
72
101
  }
73
102
  ],
74
103
  };
@@ -146,7 +175,10 @@ function createMcpServer(apiKey) {
146
175
  content: [
147
176
  {
148
177
  type: "text",
149
- text: JSON.stringify(annotationsWithTips, null, 2),
178
+ text: JSON.stringify({
179
+ preferredLanguage: data.preferredLanguage || 'en',
180
+ annotations: annotationsWithTips
181
+ }, null, 2),
150
182
  },
151
183
  ],
152
184
  };
@@ -188,6 +220,54 @@ function createMcpServer(apiKey) {
188
220
  };
189
221
  }
190
222
  }
223
+ case "planning": {
224
+ try {
225
+ const args = request.params.arguments;
226
+ if (!args.results) {
227
+ // Fetch Backlog Mode
228
+ const response = await fetch(`${BACKEND_URL}/api/mcp/backlog`, {
229
+ headers: { 'x-api-key': apiKey }
230
+ });
231
+ if (!response.ok) {
232
+ throw new Error(`Backend responded with ${response.status}`);
233
+ }
234
+ const data = (await response.json());
235
+ return {
236
+ content: [{
237
+ type: "text",
238
+ text: JSON.stringify({
239
+ preferredLanguage: data.preferredLanguage || 'en',
240
+ backlog: data.data || []
241
+ }, null, 2)
242
+ }]
243
+ };
244
+ }
245
+ else {
246
+ // Submit Results Mode
247
+ const response = await fetch(`${BACKEND_URL}/api/mcp/annotations/batch-planning`, {
248
+ method: 'PATCH',
249
+ headers: {
250
+ 'Content-Type': 'application/json',
251
+ 'x-api-key': apiKey
252
+ },
253
+ body: JSON.stringify({ results: args.results, force: args.force })
254
+ });
255
+ if (!response.ok) {
256
+ throw new Error(`Backend responded with ${response.status}`);
257
+ }
258
+ const result = await response.json();
259
+ return {
260
+ content: [{ type: "text", text: `Planning results processed: ${JSON.stringify(result, null, 2)}` }]
261
+ };
262
+ }
263
+ }
264
+ catch (error) {
265
+ return {
266
+ content: [{ type: "text", text: `Error in planning tool: ${error.message}` }],
267
+ isError: true
268
+ };
269
+ }
270
+ }
191
271
  default:
192
272
  throw new Error("Unknown tool");
193
273
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewgate-mcp",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "main": "dist/index.js",
5
5
  "bin": {
6
6
  "viewgate-mcp": "./dist/index.js"