mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 09:07:40 +00:00
* 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>
26 lines
846 B
TypeScript
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]
|
|
}
|