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.
- package/CHANGELOG.md +19 -0
- package/dist/{chunk-OMC3RAZT.js → chunk-RAXRD23K.js} +2 -2
- package/dist/{chunk-WYZQUKUD.js → chunk-VKTVMW45.js} +28 -18
- package/dist/chunk-VKTVMW45.js.map +1 -0
- package/dist/{chunk-3EQRQOXD.js → chunk-ZGEQCLOZ.js} +2 -2
- package/dist/index.js +3 -3
- package/dist/mcp/bootstrap.js +19 -2
- package/dist/mcp/bootstrap.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +2 -2
- package/dist/workers/background-worker-cli.js +2 -2
- 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/dist/chunk-WYZQUKUD.js.map +0 -1
- 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/dist/{chunk-OMC3RAZT.js.map → chunk-RAXRD23K.js.map} +0 -0
- /package/dist/{chunk-3EQRQOXD.js.map → chunk-ZGEQCLOZ.js.map} +0 -0
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
|
|
@@ -1,130 +0,0 @@
|
|
|
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
|
package/commands/stores.md
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: List all indexed library stores
|
|
3
|
-
allowed-tools: ["mcp__bluera-knowledge__execute"]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# List Knowledge Stores
|
|
7
|
-
|
|
8
|
-
Show all configured knowledge stores in the project.
|
|
9
|
-
|
|
10
|
-
## Steps
|
|
11
|
-
|
|
12
|
-
1. Use the mcp__bluera-knowledge__execute tool with command "stores" to retrieve all stores
|
|
13
|
-
|
|
14
|
-
2. Present results in a clean table format:
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
| Name | Type | ID | Source |
|
|
18
|
-
|------|------|----|--------------------|
|
|
19
|
-
| react | repo | a1b2c3d4 | https://github.com/facebook/react |
|
|
20
|
-
| lodash | repo | e5f6g7h8 | https://github.com/lodash/lodash |
|
|
21
|
-
| my-docs | file | i9j0k1l2 | ~/docs |
|
|
22
|
-
|
|
23
|
-
**Total**: 3 stores
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
3. Format each row:
|
|
27
|
-
- **Name**: The store name
|
|
28
|
-
- **Type**: Store type (repo, file, or web)
|
|
29
|
-
- **ID**: First 8 characters of the store ID (no ellipsis)
|
|
30
|
-
- **Source**:
|
|
31
|
-
- For repo stores: The git URL
|
|
32
|
-
- For file stores: The local path (use ~ for home directory to keep it concise)
|
|
33
|
-
- For web stores: The base URL
|
|
34
|
-
|
|
35
|
-
## If No Stores Found
|
|
36
|
-
|
|
37
|
-
If no stores exist, show:
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
## No Knowledge Stores Found
|
|
41
|
-
|
|
42
|
-
You haven't created any knowledge stores yet.
|
|
43
|
-
|
|
44
|
-
To get started:
|
|
45
|
-
- `/bluera-knowledge:add-repo <url> --name=<name>` - Clone and index a library repository
|
|
46
|
-
- `/bluera-knowledge:add-folder <path> --name=<name>` - Index a local folder of documentation
|
|
47
|
-
|
|
48
|
-
Example:
|
|
49
|
-
```
|
|
50
|
-
/bluera-knowledge:add-repo https://github.com/facebook/react --name=react
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
After creating stores, they will be searchable via the MCP search tool.
|
|
54
|
-
```
|
package/commands/suggest.md
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Suggest important dependencies to add to knowledge stores
|
|
3
|
-
allowed-tools: ["Glob", "Read", "mcp__bluera-knowledge__execute", "WebSearch"]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Suggest Dependencies to Index
|
|
7
|
-
|
|
8
|
-
Analyze project dependencies and suggest important libraries to add to knowledge stores.
|
|
9
|
-
|
|
10
|
-
## Steps
|
|
11
|
-
|
|
12
|
-
1. **Find dependency files** using Glob tool:
|
|
13
|
-
- `**/package.json` (JavaScript/TypeScript projects)
|
|
14
|
-
- `**/requirements.txt` (Python projects)
|
|
15
|
-
- `**/go.mod` (Go projects)
|
|
16
|
-
- `**/Cargo.toml` (Rust projects)
|
|
17
|
-
|
|
18
|
-
2. **Read and parse dependencies**:
|
|
19
|
-
- Use Read tool to read each dependency file
|
|
20
|
-
- Extract package names and usage patterns
|
|
21
|
-
- For package.json: dependencies and devDependencies
|
|
22
|
-
- For requirements.txt: all packages
|
|
23
|
-
- For go.mod: require statements
|
|
24
|
-
- For Cargo.toml: dependencies section
|
|
25
|
-
|
|
26
|
-
3. **Scan for import statements** using Glob + Read:
|
|
27
|
-
- Find all source files (*.js, *.ts, *.py, *.go, *.rs)
|
|
28
|
-
- Count imports/requires for each dependency
|
|
29
|
-
- Rank dependencies by frequency of use
|
|
30
|
-
|
|
31
|
-
4. **Get existing stores** using mcp__bluera-knowledge__execute with command "stores":
|
|
32
|
-
- Filter out dependencies already in stores
|
|
33
|
-
- Focus on new suggestions
|
|
34
|
-
|
|
35
|
-
5. **Find repository URLs** using WebSearch:
|
|
36
|
-
- For top 5 most-used dependencies
|
|
37
|
-
- Search for official GitHub/GitLab repositories
|
|
38
|
-
- Prefer official repos over forks
|
|
39
|
-
|
|
40
|
-
6. **Display suggestions**:
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
## Dependency Analysis
|
|
44
|
-
|
|
45
|
-
Scanned 342 source files and found 24 dependencies.
|
|
46
|
-
|
|
47
|
-
### Top Dependencies by Usage
|
|
48
|
-
|
|
49
|
-
1. **react** (147 imports across 52 files)
|
|
50
|
-
Repository: https://github.com/facebook/react
|
|
51
|
-
|
|
52
|
-
Add with:
|
|
53
|
-
```
|
|
54
|
-
/bluera-knowledge:add-repo https://github.com/facebook/react --name=react
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
2. **lodash** (89 imports across 31 files)
|
|
58
|
-
Repository: https://github.com/lodash/lodash
|
|
59
|
-
|
|
60
|
-
Add with:
|
|
61
|
-
```
|
|
62
|
-
/bluera-knowledge:add-repo https://github.com/lodash/lodash --name=lodash
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
[Continue for top 5...]
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
Already indexed: typescript, express, jest
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## If No Dependencies Found
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
No external dependencies found in this project.
|
|
76
|
-
|
|
77
|
-
Make sure you have a dependency manifest file:
|
|
78
|
-
- package.json (JavaScript/TypeScript)
|
|
79
|
-
- requirements.txt or pyproject.toml (Python)
|
|
80
|
-
- go.mod (Go)
|
|
81
|
-
- Cargo.toml (Rust)
|
|
82
|
-
```
|
package/commands/sync.md
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Sync stores from definitions config (bootstrap on fresh clone)
|
|
3
|
-
allowed-tools: ["mcp__bluera-knowledge__execute"]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Sync Stores from Definitions
|
|
7
|
-
|
|
8
|
-
Sync stores from the git-committable definitions config. This is useful when:
|
|
9
|
-
- You've cloned a repo that has `.bluera/bluera-knowledge/stores.config.json`
|
|
10
|
-
- You want to recreate all stores defined by the team
|
|
11
|
-
- You want to check for orphan stores not in the config
|
|
12
|
-
|
|
13
|
-
## Steps
|
|
14
|
-
|
|
15
|
-
1. Use the mcp__bluera-knowledge__execute tool with command "stores:sync" to sync stores from definitions
|
|
16
|
-
|
|
17
|
-
Optional arguments:
|
|
18
|
-
- `dryRun: true` - Show what would happen without making changes
|
|
19
|
-
- `prune: true` - Remove stores not in definitions
|
|
20
|
-
- `reindex: true` - Re-index existing stores after sync
|
|
21
|
-
|
|
22
|
-
2. Present results in a structured format:
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
## Sync Results
|
|
26
|
-
|
|
27
|
-
**Created**: 3 stores
|
|
28
|
-
- my-docs (file)
|
|
29
|
-
- react-source (repo)
|
|
30
|
-
- api-docs (web)
|
|
31
|
-
|
|
32
|
-
**Skipped** (already exist): 2 stores
|
|
33
|
-
- lodash
|
|
34
|
-
- typescript-docs
|
|
35
|
-
|
|
36
|
-
**Orphans** (not in definitions): 1 store
|
|
37
|
-
- old-unused-store
|
|
38
|
-
|
|
39
|
-
No errors occurred.
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Dry Run Mode
|
|
43
|
-
|
|
44
|
-
When using dry run, show what WOULD happen:
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
## Sync Preview (Dry Run)
|
|
48
|
-
|
|
49
|
-
**Would create**: 3 stores
|
|
50
|
-
- my-docs (file)
|
|
51
|
-
- react-source (repo)
|
|
52
|
-
- api-docs (web)
|
|
53
|
-
|
|
54
|
-
**Would skip** (already exist): 2 stores
|
|
55
|
-
- lodash
|
|
56
|
-
- typescript-docs
|
|
57
|
-
|
|
58
|
-
**Orphans** (not in definitions): 1 store
|
|
59
|
-
- old-unused-store
|
|
60
|
-
|
|
61
|
-
To apply these changes, run without --dry-run
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## If No Definitions Found
|
|
65
|
-
|
|
66
|
-
If no store definitions config exists:
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
## No Store Definitions Found
|
|
70
|
-
|
|
71
|
-
The config file `.bluera/bluera-knowledge/stores.config.json` doesn't exist yet.
|
|
72
|
-
|
|
73
|
-
Store definitions are automatically created when you:
|
|
74
|
-
- Add a repo: `/bluera-knowledge:add-repo <url>`
|
|
75
|
-
- Add a folder: `/bluera-knowledge:add-folder <path>`
|
|
76
|
-
- Crawl a website: `/bluera-knowledge:crawl <url>`
|
|
77
|
-
|
|
78
|
-
The config file will be created automatically and can be committed to git for team sharing.
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Error Handling
|
|
82
|
-
|
|
83
|
-
If some stores fail to sync, report them individually:
|
|
84
|
-
|
|
85
|
-
```
|
|
86
|
-
## Sync Results
|
|
87
|
-
|
|
88
|
-
**Created**: 2 stores
|
|
89
|
-
- my-docs
|
|
90
|
-
- api-docs
|
|
91
|
-
|
|
92
|
-
**Failed**: 1 store
|
|
93
|
-
- react-source: Directory does not exist: /path/to/repo
|
|
94
|
-
|
|
95
|
-
Continue to resolve the errors manually.
|
|
96
|
-
```
|