build: package the sidecar without the legacy memory runtime (P1.5, P1.3b)

- Stop building and staging the hive-mind CLI, the coding-agent hook
  packages and the memory MCP server: the hooks, Waggle Room and the
  memory MCP server are hidden in v1 (ADR-0002) and all of them write to
  the legacy .mind files.
- Drop sqlite-vec: nothing loads a SQLite extension since the legacy
  memory engine left. bundle-native-deps no longer copies vec0, the
  resource check no longer probes it, the Tauri shell no longer sets
  WAGGLE_SQLITE_VEC_PATH and install.sh checks plain SQLite.
- Stage bundle roots that npm keeps inside a workspace. mem0ai is not
  hoisted (it stays in packages/memory-mem0), so staging skipped it
  silently and the packaged sidecar would fail on the first memory
  access. Roots that are not installed are now listed in the output.
- js-yaml is a runtime dependency of Puppeteer's config loader since the
  WhatsApp channel moved to whatsapp-web.js (ADR-0005); it leaves the
  resource-check denylist. chromium-bidi stays unstaged: Puppeteer loads
  it only for WebDriver BiDi sessions.
This commit is contained in:
shumeiko.it
2026-10-24 16:37:48 +02:00
parent e435e7da94
commit bbfb3c7f82
6 changed files with 60 additions and 119 deletions

View File

@@ -19,14 +19,14 @@ const nativeDir = path.join(root, 'app', 'src-tauri', 'resources', 'native');
const platform = process.platform;
const arch = process.env.TARGET_ARCH || process.arch;
// macOS "universal" is not a valid staging target: sqlite-vec and onnxruntime
// macOS "universal" is not a valid staging target: better-sqlite3 and onnxruntime
// ship per-arch binaries (no darwin/universal path exists), so a universal run
// silently falls through to the x64 variant and mis-stages the arm64 half.
// Build each arch separately and lipo the app bundle instead.
if (arch === 'universal') {
console.error(
'[bundle-native-deps] FATAL — TARGET_ARCH=universal is not supported.\n'
+ ' Native modules (sqlite-vec, onnxruntime-node) are per-arch. Build each\n'
+ ' Native modules (better-sqlite3, onnxruntime-node) are per-arch. Build each\n'
+ ' arch separately: TARGET_ARCH=arm64 (aarch64-apple-darwin) and\n'
+ ' TARGET_ARCH=x64 (x86_64-apple-darwin) — see release.yml\'s macOS matrix\n'
+ ' and the app tauri:build:mac:arm64 / :x64 scripts.',
@@ -114,16 +114,7 @@ function copyDir(srcDir, destSubDir) {
console.log('[bundle-native-deps] better-sqlite3:');
copyFile('node_modules/better-sqlite3/build/Release/better_sqlite3.node', 'better_sqlite3.node');
// 2. sqlite-vec
console.log('[bundle-native-deps] sqlite-vec:');
const vecOs = platform === 'win32' ? 'windows' : platform === 'darwin' ? 'darwin' : 'linux';
const vecExt = platform === 'win32' ? 'dll' : platform === 'darwin' ? 'dylib' : 'so';
copyFile(
`node_modules/sqlite-vec-${vecOs}-${arch}/vec0.${vecExt}`,
`vec0.${vecExt}`,
);
// 3. onnxruntime-node (multiple files — binding + shared libraries)
// 2. onnxruntime-node (multiple files — binding + shared libraries)
console.log('[bundle-native-deps] onnxruntime-node:');
const ortOs = platform === 'win32' ? 'win32' : platform === 'darwin' ? 'darwin' : 'linux';
const ortDir = `node_modules/onnxruntime-node/bin/napi-v3/${ortOs}/${arch}`;