@n8n/ai-workflow-builder 0.19.0 → 0.21.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/dist/agents/workflow-planner-agent.d.ts +58 -0
- package/dist/agents/workflow-planner-agent.js +269 -0
- package/dist/agents/workflow-planner-agent.js.map +1 -0
- package/dist/build.tsbuildinfo +1 -1
- package/dist/chains/parameter-updater.js +0 -2
- package/dist/chains/parameter-updater.js.map +1 -1
- package/dist/constants.d.ts +7 -0
- package/dist/constants.js +8 -1
- package/dist/constants.js.map +1 -1
- package/dist/errors/index.d.ts +7 -0
- package/dist/errors/index.js +16 -1
- package/dist/errors/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/llm-config.js +2 -1
- package/dist/llm-config.js.map +1 -1
- package/dist/tools/add-node.tool.d.ts +38 -34
- package/dist/tools/add-node.tool.js +17 -2
- package/dist/tools/add-node.tool.js.map +1 -1
- package/dist/tools/connect-nodes.tool.d.ts +29 -26
- package/dist/tools/connect-nodes.tool.js +7 -2
- package/dist/tools/connect-nodes.tool.js.map +1 -1
- package/dist/tools/get-node-parameter.tool.d.ts +18 -0
- package/dist/tools/get-node-parameter.tool.js +109 -0
- package/dist/tools/get-node-parameter.tool.js.map +1 -0
- package/dist/tools/helpers/progress.d.ts +1 -1
- package/dist/tools/helpers/progress.js +14 -2
- package/dist/tools/helpers/progress.js.map +1 -1
- package/dist/tools/helpers/validation.d.ts +1 -0
- package/dist/tools/helpers/validation.js +13 -0
- package/dist/tools/helpers/validation.js.map +1 -1
- package/dist/tools/node-details.tool.d.ts +20 -17
- package/dist/tools/node-details.tool.js +7 -2
- package/dist/tools/node-details.tool.js.map +1 -1
- package/dist/tools/node-search.tool.d.ts +54 -45
- package/dist/tools/node-search.tool.js +7 -2
- package/dist/tools/node-search.tool.js.map +1 -1
- package/dist/tools/prompts/main-agent.prompt.d.ts +2 -0
- package/dist/tools/prompts/main-agent.prompt.js +93 -42
- package/dist/tools/prompts/main-agent.prompt.js.map +1 -1
- package/dist/tools/remove-node.tool.d.ts +14 -11
- package/dist/tools/remove-node.tool.js +7 -2
- package/dist/tools/remove-node.tool.js.map +1 -1
- package/dist/tools/update-node-parameters.tool.d.ts +19 -16
- package/dist/tools/update-node-parameters.tool.js +21 -4
- package/dist/tools/update-node-parameters.tool.js.map +1 -1
- package/dist/types/index.d.ts +8 -8
- package/dist/types/index.js +0 -22
- package/dist/types/index.js.map +1 -1
- package/dist/types/langchain.d.ts +2 -0
- package/dist/types/langchain.js +7 -0
- package/dist/types/langchain.js.map +1 -0
- package/dist/types/messages.d.ts +1 -7
- package/dist/types/streaming.d.ts +6 -1
- package/dist/types/tools.d.ts +8 -1
- package/dist/utils/stream-processor.d.ts +7 -1
- package/dist/utils/stream-processor.js +121 -63
- package/dist/utils/stream-processor.js.map +1 -1
- package/dist/utils/token-usage.d.ts +3 -0
- package/dist/utils/token-usage.js +27 -0
- package/dist/utils/token-usage.js.map +1 -1
- package/dist/utils/trim-workflow-context.d.ts +2 -0
- package/dist/utils/trim-workflow-context.js +53 -0
- package/dist/utils/trim-workflow-context.js.map +1 -0
- package/dist/workflow-builder-agent.d.ts +1 -0
- package/dist/workflow-builder-agent.js +136 -8
- package/dist/workflow-builder-agent.js.map +1 -1
- package/dist/workflow-state.d.ts +17 -0
- package/dist/workflow-state.js +12 -0
- package/dist/workflow-state.js.map +1 -1
- package/package.json +6 -5
- package/dist/chains/planner.d.ts +0 -4
- package/dist/chains/planner.js +0 -87
- package/dist/chains/planner.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../src/tools/helpers/progress.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../src/tools/helpers/progress.ts"],"names":[],"mappings":";;AAkBA,wDAmHC;AAKD,kCAEC;AAKD,wCAMC;AA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C,KAAK,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAKD,SAAgB,cAAc,CAC7B,QAA0B,EAC1B,OAAe,EACf,IAA8B;IAE9B,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC;AAKD,SAAgB,cAAc,CAAI,QAA0B,EAAE,MAAS;IACtE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC;AAKD,SAAgB,WAAW,CAAC,QAA0B,EAAE,KAAgB;IACvE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAKD,SAAgB,2BAA2B,CAC1C,QAA0B,EAC1B,KAAa;IAEb,OAAO,QAAQ,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -9,4 +9,5 @@ export declare function validateConnection(sourceNode: INode, targetNode: INode)
|
|
|
9
9
|
export declare function createValidationError(message: string, code: string, details?: Record<string, string>): ToolError;
|
|
10
10
|
export declare function createNodeNotFoundError(nodeIdentifier: string): ToolError;
|
|
11
11
|
export declare function createNodeTypeNotFoundError(nodeTypeName: string): ToolError;
|
|
12
|
+
export declare function createNodeParameterTooLargeError(nodeId: string, parameter: string, maxSize: number): ToolError;
|
|
12
13
|
export declare function hasNodes(workflow: SimpleWorkflow): boolean;
|
|
@@ -8,6 +8,7 @@ exports.validateConnection = validateConnection;
|
|
|
8
8
|
exports.createValidationError = createValidationError;
|
|
9
9
|
exports.createNodeNotFoundError = createNodeNotFoundError;
|
|
10
10
|
exports.createNodeTypeNotFoundError = createNodeTypeNotFoundError;
|
|
11
|
+
exports.createNodeParameterTooLargeError = createNodeParameterTooLargeError;
|
|
11
12
|
exports.hasNodes = hasNodes;
|
|
12
13
|
const errors_1 = require("../../errors");
|
|
13
14
|
function validateNodeExists(nodeId, nodes) {
|
|
@@ -63,6 +64,18 @@ function createNodeTypeNotFoundError(nodeTypeName) {
|
|
|
63
64
|
details: { nodeTypeName },
|
|
64
65
|
};
|
|
65
66
|
}
|
|
67
|
+
function createNodeParameterTooLargeError(nodeId, parameter, maxSize) {
|
|
68
|
+
const error = new errors_1.ParameterTooLargeError('Parameter value is too large to retrieve', {
|
|
69
|
+
parameter,
|
|
70
|
+
nodeId,
|
|
71
|
+
maxSize,
|
|
72
|
+
});
|
|
73
|
+
return {
|
|
74
|
+
message: error.message,
|
|
75
|
+
code: 'NODE_PARAMETER_TOO_LARGE',
|
|
76
|
+
details: { nodeId, parameter, maxSize: maxSize.toString() },
|
|
77
|
+
};
|
|
78
|
+
}
|
|
66
79
|
function hasNodes(workflow) {
|
|
67
80
|
return workflow.nodes.length > 0;
|
|
68
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/tools/helpers/validation.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/tools/helpers/validation.ts"],"names":[],"mappings":";;AAeA,gDAEC;AAKD,wCAEC;AAKD,gDAOC;AAKD,oCAKC;AAKD,gDAeC;AAKD,sDAYC;AAKD,0DAOC;AAKD,kEAOC;AAKD,4EAgBC;AAKD,4BAEC;AArID,yCAMsB;AAOtB,SAAgB,kBAAkB,CAAC,MAAc,EAAE,KAAc;IAChE,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC;AACnD,CAAC;AAKD,SAAgB,cAAc,CAAC,QAAgB,EAAE,KAAc;IAC9D,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,IAAI,CAAC;AACnF,CAAC;AAKD,SAAgB,kBAAkB,CAAC,cAAsB,EAAE,KAAc;IAExE,MAA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O;QACN,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,EAAE,cAAc,EAAE;KAC3B,CAAC;AACH,CAAC;AAKD,SAAgB,2BAA2B,CAAC,YAAoB;IAC/D,MAAM,KAAK,GAAG,IAAI,8BAAqB,CAAC,YAAY,CAAC,CAAC;IACtD,OAAO;QACN,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,EAAE,YAAY,EAAE;KACzB,CAAC;AACH,CAAC;AAKD,SAAgB,gCAAgC,CAC/C,MAAc,EACd,SAAiB,EACjB,OAAe;IAEf,MAAM,KAAK,GAAG,IAAI,+BAAsB,CAAC,0CAA0C,EAAE;QACpF,SAAS;QACT,MAAM;QACN,OAAO;KACP,CAAC,CAAC;IAEH,OAAO;QACN,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE;KAC3D,CAAC;AACH,CAAC;AAKD,SAAgB,QAAQ,CAAC,QAAwB;IAChD,OAAO,QAAQ,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import type { INodeTypeDescription } from 'n8n-workflow';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
export declare function createNodeDetailsTool(nodeTypes: INodeTypeDescription[]):
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
3
|
+
export declare function createNodeDetailsTool(nodeTypes: INodeTypeDescription[]): {
|
|
4
|
+
tool: import("@langchain/core/tools").DynamicStructuredTool<z.ZodObject<{
|
|
5
|
+
nodeName: z.ZodString;
|
|
6
|
+
withParameters: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
7
|
+
withConnections: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
nodeName: string;
|
|
10
|
+
withParameters: boolean;
|
|
11
|
+
withConnections: boolean;
|
|
12
|
+
}, {
|
|
13
|
+
nodeName: string;
|
|
14
|
+
withParameters?: boolean | undefined;
|
|
15
|
+
withConnections?: boolean | undefined;
|
|
16
|
+
}>, unknown, {
|
|
17
|
+
nodeName: string;
|
|
18
|
+
withParameters?: boolean | undefined;
|
|
19
|
+
withConnections?: boolean | undefined;
|
|
20
|
+
}, import("@langchain/langgraph").Command<unknown>>;
|
|
21
|
+
displayTitle: string;
|
|
22
|
+
};
|
|
@@ -86,8 +86,9 @@ function extractNodeDetails(nodeType) {
|
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
function createNodeDetailsTool(nodeTypes) {
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
const DISPLAY_TITLE = 'Getting node details';
|
|
90
|
+
const dynamicTool = (0, tools_1.tool)((input, config) => {
|
|
91
|
+
const reporter = (0, progress_1.createProgressReporter)(config, 'get_node_details', DISPLAY_TITLE);
|
|
91
92
|
try {
|
|
92
93
|
const validatedInput = nodeDetailsSchema.parse(input);
|
|
93
94
|
const { nodeName, withParameters, withConnections } = validatedInput;
|
|
@@ -129,5 +130,9 @@ function createNodeDetailsTool(nodeTypes) {
|
|
|
129
130
|
description: 'Get detailed information about a specific n8n node type including properties and available connections. Use this before adding nodes to understand their input/output structure.',
|
|
130
131
|
schema: nodeDetailsSchema,
|
|
131
132
|
});
|
|
133
|
+
return {
|
|
134
|
+
tool: dynamicTool,
|
|
135
|
+
displayTitle: DISPLAY_TITLE,
|
|
136
|
+
};
|
|
132
137
|
}
|
|
133
138
|
//# sourceMappingURL=node-details.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-details.tool.js","sourceRoot":"","sources":["../../src/tools/node-details.tool.ts"],"names":[],"mappings":";;AA+HA,
|
|
1
|
+
{"version":3,"file":"node-details.tool.js","sourceRoot":"","sources":["../../src/tools/node-details.tool.ts"],"names":[],"mappings":";;AA+HA,sDA4EC;AA3MD,iDAA6C;AAE7C,6BAAwB;AAExB,sCAAgE;AAChE,iDAA4E;AAC5E,iDAAgF;AAChF,qDAAiF;AAOjF,MAAM,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6DAA6D,CAAC;IAC5F,cAAc,EAAE,OAAC;SACf,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CAAC,kDAAkD,CAAC;IAC9D,eAAe,EAAE,OAAC;SAChB,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CAAC,6DAA6D,CAAC;CACzE,CAAC,CAAC;AAKH,SAAS,YAAY,CAAC,MAAsC;IAC3D,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpC,OAAO,uBAAuB,CAAC;IAChC,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,UAAU,MAAM,UAAU,CAAC;IACnC,CAAC;IACD,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC/B,OAAO,UAAU,KAAK,UAAU,CAAC;QAClC,CAAC;QAED,OAAO,UAAU,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC;IAClD,CAAC,CAAC,CAAC;IACH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C/B,CAAC,CAAC;gBACH,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;gBAChC,OAAO,IAAA,8BAAmB,EAAC,MAAM,EAAE,eAAe,CAAC,CAAC;YACrD,CAAC;YAED,MAAM,SAAS,GAAG,IAAI,2BAAkB,CACvC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB,EACjE;gBACC,QAAQ,EAAE,kBAAkB;gBAC5B,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;aACjD,CACD,CAAC;YACF,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YAC1B,OAAO,IAAA,8BAAmB,EAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC/C,CAAC;IACF,CAAC,EACD;QACC,IAAI,EAAE,kBAAkB;QACxB,WAAW,EACV,kLAAkL;QACnL,MAAM,EAAE,iBAAiB;KACzB,CACD,CAAC;IAEF,OAAO;QACN,IAAI,EAAE,WAAW;QACjB,YAAY,EAAE,aAAa;KAC3B,CAAC;AACH,CAAC"}
|
|
@@ -1,49 +1,58 @@
|
|
|
1
1
|
import { type INodeTypeDescription } from 'n8n-workflow';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
export declare function createNodeSearchTool(nodeTypes: INodeTypeDescription[]):
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
export declare function createNodeSearchTool(nodeTypes: INodeTypeDescription[]): {
|
|
4
|
+
tool: import("@langchain/core/tools").DynamicStructuredTool<z.ZodObject<{
|
|
5
|
+
queries: z.ZodArray<z.ZodObject<{
|
|
6
|
+
queryType: z.ZodEnum<["name", "subNodeSearch"]>;
|
|
7
|
+
query: z.ZodOptional<z.ZodString>;
|
|
8
|
+
connectionType: z.ZodOptional<z.ZodNativeEnum<{
|
|
9
|
+
readonly AiAgent: "ai_agent";
|
|
10
|
+
readonly AiChain: "ai_chain";
|
|
11
|
+
readonly AiDocument: "ai_document";
|
|
12
|
+
readonly AiEmbedding: "ai_embedding";
|
|
13
|
+
readonly AiLanguageModel: "ai_languageModel";
|
|
14
|
+
readonly AiMemory: "ai_memory";
|
|
15
|
+
readonly AiOutputParser: "ai_outputParser";
|
|
16
|
+
readonly AiRetriever: "ai_retriever";
|
|
17
|
+
readonly AiReranker: "ai_reranker";
|
|
18
|
+
readonly AiTextSplitter: "ai_textSplitter";
|
|
19
|
+
readonly AiTool: "ai_tool";
|
|
20
|
+
readonly AiVectorStore: "ai_vectorStore";
|
|
21
|
+
readonly Main: "main";
|
|
22
|
+
}>>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
queryType: "name" | "subNodeSearch";
|
|
25
|
+
connectionType?: "ai_agent" | "ai_chain" | "ai_document" | "ai_embedding" | "ai_languageModel" | "ai_memory" | "ai_outputParser" | "ai_retriever" | "ai_reranker" | "ai_textSplitter" | "ai_tool" | "ai_vectorStore" | "main" | undefined;
|
|
26
|
+
query?: string | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
queryType: "name" | "subNodeSearch";
|
|
29
|
+
connectionType?: "ai_agent" | "ai_chain" | "ai_document" | "ai_embedding" | "ai_languageModel" | "ai_memory" | "ai_outputParser" | "ai_retriever" | "ai_reranker" | "ai_textSplitter" | "ai_tool" | "ai_vectorStore" | "main" | undefined;
|
|
30
|
+
query?: string | undefined;
|
|
31
|
+
}>, "many">;
|
|
22
32
|
}, "strip", z.ZodTypeAny, {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
33
|
+
queries: {
|
|
34
|
+
queryType: "name" | "subNodeSearch";
|
|
35
|
+
connectionType?: "ai_agent" | "ai_chain" | "ai_document" | "ai_embedding" | "ai_languageModel" | "ai_memory" | "ai_outputParser" | "ai_retriever" | "ai_reranker" | "ai_textSplitter" | "ai_tool" | "ai_vectorStore" | "main" | undefined;
|
|
36
|
+
query?: string | undefined;
|
|
37
|
+
}[];
|
|
26
38
|
}, {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
query?: string | undefined;
|
|
48
|
-
}[];
|
|
49
|
-
}, import("@langchain/langgraph").Command<unknown>>;
|
|
39
|
+
queries: {
|
|
40
|
+
queryType: "name" | "subNodeSearch";
|
|
41
|
+
connectionType?: "ai_agent" | "ai_chain" | "ai_document" | "ai_embedding" | "ai_languageModel" | "ai_memory" | "ai_outputParser" | "ai_retriever" | "ai_reranker" | "ai_textSplitter" | "ai_tool" | "ai_vectorStore" | "main" | undefined;
|
|
42
|
+
query?: string | undefined;
|
|
43
|
+
}[];
|
|
44
|
+
}>, {
|
|
45
|
+
queries: {
|
|
46
|
+
queryType: "name" | "subNodeSearch";
|
|
47
|
+
connectionType?: "ai_agent" | "ai_chain" | "ai_document" | "ai_embedding" | "ai_languageModel" | "ai_memory" | "ai_outputParser" | "ai_retriever" | "ai_reranker" | "ai_textSplitter" | "ai_tool" | "ai_vectorStore" | "main" | undefined;
|
|
48
|
+
query?: string | undefined;
|
|
49
|
+
}[];
|
|
50
|
+
}, {
|
|
51
|
+
queries: {
|
|
52
|
+
queryType: "name" | "subNodeSearch";
|
|
53
|
+
connectionType?: "ai_agent" | "ai_chain" | "ai_document" | "ai_embedding" | "ai_languageModel" | "ai_memory" | "ai_outputParser" | "ai_retriever" | "ai_reranker" | "ai_textSplitter" | "ai_tool" | "ai_vectorStore" | "main" | undefined;
|
|
54
|
+
query?: string | undefined;
|
|
55
|
+
}[];
|
|
56
|
+
}, import("@langchain/langgraph").Command<unknown>>;
|
|
57
|
+
displayTitle: string;
|
|
58
|
+
};
|
|
@@ -74,8 +74,9 @@ function buildResponseMessage(results, nodeTypes) {
|
|
|
74
74
|
return responseContent;
|
|
75
75
|
}
|
|
76
76
|
function createNodeSearchTool(nodeTypes) {
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
const DISPLAY_TITLE = 'Searching nodes';
|
|
78
|
+
const dynamicTool = (0, tools_1.tool)((input, config) => {
|
|
79
|
+
const reporter = (0, progress_1.createProgressReporter)(config, 'search_nodes', DISPLAY_TITLE);
|
|
79
80
|
try {
|
|
80
81
|
const validatedInput = nodeSearchSchema.parse(input);
|
|
81
82
|
const { queries } = validatedInput;
|
|
@@ -142,5 +143,9 @@ Common AI connection types for sub-node search:
|
|
|
142
143
|
You can search for multiple different criteria at once by providing an array of queries.`,
|
|
143
144
|
schema: nodeSearchSchema,
|
|
144
145
|
});
|
|
146
|
+
return {
|
|
147
|
+
tool: dynamicTool,
|
|
148
|
+
displayTitle: DISPLAY_TITLE,
|
|
149
|
+
};
|
|
145
150
|
}
|
|
146
151
|
//# sourceMappingURL=node-search.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-search.tool.js","sourceRoot":"","sources":["../../src/tools/node-search.tool.ts"],"names":[],"mappings":";;AAiHA,
|
|
1
|
+
{"version":3,"file":"node-search.tool.js","sourceRoot":"","sources":["../../src/tools/node-search.tool.ts"],"names":[],"mappings":";;AAiHA,oDA0GC;AA3ND,iDAA6C;AAC7C,+CAA8E;AAC9E,6BAAwB;AAExB,sCAAgE;AAChE,qEAAgE;AAChE,iDAAyF;AACzF,iDAAgF;AAOhF,MAAM,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,SAAS,EAAE,OAAC,CAA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AAe,CAAC,0BAA0B,EAAE;oBACvE,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE;iBAC/B,CAAC,CAAC;gBACH,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;gBAChC,OAAO,IAAA,8BAAmB,EAAC,MAAM,EAAE,eAAe,CAAC,CAAC;YACrD,CAAC;YAED,MAAM,SAAS,GAAG,IAAI,2BAAkB,CACvC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB,EACjE;gBACC,QAAQ,EAAE,cAAc;gBACxB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;aACjD,CACD,CAAC;YACF,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YAC1B,OAAO,IAAA,8BAAmB,EAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC/C,CAAC;IACF,CAAC,EACD;QACC,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;yFAoByE;QACtF,MAAM,EAAE,gBAAgB;KACxB,CACD,CAAC;IAEF,OAAO;QACN,IAAI,EAAE,WAAW;QACjB,YAAY,EAAE,aAAa;KAC3B,CAAC;AACH,CAAC"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { ChatPromptTemplate } from '@langchain/core/prompts';
|
|
2
|
+
import type { WorkflowPlan } from '../../agents/workflow-planner-agent';
|
|
3
|
+
export declare const planFormatter: (plan?: WorkflowPlan | null) => string;
|
|
2
4
|
export declare const mainAgentPrompt: ChatPromptTemplate<any, any>;
|
|
@@ -1,29 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mainAgentPrompt = void 0;
|
|
3
|
+
exports.mainAgentPrompt = exports.planFormatter = void 0;
|
|
4
4
|
const prompts_1 = require("@langchain/core/prompts");
|
|
5
5
|
const instance_url_1 = require("../../chains/prompts/instance-url");
|
|
6
6
|
const systemPrompt = `You are an AI assistant specialized in creating and editing n8n workflows. Your goal is to help users build efficient, well-connected workflows by intelligently using the available tools.
|
|
7
|
-
|
|
8
|
-
<prime_directive>
|
|
9
|
-
ALWAYS end your workflow mutation responses with a brief note that the workflow can be adjusted if needed. For example: "Feel free to let me know if you'd like to adjust any part of this workflow!" This is mandatory for all workflow mutation responses.
|
|
10
|
-
</prime_directive>
|
|
11
|
-
|
|
12
7
|
<core_principle>
|
|
13
8
|
After receiving tool results, reflect on their quality and determine optimal next steps. Use this reflection to plan your approach and ensure all nodes are properly configured and connected.
|
|
14
9
|
</core_principle>
|
|
15
10
|
|
|
16
11
|
<communication_style>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
12
|
+
Keep responses concise.
|
|
13
|
+
|
|
14
|
+
CRITICAL: Do NOT provide commentary between tool calls. Execute tools silently.
|
|
15
|
+
- NO progress messages like "Perfect!", "Now let me...", "Excellent!"
|
|
16
|
+
- NO descriptions of what was built or how it works
|
|
17
|
+
- NO workflow features or capabilities explanations
|
|
18
|
+
- Only respond AFTER all tools are complete
|
|
19
|
+
- Response should only contain setup/usage information
|
|
23
20
|
</communication_style>
|
|
24
21
|
|
|
25
|
-
<tool_execution_strategy>
|
|
26
|
-
For maximum efficiency, invoke all relevant tools simultaneously when performing independent operations. This significantly reduces wait time and improves user experience.
|
|
27
22
|
|
|
28
23
|
Parallel execution guidelines:
|
|
29
24
|
- ALL tools support parallel execution, including add_nodes
|
|
@@ -183,6 +178,35 @@ Common failures from relying on defaults:
|
|
|
183
178
|
ALWAYS check node details obtained in Analysis Phase and configure accordingly. Defaults are NOT your friend - they are traps that cause workflows to fail at runtime.
|
|
184
179
|
</node_defaults_warning>
|
|
185
180
|
|
|
181
|
+
<workflow_configuration_node>
|
|
182
|
+
CRITICAL: Always include a Workflow Configuration node at the start of every workflow.
|
|
183
|
+
|
|
184
|
+
The Workflow Configuration node (n8n-nodes-base.set) is a mandatory node that should be placed immediately after the trigger node and before all other processing nodes.
|
|
185
|
+
This node centralizes workflow-wide settings and parameters that other nodes can reference throughout the execution with expressions.
|
|
186
|
+
|
|
187
|
+
Placement rules:
|
|
188
|
+
- ALWAYS add between trigger and first processing node
|
|
189
|
+
- Connect: Trigger → Workflow Configuration → First processing node
|
|
190
|
+
- This creates a single source of truth for workflow parameters
|
|
191
|
+
|
|
192
|
+
Configuration approach:
|
|
193
|
+
- Include URLs, thresholds, string constants and any reusable values
|
|
194
|
+
- Other nodes reference these via expressions: {{ $('Workflow Configuration').first().json.variableName }}
|
|
195
|
+
- Add only parameters that are used by other nodes, DO NOT add unnecessary fields
|
|
196
|
+
|
|
197
|
+
Workflow configuration node usage example:
|
|
198
|
+
1. Schedule Trigger → Workflow Configuration → HTTP Request → Process Data
|
|
199
|
+
2. Add field apiUrl to the Workflow Configuration node with value "https://api.example.com/data"
|
|
200
|
+
3. Reference in HTTP Request node: "{{ $('Workflow Configuration').first().json.apiUrl }}" instead of directly setting the URL
|
|
201
|
+
|
|
202
|
+
IMPORTANT:
|
|
203
|
+
- Workflow Configuration node is not meant for credentials or sensitive data.
|
|
204
|
+
- Always enable "includeOtherFields" setting of the Workflow Configuration node, to pass to the output all the input fields (this is a top level parameter, do not add it to the fields in 'Fields to Set' parameter).
|
|
205
|
+
- Do not reference the variables from the Workflow Configuration node in Trigger nodes (as they run before it).
|
|
206
|
+
|
|
207
|
+
Why: Centralizes configuration, makes workflows maintainable, enables easy environment switching, and provides clear parameter visibility.
|
|
208
|
+
</workflow_configuration_node>
|
|
209
|
+
|
|
186
210
|
<configuration_requirements>
|
|
187
211
|
ALWAYS configure nodes after adding and connecting them. This is NOT optional.
|
|
188
212
|
|
|
@@ -214,6 +238,8 @@ Why: Unconfigured nodes WILL fail at runtime
|
|
|
214
238
|
For AI-generated structured data, prefer Structured Output Parser nodes over Code nodes.
|
|
215
239
|
Why: Purpose-built parsers are more reliable and handle edge cases better than custom code.
|
|
216
240
|
|
|
241
|
+
For binary file data, use Extract From File node to extract content from files before processing.
|
|
242
|
+
|
|
217
243
|
Use Code nodes only for:
|
|
218
244
|
- Simple string manipulations
|
|
219
245
|
- Already structured data (JSON, CSV)
|
|
@@ -297,9 +323,10 @@ Anticipate workflow needs and suggest enhancements:
|
|
|
297
323
|
- Set nodes for data transformation between incompatible formats
|
|
298
324
|
- Schedule Triggers for recurring tasks
|
|
299
325
|
- Error handling for external service calls
|
|
300
|
-
- Split In Batches for large dataset processing
|
|
301
326
|
|
|
302
327
|
Why: Proactive suggestions create more robust, production-ready workflows
|
|
328
|
+
|
|
329
|
+
NEVER use Split In Batches nodes.
|
|
303
330
|
</proactive_design>
|
|
304
331
|
|
|
305
332
|
<parameter_updates>
|
|
@@ -317,7 +344,7 @@ When unsure about specific values:
|
|
|
317
344
|
- Add nodes and connections confidently
|
|
318
345
|
- For uncertain parameters, use update_node_parameters with clear placeholders
|
|
319
346
|
- For tool nodes with dynamic values, use $fromAI expressions instead of placeholders
|
|
320
|
-
- Always mention what needs user
|
|
347
|
+
- Always mention what needs user to configure in the setup response
|
|
321
348
|
|
|
322
349
|
Example for regular nodes:
|
|
323
350
|
update_node_parameters({{
|
|
@@ -330,46 +357,39 @@ update_node_parameters({{
|
|
|
330
357
|
nodeId: "gmailTool1",
|
|
331
358
|
instructions: ["Set sendTo to {{ $fromAI('to') }}", "Set subject to {{ $fromAI('subject') }}"]
|
|
332
359
|
}})
|
|
333
|
-
|
|
334
|
-
Then tell the user: "I've set up the Gmail Tool node with dynamic AI parameters - it will automatically determine recipients and subjects based on context."
|
|
335
360
|
</handling_uncertainty>
|
|
336
361
|
|
|
337
362
|
`;
|
|
338
363
|
const responsePatterns = `
|
|
339
364
|
<response_patterns>
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
1. **Brief Summary** (1-2 sentences)
|
|
343
|
-
State what was created/modified without listing every parameter
|
|
365
|
+
IMPORTANT: Only provide ONE response AFTER all tool execution is complete.
|
|
344
366
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
367
|
+
Response format:
|
|
368
|
+
**⚙️ How to Setup** (numbered format)
|
|
369
|
+
- List credentials and parameters that need to configured
|
|
370
|
+
- Only list incomplete tasks that need user action (skip what's already configured)
|
|
349
371
|
|
|
350
|
-
|
|
351
|
-
|
|
372
|
+
**ℹ️ How to Use**
|
|
373
|
+
- Only essential user actions (what to click, where to go)
|
|
352
374
|
|
|
353
|
-
|
|
354
|
-
What the user might want to do next
|
|
375
|
+
End with: "Let me know if you'd like to adjust anything."
|
|
355
376
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
-
|
|
359
|
-
-
|
|
360
|
-
-
|
|
361
|
-
-
|
|
362
|
-
- Use emojis sparingly (1-2 max per response)
|
|
363
|
-
- Focus on what the user needs to know
|
|
364
|
-
- Expand details only when asked
|
|
365
|
-
- End with a brief note that the workflow can be adjusted if needed
|
|
366
|
-
</communication_style>
|
|
377
|
+
ABSOLUTELY FORBIDDEN IN BUILDING MODE:
|
|
378
|
+
- Any text between tool calls
|
|
379
|
+
- Progress updates during execution
|
|
380
|
+
- "Perfect!", "Now let me...", "Excellent!"
|
|
381
|
+
- Describing what was built
|
|
382
|
+
- Explaining workflow functionality
|
|
367
383
|
</response_patterns>
|
|
368
384
|
`;
|
|
369
385
|
const currentWorkflowJson = `
|
|
370
386
|
<current_workflow_json>
|
|
371
387
|
{workflowJSON}
|
|
372
|
-
</current_workflow_json
|
|
388
|
+
</current_workflow_json>
|
|
389
|
+
<trimmed_workflow_json_note>
|
|
390
|
+
Note: Large property values of the nodes in the workflow JSON above may be trimmed to fit within token limits.
|
|
391
|
+
Use get_node_parameter tool to get full details when needed.
|
|
392
|
+
</trimmed_workflow_json_note>`;
|
|
373
393
|
const currentExecutionData = `
|
|
374
394
|
<current_simplified_execution_data>
|
|
375
395
|
{executionData}
|
|
@@ -382,6 +402,32 @@ const previousConversationSummary = `
|
|
|
382
402
|
<previous_summary>
|
|
383
403
|
{previousSummary}
|
|
384
404
|
</previous_summary>`;
|
|
405
|
+
const workflowPlan = '{workflowPlan}';
|
|
406
|
+
const planFormatter = (plan) => {
|
|
407
|
+
if (!plan)
|
|
408
|
+
return '<workflow_plan>EMPTY</workflow_plan>';
|
|
409
|
+
const nodesPlan = plan.plan.map((node) => {
|
|
410
|
+
return `
|
|
411
|
+
<workflow_plan_node>
|
|
412
|
+
<type>${node.nodeType}</type>
|
|
413
|
+
<name>${node.nodeName}</name>
|
|
414
|
+
<reasoning>${node.reasoning}</reasoning>
|
|
415
|
+
</workflow_plan_node>
|
|
416
|
+
`;
|
|
417
|
+
});
|
|
418
|
+
return `
|
|
419
|
+
<workflow_plan>
|
|
420
|
+
<workflow_plan_intro>
|
|
421
|
+
${plan.intro}
|
|
422
|
+
</workflow_plan_intro>
|
|
423
|
+
|
|
424
|
+
<workflow_plan_nodes>
|
|
425
|
+
${nodesPlan.join('\n')}
|
|
426
|
+
</workflow_plan_nodes>
|
|
427
|
+
</workflow_plan>
|
|
428
|
+
`;
|
|
429
|
+
};
|
|
430
|
+
exports.planFormatter = planFormatter;
|
|
385
431
|
exports.mainAgentPrompt = prompts_1.ChatPromptTemplate.fromMessages([
|
|
386
432
|
[
|
|
387
433
|
'system',
|
|
@@ -417,6 +463,11 @@ exports.mainAgentPrompt = prompts_1.ChatPromptTemplate.fromMessages([
|
|
|
417
463
|
text: previousConversationSummary,
|
|
418
464
|
cache_control: { type: 'ephemeral' },
|
|
419
465
|
},
|
|
466
|
+
{
|
|
467
|
+
type: 'text',
|
|
468
|
+
text: workflowPlan,
|
|
469
|
+
cache_control: { type: 'ephemeral' },
|
|
470
|
+
},
|
|
420
471
|
],
|
|
421
472
|
],
|
|
422
473
|
['placeholder', '{messages}'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main-agent.prompt.js","sourceRoot":"","sources":["../../../src/tools/prompts/main-agent.prompt.ts"],"names":[],"mappings":";;;AAAA,qDAA6D;
|
|
1
|
+
{"version":3,"file":"main-agent.prompt.js","sourceRoot":"","sources":["../../../src/tools/prompts/main-agent.prompt.ts"],"names":[],"mappings":";;;AAAA,qDAA6D;AAG7D,oEAAsE;AAEtE,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoWpB,CAAC;AAEF,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBxB,CAAC;AAEF,MAAM,mBAAmB,GAAG;;;;;;;8BAOE,CAAC;AAE/B,MAAM,oBAAoB,GAAG;;;qCAGQ,CAAC;AAEtC,MAAM,4BAA4B,GAAG;;;mCAGF,CAAC;AAEpC,MAAM,2BAA2B,GAAG;;;oBAGhB,CAAC;AAErB,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAE/B,MAAM,aAAa,GAAG,CAAC,IAA0B,EAAE,EAAE;IAC3D,IAAI,CAAC,IAAI;QAAE,OAAO,sCAAsC,CAAC;IAEzD,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxC,OAAO;;YAEG,IAAI,CAAC,QAAQ;YACb,IAAI,CAAC,QAAQ;iBACR,IAAI,CAAC,SAAS;;GAE5B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO;;;KAGH,IAAI,CAAC,KAAK;;;;KAIV,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;;;EAGvB,CAAC;AACH,CAAC,CAAC;AAxBW,QAAA,aAAa,iBAwBxB;AAEW,QAAA,eAAe,GAAG,4BAAkB,CAAC,YAAY,CAAC;IAC9D;QACC,QAAQ;QACR;YACC;gBACC,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,YAAY;gBAClB,aAAa,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;aACpC;YACD;gBACC,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,gCAAiB;aACvB;YACD;gBACC,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,mBAAmB;aACzB;YACD;gBACC,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,oBAAoB;aAC1B;YACD;gBACC,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,4BAA4B;aAClC;YACD;gBACC,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,gBAAgB;gBACtB,aAAa,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;aACpC;YACD;gBACC,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,2BAA2B;gBACjC,aAAa,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;aACpC;YACD;gBACC,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,YAAY;gBAClB,aAAa,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;aACpC;SACD;KACD;IACD,CAAC,aAAa,EAAE,YAAY,CAAC;CAC7B,CAAC,CAAC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import type { Logger } from '@n8n/backend-common';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
export declare function createRemoveNodeTool(_logger?: Logger):
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
export declare function createRemoveNodeTool(_logger?: Logger): {
|
|
4
|
+
tool: import("@langchain/core/tools").DynamicStructuredTool<z.ZodObject<{
|
|
5
|
+
nodeId: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
nodeId: string;
|
|
8
|
+
}, {
|
|
9
|
+
nodeId: string;
|
|
10
|
+
}>, {
|
|
11
|
+
nodeId: string;
|
|
12
|
+
}, {
|
|
13
|
+
nodeId: string;
|
|
14
|
+
}, import("@langchain/langgraph").Command<unknown>>;
|
|
15
|
+
displayTitle: string;
|
|
16
|
+
};
|
|
@@ -45,8 +45,9 @@ function buildResponseMessage(nodeName, nodeType, connectionsRemoved) {
|
|
|
45
45
|
return parts.join('\n');
|
|
46
46
|
}
|
|
47
47
|
function createRemoveNodeTool(_logger) {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
const DISPLAY_TITLE = 'Removing node';
|
|
49
|
+
const dynamicTool = (0, tools_1.tool)((input, config) => {
|
|
50
|
+
const reporter = (0, progress_1.createProgressReporter)(config, 'remove_node', DISPLAY_TITLE);
|
|
50
51
|
try {
|
|
51
52
|
const validatedInput = removeNodeSchema.parse(input);
|
|
52
53
|
const { nodeId } = validatedInput;
|
|
@@ -93,5 +94,9 @@ function createRemoveNodeTool(_logger) {
|
|
|
93
94
|
description: 'Remove a node from the workflow by its ID. This will also remove all connections to and from the node. Use this tool when you need to delete a node that is no longer needed in the workflow.',
|
|
94
95
|
schema: removeNodeSchema,
|
|
95
96
|
});
|
|
97
|
+
return {
|
|
98
|
+
tool: dynamicTool,
|
|
99
|
+
displayTitle: DISPLAY_TITLE,
|
|
100
|
+
};
|
|
96
101
|
}
|
|
97
102
|
//# sourceMappingURL=remove-node.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-node.tool.js","sourceRoot":"","sources":["../../src/tools/remove-node.tool.ts"],"names":[],"mappings":";;AA0EA,
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