Files
orca/config/scripts/orcad-artifact-version.mjs
T
OrcaWin 6fc3cdcad6 Bundle Bun for headless Orca and profile persistence (#22635)
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.
2026-09-25 22:49:06 -07:00

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)}`
}