mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-29 19:01:44 +00:00
18 lines
555 B
TypeScript
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 "*"`,
|
|
});
|
|
}
|