@n8n-as-code/agent-cli 0.2.1 → 0.4.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 +6 -11
- package/dist/assets/n8n-nodes-enriched.json +468750 -0
- package/dist/assets/n8n-nodes-index.json +32359 -8
- package/dist/services/node-schema-provider.d.ts +35 -3
- package/dist/services/node-schema-provider.d.ts.map +1 -1
- package/dist/services/node-schema-provider.js +120 -16
- package/dist/services/node-schema-provider.js.map +1 -1
- package/package.json +4 -5
- package/src/assets/n8n-nodes-index.json +0 -505297
|
@@ -3,11 +3,39 @@ export interface INodeSchemaStub {
|
|
|
3
3
|
displayName: string;
|
|
4
4
|
description: string;
|
|
5
5
|
version: number | number[];
|
|
6
|
+
keywords?: string[];
|
|
7
|
+
operations?: string[];
|
|
8
|
+
useCases?: string[];
|
|
9
|
+
relevanceScore?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface IEnrichedNode {
|
|
12
|
+
name: string;
|
|
13
|
+
displayName: string;
|
|
14
|
+
description: string;
|
|
15
|
+
version: number | number[];
|
|
16
|
+
group?: string[];
|
|
17
|
+
icon?: string;
|
|
18
|
+
schema: {
|
|
19
|
+
properties: any;
|
|
20
|
+
sourcePath: string;
|
|
21
|
+
};
|
|
22
|
+
metadata: {
|
|
23
|
+
keywords: string[];
|
|
24
|
+
operations: string[];
|
|
25
|
+
useCases: string[];
|
|
26
|
+
keywordScore: number;
|
|
27
|
+
hasDocumentation: boolean;
|
|
28
|
+
markdownUrl: string | null;
|
|
29
|
+
markdownFile: string | null;
|
|
30
|
+
};
|
|
6
31
|
}
|
|
7
32
|
export declare class NodeSchemaProvider {
|
|
8
33
|
private index;
|
|
34
|
+
private enrichedIndex;
|
|
9
35
|
private indexPath;
|
|
10
|
-
|
|
36
|
+
private enrichedIndexPath;
|
|
37
|
+
private useEnriched;
|
|
38
|
+
constructor(customIndexPath?: string, useEnriched?: boolean);
|
|
11
39
|
private loadIndex;
|
|
12
40
|
/**
|
|
13
41
|
* Get the full JSON schema for a specific node by name.
|
|
@@ -15,10 +43,14 @@ export declare class NodeSchemaProvider {
|
|
|
15
43
|
*/
|
|
16
44
|
getNodeSchema(nodeName: string): any | null;
|
|
17
45
|
/**
|
|
18
|
-
*
|
|
46
|
+
* Calculate relevance score for a node based on query
|
|
47
|
+
*/
|
|
48
|
+
private calculateRelevance;
|
|
49
|
+
/**
|
|
50
|
+
* Fuzzy search for nodes with improved relevance scoring.
|
|
19
51
|
* Returns a list of matches (stub only, not full schema).
|
|
20
52
|
*/
|
|
21
|
-
searchNodes(query: string): INodeSchemaStub[];
|
|
53
|
+
searchNodes(query: string, limit?: number): INodeSchemaStub[];
|
|
22
54
|
/**
|
|
23
55
|
* List all available nodes (compact format).
|
|
24
56
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-schema-provider.d.ts","sourceRoot":"","sources":["../../src/services/node-schema-provider.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"node-schema-provider.d.ts","sourceRoot":"","sources":["../../src/services/node-schema-provider.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC1B,IAA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index = null;
|
|
13
|
+
enrichedIndex = null;
|
|
13
14
|
indexPath;
|
|
14
|
-
|
|
15
|
+
enrichedIndexPath;
|
|
16
|
+
useEnriched = true;
|
|
17
|
+
constructor(customIndexPath, useEnriched = true) {
|
|
18
|
+
this.useEnriched = useEnriched;
|
|
15
19
|
if (customIndexPath) {
|
|
16
20
|
this.indexPath = customIndexPath;
|
|
21
|
+
this.enrichedIndexPath = customIndexPath.replace('.json', '-enriched.json');
|
|
17
22
|
}
|
|
18
23
|
else {
|
|
19
24
|
// Resolve path to assets/n8n-nodes-index.json
|
|
20
25
|
// In dist structure: dist/services/node-schema-provider.js -> dist/assets/n8n-nodes-index.json
|
|
21
26
|
this.indexPath = path.resolve(_dirname, '../assets/n8n-nodes-index.json');
|
|
27
|
+
this.enrichedIndexPath = path.resolve(_dirname, '../assets/n8n-nodes-enriched.json');
|
|
22
28
|
}
|
|
23
29
|
}
|
|
24
30
|
loadIndex() {
|
|
25
31
|
if (this.index)
|
|
26
32
|
return;
|
|
33
|
+
// Try to load enriched index first
|
|
34
|
+
if (this.useEnriched && fs.existsSync(this.enrichedIndexPath)) {
|
|
35
|
+
try {
|
|
36
|
+
const content = fs.readFileSync(this.enrichedIndexPath, 'utf-8');
|
|
37
|
+
this.enrichedIndex = JSON.parse(content);
|
|
38
|
+
this.index = this.enrichedIndex; // Use enriched as primary
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
console.warn(`Failed to load enriched index: ${error.message}, falling back to basic index`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// Fallback to basic index
|
|
27
46
|
try {
|
|
28
47
|
if (!fs.existsSync(this.indexPath)) {
|
|
29
48
|
throw new Error(`n8n Node Index not found at: ${this.indexPath}. Run 'npm run build' in @n8n-as-code/agent-cli.`);
|
|
30
49
|
}
|
|
31
50
|
const content = fs.readFileSync(this.indexPath, 'utf-8');
|
|
32
|
-
|
|
51
|
+
const basicIndex = JSON.parse(content);
|
|
52
|
+
// Convert basic index to enriched-like structure for compatibility
|
|
53
|
+
if (Array.isArray(basicIndex.nodes)) {
|
|
54
|
+
this.index = {
|
|
55
|
+
nodes: {}
|
|
56
|
+
};
|
|
57
|
+
for (const node of basicIndex.nodes) {
|
|
58
|
+
this.index.nodes[node.name] = node;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
this.index = basicIndex;
|
|
63
|
+
}
|
|
33
64
|
}
|
|
34
65
|
catch (error) {
|
|
35
66
|
throw new Error(`Failed to load n8n node index: ${error.message}`);
|
|
@@ -51,30 +82,100 @@ export class NodeSchemaProvider {
|
|
|
51
82
|
return found ? this.index.nodes[found] : null;
|
|
52
83
|
}
|
|
53
84
|
/**
|
|
54
|
-
*
|
|
85
|
+
* Calculate relevance score for a node based on query
|
|
86
|
+
*/
|
|
87
|
+
calculateRelevance(query, node, key) {
|
|
88
|
+
const lowerQuery = query.toLowerCase();
|
|
89
|
+
let score = 0;
|
|
90
|
+
// Exact name match (highest priority)
|
|
91
|
+
if (key.toLowerCase() === lowerQuery) {
|
|
92
|
+
score += 1000;
|
|
93
|
+
}
|
|
94
|
+
else if (key.toLowerCase().includes(lowerQuery)) {
|
|
95
|
+
score += 500;
|
|
96
|
+
}
|
|
97
|
+
// Display name match
|
|
98
|
+
const displayName = (node.displayName || '').toLowerCase();
|
|
99
|
+
if (displayName === lowerQuery) {
|
|
100
|
+
score += 800;
|
|
101
|
+
}
|
|
102
|
+
else if (displayName.includes(lowerQuery)) {
|
|
103
|
+
score += 400;
|
|
104
|
+
}
|
|
105
|
+
// Keyword match (from enriched metadata)
|
|
106
|
+
if (node.metadata?.keywords) {
|
|
107
|
+
const keywords = node.metadata.keywords;
|
|
108
|
+
if (keywords.includes(lowerQuery)) {
|
|
109
|
+
score += 300;
|
|
110
|
+
}
|
|
111
|
+
// Partial keyword match
|
|
112
|
+
const matchingKeywords = keywords.filter((k) => k.includes(lowerQuery) || lowerQuery.includes(k));
|
|
113
|
+
score += matchingKeywords.length * 50;
|
|
114
|
+
}
|
|
115
|
+
// Operations match
|
|
116
|
+
if (node.metadata?.operations) {
|
|
117
|
+
const matchingOps = node.metadata.operations.filter((op) => op.toLowerCase().includes(lowerQuery));
|
|
118
|
+
score += matchingOps.length * 100;
|
|
119
|
+
}
|
|
120
|
+
// Use cases match
|
|
121
|
+
if (node.metadata?.useCases) {
|
|
122
|
+
const matchingUseCases = node.metadata.useCases.filter((uc) => uc.toLowerCase().includes(lowerQuery));
|
|
123
|
+
score += matchingUseCases.length * 80;
|
|
124
|
+
}
|
|
125
|
+
// Description match (lower priority)
|
|
126
|
+
const description = (node.description || '').toLowerCase();
|
|
127
|
+
if (description.includes(lowerQuery)) {
|
|
128
|
+
score += 100;
|
|
129
|
+
}
|
|
130
|
+
// Bonus for nodes with high keyword scores (AI/popular nodes)
|
|
131
|
+
if (node.metadata?.keywordScore) {
|
|
132
|
+
score += node.metadata.keywordScore * 0.5;
|
|
133
|
+
}
|
|
134
|
+
// Multi-word query: check if all words match
|
|
135
|
+
const queryWords = lowerQuery.split(/\s+/).filter(w => w.length > 2);
|
|
136
|
+
if (queryWords.length > 1) {
|
|
137
|
+
const allFields = [
|
|
138
|
+
key.toLowerCase(),
|
|
139
|
+
displayName,
|
|
140
|
+
description,
|
|
141
|
+
...(node.metadata?.keywords || []),
|
|
142
|
+
...(node.metadata?.operations || []),
|
|
143
|
+
...(node.metadata?.useCases || [])
|
|
144
|
+
].join(' ');
|
|
145
|
+
const matchedWords = queryWords.filter(word => allFields.includes(word));
|
|
146
|
+
if (matchedWords.length === queryWords.length) {
|
|
147
|
+
score += 200 * queryWords.length;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return score;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Fuzzy search for nodes with improved relevance scoring.
|
|
55
154
|
* Returns a list of matches (stub only, not full schema).
|
|
56
155
|
*/
|
|
57
|
-
searchNodes(query) {
|
|
156
|
+
searchNodes(query, limit = 20) {
|
|
58
157
|
this.loadIndex();
|
|
59
158
|
const lowerQuery = query.toLowerCase();
|
|
60
|
-
const
|
|
159
|
+
const scoredResults = [];
|
|
61
160
|
for (const [key, node] of Object.entries(this.index.nodes)) {
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (nameMatch || displayMatch || descMatch) {
|
|
66
|
-
results.push({
|
|
161
|
+
const score = this.calculateRelevance(query, node, key);
|
|
162
|
+
if (score > 0) {
|
|
163
|
+
scoredResults.push({
|
|
67
164
|
name: node.name || key,
|
|
68
165
|
displayName: node.displayName || key,
|
|
69
166
|
description: node.description || '',
|
|
70
|
-
version: node.version
|
|
167
|
+
version: node.version,
|
|
168
|
+
keywords: node.metadata?.keywords || [],
|
|
169
|
+
operations: node.metadata?.operations || [],
|
|
170
|
+
useCases: node.metadata?.useCases || [],
|
|
171
|
+
relevanceScore: score,
|
|
172
|
+
score
|
|
71
173
|
});
|
|
72
174
|
}
|
|
73
|
-
// Cap results to avoid overwhelming output
|
|
74
|
-
if (results.length >= 20)
|
|
75
|
-
break;
|
|
76
175
|
}
|
|
77
|
-
|
|
176
|
+
// Sort by score (highest first) and take top results
|
|
177
|
+
scoredResults.sort((a, b) => b.score - a.score);
|
|
178
|
+
return scoredResults.slice(0, limit).map(({ score, ...rest }) => rest);
|
|
78
179
|
}
|
|
79
180
|
/**
|
|
80
181
|
* List all available nodes (compact format).
|
|
@@ -85,7 +186,10 @@ export class NodeSchemaProvider {
|
|
|
85
186
|
name: node.name,
|
|
86
187
|
displayName: node.displayName,
|
|
87
188
|
description: node.description || '',
|
|
88
|
-
version: node.version
|
|
189
|
+
version: node.version,
|
|
190
|
+
keywords: node.metadata?.keywords || [],
|
|
191
|
+
operations: node.metadata?.operations || [],
|
|
192
|
+
useCases: node.metadata?.useCases || []
|
|
89
193
|
}));
|
|
90
194
|
}
|
|
91
195
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-schema-provider.js","sourceRoot":"","sources":["../../src/services/node-schema-provider.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,mDAAmD;AACnD,MAAM,SAAS,GAAG,OAAO,MAAM,CAAC,IAAI,KAAK,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG;IACnE,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IAChC,CAAC,CAAC,CAAC,OAAO,UAAU,KAAK,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAE5D,MAAM,QAAQ,GAAG,OAAO,SAAS,KAAK,WAAW;IAC7C,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAmB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"node-schema-provider.js","sourceRoot":"","sources":["../../src/services/node-schema-provider.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,mDAAmD;AACnD,MAAM,SAAS,GAAG,OAAO,MAAM,CAAC,IAAI,KAAK,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG;IACnE,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IAChC,CAAC,CAAC,CAAC,OAAO,UAAU,KAAK,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAE5D,MAAM,QAAQ,GAAG,OAAO,SAAS,KAAK,WAAW;IAC7C,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAmB,CAAC,CAAC;A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ACvC,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,IAAI,EAAE;YAC3C,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,IAAI,EAAE;SAC1C,CAAC,CAAC,CAAC;IACR,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n-as-code/agent-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "AI Agent Tools for n8n-as-code (Search, Get Schema)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"n8n-agent": "./dist/cli.js"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
|
-
"prebuild": "node ../../scripts/ensure-n8n-cache.cjs && node ../../scripts/generate-n8n-index.cjs",
|
|
12
|
+
"prebuild": "node ../../scripts/ensure-n8n-cache.cjs && node ../../scripts/generate-n8n-index.cjs && node ../../scripts/download-n8n-docs.cjs && node ../../scripts/enrich-nodes-index.cjs",
|
|
13
13
|
"build": "tsc -b",
|
|
14
|
-
"postbuild": "mkdir -p dist/assets && cp src/assets/n8n-nodes-index.json dist/assets/",
|
|
14
|
+
"postbuild": "mkdir -p dist/assets && cp src/assets/n8n-nodes-index.json dist/assets/ && (cp src/assets/n8n-nodes-enriched.json dist/assets/ 2>/dev/null || true)",
|
|
15
15
|
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|
|
16
16
|
"test": "node --experimental-vm-modules ../../node_modules/.bin/jest"
|
|
17
17
|
},
|
|
@@ -27,8 +27,7 @@
|
|
|
27
27
|
"typescript": "^5.3.3"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
|
-
"dist/"
|
|
31
|
-
"src/assets/"
|
|
30
|
+
"dist/"
|
|
32
31
|
],
|
|
33
32
|
"publishConfig": {
|
|
34
33
|
"access": "public"
|