@n8n/ai-workflow-builder 1.0.2-exp.0 → 1.0.2

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 (73) hide show
  1. package/dist/agents/responder.agent.d.ts +0 -1
  2. package/dist/agents/responder.agent.js +0 -7
  3. package/dist/agents/responder.agent.js.map +1 -1
  4. package/dist/agents/supervisor.agent.d.ts +0 -1
  5. package/dist/agents/supervisor.agent.js +0 -5
  6. package/dist/agents/supervisor.agent.js.map +1 -1
  7. package/dist/ai-workflow-builder-agent.service.d.ts +1 -2
  8. package/dist/ai-workflow-builder-agent.service.js +5 -10
  9. package/dist/ai-workflow-builder-agent.service.js.map +1 -1
  10. package/dist/build.tsbuildinfo +1 -1
  11. package/dist/chains/prompts/prompt-builder.d.ts +0 -1
  12. package/dist/chains/prompts/prompt-builder.js +0 -12
  13. package/dist/chains/prompts/prompt-builder.js.map +1 -1
  14. package/dist/chains/prompts/prompt-config.js +0 -1
  15. package/dist/chains/prompts/prompt-config.js.map +1 -1
  16. package/dist/constants.d.ts +0 -2
  17. package/dist/constants.js +1 -3
  18. package/dist/constants.js.map +1 -1
  19. package/dist/multi-agent-workflow-subgraphs.d.ts +1 -38
  20. package/dist/multi-agent-workflow-subgraphs.js +2 -34
  21. package/dist/multi-agent-workflow-subgraphs.js.map +1 -1
  22. package/dist/parent-graph-state.d.ts +0 -4
  23. package/dist/parent-graph-state.js +1 -14
  24. package/dist/parent-graph-state.js.map +1 -1
  25. package/dist/subgraphs/builder.subgraph.d.ts +0 -2
  26. package/dist/subgraphs/builder.subgraph.js +1 -63
  27. package/dist/subgraphs/builder.subgraph.js.map +1 -1
  28. package/dist/subgraphs/configurator.subgraph.d.ts +0 -2
  29. package/dist/subgraphs/configurator.subgraph.js +0 -30
  30. package/dist/subgraphs/configurator.subgraph.js.map +1 -1
  31. package/dist/subgraphs/discovery.subgraph.d.ts +0 -18
  32. package/dist/subgraphs/discovery.subgraph.js +16 -88
  33. package/dist/subgraphs/discovery.subgraph.js.map +1 -1
  34. package/dist/tools/best-practices/content-generation.js +2 -38
  35. package/dist/tools/best-practices/content-generation.js.map +1 -1
  36. package/dist/types/config.d.ts +0 -1
  37. package/dist/types/coordination.d.ts +2 -8
  38. package/dist/types/coordination.js +0 -4
  39. package/dist/types/coordination.js.map +1 -1
  40. package/dist/types/discovery-types.d.ts +0 -2
  41. package/dist/utils/coordination-log.d.ts +1 -2
  42. package/dist/utils/coordination-log.js.map +1 -1
  43. package/dist/utils/stream-processor.js +30 -2
  44. package/dist/utils/stream-processor.js.map +1 -1
  45. package/dist/utils/subgraph-helpers.d.ts +0 -3
  46. package/dist/utils/subgraph-helpers.js +0 -23
  47. package/dist/utils/subgraph-helpers.js.map +1 -1
  48. package/dist/validation/checks/connections.js +16 -9
  49. package/dist/validation/checks/connections.js.map +1 -1
  50. package/dist/validation/checks/tools.js +10 -0
  51. package/dist/validation/checks/tools.js.map +1 -1
  52. package/dist/validation/types.js.map +1 -1
  53. package/dist/workflow-builder-agent.d.ts +2 -3
  54. package/dist/workflow-builder-agent.js +7 -12
  55. package/dist/workflow-builder-agent.js.map +1 -1
  56. package/dist/workflow-state.js +14 -3
  57. package/dist/workflow-state.js.map +1 -1
  58. package/package.json +2 -2
  59. package/dist/chains/prompts/examples/basic/switch-node-examples.d.ts +0 -1
  60. package/dist/chains/prompts/examples/basic/switch-node-examples.js +0 -128
  61. package/dist/chains/prompts/examples/basic/switch-node-examples.js.map +0 -1
  62. package/dist/chains/prompts/node-types/switch-node.d.ts +0 -1
  63. package/dist/chains/prompts/node-types/switch-node.js +0 -72
  64. package/dist/chains/prompts/node-types/switch-node.js.map +0 -1
  65. package/dist/utils/state-modifier.d.ts +0 -32
  66. package/dist/utils/state-modifier.js +0 -112
  67. package/dist/utils/state-modifier.js.map +0 -1
  68. package/dist/utils/state-reducers.d.ts +0 -4
  69. package/dist/utils/state-reducers.js +0 -25
  70. package/dist/utils/state-reducers.js.map +0 -1
  71. package/dist/validation/utils/node-type-map.d.ts +0 -8
  72. package/dist/validation/utils/node-type-map.js +0 -50
  73. package/dist/validation/utils/node-type-map.js.map +0 -1
@@ -1,72 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SWITCH_NODE_GUIDE = void 0;
4
- exports.SWITCH_NODE_GUIDE = `
5
- ### Switch Node Configuration Guide
6
-
7
- The Switch node routes items to different outputs based on conditions. Uses the same filter structure as IF node but for multi-way branching.
8
-
9
- #### Switch Node Structure (mode: 'rules')
10
- \`\`\`json
11
- {
12
- "mode": "rules",
13
- "rules": {
14
- "values": [
15
- {
16
- "conditions": {
17
- "options": {
18
- "caseSensitive": true,
19
- "leftValue": "",
20
- "typeValidation": "strict"
21
- },
22
- "conditions": [
23
- {
24
- "leftValue": "={{ $json.amount }}",
25
- "rightValue": 100,
26
- "operator": {
27
- "type": "number",
28
- "operation": "lt"
29
- }
30
- }
31
- ],
32
- "combinator": "and"
33
- },
34
- "renameOutput": true,
35
- "outputKey": "Under $100"
36
- }
37
- ]
38
- }
39
- }
40
- \`\`\`
41
-
42
- #### Key Points:
43
- 1. Each entry in rules.values[] creates ONE output
44
- 2. Conditions use the same filter structure as IF node
45
- 3. Multiple conditions per rule are combined with combinator ("and" or "or")
46
- 4. Use renameOutput: true + outputKey to label outputs descriptively
47
-
48
- #### Numeric Operators
49
- - lt: Less than
50
- - gt: Greater than
51
- - lte: Less than or equal
52
- - gte: Greater than or equal
53
- - equals: Equal to
54
-
55
- #### String Operators
56
- - equals: Exact match
57
- - contains: Contains substring
58
- - startsWith: Starts with
59
- - endsWith: Ends with
60
-
61
- #### Common Patterns:
62
-
63
- **Numeric Range Routing** (for ranges like $100-$1000):
64
- Use two conditions with combinator: "and":
65
- - First condition: gte (greater than or equal to lower bound)
66
- - Second condition: lte (less than or equal to upper bound)
67
-
68
- **String-Based Routing** (status/type values):
69
- - Use type: "string" with operation: "equals"
70
- - Set caseSensitive: false in options for case-insensitive matching
71
- `;
72
- //# sourceMappingURL=switch-node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"switch-node.js","sourceRoot":"","sources":["../../../../src/chains/prompts/node-types/switch-node.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmEhC,CAAC"}
@@ -1,32 +0,0 @@
1
- import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
2
- import type { BaseMessage } from '@langchain/core/messages';
3
- import { RemoveMessage } from '@langchain/core/messages';
4
- import type { Logger } from '@n8n/backend-common';
5
- import type { CoordinationLogEntry } from '../types/coordination';
6
- import type { SimpleWorkflow } from '../types/workflow';
7
- export type StateModificationAction = 'compact_messages' | 'delete_messages' | 'create_workflow_name' | 'auto_compact_messages' | 'cleanup_dangling' | 'continue';
8
- export interface StateModifierInput {
9
- messages: BaseMessage[];
10
- workflowJSON: SimpleWorkflow;
11
- previousSummary?: string;
12
- }
13
- export declare function determineStateAction(input: StateModifierInput, autoCompactThresholdTokens: number): StateModificationAction;
14
- export declare function handleCleanupDangling(messages: BaseMessage[], logger?: Logger): {
15
- messages: RemoveMessage[];
16
- };
17
- export declare function handleCompactMessages(messages: BaseMessage[], previousSummary: string, llm: BaseChatModel, isAutoCompact: boolean): Promise<{
18
- previousSummary: string;
19
- messages: BaseMessage[];
20
- coordinationLog: CoordinationLogEntry[];
21
- }>;
22
- export declare function handleDeleteMessages(messages: BaseMessage[]): {
23
- messages: RemoveMessage[];
24
- workflowJSON: SimpleWorkflow;
25
- previousSummary: string;
26
- discoveryContext: null;
27
- coordinationLog: CoordinationLogEntry[];
28
- workflowOperations: [];
29
- };
30
- export declare function handleCreateWorkflowName(messages: BaseMessage[], workflowJSON: SimpleWorkflow, llm: BaseChatModel, logger?: Logger): Promise<{
31
- workflowJSON: SimpleWorkflow;
32
- }>;
@@ -1,112 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.determineStateAction = determineStateAction;
4
- exports.handleCleanupDangling = handleCleanupDangling;
5
- exports.handleCompactMessages = handleCompactMessages;
6
- exports.handleDeleteMessages = handleDeleteMessages;
7
- exports.handleCreateWorkflowName = handleCreateWorkflowName;
8
- const messages_1 = require("@langchain/core/messages");
9
- const cleanup_dangling_tool_call_messages_1 = require("./cleanup-dangling-tool-call-messages");
10
- const token_usage_1 = require("./token-usage");
11
- const conversation_compact_1 = require("../chains/conversation-compact");
12
- const workflow_name_1 = require("../chains/workflow-name");
13
- const coordination_1 = require("../types/coordination");
14
- function determineStateAction(input, autoCompactThresholdTokens) {
15
- const { messages, workflowJSON } = input;
16
- const danglingMessages = (0, cleanup_dangling_tool_call_messages_1.cleanupDanglingToolCallMessages)(messages);
17
- if (danglingMessages.length > 0) {
18
- return 'cleanup_dangling';
19
- }
20
- const lastHumanMessage = messages.findLast((m) => m instanceof messages_1.HumanMessage);
21
- if (!lastHumanMessage)
22
- return 'continue';
23
- if (lastHumanMessage.content === '/compact') {
24
- return 'compact_messages';
25
- }
26
- if (lastHumanMessage.content === '/clear') {
27
- return 'delete_messages';
28
- }
29
- const workflowName = workflowJSON?.name;
30
- const nodesLength = workflowJSON?.nodes?.length ?? 0;
31
- const isDefaultName = !workflowName || /^My workflow( \d+)?$/.test(workflowName);
32
- if (isDefaultName && nodesLength === 0 && messages.length === 1) {
33
- return 'create_workflow_name';
34
- }
35
- const estimatedTokens = (0, token_usage_1.estimateTokenCountFromMessages)(messages);
36
- if (estimatedTokens > autoCompactThresholdTokens) {
37
- return 'auto_compact_messages';
38
- }
39
- return 'continue';
40
- }
41
- function handleCleanupDangling(messages, logger) {
42
- const messagesToRemove = (0, cleanup_dangling_tool_call_messages_1.cleanupDanglingToolCallMessages)(messages);
43
- if (messagesToRemove.length > 0) {
44
- logger?.warn('Cleaning up dangling tool call messages', {
45
- count: messagesToRemove.length,
46
- });
47
- }
48
- return { messages: messagesToRemove };
49
- }
50
- async function handleCompactMessages(messages, previousSummary, llm, isAutoCompact) {
51
- const lastHumanMessage = messages.findLast((m) => m instanceof messages_1.HumanMessage);
52
- if (!lastHumanMessage) {
53
- throw new Error('Cannot compact messages: no HumanMessage found');
54
- }
55
- const compactedMessages = await (0, conversation_compact_1.conversationCompactChain)(llm, messages, previousSummary);
56
- const newMessages = [
57
- ...messages.map((m) => new messages_1.RemoveMessage({ id: m.id })),
58
- ...(isAutoCompact ? [new messages_1.HumanMessage({ content: lastHumanMessage.content })] : []),
59
- ];
60
- return {
61
- previousSummary: compactedMessages.summaryPlain,
62
- messages: newMessages,
63
- coordinationLog: [
64
- {
65
- phase: 'state_management',
66
- status: 'completed',
67
- timestamp: Date.now(),
68
- summary: isAutoCompact
69
- ? 'Auto-compacted conversation due to token limit'
70
- : 'Manually compacted conversation history',
71
- metadata: (0, coordination_1.createStateManagementMetadata)({
72
- action: 'compact',
73
- messagesRemoved: messages.length,
74
- }),
75
- },
76
- ],
77
- };
78
- }
79
- function handleDeleteMessages(messages) {
80
- return {
81
- messages: messages.map((m) => new messages_1.RemoveMessage({ id: m.id })),
82
- workflowJSON: { nodes: [], connections: {}, name: '' },
83
- previousSummary: '',
84
- discoveryContext: null,
85
- coordinationLog: [
86
- {
87
- phase: 'state_management',
88
- status: 'completed',
89
- timestamp: Date.now(),
90
- summary: 'Cleared session and reset workflow',
91
- metadata: (0, coordination_1.createStateManagementMetadata)({ action: 'clear' }),
92
- },
93
- ],
94
- workflowOperations: [],
95
- };
96
- }
97
- async function handleCreateWorkflowName(messages, workflowJSON, llm, logger) {
98
- if (messages.length === 1 && messages[0] instanceof messages_1.HumanMessage) {
99
- const initialMessage = messages[0];
100
- if (typeof initialMessage.content !== 'string') {
101
- logger?.debug('Initial message content is not a string, skipping workflow name generation');
102
- return { workflowJSON };
103
- }
104
- logger?.debug('Generating workflow name');
105
- const { name } = await (0, workflow_name_1.workflowNameChain)(llm, initialMessage.content);
106
- return {
107
- workflowJSON: { ...workflowJSON, name },
108
- };
109
- }
110
- return { workflowJSON };
111
- }
112
- //# sourceMappingURL=state-modifier.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state-modifier.js","sourceRoot":"","sources":["../../src/utils/state-modifier.ts"],"names":[],"mappings":";;AA+BA,oDAwCC;AAMD,sDAWC;AASD,sDA0CC;AAKD,oDAwBC;AAKD,4DAqBC;AAhMD,uDAAuE;AAGvE,+FAAwF;AACxF,+CAA+D;AAC/D,yEAA0E;AAC1E,2DAA4D;AAE5D,wDAAsE;AAqBtE,SAAgB,oBAAoB,CACnC,KAAyB,EACzB,0BAAkC;IAElC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAGzC,MAAM,gBAAgB,GAAG,IAAA,qEAA+B,EAAC,QAAQ,CAAC,CAAC;IACnE,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IAED,MAAM,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,YAAY,uBAAY,CAAC,CAAC;IAC7E,IAAI,CAAC,gBAAgB;QAAE,OAAO,UAAU,CAAC;IAGzC,IAAI,gBAAgB,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;QAC7C,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IAGD,IAAI,gBAAgB,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC3C,OAAO,iBAAiB,CAAC;IAC1B,CAAC;IAGD,MAAM,YAAY,GAAG,YAAY,EAAE,IAAI,CAAC;IACxC,MAAM,WAAW,GAAG,YAAY,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC,CAAC;IACrD,MAAM,aAAa,GAAG,CAAC,YAAY,IAAI,sBAAsB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACjF,IAAI,aAAa,IAAI,WAAW,KAAK,CAAC,IAAI,QAAQ,CA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AEf,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,YAAY,uBAAY,EAAE,CAAC;QAClE,MAAM,cAAc,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QACnC,IAAI,OAAO,cAAc,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YAChD,MAAM,EAAE,KAAK,CAAC,4EAA4E,CAAC,CAAC;YAC5F,OAAO,EAAE,YAAY,EAAE,CAAC;QACzB,CAAC;QAED,MAAM,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAC1C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,iCAAiB,EAAC,GAAG,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;QAEtE,OAAO;YACN,YAAY,EAAE,EAAE,GAAG,YAAY,EAAE,IAAI,EAAE;SACvC,CAAC;IACH,CAAC;IACD,OAAO,EAAE,YAAY,EAAE,CAAC;AACzB,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { NodeConfigurationsMap } from '../types/tools';
2
- export declare function appendArrayReducer<T>(current: T[], update: T[] | undefined | null): T[];
3
- export declare function mergeNodeConfigurations(target: NodeConfigurationsMap, source: NodeConfigurationsMap): void;
4
- export declare function nodeConfigurationsReducer(current: NodeConfigurationsMap, update: NodeConfigurationsMap | undefined | null): NodeConfigurationsMap;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.appendArrayReducer = appendArrayReducer;
4
- exports.mergeNodeConfigurations = mergeNodeConfigurations;
5
- exports.nodeConfigurationsReducer = nodeConfigurationsReducer;
6
- function appendArrayReducer(current, update) {
7
- return update && update.length > 0 ? [...current, ...update] : current;
8
- }
9
- function mergeNodeConfigurations(target, source) {
10
- for (const [nodeType, configs] of Object.entries(source)) {
11
- if (!target[nodeType]) {
12
- target[nodeType] = [];
13
- }
14
- target[nodeType].push(...configs);
15
- }
16
- }
17
- function nodeConfigurationsReducer(current, update) {
18
- if (!update || Object.keys(update).length === 0) {
19
- return current;
20
- }
21
- const merged = { ...current };
22
- mergeNodeConfigurations(merged, update);
23
- return merged;
24
- }
25
- //# sourceMappingURL=state-reducers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state-reducers.js","sourceRoot":"","sources":["../../src/utils/state-reducers.ts"],"names":[],"mappings":";;AAMA,gDAEC;AAMD,0DAUC;AAMD,8DAUC;AAlCD,SAAgB,kBAAkB,CAAI,OAAY,EAAE,MAA8B;IACjF,OAAO,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACxE,CAAC;AAMD,SAAgB,uBAAuB,CACtC,MAA6B,EAC7B,MAA6B;IAE7B,KAAK,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACvB,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;QACvB,CAAC;QACD,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC;IACnC,CAAC;AACF,CAAC;AAMD,SAAgB,yBAAyB,CACxC,OAA8B,EAC9B,MAAgD;IAEhD,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjD,OAAO,OAAO,CAAC;IAChB,CAAC;IACD,MAAM,MAAM,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;IAC9B,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC;AACf,CAAC"}
@@ -1,8 +0,0 @@
1
- import type { INodeTypeDescription } from 'n8n-workflow';
2
- import type { SimpleWorkflow } from '../../types';
3
- export declare function createNodeTypeMap(nodeTypes: INodeTypeDescription[]): Map<string, INodeTypeDescription>;
4
- export declare function getNodeTypeForNode(node: SimpleWorkflow['nodes'][number], nodeTypeMap: Map<string, INodeTypeDescription>, nodeTypesByName: Map<string, INodeTypeDescription>): INodeTypeDescription | undefined;
5
- export declare function createNodeTypeMaps(nodeTypes: INodeTypeDescription[]): {
6
- nodeTypeMap: Map<string, INodeTypeDescription>;
7
- nodeTypesByName: Map<string, INodeTypeDescription>;
8
- };
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createNodeTypeMap = createNodeTypeMap;
4
- exports.getNodeTypeForNode = getNodeTypeForNode;
5
- exports.createNodeTypeMaps = createNodeTypeMaps;
6
- function getNodeTypeVersions(nodeType) {
7
- const version = nodeType.version;
8
- if (typeof version === 'number') {
9
- return [version];
10
- }
11
- if (Array.isArray(version) && version.length > 0 && typeof version[0] === 'number') {
12
- return version;
13
- }
14
- return [1];
15
- }
16
- function getDefaultVersion(nodeType) {
17
- const defaultVersion = nodeType.defaultVersion;
18
- if (typeof defaultVersion === 'number') {
19
- return defaultVersion;
20
- }
21
- const versions = getNodeTypeVersions(nodeType);
22
- return Math.max(...versions);
23
- }
24
- function createNodeTypeMap(nodeTypes) {
25
- return new Map(nodeTypes.flatMap((nodeType) => {
26
- const versions = getNodeTypeVersions(nodeType);
27
- return versions.map((version) => [`${nodeType.name}-${version}`, nodeType]);
28
- }));
29
- }
30
- function resolveNodeVersion(node, nodeTypesByName) {
31
- if (node.typeVersion !== undefined) {
32
- return node.typeVersion;
33
- }
34
- const nodeType = nodeTypesByName.get(node.type);
35
- if (nodeType) {
36
- return getDefaultVersion(nodeType);
37
- }
38
- return 1;
39
- }
40
- function getNodeTypeForNode(node, nodeTypeMap, nodeTypesByName) {
41
- const version = resolveNodeVersion(node, nodeTypesByName);
42
- return nodeTypeMap.get(`${node.type}-${version}`);
43
- }
44
- function createNodeTypeMaps(nodeTypes) {
45
- const nodeTypesArray = Array.from(nodeTypes);
46
- const nodeTypeMap = createNodeTypeMap(nodeTypesArray);
47
- const nodeTypesByName = new Map(nodeTypesArray.map((type) => [type.name, type]));
48
- return { nodeTypeMap, nodeTypesByName };
49
- }
50
- //# sourceMappingURL=node-type-map.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node-type-map.js","sourceRoot":"","sources":["../../../src/validation/utils/node-type-map.ts"],"names":[],"mappings":";;AA+CA,8CASC;AA4BD,gDAOC;AAQD,gDAYC;AArGD,SAAS,mBAAmB,CAAC,QAA8B;IAC1D,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;IAEjC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,CAAC,OAAO,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;QACpF,OAAO,OAAO,CAAC;IAChB,CAAC;IAGD,OAAO,CAAC,CAAC,CAAC,CAAC;AACZ,CAAC;AAOD,SAAS,iBAAiB,CAAC,QAA8B;IACxD,MAAM,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;IAE/C,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,cAAc,CAAC;IACvB,CAAC;IAED,MAAM,QAAQ,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC/C,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAQD,SAAgB,iBAAiB,CAChC,SAAiC;IAEjC,OAAO,IAAI,GAAG,CACb,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9B,MAAM,QAAQ,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CA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