bluera-knowledge 0.16.5 → 0.17.0
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 +12 -0
- package/dist/mcp/bootstrap.js +19 -2
- package/dist/mcp/bootstrap.js.map +1 -1
- package/package.json +1 -5
- package/.claude-plugin/plugin.json +0 -9
- package/commands/add-folder.md +0 -48
- package/commands/add-repo.md +0 -50
- package/commands/cancel.md +0 -63
- package/commands/check-status.md +0 -78
- package/commands/crawl.md +0 -54
- package/commands/index.md +0 -48
- package/commands/remove-store.md +0 -52
- package/commands/search.md +0 -86
- package/commands/search.sh +0 -63
- package/commands/skill-activation.md +0 -130
- package/commands/stores.md +0 -54
- package/commands/suggest.md +0 -82
- package/commands/sync.md +0 -96
- package/commands/test-plugin.md +0 -408
- package/commands/uninstall.md +0 -65
- package/hooks/check-dependencies.sh +0 -145
- package/hooks/format-search-results.py +0 -132
- package/hooks/hooks.json +0 -54
- package/hooks/job-status-hook.sh +0 -51
- package/hooks/posttooluse-bk-reminder.py +0 -166
- package/hooks/skill-activation.py +0 -194
- package/hooks/skill-rules.json +0 -122
- package/skills/advanced-workflows/SKILL.md +0 -273
- package/skills/knowledge-search/SKILL.md +0 -110
- package/skills/search-optimization/SKILL.md +0 -396
- package/skills/store-lifecycle/SKILL.md +0 -470
- package/skills/when-to-query/SKILL.md +0 -160
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
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.17.0](https://github.com/blueraai/bluera-knowledge/compare/v0.16.6...v0.17.0) (2026-01-18)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **bootstrap:** add interrupted install recovery via lock file ([5bf4773](https://github.com/blueraai/bluera-knowledge/commit/5bf4773b59f27fe04fc6e8f7da0fe37cc4902ac7))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **settings:** narrow deny rules to block execution only ([daf758b](https://github.com/blueraai/bluera-knowledge/commit/daf758b211eb2e2179d198485f0a7705fb137759))
|
|
16
|
+
|
|
5
17
|
## [0.16.4](https://github.com/blueraai/bluera-knowledge/compare/v0.16.3...v0.16.4) (2026-01-17)
|
|
6
18
|
|
|
7
19
|
|
package/dist/mcp/bootstrap.js
CHANGED
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
// src/mcp/bootstrap.ts
|
|
4
4
|
import { execSync } from "child_process";
|
|
5
|
-
import {
|
|
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
|
-
|
|
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 {
|
|
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 {\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;AAAA,EACA;AAAA,OACK;AACP,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,kBAAkB,KAAK,YAAY,0BAA0B;AAGnE,IAAM,aAAa,MAAc;AAC/B,MAAI;AACF,UAAM,MAAe,KAAK,MAAM,aAAa,KAAK,YAAY,cAAc,GAAG,OAAO,CAAC;AACvF,QACE,OAAO,QAAQ,YACf,QAAQ,QACR,aAAa,OACb,OAAO,IAAI,YAAY,UACvB;AACA,aAAO,IAAI,IAAI,OAAO;AAAA,IACxB;AACA,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAKA,SAAS,4BAAkC;AACzC,QAAM,UAAU,MAAe;AAC7B,QAAI;AACF,eAAS,aAAa,EAAE,OAAO,SAAS,CAAC;AACzC,aAAO;AAAA,IACT,QAAQ;AACN,aAAO;AAAA,IACT;AAAA,EACF,GAAG;AAEH,QAAM,MAAM,SAAS,kCAAkC;AACvD,MAAI,QAAQ,gDAAgD,EAAE,QAAQ,IAAI,CAAC;AAC3E,WAAS,KAAK,EAAE,KAAK,YAAY,OAAO,UAAU,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":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bluera-knowledge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
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"
|
package/commands/add-folder.md
DELETED
|
@@ -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
|
-
```
|
package/commands/add-repo.md
DELETED
|
@@ -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
|
-
```
|
package/commands/cancel.md
DELETED
|
@@ -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
|
-
```
|
package/commands/check-status.md
DELETED
|
@@ -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
|
-
```
|
package/commands/remove-store.md
DELETED
|
@@ -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
|
-
```
|
package/commands/search.md
DELETED
|
@@ -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
|
-
```
|
package/commands/search.sh
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Search command that uses Python formatter for deterministic table output
|
|
3
|
-
|
|
4
|
-
set -euo pipefail
|
|
5
|
-
|
|
6
|
-
# Parse arguments
|
|
7
|
-
QUERY=""
|
|
8
|
-
STORES=""
|
|
9
|
-
LIMIT=10
|
|
10
|
-
|
|
11
|
-
while [[ $# -gt 0 ]]; do
|
|
12
|
-
case $1 in
|
|
13
|
-
--stores)
|
|
14
|
-
STORES="$2"
|
|
15
|
-
shift 2
|
|
16
|
-
;;
|
|
17
|
-
--limit)
|
|
18
|
-
LIMIT="$2"
|
|
19
|
-
shift 2
|
|
20
|
-
;;
|
|
21
|
-
*)
|
|
22
|
-
# Everything else is the query
|
|
23
|
-
if [ -z "$QUERY" ]; then
|
|
24
|
-
QUERY="$1"
|
|
25
|
-
else
|
|
26
|
-
QUERY="$QUERY $1"
|
|
27
|
-
fi
|
|
28
|
-
shift
|
|
29
|
-
;;
|
|
30
|
-
esac
|
|
31
|
-
done
|
|
32
|
-
|
|
33
|
-
# Remove quotes from query if present
|
|
34
|
-
QUERY=$(echo "$QUERY" | sed 's/^["'\'']*//;s/["'\'']*$//')
|
|
35
|
-
|
|
36
|
-
if [ -z "$QUERY" ]; then
|
|
37
|
-
echo "Error: No search query provided"
|
|
38
|
-
exit 1
|
|
39
|
-
fi
|
|
40
|
-
|
|
41
|
-
# Build MCP tool call JSON
|
|
42
|
-
TOOL_INPUT=$(cat <<EOF
|
|
43
|
-
{
|
|
44
|
-
"query": "$QUERY",
|
|
45
|
-
"limit": $LIMIT,
|
|
46
|
-
"detail": "contextual",
|
|
47
|
-
"intent": "find-implementation"
|
|
48
|
-
}
|
|
49
|
-
EOF
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
# Call MCP tool (this would need to be done via Claude)
|
|
53
|
-
# For now, output instructions for Claude
|
|
54
|
-
cat <<EOF
|
|
55
|
-
Please call mcp__bluera-knowledge__search with these parameters and pipe the results through the formatter:
|
|
56
|
-
|
|
57
|
-
Query: $QUERY
|
|
58
|
-
Limit: $LIMIT
|
|
59
|
-
Detail: contextual
|
|
60
|
-
Intent: find-implementation
|
|
61
|
-
|
|
62
|
-
Then execute: echo '<results_json>' | ${CLAUDE_PLUGIN_ROOT}/hooks/format-search-results.py
|
|
63
|
-
EOF
|