@efectoapp/mcp-studio 0.1.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.
- package/README.md +124 -0
- package/dist/cli.d.ts +10 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +276 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +84 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/session.d.ts +21 -0
- package/dist/tools/session.d.ts.map +1 -0
- package/dist/tools/session.js +273 -0
- package/dist/tools/session.js.map +1 -0
- package/dist/tools/studio.d.ts +18 -0
- package/dist/tools/studio.d.ts.map +1 -0
- package/dist/tools/studio.js +634 -0
- package/dist/tools/studio.js.map +1 -0
- package/package.json +55 -0
- package/skills/STUDIO-SKILL.md +802 -0
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Studio Design Tools — First-Class MCP Tools
|
|
4
|
+
*
|
|
5
|
+
* Every Studio AI tool is exposed as its own MCP tool with a full schema.
|
|
6
|
+
* No more proxy pattern — agents call tools directly.
|
|
7
|
+
*
|
|
8
|
+
* The active session ID is auto-resolved from the session module.
|
|
9
|
+
* Each tool also accepts an optional `sessionId` override for multi-session use.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.studioTools = void 0;
|
|
13
|
+
exports.handleStudioTool = handleStudioTool;
|
|
14
|
+
const session_js_1 = require("./session.js");
|
|
15
|
+
// Base URL for Efecto API
|
|
16
|
+
const API_BASE = process.env.EFECTO_API_URL || 'https://efecto.app';
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
// Helper: Execute a tool in the active session
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
async function executeInSession(tool, input, sessionIdOverride) {
|
|
21
|
+
const sessionId = sessionIdOverride || (0, session_js_1.getActiveSessionId)();
|
|
22
|
+
if (!sessionId) {
|
|
23
|
+
return {
|
|
24
|
+
content: [{
|
|
25
|
+
type: 'text',
|
|
26
|
+
text: JSON.stringify({
|
|
27
|
+
success: false,
|
|
28
|
+
error: 'No active session. Call create_session first.',
|
|
29
|
+
}, null, 2),
|
|
30
|
+
}],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
const url = `${API_BASE}/api/v1/studio/sessions/${sessionId}/execute?wait=true`;
|
|
35
|
+
const abortController = new AbortController();
|
|
36
|
+
const timeoutId = setTimeout(() => abortController.abort(), 35_000);
|
|
37
|
+
const response = await fetch(url, {
|
|
38
|
+
method: 'POST',
|
|
39
|
+
headers: { 'Content-Type': 'application/json' },
|
|
40
|
+
body: JSON.stringify({ tool, input }),
|
|
41
|
+
signal: abortController.signal,
|
|
42
|
+
});
|
|
43
|
+
clearTimeout(timeoutId);
|
|
44
|
+
if (!response.ok) {
|
|
45
|
+
const errorText = await response.text();
|
|
46
|
+
return {
|
|
47
|
+
content: [{
|
|
48
|
+
type: 'text',
|
|
49
|
+
text: JSON.stringify({
|
|
50
|
+
success: false,
|
|
51
|
+
error: `API error: ${response.status}`,
|
|
52
|
+
details: errorText,
|
|
53
|
+
}, null, 2),
|
|
54
|
+
}],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const data = await response.json();
|
|
58
|
+
if (data.result) {
|
|
59
|
+
return {
|
|
60
|
+
content: [{
|
|
61
|
+
type: 'text',
|
|
62
|
+
text: JSON.stringify({
|
|
63
|
+
success: data.result.success,
|
|
64
|
+
message: data.result.message,
|
|
65
|
+
data: data.result.data,
|
|
66
|
+
}, null, 2),
|
|
67
|
+
}],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
content: [{
|
|
72
|
+
type: 'text',
|
|
73
|
+
text: JSON.stringify({
|
|
74
|
+
success: true,
|
|
75
|
+
status: data.status,
|
|
76
|
+
message: data.status === 'pending'
|
|
77
|
+
? 'Tool call queued. The browser will execute it when connected.'
|
|
78
|
+
: `Tool call status: ${data.status}`,
|
|
79
|
+
}, null, 2),
|
|
80
|
+
}],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
const isAbort = error instanceof Error && error.name === 'AbortError';
|
|
85
|
+
return {
|
|
86
|
+
content: [{
|
|
87
|
+
type: 'text',
|
|
88
|
+
text: JSON.stringify({
|
|
89
|
+
success: false,
|
|
90
|
+
error: isAbort
|
|
91
|
+
? 'Request timed out after 35s. Is the browser connected?'
|
|
92
|
+
: 'Failed to execute tool',
|
|
93
|
+
details: error instanceof Error ? error.message : String(error),
|
|
94
|
+
}, null, 2),
|
|
95
|
+
}],
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
// Optional sessionId property — added to every tool schema
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
const sessionIdProp = {
|
|
103
|
+
sessionId: {
|
|
104
|
+
type: 'string',
|
|
105
|
+
description: 'Optional session ID override (defaults to the active session from create_session)',
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
// Tool Definitions — 33 first-class MCP tools
|
|
110
|
+
// ---------------------------------------------------------------------------
|
|
111
|
+
exports.studioTools = [
|
|
112
|
+
// --- Reading State ---
|
|
113
|
+
{
|
|
114
|
+
name: 'get_document',
|
|
115
|
+
description: 'Returns the current Studio document serialized as JSX-like markup. ' +
|
|
116
|
+
'Each element has a data-id attribute you can reference in other tools. ' +
|
|
117
|
+
'Always call this before modifying an existing design.',
|
|
118
|
+
inputSchema: {
|
|
119
|
+
type: 'object',
|
|
120
|
+
properties: { ...sessionIdProp },
|
|
121
|
+
required: [],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'list_artboards',
|
|
126
|
+
description: 'Lists all artboards with IDs, names, dimensions, and positions.',
|
|
127
|
+
inputSchema: {
|
|
128
|
+
type: 'object',
|
|
129
|
+
properties: { ...sessionIdProp },
|
|
130
|
+
required: [],
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'find_nodes',
|
|
135
|
+
description: 'Searches for nodes by name, text content, type, or className.',
|
|
136
|
+
inputSchema: {
|
|
137
|
+
type: 'object',
|
|
138
|
+
properties: {
|
|
139
|
+
query: { type: 'string', description: 'Search term (matches name and text, case-insensitive)' },
|
|
140
|
+
type: { type: 'string', enum: ['frame', 'text', 'image', 'button', 'link', 'icon', 'input', 'video', 'component'] },
|
|
141
|
+
classNameContains: { type: 'string' },
|
|
142
|
+
...sessionIdProp,
|
|
143
|
+
},
|
|
144
|
+
required: [],
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
// --- Creating Content ---
|
|
148
|
+
{
|
|
149
|
+
name: 'create_artboard',
|
|
150
|
+
description: 'Creates a new artboard. IMPORTANT: Set className to "flex flex-col" for vertical layout. ' +
|
|
151
|
+
'Common sizes: Desktop (1440x900), Tablet (768x1024), Mobile (375x812).',
|
|
152
|
+
inputSchema: {
|
|
153
|
+
type: 'object',
|
|
154
|
+
properties: {
|
|
155
|
+
name: { type: 'string', description: 'Name of the artboard' },
|
|
156
|
+
width: { type: 'number', description: 'Width in CSS pixels (default: 1440)' },
|
|
157
|
+
height: { type: 'number', description: 'Height in CSS pixels (default: 900)' },
|
|
158
|
+
x: { type: 'number', description: 'Horizontal position on the canvas' },
|
|
159
|
+
y: { type: 'number', description: 'Vertical position on the canvas' },
|
|
160
|
+
backgroundColor: { type: 'string', description: 'Background color as hex (default: "#ffffff")' },
|
|
161
|
+
className: { type: 'string', description: 'Tailwind CSS classes (use "flex flex-col" for vertical layout)' },
|
|
162
|
+
...sessionIdProp,
|
|
163
|
+
},
|
|
164
|
+
required: ['name', 'width', 'height'],
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: 'add_section',
|
|
169
|
+
description: 'Adds a complete section from JSX-like markup. Most efficient for complex layouts. ' +
|
|
170
|
+
'Write standard JSX with HTML tags and Tailwind className attributes.',
|
|
171
|
+
inputSchema: {
|
|
172
|
+
type: 'object',
|
|
173
|
+
properties: {
|
|
174
|
+
parentId: { type: 'string', description: 'ID of the parent artboard or node' },
|
|
175
|
+
jsx: { type: 'string', description: 'JSX-like markup with HTML tags and Tailwind className' },
|
|
176
|
+
index: { type: 'number', description: 'Insert position (appends if omitted)' },
|
|
177
|
+
...sessionIdProp,
|
|
178
|
+
},
|
|
179
|
+
required: ['parentId', 'jsx'],
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: 'add_node',
|
|
184
|
+
description: 'Adds a single node to the document tree.',
|
|
185
|
+
inputSchema: {
|
|
186
|
+
type: 'object',
|
|
187
|
+
properties: {
|
|
188
|
+
parentId: { type: 'string', description: 'ID of the parent artboard or node' },
|
|
189
|
+
type: { type: 'string', enum: ['frame', 'text', 'image', 'button', 'link', 'icon', 'input', 'video', 'component'] },
|
|
190
|
+
tag: { type: 'string', description: 'HTML tag to render' },
|
|
191
|
+
className: { type: 'string', description: 'Tailwind CSS classes' },
|
|
192
|
+
textContent: { type: 'string' },
|
|
193
|
+
src: { type: 'string' },
|
|
194
|
+
alt: { type: 'string' },
|
|
195
|
+
href: { type: 'string' },
|
|
196
|
+
placeholder: { type: 'string' },
|
|
197
|
+
variant: { type: 'string', enum: ['primary', 'secondary', 'outline', 'ghost', 'destructive'] },
|
|
198
|
+
disabled: { type: 'boolean' },
|
|
199
|
+
name: { type: 'string' },
|
|
200
|
+
index: { type: 'number' },
|
|
201
|
+
style: { type: 'object' },
|
|
202
|
+
...sessionIdProp,
|
|
203
|
+
},
|
|
204
|
+
required: ['parentId', 'type'],
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
name: 'replace_section',
|
|
209
|
+
description: 'Replaces an existing node with new JSX content in-place. Preserves position in parent.',
|
|
210
|
+
inputSchema: {
|
|
211
|
+
type: 'object',
|
|
212
|
+
properties: {
|
|
213
|
+
nodeId: { type: 'string', description: 'ID of the node to replace' },
|
|
214
|
+
jsx: { type: 'string', description: 'JSX-like markup for the replacement' },
|
|
215
|
+
...sessionIdProp,
|
|
216
|
+
},
|
|
217
|
+
required: ['nodeId', 'jsx'],
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
// --- Modifying Content ---
|
|
221
|
+
{
|
|
222
|
+
name: 'update_node',
|
|
223
|
+
description: 'Updates properties of an existing node. Only specified properties are changed.',
|
|
224
|
+
inputSchema: {
|
|
225
|
+
type: 'object',
|
|
226
|
+
properties: {
|
|
227
|
+
nodeId: { type: 'string', description: 'ID of the node to update (from data-id)' },
|
|
228
|
+
className: { type: 'string' },
|
|
229
|
+
textContent: { type: 'string' },
|
|
230
|
+
tag: { type: 'string' },
|
|
231
|
+
style: { type: 'object' },
|
|
232
|
+
name: { type: 'string' },
|
|
233
|
+
src: { type: 'string' },
|
|
234
|
+
alt: { type: 'string' },
|
|
235
|
+
href: { type: 'string' },
|
|
236
|
+
placeholder: { type: 'string' },
|
|
237
|
+
variant: { type: 'string', enum: ['primary', 'secondary', 'outline', 'ghost', 'destructive'] },
|
|
238
|
+
disabled: { type: 'boolean' },
|
|
239
|
+
...sessionIdProp,
|
|
240
|
+
},
|
|
241
|
+
required: ['nodeId'],
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: 'update_class',
|
|
246
|
+
description: 'Updates only the className of a node. Replaces existing className entirely.',
|
|
247
|
+
inputSchema: {
|
|
248
|
+
type: 'object',
|
|
249
|
+
properties: {
|
|
250
|
+
nodeId: { type: 'string' },
|
|
251
|
+
className: { type: 'string' },
|
|
252
|
+
...sessionIdProp,
|
|
253
|
+
},
|
|
254
|
+
required: ['nodeId', 'className'],
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
name: 'update_artboard',
|
|
259
|
+
description: 'Updates properties of an existing artboard (resize, rename, change background).',
|
|
260
|
+
inputSchema: {
|
|
261
|
+
type: 'object',
|
|
262
|
+
properties: {
|
|
263
|
+
artboardId: { type: 'string', description: 'ID of the artboard to update' },
|
|
264
|
+
name: { type: 'string' },
|
|
265
|
+
width: { type: 'number' },
|
|
266
|
+
height: { type: 'number' },
|
|
267
|
+
backgroundColor: { type: 'string' },
|
|
268
|
+
className: { type: 'string' },
|
|
269
|
+
...sessionIdProp,
|
|
270
|
+
},
|
|
271
|
+
required: ['artboardId'],
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
name: 'batch_update',
|
|
276
|
+
description: 'Updates multiple nodes in a single call. Efficient for bulk changes.',
|
|
277
|
+
inputSchema: {
|
|
278
|
+
type: 'object',
|
|
279
|
+
properties: {
|
|
280
|
+
updates: {
|
|
281
|
+
type: 'array',
|
|
282
|
+
items: {
|
|
283
|
+
type: 'object',
|
|
284
|
+
properties: {
|
|
285
|
+
nodeId: { type: 'string' },
|
|
286
|
+
className: { type: 'string' },
|
|
287
|
+
textContent: { type: 'string' },
|
|
288
|
+
style: { type: 'object' },
|
|
289
|
+
},
|
|
290
|
+
required: ['nodeId'],
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
...sessionIdProp,
|
|
294
|
+
},
|
|
295
|
+
required: ['updates'],
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
// --- Organizing Structure ---
|
|
299
|
+
{
|
|
300
|
+
name: 'move_node',
|
|
301
|
+
description: 'Moves a node to a new parent or reorders within current parent.',
|
|
302
|
+
inputSchema: {
|
|
303
|
+
type: 'object',
|
|
304
|
+
properties: {
|
|
305
|
+
nodeId: { type: 'string' },
|
|
306
|
+
newParentId: { type: 'string' },
|
|
307
|
+
index: { type: 'number' },
|
|
308
|
+
...sessionIdProp,
|
|
309
|
+
},
|
|
310
|
+
required: ['nodeId', 'newParentId'],
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: 'duplicate_node',
|
|
315
|
+
description: 'Duplicates a node and all its children. Inserted after the original.',
|
|
316
|
+
inputSchema: {
|
|
317
|
+
type: 'object',
|
|
318
|
+
properties: {
|
|
319
|
+
nodeId: { type: 'string' },
|
|
320
|
+
...sessionIdProp,
|
|
321
|
+
},
|
|
322
|
+
required: ['nodeId'],
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
name: 'duplicate_artboard',
|
|
327
|
+
description: 'Duplicates an entire artboard with all content. Creates a deep copy with fresh IDs.',
|
|
328
|
+
inputSchema: {
|
|
329
|
+
type: 'object',
|
|
330
|
+
properties: {
|
|
331
|
+
artboardId: { type: 'string' },
|
|
332
|
+
newName: { type: 'string' },
|
|
333
|
+
offsetX: { type: 'number' },
|
|
334
|
+
...sessionIdProp,
|
|
335
|
+
},
|
|
336
|
+
required: ['artboardId'],
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
name: 'group_nodes',
|
|
341
|
+
description: 'Groups selected nodes into a new frame container.',
|
|
342
|
+
inputSchema: {
|
|
343
|
+
type: 'object',
|
|
344
|
+
properties: {
|
|
345
|
+
nodeIds: { type: 'array', items: { type: 'string' } },
|
|
346
|
+
...sessionIdProp,
|
|
347
|
+
},
|
|
348
|
+
required: ['nodeIds'],
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
name: 'ungroup_node',
|
|
353
|
+
description: 'Ungroups a frame container, moving its children up to the parent.',
|
|
354
|
+
inputSchema: {
|
|
355
|
+
type: 'object',
|
|
356
|
+
properties: {
|
|
357
|
+
groupId: { type: 'string', description: 'ID of the group/frame node to ungroup' },
|
|
358
|
+
...sessionIdProp,
|
|
359
|
+
},
|
|
360
|
+
required: ['groupId'],
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
name: 'reorder_node',
|
|
365
|
+
description: 'Changes z-order: "front" = bring to top, "back" = send to bottom.',
|
|
366
|
+
inputSchema: {
|
|
367
|
+
type: 'object',
|
|
368
|
+
properties: {
|
|
369
|
+
nodeId: { type: 'string' },
|
|
370
|
+
position: { type: 'string', enum: ['front', 'back'] },
|
|
371
|
+
...sessionIdProp,
|
|
372
|
+
},
|
|
373
|
+
required: ['nodeId', 'position'],
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
// --- Display & Selection ---
|
|
377
|
+
{
|
|
378
|
+
name: 'select_nodes',
|
|
379
|
+
description: 'Selects nodes on the canvas to highlight for the user. Empty array deselects all.',
|
|
380
|
+
inputSchema: {
|
|
381
|
+
type: 'object',
|
|
382
|
+
properties: {
|
|
383
|
+
nodeIds: { type: 'array', items: { type: 'string' } },
|
|
384
|
+
...sessionIdProp,
|
|
385
|
+
},
|
|
386
|
+
required: ['nodeIds'],
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
name: 'set_visibility',
|
|
391
|
+
description: 'Shows or hides a node. Hidden nodes remain in the tree but are not rendered.',
|
|
392
|
+
inputSchema: {
|
|
393
|
+
type: 'object',
|
|
394
|
+
properties: {
|
|
395
|
+
nodeId: { type: 'string' },
|
|
396
|
+
visible: { type: 'boolean' },
|
|
397
|
+
...sessionIdProp,
|
|
398
|
+
},
|
|
399
|
+
required: ['nodeId', 'visible'],
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
name: 'delete_nodes',
|
|
404
|
+
description: 'Deletes one or more nodes and all their children.',
|
|
405
|
+
inputSchema: {
|
|
406
|
+
type: 'object',
|
|
407
|
+
properties: {
|
|
408
|
+
nodeIds: { type: 'array', items: { type: 'string' }, description: 'Array of node IDs to delete' },
|
|
409
|
+
...sessionIdProp,
|
|
410
|
+
},
|
|
411
|
+
required: ['nodeIds'],
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
name: 'delete_artboard',
|
|
416
|
+
description: 'Deletes an artboard and all its contents.',
|
|
417
|
+
inputSchema: {
|
|
418
|
+
type: 'object',
|
|
419
|
+
properties: {
|
|
420
|
+
artboardId: { type: 'string', description: 'ID of the artboard to delete' },
|
|
421
|
+
...sessionIdProp,
|
|
422
|
+
},
|
|
423
|
+
required: ['artboardId'],
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
// --- New: Alignment & Distribution ---
|
|
427
|
+
{
|
|
428
|
+
name: 'align_nodes',
|
|
429
|
+
description: 'Aligns multiple nodes along a shared axis (left/center/right/top/middle/bottom).',
|
|
430
|
+
inputSchema: {
|
|
431
|
+
type: 'object',
|
|
432
|
+
properties: {
|
|
433
|
+
nodeIds: { type: 'array', items: { type: 'string' }, description: 'Node IDs to align (min 2)' },
|
|
434
|
+
alignment: { type: 'string', enum: ['left', 'center', 'right', 'top', 'middle', 'bottom'] },
|
|
435
|
+
...sessionIdProp,
|
|
436
|
+
},
|
|
437
|
+
required: ['nodeIds', 'alignment'],
|
|
438
|
+
},
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
name: 'distribute_nodes',
|
|
442
|
+
description: 'Distributes nodes evenly with equal spacing (horizontal or vertical).',
|
|
443
|
+
inputSchema: {
|
|
444
|
+
type: 'object',
|
|
445
|
+
properties: {
|
|
446
|
+
nodeIds: { type: 'array', items: { type: 'string' }, description: 'Node IDs to distribute (min 3)' },
|
|
447
|
+
direction: { type: 'string', enum: ['horizontal', 'vertical'] },
|
|
448
|
+
...sessionIdProp,
|
|
449
|
+
},
|
|
450
|
+
required: ['nodeIds', 'direction'],
|
|
451
|
+
},
|
|
452
|
+
},
|
|
453
|
+
// --- New: History ---
|
|
454
|
+
{
|
|
455
|
+
name: 'undo',
|
|
456
|
+
description: 'Undoes the last action (Cmd+Z).',
|
|
457
|
+
inputSchema: {
|
|
458
|
+
type: 'object',
|
|
459
|
+
properties: { ...sessionIdProp },
|
|
460
|
+
required: [],
|
|
461
|
+
},
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
name: 'redo',
|
|
465
|
+
description: 'Redoes the last undone action (Cmd+Shift+Z).',
|
|
466
|
+
inputSchema: {
|
|
467
|
+
type: 'object',
|
|
468
|
+
properties: { ...sessionIdProp },
|
|
469
|
+
required: [],
|
|
470
|
+
},
|
|
471
|
+
},
|
|
472
|
+
// --- New: Viewport & Document ---
|
|
473
|
+
{
|
|
474
|
+
name: 'zoom_to_artboard',
|
|
475
|
+
description: 'Zooms the viewport to fit a specific artboard.',
|
|
476
|
+
inputSchema: {
|
|
477
|
+
type: 'object',
|
|
478
|
+
properties: {
|
|
479
|
+
artboardId: { type: 'string', description: 'ID of the artboard to zoom to' },
|
|
480
|
+
...sessionIdProp,
|
|
481
|
+
},
|
|
482
|
+
required: ['artboardId'],
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
name: 'rename_document',
|
|
487
|
+
description: 'Renames the Studio document.',
|
|
488
|
+
inputSchema: {
|
|
489
|
+
type: 'object',
|
|
490
|
+
properties: {
|
|
491
|
+
name: { type: 'string', description: 'New name for the document' },
|
|
492
|
+
...sessionIdProp,
|
|
493
|
+
},
|
|
494
|
+
required: ['name'],
|
|
495
|
+
},
|
|
496
|
+
},
|
|
497
|
+
// --- Canvas & Viewport ---
|
|
498
|
+
{
|
|
499
|
+
name: 'move_artboard',
|
|
500
|
+
description: 'Repositions an artboard on the canvas. Use to lay out multi-screen flows ' +
|
|
501
|
+
'(e.g. Desktop at 0,0, Tablet at 1540,0, Mobile at 2408,0).',
|
|
502
|
+
inputSchema: {
|
|
503
|
+
type: 'object',
|
|
504
|
+
properties: {
|
|
505
|
+
artboardId: { type: 'string', description: 'ID of the artboard to move' },
|
|
506
|
+
x: { type: 'number', description: 'New X position' },
|
|
507
|
+
y: { type: 'number', description: 'New Y position' },
|
|
508
|
+
...sessionIdProp,
|
|
509
|
+
},
|
|
510
|
+
required: ['artboardId', 'x', 'y'],
|
|
511
|
+
},
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
name: 'zoom_to_fit',
|
|
515
|
+
description: 'Zooms the viewport to fit all artboards. Useful after creating multiple artboards.',
|
|
516
|
+
inputSchema: {
|
|
517
|
+
type: 'object',
|
|
518
|
+
properties: { ...sessionIdProp },
|
|
519
|
+
required: [],
|
|
520
|
+
},
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
name: 'deselect_all',
|
|
524
|
+
description: 'Deselects all currently selected nodes. Clears the selection.',
|
|
525
|
+
inputSchema: {
|
|
526
|
+
type: 'object',
|
|
527
|
+
properties: { ...sessionIdProp },
|
|
528
|
+
required: [],
|
|
529
|
+
},
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
name: 'set_viewport',
|
|
533
|
+
description: 'Sets the viewport zoom level and/or pan position. Zoom 1.0 = 100%.',
|
|
534
|
+
inputSchema: {
|
|
535
|
+
type: 'object',
|
|
536
|
+
properties: {
|
|
537
|
+
zoom: { type: 'number', description: 'Zoom level (0.1 to 5.0, where 1.0 = 100%)' },
|
|
538
|
+
panX: { type: 'number', description: 'Horizontal pan offset' },
|
|
539
|
+
panY: { type: 'number', description: 'Vertical pan offset' },
|
|
540
|
+
...sessionIdProp,
|
|
541
|
+
},
|
|
542
|
+
required: [],
|
|
543
|
+
},
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
name: 'new_document',
|
|
547
|
+
description: 'Creates a new blank document, replacing the current one. WARNING: Discards unsaved changes.',
|
|
548
|
+
inputSchema: {
|
|
549
|
+
type: 'object',
|
|
550
|
+
properties: {
|
|
551
|
+
name: { type: 'string', description: 'Name for the new document (optional)' },
|
|
552
|
+
...sessionIdProp,
|
|
553
|
+
},
|
|
554
|
+
required: [],
|
|
555
|
+
},
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
name: 'get_node_tree',
|
|
559
|
+
description: 'Returns JSX for a specific node or artboard subtree (faster than get_document for one section).',
|
|
560
|
+
inputSchema: {
|
|
561
|
+
type: 'object',
|
|
562
|
+
properties: {
|
|
563
|
+
nodeId: { type: 'string', description: 'ID of the node or artboard to serialize' },
|
|
564
|
+
...sessionIdProp,
|
|
565
|
+
},
|
|
566
|
+
required: ['nodeId'],
|
|
567
|
+
},
|
|
568
|
+
},
|
|
569
|
+
];
|
|
570
|
+
// ---------------------------------------------------------------------------
|
|
571
|
+
// MCP tool name → Studio AI tool name mapping
|
|
572
|
+
// ---------------------------------------------------------------------------
|
|
573
|
+
const TOOL_NAME_MAP = {
|
|
574
|
+
// Reading
|
|
575
|
+
'get_document': 'studio_get_state',
|
|
576
|
+
'list_artboards': 'studio_list_artboards',
|
|
577
|
+
'find_nodes': 'studio_find_nodes',
|
|
578
|
+
// Creating
|
|
579
|
+
'create_artboard': 'studio_create_artboard',
|
|
580
|
+
'add_section': 'studio_add_section',
|
|
581
|
+
'add_node': 'studio_add_node',
|
|
582
|
+
'replace_section': 'studio_replace_section',
|
|
583
|
+
// Modifying
|
|
584
|
+
'update_node': 'studio_update_node',
|
|
585
|
+
'update_class': 'studio_update_className',
|
|
586
|
+
'update_artboard': 'studio_update_artboard',
|
|
587
|
+
'batch_update': 'studio_batch_update',
|
|
588
|
+
// Organizing
|
|
589
|
+
'move_node': 'studio_move_node',
|
|
590
|
+
'duplicate_node': 'studio_duplicate_node',
|
|
591
|
+
'duplicate_artboard': 'studio_duplicate_artboard',
|
|
592
|
+
'group_nodes': 'studio_group_nodes',
|
|
593
|
+
'ungroup_node': 'studio_ungroup_node',
|
|
594
|
+
'reorder_node': 'studio_reorder_node',
|
|
595
|
+
// Display
|
|
596
|
+
'select_nodes': 'studio_select_nodes',
|
|
597
|
+
'set_visibility': 'studio_set_visibility',
|
|
598
|
+
'delete_nodes': 'studio_delete_node',
|
|
599
|
+
'delete_artboard': 'studio_delete_artboard',
|
|
600
|
+
// Alignment
|
|
601
|
+
'align_nodes': 'studio_align_nodes',
|
|
602
|
+
'distribute_nodes': 'studio_distribute_nodes',
|
|
603
|
+
// History
|
|
604
|
+
'undo': 'studio_undo',
|
|
605
|
+
'redo': 'studio_redo',
|
|
606
|
+
// Viewport & Document
|
|
607
|
+
'zoom_to_artboard': 'studio_zoom_to_artboard',
|
|
608
|
+
'rename_document': 'studio_rename_document',
|
|
609
|
+
// Canvas & Viewport
|
|
610
|
+
'move_artboard': 'studio_move_artboard',
|
|
611
|
+
'zoom_to_fit': 'studio_zoom_to_fit',
|
|
612
|
+
'deselect_all': 'studio_deselect_all',
|
|
613
|
+
'set_viewport': 'studio_set_viewport',
|
|
614
|
+
'new_document': 'studio_new_document',
|
|
615
|
+
'get_node_tree': 'studio_get_node_tree',
|
|
616
|
+
};
|
|
617
|
+
// ---------------------------------------------------------------------------
|
|
618
|
+
// Handler
|
|
619
|
+
// ---------------------------------------------------------------------------
|
|
620
|
+
async function handleStudioTool(name, args) {
|
|
621
|
+
const params = args || {};
|
|
622
|
+
// Resolve the Studio AI tool name
|
|
623
|
+
const studioToolName = TOOL_NAME_MAP[name];
|
|
624
|
+
if (!studioToolName) {
|
|
625
|
+
return {
|
|
626
|
+
content: [{ type: 'text', text: `Unknown studio tool: ${name}` }],
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
// Extract sessionId override and pass remaining params as input
|
|
630
|
+
const { sessionId: sessionIdOverride, ...input } = params;
|
|
631
|
+
const sessionId = typeof sessionIdOverride === 'string' ? sessionIdOverride : undefined;
|
|
632
|
+
return executeInSession(studioToolName, input, sessionId);
|
|
633
|
+
}
|
|
634
|
+
//# sourceMappingURL=studio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"studio.js","sourceRoot":"","sources":["../../src/tools/studio.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAgqBH,4CAmBC;AAhrBD,6CAAiD;AAEjD,0BAA0B;AAC1B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,oBAAoB,CAAA;AAEnE,8EAA8E;AAC9E,+CA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