mirror of
https://github.com/stablyai/orca.git
synced 2026-10-01 08:01:56 +00:00
Bundle a pinned, verified Bun runtime for headless Orca so existing Node launch commands can hand off before opening a profile. Keep desktop execution on Electron. Add the Bun SQLite adapter and terminal backend, bounded shutdown, process inspection and cross-platform artifact qualification. Keep future managed SSH deployment separate from current production launch paths.
27 lines
1.0 KiB
JavaScript
27 lines
1.0 KiB
JavaScript
import { createHash } from 'node:crypto'
|
|
import { existsSync, readFileSync } from 'node:fs'
|
|
import { join } from 'node:path'
|
|
import {
|
|
ORCAD_VERSION,
|
|
orcadArtifactFilenames,
|
|
orcadArtifactHashPrefix
|
|
} from '../../src/shared/orcad-artifacts.ts'
|
|
|
|
export function computeOrcadFullVersion(artifactDir, { target = '', agentBrowserFilename } = {}) {
|
|
const hash = createHash('sha256').update(orcadArtifactHashPrefix(target))
|
|
for (const filename of orcadArtifactFilenames(target)) {
|
|
const artifactPath = join(artifactDir, filename)
|
|
if (!existsSync(artifactPath)) {
|
|
throw new Error(
|
|
`orcad declares ${filename} in ORCAD_ARTIFACTS but never emitted it. Add the build ` +
|
|
'step, or drop it from src/shared/orcad-artifacts.ts.'
|
|
)
|
|
}
|
|
hash.update(readFileSync(artifactPath))
|
|
}
|
|
if (agentBrowserFilename && existsSync(join(artifactDir, agentBrowserFilename))) {
|
|
hash.update(readFileSync(join(artifactDir, agentBrowserFilename)))
|
|
}
|
|
return `${ORCAD_VERSION}+${hash.digest('hex').slice(0, 12)}`
|
|
}
|