viewgate-mcp 1.0.61 → 1.0.62

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 +17 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -148,10 +148,8 @@ function createMcpServer(apiKey, personalKey) {
148
148
  }
149
149
  else if (toolName === "generate_ui_components") {
150
150
  guard.step = 2;
151
- }
152
- else if (toolName === "mark_ui_component_generated") {
153
- // Allow finishing if it was started in this flow
154
- resetGuard();
151
+ // Step 3 is now terminal, but we reset after success in the handler
152
+ guard.step = 3;
155
153
  }
156
154
  else {
157
155
  throw new Error("TOOL_CALL_BLOCKED: tool not allowed in active flow");
@@ -165,8 +163,8 @@ function createMcpServer(apiKey, personalKey) {
165
163
  else if (toolName === "mark_annotations_as_live") {
166
164
  if (guard.step !== 1)
167
165
  throw new Error("TOOL_CALL_BLOCKED: unexpected step");
168
- // Stop here and reset flow as per USER_REQUEST (MCP only reaches 'applied')
169
- resetGuard();
166
+ // Reset moved to success handler
167
+ guard.step = 2;
170
168
  }
171
169
  else {
172
170
  throw new Error("TOOL_CALL_BLOCKED: tool not allowed in active flow");
@@ -179,7 +177,7 @@ function createMcpServer(apiKey, personalKey) {
179
177
  else if (toolName === "mark_annotations_as_live") {
180
178
  if (guard.step !== 1)
181
179
  throw new Error("TOOL_CALL_BLOCKED: unexpected step");
182
- resetGuard();
180
+ guard.step = 2;
183
181
  }
184
182
  else {
185
183
  throw new Error("TOOL_CALL_BLOCKED: tool not allowed in active flow");
@@ -198,7 +196,8 @@ function createMcpServer(apiKey, personalKey) {
198
196
  else {
199
197
  if (guard.step !== 1)
200
198
  throw new Error("TOOL_CALL_BLOCKED: unexpected step");
201
- resetGuard();
199
+ // Reset moved to success handler
200
+ guard.step = 2;
202
201
  }
203
202
  }
204
203
  else if (guard.flow === "sync") {
@@ -398,6 +397,7 @@ function createMcpServer(apiKey, personalKey) {
398
397
  const errorBody = await response.text();
399
398
  throw new Error(`Backend responded with ${response.status}: ${errorBody}`);
400
399
  }
400
+ resetGuard();
401
401
  const data = (await response.json());
402
402
  const styleHandler = data?.settings?.styleHandler || 'unknown';
403
403
  const language = data?.settings?.language || 'en';
@@ -489,6 +489,7 @@ function createMcpServer(apiKey, personalKey) {
489
489
  'MUST use Tailwind standard "primary" class (e.g. bg-primary, text-primary-foreground) as these are dynamically injected in the dashboard.',
490
490
  'The theme prop MUST be optional and typed in the component interface.',
491
491
  'Micro-animations MUST be implemented with Framer Motion (use whileHover, whileTap, etc.)',
492
+ 'AESTHETIC PERFECTION: The generated component MUST be an EXACT visual match of the source design. Pay extreme attention to spacing, shadows, and subtle gradients.',
492
493
  ]
493
494
  },
494
495
  constraints: {
@@ -501,7 +502,9 @@ function createMcpServer(apiKey, personalKey) {
501
502
  mustBeProductionReady: true,
502
503
  mustUseFramerMotionForAnimations: true,
503
504
  themingIsMandatory: true,
504
- stylingHandlerIsStrict: true
505
+ stylingHandlerIsStrict: true,
506
+ mustBeAestheticallyIdentical: true,
507
+ visualFidelityInstruction: "You MUST ensure 100% visual parity. The output component must be PREMIUM and indistinguishable from the provided Figma design in terms of layout, spacing, and styling tokens."
505
508
  }
506
509
  };
507
510
  results.push({
@@ -528,6 +531,7 @@ function createMcpServer(apiKey, personalKey) {
528
531
  2) REGISTRAR LA PREVIEW usando 'mark_ui_component_generated'.
529
532
 
530
533
  REQUISITO TECNOLÓGICO OBLIGATORIO: Usar ${styleLabel} para TODOS los estilos.
534
+ REQUISITO DE FIDELIDAD ESTÉTICA: El componente debe ser VISUALMENTE IDÉNTICO al original. Respeta cada píxel de espaciado, sombras y pesos de fuente.
531
535
  REQUISITO DE THEMING: DEBES respetar las themingTokens. NUNCA hardcodees colores (#hex, etc). Usa SIEMPRE la prop 'theme' o el fallback 'var(--vg-*)'.
532
536
  NOTA: Si styleHandler es '${styleHandler}', NO utilices otra tecnología distinta aunque los archivos originales (Figma HTML/CSS) digan lo contrario.`,
533
537
  results
@@ -710,6 +714,7 @@ Lang: ${rawData.preferredLanguage === 'es' ? 'ES' : 'EN'}
710
714
  });
711
715
  if (!response.ok)
712
716
  throw new Error(`Backend responded with ${response.status}`);
717
+ resetGuard();
713
718
  const data = (await response.json());
714
719
  return {
715
720
  content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
@@ -730,6 +735,9 @@ Lang: ${rawData.preferredLanguage === 'es' ? 'ES' : 'EN'}
730
735
  });
731
736
  if (!response.ok)
732
737
  throw new Error(`Backend responded with ${response.status}`);
738
+ if (args.results) {
739
+ resetGuard();
740
+ }
733
741
  const data = (await response.json());
734
742
  // Point: Version Storing
735
743
  if (data.backlogVersion)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewgate-mcp",
3
- "version": "1.0.61",
3
+ "version": "1.0.62",
4
4
  "main": "dist/index.js",
5
5
  "bin": {
6
6
  "viewgate-mcp": "./dist/index.js"