@_davideast/stitch-mcp 0.5.2 → 0.5.3
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/chunk-22bymmh9.js +137 -0
- package/dist/chunk-22bymmh9.js.map +10 -0
- package/dist/chunk-387yyye2.js +248 -0
- package/dist/chunk-387yyye2.js.map +14 -0
- package/dist/chunk-3ff2k44g.js +19 -0
- package/dist/chunk-3ff2k44g.js.map +9 -0
- package/dist/chunk-46cay1zp.js +273 -0
- package/dist/chunk-46cay1zp.js.map +10 -0
- package/dist/chunk-48e1jpm8.js +167 -0
- package/dist/chunk-48e1jpm8.js.map +10 -0
- package/dist/chunk-4arzkk1s.js +69 -0
- package/dist/chunk-4arzkk1s.js.map +10 -0
- package/dist/chunk-4js7vw6h.js +415 -0
- package/dist/chunk-4js7vw6h.js.map +20 -0
- package/dist/chunk-4p1wfk3t.js +736 -0
- package/dist/chunk-4p1wfk3t.js.map +16 -0
- package/dist/chunk-4zg969tc.js +370 -0
- package/dist/chunk-4zg969tc.js.map +16 -0
- package/dist/chunk-5jjt7tgw.js +247 -0
- package/dist/chunk-5jjt7tgw.js.map +14 -0
- package/dist/chunk-5t2h8z2n.js +273 -0
- package/dist/chunk-5t2h8z2n.js.map +10 -0
- package/dist/chunk-5zy3et1m.js +759 -0
- package/dist/chunk-5zy3et1m.js.map +19 -0
- package/dist/chunk-6wvst7z8.js +125 -0
- package/dist/chunk-6wvst7z8.js.map +12 -0
- package/dist/chunk-8mm08arm.js +256 -0
- package/dist/chunk-8mm08arm.js.map +11 -0
- package/dist/chunk-8nv4wwv0.js +19 -0
- package/dist/chunk-8nv4wwv0.js.map +9 -0
- package/dist/chunk-9cjny9z2.js +19 -0
- package/dist/chunk-9cjny9z2.js.map +9 -0
- package/dist/chunk-9ggfw78s.js +19 -0
- package/dist/chunk-9ggfw78s.js.map +9 -0
- package/dist/chunk-9nyyn1hn.js +125 -0
- package/dist/chunk-9nyyn1hn.js.map +12 -0
- package/dist/chunk-9nzbvp6r.js +19 -0
- package/dist/chunk-9nzbvp6r.js.map +9 -0
- package/dist/chunk-a0gmbh8e.js +415 -0
- package/dist/chunk-a0gmbh8e.js.map +20 -0
- package/dist/chunk-acv998mp.js +941 -0
- package/dist/chunk-acv998mp.js.map +27 -0
- package/dist/chunk-cpjsvven.js +10 -0
- package/dist/chunk-cpjsvven.js.map +9 -0
- package/dist/chunk-dmrahbs1.js +31467 -0
- package/dist/chunk-dmrahbs1.js.map +245 -0
- package/dist/chunk-dts6851a.js +137 -0
- package/dist/chunk-dts6851a.js.map +10 -0
- package/dist/chunk-efd0rm6g.js +69 -0
- package/dist/chunk-efd0rm6g.js.map +10 -0
- package/dist/chunk-f1kjn6cd.js +16554 -0
- package/dist/chunk-f1kjn6cd.js.map +98 -0
- package/dist/chunk-f5f6ekgp.js +109 -0
- package/dist/chunk-f5f6ekgp.js.map +10 -0
- package/dist/chunk-fmewhfh3.js +137 -0
- package/dist/chunk-fmewhfh3.js.map +10 -0
- package/dist/chunk-fmhrn6cg.js +6382 -0
- package/dist/chunk-fmhrn6cg.js.map +109 -0
- package/dist/chunk-gh7dzfhb.js +256 -0
- package/dist/chunk-gh7dzfhb.js.map +11 -0
- package/dist/chunk-gwhtc0fe.js +370 -0
- package/dist/chunk-gwhtc0fe.js.map +16 -0
- package/dist/chunk-hc7sdwmn.js +449 -0
- package/dist/chunk-hc7sdwmn.js.map +17 -0
- package/dist/chunk-k4xwb3wp.js +44184 -0
- package/dist/chunk-k4xwb3wp.js.map +237 -0
- package/dist/chunk-k751yfm6.js +736 -0
- package/dist/chunk-k751yfm6.js.map +16 -0
- package/dist/chunk-kkc2tvar.js +19 -0
- package/dist/chunk-kkc2tvar.js.map +9 -0
- package/dist/chunk-kva47mgc.js +10 -0
- package/dist/chunk-kva47mgc.js.map +9 -0
- package/dist/chunk-nv2j020p.js +45210 -0
- package/dist/chunk-nv2j020p.js.map +258 -0
- package/dist/chunk-pdj9s41r.js +683 -0
- package/dist/chunk-pdj9s41r.js.map +17 -0
- package/dist/chunk-ppphsy4t.js +273 -0
- package/dist/chunk-ppphsy4t.js.map +10 -0
- package/dist/chunk-psmw9zpa.js +941 -0
- package/dist/chunk-psmw9zpa.js.map +27 -0
- package/dist/chunk-pz31v3ma.js +24 -0
- package/dist/chunk-pz31v3ma.js.map +9 -0
- package/dist/chunk-qbt0906e.js +1495 -0
- package/dist/chunk-qbt0906e.js.map +23 -0
- package/dist/chunk-rh3k09h7.js +19 -0
- package/dist/chunk-rh3k09h7.js.map +9 -0
- package/dist/chunk-saznae7w.js +10 -0
- package/dist/chunk-saznae7w.js.map +9 -0
- package/dist/chunk-sscqdg1j.js +69 -0
- package/dist/chunk-sscqdg1j.js.map +10 -0
- package/dist/chunk-stgj6y85.js +835 -0
- package/dist/chunk-stgj6y85.js.map +19 -0
- package/dist/chunk-t3tqmxyj.js +42 -0
- package/dist/chunk-t3tqmxyj.js.map +9 -0
- package/dist/chunk-v8ak35zd.js +94 -0
- package/dist/chunk-v8ak35zd.js.map +10 -0
- package/dist/chunk-w9acw256.js +167 -0
- package/dist/chunk-w9acw256.js.map +10 -0
- package/dist/chunk-wq60thjn.js +167 -0
- package/dist/chunk-wq60thjn.js.map +10 -0
- package/dist/chunk-wzkdeb8a.js +736 -0
- package/dist/chunk-wzkdeb8a.js.map +16 -0
- package/dist/chunk-xxv6j815.js +256 -0
- package/dist/chunk-xxv6j815.js.map +11 -0
- package/dist/chunk-yjnj35q8.js +1495 -0
- package/dist/chunk-yjnj35q8.js.map +23 -0
- package/dist/chunk-yvzzrczy.js +45206 -0
- package/dist/chunk-yvzzrczy.js.map +258 -0
- package/dist/chunk-ywax1akt.js +370 -0
- package/dist/chunk-ywax1akt.js.map +16 -0
- package/dist/chunk-zakq9pc0.js +4989 -0
- package/dist/chunk-zakq9pc0.js.map +65 -0
- package/dist/commands/doctor/command.js +1 -1
- package/dist/commands/doctor/steps/AdcProjectCheckStep.d.ts +8 -0
- package/dist/commands/init/command.js +1 -1
- package/dist/commands/logout/command.js +1 -1
- package/dist/commands/proxy/command.js +1 -1
- package/dist/commands/screens/command.js +2 -2
- package/dist/commands/serve/command.js +3 -3
- package/dist/commands/site/command.js +1 -1
- package/dist/commands/snapshot/command.js +1 -1
- package/dist/commands/tool/command.js +1 -1
- package/dist/commands/view/command.js +1 -1
- package/dist/index.js +4 -4
- package/dist/lib/server/AssetGateway.d.ts +12 -0
- package/package.json +1 -1
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import {
|
|
2
|
+
downloadText
|
|
3
|
+
} from "./chunk-4vxy1qce.js";
|
|
4
|
+
import {
|
|
5
|
+
fetchWithRetry
|
|
6
|
+
} from "./chunk-6gw9apqb.js";
|
|
7
|
+
import"./chunk-384jmtpy.js";
|
|
8
|
+
import {
|
|
9
|
+
StitchToolClient,
|
|
10
|
+
stitch
|
|
11
|
+
} from "./chunk-a1mk24q9.js";
|
|
12
|
+
import {
|
|
13
|
+
pLimit
|
|
14
|
+
} from "./chunk-a5xra9jn.js";
|
|
15
|
+
import {
|
|
16
|
+
runSteps
|
|
17
|
+
} from "./chunk-f2hq6bfv.js";
|
|
18
|
+
import"./chunk-4jygt4d6.js";
|
|
19
|
+
import"./chunk-tz7wnw4s.js";
|
|
20
|
+
import"./chunk-c6ge431q.js";
|
|
21
|
+
import"./chunk-9wyra8hs.js";
|
|
22
|
+
|
|
23
|
+
// src/commands/tool/virtual-tools/get-screen-code.ts
|
|
24
|
+
var getScreenCodeTool = {
|
|
25
|
+
name: "get_screen_code",
|
|
26
|
+
description: "(Virtual) Retrieves a screen and downloads its HTML code content.",
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: "object",
|
|
29
|
+
properties: {
|
|
30
|
+
projectId: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "Required. The project ID of screen to retrieve."
|
|
33
|
+
},
|
|
34
|
+
screenId: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "Required. The name of screen to retrieve."
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
required: ["projectId", "screenId"]
|
|
40
|
+
},
|
|
41
|
+
execute: async (client, args, stitch2) => {
|
|
42
|
+
if (!stitch2)
|
|
43
|
+
throw new Error("get_screen_code requires a Stitch instance");
|
|
44
|
+
const { projectId, screenId } = args;
|
|
45
|
+
const screen = await stitch2.project(projectId).getScreen(screenId);
|
|
46
|
+
let htmlContent = null;
|
|
47
|
+
try {
|
|
48
|
+
const htmlUrl = await screen.getHtml();
|
|
49
|
+
if (htmlUrl) {
|
|
50
|
+
htmlContent = await downloadText(htmlUrl);
|
|
51
|
+
}
|
|
52
|
+
} catch (e) {
|
|
53
|
+
console.error(`Error downloading HTML code: ${e}`);
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
screenId: screen.screenId,
|
|
57
|
+
projectId: screen.projectId,
|
|
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 content.",
|
|
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, stitch2) => {
|
|
81
|
+
if (!stitch2)
|
|
82
|
+
throw new Error("get_screen_image requires a Stitch instance");
|
|
83
|
+
const { projectId, screenId } = args;
|
|
84
|
+
const screen = await stitch2.project(projectId).getScreen(screenId);
|
|
85
|
+
let imageContent = null;
|
|
86
|
+
try {
|
|
87
|
+
const imageUrl = await screen.getImage();
|
|
88
|
+
if (imageUrl) {
|
|
89
|
+
const response = await fetch(imageUrl);
|
|
90
|
+
const arrayBuffer = await response.arrayBuffer();
|
|
91
|
+
const buffer = Buffer.from(arrayBuffer);
|
|
92
|
+
imageContent = buffer.toString("base64");
|
|
93
|
+
}
|
|
94
|
+
} catch (e) {
|
|
95
|
+
console.error(`Error downloading screenshot: ${e}`);
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
screenId: screen.screenId,
|
|
99
|
+
projectId: screen.projectId,
|
|
100
|
+
imageContent
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
// src/commands/tool/virtual-tools/build-site.ts
|
|
105
|
+
var buildSiteTool = {
|
|
106
|
+
name: "build_site",
|
|
107
|
+
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.",
|
|
108
|
+
inputSchema: {
|
|
109
|
+
type: "object",
|
|
110
|
+
properties: {
|
|
111
|
+
projectId: {
|
|
112
|
+
type: "string",
|
|
113
|
+
description: "Required. The project ID to build a site from."
|
|
114
|
+
},
|
|
115
|
+
routes: {
|
|
116
|
+
type: "array",
|
|
117
|
+
description: "Required. Array of screen-to-route mappings.",
|
|
118
|
+
items: {
|
|
119
|
+
type: "object",
|
|
120
|
+
properties: {
|
|
121
|
+
screenId: {
|
|
122
|
+
type: "string",
|
|
123
|
+
description: "The screen ID to use for this route."
|
|
124
|
+
},
|
|
125
|
+
route: {
|
|
126
|
+
type: "string",
|
|
127
|
+
description: 'The route path (e.g. "/" or "/about").'
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
required: ["screenId", "route"]
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
required: ["projectId", "routes"]
|
|
135
|
+
},
|
|
136
|
+
execute: async (client, args, stitch2) => {
|
|
137
|
+
if (!stitch2)
|
|
138
|
+
throw new Error("build_site requires a Stitch instance");
|
|
139
|
+
const { projectId, routes } = args;
|
|
140
|
+
if (!Array.isArray(routes)) {
|
|
141
|
+
throw new Error("routes must be an array");
|
|
142
|
+
}
|
|
143
|
+
if (routes.length === 0) {
|
|
144
|
+
throw new Error("routes must be a non-empty array");
|
|
145
|
+
}
|
|
146
|
+
for (const entry of routes) {
|
|
147
|
+
if (!entry.screenId || typeof entry.screenId !== "string") {
|
|
148
|
+
throw new Error('Each route entry must have a "screenId" string');
|
|
149
|
+
}
|
|
150
|
+
if (!entry.route || typeof entry.route !== "string") {
|
|
151
|
+
throw new Error('Each route entry must have a "route" string');
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
const routePaths = routes.map((r) => r.route);
|
|
155
|
+
const uniqueRoutes = new Set(routePaths);
|
|
156
|
+
if (uniqueRoutes.size !== routePaths.length) {
|
|
157
|
+
const duplicates = routePaths.filter((r, i) => routePaths.indexOf(r) !== i);
|
|
158
|
+
throw new Error(`Duplicate route paths found: ${[...new Set(duplicates)].join(", ")}`);
|
|
159
|
+
}
|
|
160
|
+
const project = stitch2.project(projectId);
|
|
161
|
+
const sdkScreens = await project.screens();
|
|
162
|
+
const screenMap = new Map(sdkScreens.map((s) => [s.screenId, s]));
|
|
163
|
+
const missingIds = routes.map((r) => r.screenId).filter((id) => !screenMap.has(id));
|
|
164
|
+
if (missingIds.length > 0) {
|
|
165
|
+
throw new Error(`Screen IDs not found in project: ${missingIds.join(", ")}`);
|
|
166
|
+
}
|
|
167
|
+
const limit = pLimit(3);
|
|
168
|
+
const htmlContent = new Map;
|
|
169
|
+
const errors = [];
|
|
170
|
+
await Promise.all(routes.map((r) => limit(async () => {
|
|
171
|
+
const screen = screenMap.get(r.screenId);
|
|
172
|
+
try {
|
|
173
|
+
const htmlUrl = await screen.getHtml();
|
|
174
|
+
if (htmlUrl) {
|
|
175
|
+
const html = await fetchWithRetry(htmlUrl);
|
|
176
|
+
htmlContent.set(r.screenId, html);
|
|
177
|
+
} else {
|
|
178
|
+
htmlContent.set(r.screenId, "");
|
|
179
|
+
}
|
|
180
|
+
} catch (e) {
|
|
181
|
+
errors.push(`${r.screenId}: ${e.message}`);
|
|
182
|
+
}
|
|
183
|
+
})));
|
|
184
|
+
if (errors.length > 0) {
|
|
185
|
+
throw new Error(`Failed to fetch HTML for screens: ${errors.join("; ")}`);
|
|
186
|
+
}
|
|
187
|
+
const pages = routes.map((r) => ({
|
|
188
|
+
screenId: r.screenId,
|
|
189
|
+
route: r.route,
|
|
190
|
+
title: screenMap.get(r.screenId).title ?? r.screenId,
|
|
191
|
+
html: htmlContent.get(r.screenId)
|
|
192
|
+
}));
|
|
193
|
+
return {
|
|
194
|
+
success: true,
|
|
195
|
+
pages,
|
|
196
|
+
message: `Built ${pages.length} page(s) with design HTML`
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
// src/commands/tool/virtual-tools/list-tools.ts
|
|
201
|
+
var listToolsTool = {
|
|
202
|
+
name: "list_tools",
|
|
203
|
+
description: "List all available tools with their descriptions and schemas.",
|
|
204
|
+
inputSchema: {
|
|
205
|
+
type: "object",
|
|
206
|
+
properties: {}
|
|
207
|
+
},
|
|
208
|
+
execute: async (client, _args) => {
|
|
209
|
+
const result = await client.listTools();
|
|
210
|
+
return result.tools || [];
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
// src/commands/tool/virtual-tools/index.ts
|
|
214
|
+
var virtualTools = [
|
|
215
|
+
getScreenCodeTool,
|
|
216
|
+
getScreenImageTool,
|
|
217
|
+
buildSiteTool,
|
|
218
|
+
listToolsTool
|
|
219
|
+
];
|
|
220
|
+
|
|
221
|
+
// src/commands/tool/steps/ListToolsStep.ts
|
|
222
|
+
class ListToolsStep {
|
|
223
|
+
id = "list-tools";
|
|
224
|
+
name = "List available tools";
|
|
225
|
+
async shouldRun(context) {
|
|
226
|
+
const name = context.input.toolName?.toLowerCase();
|
|
227
|
+
return !name || name === "list" || name === "listtools" || name === "list_tools";
|
|
228
|
+
}
|
|
229
|
+
async run(context) {
|
|
230
|
+
const result = await context.client.listTools();
|
|
231
|
+
const serverTools = result.tools || [];
|
|
232
|
+
const tools = [
|
|
233
|
+
...context.virtualTools.map((t) => ({ name: t.name, description: t.description, inputSchema: t.inputSchema, virtual: true })),
|
|
234
|
+
...serverTools.map((t) => ({ ...t, virtual: false }))
|
|
235
|
+
];
|
|
236
|
+
context.result = { success: true, data: tools };
|
|
237
|
+
return { success: true };
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// src/commands/tool/steps/ShowSchemaStep.ts
|
|
242
|
+
class ShowSchemaStep {
|
|
243
|
+
id = "show-schema";
|
|
244
|
+
name = "Show tool schema";
|
|
245
|
+
async shouldRun(context) {
|
|
246
|
+
return !!context.input.toolName && context.input.toolName !== "list" && context.input.showSchema;
|
|
247
|
+
}
|
|
248
|
+
async run(context) {
|
|
249
|
+
const toolName = context.input.toolName;
|
|
250
|
+
const result = await context.client.listTools();
|
|
251
|
+
const serverTools = result.tools || [];
|
|
252
|
+
const allTools = [...context.virtualTools, ...serverTools];
|
|
253
|
+
const tool = allTools.find((t) => t.name === toolName);
|
|
254
|
+
if (!tool) {
|
|
255
|
+
context.result = { success: false, error: `Tool not found: ${toolName}` };
|
|
256
|
+
return { success: false, error: new Error(`Tool not found: ${toolName}`) };
|
|
257
|
+
}
|
|
258
|
+
context.result = { success: true, data: this.formatSchema(tool) };
|
|
259
|
+
return { success: true };
|
|
260
|
+
}
|
|
261
|
+
formatSchema(tool) {
|
|
262
|
+
const schema = tool.inputSchema;
|
|
263
|
+
const args = {};
|
|
264
|
+
if (schema?.properties) {
|
|
265
|
+
for (const [key, prop] of Object.entries(schema.properties)) {
|
|
266
|
+
const required = schema.required?.includes(key) ? "(required)" : "(optional)";
|
|
267
|
+
args[key] = `${prop.type} ${required}${prop.description ? " - " + prop.description : ""}`;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return {
|
|
271
|
+
name: tool.name,
|
|
272
|
+
description: tool.description,
|
|
273
|
+
virtual: tool.virtual ?? false,
|
|
274
|
+
arguments: args,
|
|
275
|
+
example: this.generateExample(tool)
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
generateExample(tool) {
|
|
279
|
+
const exampleArgs = {};
|
|
280
|
+
if (tool.inputSchema?.properties) {
|
|
281
|
+
for (const [key, prop] of Object.entries(tool.inputSchema.properties)) {
|
|
282
|
+
exampleArgs[key] = prop.type === "string" ? `<${key}>` : `<${prop.type}>`;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return `stitch-mcp tool ${tool.name} -d '${JSON.stringify(exampleArgs)}'`;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// src/commands/tool/steps/ParseArgsStep.ts
|
|
290
|
+
class ParseArgsStep {
|
|
291
|
+
id = "parse-args";
|
|
292
|
+
name = "Parse tool arguments";
|
|
293
|
+
async shouldRun(context) {
|
|
294
|
+
return !!context.input.toolName && context.input.toolName !== "list" && !context.input.showSchema;
|
|
295
|
+
}
|
|
296
|
+
async run(context) {
|
|
297
|
+
let args = {};
|
|
298
|
+
if (context.input.data) {
|
|
299
|
+
args = JSON.parse(context.input.data);
|
|
300
|
+
} else if (context.input.dataFile) {
|
|
301
|
+
const content = await Bun.file(context.input.dataFile.replace("@", "")).text();
|
|
302
|
+
args = JSON.parse(content);
|
|
303
|
+
}
|
|
304
|
+
context.parsedArgs = args;
|
|
305
|
+
return { success: true };
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// src/commands/tool/steps/ValidateToolStep.ts
|
|
310
|
+
class ValidateToolStep {
|
|
311
|
+
id = "validate-tool";
|
|
312
|
+
name = "Validate tool exists";
|
|
313
|
+
async shouldRun(context) {
|
|
314
|
+
return !!context.input.toolName && context.input.toolName !== "list" && !context.input.showSchema && context.parsedArgs !== undefined;
|
|
315
|
+
}
|
|
316
|
+
async run(context) {
|
|
317
|
+
const toolName = context.input.toolName;
|
|
318
|
+
const result = await context.client.listTools();
|
|
319
|
+
const serverTools = result.tools || [];
|
|
320
|
+
const allTools = [...context.virtualTools, ...serverTools];
|
|
321
|
+
const found = allTools.find((t) => t.name === toolName);
|
|
322
|
+
if (!found) {
|
|
323
|
+
const availableNames = allTools.map((t) => t.name).sort();
|
|
324
|
+
context.result = {
|
|
325
|
+
success: false,
|
|
326
|
+
error: `Tool not found: "${toolName}". Use "list_tools" to see available tools.`,
|
|
327
|
+
data: {
|
|
328
|
+
requestedTool: toolName,
|
|
329
|
+
availableTools: availableNames,
|
|
330
|
+
hint: 'Call "list_tools" to see all available tools with descriptions and schemas.'
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
return { success: false, error: new Error(`Tool not found: ${toolName}`) };
|
|
334
|
+
}
|
|
335
|
+
return { success: true };
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// src/commands/tool/steps/ExecuteToolStep.ts
|
|
340
|
+
class ExecuteToolStep {
|
|
341
|
+
id = "execute-tool";
|
|
342
|
+
name = "Execute tool";
|
|
343
|
+
async shouldRun(context) {
|
|
344
|
+
return context.parsedArgs !== undefined;
|
|
345
|
+
}
|
|
346
|
+
async run(context) {
|
|
347
|
+
const toolName = context.input.toolName;
|
|
348
|
+
const args = context.parsedArgs;
|
|
349
|
+
const virtualTool = context.virtualTools.find((t) => t.name === toolName);
|
|
350
|
+
if (virtualTool) {
|
|
351
|
+
try {
|
|
352
|
+
const result2 = await virtualTool.execute(context.client, args, context.stitch);
|
|
353
|
+
context.result = { success: true, data: result2 };
|
|
354
|
+
return { success: true };
|
|
355
|
+
} catch (e) {
|
|
356
|
+
context.result = { success: false, error: `Virtual tool execution failed: ${e.message || String(e)}` };
|
|
357
|
+
return { success: false, error: e };
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
const result = await context.client.callTool(toolName, args);
|
|
361
|
+
context.result = { success: true, data: result };
|
|
362
|
+
return { success: true };
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// src/commands/tool/handler.ts
|
|
367
|
+
var deps = {
|
|
368
|
+
runSteps,
|
|
369
|
+
ListToolsStep,
|
|
370
|
+
ShowSchemaStep,
|
|
371
|
+
ParseArgsStep,
|
|
372
|
+
ValidateToolStep,
|
|
373
|
+
ExecuteToolStep
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
class ToolCommandHandler {
|
|
377
|
+
client;
|
|
378
|
+
stitchInstance;
|
|
379
|
+
tools;
|
|
380
|
+
steps;
|
|
381
|
+
constructor(client, tools, stitchInstance) {
|
|
382
|
+
this.client = client || new StitchToolClient;
|
|
383
|
+
this.stitchInstance = stitchInstance || stitch;
|
|
384
|
+
this.tools = tools || virtualTools;
|
|
385
|
+
this.steps = [
|
|
386
|
+
new deps.ListToolsStep,
|
|
387
|
+
new deps.ShowSchemaStep,
|
|
388
|
+
new deps.ParseArgsStep,
|
|
389
|
+
new deps.ValidateToolStep,
|
|
390
|
+
new deps.ExecuteToolStep
|
|
391
|
+
];
|
|
392
|
+
}
|
|
393
|
+
async execute(input) {
|
|
394
|
+
const context = {
|
|
395
|
+
input,
|
|
396
|
+
client: this.client,
|
|
397
|
+
stitch: this.stitchInstance,
|
|
398
|
+
virtualTools: this.tools
|
|
399
|
+
};
|
|
400
|
+
try {
|
|
401
|
+
await deps.runSteps(this.steps, context, {
|
|
402
|
+
onAfterStep: (_step, _result, ctx) => ctx.result !== undefined
|
|
403
|
+
});
|
|
404
|
+
} finally {
|
|
405
|
+
await this.client.close();
|
|
406
|
+
}
|
|
407
|
+
return context.result ?? { success: false, error: "No step produced a result" };
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
export {
|
|
411
|
+
deps,
|
|
412
|
+
ToolCommandHandler
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
//# debugId=7A003C51AFD3BD2C64756E2164756E21
|
|
@@ -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 { StitchToolClient, Stitch } from '@google/stitch-sdk';\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: StitchToolClient, args: any, stitch?: Stitch) => {\n if (!stitch) throw new Error('get_screen_code requires a Stitch instance');\n const { projectId, screenId } = args;\n\n // 1. Get the screen details using the injected SDK instance\n const screen = await stitch.project(projectId).getScreen(screenId);\n\n // 2. Fetch HTML Code\n let htmlContent: string | null = null;\n try {\n const htmlUrl = await screen.getHtml();\n if (htmlUrl) {\n htmlContent = await downloadText(htmlUrl);\n }\n } catch (e) {\n console.error(`Error downloading HTML code: ${e}`);\n }\n\n // 3. Return screen with code content\n return {\n screenId: screen.screenId,\n projectId: screen.projectId,\n htmlContent,\n };\n },\n};\n",
|
|
6
|
+
"import type { StitchToolClient, Stitch } from '@google/stitch-sdk';\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 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: StitchToolClient, args: any, stitch?: Stitch) => {\n if (!stitch) throw new Error('get_screen_image requires a Stitch instance');\n const { projectId, screenId } = args;\n\n // 1. Get the screen details using the injected SDK instance\n const screen = await stitch.project(projectId).getScreen(screenId);\n\n // 2. Fetch Image Content\n let imageContent: string | null = null;\n try {\n const imageUrl = await screen.getImage();\n if (imageUrl) {\n const response = await fetch(imageUrl);\n const arrayBuffer = await response.arrayBuffer();\n const buffer = Buffer.from(arrayBuffer);\n imageContent = buffer.toString('base64');\n }\n } catch (e) {\n console.error(`Error downloading screenshot: ${e}`);\n }\n\n // 3. Return screen with image content\n return {\n screenId: screen.screenId,\n projectId: screen.projectId,\n imageContent,\n };\n },\n};\n",
|
|
7
|
+
"import type { StitchToolClient, Stitch } from '@google/stitch-sdk';\nimport type { VirtualTool } from '../spec.js';\nimport pLimit from 'p-limit';\nimport { fetchWithRetry } from '../../site/utils/fetchWithRetry.js';\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: StitchToolClient, args: any, stitch?: Stitch) => {\n if (!stitch) throw new Error('build_site requires a Stitch instance');\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 via injected SDK instance\n const project = stitch.project(projectId);\n const sdkScreens = await project.screens();\n const screenMap = new Map(sdkScreens.map((s: any) => [s.screenId, 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 htmlUrl = await screen.getHtml();\n if (htmlUrl) {\n const html = await fetchWithRetry(htmlUrl);\n htmlContent.set(r.screenId, html);\n } else {\n htmlContent.set(r.screenId, '');\n }\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 ?? r.screenId,\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 { StitchToolClient } from '@google/stitch-sdk';\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: StitchToolClient, _args: any) => {\n const result = await client.listTools();\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.listTools();\n const serverTools = result.tools || [];\n const tools = [\n ...context.virtualTools.map(t => ({ name: t.name, description: t.description, inputSchema: t.inputSchema, virtual: true as const })),\n ...serverTools.map(t => ({ ...t, virtual: false as const })),\n ];\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.listTools();\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 virtual: tool.virtual ?? false,\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.listTools();\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, context.stitch);\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 { StitchToolClient, stitch as defaultStitch } from '@google/stitch-sdk';\nimport type { Stitch } from '@google/stitch-sdk';\nimport type { CommandStep } from '../../framework/CommandStep.js';\nimport { runSteps } from '../../framework/StepRunner.js';\nimport type { ToolCommandInput, ToolCommandResult, VirtualTool } from './spec.js';\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 const deps = {\n runSteps,\n ListToolsStep,\n ShowSchemaStep,\n ParseArgsStep,\n ValidateToolStep,\n ExecuteToolStep,\n};\n\nexport class ToolCommandHandler {\n private client: StitchToolClient;\n private stitchInstance: Stitch;\n private tools: VirtualTool[];\n private steps: CommandStep<ToolContext>[];\n\n constructor(client?: StitchToolClient, tools?: VirtualTool[], stitchInstance?: Stitch) {\n this.client = client || new StitchToolClient();\n this.stitchInstance = stitchInstance || defaultStitch;\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 stitch: this.stitchInstance,\n virtualTools: this.tools,\n };\n\n try {\n await deps.runSteps(this.steps, context, {\n onAfterStep: (_step, _result, ctx) => ctx.result !== undefined,\n });\n } finally {\n await this.client.close();\n }\n\n return context.result ?? { success: false, error: 'No step produced a result' };\n }\n}\n"
|
|
16
|
+
],
|
|
17
|
+
"mappings": ";;;;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