bluera-knowledge 0.21.2 → 0.21.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/CHANGELOG.md +25 -0
- package/dist/mcp/bootstrap.js +15 -0
- package/dist/mcp/bootstrap.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
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.21.4](https://github.com/blueraai/bluera-knowledge/compare/v0.21.1...v0.21.4) (2026-02-01)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **mcp:** add build tools check before native module compilation ([1ece9b8](https://github.com/blueraai/bluera-knowledge/commit/1ece9b84ce39bcc192609a49e64b7a823170d6df))
|
|
11
|
+
* **setup:** add interactive build tools installation prompt ([7ca0572](https://github.com/blueraai/bluera-knowledge/commit/7ca05722d041a4edcf3be4b59582b313d93c222a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **mcp:** add --legacy-peer-deps for npm peer dependency conflicts ([6065dec](https://github.com/blueraai/bluera-knowledge/commit/6065deca2b4c2089c3ff5dce831ba8c122eff412))
|
|
17
|
+
|
|
18
|
+
## [0.21.3](https://github.com/blueraai/bluera-knowledge/compare/v0.21.1...v0.21.3) (2026-02-01)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* **mcp:** add build tools check before native module compilation ([1ece9b8](https://github.com/blueraai/bluera-knowledge/commit/1ece9b84ce39bcc192609a49e64b7a823170d6df))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* **mcp:** add --legacy-peer-deps for npm peer dependency conflicts ([6065dec](https://github.com/blueraai/bluera-knowledge/commit/6065deca2b4c2089c3ff5dce831ba8c122eff412))
|
|
29
|
+
|
|
5
30
|
## [0.21.2](https://github.com/blueraai/bluera-knowledge/compare/v0.21.1...v0.21.2) (2026-02-01)
|
|
6
31
|
|
|
7
32
|
|
package/dist/mcp/bootstrap.js
CHANGED
|
@@ -47,6 +47,19 @@ var getVersion = () => {
|
|
|
47
47
|
return "unknown";
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
+
function checkBuildTools() {
|
|
51
|
+
try {
|
|
52
|
+
execSync("which make", { stdio: "ignore" });
|
|
53
|
+
log("debug", "Build tools available (make found)");
|
|
54
|
+
} catch {
|
|
55
|
+
log("error", "Build tools not found - make is required for native modules", {
|
|
56
|
+
fix: "Install build-essential (Debian/Ubuntu), Development Tools (Fedora), or Xcode CLI Tools (macOS)"
|
|
57
|
+
});
|
|
58
|
+
throw new Error(
|
|
59
|
+
'Build tools not found. Install: sudo apt install build-essential (Debian/Ubuntu), sudo dnf groupinstall "Development Tools" (Fedora), or xcode-select --install (macOS)'
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
50
63
|
function installWithPackageManager() {
|
|
51
64
|
const hasBun = (() => {
|
|
52
65
|
try {
|
|
@@ -95,6 +108,8 @@ function ensureDependencies() {
|
|
|
95
108
|
log("info", "Dependencies already installed", { elapsedMs: Date.now() - startTime });
|
|
96
109
|
return;
|
|
97
110
|
}
|
|
111
|
+
log("debug", "Checking build tools before install");
|
|
112
|
+
checkBuildTools();
|
|
98
113
|
log("debug", "Creating lock file before install");
|
|
99
114
|
writeFileSync(installLockFile, (/* @__PURE__ */ new Date()).toISOString());
|
|
100
115
|
const installStart = Date.now();
|
|
@@ -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 * 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 // 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,KA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AAC9B,MAAI,SAAS,kCAAkC;AAC/C,4BAA0B;AAC1B,MAAI,SAAS,oCAAoC,EAAE,WAAW,KAAK,IAAI,IAAI,aAAa,CAAC;AAGzF,aAAW,eAAe;AAC1B,MAAI,SAAS,+BAA+B,EAAE,gBAAgB,KAAK,IAAI,IAAI,UAAU,CAAC;AACxF;AAGA,IAAM,qBAAqB,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":[]}
|
|
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,SAA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