bluera-knowledge 0.13.1 → 0.13.2
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 +2 -15
- package/.mcp.json +11 -0
- package/CHANGELOG.md +7 -0
- package/CONTRIBUTING.md +307 -0
- package/README.md +51 -1168
- package/docs/cli.md +170 -0
- package/docs/commands.md +392 -0
- package/docs/crawler-architecture.md +89 -0
- package/docs/mcp-integration.md +130 -0
- package/docs/token-efficiency.md +91 -0
- package/package.json +1 -1
- package/src/mcp/plugin-mcp-config.test.ts +26 -19
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bluera-knowledge",
|
|
3
|
-
"version": "0.13.
|
|
4
|
-
"description": "Clone repos, crawl docs, search locally. Fast, authoritative answers for AI coding agents."
|
|
5
|
-
"mcpServers": {
|
|
6
|
-
"bluera-knowledge": {
|
|
7
|
-
"command": "node",
|
|
8
|
-
"args": [
|
|
9
|
-
"${CLAUDE_PLUGIN_ROOT}/dist/mcp/server.js"
|
|
10
|
-
],
|
|
11
|
-
"env": {
|
|
12
|
-
"PROJECT_ROOT": "${PWD}",
|
|
13
|
-
"DATA_DIR": ".bluera/bluera-knowledge/data",
|
|
14
|
-
"CONFIG_PATH": ".bluera/bluera-knowledge/config.json"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
3
|
+
"version": "0.13.2",
|
|
4
|
+
"description": "Clone repos, crawl docs, search locally. Fast, authoritative answers for AI coding agents."
|
|
18
5
|
}
|
package/.mcp.json
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
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.13.2](https://github.com/blueraai/bluera-knowledge/compare/v0.13.1...v0.13.2) (2026-01-16)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **mcp:** move config to .mcp.json to fix fresh install failures ([b4bbfbb](https://github.com/blueraai/bluera-knowledge/commit/b4bbfbb327f1448aa7595c59c737f2e4496cae1a)), closes [#16143](https://github.com/blueraai/bluera-knowledge/issues/16143)
|
|
11
|
+
|
|
5
12
|
## [0.13.0](https://github.com/blueraai/bluera-knowledge/compare/v0.12.11...v0.13.0) (2026-01-15)
|
|
6
13
|
|
|
7
14
|
## [0.12.10](https://github.com/blueraai/bluera-knowledge/compare/v0.11.21...v0.12.10) (2026-01-15)
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
# Contributing to Bluera Knowledge
|
|
2
|
+
|
|
3
|
+
Contributions welcome! This guide covers development setup, testing, and the release process.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/blueraai/bluera-knowledge.git
|
|
9
|
+
cd bluera-knowledge
|
|
10
|
+
bun install
|
|
11
|
+
bun run build
|
|
12
|
+
bun test
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
> **Note:** This project uses [Bun](https://bun.sh) for development. Install it via `curl -fsSL https://bun.sh/install | bash`
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Claude Code Settings (Recommended)
|
|
20
|
+
|
|
21
|
+
For the best development experience with Claude Code, copy the example settings file:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
cp .claude/settings.local.json.example .claude/settings.local.json
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**This provides:**
|
|
28
|
+
- **Smart validation** - Automatically runs lint/typecheck after editing code (file-type aware)
|
|
29
|
+
- **No permission prompts** - Pre-approves common commands (lint, typecheck, precommit)
|
|
30
|
+
- **Desktop notifications** - macOS notifications when Claude needs your input
|
|
31
|
+
- **Plugin auto-enabled** - Automatically enables the bluera-knowledge plugin
|
|
32
|
+
- **Faster workflow** - Catch issues immediately without manual validation
|
|
33
|
+
|
|
34
|
+
The validation is intelligent—it only runs checks for TypeScript/JavaScript files, skipping docs/config to save time.
|
|
35
|
+
|
|
36
|
+
> **Note:** The `.claude/settings.local.json` file is gitignored (local to your machine). The example file is checked in for reference.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Dogfooding
|
|
41
|
+
|
|
42
|
+
Develop this plugin while using it with Claude Code:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
claude --plugin-dir /path/to/bluera-knowledge
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This loads the plugin directly from source. Changes take effect on Claude Code restart (no reinstall needed).
|
|
49
|
+
|
|
50
|
+
| What to test | Approach |
|
|
51
|
+
|--------------|----------|
|
|
52
|
+
| **Commands** (`/search`, `/add-repo`) | `--plugin-dir` (changes need restart) |
|
|
53
|
+
| **Hooks** (job status, dependencies) | `--plugin-dir` (changes need restart) |
|
|
54
|
+
| **MCP tools** (compiled) | `--plugin-dir` (run `bun run build` first) |
|
|
55
|
+
| **MCP tools** (live TypeScript) | `~/.claude.json` dev server (see below) |
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## MCP Server Development
|
|
60
|
+
|
|
61
|
+
**Production mode** (`mcp.plugin.json`):
|
|
62
|
+
- Uses `${CLAUDE_PLUGIN_ROOT}/dist/mcp/server.js` (compiled)
|
|
63
|
+
- Distributed with plugin, no extra setup needed
|
|
64
|
+
|
|
65
|
+
**Development mode** (live TypeScript):
|
|
66
|
+
|
|
67
|
+
For instant feedback when editing MCP server code, add a dev server to `~/.claude.json`:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"mcpServers": {
|
|
72
|
+
"bluera-knowledge-dev": {
|
|
73
|
+
"command": "npx",
|
|
74
|
+
"args": ["tsx", "/path/to/bluera-knowledge/src/mcp/server.ts"],
|
|
75
|
+
"env": {
|
|
76
|
+
"PWD": "${PWD}",
|
|
77
|
+
"DATA_DIR": "${PWD}/.bluera/bluera-knowledge/data",
|
|
78
|
+
"CONFIG_PATH": "${PWD}/.bluera/bluera-knowledge/config.json"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
This creates a separate `bluera-knowledge-dev` MCP server that runs source TypeScript directly via `tsx`—no rebuild needed for MCP changes.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Commands
|
|
90
|
+
|
|
91
|
+
### Development
|
|
92
|
+
|
|
93
|
+
| Command | Description | When to Use |
|
|
94
|
+
|---------|-------------|-------------|
|
|
95
|
+
| `bun run build` | Compile TypeScript to dist/ | Before testing CLI, after code changes |
|
|
96
|
+
| `bun run dev` | Watch mode compilation | During active development |
|
|
97
|
+
| `bun start` | Run the CLI | Execute CLI commands directly |
|
|
98
|
+
|
|
99
|
+
### Testing
|
|
100
|
+
|
|
101
|
+
| Command | Description | When to Use |
|
|
102
|
+
|---------|-------------|-------------|
|
|
103
|
+
| `bun test` | Run tests in watch mode | During TDD/active development |
|
|
104
|
+
| `bun run test:run` | Run tests once | Quick verification |
|
|
105
|
+
| `bun run test:coverage` | Run tests with coverage | Before committing, CI checks |
|
|
106
|
+
|
|
107
|
+
### Validation
|
|
108
|
+
|
|
109
|
+
| Command | Description | When to Use |
|
|
110
|
+
|---------|-------------|-------------|
|
|
111
|
+
| `bun run lint` | Run ESLint (quiet by default) | Check code style issues |
|
|
112
|
+
| `bun run typecheck` | Run TypeScript type checking (quiet by default) | Verify type safety |
|
|
113
|
+
| `bun run precommit` | Smart validation (file-type aware) | Runs only relevant checks based on changed files |
|
|
114
|
+
| `bun run prepush` | Smart coverage (skips for docs/config) | Runs coverage only when src/tests changed |
|
|
115
|
+
|
|
116
|
+
### Verbose Variants
|
|
117
|
+
|
|
118
|
+
| Command | Description |
|
|
119
|
+
|---------|-------------|
|
|
120
|
+
| `bun run lint:verbose` | ESLint (full output) |
|
|
121
|
+
| `bun run typecheck:verbose` | Type check (full output) |
|
|
122
|
+
| `bun run test:changed:verbose` | Test changed files (full output) |
|
|
123
|
+
| `bun run test:coverage:verbose` | Coverage (full output) |
|
|
124
|
+
| `bun run build:verbose` | Build (full output) |
|
|
125
|
+
|
|
126
|
+
### GitHub Actions
|
|
127
|
+
|
|
128
|
+
| Command | Description |
|
|
129
|
+
|---------|-------------|
|
|
130
|
+
| `bun run gh:status` | List recent GitHub Actions runs |
|
|
131
|
+
| `bun run gh:watch` | Watch latest workflow (quiet, shows result + failures) |
|
|
132
|
+
| `bun run gh:watch:verbose` | Watch with live status updates |
|
|
133
|
+
| `bun run gh:releases` | List recent GitHub releases |
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Automatic Build & Dist Commit
|
|
138
|
+
|
|
139
|
+
The `dist/` directory **must be committed** because Claude Code plugins are installed by copying files—there's no build step during installation.
|
|
140
|
+
|
|
141
|
+
**Good news: This is fully automatic!**
|
|
142
|
+
|
|
143
|
+
1. **On every commit**, the pre-commit hook intelligently validates based on file types
|
|
144
|
+
2. **If source/config changed**, it runs build and automatically stages `dist/` via `git add dist/`
|
|
145
|
+
3. **You never need to manually build or stage dist**—just commit your source changes
|
|
146
|
+
|
|
147
|
+
**For live rebuilding during development:**
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
bun run dev # Watches for changes and rebuilds instantly
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
This is useful when testing CLI commands locally, but not required for committing—the hook handles everything.
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Versioning
|
|
158
|
+
|
|
159
|
+
| Command | Description | When to Use |
|
|
160
|
+
|---------|-------------|-------------|
|
|
161
|
+
| `bun run version:patch` | Run quality checks, then bump patch version (0.0.x) | Bug fixes, minor updates |
|
|
162
|
+
| `bun run version:minor` | Run quality checks, then bump minor version (0.x.0) | New features, backwards compatible |
|
|
163
|
+
| `bun run version:major` | Run quality checks, then bump major version (x.0.0) | Breaking changes |
|
|
164
|
+
|
|
165
|
+
Note: Version commands run full quality checks (format, lint, deadcode, typecheck, coverage, build) BEFORE bumping to catch issues early.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Releasing
|
|
170
|
+
|
|
171
|
+
**Workflow (Fully Automated):**
|
|
172
|
+
|
|
173
|
+
1. Make changes and commit
|
|
174
|
+
2. Bump version: `bun run version:patch` (runs quality checks first, then updates package.json, plugin.json, README, CHANGELOG)
|
|
175
|
+
3. Commit version bump: `git commit -am "chore: bump version to X.Y.Z"`
|
|
176
|
+
4. Push to main: `git push`
|
|
177
|
+
5. **GitHub Actions automatically:**
|
|
178
|
+
- Runs CI (lint, typecheck, tests, build)
|
|
179
|
+
- Creates release tag when CI passes
|
|
180
|
+
- Creates GitHub release
|
|
181
|
+
- Updates marketplace
|
|
182
|
+
|
|
183
|
+
> **That's it!** No manual tagging needed. Just push to `main` and the release happens automatically when CI passes.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Post-Release Validation
|
|
188
|
+
|
|
189
|
+
After a release, validate the npm package works correctly:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
bun run validate:npm
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
This script:
|
|
196
|
+
- Installs the latest `bluera-knowledge` from npm globally
|
|
197
|
+
- Exercises all CLI commands (stores, add-folder, search, index, delete)
|
|
198
|
+
- Writes detailed logs to `logs/validation/npm-validation-*.log`
|
|
199
|
+
- Returns exit code 0 on success, 1 on failure
|
|
200
|
+
|
|
201
|
+
Use this to catch any packaging or runtime issues after npm publish.
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Plugin Self-Test
|
|
206
|
+
|
|
207
|
+
Test all plugin functionality from within Claude Code:
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
/test-plugin
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
This command runs comprehensive tests covering:
|
|
214
|
+
- **MCP Tools**: execute (help, stores, create, info, index), search, get_full_context
|
|
215
|
+
- **Slash Commands**: /stores, /search, /suggest
|
|
216
|
+
- **Cleanup**: Store deletion, artifact removal, verification
|
|
217
|
+
|
|
218
|
+
The test creates temporary content, exercises all features, and cleans up automatically. Use this to verify the plugin is working correctly after installation or updates.
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Testing Locally
|
|
223
|
+
|
|
224
|
+
### Option 1: Development MCP Server (Recommended)
|
|
225
|
+
|
|
226
|
+
Use the local development MCP server (see "MCP Server Development" section above) which runs your source code directly via `tsx`:
|
|
227
|
+
|
|
228
|
+
1. Set up dev MCP server in `~/.claude.json`
|
|
229
|
+
2. Test your changes—MCP server updates automatically as you edit code
|
|
230
|
+
|
|
231
|
+
### Option 2: Test Plugin from Working Directory
|
|
232
|
+
|
|
233
|
+
Load the plugin directly from your development directory:
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
cd /path/to/bluera-knowledge
|
|
237
|
+
claude --plugin-dir .
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
The MCP config in `plugin.json` is only loaded when the directory is loaded as a plugin (via `--plugin-dir` or marketplace install), so there's no conflict with project-level MCP config.
|
|
241
|
+
|
|
242
|
+
### Option 3: CLI Tool Testing
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
# Build and link
|
|
246
|
+
cd /path/to/bluera-knowledge
|
|
247
|
+
bun run build
|
|
248
|
+
bun link
|
|
249
|
+
|
|
250
|
+
# Now 'bluera-knowledge' command is available globally
|
|
251
|
+
cd ~/your-project
|
|
252
|
+
bluera-knowledge search "test query" my-store
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**For testing as an installed plugin:**
|
|
256
|
+
This requires publishing a new version to the marketplace.
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Project Structure
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
.claude-plugin/
|
|
264
|
+
└── plugin.json # Plugin metadata (references mcp.plugin.json)
|
|
265
|
+
|
|
266
|
+
mcp.plugin.json # MCP server configuration (plugin-scoped)
|
|
267
|
+
commands/ # Slash commands (auto-discovered)
|
|
268
|
+
skills/ # Agent Skills (auto-discovered)
|
|
269
|
+
├── knowledge-search/ # How to access dependency sources
|
|
270
|
+
│ └── SKILL.md
|
|
271
|
+
├── when-to-query/ # When to query BK vs project files
|
|
272
|
+
│ └── SKILL.md
|
|
273
|
+
├── advanced-workflows/ # Multi-tool orchestration patterns
|
|
274
|
+
│ └── SKILL.md
|
|
275
|
+
├── search-optimization/ # Search parameter optimization
|
|
276
|
+
│ └── SKILL.md
|
|
277
|
+
└── store-lifecycle/ # Store management best practices
|
|
278
|
+
└── SKILL.md
|
|
279
|
+
dist/ # Built MCP server (committed for distribution)
|
|
280
|
+
|
|
281
|
+
src/
|
|
282
|
+
├── analysis/ # Dependency analysis & URL resolution
|
|
283
|
+
├── crawl/ # Web crawling with Python bridge
|
|
284
|
+
├── services/ # Index, store, and search services
|
|
285
|
+
├── mcp/ # MCP server source
|
|
286
|
+
└── cli/ # CLI entry point
|
|
287
|
+
|
|
288
|
+
tests/
|
|
289
|
+
├── integration/ # Integration tests
|
|
290
|
+
└── fixtures/ # Test infrastructure
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Pull Request Process
|
|
296
|
+
|
|
297
|
+
1. Fork the repository
|
|
298
|
+
2. Create a feature branch
|
|
299
|
+
3. Add tests for new functionality
|
|
300
|
+
4. Run `bun run precommit` to validate
|
|
301
|
+
5. Submit a pull request
|
|
302
|
+
|
|
303
|
+
Please ensure:
|
|
304
|
+
- All tests pass
|
|
305
|
+
- Code follows existing style
|
|
306
|
+
- Commit messages are descriptive
|
|
307
|
+
- Documentation is updated if needed
|