openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
20 lines (19 loc) • 670 B
JavaScript
import { o as getRootOptionAwareCommandPath } from "./cli-root-options-CgExE0zj.js";
//#region extensions/policy/src/cli-output-mode.ts
/** Policy commands follow Unix convention and switch to JSON when stdout is not a terminal. */
function isPolicyMachineOutput(params) {
const [, command] = getRootOptionAwareCommandPath(params.argv, 2);
return [
"check",
"compare",
"watch"
].includes(command ?? "") && !params.stdoutIsTTY;
}
const POLICY_CLI_DESCRIPTOR = {
name: "policy",
description: "Check policy requirements and emit audit evidence",
hasSubcommands: true,
machineOutput: isPolicyMachineOutput
};
//#endregion
export { POLICY_CLI_DESCRIPTOR as t };