viewgate-mcp 1.0.49 → 1.0.50
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 +2 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -102,6 +102,7 @@ function createMcpServer(apiKey, personalKey) {
|
|
|
102
102
|
// Implicit flow reset if we are starting a new flow with a "start tool"
|
|
103
103
|
switch (toolName) {
|
|
104
104
|
case "get_ui_components":
|
|
105
|
+
case "mark_ui_component_generated":
|
|
105
106
|
guard.flow = "ui_components";
|
|
106
107
|
guard.step = 1;
|
|
107
108
|
break;
|
|
@@ -142,18 +143,13 @@ function createMcpServer(apiKey, personalKey) {
|
|
|
142
143
|
}
|
|
143
144
|
if (guard.flow === "ui_components") {
|
|
144
145
|
if (toolName === "get_ui_components") {
|
|
145
|
-
if (guard.step > 2)
|
|
146
|
-
throw new Error("TOOL_CALL_BLOCKED: cannot restart flow at this step");
|
|
147
146
|
guard.step = 1;
|
|
148
147
|
}
|
|
149
148
|
else if (toolName === "generate_ui_components") {
|
|
150
|
-
if (guard.step !== 1)
|
|
151
|
-
throw new Error("TOOL_CALL_BLOCKED: unexpected step");
|
|
152
149
|
guard.step = 2;
|
|
153
150
|
}
|
|
154
151
|
else if (toolName === "mark_ui_component_generated") {
|
|
155
|
-
if
|
|
156
|
-
throw new Error("TOOL_CALL_BLOCKED: unexpected step");
|
|
152
|
+
// Allow finishing if it was started in this flow
|
|
157
153
|
resetGuard();
|
|
158
154
|
}
|
|
159
155
|
else {
|