@n8n/n8n-nodes-langchain 2.0.1 → 2.1.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 (69) hide show
  1. package/dist/credentials/McpOAuth2Api.credentials.js +1 -2
  2. package/dist/credentials/McpOAuth2Api.credentials.js.map +1 -1
  3. package/dist/nodes/agents/Agent/Agent.node.js +4 -2
  4. package/dist/nodes/agents/Agent/Agent.node.js.map +1 -1
  5. package/dist/nodes/agents/Agent/AgentTool.node.js +4 -2
  6. package/dist/nodes/agents/Agent/AgentTool.node.js.map +1 -1
  7. package/dist/nodes/agents/Agent/V1/AgentV1.node.js +1 -1
  8. package/dist/nodes/agents/Agent/V1/AgentV1.node.js.map +1 -1
  9. package/dist/nodes/agents/Agent/V2/AgentV2.node.js +1 -1
  10. package/dist/nodes/agents/Agent/V2/AgentV2.node.js.map +1 -1
  11. package/dist/nodes/agents/Agent/V3/AgentToolV3.node.js +99 -0
  12. package/dist/nodes/agents/Agent/V3/AgentToolV3.node.js.map +1 -0
  13. package/dist/nodes/agents/Agent/V3/AgentV3.node.js +9 -2
  14. package/dist/nodes/agents/Agent/V3/AgentV3.node.js.map +1 -1
  15. package/dist/nodes/agents/Agent/agents/SqlAgent/description.js +1 -1
  16. package/dist/nodes/agents/Agent/agents/SqlAgent/description.js.map +1 -1
  17. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/execute.js +1 -3
  18. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/execute.js.map +1 -1
  19. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/executeBatch.js +4 -0
  20. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/executeBatch.js.map +1 -1
  21. package/dist/nodes/chains/ChainLLM/ChainLlm.node.js +1 -1
  22. package/dist/nodes/chains/ChainLLM/ChainLlm.node.js.map +1 -1
  23. package/dist/nodes/chains/ChainLLM/methods/config.js +10 -2
  24. package/dist/nodes/chains/ChainLLM/methods/config.js.map +1 -1
  25. package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js +11 -3
  26. package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js.map +1 -1
  27. package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js +9 -3
  28. package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js.map +1 -1
  29. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js +3 -0
  30. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js.map +1 -1
  31. package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js +66 -15
  32. package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js.map +1 -1
  33. package/dist/nodes/trigger/ChatTrigger/templates.js +1 -2
  34. package/dist/nodes/trigger/ChatTrigger/templates.js.map +1 -1
  35. package/dist/nodes/vendors/GoogleGemini/actions/file/index.js +2 -2
  36. package/dist/nodes/vendors/GoogleGemini/actions/file/index.js.map +1 -1
  37. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/createStore.operation.js +64 -0
  38. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/createStore.operation.js.map +1 -0
  39. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/deleteStore.operation.js +72 -0
  40. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/deleteStore.operation.js.map +1 -0
  41. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/index.js +94 -0
  42. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/index.js.map +1 -0
  43. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/listStores.operation.js +75 -0
  44. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/listStores.operation.js.map +1 -0
  45. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/uploadToStore.operation.js +129 -0
  46. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/uploadToStore.operation.js.map +1 -0
  47. package/dist/nodes/vendors/GoogleGemini/actions/node.type.js.map +1 -1
  48. package/dist/nodes/vendors/GoogleGemini/actions/router.js +4 -0
  49. package/dist/nodes/vendors/GoogleGemini/actions/router.js.map +1 -1
  50. package/dist/nodes/vendors/GoogleGemini/actions/text/message.operation.js +184 -11
  51. package/dist/nodes/vendors/GoogleGemini/actions/text/message.operation.js.map +1 -1
  52. package/dist/nodes/vendors/GoogleGemini/actions/versionDescription.js +10 -3
  53. package/dist/nodes/vendors/GoogleGemini/actions/versionDescription.js.map +1 -1
  54. package/dist/nodes/vendors/GoogleGemini/helpers/interfaces.js.map +1 -1
  55. package/dist/nodes/vendors/GoogleGemini/helpers/utils.js +131 -26
  56. package/dist/nodes/vendors/GoogleGemini/helpers/utils.js.map +1 -1
  57. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/message.operation.js +1 -1
  58. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/message.operation.js.map +1 -1
  59. package/dist/types/credentials.json +1 -1
  60. package/dist/types/nodes.json +9 -8
  61. package/dist/utils/agent-execution/buildSteps.js +67 -8
  62. package/dist/utils/agent-execution/buildSteps.js.map +1 -1
  63. package/dist/utils/agent-execution/createEngineRequests.js +27 -5
  64. package/dist/utils/agent-execution/createEngineRequests.js.map +1 -1
  65. package/dist/utils/agent-execution/types.js +24 -0
  66. package/dist/utils/agent-execution/types.js.map +1 -1
  67. package/dist/utils/descriptions.js +21 -1
  68. package/dist/utils/descriptions.js.map +1 -1
  69. package/package.json +7 -7
@@ -23,6 +23,52 @@ __export(buildSteps_exports, {
23
23
  module.exports = __toCommonJS(buildSteps_exports);
24
24
  var import_messages = require("@langchain/core/messages");
25
25
  var import_n8n_workflow = require("n8n-workflow");
26
+ function extractProviderMetadata(metadata) {
27
+ if (!metadata) return {};
28
+ const thoughtSignature = typeof metadata.google?.thoughtSignature === "string" ? metadata.google.thoughtSignature : void 0;
29
+ const thinkingContent = typeof metadata.anthropic?.thinkingContent === "string" ? metadata.anthropic.thinkingContent : void 0;
30
+ const thinkingType = metadata.anthropic?.thinkingType === "thinking" || metadata.anthropic?.thinkingType === "redacted_thinking" ? metadata.anthropic.thinkingType : void 0;
31
+ const thinkingSignature = typeof metadata.anthropic?.thinkingSignature === "string" ? metadata.anthropic.thinkingSignature : void 0;
32
+ return {
33
+ thoughtSignature,
34
+ thinkingContent,
35
+ thinkingType,
36
+ thinkingSignature
37
+ };
38
+ }
39
+ function buildAnthropicContentBlocks(thinkingContent, thinkingType, thinkingSignature, toolInput, toolId, toolName) {
40
+ const thinkingBlock = thinkingType === "thinking" ? {
41
+ type: "thinking",
42
+ thinking: thinkingContent,
43
+ signature: thinkingSignature ?? ""
44
+ // Use original signature if available
45
+ } : {
46
+ type: "redacted_thinking",
47
+ data: thinkingContent
48
+ };
49
+ const toolInputData = toolInput.input;
50
+ const toolUseBlock = {
51
+ type: "tool_use",
52
+ id: toolId,
53
+ name: toolName,
54
+ input: toolInputData && typeof toolInputData === "object" ? toolInputData : {}
55
+ };
56
+ return [thinkingBlock, toolUseBlock];
57
+ }
58
+ function buildMessageContent(providerMetadata, toolInput, toolId, toolName, nodeName) {
59
+ const { thinkingContent, thinkingType, thinkingSignature } = providerMetadata;
60
+ if (thinkingContent && thinkingType) {
61
+ return buildAnthropicContentBlocks(
62
+ thinkingContent,
63
+ thinkingType,
64
+ thinkingSignature,
65
+ toolInput,
66
+ toolId,
67
+ toolName
68
+ );
69
+ }
70
+ return `Calling ${nodeName} with input: ${JSON.stringify(toolInput)}`;
71
+ }
26
72
  function buildSteps(response, itemIndex) {
27
73
  const steps = [];
28
74
  if (response) {
@@ -43,25 +89,38 @@ function buildSteps(response, itemIndex) {
43
89
  if (step) {
44
90
  continue;
45
91
  }
46
- const rawThoughtSignature = tool.action.metadata?.thoughtSignature;
47
- const thoughtSignature = typeof rawThoughtSignature === "string" ? rawThoughtSignature : void 0;
92
+ const providerMetadata = extractProviderMetadata(tool.action.metadata);
93
+ const toolId = typeof toolInput?.id === "string" ? toolInput.id : "reconstructed_call";
94
+ const toolName = (0, import_n8n_workflow.nodeNameToToolName)(tool.action.nodeName);
48
95
  const toolCall = {
49
- id: typeof toolInput?.id === "string" ? toolInput.id : "reconstructed_call",
50
- name: (0, import_n8n_workflow.nodeNameToToolName)(tool.action.nodeName),
96
+ id: toolId,
97
+ name: toolName,
51
98
  args: toolInput,
52
99
  type: "tool_call",
53
100
  additional_kwargs: {
54
- ...thoughtSignature && { thought_signature: thoughtSignature }
101
+ ...providerMetadata.thoughtSignature && {
102
+ thought_signature: providerMetadata.thoughtSignature
103
+ }
55
104
  }
56
105
  };
106
+ const messageContent = buildMessageContent(
107
+ providerMetadata,
108
+ toolInput,
109
+ toolId,
110
+ toolName,
111
+ tool.action.nodeName
112
+ );
57
113
  const syntheticAIMessage = new import_messages.AIMessage({
58
- content: `Calling ${tool.action.nodeName} with input: ${JSON.stringify(toolInput)}`,
59
- tool_calls: [toolCall]
114
+ content: messageContent,
115
+ // Note: tool_calls is only used when content is a string
116
+ // When content is an array (thinking mode), tool_use blocks are in the content array
117
+ ...typeof messageContent === "string" && { tool_calls: [toolCall] }
60
118
  });
119
+ const toolInputForResult = toolInput.input;
61
120
  const toolResult = {
62
121
  action: {
63
122
  tool: (0, import_n8n_workflow.nodeNameToToolName)(tool.action.nodeName),
64
- toolInput: toolInput.input || {},
123
+ toolInput: toolInputForResult && typeof toolInputForResult === "object" ? toolInputForResult : {},
65
124
  log: toolInput.log || syntheticAIMessage.content,
66
125
  messageLog: [syntheticAIMessage],
67
126
  toolCallId: toolInput?.id,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../utils/agent-execution/buildSteps.ts"],"sourcesContent":["import { AIMessage } from '@langchain/core/messages';\nimport { nodeNameToToolName } from 'n8n-workflow';\nimport type { EngineResponse, IDataObject } from 'n8n-workflow';\n\nimport type { RequestResponseMetadata, ToolCallData } from './types';\n\n/**\n * Rebuilds the agent steps from previous tool call responses.\n * This is used to continue agent execution after tool calls have been made.\n *\n * This is a generalized version that can be used across different agent types\n * (Tools Agent, OpenAI Functions Agent, etc.).\n *\n * @param response - The engine response containing tool call results\n * @param itemIndex - The current item index being processed\n * @returns Array of tool call data representing the agent steps\n */\nexport function buildSteps(\n\tresponse: EngineResponse<RequestResponseMetadata> | undefined,\n\titemIndex: number,\n): ToolCallData[] {\n\tconst steps: ToolCallData[] = [];\n\n\tif (response) {\n\t\tconst responses = response?.actionResponses ?? [];\n\n\t\tif (response.metadata?.previousRequests) {\n\t\t\tsteps.push.apply(steps, response.metadata.previousRequests);\n\t\t}\n\n\t\tfor (const tool of responses) {\n\t\t\tif (tool.action?.metadata?.itemIndex !== itemIndex) continue;\n\n\t\t\tconst toolInput: IDataObject = {\n\t\t\t\t...tool.action.input,\n\t\t\t\tid: tool.action.id,\n\t\t\t};\n\t\t\tif (!toolInput || !tool.data) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst step = steps.find((step) => step.action.toolCallId === toolInput.id);\n\t\t\tif (step) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Create a synthetic AI message for the messageLog\n\t\t\t// This represents the AI's decision to call the tool\n\t\t\t// Extract thought_signature from metadata if present (for Gemini 3)\n\t\t\tconst rawThoughtSignature = tool.action.metadata?.thoughtSignature;\n\t\t\tconst thoughtSignature =\n\t\t\t\ttypeof rawThoughtSignature === 'string' ? rawThoughtSignature : undefined;\n\n\t\t\t// Build the tool call object with thought_signature if present\n\t\t\t// The thought_signature must be part of the tool call itself for Gemini 3\n\t\t\tconst toolCall = {\n\t\t\t\tid: typeof toolInput?.id === 'string' ? toolInput.id : 'reconstructed_call',\n\t\t\t\tname: nodeNameToToolName(tool.action.nodeName),\n\t\t\t\targs: toolInput,\n\t\t\t\ttype: 'tool_call' as const,\n\t\t\t\tadditional_kwargs: {\n\t\t\t\t\t...(thoughtSignature && { thought_signature: thoughtSignature }),\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tconst syntheticAIMessage = new AIMessage({\n\t\t\t\tcontent: `Calling ${tool.action.nodeName} with input: ${JSON.stringify(toolInput)}`,\n\t\t\t\ttool_calls: [toolCall],\n\t\t\t});\n\n\t\t\tconst toolResult = {\n\t\t\t\taction: {\n\t\t\t\t\ttool: nodeNameToToolName(tool.action.nodeName),\n\t\t\t\t\ttoolInput: (toolInput.input as IDataObject) || {},\n\t\t\t\t\tlog: toolInput.log || syntheticAIMessage.content,\n\t\t\t\t\tmessageLog: [syntheticAIMessage],\n\t\t\t\t\ttoolCallId: toolInput?.id,\n\t\t\t\t\ttype: toolInput.type || 'tool_call',\n\t\t\t\t},\n\t\t\t\tobservation: JSON.stringify(tool.data?.data?.ai_tool?.[0]?.map((item) => item?.json) ?? ''),\n\t\t\t};\n\n\t\t\tsteps.push(toolResult);\n\t\t}\n\t}\n\treturn steps;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA0B;AAC1B,0BAAmC;AAgB5B,SAAS,WACf,UACA,WACiB;AACjB,QAAM,QAAwB,CAAC;AAE/B,MAAI,UAAU;AACb,UAAM,YAAY,UAAU,mBAAmB,CAAC;AAEhD,QAAI,SAAS,UAAU,kBAAkB;AACxC,YAAM,KAAK,MAAM,OAAO,SAAS,SAAS,gBAAgB;AAAA,IAC3D;AAEA,eAAW,QAAQ,WAAW;AAC7B,UAAI,KAAK,QAAQ,UAAU,cAAc,UAAW;AAEpD,YAAM,YAAyB;AAAA,QAC9B,GAAG,KAAK,OAAO;AAAA,QACf,IAAI,KAAK,OAAO;AAAA,MACjB;AACA,UAAI,CAAC,aAAa,CAAC,KAAK,MAAM;AAC7B;AAAA,MACD;AAEA,YAAM,OAAO,MAAM,KAAK,CAACA,UAASA,MAAK,OAAO,eAAe,UAAU,EAAE;AACzE,UAAI,MAAM;AACT;AAAA,MACD;AAIA,YAAM,sBAAsB,KAAK,OAAO,UAAU;AAClD,YAAM,mBACL,OAAO,wBAAwB,WAAW,sBAAsB;AAIjE,YAAM,WAAW;AAAA,QAChB,IAAI,OAAO,WAAW,OAAO,WAAW,UAAU,KAAK;AAAA,QACvD,UAAM,wCAAmB,KAAK,OAAO,QAAQ;AAAA,QAC7C,MAAM;AAAA,QACN,MAAM;AAAA,QACN,mBAAmB;AAAA,UAClB,GAAI,oBAAoB,EAAE,mBAAmB,iBAAiB;AAAA,QAC/D;AAAA,MACD;AAEA,YAAM,qBAAqB,IAAI,0BAAU;AAAA,QACxC,SAAS,WAAW,KAAK,OAAO,QAAQ,gBAAgB,KAAK,UAAU,SAAS,CAAC;AAAA,QACjF,YAAY,CAAC,QAAQ;AAAA,MACtB,CAAC;AAED,YAAM,aAAa;AAAA,QAClB,QAAQ;AAAA,UACP,UAAM,wCAAmB,KAAK,OAAO,QAAQ;AAAA,UAC7C,WAAY,UAAU,SAAyB,CAAC;AAAA,UAChD,KAAK,UAAU,OAAO,mBAAmB;AAAA,UACzC,YAAY,CAAC,kBAAkB;AAAA,UAC/B,YAAY,WAAW;AAAA,UACvB,MAAM,UAAU,QAAQ;AAAA,QACzB;AAAA,QACA,aAAa,KAAK,UAAU,KAAK,MAAM,MAAM,UAAU,CAAC,GAAG,IAAI,CAAC,SAAS,MAAM,IAAI,KAAK,EAAE;AAAA,MAC3F;AAEA,YAAM,KAAK,UAAU;AAAA,IACtB;AAAA,EACD;AACA,SAAO;AACR;","names":["step"]}
1
+ {"version":3,"sources":["../../../utils/agent-execution/buildSteps.ts"],"sourcesContent":["import { AIMessage } from '@langchain/core/messages';\nimport { nodeNameToToolName } from 'n8n-workflow';\nimport type { EngineResponse, IDataObject } from 'n8n-workflow';\n\nimport type {\n\tRequestResponseMetadata,\n\tToolCallData,\n\tThinkingContentBlock,\n\tRedactedThinkingContentBlock,\n\tToolUseContentBlock,\n} from './types';\n\n/**\n * Provider-specific metadata extracted from tool action metadata\n */\ninterface ProviderMetadata {\n\t/** Gemini thought_signature for extended thinking */\n\tthoughtSignature?: string;\n\t/** Anthropic thinking content */\n\tthinkingContent?: string;\n\t/** Anthropic thinking type (thinking or redacted_thinking) */\n\tthinkingType?: 'thinking' | 'redacted_thinking';\n\t/** Anthropic thinking signature */\n\tthinkingSignature?: string;\n}\n\n/**\n * Extracts provider-specific metadata from tool action metadata.\n * Validates and normalizes metadata from different LLM providers.\n *\n * @param metadata - The request/response metadata from tool action\n * @returns Extracted and validated provider metadata\n */\nfunction extractProviderMetadata(metadata?: RequestResponseMetadata): ProviderMetadata {\n\tif (!metadata) return {};\n\n\t// Extract Google/Gemini metadata\n\tconst thoughtSignature =\n\t\ttypeof metadata.google?.thoughtSignature === 'string'\n\t\t\t? metadata.google.thoughtSignature\n\t\t\t: undefined;\n\n\t// Extract Anthropic metadata\n\tconst thinkingContent =\n\t\ttypeof metadata.anthropic?.thinkingContent === 'string'\n\t\t\t? metadata.anthropic.thinkingContent\n\t\t\t: undefined;\n\n\tconst thinkingType =\n\t\tmetadata.anthropic?.thinkingType === 'thinking' ||\n\t\tmetadata.anthropic?.thinkingType === 'redacted_thinking'\n\t\t\t? metadata.anthropic.thinkingType\n\t\t\t: undefined;\n\n\tconst thinkingSignature =\n\t\ttypeof metadata.anthropic?.thinkingSignature === 'string'\n\t\t\t? metadata.anthropic.thinkingSignature\n\t\t\t: undefined;\n\n\treturn {\n\t\tthoughtSignature,\n\t\tthinkingContent,\n\t\tthinkingType,\n\t\tthinkingSignature,\n\t};\n}\n\n/**\n * Builds Anthropic-specific content blocks for thinking mode.\n * Creates an array with thinking block followed by tool_use block.\n *\n * IMPORTANT: The thinking block must come before tool_use in the message.\n * When content is an array, LangChain ignores tool_calls field for Anthropic,\n * so tool_use blocks must be in the content array.\n *\n * @param thinkingContent - The thinking content from Anthropic\n * @param thinkingType - Type of thinking block (thinking or redacted_thinking)\n * @param thinkingSignature - Optional signature for thinking block\n * @param toolInput - The tool input data\n * @param toolId - The tool call ID\n * @param toolName - The tool name\n * @returns Array of content blocks with thinking and tool_use\n */\nfunction buildAnthropicContentBlocks(\n\tthinkingContent: string,\n\tthinkingType: 'thinking' | 'redacted_thinking',\n\tthinkingSignature: string | undefined,\n\ttoolInput: IDataObject,\n\ttoolId: string,\n\ttoolName: string,\n): Array<ThinkingContentBlock | RedactedThinkingContentBlock | ToolUseContentBlock> {\n\t// Create thinking block with correct field names for Anthropic API\n\tconst thinkingBlock: ThinkingContentBlock | RedactedThinkingContentBlock =\n\t\tthinkingType === 'thinking'\n\t\t\t? {\n\t\t\t\t\ttype: 'thinking',\n\t\t\t\t\tthinking: thinkingContent,\n\t\t\t\t\tsignature: thinkingSignature ?? '', // Use original signature if available\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\ttype: 'redacted_thinking',\n\t\t\t\t\tdata: thinkingContent,\n\t\t\t\t};\n\n\t// Create tool_use block (required for Anthropic when using structured content)\n\tconst toolInputData = toolInput.input;\n\tconst toolUseBlock: ToolUseContentBlock = {\n\t\ttype: 'tool_use',\n\t\tid: toolId,\n\t\tname: toolName,\n\t\tinput:\n\t\t\ttoolInputData && typeof toolInputData === 'object'\n\t\t\t\t? (toolInputData as Record<string, unknown>)\n\t\t\t\t: {},\n\t};\n\n\treturn [thinkingBlock, toolUseBlock];\n}\n\n/**\n * Builds message content for AI message, handling provider-specific formats.\n * For Anthropic thinking mode, creates content blocks with thinking and tool_use.\n * For other providers, creates simple string content.\n *\n * @param providerMetadata - Provider-specific metadata\n * @param toolInput - The tool input data\n * @param toolId - The tool call ID\n * @param toolName - The tool name\n * @param nodeName - The node name for fallback string content\n * @returns Message content (string or content blocks array)\n */\nfunction buildMessageContent(\n\tproviderMetadata: ProviderMetadata,\n\ttoolInput: IDataObject,\n\ttoolId: string,\n\ttoolName: string,\n\tnodeName: string,\n): string | Array<ThinkingContentBlock | RedactedThinkingContentBlock | ToolUseContentBlock> {\n\tconst { thinkingContent, thinkingType, thinkingSignature } = providerMetadata;\n\n\t// Anthropic thinking mode: build content blocks\n\tif (thinkingContent && thinkingType) {\n\t\treturn buildAnthropicContentBlocks(\n\t\t\tthinkingContent,\n\t\t\tthinkingType,\n\t\t\tthinkingSignature,\n\t\t\ttoolInput,\n\t\t\ttoolId,\n\t\t\ttoolName,\n\t\t);\n\t}\n\n\t// Default: simple string content\n\treturn `Calling ${nodeName} with input: ${JSON.stringify(toolInput)}`;\n}\n\n/**\n * Rebuilds the agent steps from previous tool call responses.\n * This is used to continue agent execution after tool calls have been made.\n *\n * This is a generalized version that can be used across different agent types\n * (Tools Agent, OpenAI Functions Agent, etc.).\n *\n * @param response - The engine response containing tool call results\n * @param itemIndex - The current item index being processed\n * @returns Array of tool call data representing the agent steps\n */\nexport function buildSteps(\n\tresponse: EngineResponse<RequestResponseMetadata> | undefined,\n\titemIndex: number,\n): ToolCallData[] {\n\tconst steps: ToolCallData[] = [];\n\n\tif (response) {\n\t\tconst responses = response?.actionResponses ?? [];\n\n\t\tif (response.metadata?.previousRequests) {\n\t\t\tsteps.push.apply(steps, response.metadata.previousRequests);\n\t\t}\n\n\t\tfor (const tool of responses) {\n\t\t\tif (tool.action?.metadata?.itemIndex !== itemIndex) continue;\n\n\t\t\tconst toolInput: IDataObject = {\n\t\t\t\t...tool.action.input,\n\t\t\t\tid: tool.action.id,\n\t\t\t};\n\t\t\tif (!toolInput || !tool.data) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst step = steps.find((step) => step.action.toolCallId === toolInput.id);\n\t\t\tif (step) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Extract provider-specific metadata (Gemini, Anthropic, etc.)\n\t\t\tconst providerMetadata = extractProviderMetadata(tool.action.metadata);\n\n\t\t\t// Build tool ID and name for reuse\n\t\t\tconst toolId = typeof toolInput?.id === 'string' ? toolInput.id : 'reconstructed_call';\n\t\t\tconst toolName = nodeNameToToolName(tool.action.nodeName);\n\n\t\t\t// Build the tool call object with thought_signature if present (for Gemini)\n\t\t\tconst toolCall = {\n\t\t\t\tid: toolId,\n\t\t\t\tname: toolName,\n\t\t\t\targs: toolInput,\n\t\t\t\ttype: 'tool_call' as const,\n\t\t\t\tadditional_kwargs: {\n\t\t\t\t\t...(providerMetadata.thoughtSignature && {\n\t\t\t\t\t\tthought_signature: providerMetadata.thoughtSignature,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t};\n\n\t\t\t// Build message content using provider-specific logic\n\t\t\tconst messageContent = buildMessageContent(\n\t\t\t\tproviderMetadata,\n\t\t\t\ttoolInput,\n\t\t\t\ttoolId,\n\t\t\t\ttoolName,\n\t\t\t\ttool.action.nodeName,\n\t\t\t);\n\n\t\t\tconst syntheticAIMessage = new AIMessage({\n\t\t\t\tcontent: messageContent,\n\t\t\t\t// Note: tool_calls is only used when content is a string\n\t\t\t\t// When content is an array (thinking mode), tool_use blocks are in the content array\n\t\t\t\t...(typeof messageContent === 'string' && { tool_calls: [toolCall] }),\n\t\t\t});\n\n\t\t\tconst toolInputForResult = toolInput.input;\n\t\t\tconst toolResult = {\n\t\t\t\taction: {\n\t\t\t\t\ttool: nodeNameToToolName(tool.action.nodeName),\n\t\t\t\t\ttoolInput:\n\t\t\t\t\t\ttoolInputForResult && typeof toolInputForResult === 'object'\n\t\t\t\t\t\t\t? (toolInputForResult as IDataObject)\n\t\t\t\t\t\t\t: {},\n\t\t\t\t\tlog: toolInput.log || syntheticAIMessage.content,\n\t\t\t\t\tmessageLog: [syntheticAIMessage],\n\t\t\t\t\ttoolCallId: toolInput?.id,\n\t\t\t\t\ttype: toolInput.type || 'tool_call',\n\t\t\t\t},\n\t\t\t\tobservation: JSON.stringify(tool.data?.data?.ai_tool?.[0]?.map((item) => item?.json) ?? ''),\n\t\t\t};\n\n\t\t\tsteps.push(toolResult);\n\t\t}\n\t}\n\treturn steps;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA0B;AAC1B,0BAAmC;AAgCnC,SAAS,wBAAwB,UAAsD;AACtF,MAAI,CAAC,SAAU,QAAO,CAAC;AAGvB,QAAM,mBACL,OAAO,SAAS,QAAQ,qBAAqB,WAC1C,SAAS,OAAO,mBAChB;AAGJ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UAAU,KAAK,MAAM,MAAM,UAAU,CAAC,GAAG,IAAI,CAAC,SAAS,MAAM,IAAI,KAAK,EAAE;AAAA,MAC3F;AAEA,YAAM,KAAK,UAAU;AAAA,IACtB;AAAA,EACD;AACA,SAAO;AACR;","names":["step"]}
@@ -22,27 +22,38 @@ __export(createEngineRequests_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(createEngineRequests_exports);
24
24
  var import_n8n_workflow = require("n8n-workflow");
25
+ var import_types = require("./types");
25
26
  async function createEngineRequests(toolCalls, itemIndex, tools) {
26
27
  return toolCalls.map((toolCall) => {
27
28
  const foundTool = tools.find((tool) => tool.name === toolCall.tool);
28
29
  if (!foundTool) return void 0;
29
30
  const nodeName = foundTool.metadata?.sourceNodeName;
30
- if (!nodeName) return void 0;
31
+ if (typeof nodeName !== "string") return void 0;
31
32
  const input = foundTool.metadata?.isFromToolkit ? { ...toolCall.toolInput, tool: toolCall.tool } : toolCall.toolInput;
32
33
  let thoughtSignature;
34
+ let thinkingContent;
35
+ let thinkingType;
36
+ let thinkingSignature;
33
37
  if (toolCall.messageLog && Array.isArray(toolCall.messageLog)) {
34
38
  for (const message of toolCall.messageLog) {
35
39
  if (message && typeof message === "object" && "content" in message) {
36
40
  const content = message.content;
37
41
  if (Array.isArray(content)) {
38
42
  for (const block of content) {
39
- if (block && typeof block === "object" && "thoughtSignature" in block) {
43
+ if ((0, import_types.isGeminiThoughtSignatureBlock)(block)) {
40
44
  thoughtSignature = block.thoughtSignature;
41
- break;
45
+ }
46
+ if ((0, import_types.isThinkingBlock)(block)) {
47
+ thinkingContent = block.thinking;
48
+ thinkingType = "thinking";
49
+ thinkingSignature = block.signature;
50
+ } else if ((0, import_types.isRedactedThinkingBlock)(block)) {
51
+ thinkingContent = block.data;
52
+ thinkingType = "redacted_thinking";
42
53
  }
43
54
  }
44
55
  }
45
- if (thoughtSignature) break;
56
+ if (thoughtSignature || thinkingContent) break;
46
57
  }
47
58
  }
48
59
  }
@@ -54,7 +65,18 @@ async function createEngineRequests(toolCalls, itemIndex, tools) {
54
65
  id: toolCall.toolCallId,
55
66
  metadata: {
56
67
  itemIndex,
57
- ...thoughtSignature && { thoughtSignature }
68
+ ...thoughtSignature && {
69
+ google: {
70
+ thoughtSignature
71
+ }
72
+ },
73
+ ...thinkingContent && {
74
+ anthropic: {
75
+ thinkingContent,
76
+ thinkingType,
77
+ thinkingSignature
78
+ }
79
+ }
58
80
  }
59
81
  };
60
82
  }).filter((item) => item !== void 0);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../utils/agent-execution/createEngineRequests.ts"],"sourcesContent":["import type { DynamicStructuredTool, Tool } from '@langchain/classic/tools';\nimport { NodeConnectionTypes } from 'n8n-workflow';\nimport type { EngineRequest, IDataObject } from 'n8n-workflow';\n\nimport type { RequestResponseMetadata, ToolCallRequest } from './types';\n\n/**\n * Creates engine requests from tool calls.\n * Maps tool call information to the format expected by the n8n engine\n * for executing tool nodes.\n *\n * This is a generalized version that can be used across different agent types\n * (Tools Agent, OpenAI Functions Agent, etc.).\n *\n * @param toolCalls - Array of tool call requests to convert\n * @param itemIndex - The current item index\n * @param tools - Array of available tools\n * @returns Array of engine request objects (filtered to remove undefined entries)\n */\nexport async function createEngineRequests(\n\ttoolCalls: ToolCallRequest[],\n\titemIndex: number,\n\ttools: Array<DynamicStructuredTool | Tool>,\n): Promise<EngineRequest<RequestResponseMetadata>['actions']> {\n\treturn toolCalls\n\t\t.map((toolCall) => {\n\t\t\t// First try to get from metadata (for toolkit tools)\n\t\t\tconst foundTool = tools.find((tool) => tool.name === toolCall.tool);\n\n\t\t\tif (!foundTool) return undefined;\n\n\t\t\tconst nodeName = foundTool.metadata?.sourceNodeName as string | undefined;\n\n\t\t\t// Ensure nodeName is defined\n\t\t\tif (!nodeName) return undefined;\n\n\t\t\t// For toolkit tools, include the tool name so the node knows which tool to execute\n\t\t\tconst input = foundTool.metadata?.isFromToolkit\n\t\t\t\t? { ...toolCall.toolInput, tool: toolCall.tool }\n\t\t\t\t: toolCall.toolInput;\n\n\t\t\t// Extract thought_signature from the AIMessage in messageLog (for Gemini 3)\n\t\t\tlet thoughtSignature: string | undefined;\n\t\t\tif (toolCall.messageLog && Array.isArray(toolCall.messageLog)) {\n\t\t\t\tfor (const message of toolCall.messageLog) {\n\t\t\t\t\t// Check if message has content that could contain thought_signature\n\t\t\t\t\tif (message && typeof message === 'object' && 'content' in message) {\n\t\t\t\t\t\tconst content = message.content;\n\t\t\t\t\t\t// Content can be string or array of content blocks\n\t\t\t\t\t\tif (Array.isArray(content)) {\n\t\t\t\t\t\t\t// Look for thought_signature in content blocks\n\t\t\t\t\t\t\tfor (const block of content) {\n\t\t\t\t\t\t\t\tif (block && typeof block === 'object' && 'thoughtSignature' in block) {\n\t\t\t\t\t\t\t\t\tthoughtSignature = block.thoughtSignature as string;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (thoughtSignature) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tactionType: 'ExecutionNodeAction' as const,\n\t\t\t\tnodeName,\n\t\t\t\tinput: input as IDataObject,\n\t\t\t\ttype: NodeConnectionTypes.AiTool,\n\t\t\t\tid: toolCall.toolCallId,\n\t\t\t\tmetadata: {\n\t\t\t\t\titemIndex,\n\t\t\t\t\t...(thoughtSignature && { thoughtSignature }),\n\t\t\t\t},\n\t\t\t};\n\t\t})\n\t\t.filter((item): item is NonNullable<typeof item> => item !== undefined);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAoC;AAkBpC,eAAsB,qBACrB,WACA,WACA,OAC6D;AAC7D,SAAO,UACL,IAAI,CAAC,aAAa;AAElB,UAAM,YAAY,MAAM,KAAK,CAAC,SAAS,KAAK,SAAS,SAAS,IAAI;AAElE,QAAI,CAAC,UAAW,QAAO;AAEvB,UAAM,WAAW,UAAU,UAAU;AAGrC,QAAI,CAAC,SAAU,QAAO;AAGtB,UAAM,QAAQ,UAAU,UAAU,gBAC/B,EAAE,GAAG,SAAS,WAAW,MAAM,SAAS,KAAK,IAC7C,SAAS;AAGZ,QAAI;AACJ,QAAI,SAAS,cAAc,MAAM,QAAQ,SAAS,UAAU,GAAG;AAC9D,iBAAW,WAAW,SAAS,YAAY;AAE1C,YAAI,WAAW,OAAO,YAAY,YAAY,aAAa,SAAS;AACnE,gBAAM,UAAU,QAAQ;AAExB,cAAI,MAAM,QAAQ,OAAO,GAAG;AAE3B,uBAAW,SAAS,SAAS;AAC5B,kBAAI,SAAS,OAAO,UAAU,YAAY,sBAAsB,OAAO;AACtE,mCAAmB,MAAM;AACzB;AAAA,cACD;AAAA,YACD;AAAA,UACD;AACA,cAAI,iBAAkB;AAAA,QACvB;AAAA,MACD;AAAA,IACD;AAEA,WAAO;AAAA,MACN,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,MACA,MAAM,wCAAoB;AAAA,MAC1B,IAAI,SAAS;AAAA,MACb,UAAU;AAAA,QACT;AAAA,QACA,GAAI,oBAAoB,EAAE,iBAAiB;AAAA,MAC5C;AAAA,IACD;AAAA,EACD,CAAC,EACA,OAAO,CAAC,SAA2C,SAAS,MAAS;AACxE;","names":[]}
1
+ {"version":3,"sources":["../../../utils/agent-execution/createEngineRequests.ts"],"sourcesContent":["import type { DynamicStructuredTool, Tool } from '@langchain/classic/tools';\nimport { NodeConnectionTypes } from 'n8n-workflow';\nimport type { EngineRequest, IDataObject } from 'n8n-workflow';\n\nimport { isThinkingBlock, isRedactedThinkingBlock, isGeminiThoughtSignatureBlock } from './types';\nimport type { RequestResponseMetadata, ToolCallRequest } from './types';\n\n/**\n * Creates engine requests from tool calls.\n * Maps tool call information to the format expected by the n8n engine\n * for executing tool nodes.\n *\n * This is a generalized version that can be used across different agent types\n * (Tools Agent, OpenAI Functions Agent, etc.).\n *\n * @param toolCalls - Array of tool call requests to convert\n * @param itemIndex - The current item index\n * @param tools - Array of available tools\n * @returns Array of engine request objects (filtered to remove undefined entries)\n */\nexport async function createEngineRequests(\n\ttoolCalls: ToolCallRequest[],\n\titemIndex: number,\n\ttools: Array<DynamicStructuredTool | Tool>,\n): Promise<EngineRequest<RequestResponseMetadata>['actions']> {\n\treturn toolCalls\n\t\t.map((toolCall) => {\n\t\t\t// First try to get from metadata (for toolkit tools)\n\t\t\tconst foundTool = tools.find((tool) => tool.name === toolCall.tool);\n\n\t\t\tif (!foundTool) return undefined;\n\n\t\t\tconst nodeName = foundTool.metadata?.sourceNodeName;\n\n\t\t\t// Ensure nodeName is defined and is a string\n\t\t\tif (typeof nodeName !== 'string') return undefined;\n\n\t\t\t// For toolkit tools, include the tool name so the node knows which tool to execute\n\t\t\tconst input: IDataObject = foundTool.metadata?.isFromToolkit\n\t\t\t\t? ({ ...toolCall.toolInput, tool: toolCall.tool } as IDataObject)\n\t\t\t\t: (toolCall.toolInput as IDataObject);\n\n\t\t\t// Extract thought_signature from the AIMessage in messageLog (for Gemini 3)\n\t\t\tlet thoughtSignature: string | undefined;\n\t\t\t// Extract thinking blocks from the AIMessage in messageLog (for Anthropic)\n\t\t\tlet thinkingContent: string | undefined;\n\t\t\tlet thinkingType: 'thinking' | 'redacted_thinking' | undefined;\n\t\t\tlet thinkingSignature: string | undefined;\n\n\t\t\tif (toolCall.messageLog && Array.isArray(toolCall.messageLog)) {\n\t\t\t\tfor (const message of toolCall.messageLog) {\n\t\t\t\t\t// Check if message has content that could contain thought_signature or thinking blocks\n\t\t\t\t\tif (message && typeof message === 'object' && 'content' in message) {\n\t\t\t\t\t\tconst content = message.content;\n\t\t\t\t\t\t// Content can be string or array of content blocks\n\t\t\t\t\t\tif (Array.isArray(content)) {\n\t\t\t\t\t\t\t// Look for thought_signature in content blocks (Gemini)\n\t\t\t\t\t\t\t// and thinking/redacted_thinking blocks (Anthropic)\n\t\t\t\t\t\t\tfor (const block of content) {\n\t\t\t\t\t\t\t\t// Gemini thought_signature\n\t\t\t\t\t\t\t\tif (isGeminiThoughtSignatureBlock(block)) {\n\t\t\t\t\t\t\t\t\tthoughtSignature = block.thoughtSignature;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Anthropic thinking blocks\n\t\t\t\t\t\t\t\tif (isThinkingBlock(block)) {\n\t\t\t\t\t\t\t\t\tthinkingContent = block.thinking;\n\t\t\t\t\t\t\t\t\tthinkingType = 'thinking';\n\t\t\t\t\t\t\t\t\tthinkingSignature = block.signature;\n\t\t\t\t\t\t\t\t} else if (isRedactedThinkingBlock(block)) {\n\t\t\t\t\t\t\t\t\tthinkingContent = block.data;\n\t\t\t\t\t\t\t\t\tthinkingType = 'redacted_thinking';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (thoughtSignature || thinkingContent) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tactionType: 'ExecutionNodeAction' as const,\n\t\t\t\tnodeName,\n\t\t\t\tinput,\n\t\t\t\ttype: NodeConnectionTypes.AiTool,\n\t\t\t\tid: toolCall.toolCallId,\n\t\t\t\tmetadata: {\n\t\t\t\t\titemIndex,\n\t\t\t\t\t...(thoughtSignature && {\n\t\t\t\t\t\tgoogle: {\n\t\t\t\t\t\t\tthoughtSignature,\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\t...(thinkingContent && {\n\t\t\t\t\t\tanthropic: {\n\t\t\t\t\t\t\tthinkingContent,\n\t\t\t\t\t\t\tthinkingType,\n\t\t\t\t\t\t\tthinkingSignature,\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t};\n\t\t})\n\t\t.filter((item): item is NonNullable<typeof item> => item !== undefined);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAoC;AAG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YACA;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD,CAAC,EACA,OAAO,CAAC,SAA2C,SAAS,MAAS;AACxE;","names":[]}
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
6
10
  var __copyProps = (to, from, except, desc) => {
7
11
  if (from && typeof from === "object" || typeof from === "function") {
8
12
  for (let key of __getOwnPropNames(from))
@@ -13,5 +17,25 @@ var __copyProps = (to, from, except, desc) => {
13
17
  };
14
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
19
  var types_exports = {};
20
+ __export(types_exports, {
21
+ isGeminiThoughtSignatureBlock: () => isGeminiThoughtSignatureBlock,
22
+ isRedactedThinkingBlock: () => isRedactedThinkingBlock,
23
+ isThinkingBlock: () => isThinkingBlock
24
+ });
16
25
  module.exports = __toCommonJS(types_exports);
26
+ function isThinkingBlock(block) {
27
+ return typeof block === "object" && block !== null && "type" in block && block.type === "thinking" && "thinking" in block && typeof block.thinking === "string" && "signature" in block && typeof block.signature === "string";
28
+ }
29
+ function isRedactedThinkingBlock(block) {
30
+ return typeof block === "object" && block !== null && "type" in block && block.type === "redacted_thinking" && "data" in block && typeof block.data === "string";
31
+ }
32
+ function isGeminiThoughtSignatureBlock(block) {
33
+ return typeof block === "object" && block !== null && "thoughtSignature" in block && typeof block.thoughtSignature === "string";
34
+ }
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ isGeminiThoughtSignatureBlock,
38
+ isRedactedThinkingBlock,
39
+ isThinkingBlock
40
+ });
17
41
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../utils/agent-execution/types.ts"],"sourcesContent":["import type { AIMessage } from '@langchain/core/messages';\nimport type { IDataObject, GenericValue } from 'n8n-workflow';\n\n/**\n * Represents a tool call request from an LLM.\n * This is a generic format that can be used across different agent types.\n */\nexport type ToolCallRequest = {\n\t/** The name of the tool to call */\n\ttool: string;\n\t/** The input arguments for the tool */\n\ttoolInput: Record<string, unknown>;\n\t/** Unique identifier for this tool call */\n\ttoolCallId: string;\n\t/** Type of the tool call (e.g., 'tool_call', 'function') */\n\ttype?: string;\n\t/** Log message or description */\n\tlog?: string;\n\t/** Full message log including LLM response */\n\tmessageLog?: unknown[];\n};\n\n/**\n * Represents a tool call action and its observation result.\n * Used for building agent steps and maintaining conversation context.\n */\nexport type ToolCallData = {\n\taction: {\n\t\ttool: string;\n\t\ttoolInput: Record<string, unknown>;\n\t\tlog: string | number | true | object;\n\t\tmessageLog?: AIMessage[];\n\t\ttoolCallId: IDataObject | GenericValue | GenericValue[] | IDataObject[];\n\t\ttype: string | number | true | object;\n\t};\n\tobservation: string;\n};\n\n/**\n * Result from an agent execution, optionally including tool calls and intermediate steps.\n */\nexport type AgentResult = {\n\t/** The final output from the agent */\n\toutput: string;\n\t/** Tool calls that need to be executed */\n\ttoolCalls?: ToolCallRequest[];\n\t/** Intermediate steps showing the agent's reasoning */\n\tintermediateSteps?: ToolCallData[];\n};\n\n/**\n * Metadata for engine requests and responses.\n */\nexport type RequestResponseMetadata = {\n\t/** Item index being processed */\n\titemIndex?: number;\n\t/** Previous tool call requests (for multi-turn conversations) */\n\tpreviousRequests?: ToolCallData[];\n\t/** Current iteration count (for max iterations enforcement) */\n\titerationCount?: number;\n\t/** Thought signature for Gemini 3 tool calls */\n\tthoughtSignature?: string;\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../../utils/agent-execution/types.ts"],"sourcesContent":["import type { AIMessage } from '@langchain/core/messages';\nimport type { IDataObject, GenericValue } from 'n8n-workflow';\n\n/**\n * Represents a tool call request from an LLM.\n * This is a generic format that can be used across different agent types.\n */\nexport type ToolCallRequest = {\n\t/** The name of the tool to call */\n\ttool: string;\n\t/** The input arguments for the tool */\n\ttoolInput: Record<string, unknown>;\n\t/** Unique identifier for this tool call */\n\ttoolCallId: string;\n\t/** Type of the tool call (e.g., 'tool_call', 'function') */\n\ttype?: string;\n\t/** Log message or description */\n\tlog?: string;\n\t/** Full message log including LLM response */\n\tmessageLog?: unknown[];\n};\n\n/**\n * Represents a tool call action and its observation result.\n * Used for building agent steps and maintaining conversation context.\n */\nexport type ToolCallData = {\n\taction: {\n\t\ttool: string;\n\t\ttoolInput: Record<string, unknown>;\n\t\tlog: string | number | true | object;\n\t\tmessageLog?: AIMessage[];\n\t\ttoolCallId: IDataObject | GenericValue | GenericValue[] | IDataObject[];\n\t\ttype: string | number | true | object;\n\t};\n\tobservation: string;\n};\n\n/**\n * Result from an agent execution, optionally including tool calls and intermediate steps.\n */\nexport type AgentResult = {\n\t/** The final output from the agent */\n\toutput: string;\n\t/** Tool calls that need to be executed */\n\ttoolCalls?: ToolCallRequest[];\n\t/** Intermediate steps showing the agent's reasoning */\n\tintermediateSteps?: ToolCallData[];\n};\n\n/**\n * Anthropic thinking content block\n */\nexport type ThinkingContentBlock = {\n\ttype: 'thinking';\n\tthinking: string;\n\tsignature: string;\n};\n\n/**\n * Anthropic redacted thinking content block\n */\nexport type RedactedThinkingContentBlock = {\n\ttype: 'redacted_thinking';\n\tdata: string;\n};\n\n/**\n * Anthropic tool use content block\n */\nexport type ToolUseContentBlock = {\n\ttype: 'tool_use';\n\tid: string;\n\tname: string;\n\tinput: Record<string, unknown>;\n};\n\n/**\n * Gemini thought signature content block\n */\nexport type GeminiThoughtSignatureBlock = {\n\tthoughtSignature: string;\n};\n\n/**\n * Union type for all supported content blocks\n */\nexport type ContentBlock =\n\t| ThinkingContentBlock\n\t| RedactedThinkingContentBlock\n\t| ToolUseContentBlock\n\t| GeminiThoughtSignatureBlock;\n\n/**\n * Metadata for engine requests and responses.\n */\nexport type RequestResponseMetadata = {\n\t/** Item index being processed */\n\titemIndex?: number;\n\t/** Previous tool call requests (for multi-turn conversations) */\n\tpreviousRequests?: ToolCallData[];\n\t/** Current iteration count (for max iterations enforcement) */\n\titerationCount?: number;\n\t/** Google/Gemini-specific metadata */\n\tgoogle?: {\n\t\t/** Thought signature for Gemini extended thinking */\n\t\tthoughtSignature?: string;\n\t};\n\t/** Anthropic-specific metadata */\n\tanthropic?: {\n\t\t/** Thinking content from extended thinking mode */\n\t\tthinkingContent?: string;\n\t\t/** Type of thinking block (thinking or redacted_thinking) */\n\t\tthinkingType?: 'thinking' | 'redacted_thinking';\n\t\t/** Cryptographic signature for thinking blocks */\n\t\tthinkingSignature?: string;\n\t};\n};\n\n/**\n * Type guard to check if a block is a thinking content block\n */\nexport function isThinkingBlock(block: unknown): block is ThinkingContentBlock {\n\treturn (\n\t\ttypeof block === 'object' &&\n\t\tblock !== null &&\n\t\t'type' in block &&\n\t\tblock.type === 'thinking' &&\n\t\t'thinking' in block &&\n\t\ttypeof block.thinking === 'string' &&\n\t\t'signature' in block &&\n\t\ttypeof block.signature === 'string'\n\t);\n}\n\n/**\n * Type guard to check if a block is a redacted thinking content block\n */\nexport function isRedactedThinkingBlock(block: unknown): block is RedactedThinkingContentBlock {\n\treturn (\n\t\ttypeof block === 'object' &&\n\t\tblock !== null &&\n\t\t'type' in block &&\n\t\tblock.type === 'redacted_thinking' &&\n\t\t'data' in block &&\n\t\ttypeof block.data === 'string'\n\t);\n}\n\n/**\n * Type guard to check if a block is a Gemini thought signature block\n */\nexport function isGeminiThoughtSignatureBlock(\n\tblock: unknown,\n): block is GeminiThoughtSignatureBlock {\n\treturn (\n\t\ttypeof block === 'object' &&\n\t\tblock !== null &&\n\t\t'thoughtSignature' in block &&\n\t\ttypeof block.thoughtSignature === 'string'\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0HO,SAAS,gBAAgB,OAA+C;AAC9E,SACC,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACV,MAAM,SAAS,cACf,cAAc,SACd,OAAO,MAAM,aAAa,YAC1B,eAAe,SACf,OAAO,MAAM,cAAc;AAE7B;AAKO,SAAS,wBAAwB,OAAuD;AAC9F,SACC,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACV,MAAM,SAAS,uBACf,UAAU,SACV,OAAO,MAAM,SAAS;AAExB;AAKO,SAAS,8BACf,OACuC;AACvC,SACC,OAAO,UAAU,YACjB,UAAU,QACV,sBAAsB,SACtB,OAAO,MAAM,qBAAqB;AAEpC;","names":[]}
@@ -24,6 +24,7 @@ __export(descriptions_exports, {
24
24
  inputSchemaField: () => inputSchemaField,
25
25
  jsonSchemaExampleField: () => jsonSchemaExampleField,
26
26
  promptTypeOptions: () => promptTypeOptions,
27
+ promptTypeOptionsDeprecated: () => promptTypeOptionsDeprecated,
27
28
  schemaTypeField: () => schemaTypeField,
28
29
  textFromGuardrailsNode: () => textFromGuardrailsNode,
29
30
  textFromPreviousNode: () => textFromPreviousNode,
@@ -110,7 +111,7 @@ const buildInputSchemaField = (props) => ({
110
111
  hint: 'Use <a target="_blank" href="https://json-schema.org/">JSON Schema</a> format (<a target="_blank" href="https://json-schema.org/learn/miscellaneous-examples.html">examples</a>). $refs syntax is currently not supported.'
111
112
  });
112
113
  const inputSchemaField = buildInputSchemaField();
113
- const promptTypeOptions = {
114
+ const promptTypeOptionsDeprecated = {
114
115
  displayName: "Source for Prompt (User Message)",
115
116
  name: "promptType",
116
117
  type: "options",
@@ -133,6 +134,24 @@ const promptTypeOptions = {
133
134
  ],
134
135
  default: "auto"
135
136
  };
137
+ const promptTypeOptions = {
138
+ displayName: "Source for Prompt (User Message)",
139
+ name: "promptType",
140
+ type: "options",
141
+ options: [
142
+ {
143
+ name: "Connected Chat Trigger Node",
144
+ value: "auto",
145
+ description: "Looks for an input field called 'chatInput' that is coming from a directly connected Chat Trigger"
146
+ },
147
+ {
148
+ name: "Define below",
149
+ value: "define",
150
+ description: "Use an expression to reference data in previous nodes or enter static text"
151
+ }
152
+ ],
153
+ default: "auto"
154
+ };
136
155
  const textInput = {
137
156
  displayName: "Prompt (User Message)",
138
157
  name: "text",
@@ -183,6 +202,7 @@ const toolDescription = {
183
202
  inputSchemaField,
184
203
  jsonSchemaExampleField,
185
204
  promptTypeOptions,
205
+ promptTypeOptionsDeprecated,
186
206
  schemaTypeField,
187
207
  textFromGuardrailsNode,
188
208
  textFromPreviousNode,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../utils/descriptions.ts"],"sourcesContent":["import type { DisplayCondition, INodeProperties, NodeParameterValue } from 'n8n-workflow';\n\nexport const schemaTypeField: INodeProperties = {\n\tdisplayName: 'Schema Type',\n\tname: 'schemaType',\n\ttype: 'options',\n\tnoDataExpression: true,\n\toptions: [\n\t\t{\n\t\t\tname: 'Generate From JSON Example',\n\t\t\tvalue: 'fromJson',\n\t\t\tdescription: 'Generate a schema from an example JSON object',\n\t\t},\n\t\t{\n\t\t\tname: 'Define using JSON Schema',\n\t\t\tvalue: 'manual',\n\t\t\tdescription: 'Define the JSON schema manually',\n\t\t},\n\t],\n\tdefault: 'fromJson',\n\tdescription: 'How to specify the schema for the function',\n};\n\n/**\n * Returns a field for inputting a JSON example that can be used to generate the schema.\n * @param props\n */\nexport const buildJsonSchemaExampleField = (props?: {\n\tshowExtraProps?: Record<string, Array<NodeParameterValue | DisplayCondition> | undefined>;\n}): INodeProperties => ({\n\tdisplayName: 'JSON Example',\n\tname: 'jsonSchemaExample',\n\ttype: 'json',\n\tdefault: `{\n\t\"some_input\": \"some_value\"\n}`,\n\tnoDataExpression: true,\n\ttypeOptions: {\n\t\trows: 10,\n\t},\n\tdisplayOptions: {\n\t\tshow: {\n\t\t\t...props?.showExtraProps,\n\t\t\tschemaType: ['fromJson'],\n\t\t},\n\t},\n\tdescription: 'Example JSON object to use to generate the schema',\n});\n\n/**\n * Returns a notice field about the generated schema properties being required by default.\n * @param props\n */\nexport const buildJsonSchemaExampleNotice = (props?: {\n\tshowExtraProps?: Record<string, Array<NodeParameterValue | DisplayCondition> | undefined>;\n}): INodeProperties => ({\n\tdisplayName:\n\t\t\"All properties will be required. To make them optional, use the 'JSON Schema' schema type instead\",\n\tname: 'notice',\n\ttype: 'notice',\n\tdefault: '',\n\tdisplayOptions: {\n\t\tshow: {\n\t\t\t...props?.showExtraProps,\n\t\t\tschemaType: ['fromJson'],\n\t\t},\n\t},\n});\n\nexport const jsonSchemaExampleField = buildJsonSchemaExampleField();\n\nexport const buildInputSchemaField = (props?: {\n\tshowExtraProps?: Record<string, Array<NodeParameterValue | DisplayCondition> | undefined>;\n}): INodeProperties => ({\n\tdisplayName: 'Input Schema',\n\tname: 'inputSchema',\n\ttype: 'json',\n\tdefault: `{\n\"type\": \"object\",\n\"properties\": {\n\t\"some_input\": {\n\t\t\"type\": \"string\",\n\t\t\"description\": \"Some input to the function\"\n\t\t}\n\t}\n}`,\n\tnoDataExpression: false,\n\ttypeOptions: {\n\t\trows: 10,\n\t},\n\tdisplayOptions: {\n\t\tshow: {\n\t\t\t...props?.showExtraProps,\n\t\t\tschemaType: ['manual'],\n\t\t},\n\t},\n\tdescription: 'Schema to use for the function',\n\thint: 'Use <a target=\"_blank\" href=\"https://json-schema.org/\">JSON Schema</a> format (<a target=\"_blank\" href=\"https://json-schema.org/learn/miscellaneous-examples.html\">examples</a>). $refs syntax is currently not supported.',\n});\n\nexport const inputSchemaField = buildInputSchemaField();\n\nexport const promptTypeOptions: INodeProperties = {\n\tdisplayName: 'Source for Prompt (User Message)',\n\tname: 'promptType',\n\ttype: 'options',\n\toptions: [\n\t\t{\n\t\t\tname: 'Connected Chat Trigger Node',\n\t\t\tvalue: 'auto',\n\t\t\tdescription:\n\t\t\t\t\"Looks for an input field called 'chatInput' that is coming from a directly connected Chat Trigger\",\n\t\t},\n\t\t{\n\t\t\tname: 'Connected Guardrails Node',\n\t\t\tvalue: 'guardrails',\n\t\t\tdescription:\n\t\t\t\t\"Looks for an input field called 'guardrailsInput' that is coming from a directly connected Guardrails Node\",\n\t\t},\n\t\t{\n\t\t\tname: 'Define below',\n\t\t\tvalue: 'define',\n\t\t\tdescription: 'Use an expression to reference data in previous nodes or enter static text',\n\t\t},\n\t],\n\tdefault: 'auto',\n};\n\nexport const textInput: INodeProperties = {\n\tdisplayName: 'Prompt (User Message)',\n\tname: 'text',\n\ttype: 'string',\n\trequired: true,\n\tdefault: '',\n\tplaceholder: 'e.g. Hello, how can you help me?',\n\ttypeOptions: {\n\t\trows: 2,\n\t},\n};\n\nexport const textFromPreviousNode: INodeProperties = {\n\tdisplayName: 'Prompt (User Message)',\n\tname: 'text',\n\ttype: 'string',\n\trequired: true,\n\tdefault: '={{ $json.chatInput }}',\n\ttypeOptions: {\n\t\trows: 2,\n\t},\n\tdisabledOptions: { show: { promptType: ['auto'] } },\n};\n\nexport const textFromGuardrailsNode: INodeProperties = {\n\tdisplayName: 'Prompt (User Message)',\n\tname: 'text',\n\ttype: 'string',\n\trequired: true,\n\tdefault: '={{ $json.guardrailsInput }}',\n\ttypeOptions: {\n\t\trows: 2,\n\t},\n\tdisabledOptions: { show: { promptType: ['guardrails'] } },\n};\n\nexport const toolDescription: INodeProperties = {\n\tdisplayName: 'Description',\n\tname: 'toolDescription',\n\ttype: 'string',\n\tdefault: 'AI Agent that can call other tools',\n\trequired: true,\n\ttypeOptions: { rows: 2 },\n\tdescription:\n\t\t'Explain to the LLM what this tool does, a good, specific description would allow LLMs to produce expected results much more often',\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,kBAAmC;AAAA,EAC/C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,kBAAkB;AAAA,EAClB,SAAS;AAAA,IACR;AAAA,MACC,MAA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C,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aACC;AAAA,IACF;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aACC;AAAA,IACF;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,EACD;AAAA,EACA,SAAS;AACV;AAEO,MAAM,YAA6B;AAAA,EACzC,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,aAAa;AAAA,EACb,aAAa;AAAA,IACZ,MAAM;AAAA,EACP;AACD;AAEO,MAAM,uBAAwC;AAAA,EACpD,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,aAAa;AAAA,IACZ,MAAM;AAAA,EACP;AAAA,EACA,iBAAiB,EAAE,MAAM,EAAE,YAAY,CAAC,MAAM,EAAE,EAAE;AACnD;AAEO,MAAM,yBAA0C;AAAA,EACtD,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,aAAa;AAAA,IACZ,MAAM;AAAA,EACP;AAAA,EACA,iBAAiB,EAAE,MAAM,EAAE,YAAY,CAAC,YAAY,EAAE,EAAE;AACzD;AAEO,MAAM,kBAAmC;AAAA,EAC/C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AAAA,EACV,aAAa,EAAE,MAAM,EAAE;AAAA,EACvB,aACC;AACF;","names":[]}
1
+ {"version":3,"sources":["../../utils/descriptions.ts"],"sourcesContent":["import type { DisplayCondition, INodeProperties, NodeParameterValue } from 'n8n-workflow';\n\nexport const schemaTypeField: INodeProperties = {\n\tdisplayName: 'Schema Type',\n\tname: 'schemaType',\n\ttype: 'options',\n\tnoDataExpression: true,\n\toptions: [\n\t\t{\n\t\t\tname: 'Generate From JSON Example',\n\t\t\tvalue: 'fromJson',\n\t\t\tdescription: 'Generate a schema from an example JSON object',\n\t\t},\n\t\t{\n\t\t\tname: 'Define using JSON Schema',\n\t\t\tvalue: 'manual',\n\t\t\tdescription: 'Define the JSON schema manually',\n\t\t},\n\t],\n\tdefault: 'fromJson',\n\tdescription: 'How to specify the schema for the function',\n};\n\n/**\n * Returns a field for inputting a JSON example that can be used to generate the schema.\n * @param props\n */\nexport const buildJsonSchemaExampleField = (props?: {\n\tshowExtraProps?: Record<string, Array<NodeParameterValue | DisplayCondition> | undefined>;\n}): INodeProperties => ({\n\tdisplayName: 'JSON Example',\n\tname: 'jsonSchemaExample',\n\ttype: 'json',\n\tdefault: `{\n\t\"some_input\": \"some_value\"\n}`,\n\tnoDataExpression: true,\n\ttypeOptions: {\n\t\trows: 10,\n\t},\n\tdisplayOptions: {\n\t\tshow: {\n\t\t\t...props?.showExtraProps,\n\t\t\tschemaType: ['fromJson'],\n\t\t},\n\t},\n\tdescription: 'Example JSON object to use to generate the schema',\n});\n\n/**\n * Returns a notice field about the generated schema properties being required by default.\n * @param props\n */\nexport const buildJsonSchemaExampleNotice = (props?: {\n\tshowExtraProps?: Record<string, Array<NodeParameterValue | DisplayCondition> | undefined>;\n}): INodeProperties => ({\n\tdisplayName:\n\t\t\"All properties will be required. To make them optional, use the 'JSON Schema' schema type instead\",\n\tname: 'notice',\n\ttype: 'notice',\n\tdefault: '',\n\tdisplayOptions: {\n\t\tshow: {\n\t\t\t...props?.showExtraProps,\n\t\t\tschemaType: ['fromJson'],\n\t\t},\n\t},\n});\n\nexport const jsonSchemaExampleField = buildJsonSchemaExampleField();\n\nexport const buildInputSchemaField = (props?: {\n\tshowExtraProps?: Record<string, Array<NodeParameterValue | DisplayCondition> | undefined>;\n}): INodeProperties => ({\n\tdisplayName: 'Input Schema',\n\tname: 'inputSchema',\n\ttype: 'json',\n\tdefault: `{\n\"type\": \"object\",\n\"properties\": {\n\t\"some_input\": {\n\t\t\"type\": \"string\",\n\t\t\"description\": \"Some input to the function\"\n\t\t}\n\t}\n}`,\n\tnoDataExpression: false,\n\ttypeOptions: {\n\t\trows: 10,\n\t},\n\tdisplayOptions: {\n\t\tshow: {\n\t\t\t...props?.showExtraProps,\n\t\t\tschemaType: ['manual'],\n\t\t},\n\t},\n\tdescription: 'Schema to use for the function',\n\thint: 'Use <a target=\"_blank\" href=\"https://json-schema.org/\">JSON Schema</a> format (<a target=\"_blank\" href=\"https://json-schema.org/learn/miscellaneous-examples.html\">examples</a>). $refs syntax is currently not supported.',\n});\n\nexport const inputSchemaField = buildInputSchemaField();\n\nexport const promptTypeOptionsDeprecated: INodeProperties = {\n\tdisplayName: 'Source for Prompt (User Message)',\n\tname: 'promptType',\n\ttype: 'options',\n\toptions: [\n\t\t{\n\t\t\tname: 'Connected Chat Trigger Node',\n\t\t\tvalue: 'auto',\n\t\t\tdescription:\n\t\t\t\t\"Looks for an input field called 'chatInput' that is coming from a directly connected Chat Trigger\",\n\t\t},\n\t\t{\n\t\t\tname: 'Connected Guardrails Node',\n\t\t\tvalue: 'guardrails',\n\t\t\tdescription:\n\t\t\t\t\"Looks for an input field called 'guardrailsInput' that is coming from a directly connected Guardrails Node\",\n\t\t},\n\t\t{\n\t\t\tname: 'Define below',\n\t\t\tvalue: 'define',\n\t\t\tdescription: 'Use an expression to reference data in previous nodes or enter static text',\n\t\t},\n\t],\n\tdefault: 'auto',\n};\n\nexport const promptTypeOptions: INodeProperties = {\n\tdisplayName: 'Source for Prompt (User Message)',\n\tname: 'promptType',\n\ttype: 'options',\n\toptions: [\n\t\t{\n\t\t\tname: 'Connected Chat Trigger Node',\n\t\t\tvalue: 'auto',\n\t\t\tdescription:\n\t\t\t\t\"Looks for an input field called 'chatInput' that is coming from a directly connected Chat Trigger\",\n\t\t},\n\t\t{\n\t\t\tname: 'Define below',\n\t\t\tvalue: 'define',\n\t\t\tdescription: 'Use an expression to reference data in previous nodes or enter static text',\n\t\t},\n\t],\n\tdefault: 'auto',\n};\n\nexport const textInput: INodeProperties = {\n\tdisplayName: 'Prompt (User Message)',\n\tname: 'text',\n\ttype: 'string',\n\trequired: true,\n\tdefault: '',\n\tplaceholder: 'e.g. Hello, how can you help me?',\n\ttypeOptions: {\n\t\trows: 2,\n\t},\n};\n\nexport const textFromPreviousNode: INodeProperties = {\n\tdisplayName: 'Prompt (User Message)',\n\tname: 'text',\n\ttype: 'string',\n\trequired: true,\n\tdefault: '={{ $json.chatInput }}',\n\ttypeOptions: {\n\t\trows: 2,\n\t},\n\tdisabledOptions: { show: { promptType: ['auto'] } },\n};\n\nexport const textFromGuardrailsNode: INodeProperties = {\n\tdisplayName: 'Prompt (User Message)',\n\tname: 'text',\n\ttype: 'string',\n\trequired: true,\n\tdefault: '={{ $json.guardrailsInput }}',\n\ttypeOptions: {\n\t\trows: 2,\n\t},\n\tdisabledOptions: { show: { promptType: ['guardrails'] } },\n};\n\nexport const toolDescription: INodeProperties = {\n\tdisplayName: 'Description',\n\tname: 'toolDescription',\n\ttype: 'string',\n\tdefault: 'AI Agent that can call other tools',\n\trequired: true,\n\ttypeOptions: { rows: 2 },\n\tdescription:\n\t\t'Explain to the LLM what this tool does, a good, specific description would allow LLMs to produce expected results much more often',\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,kBAAmC;AAAA,EAC/C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,kBAAkB;AAAA,EAClB,SAAS;AAAA,IACR;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,EACD;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AACd;AAMO,MAAM,8BAA8B,CAAC,WAE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AA,EACD;AAAA,EACA,SAAS;AACV;AAEO,MAAM,oBAAqC;AAAA,EACjD,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,IACR;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aACC;AAAA,IACF;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,EACD;AAAA,EACA,SAAS;AACV;AAEO,MAAM,YAA6B;AAAA,EACzC,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,aAAa;AAAA,EACb,aAAa;AAAA,IACZ,MAAM;AAAA,EACP;AACD;AAEO,MAAM,uBAAwC;AAAA,EACpD,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,aAAa;AAAA,IACZ,MAAM;AAAA,EACP;AAAA,EACA,iBAAiB,EAAE,MAAM,EAAE,YAAY,CAAC,MAAM,EAAE,EAAE;AACnD;AAEO,MAAM,yBAA0C;AAAA,EACtD,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,aAAa;AAAA,IACZ,MAAM;AAAA,EACP;AAAA,EACA,iBAAiB,EAAE,MAAM,EAAE,YAAY,CAAC,YAAY,EAAE,EAAE;AACzD;AAEO,MAAM,kBAAmC;AAAA,EAC/C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AAAA,EACV,aAAa,EAAE,MAAM,EAAE;AAAA,EACvB,aACC;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n8n/n8n-nodes-langchain",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -159,8 +159,8 @@
159
159
  "fast-glob": "3.2.12",
160
160
  "jest-mock-extended": "^3.0.4",
161
161
  "tsup": "^8.5.0",
162
- "@n8n/eslint-plugin-community-nodes": "0.7.0",
163
- "n8n-core": "2.0.1"
162
+ "n8n-core": "2.1.0",
163
+ "@n8n/eslint-plugin-community-nodes": "0.7.0"
164
164
  },
165
165
  "dependencies": {
166
166
  "@aws-sdk/client-sso-oidc": "3.808.0",
@@ -194,7 +194,7 @@
194
194
  "@n8n/typeorm": "0.3.20-15",
195
195
  "@n8n/vm2": "3.9.25",
196
196
  "@pinecone-database/pinecone": "^5.0.2",
197
- "@qdrant/js-client-rest": "^1.15.0",
197
+ "@qdrant/js-client-rest": "^1.16.2",
198
198
  "@supabase/supabase-js": "2.49.9",
199
199
  "@xata.io/client": "0.28.4",
200
200
  "@zilliz/milvus2-sdk-node": "^2.5.7",
@@ -229,14 +229,14 @@
229
229
  "weaviate-client": "3.6.2",
230
230
  "zod": "3.25.67",
231
231
  "zod-to-json-schema": "3.23.3",
232
+ "@n8n/config": "2.0.0",
232
233
  "@n8n/client-oauth2": "1.0.0-rc.0",
233
- "@n8n/config": "2.0.0-rc.1",
234
234
  "@n8n/di": "0.10.0",
235
235
  "@n8n/errors": "0.5.0",
236
236
  "@n8n/json-schema-to-zod": "1.6.0",
237
237
  "@n8n/typescript-config": "1.3.0",
238
- "n8n-workflow": "2.0.1",
239
- "n8n-nodes-base": "2.0.1"
238
+ "n8n-workflow": "2.1.0",
239
+ "n8n-nodes-base": "2.1.0"
240
240
  },
241
241
  "license": "SEE LICENSE IN LICENSE.md",
242
242
  "homepage": "https://n8n.io",