@openclaw/zalouser 2026.2.22 → 2026.2.23
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/package.json +1 -1
- package/src/monitor.ts +26 -25
package/package.json
CHANGED
package/src/monitor.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import type { ChildProcess } from "node:child_process";
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
MarkdownTableMode,
|
|
4
|
+
OpenClawConfig,
|
|
5
|
+
OutboundReplyPayload,
|
|
6
|
+
RuntimeEnv,
|
|
7
|
+
} from "openclaw/plugin-sdk";
|
|
3
8
|
import {
|
|
4
9
|
createReplyPrefixOptions,
|
|
10
|
+
resolveOutboundMediaUrls,
|
|
5
11
|
mergeAllowlist,
|
|
6
12
|
resolveOpenProviderRuntimeGroupPolicy,
|
|
7
13
|
resolveDefaultGroupPolicy,
|
|
8
14
|
resolveSenderCommandAuthorization,
|
|
15
|
+
sendMediaWithLeadingCaption,
|
|
9
16
|
summarizeMapping,
|
|
10
17
|
warnMissingProviderGroupPolicyFallbackOnce,
|
|
11
18
|
} from "openclaw/plugin-sdk";
|
|
@@ -392,7 +399,7 @@ async function processMessage(
|
|
|
392
399
|
}
|
|
393
400
|
|
|
394
401
|
async function deliverZalouserReply(params: {
|
|
395
|
-
payload:
|
|
402
|
+
payload: OutboundReplyPayload;
|
|
396
403
|
profile: string;
|
|
397
404
|
chatId: string;
|
|
398
405
|
isGroup: boolean;
|
|
@@ -408,29 +415,23 @@ async function deliverZalouserReply(params: {
|
|
|
408
415
|
const tableMode = params.tableMode ?? "code";
|
|
409
416
|
const text = core.channel.text.convertMarkdownTables(payload.text ?? "", tableMode);
|
|
410
417
|
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
:
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
});
|
|
429
|
-
statusSink?.({ lastOutboundAt: Date.now() });
|
|
430
|
-
} catch (err) {
|
|
431
|
-
runtime.error(`Zalouser media send failed: ${String(err)}`);
|
|
432
|
-
}
|
|
433
|
-
}
|
|
418
|
+
const sentMedia = await sendMediaWithLeadingCaption({
|
|
419
|
+
mediaUrls: resolveOutboundMediaUrls(payload),
|
|
420
|
+
caption: text,
|
|
421
|
+
send: async ({ mediaUrl, caption }) => {
|
|
422
|
+
logVerbose(core, runtime, `Sending media to ${chatId}`);
|
|
423
|
+
await sendMessageZalouser(chatId, caption ?? "", {
|
|
424
|
+
profile,
|
|
425
|
+
mediaUrl,
|
|
426
|
+
isGroup,
|
|
427
|
+
});
|
|
428
|
+
statusSink?.({ lastOutboundAt: Date.now() });
|
|
429
|
+
},
|
|
430
|
+
onError: (error) => {
|
|
431
|
+
runtime.error(`Zalouser media send failed: ${String(error)}`);
|
|
432
|
+
},
|
|
433
|
+
});
|
|
434
|
+
if (sentMedia) {
|
|
434
435
|
return;
|
|
435
436
|
}
|
|
436
437
|
|