@flat8n/cli 0.1.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 (105) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +155 -0
  3. package/dist/src/cli/api.d.ts +10 -0
  4. package/dist/src/cli/api.js +57 -0
  5. package/dist/src/cli/api.js.map +1 -0
  6. package/dist/src/cli/build.d.ts +2 -0
  7. package/dist/src/cli/build.js +162 -0
  8. package/dist/src/cli/build.js.map +1 -0
  9. package/dist/src/cli/compile.d.ts +2 -0
  10. package/dist/src/cli/compile.js +149 -0
  11. package/dist/src/cli/compile.js.map +1 -0
  12. package/dist/src/cli/deploy.d.ts +4 -0
  13. package/dist/src/cli/deploy.js +47 -0
  14. package/dist/src/cli/deploy.js.map +1 -0
  15. package/dist/src/cli/dev.d.ts +2 -0
  16. package/dist/src/cli/dev.js +54 -0
  17. package/dist/src/cli/dev.js.map +1 -0
  18. package/dist/src/cli/init.d.ts +1 -0
  19. package/dist/src/cli/init.js +237 -0
  20. package/dist/src/cli/init.js.map +1 -0
  21. package/dist/src/cli/main.d.ts +2 -0
  22. package/dist/src/cli/main.js +249 -0
  23. package/dist/src/cli/main.js.map +1 -0
  24. package/dist/src/cli/run.d.ts +2 -0
  25. package/dist/src/cli/run.js +84 -0
  26. package/dist/src/cli/run.js.map +1 -0
  27. package/dist/src/cli/server.d.ts +2 -0
  28. package/dist/src/cli/server.js +62 -0
  29. package/dist/src/cli/server.js.map +1 -0
  30. package/dist/src/cli/setup.d.ts +1 -0
  31. package/dist/src/cli/setup.js +62 -0
  32. package/dist/src/cli/setup.js.map +1 -0
  33. package/dist/src/cli/sync.d.ts +4 -0
  34. package/dist/src/cli/sync.js +45 -0
  35. package/dist/src/cli/sync.js.map +1 -0
  36. package/dist/src/cli/ui.d.ts +5 -0
  37. package/dist/src/cli/ui.js +66 -0
  38. package/dist/src/cli/ui.js.map +1 -0
  39. package/dist/src/compiler/analyze.d.ts +15 -0
  40. package/dist/src/compiler/analyze.js +26 -0
  41. package/dist/src/compiler/analyze.js.map +1 -0
  42. package/dist/src/compiler/diagnostics.d.ts +28 -0
  43. package/dist/src/compiler/diagnostics.js +26 -0
  44. package/dist/src/compiler/diagnostics.js.map +1 -0
  45. package/dist/src/compiler/inputs.d.ts +30 -0
  46. package/dist/src/compiler/inputs.js +2 -0
  47. package/dist/src/compiler/inputs.js.map +1 -0
  48. package/dist/src/compiler/json.d.ts +15 -0
  49. package/dist/src/compiler/json.js +83 -0
  50. package/dist/src/compiler/json.js.map +1 -0
  51. package/dist/src/compiler/link.d.ts +18 -0
  52. package/dist/src/compiler/link.js +84 -0
  53. package/dist/src/compiler/link.js.map +1 -0
  54. package/dist/src/compiler/stable-json.d.ts +3 -0
  55. package/dist/src/compiler/stable-json.js +18 -0
  56. package/dist/src/compiler/stable-json.js.map +1 -0
  57. package/dist/src/compiler/validate.d.ts +9 -0
  58. package/dist/src/compiler/validate.js +25 -0
  59. package/dist/src/compiler/validate.js.map +1 -0
  60. package/dist/src/compiler/watch.d.ts +19 -0
  61. package/dist/src/compiler/watch.js +67 -0
  62. package/dist/src/compiler/watch.js.map +1 -0
  63. package/dist/src/compiler/workflow-file.d.ts +2 -0
  64. package/dist/src/compiler/workflow-file.js +27 -0
  65. package/dist/src/compiler/workflow-file.js.map +1 -0
  66. package/dist/src/generator/n8n-generator.d.ts +3 -0
  67. package/dist/src/generator/n8n-generator.js +129 -0
  68. package/dist/src/generator/n8n-generator.js.map +1 -0
  69. package/dist/src/graph/graph.d.ts +11 -0
  70. package/dist/src/graph/graph.js +76 -0
  71. package/dist/src/graph/graph.js.map +1 -0
  72. package/dist/src/index.d.ts +7 -0
  73. package/dist/src/index.js +5 -0
  74. package/dist/src/index.js.map +1 -0
  75. package/dist/src/ir/model.d.ts +58 -0
  76. package/dist/src/ir/model.js +29 -0
  77. package/dist/src/ir/model.js.map +1 -0
  78. package/dist/src/parser/n8n-parser.d.ts +8 -0
  79. package/dist/src/parser/n8n-parser.js +119 -0
  80. package/dist/src/parser/n8n-parser.js.map +1 -0
  81. package/dist/src/parser/n8n-schema.d.ts +60 -0
  82. package/dist/src/parser/n8n-schema.js +35 -0
  83. package/dist/src/parser/n8n-schema.js.map +1 -0
  84. package/dist/src/passes/auto-layout.d.ts +6 -0
  85. package/dist/src/passes/auto-layout.js +52 -0
  86. package/dist/src/passes/auto-layout.js.map +1 -0
  87. package/dist/src/passes/credential-isolation.d.ts +10 -0
  88. package/dist/src/passes/credential-isolation.js +56 -0
  89. package/dist/src/passes/credential-isolation.js.map +1 -0
  90. package/dist/src/passes/deterministic-ids.d.ts +7 -0
  91. package/dist/src/passes/deterministic-ids.js +40 -0
  92. package/dist/src/passes/deterministic-ids.js.map +1 -0
  93. package/dist/src/passes/expression-rewriter.d.ts +7 -0
  94. package/dist/src/passes/expression-rewriter.js +294 -0
  95. package/dist/src/passes/expression-rewriter.js.map +1 -0
  96. package/dist/src/passes/inline-subworkflows.d.ts +11 -0
  97. package/dist/src/passes/inline-subworkflows.js +437 -0
  98. package/dist/src/passes/inline-subworkflows.js.map +1 -0
  99. package/dist/src/passes/pass.d.ts +10 -0
  100. package/dist/src/passes/pass.js +2 -0
  101. package/dist/src/passes/pass.js.map +1 -0
  102. package/dist/src/validation/graph-integrity.d.ts +9 -0
  103. package/dist/src/validation/graph-integrity.js +104 -0
  104. package/dist/src/validation/graph-integrity.js.map +1 -0
  105. package/package.json +60 -0
@@ -0,0 +1,437 @@
1
+ import { createHash } from "node:crypto";
2
+ import { diagnostic } from "../compiler/diagnostics.js";
3
+ import { isJsonObject, jsonEquals } from "../compiler/json.js";
4
+ import { buildWorkflowGraph } from "../graph/graph.js";
5
+ import { rewriteJsonReferences } from "./expression-rewriter.js";
6
+ const EXECUTE_WORKFLOW_TYPE = "n8n-nodes-base.executeWorkflow";
7
+ const EXECUTE_WORKFLOW_TRIGGER_TYPE = "n8n-nodes-base.executeWorkflowTrigger";
8
+ export class InlineSubworkflowsPass {
9
+ name = "inline-subworkflows";
10
+ dependencies;
11
+ options;
12
+ constructor(dependencies, options) {
13
+ this.dependencies = dependencies;
14
+ this.options = options;
15
+ }
16
+ run(workflow) {
17
+ return this.inlineWorkflow(workflow, {
18
+ stack: [workflow.id],
19
+ namespace: []
20
+ });
21
+ }
22
+ inlineWorkflow(workflow, context) {
23
+ let current = workflow;
24
+ const diagnostics = [];
25
+ while (true) {
26
+ const graph = buildWorkflowGraph(current, this.name);
27
+ diagnostics.push(...graph.diagnostics);
28
+ if (graph.diagnostics.some((item) => item.severity === "error")) {
29
+ return { workflow: current, diagnostics };
30
+ }
31
+ const executeNode = current.nodes.find((node) => isExecuteWorkflowNode(node));
32
+ if (executeNode === undefined) {
33
+ return { workflow: current, diagnostics };
34
+ }
35
+ const reference = extractWorkflowReference(executeNode);
36
+ if (reference.kind !== "static") {
37
+ diagnostics.push(diagnostic({
38
+ pass: this.name,
39
+ workflow: current.id,
40
+ node: executeNode.name,
41
+ location: executeNode.source,
42
+ cause: reference.cause,
43
+ invariant: "Execute Workflow node must reference a known static dependency before inlining",
44
+ suggestion: reference.suggestion
45
+ }));
46
+ return { workflow: current, diagnostics };
47
+ }
48
+ const child = this.dependencies.get(reference.value);
49
+ if (child === undefined) {
50
+ diagnostics.push(diagnostic({
51
+ pass: this.name,
52
+ workflow: current.id,
53
+ node: executeNode.name,
54
+ location: executeNode.source,
55
+ cause: `dependency "${reference.value}" not found`,
56
+ invariant: "all Execute Workflow references must resolve through dependency map",
57
+ suggestion: `provide dependency map entry for "${reference.value}"`
58
+ }));
59
+ return { workflow: current, diagnostics };
60
+ }
61
+ if (context.stack.includes(child.id)) {
62
+ diagnostics.push(diagnostic({
63
+ pass: this.name,
64
+ workflow: current.id,
65
+ node: executeNode.name,
66
+ location: executeNode.source,
67
+ cause: `workflow cycle detected: ${[...context.stack, child.id].join(" -> ")}`,
68
+ invariant: "workflow inlining graph must be acyclic",
69
+ suggestion: "remove recursive Execute Workflow dependency or keep it external"
70
+ }));
71
+ return { workflow: current, diagnostics };
72
+ }
73
+ const childResult = this.inlineWorkflow(child, {
74
+ stack: [...context.stack, child.id],
75
+ namespace: [...context.namespace, executeNode.name]
76
+ });
77
+ diagnostics.push(...childResult.diagnostics);
78
+ if (childResult.diagnostics.some((item) => item.severity === "error")) {
79
+ return { workflow: current, diagnostics };
80
+ }
81
+ const inlined = inlineExecuteNode(current, executeNode, childResult.workflow, this.options, this.name);
82
+ diagnostics.push(...inlined.diagnostics);
83
+ current = inlined.workflow;
84
+ if (inlined.diagnostics.some((item) => item.severity === "error")) {
85
+ return { workflow: current, diagnostics };
86
+ }
87
+ }
88
+ }
89
+ }
90
+ function inlineExecuteNode(parent, executeNode, child, options, pass) {
91
+ const parentGraph = buildWorkflowGraph(parent, pass);
92
+ const childGraph = buildWorkflowGraph(child, pass);
93
+ const diagnostics = [...parentGraph.diagnostics, ...childGraph.diagnostics];
94
+ const operationalNodes = child.nodes.filter((node) => !isBoundaryNode(node));
95
+ if (operationalNodes.length === 0) {
96
+ diagnostics.push(diagnostic({
97
+ pass,
98
+ workflow: parent.id,
99
+ node: executeNode.name,
100
+ location: executeNode.source,
101
+ cause: `dependency workflow "${child.id}" has no operational nodes after boundary removal`,
102
+ invariant: "inlined workflow must contain at least one operational node",
103
+ suggestion: "add operational nodes to subworkflow or remove Execute Workflow node"
104
+ }));
105
+ return { workflow: parent, diagnostics };
106
+ }
107
+ if (diagnostics.some((item) => item.severity === "error")) {
108
+ return { workflow: parent, diagnostics };
109
+ }
110
+ const childEdges = child.edges.filter((edge) => {
111
+ const source = childGraph.nodesByName.get(edge.source);
112
+ const target = childGraph.nodesByName.get(edge.target);
113
+ return source !== undefined && target !== undefined && !isBoundaryNode(source) && !isBoundaryNode(target);
114
+ });
115
+ const boundarySourceEdges = child.edges.filter((edge) => {
116
+ const source = childGraph.nodesByName.get(edge.source);
117
+ const target = childGraph.nodesByName.get(edge.target);
118
+ return source !== undefined && target !== undefined && isBoundaryNode(source) && !isBoundaryNode(target);
119
+ });
120
+ const boundaryTargetEdges = child.edges.filter((edge) => {
121
+ const source = childGraph.nodesByName.get(edge.source);
122
+ const target = childGraph.nodesByName.get(edge.target);
123
+ return source !== undefined && target !== undefined && !isBoundaryNode(source) && isBoundaryNode(target);
124
+ });
125
+ const merge = mergeSettings(parent.settings, child.settings, executeNode.name, options.namespaceSeparator ?? "__");
126
+ const namespaced = namespaceChild(parent, executeNode, operationalNodes, childEdges, boundarySourceEdges, boundaryTargetEdges, merge.variableNameMap, merge.settings, options);
127
+ const parentIncoming = parent.edges.filter((edge) => edge.target === executeNode.name);
128
+ const parentOutgoing = parent.edges.filter((edge) => edge.source === executeNode.name);
129
+ const untouchedParentEdges = parent.edges.filter((edge) => edge.source !== executeNode.name && edge.target !== executeNode.name);
130
+ const parentNodeReferenceMap = namespaced.exits.length === 1 ? { [executeNode.name]: namespaced.exits[0]?.source ?? executeNode.name } : {};
131
+ const retainedParentNodes = parent.nodes
132
+ .filter((node) => node.name !== executeNode.name)
133
+ .map((node) => ({
134
+ ...node,
135
+ parameters: rewriteJsonReferences(node.parameters, {
136
+ nodeNames: parentNodeReferenceMap,
137
+ variableNames: {}
138
+ })
139
+ }));
140
+ const entryEdges = bridgeEntries(parentIncoming, namespaced.entries, executeNode);
141
+ const exitEdges = bridgeExits(parentOutgoing, namespaced.exits, executeNode);
142
+ const workflow = {
143
+ ...parent,
144
+ nodes: [
145
+ ...retainedParentNodes,
146
+ ...namespaced.nodes
147
+ ],
148
+ edges: [
149
+ ...untouchedParentEdges,
150
+ ...namespaced.edges,
151
+ ...entryEdges,
152
+ ...exitEdges
153
+ ],
154
+ settings: namespaced.settings
155
+ };
156
+ return {
157
+ workflow,
158
+ diagnostics
159
+ };
160
+ }
161
+ function namespaceChild(parent, executeNode, childNodes, childEdges, boundarySourceEdges, boundaryTargetEdges, variableNameMap, settings, options) {
162
+ const separator = options.namespaceSeparator ?? "__";
163
+ const usedNames = new Set(parent.nodes.filter((node) => node.name !== executeNode.name).map((node) => node.name));
164
+ const segment = sanitizeName(executeNode.name);
165
+ const bounds = boundsFor(childNodes);
166
+ const nodeNameMap = {};
167
+ for (const node of childNodes) {
168
+ const baseName = `${segment}${separator}${sanitizeName(node.name)}`;
169
+ const mappedUniqueName = uniqueName(baseName, usedNames, `${parent.id}:${executeNode.name}:${node.name}`);
170
+ usedNames.add(mappedUniqueName);
171
+ nodeNameMap[node.name] = mappedUniqueName;
172
+ }
173
+ const nodes = childNodes.map((node) => {
174
+ const mappedName = nodeNameMap[node.name] ?? node.name;
175
+ const references = { nodeNames: nodeNameMap, variableNames: variableNameMap };
176
+ return {
177
+ ...node,
178
+ name: mappedName,
179
+ position: translatePosition(node.position, bounds, executeNode.position, options.layout),
180
+ parameters: rewriteJsonReferences(node.parameters, references)
181
+ };
182
+ });
183
+ const edges = childEdges.map((edge) => ({
184
+ ...edge,
185
+ source: nodeNameMap[edge.source] ?? edge.source,
186
+ target: nodeNameMap[edge.target] ?? edge.target
187
+ }));
188
+ return {
189
+ nodes,
190
+ edges,
191
+ nodeNameMap,
192
+ variableNameMap,
193
+ settings,
194
+ entries: deriveEntries(childNodes, childEdges, boundarySourceEdges, nodeNameMap),
195
+ exits: deriveExits(childNodes, childEdges, boundaryTargetEdges, nodeNameMap)
196
+ };
197
+ }
198
+ function mergeSettings(parent, child, segmentName, separator) {
199
+ const vars = { ...parent.vars };
200
+ const variableNameMap = {};
201
+ const used = new Set(Object.keys(vars));
202
+ const segment = sanitizeName(segmentName);
203
+ const additions = [];
204
+ for (const [key, value] of Object.entries(child.vars).sort(([left], [right]) => left.localeCompare(right))) {
205
+ if (!used.has(key)) {
206
+ used.add(key);
207
+ variableNameMap[key] = key;
208
+ additions.push({ key, value });
209
+ continue;
210
+ }
211
+ const existing = vars[key];
212
+ if (existing !== undefined && jsonEquals(existing, value)) {
213
+ variableNameMap[key] = key;
214
+ continue;
215
+ }
216
+ const renamed = uniqueName(`${segment}${separator}${sanitizeName(key)}`, used, `${segment}:${key}`);
217
+ used.add(renamed);
218
+ variableNameMap[key] = renamed;
219
+ additions.push({ key: renamed, value });
220
+ }
221
+ const references = { nodeNames: {}, variableNames: variableNameMap };
222
+ for (const addition of additions) {
223
+ vars[addition.key] = rewriteJsonReferences(addition.value, references);
224
+ }
225
+ return {
226
+ settings: {
227
+ ...parent,
228
+ vars
229
+ },
230
+ variableNameMap
231
+ };
232
+ }
233
+ function deriveEntries(childNodes, childEdges, boundarySourceEdges, nodeNameMap) {
234
+ if (boundarySourceEdges.length > 0) {
235
+ return uniqueEntries(boundarySourceEdges.map((edge) => ({
236
+ target: nodeNameMap[edge.target] ?? edge.target,
237
+ inputType: edge.inputType,
238
+ inputIndex: edge.inputIndex
239
+ })));
240
+ }
241
+ const incomingTargets = new Set(childEdges.map((edge) => edge.target));
242
+ return childNodes
243
+ .filter((node) => !incomingTargets.has(node.name))
244
+ .map((node) => ({
245
+ target: nodeNameMap[node.name] ?? node.name,
246
+ inputType: "main",
247
+ inputIndex: 0
248
+ }));
249
+ }
250
+ function deriveExits(childNodes, childEdges, boundaryTargetEdges, nodeNameMap) {
251
+ if (boundaryTargetEdges.length > 0) {
252
+ return uniqueExits(boundaryTargetEdges.map((edge) => ({
253
+ source: nodeNameMap[edge.source] ?? edge.source,
254
+ outputType: edge.outputType,
255
+ outputIndex: edge.outputIndex
256
+ })));
257
+ }
258
+ const outgoingSources = new Set(childEdges.map((edge) => edge.source));
259
+ return childNodes
260
+ .filter((node) => !outgoingSources.has(node.name))
261
+ .map((node) => ({
262
+ source: nodeNameMap[node.name] ?? node.name,
263
+ outputType: "main",
264
+ outputIndex: 0
265
+ }));
266
+ }
267
+ function bridgeEntries(parentIncoming, entries, executeNode) {
268
+ if (parentIncoming.length === 0) {
269
+ return [];
270
+ }
271
+ const edges = [];
272
+ for (const incoming of parentIncoming) {
273
+ for (const entry of entries) {
274
+ edges.push({
275
+ source: incoming.source,
276
+ outputType: incoming.outputType,
277
+ outputIndex: incoming.outputIndex,
278
+ target: entry.target,
279
+ inputType: entry.inputType,
280
+ inputIndex: entry.inputIndex,
281
+ sourcePointer: executeNode.source
282
+ });
283
+ }
284
+ }
285
+ return edges;
286
+ }
287
+ function bridgeExits(parentOutgoing, exits, executeNode) {
288
+ if (parentOutgoing.length === 0) {
289
+ return [];
290
+ }
291
+ const edges = [];
292
+ for (const exit of exits) {
293
+ for (const outgoing of parentOutgoing) {
294
+ edges.push({
295
+ source: exit.source,
296
+ outputType: exit.outputType,
297
+ outputIndex: exit.outputIndex,
298
+ target: outgoing.target,
299
+ inputType: outgoing.inputType,
300
+ inputIndex: outgoing.inputIndex,
301
+ sourcePointer: executeNode.source
302
+ });
303
+ }
304
+ }
305
+ return edges;
306
+ }
307
+ function translatePosition(childPosition, bounds, executePosition, layout) {
308
+ const spacing = layout?.spacing ?? 320;
309
+ const direction = layout?.direction ?? "right";
310
+ const localX = childPosition[0] - bounds.minX;
311
+ const localY = childPosition[1] - bounds.minY;
312
+ switch (direction) {
313
+ case "right":
314
+ return [executePosition[0] + spacing + localX, executePosition[1] + localY];
315
+ case "left":
316
+ return [executePosition[0] - spacing - bounds.width + localX, executePosition[1] + localY];
317
+ case "down":
318
+ return [executePosition[0] + localX, executePosition[1] + spacing + localY];
319
+ case "up":
320
+ return [executePosition[0] + localX, executePosition[1] - spacing - bounds.height + localY];
321
+ }
322
+ }
323
+ function boundsFor(nodes) {
324
+ const xs = nodes.map((node) => node.position[0]);
325
+ const ys = nodes.map((node) => node.position[1]);
326
+ const minX = Math.min(...xs);
327
+ const maxX = Math.max(...xs);
328
+ const minY = Math.min(...ys);
329
+ const maxY = Math.max(...ys);
330
+ return {
331
+ minX,
332
+ minY,
333
+ width: maxX - minX,
334
+ height: maxY - minY
335
+ };
336
+ }
337
+ function uniqueEntries(entries) {
338
+ const seen = new Set();
339
+ const output = [];
340
+ for (const entry of entries) {
341
+ const key = `${entry.target}\u001f${entry.inputType}\u001f${entry.inputIndex}`;
342
+ if (!seen.has(key)) {
343
+ seen.add(key);
344
+ output.push(entry);
345
+ }
346
+ }
347
+ return output;
348
+ }
349
+ function uniqueExits(exits) {
350
+ const seen = new Set();
351
+ const output = [];
352
+ for (const exit of exits) {
353
+ const key = `${exit.source}\u001f${exit.outputType}\u001f${exit.outputIndex}`;
354
+ if (!seen.has(key)) {
355
+ seen.add(key);
356
+ output.push(exit);
357
+ }
358
+ }
359
+ return output;
360
+ }
361
+ function isExecuteWorkflowNode(node) {
362
+ return node.type === EXECUTE_WORKFLOW_TYPE || node.type.endsWith(".executeWorkflow");
363
+ }
364
+ function isBoundaryNode(node) {
365
+ return node.type === EXECUTE_WORKFLOW_TRIGGER_TYPE || node.type.endsWith(".executeWorkflowTrigger");
366
+ }
367
+ function extractWorkflowReference(node) {
368
+ const candidates = ["workflowId", "workflow", "workflowName"];
369
+ for (const key of candidates) {
370
+ const value = node.parameters[key];
371
+ const extracted = extractReferenceValue(value);
372
+ if (extracted.kind === "static") {
373
+ return extracted;
374
+ }
375
+ if (extracted.kind === "dynamic") {
376
+ return {
377
+ kind: "invalid",
378
+ cause: `workflow reference parameter "${key}" is dynamic expression`,
379
+ suggestion: "replace dynamic workflow reference with static dependency id for build-time linking"
380
+ };
381
+ }
382
+ }
383
+ return {
384
+ kind: "invalid",
385
+ cause: "no static workflow reference found in parameters.workflowId, parameters.workflow, or parameters.workflowName",
386
+ suggestion: "set Execute Workflow node to a static workflow id/name and pass matching dependency"
387
+ };
388
+ }
389
+ function extractReferenceValue(value) {
390
+ if (value === undefined || value === null) {
391
+ return { kind: "missing" };
392
+ }
393
+ if (typeof value === "number" || typeof value === "boolean") {
394
+ return { kind: "static", value: String(value) };
395
+ }
396
+ if (typeof value === "string") {
397
+ const trimmed = value.trim();
398
+ if (trimmed.length === 0) {
399
+ return { kind: "missing" };
400
+ }
401
+ if (trimmed.startsWith("=") || trimmed.includes("{{")) {
402
+ return { kind: "dynamic" };
403
+ }
404
+ return { kind: "static", value: trimmed };
405
+ }
406
+ if (Array.isArray(value)) {
407
+ return { kind: "missing" };
408
+ }
409
+ if (isJsonObject(value)) {
410
+ const nested = value.value;
411
+ return extractReferenceValue(nested);
412
+ }
413
+ return { kind: "missing" };
414
+ }
415
+ function sanitizeName(value) {
416
+ const sanitized = value
417
+ .trim()
418
+ .replaceAll(/[^A-Za-z0-9_$-]+/gu, "_")
419
+ .replaceAll(/^_+|_+$/gu, "");
420
+ return sanitized.length === 0 ? "node" : sanitized;
421
+ }
422
+ function uniqueName(base, used, context) {
423
+ if (!used.has(base)) {
424
+ return base;
425
+ }
426
+ const suffix = createHash("sha256").update(context).digest("hex").slice(0, 8);
427
+ const candidate = `${base}__${suffix}`;
428
+ if (!used.has(candidate)) {
429
+ return candidate;
430
+ }
431
+ let salt = 1;
432
+ while (used.has(`${candidate}_${salt}`)) {
433
+ salt += 1;
434
+ }
435
+ return `${candidate}_${salt}`;
436
+ }
437
+ //# sourceMappingURL=inline-subworkflows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-subworkflows.js","sourceRoot":"","sources":["../../../src/passes/inline-subworkflows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAA2B,MAAM,4BAA4B,CAAC;AAGjF,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AA8BjE,MAAM,qBAAqB,GAAG,gCAAgC,CAAC;AAC/D,MAAM,6BAA6B,GAAG,uCAAuC,CAAC;AAE9E,MAAM,OAAO,sBAAsB;IACxB,IAAI,GAAG,qBAAqB,CAAC;IACrB,YAAY,CAAkC;IAC9C,OAAO,CAAc;IAEtC,YAAY,YAA6C,EAAE,OAAoB;QAC7E,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;I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AE,EAAE,CAAC,CAAC;IAC/B,OAAO,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACrD,CAAC;AAED,SAAS,UAAU,CAAC,IAAY,EAAE,IAAyB,EAAE,OAAe;IAC1E,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9E,MAAM,SAAS,GAAG,GAAG,IAAI,KAAK,MAAM,EAAE,CAAC;IACvC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QACzB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC;QACxC,IAAI,IAAI,CAAC,CAAC;IACZ,CAAC;IACD,OAAO,GAAG,SAAS,IAAI,IAAI,EAAE,CAAC;AAChC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { CompilerDiagnostic } from "../compiler/diagnostics.js";
2
+ import type { WorkflowIR } from "../ir/model.js";
3
+ export interface PassResult {
4
+ readonly workflow: WorkflowIR;
5
+ readonly diagnostics: readonly CompilerDiagnostic[];
6
+ }
7
+ export interface LinkPass {
8
+ readonly name: string;
9
+ run(workflow: WorkflowIR): PassResult;
10
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=pass.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pass.js","sourceRoot":"","sources":["../../../src/passes/pass.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { type CompilerDiagnostic } from "../compiler/diagnostics.js";
2
+ import type { GraphStats, WorkflowIR } from "../ir/model.js";
3
+ export interface WorkflowValidationOptions {
4
+ readonly requireNodeIds?: boolean;
5
+ readonly forbidBoundaryNodes?: boolean;
6
+ readonly forbidExecuteWorkflowNodes?: boolean;
7
+ }
8
+ export declare function validateWorkflowIR(workflow: WorkflowIR, pass: string, options?: WorkflowValidationOptions): readonly CompilerDiagnostic[];
9
+ export declare function collectGraphStats(workflow: WorkflowIR): GraphStats;
@@ -0,0 +1,104 @@
1
+ import { diagnostic } from "../compiler/diagnostics.js";
2
+ import { buildWorkflowGraph } from "../graph/graph.js";
3
+ export function validateWorkflowIR(workflow, pass, options = {}) {
4
+ const diagnostics = [];
5
+ diagnostics.push(...buildWorkflowGraph(workflow, pass).diagnostics);
6
+ diagnostics.push(...validateNodeIds(workflow, pass, options.requireNodeIds ?? false));
7
+ diagnostics.push(...validateNodeVersions(workflow, pass));
8
+ if (options.forbidBoundaryNodes ?? false) {
9
+ diagnostics.push(...validateNoBoundaryNodes(workflow, pass));
10
+ }
11
+ if (options.forbidExecuteWorkflowNodes ?? false) {
12
+ diagnostics.push(...validateNoExecuteWorkflowNodes(workflow, pass));
13
+ }
14
+ return diagnostics;
15
+ }
16
+ export function collectGraphStats(workflow) {
17
+ return {
18
+ nodes: workflow.nodes.length,
19
+ edges: workflow.edges.length,
20
+ triggers: workflow.nodes.filter((node) => node.type.toLowerCase().includes("trigger")).length,
21
+ executeWorkflowNodes: workflow.nodes.filter((node) => isExecuteWorkflowNode(node)).length,
22
+ variables: Object.keys(workflow.settings.vars).length
23
+ };
24
+ }
25
+ function validateNodeIds(workflow, pass, requireIds) {
26
+ const diagnostics = [];
27
+ const seen = new Map();
28
+ for (const node of workflow.nodes) {
29
+ if (node.id === undefined || node.id.length === 0) {
30
+ if (requireIds) {
31
+ diagnostics.push(diagnostic({
32
+ pass,
33
+ workflow: workflow.id,
34
+ node: node.name,
35
+ location: node.source,
36
+ cause: "node is missing deterministic id",
37
+ invariant: "generated workflows must contain deterministic node ids",
38
+ suggestion: "run deterministic id pass before generation"
39
+ }));
40
+ }
41
+ continue;
42
+ }
43
+ const previous = seen.get(node.id);
44
+ if (previous !== undefined) {
45
+ diagnostics.push(diagnostic({
46
+ pass,
47
+ workflow: workflow.id,
48
+ node: node.name,
49
+ location: node.source,
50
+ cause: `node id "${node.id}" duplicates node "${previous}"`,
51
+ invariant: "node ids must be unique in generated workflow",
52
+ suggestion: "check namespace path and deterministic id source inputs"
53
+ }));
54
+ }
55
+ seen.set(node.id, node.name);
56
+ }
57
+ return diagnostics;
58
+ }
59
+ function validateNodeVersions(workflow, pass) {
60
+ return workflow.nodes
61
+ .filter((node) => !Number.isFinite(node.typeVersion))
62
+ .map((node) => diagnostic({
63
+ pass,
64
+ workflow: workflow.id,
65
+ node: node.name,
66
+ location: node.source,
67
+ cause: "node typeVersion is not finite",
68
+ invariant: "node typeVersion must remain immutable finite number",
69
+ suggestion: "restore node typeVersion exported by n8n"
70
+ }));
71
+ }
72
+ function validateNoBoundaryNodes(workflow, pass) {
73
+ return workflow.nodes
74
+ .filter((node) => isBoundaryNode(node))
75
+ .map((node) => diagnostic({
76
+ pass,
77
+ workflow: workflow.id,
78
+ node: node.name,
79
+ location: node.source,
80
+ cause: "subworkflow boundary trigger remains after linking",
81
+ invariant: "linked output must delete inlined subworkflow boundary nodes",
82
+ suggestion: "ensure boundary trigger type is supported or remove unresolved subworkflow"
83
+ }));
84
+ }
85
+ function validateNoExecuteWorkflowNodes(workflow, pass) {
86
+ return workflow.nodes
87
+ .filter((node) => isExecuteWorkflowNode(node))
88
+ .map((node) => diagnostic({
89
+ pass,
90
+ workflow: workflow.id,
91
+ node: node.name,
92
+ location: node.source,
93
+ cause: "Execute Workflow node remains after linking",
94
+ invariant: "linked monolithic output must not depend on external workflows",
95
+ suggestion: "provide dependency map entry or remove Execute Workflow node"
96
+ }));
97
+ }
98
+ function isExecuteWorkflowNode(node) {
99
+ return node.type === "n8n-nodes-base.executeWorkflow" || node.type.endsWith(".executeWorkflow");
100
+ }
101
+ function isBoundaryNode(node) {
102
+ return node.type === "n8n-nodes-base.executeWorkflowTrigger" || node.type.endsWith(".executeWorkflowTrigger");
103
+ }
104
+ //# sourceMappingURL=graph-integrity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-integrity.js","sourceRoot":"","sources":["../../../src/validation/graph-integrity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA2B,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AASvD,MAAM,UAAU,kBAAkB,CAChC,QAAoB,EACpB,IAAY,EACZ,UAAqC,EAAE;IAEvC,MAAM,WAAW,GAAyB,EAAE,CAAC;IAC7C,WAAW,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC;IACpE,WAAW,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,cAAc,IAAI,KAAK,CAAC,CAAC,CAAC;IACtF,WAAW,CAAC,IAAI,CAAC,GAAG,oBAAoB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IAE1D,IAAI,OAAO,CAAC,mBAAmB,IAAI,KAAK,EAAE,CAAC;QACzC,WAAW,CAAC,IAAI,CAAC,GAAG,uBAAuB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED,IAAI,OAAO,CAAC,0BAA0B,IAAI,KAAK,EAAE,CAAC;QAChD,WAAW,CAAC,IAAI,CAAC,GAAG,8BAA8B,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAAoB;IACpD,OAAO;QACL,KAAK,EAAE,QAAQ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