openclaw-elys 1.8.2 → 1.8.3
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/src/monitor.js +5 -5
- package/dist/src/mqtt-client.js +9 -9
- package/dist/src/types.d.ts +7 -7
- package/package.json +1 -1
package/dist/src/monitor.js
CHANGED
|
@@ -46,10 +46,10 @@ export async function monitorElysProvider(opts) {
|
|
|
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.
|
|
50
|
-
? cmd.
|
|
51
|
-
: cmd.
|
|
52
|
-
? [cmd.
|
|
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.
|
|
60
|
+
downloadedTypes.push(cmd.media_type ?? guessMediaType(url));
|
|
61
61
|
}
|
|
62
62
|
catch (err) {
|
|
63
63
|
log(`[elys] failed to download media ${url}:`, err);
|
package/dist/src/mqtt-client.js
CHANGED
|
@@ -133,9 +133,9 @@ export class ElysDeviceMQTTClient {
|
|
|
133
133
|
done,
|
|
134
134
|
};
|
|
135
135
|
if (media?.mediaUrl)
|
|
136
|
-
msg.
|
|
136
|
+
msg.media_url = media.mediaUrl;
|
|
137
137
|
if (media?.mediaUrls?.length)
|
|
138
|
-
msg.
|
|
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.
|
|
223
|
-
allMediaUrls.push(...c.
|
|
222
|
+
if (c.media_urls?.length) {
|
|
223
|
+
allMediaUrls.push(...c.media_urls);
|
|
224
224
|
}
|
|
225
|
-
else if (c.
|
|
226
|
-
allMediaUrls.push(c.
|
|
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
|
-
|
|
236
|
-
|
|
237
|
-
|
|
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
|
package/dist/src/types.d.ts
CHANGED
|
@@ -25,9 +25,9 @@ export interface CommandMessage extends MQTTBaseMessage {
|
|
|
25
25
|
command: string;
|
|
26
26
|
args?: Record<string, unknown>;
|
|
27
27
|
stream?: boolean;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
41
|
-
|
|
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
|
-
|
|
49
|
-
|
|
48
|
+
media_url?: string;
|
|
49
|
+
media_urls?: string[];
|
|
50
50
|
}
|