@muloka/figma-console-mcp 0.5.0 → 0.5.1

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 (107) hide show
  1. package/README.md +2 -0
  2. package/dist/core/websocket-connector.d.ts +2 -1
  3. package/dist/core/websocket-connector.d.ts.map +1 -1
  4. package/dist/core/websocket-connector.js +17 -2
  5. package/dist/core/websocket-connector.js.map +1 -1
  6. package/dist/core/websocket-server.d.ts +8 -1
  7. package/dist/core/websocket-server.d.ts.map +1 -1
  8. package/dist/core/websocket-server.js +18 -2
  9. package/dist/core/websocket-server.js.map +1 -1
  10. package/dist/core/write-tools.d.ts +3 -1
  11. package/dist/core/write-tools.d.ts.map +1 -1
  12. package/dist/core/write-tools.js +34 -14
  13. package/dist/core/write-tools.js.map +1 -1
  14. package/dist/local.d.ts +2 -1
  15. package/dist/local.d.ts.map +1 -1
  16. package/dist/local.js +5 -4
  17. package/dist/local.js.map +1 -1
  18. package/package.json +1 -1
  19. package/dist/apps/design-system-dashboard/mcp-app.html +0 -521
  20. package/dist/apps/token-browser/mcp-app.html +0 -410
  21. package/dist/cloudflare/apps/design-system-dashboard/scoring/accessibility.js +0 -277
  22. package/dist/cloudflare/apps/design-system-dashboard/scoring/component-metadata.js +0 -357
  23. package/dist/cloudflare/apps/design-system-dashboard/scoring/consistency.js +0 -341
  24. package/dist/cloudflare/apps/design-system-dashboard/scoring/coverage.js +0 -230
  25. package/dist/cloudflare/apps/design-system-dashboard/scoring/engine.js +0 -92
  26. package/dist/cloudflare/apps/design-system-dashboard/scoring/naming-semantics.js +0 -308
  27. package/dist/cloudflare/apps/design-system-dashboard/scoring/token-architecture.js +0 -349
  28. package/dist/cloudflare/apps/design-system-dashboard/scoring/types.js +0 -40
  29. package/dist/cloudflare/apps/design-system-dashboard/server.js +0 -159
  30. package/dist/cloudflare/apps/token-browser/server.js +0 -136
  31. package/dist/cloudflare/browser-manager.js +0 -157
  32. package/dist/cloudflare/core/accessibility-tools.js +0 -361
  33. package/dist/cloudflare/core/annotation-tools.js +0 -230
  34. package/dist/cloudflare/core/cloud-websocket-connector.js +0 -419
  35. package/dist/cloudflare/core/cloud-websocket-relay.js +0 -198
  36. package/dist/cloudflare/core/comment-tools.js +0 -292
  37. package/dist/cloudflare/core/config.js +0 -153
  38. package/dist/cloudflare/core/console-monitor.js +0 -427
  39. package/dist/cloudflare/core/deep-component-tools.js +0 -128
  40. package/dist/cloudflare/core/design-code-tools.js +0 -2793
  41. package/dist/cloudflare/core/design-system-manifest.js +0 -265
  42. package/dist/cloudflare/core/design-system-tools.js +0 -882
  43. package/dist/cloudflare/core/diagnose-tool.js +0 -100
  44. package/dist/cloudflare/core/diff/changelog-formatter.js +0 -275
  45. package/dist/cloudflare/core/diff/diff-engine.js +0 -334
  46. package/dist/cloudflare/core/diff/property-compare.js +0 -36
  47. package/dist/cloudflare/core/diff/version-cache.js +0 -74
  48. package/dist/cloudflare/core/enrichment/enrichment-service.js +0 -374
  49. package/dist/cloudflare/core/enrichment/index.js +0 -7
  50. package/dist/cloudflare/core/enrichment/relationship-mapper.js +0 -351
  51. package/dist/cloudflare/core/enrichment/style-resolver.js +0 -346
  52. package/dist/cloudflare/core/figjam-tools.js +0 -547
  53. package/dist/cloudflare/core/figma-api.js +0 -509
  54. package/dist/cloudflare/core/figma-connector.js +0 -7
  55. package/dist/cloudflare/core/figma-reconstruction-spec.js +0 -402
  56. package/dist/cloudflare/core/figma-style-extractor.js +0 -311
  57. package/dist/cloudflare/core/figma-tools.js +0 -3353
  58. package/dist/cloudflare/core/identity.js +0 -96
  59. package/dist/cloudflare/core/library-tools.js +0 -580
  60. package/dist/cloudflare/core/logger.js +0 -53
  61. package/dist/cloudflare/core/port-discovery.js +0 -935
  62. package/dist/cloudflare/core/resolve-package-root.js +0 -11
  63. package/dist/cloudflare/core/slides-tools.js +0 -714
  64. package/dist/cloudflare/core/slot-tools.js +0 -334
  65. package/dist/cloudflare/core/snippet-injector.js +0 -96
  66. package/dist/cloudflare/core/tokens/alias-resolver.js +0 -205
  67. package/dist/cloudflare/core/tokens/config.js +0 -294
  68. package/dist/cloudflare/core/tokens/dialect.js +0 -232
  69. package/dist/cloudflare/core/tokens/figma-converter.js +0 -323
  70. package/dist/cloudflare/core/tokens/formatters/css-vars.js +0 -338
  71. package/dist/cloudflare/core/tokens/formatters/dtcg.js +0 -376
  72. package/dist/cloudflare/core/tokens/formatters/index.js +0 -45
  73. package/dist/cloudflare/core/tokens/formatters/json.js +0 -205
  74. package/dist/cloudflare/core/tokens/formatters/less.js +0 -4
  75. package/dist/cloudflare/core/tokens/formatters/scss.js +0 -258
  76. package/dist/cloudflare/core/tokens/formatters/stubs.js +0 -13
  77. package/dist/cloudflare/core/tokens/formatters/style-dictionary-v3.js +0 -213
  78. package/dist/cloudflare/core/tokens/formatters/tailwind-v3.js +0 -237
  79. package/dist/cloudflare/core/tokens/formatters/tailwind-v4.js +0 -335
  80. package/dist/cloudflare/core/tokens/formatters/tokens-studio.js +0 -256
  81. package/dist/cloudflare/core/tokens/formatters/ts-module.js +0 -198
  82. package/dist/cloudflare/core/tokens/index.js +0 -16
  83. package/dist/cloudflare/core/tokens/parsers/css-vars.js +0 -4
  84. package/dist/cloudflare/core/tokens/parsers/dtcg.js +0 -280
  85. package/dist/cloudflare/core/tokens/parsers/index.js +0 -138
  86. package/dist/cloudflare/core/tokens/parsers/json.js +0 -7
  87. package/dist/cloudflare/core/tokens/parsers/scss.js +0 -4
  88. package/dist/cloudflare/core/tokens/parsers/stubs.js +0 -20
  89. package/dist/cloudflare/core/tokens/parsers/style-dictionary-v3.js +0 -4
  90. package/dist/cloudflare/core/tokens/parsers/tailwind-v3.js +0 -4
  91. package/dist/cloudflare/core/tokens/parsers/tailwind-v4.js +0 -4
  92. package/dist/cloudflare/core/tokens/parsers/tokens-studio.js +0 -4
  93. package/dist/cloudflare/core/tokens/schemas.js +0 -152
  94. package/dist/cloudflare/core/tokens/transforms/color.js +0 -12
  95. package/dist/cloudflare/core/tokens/transforms/index.js +0 -29
  96. package/dist/cloudflare/core/tokens/transforms/size.js +0 -7
  97. package/dist/cloudflare/core/tokens/types.js +0 -18
  98. package/dist/cloudflare/core/tokens-tools.js +0 -1788
  99. package/dist/cloudflare/core/types/design-code.js +0 -4
  100. package/dist/cloudflare/core/types/enriched.js +0 -5
  101. package/dist/cloudflare/core/types/index.js +0 -4
  102. package/dist/cloudflare/core/variable-resolver.js +0 -85
  103. package/dist/cloudflare/core/version-tools.js +0 -1199
  104. package/dist/cloudflare/core/websocket-connector.js +0 -436
  105. package/dist/cloudflare/core/websocket-server.js +0 -1009
  106. package/dist/cloudflare/core/write-tools.js +0 -2506
  107. package/dist/cloudflare/index.js +0 -3010
@@ -1,436 +0,0 @@
1
- /**
2
- * WebSocket Figma Connector
3
- *
4
- * Implements IFigmaConnector using the WebSocket Desktop Bridge transport.
5
- * Each method sends a command to the plugin UI via WebSocket and waits
6
- * for the response — same window.* functions, different transport.
7
- *
8
- * Data flow: MCP Server ←WebSocket→ ui.html ←postMessage→ code.js ←figma.*→ Figma
9
- */
10
- import { createChildLogger } from './logger.js';
11
- const logger = createChildLogger({ component: 'websocket-connector' });
12
- /**
13
- * Number of variants a CREATE_COMPONENT_SET request will produce:
14
- * Mode B = componentIds.length; Mode A = the cartesian product of the
15
- * property axes ({State:[a,b,c], Size:[s,l]} → 6).
16
- */
17
- export function componentSetVariantCount(params) {
18
- if (params.componentIds?.length)
19
- return params.componentIds.length;
20
- if (params.properties) {
21
- let count = 1;
22
- for (const values of Object.values(params.properties)) {
23
- count *= Math.max(1, values?.length ?? 1);
24
- }
25
- return count;
26
- }
27
- return 1;
28
- }
29
- /**
30
- * Server-hop timeout for CREATE_COMPONENT_SET, scaled by variant count.
31
- * The plugin builds all variants in ONE uncancellable pass, so timing out
32
- * early doesn't stop the work — it just makes the report contradict the
33
- * file state (set gets created after the "failure") and invites duplicate
34
- * retries. Budget ~1.2s per variant with a 30s floor and 120s cap, plus a
35
- * 5s buffer over the ui.html hop (which uses the same base formula) so the
36
- * plugin-side result or error always wins the race.
37
- *
38
- * NOTE: ui.html's CREATE_COMPONENT_SET route and
39
- * cloud-websocket-connector.ts mirror the base formula — keep all three in
40
- * sync.
41
- */
42
- export function componentSetTimeoutMs(params) {
43
- const count = componentSetVariantCount(params);
44
- return Math.min(120000, Math.max(30000, count * 1200)) + 5000;
45
- }
46
- export class WebSocketConnector {
47
- constructor(wsServer) {
48
- this.wsServer = wsServer;
49
- }
50
- async initialize() {
51
- if (!this.wsServer.isClientConnected()) {
52
- throw new Error('No WebSocket client connected. Make sure the Desktop Bridge plugin is open in Figma.');
53
- }
54
- logger.info('WebSocket connector initialized');
55
- }
56
- getTransportType() {
57
- return 'websocket';
58
- }
59
- // ============================================================================
60
- // Core execution
61
- // ============================================================================
62
- async executeInPluginContext(code) {
63
- return this.wsServer.sendCommand('EXECUTE_CODE', { code, timeout: 5000 }, 7000);
64
- }
65
- async getVariablesFromPluginUI(fileKey) {
66
- // Request the cached variables data that the plugin UI holds in window.__figmaVariablesData
67
- return this.wsServer.sendCommand('GET_VARIABLES_DATA', {}, 10000, fileKey);
68
- }
69
- async getVariables(fileKey) {
70
- // Execute the same variables-fetching code in the plugin worker context.
71
- //
72
- // IMPORTANT: Do NOT wrap this in an inner `(async () => { ... })()` IIFE.
73
- // figma-desktop-bridge/code.js already wraps every EXECUTE_CODE payload in
74
- // `(async function() { <code> })()`. An inner IIFE turns `return X` into a
75
- // statement-expression that builds (but doesn't return) a Promise — the
76
- // outer async returns undefined, and the result is silently dropped. See
77
- // issue #68. The bare try/catch with top-level `return` is the contract
78
- // code.js expects.
79
- const code = `
80
- try {
81
- if (typeof figma === 'undefined') {
82
- throw new Error('Figma API not available in this context');
83
- }
84
- const variables = await figma.variables.getLocalVariablesAsync();
85
- const collections = await figma.variables.getLocalVariableCollectionsAsync();
86
- return {
87
- success: true,
88
- timestamp: Date.now(),
89
- fileMetadata: { fileName: figma.root.name, fileKey: figma.fileKey || null },
90
- variables: variables.map(function(v) { return { id: v.id, name: v.name, key: v.key, resolvedType: v.resolvedType, valuesByMode: v.valuesByMode, variableCollectionId: v.variableCollectionId, scopes: v.scopes, description: v.description, hiddenFromPublishing: v.hiddenFromPublishing }; }),
91
- variableCollections: collections.map(function(c) { return { id: c.id, name: c.name, key: c.key, modes: c.modes, defaultModeId: c.defaultModeId, variableIds: c.variableIds }; })
92
- };
93
- } catch (error) {
94
- return { success: false, error: error.message };
95
- }
96
- `;
97
- return this.wsServer.sendCommand('EXECUTE_CODE', { code, timeout: 30000 }, 32000, fileKey);
98
- }
99
- async executeCodeViaUI(code, timeoutMs = 5000) {
100
- return this.wsServer.sendCommand('EXECUTE_CODE', { code, timeout: timeoutMs }, timeoutMs + 2000);
101
- }
102
- // ============================================================================
103
- // Variable operations
104
- // ============================================================================
105
- async updateVariable(variableId, modeId, value) {
106
- return this.wsServer.sendCommand('UPDATE_VARIABLE', { variableId, modeId, value });
107
- }
108
- async createVariable(name, collectionId, resolvedType, options) {
109
- const params = { name, collectionId, resolvedType };
110
- if (options) {
111
- if (options.valuesByMode)
112
- params.valuesByMode = options.valuesByMode;
113
- if (options.description)
114
- params.description = options.description;
115
- if (options.scopes)
116
- params.scopes = options.scopes;
117
- }
118
- return this.wsServer.sendCommand('CREATE_VARIABLE', params);
119
- }
120
- async deleteVariable(variableId) {
121
- return this.wsServer.sendCommand('DELETE_VARIABLE', { variableId });
122
- }
123
- async refreshVariables() {
124
- return this.wsServer.sendCommand('REFRESH_VARIABLES', {}, 300000);
125
- }
126
- async renameVariable(variableId, newName) {
127
- const result = await this.wsServer.sendCommand('RENAME_VARIABLE', { variableId, newName });
128
- // oldName may be embedded in variable data if ui.html handleResult doesn't pass it through
129
- if (!result.oldName && result.variable?.oldName)
130
- result.oldName = result.variable.oldName;
131
- return result;
132
- }
133
- async setVariableDescription(variableId, description) {
134
- return this.wsServer.sendCommand('SET_VARIABLE_DESCRIPTION', { variableId, description });
135
- }
136
- // ============================================================================
137
- // Mode operations
138
- // ============================================================================
139
- async addMode(collectionId, modeName) {
140
- return this.wsServer.sendCommand('ADD_MODE', { collectionId, modeName });
141
- }
142
- async renameMode(collectionId, modeId, newName) {
143
- const result = await this.wsServer.sendCommand('RENAME_MODE', { collectionId, modeId, newName });
144
- // oldName may be embedded in collection data if ui.html handleResult doesn't pass it through
145
- if (!result.oldName && result.collection?.oldName)
146
- result.oldName = result.collection.oldName;
147
- return result;
148
- }
149
- // ============================================================================
150
- // Collection operations
151
- // ============================================================================
152
- async createVariableCollection(name, options) {
153
- const params = { name };
154
- if (options) {
155
- if (options.initialModeName)
156
- params.initialModeName = options.initialModeName;
157
- if (options.additionalModes)
158
- params.additionalModes = options.additionalModes;
159
- }
160
- return this.wsServer.sendCommand('CREATE_VARIABLE_COLLECTION', params);
161
- }
162
- async deleteVariableCollection(collectionId) {
163
- return this.wsServer.sendCommand('DELETE_VARIABLE_COLLECTION', { collectionId });
164
- }
165
- // ============================================================================
166
- // Component operations
167
- // ============================================================================
168
- async getComponentFromPluginUI(nodeId) {
169
- return this.wsServer.sendCommand('GET_COMPONENT', { nodeId }, 10000);
170
- }
171
- async getLocalComponents() {
172
- return this.wsServer.sendCommand('GET_LOCAL_COMPONENTS', {}, 300000);
173
- }
174
- async setNodeDescription(nodeId, description, descriptionMarkdown) {
175
- return this.wsServer.sendCommand('SET_NODE_DESCRIPTION', { nodeId, description, descriptionMarkdown });
176
- }
177
- // ============================================================================
178
- // Annotation operations
179
- // ============================================================================
180
- async getAnnotations(nodeId, includeChildren, depth) {
181
- return this.wsServer.sendCommand('GET_ANNOTATIONS', { nodeId, includeChildren, depth }, 10000);
182
- }
183
- async setAnnotations(nodeId, annotations, mode) {
184
- return this.wsServer.sendCommand('SET_ANNOTATIONS', { nodeId, annotations, mode: mode || 'replace' });
185
- }
186
- async getAnnotationCategories() {
187
- return this.wsServer.sendCommand('GET_ANNOTATION_CATEGORIES', {}, 5000);
188
- }
189
- async deepGetComponent(nodeId, depth) {
190
- return this.wsServer.sendCommand('DEEP_GET_COMPONENT', { nodeId, depth: depth || 10 }, 30000);
191
- }
192
- async analyzeComponentSet(nodeId) {
193
- return this.wsServer.sendCommand('ANALYZE_COMPONENT_SET', { nodeId }, 30000);
194
- }
195
- async addComponentProperty(nodeId, propertyName, type, defaultValue, options) {
196
- const params = { nodeId, propertyName, propertyType: type, defaultValue };
197
- if (options?.preferredValues)
198
- params.preferredValues = options.preferredValues;
199
- if (options?.description)
200
- params.description = options.description;
201
- return this.wsServer.sendCommand('ADD_COMPONENT_PROPERTY', params);
202
- }
203
- async editComponentProperty(nodeId, propertyName, newValue) {
204
- return this.wsServer.sendCommand('EDIT_COMPONENT_PROPERTY', { nodeId, propertyName, newValue });
205
- }
206
- async deleteComponentProperty(nodeId, propertyName) {
207
- return this.wsServer.sendCommand('DELETE_COMPONENT_PROPERTY', { nodeId, propertyName });
208
- }
209
- async instantiateComponent(componentKey, options) {
210
- const params = { componentKey };
211
- if (options) {
212
- if (options.nodeId)
213
- params.nodeId = options.nodeId;
214
- if (options.position)
215
- params.position = options.position;
216
- if (options.size)
217
- params.size = options.size;
218
- if (options.overrides)
219
- params.overrides = options.overrides;
220
- if (options.variant)
221
- params.variant = options.variant;
222
- if (options.parentId)
223
- params.parentId = options.parentId;
224
- }
225
- return this.wsServer.sendCommand('INSTANTIATE_COMPONENT', params);
226
- }
227
- async createComponentSet(params) {
228
- // Cloning + combining large variant matrices is slow on heavy components
229
- // and the plugin-side pass is uncancellable — a fixed 30s ceiling made a
230
- // 48-variant set REPORT failure while the plugin kept going and created
231
- // the set anyway (retry → duplicates). Scale the timeout with variant
232
- // count instead (precedent: the token-import create phase).
233
- return this.wsServer.sendCommand('CREATE_COMPONENT_SET', params, componentSetTimeoutMs(params));
234
- }
235
- // ============================================================================
236
- // Slot operations
237
- // ============================================================================
238
- async createSlot(nodeId, options) {
239
- return this.wsServer.sendCommand('CREATE_SLOT', { nodeId, ...options });
240
- }
241
- async getSlots(nodeId) {
242
- return this.wsServer.sendCommand('GET_SLOTS', { nodeId });
243
- }
244
- async appendToSlot(params) {
245
- return this.wsServer.sendCommand('APPEND_TO_SLOT', params);
246
- }
247
- async resetSlot(params) {
248
- return this.wsServer.sendCommand('RESET_SLOT', params);
249
- }
250
- // ============================================================================
251
- // Node manipulation
252
- // ============================================================================
253
- async resizeNode(nodeId, width, height, withConstraints = true) {
254
- return this.wsServer.sendCommand('RESIZE_NODE', { nodeId, width, height, withConstraints });
255
- }
256
- async moveNode(nodeId, x, y) {
257
- return this.wsServer.sendCommand('MOVE_NODE', { nodeId, x, y });
258
- }
259
- async setNodeFills(nodeId, fills) {
260
- return this.wsServer.sendCommand('SET_NODE_FILLS', { nodeId, fills });
261
- }
262
- async setNodeStrokes(nodeId, strokes, strokeWeight) {
263
- const params = { nodeId, strokes };
264
- if (strokeWeight !== undefined)
265
- params.strokeWeight = strokeWeight;
266
- return this.wsServer.sendCommand('SET_NODE_STROKES', params);
267
- }
268
- async setNodeOpacity(nodeId, opacity) {
269
- return this.wsServer.sendCommand('SET_NODE_OPACITY', { nodeId, opacity });
270
- }
271
- async setNodeCornerRadius(nodeId, radius) {
272
- return this.wsServer.sendCommand('SET_NODE_CORNER_RADIUS', { nodeId, radius });
273
- }
274
- async cloneNode(nodeId) {
275
- return this.wsServer.sendCommand('CLONE_NODE', { nodeId });
276
- }
277
- async deleteNode(nodeId) {
278
- return this.wsServer.sendCommand('DELETE_NODE', { nodeId });
279
- }
280
- async renameNode(nodeId, newName) {
281
- return this.wsServer.sendCommand('RENAME_NODE', { nodeId, newName });
282
- }
283
- async setTextContent(nodeId, characters, options) {
284
- const params = { nodeId, text: characters };
285
- if (options) {
286
- if (options.fontSize)
287
- params.fontSize = options.fontSize;
288
- if (options.fontWeight)
289
- params.fontWeight = options.fontWeight;
290
- if (options.fontFamily)
291
- params.fontFamily = options.fontFamily;
292
- if (options.fontStyle)
293
- params.fontStyle = options.fontStyle;
294
- }
295
- return this.wsServer.sendCommand('SET_TEXT_CONTENT', params);
296
- }
297
- async createChildNode(parentId, nodeType, properties) {
298
- return this.wsServer.sendCommand('CREATE_CHILD_NODE', { parentId, nodeType, properties: properties || {} });
299
- }
300
- // ============================================================================
301
- // Screenshot & instance properties
302
- // ============================================================================
303
- async captureScreenshot(nodeId, options) {
304
- const params = { nodeId };
305
- if (options?.format)
306
- params.format = options.format;
307
- if (options?.scale)
308
- params.scale = options.scale;
309
- return this.wsServer.sendCommand('CAPTURE_SCREENSHOT', params, 30000);
310
- }
311
- async setInstanceProperties(nodeId, properties) {
312
- return this.wsServer.sendCommand('SET_INSTANCE_PROPERTIES', { nodeId, properties });
313
- }
314
- // ============================================================================
315
- // Image fill
316
- // ============================================================================
317
- async setImageFill(nodeIds, imageData, scaleMode = 'FILL') {
318
- return this.wsServer.sendCommand('SET_IMAGE_FILL', { nodeIds, imageData, scaleMode }, 60000);
319
- }
320
- // ============================================================================
321
- // Design lint
322
- // ============================================================================
323
- async lintDesign(nodeId, rules, maxDepth, maxFindings) {
324
- const params = {};
325
- if (nodeId)
326
- params.nodeId = nodeId;
327
- if (rules)
328
- params.rules = rules;
329
- if (maxDepth !== undefined)
330
- params.maxDepth = maxDepth;
331
- if (maxFindings !== undefined)
332
- params.maxFindings = maxFindings;
333
- return this.wsServer.sendCommand('LINT_DESIGN', params, 120000);
334
- }
335
- // ============================================================================
336
- // Component accessibility audit
337
- // ============================================================================
338
- async auditComponentAccessibility(nodeId, targetSize) {
339
- const params = {};
340
- if (nodeId)
341
- params.nodeId = nodeId;
342
- if (targetSize !== undefined)
343
- params.targetSize = targetSize;
344
- return this.wsServer.sendCommand('AUDIT_COMPONENT_ACCESSIBILITY', params, 120000);
345
- }
346
- // ============================================================================
347
- // FigJam operations
348
- // ============================================================================
349
- async createSticky(params) {
350
- return this.wsServer.sendCommand('CREATE_STICKY', params);
351
- }
352
- async createStickies(params) {
353
- return this.wsServer.sendCommand('CREATE_STICKIES', params, 30000);
354
- }
355
- async createConnector(params) {
356
- return this.wsServer.sendCommand('CREATE_CONNECTOR', params);
357
- }
358
- async createShapeWithText(params) {
359
- return this.wsServer.sendCommand('CREATE_SHAPE_WITH_TEXT', params);
360
- }
361
- async createSection(params) {
362
- return this.wsServer.sendCommand('CREATE_SECTION', params);
363
- }
364
- async createTable(params) {
365
- return this.wsServer.sendCommand('CREATE_TABLE', params, 30000);
366
- }
367
- async createCodeBlock(params) {
368
- return this.wsServer.sendCommand('CREATE_CODE_BLOCK', params);
369
- }
370
- async getBoardContents(params) {
371
- return this.wsServer.sendCommand('GET_BOARD_CONTENTS', params, 30000);
372
- }
373
- async getConnections() {
374
- return this.wsServer.sendCommand('GET_CONNECTIONS', {}, 15000);
375
- }
376
- // ============================================================================
377
- // Slides operations
378
- // ============================================================================
379
- async listSlides() {
380
- return this.wsServer.sendCommand('LIST_SLIDES', {}, 10000);
381
- }
382
- async getSlideContent(params) {
383
- return this.wsServer.sendCommand('GET_SLIDE_CONTENT', params, 10000);
384
- }
385
- async createSlide(params) {
386
- return this.wsServer.sendCommand('CREATE_SLIDE', params, 10000);
387
- }
388
- async deleteSlide(params) {
389
- return this.wsServer.sendCommand('DELETE_SLIDE', params, 5000);
390
- }
391
- async duplicateSlide(params) {
392
- return this.wsServer.sendCommand('DUPLICATE_SLIDE', params, 5000);
393
- }
394
- async getSlideGrid() {
395
- return this.wsServer.sendCommand('GET_SLIDE_GRID', {}, 10000);
396
- }
397
- async reorderSlides(params) {
398
- return this.wsServer.sendCommand('REORDER_SLIDES', params, 15000);
399
- }
400
- async setSlideTransition(params) {
401
- return this.wsServer.sendCommand('SET_SLIDE_TRANSITION', params, 5000);
402
- }
403
- async getSlideTransition(params) {
404
- return this.wsServer.sendCommand('GET_SLIDE_TRANSITION', params, 5000);
405
- }
406
- async setSlidesViewMode(params) {
407
- return this.wsServer.sendCommand('SET_SLIDES_VIEW_MODE', params, 5000);
408
- }
409
- async getFocusedSlide() {
410
- return this.wsServer.sendCommand('GET_FOCUSED_SLIDE', {}, 5000);
411
- }
412
- async focusSlide(params) {
413
- return this.wsServer.sendCommand('FOCUS_SLIDE', params, 5000);
414
- }
415
- async skipSlide(params) {
416
- return this.wsServer.sendCommand('SKIP_SLIDE', params, 5000);
417
- }
418
- async addTextToSlide(params) {
419
- return this.wsServer.sendCommand('ADD_TEXT_TO_SLIDE', params, 10000);
420
- }
421
- async addShapeToSlide(params) {
422
- return this.wsServer.sendCommand('ADD_SHAPE_TO_SLIDE', params, 5000);
423
- }
424
- async setSlideBackground(params) {
425
- return this.wsServer.sendCommand('SET_SLIDE_BACKGROUND', params, 5000);
426
- }
427
- async getTextStyles() {
428
- return this.wsServer.sendCommand('GET_TEXT_STYLES', {}, 5000);
429
- }
430
- // ============================================================================
431
- // Cache management (no-op for WebSocket — no frame cache)
432
- // ============================================================================
433
- clearFrameCache() {
434
- // No frame cache in WebSocket mode
435
- }
436
- }