mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 17:37:40 +00:00
* fix(cli): hide unsupported profile-state flags * fix(cli): derive --page and remote-selector help from what each command takes --page is now a property the browser spec modules set for commands that act on one page, rather than offered to every command group not on a deny-list, so serve, environment, agent, connector, host, vm and profile commands stop advertising and accepting it. Local-only commands offer only --help and --json plus a selector they take as their own argument, and a test ties their help to the same local-only list dispatch uses. Co-authored-by: William Poisel <53629276+epoisel@users.noreply.github.com> --------- Co-authored-by: William Poisel <53629276+epoisel@users.noreply.github.com>
28 lines
951 B
TypeScript
28 lines
951 B
TypeScript
export type CommandSpec = {
|
|
path: string[]
|
|
aliases?: string[][]
|
|
argumentMode?: 'parsed' | 'passthrough'
|
|
// Prevent typo recovery from suggesting destructive actions for unrelated commands.
|
|
destructive?: boolean
|
|
hidden?: boolean
|
|
summary: string
|
|
usage: string
|
|
allowedFlags: string[]
|
|
// Flag repeatability varies by command, even for the same flag name.
|
|
repeatableFlags?: string[]
|
|
positionalArgs?: string[]
|
|
variadicPositional?: boolean
|
|
examples?: string[]
|
|
notes?: string[]
|
|
// Takes `--page <browserPageId>`; only the browser spec modules set it.
|
|
browserPageTarget?: boolean
|
|
// Caller flags must match the acting agent session; target flags may name another session.
|
|
identityFlagRoles?: Partial<Record<IdentityFlag, 'caller' | 'target'>>
|
|
}
|
|
|
|
export type IdentityFlag = 'from' | 'terminal'
|
|
|
|
export function specPaths(spec: CommandSpec): string[][] {
|
|
return spec.aliases ? [spec.path, ...spec.aliases] : [spec.path]
|
|
}
|