bluera-knowledge 0.11.20 → 0.11.21
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/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +16 -0
- package/README.md +42 -5
- package/commands/crawl.md +7 -7
- package/commands/search.md +9 -2
- package/dist/{chunk-MQGRQ2EG.js → chunk-C4SYGLAI.js} +27 -7
- package/dist/chunk-C4SYGLAI.js.map +1 -0
- package/dist/{chunk-ZSKQIMD7.js → chunk-CC6EGZ4D.js} +48 -8
- package/dist/chunk-CC6EGZ4D.js.map +1 -0
- package/dist/{chunk-Q2ZGPJ66.js → chunk-QCSFBMYW.js} +2 -2
- package/dist/index.js +64 -12
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.js +2 -2
- package/dist/workers/background-worker-cli.js +2 -2
- package/package.json +1 -1
- package/src/analysis/code-graph.test.ts +30 -0
- package/src/analysis/code-graph.ts +10 -2
- package/src/cli/commands/store.test.ts +78 -0
- package/src/cli/commands/store.ts +19 -0
- package/src/cli/commands/sync.test.ts +1 -1
- package/src/cli/commands/sync.ts +50 -1
- package/src/mcp/commands/sync.commands.test.ts +94 -6
- package/src/mcp/commands/sync.commands.ts +36 -6
- package/src/mcp/handlers/search.handler.ts +3 -1
- package/src/mcp/handlers/store.handler.test.ts +3 -0
- package/src/mcp/handlers/store.handler.ts +5 -2
- package/src/mcp/schemas/index.test.ts +36 -0
- package/src/mcp/schemas/index.ts +6 -0
- package/src/mcp/server.ts +11 -0
- package/src/services/code-graph.service.ts +11 -1
- package/src/services/job.service.test.ts +23 -0
- package/src/services/job.service.ts +10 -6
- package/vitest.config.ts +1 -1
- package/dist/chunk-MQGRQ2EG.js.map +0 -1
- package/dist/chunk-ZSKQIMD7.js.map +0 -1
- /package/dist/{chunk-Q2ZGPJ66.js.map → chunk-QCSFBMYW.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
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.11.21](https://github.com/blueraai/bluera-knowledge/compare/v0.11.20...v0.11.21) (2026-01-10)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **cli:** add --branch option to store create command ([8b3209f](https://github.com/blueraai/bluera-knowledge/commit/8b3209f34e22f78df54fc6a64cf1d8b91833dabc))
|
|
11
|
+
* **mcp:** add mode and threshold params to search tool ([18acdb5](https://github.com/blueraai/bluera-knowledge/commit/18acdb590944b9e1ebf1851d0eab32f746ac1758))
|
|
12
|
+
* **sync:** add --reindex flag to sync command ([1344d98](https://github.com/blueraai/bluera-knowledge/commit/1344d984fdc5a75b25687d55ad186416d14203a9))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **code-graph:** preserve confidence in serialized edges ([d88c342](https://github.com/blueraai/bluera-knowledge/commit/d88c342e4225f984db02691437ab1c54d29ad07d))
|
|
18
|
+
* **job-service:** throw on missing HOME/USERPROFILE env vars ([b0a79fb](https://github.com/blueraai/bluera-knowledge/commit/b0a79fbe996c5e4e333ce4ad7a338cdda4af2d70))
|
|
19
|
+
* **store:** clean up all resources on store deletion ([fbcff02](https://github.com/blueraai/bluera-knowledge/commit/fbcff02f304e8b330c1656db32f6b237a63f3295))
|
|
20
|
+
|
|
5
21
|
## [0.11.20](https://github.com/blueraai/bluera-knowledge/compare/v0.11.6...v0.11.20) (2026-01-10)
|
|
6
22
|
|
|
7
23
|
|
package/README.md
CHANGED
|
@@ -1248,9 +1248,12 @@ The plugin exposes 3 MCP tools optimized for minimal context overhead:
|
|
|
1248
1248
|
**Parameters:**
|
|
1249
1249
|
- `query` - Search query (natural language, patterns, or type signatures)
|
|
1250
1250
|
- `intent` - Search intent: find-pattern, find-implementation, find-usage, find-definition, find-documentation
|
|
1251
|
+
- `mode` - Search mode: hybrid (default), vector, or fts
|
|
1251
1252
|
- `detail` - Context level: minimal, contextual, or full
|
|
1252
1253
|
- `limit` - Maximum results (default: 10)
|
|
1253
1254
|
- `stores` - Array of specific store IDs to search (optional, searches all stores if not specified)
|
|
1255
|
+
- `threshold` - Minimum normalized score (0-1) for filtering results
|
|
1256
|
+
- `minRelevance` - Minimum raw cosine similarity (0-1) for filtering results
|
|
1254
1257
|
|
|
1255
1258
|
#### `get_full_context`
|
|
1256
1259
|
📖 Retrieve complete code and context for a specific search result by ID.
|
|
@@ -1311,6 +1314,9 @@ npm install --save-dev bluera-knowledge
|
|
|
1311
1314
|
# Add a Git repository
|
|
1312
1315
|
bluera-knowledge store create react --type repo --source https://github.com/facebook/react
|
|
1313
1316
|
|
|
1317
|
+
# Add a Git repository with specific branch
|
|
1318
|
+
bluera-knowledge store create react-canary --type repo --source https://github.com/facebook/react --branch canary
|
|
1319
|
+
|
|
1314
1320
|
# Add a local folder
|
|
1315
1321
|
bluera-knowledge store create my-docs --type file --source ./docs
|
|
1316
1322
|
|
|
@@ -1318,12 +1324,33 @@ bluera-knowledge store create my-docs --type file --source ./docs
|
|
|
1318
1324
|
bluera-knowledge store create fastapi-docs --type web --source https://fastapi.tiangolo.com
|
|
1319
1325
|
```
|
|
1320
1326
|
|
|
1327
|
+
**Create Options:**
|
|
1328
|
+
- `-t, --type <type>` - Store type: `file`, `repo`, or `web` (required)
|
|
1329
|
+
- `-s, --source <path>` - Local path or URL (required)
|
|
1330
|
+
- `-b, --branch <branch>` - Git branch to clone (repo stores only)
|
|
1331
|
+
- `-d, --description <desc>` - Optional store description
|
|
1332
|
+
- `--tags <tags>` - Comma-separated tags for filtering
|
|
1333
|
+
|
|
1321
1334
|
#### Index a Store
|
|
1322
1335
|
|
|
1323
1336
|
```bash
|
|
1337
|
+
# Re-index a store (only changed files)
|
|
1324
1338
|
bluera-knowledge index react
|
|
1339
|
+
|
|
1340
|
+
# Force re-index all files (ignores cache)
|
|
1341
|
+
bluera-knowledge index react --force
|
|
1342
|
+
|
|
1343
|
+
# Watch for changes and auto-reindex
|
|
1344
|
+
bluera-knowledge index watch react
|
|
1345
|
+
bluera-knowledge index watch react --debounce 2000 # Custom debounce (default: 1000ms)
|
|
1325
1346
|
```
|
|
1326
1347
|
|
|
1348
|
+
**Index Options:**
|
|
1349
|
+
- `-f, --force` - Re-index all files (ignore incremental cache)
|
|
1350
|
+
|
|
1351
|
+
**Watch Options:**
|
|
1352
|
+
- `--debounce <ms>` - Debounce delay for file changes (default: 1000ms)
|
|
1353
|
+
|
|
1327
1354
|
#### Search
|
|
1328
1355
|
|
|
1329
1356
|
```bash
|
|
@@ -1368,17 +1395,27 @@ bluera-knowledge store info react
|
|
|
1368
1395
|
#### Delete a Store
|
|
1369
1396
|
|
|
1370
1397
|
```bash
|
|
1398
|
+
# Interactive deletion (prompts for confirmation in TTY mode)
|
|
1371
1399
|
bluera-knowledge store delete old-store
|
|
1400
|
+
|
|
1401
|
+
# Force delete without confirmation
|
|
1402
|
+
bluera-knowledge store delete old-store --force
|
|
1403
|
+
bluera-knowledge store delete old-store -y
|
|
1372
1404
|
```
|
|
1373
1405
|
|
|
1406
|
+
**Delete Options:**
|
|
1407
|
+
- `-f, --force` - Delete without confirmation prompt
|
|
1408
|
+
- `-y, --yes` - Alias for `--force`
|
|
1409
|
+
|
|
1374
1410
|
### Global Options
|
|
1375
1411
|
|
|
1376
1412
|
```bash
|
|
1377
|
-
--config <path>
|
|
1378
|
-
--data-dir <path>
|
|
1379
|
-
--
|
|
1380
|
-
--
|
|
1381
|
-
--
|
|
1413
|
+
--config <path> # Custom config file
|
|
1414
|
+
--data-dir <path> # Custom data directory
|
|
1415
|
+
--project-root <path> # Project root for store definitions (required for sync)
|
|
1416
|
+
--format <format> # Output format: json | table | plain
|
|
1417
|
+
--quiet # Suppress non-essential output
|
|
1418
|
+
--verbose # Enable verbose logging
|
|
1382
1419
|
```
|
|
1383
1420
|
|
|
1384
1421
|
### When to Use CLI vs Plugin
|
package/commands/crawl.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Crawl web pages with natural language control and add to knowledge store
|
|
3
|
-
argument-hint: "[url] [store-name] [--crawl instruction] [--extract instruction]"
|
|
3
|
+
argument-hint: "[url] [store-name] [--crawl instruction] [--extract instruction] [--fast]"
|
|
4
4
|
allowed-tools: [Bash(*)]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -36,9 +36,9 @@ The web pages will be crawled with intelligent link selection and optional natur
|
|
|
36
36
|
/bluera-knowledge:crawl https://example.com/docs docs-store --simple
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
**
|
|
39
|
+
**Fast mode (axios-only, no JavaScript rendering):**
|
|
40
40
|
```
|
|
41
|
-
/bluera-knowledge:crawl https://
|
|
41
|
+
/bluera-knowledge:crawl https://example.com/docs docs-store --fast --max-pages 20
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
## Options
|
|
@@ -47,7 +47,7 @@ The web pages will be crawled with intelligent link selection and optional natur
|
|
|
47
47
|
- `--extract <instruction>` - Natural language instruction for what content to extract (e.g., "extract API references")
|
|
48
48
|
- `--simple` - Use simple BFS (breadth-first search) mode instead of intelligent crawling
|
|
49
49
|
- `--max-pages <number>` - Maximum number of pages to crawl (default: 50)
|
|
50
|
-
- `--
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
50
|
+
- `--fast` - Use fast axios-only mode instead of headless browser
|
|
51
|
+
- Default behavior uses headless browser (Playwright via crawl4ai) for JavaScript-rendered sites
|
|
52
|
+
- Use `--fast` when the target site doesn't use client-side rendering
|
|
53
|
+
- Much faster than headless mode but may miss content from JavaScript-heavy sites
|
package/commands/search.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Search indexed library sources
|
|
3
|
-
argument-hint: "[query] [--stores names] [--limit N]"
|
|
3
|
+
argument-hint: "[query] [--stores names] [--limit N] [--mode vector|fts|hybrid] [--detail minimal|contextual|full] [--threshold 0-1] [--min-relevance 0-1]"
|
|
4
4
|
allowed-tools: ["mcp__bluera-knowledge__search"]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -14,12 +14,19 @@ Search indexed library sources for: **$ARGUMENTS**
|
|
|
14
14
|
- Extract the search query (required)
|
|
15
15
|
- Extract --stores parameter (optional, comma-separated store names)
|
|
16
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)
|
|
17
21
|
|
|
18
22
|
2. Call mcp__bluera-knowledge__search with:
|
|
19
23
|
- query: The search query string
|
|
20
24
|
- stores: Array of store names (if --stores specified)
|
|
21
25
|
- limit: Number of results (if --limit specified, default 10)
|
|
22
|
-
-
|
|
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)
|
|
23
30
|
- intent: "find-implementation"
|
|
24
31
|
|
|
25
32
|
3. Format and display results with rich context:
|
|
@@ -262,10 +262,16 @@ function err(error) {
|
|
|
262
262
|
var JobService = class {
|
|
263
263
|
jobsDir;
|
|
264
264
|
constructor(dataDir) {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
265
|
+
let baseDir;
|
|
266
|
+
if (dataDir !== void 0) {
|
|
267
|
+
baseDir = dataDir;
|
|
268
|
+
} else {
|
|
269
|
+
const homeDir = process.env["HOME"] ?? process.env["USERPROFILE"];
|
|
270
|
+
if (homeDir === void 0) {
|
|
271
|
+
throw new Error("HOME or USERPROFILE environment variable is required");
|
|
272
|
+
}
|
|
273
|
+
baseDir = path.join(homeDir, ".local/share/bluera-knowledge");
|
|
274
|
+
}
|
|
269
275
|
this.jobsDir = path.join(baseDir, "jobs");
|
|
270
276
|
if (!fs.existsSync(this.jobsDir)) {
|
|
271
277
|
fs.mkdirSync(this.jobsDir, { recursive: true });
|
|
@@ -451,7 +457,7 @@ var JobService = class {
|
|
|
451
457
|
};
|
|
452
458
|
|
|
453
459
|
// src/services/code-graph.service.ts
|
|
454
|
-
import { readFile, writeFile, mkdir } from "fs/promises";
|
|
460
|
+
import { readFile, writeFile, mkdir, rm } from "fs/promises";
|
|
455
461
|
import { join as join3, dirname } from "path";
|
|
456
462
|
|
|
457
463
|
// src/analysis/ast-parser.ts
|
|
@@ -763,7 +769,12 @@ var CodeGraph = class {
|
|
|
763
769
|
}
|
|
764
770
|
return {
|
|
765
771
|
nodes: Array.from(this.nodes.values()),
|
|
766
|
-
edges: allEdges.map((e) => ({
|
|
772
|
+
edges: allEdges.map((e) => ({
|
|
773
|
+
from: e.from,
|
|
774
|
+
to: e.to,
|
|
775
|
+
type: e.type,
|
|
776
|
+
confidence: e.confidence
|
|
777
|
+
}))
|
|
767
778
|
};
|
|
768
779
|
}
|
|
769
780
|
};
|
|
@@ -1668,6 +1679,15 @@ var CodeGraphService = class {
|
|
|
1668
1679
|
const serialized = graph.toJSON();
|
|
1669
1680
|
await writeFile(graphPath, JSON.stringify(serialized, null, 2));
|
|
1670
1681
|
}
|
|
1682
|
+
/**
|
|
1683
|
+
* Delete the code graph file for a store.
|
|
1684
|
+
* Silently succeeds if the file doesn't exist.
|
|
1685
|
+
*/
|
|
1686
|
+
async deleteGraph(storeId) {
|
|
1687
|
+
const graphPath = this.getGraphPath(storeId);
|
|
1688
|
+
await rm(graphPath, { force: true });
|
|
1689
|
+
this.graphCache.delete(storeId);
|
|
1690
|
+
}
|
|
1671
1691
|
/**
|
|
1672
1692
|
* Load a code graph for a store.
|
|
1673
1693
|
* Returns undefined if no graph exists.
|
|
@@ -4518,4 +4538,4 @@ export {
|
|
|
4518
4538
|
createServices,
|
|
4519
4539
|
destroyServices
|
|
4520
4540
|
};
|
|
4521
|
-
//# sourceMappingURL=chunk-
|
|
4541
|
+
//# sourceMappingURL=chunk-C4SYGLAI.js.map
|