@umimoney/clawdbot-relay-plugin 0.1.15 → 0.1.17
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 +1 -1
- package/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +15 -4
- package/dist/index.mjs +15 -4
- 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.17",
|
|
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",
|
package/dist/index.d.mts
CHANGED
|
@@ -103,7 +103,14 @@ interface PluginRuntime {
|
|
|
103
103
|
ctx: {
|
|
104
104
|
channel: string;
|
|
105
105
|
From: string;
|
|
106
|
-
|
|
106
|
+
To?: string;
|
|
107
|
+
Body?: string;
|
|
108
|
+
BodyForAgent?: string;
|
|
109
|
+
RawBody?: string;
|
|
110
|
+
CommandBody?: string;
|
|
111
|
+
Text?: string;
|
|
112
|
+
SessionKey?: string;
|
|
113
|
+
AccountId?: string;
|
|
107
114
|
accountId?: string;
|
|
108
115
|
ts?: number;
|
|
109
116
|
metadata?: Record<string, any>;
|
package/dist/index.d.ts
CHANGED
|
@@ -103,7 +103,14 @@ interface PluginRuntime {
|
|
|
103
103
|
ctx: {
|
|
104
104
|
channel: string;
|
|
105
105
|
From: string;
|
|
106
|
-
|
|
106
|
+
To?: string;
|
|
107
|
+
Body?: string;
|
|
108
|
+
BodyForAgent?: string;
|
|
109
|
+
RawBody?: string;
|
|
110
|
+
CommandBody?: string;
|
|
111
|
+
Text?: string;
|
|
112
|
+
SessionKey?: string;
|
|
113
|
+
AccountId?: string;
|
|
107
114
|
accountId?: string;
|
|
108
115
|
ts?: number;
|
|
109
116
|
metadata?: Record<string, any>;
|
package/dist/index.js
CHANGED
|
@@ -341,16 +341,27 @@ var umiRelayChannel = {
|
|
|
341
341
|
relayClient = new UmiRelayClient(config);
|
|
342
342
|
relayClient.onMessage((message) => {
|
|
343
343
|
if (message.type === "platform:message") {
|
|
344
|
-
const userId = message.userId || "unknown";
|
|
345
|
-
console.log("[UmiRelay] Dispatching message to Clawdbot:", message.content);
|
|
344
|
+
const userId = String(message.userId || message.senderId || "unknown");
|
|
345
|
+
console.log("[UmiRelay] Dispatching message to Clawdbot:", message.content, "from:", userId);
|
|
346
346
|
try {
|
|
347
347
|
const runtime = getPluginRuntime();
|
|
348
|
+
const content = String(message.content || "");
|
|
349
|
+
const sessionKey = `umi-relay:default:${userId}`;
|
|
348
350
|
runtime.channel.reply.dispatchReplyWithBufferedBlockDispatcher({
|
|
349
351
|
ctx: {
|
|
350
352
|
channel: "umi-relay",
|
|
351
353
|
From: userId,
|
|
352
|
-
|
|
353
|
-
|
|
354
|
+
// Must be string
|
|
355
|
+
To: "umi-relay:default",
|
|
356
|
+
Body: content,
|
|
357
|
+
// REQUIRED - agent reads this
|
|
358
|
+
BodyForAgent: content,
|
|
359
|
+
// REQUIRED - agent reads this
|
|
360
|
+
RawBody: content,
|
|
361
|
+
CommandBody: content,
|
|
362
|
+
Text: content,
|
|
363
|
+
SessionKey: sessionKey,
|
|
364
|
+
AccountId: "default",
|
|
354
365
|
ts: message.timestamp,
|
|
355
366
|
metadata: {
|
|
356
367
|
userId: message.userId,
|
package/dist/index.mjs
CHANGED
|
@@ -306,16 +306,27 @@ var umiRelayChannel = {
|
|
|
306
306
|
relayClient = new UmiRelayClient(config);
|
|
307
307
|
relayClient.onMessage((message) => {
|
|
308
308
|
if (message.type === "platform:message") {
|
|
309
|
-
const userId = message.userId || "unknown";
|
|
310
|
-
console.log("[UmiRelay] Dispatching message to Clawdbot:", message.content);
|
|
309
|
+
const userId = String(message.userId || message.senderId || "unknown");
|
|
310
|
+
console.log("[UmiRelay] Dispatching message to Clawdbot:", message.content, "from:", userId);
|
|
311
311
|
try {
|
|
312
312
|
const runtime = getPluginRuntime();
|
|
313
|
+
const content = String(message.content || "");
|
|
314
|
+
const sessionKey = `umi-relay:default:${userId}`;
|
|
313
315
|
runtime.channel.reply.dispatchReplyWithBufferedBlockDispatcher({
|
|
314
316
|
ctx: {
|
|
315
317
|
channel: "umi-relay",
|
|
316
318
|
From: userId,
|
|
317
|
-
|
|
318
|
-
|
|
319
|
+
// Must be string
|
|
320
|
+
To: "umi-relay:default",
|
|
321
|
+
Body: content,
|
|
322
|
+
// REQUIRED - agent reads this
|
|
323
|
+
BodyForAgent: content,
|
|
324
|
+
// REQUIRED - agent reads this
|
|
325
|
+
RawBody: content,
|
|
326
|
+
CommandBody: content,
|
|
327
|
+
Text: content,
|
|
328
|
+
SessionKey: sessionKey,
|
|
329
|
+
AccountId: "default",
|
|
319
330
|
ts: message.timestamp,
|
|
320
331
|
metadata: {
|
|
321
332
|
userId: message.userId,
|