@umimoney/clawdbot-relay-plugin 0.1.14 → 0.1.15
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/clawdbot.plugin.json +3 -33
- package/dist/index.js +9 -13
- package/dist/index.mjs +9 -13
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://clawdbot.dev/schemas/plugin.json",
|
|
3
3
|
"id": "umi-relay",
|
|
4
4
|
"name": "UMI Relay",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.15",
|
|
6
6
|
"description": "Connect to UMI relay server for real-time chat visibility in UMI web UI",
|
|
7
7
|
"type": "channel",
|
|
8
8
|
"main": "index.js",
|
|
@@ -10,38 +10,8 @@
|
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"configSchema": {
|
|
12
12
|
"type": "object",
|
|
13
|
-
"additionalProperties":
|
|
14
|
-
"properties": {
|
|
15
|
-
"apiKey": {
|
|
16
|
-
"type": "string",
|
|
17
|
-
"description": "UMI API key (starts with umi_)"
|
|
18
|
-
},
|
|
19
|
-
"relayUrl": {
|
|
20
|
-
"type": "string",
|
|
21
|
-
"default": "wss://ws.umi.app/ws/relay",
|
|
22
|
-
"description": "UMI relay server URL"
|
|
23
|
-
},
|
|
24
|
-
"agentVersion": {
|
|
25
|
-
"type": "string",
|
|
26
|
-
"default": "1.0.0",
|
|
27
|
-
"description": "Agent version string"
|
|
28
|
-
},
|
|
29
|
-
"capabilities": {
|
|
30
|
-
"type": "array",
|
|
31
|
-
"items": { "type": "string" },
|
|
32
|
-
"default": ["chat"],
|
|
33
|
-
"description": "Agent capabilities"
|
|
34
|
-
},
|
|
35
|
-
"autoReconnect": {
|
|
36
|
-
"type": "boolean",
|
|
37
|
-
"default": true,
|
|
38
|
-
"description": "Reconnect on disconnect"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"uiHints": {
|
|
43
|
-
"apiKey": { "label": "API Key", "sensitive": true, "env": "UMI_API_KEY" },
|
|
44
|
-
"relayUrl": { "label": "Relay URL", "placeholder": "wss://ws.umi.app/ws/relay" }
|
|
13
|
+
"additionalProperties": true,
|
|
14
|
+
"properties": {}
|
|
45
15
|
},
|
|
46
16
|
"channels": ["umi-relay"]
|
|
47
17
|
}
|
package/dist/index.js
CHANGED
|
@@ -290,10 +290,11 @@ var umiRelayChannel = {
|
|
|
290
290
|
chatTypes: ["direct"],
|
|
291
291
|
media: false
|
|
292
292
|
},
|
|
293
|
+
// Empty plugin config - all config comes from channel (channels.umi-relay)
|
|
293
294
|
configSchema: {
|
|
294
295
|
type: "object",
|
|
295
296
|
properties: {},
|
|
296
|
-
additionalProperties:
|
|
297
|
+
additionalProperties: true
|
|
297
298
|
},
|
|
298
299
|
config: {
|
|
299
300
|
listAccountIds: () => ["default"],
|
|
@@ -323,20 +324,15 @@ var umiRelayChannel = {
|
|
|
323
324
|
},
|
|
324
325
|
gateway: {
|
|
325
326
|
startAccount: async (ctx) => {
|
|
326
|
-
|
|
327
|
-
console.log("[UmiRelay] ctx.account:", ctx.account);
|
|
328
|
-
console.log("[UmiRelay] ctx.cfg:", ctx.cfg);
|
|
329
|
-
console.log("[UmiRelay] ctx.cfg?.channels:", ctx.cfg?.channels);
|
|
330
|
-
console.log('[UmiRelay] ctx.cfg?.channels?.["umi-relay"]:', ctx.cfg?.channels?.["umi-relay"]);
|
|
331
|
-
const channelConfig = ctx.account?.config || ctx.cfg?.channels?.["umi-relay"] || ctx.cfg || {};
|
|
327
|
+
const account = ctx.account || {};
|
|
332
328
|
const config = {
|
|
333
|
-
apiKey:
|
|
334
|
-
relayUrl:
|
|
335
|
-
agentVersion:
|
|
336
|
-
capabilities:
|
|
337
|
-
autoReconnect:
|
|
329
|
+
apiKey: account.apiKey || account.config?.apiKey || process.env.UMI_API_KEY || "",
|
|
330
|
+
relayUrl: account.relayUrl || account.config?.relayUrl || "wss://ws.umi.app/ws/relay",
|
|
331
|
+
agentVersion: account.agentVersion || account.config?.agentVersion || "1.0.0",
|
|
332
|
+
capabilities: account.capabilities || account.config?.capabilities || ["chat"],
|
|
333
|
+
autoReconnect: account.autoReconnect ?? account.config?.autoReconnect ?? true
|
|
338
334
|
};
|
|
339
|
-
console.log("[UmiRelay]
|
|
335
|
+
console.log("[UmiRelay] Config from channel:", { ...config, apiKey: config.apiKey ? "***" : "MISSING" });
|
|
340
336
|
if (!config.apiKey) {
|
|
341
337
|
console.error("[UmiRelay] No API key provided. Set UMI_API_KEY or pass apiKey in config.");
|
|
342
338
|
return { stop: () => {
|
package/dist/index.mjs
CHANGED
|
@@ -255,10 +255,11 @@ var umiRelayChannel = {
|
|
|
255
255
|
chatTypes: ["direct"],
|
|
256
256
|
media: false
|
|
257
257
|
},
|
|
258
|
+
// Empty plugin config - all config comes from channel (channels.umi-relay)
|
|
258
259
|
configSchema: {
|
|
259
260
|
type: "object",
|
|
260
261
|
properties: {},
|
|
261
|
-
additionalProperties:
|
|
262
|
+
additionalProperties: true
|
|
262
263
|
},
|
|
263
264
|
config: {
|
|
264
265
|
listAccountIds: () => ["default"],
|
|
@@ -288,20 +289,15 @@ var umiRelayChannel = {
|
|
|
288
289
|
},
|
|
289
290
|
gateway: {
|
|
290
291
|
startAccount: async (ctx) => {
|
|
291
|
-
|
|
292
|
-
console.log("[UmiRelay] ctx.account:", ctx.account);
|
|
293
|
-
console.log("[UmiRelay] ctx.cfg:", ctx.cfg);
|
|
294
|
-
console.log("[UmiRelay] ctx.cfg?.channels:", ctx.cfg?.channels);
|
|
295
|
-
console.log('[UmiRelay] ctx.cfg?.channels?.["umi-relay"]:', ctx.cfg?.channels?.["umi-relay"]);
|
|
296
|
-
const channelConfig = ctx.account?.config || ctx.cfg?.channels?.["umi-relay"] || ctx.cfg || {};
|
|
292
|
+
const account = ctx.account || {};
|
|
297
293
|
const config = {
|
|
298
|
-
apiKey:
|
|
299
|
-
relayUrl:
|
|
300
|
-
agentVersion:
|
|
301
|
-
capabilities:
|
|
302
|
-
autoReconnect:
|
|
294
|
+
apiKey: account.apiKey || account.config?.apiKey || process.env.UMI_API_KEY || "",
|
|
295
|
+
relayUrl: account.relayUrl || account.config?.relayUrl || "wss://ws.umi.app/ws/relay",
|
|
296
|
+
agentVersion: account.agentVersion || account.config?.agentVersion || "1.0.0",
|
|
297
|
+
capabilities: account.capabilities || account.config?.capabilities || ["chat"],
|
|
298
|
+
autoReconnect: account.autoReconnect ?? account.config?.autoReconnect ?? true
|
|
303
299
|
};
|
|
304
|
-
console.log("[UmiRelay]
|
|
300
|
+
console.log("[UmiRelay] Config from channel:", { ...config, apiKey: config.apiKey ? "***" : "MISSING" });
|
|
305
301
|
if (!config.apiKey) {
|
|
306
302
|
console.error("[UmiRelay] No API key provided. Set UMI_API_KEY or pass apiKey in config.");
|
|
307
303
|
return { stop: () => {
|