openclaw-elys 1.8.2 → 1.8.4

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.
@@ -39,17 +39,17 @@ export async function monitorElysProvider(opts) {
39
39
  const finalizeCtx = core?.channel?.reply?.finalizeInboundContext;
40
40
  log(`[elys] pluginRuntime available: ${!!core}, dispatchReplyFromConfig: ${!!dispatchReplyFromConfig}, createDispatcher: ${!!createDispatcher}, finalizeCtx: ${!!finalizeCtx}`);
41
41
  const commandHandler = async (cmd, signal) => {
42
- log(`[elys] executing command: ${cmd.command}`, cmd.args);
42
+ log(`[elys] executing command: ${cmd.command}`, cmd.args, `media_url=${cmd.media_url ?? "none"}`, `media_urls=${JSON.stringify(cmd.media_urls ?? [])}`);
43
43
  if (dispatchReplyFromConfig && finalizeCtx && createDispatcher) {
44
44
  try {
45
45
  let seq = 0;
46
46
  let fullText = "";
47
47
  // Download inbound media (user-sent) to local temp files
48
48
  // OpenClaw expects local file paths in MediaPath/MediaUrl, not remote URLs
49
- const rawMediaUrls = cmd.mediaUrls?.length
50
- ? cmd.mediaUrls
51
- : cmd.mediaUrl
52
- ? [cmd.mediaUrl]
49
+ const rawMediaUrls = cmd.media_urls?.length
50
+ ? cmd.media_urls
51
+ : cmd.media_url
52
+ ? [cmd.media_url]
53
53
  : [];
54
54
  const downloadedPaths = [];
55
55
  const downloadedTypes = [];
@@ -57,7 +57,7 @@ export async function monitorElysProvider(opts) {
57
57
  try {
58
58
  const localPath = await downloadToTemp(url, log);
59
59
  downloadedPaths.push(localPath);
60
- downloadedTypes.push(cmd.mediaType ?? guessMediaType(url));
60
+ downloadedTypes.push(cmd.media_type ?? guessMediaType(url));
61
61
  }
62
62
  catch (err) {
63
63
  log(`[elys] failed to download media ${url}:`, err);
@@ -133,9 +133,9 @@ export class ElysDeviceMQTTClient {
133
133
  done,
134
134
  };
135
135
  if (media?.mediaUrl)
136
- msg.mediaUrl = media.mediaUrl;
136
+ msg.media_url = media.mediaUrl;
137
137
  if (media?.mediaUrls?.length)
138
- msg.mediaUrls = media.mediaUrls;
138
+ msg.media_urls = media.mediaUrls;
139
139
  this.publish(msg);
140
140
  }
141
141
  // ─── Inbound message pipeline: dedup → ack → debounce → abort → execute ───
@@ -219,11 +219,11 @@ export class ElysDeviceMQTTClient {
219
219
  // Collect all media URLs from all commands
220
220
  const allMediaUrls = [];
221
221
  for (const c of cmds) {
222
- if (c.mediaUrls?.length) {
223
- allMediaUrls.push(...c.mediaUrls);
222
+ if (c.media_urls?.length) {
223
+ allMediaUrls.push(...c.media_urls);
224
224
  }
225
- else if (c.mediaUrl) {
226
- allMediaUrls.push(c.mediaUrl);
225
+ else if (c.media_url) {
226
+ allMediaUrls.push(c.media_url);
227
227
  }
228
228
  }
229
229
  const mergedText = texts.length > 1 ? texts.join("\n") : texts[0] ?? "";
@@ -232,9 +232,9 @@ export class ElysDeviceMQTTClient {
232
232
  return {
233
233
  ...last,
234
234
  args: { ...last.args, ...(mergedText && { text: mergedText }) },
235
- mediaUrl: allMediaUrls[0] ?? last.mediaUrl,
236
- mediaUrls: allMediaUrls.length > 0 ? allMediaUrls : undefined,
237
- mediaType: last.mediaType,
235
+ media_url: allMediaUrls[0] ?? last.media_url,
236
+ media_urls: allMediaUrls.length > 0 ? allMediaUrls : undefined,
237
+ media_type: last.media_type,
238
238
  };
239
239
  }
240
240
  // Can't merge non-text commands, use the latest one
@@ -25,9 +25,9 @@ export interface CommandMessage extends MQTTBaseMessage {
25
25
  command: string;
26
26
  args?: Record<string, unknown>;
27
27
  stream?: boolean;
28
- mediaUrl?: string;
29
- mediaUrls?: string[];
30
- mediaType?: string;
28
+ media_url?: string;
29
+ media_urls?: string[];
30
+ media_type?: string;
31
31
  }
32
32
  export interface AckMessage extends MQTTBaseMessage {
33
33
  type: "ack";
@@ -37,14 +37,14 @@ export interface StreamMessage extends MQTTBaseMessage {
37
37
  chunk: string;
38
38
  done: boolean;
39
39
  seq: number;
40
- mediaUrl?: string;
41
- mediaUrls?: string[];
40
+ media_url?: string;
41
+ media_urls?: string[];
42
42
  }
43
43
  export interface ResultMessage extends MQTTBaseMessage {
44
44
  type: "result";
45
45
  status: "success" | "error";
46
46
  result?: Record<string, unknown>;
47
47
  error?: string;
48
- mediaUrl?: string;
49
- mediaUrls?: string[];
48
+ media_url?: string;
49
+ media_urls?: string[];
50
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-elys",
3
- "version": "1.8.2",
3
+ "version": "1.8.4",
4
4
  "description": "OpenClaw Elys channel plugin — connects to Elys App",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",