Files
orca/src/cli/command-spec.ts
T
Neil 8d102e2745 fix(cli): orca secret request accepts the documented --wait <sec>
--wait is a global boolean flag, so '--wait 300' left 300 as a positional and the command failed with 'Unknown command: secret request NAME 300' (found in the W6 live e2e). A spec can now list optionalNumberFlags; secret request does for wait.
2026-11-10 07:24:12 -08:00

30 lines
1.0 KiB
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[]
// Globally boolean flags that this command also accepts with a number (`--wait 300`).
optionalNumberFlags?: 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]
}