claude-mem 12.1.2 → 12.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -44
- package/dist/npx-cli/index.js +125 -116
- package/openclaw/dist/index.js +14 -14
- package/openclaw/src/index.test.ts +0 -204
- package/openclaw/src/index.ts +3 -94
- package/package.json +2 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/hooks/hooks.json +9 -9
- package/plugin/package.json +1 -1
- package/plugin/scripts/bun-runner.js +6 -14
- package/plugin/scripts/context-generator.cjs +48 -48
- package/plugin/scripts/mcp-server.cjs +13 -13
- package/plugin/scripts/smart-install.js +1 -54
- package/plugin/scripts/worker-service.cjs +212 -216
- package/plugin/skills/mem-search/SKILL.md +48 -0
- package/plugin/skills/smart-explore/SKILL.md +0 -45
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* for both cache and marketplace installs), falling back to script location
|
|
10
10
|
* and legacy paths.
|
|
11
11
|
*/
|
|
12
|
-
import { existsSync, readFileSync, writeFileSync
|
|
12
|
+
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
|
13
13
|
import { execSync, spawnSync } from 'child_process';
|
|
14
14
|
import { join, dirname } from 'path';
|
|
15
15
|
import { homedir } from 'os';
|
|
@@ -490,56 +490,6 @@ function verifyCriticalModules() {
|
|
|
490
490
|
return true;
|
|
491
491
|
}
|
|
492
492
|
|
|
493
|
-
// Mach-O 64-bit magic values as seen when reading the first 4 file bytes with readUInt32LE.
|
|
494
|
-
// Native arm64/x86_64 Mach-O files start with bytes [CF FA ED FE]; readUInt32LE gives 0xFEEDFACF.
|
|
495
|
-
// Byte-swapped (big-endian) Mach-O files start with bytes [FE ED FA CF]; readUInt32LE gives 0xCFFAEDFE.
|
|
496
|
-
const MACHO_MAGIC_NATIVE = 0xFEEDFACF; // native 64-bit (arm64/x86_64) — file bytes CF FA ED FE
|
|
497
|
-
const MACHO_MAGIC_SWAPPED = 0xCFFAEDFE; // byte-swapped 64-bit — file bytes FE ED FA CF
|
|
498
|
-
|
|
499
|
-
/**
|
|
500
|
-
* Warn when the bundled claude-mem binary cannot run on the current platform.
|
|
501
|
-
*
|
|
502
|
-
* The committed binary (plugin/scripts/claude-mem) is compiled for macOS arm64.
|
|
503
|
-
* On Linux or Windows it produces "Exec format error" and silently fails.
|
|
504
|
-
* This check surfaces the incompatibility at install time so users know why
|
|
505
|
-
* the binary path doesn't work, and confirms the JS fallback (bun-runner.js →
|
|
506
|
-
* worker-service.cjs) is active and covers all functionality.
|
|
507
|
-
*
|
|
508
|
-
* Fixes #1547 — Plugin silently fails on Linux ARM64.
|
|
509
|
-
*/
|
|
510
|
-
export function checkBinaryPlatformCompatibility(binaryPath = join(ROOT, 'scripts', 'claude-mem')) {
|
|
511
|
-
|
|
512
|
-
if (!existsSync(binaryPath)) {
|
|
513
|
-
return; // Binary absent — nothing to check (e.g. after npm install which excludes it)
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
// The binary only matters on non-macOS platforms; on macOS it works correctly.
|
|
517
|
-
if (process.platform === 'darwin') {
|
|
518
|
-
return;
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
// Read the first 4 bytes to identify the binary format.
|
|
522
|
-
let fd;
|
|
523
|
-
try {
|
|
524
|
-
const buf = Buffer.alloc(4);
|
|
525
|
-
fd = openSync(binaryPath, 'r');
|
|
526
|
-
readSync(fd, buf, 0, 4, 0);
|
|
527
|
-
|
|
528
|
-
const magic = buf.readUInt32LE(0);
|
|
529
|
-
if (magic === MACHO_MAGIC_NATIVE || magic === MACHO_MAGIC_SWAPPED) {
|
|
530
|
-
console.error('⚠️ Platform notice: The bundled claude-mem binary is macOS-only.');
|
|
531
|
-
console.error(` Current platform: ${process.platform} ${process.arch}`);
|
|
532
|
-
console.error(' The binary will not execute on this platform.');
|
|
533
|
-
console.error(' Plugin functionality is provided by the JS fallback');
|
|
534
|
-
console.error(' (bun-runner.js → worker-service.cjs) which works on all platforms.');
|
|
535
|
-
}
|
|
536
|
-
} catch {
|
|
537
|
-
// Unreadable binary — not critical, skip silently
|
|
538
|
-
} finally {
|
|
539
|
-
if (fd !== undefined) closeSync(fd);
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
|
|
543
493
|
// Main execution
|
|
544
494
|
try {
|
|
545
495
|
// Step 1: Ensure Bun is installed and meets minimum version (REQUIRED)
|
|
@@ -632,9 +582,6 @@ try {
|
|
|
632
582
|
// Step 4: Install CLI to PATH
|
|
633
583
|
installCLI();
|
|
634
584
|
|
|
635
|
-
// Step 5: Warn if the bundled native binary is incompatible with this platform
|
|
636
|
-
checkBinaryPlatformCompatibility();
|
|
637
|
-
|
|
638
585
|
// Output valid JSON for Claude Code hook contract
|
|
639
586
|
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
640
587
|
} catch (e) {
|