MCPcopy Create free account
hub / github.com/arktypeio/arktype / findAgentBinary

Function findAgentBinary

ark/type/cli.ts:693–710  ·  view source on GitHub ↗
(preferred?: string)

Source from the content-addressed store, hash-verified

691}
692
693const findAgentBinary = (preferred?: string): AgentCommand | undefined => {
694 const candidates = preferred ? [preferred] : ["claude", "codex"]
695 for (const cmd of candidates) {
696 const commands: AgentCommand[] =
697 process.platform === "win32" ?
698 resolveWindowsAgentCandidates(cmd)
699 : [{ command: cmd, args: [] }]
700 for (const resolved of commands) {
701 const probe = spawnSync(
702 resolved.command,
703 [...resolved.args, "--version"],
704 { stdio: "ignore" }
705 )
706 if (probe.status === 0) return resolved
707 }
708 }
709 return undefined
710}
711
712const runMigrate = (
713 args: string[],

Callers 1

runMigrateFunction · 0.85

Calls 1

Tested by

no test coverage detected