mirror of
https://github.com/stablyai/orca.git
synced 2026-09-27 08:02:35 +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.
34 lines
981 B
JavaScript
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
|