Files
openclaw/extensions/shared/config-schema-helpers.ts
2026-03-27 16:40:27 +00:00

18 lines
555 B
TypeScript

import { requireOpenAllowFrom } from "openclaw/plugin-sdk/channel-config-primitives";
import type { z } from "openclaw/plugin-sdk/zod";
export function requireChannelOpenAllowFrom(params: {
channel: string;
policy?: string;
allowFrom?: Array<string | number>;
ctx: z.RefinementCtx;
}) {
requireOpenAllowFrom({
policy: params.policy,
allowFrom: params.allowFrom,
ctx: params.ctx,
path: ["allowFrom"],
message: `channels.${params.channel}.dmPolicy="open" requires channels.${params.channel}.allowFrom to include "*"`,
});
}