@openclaw/zalouser 2026.2.2 → 2026.2.6
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 +12 -0
- package/package.json +1 -1
- package/src/config-schema.ts +1 -0
- package/src/monitor.ts +12 -1
- package/src/types.ts +2 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/config-schema.ts
CHANGED
|
@@ -19,6 +19,7 @@ const zalouserAccountSchema = z.object({
|
|
|
19
19
|
groupPolicy: z.enum(["disabled", "allowlist", "open"]).optional(),
|
|
20
20
|
groups: z.object({}).catchall(groupConfigSchema).optional(),
|
|
21
21
|
messagePrefix: z.string().optional(),
|
|
22
|
+
responsePrefix: z.string().optional(),
|
|
22
23
|
});
|
|
23
24
|
|
|
24
25
|
export const ZalouserConfigSchema = zalouserAccountSchema.extend({
|
package/src/monitor.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChildProcess } from "node:child_process";
|
|
2
2
|
import type { OpenClawConfig, MarkdownTableMode, RuntimeEnv } from "openclaw/plugin-sdk";
|
|
3
|
-
import { mergeAllowlist, summarizeMapping } from "openclaw/plugin-sdk";
|
|
3
|
+
import { createReplyPrefixOptions, mergeAllowlist, summarizeMapping } from "openclaw/plugin-sdk";
|
|
4
4
|
import type { ResolvedZalouserAccount, ZcaFriend, ZcaGroup, ZcaMessage } from "./types.js";
|
|
5
5
|
import { getZalouserRuntime } from "./runtime.js";
|
|
6
6
|
import { sendMessageZalouser } from "./send.js";
|
|
@@ -334,10 +334,18 @@ async function processMessage(
|
|
|
334
334
|
},
|
|
335
335
|
});
|
|
336
336
|
|
|
337
|
+
const { onModelSelected, ...prefixOptions } = createReplyPrefixOptions({
|
|
338
|
+
cfg: config,
|
|
339
|
+
agentId: route.agentId,
|
|
340
|
+
channel: "zalouser",
|
|
341
|
+
accountId: account.accountId,
|
|
342
|
+
});
|
|
343
|
+
|
|
337
344
|
await core.channel.reply.dispatchReplyWithBufferedBlockDispatcher({
|
|
338
345
|
ctx: ctxPayload,
|
|
339
346
|
cfg: config,
|
|
340
347
|
dispatcherOptions: {
|
|
348
|
+
...prefixOptions,
|
|
341
349
|
deliver: async (payload) => {
|
|
342
350
|
await deliverZalouserReply({
|
|
343
351
|
payload: payload as { text?: string; mediaUrls?: string[]; mediaUrl?: string },
|
|
@@ -360,6 +368,9 @@ async function processMessage(
|
|
|
360
368
|
runtime.error(`[${account.accountId}] Zalouser ${info.kind} reply failed: ${String(err)}`);
|
|
361
369
|
},
|
|
362
370
|
},
|
|
371
|
+
replyOptions: {
|
|
372
|
+
onModelSelected,
|
|
373
|
+
},
|
|
363
374
|
});
|
|
364
375
|
}
|
|
365
376
|
|
package/src/types.ts
CHANGED
|
@@ -80,6 +80,7 @@ export type ZalouserAccountConfig = {
|
|
|
80
80
|
{ allow?: boolean; enabled?: boolean; tools?: { allow?: string[]; deny?: string[] } }
|
|
81
81
|
>;
|
|
82
82
|
messagePrefix?: string;
|
|
83
|
+
responsePrefix?: string;
|
|
83
84
|
};
|
|
84
85
|
|
|
85
86
|
export type ZalouserConfig = {
|
|
@@ -95,6 +96,7 @@ export type ZalouserConfig = {
|
|
|
95
96
|
{ allow?: boolean; enabled?: boolean; tools?: { allow?: string[]; deny?: string[] } }
|
|
96
97
|
>;
|
|
97
98
|
messagePrefix?: string;
|
|
99
|
+
responsePrefix?: string;
|
|
98
100
|
accounts?: Record<string, ZalouserAccountConfig>;
|
|
99
101
|
};
|
|
100
102
|
|