@n8n/ai-workflow-builder 0.32.1 → 0.33.0-exp.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 (149) hide show
  1. package/dist/agents/responder.agent.d.ts +21 -0
  2. package/dist/agents/responder.agent.js +102 -0
  3. package/dist/agents/responder.agent.js.map +1 -0
  4. package/dist/agents/supervisor.agent.d.ts +31 -0
  5. package/dist/agents/supervisor.agent.js +104 -0
  6. package/dist/agents/supervisor.agent.js.map +1 -0
  7. package/dist/ai-workflow-builder-agent.service.d.ts +2 -1
  8. package/dist/ai-workflow-builder-agent.service.js +13 -4
  9. package/dist/ai-workflow-builder-agent.service.js.map +1 -1
  10. package/dist/build.tsbuildinfo +1 -1
  11. package/dist/chains/prompts/examples/basic/switch-node-examples.d.ts +1 -0
  12. package/dist/chains/prompts/examples/basic/switch-node-examples.js +128 -0
  13. package/dist/chains/prompts/examples/basic/switch-node-examples.js.map +1 -0
  14. package/dist/chains/prompts/node-types/switch-node.d.ts +1 -0
  15. package/dist/chains/prompts/node-types/switch-node.js +72 -0
  16. package/dist/chains/prompts/node-types/switch-node.js.map +1 -0
  17. package/dist/chains/prompts/prompt-builder.d.ts +1 -0
  18. package/dist/chains/prompts/prompt-builder.js +12 -0
  19. package/dist/chains/prompts/prompt-builder.js.map +1 -1
  20. package/dist/chains/prompts/prompt-config.js +1 -0
  21. package/dist/chains/prompts/prompt-config.js.map +1 -1
  22. package/dist/constants.d.ts +6 -0
  23. package/dist/constants.js +7 -1
  24. package/dist/constants.js.map +1 -1
  25. package/dist/llm-config.d.ts +1 -0
  26. package/dist/llm-config.js +20 -1
  27. package/dist/llm-config.js.map +1 -1
  28. package/dist/multi-agent-workflow-subgraphs.d.ts +122 -0
  29. package/dist/multi-agent-workflow-subgraphs.js +153 -0
  30. package/dist/multi-agent-workflow-subgraphs.js.map +1 -0
  31. package/dist/parent-graph-state.d.ts +27 -0
  32. package/dist/parent-graph-state.js +47 -0
  33. package/dist/parent-graph-state.js.map +1 -0
  34. package/dist/subgraphs/builder.subgraph.d.ts +122 -0
  35. package/dist/subgraphs/builder.subgraph.js +384 -0
  36. package/dist/subgraphs/builder.subgraph.js.map +1 -0
  37. package/dist/subgraphs/configurator.subgraph.d.ts +132 -0
  38. package/dist/subgraphs/configurator.subgraph.js +272 -0
  39. package/dist/subgraphs/configurator.subgraph.js.map +1 -0
  40. package/dist/subgraphs/discovery.subgraph.d.ts +158 -0
  41. package/dist/subgraphs/discovery.subgraph.js +487 -0
  42. package/dist/subgraphs/discovery.subgraph.js.map +1 -0
  43. package/dist/subgraphs/subgraph-interface.d.ts +23 -0
  44. package/dist/subgraphs/subgraph-interface.js +7 -0
  45. package/dist/subgraphs/subgraph-interface.js.map +1 -0
  46. package/dist/tools/best-practices/content-generation.js +38 -2
  47. package/dist/tools/best-practices/content-generation.js.map +1 -1
  48. package/dist/tools/builder-tools.d.ts +5 -2
  49. package/dist/tools/builder-tools.js +15 -25
  50. package/dist/tools/builder-tools.js.map +1 -1
  51. package/dist/tools/get-best-practices.tool.d.ts +1 -1
  52. package/dist/tools/get-workflow-examples.tool.d.ts +34 -0
  53. package/dist/tools/get-workflow-examples.tool.js +172 -0
  54. package/dist/tools/get-workflow-examples.tool.js.map +1 -0
  55. package/dist/tools/node-details.tool.d.ts +4 -4
  56. package/dist/tools/node-details.tool.js +30 -2
  57. package/dist/tools/node-details.tool.js.map +1 -1
  58. package/dist/tools/node-search.tool.d.ts +1 -1
  59. package/dist/tools/prompts/main-agent.prompt.d.ts +4 -0
  60. package/dist/tools/prompts/main-agent.prompt.js +113 -57
  61. package/dist/tools/prompts/main-agent.prompt.js.map +1 -1
  62. package/dist/tools/utils/markdown-workflow.utils.d.ts +14 -0
  63. package/dist/tools/utils/markdown-workflow.utils.js +174 -0
  64. package/dist/tools/utils/markdown-workflow.utils.js.map +1 -0
  65. package/dist/tools/utils/test/workflows/ai-assistant.workflow.d.ts +2 -0
  66. package/dist/tools/utils/test/workflows/ai-assistant.workflow.js +541 -0
  67. package/dist/tools/utils/test/workflows/ai-assistant.workflow.js.map +1 -0
  68. package/dist/tools/validate-configuration.tool.d.ts +4 -0
  69. package/dist/tools/validate-configuration.tool.js +70 -0
  70. package/dist/tools/validate-configuration.tool.js.map +1 -0
  71. package/dist/tools/validate-structure.tool.d.ts +4 -0
  72. package/dist/tools/validate-structure.tool.js +66 -0
  73. package/dist/tools/validate-structure.tool.js.map +1 -0
  74. package/dist/tools/web/templates.d.ts +7 -0
  75. package/dist/tools/web/templates.js +71 -0
  76. package/dist/tools/web/templates.js.map +1 -0
  77. package/dist/types/config.d.ts +1 -0
  78. package/dist/types/coordination.d.ts +42 -0
  79. package/dist/types/coordination.js +23 -0
  80. package/dist/types/coordination.js.map +1 -0
  81. package/dist/types/discovery-types.d.ts +14 -0
  82. package/dist/types/discovery-types.js +3 -0
  83. package/dist/types/discovery-types.js.map +1 -0
  84. package/dist/types/index.d.ts +1 -0
  85. package/dist/types/index.js +15 -0
  86. package/dist/types/index.js.map +1 -1
  87. package/dist/types/langchain.d.ts +1 -0
  88. package/dist/types/langchain.js +8 -0
  89. package/dist/types/langchain.js.map +1 -1
  90. package/dist/types/tools.d.ts +20 -0
  91. package/dist/types/web/templates.d.ts +44 -0
  92. package/dist/types/web/templates.js +37 -0
  93. package/dist/types/web/templates.js.map +1 -0
  94. package/dist/utils/cache-control/helpers.d.ts +1 -0
  95. package/dist/utils/cache-control/helpers.js +36 -0
  96. package/dist/utils/cache-control/helpers.js.map +1 -1
  97. package/dist/utils/cache-control/index.d.ts +1 -1
  98. package/dist/utils/cache-control/index.js +2 -1
  99. package/dist/utils/cache-control/index.js.map +1 -1
  100. package/dist/utils/context-builders.d.ts +10 -0
  101. package/dist/utils/context-builders.js +71 -0
  102. package/dist/utils/context-builders.js.map +1 -0
  103. package/dist/utils/coordination-log.d.ts +15 -0
  104. package/dist/utils/coordination-log.js +75 -0
  105. package/dist/utils/coordination-log.js.map +1 -0
  106. package/dist/utils/operations-processor.d.ts +4 -2
  107. package/dist/utils/operations-processor.js.map +1 -1
  108. package/dist/utils/state-modifier.d.ts +32 -0
  109. package/dist/utils/state-modifier.js +112 -0
  110. package/dist/utils/state-modifier.js.map +1 -0
  111. package/dist/utils/state-reducers.d.ts +4 -0
  112. package/dist/utils/state-reducers.js +25 -0
  113. package/dist/utils/state-reducers.js.map +1 -0
  114. package/dist/utils/stream-processor.d.ts +6 -2
  115. package/dist/utils/stream-processor.js +138 -83
  116. package/dist/utils/stream-processor.js.map +1 -1
  117. package/dist/utils/subgraph-helpers.d.ts +16 -0
  118. package/dist/utils/subgraph-helpers.js +118 -0
  119. package/dist/utils/subgraph-helpers.js.map +1 -0
  120. package/dist/utils/token-usage.js +4 -1
  121. package/dist/utils/token-usage.js.map +1 -1
  122. package/dist/utils/tool-executor.js +55 -38
  123. package/dist/utils/tool-executor.js.map +1 -1
  124. package/dist/utils/workflow-validation.js +1 -0
  125. package/dist/utils/workflow-validation.js.map +1 -1
  126. package/dist/validation/checks/connections.js +6 -14
  127. package/dist/validation/checks/connections.js.map +1 -1
  128. package/dist/validation/checks/index.d.ts +2 -1
  129. package/dist/validation/checks/index.js +3 -1
  130. package/dist/validation/checks/index.js.map +1 -1
  131. package/dist/validation/checks/nodes.d.ts +4 -0
  132. package/dist/validation/checks/nodes.js +36 -0
  133. package/dist/validation/checks/nodes.js.map +1 -0
  134. package/dist/validation/checks/tools.js +0 -10
  135. package/dist/validation/checks/tools.js.map +1 -1
  136. package/dist/validation/checks/trigger.js +0 -6
  137. package/dist/validation/checks/trigger.js.map +1 -1
  138. package/dist/validation/programmatic.js +2 -0
  139. package/dist/validation/programmatic.js.map +1 -1
  140. package/dist/validation/types.d.ts +5 -1
  141. package/dist/validation/types.js +8 -0
  142. package/dist/validation/types.js.map +1 -1
  143. package/dist/workflow-builder-agent.d.ts +9 -0
  144. package/dist/workflow-builder-agent.js +44 -10
  145. package/dist/workflow-builder-agent.js.map +1 -1
  146. package/dist/workflow-state.d.ts +4 -2
  147. package/dist/workflow-state.js +9 -0
  148. package/dist/workflow-state.js.map +1 -1
  149. package/package.json +9 -8
@@ -7,40 +7,30 @@ const categorize_prompt_tool_1 = require("./categorize-prompt.tool");
7
7
  const connect_nodes_tool_1 = require("./connect-nodes.tool");
8
8
  const get_best_practices_tool_1 = require("./get-best-practices.tool");
9
9
  const get_node_parameter_tool_1 = require("./get-node-parameter.tool");
10
+ const get_workflow_examples_tool_1 = require("./get-workflow-examples.tool");
10
11
  const node_details_tool_1 = require("./node-details.tool");
11
12
  const node_search_tool_1 = require("./node-search.tool");
12
13
  const remove_connection_tool_1 = require("./remove-connection.tool");
13
14
  const remove_node_tool_1 = require("./remove-node.tool");
14
15
  const update_node_parameters_tool_1 = require("./update-node-parameters.tool");
15
16
  const validate_workflow_tool_1 = require("./validate-workflow.tool");
16
- function getBuilderTools({ parsedNodeTypes, logger, llmComplexTask, instanceUrl, }) {
17
- return [
17
+ function getBuilderTools({ parsedNodeTypes, logger, llmComplexTask, instanceUrl, featureFlags, }) {
18
+ const tools = [
18
19
  (0, categorize_prompt_tool_1.createCategorizePromptTool)(llmComplexTask, logger),
19
20
  (0, get_best_practices_tool_1.createGetBestPracticesTool)(),
20
- (0, node_search_tool_1.createNodeSearchTool)(parsedNodeTypes),
21
- (0, node_details_tool_1.createNodeDetailsTool)(parsedNodeTypes),
22
- (0, add_node_tool_1.createAddNodeTool)(parsedNodeTypes),
23
- (0, connect_nodes_tool_1.createConnectNodesTool)(parsedNodeTypes, logger),
24
- (0, remove_connection_tool_1.createRemoveConnectionTool)(logger),
25
- (0, remove_node_tool_1.createRemoveNodeTool)(logger),
26
- (0, update_node_parameters_tool_1.createUpdateNodeParametersTool)(parsedNodeTypes, llmComplexTask, logger, instanceUrl),
27
- (0, get_node_parameter_tool_1.createGetNodeParameterTool)(),
28
- (0, validate_workflow_tool_1.createValidateWorkflowTool)(parsedNodeTypes, logger),
29
21
  ];
22
+ if (featureFlags?.templateExamples === true) {
23
+ tools.push((0, get_workflow_examples_tool_1.createGetWorkflowExamplesTool)(logger));
24
+ }
25
+ tools.push((0, node_search_tool_1.createNodeSearchTool)(parsedNodeTypes), (0, node_details_tool_1.createNodeDetailsTool)(parsedNodeTypes), (0, add_node_tool_1.createAddNodeTool)(parsedNodeTypes), (0, connect_nodes_tool_1.createConnectNodesTool)(parsedNodeTypes, logger), (0, remove_connection_tool_1.createRemoveConnectionTool)(logger), (0, remove_node_tool_1.createRemoveNodeTool)(logger), (0, update_node_parameters_tool_1.createUpdateNodeParametersTool)(parsedNodeTypes, llmComplexTask, logger, instanceUrl), (0, get_node_parameter_tool_1.createGetNodeParameterTool)(), (0, validate_workflow_tool_1.createValidateWorkflowTool)(parsedNodeTypes, logger));
26
+ return tools;
30
27
  }
31
- function getBuilderToolsForDisplay({ nodeTypes, }) {
32
- return [
33
- categorize_prompt_tool_1.CATEGORIZE_PROMPT_TOOL,
34
- get_best_practices_tool_1.GET_BEST_PRACTICES_TOOL,
35
- node_search_tool_1.NODE_SEARCH_TOOL,
36
- node_details_tool_1.NODE_DETAILS_TOOL,
37
- (0, add_node_tool_1.getAddNodeToolBase)(nodeTypes),
38
- connect_nodes_tool_1.CONNECT_NODES_TOOL,
39
- remove_connection_tool_1.REMOVE_CONNECTION_TOOL,
40
- remove_node_tool_1.REMOVE_NODE_TOOL,
41
- update_node_parameters_tool_1.UPDATING_NODE_PARAMETER_TOOL,
42
- get_node_parameter_tool_1.GET_NODE_PARAMETER_TOOL,
43
- validate_workflow_tool_1.VALIDATE_WORKFLOW_TOOL,
44
- ];
28
+ function getBuilderToolsForDisplay({ nodeTypes, featureFlags, }) {
29
+ const tools = [categorize_prompt_tool_1.CATEGORIZE_PROMPT_TOOL, get_best_practices_tool_1.GET_BEST_PRACTICES_TOOL];
30
+ if (featureFlags?.templateExamples === true) {
31
+ tools.push(get_workflow_examples_tool_1.GET_WORKFLOW_EXAMPLES_TOOL);
32
+ }
33
+ tools.push(node_search_tool_1.NODE_SEARCH_TOOL, node_details_tool_1.NODE_DETAILS_TOOL, (0, add_node_tool_1.getAddNodeToolBase)(nodeTypes), connect_nodes_tool_1.CONNECT_NODES_TOOL, remove_connection_tool_1.REMOVE_CONNECTION_TOOL, remove_node_tool_1.REMOVE_NODE_TOOL, update_node_parameters_tool_1.UPDATING_NODE_PARAMETER_TOOL, get_node_parameter_tool_1.GET_NODE_PARAMETER_TOOL, validate_workflow_tool_1.VALIDATE_WORKFLOW_TOOL);
34
+ return tools;
45
35
  }
46
36
  //# sourceMappingURL=builder-tools.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"builder-tools.js","sourceRoot":"","sources":["../../src/tools/builder-tools.ts"],"names":[],"mappings":";;AAqBA,0CAwBC;AAOD,8DAgBC;AA9DD,mDAAwE;AACxE,qEAA8F;AAC9F,6DAAkF;AAClF,uEAAgG;AAChG,uEAAgG;AAChG,2DAA+E;AAC/E,yDAA4E;AAC5E,qEAA8F;AAC9F,yDAA4E;AAC5E,+EAGuC;AACvC,qEAA8F;AAE9F,SAAgB,eAAe,CAAC,EAC/B,eAAe,EACf,MAAM,EACN,cAAc,EACd,WAAW,GAMX;IACA,OAAO;QACN,IAAA,mDAA0B,EAAC,cAAc,EAAE,MAAM,CAAC;QAClD,IAAA,oDAA0B,GAAE;QAC5B,IAAA,uCAAoB,EAAC,eAAe,CAAC;QACrC,IAAA,yCAAqB,EAAC,eAAe,CAAC;QACtC,IAAA,iCAAiB,EAAC,eAAe,CAAC;QAClC,IAAA,2CAAsB,EAAC,eAAe,EAAE,MAAM,CAAC;QAC/C,IAAA,mDAA0B,EAAC,MAAM,CAAC;QAClC,IAAA,uCAAoB,EAAC,MAAM,CAAC;QAC5B,IAAA,4DAA8B,EAAC,eAAe,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,CAAC;QACpF,IAAA,oDAA0B,GAAE;QAC5B,IAAA,mDAA0B,EAAC,eAAe,EAAE,MAAM,CAAC;KACnD,CAAC;AACH,CAAC;AAOD,SAAgB,yBAA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ACpF,IAAA,oDAA0B,GAAE,EAC5B,IAAA,mDAA0B,EAAC,eAAe,EAAE,MAAM,CAAC,CACnD,CAAC;IAEF,OAAO,KAAK,CAAC;AACd,CAAC;AAOD,SAAgB,yBAAyB,CAAC,EACzC,SAAS,EACT,YAAY,GAIZ;IACA,MAAM,KAAK,GAAsB,CAAC,+CAAsB,EAAE,iDAAuB,CAAC,CAAC;IAInF,IAAI,YAAY,EAAE,gBAAgB,KAAK,IAAI,EAAE,CAAC;QAC7C,KAAK,CAAC,IAAI,CAAC,uDAA0B,CAAC,CAAC;IACxC,CAAC;IAGD,KAAK,CAAC,IAAI,CACT,mCAAgB,EAChB,qCAAiB,EACjB,IAAA,kCAAkB,EAAC,SAAS,CAAC,EAC7B,uCAAkB,EAClB,+CAAsB,EACtB,mCAAgB,EAChB,0DAA4B,EAC5B,iDAAuB,EACvB,+CAAsB,CACtB,CAAC;IAEF,OAAO,KAAK,CAAC;AACd,CAAC"}
@@ -29,5 +29,5 @@ export declare function createGetBestPracticesTool(): {
29
29
  techniques: ("scheduling" | "chatbot" | "form_input" | "scraping_and_research" | "monitoring" | "enrichment" | "triage" | "content_generation" | "document_processing" | "data_extraction" | "data_analysis" | "data_transformation" | "notification" | "knowledge_base" | "human_in_the_loop")[];
30
30
  }>, unknown, {
31
31
  techniques: ("scheduling" | "chatbot" | "form_input" | "scraping_and_research" | "monitoring" | "enrichment" | "triage" | "content_generation" | "document_processing" | "data_extraction" | "data_analysis" | "data_transformation" | "notification" | "knowledge_base" | "human_in_the_loop")[];
32
- }, import("@langchain/langgraph").Command<unknown>>;
32
+ }, import("@langchain/langgraph").Command<unknown, Record<string, unknown>, string>>;
33
33
  };
@@ -0,0 +1,34 @@
1
+ import type { Logger } from '@n8n/backend-common';
2
+ import { z } from 'zod';
3
+ import type { BuilderToolBase } from '../utils/stream-processor';
4
+ export declare const GET_WORKFLOW_EXAMPLES_TOOL: BuilderToolBase;
5
+ export declare function createGetWorkflowExamplesTool(logger?: Logger): {
6
+ toolName: string;
7
+ displayTitle: string;
8
+ getCustomDisplayTitle?: (values: Record<string, unknown>) => string;
9
+ tool: import("@langchain/core/tools").DynamicStructuredTool<z.ZodObject<{
10
+ queries: z.ZodArray<z.ZodObject<{
11
+ search: z.ZodOptional<z.ZodString>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ search?: string | undefined;
14
+ }, {
15
+ search?: string | undefined;
16
+ }>, "many">;
17
+ }, "strip", z.ZodTypeAny, {
18
+ queries: {
19
+ search?: string | undefined;
20
+ }[];
21
+ }, {
22
+ queries: {
23
+ search?: string | undefined;
24
+ }[];
25
+ }>, {
26
+ queries: {
27
+ search?: string | undefined;
28
+ }[];
29
+ }, {
30
+ queries: {
31
+ search?: string | undefined;
32
+ }[];
33
+ }, import("@langchain/langgraph").Command<unknown, Record<string, unknown>, string>>;
34
+ };
@@ -0,0 +1,172 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_WORKFLOW_EXAMPLES_TOOL = void 0;
4
+ exports.createGetWorkflowExamplesTool = createGetWorkflowExamplesTool;
5
+ const tools_1 = require("@langchain/core/tools");
6
+ const zod_1 = require("zod");
7
+ const errors_1 = require("../errors");
8
+ const helpers_1 = require("./helpers");
9
+ const markdown_workflow_utils_1 = require("./utils/markdown-workflow.utils");
10
+ const templates_1 = require("./web/templates");
11
+ const workflowExampleQuerySchema = zod_1.z.object({
12
+ search: zod_1.z.string().optional().describe('Search term to find workflow examples'),
13
+ });
14
+ const getWorkflowExamplesSchema = zod_1.z.object({
15
+ queries: zod_1.z
16
+ .array(workflowExampleQuerySchema)
17
+ .min(1)
18
+ .describe('Array of search queries to find workflow examples'),
19
+ });
20
+ async function fetchWorkflowExamples(query, logger) {
21
+ logger?.debug('Fetching workflow examples with query', { query });
22
+ const response = await (0, templates_1.fetchTemplateList)({
23
+ search: query.search,
24
+ });
25
+ const workflowResults = await Promise.all(response.workflows.map(async (workflow) => {
26
+ try {
27
+ const fullWorkflow = await (0, templates_1.fetchTemplateByID)(workflow.id);
28
+ return {
29
+ metadata: {
30
+ name: workflow.name,
31
+ description: workflow.description,
32
+ workflow: fullWorkflow.workflow,
33
+ },
34
+ templateId: workflow.id,
35
+ };
36
+ }
37
+ catch (error) {
38
+ logger?.warn(`Failed to fetch full workflow for template ${workflow.id}`, { error });
39
+ return undefined;
40
+ }
41
+ }));
42
+ const validResults = workflowResults.filter((result) => result !== undefined);
43
+ return {
44
+ workflows: validResults.map((r) => r.metadata),
45
+ totalFound: response.totalWorkflows,
46
+ templateIds: validResults.map((r) => r.templateId),
47
+ };
48
+ }
49
+ function buildQueryIdentifier(query) {
50
+ const parts = [];
51
+ if (query.search) {
52
+ parts.push(`search: ${query.search}`);
53
+ }
54
+ return parts.join(',');
55
+ }
56
+ function buildResponseMessage(output) {
57
+ if (output.examples.length === 0) {
58
+ return 'No workflow examples found';
59
+ }
60
+ const sections = [`Found ${output.totalResults} workflow example(s):`];
61
+ for (const example of output.examples) {
62
+ sections.push(`\n## ${example.name}`);
63
+ if (example.description) {
64
+ sections.push(example.description);
65
+ }
66
+ sections.push(example.workflow);
67
+ }
68
+ return sections.join('\n');
69
+ }
70
+ exports.GET_WORKFLOW_EXAMPLES_TOOL = {
71
+ toolName: 'get_workflow_examples',
72
+ displayTitle: 'Retrieving workflow examples',
73
+ };
74
+ const TOOL_DESCRIPTION = `Retrieve workflow examples from n8n's workflow library to use as reference for building workflows.
75
+
76
+ This tool searches for existing workflow examples that match specific criteria.
77
+ The retrieved workflows serve as reference material to understand common patterns, node usage and connections.
78
+ Consider these workflows as ideal solutions.
79
+ The workflows will be returned in a token efficient format rather than JSON.
80
+
81
+ Usage:
82
+ - Provide search criteria to find relevant workflow examples
83
+ - Results include workflow metadata, summaries, and full workflow data for reference
84
+
85
+ Parameters:
86
+ - search: Keywords to search for in workflow names/descriptions based on the user prompt`;
87
+ function createGetWorkflowExamplesTool(logger) {
88
+ const dynamicTool = (0, tools_1.tool)(async (input, config) => {
89
+ const reporter = (0, helpers_1.createProgressReporter)(config, exports.GET_WORKFLOW_EXAMPLES_TOOL.toolName, exports.GET_WORKFLOW_EXAMPLES_TOOL.displayTitle);
90
+ try {
91
+ const validatedInput = getWorkflowExamplesSchema.parse(input);
92
+ const { queries } = validatedInput;
93
+ reporter.start(validatedInput);
94
+ let allResults = [];
95
+ let allTemplateIds = [];
96
+ const batchReporter = (0, helpers_1.createBatchProgressReporter)(reporter, 'Retrieving workflow examples');
97
+ batchReporter.init(queries.length);
98
+ for (const query of queries) {
99
+ const identifier = buildQueryIdentifier(query);
100
+ try {
101
+ batchReporter.next(identifier);
102
+ const result = await fetchWorkflowExamples(query, logger);
103
+ allResults = allResults.concat(result.workflows);
104
+ allTemplateIds = allTemplateIds.concat(result.templateIds);
105
+ }
106
+ catch (error) {
107
+ logger?.error('Error fetching workflow examples', { error });
108
+ }
109
+ }
110
+ batchReporter.complete();
111
+ const uniqueWorkflows = new Map();
112
+ for (const workflow of allResults) {
113
+ if (!uniqueWorkflows.has(workflow.name)) {
114
+ uniqueWorkflows.set(workflow.name, workflow);
115
+ }
116
+ }
117
+ const deduplicatedResults = Array.from(uniqueWorkflows.values());
118
+ const processedResults = (0, markdown_workflow_utils_1.processWorkflowExamples)(deduplicatedResults, {
119
+ includeNodeParameters: false,
120
+ });
121
+ const nodeConfigurations = processedResults.length > 0
122
+ ? processedResults[processedResults.length - 1].nodeConfigurations
123
+ : {};
124
+ logger?.debug('Collected node configurations from workflow examples', {
125
+ nodeTypeCount: Object.keys(nodeConfigurations).length,
126
+ nodeTypes: Object.keys(nodeConfigurations),
127
+ configCounts: Object.fromEntries(Object.entries(nodeConfigurations).map(([type, configs]) => [type, configs.length])),
128
+ });
129
+ const formattedResults = deduplicatedResults.map((workflow, index) => ({
130
+ name: workflow.name,
131
+ description: workflow.description,
132
+ workflow: processedResults[index].mermaid,
133
+ }));
134
+ const output = {
135
+ examples: formattedResults,
136
+ totalResults: deduplicatedResults.length,
137
+ nodeConfigurations,
138
+ };
139
+ const responseMessage = buildResponseMessage(output);
140
+ reporter.complete(output);
141
+ const uniqueTemplateIds = [...new Set(allTemplateIds)];
142
+ return (0, helpers_1.createSuccessResponse)(config, responseMessage, {
143
+ nodeConfigurations,
144
+ templateIds: uniqueTemplateIds,
145
+ });
146
+ }
147
+ catch (error) {
148
+ if (error instanceof zod_1.z.ZodError) {
149
+ const validationError = new errors_1.ValidationError('Invalid input parameters', {
150
+ extra: { errors: error.errors },
151
+ });
152
+ reporter.error(validationError);
153
+ return (0, helpers_1.createErrorResponse)(config, validationError);
154
+ }
155
+ const toolError = new errors_1.ToolExecutionError(error instanceof Error ? error.message : 'Unknown error occurred', {
156
+ toolName: exports.GET_WORKFLOW_EXAMPLES_TOOL.toolName,
157
+ cause: error instanceof Error ? error : undefined,
158
+ });
159
+ reporter.error(toolError);
160
+ return (0, helpers_1.createErrorResponse)(config, toolError);
161
+ }
162
+ }, {
163
+ name: exports.GET_WORKFLOW_EXAMPLES_TOOL.toolName,
164
+ description: TOOL_DESCRIPTION,
165
+ schema: getWorkflowExamplesSchema,
166
+ });
167
+ return {
168
+ tool: dynamicTool,
169
+ ...exports.GET_WORKFLOW_EXAMPLES_TOOL,
170
+ };
171
+ }
172
+ //# sourceMappingURL=get-workflow-examples.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-workflow-examples.tool.js","sourceRoot":"","sources":["../../src/tools/get-workflow-examples.tool.ts"],"names":[],"mappings":";;;AAwJA,sEAmIC;AA3RD,iDAA6C;AAE7C,6BAAwB;AAKxB,sCAAgE;AAChE,uCAKmB;AACnB,6EAA0E;AAC1E,+CAAuE;AAKvE,MAAM,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;CAC/E,CAAC,CAAC;AAKH,MAAM,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC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QACC,IAAI,EAAE,kCAA0B,CAAC,QAAQ;QACzC,WAAW,EAAE,gBAAgB;QAC7B,MAAM,EAAE,yBAAyB;KACjC,CACD,CAAC;IAEF,OAAO;QACN,IAAI,EAAE,WAAW;QACjB,GAAG,kCAA0B;KAC7B,CAAC;AACH,CAAC"}
@@ -12,19 +12,19 @@ export declare function createNodeDetailsTool(nodeTypes: INodeTypeDescription[])
12
12
  withParameters: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
13
13
  withConnections: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
14
14
  }, "strip", z.ZodTypeAny, {
15
- nodeVersion: number;
16
15
  nodeName: string;
16
+ nodeVersion: number;
17
17
  withParameters: boolean;
18
18
  withConnections: boolean;
19
19
  }, {
20
- nodeVersion: number;
21
20
  nodeName: string;
21
+ nodeVersion: number;
22
22
  withParameters?: boolean | undefined;
23
23
  withConnections?: boolean | undefined;
24
24
  }>, unknown, {
25
- nodeVersion: number;
26
25
  nodeName: string;
26
+ nodeVersion: number;
27
27
  withParameters?: boolean | undefined;
28
28
  withConnections?: boolean | undefined;
29
- }, import("@langchain/langgraph").Command<unknown>>;
29
+ }, import("@langchain/langgraph").Command<unknown, Record<string, unknown>, string>>;
30
30
  };
@@ -4,9 +4,11 @@ exports.NODE_DETAILS_TOOL = void 0;
4
4
  exports.createNodeDetailsTool = createNodeDetailsTool;
5
5
  const tools_1 = require("@langchain/core/tools");
6
6
  const zod_1 = require("zod");
7
+ const constants_1 = require("../constants");
7
8
  const errors_1 = require("../errors");
8
9
  const progress_1 = require("./helpers/progress");
9
10
  const response_1 = require("./helpers/response");
11
+ const state_1 = require("./helpers/state");
10
12
  const validation_1 = require("./helpers/validation");
11
13
  const nodeDetailsSchema = zod_1.z.object({
12
14
  nodeName: zod_1.z.string().describe('The exact node type name (e.g., n8n-nodes-base.httpRequest)'),
@@ -52,7 +54,7 @@ function formatOutputs(outputs) {
52
54
  });
53
55
  return formattedOutputs.join('\n');
54
56
  }
55
- function formatNodeDetails(details, withParameters = false, withConnections = true) {
57
+ function formatNodeDetails(details, withParameters = false, withConnections = true, examples = []) {
56
58
  const parts = [];
57
59
  parts.push('<node_details>');
58
60
  parts.push(`<name>${details.name}</name>`);
@@ -73,6 +75,21 @@ function formatNodeDetails(details, withParameters = false, withConnections = tr
73
75
  parts.push(formatOutputs(details.outputs));
74
76
  parts.push('</connections>');
75
77
  }
78
+ if (examples.length > 0) {
79
+ const { parts: exampleParts } = examples.reduce((acc, example) => {
80
+ const exampleStr = JSON.stringify(example, null, 2);
81
+ if (acc.chars + exampleStr.length <= constants_1.MAX_NODE_EXAMPLE_CHARS) {
82
+ acc.parts.push(exampleStr);
83
+ acc.chars += exampleStr.length;
84
+ }
85
+ return acc;
86
+ }, { parts: [], chars: 0 });
87
+ if (exampleParts.length > 0) {
88
+ parts.push('<node_examples>');
89
+ parts.push(...exampleParts);
90
+ parts.push('</node_examples>');
91
+ }
92
+ }
76
93
  parts.push('</node_details>');
77
94
  return parts.join('\n');
78
95
  }
@@ -106,7 +123,18 @@ function createNodeDetailsTool(nodeTypes) {
106
123
  return (0, response_1.createErrorResponse)(config, error);
107
124
  }
108
125
  const details = extractNodeDetails(nodeType);
109
- const message = formatNodeDetails(details, withParameters, withConnections);
126
+ let examples = [];
127
+ try {
128
+ const state = (0, state_1.getWorkflowState)();
129
+ const allNodeConfigs = state?.nodeConfigurations?.[nodeName] ?? [];
130
+ examples = allNodeConfigs
131
+ .filter((config) => config.version === nodeVersion)
132
+ .map((config) => config.parameters);
133
+ }
134
+ catch {
135
+ examples = [];
136
+ }
137
+ const message = formatNodeDetails(details, withParameters, withConnections, examples);
110
138
  const output = {
111
139
  details,
112
140
  found: true,
@@ -1 +1 @@
1
- {"version":3,"file":"node-details.tool.js","sourceRoot":"","sources":["../../src/tools/node-details.tool.ts"],"names":[],"mappings":";;;AAuIA,sDA8EC;AArND,iDAA6C;AAE7C,6BAAwB;AAIxB,sCAAgE;AAChE,iDAA4E;AAC5E,iD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mB,EAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC/C,CAAC;IACF,CAAC,EACD;QACC,IAAI,EAAE,yBAAiB,CAAC,QAAQ;QAChC,WAAW,EACV,kLAAkL;QACnL,MAAM,EAAE,iBAAiB;KACzB,CACD,CAAC;IAEF,OAAO;QACN,IAAI,EAAE,WAAW;QACjB,GAAG,yBAAiB;KACpB,CAAC;AACH,CAAC"}
@@ -58,5 +58,5 @@ export declare function createNodeSearchTool(nodeTypes: INodeTypeDescription[]):
58
58
  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;
59
59
  query?: string | undefined;
60
60
  }[];
61
- }, import("@langchain/langgraph").Command<unknown>>;
61
+ }, import("@langchain/langgraph").Command<unknown, Record<string, unknown>, string>>;
62
62
  };
@@ -1,2 +1,6 @@
1
1
  import { ChatPromptTemplate } from '@langchain/core/prompts';
2
+ export interface MainAgentPromptOptions {
3
+ includeExamplesPhase?: boolean;
4
+ }
5
+ export declare function createMainAgentPrompt(options?: MainAgentPromptOptions): ChatPromptTemplate<any, any>;
2
6
  export declare const mainAgentPrompt: ChatPromptTemplate<any, any>;
@@ -1,9 +1,92 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mainAgentPrompt = void 0;
4
+ exports.createMainAgentPrompt = createMainAgentPrompt;
4
5
  const prompts_1 = require("@langchain/core/prompts");
5
6
  const instance_url_1 = require("../../chains/prompts/instance-url");
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
+ function generateWorkflowCreationPhases(options = {}) {
8
+ const { includeExamplesPhase = false } = options;
9
+ const phases = [
10
+ {
11
+ name: 'Categorization Phase',
12
+ metadata: '- MANDATORY',
13
+ content: [
14
+ 'Categorize the prompt and search for best practices documentation based on the techniques found',
15
+ 'Why: Best practices help to inform which nodes to search for and use to build the workflow plus mistakes to avoid',
16
+ ],
17
+ },
18
+ ];
19
+ if (includeExamplesPhase) {
20
+ phases.push({
21
+ name: 'Examples Phase',
22
+ metadata: '(parallel execution)',
23
+ content: [
24
+ 'Search for workflow examples using simple, relevant search terms',
25
+ 'Why: Examples provide complete, working implementations showing nodes, connections and parameter configurations',
26
+ ],
27
+ });
28
+ }
29
+ phases.push({
30
+ name: 'Discovery Phase',
31
+ metadata: '(parallel execution)',
32
+ content: [
33
+ 'Search for all required node types simultaneously, review the <node_selection> section for tips and best practices',
34
+ 'Why: Ensures you work with actual available nodes, not assumptions',
35
+ ],
36
+ }, {
37
+ name: 'Analysis Phase',
38
+ metadata: '(parallel execution)',
39
+ content: [
40
+ 'Get details for ALL nodes before proceeding',
41
+ 'Why: Understanding inputs/outputs prevents connection errors and ensures proper parameter configuration',
42
+ ],
43
+ }, {
44
+ name: 'Creation Phase',
45
+ metadata: '(parallel execution)',
46
+ content: [
47
+ 'Add nodes individually by calling add_nodes for each node',
48
+ 'Execute multiple add_nodes calls in parallel for efficiency',
49
+ 'Why: Each node addition is independent, parallel execution is faster, and the operations processor ensures consistency',
50
+ ],
51
+ }, {
52
+ name: 'Connection Phase',
53
+ metadata: '(parallel execution)',
54
+ content: [
55
+ 'Connect all nodes based on discovered input/output structure',
56
+ 'Why: Parallel connections are safe and faster',
57
+ ],
58
+ }, {
59
+ name: 'Configuration Phase',
60
+ metadata: '(parallel execution) - MANDATORY',
61
+ content: [
62
+ 'ALWAYS configure nodes using update_node_parameters',
63
+ 'Even for "simple" nodes like HTTP Request, Set, etc.',
64
+ 'Configure all nodes in parallel for efficiency',
65
+ 'Why: Unconfigured nodes will fail at runtime',
66
+ 'Pay special attention to parameters that control node behavior (dataType, mode, operation)',
67
+ 'Why: Unconfigured nodes will fail at runtime, defaults are unreliable',
68
+ ],
69
+ }, {
70
+ name: 'Validation Phase',
71
+ metadata: '(tool call) - MANDATORY',
72
+ content: [
73
+ 'Run validate_workflow after applying changes to refresh the workflow validation report',
74
+ 'Review <workflow_validation_report> and resolve any violations before finalizing',
75
+ 'Why: Ensures structural issues are surfaced early; rerun validation after major updates',
76
+ ],
77
+ });
78
+ return phases
79
+ .map((phase, index) => {
80
+ const phaseNumber = index + 1;
81
+ const metadataStr = phase.metadata ? ` ${phase.metadata}` : '';
82
+ const contentStr = phase.content.map((line) => ` - ${line}`).join('\n');
83
+ return `${phaseNumber}. **${phase.name}**${metadataStr}\n${contentStr}`;
84
+ })
85
+ .join('\n\n');
86
+ }
87
+ function generateSystemPrompt(options = {}) {
88
+ const workflowPhases = generateWorkflowCreationPhases(options);
89
+ return `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
90
  <core_principle>
8
91
  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.
9
92
  </core_principle>
@@ -33,39 +116,7 @@ The system's operations processor ensures state consistency across all parallel
33
116
  <workflow_creation_sequence>
34
117
  Follow this proven sequence for creating robust workflows:
35
118
 
36
- 1. **Categorization Phase** - MANDATORY
37
- - Categorize the prompt and search for best practices documentation based on the techniques found
38
- - Why: Best practices help to inform which nodes to search for and use to build the workflow plus mistakes to avoid
39
-
40
- 2. **Discovery Phase** (parallel execution)
41
- - Search for all required node types simultaneously, review the <node_selection> section for tips and best practices
42
- - Why: Ensures you work with actual available nodes, not assumptions
43
-
44
- 3. **Analysis Phase** (parallel execution)
45
- - Get details for ALL nodes before proceeding
46
- - Why: Understanding inputs/outputs prevents connection errors and ensures proper parameter configuration
47
-
48
- 4. **Creation Phase** (parallel execution)
49
- - Add nodes individually by calling add_nodes for each node
50
- - Execute multiple add_nodes calls in parallel for efficiency
51
- - Why: Each node addition is independent, parallel execution is faster, and the operations processor ensures consistency
52
-
53
- 5. **Connection Phase** (parallel execution)
54
- - Connect all nodes based on discovered input/output structure
55
- - Why: Parallel connections are safe and faster
56
-
57
- 6. **Configuration Phase** (parallel execution) - MANDATORY
58
- - ALWAYS configure nodes using update_node_parameters
59
- - Even for "simple" nodes like HTTP Request, Set, etc.
60
- - Configure all nodes in parallel for efficiency
61
- - Why: Unconfigured nodes will fail at runtime
62
- - Pay special attention to parameters that control node behavior (dataType, mode, operation)
63
- - Why: Unconfigured nodes will fail at runtime, defaults are unreliable
64
-
65
- 6. **Validation Phase** (tool call) - MANDATORY
66
- - Run validate_workflow after applying changes to refresh the workflow validation report
67
- - Review <workflow_validation_report> and resolve any violations before finalizing
68
- - Why: Ensures structural issues are surfaced early; rerun validation after major updates
119
+ ${workflowPhases}
69
120
 
70
121
  <node_selection>
71
122
  When building AI workflows prefer the AI agent node to other text LLM nodes, unless the user specifies them by name. Summarization, analysis, information
@@ -483,6 +534,7 @@ update_node_parameters({{
483
534
  </handling_uncertainty>
484
535
 
485
536
  `;
537
+ }
486
538
  const responsePatterns = `
487
539
  <response_patterns>
488
540
  IMPORTANT: Only provide ONE response AFTER all tool executions are complete.
@@ -527,29 +579,33 @@ const previousConversationSummary = `
527
579
  <previous_summary>
528
580
  {previousSummary}
529
581
  </previous_summary>`;
530
- exports.mainAgentPrompt = prompts_1.ChatPromptTemplate.fromMessages([
531
- [
532
- 'system',
582
+ function createMainAgentPrompt(options = {}) {
583
+ const systemPrompt = generateSystemPrompt(options);
584
+ return prompts_1.ChatPromptTemplate.fromMessages([
533
585
  [
534
- {
535
- type: 'text',
536
- text: systemPrompt,
537
- },
538
- {
539
- type: 'text',
540
- text: instance_url_1.instanceUrlPrompt,
541
- },
542
- {
543
- type: 'text',
544
- text: responsePatterns,
545
- },
546
- {
547
- type: 'text',
548
- text: previousConversationSummary,
549
- cache_control: { type: 'ephemeral' },
550
- },
586
+ 'system',
587
+ [
588
+ {
589
+ type: 'text',
590
+ text: systemPrompt,
591
+ },
592
+ {
593
+ type: 'text',
594
+ text: instance_url_1.instanceUrlPrompt,
595
+ },
596
+ {
597
+ type: 'text',
598
+ text: responsePatterns,
599
+ },
600
+ {
601
+ type: 'text',
602
+ text: previousConversationSummary,
603
+ cache_control: { type: 'ephemeral' },
604
+ },
605
+ ],
551
606
  ],
552
- ],
553
- ['placeholder', '{messages}'],
554
- ]);
607
+ ['placeholder', '{messages}'],
608
+ ]);
609
+ }
610
+ exports.mainAgentPrompt = createMainAgentPrompt();
555
611
  //# sourceMappingURL=main-agent.prompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"main-agent.prompt.js","sourceRoot":"","sources":["../../../src/tools/prompts/main-agent.prompt.ts"],"names":[],"mappings":";;;AAAA,qDAA6D;AAE7D,oEAAsE;AAEtE,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+dpB,CAAC;AAEF,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCxB,CAAC;AAEF,MAAM,2BAA2B,GAAG;;;oBAGhB,CAAC;AAER,QAAA,eAAe,GAAG,4BAAkB,CAAC,YAAY,CAAC;IAC9D;QACC,QAAQ;QACR;YACC;gBACC,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,YAAY;aAClB;YACD;gBACC,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,gCAAiB;aACvB;YACD;gBACC,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,gBAAgB;aACtB;YACD;gBACC,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,2BAA2B;gBACjC,aAAa,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;aACpC;SACD;KACD;IACD,CAAC,aAAa,EAAE,YAAY,CAAC;CAC7B,CAAC,CAAC"}
1
+ {"version":3,"file":"main-agent.prompt.js","sourceRoot":"","sources":["../../../src/tools/prompts/main-agent.prompt.ts"],"names":[],"mappings":";;;AA6mBA,sDA4BC;AAzoBD,qDAA6D;AAE7D,oEAAsE;AAqBtE,SAAS,8BAA8B,CAAC,UAAkC,EAAE;IAC3E,MAAM,EAAE,oBAAoB,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IAEjD,MAAM,MAAM,GAAkB;QAC7B;YACC,IAAI,EAAE,sBAAsB;YAC5B,QAAQ,EAAE,aAAa;YACvB,OAAO,EAAE;gBACR,iGAAiG;gBACjG,mHAAmH;aACnH;SACD;KACD,CAAC;IAEF,IAAI,oBAAoB,EAAE,CAAC;QAC1B,MAAM,CAAC,IAAI,CAAC;YACX,IAAI,EAAE,gBAAgB;YACtB,QAAQ,EAAE,sBAAsB;YAChC,OAAO,EAAE;gBACR,kEAAkE;gBAClE,iHAAiH;aACjH;SACD,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,IAAI,CACV;QACC,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,sBAAsB;QAChC,OAAO,EAAE;YACR,oHAAoH;YACpH,oEAAoE;SACpE;KACD,EACD;QACC,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,sBAAsB;QAChC,OAAO,EAAE;YACR,6CAA6C;YAC7C,yGAAyG;SACzG;KACD,EACD;QACC,IAAI,EAAE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