@n8n/ai-workflow-builder 1.22.0 → 1.23.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 (43) hide show
  1. package/dist/build.tsbuildinfo +1 -1
  2. package/dist/code-builder/code-builder-agent.js +2 -2
  3. package/dist/code-builder/code-builder-agent.js.map +1 -1
  4. package/dist/code-builder/handlers/chat-setup-handler.d.ts +1 -1
  5. package/dist/code-builder/handlers/chat-setup-handler.js +2 -2
  6. package/dist/code-builder/handlers/chat-setup-handler.js.map +1 -1
  7. package/dist/code-builder/index.d.ts +2 -5
  8. package/dist/code-builder/index.js +1 -5
  9. package/dist/code-builder/index.js.map +1 -1
  10. package/dist/code-builder/tools/code-builder-get.tool.d.ts +1 -13
  11. package/dist/code-builder/tools/code-builder-get.tool.js +2 -354
  12. package/dist/code-builder/tools/code-builder-get.tool.js.map +1 -1
  13. package/dist/code-builder/tools/code-builder-search.tool.d.ts +1 -10
  14. package/dist/code-builder/tools/code-builder-search.tool.js +2 -325
  15. package/dist/code-builder/tools/code-builder-search.tool.js.map +1 -1
  16. package/dist/code-builder/tools/get-suggested-nodes.tool.d.ts +1 -1
  17. package/dist/code-builder/tools/get-suggested-nodes.tool.js +3 -68
  18. package/dist/code-builder/tools/get-suggested-nodes.tool.js.map +1 -1
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.js +1 -4
  21. package/dist/index.js.map +1 -1
  22. package/dist/subgraphs/discovery.subgraph.d.ts +1 -1
  23. package/dist/subgraphs/discovery.subgraph.js +3 -3
  24. package/dist/subgraphs/discovery.subgraph.js.map +1 -1
  25. package/dist/tools/node-details.tool.js +4 -4
  26. package/dist/tools/node-details.tool.js.map +1 -1
  27. package/dist/types/discovery-types.d.ts +1 -1
  28. package/package.json +11 -11
  29. package/dist/code-builder/engines/code-builder-node-search-engine.d.ts +0 -19
  30. package/dist/code-builder/engines/code-builder-node-search-engine.js +0 -243
  31. package/dist/code-builder/engines/code-builder-node-search-engine.js.map +0 -1
  32. package/dist/code-builder/tools/suggested-nodes-data.d.ts +0 -11
  33. package/dist/code-builder/tools/suggested-nodes-data.js +0 -236
  34. package/dist/code-builder/tools/suggested-nodes-data.js.map +0 -1
  35. package/dist/code-builder/utils/discriminator-utils.d.ts +0 -22
  36. package/dist/code-builder/utils/discriminator-utils.js +0 -85
  37. package/dist/code-builder/utils/discriminator-utils.js.map +0 -1
  38. package/dist/code-builder/utils/node-type-parser.d.ts +0 -18
  39. package/dist/code-builder/utils/node-type-parser.js +0 -67
  40. package/dist/code-builder/utils/node-type-parser.js.map +0 -1
  41. package/dist/utils/resource-operation-extractor.d.ts +0 -26
  42. package/dist/utils/resource-operation-extractor.js +0 -156
  43. package/dist/utils/resource-operation-extractor.js.map +0 -1
@@ -1,236 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.categoryList = exports.suggestedNodesData = void 0;
4
- exports.suggestedNodesData = {
5
- chatbot: {
6
- description: 'Receiving chat messages and replying (built-in chat, Telegram, Slack, etc.)',
7
- patternHint: 'Chat Trigger → AI Agent → Memory → Response',
8
- nodes: [
9
- {
10
- name: '@n8n/n8n-nodes-langchain.chatTrigger',
11
- note: 'When loadPreviousSession is set to memory, the downstream Agent must also have its own memory subnode to maintain conversation context during processing',
12
- },
13
- {
14
- name: '@n8n/n8n-nodes-langchain.agent',
15
- note: 'Every agent in a conversational workflow MUST have a memory subnode connected. If multiple agents share the same conversation, they must use the same memory session key',
16
- },
17
- { name: '@n8n/n8n-nodes-langchain.lmChatOpenAi' },
18
- { name: '@n8n/n8n-nodes-langchain.lmChatGoogleGemini' },
19
- {
20
- name: '@n8n/n8n-nodes-langchain.memoryBufferWindow',
21
- note: 'Maintains short-term conversation history. Must be connected as a subnode to every Agent that participates in a conversation. When multiple agents share a conversation, use the same session key across all of them',
22
- },
23
- {
24
- name: '@n8n/n8n-nodes-langchain.retrieverVectorStore',
25
- note: 'Connects any Vector Store (Pinecone, Qdrant, Supabase, In-Memory, etc.) to an AI Agent for RAG. Use this as a subnode between the vector store and the agent to retrieve relevant documents when answering questions',
26
- },
27
- { name: 'n8n-nodes-base.slack' },
28
- { name: 'n8n-nodes-base.telegram' },
29
- { name: 'n8n-nodes-base.whatsApp' },
30
- { name: 'n8n-nodes-base.discord' },
31
- ],
32
- },
33
- notification: {
34
- description: 'Sending alerts or updates via email, chat, SMS when events occur',
35
- patternHint: 'Trigger → Condition → Send (Email/Slack/SMS)',
36
- nodes: [
37
- { name: 'n8n-nodes-base.webhook', note: 'Event-based notifications from external systems' },
38
- {
39
- name: 'n8n-nodes-base.scheduleTrigger',
40
- note: 'Periodic monitoring and batch notifications',
41
- },
42
- {
43
- name: 'n8n-nodes-base.gmail',
44
- note: "Default to this because it's easy for users to setup",
45
- },
46
- { name: 'n8n-nodes-base.slack' },
47
- { name: 'n8n-nodes-base.telegram' },
48
- { name: 'n8n-nodes-base.twilio' },
49
- {
50
- name: 'n8n-nodes-base.httpRequest',
51
- note: 'For services without dedicated nodes (Teams, Discord)',
52
- },
53
- { name: 'n8n-nodes-base.if', note: 'Check alert conditions before sending' },
54
- {
55
- name: 'n8n-nodes-base.switch',
56
- note: 'If routing by severity/type is needed, use Switch to direct to different channels',
57
- },
58
- ],
59
- },
60
- scheduling: {
61
- description: 'Running actions at specific times or intervals',
62
- patternHint: 'Schedule Trigger → Fetch → Process → Act',
63
- nodes: [
64
- { name: 'n8n-nodes-base.scheduleTrigger' },
65
- { name: 'n8n-nodes-base.httpRequest' },
66
- { name: 'n8n-nodes-base.set' },
67
- { name: 'n8n-nodes-base.wait', note: 'Respect rate limits between API calls' },
68
- ],
69
- },
70
- data_transformation: {
71
- description: 'Cleaning, formatting, or restructuring data',
72
- patternHint: 'Input → Filter/Map → Transform → Output',
73
- nodes: [
74
- { name: 'n8n-nodes-base.set' },
75
- { name: 'n8n-nodes-base.if', note: 'Use early to validate inputs' },
76
- { name: 'n8n-nodes-base.filter', note: 'Use early to reduce data volume' },
77
- { name: 'n8n-nodes-base.summarize', note: 'Pivot table-style aggregations' },
78
- { name: 'n8n-nodes-base.aggregate', note: 'Combine multiple items into one' },
79
- {
80
- name: 'n8n-nodes-base.splitOut',
81
- note: 'Convert single item with array into multiple items',
82
- },
83
- { name: 'n8n-nodes-base.sort' },
84
- { name: 'n8n-nodes-base.limit' },
85
- { name: 'n8n-nodes-base.removeDuplicates' },
86
- {
87
- name: 'n8n-nodes-base.splitInBatches',
88
- note: 'For large datasets (100+ items), batch processing prevents timeouts',
89
- },
90
- ],
91
- },
92
- data_persistence: {
93
- description: 'Storing, updating, or retrieving records from persistent storage',
94
- patternHint: 'Trigger → Process → Store (DataTable/Sheets)',
95
- nodes: [
96
- { name: 'n8n-nodes-base.dataTable', note: 'PREFERRED - no external config needed' },
97
- {
98
- name: 'n8n-nodes-base.googleSheets',
99
- note: 'For collaboration needs; if >10k rows expected, consider DataTable instead',
100
- },
101
- {
102
- name: 'n8n-nodes-base.airtable',
103
- note: 'If relationships between tables are needed',
104
- },
105
- { name: 'n8n-nodes-base.postgres' },
106
- { name: 'n8n-nodes-base.mySql' },
107
- { name: 'n8n-nodes-base.mongoDb' },
108
- ],
109
- },
110
- data_extraction: {
111
- description: 'Pulling specific information from structured or unstructured inputs',
112
- patternHint: 'Source → Extract → Parse → Structure',
113
- nodes: [
114
- {
115
- name: 'n8n-nodes-base.extractFromFile',
116
- note: 'For multiple file types, route by file type first with IF/Switch',
117
- },
118
- { name: 'n8n-nodes-base.htmlExtract', note: 'JS-rendered content may be empty' },
119
- { name: 'n8n-nodes-base.splitOut', note: 'Use before Loop Over Items for arrays' },
120
- {
121
- name: 'n8n-nodes-base.splitInBatches',
122
- note: 'Process 200 rows at a time for memory',
123
- },
124
- { name: 'n8n-nodes-base.code' },
125
- { name: '@n8n/n8n-nodes-langchain.informationExtractor', note: 'For unstructured text' },
126
- {
127
- name: '@n8n/n8n-nodes-langchain.chainSummarization',
128
- note: 'Context window limits may truncate',
129
- },
130
- ],
131
- },
132
- document_processing: {
133
- description: 'Taking action on content within files (PDFs, Word docs, images)',
134
- patternHint: 'Trigger → Extract Text → AI Parse → Store',
135
- nodes: [
136
- {
137
- name: 'n8n-nodes-base.gmailTrigger',
138
- },
139
- { name: 'n8n-nodes-base.googleDriveTrigger' },
140
- {
141
- name: 'n8n-nodes-base.extractFromFile',
142
- note: 'Different file types require different operations - route accordingly',
143
- },
144
- { name: 'n8n-nodes-base.awsTextract', note: 'For tables and forms in scanned docs' },
145
- { name: 'n8n-nodes-base.mindee', note: 'Specialized invoice/receipt parsing' },
146
- { name: '@n8n/n8n-nodes-langchain.agent' },
147
- {
148
- name: '@n8n/n8n-nodes-langchain.documentDefaultDataLoader',
149
- note: 'Loads binary files (PDF, CSV, JSON, DOCX, EPUB, text) into LangChain Documents. Auto-detects format from MIME type. Requires a preceding node that outputs binary data',
150
- },
151
- {
152
- name: '@n8n/n8n-nodes-langchain.vectorStoreInMemory',
153
- note: 'No external dependencies needed',
154
- },
155
- { name: 'n8n-nodes-base.splitInBatches', note: 'Process 5-10 files at a time' },
156
- ],
157
- },
158
- form_input: {
159
- description: 'Gathering data from users via forms',
160
- patternHint: 'Form Trigger → Validate → Store → Respond',
161
- nodes: [
162
- { name: 'n8n-nodes-base.formTrigger', note: 'ALWAYS store raw data to persistent storage' },
163
- { name: 'n8n-nodes-base.form', note: 'Each node is one page/step' },
164
- { name: 'n8n-nodes-base.dataTable', note: 'PREFERRED for form data storage' },
165
- { name: 'n8n-nodes-base.googleSheets' },
166
- { name: 'n8n-nodes-base.airtable' },
167
- ],
168
- },
169
- content_generation: {
170
- description: 'Creating text, images, audio, or video',
171
- patternHint: 'Trigger → Generate (Text/Image/Video) → Deliver',
172
- nodes: [
173
- { name: '@n8n/n8n-nodes-langchain.agent', note: 'For text generation' },
174
- {
175
- name: '@n8n/n8n-nodes-langchain.openAi',
176
- note: 'Use for image/video generation. DALL-E, TTS, Sora video generation',
177
- },
178
- { name: '@n8n/n8n-nodes-langchain.lmChatGoogleGemini', note: 'Imagen, video generation' },
179
- { name: 'n8n-nodes-base.httpRequest', note: 'For APIs without dedicated nodes' },
180
- { name: 'n8n-nodes-base.editImage', note: 'Resize, crop, format conversion' },
181
- { name: 'n8n-nodes-base.markdown', note: 'Convert to HTML' },
182
- { name: 'n8n-nodes-base.facebookGraphApi' },
183
- {
184
- name: 'n8n-nodes-base.wait',
185
- note: 'Video generation is async, use wait while polling for updated',
186
- },
187
- ],
188
- },
189
- triage: {
190
- description: 'Classifying data for routing or prioritization',
191
- patternHint: 'Trigger → Classify → Route → Act',
192
- nodes: [
193
- {
194
- name: '@n8n/n8n-nodes-langchain.agent',
195
- note: 'For consistent/deterministic classification, always use structured output parser and set temperature 0-0.2',
196
- },
197
- {
198
- name: '@n8n/n8n-nodes-langchain.outputParserStructured',
199
- note: 'Critical to ensure agent output is consistent and matching general schema',
200
- },
201
- ],
202
- },
203
- scraping_and_research: {
204
- description: 'Collecting information from websites or APIs',
205
- patternHint: 'Trigger → Fetch → Extract → Store',
206
- nodes: [
207
- {
208
- name: 'n8n-nodes-base.dataTable',
209
- note: 'Default storage for scraped data when the user does not specify a destination. No external config needed. Always include a storage step in scraping workflows',
210
- },
211
- {
212
- name: 'n8n-nodes-base.phantombuster',
213
- note: 'Use this for social media requests: LinkedIn, Facebook, Instagram, Twitter, etc.',
214
- },
215
- {
216
- name: '@n8n/n8n-nodes-langchain.toolSerpApi',
217
- note: 'Give agent web search capability, get up-to-date information from websites.',
218
- },
219
- { name: 'n8n-nodes-base.perplexity', note: 'Recommended for fetching up-to-date news' },
220
- { name: 'n8n-nodes-base.perplexityTool', note: 'Recommended for fetching up-to-date news' },
221
- {
222
- name: 'n8n-nodes-base.htmlExtract',
223
- note: 'Use to extract HTML content from http requests. Though, JS-rendered sites may return empty',
224
- },
225
- {
226
- name: 'n8n-nodes-base.splitInBatches',
227
- note: 'Use to batch the processing of items. General recommendation: 200 rows at a time if processing is fast',
228
- },
229
- { name: 'n8n-nodes-base.wait', note: 'Use this to avoid rate limits (429 errors)' },
230
- { name: 'n8n-nodes-base.httpRequest' },
231
- { name: 'n8n-nodes-base.httpRequestTool' },
232
- ],
233
- },
234
- };
235
- exports.categoryList = Object.keys(exports.suggestedNodesData);
236
- //# sourceMappingURL=suggested-nodes-data.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"suggested-nodes-data.js","sourceRoot":"","sources":["../../../src/code-builder/tools/suggested-nodes-data.ts"],"names":[],"mappings":";;;AAgBa,QAAA,kBAAkB,GAAiC;IAC/D,OAAO,EAAE;QACR,WAAW,EAAE,6EAA6E;QAC1F,WAAW,EAAE,6CAA6C;QAC1D,KAAK,EAAE;YACN;gBACC,IAAI,EAAE,sCAAsC;gBAC5C,IAAI,EAAE,0JAA0J;aAChK;YACD;gBACC,IAAI,EAAE,gCAAgC;gBACtC,IAAI,EAAE,0KAA0K;aAChL;YACD,EAAE,IAAI,EAAE,uCAAuC,EAAE;YACjD,EAAE,IAAI,EAAE,6CAA6C,EAAE;YACvD;gBACC,IAAI,EAAE,6CAA6C;gBACnD,IAAI,EAAE,sNAAsN;aAC5N;YACD;gBACC,IAAI,EAAE,+CAA+C;gBACrD,IAAI,EAAE,sNAAsN;aAC5N;YACD,EAAE,IAAI,EAAE,sBAAsB,EAAE;YAChC,EAAE,IAAI,EAAE,yBAAyB,EAAE;YACnC,EAAE,IAAI,EAAE,yBAAyB,EAAE;YACnC,EAAE,IAAI,EAAE,wBAAwB,EAAE;SAClC;KACD;IAED,YAAY,EAAE;QACb,WAAW,EAAE,kEAAkE;QAC/E,WAAW,EAAE,8CAA8C;QAC3D,KAAK,EAAE;YACN,EAAE,IAAI,EAAE,wBAAwB,EAAE,IAAI,EAAE,iDAAiD,EAAE;YAC3F;gBACC,IAAI,EAAE,gCAAgC;gBACtC,IAAI,EAAE,6CAA6C;aACnD;YACD;gBACC,IAAI,EAAE,sBAAsB;gBAC5B,IAAI,EAAE,sDAAsD;aAC5D;YACD,EAAE,IAAI,EAAE,sBAAs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AAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,+DAA+D;aACrE;SACD;KACD;IAED,MAAM,EAAE;QACP,WAAW,EAAE,gDAAgD;QAC7D,WAAW,EAAE,kCAAkC;QAC/C,KAAK,EAAE;YACN;gBACC,IAAI,EAAE,gCAAgC;gBACtC,IAAI,EAAE,4GAA4G;aAClH;YACD;gBACC,IAAI,EAAE,iDAAiD;gBACvD,IAAI,EAAE,2EAA2E;aACjF;SACD;KACD;IAED,qBAAqB,EAAE;QACtB,WAAW,EAAE,8CAA8C;QAC3D,WAAW,EAAE,mCAAmC;QAChD,KAAK,EAAE;YACN;gBACC,IAAI,EAAE,0BAA0B;gBAChC,IAAI,EAAE,+JAA+J;aACrK;YACD;gBACC,IAAI,EAAE,8BAA8B;gBACpC,IAAI,EAAE,kFAAkF;aACxF;YACD;gBACC,IAAI,EAAE,sCAAsC;gBAC5C,IAAI,EAAE,6EAA6E;aACnF;YACD,EAAE,IAAI,EAAE,2BAA2B,EAAE,IAAI,EAAE,0CAA0C,EAAE;YACvF,EAAE,IAAI,EAAE,+BAA+B,EAAE,IAAI,EAAE,0CAA0C,EAAE;YAC3F;gBACC,IAAI,EAAE,4BAA4B;gBAClC,IAAI,EAAE,4FAA4F;aAClG;YACD;gBACC,IAAI,EAAE,+BAA+B;gBACrC,IAAI,EAAE,wGAAwG;aAC9G;YACD,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,4CAA4C,EAAE;YACnF,EAAE,IAAI,EAAE,4BAA4B,EAAE;YACtC,EAAE,IAAI,EAAE,gCAAgC,EAAE;SAC1C;KACD;CACD,CAAC;AAEW,QAAA,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,0BAAkB,CAAC,CAAC"}
@@ -1,22 +0,0 @@
1
- import type { INodeTypeDescription, IParameterBuilderHint, NodeConnectionType } from 'n8n-workflow';
2
- export interface ModeInfo {
3
- value: string;
4
- displayName: string;
5
- outputConnectionType?: NodeConnectionType;
6
- description?: string;
7
- builderHint?: IParameterBuilderHint;
8
- }
9
- export interface ModeDiscriminatorInfo {
10
- modes: ModeInfo[];
11
- }
12
- export declare function extractModeDiscriminator(nodeType: INodeTypeDescription, nodeVersion: number): ModeDiscriminatorInfo | null;
13
- export interface OperationOnlyInfo {
14
- value: string;
15
- displayName: string;
16
- description?: string;
17
- builderHint?: IParameterBuilderHint;
18
- }
19
- export interface OperationOnlyDiscriminatorInfo {
20
- operations: OperationOnlyInfo[];
21
- }
22
- export declare function extractOperationOnlyDiscriminator(nodeType: INodeTypeDescription, nodeVersion: number): OperationOnlyDiscriminatorInfo | null;
@@ -1,85 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.extractModeDiscriminator = extractModeDiscriminator;
4
- exports.extractOperationOnlyDiscriminator = extractOperationOnlyDiscriminator;
5
- function extractModeDiscriminator(nodeType, nodeVersion) {
6
- const properties = nodeType.properties;
7
- if (!properties || properties.length === 0) {
8
- return null;
9
- }
10
- const modeProperty = properties.find((prop) => prop.name === 'mode' &&
11
- prop.type === 'options' &&
12
- isPropertyVisibleForVersion(prop, nodeVersion) &&
13
- !prop.displayOptions?.show?.operation &&
14
- !prop.displayOptions?.show?.resource);
15
- if (!modeProperty?.options) {
16
- return null;
17
- }
18
- const modes = modeProperty.options
19
- .filter((opt) => typeof opt === 'object' && opt !== null && 'value' in opt && typeof opt.value === 'string')
20
- .map((opt) => ({
21
- value: opt.value,
22
- displayName: opt.name,
23
- outputConnectionType: opt.outputConnectionType,
24
- description: opt.description,
25
- builderHint: opt.builderHint,
26
- }));
27
- if (modes.length === 0) {
28
- return null;
29
- }
30
- return { modes };
31
- }
32
- function extractOperationOnlyDiscriminator(nodeType, nodeVersion) {
33
- const properties = nodeType.properties;
34
- if (!properties || properties.length === 0) {
35
- return null;
36
- }
37
- const hasResource = properties.some((prop) => prop.name === 'resource' &&
38
- prop.type === 'options' &&
39
- isPropertyVisibleForVersion(prop, nodeVersion));
40
- if (hasResource) {
41
- return null;
42
- }
43
- const operationProperty = properties.find((prop) => prop.name === 'operation' &&
44
- prop.type === 'options' &&
45
- isPropertyVisibleForVersion(prop, nodeVersion));
46
- if (!operationProperty?.options) {
47
- return null;
48
- }
49
- const operations = operationProperty.options
50
- .filter((opt) => typeof opt === 'object' && opt !== null && 'value' in opt && typeof opt.value === 'string')
51
- .map((opt) => ({
52
- value: opt.value,
53
- displayName: opt.name,
54
- description: opt.description,
55
- builderHint: opt.builderHint,
56
- }));
57
- if (operations.length === 0) {
58
- return null;
59
- }
60
- return { operations };
61
- }
62
- function isPropertyVisibleForVersion(property, nodeVersion) {
63
- const displayOptions = property.displayOptions;
64
- if (!displayOptions) {
65
- return true;
66
- }
67
- const showVersion = displayOptions.show?.['@version'];
68
- if (showVersion) {
69
- if (Array.isArray(showVersion)) {
70
- if (!showVersion.includes(nodeVersion)) {
71
- return false;
72
- }
73
- }
74
- }
75
- const hideVersion = displayOptions.hide?.['@version'];
76
- if (hideVersion) {
77
- if (Array.isArray(hideVersion)) {
78
- if (hideVersion.includes(nodeVersion)) {
79
- return false;
80
- }
81
- }
82
- }
83
- return true;
84
- }
85
- //# sourceMappingURL=discriminator-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"discriminator-utils.js","sourceRoot":"","sources":["../../../src/code-builder/utils/discriminator-utils.ts"],"names":[],"mappings":";;AA2CA,4DAkDC;AAuBD,8EAwDC;AAjID,SAAgB,wBAAwB,CACvC,QAA8B,EAC9B,WAAmB;IAEnB,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;IACvC,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5C,OAAO,IAAI,CAAC;IACb,CAAC;IAGD,MAAM,YAAY,GAAG,UAAU,CAAC,IAAI,CACnC,CAAC,IAAI,EAAE,EAAE,CACR,IAAI,CAAC,IAAI,KAAK,MAAM;QACpB,IAAI,CAAC,IAAI,KAAK,SAAS;QACvB,2BA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jB,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YAChC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;gBACxC,OAAO,KAAK,CAAC;YACd,CAAC;QACF,CAAC;IACF,CAAC;IAGD,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC;IACtD,IAAI,WAAW,EAAE,CAAC;QACjB,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YAChC,IAAI,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;gBACvC,OAAO,KAAK,CAAC;YACd,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC"}
@@ -1,18 +0,0 @@
1
- import type { INodeTypeDescription } from 'n8n-workflow';
2
- export interface ParsedNodeType {
3
- id: string;
4
- displayName: string;
5
- description: string;
6
- version: number;
7
- isTrigger: boolean;
8
- }
9
- export declare class NodeTypeParser {
10
- private nodeTypes;
11
- private nodeTypeIndex;
12
- private searchEngine;
13
- constructor(nodeTypes: INodeTypeDescription[]);
14
- private buildIndex;
15
- private isTriggerNode;
16
- searchNodeTypes(query: string, limit?: number, nodeFilter?: (nodeId: string) => boolean): ParsedNodeType[];
17
- getNodeType(nodeId: string, version?: number): INodeTypeDescription | null;
18
- }
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NodeTypeParser = void 0;
4
- const code_builder_node_search_engine_1 = require("../engines/code-builder-node-search-engine");
5
- class NodeTypeParser {
6
- nodeTypes;
7
- nodeTypeIndex;
8
- searchEngine;
9
- constructor(nodeTypes) {
10
- this.nodeTypes = nodeTypes;
11
- this.searchEngine = new code_builder_node_search_engine_1.CodeBuilderNodeSearchEngine(nodeTypes);
12
- this.nodeTypeIndex = this.buildIndex();
13
- }
14
- buildIndex() {
15
- const index = new Map();
16
- for (const nodeType of this.nodeTypes) {
17
- const existing = index.get(nodeType.name) ?? [];
18
- existing.push(nodeType);
19
- index.set(nodeType.name, existing);
20
- }
21
- return index;
22
- }
23
- isTriggerNode(nodeType) {
24
- if (nodeType.group.includes('trigger')) {
25
- return true;
26
- }
27
- return (nodeType.name.toLowerCase().includes('trigger') ||
28
- nodeType.name.toLowerCase().includes('webhook'));
29
- }
30
- searchNodeTypes(query, limit = 5, nodeFilter) {
31
- const results = this.searchEngine.searchByName(query, limit, nodeFilter);
32
- return results.map((result) => {
33
- const nodeType = this.getNodeType(result.name, result.version);
34
- return {
35
- id: result.name,
36
- displayName: result.displayName,
37
- description: result.description,
38
- version: result.version,
39
- isTrigger: nodeType ? this.isTriggerNode(nodeType) : false,
40
- };
41
- });
42
- }
43
- getNodeType(nodeId, version) {
44
- const versions = this.nodeTypeIndex.get(nodeId);
45
- if (!versions || versions.length === 0) {
46
- return null;
47
- }
48
- if (version !== undefined) {
49
- const match = versions.find((v) => {
50
- const nodeVersions = Array.isArray(v.version) ? v.version : [v.version];
51
- return nodeVersions.includes(version);
52
- });
53
- return match ?? null;
54
- }
55
- return versions.reduce((latest, current) => {
56
- const latestMax = Array.isArray(latest.version)
57
- ? Math.max(...latest.version)
58
- : latest.version;
59
- const currentMax = Array.isArray(current.version)
60
- ? Math.max(...current.version)
61
- : current.version;
62
- return currentMax > latestMax ? current : latest;
63
- });
64
- }
65
- }
66
- exports.NodeTypeParser = NodeTypeParser;
67
- //# sourceMappingURL=node-type-parser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node-type-parser.js","sourceRoot":"","sources":["../../../src/code-builder/utils/node-type-parser.ts"],"names":[],"mappings":";;;AAUA,gGAAyF;AAczF,MAAa,cAAc;IAClB,SAAS,CAAyB;IAClC,aAAa,CAAsC;IACnD,YAAY,CAA8B;IAElD,YAAY,SAAiC;QAC5C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,YAAY,GAAG,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AAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;gBAC9B,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;YACnB,OAAO,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;QAClD,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AAjGD,wCAiGC"}
@@ -1,26 +0,0 @@
1
- import { type INodeTypeDescription, type IParameterBuilderHint, type Logger } from 'n8n-workflow';
2
- export interface OperationInfo {
3
- value: string;
4
- displayName: string;
5
- description?: string;
6
- builderHint?: IParameterBuilderHint;
7
- }
8
- export interface ResourceInfo {
9
- value: string;
10
- displayName: string;
11
- description?: string;
12
- builderHint?: IParameterBuilderHint;
13
- operations: OperationInfo[];
14
- }
15
- export interface ResourceOperationInfo {
16
- resources: ResourceInfo[];
17
- }
18
- export interface ExtractOptions {
19
- fields?: {
20
- description?: boolean;
21
- builderHint?: boolean;
22
- };
23
- }
24
- export declare function extractResourceOperations(nodeType: INodeTypeDescription, nodeVersion: number, logger?: Logger, options?: ExtractOptions): ResourceOperationInfo | null;
25
- export declare function createResourceCacheKey(nodeName: string, version: number): string;
26
- export declare function formatResourceOperationsForPrompt(info: ResourceOperationInfo): string;
@@ -1,156 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.extractResourceOperations = extractResourceOperations;
4
- exports.createResourceCacheKey = createResourceCacheKey;
5
- exports.formatResourceOperationsForPrompt = formatResourceOperationsForPrompt;
6
- const n8n_workflow_1 = require("n8n-workflow");
7
- function isPropertyVisibleForVersion(property, nodeVersion) {
8
- const displayOptions = property.displayOptions;
9
- if (!displayOptions) {
10
- return true;
11
- }
12
- const showVersion = displayOptions.show?.['@version'];
13
- if (showVersion && !(0, n8n_workflow_1.checkConditions)(showVersion, [nodeVersion])) {
14
- return false;
15
- }
16
- const hideVersion = displayOptions.hide?.['@version'];
17
- if (hideVersion && (0, n8n_workflow_1.checkConditions)(hideVersion, [nodeVersion])) {
18
- return false;
19
- }
20
- return true;
21
- }
22
- function findResourceProperty(properties, nodeVersion) {
23
- return properties.find((prop) => prop.name === 'resource' &&
24
- prop.type === 'options' &&
25
- isPropertyVisibleForVersion(prop, nodeVersion));
26
- }
27
- function isOperationVisibleForResource(prop, resourceValue) {
28
- const displayOptions = prop.displayOptions;
29
- if (!displayOptions) {
30
- return true;
31
- }
32
- const showResource = displayOptions.show?.resource;
33
- if (showResource && !(0, n8n_workflow_1.checkConditions)(showResource, [resourceValue])) {
34
- return false;
35
- }
36
- const hideResource = displayOptions.hide?.resource;
37
- if (hideResource && (0, n8n_workflow_1.checkConditions)(hideResource, [resourceValue])) {
38
- return false;
39
- }
40
- return true;
41
- }
42
- function findOperationProperties(properties, resourceValue, nodeVersion) {
43
- return properties.filter((prop) => {
44
- if (prop.name !== 'operation' || prop.type !== 'options') {
45
- return false;
46
- }
47
- if (!isPropertyVisibleForVersion(prop, nodeVersion)) {
48
- return false;
49
- }
50
- return isOperationVisibleForResource(prop, resourceValue);
51
- });
52
- }
53
- function extractOptions(property, logger, options) {
54
- if (!property.options || !Array.isArray(property.options)) {
55
- return [];
56
- }
57
- const includeDescription = options?.fields?.description ?? false;
58
- const includeBuilderHint = options?.fields?.builderHint ?? false;
59
- return property.options
60
- .filter((opt) => {
61
- if (typeof opt !== 'object' || opt === null || !('name' in opt) || !('value' in opt)) {
62
- return false;
63
- }
64
- const optName = opt.name;
65
- const optValue = opt.value;
66
- if (typeof optValue !== 'string') {
67
- logger?.debug('Skipping non-string option value in resource/operation extraction', {
68
- propertyName: property.name,
69
- optionName: optName,
70
- valueType: typeof optValue,
71
- });
72
- return false;
73
- }
74
- return true;
75
- })
76
- .map((opt) => ({
77
- value: opt.value,
78
- displayName: opt.name,
79
- ...(includeDescription && opt.description && { description: opt.description }),
80
- ...(includeBuilderHint && opt.builderHint && { builderHint: opt.builderHint }),
81
- }));
82
- }
83
- function extractResourceOperations(nodeType, nodeVersion, logger, options) {
84
- const properties = nodeType.properties;
85
- if (!properties || properties.length === 0) {
86
- logger?.debug('extractResourceOperations: No properties found', {
87
- nodeType: nodeType.name,
88
- nodeVersion,
89
- });
90
- return null;
91
- }
92
- const resourceProperty = findResourceProperty(properties, nodeVersion);
93
- if (!resourceProperty) {
94
- return null;
95
- }
96
- const resourceOptions = extractOptions(resourceProperty, logger, options);
97
- if (resourceOptions.length === 0) {
98
- logger?.warn('extractResourceOperations: Resource property found but no string options', {
99
- nodeType: nodeType.name,
100
- nodeVersion,
101
- propertyDefault: resourceProperty.default,
102
- });
103
- return null;
104
- }
105
- const resources = resourceOptions.map((resource) => {
106
- const operationProperties = findOperationProperties(properties, resource.value, nodeVersion);
107
- const allOperations = [];
108
- const seenValues = new Set();
109
- for (const opProp of operationProperties) {
110
- const ops = extractOptions(opProp, logger, options);
111
- for (const op of ops) {
112
- if (!seenValues.has(op.value)) {
113
- seenValues.add(op.value);
114
- allOperations.push({
115
- value: op.value,
116
- displayName: op.displayName,
117
- ...(op.description && { description: op.description }),
118
- ...(op.builderHint && { builderHint: op.builderHint }),
119
- });
120
- }
121
- }
122
- }
123
- return {
124
- value: resource.value,
125
- displayName: resource.displayName,
126
- ...(resource.description && { description: resource.description }),
127
- ...(resource.builderHint && { builderHint: resource.builderHint }),
128
- operations: allOperations,
129
- };
130
- });
131
- return { resources };
132
- }
133
- function createResourceCacheKey(nodeName, version) {
134
- return `${nodeName}:${version}`;
135
- }
136
- function formatResourceOperationsForPrompt(info) {
137
- const parts = ['<available_resources_and_operations>'];
138
- for (const resource of info.resources) {
139
- if (resource.value === '__CUSTOM_API_CALL__')
140
- continue;
141
- parts.push(` Resource: ${resource.displayName} (value: "${resource.value}")`);
142
- const filteredOps = resource.operations.filter((op) => op.value !== '__CUSTOM_API_CALL__');
143
- if (filteredOps.length > 0) {
144
- parts.push(' Operations:');
145
- for (const op of filteredOps) {
146
- parts.push(` - ${op.displayName} (value: "${op.value}")`);
147
- }
148
- }
149
- else {
150
- parts.push(' Operations: none defined');
151
- }
152
- }
153
- parts.push('</available_resources_and_operations>');
154
- return parts.join('\n');
155
- }
156
- //# sourceMappingURL=resource-operation-extractor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource-operation-extractor.js","sourceRoot":"","sources":["../../src/utils/resource-operation-extractor.ts"],"names":[],"mappings":";;AAuNA,8DAkEC;AAMD,wDAEC;AAKD,8EAuBC;AA7TD,+CAMsB;AAiDtB,SAAS,2BAA2B,CAAC,QAAyB,EAAE,WAAmB;IAClF,MAAM,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;IAG/C,IAAI,CAAC,cAAc,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACb,CAAC;IAGD,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC;IACtD,IAAI,WAAW,IAAI,CAAC,IAAA,8BAAe,EAAC,WAAW,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC;QACjE,OAAO,KAAK,CAAC;IACd,CAAC;IAGD,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC;IACtD,IAAI,WAAW,IAAI,IAAA,8BAAe,EAAC,WAAW,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC;QAChE,OAAO,KAAK,CAAC;IACd,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AAKD,SAAS,oBAAoB,CAC5B,UAA6B,EAC7B,WAAmB;IAEnB,OAAO,UAAU,CAAC,IAAI,CACrB,CAAC,IAAI,EAAE,EAAE,CACR,IAAI,CAAC,IAAI,KAAK,UAAU;QACxB,IAAI,CAAC,IAAI,KAAK,SAAS;QACvB,2BAA2B,CAAC,IAAI,EAAE,WAAW,CAAC,CAC/C,CAAC;AACH,CAAC;AAMD,SAAS,6BAA6B,CAAC,IAAqB,EAAE,aAAqB;IAClF,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAC3C,IAAI,C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