@atom8n/n8n-nodes-langchain 2.5.6 → 2.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/known/nodes.json +32 -0
- package/dist/methods/defined.json +3 -0
- package/dist/methods/referenced.json +3 -0
- package/dist/nodes/agents/OpenClawAgent/OpenClawAgent.node.js +62 -0
- package/dist/nodes/agents/OpenClawAgent/OpenClawAgent.node.js.map +1 -0
- package/dist/nodes/agents/OpenClawAgent/V1/OpenClawAgentV1.node.js +821 -0
- package/dist/nodes/agents/OpenClawAgent/V1/OpenClawAgentV1.node.js.map +1 -0
- package/dist/nodes/agents/OpenClawAgent/V2/OpenClawAgentV2.node.js +2059 -0
- package/dist/nodes/agents/OpenClawAgent/V2/OpenClawAgentV2.node.js.map +1 -0
- package/dist/nodes/agents/OpenClawAgent/channels/TelegramChannel/TelegramChannel.node.js +329 -0
- package/dist/nodes/agents/OpenClawAgent/channels/TelegramChannel/TelegramChannel.node.js.map +1 -0
- package/dist/nodes/agents/OpenClawAgent/channels/TelegramChannel/telegram-channel.svg +4 -0
- package/dist/nodes/agents/OpenClawAgent/channels/WhatsAppChannel/WhatsAppChannel.node.js +108 -0
- package/dist/nodes/agents/OpenClawAgent/channels/WhatsAppChannel/WhatsAppChannel.node.js.map +1 -0
- package/dist/nodes/agents/OpenClawAgent/channels/WhatsAppChannel/whatsapp-channel.svg +3 -0
- package/dist/nodes/agents/OpenClawAgent/mcpServers/OpenClawMcpServer/OpenClawMcpServer.node.js +228 -0
- package/dist/nodes/agents/OpenClawAgent/mcpServers/OpenClawMcpServer/OpenClawMcpServer.node.js.map +1 -0
- package/dist/nodes/agents/OpenClawAgent/mcpServers/OpenClawMcpServer/openclaw-mcp-server.svg +9 -0
- package/dist/nodes/agents/OpenClawAgent/models/OpenCodeFreeModel/OpenCodeFreeModel.node.js +97 -0
- package/dist/nodes/agents/OpenClawAgent/models/OpenCodeFreeModel/OpenCodeFreeModel.node.js.map +1 -0
- package/dist/nodes/agents/OpenClawAgent/models/OpenCodeFreeModel/opencode-free-model.svg +1 -0
- package/dist/nodes/agents/OpenClawAgent/openclaw.svg +8 -0
- package/dist/nodes/agents/OpenClawAgent/plugins/OpenClawPlugin/OpenClawPlugin.node.js +261 -0
- package/dist/nodes/agents/OpenClawAgent/plugins/OpenClawPlugin/OpenClawPlugin.node.js.map +1 -0
- package/dist/nodes/agents/OpenClawAgent/plugins/OpenClawPlugin/openclaw-plugin.svg +3 -0
- package/dist/nodes/llms/LmChat9Router/LmChat9Router.node.js +40 -3
- package/dist/nodes/llms/LmChat9Router/LmChat9Router.node.js.map +1 -1
- package/dist/nodes/llms/LmChatCodexCli/LmChatCodexCli.node.js +456 -0
- package/dist/nodes/llms/LmChatCodexCli/LmChatCodexCli.node.js.map +1 -0
- package/dist/nodes/llms/LmChatCodexCli/codexCli.svg +1 -0
- package/dist/nodes/llms/LmChatCursorAgent/LmChatCursorAgent.node.js +46 -6
- package/dist/nodes/llms/LmChatCursorAgent/LmChatCursorAgent.node.js.map +1 -1
- package/dist/nodes/llms/LmChatOpenCodeCli/LmChatOpenCodeCli.node.js +443 -0
- package/dist/nodes/llms/LmChatOpenCodeCli/LmChatOpenCodeCli.node.js.map +1 -0
- package/dist/nodes/llms/LmChatOpenCodeCli/openCodeCli.svg +1 -0
- package/dist/types/nodes.json +11 -2
- package/package.json +19 -11
package/dist/nodes/agents/OpenClawAgent/mcpServers/OpenClawMcpServer/OpenClawMcpServer.node.js
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
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
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var OpenClawMcpServer_node_exports = {};
|
|
20
|
+
__export(OpenClawMcpServer_node_exports, {
|
|
21
|
+
OpenClawMcpServer: () => OpenClawMcpServer
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(OpenClawMcpServer_node_exports);
|
|
24
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
25
|
+
function isObject(value) {
|
|
26
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
27
|
+
}
|
|
28
|
+
function parseHeaders(value, ctx, itemIndex) {
|
|
29
|
+
if (value === void 0 || value === null || value === "") {
|
|
30
|
+
return void 0;
|
|
31
|
+
}
|
|
32
|
+
let rawHeaders = value;
|
|
33
|
+
if (typeof value === "string") {
|
|
34
|
+
const trimmed = value.trim();
|
|
35
|
+
if (!trimmed || trimmed === "{}") {
|
|
36
|
+
return void 0;
|
|
37
|
+
}
|
|
38
|
+
rawHeaders = (0, import_n8n_workflow.jsonParse)(trimmed, { acceptJSObject: true, repairJSON: true });
|
|
39
|
+
}
|
|
40
|
+
if (!isObject(rawHeaders)) {
|
|
41
|
+
throw new import_n8n_workflow.NodeOperationError(ctx.getNode(), "Headers must be a JSON object", { itemIndex });
|
|
42
|
+
}
|
|
43
|
+
const headers = {};
|
|
44
|
+
for (const [key, headerValue] of Object.entries(rawHeaders)) {
|
|
45
|
+
if (typeof headerValue !== "string" && typeof headerValue !== "number" && typeof headerValue !== "boolean") {
|
|
46
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
47
|
+
ctx.getNode(),
|
|
48
|
+
`Header "${key}" must be a string, number, or boolean`,
|
|
49
|
+
{ itemIndex }
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
headers[key] = headerValue;
|
|
53
|
+
}
|
|
54
|
+
return Object.keys(headers).length > 0 ? headers : void 0;
|
|
55
|
+
}
|
|
56
|
+
function assertHttpUrl(value, ctx, itemIndex) {
|
|
57
|
+
try {
|
|
58
|
+
const parsed = new URL(value);
|
|
59
|
+
if (parsed.protocol === "http:" || parsed.protocol === "https:") {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
} catch {
|
|
63
|
+
}
|
|
64
|
+
throw new import_n8n_workflow.NodeOperationError(ctx.getNode(), "Endpoint URL must be a valid HTTP or HTTPS URL", {
|
|
65
|
+
itemIndex
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
class OpenClawMcpServer {
|
|
69
|
+
constructor() {
|
|
70
|
+
this.description = {
|
|
71
|
+
displayName: "OpenClaw MCP Server",
|
|
72
|
+
name: "openClawMcpServer",
|
|
73
|
+
icon: "file:openclaw-mcp-server.svg",
|
|
74
|
+
iconColor: "blue",
|
|
75
|
+
group: ["transform"],
|
|
76
|
+
version: 1,
|
|
77
|
+
description: "Provides MCP server configuration to an OpenClaw AI Agent",
|
|
78
|
+
defaults: {
|
|
79
|
+
name: "OpenClaw MCP Server"
|
|
80
|
+
},
|
|
81
|
+
codex: {
|
|
82
|
+
alias: ["OpenClaw", "MCP", "MCP Server", "Model Context Protocol", "BrowserOS"],
|
|
83
|
+
categories: ["AI"],
|
|
84
|
+
subcategories: {
|
|
85
|
+
AI: ["Model Context Protocol", "Tools"]
|
|
86
|
+
},
|
|
87
|
+
resources: {
|
|
88
|
+
primaryDocumentation: [
|
|
89
|
+
{
|
|
90
|
+
url: "https://docs.openclaw.ai/cli/mcp"
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
inputs: [],
|
|
96
|
+
outputs: [{ type: import_n8n_workflow.NodeConnectionTypes.AiTool, displayName: "MCP Server" }],
|
|
97
|
+
outputNames: ["MCP Server"],
|
|
98
|
+
properties: [
|
|
99
|
+
{
|
|
100
|
+
displayName: "Connect this node to the MCP Server input of an OpenClaw AI Agent to sync a named MCP endpoint into OpenClaw config.",
|
|
101
|
+
name: "mcpServerNotice",
|
|
102
|
+
type: "notice",
|
|
103
|
+
default: ""
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
displayName: "Server Name",
|
|
107
|
+
name: "serverName",
|
|
108
|
+
type: "string",
|
|
109
|
+
required: true,
|
|
110
|
+
default: "browseros",
|
|
111
|
+
description: "Name to use under OpenClaw mcp.servers"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
displayName: "Endpoint URL",
|
|
115
|
+
name: "endpointUrl",
|
|
116
|
+
type: "string",
|
|
117
|
+
required: true,
|
|
118
|
+
default: "http://127.0.0.1:9001/mcp",
|
|
119
|
+
placeholder: "e.g. http://127.0.0.1:9001/mcp",
|
|
120
|
+
description: "HTTP or HTTPS URL of the MCP server endpoint"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
displayName: "Transport",
|
|
124
|
+
name: "transport",
|
|
125
|
+
type: "options",
|
|
126
|
+
default: "streamable-http",
|
|
127
|
+
noDataExpression: true,
|
|
128
|
+
description: "HTTP transport OpenClaw should use for this MCP server",
|
|
129
|
+
options: [
|
|
130
|
+
{
|
|
131
|
+
name: "OpenClaw Default",
|
|
132
|
+
value: "",
|
|
133
|
+
description: "Do not write a transport value"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: "Server-Sent Events (SSE)",
|
|
137
|
+
value: "sse",
|
|
138
|
+
description: "Use SSE transport"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "Streamable HTTP",
|
|
142
|
+
value: "streamable-http",
|
|
143
|
+
description: "Use Streamable HTTP transport"
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
displayName: "Options",
|
|
149
|
+
name: "options",
|
|
150
|
+
type: "collection",
|
|
151
|
+
placeholder: "Add Option",
|
|
152
|
+
default: {},
|
|
153
|
+
options: [
|
|
154
|
+
{
|
|
155
|
+
displayName: "Connection Timeout",
|
|
156
|
+
name: "connectionTimeoutMs",
|
|
157
|
+
type: "number",
|
|
158
|
+
default: 3e4,
|
|
159
|
+
description: "Time in milliseconds to wait while connecting to the MCP server",
|
|
160
|
+
typeOptions: { minValue: 1 }
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
displayName: "Headers",
|
|
164
|
+
name: "headers",
|
|
165
|
+
type: "json",
|
|
166
|
+
default: "{}",
|
|
167
|
+
description: "Optional HTTP headers as a JSON object",
|
|
168
|
+
typeOptions: { rows: 4 }
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
async supplyData(itemIndex) {
|
|
176
|
+
const node = this.getNode();
|
|
177
|
+
console.log("[OpenClawMcpServer] supplyData ENTRY", {
|
|
178
|
+
nodeName: node.name,
|
|
179
|
+
nodeId: node.id,
|
|
180
|
+
nodeType: node.type,
|
|
181
|
+
itemIndex,
|
|
182
|
+
parameterNames: Object.keys(node.parameters ?? {})
|
|
183
|
+
});
|
|
184
|
+
const serverName = this.getNodeParameter("serverName", itemIndex, "").trim();
|
|
185
|
+
const endpointUrl = this.getNodeParameter("endpointUrl", itemIndex, "").trim();
|
|
186
|
+
const transport = this.getNodeParameter("transport", itemIndex, "streamable-http");
|
|
187
|
+
const options = this.getNodeParameter("options", itemIndex, {});
|
|
188
|
+
const headers = parseHeaders(options.headers, this, itemIndex);
|
|
189
|
+
const rawConnectionTimeoutMs = options.connectionTimeoutMs;
|
|
190
|
+
const connectionTimeoutMs = typeof rawConnectionTimeoutMs === "number" && Number.isFinite(rawConnectionTimeoutMs) && rawConnectionTimeoutMs > 0 ? Math.floor(rawConnectionTimeoutMs) : void 0;
|
|
191
|
+
console.log("[OpenClawMcpServer] supplyData called", {
|
|
192
|
+
itemIndex,
|
|
193
|
+
serverName,
|
|
194
|
+
endpointUrl,
|
|
195
|
+
transport: transport || "(openclaw-default)",
|
|
196
|
+
headerKeys: headers ? Object.keys(headers) : [],
|
|
197
|
+
connectionTimeoutMs
|
|
198
|
+
});
|
|
199
|
+
if (!serverName) {
|
|
200
|
+
throw new import_n8n_workflow.NodeOperationError(this.getNode(), "Server Name must not be empty", { itemIndex });
|
|
201
|
+
}
|
|
202
|
+
if (!endpointUrl) {
|
|
203
|
+
throw new import_n8n_workflow.NodeOperationError(this.getNode(), "Endpoint URL must not be empty", { itemIndex });
|
|
204
|
+
}
|
|
205
|
+
assertHttpUrl(endpointUrl, this, itemIndex);
|
|
206
|
+
const mcpServerConfig = {
|
|
207
|
+
mcpServerSource: "openclaw",
|
|
208
|
+
serverName,
|
|
209
|
+
url: endpointUrl,
|
|
210
|
+
transport: transport || void 0,
|
|
211
|
+
headers,
|
|
212
|
+
connectionTimeoutMs
|
|
213
|
+
};
|
|
214
|
+
console.log("[OpenClawMcpServer] returning MCP Server config", {
|
|
215
|
+
serverName: mcpServerConfig.serverName,
|
|
216
|
+
url: mcpServerConfig.url,
|
|
217
|
+
transport: mcpServerConfig.transport ?? "(openclaw-default)",
|
|
218
|
+
headerKeys: mcpServerConfig.headers ? Object.keys(mcpServerConfig.headers) : [],
|
|
219
|
+
connectionTimeoutMs: mcpServerConfig.connectionTimeoutMs
|
|
220
|
+
});
|
|
221
|
+
return { response: mcpServerConfig };
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
225
|
+
0 && (module.exports = {
|
|
226
|
+
OpenClawMcpServer
|
|
227
|
+
});
|
|
228
|
+
//# sourceMappingURL=OpenClawMcpServer.node.js.map
|
package/dist/nodes/agents/OpenClawAgent/mcpServers/OpenClawMcpServer/OpenClawMcpServer.node.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../nodes/agents/OpenClawAgent/mcpServers/OpenClawMcpServer/OpenClawMcpServer.node.ts"],"sourcesContent":["import {\n\tNodeConnectionTypes,\n\tNodeOperationError,\n\tjsonParse,\n\ttype IDataObject,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport type { McpServerConfig } from '../../V2/OpenClawAgentV2.node';\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction parseHeaders(\n\tvalue: unknown,\n\tctx: ISupplyDataFunctions,\n\titemIndex: number,\n): Record<string, string | number | boolean> | undefined {\n\tif (value === undefined || value === null || value === '') {\n\t\treturn undefined;\n\t}\n\n\tlet rawHeaders: unknown = value;\n\tif (typeof value === 'string') {\n\t\tconst trimmed = value.trim();\n\t\tif (!trimmed || trimmed === '{}') {\n\t\t\treturn undefined;\n\t\t}\n\t\trawHeaders = jsonParse<unknown>(trimmed, { acceptJSObject: true, repairJSON: true });\n\t}\n\n\tif (!isObject(rawHeaders)) {\n\t\tthrow new NodeOperationError(ctx.getNode(), 'Headers must be a JSON object', { itemIndex });\n\t}\n\n\tconst headers: Record<string, string | number | boolean> = {};\n\tfor (const [key, headerValue] of Object.entries(rawHeaders)) {\n\t\tif (\n\t\t\ttypeof headerValue !== 'string' &&\n\t\t\ttypeof headerValue !== 'number' &&\n\t\t\ttypeof headerValue !== 'boolean'\n\t\t) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tctx.getNode(),\n\t\t\t\t`Header \"${key}\" must be a string, number, or boolean`,\n\t\t\t\t{ itemIndex },\n\t\t\t);\n\t\t}\n\t\theaders[key] = headerValue;\n\t}\n\n\treturn Object.keys(headers).length > 0 ? headers : undefined;\n}\n\nfunction assertHttpUrl(value: string, ctx: ISupplyDataFunctions, itemIndex: number): void {\n\ttry {\n\t\tconst parsed = new URL(value);\n\t\tif (parsed.protocol === 'http:' || parsed.protocol === 'https:') {\n\t\t\treturn;\n\t\t}\n\t} catch {\n\t\t// handled below\n\t}\n\tthrow new NodeOperationError(ctx.getNode(), 'Endpoint URL must be a valid HTTP or HTTPS URL', {\n\t\titemIndex,\n\t});\n}\n\nexport class OpenClawMcpServer implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'OpenClaw MCP Server',\n\t\tname: 'openClawMcpServer',\n\t\ticon: 'file:openclaw-mcp-server.svg',\n\t\ticonColor: 'blue',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Provides MCP server configuration to an OpenClaw AI Agent',\n\t\tdefaults: {\n\t\t\tname: 'OpenClaw MCP Server',\n\t\t},\n\t\tcodex: {\n\t\t\talias: ['OpenClaw', 'MCP', 'MCP Server', 'Model Context Protocol', 'BrowserOS'],\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Model Context Protocol', 'Tools'],\n\t\t\t},\n\t\t\tresources: {\n\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t{\n\t\t\t\t\t\turl: 'https://docs.openclaw.ai/cli/mcp',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tinputs: [],\n\t\toutputs: [{ type: NodeConnectionTypes.AiTool, displayName: 'MCP Server' }],\n\t\toutputNames: ['MCP Server'],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'Connect this node to the MCP Server input of an OpenClaw AI Agent to sync a named MCP endpoint into OpenClaw config.',\n\t\t\t\tname: 'mcpServerNotice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Server Name',\n\t\t\t\tname: 'serverName',\n\t\t\t\ttype: 'string',\n\t\t\t\trequired: true,\n\t\t\t\tdefault: 'browseros',\n\t\t\t\tdescription: 'Name to use under OpenClaw mcp.servers',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Endpoint URL',\n\t\t\t\tname: 'endpointUrl',\n\t\t\t\ttype: 'string',\n\t\t\t\trequired: true,\n\t\t\t\tdefault: 'http://127.0.0.1:9001/mcp',\n\t\t\t\tplaceholder: 'e.g. http://127.0.0.1:9001/mcp',\n\t\t\t\tdescription: 'HTTP or HTTPS URL of the MCP server endpoint',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Transport',\n\t\t\t\tname: 'transport',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'streamable-http',\n\t\t\t\tnoDataExpression: true,\n\t\t\t\tdescription: 'HTTP transport OpenClaw should use for this MCP server',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'OpenClaw Default',\n\t\t\t\t\t\tvalue: '',\n\t\t\t\t\t\tdescription: 'Do not write a transport value',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Server-Sent Events (SSE)',\n\t\t\t\t\t\tvalue: 'sse',\n\t\t\t\t\t\tdescription: 'Use SSE transport',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Streamable HTTP',\n\t\t\t\t\t\tvalue: 'streamable-http',\n\t\t\t\t\t\tdescription: 'Use Streamable HTTP transport',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Connection Timeout',\n\t\t\t\t\t\tname: 'connectionTimeoutMs',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tdefault: 30000,\n\t\t\t\t\t\tdescription: 'Time in milliseconds to wait while connecting to the MCP server',\n\t\t\t\t\t\ttypeOptions: { minValue: 1 },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Headers',\n\t\t\t\t\t\tname: 'headers',\n\t\t\t\t\t\ttype: 'json',\n\t\t\t\t\t\tdefault: '{}',\n\t\t\t\t\t\tdescription: 'Optional HTTP headers as a JSON object',\n\t\t\t\t\t\ttypeOptions: { rows: 4 },\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst node = this.getNode();\n\t\tconsole.log('[OpenClawMcpServer] supplyData ENTRY', {\n\t\t\tnodeName: node.name,\n\t\t\tnodeId: node.id,\n\t\t\tnodeType: node.type,\n\t\t\titemIndex,\n\t\t\tparameterNames: Object.keys(node.parameters ?? {}),\n\t\t});\n\n\t\tconst serverName = (this.getNodeParameter('serverName', itemIndex, '') as string).trim();\n\t\tconst endpointUrl = (this.getNodeParameter('endpointUrl', itemIndex, '') as string).trim();\n\t\tconst transport = this.getNodeParameter('transport', itemIndex, 'streamable-http') as\n\t\t\t| ''\n\t\t\t| 'sse'\n\t\t\t| 'streamable-http';\n\t\tconst options = this.getNodeParameter('options', itemIndex, {}) as IDataObject;\n\t\tconst headers = parseHeaders(options.headers, this, itemIndex);\n\t\tconst rawConnectionTimeoutMs = options.connectionTimeoutMs;\n\t\tconst connectionTimeoutMs =\n\t\t\ttypeof rawConnectionTimeoutMs === 'number' &&\n\t\t\tNumber.isFinite(rawConnectionTimeoutMs) &&\n\t\t\trawConnectionTimeoutMs > 0\n\t\t\t\t? Math.floor(rawConnectionTimeoutMs)\n\t\t\t\t: undefined;\n\n\t\tconsole.log('[OpenClawMcpServer] supplyData called', {\n\t\t\titemIndex,\n\t\t\tserverName,\n\t\t\tendpointUrl,\n\t\t\ttransport: transport || '(openclaw-default)',\n\t\t\theaderKeys: headers ? Object.keys(headers) : [],\n\t\t\tconnectionTimeoutMs,\n\t\t});\n\n\t\tif (!serverName) {\n\t\t\tthrow new NodeOperationError(this.getNode(), 'Server Name must not be empty', { itemIndex });\n\t\t}\n\t\tif (!endpointUrl) {\n\t\t\tthrow new NodeOperationError(this.getNode(), 'Endpoint URL must not be empty', { itemIndex });\n\t\t}\n\t\tassertHttpUrl(endpointUrl, this, itemIndex);\n\n\t\tconst mcpServerConfig: McpServerConfig = {\n\t\t\tmcpServerSource: 'openclaw',\n\t\t\tserverName,\n\t\t\turl: endpointUrl,\n\t\t\ttransport: transport || undefined,\n\t\t\theaders,\n\t\t\tconnectionTimeoutMs,\n\t\t};\n\n\t\tconsole.log('[OpenClawMcpServer] returning MCP Server config', {\n\t\t\tserverName: mcpServerConfig.serverName,\n\t\t\turl: mcpServerConfig.url,\n\t\t\ttransport: mcpServerConfig.transport ?? '(openclaw-default)',\n\t\t\theaderKeys: mcpServerConfig.headers ? Object.keys(mcpServerConfig.headers) : [],\n\t\t\tconnectionTimeoutMs: mcpServerConfig.connectionTimeoutMs,\n\t\t});\n\n\t\treturn { response: mcpServerConfig };\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BASO;AAIP,SAAS,SAAS,OAAkD;AACnE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC3E;AAEA,SAAS,aACR,OACA,KACA,WACwD;AACxD,MAAI,UAAU,UAAa,UAAU,QAAQ,UAAU,IAAI;AAC1D,WAAO;AAAA,EACR;AAEA,MAAI,aAAsB;AAC1B,MAAI,OAAO,UAAU,UAAU;AAC9B,UAAM,UAAU,MAAM,KAAK;AAC3B,QAAI,CAAC,WAAW,YAAY,MAAM;AACjC,aAAO;AAAA,IACR;AACA,qBAAa,+BAAmB,SAAS,EAAE,gBAAgB,MAAM,YAAY,KAAK,CA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;AAAA,MACxC,iBAAiB;AAAA,MACjB;AAAA,MACA,KAAK;AAAA,MACL,WAAW,aAAa;AAAA,MACxB;AAAA,MACA;AAAA,IACD;AAEA,YAAQ,IAAI,mDAAmD;AAAA,MAC9D,YAAY,gBAAgB;AAAA,MAC5B,KAAK,gBAAgB;AAAA,MACrB,WAAW,gBAAgB,aAAa;AAAA,MACxC,YAAY,gBAAgB,UAAU,OAAO,KAAK,gBAAgB,OAAO,IAAI,CAAC;AAAA,MAC9E,qBAAqB,gBAAgB;AAAA,IACtC,CAAC;AAED,WAAO,EAAE,UAAU,gBAAgB;AAAA,EACpC;AACD;","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2
|
+
<rect x="3" y="4" width="18" height="16" rx="2"/>
|
|
3
|
+
<path d="M7 8h10"/>
|
|
4
|
+
<path d="M7 12h4"/>
|
|
5
|
+
<path d="M14 12h3"/>
|
|
6
|
+
<path d="M8 16h8"/>
|
|
7
|
+
<path d="M12 20v2"/>
|
|
8
|
+
<path d="M9 22h6"/>
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
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
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var OpenCodeFreeModel_node_exports = {};
|
|
20
|
+
__export(OpenCodeFreeModel_node_exports, {
|
|
21
|
+
OpenCodeFreeModel: () => OpenCodeFreeModel
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(OpenCodeFreeModel_node_exports);
|
|
24
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
25
|
+
class OpenCodeFreeModel {
|
|
26
|
+
constructor() {
|
|
27
|
+
this.description = {
|
|
28
|
+
displayName: "OpenCode Free Chat Model",
|
|
29
|
+
name: "openClawOpenCodeFreeModel",
|
|
30
|
+
icon: "file:opencode-free-model.svg",
|
|
31
|
+
iconColor: "green",
|
|
32
|
+
group: ["transform"],
|
|
33
|
+
version: 1,
|
|
34
|
+
description: "Provides an OpenCode free-tier model to an OpenClaw AI Agent (no API key needed)",
|
|
35
|
+
defaults: {
|
|
36
|
+
name: "OpenCode Free Chat Model"
|
|
37
|
+
},
|
|
38
|
+
codex: {
|
|
39
|
+
alias: ["OpenCode", "Free", "Model", "OpenClaw"],
|
|
40
|
+
categories: ["AI"],
|
|
41
|
+
subcategories: {
|
|
42
|
+
AI: ["Language Models"]
|
|
43
|
+
},
|
|
44
|
+
resources: {
|
|
45
|
+
primaryDocumentation: [
|
|
46
|
+
{
|
|
47
|
+
url: "https://opencode.ai"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
inputs: [],
|
|
53
|
+
outputs: [import_n8n_workflow.NodeConnectionTypes.AiLanguageModel],
|
|
54
|
+
outputNames: ["Model"],
|
|
55
|
+
// No credentials — free models do not require API keys
|
|
56
|
+
properties: [
|
|
57
|
+
{
|
|
58
|
+
displayName: "Connect this node to an OpenClaw AI Agent to provide a free OpenCode model. No API key is needed for these models.",
|
|
59
|
+
name: "openCodeFreeNotice",
|
|
60
|
+
type: "notice",
|
|
61
|
+
default: ""
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
displayName: "Model",
|
|
65
|
+
name: "model",
|
|
66
|
+
type: "options",
|
|
67
|
+
default: "opencode/big-pickle",
|
|
68
|
+
description: "Select a free OpenCode model to use with the OpenClaw agent",
|
|
69
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items
|
|
70
|
+
options: [
|
|
71
|
+
{ name: "OpenCode Big Pickle", value: "opencode/big-pickle" },
|
|
72
|
+
{ name: "OpenCode GPT-5 Nano", value: "opencode/gpt-5-nano" },
|
|
73
|
+
{ name: "OpenCode Hy3 Preview Free", value: "opencode/hy3-preview-free" }
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
async supplyData(itemIndex) {
|
|
80
|
+
const modelId = this.getNodeParameter("model", itemIndex, "opencode/big-pickle");
|
|
81
|
+
console.log("[OpenCodeFreeModel] supplyData called", {
|
|
82
|
+
itemIndex,
|
|
83
|
+
modelId
|
|
84
|
+
});
|
|
85
|
+
const modelConfig = {
|
|
86
|
+
modelId,
|
|
87
|
+
modelSource: "opencode-free"
|
|
88
|
+
};
|
|
89
|
+
console.log("[OpenCodeFreeModel] returning model config", modelConfig);
|
|
90
|
+
return { response: modelConfig };
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
94
|
+
0 && (module.exports = {
|
|
95
|
+
OpenCodeFreeModel
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=OpenCodeFreeModel.node.js.map
|
package/dist/nodes/agents/OpenClawAgent/models/OpenCodeFreeModel/OpenCodeFreeModel.node.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../nodes/agents/OpenClawAgent/models/OpenCodeFreeModel/OpenCodeFreeModel.node.ts"],"sourcesContent":["import {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport type { ModelConfig } from '../../V2/OpenClawAgentV2.node';\n\n/**\n * OpenCode Free Chat Model sub-node for OpenClaw Agent.\n *\n * This node provides model configuration to the OpenClaw AI Agent\n * via the AiLanguageModel connection. It supplies free-tier OpenCode\n * models (no API key required) that the agent passes as --model to\n * the OpenClaw CLI.\n *\n * Unlike the standalone LmChatOpenCodeCli node (which wraps the CLI\n * as a LangChain BaseChatModel), this node simply supplies a model\n * identifier string — the OpenClaw agent handles CLI invocation.\n */\nexport class OpenCodeFreeModel implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'OpenCode Free Chat Model',\n\t\tname: 'openClawOpenCodeFreeModel',\n\t\ticon: 'file:opencode-free-model.svg',\n\t\ticonColor: 'green',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Provides an OpenCode free-tier model to an OpenClaw AI Agent (no API key needed)',\n\t\tdefaults: {\n\t\t\tname: 'OpenCode Free Chat Model',\n\t\t},\n\t\tcodex: {\n\t\t\talias: ['OpenCode', 'Free', 'Model', 'OpenClaw'],\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Language Models'],\n\t\t\t},\n\t\t\tresources: {\n\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t{\n\t\t\t\t\t\turl: 'https://opencode.ai',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tinputs: [],\n\t\toutputs: [NodeConnectionTypes.AiLanguageModel],\n\t\toutputNames: ['Model'],\n\t\t// No credentials — free models do not require API keys\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'Connect this node to an OpenClaw AI Agent to provide a free OpenCode model. No API key is needed for these models.',\n\t\t\t\tname: 'openCodeFreeNotice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Model',\n\t\t\t\tname: 'model',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'opencode/big-pickle',\n\t\t\t\tdescription: 'Select a free OpenCode model to use with the OpenClaw agent',\n\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items\n\t\t\t\toptions: [\n\t\t\t\t\t{ name: 'OpenCode Big Pickle', value: 'opencode/big-pickle' },\n\t\t\t\t\t{ name: 'OpenCode GPT-5 Nano', value: 'opencode/gpt-5-nano' },\n\t\t\t\t\t{ name: 'OpenCode Hy3 Preview Free', value: 'opencode/hy3-preview-free' },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst modelId = this.getNodeParameter('model', itemIndex, 'opencode/big-pickle') as string;\n\n\t\tconsole.log('[OpenCodeFreeModel] supplyData called', {\n\t\t\titemIndex,\n\t\t\tmodelId,\n\t\t});\n\n\t\tconst modelConfig: ModelConfig = {\n\t\t\tmodelId,\n\t\t\tmodelSource: 'opencode-free',\n\t\t};\n\n\t\tconsole.log('[OpenCodeFreeModel] returning model config', modelConfig);\n\n\t\treturn { response: modelConfig };\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAMO;AAgBA,MAAM,kBAAuC;AAAA,EAA7C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,OAAO,CAAC,YAAY,QAAQ,SAAS,UAAU;AAAA,QAC/C,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,iBAAiB;AAAA,QACvB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,MACA,QAAQ,CAAC;AAAA,MACT,SAAS,CAAC,wCAAoB,eAAe;AAAA,MAC7C,aAAa,CAAC,OAAO;AAAA;AAAA,MAErB,YAAY;AAAA,QACX;AAAA,UACC,aACC;AAAA,UACD,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,aAAa;AAAA;AAAA,UAEb,SAAS;AAAA,YACR,EAAE,MAAM,uBAAuB,OAAO,sBAAsB;AAAA,YAC5D,EAAE,MAAM,uBAAuB,OAAO,sBAAsB;AAAA,YAC5D,EAAE,MAAM,6BAA6B,OAAO,4BAA4B;AAAA,UACzE;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,UAAM,UAAU,KAAK,iBAAiB,SAAS,WAAW,qBAAqB;AAE/E,YAAQ,IAAI,yCAAyC;AAAA,MACpD;AAAA,MACA;AAAA,IACD,CAAC;AAED,UAAM,cAA2B;AAAA,MAChC;AAAA,MACA,aAAa;AAAA,IACd;AAEA,YAAQ,IAAI,8CAA8C,WAAW;AAErE,WAAO,EAAE,UAAU,YAAY;AAAA,EAChC;AACD;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="none" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><rect width="512" height="512" rx="80" fill="#064e3b"/><rect x="4" y="4" width="504" height="504" rx="76" stroke="#34d399" stroke-opacity=".25" stroke-width="8"/><path d="M160 176l-56 80 56 80" stroke="#34d399" stroke-width="28" stroke-linecap="round" stroke-linejoin="round"/><path d="M352 176l56 80-56 80" stroke="#34d399" stroke-width="28" stroke-linecap="round" stroke-linejoin="round"/><path d="M288 148l-64 216" stroke="#6ee7b7" stroke-width="24" stroke-linecap="round"/><circle cx="256" cy="256" r="120" stroke="#34d399" stroke-width="8" stroke-dasharray="16 12" opacity=".35"/><text x="256" y="440" text-anchor="middle" fill="#6ee7b7" font-size="56" font-family="monospace" font-weight="bold" opacity=".7">FREE</text></svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="60" height="60" rx="12" fill="#C94418"/>
|
|
3
|
+
<path d="M16 34.4C16 26.7 22.3 20.5 30 20.5C37.7 20.5 44 26.7 44 34.4" stroke="#FFF4EB" stroke-width="4" stroke-linecap="round"/>
|
|
4
|
+
<path d="M22.5 34.1C22.5 29.9 25.8 26.7 30 26.7C34.2 26.7 37.5 29.9 37.5 34.1" stroke="#FFF4EB" stroke-width="4" stroke-linecap="round"/>
|
|
5
|
+
<path d="M17 39H43" stroke="#FFF4EB" stroke-width="4" stroke-linecap="round"/>
|
|
6
|
+
<path d="M25.5 15L22 20.5" stroke="#FFF4EB" stroke-width="4" stroke-linecap="round"/>
|
|
7
|
+
<path d="M34.5 15L38 20.5" stroke="#FFF4EB" stroke-width="4" stroke-linecap="round"/>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
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
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var OpenClawPlugin_node_exports = {};
|
|
20
|
+
__export(OpenClawPlugin_node_exports, {
|
|
21
|
+
OpenClawPlugin: () => OpenClawPlugin
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(OpenClawPlugin_node_exports);
|
|
24
|
+
var import_fs = require("fs");
|
|
25
|
+
var import_path = require("path");
|
|
26
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
27
|
+
const PLUGIN_MANIFEST_FILENAME = "openclaw.plugin.json";
|
|
28
|
+
function loadLocalPluginManifest(dirPath) {
|
|
29
|
+
const manifestPath = (0, import_path.join)(dirPath, PLUGIN_MANIFEST_FILENAME);
|
|
30
|
+
console.log("[OpenClawPlugin] Scanning for local manifest", {
|
|
31
|
+
dirPath,
|
|
32
|
+
manifestPath,
|
|
33
|
+
exists: (0, import_fs.existsSync)(manifestPath)
|
|
34
|
+
});
|
|
35
|
+
if (!(0, import_fs.existsSync)(manifestPath)) {
|
|
36
|
+
console.log("[OpenClawPlugin] No openclaw.plugin.json found at path", {
|
|
37
|
+
dirPath,
|
|
38
|
+
manifestPath
|
|
39
|
+
});
|
|
40
|
+
return void 0;
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
const raw = (0, import_fs.readFileSync)(manifestPath, "utf8").trim();
|
|
44
|
+
if (!raw) {
|
|
45
|
+
console.log("[OpenClawPlugin] Manifest file is empty", { manifestPath });
|
|
46
|
+
return void 0;
|
|
47
|
+
}
|
|
48
|
+
const parsed = JSON.parse(raw);
|
|
49
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
50
|
+
console.log("[OpenClawPlugin] Manifest is not a valid JSON object", {
|
|
51
|
+
manifestPath,
|
|
52
|
+
type: typeof parsed
|
|
53
|
+
});
|
|
54
|
+
return void 0;
|
|
55
|
+
}
|
|
56
|
+
const manifest = {
|
|
57
|
+
id: typeof parsed.id === "string" ? parsed.id : void 0,
|
|
58
|
+
name: typeof parsed.name === "string" ? parsed.name : void 0,
|
|
59
|
+
description: typeof parsed.description === "string" ? parsed.description : void 0,
|
|
60
|
+
version: typeof parsed.version === "string" ? parsed.version : void 0,
|
|
61
|
+
providers: Array.isArray(parsed.providers) ? parsed.providers.filter((p) => typeof p === "string") : void 0,
|
|
62
|
+
channels: Array.isArray(parsed.channels) ? parsed.channels.filter((c) => typeof c === "string") : void 0
|
|
63
|
+
};
|
|
64
|
+
console.log("[OpenClawPlugin] Successfully loaded local manifest", {
|
|
65
|
+
manifestPath,
|
|
66
|
+
id: manifest.id,
|
|
67
|
+
name: manifest.name,
|
|
68
|
+
version: manifest.version,
|
|
69
|
+
providerCount: manifest.providers?.length ?? 0,
|
|
70
|
+
channelCount: manifest.channels?.length ?? 0
|
|
71
|
+
});
|
|
72
|
+
return manifest;
|
|
73
|
+
} catch (error) {
|
|
74
|
+
console.log("[OpenClawPlugin] Failed to parse manifest file", {
|
|
75
|
+
manifestPath,
|
|
76
|
+
error: error instanceof Error ? error.message : String(error)
|
|
77
|
+
});
|
|
78
|
+
return void 0;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
class OpenClawPlugin {
|
|
82
|
+
constructor() {
|
|
83
|
+
this.description = {
|
|
84
|
+
displayName: "OpenClaw Plugin",
|
|
85
|
+
name: "openClawPlugin",
|
|
86
|
+
icon: "file:openclaw-plugin.svg",
|
|
87
|
+
iconColor: "purple",
|
|
88
|
+
group: ["transform"],
|
|
89
|
+
version: 1,
|
|
90
|
+
description: "Provides plugin configuration to an OpenClaw AI Agent (local or ClawHub)",
|
|
91
|
+
defaults: {
|
|
92
|
+
name: "OpenClaw Plugin"
|
|
93
|
+
},
|
|
94
|
+
codex: {
|
|
95
|
+
alias: ["OpenClaw", "Plugin", "Extension", "ClawHub"],
|
|
96
|
+
categories: ["AI"],
|
|
97
|
+
subcategories: {
|
|
98
|
+
AI: ["Other"]
|
|
99
|
+
},
|
|
100
|
+
resources: {
|
|
101
|
+
primaryDocumentation: [
|
|
102
|
+
{
|
|
103
|
+
url: "https://docs.openclaw.ai/plugins"
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
inputs: [],
|
|
109
|
+
outputs: [import_n8n_workflow.NodeConnectionTypes.AiTool],
|
|
110
|
+
outputNames: ["Plugin"],
|
|
111
|
+
// No credentials needed — local plugins are filesystem-based, cloud uses public ClawHub
|
|
112
|
+
properties: [
|
|
113
|
+
{
|
|
114
|
+
displayName: "Connect this node to an OpenClaw AI Agent to provide plugin configuration. Local plugins are scanned from a directory; Cloud plugins are loaded from ClawHub.",
|
|
115
|
+
name: "pluginNotice",
|
|
116
|
+
type: "notice",
|
|
117
|
+
default: ""
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
displayName: "Plugin Source",
|
|
121
|
+
name: "pluginSource",
|
|
122
|
+
type: "options",
|
|
123
|
+
default: "local",
|
|
124
|
+
noDataExpression: true,
|
|
125
|
+
description: "Where to load the plugin from",
|
|
126
|
+
options: [
|
|
127
|
+
{
|
|
128
|
+
name: "Local",
|
|
129
|
+
value: "local",
|
|
130
|
+
description: "Scan a directory for openclaw.plugin.json and load plugin info from it"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "Cloud (ClawHub)",
|
|
134
|
+
value: "cloud",
|
|
135
|
+
description: "Load a plugin from the ClawHub marketplace"
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
// ── Local source fields ──
|
|
140
|
+
{
|
|
141
|
+
displayName: "Plugin Directory",
|
|
142
|
+
name: "pluginDirectory",
|
|
143
|
+
type: "string",
|
|
144
|
+
required: true,
|
|
145
|
+
default: "={{ $workspace.__dirPath }}",
|
|
146
|
+
description: "Directory path to scan for openclaw.plugin.json. Supports expressions like {{ $workspace.__dirPath }}.",
|
|
147
|
+
displayOptions: {
|
|
148
|
+
show: {
|
|
149
|
+
pluginSource: ["local"]
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
// ── Cloud source fields ──
|
|
154
|
+
{
|
|
155
|
+
displayName: "Plugin ID",
|
|
156
|
+
name: "pluginId",
|
|
157
|
+
type: "string",
|
|
158
|
+
required: true,
|
|
159
|
+
default: "",
|
|
160
|
+
placeholder: "e.g. openai, @scope/my-plugin",
|
|
161
|
+
description: "ClawHub plugin package name",
|
|
162
|
+
displayOptions: {
|
|
163
|
+
show: {
|
|
164
|
+
pluginSource: ["cloud"]
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
displayName: "Version",
|
|
170
|
+
name: "pluginVersion",
|
|
171
|
+
type: "string",
|
|
172
|
+
default: "",
|
|
173
|
+
placeholder: "latest",
|
|
174
|
+
description: "ClawHub plugin version. Leave empty to use the latest available version.",
|
|
175
|
+
displayOptions: {
|
|
176
|
+
show: {
|
|
177
|
+
pluginSource: ["cloud"]
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
async supplyData(itemIndex) {
|
|
185
|
+
const node = this.getNode();
|
|
186
|
+
console.log("[OpenClawPlugin] supplyData ENTRY", {
|
|
187
|
+
nodeName: node.name,
|
|
188
|
+
nodeId: node.id,
|
|
189
|
+
nodeType: node.type,
|
|
190
|
+
itemIndex,
|
|
191
|
+
parameterNames: Object.keys(node.parameters ?? {}),
|
|
192
|
+
rawParameters: JSON.stringify(node.parameters ?? {}).slice(0, 500)
|
|
193
|
+
});
|
|
194
|
+
const pluginSource = this.getNodeParameter("pluginSource", itemIndex, "local");
|
|
195
|
+
console.log("[OpenClawPlugin] supplyData called", {
|
|
196
|
+
itemIndex,
|
|
197
|
+
pluginSource
|
|
198
|
+
});
|
|
199
|
+
if (pluginSource === "local") {
|
|
200
|
+
const rawPluginDirectory = this.getNodeParameter("pluginDirectory", itemIndex, "");
|
|
201
|
+
const pluginDirectory = rawPluginDirectory.trim();
|
|
202
|
+
console.log("[OpenClawPlugin] Local source: scanning directory", {
|
|
203
|
+
itemIndex,
|
|
204
|
+
rawPluginDirectory,
|
|
205
|
+
pluginDirectory,
|
|
206
|
+
isEmpty: !pluginDirectory,
|
|
207
|
+
length: pluginDirectory.length
|
|
208
|
+
});
|
|
209
|
+
if (!pluginDirectory) {
|
|
210
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
211
|
+
this.getNode(),
|
|
212
|
+
"Plugin Directory must not be empty for local plugin source",
|
|
213
|
+
{ itemIndex }
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
const pluginManifest = loadLocalPluginManifest(pluginDirectory);
|
|
217
|
+
const pluginConfig2 = {
|
|
218
|
+
pluginSource: "local",
|
|
219
|
+
pluginPath: pluginDirectory,
|
|
220
|
+
pluginManifest
|
|
221
|
+
};
|
|
222
|
+
console.log("[OpenClawPlugin] Returning local plugin config", {
|
|
223
|
+
pluginPath: pluginConfig2.pluginPath,
|
|
224
|
+
hasManifest: !!pluginManifest,
|
|
225
|
+
manifestId: pluginManifest?.id,
|
|
226
|
+
manifestName: pluginManifest?.name,
|
|
227
|
+
manifestVersion: pluginManifest?.version
|
|
228
|
+
});
|
|
229
|
+
return { response: pluginConfig2 };
|
|
230
|
+
}
|
|
231
|
+
const pluginId = this.getNodeParameter("pluginId", itemIndex, "").trim();
|
|
232
|
+
const pluginVersion = this.getNodeParameter("pluginVersion", itemIndex, "").trim() || void 0;
|
|
233
|
+
console.log("[OpenClawPlugin] Cloud source: ClawHub plugin", {
|
|
234
|
+
itemIndex,
|
|
235
|
+
pluginId,
|
|
236
|
+
pluginVersion: pluginVersion ?? "(latest)"
|
|
237
|
+
});
|
|
238
|
+
if (!pluginId) {
|
|
239
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
240
|
+
this.getNode(),
|
|
241
|
+
"Plugin ID must not be empty for cloud plugin source",
|
|
242
|
+
{ itemIndex }
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
const pluginConfig = {
|
|
246
|
+
pluginSource: "cloud",
|
|
247
|
+
pluginId,
|
|
248
|
+
pluginVersion
|
|
249
|
+
};
|
|
250
|
+
console.log("[OpenClawPlugin] Returning cloud plugin config", {
|
|
251
|
+
pluginId: pluginConfig.pluginId,
|
|
252
|
+
pluginVersion: pluginConfig.pluginVersion ?? "(latest)"
|
|
253
|
+
});
|
|
254
|
+
return { response: pluginConfig };
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
258
|
+
0 && (module.exports = {
|
|
259
|
+
OpenClawPlugin
|
|
260
|
+
});
|
|
261
|
+
//# sourceMappingURL=OpenClawPlugin.node.js.map
|