openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
20 lines (19 loc) • 644 B
JavaScript
import { s as getRootOptionAwareCommandPath } from "./cli-root-options-xlQx6o4R.mjs";
//#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(e) {
const [, t] = getRootOptionAwareCommandPath(e.argv, 2);
return [
"check",
"compare",
"watch"
].includes(t ?? "") && !e.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 };