@_davideast/stitch-mcp 0.4.0 → 0.5.0

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 (210) hide show
  1. package/dist/chunk-25wakzyb.js +137 -0
  2. package/dist/chunk-25wakzyb.js.map +10 -0
  3. package/dist/chunk-2cetsfw4.js +16531 -0
  4. package/dist/chunk-2cetsfw4.js.map +95 -0
  5. package/dist/chunk-2fcdwvrm.js +54 -0
  6. package/dist/chunk-2fcdwvrm.js.map +10 -0
  7. package/dist/chunk-2k7n0w2x.js +3980 -0
  8. package/dist/chunk-2k7n0w2x.js.map +16 -0
  9. package/dist/chunk-2kyqsrg2.js +403 -0
  10. package/dist/chunk-2kyqsrg2.js.map +10 -0
  11. package/dist/chunk-384jmtpy.js +11057 -0
  12. package/dist/chunk-384jmtpy.js.map +238 -0
  13. package/dist/chunk-3at4pjgn.js +22 -0
  14. package/dist/chunk-3at4pjgn.js.map +9 -0
  15. package/dist/chunk-3sfn889r.js +492 -0
  16. package/dist/chunk-3sfn889r.js.map +13 -0
  17. package/dist/chunk-45wx7tn7.js +94 -0
  18. package/dist/chunk-45wx7tn7.js.map +10 -0
  19. package/dist/chunk-48d17n29.js +10 -0
  20. package/dist/chunk-48d17n29.js.map +9 -0
  21. package/dist/chunk-4jwmvjb4.js +839 -0
  22. package/dist/chunk-4jwmvjb4.js.map +11 -0
  23. package/dist/chunk-4jygt4d6.js +14 -0
  24. package/dist/chunk-4jygt4d6.js.map +10 -0
  25. package/dist/chunk-4vxy1qce.js +68 -0
  26. package/dist/chunk-4vxy1qce.js.map +10 -0
  27. package/dist/chunk-7tx0wn04.js +11 -0
  28. package/dist/chunk-7tx0wn04.js.map +9 -0
  29. package/dist/chunk-7xh1y383.js +45188 -0
  30. package/dist/chunk-7xh1y383.js.map +258 -0
  31. package/dist/chunk-8yrtq2qs.js +18 -0
  32. package/dist/chunk-8yrtq2qs.js.map +9 -0
  33. package/dist/chunk-985f11w6.js +21 -0
  34. package/dist/chunk-985f11w6.js.map +9 -0
  35. package/dist/chunk-9tvppjaf.js +250 -0
  36. package/dist/chunk-9tvppjaf.js.map +14 -0
  37. package/dist/chunk-9wyra8hs.js +32 -0
  38. package/dist/chunk-9wyra8hs.js.map +9 -0
  39. package/dist/chunk-cwkb2wbe.js +733 -0
  40. package/dist/chunk-cwkb2wbe.js.map +16 -0
  41. package/dist/chunk-djhzzcgj.js +362 -0
  42. package/dist/chunk-djhzzcgj.js.map +13 -0
  43. package/dist/chunk-edp6faw2.js +7 -0
  44. package/dist/chunk-edp6faw2.js.map +9 -0
  45. package/dist/chunk-ezmw2j8c.js +14 -0
  46. package/dist/chunk-ezmw2j8c.js.map +9 -0
  47. package/dist/chunk-f2hq6bfv.js +22 -0
  48. package/dist/chunk-f2hq6bfv.js.map +10 -0
  49. package/dist/chunk-fwb4fnkp.js +31 -0
  50. package/dist/chunk-fwb4fnkp.js.map +10 -0
  51. package/dist/chunk-h18jrqed.js +9517 -0
  52. package/dist/chunk-h18jrqed.js.map +99 -0
  53. package/dist/chunk-hb3c6f6a.js +42 -0
  54. package/dist/chunk-hb3c6f6a.js.map +9 -0
  55. package/dist/chunk-jy2d17pr.js +252 -0
  56. package/dist/chunk-jy2d17pr.js.map +11 -0
  57. package/dist/chunk-kbtqrkwh.js +24 -0
  58. package/dist/chunk-kbtqrkwh.js.map +10 -0
  59. package/dist/chunk-knbnsf6s.js +92 -0
  60. package/dist/chunk-knbnsf6s.js.map +10 -0
  61. package/dist/chunk-mv9ssgmx.js +446 -0
  62. package/dist/chunk-mv9ssgmx.js.map +17 -0
  63. package/dist/chunk-nq68kghz.js +1647 -0
  64. package/dist/chunk-nq68kghz.js.map +10 -0
  65. package/dist/chunk-nthabjd9.js +3138 -0
  66. package/dist/chunk-nthabjd9.js.map +34 -0
  67. package/dist/chunk-nxpzt33t.js +278 -0
  68. package/dist/chunk-nxpzt33t.js.map +10 -0
  69. package/dist/chunk-pfyjtfex.js +172 -0
  70. package/dist/chunk-pfyjtfex.js.map +10 -0
  71. package/dist/chunk-q1nd6g0y.js +392 -0
  72. package/dist/chunk-q1nd6g0y.js.map +20 -0
  73. package/dist/chunk-q4js8r0z.js +4708 -0
  74. package/dist/chunk-q4js8r0z.js.map +29 -0
  75. package/dist/chunk-qv44tmn6.js +289 -0
  76. package/dist/chunk-qv44tmn6.js.map +13 -0
  77. package/dist/chunk-r2sg2nxa.js +20 -0
  78. package/dist/chunk-r2sg2nxa.js.map +9 -0
  79. package/dist/chunk-rp8wjzht.js +16959 -0
  80. package/dist/chunk-rp8wjzht.js.map +26 -0
  81. package/dist/chunk-rpxnm86e.js +372 -0
  82. package/dist/chunk-rpxnm86e.js.map +17 -0
  83. package/dist/chunk-sdp429xd.js +914 -0
  84. package/dist/chunk-sdp429xd.js.map +24 -0
  85. package/dist/chunk-t85nbjjb.js +113 -0
  86. package/dist/chunk-t85nbjjb.js.map +10 -0
  87. package/dist/chunk-tz7wnw4s.js +211 -0
  88. package/dist/chunk-tz7wnw4s.js.map +11 -0
  89. package/dist/chunk-v7117ywx.js +1477 -0
  90. package/dist/chunk-v7117ywx.js.map +23 -0
  91. package/dist/chunk-w8q7nsm7.js +2098 -0
  92. package/dist/chunk-w8q7nsm7.js.map +44 -0
  93. package/dist/chunk-wa64nz8b.js +47 -0
  94. package/dist/chunk-wa64nz8b.js.map +10 -0
  95. package/dist/chunk-wz8d5vzb.js +234 -0
  96. package/dist/chunk-wz8d5vzb.js.map +11 -0
  97. package/dist/chunk-ycfxp056.js +677 -0
  98. package/dist/chunk-ycfxp056.js.map +17 -0
  99. package/dist/chunk-z9d2xc83.js +3256 -0
  100. package/dist/chunk-z9d2xc83.js.map +84 -0
  101. package/dist/cli.js +111 -126055
  102. package/dist/cli.js.map +19 -0
  103. package/dist/commands/autoload.d.ts +2 -0
  104. package/dist/commands/doctor/command.d.ts +2 -1
  105. package/dist/commands/doctor/command.js +82 -0
  106. package/dist/commands/doctor/command.js.map +11 -0
  107. package/dist/commands/doctor/spec.d.ts +16 -8
  108. package/dist/commands/init/command.d.ts +2 -1
  109. package/dist/commands/init/command.js +98 -0
  110. package/dist/commands/init/command.js.map +11 -0
  111. package/dist/commands/init/spec.d.ts +29 -9
  112. package/dist/commands/logout/command.d.ts +2 -1
  113. package/dist/commands/logout/command.js +79 -0
  114. package/dist/commands/logout/command.js.map +11 -0
  115. package/dist/commands/logout/spec.d.ts +11 -0
  116. package/dist/commands/proxy/command.d.ts +2 -1
  117. package/dist/commands/proxy/command.js +56 -0
  118. package/dist/commands/proxy/command.js.map +11 -0
  119. package/dist/commands/proxy/spec.d.ts +15 -0
  120. package/dist/commands/screens/command.d.ts +2 -1
  121. package/dist/commands/screens/command.js +61 -0
  122. package/dist/commands/screens/command.js.map +11 -0
  123. package/dist/commands/screens/spec.d.ts +9 -0
  124. package/dist/commands/serve/command.d.ts +2 -1
  125. package/dist/commands/serve/command.js +65 -0
  126. package/dist/commands/serve/command.js.map +11 -0
  127. package/dist/commands/serve/spec.d.ts +9 -0
  128. package/dist/commands/site/command.d.ts +2 -1
  129. package/dist/commands/site/command.js +53 -0
  130. package/dist/commands/site/command.js.map +11 -0
  131. package/dist/commands/site/spec.d.ts +15 -0
  132. package/dist/commands/snapshot/command.d.ts +2 -1
  133. package/dist/commands/snapshot/command.js +59 -0
  134. package/dist/commands/snapshot/command.js.map +11 -0
  135. package/dist/commands/tool/command.d.ts +2 -1
  136. package/dist/commands/tool/command.js +79 -0
  137. package/dist/commands/tool/command.js.map +11 -0
  138. package/dist/commands/tool/handler.d.ts +17 -0
  139. package/dist/commands/tool/spec.d.ts +17 -0
  140. package/dist/commands/view/command.d.ts +2 -1
  141. package/dist/commands/view/command.js +52 -0
  142. package/dist/commands/view/command.js.map +11 -0
  143. package/dist/commands/view/spec.d.ts +24 -0
  144. package/dist/framework/CommandDefinition.d.ts +2 -2
  145. package/dist/index.js +26 -21607
  146. package/dist/index.js.map +9 -0
  147. package/dist/lib/services/site/schemas.d.ts +8 -8
  148. package/dist/services/config/handler.d.ts +12 -0
  149. package/dist/services/config/spec.d.ts +82 -0
  150. package/dist/services/gcloud/auth.d.ts +28 -0
  151. package/dist/services/gcloud/core.d.ts +21 -0
  152. package/dist/services/gcloud/handler.d.ts +6 -18
  153. package/dist/services/gcloud/install.d.ts +23 -0
  154. package/dist/services/gcloud/projects.d.ts +15 -0
  155. package/dist/services/gcloud/spec.d.ts +32 -24
  156. package/dist/services/mcp-client/client.d.ts +0 -5
  157. package/dist/services/mcp-client/spec.d.ts +6 -6
  158. package/dist/services/mcp-config/spec.d.ts +12 -12
  159. package/dist/services/project/spec.d.ts +4 -4
  160. package/dist/services/proxy/spec.d.ts +3 -3
  161. package/dist/services/stitch/api.d.ts +10 -0
  162. package/dist/services/stitch/connection.d.ts +5 -0
  163. package/dist/services/stitch/handler.d.ts +5 -3
  164. package/dist/services/stitch/iam.d.ts +11 -0
  165. package/dist/services/stitch/spec.d.ts +6 -6
  166. package/dist/services/view/spec.d.ts +7 -7
  167. package/dist/src/cli.d.ts +1 -0
  168. package/dist/src/commands/doctor/handler.d.ts +9 -0
  169. package/dist/src/commands/doctor/handler.test.d.ts +1 -0
  170. package/dist/src/commands/doctor/spec.d.ts +130 -0
  171. package/dist/src/commands/doctor/spec.test.d.ts +1 -0
  172. package/dist/src/commands/init/handler.d.ts +17 -0
  173. package/dist/src/commands/init/handler.test.d.ts +1 -0
  174. package/dist/src/commands/init/spec.d.ts +88 -0
  175. package/dist/src/commands/init/spec.test.d.ts +1 -0
  176. package/dist/src/commands/proxy/handler.d.ts +7 -0
  177. package/dist/src/commands/proxy/handler.test.d.ts +1 -0
  178. package/dist/src/index.d.ts +13 -0
  179. package/dist/src/platform/detector.d.ts +29 -0
  180. package/dist/src/platform/paths.d.ts +20 -0
  181. package/dist/src/platform/shell.d.ts +26 -0
  182. package/dist/src/services/gcloud/handler.d.ts +48 -0
  183. package/dist/src/services/gcloud/handler.test.d.ts +1 -0
  184. package/dist/src/services/gcloud/spec.d.ts +405 -0
  185. package/dist/src/services/mcp-config/handler.d.ts +12 -0
  186. package/dist/src/services/mcp-config/handler.test.d.ts +1 -0
  187. package/dist/src/services/mcp-config/spec.d.ts +88 -0
  188. package/dist/src/services/mcp-config/spec.test.d.ts +1 -0
  189. package/dist/src/services/project/handler.d.ts +11 -0
  190. package/dist/src/services/project/handler.test.d.ts +1 -0
  191. package/dist/src/services/project/spec.d.ts +86 -0
  192. package/dist/src/services/project/spec.test.d.ts +1 -0
  193. package/dist/src/services/proxy/handler.d.ts +15 -0
  194. package/dist/src/services/proxy/handler.test.d.ts +1 -0
  195. package/dist/src/services/proxy/spec.d.ts +83 -0
  196. package/dist/src/services/proxy/spec.test.d.ts +1 -0
  197. package/dist/src/services/stitch/handler.d.ts +15 -0
  198. package/dist/src/services/stitch/handler.test.d.ts +1 -0
  199. package/dist/src/services/stitch/spec.d.ts +262 -0
  200. package/dist/src/services/stitch/spec.test.d.ts +1 -0
  201. package/dist/src/ui/spinner.d.ts +11 -0
  202. package/dist/src/ui/theme.d.ts +18 -0
  203. package/dist/src/ui/wizard.d.ts +24 -0
  204. package/dist/tests/mocks/shell.d.ts +2 -0
  205. package/dist/ui/JsonTree.d.ts +1 -1
  206. package/package.json +2 -2
  207. package/dist/commands/registry.d.ts +0 -2
  208. package/dist/ui/copy-behaviors/index.d.ts +0 -8
  209. package/dist/ui/serve-behaviors/index.d.ts +0 -7
  210. /package/dist/ui/navigation-behaviors/{index.d.ts → handler.d.ts} +0 -0
@@ -0,0 +1,392 @@
1
+ import {
2
+ ProjectSyncer,
3
+ SiteService,
4
+ pLimit
5
+ } from "./chunk-qv44tmn6.js";
6
+ import {
7
+ StitchMCPClient
8
+ } from "./chunk-h18jrqed.js";
9
+ import"./chunk-q4js8r0z.js";
10
+ import"./chunk-w8q7nsm7.js";
11
+ import {
12
+ downloadImage,
13
+ downloadText
14
+ } from "./chunk-4vxy1qce.js";
15
+ import"./chunk-384jmtpy.js";
16
+ import {
17
+ runSteps
18
+ } from "./chunk-f2hq6bfv.js";
19
+ import"./chunk-nthabjd9.js";
20
+ import"./chunk-4jygt4d6.js";
21
+ import"./chunk-tz7wnw4s.js";
22
+ import"./chunk-kbtqrkwh.js";
23
+ import"./chunk-3sfn889r.js";
24
+ import"./chunk-2k7n0w2x.js";
25
+ import"./chunk-9wyra8hs.js";
26
+
27
+ // src/commands/tool/virtual-tools/get-screen-code.ts
28
+ var getScreenCodeTool = {
29
+ name: "get_screen_code",
30
+ description: "(Virtual) Retrieves a screen and downloads its HTML code content.",
31
+ inputSchema: {
32
+ type: "object",
33
+ properties: {
34
+ projectId: {
35
+ type: "string",
36
+ description: "Required. The project ID of screen to retrieve."
37
+ },
38
+ screenId: {
39
+ type: "string",
40
+ description: "Required. The name of screen to retrieve."
41
+ }
42
+ },
43
+ required: ["projectId", "screenId"]
44
+ },
45
+ execute: async (client, args) => {
46
+ const { projectId, screenId } = args;
47
+ const screen = await client.callTool("get_screen", { projectId, screenId });
48
+ let htmlContent = null;
49
+ if (screen.htmlCode?.downloadUrl) {
50
+ try {
51
+ htmlContent = await downloadText(screen.htmlCode.downloadUrl);
52
+ } catch (e) {
53
+ console.error(`Error downloading HTML code: ${e}`);
54
+ }
55
+ }
56
+ return {
57
+ ...screen,
58
+ htmlContent
59
+ };
60
+ }
61
+ };
62
+ // src/commands/tool/virtual-tools/get-screen-image.ts
63
+ var getScreenImageTool = {
64
+ name: "get_screen_image",
65
+ description: "(Virtual) Retrieves a screen and downloads its screenshot image as base64.",
66
+ inputSchema: {
67
+ type: "object",
68
+ properties: {
69
+ projectId: {
70
+ type: "string",
71
+ description: "Required. The project ID of screen to retrieve."
72
+ },
73
+ screenId: {
74
+ type: "string",
75
+ description: "Required. The name of screen to retrieve."
76
+ }
77
+ },
78
+ required: ["projectId", "screenId"]
79
+ },
80
+ execute: async (client, args) => {
81
+ const { projectId, screenId } = args;
82
+ const screen = await client.callTool("get_screen", { projectId, screenId });
83
+ let screenshotBase64 = null;
84
+ if (screen.screenshot?.downloadUrl) {
85
+ try {
86
+ const buffer = await downloadImage(screen.screenshot.downloadUrl);
87
+ screenshotBase64 = Buffer.from(buffer).toString("base64");
88
+ } catch (e) {
89
+ console.error(`Error downloading screenshot: ${e}`);
90
+ }
91
+ }
92
+ return {
93
+ ...screen,
94
+ screenshotBase64
95
+ };
96
+ }
97
+ };
98
+ // src/commands/tool/virtual-tools/build-site.ts
99
+ var buildSiteTool = {
100
+ name: "build_site",
101
+ description: "(Virtual) Builds a site from a Stitch project by mapping screens to routes. Returns the design HTML for each page to use as context for code generation.",
102
+ inputSchema: {
103
+ type: "object",
104
+ properties: {
105
+ projectId: {
106
+ type: "string",
107
+ description: "Required. The project ID to build a site from."
108
+ },
109
+ routes: {
110
+ type: "array",
111
+ description: "Required. Array of screen-to-route mappings.",
112
+ items: {
113
+ type: "object",
114
+ properties: {
115
+ screenId: {
116
+ type: "string",
117
+ description: "The screen ID to use for this route."
118
+ },
119
+ route: {
120
+ type: "string",
121
+ description: 'The route path (e.g. "/" or "/about").'
122
+ }
123
+ },
124
+ required: ["screenId", "route"]
125
+ }
126
+ }
127
+ },
128
+ required: ["projectId", "routes"]
129
+ },
130
+ execute: async (client, args) => {
131
+ const { projectId, routes } = args;
132
+ if (!Array.isArray(routes)) {
133
+ throw new Error("routes must be an array");
134
+ }
135
+ if (routes.length === 0) {
136
+ throw new Error("routes must be a non-empty array");
137
+ }
138
+ for (const entry of routes) {
139
+ if (!entry.screenId || typeof entry.screenId !== "string") {
140
+ throw new Error('Each route entry must have a "screenId" string');
141
+ }
142
+ if (!entry.route || typeof entry.route !== "string") {
143
+ throw new Error('Each route entry must have a "route" string');
144
+ }
145
+ }
146
+ const routePaths = routes.map((r) => r.route);
147
+ const uniqueRoutes = new Set(routePaths);
148
+ if (uniqueRoutes.size !== routePaths.length) {
149
+ const duplicates = routePaths.filter((r, i) => routePaths.indexOf(r) !== i);
150
+ throw new Error(`Duplicate route paths found: ${[...new Set(duplicates)].join(", ")}`);
151
+ }
152
+ const syncer = new ProjectSyncer(client);
153
+ const remoteScreens = await syncer.fetchManifest(projectId);
154
+ const uiScreens = SiteService.toUIScreens(remoteScreens);
155
+ const screenMap = new Map(uiScreens.map((s) => [s.id, s]));
156
+ const missingIds = routes.map((r) => r.screenId).filter((id) => !screenMap.has(id));
157
+ if (missingIds.length > 0) {
158
+ throw new Error(`Screen IDs not found in project: ${missingIds.join(", ")}`);
159
+ }
160
+ const limit = pLimit(3);
161
+ const htmlContent = new Map;
162
+ const errors = [];
163
+ await Promise.all(routes.map((r) => limit(async () => {
164
+ const screen = screenMap.get(r.screenId);
165
+ try {
166
+ const html = await syncer.fetchContent(screen.downloadUrl);
167
+ htmlContent.set(r.screenId, html);
168
+ } catch (e) {
169
+ errors.push(`${r.screenId}: ${e.message}`);
170
+ }
171
+ })));
172
+ if (errors.length > 0) {
173
+ throw new Error(`Failed to fetch HTML for screens: ${errors.join("; ")}`);
174
+ }
175
+ const pages = routes.map((r) => ({
176
+ screenId: r.screenId,
177
+ route: r.route,
178
+ title: screenMap.get(r.screenId).title,
179
+ html: htmlContent.get(r.screenId)
180
+ }));
181
+ return {
182
+ success: true,
183
+ pages,
184
+ message: `Built ${pages.length} page(s) with design HTML`
185
+ };
186
+ }
187
+ };
188
+ // src/commands/tool/virtual-tools/list-tools.ts
189
+ var listToolsTool = {
190
+ name: "list_tools",
191
+ description: "List all available tools with their descriptions and schemas.",
192
+ inputSchema: {
193
+ type: "object",
194
+ properties: {}
195
+ },
196
+ execute: async (client, _args) => {
197
+ const result = await client.getCapabilities();
198
+ return result.tools || [];
199
+ }
200
+ };
201
+ // src/commands/tool/virtual-tools/index.ts
202
+ var virtualTools = [
203
+ getScreenCodeTool,
204
+ getScreenImageTool,
205
+ buildSiteTool,
206
+ listToolsTool
207
+ ];
208
+
209
+ // src/commands/tool/steps/ListToolsStep.ts
210
+ class ListToolsStep {
211
+ id = "list-tools";
212
+ name = "List available tools";
213
+ async shouldRun(context) {
214
+ const name = context.input.toolName?.toLowerCase();
215
+ return !name || name === "list" || name === "listtools" || name === "list_tools";
216
+ }
217
+ async run(context) {
218
+ const result = await context.client.getCapabilities();
219
+ const serverTools = result.tools || [];
220
+ const tools = [...context.virtualTools, ...serverTools];
221
+ context.result = { success: true, data: tools };
222
+ return { success: true };
223
+ }
224
+ }
225
+
226
+ // src/commands/tool/steps/ShowSchemaStep.ts
227
+ class ShowSchemaStep {
228
+ id = "show-schema";
229
+ name = "Show tool schema";
230
+ async shouldRun(context) {
231
+ return !!context.input.toolName && context.input.toolName !== "list" && context.input.showSchema;
232
+ }
233
+ async run(context) {
234
+ const toolName = context.input.toolName;
235
+ const result = await context.client.getCapabilities();
236
+ const serverTools = result.tools || [];
237
+ const allTools = [...context.virtualTools, ...serverTools];
238
+ const tool = allTools.find((t) => t.name === toolName);
239
+ if (!tool) {
240
+ context.result = { success: false, error: `Tool not found: ${toolName}` };
241
+ return { success: false, error: new Error(`Tool not found: ${toolName}`) };
242
+ }
243
+ context.result = { success: true, data: this.formatSchema(tool) };
244
+ return { success: true };
245
+ }
246
+ formatSchema(tool) {
247
+ const schema = tool.inputSchema;
248
+ const args = {};
249
+ if (schema?.properties) {
250
+ for (const [key, prop] of Object.entries(schema.properties)) {
251
+ const required = schema.required?.includes(key) ? "(required)" : "(optional)";
252
+ args[key] = `${prop.type} ${required}${prop.description ? " - " + prop.description : ""}`;
253
+ }
254
+ }
255
+ return {
256
+ name: tool.name,
257
+ description: tool.description,
258
+ arguments: args,
259
+ example: this.generateExample(tool)
260
+ };
261
+ }
262
+ generateExample(tool) {
263
+ const exampleArgs = {};
264
+ if (tool.inputSchema?.properties) {
265
+ for (const [key, prop] of Object.entries(tool.inputSchema.properties)) {
266
+ exampleArgs[key] = prop.type === "string" ? `<${key}>` : `<${prop.type}>`;
267
+ }
268
+ }
269
+ return `stitch-mcp tool ${tool.name} -d '${JSON.stringify(exampleArgs)}'`;
270
+ }
271
+ }
272
+
273
+ // src/commands/tool/steps/ParseArgsStep.ts
274
+ class ParseArgsStep {
275
+ id = "parse-args";
276
+ name = "Parse tool arguments";
277
+ async shouldRun(context) {
278
+ return !!context.input.toolName && context.input.toolName !== "list" && !context.input.showSchema;
279
+ }
280
+ async run(context) {
281
+ let args = {};
282
+ if (context.input.data) {
283
+ args = JSON.parse(context.input.data);
284
+ } else if (context.input.dataFile) {
285
+ const content = await Bun.file(context.input.dataFile.replace("@", "")).text();
286
+ args = JSON.parse(content);
287
+ }
288
+ context.parsedArgs = args;
289
+ return { success: true };
290
+ }
291
+ }
292
+
293
+ // src/commands/tool/steps/ValidateToolStep.ts
294
+ class ValidateToolStep {
295
+ id = "validate-tool";
296
+ name = "Validate tool exists";
297
+ async shouldRun(context) {
298
+ return !!context.input.toolName && context.input.toolName !== "list" && !context.input.showSchema && context.parsedArgs !== undefined;
299
+ }
300
+ async run(context) {
301
+ const toolName = context.input.toolName;
302
+ const result = await context.client.getCapabilities();
303
+ const serverTools = result.tools || [];
304
+ const allTools = [...context.virtualTools, ...serverTools];
305
+ const found = allTools.find((t) => t.name === toolName);
306
+ if (!found) {
307
+ const availableNames = allTools.map((t) => t.name).sort();
308
+ context.result = {
309
+ success: false,
310
+ error: `Tool not found: "${toolName}". Use "list_tools" to see available tools.`,
311
+ data: {
312
+ requestedTool: toolName,
313
+ availableTools: availableNames,
314
+ hint: 'Call "list_tools" to see all available tools with descriptions and schemas.'
315
+ }
316
+ };
317
+ return { success: false, error: new Error(`Tool not found: ${toolName}`) };
318
+ }
319
+ return { success: true };
320
+ }
321
+ }
322
+
323
+ // src/commands/tool/steps/ExecuteToolStep.ts
324
+ class ExecuteToolStep {
325
+ id = "execute-tool";
326
+ name = "Execute tool";
327
+ async shouldRun(context) {
328
+ return context.parsedArgs !== undefined;
329
+ }
330
+ async run(context) {
331
+ const toolName = context.input.toolName;
332
+ const args = context.parsedArgs;
333
+ const virtualTool = context.virtualTools.find((t) => t.name === toolName);
334
+ if (virtualTool) {
335
+ try {
336
+ const result2 = await virtualTool.execute(context.client, args);
337
+ context.result = { success: true, data: result2 };
338
+ return { success: true };
339
+ } catch (e) {
340
+ context.result = { success: false, error: `Virtual tool execution failed: ${e.message || String(e)}` };
341
+ return { success: false, error: e };
342
+ }
343
+ }
344
+ const result = await context.client.callTool(toolName, args);
345
+ context.result = { success: true, data: result };
346
+ return { success: true };
347
+ }
348
+ }
349
+
350
+ // src/commands/tool/handler.ts
351
+ var deps = {
352
+ runSteps,
353
+ ListToolsStep,
354
+ ShowSchemaStep,
355
+ ParseArgsStep,
356
+ ValidateToolStep,
357
+ ExecuteToolStep
358
+ };
359
+
360
+ class ToolCommandHandler {
361
+ client;
362
+ tools;
363
+ steps;
364
+ constructor(client, tools) {
365
+ this.client = client || new StitchMCPClient;
366
+ this.tools = tools || virtualTools;
367
+ this.steps = [
368
+ new deps.ListToolsStep,
369
+ new deps.ShowSchemaStep,
370
+ new deps.ParseArgsStep,
371
+ new deps.ValidateToolStep,
372
+ new deps.ExecuteToolStep
373
+ ];
374
+ }
375
+ async execute(input) {
376
+ const context = {
377
+ input,
378
+ client: this.client,
379
+ virtualTools: this.tools
380
+ };
381
+ await deps.runSteps(this.steps, context, {
382
+ onAfterStep: (_step, _result, ctx) => ctx.result !== undefined
383
+ });
384
+ return context.result ?? { success: false, error: "No step produced a result" };
385
+ }
386
+ }
387
+ export {
388
+ deps,
389
+ ToolCommandHandler
390
+ };
391
+
392
+ //# debugId=2F78B99CA5A904DD64756E2164756E21
@@ -0,0 +1,20 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/commands/tool/virtual-tools/get-screen-code.ts", "../src/commands/tool/virtual-tools/get-screen-image.ts", "../src/commands/tool/virtual-tools/build-site.ts", "../src/commands/tool/virtual-tools/list-tools.ts", "../src/commands/tool/virtual-tools/index.ts", "../src/commands/tool/steps/ListToolsStep.ts", "../src/commands/tool/steps/ShowSchemaStep.ts", "../src/commands/tool/steps/ParseArgsStep.ts", "../src/commands/tool/steps/ValidateToolStep.ts", "../src/commands/tool/steps/ExecuteToolStep.ts", "../src/commands/tool/handler.ts"],
4
+ "sourcesContent": [
5
+ "import type { StitchMCPClient } from '../../../services/mcp-client/client.js';\nimport { downloadText } from '../../../ui/copy-behaviors/clipboard.js';\nimport type { VirtualTool } from '../spec.js';\n\nexport const getScreenCodeTool: VirtualTool = {\n name: 'get_screen_code',\n description: '(Virtual) Retrieves a screen and downloads its HTML code content.',\n inputSchema: {\n type: 'object',\n properties: {\n projectId: {\n type: 'string',\n description: 'Required. The project ID of screen to retrieve.',\n },\n screenId: {\n type: 'string',\n description: 'Required. The name of screen to retrieve.',\n },\n },\n required: ['projectId', 'screenId'],\n },\n execute: async (client: StitchMCPClient, args: any) => {\n const { projectId, screenId } = args;\n\n // 1. Get the screen details\n const screen = await client.callTool('get_screen', { projectId, screenId }) as any;\n\n // 2. Fetch HTML Code\n let htmlContent: string | null = null;\n if (screen.htmlCode?.downloadUrl) {\n try {\n htmlContent = await downloadText(screen.htmlCode.downloadUrl);\n } catch (e) {\n console.error(`Error downloading HTML code: ${e}`);\n }\n }\n\n // 3. Return screen with code content\n return {\n ...screen,\n htmlContent,\n };\n },\n};\n",
6
+ "import type { StitchMCPClient } from '../../../services/mcp-client/client.js';\nimport { downloadImage } from '../../../ui/copy-behaviors/clipboard.js';\nimport type { VirtualTool } from '../spec.js';\n\nexport const getScreenImageTool: VirtualTool = {\n name: 'get_screen_image',\n description: '(Virtual) Retrieves a screen and downloads its screenshot image as base64.',\n inputSchema: {\n type: 'object',\n properties: {\n projectId: {\n type: 'string',\n description: 'Required. The project ID of screen to retrieve.',\n },\n screenId: {\n type: 'string',\n description: 'Required. The name of screen to retrieve.',\n },\n },\n required: ['projectId', 'screenId'],\n },\n execute: async (client: StitchMCPClient, args: any) => {\n const { projectId, screenId } = args;\n\n // 1. Get the screen details\n const screen = await client.callTool('get_screen', { projectId, screenId }) as any;\n\n // 2. Fetch Screenshot (as base64)\n let screenshotBase64: string | null = null;\n if (screen.screenshot?.downloadUrl) {\n try {\n const buffer = await downloadImage(screen.screenshot.downloadUrl);\n screenshotBase64 = Buffer.from(buffer).toString('base64');\n } catch (e) {\n console.error(`Error downloading screenshot: ${e}`);\n }\n }\n\n // 3. Return screen with image content\n return {\n ...screen,\n screenshotBase64,\n };\n },\n};\n",
7
+ "import type { StitchMCPClient } from '../../../services/mcp-client/client.js';\nimport { ProjectSyncer } from '../../site/utils/ProjectSyncer.js';\nimport { SiteService } from '../../../lib/services/site/SiteService.js';\nimport type { VirtualTool } from '../spec.js';\nimport pLimit from 'p-limit';\n\nexport const buildSiteTool: VirtualTool = {\n name: 'build_site',\n description: '(Virtual) Builds a site from a Stitch project by mapping screens to routes. Returns the design HTML for each page to use as context for code generation.',\n inputSchema: {\n type: 'object',\n properties: {\n projectId: {\n type: 'string',\n description: 'Required. The project ID to build a site from.',\n },\n routes: {\n type: 'array',\n description: 'Required. Array of screen-to-route mappings.',\n items: {\n type: 'object',\n properties: {\n screenId: {\n type: 'string',\n description: 'The screen ID to use for this route.',\n },\n route: {\n type: 'string',\n description: 'The route path (e.g. \"/\" or \"/about\").',\n },\n },\n required: ['screenId', 'route'],\n },\n },\n },\n required: ['projectId', 'routes'],\n },\n execute: async (client: StitchMCPClient, args: any) => {\n const { projectId, routes } = args;\n\n // Validate routes\n if (!Array.isArray(routes)) {\n throw new Error('routes must be an array');\n }\n if (routes.length === 0) {\n throw new Error('routes must be a non-empty array');\n }\n for (const entry of routes) {\n if (!entry.screenId || typeof entry.screenId !== 'string') {\n throw new Error('Each route entry must have a \"screenId\" string');\n }\n if (!entry.route || typeof entry.route !== 'string') {\n throw new Error('Each route entry must have a \"route\" string');\n }\n }\n\n // Check for duplicate routes\n const routePaths = routes.map((r: any) => r.route);\n const uniqueRoutes = new Set(routePaths);\n if (uniqueRoutes.size !== routePaths.length) {\n const duplicates = routePaths.filter((r: string, i: number) => routePaths.indexOf(r) !== i);\n throw new Error(`Duplicate route paths found: ${[...new Set(duplicates)].join(', ')}`);\n }\n\n // Fetch project screens\n const syncer = new ProjectSyncer(client);\n const remoteScreens = await syncer.fetchManifest(projectId);\n const uiScreens = SiteService.toUIScreens(remoteScreens);\n\n // Build lookup map\n const screenMap = new Map(uiScreens.map(s => [s.id, s]));\n\n // Validate all requested screenIds exist\n const missingIds = routes\n .map((r: any) => r.screenId)\n .filter((id: string) => !screenMap.has(id));\n if (missingIds.length > 0) {\n throw new Error(`Screen IDs not found in project: ${missingIds.join(', ')}`);\n }\n\n // Fetch HTML for each screen with concurrency limit\n const limit = pLimit(3);\n const htmlContent = new Map<string, string>();\n const errors: string[] = [];\n\n await Promise.all(\n routes.map((r: any) =>\n limit(async () => {\n const screen = screenMap.get(r.screenId)!;\n try {\n const html = await syncer.fetchContent(screen.downloadUrl);\n htmlContent.set(r.screenId, html);\n } catch (e: any) {\n errors.push(`${r.screenId}: ${e.message}`);\n }\n })\n )\n );\n\n if (errors.length > 0) {\n throw new Error(`Failed to fetch HTML for screens: ${errors.join('; ')}`);\n }\n\n // Return raw HTML content for each page\n const pages = routes.map((r: any) => ({\n screenId: r.screenId,\n route: r.route,\n title: screenMap.get(r.screenId)!.title,\n html: htmlContent.get(r.screenId)!,\n }));\n\n return {\n success: true,\n pages,\n message: `Built ${pages.length} page(s) with design HTML`,\n };\n },\n};\n",
8
+ "import type { VirtualTool } from '../spec.js';\nimport type { StitchMCPClient } from '../../../services/mcp-client/client.js';\n\nexport const listToolsTool: VirtualTool = {\n name: 'list_tools',\n description: 'List all available tools with their descriptions and schemas.',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n execute: async (client: StitchMCPClient, _args: any) => {\n const result = await client.getCapabilities();\n return result.tools || [];\n },\n};\n",
9
+ "export type { VirtualTool } from '../spec.js';\nexport { getScreenCodeTool } from './get-screen-code.js';\nexport { getScreenImageTool } from './get-screen-image.js';\nexport { buildSiteTool } from './build-site.js';\nexport { listToolsTool } from './list-tools.js';\n\nimport { getScreenCodeTool } from './get-screen-code.js';\nimport { getScreenImageTool } from './get-screen-image.js';\nimport { buildSiteTool } from './build-site.js';\nimport { listToolsTool } from './list-tools.js';\nimport type { VirtualTool } from '../spec.js';\n\nexport const virtualTools: VirtualTool[] = [\n getScreenCodeTool,\n getScreenImageTool,\n buildSiteTool,\n listToolsTool,\n];\n",
10
+ "import type { CommandStep, StepResult } from '../../../framework/CommandStep.js';\nimport type { ToolContext } from '../context.js';\n\nexport class ListToolsStep implements CommandStep<ToolContext> {\n id = 'list-tools';\n name = 'List available tools';\n\n async shouldRun(context: ToolContext): Promise<boolean> {\n const name = context.input.toolName?.toLowerCase();\n return !name || name === 'list' || name === 'listtools' || name === 'list_tools';\n }\n\n async run(context: ToolContext): Promise<StepResult> {\n const result = await context.client.getCapabilities();\n const serverTools = result.tools || [];\n const tools = [...context.virtualTools, ...serverTools];\n context.result = { success: true, data: tools };\n return { success: true };\n }\n}\n",
11
+ "import type { CommandStep, StepResult } from '../../../framework/CommandStep.js';\nimport type { ToolContext } from '../context.js';\nimport type { ToolInfo } from '../spec.js';\n\nexport class ShowSchemaStep implements CommandStep<ToolContext> {\n id = 'show-schema';\n name = 'Show tool schema';\n\n async shouldRun(context: ToolContext): Promise<boolean> {\n return !!context.input.toolName && context.input.toolName !== 'list' && context.input.showSchema;\n }\n\n async run(context: ToolContext): Promise<StepResult> {\n const toolName = context.input.toolName!;\n\n // Get all tools to find the one we need\n const result = await context.client.getCapabilities();\n const serverTools = result.tools || [];\n const allTools = [...context.virtualTools, ...serverTools];\n const tool = allTools.find(t => t.name === toolName);\n\n if (!tool) {\n context.result = { success: false, error: `Tool not found: ${toolName}` };\n return { success: false, error: new Error(`Tool not found: ${toolName}`) };\n }\n\n context.result = { success: true, data: this.formatSchema(tool) };\n return { success: true };\n }\n\n private formatSchema(tool: ToolInfo): object {\n const schema = tool.inputSchema;\n const args: Record<string, string> = {};\n\n if (schema?.properties) {\n for (const [key, prop] of Object.entries(schema.properties)) {\n const required = schema.required?.includes(key) ? '(required)' : '(optional)';\n args[key] = `${prop.type} ${required}${prop.description ? ' - ' + prop.description : ''}`;\n }\n }\n\n return {\n name: tool.name,\n description: tool.description,\n arguments: args,\n example: this.generateExample(tool),\n };\n }\n\n private generateExample(tool: ToolInfo): string {\n const exampleArgs: Record<string, any> = {};\n if (tool.inputSchema?.properties) {\n for (const [key, prop] of Object.entries(tool.inputSchema.properties)) {\n exampleArgs[key] = prop.type === 'string' ? `<${key}>` : `<${prop.type}>`;\n }\n }\n return `stitch-mcp tool ${tool.name} -d '${JSON.stringify(exampleArgs)}'`;\n }\n}\n",
12
+ "import type { CommandStep, StepResult } from '../../../framework/CommandStep.js';\nimport type { ToolContext } from '../context.js';\n\nexport class ParseArgsStep implements CommandStep<ToolContext> {\n id = 'parse-args';\n name = 'Parse tool arguments';\n\n async shouldRun(context: ToolContext): Promise<boolean> {\n return !!context.input.toolName\n && context.input.toolName !== 'list'\n && !context.input.showSchema;\n }\n\n async run(context: ToolContext): Promise<StepResult> {\n let args: Record<string, any> = {};\n\n if (context.input.data) {\n args = JSON.parse(context.input.data);\n } else if (context.input.dataFile) {\n const content = await Bun.file(context.input.dataFile.replace('@', '')).text();\n args = JSON.parse(content);\n }\n\n context.parsedArgs = args;\n return { success: true };\n }\n}\n",
13
+ "import type { CommandStep, StepResult } from '../../../framework/CommandStep.js';\nimport type { ToolContext } from '../context.js';\n\nexport class ValidateToolStep implements CommandStep<ToolContext> {\n id = 'validate-tool';\n name = 'Validate tool exists';\n\n async shouldRun(context: ToolContext): Promise<boolean> {\n return !!context.input.toolName\n && context.input.toolName !== 'list'\n && !context.input.showSchema\n && context.parsedArgs !== undefined;\n }\n\n async run(context: ToolContext): Promise<StepResult> {\n const toolName = context.input.toolName!;\n\n const result = await context.client.getCapabilities();\n const serverTools = result.tools || [];\n const allTools = [...context.virtualTools, ...serverTools];\n const found = allTools.find(t => t.name === toolName);\n\n if (!found) {\n const availableNames = allTools.map(t => t.name).sort();\n context.result = {\n success: false,\n error: `Tool not found: \"${toolName}\". Use \"list_tools\" to see available tools.`,\n data: {\n requestedTool: toolName,\n availableTools: availableNames,\n hint: 'Call \"list_tools\" to see all available tools with descriptions and schemas.',\n },\n };\n return { success: false, error: new Error(`Tool not found: ${toolName}`) };\n }\n\n return { success: true };\n }\n}\n",
14
+ "import type { CommandStep, StepResult } from '../../../framework/CommandStep.js';\nimport type { ToolContext } from '../context.js';\n\nexport class ExecuteToolStep implements CommandStep<ToolContext> {\n id = 'execute-tool';\n name = 'Execute tool';\n\n async shouldRun(context: ToolContext): Promise<boolean> {\n return context.parsedArgs !== undefined;\n }\n\n async run(context: ToolContext): Promise<StepResult> {\n const toolName = context.input.toolName!;\n const args = context.parsedArgs!;\n\n // Check if it's a virtual tool\n const virtualTool = context.virtualTools.find(t => t.name === toolName);\n if (virtualTool) {\n try {\n const result = await virtualTool.execute(context.client, args);\n context.result = { success: true, data: result };\n return { success: true };\n } catch (e: any) {\n context.result = { success: false, error: `Virtual tool execution failed: ${e.message || String(e)}` };\n return { success: false, error: e };\n }\n }\n\n const result = await context.client.callTool(toolName, args);\n context.result = { success: true, data: result };\n return { success: true };\n }\n}\n",
15
+ "import { StitchMCPClient } from '../../services/mcp-client/client.js';\nimport type { CommandStep } from '../../framework/CommandStep.js';\nimport { runSteps } from '../../framework/StepRunner.js';\nimport type { ToolCommandInput, ToolCommandResult, VirtualTool } from './spec.js';\n\n/**\n * Internal dependencies for testing\n */\nexport const deps = {\n runSteps,\n ListToolsStep,\n ShowSchemaStep,\n ParseArgsStep,\n ValidateToolStep,\n ExecuteToolStep,\n};\nimport type { ToolContext } from './context.js';\nimport { virtualTools as defaultVirtualTools } from './virtual-tools/index.js';\nimport { ListToolsStep } from './steps/ListToolsStep.js';\nimport { ShowSchemaStep } from './steps/ShowSchemaStep.js';\nimport { ParseArgsStep } from './steps/ParseArgsStep.js';\nimport { ValidateToolStep } from './steps/ValidateToolStep.js';\nimport { ExecuteToolStep } from './steps/ExecuteToolStep.js';\n\nexport class ToolCommandHandler {\n private client: StitchMCPClient;\n private tools: VirtualTool[];\n private steps: CommandStep<ToolContext>[];\n\n constructor(client?: StitchMCPClient, tools?: VirtualTool[]) {\n this.client = client || new StitchMCPClient();\n this.tools = tools || defaultVirtualTools;\n this.steps = [\n new deps.ListToolsStep(),\n new deps.ShowSchemaStep(),\n new deps.ParseArgsStep(),\n new deps.ValidateToolStep(),\n new deps.ExecuteToolStep(),\n ];\n }\n\n async execute(input: ToolCommandInput): Promise<ToolCommandResult> {\n const context: ToolContext = {\n input,\n client: this.client,\n virtualTools: this.tools,\n };\n\n await deps.runSteps(this.steps, context, {\n onAfterStep: (_step, _result, ctx) => ctx.result !== undefined,\n });\n\n return context.result ?? { success: false, error: 'No step produced a result' };\n }\n}\n"
16
+ ],
17
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,IAAM,oBAAiC;AAAA,EAC5C,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,IACX,MAAM;AAAA,IACN,YAAY;AAAA,MACV,WAAW;AAAA,QACT,MAAM;AAAA,QACN,aAAa;AAAA,MACf;AAAA,MACA,UAAU;AAAA,QACR,MAAM;AAAA,QACN,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IACA,UAAU,CAAC,aAAa,UAAU;AAAA,EACpC;AAAA,EACA,SAAS,OAAO,QAAyB,SAAc;AAAA,IACrD,QAAQ,WAAW,aAAa;AAAA,IAGhC,MAAM,SAAS,MAAM,OAAO,SAAS,cAAc,EAAE,WAAW,SAAS,CAAC;AAAA,IAG1E,IAAI,cAA6B;AAAA,IACjC,IAAI,OAAO,UAAU,aAAa;AAAA,MAChC,IAAI;AAAA,QACF,cAAc,MAAM,aAAa,OAAO,SAAS,WAAW;AAAA,QAC5D,OAAO,GAAG;AAAA,QACV,QAAQ,MAAM,gCAAgC,GAAG;AAAA;AAAA,IAErD;AAAA,IAGA,OAAO;AAAA,SACF;AAAA,MACH;AAAA,IACF;AAAA;AAEJ;;ACvCO,IAAM,qBAAkC;AAAA,EAC7C,MAAM;AAAA,EACN,aAAa;AAAA,EACb,a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