Files
orca/config/scripts/script-child-process.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

34 lines
981 B
JavaScript

import { build } from 'esbuild'
import { mkdtempSync, rmSync } from 'node:fs'
import { tmpdir } from 'node:os'
import { join, resolve } from 'node:path'
import { pathToFileURL } from 'node:url'
const root = resolve(import.meta.dirname, '../..')
const temporary = mkdtempSync(join(tmpdir(), 'orca-script-child-process-'))
const output = join(temporary, 'child-process.mjs')
let implementation
try {
await build({
stdin: {
contents: [
`export { runProcessSync } from ${JSON.stringify(join(root, 'src/shared/child-process/run-process.ts'))}`
].join('\n'),
resolveDir: root,
sourcefile: 'script-child-process-entry.ts'
},
bundle: true,
platform: 'node',
target: 'node20',
format: 'esm',
outfile: output,
logLevel: 'silent'
})
implementation = await import(pathToFileURL(output).href)
} finally {
rmSync(temporary, { recursive: true, force: true })
}
export const runProcessSync = implementation.runProcessSync