flowspec-mcp 4.1.0 → 4.2.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.
- package/README.md +4 -159
- package/dist/db.d.ts +0 -26
- package/dist/db.js +396 -318
- package/dist/db.js.map +1 -1
- package/dist/index.js +0 -0
- package/dist/server.js +7 -26
- package/dist/server.js.map +1 -1
- package/dist/tools/createEdge.d.ts +4 -4
- package/dist/tools/createNode.d.ts +2 -2
- package/dist/tools/deleteEdge.js +4 -20
- package/dist/tools/deleteEdge.js.map +1 -1
- package/dist/tools/deleteNode.js +4 -20
- package/dist/tools/deleteNode.js.map +1 -1
- package/dist/tools/updateEdge.d.ts +2 -2
- package/dist/tools/updateEdge.js +3 -19
- package/dist/tools/updateEdge.js.map +1 -1
- package/dist/tools/updateNode.d.ts +2 -2
- package/dist/tools/updateNode.js +5 -21
- package/dist/tools/updateNode.js.map +1 -1
- package/dist/tools/updateProject.d.ts +2 -2
- package/dist/types.d.ts +0 -12
- package/package.json +2 -2
- package/dist/analysis/analysisUtils.d.ts +0 -36
- package/dist/analysis/analysisUtils.js +0 -284
- package/dist/analysis/analysisUtils.js.map +0 -1
- package/dist/export/jsonExporter.d.ts +0 -17
- package/dist/export/jsonExporter.js +0 -176
- package/dist/export/jsonExporter.js.map +0 -1
- package/dist/layout/semanticLayout.d.ts +0 -24
- package/dist/layout/semanticLayout.js +0 -233
- package/dist/layout/semanticLayout.js.map +0 -1
- package/dist/resources/selection.d.ts +0 -5
- package/dist/resources/selection.js +0 -88
- package/dist/resources/selection.js.map +0 -1
- package/dist/tools/captureScreen.d.ts +0 -48
- package/dist/tools/captureScreen.js +0 -135
- package/dist/tools/captureScreen.js.map +0 -1
- package/dist/tools/createSubview.d.ts +0 -50
- package/dist/tools/createSubview.js +0 -29
- package/dist/tools/createSubview.js.map +0 -1
- package/dist/tools/deleteSubview.d.ts +0 -24
- package/dist/tools/deleteSubview.js +0 -19
- package/dist/tools/deleteSubview.js.map +0 -1
- package/dist/tools/generateSpec.d.ts +0 -26
- package/dist/tools/generateSpec.js +0 -336
- package/dist/tools/generateSpec.js.map +0 -1
- package/dist/tools/getJson.d.ts +0 -21
- package/dist/tools/getJson.js +0 -24
- package/dist/tools/getJson.js.map +0 -1
- package/dist/tools/healthCheck.d.ts +0 -8
- package/dist/tools/healthCheck.js +0 -16
- package/dist/tools/healthCheck.js.map +0 -1
- package/dist/tools/ingestCodebase.d.ts +0 -27
- package/dist/tools/ingestCodebase.js +0 -516
- package/dist/tools/ingestCodebase.js.map +0 -1
- package/dist/tools/listSubviews.d.ts +0 -21
- package/dist/tools/listSubviews.js +0 -34
- package/dist/tools/listSubviews.js.map +0 -1
- package/dist/tools/smartLayout.d.ts +0 -30
- package/dist/tools/smartLayout.js +0 -74
- package/dist/tools/smartLayout.js.map +0 -1
- package/dist/tools/updateSubview.d.ts +0 -53
- package/dist/tools/updateSubview.js +0 -33
- package/dist/tools/updateSubview.js.map +0 -1
- package/dist/utils/selectionHelper.d.ts +0 -61
- package/dist/utils/selectionHelper.js +0 -111
- package/dist/utils/selectionHelper.js.map +0 -1
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { CanvasNode, CanvasEdge } from '../types.js';
|
|
2
|
-
export interface NamingViolation {
|
|
3
|
-
nodeId: string;
|
|
4
|
-
label: string;
|
|
5
|
-
issue: 'mixed-case' | 'special-chars' | 'inconsistent-prefix';
|
|
6
|
-
suggestion: string;
|
|
7
|
-
}
|
|
8
|
-
export interface FuzzyDuplicate {
|
|
9
|
-
primaryNodeId: string;
|
|
10
|
-
primaryLabel: string;
|
|
11
|
-
similarNodes: Array<{
|
|
12
|
-
nodeId: string;
|
|
13
|
-
label: string;
|
|
14
|
-
similarity: number;
|
|
15
|
-
method: 'levenshtein' | 'cosine';
|
|
16
|
-
}>;
|
|
17
|
-
}
|
|
18
|
-
export interface SubgraphCluster {
|
|
19
|
-
clusterIndex: number;
|
|
20
|
-
nodeIds: string[];
|
|
21
|
-
nodeLabels: string[];
|
|
22
|
-
isIsolated: boolean;
|
|
23
|
-
}
|
|
24
|
-
export interface ConsolidationSuggestion {
|
|
25
|
-
targetLabel: string;
|
|
26
|
-
nodeIds: string[];
|
|
27
|
-
reason: 'same-type-and-constraints' | 'duplicate-references';
|
|
28
|
-
confidence: 'high' | 'medium' | 'low';
|
|
29
|
-
}
|
|
30
|
-
export declare function detectNamingViolations(nodes: CanvasNode[]): NamingViolation[];
|
|
31
|
-
export declare function findFuzzyDuplicates(nodes: CanvasNode[], thresholds?: {
|
|
32
|
-
levenshtein: number;
|
|
33
|
-
cosine: number;
|
|
34
|
-
}): FuzzyDuplicate[];
|
|
35
|
-
export declare function detectSubgraphs(nodes: CanvasNode[], edges: CanvasEdge[]): SubgraphCluster[];
|
|
36
|
-
export declare function suggestConsolidations(nodes: CanvasNode[]): ConsolidationSuggestion[];
|
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
import levenshtein from 'fast-levenshtein';
|
|
2
|
-
import natural from 'natural';
|
|
3
|
-
// ─── Naming Convention Detection ─────────────────────────────────
|
|
4
|
-
const NAMING_RULES = {
|
|
5
|
-
// Prefer snake_case or kebab-case, flag mixed casing
|
|
6
|
-
mixedCase: /^[a-z]+([A-Z][a-z]+)+$/, // camelCase
|
|
7
|
-
specialChars: /[^a-zA-Z0-9_\-\s]/,
|
|
8
|
-
commonPrefixes: ['user', 'order', 'product', 'payment', 'auth', 'admin', 'cart', 'invoice']
|
|
9
|
-
};
|
|
10
|
-
export function detectNamingViolations(nodes) {
|
|
11
|
-
const violations = [];
|
|
12
|
-
const prefixGroups = new Map(); // prefix → [labels]
|
|
13
|
-
for (const node of nodes) {
|
|
14
|
-
const label = (node.data?.label ?? '').trim();
|
|
15
|
-
if (!label)
|
|
16
|
-
continue;
|
|
17
|
-
const nodeId = node.id;
|
|
18
|
-
// Check for mixed casing (camelCase)
|
|
19
|
-
if (NAMING_RULES.mixedCase.test(label)) {
|
|
20
|
-
const suggestion = label.replace(/([A-Z])/g, '_$1').toLowerCase();
|
|
21
|
-
violations.push({
|
|
22
|
-
nodeId,
|
|
23
|
-
label,
|
|
24
|
-
issue: 'mixed-case',
|
|
25
|
-
suggestion
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
// Check for special characters (excluding space, dash, underscore)
|
|
29
|
-
if (NAMING_RULES.specialChars.test(label)) {
|
|
30
|
-
const suggestion = label.replace(/[^a-zA-Z0-9_\-\s]/g, '');
|
|
31
|
-
violations.push({
|
|
32
|
-
nodeId,
|
|
33
|
-
label,
|
|
34
|
-
issue: 'special-chars',
|
|
35
|
-
suggestion
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
// Track prefix usage for consistency analysis
|
|
39
|
-
const lowerLabel = label.toLowerCase();
|
|
40
|
-
for (const prefix of NAMING_RULES.commonPrefixes) {
|
|
41
|
-
if (lowerLabel.startsWith(prefix)) {
|
|
42
|
-
const group = prefixGroups.get(prefix) ?? [];
|
|
43
|
-
group.push(label);
|
|
44
|
-
prefixGroups.set(prefix, group);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
// Check for inconsistent prefix usage (e.g., user_id vs userId)
|
|
49
|
-
for (const [prefix, labels] of prefixGroups) {
|
|
50
|
-
if (labels.length < 2)
|
|
51
|
-
continue;
|
|
52
|
-
const hasCamelCase = labels.some((l) => /[A-Z]/.test(l));
|
|
53
|
-
const hasSnakeCase = labels.some((l) => l.includes('_'));
|
|
54
|
-
const hasKebabCase = labels.some((l) => l.includes('-'));
|
|
55
|
-
// If mixed styles exist for same prefix, flag inconsistency
|
|
56
|
-
const styles = [hasCamelCase, hasSnakeCase, hasKebabCase].filter(Boolean).length;
|
|
57
|
-
if (styles > 1) {
|
|
58
|
-
// Find the inconsistent nodes and suggest the most common style
|
|
59
|
-
const dominantStyle = hasSnakeCase ? 'snake_case' : hasCamelCase ? 'camelCase' : 'kebab-case';
|
|
60
|
-
for (const node of nodes) {
|
|
61
|
-
const label = (node.data?.label ?? '').trim();
|
|
62
|
-
if (!label.toLowerCase().startsWith(prefix))
|
|
63
|
-
continue;
|
|
64
|
-
const isInconsistent = (dominantStyle === 'snake_case' && /[A-Z]/.test(label)) ||
|
|
65
|
-
(dominantStyle === 'camelCase' && label.includes('_'));
|
|
66
|
-
if (isInconsistent) {
|
|
67
|
-
const suggestion = dominantStyle === 'snake_case'
|
|
68
|
-
? label.replace(/([A-Z])/g, '_$1').toLowerCase()
|
|
69
|
-
: label.replace(/_([a-z])/g, (_, c) => c.toUpperCase());
|
|
70
|
-
violations.push({
|
|
71
|
-
nodeId: node.id,
|
|
72
|
-
label,
|
|
73
|
-
issue: 'inconsistent-prefix',
|
|
74
|
-
suggestion
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return violations;
|
|
81
|
-
}
|
|
82
|
-
// ─── Fuzzy Duplicate Detection ──────────────────────────────────
|
|
83
|
-
export function findFuzzyDuplicates(nodes, thresholds = { levenshtein: 2, cosine: 0.85 }) {
|
|
84
|
-
const duplicates = [];
|
|
85
|
-
const processed = new Set();
|
|
86
|
-
// Group nodes by type first to reduce comparisons
|
|
87
|
-
const nodesByType = new Map();
|
|
88
|
-
for (const node of nodes) {
|
|
89
|
-
const nodeType = node.type ?? 'unknown';
|
|
90
|
-
const group = nodesByType.get(nodeType) ?? [];
|
|
91
|
-
group.push(node);
|
|
92
|
-
nodesByType.set(nodeType, group);
|
|
93
|
-
}
|
|
94
|
-
// TF-IDF vectorizer for cosine similarity
|
|
95
|
-
const TfIdf = natural.TfIdf;
|
|
96
|
-
const tfidf = new TfIdf();
|
|
97
|
-
// Within each type group, find fuzzy matches
|
|
98
|
-
for (const [, typeNodes] of nodesByType) {
|
|
99
|
-
if (typeNodes.length < 2)
|
|
100
|
-
continue;
|
|
101
|
-
// Build TF-IDF corpus
|
|
102
|
-
const labels = typeNodes.map((n) => (n.data?.label ?? '').trim().toLowerCase());
|
|
103
|
-
for (const label of labels) {
|
|
104
|
-
if (label)
|
|
105
|
-
tfidf.addDocument(label);
|
|
106
|
-
}
|
|
107
|
-
for (let i = 0; i < typeNodes.length; i++) {
|
|
108
|
-
const node = typeNodes[i];
|
|
109
|
-
const label = (node.data?.label ?? '').trim();
|
|
110
|
-
if (!label || processed.has(node.id))
|
|
111
|
-
continue;
|
|
112
|
-
const similarNodes = [];
|
|
113
|
-
for (let j = i + 1; j < typeNodes.length; j++) {
|
|
114
|
-
const compareNode = typeNodes[j];
|
|
115
|
-
const compareLabel = (compareNode.data?.label ?? '').trim();
|
|
116
|
-
if (!compareLabel || processed.has(compareNode.id))
|
|
117
|
-
continue;
|
|
118
|
-
// Levenshtein distance (edit distance)
|
|
119
|
-
const distance = levenshtein.get(label.toLowerCase(), compareLabel.toLowerCase());
|
|
120
|
-
if (distance <= thresholds.levenshtein && distance > 0) {
|
|
121
|
-
// Distance 0 = exact match (handled by existing duplicate detection)
|
|
122
|
-
similarNodes.push({
|
|
123
|
-
nodeId: compareNode.id,
|
|
124
|
-
label: compareLabel,
|
|
125
|
-
similarity: 1 - distance / Math.max(label.length, compareLabel.length),
|
|
126
|
-
method: 'levenshtein'
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
// Cosine similarity (semantic similarity)
|
|
131
|
-
tfidf.tfidfs(label.toLowerCase(), (k, measure) => {
|
|
132
|
-
if (k === j && measure >= thresholds.cosine) {
|
|
133
|
-
similarNodes.push({
|
|
134
|
-
nodeId: compareNode.id,
|
|
135
|
-
label: compareLabel,
|
|
136
|
-
similarity: measure,
|
|
137
|
-
method: 'cosine'
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
if (similarNodes.length > 0) {
|
|
144
|
-
duplicates.push({
|
|
145
|
-
primaryNodeId: node.id,
|
|
146
|
-
primaryLabel: label,
|
|
147
|
-
similarNodes: similarNodes.sort((a, b) => b.similarity - a.similarity)
|
|
148
|
-
});
|
|
149
|
-
// Mark all as processed
|
|
150
|
-
processed.add(node.id);
|
|
151
|
-
for (const sim of similarNodes) {
|
|
152
|
-
processed.add(sim.nodeId);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
return duplicates;
|
|
158
|
-
}
|
|
159
|
-
// ─── Subgraph Detection (Connected Components) ───────────────────
|
|
160
|
-
export function detectSubgraphs(nodes, edges) {
|
|
161
|
-
// Build adjacency list
|
|
162
|
-
const adjacency = new Map();
|
|
163
|
-
const nodeIds = new Set(nodes.map((n) => n.id));
|
|
164
|
-
for (const node of nodes) {
|
|
165
|
-
adjacency.set(node.id, new Set());
|
|
166
|
-
}
|
|
167
|
-
for (const edge of edges) {
|
|
168
|
-
if (nodeIds.has(edge.source) && nodeIds.has(edge.target)) {
|
|
169
|
-
adjacency.get(edge.source)?.add(edge.target);
|
|
170
|
-
adjacency.get(edge.target)?.add(edge.source); // Undirected graph
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
// BFS to find connected components
|
|
174
|
-
const visited = new Set();
|
|
175
|
-
const clusters = [];
|
|
176
|
-
let clusterIndex = 0;
|
|
177
|
-
for (const node of nodes) {
|
|
178
|
-
if (visited.has(node.id))
|
|
179
|
-
continue;
|
|
180
|
-
// Start BFS from unvisited node
|
|
181
|
-
const cluster = [];
|
|
182
|
-
const queue = [node.id];
|
|
183
|
-
visited.add(node.id);
|
|
184
|
-
while (queue.length > 0) {
|
|
185
|
-
const current = queue.shift();
|
|
186
|
-
cluster.push(current);
|
|
187
|
-
const neighbors = adjacency.get(current) ?? new Set();
|
|
188
|
-
for (const neighbor of neighbors) {
|
|
189
|
-
if (!visited.has(neighbor)) {
|
|
190
|
-
visited.add(neighbor);
|
|
191
|
-
queue.push(neighbor);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
const nodeLabels = cluster
|
|
196
|
-
.map((id) => {
|
|
197
|
-
const n = nodes.find((node) => node.id === id);
|
|
198
|
-
return n?.data?.label ?? 'Untitled';
|
|
199
|
-
});
|
|
200
|
-
clusters.push({
|
|
201
|
-
clusterIndex: clusterIndex++,
|
|
202
|
-
nodeIds: cluster,
|
|
203
|
-
nodeLabels,
|
|
204
|
-
isIsolated: cluster.length < nodes.length / 2 // Heuristic: small clusters are isolated
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
// Sort by size (largest first)
|
|
208
|
-
clusters.sort((a, b) => b.nodeIds.length - a.nodeIds.length);
|
|
209
|
-
// Mark small clusters as isolated (only if there's a dominant main cluster)
|
|
210
|
-
if (clusters.length > 1 && clusters[0].nodeIds.length > nodes.length * 0.5) {
|
|
211
|
-
for (let i = 1; i < clusters.length; i++) {
|
|
212
|
-
clusters[i].isIsolated = true;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
return clusters;
|
|
216
|
-
}
|
|
217
|
-
// ─── Consolidation Suggestions ───────────────────────────────────
|
|
218
|
-
export function suggestConsolidations(nodes) {
|
|
219
|
-
const suggestions = [];
|
|
220
|
-
// Group by node type
|
|
221
|
-
const nodesByType = new Map();
|
|
222
|
-
for (const node of nodes) {
|
|
223
|
-
const nodeType = node.type ?? 'unknown';
|
|
224
|
-
const group = nodesByType.get(nodeType) ?? [];
|
|
225
|
-
group.push(node);
|
|
226
|
-
nodesByType.set(nodeType, group);
|
|
227
|
-
}
|
|
228
|
-
// For each type group, find nodes with same constraints
|
|
229
|
-
for (const [nodeType, typeNodes] of nodesByType) {
|
|
230
|
-
if (nodeType === 'datapoint') {
|
|
231
|
-
// Group by data type + constraints
|
|
232
|
-
const constraintGroups = new Map();
|
|
233
|
-
for (const node of typeNodes) {
|
|
234
|
-
const data = node.data;
|
|
235
|
-
const dataType = data.type ?? 'unknown';
|
|
236
|
-
const constraints = (data.constraints ?? []).sort().join('|');
|
|
237
|
-
const key = `${dataType}::${constraints}`;
|
|
238
|
-
const group = constraintGroups.get(key) ?? [];
|
|
239
|
-
group.push(node);
|
|
240
|
-
constraintGroups.set(key, group);
|
|
241
|
-
}
|
|
242
|
-
// Suggest consolidation for groups with multiple nodes
|
|
243
|
-
for (const [key, group] of constraintGroups) {
|
|
244
|
-
if (group.length > 1) {
|
|
245
|
-
const [dataType, constraintsStr] = key.split('::');
|
|
246
|
-
const hasConstraints = constraintsStr.length > 0;
|
|
247
|
-
suggestions.push({
|
|
248
|
-
targetLabel: group.map((n) => n.data?.label ?? '').join(' / '),
|
|
249
|
-
nodeIds: group.map((n) => n.id),
|
|
250
|
-
reason: 'same-type-and-constraints',
|
|
251
|
-
confidence: hasConstraints ? 'high' : 'medium'
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
else if (nodeType === 'component') {
|
|
257
|
-
// Group by displays/captures references
|
|
258
|
-
const referenceGroups = new Map();
|
|
259
|
-
for (const node of typeNodes) {
|
|
260
|
-
const data = node.data;
|
|
261
|
-
const displays = (data.displays ?? []).sort().join('|');
|
|
262
|
-
const captures = (data.captures ?? []).sort().join('|');
|
|
263
|
-
const key = `${displays}::${captures}`;
|
|
264
|
-
const group = referenceGroups.get(key) ?? [];
|
|
265
|
-
group.push(node);
|
|
266
|
-
referenceGroups.set(key, group);
|
|
267
|
-
}
|
|
268
|
-
for (const [key, group] of referenceGroups) {
|
|
269
|
-
if (group.length > 1) {
|
|
270
|
-
const [displaysStr, capturesStr] = key.split('::');
|
|
271
|
-
const hasReferences = displaysStr.length > 0 || capturesStr.length > 0;
|
|
272
|
-
suggestions.push({
|
|
273
|
-
targetLabel: group.map((n) => n.data?.label ?? '').join(' / '),
|
|
274
|
-
nodeIds: group.map((n) => n.id),
|
|
275
|
-
reason: 'duplicate-references',
|
|
276
|
-
confidence: hasReferences ? 'medium' : 'low'
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
return suggestions;
|
|
283
|
-
}
|
|
284
|
-
//# sourceMappingURL=analysisUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analysisUtils.js","sourceRoot":"","sources":["../../src/analysis/analysisUtils.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,OAAO,MAAM,SAAS,CAAC;AAqC9B,oEAAoE;AAEpE,MAAM,YAAY,GAAG;IACpB,qDAAqD;IACrD,SAAS,EAAE,wBAAwB,EAAE,YAAY;IACjD,YAAY,EAAE,mBAAmB;IACjC,cAAc,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC;CAC3F,CAAC;AAEF,MAAM,UAAU,sBAAsB,CAAC,KAAmB;IACzD,MAAM,UAAU,GAAsB,EAAE,CAAC;IACzC,MAAM,YAAY,GAAG,IAAI,GAAG,EAAoB,CAAC,CAAC,oBAAoB;IAEtE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAG,CAAE,IAAI,CAAC,IAAI,EAAE,KAAgB,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAC1D,IAAI,CAAC,KAAK;YAAE,SAAS;QAErB,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;QAEvB,qCAAqC;QACrC,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACxC,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;YAClE,UAAU,CAAC,IAAI,CAAC;gBACf,MAAM;gBACN,KAAK;gBACL,KAAK,EAAE,YAAY;gBACnB,UAAU;aACV,CAAC,CAAC;QACJ,CAAC;QAED,mEAAmE;QACnE,IAAI,YAAY,CAAC,YAAY,CAAC,IAAI,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0+ - JSON format for faster parsing and smaller file sizes.
|
|
5
|
-
* v4.1.0+ - Includes subviews support
|
|
6
|
-
* Adapted from web app — uses plain interfaces instead of @xyflow/svelte types.
|
|
7
|
-
*/
|
|
8
|
-
export declare function exportToJson(nodes: CanvasNode[], edges: CanvasEdge[], projectName?: string, screens?: Screen[], subviews?: Array<{
|
|
9
|
-
id: string;
|
|
10
|
-
name: string;
|
|
11
|
-
description?: string;
|
|
12
|
-
nodePositions: Array<{
|
|
13
|
-
nodeId: string;
|
|
14
|
-
x: number;
|
|
15
|
-
y: number;
|
|
16
|
-
}>;
|
|
17
|
-
}>): string;
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Exports canvas state to JSON specification optimised for Claude Code.
|
|
3
|
-
* v4.0.0+ - JSON format for faster parsing and smaller file sizes.
|
|
4
|
-
* v4.1.0+ - Includes subviews support
|
|
5
|
-
* Adapted from web app — uses plain interfaces instead of @xyflow/svelte types.
|
|
6
|
-
*/
|
|
7
|
-
export function exportToJson(nodes, edges, projectName = 'Untitled Project', screens = [], subviews = []) {
|
|
8
|
-
const exportableNodes = nodes.filter((n) => n.type !== 'image' && n.type !== 'screen');
|
|
9
|
-
const dataPointNodes = exportableNodes.filter((n) => n.type === 'datapoint');
|
|
10
|
-
const componentNodes = exportableNodes.filter((n) => n.type === 'component');
|
|
11
|
-
const transformNodes = exportableNodes.filter((n) => n.type === 'transform');
|
|
12
|
-
const tableNodes = exportableNodes.filter((n) => n.type === 'table');
|
|
13
|
-
const locationMap = buildLocationMap(dataPointNodes, componentNodes, edges);
|
|
14
|
-
// Build node label lookup for screen region export
|
|
15
|
-
const nodeLabelMap = new Map();
|
|
16
|
-
for (const n of exportableNodes) {
|
|
17
|
-
const label = n.data.label ?? 'Untitled';
|
|
18
|
-
nodeLabelMap.set(n.id, { label, type: n.type ?? 'unknown' });
|
|
19
|
-
}
|
|
20
|
-
const spec = {
|
|
21
|
-
version: '1.3.0',
|
|
22
|
-
metadata: {
|
|
23
|
-
projectName,
|
|
24
|
-
exportedAt: new Date().toISOString(),
|
|
25
|
-
nodeCount: exportableNodes.length,
|
|
26
|
-
edgeCount: edges.length,
|
|
27
|
-
},
|
|
28
|
-
dataPoints: dataPointNodes.map((node) => {
|
|
29
|
-
const data = node.data;
|
|
30
|
-
return {
|
|
31
|
-
id: node.id,
|
|
32
|
-
label: data.label,
|
|
33
|
-
type: data.type,
|
|
34
|
-
source: data.source,
|
|
35
|
-
sourceDefinition: data.sourceDefinition,
|
|
36
|
-
constraints: data.constraints,
|
|
37
|
-
locations: locationMap.get(node.id) ?? [],
|
|
38
|
-
};
|
|
39
|
-
}),
|
|
40
|
-
components: componentNodes.map((node) => {
|
|
41
|
-
const data = node.data;
|
|
42
|
-
const result = {
|
|
43
|
-
id: node.id,
|
|
44
|
-
label: data.label,
|
|
45
|
-
displays: data.displays,
|
|
46
|
-
captures: data.captures,
|
|
47
|
-
};
|
|
48
|
-
if (data.wireframeRef) {
|
|
49
|
-
result.wireframeRef = data.wireframeRef;
|
|
50
|
-
}
|
|
51
|
-
return result;
|
|
52
|
-
}),
|
|
53
|
-
transforms: transformNodes.map((node) => {
|
|
54
|
-
const data = node.data;
|
|
55
|
-
return {
|
|
56
|
-
id: node.id,
|
|
57
|
-
type: data.type,
|
|
58
|
-
description: data.description,
|
|
59
|
-
inputs: data.inputs,
|
|
60
|
-
outputs: data.outputs,
|
|
61
|
-
logic: data.logic,
|
|
62
|
-
};
|
|
63
|
-
}),
|
|
64
|
-
dataFlow: edges.filter((e) => {
|
|
65
|
-
return e.data?.edgeType !== 'contains';
|
|
66
|
-
}).map((edge) => {
|
|
67
|
-
const result = {
|
|
68
|
-
from: edge.source,
|
|
69
|
-
to: edge.target,
|
|
70
|
-
edgeType: edge.data?.edgeType ?? 'flows-to',
|
|
71
|
-
};
|
|
72
|
-
if (edge.data?.label) {
|
|
73
|
-
result.label = edge.data.label;
|
|
74
|
-
}
|
|
75
|
-
return result;
|
|
76
|
-
}),
|
|
77
|
-
};
|
|
78
|
-
// Add tables section if table nodes exist
|
|
79
|
-
if (tableNodes.length > 0) {
|
|
80
|
-
spec.tables = tableNodes.map((node) => {
|
|
81
|
-
const data = node.data;
|
|
82
|
-
const result = {
|
|
83
|
-
id: node.id,
|
|
84
|
-
label: data.label,
|
|
85
|
-
sourceType: data.sourceType,
|
|
86
|
-
columns: (data.columns ?? []).map((c) => ({ name: c.name, type: c.type })),
|
|
87
|
-
};
|
|
88
|
-
if (data.endpoint) {
|
|
89
|
-
result.endpoint = data.endpoint;
|
|
90
|
-
}
|
|
91
|
-
return result;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
// Add screens section if screens exist
|
|
95
|
-
if (screens.length > 0) {
|
|
96
|
-
spec.screens = screens.map((sc) => ({
|
|
97
|
-
id: sc.id,
|
|
98
|
-
name: sc.name,
|
|
99
|
-
imageFilename: sc.imageFilename,
|
|
100
|
-
regions: sc.regions.map((r) => {
|
|
101
|
-
const region = {
|
|
102
|
-
id: r.id,
|
|
103
|
-
label: r.label,
|
|
104
|
-
position: {
|
|
105
|
-
x: Math.round(r.position.x * 10) / 10,
|
|
106
|
-
y: Math.round(r.position.y * 10) / 10,
|
|
107
|
-
},
|
|
108
|
-
size: {
|
|
109
|
-
width: Math.round(r.size.width * 10) / 10,
|
|
110
|
-
height: Math.round(r.size.height * 10) / 10,
|
|
111
|
-
},
|
|
112
|
-
elements: r.elementIds.map((eid) => {
|
|
113
|
-
const info = nodeLabelMap.get(eid);
|
|
114
|
-
return {
|
|
115
|
-
nodeId: eid,
|
|
116
|
-
nodeLabel: info?.label ?? 'Missing element',
|
|
117
|
-
nodeType: info?.type ?? 'unknown',
|
|
118
|
-
};
|
|
119
|
-
}),
|
|
120
|
-
};
|
|
121
|
-
if (r.componentNodeId) {
|
|
122
|
-
region.componentNodeId = r.componentNodeId;
|
|
123
|
-
}
|
|
124
|
-
return region;
|
|
125
|
-
}),
|
|
126
|
-
}));
|
|
127
|
-
}
|
|
128
|
-
// Add subviews section if subviews exist
|
|
129
|
-
if (subviews.length > 0) {
|
|
130
|
-
spec.subviews = subviews.map((sv) => {
|
|
131
|
-
const subviewExport = {
|
|
132
|
-
id: sv.id,
|
|
133
|
-
name: sv.name,
|
|
134
|
-
nodes: sv.nodePositions.map((np) => {
|
|
135
|
-
const info = nodeLabelMap.get(np.nodeId);
|
|
136
|
-
return {
|
|
137
|
-
nodeId: np.nodeId,
|
|
138
|
-
nodeLabel: info?.label ?? 'Missing node',
|
|
139
|
-
nodeType: info?.type ?? 'unknown',
|
|
140
|
-
x: Math.round(np.x * 10) / 10,
|
|
141
|
-
y: Math.round(np.y * 10) / 10,
|
|
142
|
-
};
|
|
143
|
-
}),
|
|
144
|
-
};
|
|
145
|
-
if (sv.description) {
|
|
146
|
-
subviewExport.description = sv.description;
|
|
147
|
-
}
|
|
148
|
-
return subviewExport;
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
return JSON.stringify(spec, null, 2);
|
|
152
|
-
}
|
|
153
|
-
function buildLocationMap(dataPoints, components, edges) {
|
|
154
|
-
const map = new Map();
|
|
155
|
-
for (const dp of dataPoints) {
|
|
156
|
-
map.set(dp.id, []);
|
|
157
|
-
}
|
|
158
|
-
for (const edge of edges) {
|
|
159
|
-
const sourceIsDataPoint = dataPoints.some((n) => n.id === edge.source);
|
|
160
|
-
const targetIsComponent = components.some((n) => n.id === edge.target);
|
|
161
|
-
if (sourceIsDataPoint && targetIsComponent) {
|
|
162
|
-
const locations = map.get(edge.source) ?? [];
|
|
163
|
-
locations.push({ component: edge.target, role: 'output' });
|
|
164
|
-
map.set(edge.source, locations);
|
|
165
|
-
}
|
|
166
|
-
const sourceIsComponent = components.some((n) => n.id === edge.source);
|
|
167
|
-
const targetIsDataPoint = dataPoints.some((n) => n.id === edge.target);
|
|
168
|
-
if (sourceIsComponent && targetIsDataPoint) {
|
|
169
|
-
const locations = map.get(edge.target) ?? [];
|
|
170
|
-
locations.push({ component: edge.source, role: 'input' });
|
|
171
|
-
map.set(edge.target, locations);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return map;
|
|
175
|
-
}
|
|
176
|
-
//# sourceMappingURL=jsonExporter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonExporter.js","sourceRoot":"","sources":["../../src/export/jsonExporter.ts"],"names":[],"mappings":"AA6GA;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAmB,EACnB,KAAmB,EACnB,cAAsB,kBAAkB,EACxC,UAAoB,EAAE,EACtB,WAKK,EAAE;IAEP,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;IAEvF,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;IAC7E,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;IAC7E,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;IAC7E,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;IAErE,MAAM,WAAW,GAAG,gBAAgB,CAAC,cAAc,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;IAE5E,mDAAmD;IACnD,MAAM,YAAY,GAAG,IAAI,GAAG,EAA2C,CAAC;IACxE,KAAK,MAAM,CAAC,IAAI,eAAe,EAAE,CAAC;QAChC,MAAM,KAAK,GAAI,CA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AAC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;YAC3D,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAClC,CAAC;QAED,MAAM,iBAAiB,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC;QACvE,MAAM,iBAAiB,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC;QAEvE,IAAI,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;YAC3C,MAAM,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YAC7C,SAAS,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;YAC1D,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { CanvasNode, CanvasEdge } from '../types.js';
|
|
2
|
-
export interface LayoutCommand {
|
|
3
|
-
nodeIds: string[];
|
|
4
|
-
targetBounds: {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
};
|
|
10
|
-
arrangement: 'stack' | 'grid' | 'flow' | 'cluster';
|
|
11
|
-
direction?: 'vertical' | 'horizontal';
|
|
12
|
-
}
|
|
13
|
-
export declare function parseNaturalLanguageLayout(command: string, nodes: CanvasNode[], canvasBounds: {
|
|
14
|
-
width: number;
|
|
15
|
-
height: number;
|
|
16
|
-
}): LayoutCommand | {
|
|
17
|
-
error: string;
|
|
18
|
-
};
|
|
19
|
-
export declare function applySemanticLayout(nodes: CanvasNode[], edges: CanvasEdge[], command: LayoutCommand): Map<string, {
|
|
20
|
-
x: number;
|
|
21
|
-
y: number;
|
|
22
|
-
}>;
|
|
23
|
-
export declare const SUPPORTED_COMMANDS: string[];
|
|
24
|
-
export declare const SUPPORTED_REGIONS: string[];
|