@n8n-as-code/transformer 0.2.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.
- package/README.md +215 -0
- package/dist/compiler/index.d.ts +6 -0
- package/dist/compiler/index.d.ts.map +1 -0
- package/dist/compiler/index.js +6 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/compiler/typescript-parser.d.ts +87 -0
- package/dist/compiler/typescript-parser.d.ts.map +1 -0
- package/dist/compiler/typescript-parser.js +379 -0
- package/dist/compiler/typescript-parser.js.map +1 -0
- package/dist/compiler/workflow-builder.d.ts +48 -0
- package/dist/compiler/workflow-builder.d.ts.map +1 -0
- package/dist/compiler/workflow-builder.js +231 -0
- package/dist/compiler/workflow-builder.js.map +1 -0
- package/dist/decorators/helpers.d.ts +27 -0
- package/dist/decorators/helpers.d.ts.map +1 -0
- package/dist/decorators/helpers.js +97 -0
- package/dist/decorators/helpers.js.map +1 -0
- package/dist/decorators/index.d.ts +11 -0
- package/dist/decorators/index.d.ts.map +1 -0
- package/dist/decorators/index.js +10 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/decorators/links.d.ts +70 -0
- package/dist/decorators/links.d.ts.map +1 -0
- package/dist/decorators/links.js +85 -0
- package/dist/decorators/links.js.map +1 -0
- package/dist/decorators/node.d.ts +32 -0
- package/dist/decorators/node.d.ts.map +1 -0
- package/dist/decorators/node.js +43 -0
- package/dist/decorators/node.js.map +1 -0
- package/dist/decorators/types.d.ts +122 -0
- package/dist/decorators/types.d.ts.map +1 -0
- package/dist/decorators/types.js +13 -0
- package/dist/decorators/types.js.map +1 -0
- package/dist/decorators/workflow.d.ts +32 -0
- package/dist/decorators/workflow.d.ts.map +1 -0
- package/dist/decorators/workflow.js +38 -0
- package/dist/decorators/workflow.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/parser/ast-to-typescript.d.ts +55 -0
- package/dist/parser/ast-to-typescript.d.ts.map +1 -0
- package/dist/parser/ast-to-typescript.js +337 -0
- package/dist/parser/ast-to-typescript.js.map +1 -0
- package/dist/parser/index.d.ts +6 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +6 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/json-to-ast.d.ts +61 -0
- package/dist/parser/json-to-ast.d.ts.map +1 -0
- package/dist/parser/json-to-ast.js +222 -0
- package/dist/parser/json-to-ast.js.map +1 -0
- package/dist/types.d.ts +227 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/formatting.d.ts +33 -0
- package/dist/utils/formatting.d.ts.map +1 -0
- package/dist/utils/formatting.js +83 -0
- package/dist/utils/formatting.js.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/naming.d.ts +39 -0
- package/dist/utils/naming.d.ts.map +1 -0
- package/dist/utils/naming.js +161 -0
- package/dist/utils/naming.js.map +1 -0
- package/package.json +33 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-parser.js","sourceRoot":"","sources":["../../src/compiler/typescript-parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAc,UAAU,EAA4D,MAAM,UAAU,CAAC;AAGrH;;GAEG;AACH,MAAM,OAAO,gBAAgB;IACjB,OAAO,CAAU;IAEzB;QACI,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC;YACvB,eAAe,EAAE;gBACb,MAAM,EAAE,EAAE,EAAE,SAAS;gBACrB,MAAM,EAAE,EAAE,EAAE,SAAS;gBACrB,sBAAsB,EAAE,IAAI;gBAC5B,qBAAqB,EAAE,IAAI;aAC9B;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH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;iBAC5B;aACJ,CAAC;QACN,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;;OAKG;IACK,kBAAkB,CAAC,IAAY;QACnC,IAAI,CAAC;YACD,mDAAmD;YACnD,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,WAAW,IAAI,GAAG,CAAC,CAAC;YAC9C,OAAO,IAAI,EAAE,CAAC;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,IAAI,CAAC,CAAC;YACvD,MAAM,IAAI,KAAK,CAAC,mCAAmC,KAAK,EAAE,CAAC,CAAC;QAChE,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Builder
|
|
3
|
+
*
|
|
4
|
+
* Builds n8n workflow JSON from extracted TypeScript metadata
|
|
5
|
+
*/
|
|
6
|
+
import { WorkflowAST, N8nWorkflow } from '../types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Build n8n workflow JSON from AST
|
|
9
|
+
*/
|
|
10
|
+
export declare class WorkflowBuilder {
|
|
11
|
+
/**
|
|
12
|
+
* Build workflow JSON from AST
|
|
13
|
+
*/
|
|
14
|
+
build(ast: WorkflowAST, options?: {
|
|
15
|
+
deterministicIds?: boolean;
|
|
16
|
+
}): N8nWorkflow;
|
|
17
|
+
/**
|
|
18
|
+
* Build nodes array
|
|
19
|
+
*/
|
|
20
|
+
private buildNodes;
|
|
21
|
+
/**
|
|
22
|
+
* Build connections object
|
|
23
|
+
*
|
|
24
|
+
* Converts from AST format to n8n format:
|
|
25
|
+
*
|
|
26
|
+
* AST: [{ from: {node, output}, to: {node, input} }]
|
|
27
|
+
*
|
|
28
|
+
* n8n: {
|
|
29
|
+
* "NodeA": {
|
|
30
|
+
* "main": [
|
|
31
|
+
* [{ node: "NodeB", type: "main", index: 0 }]
|
|
32
|
+
* ],
|
|
33
|
+
* "ai_languageModel": [
|
|
34
|
+
* [{ node: "Agent", type: "ai_languageModel", index: 0 }]
|
|
35
|
+
* ]
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
*/
|
|
39
|
+
private buildConnections;
|
|
40
|
+
/**
|
|
41
|
+
* Generate deterministic UUID based on property name and position
|
|
42
|
+
*
|
|
43
|
+
* This creates a consistent UUID for the same node across transformations
|
|
44
|
+
* Useful for testing and ensuring stable IDs
|
|
45
|
+
*/
|
|
46
|
+
private generateDeterministicId;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=workflow-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-builder.d.ts","sourceRoot":"","sources":["../../src/compiler/workflow-builder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,WAAW,EAAmD,MAAM,aAAa,CAAC;AAIxG;;GAEG;AACH,qBAAa,eAAe;IACxB;;OAEG;IACH,KAAK,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,GAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,WAAW;IAiDlF;;OAEG;IACH,OAAO,CAAC,UAAU;IAuBlB;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,gBAAgB;IA8IxB;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;CAelC"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Builder
|
|
3
|
+
*
|
|
4
|
+
* Builds n8n workflow JSON from extracted TypeScript metadata
|
|
5
|
+
*/
|
|
6
|
+
import { randomUUID } from 'crypto';
|
|
7
|
+
import { createHash } from 'crypto';
|
|
8
|
+
/**
|
|
9
|
+
* Build n8n workflow JSON from AST
|
|
10
|
+
*/
|
|
11
|
+
export class WorkflowBuilder {
|
|
12
|
+
/**
|
|
13
|
+
* Build workflow JSON from AST
|
|
14
|
+
*/
|
|
15
|
+
build(ast, options = {}) {
|
|
16
|
+
const { deterministicIds = false } = options;
|
|
17
|
+
// Create mapping: propertyName → node ID
|
|
18
|
+
const nodeIdMap = new Map();
|
|
19
|
+
// Generate node IDs
|
|
20
|
+
for (const node of ast.nodes) {
|
|
21
|
+
const nodeId = deterministicIds
|
|
22
|
+
? this.generateDeterministicId(node.propertyName, node.position)
|
|
23
|
+
: randomUUID();
|
|
24
|
+
nodeIdMap.set(node.propertyName, nodeId);
|
|
25
|
+
}
|
|
26
|
+
// Build nodes array
|
|
27
|
+
const nodes = this.buildNodes(ast.nodes, nodeIdMap);
|
|
28
|
+
// Build connections object
|
|
29
|
+
const connections = this.buildConnections(ast.connections, nodeIdMap, ast.nodes);
|
|
30
|
+
// Assemble workflow
|
|
31
|
+
const workflow = {
|
|
32
|
+
id: ast.metadata.id,
|
|
33
|
+
name: ast.metadata.name,
|
|
34
|
+
active: ast.metadata.active,
|
|
35
|
+
nodes,
|
|
36
|
+
connections,
|
|
37
|
+
settings: ast.metadata.settings,
|
|
38
|
+
tags: []
|
|
39
|
+
};
|
|
40
|
+
// Add optional organization metadata
|
|
41
|
+
if (ast.metadata.projectId) {
|
|
42
|
+
workflow.projectId = ast.metadata.projectId;
|
|
43
|
+
}
|
|
44
|
+
if (ast.metadata.projectName) {
|
|
45
|
+
workflow.projectName = ast.metadata.projectName;
|
|
46
|
+
}
|
|
47
|
+
if (ast.metadata.homeProject) {
|
|
48
|
+
workflow.homeProject = ast.metadata.homeProject;
|
|
49
|
+
}
|
|
50
|
+
if (ast.metadata.isArchived !== undefined) {
|
|
51
|
+
workflow.isArchived = ast.metadata.isArchived;
|
|
52
|
+
}
|
|
53
|
+
return workflow;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Build nodes array
|
|
57
|
+
*/
|
|
58
|
+
buildNodes(nodes, nodeIdMap) {
|
|
59
|
+
return nodes.map(node => {
|
|
60
|
+
const n8nNode = {
|
|
61
|
+
id: nodeIdMap.get(node.propertyName),
|
|
62
|
+
name: node.displayName,
|
|
63
|
+
type: node.type,
|
|
64
|
+
typeVersion: node.version,
|
|
65
|
+
position: node.position,
|
|
66
|
+
parameters: node.parameters
|
|
67
|
+
};
|
|
68
|
+
// Add optional fields
|
|
69
|
+
if (node.credentials) {
|
|
70
|
+
n8nNode.credentials = node.credentials;
|
|
71
|
+
}
|
|
72
|
+
if (node.onError) {
|
|
73
|
+
n8nNode.onError = node.onError;
|
|
74
|
+
}
|
|
75
|
+
return n8nNode;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Build connections object
|
|
80
|
+
*
|
|
81
|
+
* Converts from AST format to n8n format:
|
|
82
|
+
*
|
|
83
|
+
* AST: [{ from: {node, output}, to: {node, input} }]
|
|
84
|
+
*
|
|
85
|
+
* n8n: {
|
|
86
|
+
* "NodeA": {
|
|
87
|
+
* "main": [
|
|
88
|
+
* [{ node: "NodeB", type: "main", index: 0 }]
|
|
89
|
+
* ],
|
|
90
|
+
* "ai_languageModel": [
|
|
91
|
+
* [{ node: "Agent", type: "ai_languageModel", index: 0 }]
|
|
92
|
+
* ]
|
|
93
|
+
* }
|
|
94
|
+
* }
|
|
95
|
+
*/
|
|
96
|
+
buildConnections(connections, nodeIdMap, nodes) {
|
|
97
|
+
const result = {};
|
|
98
|
+
// Create reverse map: propertyName → displayName
|
|
99
|
+
const displayNameMap = new Map();
|
|
100
|
+
for (const node of nodes) {
|
|
101
|
+
displayNameMap.set(node.propertyName, node.displayName);
|
|
102
|
+
}
|
|
103
|
+
// Group connections by source node and output index
|
|
104
|
+
for (const conn of connections) {
|
|
105
|
+
const sourceDisplayName = displayNameMap.get(conn.from.node);
|
|
106
|
+
const targetDisplayName = displayNameMap.get(conn.to.node);
|
|
107
|
+
if (!sourceDisplayName || !targetDisplayName) {
|
|
108
|
+
console.warn(`Warning: Unknown node in connection: ${conn.from.node} → ${conn.to.node}`);
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
// Initialize source node connections if not exists
|
|
112
|
+
if (!result[sourceDisplayName]) {
|
|
113
|
+
result[sourceDisplayName] = {};
|
|
114
|
+
}
|
|
115
|
+
// Determine output type (main vs error)
|
|
116
|
+
const outputType = conn.from.isError ? 'error' : 'main';
|
|
117
|
+
// Initialize output type array if not exists
|
|
118
|
+
if (!result[sourceDisplayName][outputType]) {
|
|
119
|
+
result[sourceDisplayName][outputType] = [];
|
|
120
|
+
}
|
|
121
|
+
// Ensure output index array exists
|
|
122
|
+
const outputIndex = conn.from.output;
|
|
123
|
+
while (result[sourceDisplayName][outputType].length <= outputIndex) {
|
|
124
|
+
result[sourceDisplayName][outputType].push([]);
|
|
125
|
+
}
|
|
126
|
+
// Add connection
|
|
127
|
+
result[sourceDisplayName][outputType][outputIndex].push({
|
|
128
|
+
node: targetDisplayName,
|
|
129
|
+
type: 'main',
|
|
130
|
+
index: conn.to.input
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
// Add AI dependencies from nodes
|
|
134
|
+
for (const node of nodes) {
|
|
135
|
+
if (!node.aiDependencies) {
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
const deps = node.aiDependencies;
|
|
139
|
+
const targetDisplayName = node.displayName;
|
|
140
|
+
// Process each AI dependency type
|
|
141
|
+
const aiDepTypes = [
|
|
142
|
+
{ key: 'ai_languageModel', connectionType: 'ai_languageModel' },
|
|
143
|
+
{ key: 'ai_memory', connectionType: 'ai_memory' },
|
|
144
|
+
{ key: 'ai_outputParser', connectionType: 'ai_outputParser' },
|
|
145
|
+
{ key: 'ai_agent', connectionType: 'ai_agent' },
|
|
146
|
+
{ key: 'ai_chain', connectionType: 'ai_chain' },
|
|
147
|
+
{ key: 'ai_textSplitter', connectionType: 'ai_textSplitter' },
|
|
148
|
+
{ key: 'ai_embedding', connectionType: 'ai_embedding' },
|
|
149
|
+
{ key: 'ai_retriever', connectionType: 'ai_retriever' },
|
|
150
|
+
{ key: 'ai_reranker', connectionType: 'ai_reranker' },
|
|
151
|
+
{ key: 'ai_vectorStore', connectionType: 'ai_vectorStore' }
|
|
152
|
+
];
|
|
153
|
+
for (const { key, connectionType } of aiDepTypes) {
|
|
154
|
+
const sourcePropertyName = deps[key];
|
|
155
|
+
if (sourcePropertyName && typeof sourcePropertyName === 'string') {
|
|
156
|
+
const sourceDisplayName = displayNameMap.get(sourcePropertyName);
|
|
157
|
+
if (!sourceDisplayName) {
|
|
158
|
+
console.warn(`Warning: Unknown AI dependency node "${sourcePropertyName}"`);
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
// Initialize source node connections if not exists
|
|
162
|
+
if (!result[sourceDisplayName]) {
|
|
163
|
+
result[sourceDisplayName] = {};
|
|
164
|
+
}
|
|
165
|
+
// Initialize connection type array
|
|
166
|
+
if (!result[sourceDisplayName][connectionType]) {
|
|
167
|
+
result[sourceDisplayName][connectionType] = [[]];
|
|
168
|
+
}
|
|
169
|
+
// Add AI connection
|
|
170
|
+
result[sourceDisplayName][connectionType][0].push({
|
|
171
|
+
node: targetDisplayName,
|
|
172
|
+
type: connectionType,
|
|
173
|
+
index: 0
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
// Handle ai_tool and ai_document (arrays)
|
|
178
|
+
const arrayTypes = [
|
|
179
|
+
{ key: 'ai_tool', connectionType: 'ai_tool' },
|
|
180
|
+
{ key: 'ai_document', connectionType: 'ai_document' }
|
|
181
|
+
];
|
|
182
|
+
for (const { key, connectionType } of arrayTypes) {
|
|
183
|
+
if (deps[key] && Array.isArray(deps[key])) {
|
|
184
|
+
for (const itemPropertyName of deps[key]) {
|
|
185
|
+
const sourceDisplayName = displayNameMap.get(itemPropertyName);
|
|
186
|
+
if (!sourceDisplayName) {
|
|
187
|
+
console.warn(`Warning: Unknown AI ${connectionType} node "${itemPropertyName}"`);
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
// Initialize source node connections if not exists
|
|
191
|
+
if (!result[sourceDisplayName]) {
|
|
192
|
+
result[sourceDisplayName] = {};
|
|
193
|
+
}
|
|
194
|
+
// Initialize connection type array
|
|
195
|
+
if (!result[sourceDisplayName][connectionType]) {
|
|
196
|
+
result[sourceDisplayName][connectionType] = [[]];
|
|
197
|
+
}
|
|
198
|
+
// Add AI connection
|
|
199
|
+
result[sourceDisplayName][connectionType][0].push({
|
|
200
|
+
node: targetDisplayName,
|
|
201
|
+
type: connectionType,
|
|
202
|
+
index: 0
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return result;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Generate deterministic UUID based on property name and position
|
|
212
|
+
*
|
|
213
|
+
* This creates a consistent UUID for the same node across transformations
|
|
214
|
+
* Useful for testing and ensuring stable IDs
|
|
215
|
+
*/
|
|
216
|
+
generateDeterministicId(propertyName, position) {
|
|
217
|
+
// Create hash from property name and position
|
|
218
|
+
const hash = createHash('sha256')
|
|
219
|
+
.update(`${propertyName}-${position[0]}-${position[1]}`)
|
|
220
|
+
.digest('hex');
|
|
221
|
+
// Format as UUID v4
|
|
222
|
+
return [
|
|
223
|
+
hash.substring(0, 8),
|
|
224
|
+
hash.substring(8, 12),
|
|
225
|
+
'4' + hash.substring(13, 16),
|
|
226
|
+
hash.substring(16, 20),
|
|
227
|
+
hash.substring(20, 32)
|
|
228
|
+
].join('-');
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=workflow-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-builder.js","sourceRoot":"","sources":["../../src/compiler/workflow-builder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC;;GAEG;AACH,MAAM,OAAO,eAAe;IACxB;;OAEG;IACH,KA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,CAAC;aACvD,MAAM,CAAC,KAAK,CAAC,CAAC;QAEnB,oBAAoB;QACpB,OAAO;YACH,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;YACpB,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC;YACrB,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;YAC5B,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;YACtB,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;SACzB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC;CACJ"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime helpers for fluent API
|
|
3
|
+
*
|
|
4
|
+
* Implements .out(), .to(), .in(), .uses(), .error()
|
|
5
|
+
*/
|
|
6
|
+
import { NodeProxy } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Create a node proxy for fluent API
|
|
9
|
+
*
|
|
10
|
+
* This allows syntax like:
|
|
11
|
+
* this.ScheduleTrigger.out(0).to(this.Configuration.in(0))
|
|
12
|
+
*/
|
|
13
|
+
export declare function createNodeProxy(propertyName: string): NodeProxy;
|
|
14
|
+
/**
|
|
15
|
+
* Create .output property for AI sub-nodes
|
|
16
|
+
*
|
|
17
|
+
* This allows syntax like:
|
|
18
|
+
* this.Agent.uses({
|
|
19
|
+
* ai_languageModel: this.GeminiModel.output
|
|
20
|
+
* })
|
|
21
|
+
*/
|
|
22
|
+
export declare function createOutputReference(propertyName: string): {
|
|
23
|
+
output: {
|
|
24
|
+
_propertyName: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/decorators/helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAsD,SAAS,EAAE,MAAM,YAAY,CAAC;AAE3F;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,CAsC/D;AA0DD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAMjG"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime helpers for fluent API
|
|
3
|
+
*
|
|
4
|
+
* Implements .out(), .to(), .in(), .uses(), .error()
|
|
5
|
+
*/
|
|
6
|
+
import { connectionTracker } from './links.js';
|
|
7
|
+
/**
|
|
8
|
+
* Create a node proxy for fluent API
|
|
9
|
+
*
|
|
10
|
+
* This allows syntax like:
|
|
11
|
+
* this.ScheduleTrigger.out(0).to(this.Configuration.in(0))
|
|
12
|
+
*/
|
|
13
|
+
export function createNodeProxy(propertyName) {
|
|
14
|
+
const proxy = {
|
|
15
|
+
_propertyName: propertyName,
|
|
16
|
+
out(index) {
|
|
17
|
+
return createOutputConnection(propertyName, index, false);
|
|
18
|
+
},
|
|
19
|
+
in(index) {
|
|
20
|
+
return createInputConnection(propertyName, index);
|
|
21
|
+
},
|
|
22
|
+
error() {
|
|
23
|
+
return createOutputConnection(propertyName, 0, true);
|
|
24
|
+
},
|
|
25
|
+
uses(dependencies) {
|
|
26
|
+
// Extract property names from dependency objects
|
|
27
|
+
const deps = {};
|
|
28
|
+
if (dependencies.ai_languageModel) {
|
|
29
|
+
deps.ai_languageModel = extractPropertyName(dependencies.ai_languageModel.output);
|
|
30
|
+
}
|
|
31
|
+
if (dependencies.ai_memory) {
|
|
32
|
+
deps.ai_memory = extractPropertyName(dependencies.ai_memory.output);
|
|
33
|
+
}
|
|
34
|
+
if (dependencies.ai_outputParser) {
|
|
35
|
+
deps.ai_outputParser = extractPropertyName(dependencies.ai_outputParser.output);
|
|
36
|
+
}
|
|
37
|
+
if (dependencies.ai_tool) {
|
|
38
|
+
deps.ai_tool = dependencies.ai_tool.map(t => extractPropertyName(t.output));
|
|
39
|
+
}
|
|
40
|
+
connectionTracker.addAIDependencies(propertyName, deps);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
return proxy;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Create output connection builder
|
|
47
|
+
*/
|
|
48
|
+
function createOutputConnection(fromNode, output, isError) {
|
|
49
|
+
return {
|
|
50
|
+
_from: { node: fromNode, output, isError },
|
|
51
|
+
to(input) {
|
|
52
|
+
connectionTracker.addConnection(fromNode, output, input._to.node, input._to.input, isError);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Create input connection builder
|
|
58
|
+
*/
|
|
59
|
+
function createInputConnection(toNode, input) {
|
|
60
|
+
return {
|
|
61
|
+
_to: { node: toNode, input }
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Extract property name from node proxy or output object
|
|
66
|
+
*/
|
|
67
|
+
function extractPropertyName(obj) {
|
|
68
|
+
if (obj && obj._propertyName) {
|
|
69
|
+
return obj._propertyName;
|
|
70
|
+
}
|
|
71
|
+
// If it's a raw object with output property, try to extract
|
|
72
|
+
if (obj && typeof obj === 'object') {
|
|
73
|
+
// Look for _propertyName in nested object
|
|
74
|
+
for (const key in obj) {
|
|
75
|
+
if (obj[key] && obj[key]._propertyName) {
|
|
76
|
+
return obj[key]._propertyName;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
throw new Error(`Cannot extract property name from: ${JSON.stringify(obj)}`);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Create .output property for AI sub-nodes
|
|
84
|
+
*
|
|
85
|
+
* This allows syntax like:
|
|
86
|
+
* this.Agent.uses({
|
|
87
|
+
* ai_languageModel: this.GeminiModel.output
|
|
88
|
+
* })
|
|
89
|
+
*/
|
|
90
|
+
export function createOutputReference(propertyName) {
|
|
91
|
+
return {
|
|
92
|
+
output: {
|
|
93
|
+
_propertyName: propertyName
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/decorators/helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,YAAoB;IAChD,MAAM,KAAK,GAAc;QACrB,aAAa,EAAE,YAAY;QAE3B,GAAG,CAAC,KAAa;YACb,OAAO,sBAAsB,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC9D,CAAC;QAED,EAAE,CAAC,KAAa;YACZ,OAAO,qBAAqB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QACtD,CAAC;QAED,KAAK;YACD,OAAO,sBAAsB,CAAC,YAAY,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;QACzD,CAAC;QAED,IAAI,CAAC,YAA6B;YAC9B,iDAAiD;YACjD,MAAM,IAAI,GAAQ,EAAE,CAAC;YAErB,IAAI,YAAY,CAAC,gBAAgB,EAAE,CAAC;gBAChC,IAAI,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,YAAY,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;YACtF,CAAC;YACD,IAAI,YAAY,CAAC,SAAS,EAAE,CAAC;gBACzB,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAAC,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YACxE,CAAC;YACD,IAAI,YAAY,CAAC,eAAe,EAAE,CAAC;gBAC/B,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,YAAY,CAAC,eAAe,CA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AE,CAAC;gBACrC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC;YAClC,CAAC;QACL,CAAC;IACL,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,sCAAsC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACjF,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAoB;IACtD,OAAO;QACH,MAAM,EAAE;YACJ,aAAa,EAAE,YAAY;SAC9B;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decorator exports
|
|
3
|
+
*
|
|
4
|
+
* Public API for workflow TypeScript files
|
|
5
|
+
*/
|
|
6
|
+
export { workflow, getWorkflowMetadata } from './workflow.js';
|
|
7
|
+
export { node, getNodeMetadata } from './node.js';
|
|
8
|
+
export { links, getLinksMethodName, connectionTracker, ConnectionTracker } from './links.js';
|
|
9
|
+
export { createNodeProxy, createOutputReference } from './helpers.js';
|
|
10
|
+
export type { WorkflowDecoratorMetadata, NodeDecoratorMetadata, NodeProxy, OutputConnection, InputConnection, AIDependencyMap } from './types.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAEtE,YAAY,EACR,yBAAyB,EACzB,qBAAqB,EACrB,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,eAAe,EAClB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decorator exports
|
|
3
|
+
*
|
|
4
|
+
* Public API for workflow TypeScript files
|
|
5
|
+
*/
|
|
6
|
+
export { workflow, getWorkflowMetadata } from './workflow.js';
|
|
7
|
+
export { node, getNodeMetadata } from './node.js';
|
|
8
|
+
export { links, getLinksMethodName, connectionTracker, ConnectionTracker } from './links.js';
|
|
9
|
+
export { createNodeProxy, createOutputReference } from './helpers.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @links decorator implementation
|
|
3
|
+
*
|
|
4
|
+
* Marker decorator for the defineRouting() method
|
|
5
|
+
* This method defines connections and AI dependencies
|
|
6
|
+
*/
|
|
7
|
+
import 'reflect-metadata';
|
|
8
|
+
import { AIDependencyMap } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* @links decorator
|
|
11
|
+
*
|
|
12
|
+
* Marks the method that defines workflow routing (connections)
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* @links()
|
|
17
|
+
* defineRouting() {
|
|
18
|
+
* this.ScheduleTrigger.out(0).to(this.Configuration.in(0));
|
|
19
|
+
* this.Configuration.out(0).to(this.BuildProfile.in(0));
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function links(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
24
|
+
/**
|
|
25
|
+
* Get the name of the method marked with @links
|
|
26
|
+
*/
|
|
27
|
+
export declare function getLinksMethodName(target: any): string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Connection storage for tracking during defineRouting() execution
|
|
30
|
+
*/
|
|
31
|
+
export declare class ConnectionTracker {
|
|
32
|
+
private connections;
|
|
33
|
+
private aiDependencies;
|
|
34
|
+
/**
|
|
35
|
+
* Record a connection
|
|
36
|
+
*/
|
|
37
|
+
addConnection(fromNode: string, fromOutput: number, toNode: string, toInput: number, isError?: boolean): void;
|
|
38
|
+
/**
|
|
39
|
+
* Record AI dependencies for a node
|
|
40
|
+
*/
|
|
41
|
+
addAIDependencies(nodeName: string, dependencies: AIDependencyMap): void;
|
|
42
|
+
/**
|
|
43
|
+
* Get all recorded connections
|
|
44
|
+
*/
|
|
45
|
+
getConnections(): {
|
|
46
|
+
from: {
|
|
47
|
+
node: string;
|
|
48
|
+
output: number;
|
|
49
|
+
isError?: boolean;
|
|
50
|
+
};
|
|
51
|
+
to: {
|
|
52
|
+
node: string;
|
|
53
|
+
input: number;
|
|
54
|
+
};
|
|
55
|
+
}[];
|
|
56
|
+
/**
|
|
57
|
+
* Get all AI dependencies
|
|
58
|
+
*/
|
|
59
|
+
getAIDependencies(): Map<string, AIDependencyMap>;
|
|
60
|
+
/**
|
|
61
|
+
* Clear all tracked data
|
|
62
|
+
*/
|
|
63
|
+
clear(): void;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Global connection tracker instance
|
|
67
|
+
* Used during defineRouting() execution to capture connections
|
|
68
|
+
*/
|
|
69
|
+
export declare const connectionTracker: ConnectionTracker;
|
|
70
|
+
//# sourceMappingURL=links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../src/decorators/links.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAoD,eAAe,EAAE,MAAM,YAAY,CAAC;AAE/F;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,KACA,QAAQ,GAAG,EAAE,aAAa,MAAM,EAAE,YAAY,kBAAkB,wBAMpF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,GAAG,IAAI,CAE7D;AAMD;;GAEG;AACH,qBAAa,iBAAiB;IAC1B,OAAO,CAAC,WAAW,CAGX;IAER,OAAO,CAAC,cAAc,CAA2C;IAEjE;;OAEG;IACH,aAAa,CACT,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,OAAO,GAClB,IAAI;IAOP;;OAEG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,GAAG,IAAI;IAIxE;;OAEG;IACH,cAAc;cAhCJ;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,OAAO,CAAA;SAAE;YACrD;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE;;IAmCvC;;OAEG;IACH,iBAAiB;IAIjB;;OAEG;IACH,KAAK,IAAI,IAAI;CAIhB;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @links decorator implementation
|
|
3
|
+
*
|
|
4
|
+
* Marker decorator for the defineRouting() method
|
|
5
|
+
* This method defines connections and AI dependencies
|
|
6
|
+
*/
|
|
7
|
+
import 'reflect-metadata';
|
|
8
|
+
import { METADATA_KEYS } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* @links decorator
|
|
11
|
+
*
|
|
12
|
+
* Marks the method that defines workflow routing (connections)
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* @links()
|
|
17
|
+
* defineRouting() {
|
|
18
|
+
* this.ScheduleTrigger.out(0).to(this.Configuration.in(0));
|
|
19
|
+
* this.Configuration.out(0).to(this.BuildProfile.in(0));
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export function links() {
|
|
24
|
+
return function (target, propertyKey, descriptor) {
|
|
25
|
+
// Mark this method as the routing definition
|
|
26
|
+
Reflect.defineMetadata(METADATA_KEYS.CONNECTIONS, propertyKey, target.constructor);
|
|
27
|
+
return descriptor;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the name of the method marked with @links
|
|
32
|
+
*/
|
|
33
|
+
export function getLinksMethodName(target) {
|
|
34
|
+
return Reflect.getMetadata(METADATA_KEYS.CONNECTIONS, target) || null;
|
|
35
|
+
}
|
|
36
|
+
// =====================================================================
|
|
37
|
+
// CONNECTION TRACKING
|
|
38
|
+
// =====================================================================
|
|
39
|
+
/**
|
|
40
|
+
* Connection storage for tracking during defineRouting() execution
|
|
41
|
+
*/
|
|
42
|
+
export class ConnectionTracker {
|
|
43
|
+
connections = [];
|
|
44
|
+
aiDependencies = new Map();
|
|
45
|
+
/**
|
|
46
|
+
* Record a connection
|
|
47
|
+
*/
|
|
48
|
+
addConnection(fromNode, fromOutput, toNode, toInput, isError) {
|
|
49
|
+
this.connections.push({
|
|
50
|
+
from: { node: fromNode, output: fromOutput, isError },
|
|
51
|
+
to: { node: toNode, input: toInput }
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Record AI dependencies for a node
|
|
56
|
+
*/
|
|
57
|
+
addAIDependencies(nodeName, dependencies) {
|
|
58
|
+
this.aiDependencies.set(nodeName, dependencies);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get all recorded connections
|
|
62
|
+
*/
|
|
63
|
+
getConnections() {
|
|
64
|
+
return this.connections;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Get all AI dependencies
|
|
68
|
+
*/
|
|
69
|
+
getAIDependencies() {
|
|
70
|
+
return this.aiDependencies;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Clear all tracked data
|
|
74
|
+
*/
|
|
75
|
+
clear() {
|
|
76
|
+
this.connections = [];
|
|
77
|
+
this.aiDependencies.clear();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Global connection tracker instance
|
|
82
|
+
* Used during defineRouting() execution to capture connections
|
|
83
|
+
*/
|
|
84
|
+
export const connectionTracker = new ConnectionTracker();
|
|
85
|
+
//# sourceMappingURL=links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"links.js","sourceRoot":"","sources":["../../src/decorators/links.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAsD,MAAM,YAAY,CAAC;AAE/F;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,KAAK;IACjB,OAAO,UAAU,MAAW,EAAE,WAAmB,EAAE,UAA8B;QAC7E,6CAA6C;QAC7C,OAAO,CAAC,cAAc,CAAC,aAAa,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QAEnF,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAW;IAC1C,OAAO,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC;A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