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.

1.0 KB
Raw Blame
import { resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import {
  resolveTypecheckBunExecutable,
  resolveTypecheckCommand,
  selectTypecheckCompiler
} from '../../config/scripts/run-typecheck-projects-in-parallel.mjs'

const root = fileURLToPath(new URL('../..', import.meta.url))

// Run from the mobile cwd for relative diagnostics; ORCA_MOBILE_TYPECHECK_COMPILER selects auto|tsrs|bun|native.
export function resolveMobileTypecheckCommand(project, cwd = process.cwd()) {
  const requested = process.env.ORCA_MOBILE_TYPECHECK_COMPILER ?? 'auto'
  if (!/^(auto|tsrs|bun|native)$/.test(requested)) {
    throw new Error(`Unknown mobile typecheck compiler: ${requested}`)
  }
  const selection = selectTypecheckCompiler(requested, {
    root,
    resolveBunExecutable: resolveTypecheckBunExecutable,
    fallbackHint: 'set ORCA_MOBILE_TYPECHECK_COMPILER=native'
  })
  const command = resolveTypecheckCommand(resolve(cwd, project), {
    ...selection,
    bunThreads: 2,
    root
  })
  return { ...command, cwd, compiler: selection.compiler }
}