feat: resolve allowlists in channel plugins

This commit is contained in:
Peter Steinberger
2026-01-18 22:51:05 +00:00
parent ace8a1b44e
commit d198474415
4 changed files with 270 additions and 72 deletions

View File

@@ -207,6 +207,17 @@ const dmPolicy: ChannelOnboardingDmPolicy = {
allowFromKey: "channels.zalo.allowFrom",
getCurrent: (cfg) => (cfg.channels?.zalo?.dmPolicy ?? "pairing") as "pairing",
setPolicy: (cfg, policy) => setZaloDmPolicy(cfg as ClawdbotConfig, policy),
promptAllowFrom: async ({ cfg, prompter, accountId }) => {
const id =
accountId && normalizeAccountId(accountId)
? normalizeAccountId(accountId) ?? DEFAULT_ACCOUNT_ID
: resolveDefaultZaloAccountId(cfg as ClawdbotConfig);
return promptZaloAllowFrom({
cfg: cfg as ClawdbotConfig,
prompter,
accountId: id,
});
},
};
export const zaloOnboardingAdapter: ChannelOnboardingAdapter = {