n8n-nodes-agnicwallet 1.0.8 → 1.0.10
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.
|
@@ -7,19 +7,6 @@ const streamableHttp_js_1 = require("@modelcontextprotocol/sdk/client/streamable
|
|
|
7
7
|
const tools_1 = require("@langchain/core/tools");
|
|
8
8
|
const zod_1 = require("zod");
|
|
9
9
|
const json_schema_to_zod_1 = require("@n8n/json-schema-to-zod");
|
|
10
|
-
/**
|
|
11
|
-
* Minimal Toolkit interface compatible with n8n AI Agent
|
|
12
|
-
* This replaces the deprecated langchain/agents Toolkit to avoid version conflicts
|
|
13
|
-
*/
|
|
14
|
-
class AgnicMcpToolkit {
|
|
15
|
-
constructor(tools) {
|
|
16
|
-
this.tools = tools;
|
|
17
|
-
this.lc_namespace = ["langchain", "agents", "toolkits"];
|
|
18
|
-
}
|
|
19
|
-
getTools() {
|
|
20
|
-
return this.tools;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
10
|
// Pre-configured AgnicPay MCP endpoint (uses HTTP Streamable transport)
|
|
24
11
|
const AGNIC_MCP_ENDPOINT = "https://mcp.agnicpay.xyz/sse";
|
|
25
12
|
/**
|
|
@@ -319,15 +306,16 @@ class AgnicMCPTool {
|
|
|
319
306
|
return result;
|
|
320
307
|
};
|
|
321
308
|
// Convert MCP tools to LangChain DynamicStructuredTools
|
|
309
|
+
// Returns tools directly - n8n's getConnectedTools handles both
|
|
310
|
+
// Toolkit instances and raw tool arrays via flatMap
|
|
322
311
|
const langchainTools = mcpTools.map((tool) => mcpToolToDynamicTool(tool, callTool));
|
|
323
|
-
// Wrap tools in a Toolkit for n8n AI Agent compatibility
|
|
324
|
-
const toolkit = new AgnicMcpToolkit(langchainTools);
|
|
325
312
|
// Store references for cleanup
|
|
326
313
|
const clientRef = client;
|
|
327
314
|
const transportRef = transport;
|
|
328
|
-
// Return
|
|
315
|
+
// Return tools directly (not wrapped in Toolkit)
|
|
316
|
+
// This avoids langchain version conflicts with other community nodes
|
|
329
317
|
return {
|
|
330
|
-
response:
|
|
318
|
+
response: langchainTools,
|
|
331
319
|
closeFunction: async () => {
|
|
332
320
|
try {
|
|
333
321
|
await clientRef.close();
|