flowspec-mcp 5.4.0 → 5.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 (58) hide show
  1. package/dist/analysis/analysisUtils.d.ts +36 -0
  2. package/dist/analysis/analysisUtils.js +284 -0
  3. package/dist/analysis/analysisUtils.js.map +1 -0
  4. package/dist/db.js +19 -3
  5. package/dist/db.js.map +1 -1
  6. package/dist/export/yamlExporter.d.ts +6 -0
  7. package/dist/export/yamlExporter.js +155 -0
  8. package/dist/export/yamlExporter.js.map +1 -0
  9. package/dist/import/yamlImporter.d.ts +22 -0
  10. package/dist/import/yamlImporter.js +227 -0
  11. package/dist/import/yamlImporter.js.map +1 -0
  12. package/dist/index.js +0 -0
  13. package/dist/layout/semanticLayout.d.ts +24 -0
  14. package/dist/layout/semanticLayout.js +233 -0
  15. package/dist/layout/semanticLayout.js.map +1 -0
  16. package/dist/resources/selection.d.ts +5 -0
  17. package/dist/resources/selection.js +88 -0
  18. package/dist/resources/selection.js.map +1 -0
  19. package/dist/server.js +29 -24
  20. package/dist/server.js.map +1 -1
  21. package/dist/tools/captureScreen.d.ts +48 -0
  22. package/dist/tools/captureScreen.js +135 -0
  23. package/dist/tools/captureScreen.js.map +1 -0
  24. package/dist/tools/createNode.d.ts +2 -2
  25. package/dist/tools/createSubview.d.ts +50 -0
  26. package/dist/tools/createSubview.js +29 -0
  27. package/dist/tools/createSubview.js.map +1 -0
  28. package/dist/tools/deleteSubview.d.ts +24 -0
  29. package/dist/tools/deleteSubview.js +19 -0
  30. package/dist/tools/deleteSubview.js.map +1 -0
  31. package/dist/tools/generateSpec.d.ts +26 -0
  32. package/dist/tools/generateSpec.js +336 -0
  33. package/dist/tools/generateSpec.js.map +1 -0
  34. package/dist/tools/getYaml.d.ts +21 -0
  35. package/dist/tools/getYaml.js +23 -0
  36. package/dist/tools/getYaml.js.map +1 -0
  37. package/dist/tools/healthCheck.d.ts +8 -0
  38. package/dist/tools/healthCheck.js +16 -0
  39. package/dist/tools/healthCheck.js.map +1 -0
  40. package/dist/tools/importYaml.d.ts +33 -0
  41. package/dist/tools/importYaml.js +97 -0
  42. package/dist/tools/importYaml.js.map +1 -0
  43. package/dist/tools/ingestCodebase.d.ts +27 -0
  44. package/dist/tools/ingestCodebase.js +516 -0
  45. package/dist/tools/ingestCodebase.js.map +1 -0
  46. package/dist/tools/listSubviews.d.ts +21 -0
  47. package/dist/tools/listSubviews.js +34 -0
  48. package/dist/tools/listSubviews.js.map +1 -0
  49. package/dist/tools/smartLayout.d.ts +30 -0
  50. package/dist/tools/smartLayout.js +74 -0
  51. package/dist/tools/smartLayout.js.map +1 -0
  52. package/dist/tools/updateSubview.d.ts +53 -0
  53. package/dist/tools/updateSubview.js +33 -0
  54. package/dist/tools/updateSubview.js.map +1 -0
  55. package/dist/utils/selectionHelper.d.ts +61 -0
  56. package/dist/utils/selectionHelper.js +111 -0
  57. package/dist/utils/selectionHelper.js.map +1 -0
  58. package/package.json +1 -1
@@ -0,0 +1,233 @@
1
+ import nlp from 'compromise';
2
+ // ─── Layout Regions (9-grid system for infinite canvas) ─────────
3
+ const LAYOUT_REGIONS = {
4
+ 'top-left': { x: 0.05, y: 0.05 },
5
+ 'top-center': { x: 0.4, y: 0.05 },
6
+ 'top-right': { x: 0.7, y: 0.05 },
7
+ 'center-left': { x: 0.05, y: 0.4 },
8
+ 'center': { x: 0.4, y: 0.4 },
9
+ 'center-right': { x: 0.7, y: 0.4 },
10
+ 'bottom-left': { x: 0.05, y: 0.7 },
11
+ 'bottom-center': { x: 0.4, y: 0.7 },
12
+ 'bottom-right': { x: 0.7, y: 0.7 }
13
+ };
14
+ // Aliases for natural language
15
+ const REGION_ALIASES = {
16
+ 'top': 'top-center',
17
+ 'bottom': 'bottom-center',
18
+ 'left': 'center-left',
19
+ 'right': 'center-right',
20
+ 'upper-left': 'top-left',
21
+ 'upper-right': 'top-right',
22
+ 'lower-left': 'bottom-left',
23
+ 'lower-right': 'bottom-right',
24
+ 'middle': 'center'
25
+ };
26
+ // ─── Natural Language Parsing ────────────────────────────────────
27
+ export function parseNaturalLanguageLayout(command, nodes, canvasBounds) {
28
+ const doc = nlp(command.toLowerCase());
29
+ // Extract action verb (move, arrange, cluster, position)
30
+ const verbs = doc.verbs().out('array');
31
+ const action = verbs[0] ?? 'move';
32
+ // Extract target nodes (by label matching)
33
+ const nodeMatches = extractNodeReferences(command, nodes);
34
+ if (nodeMatches.length === 0) {
35
+ return {
36
+ error: `No matching nodes found. Command: "${command}". Try specifying node labels explicitly (e.g., "move user auth nodes to top-right").`
37
+ };
38
+ }
39
+ // Extract target region
40
+ const region = extractTargetRegion(command);
41
+ if (!region) {
42
+ return {
43
+ error: `No target region found. Supported regions: ${Object.keys(LAYOUT_REGIONS).join(', ')}. Command: "${command}".`
44
+ };
45
+ }
46
+ // Extract arrangement style (vertical, horizontal, grid, cluster)
47
+ const arrangement = extractArrangement(command);
48
+ const direction = extractDirection(command);
49
+ // Convert region to absolute coordinates
50
+ const relativePos = LAYOUT_REGIONS[region];
51
+ const targetBounds = {
52
+ x: relativePos.x * canvasBounds.width,
53
+ y: relativePos.y * canvasBounds.height,
54
+ width: canvasBounds.width * 0.25, // 25% of canvas for layout region
55
+ height: canvasBounds.height * 0.25
56
+ };
57
+ return {
58
+ nodeIds: nodeMatches,
59
+ targetBounds,
60
+ arrangement,
61
+ direction
62
+ };
63
+ }
64
+ function extractNodeReferences(command, nodes) {
65
+ const matches = [];
66
+ // Extract potential node label keywords (nouns, adjectives)
67
+ const doc = nlp(command);
68
+ const keywords = [
69
+ ...doc.nouns().out('array'),
70
+ ...doc.adjectives().out('array')
71
+ ];
72
+ // Match keywords against node labels (fuzzy matching)
73
+ for (const node of nodes) {
74
+ const label = (node.data?.label ?? '').toLowerCase();
75
+ if (!label)
76
+ continue;
77
+ // Check if any keyword appears in label
78
+ for (const keyword of keywords) {
79
+ if (label.includes(keyword) || keyword.includes(label)) {
80
+ matches.push(node.id);
81
+ break;
82
+ }
83
+ }
84
+ }
85
+ return [...new Set(matches)]; // Deduplicate
86
+ }
87
+ function extractTargetRegion(command) {
88
+ const lowerCommand = command.toLowerCase();
89
+ // Check for explicit region names
90
+ for (const [alias, canonical] of Object.entries(REGION_ALIASES)) {
91
+ if (lowerCommand.includes(alias)) {
92
+ return canonical;
93
+ }
94
+ }
95
+ for (const region of Object.keys(LAYOUT_REGIONS)) {
96
+ if (lowerCommand.includes(region)) {
97
+ return region;
98
+ }
99
+ }
100
+ // Pattern matching: "to the <direction>"
101
+ if (lowerCommand.includes('to the top'))
102
+ return 'top-center';
103
+ if (lowerCommand.includes('to the bottom'))
104
+ return 'bottom-center';
105
+ if (lowerCommand.includes('to the left'))
106
+ return 'center-left';
107
+ if (lowerCommand.includes('to the right'))
108
+ return 'center-right';
109
+ // Pattern matching: "in the <region>"
110
+ if (lowerCommand.includes('in the top left'))
111
+ return 'top-left';
112
+ if (lowerCommand.includes('in the top right'))
113
+ return 'top-right';
114
+ if (lowerCommand.includes('in the bottom left'))
115
+ return 'bottom-left';
116
+ if (lowerCommand.includes('in the bottom right'))
117
+ return 'bottom-right';
118
+ if (lowerCommand.includes('in the center'))
119
+ return 'center';
120
+ return null;
121
+ }
122
+ function extractArrangement(command) {
123
+ const lowerCommand = command.toLowerCase();
124
+ if (lowerCommand.includes('stack') || lowerCommand.includes('column') || lowerCommand.includes('row')) {
125
+ return 'stack';
126
+ }
127
+ if (lowerCommand.includes('grid')) {
128
+ return 'grid';
129
+ }
130
+ if (lowerCommand.includes('flow')) {
131
+ return 'flow';
132
+ }
133
+ if (lowerCommand.includes('cluster') || lowerCommand.includes('group')) {
134
+ return 'cluster';
135
+ }
136
+ // Default: stack for small groups, grid for larger
137
+ return 'stack';
138
+ }
139
+ function extractDirection(command) {
140
+ const lowerCommand = command.toLowerCase();
141
+ if (lowerCommand.includes('vertical') || lowerCommand.includes('vertically') || lowerCommand.includes('column')) {
142
+ return 'vertical';
143
+ }
144
+ if (lowerCommand.includes('horizontal') || lowerCommand.includes('horizontally') || lowerCommand.includes('row')) {
145
+ return 'horizontal';
146
+ }
147
+ return undefined; // Let arrangement logic decide
148
+ }
149
+ // ─── Apply Semantic Layout ───────────────────────────────────────
150
+ export function applySemanticLayout(nodes, edges, command) {
151
+ const positions = new Map();
152
+ const targetNodes = nodes.filter((n) => command.nodeIds.includes(n.id));
153
+ if (targetNodes.length === 0)
154
+ return positions;
155
+ const { targetBounds, arrangement, direction } = command;
156
+ switch (arrangement) {
157
+ case 'stack': {
158
+ // Stack vertically or horizontally
159
+ const isVertical = direction === 'vertical' || direction === undefined;
160
+ const spacing = 60;
161
+ targetNodes.forEach((node, index) => {
162
+ if (isVertical) {
163
+ positions.set(node.id, {
164
+ x: targetBounds.x,
165
+ y: targetBounds.y + index * spacing
166
+ });
167
+ }
168
+ else {
169
+ positions.set(node.id, {
170
+ x: targetBounds.x + index * spacing,
171
+ y: targetBounds.y
172
+ });
173
+ }
174
+ });
175
+ break;
176
+ }
177
+ case 'grid': {
178
+ // Arrange in a grid (3 columns max)
179
+ const cols = Math.min(3, Math.ceil(Math.sqrt(targetNodes.length)));
180
+ const spacing = 80;
181
+ targetNodes.forEach((node, index) => {
182
+ const col = index % cols;
183
+ const row = Math.floor(index / cols);
184
+ positions.set(node.id, {
185
+ x: targetBounds.x + col * spacing,
186
+ y: targetBounds.y + row * spacing
187
+ });
188
+ });
189
+ break;
190
+ }
191
+ case 'flow': {
192
+ // Flow layout (left-to-right, wrapping)
193
+ const maxWidth = targetBounds.width;
194
+ const spacing = 70;
195
+ let currentX = targetBounds.x;
196
+ let currentY = targetBounds.y;
197
+ for (const node of targetNodes) {
198
+ positions.set(node.id, { x: currentX, y: currentY });
199
+ currentX += spacing;
200
+ if (currentX - targetBounds.x > maxWidth) {
201
+ currentX = targetBounds.x;
202
+ currentY += spacing;
203
+ }
204
+ }
205
+ break;
206
+ }
207
+ case 'cluster': {
208
+ // Cluster in a compact circle/ellipse
209
+ const centerX = targetBounds.x + targetBounds.width / 2;
210
+ const centerY = targetBounds.y + targetBounds.height / 2;
211
+ const radius = Math.min(targetBounds.width, targetBounds.height) / 3;
212
+ targetNodes.forEach((node, index) => {
213
+ const angle = (index / targetNodes.length) * 2 * Math.PI;
214
+ positions.set(node.id, {
215
+ x: centerX + radius * Math.cos(angle),
216
+ y: centerY + radius * Math.sin(angle)
217
+ });
218
+ });
219
+ break;
220
+ }
221
+ }
222
+ return positions;
223
+ }
224
+ // ─── Supported Commands (for tool description) ───────────────────
225
+ export const SUPPORTED_COMMANDS = [
226
+ 'move <nodes> to <region>',
227
+ 'arrange <nodes> vertically/horizontally in <region>',
228
+ 'cluster <nodes> in <region>',
229
+ 'position <nodes> at <region>',
230
+ 'stack <nodes> in <region>'
231
+ ];
232
+ export const SUPPORTED_REGIONS = Object.keys(LAYOUT_REGIONS);
233
+ //# sourceMappingURL=semanticLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semanticLayout.js","sourceRoot":"","sources":["../../src/layout/semanticLayout.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,YAAY,CAAC;AAY7B,mEAAmE;AAEnE,MAAM,cAAc,GAA6C;IAChE,UAAU,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE;IAChC,YAAY,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE;IACjC,WAAW,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE;IAChC,aAAa,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE;IAClC,QAAQ,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;IAC5B,cAAc,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;IAClC,aAAa,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE;I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/server/mcp.js';
2
+ /**
3
+ * MCP Resource handler for flowspec://selection/current
4
+ */
5
+ export declare const handleReadSelection: ReadResourceCallback;
@@ -0,0 +1,88 @@
1
+ import { MODE, LOCAL_API_BASE, getLocalAuthToken } from '../config.js';
2
+ /**
3
+ * Fetch current selection state from desktop server
4
+ */
5
+ async function fetchLocalSelection() {
6
+ if (MODE !== 'local') {
7
+ throw new Error('Selection resource only available in local mode');
8
+ }
9
+ const token = getLocalAuthToken();
10
+ const headers = {
11
+ 'Content-Type': 'application/json',
12
+ };
13
+ if (token) {
14
+ headers['Authorization'] = `Bearer ${token}`;
15
+ }
16
+ const res = await fetch(`${LOCAL_API_BASE}/api/selection/current`, {
17
+ headers,
18
+ signal: AbortSignal.timeout(2000)
19
+ });
20
+ if (!res.ok) {
21
+ throw new Error(`Failed to fetch selection: ${res.status} ${res.statusText}`);
22
+ }
23
+ return res.json();
24
+ }
25
+ /**
26
+ * MCP Resource handler for flowspec://selection/current
27
+ */
28
+ export const handleReadSelection = async (uri, extra) => {
29
+ try {
30
+ const selection = await fetchLocalSelection();
31
+ // Format for better readability
32
+ let text = '';
33
+ if (selection.type === 'none' || (!selection.selectedNodes?.length && !selection.selectedEdges?.length)) {
34
+ text = 'No nodes or edges currently selected in FlowSpec editor.';
35
+ if (selection.stale) {
36
+ text += '\n\n_Note: Selection state is stale (>60s old). Make sure the FlowSpec desktop app is open._';
37
+ }
38
+ }
39
+ else {
40
+ text = `## FlowSpec Selection State\n\n`;
41
+ text += `**Project:** ${selection.projectName || 'Unknown'} (${selection.projectId || 'N/A'})\n`;
42
+ text += `**Updated:** ${selection.timestamp}\n\n`;
43
+ if (selection.selectedNodes?.length > 0) {
44
+ text += `### Selected Nodes (${selection.selectedNodes.length})\n\n`;
45
+ for (const node of selection.selectedNodes) {
46
+ text += `- **${node.label}** (${node.type})\n`;
47
+ text += ` - ID: \`${node.id}\`\n`;
48
+ text += ` - Position: (${node.position.x.toFixed(0)}, ${node.position.y.toFixed(0)})\n`;
49
+ text += ` - Data: \`${JSON.stringify(node.data)}\`\n\n`;
50
+ }
51
+ }
52
+ if (selection.selectedEdges?.length > 0) {
53
+ text += `### Selected Edges (${selection.selectedEdges.length})\n\n`;
54
+ for (const edge of selection.selectedEdges) {
55
+ text += `- **${edge.edgeType}**: \`${edge.source}\` → \`${edge.target}\`\n`;
56
+ text += ` - ID: \`${edge.id}\`\n`;
57
+ if (edge.sourceHandle)
58
+ text += ` - Source Handle: ${edge.sourceHandle}\n`;
59
+ if (edge.targetHandle)
60
+ text += ` - Target Handle: ${edge.targetHandle}\n`;
61
+ text += `\n`;
62
+ }
63
+ }
64
+ if (selection.viewport) {
65
+ text += `### Viewport\n\n`;
66
+ text += `- Position: (${selection.viewport.x.toFixed(1)}, ${selection.viewport.y.toFixed(1)})\n`;
67
+ text += `- Zoom: ${(selection.viewport.zoom * 100).toFixed(0)}%\n`;
68
+ }
69
+ }
70
+ return {
71
+ contents: [{
72
+ uri: uri.toString(),
73
+ mimeType: 'text/markdown',
74
+ text
75
+ }]
76
+ };
77
+ }
78
+ catch (err) {
79
+ return {
80
+ contents: [{
81
+ uri: uri.toString(),
82
+ mimeType: 'text/plain',
83
+ text: `Error reading selection state: ${err instanceof Error ? err.message : String(err)}\n\nMake sure the FlowSpec desktop app is running.`
84
+ }]
85
+ };
86
+ }
87
+ };
88
+ //# sourceMappingURL=selection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection.js","sourceRoot":"","sources":["../../src/resources/selection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEvE;;GAEG;AACH,KAAK,UAAU,mBAAmB;IACjC,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,KAAK,GAAG,iBAAiB,EAAE,CAAC;IAClC,MAAM,OAAO,GAA2B;QACv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AI,kBAAkB,CAAC;gBAC3B,IAAI,IAAI,gBAAgB,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;gBACjG,IAAI,IAAI,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;YACpE,CAAC;QACF,CAAC;QAED,OAAO;YACN,QAAQ,EAAE,CAAC;oBACV,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE;oBACnB,QAAQ,EAAE,eAAe;oBACzB,IAAI;iBACJ,CAAC;SACF,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,OAAO;YACN,QAAQ,EAAE,CAAC;oBACV,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE;oBACnB,QAAQ,EAAE,YAAY;oBACtB,IAAI,EAAE,kCAAkC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,oDAAoD;iBAC5I,CAAC;SACF,CAAC;IACH,CAAC;AACF,CAAC,CAAC"}
package/dist/server.js CHANGED
@@ -33,46 +33,51 @@ import { getDecisionTreeSchema, handleGetDecisionTree } from './tools/getDecisio
33
33
  import { deleteDecisionTreeSchema, handleDeleteDecisionTree } from './tools/deleteDecisionTree.js';
34
34
  import { analyseDecisionTreeSchema, handleAnalyseDecisionTree } from './tools/analyseDecisionTree.js';
35
35
  import { MODE } from './config.js';
36
+ // FLOWSPEC_TOOLS=core → 11 essential tools only (~2,900 tokens)
37
+ // FLOWSPEC_TOOLS=all → all 30 tools (~7,980 tokens) [default]
38
+ const TOOLS_MODE = (process.env.FLOWSPEC_TOOLS ?? 'all');
36
39
  export function createServer() {
37
40
  const server = new McpServer({
38
41
  name: 'flowspec',
39
42
  version: '5.0.0',
40
43
  });
41
- // ─── Read tools ──────────────────────────────────────────────────
44
+ // ─── Core tools (always registered) ─────────────────────────────
42
45
  server.tool('flowspec_list_projects', 'List all FlowSpec projects with names and dates', listProjectsSchema.shape, handleListProjects);
43
46
  server.tool('flowspec_get_json', 'Get the full JSON spec for a FlowSpec project (optimised for Claude Code consumption)', getJsonSchema.shape, handleGetJson);
44
47
  server.tool('flowspec_get_project', 'Get project data (nodes, edges, screens) for a FlowSpec project', getProjectSchema.shape, handleGetProject);
45
48
  server.tool('flowspec_search_nodes', 'Search for nodes by label across all projects, optionally filtered by type', searchNodesSchema.shape, handleSearchNodes);
46
49
  server.tool('flowspec_get_screen_context', 'Get screen/region/element structure for a FlowSpec project (lightweight alternative to full JSON)', getScreenContextSchema.shape, handleGetScreenContext);
47
- // ─── Write tools (v2) ────────────────────────────────────────────
48
50
  server.tool('flowspec_create_project', 'Create a new FlowSpec project. Before building from a codebase, scan source files for @flowspec annotations (left by the codebase-indexer skill) to avoid re-discovering already-indexed elements.', createProjectSchema.shape, handleCreateProject);
49
- server.tool('flowspec_update_project', 'Update a project name or replace its entire canvas state', updateProjectSchema.shape, handleUpdateProject);
50
- server.tool('flowspec_delete_project', 'Delete a FlowSpec project', deleteProjectSchema.shape, handleDeleteProject);
51
51
  server.tool('flowspec_create_node', 'Add a node (datapoint, component, transform, or table) to a project. Check source files for @flowspec annotations first — they contain pre-indexed element definitions (e.g. // @flowspec dp-name: type, source, constraints).', createNodeSchema.shape, handleCreateNode);
52
52
  server.tool('flowspec_update_node', 'Update a node\'s data (label, type, constraints) or position', updateNodeSchema.shape, handleUpdateNode);
53
- server.tool('flowspec_delete_node', 'Remove a node and all its connected edges from a project', deleteNodeSchema.shape, handleDeleteNode);
54
53
  server.tool('flowspec_create_edge', 'Connect two nodes with an edge type (flows-to, derives-from, transforms, validates, contains)', createEdgeSchema.shape, handleCreateEdge);
55
- server.tool('flowspec_delete_edge', 'Remove an edge from a project', deleteEdgeSchema.shape, handleDeleteEdge);
56
54
  server.tool('flowspec_analyse_project', 'Run orphan node and duplicate label analysis on a project', analyseProjectSchema.shape, handleAnalyseProject);
57
55
  server.tool('flowspec_validate_project', 'Validate data flow semantics: DataPoint sources, Transform I/O, Component references, type matching, and circular dependencies', validateProjectSchema.shape, handleValidateProject);
58
- // ─── Write tools (v3) ────────────────────────────────────────────
59
- server.tool('flowspec_import_json', 'Import JSON specification to create/merge nodes, edges, and screens. If the codebase has @flowspec annotations, incorporate them into the spec before importing to avoid duplicating pre-indexed elements.', importJsonSchema.shape, handleImportJson);
60
- server.tool('flowspec_auto_layout', 'Apply automatic hierarchical layout (Dagre) to organize nodes', autoLayoutSchema.shape, handleAutoLayout);
61
- server.tool('flowspec_upload_image', 'Upload an image and get its URL with auto-detected dimensions', uploadImageSchema.shape, handleUploadImage);
62
- server.tool('flowspec_create_screen', 'Create a new wireframe screen with optional image', createScreenSchema.shape, handleCreateScreen);
63
- server.tool('flowspec_update_screen', 'Update screen properties (name, image)', updateScreenSchema.shape, handleUpdateScreen);
64
- server.tool('flowspec_delete_screen', 'Delete a wireframe screen and all its regions', deleteScreenSchema.shape, handleDeleteScreen);
65
- server.tool('flowspec_add_region', 'Add a region to a screen with % coordinates and element IDs', addRegionSchema.shape, handleAddRegion);
66
- server.tool('flowspec_update_region', 'Update region position, size, label, or element IDs', updateRegionSchema.shape, handleUpdateRegion);
67
- server.tool('flowspec_remove_region', 'Remove a region from a screen', removeRegionSchema.shape, handleRemoveRegion);
68
- server.tool('flowspec_update_edge', 'Update edge type, label, or handle positions', updateEdgeSchema.shape, handleUpdateEdge);
69
- server.tool('flowspec_clone_project', 'Clone a project for backup or branching', cloneProjectSchema.shape, handleCloneProject);
70
- // ─── Decision tree tools (v4) ───────────────────────────────────
71
- server.tool('flowspec_list_decision_trees', 'List all decision trees for a project', listDecisionTreesSchema.shape, handleListDecisionTrees);
72
- server.tool('flowspec_get_decision_tree', 'Get a decision tree with full node/edge structure', getDecisionTreeSchema.shape, handleGetDecisionTree);
73
- server.tool('flowspec_delete_decision_tree', 'Delete a decision tree from a project', deleteDecisionTreeSchema.shape, handleDeleteDecisionTree);
74
- server.tool('flowspec_analyse_decision_tree', 'Analyse a decision tree: depth, orphans, outcomes, under-branched decisions', analyseDecisionTreeSchema.shape, handleAnalyseDecisionTree);
75
- console.error(`FlowSpec MCP v5.4.0 mode: ${MODE}`);
56
+ if (TOOLS_MODE === 'all') {
57
+ // ─── Extras: v2 destructive/update tools ───────────────────────
58
+ server.tool('flowspec_update_project', 'Update a project name or replace its entire canvas state', updateProjectSchema.shape, handleUpdateProject);
59
+ server.tool('flowspec_delete_project', 'Delete a FlowSpec project', deleteProjectSchema.shape, handleDeleteProject);
60
+ server.tool('flowspec_delete_node', 'Remove a node and all its connected edges from a project', deleteNodeSchema.shape, handleDeleteNode);
61
+ server.tool('flowspec_delete_edge', 'Remove an edge from a project', deleteEdgeSchema.shape, handleDeleteEdge);
62
+ // ─── Extras: v3 bulk/screen/region tools ───────────────────────
63
+ server.tool('flowspec_import_json', 'Import JSON specification to create/merge nodes, edges, and screens. If the codebase has @flowspec annotations, incorporate them into the spec before importing to avoid duplicating pre-indexed elements.', importJsonSchema.shape, handleImportJson);
64
+ server.tool('flowspec_auto_layout', 'Apply automatic hierarchical layout (Dagre) to organize nodes', autoLayoutSchema.shape, handleAutoLayout);
65
+ server.tool('flowspec_upload_image', 'Upload an image and get its URL with auto-detected dimensions', uploadImageSchema.shape, handleUploadImage);
66
+ server.tool('flowspec_create_screen', 'Create a new wireframe screen with optional image', createScreenSchema.shape, handleCreateScreen);
67
+ server.tool('flowspec_update_screen', 'Update screen properties (name, image)', updateScreenSchema.shape, handleUpdateScreen);
68
+ server.tool('flowspec_delete_screen', 'Delete a wireframe screen and all its regions', deleteScreenSchema.shape, handleDeleteScreen);
69
+ server.tool('flowspec_add_region', 'Add a region to a screen with % coordinates and element IDs', addRegionSchema.shape, handleAddRegion);
70
+ server.tool('flowspec_update_region', 'Update region position, size, label, or element IDs', updateRegionSchema.shape, handleUpdateRegion);
71
+ server.tool('flowspec_remove_region', 'Remove a region from a screen', removeRegionSchema.shape, handleRemoveRegion);
72
+ server.tool('flowspec_update_edge', 'Update edge type, label, or handle positions', updateEdgeSchema.shape, handleUpdateEdge);
73
+ server.tool('flowspec_clone_project', 'Clone a project for backup or branching', cloneProjectSchema.shape, handleCloneProject);
74
+ // ─── Extras: v4 decision tree tools ────────────────────────────
75
+ server.tool('flowspec_list_decision_trees', 'List all decision trees for a project', listDecisionTreesSchema.shape, handleListDecisionTrees);
76
+ server.tool('flowspec_get_decision_tree', 'Get a decision tree with full node/edge structure', getDecisionTreeSchema.shape, handleGetDecisionTree);
77
+ server.tool('flowspec_delete_decision_tree', 'Delete a decision tree from a project', deleteDecisionTreeSchema.shape, handleDeleteDecisionTree);
78
+ server.tool('flowspec_analyse_decision_tree', 'Analyse a decision tree: depth, orphans, outcomes, under-branched decisions', analyseDecisionTreeSchema.shape, handleAnalyseDecisionTree);
79
+ }
80
+ console.error(`FlowSpec MCP v5.4.0 — mode: ${MODE}, tools: ${TOOLS_MODE} (${TOOLS_MODE === 'core' ? 11 : 30})`);
76
81
  return server;
77
82
  }
78
83
  //# sourceMappingURL=server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;A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M,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAEhH,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { z } from 'zod';
2
+ export declare const captureScreenSchema: z.ZodObject<{
3
+ url: z.ZodString;
4
+ selector: z.ZodOptional<z.ZodString>;
5
+ viewport: z.ZodOptional<z.ZodObject<{
6
+ width: z.ZodNumber;
7
+ height: z.ZodNumber;
8
+ }, "strip", z.ZodTypeAny, {
9
+ width: number;
10
+ height: number;
11
+ }, {
12
+ width: number;
13
+ height: number;
14
+ }>>;
15
+ waitFor: z.ZodOptional<z.ZodString>;
16
+ fullPage: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
17
+ }, "strip", z.ZodTypeAny, {
18
+ url: string;
19
+ fullPage: boolean;
20
+ selector?: string | undefined;
21
+ viewport?: {
22
+ width: number;
23
+ height: number;
24
+ } | undefined;
25
+ waitFor?: string | undefined;
26
+ }, {
27
+ url: string;
28
+ selector?: string | undefined;
29
+ viewport?: {
30
+ width: number;
31
+ height: number;
32
+ } | undefined;
33
+ waitFor?: string | undefined;
34
+ fullPage?: boolean | undefined;
35
+ }>;
36
+ export declare function handleCaptureScreen(args: z.infer<typeof captureScreenSchema>): Promise<{
37
+ content: {
38
+ type: "text";
39
+ text: string;
40
+ }[];
41
+ isError: boolean;
42
+ } | {
43
+ content: {
44
+ type: "text";
45
+ text: string;
46
+ }[];
47
+ isError?: undefined;
48
+ }>;