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.

823 B
Raw Blame
export const WORKTREE_SCAN_FAILURE_KINDS = [
  'xcode-license',
  'developer-tools',
  'architecture-mismatch',
  'unknown'
] as const

export type WorktreeScanFailureKind = (typeof WORKTREE_SCAN_FAILURE_KINDS)[number]

export function isWorktreeScanFailureKind(value: unknown): value is WorktreeScanFailureKind {
  return WORKTREE_SCAN_FAILURE_KINDS.some((kind) => kind === value)
}

export function classifyWorktreeScanFailure(reason: string): WorktreeScanFailureKind {
  if (/Agreeing to the Xcode\/iOS license requires admin privileges/i.test(reason)) {
    return 'xcode-license'
  }
  if (/no developer tools were found/i.test(reason)) {
    return 'developer-tools'
  }
  if (/Unknown system error -86|EBADARCH|Bad CPU type in executable/i.test(reason)) {
    return 'architecture-mismatch'
  }
  return 'unknown'
}