bluera-knowledge 0.11.20 → 0.12.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/.claude/council-cache/1a43ed5977b8f29afc79a9bf5c4082ee5ad8338c42ab991a4241a48f80c1e46d.json +7 -0
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +31 -0
  4. package/README.md +64 -5
  5. package/commands/crawl.md +7 -7
  6. package/commands/search.md +9 -2
  7. package/commands/skill-activation.md +130 -0
  8. package/dist/{chunk-MQGRQ2EG.js → chunk-C4SYGLAI.js} +27 -7
  9. package/dist/chunk-C4SYGLAI.js.map +1 -0
  10. package/dist/{chunk-ZSKQIMD7.js → chunk-CC6EGZ4D.js} +48 -8
  11. package/dist/chunk-CC6EGZ4D.js.map +1 -0
  12. package/dist/{chunk-Q2ZGPJ66.js → chunk-QCSFBMYW.js} +2 -2
  13. package/dist/index.js +64 -12
  14. package/dist/index.js.map +1 -1
  15. package/dist/mcp/server.js +2 -2
  16. package/dist/workers/background-worker-cli.js +2 -2
  17. package/hooks/hooks.json +28 -1
  18. package/hooks/pretooluse-bk-reminder.py +97 -0
  19. package/hooks/skill-activation.py +190 -0
  20. package/hooks/skill-rules.json +122 -0
  21. package/package.json +1 -1
  22. package/src/analysis/code-graph.test.ts +30 -0
  23. package/src/analysis/code-graph.ts +10 -2
  24. package/src/cli/commands/store.test.ts +78 -0
  25. package/src/cli/commands/store.ts +19 -0
  26. package/src/cli/commands/sync.test.ts +1 -1
  27. package/src/cli/commands/sync.ts +50 -1
  28. package/src/mcp/commands/sync.commands.test.ts +94 -6
  29. package/src/mcp/commands/sync.commands.ts +36 -6
  30. package/src/mcp/handlers/search.handler.ts +3 -1
  31. package/src/mcp/handlers/store.handler.test.ts +3 -0
  32. package/src/mcp/handlers/store.handler.ts +5 -2
  33. package/src/mcp/schemas/index.test.ts +36 -0
  34. package/src/mcp/schemas/index.ts +6 -0
  35. package/src/mcp/server.ts +11 -0
  36. package/src/services/code-graph.service.ts +11 -1
  37. package/src/services/job.service.test.ts +23 -0
  38. package/src/services/job.service.ts +10 -6
  39. package/src/services/watch.service.test.ts +14 -11
  40. package/vitest.config.ts +1 -1
  41. package/dist/chunk-MQGRQ2EG.js.map +0 -1
  42. package/dist/chunk-ZSKQIMD7.js.map +0 -1
  43. /package/dist/{chunk-Q2ZGPJ66.js.map → chunk-QCSFBMYW.js.map} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "provider": "openai",
3
+ "model": "codex-mini-latest",
4
+ "prompt": "What are the best trigger keywords and patterns for a skill auto-activation system in a Claude Code plugin? Context: We're building a UserPromptSubmit hook for the bluera-knowledge plugin that detects when users would benefit from learning about specific skills. The 5 skills are: (1) knowledge-search - how to query indexed library sources, (2) when-to-query - deciding between BK vs Grep/Read, (3) search-optimization - optimizing search parameters, (4) advanced-workflows - multi-tool orchestration, (5) store-lifecycle - managing knowledge stores. Key insight: if a user already uses BK terminology, they don't need the skill suggested. We want to catch users who SHOULD be using BK but don't know it exists.",
5
+ "response": "Below is a bite‑sized “pattern cookbook” you can drop into your `UserPromptSubmit` hook in the bluera‑knowledge Claude Code plugin. The idea is simple:\n\n1. **Look for “natural” signals** that a user is trying to do something Blue‑Knowledge (BK) was built for, but \n2. **Exclude** anyone already using BK lingo (e.g. “knowledge‑search,” “index,” “store,” “workflow”) so you don’t remind the experienced.\n\n---\n\n## 1. Skill → Trigger‑patterns matrix\n\n| Skill | What it is | Trigger patterns (if user text _contains_) | Exclude if user text _contains_ |\n|:---------------------|:---------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------|\n| **knowledge‑search** | How to query an indexed library of docs/sources. | `\\b(find|lookup|search|get me|show me|where can i find)\\b.*\\b(docs|documentation|references?|articles?)\\b` | `\\bknowledge[- ]search\\b|\\bindex(ed)?\\b|\\bstore\\b` |\n| **when‑to‑query** | Deciding whether to use BK vs. grep/`read()` etc. | `\\b(grep|read\\(\\)|scan files|open files manually|search local files)\\b|\\b(is there a better way)\\b` | `\\bwhen[- ]to[- ]query\\b|\\bblue[- ]knowledge\\b` |\n| **search‑optimization** | Tuning filters, relevance, context windows, metadata to get better hits. | `\\b(narrow|filter|refine|limit|boost|prioritize|sort)\\b.*\\b(results|hits|matches)\\b` | `\\bsearch[- ]optimization\\b|\\brelevance\\b|\\bcontext window\\b` |\n| **advanced‑workflows** | Chaining multiple tools/APIs, branching, retrieval‑then‑generation, tool orchestration. | `\\b(chain|pipeline|orchestrate|automate|workflow|multi[- ]step|multi[- ]tool)\\b` | `\\badvanced[- ]workflows\\b|\\btool orchestration\\b` |\n| **store‑lifecycle** | Setting up/updating/archiving knowledge stores, versioning, pruning old info. | `\\b(create|update|delete|archive|prune|version)\\b.*\\b(store|index|database|repository)\\b` | `\\bstore[- ]lifecycle\\b|\\bknowledge[- ]store\\b` |\n\n---\n\n### 1.1. Example Regex snippets\n\n```js\n// snippet for knowledge-search\nconst KNOWLEDGE_SEARCH_RE = /\\b(?:find|lookup|search|get me|show me|where can i find)\\b.*\\b(?:docs|documentation|references?|articles?)\\b/i;\n\n// snippet for when-to-query\nconst WHEN_TO_QUERY_RE = /\\b(?:grep|read\\(\\)|scan files|open files manually|search local files)\\b|\\b(?:is there a better way)\\b/i;\n\n// snippet for store-lifecycle\nconst STORE_LIFECYCLE_RE = /\\b(?:create|update|delete|archive|prune|version)\\b.*\\b(?:store|index|database|repository)\\b/i;\n```\n\n---\n\n## 2. Putting it together in your hook\n\nBelow is a simplified example of how you might wire these patterns into a Claude Code `UserPromptSubmit` hook. You’ll want to adjust the messaging and localization to taste.\n\n```js\n/**\n * bluera-knowledge UserPromptSubmit hook\n * Detect users who could benefit from Blue‑Knowledge skills.\n */\nexport async function onUserPromptSubmit(event, ctx) {\n const text = event.prompt.text;\n\n // quick bailout: if they already speak BK\n const hasBKTerm = /\\bknowledge[- ]search\\b|\\bwhen[- ]to[- ]query\\b|\\bsearch[- ]optimization\\b|\\badvanced[- ]workflows\\b|\\bstore[- ]lifecycle\\b|\\bblue[- ]knowledge\\b/i.test(text);\n if (hasBKTerm) return;\n\n // mapping skill → [pattern, user‐facing hint]\n const SKILLS = [\n {\n name: \"knowledge-search\",\n re: /\\b(?:find|lookup|search|get me|show me|where can i find)\\b.*\\b(?:docs|documentation|references?|articles?)\\b/i,\n hint: \"🔍 You can try using our **knowledge‑search** feature to query indexed docs—no manual grepping needed!\"\n },\n {\n name: \"when-to-query\",\n re: /\\b(?:grep|read\\(\\)|scan files|open files manually|search local files)\\b|\\b(?:is there a better way)\\b/i,\n hint: \"💡 Noticed you're grepping or opening files one by one. Our **when‑to‑query** guide helps decide BK vs. direct file search.\"\n },\n {\n name: \"search-optimization\",\n re: /\\b(?:narrow|filter|refine|limit|boost|prioritize|sort)\\b.*\\b(?:results|hits|matches)\\b/i,\n hint: \"⚙️ Want more relevant hits? See our **search‑optimization** tips for tuning relevance and filters.\"\n },\n {\n name: \"advanced-workflows\",\n re: /\\b(?:chain|pipeline|orchestrate|automate|workflow|multi[- ]step|multi[- ]tool)\\b/i,\n hint: \"🔗 Looking to chain tools or build pipelines? Check out **advanced‑workflows** for multi‑tool orchestration.\"\n },\n {\n name: \"store-lifecycle\",\n re: /\\b(?:create|update|delete|archive|prune|version)\\b.*\\b(?:store|index|database|repository)\\b/i,\n hint: \"🗄️ Managing indexes or archiving old data? Our **store‑lifecycle** guide covers store setup, pruning, and versioning.\"\n }\n ];\n\n // find the first match\n for (const skill of SKILLS) {\n if (skill.re.test(text)) {\n await ctx.reply({\n type: \"skill-suggestion\",\n skill: skill.name,\n message: skill.hint\n });\n break;\n }\n }\n}\n```\n\n---\n\n## 3. Tuning tips\n\n1. **Balance precision/recall**: \n - Start _wide_: shorter patterns catch more but risk noise. \n - Refine as you gather real prompts: update regex to avoid false positives.\n\n2. **Avoid overlap**: \n If two patterns both match, pick the one that feels _most_ immediately helpful. (Above example picks the first.)\n\n3. **User‑facing copy**: \n Keep hints crisp, emoji‑tagged, and link directly to your docs or `@help` commands.\n\n4. **Metrics & feedback loop**: \n Log suggestions shown vs. accepted. Tune patterns around low‑acceptance hits.\n\n---\n\n### Summary\n\nBy combining simple regex‑based detectors with an exclusion of existing BK terminology, you’ll catch “hidden” use cases where users are laboring manually and would love a BK shortcut. Tweak patterns over time against your live traffic, and you’ll have a reliable auto‑activation layer that boosts discoverability _without_ nagging your power users.",
6
+ "timestamp": 1768432278
7
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bluera-knowledge",
3
- "version": "0.11.20",
3
+ "version": "0.12.1",
4
4
  "description": "Clone repos, crawl docs, search locally. Fast, authoritative answers for AI coding agents.",
5
5
  "mcpServers": {
6
6
  "bluera-knowledge": {
package/CHANGELOG.md CHANGED
@@ -2,6 +2,37 @@
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.12.1](https://github.com/blueraai/bluera-knowledge/compare/v0.11.21...v0.12.1) (2026-01-14)
6
+
7
+
8
+ ### Features
9
+
10
+ * **hooks:** add PreToolUse hooks for BK suggestions ([23d3fa4](https://github.com/blueraai/bluera-knowledge/commit/23d3fa493dd16427d6bda3ea80064622c6244bba))
11
+ * **hooks:** add skill auto-activation system ([2b4e96b](https://github.com/blueraai/bluera-knowledge/commit/2b4e96bd29f28df63377cdaacab922d4f4321a8f))
12
+
13
+ ## [0.12.0](https://github.com/blueraai/bluera-knowledge/compare/v0.11.21...v0.12.0) (2026-01-14)
14
+
15
+
16
+ ### Features
17
+
18
+ * **hooks:** add skill auto-activation system ([2b4e96b](https://github.com/blueraai/bluera-knowledge/commit/2b4e96bd29f28df63377cdaacab922d4f4321a8f))
19
+
20
+ ## [0.11.21](https://github.com/blueraai/bluera-knowledge/compare/v0.11.20...v0.11.21) (2026-01-10)
21
+
22
+
23
+ ### Features
24
+
25
+ * **cli:** add --branch option to store create command ([8b3209f](https://github.com/blueraai/bluera-knowledge/commit/8b3209f34e22f78df54fc6a64cf1d8b91833dabc))
26
+ * **mcp:** add mode and threshold params to search tool ([18acdb5](https://github.com/blueraai/bluera-knowledge/commit/18acdb590944b9e1ebf1851d0eab32f746ac1758))
27
+ * **sync:** add --reindex flag to sync command ([1344d98](https://github.com/blueraai/bluera-knowledge/commit/1344d984fdc5a75b25687d55ad186416d14203a9))
28
+
29
+
30
+ ### Bug Fixes
31
+
32
+ * **code-graph:** preserve confidence in serialized edges ([d88c342](https://github.com/blueraai/bluera-knowledge/commit/d88c342e4225f984db02691437ab1c54d29ad07d))
33
+ * **job-service:** throw on missing HOME/USERPROFILE env vars ([b0a79fb](https://github.com/blueraai/bluera-knowledge/commit/b0a79fbe996c5e4e333ce4ad7a338cdda4af2d70))
34
+ * **store:** clean up all resources on store deletion ([fbcff02](https://github.com/blueraai/bluera-knowledge/commit/fbcff02f304e8b330c1656db32f6b237a63f3295))
35
+
5
36
  ## [0.11.20](https://github.com/blueraai/bluera-knowledge/compare/v0.11.6...v0.11.20) (2026-01-10)
6
37
 
7
38
 
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> # Custom config file
1378
- --data-dir <path> # Custom data directory
1379
- --format <format> # Output format: json | table | plain
1380
- --quiet # Suppress non-essential output
1381
- --verbose # Enable verbose logging
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
@@ -1449,6 +1486,28 @@ This hybrid approach reduces unnecessary tool calls and context usage while main
1449
1486
 
1450
1487
  Result: Fewer tool calls, more accurate results, less context consumed.
1451
1488
 
1489
+ ### 🎯 Skill Auto-Activation
1490
+
1491
+ Skills can automatically suggest themselves when your prompt matches certain patterns.
1492
+
1493
+ **Toggle via slash command:**
1494
+ - `/bluera-knowledge:skill-activation` - Show current status
1495
+ - `/bluera-knowledge:skill-activation on` - Enable (default)
1496
+ - `/bluera-knowledge:skill-activation off` - Disable
1497
+ - `/bluera-knowledge:skill-activation config` - Toggle individual skills
1498
+
1499
+ **How it works:**
1500
+ When enabled, a UserPromptSubmit hook analyzes your prompt for patterns like:
1501
+ - "How does [library] work?" → suggests `knowledge-search`
1502
+ - "Should I grep or search?" → suggests `when-to-query`
1503
+ - "Too many results" → suggests `search-optimization`
1504
+ - "Multi-step workflow" → suggests `advanced-workflows`
1505
+ - "Add/delete store" → suggests `store-lifecycle`
1506
+
1507
+ Claude evaluates each suggestion and invokes relevant skills before answering. Users who already use BK terminology are excluded (they already know the tool).
1508
+
1509
+ **Configuration stored in:** `~/.local/share/bluera-knowledge/skill-activation.json`
1510
+
1452
1511
  ---
1453
1512
 
1454
1513
  ## 💾 Data Storage
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
- **Headless browser for JavaScript-rendered sites:**
39
+ **Fast mode (axios-only, no JavaScript rendering):**
40
40
  ```
41
- /bluera-knowledge:crawl https://code.claude.com/docs claude-docs --headless --max-pages 20
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
- - `--headless` - Use headless browser (Playwright via crawl4ai) for JavaScript-rendered sites
51
- - Required for modern frameworks (Next.js, React, Vue, etc.) that render content via client-side JavaScript
52
- - Slower than default (axios) but handles client-side rendering
53
- - Falls back to axios if headless fetch fails
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
@@ -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
- - detail: "contextual"
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:
@@ -0,0 +1,130 @@
1
+ ---
2
+ description: Toggle skill auto-activation on/off or configure individual skills
3
+ argument-hint: "[on|off|status|config]"
4
+ allowed-tools: ["Read", "Write", "AskUserQuestion"]
5
+ ---
6
+
7
+ # Skill Activation Configuration
8
+
9
+ Manage the bluera-knowledge skill auto-activation system.
10
+
11
+ ## Configuration File
12
+
13
+ Location: `~/.local/share/bluera-knowledge/skill-activation.json`
14
+
15
+ Default configuration (created if missing):
16
+ ```json
17
+ {
18
+ "enabled": true,
19
+ "threshold": 1,
20
+ "skills": {
21
+ "knowledge-search": true,
22
+ "when-to-query": true,
23
+ "search-optimization": true,
24
+ "advanced-workflows": true,
25
+ "store-lifecycle": true
26
+ }
27
+ }
28
+ ```
29
+
30
+ ## Steps
31
+
32
+ ### 1. Parse Arguments
33
+
34
+ Extract the subcommand from $ARGUMENTS:
35
+ - Empty or "status": Show current status
36
+ - "on": Enable skill activation
37
+ - "off": Disable skill activation
38
+ - "config": Interactive skill configuration
39
+
40
+ ### 2. Read Current Configuration
41
+
42
+ Read `~/.local/share/bluera-knowledge/skill-activation.json`
43
+
44
+ If the file doesn't exist, use the default configuration shown above.
45
+
46
+ ### 3. Execute Subcommand
47
+
48
+ **For "status" or empty arguments:**
49
+
50
+ Display the current configuration:
51
+
52
+ ```
53
+ ## Skill Activation Status
54
+
55
+ **Status**: [Enabled/Disabled]
56
+ **Threshold**: [threshold value]
57
+
58
+ ### Individual Skills
59
+ | Skill | Status |
60
+ |-------|--------|
61
+ | knowledge-search | enabled/disabled |
62
+ | when-to-query | enabled/disabled |
63
+ | search-optimization | enabled/disabled |
64
+ | advanced-workflows | enabled/disabled |
65
+ | store-lifecycle | enabled/disabled |
66
+
67
+ Use `/bluera-knowledge:skill-activation config` to toggle individual skills.
68
+ ```
69
+
70
+ **For "on":**
71
+
72
+ 1. Read configuration (or use defaults)
73
+ 2. Set `enabled: true`
74
+ 3. Ensure directory exists: `~/.local/share/bluera-knowledge/`
75
+ 4. Write updated configuration
76
+ 5. Confirm: "Skill activation **enabled**. Skills will be suggested based on your prompts."
77
+
78
+ **For "off":**
79
+
80
+ 1. Read configuration (or use defaults)
81
+ 2. Set `enabled: false`
82
+ 3. Write updated configuration
83
+ 4. Confirm: "Skill activation **disabled**. No skill suggestions will appear."
84
+
85
+ **For "config":**
86
+
87
+ 1. Read current configuration
88
+ 2. Use AskUserQuestion to let user toggle skills:
89
+
90
+ ```json
91
+ {
92
+ "questions": [{
93
+ "question": "Which skills should auto-activate when relevant patterns are detected?",
94
+ "header": "Skills",
95
+ "multiSelect": true,
96
+ "options": [
97
+ {
98
+ "label": "knowledge-search",
99
+ "description": "Suggests when to query BK for library questions"
100
+ },
101
+ {
102
+ "label": "when-to-query",
103
+ "description": "Guides BK vs Grep/Read decisions"
104
+ },
105
+ {
106
+ "label": "search-optimization",
107
+ "description": "Tips for optimizing search parameters"
108
+ },
109
+ {
110
+ "label": "advanced-workflows",
111
+ "description": "Multi-tool orchestration patterns"
112
+ },
113
+ {
114
+ "label": "store-lifecycle",
115
+ "description": "Managing knowledge stores"
116
+ }
117
+ ]
118
+ }]
119
+ }
120
+ ```
121
+
122
+ 3. Update skills based on selection (selected = enabled, unselected = disabled)
123
+ 4. Write updated configuration
124
+ 5. Show updated status table
125
+
126
+ ## Notes
127
+
128
+ - The configuration directory is created automatically if it doesn't exist
129
+ - Changes take effect immediately on the next prompt
130
+ - When disabled globally, no skills are suggested regardless of individual settings
@@ -262,10 +262,16 @@ function err(error) {
262
262
  var JobService = class {
263
263
  jobsDir;
264
264
  constructor(dataDir) {
265
- const baseDir = dataDir ?? path.join(
266
- process.env["HOME"] ?? process.env["USERPROFILE"] ?? ".",
267
- ".local/share/bluera-knowledge"
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) => ({ from: e.from, to: e.to, type: e.type }))
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-MQGRQ2EG.js.map
4541
+ //# sourceMappingURL=chunk-C4SYGLAI.js.map