@umimoney/clawdbot-relay-plugin 0.1.21 → 0.1.22
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/index.js +12 -3
- package/dist/index.mjs +12 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -292,7 +292,7 @@ var umiRelayChannel = {
|
|
|
292
292
|
},
|
|
293
293
|
capabilities: {
|
|
294
294
|
chatTypes: ["direct"],
|
|
295
|
-
media:
|
|
295
|
+
media: true
|
|
296
296
|
},
|
|
297
297
|
// Empty plugin config - all config comes from channel (channels.umi-relay)
|
|
298
298
|
configSchema: {
|
|
@@ -354,11 +354,18 @@ var umiRelayChannel = {
|
|
|
354
354
|
relayClient.onMessage((message) => {
|
|
355
355
|
if (message.type === "platform:message") {
|
|
356
356
|
const userId = String(message.userId || message.senderId || "unknown");
|
|
357
|
-
|
|
357
|
+
const attachments = message.attachments || [];
|
|
358
|
+
console.log("[UmiRelay] Dispatching message to Clawdbot:", message.content, "from:", userId, "attachments:", attachments.length);
|
|
358
359
|
try {
|
|
359
360
|
const runtime = getPluginRuntime();
|
|
360
361
|
const content = String(message.content || "");
|
|
361
362
|
const sessionKey = `umi-relay:default:${userId}`;
|
|
363
|
+
const media = attachments.filter((att) => att.base64 && att.type === "image").map((att) => ({
|
|
364
|
+
type: "image",
|
|
365
|
+
mimeType: att.mimeType || "image/png",
|
|
366
|
+
data: att.base64,
|
|
367
|
+
name: att.name
|
|
368
|
+
}));
|
|
362
369
|
runtime.channel.reply.dispatchReplyWithBufferedBlockDispatcher({
|
|
363
370
|
ctx: {
|
|
364
371
|
channel: "umi-relay",
|
|
@@ -377,7 +384,9 @@ var umiRelayChannel = {
|
|
|
377
384
|
ts: message.timestamp,
|
|
378
385
|
metadata: {
|
|
379
386
|
userId: message.userId,
|
|
380
|
-
agentId: message.agentId
|
|
387
|
+
agentId: message.agentId,
|
|
388
|
+
attachments,
|
|
389
|
+
media: media.length > 0 ? media : void 0
|
|
381
390
|
}
|
|
382
391
|
},
|
|
383
392
|
cfg: ctx.cfg,
|
package/dist/index.mjs
CHANGED
|
@@ -257,7 +257,7 @@ var umiRelayChannel = {
|
|
|
257
257
|
},
|
|
258
258
|
capabilities: {
|
|
259
259
|
chatTypes: ["direct"],
|
|
260
|
-
media:
|
|
260
|
+
media: true
|
|
261
261
|
},
|
|
262
262
|
// Empty plugin config - all config comes from channel (channels.umi-relay)
|
|
263
263
|
configSchema: {
|
|
@@ -319,11 +319,18 @@ var umiRelayChannel = {
|
|
|
319
319
|
relayClient.onMessage((message) => {
|
|
320
320
|
if (message.type === "platform:message") {
|
|
321
321
|
const userId = String(message.userId || message.senderId || "unknown");
|
|
322
|
-
|
|
322
|
+
const attachments = message.attachments || [];
|
|
323
|
+
console.log("[UmiRelay] Dispatching message to Clawdbot:", message.content, "from:", userId, "attachments:", attachments.length);
|
|
323
324
|
try {
|
|
324
325
|
const runtime = getPluginRuntime();
|
|
325
326
|
const content = String(message.content || "");
|
|
326
327
|
const sessionKey = `umi-relay:default:${userId}`;
|
|
328
|
+
const media = attachments.filter((att) => att.base64 && att.type === "image").map((att) => ({
|
|
329
|
+
type: "image",
|
|
330
|
+
mimeType: att.mimeType || "image/png",
|
|
331
|
+
data: att.base64,
|
|
332
|
+
name: att.name
|
|
333
|
+
}));
|
|
327
334
|
runtime.channel.reply.dispatchReplyWithBufferedBlockDispatcher({
|
|
328
335
|
ctx: {
|
|
329
336
|
channel: "umi-relay",
|
|
@@ -342,7 +349,9 @@ var umiRelayChannel = {
|
|
|
342
349
|
ts: message.timestamp,
|
|
343
350
|
metadata: {
|
|
344
351
|
userId: message.userId,
|
|
345
|
-
agentId: message.agentId
|
|
352
|
+
agentId: message.agentId,
|
|
353
|
+
attachments,
|
|
354
|
+
media: media.length > 0 ? media : void 0
|
|
346
355
|
}
|
|
347
356
|
},
|
|
348
357
|
cfg: ctx.cfg,
|