FIX: QVAC (QuantumVerse Automatic Computer) Packing
CI / test (push) Successful in 2m38s
Release rolling / release (push) Failing after 6m17s

This commit is contained in:
Raven Scott
2026-07-30 14:17:06 -04:00
parent e2d909eaaa
commit bce96d6550
16 changed files with 1391 additions and 441 deletions
+24 -2
View File
@@ -55,18 +55,40 @@ export function createQvacEngine(deps) {
}
/**
* Resolve @qvac/sdk for both ESM (pear run) and CJS Electron bundle.
* Packaged Electron: packages are external requires under app/node_modules.
* @param {number} [timeoutMs]
*/
async function tryLoadSdk(timeoutMs = 8_000) {
if (sdk) return sdk
try {
const load = import('@qvac/sdk').then((m) => m)
const load = (async () => {
// Prefer dynamic import (ESM / pear). Falls back to createRequire for CJS.
try {
return await import('@qvac/sdk')
} catch (importErr) {
try {
const { createRequire } = await import('module')
const req = createRequire(
typeof __filename !== 'undefined'
? __filename
: `${process.cwd()}/package.json`
)
return req('@qvac/sdk')
} catch {
throw importErr
}
}
})()
const timed =
timeoutMs > 0
? Promise.race([
load,
new Promise((_, reject) => {
setTimeout(() => reject(new Error(`@qvac/sdk import timed out after ${timeoutMs}ms`)), timeoutMs)
setTimeout(
() => reject(new Error(`@qvac/sdk import timed out after ${timeoutMs}ms`)),
timeoutMs
)
}),
])
: load