bluera-knowledge 0.22.6 → 0.22.8

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/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [0.22.8](https://github.com/blueraai/bluera-knowledge/compare/v0.22.4...v0.22.8) (2026-02-01)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **deps:** make tree-sitter optional for Node.js v24 compatibility ([acd6618](https://github.com/blueraai/bluera-knowledge/commit/acd66185813b4841a4c0abdd2edce10db9e08fef))
11
+ * **mcp:** use latest cached version instead of first found ([7943c05](https://github.com/blueraai/bluera-knowledge/commit/7943c0529fb8f36bea00f73233017eee17c733cb))
12
+ * **setup:** add --legacy-peer-deps to resolve tree-sitter peer conflict ([9b0b101](https://github.com/blueraai/bluera-knowledge/commit/9b0b1014e9ec0cec90c63a6a4cfdd81533248b2b))
13
+
14
+ ## [0.22.7](https://github.com/blueraai/bluera-knowledge/compare/v0.22.4...v0.22.7) (2026-02-01)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **deps:** make tree-sitter optional for Node.js v24 compatibility ([acd6618](https://github.com/blueraai/bluera-knowledge/commit/acd66185813b4841a4c0abdd2edce10db9e08fef))
20
+ * **mcp:** use latest cached version instead of first found ([7943c05](https://github.com/blueraai/bluera-knowledge/commit/7943c0529fb8f36bea00f73233017eee17c733cb))
21
+ * **setup:** add --legacy-peer-deps to resolve tree-sitter peer conflict ([9b0b101](https://github.com/blueraai/bluera-knowledge/commit/9b0b1014e9ec0cec90c63a6a4cfdd81533248b2b))
22
+
5
23
  ## [0.22.6](https://github.com/blueraai/bluera-knowledge/compare/v0.22.4...v0.22.6) (2026-02-01)
6
24
 
7
25
 
package/README.md CHANGED
@@ -487,10 +487,20 @@ If the plugin isn't listed, install it:
487
487
 
488
488
  If the MCP server shows as failed after installation:
489
489
 
490
- 1. **Restart Claude Code** - MCP servers require a restart to initialize
491
- 2. **Check logs:** Run `/logs errors` to see recent errors or `/logs module bootstrap` for startup logs
492
- 3. **Check status:** Run `/mcp` to see connection status
493
- 4. **Reinstall:** Try `/plugin uninstall bluera-knowledge` then `/plugin install bluera-knowledge@bluera`
490
+ 1. **Run `/bluera-knowledge:doctor`** - This diagnoses the most common issues
491
+ 2. **Restart Claude Code** - MCP servers require a restart to initialize
492
+ 3. **Check logs:** Run `/logs errors` to see recent errors or `/logs module bootstrap` for startup logs
493
+ 4. **Check status:** Run `/mcp` to see connection status
494
+ 5. **Reinstall:** Try `/plugin uninstall bluera-knowledge` then `/plugin install bluera-knowledge@bluera`
495
+
496
+ **Common MCP failure causes:**
497
+
498
+ | Symptom | Cause | Fix |
499
+ |---------|-------|-----|
500
+ | `npm ERR! ERESOLVE` in logs | Peer dependency conflict | Fixed in v0.22.6+ with npm flag |
501
+ | Old plugin version running | Multiple cached versions | Fixed in v0.22.7+ (version sorting) |
502
+ | `make not found` | Missing build tools | Install `build-essential` (Linux) |
503
+ | Compilation errors on Node 24 | V8 API changes | Use Node.js v20.x or v22.x |
494
504
 
495
505
  If the issue persists, check that Claude Code is v2.0.65 or later (earlier versions had MCP loading bugs).
496
506
  </details>
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/mcp/bootstrap.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * MCP Server Bootstrap - installs dependencies before starting server.\n *\n * Uses only Node.js built-ins (no external dependencies required).\n * Self-locates plugin root via import.meta.url (doesn't rely on CLAUDE_PLUGIN_ROOT).\n *\n * Dependency installation strategy:\n * 1. Fast path: node_modules already exists → skip\n * 2. Package manager: Run bun install or npm install\n *\n * IMPORTANT: MCP servers must NOT log to stderr - Claude Code treats stderr output\n * as an error and may mark the MCP server as failed. All logging goes to file.\n */\nimport { execSync } from 'node:child_process';\nimport {\n appendFileSync,\n existsSync,\n mkdirSync,\n readFileSync,\n rmSync,\n unlinkSync,\n writeFileSync,\n} from 'node:fs';\nimport { homedir } from 'node:os';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n// Logging helper - writes to file since MCP servers must NOT use stderr\n// (Claude Code treats stderr as error and may fail the server)\n// JSON format matches pino output for consistency\n// Use PROJECT_ROOT if available (set by Claude Code), else fall back to home dir\nconst envProjectRoot = process.env['PROJECT_ROOT'];\nconst logDir =\n envProjectRoot !== undefined && envProjectRoot !== ''\n ? join(envProjectRoot, '.bluera', 'bluera-knowledge', 'logs')\n : join(homedir(), '.bluera', 'bluera-knowledge', 'logs');\nconst logFile = join(logDir, 'app.log');\n\nconst log = (\n level: 'info' | 'error' | 'debug',\n msg: string,\n data?: Record<string, unknown>\n): void => {\n try {\n mkdirSync(logDir, { recursive: true });\n const entry = {\n time: new Date().toISOString(),\n level,\n module: 'bootstrap',\n msg,\n ...data,\n };\n appendFileSync(logFile, `${JSON.stringify(entry)}\\n`);\n } catch {\n // Silently fail - we cannot use stderr for MCP servers\n }\n};\n\n// Self-locate plugin root from this file's path\n// dist/mcp/bootstrap.js -> plugin root (two directories up)\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\nconst pluginRoot = join(__dirname, '..', '..');\n\n// Lock file to detect interrupted installs\nconst installLockFile = join(pluginRoot, '.node_modules_installing');\n\n// Get version from package.json for logging\nconst getVersion = (): string => {\n try {\n const pkg: unknown = JSON.parse(readFileSync(join(pluginRoot, 'package.json'), 'utf-8'));\n if (\n typeof pkg === 'object' &&\n pkg !== null &&\n 'version' in pkg &&\n typeof pkg.version === 'string'\n ) {\n return `v${pkg.version}`;\n }\n return 'unknown';\n } catch {\n return 'unknown';\n }\n};\n\n/**\n * Check if build tools are available for native module compilation.\n * Logs error to file and throws if make is not found.\n */\nfunction checkBuildTools(): void {\n try {\n execSync('which make', { stdio: 'ignore' });\n log('debug', 'Build tools available (make found)');\n } catch {\n log('error', 'Build tools not found - make is required for native modules', {\n fix: 'Install build-essential (Debian/Ubuntu), Development Tools (Fedora), or Xcode CLI Tools (macOS)',\n });\n throw new Error(\n 'Build tools not found. Install: sudo apt install build-essential (Debian/Ubuntu), ' +\n 'sudo dnf groupinstall \"Development Tools\" (Fedora), or xcode-select --install (macOS)'\n );\n }\n}\n\n/**\n * Install dependencies using bun or npm.\n * Uses stdio: 'pipe' to capture output and avoid corrupting MCP stdio transport.\n */\nfunction installWithPackageManager(): void {\n const hasBun = ((): boolean => {\n try {\n execSync('which bun', { stdio: 'ignore' });\n return true;\n } catch {\n return false;\n }\n })();\n\n const cmd = hasBun ? 'bun install --frozen-lockfile' : 'npm install --legacy-peer-deps --silent';\n log('info', 'Installing dependencies with package manager', { hasBun, cmd });\n\n try {\n // Use stdio: 'pipe' to capture output - 'inherit' would corrupt MCP stdio transport\n const output = execSync(cmd, { cwd: pluginRoot, stdio: 'pipe' });\n if (output.length > 0) {\n log('debug', 'Install output', { output: output.toString().trim() });\n }\n log('info', 'Dependencies installed via package manager');\n } catch (error) {\n // Log installation failure details before re-throwing\n // execSync throws an object with stdout/stderr buffers on failure\n const errorMessage = error instanceof Error ? error.message : String(error);\n const errorDetails: Record<string, unknown> = { message: errorMessage };\n\n if (typeof error === 'object' && error !== null) {\n if ('stdout' in error && Buffer.isBuffer(error.stdout)) {\n errorDetails['stdout'] = error.stdout.toString().trim();\n }\n if ('stderr' in error && Buffer.isBuffer(error.stderr)) {\n errorDetails['stderr'] = error.stderr.toString().trim();\n }\n }\n\n log('error', 'Dependency installation failed', errorDetails);\n throw error;\n }\n}\n\n/**\n * Ensure dependencies are available.\n * Uses a lock file to detect and recover from interrupted installs.\n */\nfunction ensureDependencies(): void {\n const startTime = Date.now();\n log('debug', 'ensureDependencies starting');\n\n const nodeModulesPath = join(pluginRoot, 'node_modules');\n\n // Check for interrupted install - lock file exists means previous install was killed\n log('debug', 'Checking for interrupted install lock file', { lockFile: installLockFile });\n if (existsSync(installLockFile)) {\n log('info', 'Detected interrupted install, cleaning up');\n rmSync(nodeModulesPath, { recursive: true, force: true });\n unlinkSync(installLockFile);\n log('debug', 'Cleanup complete');\n }\n\n // Fast path: already installed\n log('debug', 'Checking node_modules exists', { path: nodeModulesPath });\n if (existsSync(nodeModulesPath)) {\n log('info', 'Dependencies already installed', { elapsedMs: Date.now() - startTime });\n return;\n }\n\n // Check build tools before attempting install\n log('debug', 'Checking build tools before install');\n checkBuildTools();\n\n // Create lock file before install (left behind if install interrupted/fails)\n log('debug', 'Creating lock file before install');\n writeFileSync(installLockFile, new Date().toISOString());\n\n const installStart = Date.now();\n log('debug', 'Starting package manager install');\n installWithPackageManager();\n log('debug', 'Package manager install finished', { elapsedMs: Date.now() - installStart });\n\n // Remove lock file on success\n unlinkSync(installLockFile);\n log('debug', 'ensureDependencies complete', { totalElapsedMs: Date.now() - startTime });\n}\n\n// Main entry point\nconst bootstrapStartTime = Date.now();\nconst VERSION = getVersion();\nlog('info', 'Bootstrap starting', { pluginRoot, version: VERSION });\n\nlog('debug', 'Calling ensureDependencies');\nensureDependencies();\nlog('debug', 'ensureDependencies returned', { elapsedMs: Date.now() - bootstrapStartTime });\n\n// Now that dependencies are installed, import and run the server\n// Dynamic import required because @modelcontextprotocol/sdk wouldn't be available before install\nlog('info', 'Loading server module');\nconst importStart = Date.now();\nconst { runMCPServer } = await import('./server.js');\nlog('debug', 'Server module loaded', { elapsedMs: Date.now() - importStart });\n\nconst projectRoot = process.env['PROJECT_ROOT'];\nif (projectRoot === undefined) {\n throw new Error('PROJECT_ROOT environment variable is required');\n}\n\nlog('info', 'Starting MCP server', {\n projectRoot,\n dataDir: process.env['DATA_DIR'],\n});\n\nawait runMCPServer({\n dataDir: process.env['DATA_DIR'],\n config: process.env['CONFIG_PATH'],\n projectRoot,\n});\n"],"mappings":";;;AAcA,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP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;AAED,MAAM,aAAa;AAAA,EACjB,SAAS,QAAQ,IAAI,UAAU;AAAA,EAC/B,QAAQ,QAAQ,IAAI,aAAa;AAAA,EACjC;AACF,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../src/mcp/bootstrap.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * MCP Server Bootstrap - installs dependencies before starting server.\n *\n * Uses only Node.js built-ins (no external dependencies required).\n * Self-locates plugin root via import.meta.url (doesn't rely on CLAUDE_PLUGIN_ROOT).\n *\n * Dependency installation strategy:\n * 1. Fast path: node_modules already exists → skip\n * 2. Package manager: Run bun install or npm install\n *\n * IMPORTANT: MCP servers must NOT log to stderr - Claude Code treats stderr output\n * as an error and may mark the MCP server as failed. All logging goes to file.\n */\nimport { execSync } from 'node:child_process';\nimport {\n appendFileSync,\n existsSync,\n mkdirSync,\n readFileSync,\n rmSync,\n unlinkSync,\n writeFileSync,\n} from 'node:fs';\nimport { homedir } from 'node:os';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n// Logging helper - writes to file since MCP servers must NOT use stderr\n// (Claude Code treats stderr as error and may fail the server)\n// JSON format matches pino output for consistency\n// Use PROJECT_ROOT if available (set by Claude Code), else fall back to home dir\nconst envProjectRoot = process.env['PROJECT_ROOT'];\nconst logDir =\n envProjectRoot !== undefined && envProjectRoot !== ''\n ? join(envProjectRoot, '.bluera', 'bluera-knowledge', 'logs')\n : join(homedir(), '.bluera', 'bluera-knowledge', 'logs');\nconst logFile = join(logDir, 'app.log');\n\nconst log = (\n level: 'info' | 'error' | 'debug',\n msg: string,\n data?: Record<string, unknown>\n): void => {\n try {\n mkdirSync(logDir, { recursive: true });\n const entry = {\n time: new Date().toISOString(),\n level,\n module: 'bootstrap',\n msg,\n ...data,\n };\n appendFileSync(logFile, `${JSON.stringify(entry)}\\n`);\n } catch {\n // Silently fail - we cannot use stderr for MCP servers\n }\n};\n\n// Self-locate plugin root from this file's path\n// dist/mcp/bootstrap.js -> plugin root (two directories up)\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\nconst pluginRoot = join(__dirname, '..', '..');\n\n// Lock file to detect interrupted installs\nconst installLockFile = join(pluginRoot, '.node_modules_installing');\n\n// Get version from package.json for logging\nconst getVersion = (): string => {\n try {\n const pkg: unknown = JSON.parse(readFileSync(join(pluginRoot, 'package.json'), 'utf-8'));\n if (\n typeof pkg === 'object' &&\n pkg !== null &&\n 'version' in pkg &&\n typeof pkg.version === 'string'\n ) {\n return `v${pkg.version}`;\n }\n return 'unknown';\n } catch {\n return 'unknown';\n }\n};\n\n/**\n * Check if build tools are available for native module compilation.\n * Logs error to file and throws if make is not found.\n */\nfunction checkBuildTools(): void {\n try {\n execSync('which make', { stdio: 'ignore' });\n log('debug', 'Build tools available (make found)');\n } catch {\n log('error', 'Build tools not found - make is required for native modules', {\n fix: 'Install build-essential (Debian/Ubuntu), Development Tools (Fedora), or Xcode CLI Tools (macOS)',\n });\n throw new Error(\n 'Build tools not found. Install: sudo apt install build-essential (Debian/Ubuntu), ' +\n 'sudo dnf groupinstall \"Development Tools\" (Fedora), or xcode-select --install (macOS)'\n );\n }\n}\n\n/**\n * Install dependencies using bun or npm.\n * Uses stdio: 'pipe' to capture output and avoid corrupting MCP stdio transport.\n */\nfunction installWithPackageManager(): void {\n const hasBun = ((): boolean => {\n try {\n execSync('which bun', { stdio: 'ignore' });\n return true;\n } catch {\n return false;\n }\n })();\n\n // CRITICAL: npm needs peer-deps bypass flag (tree-sitter-go/rust have conflicting requirements)\n const cmd = hasBun ? 'bun install --frozen-lockfile' : 'npm install --legacy-peer-deps --silent';\n log('info', 'Installing dependencies with package manager', { hasBun, cmd });\n\n try {\n // Use stdio: 'pipe' to capture output - 'inherit' would corrupt MCP stdio transport\n const output = execSync(cmd, { cwd: pluginRoot, stdio: 'pipe' });\n if (output.length > 0) {\n log('debug', 'Install output', { output: output.toString().trim() });\n }\n log('info', 'Dependencies installed via package manager');\n } catch (error) {\n // Log installation failure details before re-throwing\n // execSync throws an object with stdout/stderr buffers on failure\n const errorMessage = error instanceof Error ? error.message : String(error);\n const errorDetails: Record<string, unknown> = { message: errorMessage };\n\n if (typeof error === 'object' && error !== null) {\n if ('stdout' in error && Buffer.isBuffer(error.stdout)) {\n errorDetails['stdout'] = error.stdout.toString().trim();\n }\n if ('stderr' in error && Buffer.isBuffer(error.stderr)) {\n errorDetails['stderr'] = error.stderr.toString().trim();\n }\n }\n\n log('error', 'Dependency installation failed', errorDetails);\n throw error;\n }\n}\n\n/**\n * Ensure dependencies are available.\n * Uses a lock file to detect and recover from interrupted installs.\n */\nfunction ensureDependencies(): void {\n const startTime = Date.now();\n log('debug', 'ensureDependencies starting');\n\n const nodeModulesPath = join(pluginRoot, 'node_modules');\n\n // Check for interrupted install - lock file exists means previous install was killed\n log('debug', 'Checking for interrupted install lock file', { lockFile: installLockFile });\n if (existsSync(installLockFile)) {\n log('info', 'Detected interrupted install, cleaning up');\n rmSync(nodeModulesPath, { recursive: true, force: true });\n unlinkSync(installLockFile);\n log('debug', 'Cleanup complete');\n }\n\n // Fast path: already installed\n log('debug', 'Checking node_modules exists', { path: nodeModulesPath });\n if (existsSync(nodeModulesPath)) {\n log('info', 'Dependencies already installed', { elapsedMs: Date.now() - startTime });\n return;\n }\n\n // Check build tools before attempting install\n log('debug', 'Checking build tools before install');\n checkBuildTools();\n\n // Create lock file before install (left behind if install interrupted/fails)\n log('debug', 'Creating lock file before install');\n writeFileSync(installLockFile, new Date().toISOString());\n\n const installStart = Date.now();\n log('debug', 'Starting package manager install');\n installWithPackageManager();\n log('debug', 'Package manager install finished', { elapsedMs: Date.now() - installStart });\n\n // Remove lock file on success\n unlinkSync(installLockFile);\n log('debug', 'ensureDependencies complete', { totalElapsedMs: Date.now() - startTime });\n}\n\n// Main entry point\nconst bootstrapStartTime = Date.now();\nconst VERSION = getVersion();\nlog('info', 'Bootstrap starting', { pluginRoot, version: VERSION });\n\nlog('debug', 'Calling ensureDependencies');\nensureDependencies();\nlog('debug', 'ensureDependencies returned', { elapsedMs: Date.now() - bootstrapStartTime });\n\n// Now that dependencies are installed, import and run the server\n// Dynamic import required because @modelcontextprotocol/sdk wouldn't be available before install\nlog('info', 'Loading server module');\nconst importStart = Date.now();\nconst { runMCPServer } = await import('./server.js');\nlog('debug', 'Server module loaded', { elapsedMs: Date.now() - importStart });\n\nconst projectRoot = process.env['PROJECT_ROOT'];\nif (projectRoot === undefined) {\n throw new Error('PROJECT_ROOT environment variable is required');\n}\n\nlog('info', 'Starting MCP server', {\n projectRoot,\n dataDir: process.env['DATA_DIR'],\n});\n\nawait runMCPServer({\n dataDir: process.env['DATA_DIR'],\n config: process.env['CONFIG_PATH'],\n projectRoot,\n});\n"],"mappings":";;;AAcA,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe;AACxB,SAAS,SAAS,YAAY;AAC9B,SAAS,qBAAqB;AAM9B,IAAM,iBAAiB,QAAQ,IAAI,cAAc;AACjD,IAAM,SACJ,mBAAmB,UAAa,mBAAmB,KAC/C,KAAK,gBAAgB,WAAW,oBAAoB,MAAM,IAC1D,KAAK,QAAQ,GAAG,WAAW,oBAAoB,MAAM;AAC3D,IAAM,UAAU,KAAK,QAAQ,SAAS;AAEtC,IAAM,MAAM,CACV,OACA,KACA,SACS;AACT,MAAI;AACF,cAAU,QAAQ,EAAE,WAAW,KAAK,CAAC;AACrC,UAAM,QAAQ;AAAA,MACZ,OAAM,oBAAI,KAAK,GAAE,YAAY;AAAA,MAC7B;AAAA,MACA,QAAQ;AAAA,MACR;AAAA,MACA,GAAG;AAAA,IACL;AACA,mBAAe,SAAS,GAAG,KAAK,UAAU,KAAK,CAAC;AAAA,CAAI;AAAA,EACtD,QAAQ;AAAA,EAER;AACF;AAIA,IAAM,aAAa,cAAc,YAAY,GAAG;AAChD,IAAM,YAAY,QAAQ,UAAU;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KAAK,IAAI;AACpC,IAAM,UAAU,WAAW;AAC3B,IAAI,QAAQ,sBAAsB,EAAE,YAAY,SAAS,QAAQ,CAAC;AAElE,IAAI,SAAS,4BAA4B;AACzC,mBAAmB;AACnB,IAAI,SAAS,+BAA+B,EAAE,WAAW,KAAK,IAAI,IAAI,mBAAmB,CAAC;AAI1F,IAAI,QAAQ,uBAAuB;AACnC,IAAM,cAAc,KAAK,IAAI;AAC7B,IAAM,EAAE,aAAa,IAAI,MAAM,OAAO,aAAa;AACnD,IAAI,SAAS,wBAAwB,EAAE,WAAW,KAAK,IAAI,IAAI,YAAY,CAAC;AAE5E,IAAM,cAAc,QAAQ,IAAI,cAAc;AAC9C,IAAI,gBAAgB,QAAW;AAC7B,QAAM,IAAI,MAAM,+CAA+C;AACjE;AAEA,IAAI,QAAQ,uBAAuB;AAAA,EACjC;AAAA,EACA,SAAS,QAAQ,IAAI,UAAU;AACjC,CAAC;AAED,MAAM,aAAa;AAAA,EACjB,SAAS,QAAQ,IAAI,UAAU;AAAA,EAC/B,QAAQ,QAAQ,IAAI,aAAa;AAAA,EACjC;AACF,CAAC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bluera-knowledge",
3
- "version": "0.22.6",
3
+ "version": "0.22.8",
4
4
  "description": "CLI tool for managing knowledge stores with semantic search",
5
5
  "type": "module",
6
6
  "bin": {