mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 21:07:01 -06:00
269bc5c89e
Co-authored-by: 1052326311 <65798732+1052326311@users.noreply.github.com>
32 lines
996 B
TypeScript
32 lines
996 B
TypeScript
import { getRootOptionAwareCommandPath } from "openclaw/plugin-sdk/cli-argv";
|
|
|
|
const DEFAULT_JSON_COMMANDS = new Set(["join", "status", "test-listen", "test-speech"]);
|
|
|
|
function hasOption(argv: readonly string[], flag: string): boolean {
|
|
for (const arg of argv.slice(2)) {
|
|
if (arg === "--") {
|
|
return false;
|
|
}
|
|
if (arg === flag || arg.startsWith(`${flag}=`)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
/** Runtime probe commands emit JSON without requiring the shared `--json` option. */
|
|
function isGoogleMeetMachineOutput(params: { argv: readonly string[] }): boolean {
|
|
const [, command] = getRootOptionAwareCommandPath(params.argv, 2);
|
|
return (
|
|
DEFAULT_JSON_COMMANDS.has(command ?? "") ||
|
|
(command === "export" && hasOption(params.argv, "--dry-run"))
|
|
);
|
|
}
|
|
|
|
export const GOOGLE_MEET_CLI_DESCRIPTOR = {
|
|
name: "googlemeet",
|
|
description: "Join and manage Google Meet calls",
|
|
hasSubcommands: true,
|
|
machineOutput: isGoogleMeetMachineOutput,
|
|
} as const;
|