Files
openclaw/extensions/voice-call/cli-output-mode.ts
2026-07-27 05:44:16 -04:00

28 lines
709 B
TypeScript

import { getRootOptionAwareCommandPath } from "openclaw/plugin-sdk/cli-argv";
const MACHINE_OUTPUT_COMMANDS = new Set([
"call",
"continue",
"dtmf",
"end",
"expose",
"latency",
"speak",
"start",
"status",
"tail",
]);
/** Voice-call result actions emit JSON, while tail reserves stdout for JSONL. */
function isVoiceCallMachineOutput(params: { argv: readonly string[] }): boolean {
const [, command] = getRootOptionAwareCommandPath(params.argv, 2);
return MACHINE_OUTPUT_COMMANDS.has(command ?? "");
}
export const VOICE_CALL_CLI_DESCRIPTOR = {
name: "voicecall",
description: "Voice call utilities",
hasSubcommands: true,
machineOutput: isVoiceCallMachineOutput,
} as const;