6fb9570291
Fixed better-sqlite3 distribution by implementing self-bootstrapping hooks that auto-install dependencies on first run. This eliminates the need for users to have native compilation tools or manually install dependencies. ## Solution Instead of bundling 25MB of better-sqlite3 binaries in git or requiring manual npm install, hooks now bootstrap themselves on first execution: 1. Created `src/shared/bootstrap.ts` with `ensureDependencies()` function 2. Added bootstrap calls to all hook entry points (context, new, save, summary, cleanup) 3. Created `plugin/scripts/package.json` declaring better-sqlite3 dependency 4. Bootstrap checks if `node_modules` exists, runs `npm install` if missing 5. npm automatically downloads prebuilt better-sqlite3 binary for user's platform ## Changes **Core Bootstrap System:** - Added src/shared/bootstrap.ts: Auto-install dependencies using npm - Modified all hooks (context, new, save, summary, cleanup) to call ensureDependencies() - Created plugin/scripts/package.json with better-sqlite3 dependency **Build & Distribution:** - Removed node_modules copying logic from build script - Build output is now compact (hooks + package.json, no binaries) - Updated marketplace.json to point to GitHub for direct installation **Documentation:** - Updated README: GitHub Marketplace installation is now recommended method - Installation instructions emphasize no compilation needed - Version bumped to 4.0.5 throughout ## Benefits - ✅ No git bloat (repo stays small, no 25MB binaries committed) - ✅ No compilation needed (npm downloads prebuilt binaries) - ✅ Works on all platforms (npm handles platform-specific binaries) - ✅ Zero manual steps (hooks bootstrap themselves automatically) - ✅ Idempotent (skips install if dependencies already exist) Installation now works via simple: ``` /plugin marketplace add https://github.com/thedotmack/claude-mem /plugin install claude-mem ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
77 lines
2.2 KiB
JSON
77 lines
2.2 KiB
JSON
{
|
|
"name": "claude-mem",
|
|
"version": "4.0.5",
|
|
"description": "Memory compression system for Claude Code - persist context across sessions",
|
|
"keywords": [
|
|
"claude",
|
|
"claude-code",
|
|
"claude-agent-sdk",
|
|
"mcp",
|
|
"plugin",
|
|
"memory",
|
|
"compression",
|
|
"knowledge-graph",
|
|
"transcript",
|
|
"typescript",
|
|
"nodejs"
|
|
],
|
|
"author": "Alex Newman",
|
|
"license": "SEE LICENSE IN LICENSE",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/thedotmack/claude-mem.git"
|
|
},
|
|
"homepage": "https://github.com/thedotmack/claude-mem#readme",
|
|
"bugs": {
|
|
"url": "https://github.com/thedotmack/claude-mem/issues"
|
|
},
|
|
"publishConfig": {
|
|
"access": "public",
|
|
"registry": "https://registry.npmjs.org/"
|
|
},
|
|
"type": "module",
|
|
"engines": {
|
|
"node": ">=18.0.0"
|
|
},
|
|
"scripts": {
|
|
"build": "node scripts/build-hooks.js",
|
|
"build:hooks": "node scripts/build-hooks.js",
|
|
"release": "node scripts/publish.js",
|
|
"prepublishOnly": "npm run build",
|
|
"test": "node --test tests/",
|
|
"test:context": "echo '{\"session_id\":\"test-'$(date +%s)'\",\"cwd\":\"'$(pwd)'\",\"source\":\"startup\"}' | node plugin/scripts/context-hook.js 2>/dev/null",
|
|
"test:context:verbose": "echo '{\"session_id\":\"test-'$(date +%s)'\",\"cwd\":\"'$(pwd)'\",\"source\":\"startup\"}' | node plugin/scripts/context-hook.js",
|
|
"import:xml": "tsx src/bin/import-xml-observations.ts",
|
|
"cleanup:duplicates": "tsx src/bin/cleanup-duplicates.ts",
|
|
"worker:start": "npx pm2 start ecosystem.config.cjs",
|
|
"worker:stop": "npx pm2 stop claude-mem-worker",
|
|
"worker:restart": "npx pm2 restart claude-mem-worker",
|
|
"worker:logs": "npx pm2 logs claude-mem-worker",
|
|
"worker:status": "npx pm2 status claude-mem-worker"
|
|
},
|
|
"dependencies": {
|
|
"@anthropic-ai/claude-agent-sdk": "^0.1.0",
|
|
"better-sqlite3": "^11.0.0",
|
|
"express": "^4.18.2",
|
|
"glob": "^11.0.3",
|
|
"handlebars": "^4.7.8",
|
|
"pm2": "^5.3.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/better-sqlite3": "^7.6.8",
|
|
"@types/express": "^4.17.21",
|
|
"@types/node": "^20.0.0",
|
|
"esbuild": "^0.20.0",
|
|
"typescript": "^5.3.0"
|
|
},
|
|
"files": [
|
|
"plugin",
|
|
"src",
|
|
"scripts",
|
|
"docs",
|
|
"ecosystem.config.cjs",
|
|
"LICENSE",
|
|
"README.md"
|
|
]
|
|
}
|