Files
orca/src/cli/command-spec.ts
T
OrcaWinandOrcaWin 120f01331c [comment audit] Shorten CLI parsing and host-routing comments (#32265)
* chore: shorten process-host comments

* chore: audit CLI parsing and host-routing comments

* chore: remove stale host-selector restriction comment

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-23 07:49:36 -07:00

26 lines
846 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[]
// 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]
}