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:
@@ -22,7 +22,10 @@ const WINDOWS_1252_EXTRA_CODEPOINTS = new Set([
|
||||
0x0160, 0x2039, 0x0152, 0x017d, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022,
|
||||
0x2013, 0x2014, 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0x017e, 0x0178,
|
||||
]);
|
||||
const STAGED_DEPENDENCY_ALLOWLIST = new Set(['onnxruntime-web']);
|
||||
// Declared dependencies the staged runtime never loads: onnxruntime-web (the
|
||||
// browser backend of Transformers.js) and chromium-bidi, which Puppeteer loads
|
||||
// only for WebDriver BiDi sessions; whatsapp-web.js drives Chrome over CDP.
|
||||
const STAGED_DEPENDENCY_ALLOWLIST = new Set(['onnxruntime-web', 'chromium-bidi']);
|
||||
const FIRST_PARTY_RUNTIME_ENTRIES = new Set([
|
||||
'dist',
|
||||
'LICENSE',
|
||||
@@ -960,10 +963,10 @@ describe('Tauri Production Configuration', () => {
|
||||
expect(vulnerableSharp.stderr).toContain('sharp@0.34.5');
|
||||
writeManifest('sharp', 'sharp', '0.35.3');
|
||||
|
||||
// Puppeteer (WhatsApp, ADR-0005) parses its config with js-yaml at runtime.
|
||||
writeManifest('vendor/node_modules/js-yaml', 'js-yaml', '4.3.0');
|
||||
const stagedDevDependency = run();
|
||||
expect(stagedDevDependency.status).toBe(1);
|
||||
expect(stagedDevDependency.stderr).toContain('development-only js-yaml');
|
||||
const stagedYamlParser = run();
|
||||
expect(stagedYamlParser.stderr).not.toContain('js-yaml');
|
||||
fs.rmSync(path.join(fixture, 'vendor'), { recursive: true, force: true });
|
||||
|
||||
fs.rmSync(
|
||||
@@ -988,8 +991,9 @@ describe('Tauri Production Configuration', () => {
|
||||
expect(script).toContain('execFileSync(nodePath');
|
||||
expect(script).toContain('const database = new Database');
|
||||
expect(script).toContain('SELECT 1 AS ok');
|
||||
expect(script).toContain('SELECT vec_version() AS version');
|
||||
expect(script).toContain('const onnx = require(process.argv[4])');
|
||||
// No SQLite extension is loaded since the legacy memory engine left (P1.5).
|
||||
expect(script).not.toContain('vec_version');
|
||||
expect(script).toContain('const onnx = require(process.argv[3])');
|
||||
expect(script).toContain('const { RawImage } = require(process.argv[1])');
|
||||
expect(script).toContain('image.toSharp().resize(1, 1).png().toBuffer()');
|
||||
expect(script).toContain('Buffer.from([137,80,78,71,13,10,26,10])');
|
||||
@@ -1036,7 +1040,7 @@ describe('Tauri Production Configuration', () => {
|
||||
);
|
||||
expect(script).toContain("execFileSync('/usr/bin/lipo'");
|
||||
expect(script).toContain('required native dependency');
|
||||
expect(script).toContain('sqlite-vec-${vecOs}-${arch}');
|
||||
expect(script).not.toContain('sqlite-vec');
|
||||
expect(script).not.toContain("arch === 'arm64' ? 'aarch64'");
|
||||
});
|
||||
|
||||
@@ -1051,21 +1055,9 @@ describe('Tauri Production Configuration', () => {
|
||||
const fixtureChecker = path.join(fixtureScripts, 'check-sidecar-resources.mjs');
|
||||
const requiredNativeFiles = [
|
||||
'better_sqlite3.node',
|
||||
'vec0.dll',
|
||||
'onnxruntime/onnxruntime_binding.node',
|
||||
];
|
||||
const stagedRuntimeFiles = [
|
||||
'@waggle/hive-mind-core/dist/index.js',
|
||||
'@waggle/hive-mind-cli/dist/index.js',
|
||||
'@waggle/hive-mind-hooks-claude-code/dist/bin/claude-code-hooks-cli.js',
|
||||
'@waggle/hive-mind-hooks-claude-desktop/dist/bin/claude-desktop-hooks.js',
|
||||
'@waggle/hive-mind-hooks-codex/dist/bin/codex-hooks.js',
|
||||
'@waggle/hive-mind-hooks-codex-desktop/dist/bin/codex-desktop-hooks.js',
|
||||
'@waggle/hive-mind-hooks-cursor/dist/bin/cursor-hooks.js',
|
||||
'@waggle/hive-mind-hooks-hermes/dist/bin/hermes-hooks.js',
|
||||
'@waggle/hive-mind-hooks-openclaw/dist/bin/openclaw-hooks.js',
|
||||
'@waggle/hive-mind-hooks-openclaw/dist/handler.bundle.cjs',
|
||||
'waggle-memory-mcp/dist/index.js',
|
||||
'waggle-test-runtime/dist/index.js',
|
||||
];
|
||||
const writeFixtureFile = (base: string, relative: string, content = '') => {
|
||||
@@ -1245,7 +1237,6 @@ describe('Tauri Production Configuration', () => {
|
||||
);
|
||||
}
|
||||
const installedBinding = path.join(installedBetterSqlite, 'build', 'Release', 'better_sqlite3.node');
|
||||
const installedVec = path.join(ROOT, 'node_modules', 'sqlite-vec-windows-x64', 'vec0.dll');
|
||||
const installedOnnx = path.join(ROOT, 'node_modules', 'onnxruntime-node');
|
||||
const fixtureOnnx = path.join(fixtureResources, 'node_modules', 'onnxruntime-node');
|
||||
fs.mkdirSync(fixtureOnnx, { recursive: true });
|
||||
@@ -1327,7 +1318,6 @@ describe('Tauri Production Configuration', () => {
|
||||
for (const entry of requiredNativeFiles) {
|
||||
const target = writeFixtureFile(path.join(fixtureResources, 'native'), entry);
|
||||
if (entry === 'better_sqlite3.node') fs.copyFileSync(installedBinding, target);
|
||||
if (entry === 'vec0.dll') fs.copyFileSync(installedVec, target);
|
||||
if (entry === 'onnxruntime/onnxruntime_binding.node') fs.copyFileSync(installedOnnxBinding, target);
|
||||
}
|
||||
for (const entry of stagedRuntimeFiles) {
|
||||
@@ -1616,8 +1606,7 @@ describe('Tauri Production Configuration', () => {
|
||||
'better_sqlite3.node',
|
||||
);
|
||||
const stagedOnnxBinding = path.join(fixtureOnnxBin, 'onnxruntime_binding.node');
|
||||
const fixtureVec = path.join(fixtureResources, 'native', 'vec0.dll');
|
||||
for (const target of [stagedBinding, stagedOnnxBinding, fixtureVec]) {
|
||||
for (const target of [stagedBinding, stagedOnnxBinding]) {
|
||||
const original = fs.readFileSync(target);
|
||||
fs.writeFileSync(target, 'not a native payload');
|
||||
const invalidRuntimeResult = await runChecker({ runtimeProbe: 'native' });
|
||||
|
||||
Reference in New Issue
Block a user