mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 04:12:10 +03:00
Completes the #3066 fix. Externalizing sqlite-vec unblocked the Turbopack build, but Next.js does not trace sqlite-vec's platform-specific native package (sqlite-vec-<os>-<arch>, which ships vec0.so) into .next/standalone — sqlite-vec resolves it at runtime via require.resolve() (Next.js issue #88844). Result: in the bundled/Docker build the wrapper loaded but getLoadablePath() threw MODULE_NOT_FOUND, so vectorStore silently degraded vector/semantic memory to FTS5 keyword search. build-next-isolated now syncs the sqlite-vec wrapper plus whichever sqlite-vec-<platform> package npm installed into the standalone output (mirroring the existing better-sqlite3 native-binary handling). Platform-agnostic, so Docker (linux) and Electron (mac/win/linux) builds all carry their matching vec0.so/.dylib/.dll. Verified: vec0.so present in .next/standalone/node_modules/sqlite-vec-linux-x64; createRequire("sqlite-vec") + require.resolve("sqlite-vec-linux-x64/vec0.so") both resolve from inside the standalone (no FTS5 fallback). build-next-isolated tests 7/7.