Dashboard › opencode-lore › Distillation
bc4ae1e8-712e-42e6-bdd5-ffa191d9cbf4["lore_tm_v1_PN54FM6HuRWSJgbfa6ia9TnpyJk3_lgPMqOuPkFCDps","lore_tm_v1_NfX6UwU1qny8WProdBusia2Aq6cRK0IJpjQJx5J_sDQ","lore_tm_v1_U1yvEK2rWiFFK8hzGjkfjkjqmSBRzlT4b3Pk9Pq_Lsk"]
Date: Sep 16, 2026
packages/gateway/script/ort-platform-package.ts, which generates per-platform npm packages containing the native onnxruntime-node addon and shared libraries, following the @esbuild/<os>-<arch> distribution model.onnxruntime-node dependency was rejected because its binary arrives through a GitHub-release postinstall download, npm 12 will stop running such scripts automatically, and downloads fail in offline, air-gapped, or proxied installations. Chosen design uses @loreai/onnxruntime-<os>-<arch> optional dependencies gated by npm os/cpu, with no install script; unresolved packages fall back to bundled single-threaded WASM, which is 2.7–4.1× slower than native.linux-x64 (linux/x64), 2. linux-arm64 (linux/arm64), 3. darwin-arm64 (darwin/arm64), 4. win32-x64 (win32/x64), 5. win32-arm64 (win32/arm64). darwin-x64 is absent because onnxruntime-node 1.27.0 dropped its Intel macOS prebuilt, so Intel Macs fall back to WASM.require.resolve("@loreai/onnxruntime-<target>/onnxruntime_binding.node"); ortPlatformTarget(platform, arch) returns ${platform}-${arch}, ortPackageName(target) returns @loreai/onnxruntime-${target}, and ORT_PACKAGE_BINDING_SUBPATH equals ORT_BINDING_FILE.buildOrtPlatformPackages(outDir, version, platforms) writes each package beneath outDir/onnxruntime-<target>/, copies native files flat into the package root, and generates metadata including name, release-locked version, loreOrtNodeVersion, os, cpu, preferUnplugged: true, sorted files, license: "FSL-1.1-Apache-2.0", and publishConfig: { access: "public" }."exports" field because an exports map would block the deep require.resolve("<pkg>/onnxruntime_binding.node") lookup. preferUnplugged: true ensures Yarn PnP keeps the dlopen-loaded addon and sibling shared libraries as real on-disk files.tsx script/ort-platform-package.ts --out <dir> [--version x.y.z]; --out is mandatory, omitted --version defaults to the gateway package version, and importing the module has no side effects.packages/gateway/test/ort-platform-package.test.ts bind ORT_NATIVE_TARGETS, ORT_NPM_PLATFORMS, npm os/cpu, ortPlatformTarget(), and ortPackageName() so build-time package identities cannot drift from runtime resolution keys and silently force WASM fallback.buildOrtPlatformPackages tests use temporary output and version "9.9.9"; they verify one package per platform, physical presence of ORT_PACKAGE_BINDING_SUBPATH, matching name/version/os/cpu, preferUnplugged: true, loreOrtNodeVersion === ortNodeVersion(), absence of exports, and existence of every file declared in package.json.libonnxruntime.so.1 and drop duplicate libonnxruntime.so.1.27.0; Darwin must retain libonnxruntime.1.dylib and drop duplicate libonnxruntime.1.27.0.dylib; Windows must ship both onnxruntime.dll and DirectML.dll.beforeAll, and its assertions must never run against an artifact that predates source.@loreai/core at runtime.@loreai/* package consumed at runtime must be declared as a runtime dependency and must never be hidden in devDependencies, because devDependencies are never installed for a transitively installed package.workspace:*, which pnpm pack rewrites to the exact release version.