@openclaw/zalo 2026.2.2 → 2026.2.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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/config-schema.ts +1 -0
- package/src/monitor.ts +11 -0
- package/src/types.ts +2 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/config-schema.ts
CHANGED
|
@@ -16,6 +16,7 @@ const zaloAccountSchema = z.object({
|
|
|
16
16
|
allowFrom: z.array(allowFromEntry).optional(),
|
|
17
17
|
mediaMaxMb: z.number().optional(),
|
|
18
18
|
proxy: z.string().optional(),
|
|
19
|
+
responsePrefix: z.string().optional(),
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
export const ZaloConfigSchema = zaloAccountSchema.extend({
|
package/src/monitor.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import type { OpenClawConfig, MarkdownTableMode } from "openclaw/plugin-sdk";
|
|
3
|
+
import { createReplyPrefixOptions } from "openclaw/plugin-sdk";
|
|
3
4
|
import type { ResolvedZaloAccount } from "./accounts.js";
|
|
4
5
|
import {
|
|
5
6
|
ZaloApiError,
|
|
@@ -583,11 +584,18 @@ async function processMessageWithPipeline(params: {
|
|
|
583
584
|
channel: "zalo",
|
|
584
585
|
accountId: account.accountId,
|
|
585
586
|
});
|
|
587
|
+
const { onModelSelected, ...prefixOptions } = createReplyPrefixOptions({
|
|
588
|
+
cfg: config,
|
|
589
|
+
agentId: route.agentId,
|
|
590
|
+
channel: "zalo",
|
|
591
|
+
accountId: account.accountId,
|
|
592
|
+
});
|
|
586
593
|
|
|
587
594
|
await core.channel.reply.dispatchReplyWithBufferedBlockDispatcher({
|
|
588
595
|
ctx: ctxPayload,
|
|
589
596
|
cfg: config,
|
|
590
597
|
dispatcherOptions: {
|
|
598
|
+
...prefixOptions,
|
|
591
599
|
deliver: async (payload) => {
|
|
592
600
|
await deliverZaloReply({
|
|
593
601
|
payload,
|
|
@@ -606,6 +614,9 @@ async function processMessageWithPipeline(params: {
|
|
|
606
614
|
runtime.error?.(`[${account.accountId}] Zalo ${info.kind} reply failed: ${String(err)}`);
|
|
607
615
|
},
|
|
608
616
|
},
|
|
617
|
+
replyOptions: {
|
|
618
|
+
onModelSelected,
|
|
619
|
+
},
|
|
609
620
|
});
|
|
610
621
|
}
|
|
611
622
|
|
package/src/types.ts
CHANGED