bluera-knowledge 0.16.6 → 0.17.1

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/{chunk-OMC3RAZT.js → chunk-RAXRD23K.js} +2 -2
  3. package/dist/{chunk-WYZQUKUD.js → chunk-VKTVMW45.js} +28 -18
  4. package/dist/chunk-VKTVMW45.js.map +1 -0
  5. package/dist/{chunk-3EQRQOXD.js → chunk-ZGEQCLOZ.js} +2 -2
  6. package/dist/index.js +3 -3
  7. package/dist/mcp/bootstrap.js +19 -2
  8. package/dist/mcp/bootstrap.js.map +1 -1
  9. package/dist/mcp/server.d.ts +1 -0
  10. package/dist/mcp/server.js +2 -2
  11. package/dist/workers/background-worker-cli.js +2 -2
  12. package/package.json +1 -5
  13. package/.claude-plugin/plugin.json +0 -9
  14. package/commands/add-folder.md +0 -48
  15. package/commands/add-repo.md +0 -50
  16. package/commands/cancel.md +0 -63
  17. package/commands/check-status.md +0 -78
  18. package/commands/crawl.md +0 -54
  19. package/commands/index.md +0 -48
  20. package/commands/remove-store.md +0 -52
  21. package/commands/search.md +0 -86
  22. package/commands/search.sh +0 -63
  23. package/commands/skill-activation.md +0 -130
  24. package/commands/stores.md +0 -54
  25. package/commands/suggest.md +0 -82
  26. package/commands/sync.md +0 -96
  27. package/commands/test-plugin.md +0 -408
  28. package/commands/uninstall.md +0 -65
  29. package/dist/chunk-WYZQUKUD.js.map +0 -1
  30. package/hooks/check-dependencies.sh +0 -145
  31. package/hooks/format-search-results.py +0 -132
  32. package/hooks/hooks.json +0 -54
  33. package/hooks/job-status-hook.sh +0 -51
  34. package/hooks/posttooluse-bk-reminder.py +0 -166
  35. package/hooks/skill-activation.py +0 -194
  36. package/hooks/skill-rules.json +0 -122
  37. package/skills/advanced-workflows/SKILL.md +0 -273
  38. package/skills/knowledge-search/SKILL.md +0 -110
  39. package/skills/search-optimization/SKILL.md +0 -396
  40. package/skills/store-lifecycle/SKILL.md +0 -470
  41. package/skills/when-to-query/SKILL.md +0 -160
  42. /package/dist/{chunk-OMC3RAZT.js.map → chunk-RAXRD23K.js.map} +0 -0
  43. /package/dist/{chunk-3EQRQOXD.js.map → chunk-ZGEQCLOZ.js.map} +0 -0
@@ -10,7 +10,7 @@ import {
10
10
  isRepoStoreDefinition,
11
11
  isWebStoreDefinition,
12
12
  summarizePayload
13
- } from "./chunk-WYZQUKUD.js";
13
+ } from "./chunk-VKTVMW45.js";
14
14
 
15
15
  // src/mcp/server.ts
16
16
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
@@ -2155,4 +2155,4 @@ export {
2155
2155
  createMCPServer,
2156
2156
  runMCPServer
2157
2157
  };
2158
- //# sourceMappingURL=chunk-3EQRQOXD.js.map
2158
+ //# sourceMappingURL=chunk-ZGEQCLOZ.js.map
package/dist/index.js CHANGED
@@ -3,11 +3,11 @@ import {
3
3
  ZilAdapter,
4
4
  runMCPServer,
5
5
  spawnBackgroundWorker
6
- } from "./chunk-3EQRQOXD.js";
6
+ } from "./chunk-ZGEQCLOZ.js";
7
7
  import {
8
8
  IntelligentCrawler,
9
9
  getCrawlStrategy
10
- } from "./chunk-OMC3RAZT.js";
10
+ } from "./chunk-RAXRD23K.js";
11
11
  import {
12
12
  ASTParser,
13
13
  AdapterRegistry,
@@ -25,7 +25,7 @@ import {
25
25
  isRepoStoreDefinition,
26
26
  isWebStoreDefinition,
27
27
  ok
28
- } from "./chunk-WYZQUKUD.js";
28
+ } from "./chunk-VKTVMW45.js";
29
29
  import "./chunk-HRQD3MPH.js";
30
30
 
31
31
  // src/index.ts
@@ -2,7 +2,15 @@
2
2
 
3
3
  // src/mcp/bootstrap.ts
4
4
  import { execSync } from "child_process";
5
- import { appendFileSync, existsSync, mkdirSync, readFileSync } from "fs";
5
+ import {
6
+ appendFileSync,
7
+ existsSync,
8
+ mkdirSync,
9
+ readFileSync,
10
+ rmSync,
11
+ unlinkSync,
12
+ writeFileSync
13
+ } from "fs";
6
14
  import { homedir } from "os";
7
15
  import { dirname, join } from "path";
8
16
  import { fileURLToPath } from "url";
@@ -26,6 +34,7 @@ var log = (level, msg, data) => {
26
34
  var __filename = fileURLToPath(import.meta.url);
27
35
  var __dirname = dirname(__filename);
28
36
  var pluginRoot = join(__dirname, "..", "..");
37
+ var installLockFile = join(pluginRoot, ".node_modules_installing");
29
38
  var getVersion = () => {
30
39
  try {
31
40
  const pkg = JSON.parse(readFileSync(join(pluginRoot, "package.json"), "utf-8"));
@@ -52,11 +61,19 @@ function installWithPackageManager() {
52
61
  log("info", "Dependencies installed via package manager");
53
62
  }
54
63
  function ensureDependencies() {
55
- if (existsSync(join(pluginRoot, "node_modules"))) {
64
+ const nodeModulesPath = join(pluginRoot, "node_modules");
65
+ if (existsSync(installLockFile)) {
66
+ log("info", "Detected interrupted install, cleaning up");
67
+ rmSync(nodeModulesPath, { recursive: true, force: true });
68
+ unlinkSync(installLockFile);
69
+ }
70
+ if (existsSync(nodeModulesPath)) {
56
71
  log("info", "Dependencies already installed");
57
72
  return;
58
73
  }
74
+ writeFileSync(installLockFile, (/* @__PURE__ */ new Date()).toISOString());
59
75
  installWithPackageManager();
76
+ unlinkSync(installLockFile);
60
77
  }
61
78
  var VERSION = getVersion();
62
79
  log("info", "Bootstrap starting", { pluginRoot, version: VERSION });
@@ -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 ci\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 { appendFileSync, existsSync, mkdirSync, readFileSync } 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\nconst logDir = 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// 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 */\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 ci --silent';\n log('info', 'Installing dependencies with package manager', { hasBun, cmd });\n execSync(cmd, { cwd: pluginRoot, stdio: 'inherit' });\n log('info', 'Dependencies installed via package manager');\n}\n\n/**\n * Ensure dependencies are available.\n */\nfunction ensureDependencies(): void {\n // Fast path: already installed\n if (existsSync(join(pluginRoot, 'node_modules'))) {\n log('info', 'Dependencies already installed');\n return;\n }\n\n // Install via package manager\n installWithPackageManager();\n}\n\n// Main entry point\nconst VERSION = getVersion();\nlog('info', 'Bootstrap starting', { pluginRoot, version: VERSION });\n\nensureDependencies();\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 { runMCPServer } = await import('./server.js');\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,SAAS,gBAAgB,YAAY,WAAW,oBAAoB;AACpE,SAAS,eAAe;AACxB,SAAS,SAAS,YAAY;AAC9B,SAAS,qBAAqB;AAK9B,IAAM,SAAS,KAAK,QAAQ,GAAG,WAAW,oBAAoB,MAAM;AACpE,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;AACpC,IAAM,aAAa,KAAK,WAAW,MAAM,IAAI;AAG7C,IAAM,aAAa,MAAc;AAC/B,MAAI;AACF,UAAM,MAAe,KAAK,MAAM,aAAa,KAAK,YAAY,cAAc,GAAG,OAAO,CAAC;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s 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 ci\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\nconst logDir = 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 */\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 ci --silent';\n log('info', 'Installing dependencies with package manager', { hasBun, cmd });\n execSync(cmd, { cwd: pluginRoot, stdio: 'inherit' });\n log('info', 'Dependencies installed via package manager');\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 nodeModulesPath = join(pluginRoot, 'node_modules');\n\n // Check for interrupted install - lock file exists means previous install was killed\n if (existsSync(installLockFile)) {\n log('info', 'Detected interrupted install, cleaning up');\n rmSync(nodeModulesPath, { recursive: true, force: true });\n unlinkSync(installLockFile);\n }\n\n // Fast path: already installed\n if (existsSync(nodeModulesPath)) {\n log('info', 'Dependencies already installed');\n return;\n }\n\n // Create lock file before install (left behind if install interrupted/fails)\n writeFileSync(installLockFile, new Date().toISOString());\n\n installWithPackageManager();\n\n // Remove lock file on success\n unlinkSync(installLockFile);\n}\n\n// Main entry point\nconst VERSION = getVersion();\nlog('info', 'Bootstrap starting', { pluginRoot, version: VERSION });\n\nensureDependencies();\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 { runMCPServer } = await import('./server.js');\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;AA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CAAC;AACnD,MAAI,QAAQ,4CAA4C;AAC1D;AAMA,SAAS,qBAA2B;AAClC,QAAM,kBAAkB,KAAK,YAAY,cAAc;AAGvD,MAAI,WAAW,eAAe,GAAG;AAC/B,QAAI,QAAQ,2CAA2C;AACvD,WAAO,iBAAiB,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AACxD,eAAW,eAAe;AAAA,EAC5B;AAGA,MAAI,WAAW,eAAe,GAAG;AAC/B,QAAI,QAAQ,gCAAgC;AAC5C;AAAA,EACF;AAGA,gBAAc,kBAAiB,oBAAI,KAAK,GAAE,YAAY,CAAC;AAEvD,4BAA0B;AAG1B,aAAW,eAAe;AAC5B;AAGA,IAAM,UAAU,WAAW;AAC3B,IAAI,QAAQ,sBAAsB,EAAE,YAAY,SAAS,QAAQ,CAAC;AAElE,mBAAmB;AAInB,IAAI,QAAQ,uBAAuB;AACnC,IAAM,EAAE,aAAa,IAAI,MAAM,OAAO,aAAa;AAEnD,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":[]}
@@ -277,6 +277,7 @@ declare class ConfigService {
277
277
  load(): Promise<AppConfig>;
278
278
  save(config: AppConfig): Promise<void>;
279
279
  resolveDataDir(): string;
280
+ resolveConfigPath(): string;
280
281
  private expandPath;
281
282
  }
282
283
 
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createMCPServer,
3
3
  runMCPServer
4
- } from "../chunk-3EQRQOXD.js";
5
- import "../chunk-WYZQUKUD.js";
4
+ } from "../chunk-ZGEQCLOZ.js";
5
+ import "../chunk-VKTVMW45.js";
6
6
  import "../chunk-HRQD3MPH.js";
7
7
  export {
8
8
  createMCPServer,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  IntelligentCrawler
4
- } from "../chunk-OMC3RAZT.js";
4
+ } from "../chunk-RAXRD23K.js";
5
5
  import {
6
6
  JobService,
7
7
  createDocumentId,
@@ -10,7 +10,7 @@ import {
10
10
  createStoreId,
11
11
  destroyServices,
12
12
  shutdownLogger
13
- } from "../chunk-WYZQUKUD.js";
13
+ } from "../chunk-VKTVMW45.js";
14
14
  import "../chunk-HRQD3MPH.js";
15
15
 
16
16
  // src/workers/background-worker-cli.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bluera-knowledge",
3
- "version": "0.16.6",
3
+ "version": "0.17.1",
4
4
  "description": "CLI tool for managing knowledge stores with semantic search",
5
5
  "type": "module",
6
6
  "bin": {
@@ -67,10 +67,6 @@
67
67
  "files": [
68
68
  "dist/",
69
69
  "python/",
70
- "hooks/",
71
- "commands/",
72
- "skills/",
73
- ".claude-plugin/",
74
70
  "README.md",
75
71
  "CHANGELOG.md",
76
72
  "LICENSE"
@@ -1,9 +0,0 @@
1
- {
2
- "name": "bluera-knowledge",
3
- "version": "0.16.6",
4
- "description": "Clone repos, crawl docs, search locally. Fast, authoritative answers for AI coding agents.",
5
- "author": {
6
- "name": "Bluera Inc",
7
- "url": "https://bluera.ai"
8
- }
9
- }
@@ -1,48 +0,0 @@
1
- ---
2
- description: Index a local folder of reference material
3
- argument-hint: "[path] [--name store-name]"
4
- allowed-tools: ["mcp__bluera-knowledge__execute"]
5
- ---
6
-
7
- # Add Local Folder to Knowledge Stores
8
-
9
- Index a local folder of reference material: **$ARGUMENTS**
10
-
11
- ## Steps
12
-
13
- 1. Parse arguments from $ARGUMENTS:
14
- - Extract the folder path (required, first positional argument)
15
- - Extract --name parameter (optional, defaults to folder name)
16
-
17
- 2. Use mcp__bluera-knowledge__execute tool with command "store:create":
18
- - args.name: Store name (from --name or folder basename)
19
- - args.type: "file"
20
- - args.source: The folder path
21
-
22
- 3. Display results showing job ID for background indexing:
23
-
24
- ```
25
- ✓ Adding folder: /Users/me/my-docs...
26
- ✓ Created store: my-docs (e5f6g7h8...)
27
- Location: ~/.local/share/bluera-knowledge/stores/e5f6g7h8.../
28
-
29
- 🔄 Indexing started in background
30
- Job ID: job_xyz789abc123
31
-
32
- Check status with: /bluera-knowledge:check-status job_xyz789abc123
33
- Or view all jobs: /bluera-knowledge:check-status
34
- ```
35
-
36
- ## Error Handling
37
-
38
- If creation fails (e.g., path doesn't exist, permission denied):
39
-
40
- ```
41
- ✗ Failed to add folder: [error message]
42
-
43
- Common issues:
44
- - Check that the path exists
45
- - Ensure you have read permissions for the folder
46
- - Verify the path is a directory, not a file
47
- - Use absolute paths to avoid ambiguity
48
- ```
@@ -1,50 +0,0 @@
1
- ---
2
- description: Clone and index a library source repository
3
- argument-hint: "[git-url] [--name store-name] [--branch branch-name]"
4
- allowed-tools: ["mcp__bluera-knowledge__execute"]
5
- ---
6
-
7
- # Add Repository to Knowledge Stores
8
-
9
- Clone and index a library source repository: **$ARGUMENTS**
10
-
11
- ## Steps
12
-
13
- 1. Parse arguments from $ARGUMENTS:
14
- - Extract the git URL (required, first positional argument)
15
- - Extract --name parameter (optional, defaults to repo name from URL)
16
- - Extract --branch parameter (optional, defaults to default branch)
17
-
18
- 2. Use mcp__bluera-knowledge__execute tool with command "store:create":
19
- - args.name: Store name (from --name or extracted from URL)
20
- - args.type: "repo"
21
- - args.source: The git URL
22
- - args.branch: Branch name (if --branch specified)
23
-
24
- 3. Display results showing job ID for background indexing:
25
-
26
- ```
27
- ✓ Cloning https://github.com/facebook/react...
28
- ✓ Created store: react (a1b2c3d4...)
29
- Location: ~/.local/share/bluera-knowledge/stores/a1b2c3d4.../
30
-
31
- 🔄 Indexing started in background
32
- Job ID: job_abc123def456
33
-
34
- Check status with: /bluera-knowledge:check-status job_abc123def456
35
- Or view all jobs: /bluera-knowledge:check-status
36
- ```
37
-
38
- ## Error Handling
39
-
40
- If creation fails (e.g., invalid URL, network error, git not available):
41
-
42
- ```
43
- ✗ Failed to clone repository: [error message]
44
-
45
- Common issues:
46
- - Check that the git URL is valid and accessible
47
- - Ensure you have network connectivity
48
- - Verify git is installed on your system
49
- - For private repos, check your SSH keys or credentials
50
- ```
@@ -1,63 +0,0 @@
1
- ---
2
- description: Cancel a background job
3
- argument-hint: "[job-id]"
4
- allowed-tools: ["mcp__bluera-knowledge__execute"]
5
- ---
6
-
7
- # Cancel Background Job
8
-
9
- Cancel a running or pending background job: **$ARGUMENTS**
10
-
11
- ## Steps
12
-
13
- 1. Parse the job ID from $ARGUMENTS (required)
14
- - If no job ID provided, show error and suggest using /bluera-knowledge:check-status to list active jobs
15
-
16
- 2. Use mcp__bluera-knowledge__execute tool with command "job:cancel":
17
- - args.jobId: The job ID from $ARGUMENTS
18
-
19
- 3. Display cancellation result:
20
-
21
- ```
22
- ✓ Job job_abc123def456 cancelled
23
- Type: clone
24
- Progress: 45% (was indexing)
25
-
26
- The job has been stopped and will not continue.
27
- ```
28
-
29
- ## When to Cancel
30
-
31
- Cancel a job when:
32
- - You accidentally started indexing the wrong repository
33
- - The operation is taking too long and you want to try a different approach
34
- - You need to free up system resources
35
- - You want to stop an operation before it completes
36
-
37
- ## Important Notes
38
-
39
- - Only jobs in 'pending' or 'running' status can be cancelled
40
- - Completed or failed jobs cannot be cancelled
41
- - Cancelled jobs are marked with status 'cancelled' and remain in the job list
42
- - Partial work may be saved (e.g., partially indexed files remain in the database)
43
-
44
- ## Error Handling
45
-
46
- If job cannot be cancelled:
47
-
48
- ```
49
- ✗ Cannot cancel job job_abc123def456: Job has already completed
50
-
51
- Only pending or running jobs can be cancelled.
52
- ```
53
-
54
- If job not found:
55
-
56
- ```
57
- ✗ Job not found: job_abc123def456
58
-
59
- Common issues:
60
- - Check the job ID is correct
61
- - Use /bluera-knowledge:check-status to see all active jobs
62
- - Job may have already completed and been cleaned up
63
- ```
@@ -1,78 +0,0 @@
1
- ---
2
- description: Check status of background operations
3
- argument-hint: "[job-id]"
4
- allowed-tools: ["mcp__bluera-knowledge__execute"]
5
- ---
6
-
7
- # Check Background Job Status
8
-
9
- Check the status of a background operation: **$ARGUMENTS**
10
-
11
- ## Steps
12
-
13
- 1. Parse $ARGUMENTS:
14
- - If a job ID is provided, use it for specific job status
15
- - If no arguments, show all active jobs
16
-
17
- 2. If job ID provided:
18
- - Use mcp__bluera-knowledge__execute tool with command "job:status":
19
- - args.jobId: The job ID from $ARGUMENTS
20
- - Display current status, progress, and details
21
-
22
- 3. If no job ID provided:
23
- - Use mcp__bluera-knowledge__execute tool with command "jobs":
24
- - args.activeOnly: true
25
- - Display a table of running/pending jobs
26
-
27
- ## Display Format
28
-
29
- For a specific job:
30
-
31
- ```
32
- Job Status: job_abc123def456
33
- ───────────────────────────────────────
34
- Type: clone
35
- Status: running
36
- Progress: ███████████░░░░░░░░░ 45%
37
- Message: Indexed 562/1,247 files
38
- Started: 2 minutes ago
39
- ```
40
-
41
- For all active jobs:
42
-
43
- ```
44
- Active Background Jobs
45
- ───────────────────────────────────────────────────────────────
46
- | Job ID | Type | Status | Progress | Started |
47
- |-------------------|-------|---------|----------|----------|
48
- | job_abc123def456 | clone | running | 45% | 2m ago |
49
- | job_xyz789ghi012 | index | pending | 0% | Just now |
50
-
51
- Use /bluera-knowledge:check-status <job-id> for details
52
- ```
53
-
54
- If no active jobs:
55
-
56
- ```
57
- No active background jobs.
58
-
59
- Recent completed jobs:
60
- | Job ID | Type | Status | Completed |
61
- |-------------------|-------|-----------|-----------|
62
- | job_old123abc456 | clone | completed | 5m ago |
63
-
64
- Use /bluera-knowledge:cancel <job-id> to cancel a running job
65
- ```
66
-
67
- ## Error Handling
68
-
69
- If job not found:
70
-
71
- ```
72
- ✗ Job not found: job_abc123def456
73
-
74
- Common issues:
75
- - Check the job ID is correct
76
- - Job may have been cleaned up (completed jobs are removed after 24 hours)
77
- - Use /bluera-knowledge:check-status to see all active jobs
78
- ```
package/commands/crawl.md DELETED
@@ -1,54 +0,0 @@
1
- ---
2
- description: Crawl web pages with natural language control and add to knowledge store
3
- argument-hint: "[url] [store-name] [--crawl instruction] [--extract instruction] [--fast]"
4
- allowed-tools: ["Bash(node ${CLAUDE_PLUGIN_ROOT}/dist/index.js crawl:*)"]
5
- context: fork
6
- ---
7
-
8
- Crawling and indexing: $ARGUMENTS
9
-
10
- ```bash
11
- node ${CLAUDE_PLUGIN_ROOT}/dist/index.js crawl $ARGUMENTS
12
- ```
13
-
14
- The web pages will be crawled with intelligent link selection and optional natural language extraction, then indexed for searching.
15
-
16
- **Note:** The web store is auto-created if it doesn't exist. No need to create the store first.
17
-
18
- ## Usage Examples
19
-
20
- **Intelligent crawl strategy:**
21
- ```
22
- /bluera-knowledge:crawl https://code.claude.com/docs/en/ claude-docs --crawl "all Getting Started pages"
23
- ```
24
-
25
- **With extraction:**
26
- ```
27
- /bluera-knowledge:crawl https://example.com/pricing pricing-store --extract "extract pricing and features"
28
- ```
29
-
30
- **Both strategy and extraction:**
31
- ```
32
- /bluera-knowledge:crawl https://docs.example.com my-docs --crawl "API reference pages" --extract "API endpoints and parameters"
33
- ```
34
-
35
- **Simple BFS mode:**
36
- ```
37
- /bluera-knowledge:crawl https://example.com/docs docs-store --simple
38
- ```
39
-
40
- **Fast mode (axios-only, no JavaScript rendering):**
41
- ```
42
- /bluera-knowledge:crawl https://example.com/docs docs-store --fast --max-pages 20
43
- ```
44
-
45
- ## Options
46
-
47
- - `--crawl <instruction>` - Natural language instruction for which pages to crawl (e.g., "all Getting Started pages")
48
- - `--extract <instruction>` - Natural language instruction for what content to extract (e.g., "extract API references")
49
- - `--simple` - Use simple BFS (breadth-first search) mode instead of intelligent crawling
50
- - `--max-pages <number>` - Maximum number of pages to crawl (default: 50)
51
- - `--fast` - Use fast axios-only mode instead of headless browser
52
- - Default behavior uses headless browser (Playwright via crawl4ai) for JavaScript-rendered sites
53
- - Use `--fast` when the target site doesn't use client-side rendering
54
- - Much faster than headless mode but may miss content from JavaScript-heavy sites
package/commands/index.md DELETED
@@ -1,48 +0,0 @@
1
- ---
2
- description: Re-index a knowledge store
3
- argument-hint: "[store-name-or-id]"
4
- allowed-tools: ["mcp__bluera-knowledge__execute"]
5
- ---
6
-
7
- # Re-index Knowledge Store
8
-
9
- Re-index a knowledge store: **$ARGUMENTS**
10
-
11
- ## Steps
12
-
13
- 1. Parse the store name or ID from $ARGUMENTS (required)
14
-
15
- 2. Use mcp__bluera-knowledge__execute tool with command "store:index":
16
- - args.store: The store name or ID from $ARGUMENTS
17
-
18
- 3. Display results showing job ID for background indexing:
19
-
20
- ```
21
- ✓ Indexing store: react...
22
- 🔄 Indexing started in background
23
- Job ID: job_def456ghi789
24
-
25
- Check status with: /bluera-knowledge:check-status job_def456ghi789
26
- Or view all jobs: /bluera-knowledge:check-status
27
- ```
28
-
29
- ## When to Re-index
30
-
31
- Re-index a store when:
32
- - The source repository has been updated (for repo stores)
33
- - Files have been added or modified (for file stores)
34
- - You want to refresh embeddings with an updated model
35
- - Search results seem out of date
36
-
37
- ## Error Handling
38
-
39
- If indexing fails:
40
-
41
- ```
42
- ✗ Failed to index store: [error message]
43
-
44
- Common issues:
45
- - Store name or ID not found - use /bluera-knowledge:stores to list available stores
46
- - Source directory no longer exists (for file stores)
47
- - Network issues pulling latest changes (for repo stores)
48
- ```
@@ -1,52 +0,0 @@
1
- ---
2
- description: Delete a knowledge store and all associated data
3
- argument-hint: "[store-name-or-id]"
4
- allowed-tools: ["mcp__bluera-knowledge__execute"]
5
- ---
6
-
7
- # Remove Knowledge Store
8
-
9
- Delete a knowledge store and all associated data: **$ARGUMENTS**
10
-
11
- ## Steps
12
-
13
- 1. Parse the store name or ID from $ARGUMENTS (required)
14
- - If no store provided, show error and suggest using /bluera-knowledge:stores to list available stores
15
-
16
- 2. Use mcp__bluera-knowledge__execute tool with command "store:delete":
17
- - args.store: The store name or ID from $ARGUMENTS
18
-
19
- 3. Display deletion result:
20
-
21
- ```
22
- Store "react" deleted successfully.
23
-
24
- Removed:
25
- - Store registry entry
26
- - LanceDB search index
27
- - Cloned repository files (for repo stores)
28
- ```
29
-
30
- ## What Gets Deleted
31
-
32
- When you remove a store:
33
- - **Registry entry** - Store is removed from the list
34
- - **Search index** - LanceDB vector embeddings are dropped
35
- - **Cloned files** - For repo stores created from URLs, the cloned repository is deleted
36
-
37
- ## Warning
38
-
39
- This action is **permanent**. The store and all indexed data will be deleted.
40
- To re-create, you'll need to add and re-index the source again.
41
-
42
- ## Error Handling
43
-
44
- If store not found:
45
-
46
- ```
47
- Store not found: nonexistent-store
48
-
49
- Available stores:
50
- - Use /bluera-knowledge:stores to list all stores
51
- - Check spelling of store name or ID
52
- ```
@@ -1,86 +0,0 @@
1
- ---
2
- description: Search indexed library sources
3
- argument-hint: "[query] [--stores names] [--limit N] [--mode vector|fts|hybrid] [--detail minimal|contextual|full] [--threshold 0-1] [--min-relevance 0-1]"
4
- allowed-tools: ["mcp__bluera-knowledge__search"]
5
- ---
6
-
7
- # Search Knowledge Stores
8
-
9
- Search indexed library sources for: **$ARGUMENTS**
10
-
11
- ## Steps
12
-
13
- 1. Parse the query from $ARGUMENTS:
14
- - Extract the search query (required)
15
- - Extract --stores parameter (optional, comma-separated store names)
16
- - Extract --limit parameter (optional, default 10)
17
- - Extract --mode parameter (optional: vector, fts, hybrid; default hybrid)
18
- - Extract --detail parameter (optional: minimal, contextual, full; default contextual)
19
- - Extract --threshold parameter (optional, 0-1 range for normalized score filtering)
20
- - Extract --min-relevance parameter (optional, 0-1 range for raw cosine similarity filtering)
21
-
22
- 2. Call mcp__bluera-knowledge__search with:
23
- - query: The search query string
24
- - stores: Array of store names (if --stores specified)
25
- - limit: Number of results (if --limit specified, default 10)
26
- - mode: Search mode (if --mode specified, default "hybrid")
27
- - detail: Detail level (if --detail specified, default "contextual")
28
- - threshold: Minimum normalized score (if --threshold specified)
29
- - minRelevance: Minimum raw cosine similarity (if --min-relevance specified)
30
- - intent: "find-implementation"
31
-
32
- 3. Format and display results with rich context:
33
-
34
- ```
35
- ## Search Results: "query" (hybrid search)
36
-
37
- **1. [Score: 0.95] [Vector+FTS]**
38
- Store: claude-code
39
- File: 📄 path/to/file.ts
40
- Purpose: → Purpose description here
41
- Top Terms: 🔑 (in this chunk): concept1, concept2, concept3
42
- Imports: 📦 (in this chunk): package1, package2
43
-
44
- **2. [Score: 0.87] [Vector]**
45
- Store: another-store
46
- File: 📄 path/to/file.js
47
- Purpose: → Another purpose here
48
- Top Terms: 🔑 (in this chunk): other-concept
49
-
50
- ---
51
- **Found 10 results in 45ms**
52
-
53
- 💡 **Next Steps:**
54
- - Read file: `Read /path/to/file.ts`
55
- - Get full code: `mcp__bluera-knowledge__get_full_context("result-id")`
56
- - Refine search: Use keywords above
57
- ```
58
-
59
- **Formatting rules:**
60
- - Header: `## Search Results: "query" (mode search)` - Extract mode from response (vector/fts/hybrid)
61
- - Each result on its own block with blank line between
62
- - Result header: `**N. [Score: X.XX] {{method}}**` where method is:
63
- - `[Vector+FTS]` if result.rankingMetadata has both vectorRank AND ftsRank (found by both methods)
64
- - `[Vector]` if result.rankingMetadata has only vectorRank (semantic match only)
65
- - `[Keyword]` if result.rankingMetadata has only ftsRank (keyword match only)
66
- - Store: `Store: storeName` (on new line after header)
67
- - File: `File: 📄 filename` (strip repoRoot prefix from location)
68
- - Purpose: `Purpose: → purpose text` (keep concise)
69
- - Top Terms: `Top Terms: 🔑 (in this chunk): ...` (top 5 most frequent words from this chunk, comma-separated)
70
- - Imports: `Imports: 📦 (in this chunk): ...` (import statements from this chunk, first 3-4, comma-separated)
71
- - Skip Top Terms/Imports lines if arrays are empty
72
- - Footer: `**Found {{totalResults}} results in {{timeMs}}ms**` with separator line above
73
-
74
- 4. For the footer next steps, include:
75
- - First result's ID in the get_full_context example
76
- - First result's actual file path in the Read example
77
- - Use the actual keywords from top results
78
-
79
- 5. If no results:
80
- ```
81
- No results found for "query"
82
-
83
- Try:
84
- - Broadening your search terms
85
- - Checking indexed stores: /bluera-knowledge:stores
86
- ```