@umimoney/clawdbot-relay-plugin 0.1.9 → 0.1.11
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 +2 -7
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +12 -5
- package/dist/index.mjs +12 -5
- 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.11",
|
|
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",
|
|
@@ -44,10 +44,5 @@
|
|
|
44
44
|
"apiKey": { "label": "API Key", "sensitive": true, "env": "UMI_API_KEY" },
|
|
45
45
|
"relayUrl": { "label": "Relay URL", "placeholder": "wss://ws.umi.app/ws/relay" }
|
|
46
46
|
},
|
|
47
|
-
"channels":
|
|
48
|
-
"umi": {
|
|
49
|
-
"name": "UMI",
|
|
50
|
-
"description": "Messages from UMI users"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
47
|
+
"channels": ["umi-relay"]
|
|
53
48
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -154,7 +154,12 @@ interface ChannelPlugin {
|
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
156
|
interface GatewayContext {
|
|
157
|
-
cfg: any
|
|
157
|
+
cfg: any & {
|
|
158
|
+
channels?: Record<string, any>;
|
|
159
|
+
};
|
|
160
|
+
account?: {
|
|
161
|
+
config?: any;
|
|
162
|
+
};
|
|
158
163
|
runtime: {
|
|
159
164
|
inbound: (msg: InboundMessage) => void;
|
|
160
165
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -154,7 +154,12 @@ interface ChannelPlugin {
|
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
156
|
interface GatewayContext {
|
|
157
|
-
cfg: any
|
|
157
|
+
cfg: any & {
|
|
158
|
+
channels?: Record<string, any>;
|
|
159
|
+
};
|
|
160
|
+
account?: {
|
|
161
|
+
config?: any;
|
|
162
|
+
};
|
|
158
163
|
runtime: {
|
|
159
164
|
inbound: (msg: InboundMessage) => void;
|
|
160
165
|
};
|
package/dist/index.js
CHANGED
|
@@ -315,13 +315,20 @@ var umiRelayChannel = {
|
|
|
315
315
|
},
|
|
316
316
|
gateway: {
|
|
317
317
|
startAccount: async (ctx) => {
|
|
318
|
+
console.log("[UmiRelay] ctx keys:", Object.keys(ctx));
|
|
319
|
+
console.log("[UmiRelay] ctx.account:", ctx.account);
|
|
320
|
+
console.log("[UmiRelay] ctx.cfg:", ctx.cfg);
|
|
321
|
+
console.log("[UmiRelay] ctx.cfg?.channels:", ctx.cfg?.channels);
|
|
322
|
+
console.log('[UmiRelay] ctx.cfg?.channels?.["umi-relay"]:', ctx.cfg?.channels?.["umi-relay"]);
|
|
323
|
+
const channelConfig = ctx.account?.config || ctx.cfg?.channels?.["umi-relay"] || ctx.cfg || {};
|
|
318
324
|
const config = {
|
|
319
|
-
apiKey:
|
|
320
|
-
relayUrl:
|
|
321
|
-
agentVersion:
|
|
322
|
-
capabilities:
|
|
323
|
-
autoReconnect:
|
|
325
|
+
apiKey: channelConfig.apiKey || process.env.UMI_API_KEY || "",
|
|
326
|
+
relayUrl: channelConfig.relayUrl || "wss://ws.umi.app/ws/relay",
|
|
327
|
+
agentVersion: channelConfig.agentVersion || "1.0.0",
|
|
328
|
+
capabilities: channelConfig.capabilities || ["chat"],
|
|
329
|
+
autoReconnect: channelConfig.autoReconnect ?? true
|
|
324
330
|
};
|
|
331
|
+
console.log("[UmiRelay] Resolved config:", { ...config, apiKey: config.apiKey ? "***" : "MISSING" });
|
|
325
332
|
if (!config.apiKey) {
|
|
326
333
|
console.error("[UmiRelay] No API key provided. Set UMI_API_KEY or pass apiKey in config.");
|
|
327
334
|
return { stop: () => {
|
package/dist/index.mjs
CHANGED
|
@@ -280,13 +280,20 @@ var umiRelayChannel = {
|
|
|
280
280
|
},
|
|
281
281
|
gateway: {
|
|
282
282
|
startAccount: async (ctx) => {
|
|
283
|
+
console.log("[UmiRelay] ctx keys:", Object.keys(ctx));
|
|
284
|
+
console.log("[UmiRelay] ctx.account:", ctx.account);
|
|
285
|
+
console.log("[UmiRelay] ctx.cfg:", ctx.cfg);
|
|
286
|
+
console.log("[UmiRelay] ctx.cfg?.channels:", ctx.cfg?.channels);
|
|
287
|
+
console.log('[UmiRelay] ctx.cfg?.channels?.["umi-relay"]:', ctx.cfg?.channels?.["umi-relay"]);
|
|
288
|
+
const channelConfig = ctx.account?.config || ctx.cfg?.channels?.["umi-relay"] || ctx.cfg || {};
|
|
283
289
|
const config = {
|
|
284
|
-
apiKey:
|
|
285
|
-
relayUrl:
|
|
286
|
-
agentVersion:
|
|
287
|
-
capabilities:
|
|
288
|
-
autoReconnect:
|
|
290
|
+
apiKey: channelConfig.apiKey || process.env.UMI_API_KEY || "",
|
|
291
|
+
relayUrl: channelConfig.relayUrl || "wss://ws.umi.app/ws/relay",
|
|
292
|
+
agentVersion: channelConfig.agentVersion || "1.0.0",
|
|
293
|
+
capabilities: channelConfig.capabilities || ["chat"],
|
|
294
|
+
autoReconnect: channelConfig.autoReconnect ?? true
|
|
289
295
|
};
|
|
296
|
+
console.log("[UmiRelay] Resolved config:", { ...config, apiKey: config.apiKey ? "***" : "MISSING" });
|
|
290
297
|
if (!config.apiKey) {
|
|
291
298
|
console.error("[UmiRelay] No API key provided. Set UMI_API_KEY or pass apiKey in config.");
|
|
292
299
|
return { stop: () => {
|