mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 17:37:40 +00:00
* cli: add orca plugin create, validate and inspect * build: ship orca plugin validate's main checks as a CLI main entry
14 lines
506 B
TypeScript
14 lines
506 B
TypeScript
import { cliErrorCode } from './cli-error'
|
|
|
|
const PLUGIN_EXIT_CODES: Readonly<Record<string, number>> = {
|
|
plugin_invalid: 2,
|
|
approval_required: 3,
|
|
approval_stale: 3
|
|
}
|
|
|
|
/** `orca plugin` exit codes are a stable contract so scripts can tell "invalid" and "ask a human" apart from failure. */
|
|
export function cliErrorExitCode(error: unknown, commandPath: readonly string[]): number {
|
|
const code = cliErrorCode(error)
|
|
return commandPath[0] === 'plugin' && code ? (PLUGIN_EXIT_CODES[code] ?? 1) : 1
|
|
}
|