@timo9378/flow2code 0.1.6 → 0.1.8
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/CHANGELOG.md +41 -0
- package/dist/cli.js +119 -46
- package/dist/compiler.cjs +68 -37
- package/dist/compiler.js +68 -37
- package/dist/server.js +80 -39
- package/out/404.html +1 -1
- package/out/__next.__PAGE__.txt +2 -2
- package/out/__next._full.txt +2 -2
- package/out/__next._head.txt +1 -1
- package/out/__next._index.txt +1 -1
- package/out/__next._tree.txt +1 -1
- package/out/_next/static/chunks/{5f1a9fec0e69c483.js → 06054f68c210e89c.js} +1 -1
- package/out/_next/static/chunks/{bfa275b7488d8b70.js → 0bc0a50347ee5f3c.js} +14 -12
- package/out/_next/static/chunks/4ce13068a7e61854.js +25 -0
- package/out/_not-found/__next._full.txt +1 -1
- package/out/_not-found/__next._head.txt +1 -1
- package/out/_not-found/__next._index.txt +1 -1
- package/out/_not-found/__next._not-found/__PAGE__.txt +1 -1
- package/out/_not-found/__next._not-found.txt +1 -1
- package/out/_not-found/__next._tree.txt +1 -1
- package/out/_not-found.html +1 -1
- package/out/_not-found.txt +1 -1
- package/out/index.html +2 -2
- package/out/index.txt +2 -2
- package/package.json +1 -1
- /package/out/_next/static/{wFX9tOZWtEdER7XrtbgHQ → EFK7prtbW4K3cbFdFFkDA}/_buildManifest.js +0 -0
- /package/out/_next/static/{wFX9tOZWtEdER7XrtbgHQ → EFK7prtbW4K3cbFdFFkDA}/_clientMiddlewareManifest.json +0 -0
- /package/out/_next/static/{wFX9tOZWtEdER7XrtbgHQ → EFK7prtbW4K3cbFdFFkDA}/_ssgManifest.js +0 -0
package/dist/compiler.js
CHANGED
|
@@ -227,25 +227,32 @@ function detectCycles(nodes, edges) {
|
|
|
227
227
|
for (const node of nodes) {
|
|
228
228
|
color.set(node.id, WHITE);
|
|
229
229
|
}
|
|
230
|
-
|
|
231
|
-
color.
|
|
232
|
-
|
|
230
|
+
for (const node of nodes) {
|
|
231
|
+
if (color.get(node.id) !== WHITE) continue;
|
|
232
|
+
const stack = [[node.id, 0]];
|
|
233
|
+
color.set(node.id, GRAY);
|
|
234
|
+
while (stack.length > 0) {
|
|
235
|
+
const top = stack[stack.length - 1];
|
|
236
|
+
const [currentId, idx] = top;
|
|
237
|
+
const neighbors = adjacency.get(currentId) ?? [];
|
|
238
|
+
if (idx >= neighbors.length) {
|
|
239
|
+
color.set(currentId, BLACK);
|
|
240
|
+
stack.pop();
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
top[1] = idx + 1;
|
|
244
|
+
const neighbor = neighbors[idx];
|
|
233
245
|
if (color.get(neighbor) === GRAY) {
|
|
234
246
|
errors.push({
|
|
235
247
|
code: "CYCLE_DETECTED",
|
|
236
|
-
message: `Cycle detected: node "${
|
|
237
|
-
nodeId
|
|
248
|
+
message: `Cycle detected: node "${currentId}" \u2192 "${neighbor}"`,
|
|
249
|
+
nodeId: currentId
|
|
238
250
|
});
|
|
239
251
|
} else if (color.get(neighbor) === WHITE) {
|
|
240
|
-
|
|
252
|
+
color.set(neighbor, GRAY);
|
|
253
|
+
stack.push([neighbor, 0]);
|
|
241
254
|
}
|
|
242
255
|
}
|
|
243
|
-
color.set(nodeId, BLACK);
|
|
244
|
-
}
|
|
245
|
-
for (const node of nodes) {
|
|
246
|
-
if (color.get(node.id) === WHITE) {
|
|
247
|
-
dfs(node.id);
|
|
248
|
-
}
|
|
249
256
|
}
|
|
250
257
|
return errors;
|
|
251
258
|
}
|
|
@@ -447,10 +454,16 @@ function resolveInputRef(path, context) {
|
|
|
447
454
|
const incoming = context.ir.edges.filter(
|
|
448
455
|
(e) => e.targetNodeId === context.currentNodeId
|
|
449
456
|
);
|
|
450
|
-
const
|
|
457
|
+
const nonTriggerIncoming = incoming.filter((e) => {
|
|
451
458
|
const src = context.nodeMap.get(e.sourceNodeId);
|
|
452
459
|
return src && src.category !== "trigger" /* TRIGGER */;
|
|
453
|
-
})
|
|
460
|
+
});
|
|
461
|
+
if (nonTriggerIncoming.length > 1 && typeof console !== "undefined") {
|
|
462
|
+
console.warn(
|
|
463
|
+
`[flow2code] $input is ambiguous: node "${context.currentNodeId}" has ${nonTriggerIncoming.length} non-trigger upstream edges. Using first match "${nonTriggerIncoming[0].sourceNodeId}".`
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
const dataSource = nonTriggerIncoming[0] || incoming[0];
|
|
454
467
|
if (dataSource) {
|
|
455
468
|
const srcId = dataSource.sourceNodeId;
|
|
456
469
|
if (context.blockScopedNodeIds?.has(srcId)) {
|
|
@@ -465,15 +478,21 @@ function resolveInputRef(path, context) {
|
|
|
465
478
|
`Expression parser error: Node "${context.currentNodeId}" has no input connected`
|
|
466
479
|
);
|
|
467
480
|
}
|
|
481
|
+
var _cachedTriggerIR = null;
|
|
482
|
+
var _cachedTriggerId = null;
|
|
468
483
|
function resolveTriggerRef(path, context) {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
484
|
+
if (_cachedTriggerIR !== context.ir) {
|
|
485
|
+
_cachedTriggerIR = context.ir;
|
|
486
|
+
const trigger = context.ir.nodes.find(
|
|
487
|
+
(n) => n.category === "trigger" /* TRIGGER */
|
|
488
|
+
);
|
|
489
|
+
_cachedTriggerId = trigger?.id ?? null;
|
|
490
|
+
}
|
|
491
|
+
if (_cachedTriggerId) {
|
|
492
|
+
if (context.symbolTable?.hasVar(_cachedTriggerId)) {
|
|
493
|
+
return `${context.symbolTable.getVarName(_cachedTriggerId)}${path}`;
|
|
475
494
|
}
|
|
476
|
-
return `flowState['${
|
|
495
|
+
return `flowState['${_cachedTriggerId}']${path}`;
|
|
477
496
|
}
|
|
478
497
|
return "undefined";
|
|
479
498
|
}
|
|
@@ -1794,10 +1813,18 @@ function compile(ir, options) {
|
|
|
1794
1813
|
dagMode: false,
|
|
1795
1814
|
symbolTableExclusions: /* @__PURE__ */ new Set(),
|
|
1796
1815
|
generatedBlockNodeIds: /* @__PURE__ */ new Set(),
|
|
1797
|
-
pluginRegistry
|
|
1816
|
+
pluginRegistry,
|
|
1817
|
+
edgeSuccessors: (() => {
|
|
1818
|
+
const map = /* @__PURE__ */ new Map();
|
|
1819
|
+
for (const edge of workingIR.edges) {
|
|
1820
|
+
if (!map.has(edge.sourceNodeId)) map.set(edge.sourceNodeId, []);
|
|
1821
|
+
map.get(edge.sourceNodeId).push(edge.targetNodeId);
|
|
1822
|
+
}
|
|
1823
|
+
return map;
|
|
1824
|
+
})()
|
|
1798
1825
|
};
|
|
1799
1826
|
const trigger = workingIR.nodes.find((n) => n.category === "trigger" /* TRIGGER */);
|
|
1800
|
-
const preComputedBlockNodes = computeControlFlowDescendants(workingIR, trigger.id);
|
|
1827
|
+
const preComputedBlockNodes = computeControlFlowDescendants(workingIR, trigger.id, nodeMap);
|
|
1801
1828
|
for (const nodeId of preComputedBlockNodes) {
|
|
1802
1829
|
context.childBlockNodeIds.add(nodeId);
|
|
1803
1830
|
context.symbolTableExclusions.add(nodeId);
|
|
@@ -1882,8 +1909,7 @@ function isControlFlowEdge(edge, nodeMap) {
|
|
|
1882
1909
|
const controlPorts = CONTROL_FLOW_PORT_MAP[sourceNode.nodeType];
|
|
1883
1910
|
return controlPorts !== void 0 && controlPorts.has(edge.sourcePortId);
|
|
1884
1911
|
}
|
|
1885
|
-
function computeControlFlowDescendants(ir, triggerId) {
|
|
1886
|
-
const nodeMap = new Map(ir.nodes.map((n) => [n.id, n]));
|
|
1912
|
+
function computeControlFlowDescendants(ir, triggerId, nodeMap) {
|
|
1887
1913
|
const strippedSuccessors = /* @__PURE__ */ new Map();
|
|
1888
1914
|
for (const node of ir.nodes) {
|
|
1889
1915
|
strippedSuccessors.set(node.id, /* @__PURE__ */ new Set());
|
|
@@ -1916,13 +1942,7 @@ function computeControlFlowDescendants(ir, triggerId) {
|
|
|
1916
1942
|
function generateBlockContinuation(writer, fromNodeId, context) {
|
|
1917
1943
|
const reachable = /* @__PURE__ */ new Set();
|
|
1918
1944
|
const bfsQueue = [fromNodeId];
|
|
1919
|
-
const edgeSuccessors =
|
|
1920
|
-
for (const edge of context.ir.edges) {
|
|
1921
|
-
if (!edgeSuccessors.has(edge.sourceNodeId)) {
|
|
1922
|
-
edgeSuccessors.set(edge.sourceNodeId, []);
|
|
1923
|
-
}
|
|
1924
|
-
edgeSuccessors.get(edge.sourceNodeId).push(edge.targetNodeId);
|
|
1925
|
-
}
|
|
1945
|
+
const edgeSuccessors = context.edgeSuccessors;
|
|
1926
1946
|
while (bfsQueue.length > 0) {
|
|
1927
1947
|
const id = bfsQueue.shift();
|
|
1928
1948
|
if (reachable.has(id)) continue;
|
|
@@ -2754,7 +2774,10 @@ function processForInStatement(stmt, _prevNodeId, ctx, line) {
|
|
|
2754
2774
|
}
|
|
2755
2775
|
function processForStatement(stmt, _prevNodeId, ctx, line) {
|
|
2756
2776
|
const nodeId = ctx.nextId("loop");
|
|
2757
|
-
const
|
|
2777
|
+
const initText = stmt.getInitializer()?.getText() ?? "";
|
|
2778
|
+
const condText = stmt.getCondition()?.getText() ?? "";
|
|
2779
|
+
const incrText = stmt.getIncrementor()?.getText() ?? "";
|
|
2780
|
+
const fullText = `for (${initText}; ${condText}; ${incrText})`;
|
|
2758
2781
|
ctx.addNode({
|
|
2759
2782
|
id: nodeId,
|
|
2760
2783
|
nodeType: "for_loop" /* FOR_LOOP */,
|
|
@@ -2973,12 +2996,18 @@ function computeAuditHints(ctx) {
|
|
|
2973
2996
|
return hints;
|
|
2974
2997
|
}
|
|
2975
2998
|
function isFetchCall(node) {
|
|
2976
|
-
|
|
2977
|
-
|
|
2999
|
+
if (node.getKind() === SyntaxKind.CallExpression) {
|
|
3000
|
+
const expr = node.getExpression();
|
|
3001
|
+
if (expr.getKind() === SyntaxKind.Identifier && expr.getText() === "fetch") return true;
|
|
3002
|
+
}
|
|
3003
|
+
if (node.getKind() === SyntaxKind.AwaitExpression) {
|
|
3004
|
+
return isFetchCall(node.getChildAtIndex(1) ?? node);
|
|
3005
|
+
}
|
|
3006
|
+
return node.forEachChild((child) => isFetchCall(child) || void 0) ?? false;
|
|
2978
3007
|
}
|
|
2979
3008
|
function hasAwaitExpression(node) {
|
|
2980
3009
|
if (node.getKind() === SyntaxKind.AwaitExpression) return true;
|
|
2981
|
-
return node.
|
|
3010
|
+
return node.forEachChild((child) => hasAwaitExpression(child) || void 0) ?? false;
|
|
2982
3011
|
}
|
|
2983
3012
|
function extractAwaitedExpression(node) {
|
|
2984
3013
|
const text = node.getText();
|
|
@@ -3048,7 +3077,8 @@ function inferLabel(code, varName) {
|
|
|
3048
3077
|
return truncate2(code, 30);
|
|
3049
3078
|
}
|
|
3050
3079
|
function trackVariableUses(nodeId, expression, ctx) {
|
|
3051
|
-
const
|
|
3080
|
+
const stripped = expression.replace(/(["'`])(?:(?!\1|\\).|\\.)*\1/g, "");
|
|
3081
|
+
const identifiers = stripped.match(/\b([a-zA-Z_]\w*)\b/g);
|
|
3052
3082
|
if (!identifiers) return;
|
|
3053
3083
|
const uses = [];
|
|
3054
3084
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -3703,6 +3733,7 @@ function sanitizeFilename(id) {
|
|
|
3703
3733
|
|
|
3704
3734
|
// src/lib/storage/flow-project.ts
|
|
3705
3735
|
import { readFileSync, writeFileSync, mkdirSync, existsSync, readdirSync, rmSync, statSync } from "fs";
|
|
3736
|
+
import { readFile, readdir } from "fs/promises";
|
|
3706
3737
|
import { join, dirname } from "path";
|
|
3707
3738
|
function detectFormat(inputPath) {
|
|
3708
3739
|
if (inputPath.endsWith(".flow.json") && existsSync(inputPath)) {
|
package/dist/server.js
CHANGED
|
@@ -198,25 +198,32 @@ function detectCycles(nodes, edges) {
|
|
|
198
198
|
for (const node of nodes) {
|
|
199
199
|
color.set(node.id, WHITE);
|
|
200
200
|
}
|
|
201
|
-
|
|
202
|
-
color.
|
|
203
|
-
|
|
201
|
+
for (const node of nodes) {
|
|
202
|
+
if (color.get(node.id) !== WHITE) continue;
|
|
203
|
+
const stack = [[node.id, 0]];
|
|
204
|
+
color.set(node.id, GRAY);
|
|
205
|
+
while (stack.length > 0) {
|
|
206
|
+
const top = stack[stack.length - 1];
|
|
207
|
+
const [currentId, idx] = top;
|
|
208
|
+
const neighbors = adjacency.get(currentId) ?? [];
|
|
209
|
+
if (idx >= neighbors.length) {
|
|
210
|
+
color.set(currentId, BLACK);
|
|
211
|
+
stack.pop();
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
top[1] = idx + 1;
|
|
215
|
+
const neighbor = neighbors[idx];
|
|
204
216
|
if (color.get(neighbor) === GRAY) {
|
|
205
217
|
errors.push({
|
|
206
218
|
code: "CYCLE_DETECTED",
|
|
207
|
-
message: `Cycle detected: node "${
|
|
208
|
-
nodeId
|
|
219
|
+
message: `Cycle detected: node "${currentId}" \u2192 "${neighbor}"`,
|
|
220
|
+
nodeId: currentId
|
|
209
221
|
});
|
|
210
222
|
} else if (color.get(neighbor) === WHITE) {
|
|
211
|
-
|
|
223
|
+
color.set(neighbor, GRAY);
|
|
224
|
+
stack.push([neighbor, 0]);
|
|
212
225
|
}
|
|
213
226
|
}
|
|
214
|
-
color.set(nodeId, BLACK);
|
|
215
|
-
}
|
|
216
|
-
for (const node of nodes) {
|
|
217
|
-
if (color.get(node.id) === WHITE) {
|
|
218
|
-
dfs(node.id);
|
|
219
|
-
}
|
|
220
227
|
}
|
|
221
228
|
return errors;
|
|
222
229
|
}
|
|
@@ -418,10 +425,16 @@ function resolveInputRef(path, context) {
|
|
|
418
425
|
const incoming = context.ir.edges.filter(
|
|
419
426
|
(e) => e.targetNodeId === context.currentNodeId
|
|
420
427
|
);
|
|
421
|
-
const
|
|
428
|
+
const nonTriggerIncoming = incoming.filter((e) => {
|
|
422
429
|
const src = context.nodeMap.get(e.sourceNodeId);
|
|
423
430
|
return src && src.category !== "trigger" /* TRIGGER */;
|
|
424
|
-
})
|
|
431
|
+
});
|
|
432
|
+
if (nonTriggerIncoming.length > 1 && typeof console !== "undefined") {
|
|
433
|
+
console.warn(
|
|
434
|
+
`[flow2code] $input is ambiguous: node "${context.currentNodeId}" has ${nonTriggerIncoming.length} non-trigger upstream edges. Using first match "${nonTriggerIncoming[0].sourceNodeId}".`
|
|
435
|
+
);
|
|
436
|
+
}
|
|
437
|
+
const dataSource = nonTriggerIncoming[0] || incoming[0];
|
|
425
438
|
if (dataSource) {
|
|
426
439
|
const srcId = dataSource.sourceNodeId;
|
|
427
440
|
if (context.blockScopedNodeIds?.has(srcId)) {
|
|
@@ -436,15 +449,21 @@ function resolveInputRef(path, context) {
|
|
|
436
449
|
`Expression parser error: Node "${context.currentNodeId}" has no input connected`
|
|
437
450
|
);
|
|
438
451
|
}
|
|
452
|
+
var _cachedTriggerIR = null;
|
|
453
|
+
var _cachedTriggerId = null;
|
|
439
454
|
function resolveTriggerRef(path, context) {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
455
|
+
if (_cachedTriggerIR !== context.ir) {
|
|
456
|
+
_cachedTriggerIR = context.ir;
|
|
457
|
+
const trigger = context.ir.nodes.find(
|
|
458
|
+
(n) => n.category === "trigger" /* TRIGGER */
|
|
459
|
+
);
|
|
460
|
+
_cachedTriggerId = trigger?.id ?? null;
|
|
461
|
+
}
|
|
462
|
+
if (_cachedTriggerId) {
|
|
463
|
+
if (context.symbolTable?.hasVar(_cachedTriggerId)) {
|
|
464
|
+
return `${context.symbolTable.getVarName(_cachedTriggerId)}${path}`;
|
|
446
465
|
}
|
|
447
|
-
return `flowState['${
|
|
466
|
+
return `flowState['${_cachedTriggerId}']${path}`;
|
|
448
467
|
}
|
|
449
468
|
return "undefined";
|
|
450
469
|
}
|
|
@@ -1747,10 +1766,18 @@ function compile(ir, options) {
|
|
|
1747
1766
|
dagMode: false,
|
|
1748
1767
|
symbolTableExclusions: /* @__PURE__ */ new Set(),
|
|
1749
1768
|
generatedBlockNodeIds: /* @__PURE__ */ new Set(),
|
|
1750
|
-
pluginRegistry
|
|
1769
|
+
pluginRegistry,
|
|
1770
|
+
edgeSuccessors: (() => {
|
|
1771
|
+
const map = /* @__PURE__ */ new Map();
|
|
1772
|
+
for (const edge of workingIR.edges) {
|
|
1773
|
+
if (!map.has(edge.sourceNodeId)) map.set(edge.sourceNodeId, []);
|
|
1774
|
+
map.get(edge.sourceNodeId).push(edge.targetNodeId);
|
|
1775
|
+
}
|
|
1776
|
+
return map;
|
|
1777
|
+
})()
|
|
1751
1778
|
};
|
|
1752
1779
|
const trigger = workingIR.nodes.find((n) => n.category === "trigger" /* TRIGGER */);
|
|
1753
|
-
const preComputedBlockNodes = computeControlFlowDescendants(workingIR, trigger.id);
|
|
1780
|
+
const preComputedBlockNodes = computeControlFlowDescendants(workingIR, trigger.id, nodeMap);
|
|
1754
1781
|
for (const nodeId of preComputedBlockNodes) {
|
|
1755
1782
|
context.childBlockNodeIds.add(nodeId);
|
|
1756
1783
|
context.symbolTableExclusions.add(nodeId);
|
|
@@ -1835,8 +1862,7 @@ function isControlFlowEdge(edge, nodeMap) {
|
|
|
1835
1862
|
const controlPorts = CONTROL_FLOW_PORT_MAP[sourceNode.nodeType];
|
|
1836
1863
|
return controlPorts !== void 0 && controlPorts.has(edge.sourcePortId);
|
|
1837
1864
|
}
|
|
1838
|
-
function computeControlFlowDescendants(ir, triggerId) {
|
|
1839
|
-
const nodeMap = new Map(ir.nodes.map((n) => [n.id, n]));
|
|
1865
|
+
function computeControlFlowDescendants(ir, triggerId, nodeMap) {
|
|
1840
1866
|
const strippedSuccessors = /* @__PURE__ */ new Map();
|
|
1841
1867
|
for (const node of ir.nodes) {
|
|
1842
1868
|
strippedSuccessors.set(node.id, /* @__PURE__ */ new Set());
|
|
@@ -1869,13 +1895,7 @@ function computeControlFlowDescendants(ir, triggerId) {
|
|
|
1869
1895
|
function generateBlockContinuation(writer, fromNodeId, context) {
|
|
1870
1896
|
const reachable = /* @__PURE__ */ new Set();
|
|
1871
1897
|
const bfsQueue = [fromNodeId];
|
|
1872
|
-
const edgeSuccessors =
|
|
1873
|
-
for (const edge of context.ir.edges) {
|
|
1874
|
-
if (!edgeSuccessors.has(edge.sourceNodeId)) {
|
|
1875
|
-
edgeSuccessors.set(edge.sourceNodeId, []);
|
|
1876
|
-
}
|
|
1877
|
-
edgeSuccessors.get(edge.sourceNodeId).push(edge.targetNodeId);
|
|
1878
|
-
}
|
|
1898
|
+
const edgeSuccessors = context.edgeSuccessors;
|
|
1879
1899
|
while (bfsQueue.length > 0) {
|
|
1880
1900
|
const id = bfsQueue.shift();
|
|
1881
1901
|
if (reachable.has(id)) continue;
|
|
@@ -2567,7 +2587,10 @@ function processForInStatement(stmt, _prevNodeId, ctx, line) {
|
|
|
2567
2587
|
}
|
|
2568
2588
|
function processForStatement(stmt, _prevNodeId, ctx, line) {
|
|
2569
2589
|
const nodeId = ctx.nextId("loop");
|
|
2570
|
-
const
|
|
2590
|
+
const initText = stmt.getInitializer()?.getText() ?? "";
|
|
2591
|
+
const condText = stmt.getCondition()?.getText() ?? "";
|
|
2592
|
+
const incrText = stmt.getIncrementor()?.getText() ?? "";
|
|
2593
|
+
const fullText = `for (${initText}; ${condText}; ${incrText})`;
|
|
2571
2594
|
ctx.addNode({
|
|
2572
2595
|
id: nodeId,
|
|
2573
2596
|
nodeType: "for_loop" /* FOR_LOOP */,
|
|
@@ -2786,12 +2809,18 @@ function computeAuditHints(ctx) {
|
|
|
2786
2809
|
return hints;
|
|
2787
2810
|
}
|
|
2788
2811
|
function isFetchCall(node) {
|
|
2789
|
-
|
|
2790
|
-
|
|
2812
|
+
if (node.getKind() === SyntaxKind.CallExpression) {
|
|
2813
|
+
const expr = node.getExpression();
|
|
2814
|
+
if (expr.getKind() === SyntaxKind.Identifier && expr.getText() === "fetch") return true;
|
|
2815
|
+
}
|
|
2816
|
+
if (node.getKind() === SyntaxKind.AwaitExpression) {
|
|
2817
|
+
return isFetchCall(node.getChildAtIndex(1) ?? node);
|
|
2818
|
+
}
|
|
2819
|
+
return node.forEachChild((child) => isFetchCall(child) || void 0) ?? false;
|
|
2791
2820
|
}
|
|
2792
2821
|
function hasAwaitExpression(node) {
|
|
2793
2822
|
if (node.getKind() === SyntaxKind.AwaitExpression) return true;
|
|
2794
|
-
return node.
|
|
2823
|
+
return node.forEachChild((child) => hasAwaitExpression(child) || void 0) ?? false;
|
|
2795
2824
|
}
|
|
2796
2825
|
function extractAwaitedExpression(node) {
|
|
2797
2826
|
const text = node.getText();
|
|
@@ -2861,7 +2890,8 @@ function inferLabel(code, varName) {
|
|
|
2861
2890
|
return truncate(code, 30);
|
|
2862
2891
|
}
|
|
2863
2892
|
function trackVariableUses(nodeId, expression, ctx) {
|
|
2864
|
-
const
|
|
2893
|
+
const stripped = expression.replace(/(["'`])(?:(?!\1|\\).|\\.)*\1/g, "");
|
|
2894
|
+
const identifiers = stripped.match(/\b([a-zA-Z_]\w*)\b/g);
|
|
2865
2895
|
if (!identifiers) return;
|
|
2866
2896
|
const uses = [];
|
|
2867
2897
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -3642,6 +3672,13 @@ function handleImportOpenAPI(body) {
|
|
|
3642
3672
|
(flow) => paths.some((p) => flow.meta.name.includes(p))
|
|
3643
3673
|
);
|
|
3644
3674
|
}
|
|
3675
|
+
if (body.filter?.tags && Array.isArray(body.filter.tags)) {
|
|
3676
|
+
const tags = body.filter.tags.map((t) => t.toLowerCase());
|
|
3677
|
+
filteredFlows = filteredFlows.filter((flow) => {
|
|
3678
|
+
const flowTags = flow.meta.tags ?? [];
|
|
3679
|
+
return flowTags.some((t) => tags.includes(t.toLowerCase()));
|
|
3680
|
+
});
|
|
3681
|
+
}
|
|
3645
3682
|
return {
|
|
3646
3683
|
status: 200,
|
|
3647
3684
|
body: {
|
|
@@ -3960,10 +3997,14 @@ function startServer(options = {}) {
|
|
|
3960
3997
|
const server = createServer((req, res) => {
|
|
3961
3998
|
handleRequest(req, res, staticDir, projectRoot).catch((err) => {
|
|
3962
3999
|
logger.error("Internal error:", err);
|
|
3963
|
-
res.
|
|
3964
|
-
|
|
4000
|
+
if (!res.headersSent) {
|
|
4001
|
+
res.writeHead(500, { "Content-Type": "text/plain" });
|
|
4002
|
+
res.end("Internal Server Error");
|
|
4003
|
+
}
|
|
3965
4004
|
});
|
|
3966
4005
|
});
|
|
4006
|
+
server.headersTimeout = 3e4;
|
|
4007
|
+
server.requestTimeout = 6e4;
|
|
3967
4008
|
const hasUI = existsSync2(join2(staticDir, "index.html"));
|
|
3968
4009
|
server.listen(port, host, () => {
|
|
3969
4010
|
const url = `http://localhost:${port}`;
|
package/out/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--EFK7prtbW4K3cbFdFFkDA--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/83ab8820627f8bfe.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/b6e8711267bccbbd.js"/><script src="/_next/static/chunks/fbca595129527827.js" async=""></script><script src="/_next/static/chunks/ab8888d4b78b94be.js" async=""></script><script src="/_next/static/chunks/turbopack-576234c945ffdc44.js" async=""></script><script src="/_next/static/chunks/acf223168ac429f7.js" async=""></script><script src="/_next/static/chunks/b163b5d7cccbcf42.js" async=""></script><script src="/_next/static/chunks/6b84376656bd9887.js" async=""></script><script src="/_next/static/chunks/b112c2f519e4b429.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Flow2Code | Visual AST Compiler</title><meta name="description" content="Visual backend logic generator: compile canvas nodes directly into native TypeScript code"/><link rel="manifest" href="/site.webmanifest"/><link rel="icon" href="/favicon.ico" sizes="any"/><link rel="icon" href="/favicon-16x16.png" sizes="16x16" type="image/png"/><link rel="icon" href="/favicon-32x32.png" sizes="32x32" type="image/png"/><link rel="apple-touch-icon" href="/apple-touch-icon.png"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body class="antialiased overflow-hidden"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/b6e8711267bccbbd.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[46798,[\"/_next/static/chunks/acf223168ac429f7.js\"],\"TooltipProvider\"]\n3:I[95731,[\"/_next/static/chunks/b163b5d7cccbcf42.js\",\"/_next/static/chunks/6b84376656bd9887.js\"],\"default\"]\n4:I[58298,[\"/_next/static/chunks/acf223168ac429f7.js\",\"/_next/static/chunks/b112c2f519e4b429.js\"],\"default\"]\n5:I[32294,[\"/_next/static/chunks/b163b5d7cccbcf42.js\",\"/_next/static/chunks/6b84376656bd9887.js\"],\"default\"]\n6:I[5806,[\"/_next/static/chunks/b163b5d7cccbcf42.js\",\"/_next/static/chunks/6b84376656bd9887.js\"],\"OutletBoundary\"]\n7:\"$Sreact.suspense\"\n9:I[5806,[\"/_next/static/chunks/b163b5d7cccbcf42.js\",\"/_next/static/chunks/6b84376656bd9887.js\"],\"ViewportBoundary\"]\nb:I[5806,[\"/_next/static/chunks/b163b5d7cccbcf42.js\",\"/_next/static/chunks/6b84376656bd9887.js\"],\"MetadataBoundary\"]\nd:I[63491,[\"/_next/static/chunks/b163b5d7cccbcf42.js\",\"/_next/static/chunks/6b84376656bd9887.js\"],\"default\"]\n:HL[\"/_next/static/chunks/83ab8820627f8bfe.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"EFK7prtbW4K3cbFdFFkDA\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/83ab8820627f8bfe.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/acf223168ac429f7.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"antialiased overflow-hidden\",\"children\":[\"$\",\"$L2\",null,{\"delayDuration\":200,\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$4\",\"errorStyles\":[],\"errorScripts\":[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/b112c2f519e4b429.js\",\"async\":true}]],\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@8\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L9\",null,{\"children\":\"$La\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lb\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lc\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$d\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"e:I[22192,[\"/_next/static/chunks/b163b5d7cccbcf42.js\",\"/_next/static/chunks/6b84376656bd9887.js\"],\"IconMark\"]\n8:null\nc:[[\"$\",\"title\",\"0\",{\"children\":\"Flow2Code | Visual AST Compiler\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visual backend logic generator: compile canvas nodes directly into native TypeScript code\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/site.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"3\",{\"rel\":\"icon\",\"href\":\"/favicon.ico\",\"sizes\":\"any\"}],[\"$\",\"link\",\"4\",{\"rel\":\"icon\",\"href\":\"/favicon-16x16.png\",\"sizes\":\"16x16\",\"type\":\"image/png\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"/favicon-32x32.png\",\"sizes\":\"32x32\",\"type\":\"image/png\"}],[\"$\",\"link\",\"6\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-touch-icon.png\"}],[\"$\",\"$Le\",\"7\",{}]]\n"])</script></body></html>
|
package/out/__next.__PAGE__.txt
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
2
|
2:I[55026,["/_next/static/chunks/b163b5d7cccbcf42.js","/_next/static/chunks/6b84376656bd9887.js"],"ClientPageRoot"]
|
|
3
|
-
3:I[52683,["/_next/static/chunks/acf223168ac429f7.js","/_next/static/chunks/
|
|
3
|
+
3:I[52683,["/_next/static/chunks/acf223168ac429f7.js","/_next/static/chunks/06054f68c210e89c.js","/_next/static/chunks/0bc0a50347ee5f3c.js"],"default"]
|
|
4
4
|
6:I[5806,["/_next/static/chunks/b163b5d7cccbcf42.js","/_next/static/chunks/6b84376656bd9887.js"],"OutletBoundary"]
|
|
5
5
|
7:"$Sreact.suspense"
|
|
6
6
|
:HL["/_next/static/chunks/8a5bd6fe3abc8091.css","style"]
|
|
7
|
-
0:{"buildId":"
|
|
7
|
+
0:{"buildId":"EFK7prtbW4K3cbFdFFkDA","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/8a5bd6fe3abc8091.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/06054f68c210e89c.js","async":true}],["$","script","script-1",{"src":"/_next/static/chunks/0bc0a50347ee5f3c.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false}
|
|
8
8
|
4:{}
|
|
9
9
|
5:"$0:rsc:props:children:0:props:serverProvidedParams:params"
|
|
10
10
|
8:null
|
package/out/__next._full.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
4:I[58298,["/_next/static/chunks/acf223168ac429f7.js","/_next/static/chunks/b112c2f519e4b429.js"],"default"]
|
|
5
5
|
5:I[32294,["/_next/static/chunks/b163b5d7cccbcf42.js","/_next/static/chunks/6b84376656bd9887.js"],"default"]
|
|
6
6
|
6:I[55026,["/_next/static/chunks/b163b5d7cccbcf42.js","/_next/static/chunks/6b84376656bd9887.js"],"ClientPageRoot"]
|
|
7
|
-
7:I[52683,["/_next/static/chunks/acf223168ac429f7.js","/_next/static/chunks/
|
|
7
|
+
7:I[52683,["/_next/static/chunks/acf223168ac429f7.js","/_next/static/chunks/06054f68c210e89c.js","/_next/static/chunks/0bc0a50347ee5f3c.js"],"default"]
|
|
8
8
|
a:I[5806,["/_next/static/chunks/b163b5d7cccbcf42.js","/_next/static/chunks/6b84376656bd9887.js"],"OutletBoundary"]
|
|
9
9
|
b:"$Sreact.suspense"
|
|
10
10
|
d:I[5806,["/_next/static/chunks/b163b5d7cccbcf42.js","/_next/static/chunks/6b84376656bd9887.js"],"ViewportBoundary"]
|
|
@@ -12,7 +12,7 @@ f:I[5806,["/_next/static/chunks/b163b5d7cccbcf42.js","/_next/static/chunks/6b843
|
|
|
12
12
|
11:I[63491,["/_next/static/chunks/b163b5d7cccbcf42.js","/_next/static/chunks/6b84376656bd9887.js"],"default"]
|
|
13
13
|
:HL["/_next/static/chunks/83ab8820627f8bfe.css","style"]
|
|
14
14
|
:HL["/_next/static/chunks/8a5bd6fe3abc8091.css","style"]
|
|
15
|
-
0:{"P":null,"b":"
|
|
15
|
+
0:{"P":null,"b":"EFK7prtbW4K3cbFdFFkDA","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/83ab8820627f8bfe.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/acf223168ac429f7.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"antialiased overflow-hidden","children":["$","$L2",null,{"delayDuration":200,"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$4","errorStyles":[],"errorScripts":[["$","script","script-0",{"src":"/_next/static/chunks/b112c2f519e4b429.js","async":true}]],"template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L6",null,{"Component":"$7","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@8","$@9"]}}],[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/8a5bd6fe3abc8091.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/06054f68c210e89c.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/0bc0a50347ee5f3c.js","async":true,"nonce":"$undefined"}]],["$","$La",null,{"children":["$","$b",null,{"name":"Next.MetadataOutlet","children":"$@c"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Ld",null,{"children":"$Le"}],["$","div",null,{"hidden":true,"children":["$","$Lf",null,{"children":["$","$b",null,{"name":"Next.Metadata","children":"$L10"}]}]}],null]}],false]],"m":"$undefined","G":["$11",[]],"S":true}
|
|
16
16
|
8:{}
|
|
17
17
|
9:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params"
|
|
18
18
|
e:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
|
package/out/__next._head.txt
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
3:I[5806,["/_next/static/chunks/b163b5d7cccbcf42.js","/_next/static/chunks/6b84376656bd9887.js"],"MetadataBoundary"]
|
|
4
4
|
4:"$Sreact.suspense"
|
|
5
5
|
5:I[22192,["/_next/static/chunks/b163b5d7cccbcf42.js","/_next/static/chunks/6b84376656bd9887.js"],"IconMark"]
|
|
6
|
-
0:{"buildId":"
|
|
6
|
+
0:{"buildId":"EFK7prtbW4K3cbFdFFkDA","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Flow2Code | Visual AST Compiler"}],["$","meta","1",{"name":"description","content":"Visual backend logic generator: compile canvas nodes directly into native TypeScript code"}],["$","link","2",{"rel":"manifest","href":"/site.webmanifest"}],["$","link","3",{"rel":"icon","href":"/favicon.ico","sizes":"any"}],["$","link","4",{"rel":"icon","href":"/favicon-16x16.png","sizes":"16x16","type":"image/png"}],["$","link","5",{"rel":"icon","href":"/favicon-32x32.png","sizes":"32x32","type":"image/png"}],["$","link","6",{"rel":"apple-touch-icon","href":"/apple-touch-icon.png"}],["$","$L5","7",{}]]}]}]}],null]}],"loading":null,"isPartial":false}
|
package/out/__next._index.txt
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
4:I[58298,["/_next/static/chunks/acf223168ac429f7.js","/_next/static/chunks/b112c2f519e4b429.js"],"default"]
|
|
5
5
|
5:I[32294,["/_next/static/chunks/b163b5d7cccbcf42.js","/_next/static/chunks/6b84376656bd9887.js"],"default"]
|
|
6
6
|
:HL["/_next/static/chunks/83ab8820627f8bfe.css","style"]
|
|
7
|
-
0:{"buildId":"
|
|
7
|
+
0:{"buildId":"EFK7prtbW4K3cbFdFFkDA","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/83ab8820627f8bfe.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/acf223168ac429f7.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"antialiased overflow-hidden","children":["$","$L2",null,{"delayDuration":200,"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$4","errorStyles":[],"errorScripts":[["$","script","script-0",{"src":"/_next/static/chunks/b112c2f519e4b429.js","async":true}]],"template":["$","$L5",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false}
|
package/out/__next._tree.txt
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
:HL["/_next/static/chunks/83ab8820627f8bfe.css","style"]
|
|
2
2
|
:HL["/_next/static/chunks/8a5bd6fe3abc8091.css","style"]
|
|
3
|
-
0:{"buildId":"
|
|
3
|
+
0:{"buildId":"EFK7prtbW4K3cbFdFFkDA","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":true},"staleTime":300}
|
|
@@ -122,4 +122,4 @@ Given a user's natural language description of an API endpoint or workflow, gene
|
|
|
122
122
|
|
|
123
123
|
## Output
|
|
124
124
|
Return ONLY valid JSON (no markdown, no explanation). The JSON must conform to the FlowIR schema above.
|
|
125
|
-
`;e.s(["EXAMPLE_PROMPTS",0,["Create a GET /api/users endpoint that fetches the user list from https://jsonplaceholder.typicode.com/users and returns it","Create a POST /api/auth/login endpoint that accepts email and password, validates them, and returns a JWT token","Create a GET /api/weather endpoint that calls a weather API and an air quality API in parallel, then merges and returns the results","Create a POST /api/orders endpoint that accepts order data, writes it to the database, and sends a notification","Create a scheduled task that checks the database for expired orders every hour and updates their status"],"FLOW_IR_SYSTEM_PROMPT",0,t])},94501,68773,e=>{"use strict";let t="1.0.0";var a,r,s,o,n,i,d=((a={}).TRIGGER="trigger",a.ACTION="action",a.LOGIC="logic",a.VARIABLE="variable",a.OUTPUT="output",a),
|
|
125
|
+
`;e.s(["EXAMPLE_PROMPTS",0,["Create a GET /api/users endpoint that fetches the user list from https://jsonplaceholder.typicode.com/users and returns it","Create a POST /api/auth/login endpoint that accepts email and password, validates them, and returns a JWT token","Create a GET /api/weather endpoint that calls a weather API and an air quality API in parallel, then merges and returns the results","Create a POST /api/orders endpoint that accepts order data, writes it to the database, and sends a notification","Create a scheduled task that checks the database for expired orders every hour and updates their status"],"FLOW_IR_SYSTEM_PROMPT",0,t])},94501,68773,e=>{"use strict";let t="1.0.0";var a,r,s,o,n,i,d=((a={}).TRIGGER="trigger",a.ACTION="action",a.LOGIC="logic",a.VARIABLE="variable",a.OUTPUT="output",a),l=((r={}).HTTP_WEBHOOK="http_webhook",r.CRON_JOB="cron_job",r.MANUAL="manual",r),u=((s={}).FETCH_API="fetch_api",s.SQL_QUERY="sql_query",s.REDIS_CACHE="redis_cache",s.CUSTOM_CODE="custom_code",s.CALL_SUBFLOW="call_subflow",s),p=((o={}).IF_ELSE="if_else",o.FOR_LOOP="for_loop",o.TRY_CATCH="try_catch",o.PROMISE_ALL="promise_all",o),c=((n={}).DECLARE="declare",n.TRANSFORM="transform",n),g=((i={}).RETURN_RESPONSE="return_response",i);e.s(["ActionType",()=>u,"CURRENT_IR_VERSION",0,t,"LogicType",()=>p,"NodeCategory",()=>d,"OutputType",()=>g,"TriggerType",()=>l,"VariableType",()=>c],68773);let y=[];class T extends Error{fromVersion;targetVersion;constructor(e,t,a){super(e),this.fromVersion=t,this.targetVersion=a,this.name="MigrationError"}}function m(e){let a,r=[];if(!e||"object"!=typeof e)return{valid:!1,errors:[{code:"INVALID_INPUT",message:"IR input must be a non-null object"}]};if(!Array.isArray(e.nodes))return{valid:!1,errors:[{code:"MISSING_NODES",message:"IR is missing required 'nodes' array"}]};if(!Array.isArray(e.edges))return{valid:!1,errors:[{code:"MISSING_EDGES",message:"IR is missing required 'edges' array"}]};let s=e,o=!1;if(function(e,a=t){return e!==a}(e.version))try{let r=function(e,a=t){let r=[],s={...e};if(s.version===a)return{ir:s,applied:r,migrated:!1};let o=y.length+1,n=0;for(;s.version!==a;){if(n++>o)throw new T(`Migration exceeded max iterations (${o}), possible circular migration`,s.version,a);let e=y.find(e=>e.fromVersion===s.version);if(!e)throw new T(`No migration path found from ${s.version} to ${a}`,s.version,a);s=e.migrate(s),r.push(`${e.fromVersion} → ${e.toVersion}: ${e.description}`)}return{ir:s,applied:r,migrated:!0}}({version:e.version,meta:e.meta,nodes:e.nodes,edges:e.edges},t);r.migrated&&(s=r.ir,o=!0,a=r.applied)}catch(t){t instanceof T?r.push({code:"MIGRATION_FAILED",message:`IR version migration failed: ${t.message}`}):r.push({code:"INVALID_VERSION",message:`Unsupported IR version: ${e.version}`})}o||s.version===t||r.push({code:"INVALID_VERSION",message:`Unsupported IR version: ${s.version} (current: ${t})`});let n=new Map(s.nodes.map(e=>[e.id,e])),i=s.nodes.filter(e=>e.category===d.TRIGGER);0===i.length&&r.push({code:"NO_TRIGGER",message:"Workflow must contain at least one trigger node"}),i.length>1&&r.push({code:"MULTIPLE_TRIGGERS",message:`Workflow must have exactly one trigger, found ${i.length}`});let l=new Set;for(let e of s.nodes)l.has(e.id)&&r.push({code:"DUPLICATE_NODE_ID",message:`Duplicate node ID: ${e.id}`,nodeId:e.id}),l.add(e.id);for(let e of s.edges)n.has(e.sourceNodeId)||r.push({code:"INVALID_EDGE_SOURCE",message:`Edge "${e.id}" references non-existent source node "${e.sourceNodeId}"`,edgeId:e.id}),n.has(e.targetNodeId)||r.push({code:"INVALID_EDGE_TARGET",message:`Edge "${e.id}" references non-existent target node "${e.targetNodeId}"`,edgeId:e.id});let u=function(e,t){let a=[],r=new Map;for(let t of e)r.set(t.id,[]);for(let e of t)r.get(e.sourceNodeId)?.push(e.targetNodeId);let s=new Map;for(let t of e)s.set(t.id,0);for(let t of e){if(0!==s.get(t.id))continue;let e=[[t.id,0]];for(s.set(t.id,1);e.length>0;){let t=e[e.length-1],[o,n]=t,i=r.get(o)??[];if(n>=i.length){s.set(o,2),e.pop();continue}t[1]=n+1;let d=i[n];1===s.get(d)?a.push({code:"CYCLE_DETECTED",message:`Cycle detected: node "${o}" → "${d}"`,nodeId:o}):0===s.get(d)&&(s.set(d,1),e.push([d,0]))}}return a}(s.nodes,s.edges);r.push(...u);let p=new Set;for(let e of s.edges)p.add(e.sourceNodeId),p.add(e.targetNodeId);for(let e of s.nodes)e.category===d.TRIGGER||p.has(e.id)||r.push({code:"ORPHAN_NODE",message:`Node "${e.id}" (${e.label}) is not connected to any other node`,nodeId:e.id});return{valid:0===r.length,errors:r,migrated:o,migratedIR:o?s:void 0,migrationLog:a}}e.s(["validateFlowIR",()=>m],94501)},29641,e=>{e.v(e=>Promise.resolve().then(()=>e(44497)))},30679,e=>{e.v(e=>Promise.resolve().then(()=>e(94501)))},98984,e=>{e.v(e=>Promise.resolve().then(()=>e(45966)))},9830,e=>{e.v(t=>Promise.all(["static/chunks/4ce13068a7e61854.js"].map(t=>e.l(t))).then(()=>t(33958)))}]);
|