openclaw-elys 1.8.1 → 1.8.2

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.
@@ -45,7 +45,7 @@ export declare class ElysDeviceMQTTClient {
45
45
  private flushDebounce;
46
46
  private startCommand;
47
47
  private processPendingCommands;
48
- /** Merge multiple buffered commands into one. Joins text args with newline. */
48
+ /** Merge multiple buffered commands into one. Joins text args with newline, collects all media. */
49
49
  private mergeCommands;
50
50
  private executeCommand;
51
51
  private cleanupDedup;
@@ -208,7 +208,7 @@ export class ElysDeviceMQTTClient {
208
208
  this.log(`[elys] processing queued command ${merged.id}`);
209
209
  this.startCommand(merged);
210
210
  }
211
- /** Merge multiple buffered commands into one. Joins text args with newline. */
211
+ /** Merge multiple buffered commands into one. Joins text args with newline, collects all media. */
212
212
  mergeCommands(cmds) {
213
213
  if (cmds.length === 1)
214
214
  return cmds[0];
@@ -216,11 +216,25 @@ export class ElysDeviceMQTTClient {
216
216
  const texts = cmds
217
217
  .map((c) => c.args?.text ?? "")
218
218
  .filter(Boolean);
219
- if (texts.length > 1) {
220
- this.log(`[elys] debounce: merged ${cmds.length} commands`);
219
+ // Collect all media URLs from all commands
220
+ const allMediaUrls = [];
221
+ for (const c of cmds) {
222
+ if (c.mediaUrls?.length) {
223
+ allMediaUrls.push(...c.mediaUrls);
224
+ }
225
+ else if (c.mediaUrl) {
226
+ allMediaUrls.push(c.mediaUrl);
227
+ }
228
+ }
229
+ const mergedText = texts.length > 1 ? texts.join("\n") : texts[0] ?? "";
230
+ if (texts.length > 1 || allMediaUrls.length > 0) {
231
+ this.log(`[elys] debounce: merged ${cmds.length} commands (${texts.length} texts, ${allMediaUrls.length} media)`);
221
232
  return {
222
233
  ...last,
223
- args: { ...last.args, text: texts.join("\n") },
234
+ args: { ...last.args, ...(mergedText && { text: mergedText }) },
235
+ mediaUrl: allMediaUrls[0] ?? last.mediaUrl,
236
+ mediaUrls: allMediaUrls.length > 0 ? allMediaUrls : undefined,
237
+ mediaType: last.mediaType,
224
238
  };
225
239
  }
226
240
  // Can't merge non-text commands, use the latest one
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-elys",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "OpenClaw Elys channel plugin — connects to Elys App",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",