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.
TypeScript adeagent-ideai-agentsautomationbotclaude-codecodexghosttygrok-bothermes-agentmobile-appmuseopenclawopencodeorchestrationpiruntimeterminalworktreesyc-backed
import { createHash } from 'node:crypto'
import { mkdir, writeFile } from 'node:fs/promises'
import { dirname, join } from 'node:path'
import {
ORCAD_MOBILE_WEB_MANIFEST,
ORCAD_NODE_RUNTIME_MARKER_FILENAME,
ORCAD_SERVER_TARGET_FILENAME,
ORCAD_TEMPLATE_MANIFEST_FILENAME,
ORCAD_TEMPLATE_TARGETS_DIR,
orcadTemplateCommonFilenames,
orcadTemplateTargetFilenames
} from '../../src/shared/orcad-artifacts.ts'
import {
COMPAT_SERVER_TARGETS,
ORCAD_TEMPLATE_TARGETS,
pinnedNodeRuntimeAsset
} from '../../src/shared/node-runtime-pin.ts'
async function write(path, contents) {
await mkdir(dirname(path), { recursive: true })
await writeFile(path, contents)
return createHash('sha256').update(contents).digest('hex')
}
function targetFileContents(target, filename) {
if (filename === ORCAD_SERVER_TARGET_FILENAME) {
return `${target}\n`
}
if (filename === ORCAD_NODE_RUNTIME_MARKER_FILENAME) {
return `${pinnedNodeRuntimeAsset(target).executableSha256}\n`
}
return `${target}:${filename}`
}
export async function writeOrcadTemplateTestFixture(resourcesDir, { compat = false } = {}) {
const templateDir = join(resourcesDir, 'orcad-template')
const commonSha256 = {}
for (const filename of orcadTemplateCommonFilenames(['out/mobile-web/index.html'])) {
commonSha256[filename] = await write(
join(templateDir, ...filename.split('/')),
Buffer.from(
filename === ORCAD_MOBILE_WEB_MANIFEST
? JSON.stringify({ assets: [{ path: 'index.html' }] })
: `common:${filename}`
)
)
}
const targets = {}
for (const target of [...ORCAD_TEMPLATE_TARGETS, ...(compat ? COMPAT_SERVER_TARGETS : [])]) {
const targetDir = join(templateDir, ORCAD_TEMPLATE_TARGETS_DIR, target)
const files = {}
for (const filename of orcadTemplateTargetFilenames(target)) {
files[filename] = await write(
join(targetDir, ...filename.split('/')),
targetFileContents(target, filename)
)
}
targets[target] = { files }
}
const browserName = 'agent-browser-linux-x64'
targets['linux-x64-glibc'] = {
...targets['linux-x64-glibc'],
browserName,
browserSha256: await write(
join(templateDir, ORCAD_TEMPLATE_TARGETS_DIR, 'linux-x64-glibc', browserName),
'browser'
)
}
await writeFile(
join(templateDir, ORCAD_TEMPLATE_MANIFEST_FILENAME),
JSON.stringify({ schemaVersion: 3, commonSha256, targets })
)
return templateDir
}