Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

506 B
Raw Blame
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
}