@umimoney/clawdbot-relay-plugin 0.1.11 → 0.1.13

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.
@@ -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.11",
5
+ "version": "0.1.13",
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",
@@ -11,7 +11,6 @@
11
11
  "configSchema": {
12
12
  "type": "object",
13
13
  "additionalProperties": false,
14
- "required": ["apiKey"],
15
14
  "properties": {
16
15
  "apiKey": {
17
16
  "type": "string",
package/dist/index.d.mts CHANGED
@@ -161,16 +161,32 @@ interface GatewayContext {
161
161
  config?: any;
162
162
  };
163
163
  runtime: {
164
- inbound: (msg: InboundMessage) => void;
164
+ channel: {
165
+ reply: {
166
+ dispatchReplyWithBufferedBlockDispatcher: (opts: {
167
+ ctx: {
168
+ channel: string;
169
+ From: string;
170
+ Text: string;
171
+ accountId?: string;
172
+ ts?: number;
173
+ metadata?: Record<string, any>;
174
+ };
175
+ cfg: any;
176
+ dispatcherOptions: {
177
+ deliver: (payload: {
178
+ text: string;
179
+ metadata?: any;
180
+ }) => Promise<void>;
181
+ };
182
+ }) => void;
183
+ };
184
+ routing: {
185
+ resolveAgentRoute: (opts: any) => any;
186
+ };
187
+ };
165
188
  };
166
189
  }
167
- interface InboundMessage {
168
- channel: string;
169
- from: string;
170
- text: string;
171
- ts?: number;
172
- metadata?: Record<string, any>;
173
- }
174
190
  declare const _default: {
175
191
  id: string;
176
192
  register(api: ClawdbotPluginApi): void;
package/dist/index.d.ts CHANGED
@@ -161,16 +161,32 @@ interface GatewayContext {
161
161
  config?: any;
162
162
  };
163
163
  runtime: {
164
- inbound: (msg: InboundMessage) => void;
164
+ channel: {
165
+ reply: {
166
+ dispatchReplyWithBufferedBlockDispatcher: (opts: {
167
+ ctx: {
168
+ channel: string;
169
+ From: string;
170
+ Text: string;
171
+ accountId?: string;
172
+ ts?: number;
173
+ metadata?: Record<string, any>;
174
+ };
175
+ cfg: any;
176
+ dispatcherOptions: {
177
+ deliver: (payload: {
178
+ text: string;
179
+ metadata?: any;
180
+ }) => Promise<void>;
181
+ };
182
+ }) => void;
183
+ };
184
+ routing: {
185
+ resolveAgentRoute: (opts: any) => any;
186
+ };
187
+ };
165
188
  };
166
189
  }
167
- interface InboundMessage {
168
- channel: string;
169
- from: string;
170
- text: string;
171
- ts?: number;
172
- metadata?: Record<string, any>;
173
- }
174
190
  declare const _default: {
175
191
  id: string;
176
192
  register(api: ClawdbotPluginApi): void;
package/dist/index.js CHANGED
@@ -337,14 +337,28 @@ var umiRelayChannel = {
337
337
  relayClient = new UmiRelayClient(config);
338
338
  relayClient.onMessage((message) => {
339
339
  if (message.type === "platform:message") {
340
- ctx.runtime.inbound({
341
- channel: "umi-relay",
342
- from: message.userId || "unknown",
343
- text: message.content,
344
- ts: message.timestamp,
345
- metadata: {
346
- userId: message.userId,
347
- agentId: message.agentId
340
+ const userId = message.userId || "unknown";
341
+ console.log("[UmiRelay] Dispatching message to Clawdbot:", message.content);
342
+ ctx.runtime.channel.reply.dispatchReplyWithBufferedBlockDispatcher({
343
+ ctx: {
344
+ channel: "umi-relay",
345
+ From: userId,
346
+ Text: message.content,
347
+ accountId: "default",
348
+ ts: message.timestamp,
349
+ metadata: {
350
+ userId: message.userId,
351
+ agentId: message.agentId
352
+ }
353
+ },
354
+ cfg: ctx.cfg,
355
+ dispatcherOptions: {
356
+ deliver: async (payload) => {
357
+ console.log("[UmiRelay] Delivering response back to UMI:", payload.text?.substring(0, 50) + "...");
358
+ if (relayClient?.isConnected) {
359
+ relayClient.sendMessage(payload.text, { to: userId });
360
+ }
361
+ }
348
362
  }
349
363
  });
350
364
  }
package/dist/index.mjs CHANGED
@@ -302,14 +302,28 @@ var umiRelayChannel = {
302
302
  relayClient = new UmiRelayClient(config);
303
303
  relayClient.onMessage((message) => {
304
304
  if (message.type === "platform:message") {
305
- ctx.runtime.inbound({
306
- channel: "umi-relay",
307
- from: message.userId || "unknown",
308
- text: message.content,
309
- ts: message.timestamp,
310
- metadata: {
311
- userId: message.userId,
312
- agentId: message.agentId
305
+ const userId = message.userId || "unknown";
306
+ console.log("[UmiRelay] Dispatching message to Clawdbot:", message.content);
307
+ ctx.runtime.channel.reply.dispatchReplyWithBufferedBlockDispatcher({
308
+ ctx: {
309
+ channel: "umi-relay",
310
+ From: userId,
311
+ Text: message.content,
312
+ accountId: "default",
313
+ ts: message.timestamp,
314
+ metadata: {
315
+ userId: message.userId,
316
+ agentId: message.agentId
317
+ }
318
+ },
319
+ cfg: ctx.cfg,
320
+ dispatcherOptions: {
321
+ deliver: async (payload) => {
322
+ console.log("[UmiRelay] Delivering response back to UMI:", payload.text?.substring(0, 50) + "...");
323
+ if (relayClient?.isConnected) {
324
+ relayClient.sendMessage(payload.text, { to: userId });
325
+ }
326
+ }
313
327
  }
314
328
  });
315
329
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umimoney/clawdbot-relay-plugin",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Clawdbot plugin for connecting to UMI relay server",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",