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 (#36280)
* cli: add orca plugin create, validate and inspect * build: ship orca plugin validate's main checks as a CLI main entry
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user