openclaw/src/channels/plugins/exec-approval-local.ts

24 lines
761 B
TypeScript

import type { ReplyPayload } from "../../auto-reply/types.js";
import type { OpenClawConfig } from "../../config/config.js";
import { getChannelPlugin, normalizeChannelId } from "./registry.js";
export function shouldSuppressLocalExecApprovalPrompt(params: {
channel?: string | null;
cfg: OpenClawConfig;
accountId?: string | null;
payload: ReplyPayload;
}): boolean {
const channel = params.channel ? normalizeChannelId(params.channel) : null;
if (!channel) {
return false;
}
return (
getChannelPlugin(channel)?.outbound?.shouldSuppressLocalPayloadPrompt?.({
cfg: params.cfg,
accountId: params.accountId,
payload: params.payload,
hint: { kind: "approval-pending", approvalKind: "exec" },
}) ?? false
);
}