flowspec-mcp 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +87 -0
  3. package/dist/config.d.ts +5 -0
  4. package/dist/config.js +16 -0
  5. package/dist/config.js.map +1 -0
  6. package/dist/db.d.ts +47 -0
  7. package/dist/db.js +283 -0
  8. package/dist/db.js.map +1 -0
  9. package/dist/export/yamlExporter.d.ts +6 -0
  10. package/dist/export/yamlExporter.js +155 -0
  11. package/dist/export/yamlExporter.js.map +1 -0
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.js +7 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/server.d.ts +2 -0
  16. package/dist/server.js +42 -0
  17. package/dist/server.js.map +1 -0
  18. package/dist/tools/analyseProject.d.ts +21 -0
  19. package/dist/tools/analyseProject.js +105 -0
  20. package/dist/tools/analyseProject.js.map +1 -0
  21. package/dist/tools/createEdge.d.ts +33 -0
  22. package/dist/tools/createEdge.js +31 -0
  23. package/dist/tools/createEdge.js.map +1 -0
  24. package/dist/tools/createNode.d.ts +45 -0
  25. package/dist/tools/createNode.js +31 -0
  26. package/dist/tools/createNode.js.map +1 -0
  27. package/dist/tools/createProject.d.ts +17 -0
  28. package/dist/tools/createProject.js +16 -0
  29. package/dist/tools/createProject.js.map +1 -0
  30. package/dist/tools/deleteEdge.d.ts +24 -0
  31. package/dist/tools/deleteEdge.js +19 -0
  32. package/dist/tools/deleteEdge.js.map +1 -0
  33. package/dist/tools/deleteNode.d.ts +24 -0
  34. package/dist/tools/deleteNode.js +19 -0
  35. package/dist/tools/deleteNode.js.map +1 -0
  36. package/dist/tools/deleteProject.d.ts +21 -0
  37. package/dist/tools/deleteProject.js +18 -0
  38. package/dist/tools/deleteProject.js.map +1 -0
  39. package/dist/tools/getProject.d.ts +21 -0
  40. package/dist/tools/getProject.js +18 -0
  41. package/dist/tools/getProject.js.map +1 -0
  42. package/dist/tools/getScreenContext.d.ts +24 -0
  43. package/dist/tools/getScreenContext.js +65 -0
  44. package/dist/tools/getScreenContext.js.map +1 -0
  45. package/dist/tools/getYaml.d.ts +21 -0
  46. package/dist/tools/getYaml.js +23 -0
  47. package/dist/tools/getYaml.js.map +1 -0
  48. package/dist/tools/listProjects.d.ts +8 -0
  49. package/dist/tools/listProjects.js +14 -0
  50. package/dist/tools/listProjects.js.map +1 -0
  51. package/dist/tools/searchNodes.d.ts +17 -0
  52. package/dist/tools/searchNodes.js +22 -0
  53. package/dist/tools/searchNodes.js.map +1 -0
  54. package/dist/tools/updateNode.d.ts +45 -0
  55. package/dist/tools/updateNode.js +29 -0
  56. package/dist/tools/updateNode.js.map +1 -0
  57. package/dist/tools/updateProject.d.ts +27 -0
  58. package/dist/tools/updateProject.js +25 -0
  59. package/dist/tools/updateProject.js.map +1 -0
  60. package/dist/types.d.ts +92 -0
  61. package/dist/types.js +3 -0
  62. package/dist/types.js.map +1 -0
  63. package/package.json +44 -0
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
+ import { createServer } from './server.js';
4
+ const server = createServer();
5
+ const transport = new StdioServerTransport();
6
+ await server.connect(transport);
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;AAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAE7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function createServer(): McpServer;
package/dist/server.js ADDED
@@ -0,0 +1,42 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { listProjectsSchema, handleListProjects } from './tools/listProjects.js';
3
+ import { getYamlSchema, handleGetYaml } from './tools/getYaml.js';
4
+ import { getProjectSchema, handleGetProject } from './tools/getProject.js';
5
+ import { searchNodesSchema, handleSearchNodes } from './tools/searchNodes.js';
6
+ import { getScreenContextSchema, handleGetScreenContext } from './tools/getScreenContext.js';
7
+ // v2 write tools
8
+ import { createProjectSchema, handleCreateProject } from './tools/createProject.js';
9
+ import { updateProjectSchema, handleUpdateProject } from './tools/updateProject.js';
10
+ import { deleteProjectSchema, handleDeleteProject } from './tools/deleteProject.js';
11
+ import { createNodeSchema, handleCreateNode } from './tools/createNode.js';
12
+ import { updateNodeSchema, handleUpdateNode } from './tools/updateNode.js';
13
+ import { deleteNodeSchema, handleDeleteNode } from './tools/deleteNode.js';
14
+ import { createEdgeSchema, handleCreateEdge } from './tools/createEdge.js';
15
+ import { deleteEdgeSchema, handleDeleteEdge } from './tools/deleteEdge.js';
16
+ import { analyseProjectSchema, handleAnalyseProject } from './tools/analyseProject.js';
17
+ import { MODE } from './config.js';
18
+ export function createServer() {
19
+ const server = new McpServer({
20
+ name: 'flowspec',
21
+ version: '2.0.0',
22
+ });
23
+ // ─── Read tools ──────────────────────────────────────────────────
24
+ server.tool('flowspec_list_projects', 'List all FlowSpec projects with names and dates', listProjectsSchema.shape, handleListProjects);
25
+ server.tool('flowspec_get_yaml', 'Get the full YAML spec for a FlowSpec project (optimised for Claude Code consumption)', getYamlSchema.shape, handleGetYaml);
26
+ server.tool('flowspec_get_project', 'Get raw canvas_state JSON for a FlowSpec project', getProjectSchema.shape, handleGetProject);
27
+ server.tool('flowspec_search_nodes', 'Search for nodes by label across all projects, optionally filtered by type', searchNodesSchema.shape, handleSearchNodes);
28
+ server.tool('flowspec_get_screen_context', 'Get screen/region/element structure for a FlowSpec project (lightweight alternative to full YAML)', getScreenContextSchema.shape, handleGetScreenContext);
29
+ // ─── Write tools (v2) ────────────────────────────────────────────
30
+ server.tool('flowspec_create_project', 'Create a new FlowSpec project with a name and optional initial canvas state', createProjectSchema.shape, handleCreateProject);
31
+ server.tool('flowspec_update_project', 'Update a project name or replace its entire canvas state', updateProjectSchema.shape, handleUpdateProject);
32
+ server.tool('flowspec_delete_project', 'Delete a FlowSpec project', deleteProjectSchema.shape, handleDeleteProject);
33
+ server.tool('flowspec_create_node', 'Add a node (datapoint, component, transform, or table) to a project', createNodeSchema.shape, handleCreateNode);
34
+ server.tool('flowspec_update_node', 'Update a node\'s data (label, type, constraints) or position', updateNodeSchema.shape, handleUpdateNode);
35
+ server.tool('flowspec_delete_node', 'Remove a node and all its connected edges from a project', deleteNodeSchema.shape, handleDeleteNode);
36
+ server.tool('flowspec_create_edge', 'Connect two nodes with an edge type (flows-to, derives-from, transforms, validates, contains)', createEdgeSchema.shape, handleCreateEdge);
37
+ server.tool('flowspec_delete_edge', 'Remove an edge from a project', deleteEdgeSchema.shape, handleDeleteEdge);
38
+ server.tool('flowspec_analyse_project', 'Run orphan node and duplicate label analysis on a project', analyseProjectSchema.shape, handleAnalyseProject);
39
+ console.error(`FlowSpec MCP v2.0.0 — mode: ${MODE}`);
40
+ return server;
41
+ }
42
+ //# sourceMappingURL=server.js.map
@@ -0,0 +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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AAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ export declare const analyseProjectSchema: z.ZodObject<{
3
+ projectId: z.ZodString;
4
+ }, "strip", z.ZodTypeAny, {
5
+ projectId: string;
6
+ }, {
7
+ projectId: string;
8
+ }>;
9
+ export declare function handleAnalyseProject(args: z.infer<typeof analyseProjectSchema>): Promise<{
10
+ content: {
11
+ type: "text";
12
+ text: string;
13
+ }[];
14
+ isError: boolean;
15
+ } | {
16
+ content: {
17
+ type: "text";
18
+ text: string;
19
+ }[];
20
+ isError?: undefined;
21
+ }>;
@@ -0,0 +1,105 @@
1
+ import { z } from 'zod';
2
+ import { getProject } from '../db.js';
3
+ export const analyseProjectSchema = z.object({
4
+ projectId: z.string().describe('UUID of the project to analyse'),
5
+ });
6
+ export async function handleAnalyseProject(args) {
7
+ const project = await getProject(args.projectId);
8
+ if (!project) {
9
+ return {
10
+ content: [{ type: 'text', text: `Project not found: ${args.projectId}` }],
11
+ isError: true,
12
+ };
13
+ }
14
+ const nodes = project.canvas_state?.nodes ?? [];
15
+ const edges = project.canvas_state?.edges ?? [];
16
+ const screens = (project.canvas_state?.screens ?? []);
17
+ // Filter to meaningful nodes (exclude image and screen)
18
+ const analysableNodes = nodes.filter((n) => n.type !== 'image' && n.type !== 'screen');
19
+ // Build set of connected node IDs
20
+ const connectedIds = new Set();
21
+ for (const e of edges) {
22
+ connectedIds.add(e.source);
23
+ connectedIds.add(e.target);
24
+ }
25
+ // Build screen-reference map
26
+ const screenRefMap = new Map();
27
+ for (const sc of screens) {
28
+ for (const r of sc.regions) {
29
+ for (const eid of r.elementIds) {
30
+ const refs = screenRefMap.get(eid) ?? [];
31
+ if (!refs.includes(sc.name))
32
+ refs.push(sc.name);
33
+ screenRefMap.set(eid, refs);
34
+ }
35
+ }
36
+ }
37
+ // Orphans
38
+ const orphans = [];
39
+ for (const n of analysableNodes) {
40
+ if (!connectedIds.has(n.id)) {
41
+ orphans.push({
42
+ id: n.id,
43
+ label: n.data?.label ?? 'Untitled',
44
+ nodeType: n.type ?? 'unknown',
45
+ screenRefs: screenRefMap.get(n.id) ?? [],
46
+ });
47
+ }
48
+ }
49
+ // Duplicates
50
+ const labelGroups = new Map();
51
+ for (const n of analysableNodes) {
52
+ const label = (n.data?.label ?? '').trim().toLowerCase();
53
+ if (!label)
54
+ continue;
55
+ const group = labelGroups.get(label) ?? { ids: [], types: [] };
56
+ group.ids.push(n.id);
57
+ group.types.push(n.type ?? 'unknown');
58
+ labelGroups.set(label, group);
59
+ }
60
+ const duplicates = [];
61
+ for (const [label, group] of labelGroups) {
62
+ if (group.ids.length < 2)
63
+ continue;
64
+ const uniqueTypes = [...new Set(group.types)];
65
+ duplicates.push({
66
+ label,
67
+ nodeType: uniqueTypes.length === 1 ? uniqueTypes[0] : 'mixed',
68
+ nodeIds: group.ids,
69
+ nodeTypes: group.types,
70
+ });
71
+ }
72
+ const result = {
73
+ orphans,
74
+ duplicates,
75
+ totalNodes: analysableNodes.length,
76
+ connectedNodes: connectedIds.size,
77
+ };
78
+ // Format output
79
+ const lines = [];
80
+ lines.push(`## Analysis for ${project.name}`);
81
+ lines.push(`Total nodes: ${result.totalNodes} | Connected: ${result.connectedNodes} | Orphans: ${result.orphans.length} | Duplicate labels: ${result.duplicates.length}`);
82
+ if (result.orphans.length > 0) {
83
+ lines.push('');
84
+ lines.push('### Orphan Nodes (no edges)');
85
+ for (const o of result.orphans) {
86
+ const screenInfo = o.screenRefs.length > 0 ? ` [screens: ${o.screenRefs.join(', ')}]` : '';
87
+ lines.push(`- **${o.label}** (${o.nodeType}, id: ${o.id})${screenInfo}`);
88
+ }
89
+ }
90
+ if (result.duplicates.length > 0) {
91
+ lines.push('');
92
+ lines.push('### Duplicate Labels');
93
+ for (const d of result.duplicates) {
94
+ lines.push(`- **${d.label}** (${d.nodeType}) — ${d.nodeIds.length} nodes: ${d.nodeIds.join(', ')}`);
95
+ }
96
+ }
97
+ if (result.orphans.length === 0 && result.duplicates.length === 0) {
98
+ lines.push('');
99
+ lines.push('No issues found — all nodes are connected and labels are unique.');
100
+ }
101
+ return {
102
+ content: [{ type: 'text', text: lines.join('\n') }],
103
+ };
104
+ }
105
+ //# sourceMappingURL=analyseProject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyseProject.js","sourceRoot":"","sources":["../../src/tools/analyseProject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;CACjE,CAAC,CAAC;AAgBH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,IAA0C;IACnF,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAEjD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,sBAAsB,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;YAClF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC;IAChD,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC;IAChD,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,IAAI,EAAE,CAGlD,CAAC;IAEH,wDAAwD;IACxD,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAClC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,CACjD,CAAC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AQ,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,WAAW,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtG,CAAC;IACH,CAAC;IAED,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;IACjF,CAAC;IAED,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;KAC7D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ export declare const createEdgeSchema: z.ZodObject<{
3
+ projectId: z.ZodString;
4
+ source: z.ZodString;
5
+ target: z.ZodString;
6
+ type: z.ZodOptional<z.ZodEnum<["flows-to", "derives-from", "transforms", "validates", "contains"]>>;
7
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ projectId: string;
10
+ source: string;
11
+ target: string;
12
+ data?: Record<string, unknown> | undefined;
13
+ type?: "flows-to" | "derives-from" | "transforms" | "validates" | "contains" | undefined;
14
+ }, {
15
+ projectId: string;
16
+ source: string;
17
+ target: string;
18
+ data?: Record<string, unknown> | undefined;
19
+ type?: "flows-to" | "derives-from" | "transforms" | "validates" | "contains" | undefined;
20
+ }>;
21
+ export declare function handleCreateEdge(args: z.infer<typeof createEdgeSchema>): Promise<{
22
+ content: {
23
+ type: "text";
24
+ text: string;
25
+ }[];
26
+ isError: boolean;
27
+ } | {
28
+ content: {
29
+ type: "text";
30
+ text: string;
31
+ }[];
32
+ isError?: undefined;
33
+ }>;
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ import { createEdgeViaApi } from '../db.js';
3
+ export const createEdgeSchema = z.object({
4
+ projectId: z.string().describe('UUID of the project'),
5
+ source: z.string().describe('Source node ID'),
6
+ target: z.string().describe('Target node ID'),
7
+ type: z.enum(['flows-to', 'derives-from', 'transforms', 'validates', 'contains']).optional()
8
+ .describe('Edge type (defaults to flows-to)'),
9
+ data: z.record(z.unknown()).optional().describe('Optional edge data'),
10
+ });
11
+ export async function handleCreateEdge(args) {
12
+ const edge = await createEdgeViaApi(args.projectId, {
13
+ source: args.source,
14
+ target: args.target,
15
+ type: args.type ? `typed` : 'typed',
16
+ data: { edgeType: args.type ?? 'flows-to', ...(args.data ?? {}) },
17
+ });
18
+ if (!edge) {
19
+ return {
20
+ content: [{ type: 'text', text: `Failed to create edge — project or nodes not found` }],
21
+ isError: true,
22
+ };
23
+ }
24
+ return {
25
+ content: [{
26
+ type: 'text',
27
+ text: `Created edge ${args.source} → ${args.target} (type: ${args.type ?? 'flows-to'}, id: ${edge.id})`,
28
+ }],
29
+ };
30
+ }
31
+ //# sourceMappingURL=createEdge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createEdge.js","sourceRoot":"","sources":["../../src/tools/createEdge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IACrD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC7C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC7C,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE;SACzF,QAAQ,CAAC,kCAAkC,CAAC;IAC/C,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;CACtE,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,IAAsC;IAC3E,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE;QAClD,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;QACnC,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,IAAI,UAAU,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE;KAClE,CAAC,CAAC;IAEH,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,oDAAoD,EAAE,CAAC;YAChG,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,CAAC;gBACR,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE,gBAAgB,IAAI,CAAC,MAAM,MAAM,IAAI,CAAC,MAAM,WAAW,IAAI,CAAC,IAAI,IAAI,UAAU,SAAS,IAAI,CAAC,EAAE,GAAG;aACxG,CAAC;KACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { z } from 'zod';
2
+ export declare const createNodeSchema: z.ZodObject<{
3
+ projectId: z.ZodString;
4
+ type: z.ZodEnum<["datapoint", "component", "transform", "table"]>;
5
+ position: z.ZodObject<{
6
+ x: z.ZodNumber;
7
+ y: z.ZodNumber;
8
+ }, "strip", z.ZodTypeAny, {
9
+ x: number;
10
+ y: number;
11
+ }, {
12
+ x: number;
13
+ y: number;
14
+ }>;
15
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ data: Record<string, unknown>;
18
+ type: "datapoint" | "component" | "transform" | "table";
19
+ position: {
20
+ x: number;
21
+ y: number;
22
+ };
23
+ projectId: string;
24
+ }, {
25
+ data: Record<string, unknown>;
26
+ type: "datapoint" | "component" | "transform" | "table";
27
+ position: {
28
+ x: number;
29
+ y: number;
30
+ };
31
+ projectId: string;
32
+ }>;
33
+ export declare function handleCreateNode(args: z.infer<typeof createNodeSchema>): Promise<{
34
+ content: {
35
+ type: "text";
36
+ text: string;
37
+ }[];
38
+ isError: boolean;
39
+ } | {
40
+ content: {
41
+ type: "text";
42
+ text: string;
43
+ }[];
44
+ isError?: undefined;
45
+ }>;
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ import { createNodeViaApi } from '../db.js';
3
+ export const createNodeSchema = z.object({
4
+ projectId: z.string().describe('UUID of the project'),
5
+ type: z.enum(['datapoint', 'component', 'transform', 'table']).describe('Node type'),
6
+ position: z.object({
7
+ x: z.number().describe('X position on canvas'),
8
+ y: z.number().describe('Y position on canvas'),
9
+ }).describe('Canvas position'),
10
+ data: z.record(z.unknown()).describe('Node data (label, type, constraints, etc. — varies by node type)'),
11
+ });
12
+ export async function handleCreateNode(args) {
13
+ const node = await createNodeViaApi(args.projectId, {
14
+ type: args.type,
15
+ position: args.position,
16
+ data: args.data,
17
+ });
18
+ if (!node) {
19
+ return {
20
+ content: [{ type: 'text', text: `Failed to create node — project not found: ${args.projectId}` }],
21
+ isError: true,
22
+ };
23
+ }
24
+ return {
25
+ content: [{
26
+ type: 'text',
27
+ text: `Created ${args.type} node **${args.data.label ?? node.id}** (id: ${node.id})`,
28
+ }],
29
+ };
30
+ }
31
+ //# source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EAAE,EAAE,CAAC;YAC1G,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,CAAC;gBACR,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE,WAAW,IAAI,CAAC,IAAI,WAAW,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE,WAAW,IAAI,CAAC,EAAE,GAAG;aACrF,CAAC;KACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ export declare const createProjectSchema: z.ZodObject<{
3
+ name: z.ZodString;
4
+ canvas_state: z.ZodOptional<z.ZodAny>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ name: string;
7
+ canvas_state?: any;
8
+ }, {
9
+ name: string;
10
+ canvas_state?: any;
11
+ }>;
12
+ export declare function handleCreateProject(args: z.infer<typeof createProjectSchema>): Promise<{
13
+ content: {
14
+ type: "text";
15
+ text: string;
16
+ }[];
17
+ }>;
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { createProjectViaApi } from '../db.js';
3
+ export const createProjectSchema = z.object({
4
+ name: z.string().describe('Project name'),
5
+ canvas_state: z.any().optional().describe('Initial canvas state JSON (nodes, edges, screens). Defaults to empty.'),
6
+ });
7
+ export async function handleCreateProject(args) {
8
+ const project = await createProjectViaApi(args.name, args.canvas_state);
9
+ return {
10
+ content: [{
11
+ type: 'text',
12
+ text: `Created project **${project.name}** (id: ${project.id})`,
13
+ }],
14
+ };
15
+ }
16
+ //# sourceMappingURL=createProject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createProject.js","sourceRoot":"","sources":["../../src/tools/createProject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;IACzC,YAAY,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uEAAuE,CAAC;CACnH,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,IAAyC;IACjF,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAExE,OAAO;QACL,OAAO,EAAE,CAAC;gBACR,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE,qBAAqB,OAAO,CAAC,IAAI,WAAW,OAAO,CAAC,EAAE,GAAG;aAChE,CAAC;KACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ export declare const deleteEdgeSchema: z.ZodObject<{
3
+ projectId: z.ZodString;
4
+ edgeId: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ projectId: string;
7
+ edgeId: string;
8
+ }, {
9
+ projectId: string;
10
+ edgeId: string;
11
+ }>;
12
+ export declare function handleDeleteEdge(args: z.infer<typeof deleteEdgeSchema>): Promise<{
13
+ content: {
14
+ type: "text";
15
+ text: string;
16
+ }[];
17
+ isError: boolean;
18
+ } | {
19
+ content: {
20
+ type: "text";
21
+ text: string;
22
+ }[];
23
+ isError?: undefined;
24
+ }>;
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { deleteEdgeViaApi } from '../db.js';
3
+ export const deleteEdgeSchema = z.object({
4
+ projectId: z.string().describe('UUID of the project'),
5
+ edgeId: z.string().describe('UUID of the edge to delete'),
6
+ });
7
+ export async function handleDeleteEdge(args) {
8
+ const ok = await deleteEdgeViaApi(args.projectId, args.edgeId);
9
+ if (!ok) {
10
+ return {
11
+ content: [{ type: 'text', text: `Edge or project not found: ${args.edgeId}` }],
12
+ isError: true,
13
+ };
14
+ }
15
+ return {
16
+ content: [{ type: 'text', text: `Deleted edge ${args.edgeId}` }],
17
+ };
18
+ }
19
+ //# sourceMappingURL=deleteEdge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteEdge.js","sourceRoot":"","sources":["../../src/tools/deleteEdge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IACrD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;CAC1D,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,IAAsC;IAC3E,MAAM,EAAE,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAE/D,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,8BAA8B,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;YACvF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,gBAAgB,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;KAC1E,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ export declare const deleteNodeSchema: z.ZodObject<{
3
+ projectId: z.ZodString;
4
+ nodeId: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ projectId: string;
7
+ nodeId: string;
8
+ }, {
9
+ projectId: string;
10
+ nodeId: string;
11
+ }>;
12
+ export declare function handleDeleteNode(args: z.infer<typeof deleteNodeSchema>): Promise<{
13
+ content: {
14
+ type: "text";
15
+ text: string;
16
+ }[];
17
+ isError: boolean;
18
+ } | {
19
+ content: {
20
+ type: "text";
21
+ text: string;
22
+ }[];
23
+ isError?: undefined;
24
+ }>;
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { deleteNodeViaApi } from '../db.js';
3
+ export const deleteNodeSchema = z.object({
4
+ projectId: z.string().describe('UUID of the project'),
5
+ nodeId: z.string().describe('UUID of the node to delete (connected edges are also removed)'),
6
+ });
7
+ export async function handleDeleteNode(args) {
8
+ const ok = await deleteNodeViaApi(args.projectId, args.nodeId);
9
+ if (!ok) {
10
+ return {
11
+ content: [{ type: 'text', text: `Node or project not found: ${args.nodeId}` }],
12
+ isError: true,
13
+ };
14
+ }
15
+ return {
16
+ content: [{ type: 'text', text: `Deleted node ${args.nodeId} and its connected edges` }],
17
+ };
18
+ }
19
+ //# sourceMappingURL=deleteNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteNode.js","sourceRoot":"","sources":["../../src/tools/deleteNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IACrD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+DAA+D,CAAC;CAC7F,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,IAAsC;IAC3E,MAAM,EAAE,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAE/D,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,8BAA8B,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;YACvF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,gBAAgB,IAAI,CAAC,MAAM,0BAA0B,EAAE,CAAC;KAClG,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ export declare const deleteProjectSchema: z.ZodObject<{
3
+ projectId: z.ZodString;
4
+ }, "strip", z.ZodTypeAny, {
5
+ projectId: string;
6
+ }, {
7
+ projectId: string;
8
+ }>;
9
+ export declare function handleDeleteProject(args: z.infer<typeof deleteProjectSchema>): Promise<{
10
+ content: {
11
+ type: "text";
12
+ text: string;
13
+ }[];
14
+ isError: boolean;
15
+ } | {
16
+ content: {
17
+ type: "text";
18
+ text: string;
19
+ }[];
20
+ isError?: undefined;
21
+ }>;
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { deleteProjectViaApi } from '../db.js';
3
+ export const deleteProjectSchema = z.object({
4
+ projectId: z.string().describe('UUID of the project to delete'),
5
+ });
6
+ export async function handleDeleteProject(args) {
7
+ const ok = await deleteProjectViaApi(args.projectId);
8
+ if (!ok) {
9
+ return {
10
+ content: [{ type: 'text', text: `Project not found: ${args.projectId}` }],
11
+ isError: true,
12
+ };
13
+ }
14
+ return {
15
+ content: [{ type: 'text', text: `Deleted project ${args.projectId}` }],
16
+ };
17
+ }
18
+ //# sourceMappingURL=deleteProject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteProject.js","sourceRoot":"","sources":["../../src/tools/deleteProject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;CAChE,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,IAAyC;IACjF,MAAM,EAAE,GAAG,MAAM,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAErD,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,sBAAsB,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;YAClF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,mBAAmB,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;KAChF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ export declare const getProjectSchema: z.ZodObject<{
3
+ projectId: z.ZodString;
4
+ }, "strip", z.ZodTypeAny, {
5
+ projectId: string;
6
+ }, {
7
+ projectId: string;
8
+ }>;
9
+ export declare function handleGetProject(args: z.infer<typeof getProjectSchema>): Promise<{
10
+ content: {
11
+ type: "text";
12
+ text: string;
13
+ }[];
14
+ isError: boolean;
15
+ } | {
16
+ content: {
17
+ type: "text";
18
+ text: string;
19
+ }[];
20
+ isError?: undefined;
21
+ }>;
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { getProject } from '../db.js';
3
+ export const getProjectSchema = z.object({
4
+ projectId: z.string().describe('UUID of the FlowSpec project'),
5
+ });
6
+ export async function handleGetProject(args) {
7
+ const project = await getProject(args.projectId);
8
+ if (!project) {
9
+ return {
10
+ content: [{ type: 'text', text: `Project not found: ${args.projectId}` }],
11
+ isError: true,
12
+ };
13
+ }
14
+ return {
15
+ content: [{ type: 'text', text: JSON.stringify(project.canvas_state, null, 2) }],
16
+ };
17
+ }
18
+ //# sourceMappingURL=getProject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getProject.js","sourceRoot":"","sources":["../../src/tools/getProject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;CAC/D,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,IAAsC;IAC3E,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAEjD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,sBAAsB,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;YAClF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KAC1F,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ export declare const getScreenContextSchema: z.ZodObject<{
3
+ projectId: z.ZodString;
4
+ screenId: z.ZodOptional<z.ZodString>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ projectId: string;
7
+ screenId?: string | undefined;
8
+ }, {
9
+ projectId: string;
10
+ screenId?: string | undefined;
11
+ }>;
12
+ export declare function handleGetScreenContext(args: z.infer<typeof getScreenContextSchema>): Promise<{
13
+ content: {
14
+ type: "text";
15
+ text: string;
16
+ }[];
17
+ isError: boolean;
18
+ } | {
19
+ content: {
20
+ type: "text";
21
+ text: string;
22
+ }[];
23
+ isError?: undefined;
24
+ }>;