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.
Files changed (43) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/{chunk-OMC3RAZT.js → chunk-RAXRD23K.js} +2 -2
  3. package/dist/{chunk-WYZQUKUD.js → chunk-VKTVMW45.js} +28 -18
  4. package/dist/chunk-VKTVMW45.js.map +1 -0
  5. package/dist/{chunk-3EQRQOXD.js → chunk-ZGEQCLOZ.js} +2 -2
  6. package/dist/index.js +3 -3
  7. package/dist/mcp/bootstrap.js +19 -2
  8. package/dist/mcp/bootstrap.js.map +1 -1
  9. package/dist/mcp/server.d.ts +1 -0
  10. package/dist/mcp/server.js +2 -2
  11. package/dist/workers/background-worker-cli.js +2 -2
  12. package/package.json +1 -5
  13. package/.claude-plugin/plugin.json +0 -9
  14. package/commands/add-folder.md +0 -48
  15. package/commands/add-repo.md +0 -50
  16. package/commands/cancel.md +0 -63
  17. package/commands/check-status.md +0 -78
  18. package/commands/crawl.md +0 -54
  19. package/commands/index.md +0 -48
  20. package/commands/remove-store.md +0 -52
  21. package/commands/search.md +0 -86
  22. package/commands/search.sh +0 -63
  23. package/commands/skill-activation.md +0 -130
  24. package/commands/stores.md +0 -54
  25. package/commands/suggest.md +0 -82
  26. package/commands/sync.md +0 -96
  27. package/commands/test-plugin.md +0 -408
  28. package/commands/uninstall.md +0 -65
  29. package/dist/chunk-WYZQUKUD.js.map +0 -1
  30. package/hooks/check-dependencies.sh +0 -145
  31. package/hooks/format-search-results.py +0 -132
  32. package/hooks/hooks.json +0 -54
  33. package/hooks/job-status-hook.sh +0 -51
  34. package/hooks/posttooluse-bk-reminder.py +0 -166
  35. package/hooks/skill-activation.py +0 -194
  36. package/hooks/skill-rules.json +0 -122
  37. package/skills/advanced-workflows/SKILL.md +0 -273
  38. package/skills/knowledge-search/SKILL.md +0 -110
  39. package/skills/search-optimization/SKILL.md +0 -396
  40. package/skills/store-lifecycle/SKILL.md +0 -470
  41. package/skills/when-to-query/SKILL.md +0 -160
  42. /package/dist/{chunk-OMC3RAZT.js.map → chunk-RAXRD23K.js.map} +0 -0
  43. /package/dist/{chunk-3EQRQOXD.js.map → chunk-ZGEQCLOZ.js.map} +0 -0
@@ -1,408 +0,0 @@
1
- ---
2
- description: Run comprehensive plugin validation test suite
3
- argument-hint: "[--dev]"
4
- context: fork
5
- ---
6
-
7
- # Test Plugin
8
-
9
- Comprehensive test of all Bluera Knowledge plugin functionality covering the **full API surface**.
10
-
11
- ## API Coverage
12
-
13
- | Category | Tests |
14
- |----------|-------|
15
- | MCP execute commands | help, commands, stores, store:create, store:info, store:index, store:delete, jobs, job:status, job:cancel |
16
- | MCP tools | search, get_full_context |
17
- | Slash commands | stores, search, suggest, check-status, skill-activation, index, add-folder |
18
- | Web crawling | crawl (start job, verify status, cancel) |
19
- | Hooks | PostToolUse, UserPromptSubmit, SessionStart |
20
-
21
- ## When to Use Each Mode
22
-
23
- | Scenario | Command | Tests |
24
- |----------|---------|-------|
25
- | Claude running with `--plugin-dir .` | `/test-plugin` | 30/30 (full suite) |
26
- | Plugin installed from marketplace | `/test-plugin` | 30/30 (full suite) |
27
- | Claude running WITHOUT plugin loaded | `/test-plugin --dev` | 24/30 (no slash cmds) |
28
-
29
- **Modes:**
30
- - **Default mode**: Uses Claude's MCP tools. Runs all 30 tests including slash commands.
31
- - **`--dev` mode**: Spawns MCP server directly. Skips slash command tests since they require Claude's skill router.
32
-
33
- ## Context
34
-
35
- !`echo "=== BK Plugin Test ===" && ls -la .bluera/bluera-knowledge/ 2>/dev/null || echo "No BK data dir yet (will be created)"`
36
-
37
- ## Mode Detection
38
-
39
- Check if `--dev` flag is present in: $ARGUMENTS
40
-
41
- - If `--dev` is present: Use **Development Mode**
42
- - Otherwise: Use **Production Mode**
43
-
44
- ---
45
-
46
- ## Pre-Test Cleanup
47
-
48
- Clean up any leftover artifacts from previous test runs (ignore errors):
49
-
50
- **In `--dev` mode:**
51
- ```bash
52
- node scripts/test-mcp-dev.js call execute '{"command":"store:delete","args":{"store":"bk-test-store"}}' 2>/dev/null || true
53
- node scripts/test-mcp-dev.js call execute '{"command":"store:delete","args":{"store":"bk-crawl-test"}}' 2>/dev/null || true
54
- rm -rf .bluera/bluera-knowledge/test-content
55
- ```
56
-
57
- **In production mode:**
58
- 1. Call MCP `execute` with `{ command: "store:delete", args: { store: "bk-test-store" } }` - ignore errors
59
- 2. Call MCP `execute` with `{ command: "store:delete", args: { store: "bk-crawl-test" } }` - ignore errors
60
- 3. Run: `rm -rf .bluera/bluera-knowledge/test-content`
61
-
62
- ## Test Content Setup
63
-
64
- Create test content for indexing:
65
-
66
- ```bash
67
- mkdir -p .bluera/bluera-knowledge/test-content
68
- cat > .bluera/bluera-knowledge/test-content/test-file.md << 'EOF'
69
- # BK Plugin Test File
70
-
71
- This file contains unique test content for validating the Bluera Knowledge plugin.
72
-
73
- ## Test Function
74
-
75
- The `validateBKPlugin` function performs comprehensive testing of all plugin features.
76
- It checks MCP connectivity, store operations, search functionality, and cleanup.
77
-
78
- Keywords: bluera-knowledge-test, plugin-validation, mcp-test
79
- EOF
80
- ```
81
-
82
- ---
83
-
84
- # PRODUCTION MODE (default)
85
-
86
- Use this section if `--dev` flag is NOT present.
87
-
88
- ## Part 1: MCP Execute Commands
89
-
90
- 1. **help**: Call `execute` with `{ command: "help" }`
91
- - PASS if response contains "Available commands"
92
-
93
- 2. **commands**: Call `execute` with `{ command: "commands" }`
94
- - PASS if response contains array of commands with "stores" and "store:create"
95
-
96
- 3. **stores**: Call `execute` with `{ command: "stores" }`
97
- - PASS if no error (may return empty array)
98
-
99
- 4. **store:create**: Call `execute` with:
100
- ```json
101
- { "command": "store:create", "args": { "name": "bk-test-store", "type": "file", "source": ".bluera/bluera-knowledge/test-content" } }
102
- ```
103
- - PASS if response indicates success and contains store id
104
-
105
- 5. **store:info**: Call `execute` with:
106
- ```json
107
- { "command": "store:info", "args": { "store": "bk-test-store" } }
108
- ```
109
- - PASS if response contains store name and type
110
-
111
- 6. **store:index**: Call `execute` with:
112
- ```json
113
- { "command": "store:index", "args": { "store": "bk-test-store" } }
114
- ```
115
- - PASS if response indicates indexing started (job created)
116
-
117
- 7. **jobs**: Call `execute` with `{ command: "jobs" }`
118
- - PASS if response contains jobs array (may be empty if indexing completed)
119
-
120
- 8. **job:status** (if job from step 6 available): Call `execute` with:
121
- ```json
122
- { "command": "job:status", "args": { "jobId": "<job-id-from-step-6>" } }
123
- ```
124
- - PASS if response contains job status (pending, running, or completed)
125
- - SKIP if no job id available (indexing was synchronous)
126
-
127
- ## Part 2: MCP Search Tools
128
-
129
- 9. **search**: Call MCP tool `search` with:
130
- ```json
131
- { "query": "validateBKPlugin", "stores": ["bk-test-store"] }
132
- ```
133
- - PASS if results array is non-empty
134
-
135
- 10. **get_full_context**: Call MCP tool `get_full_context` with resultId from step 9
136
- - PASS if response contains code or documentation content
137
-
138
- ## Part 3: Slash Commands
139
-
140
- 11. **/stores**: Run `/bluera-knowledge:stores`
141
- - PASS if bk-test-store is listed
142
-
143
- 12. **/search**: Run `/bluera-knowledge:search "bluera-knowledge-test"`
144
- - PASS if results are shown
145
-
146
- 13. **/suggest**: Run `/bluera-knowledge:suggest`
147
- - PASS if no error thrown
148
-
149
- 14. **/check-status**: Run `/bluera-knowledge:check-status`
150
- - PASS if shows job status (may show "no active jobs")
151
-
152
- 15. **/skill-activation**: Run `/bluera-knowledge:skill-activation`
153
- - PASS if shows activation configuration or prompts for setup
154
-
155
- 16. **/index**: Run `/bluera-knowledge:index bk-test-store`
156
- - PASS if indexing completes or starts successfully
157
-
158
- ## Part 4: Web Crawl Testing
159
-
160
- 17. **Create crawl store**: Call `execute` with:
161
- ```json
162
- { "command": "store:create", "args": { "name": "bk-crawl-test", "type": "web", "source": "https://httpbin.org/html", "options": { "maxPages": 1 } } }
163
- ```
164
- - PASS if store creation initiates and returns job id
165
-
166
- 18. **Verify crawl job**: Call `execute` with `{ command: "jobs" }`
167
- - PASS if bk-crawl-test job appears in list (or completed)
168
-
169
- 19. **job:cancel** (if crawl still running): Call `execute` with:
170
- ```json
171
- { "command": "job:cancel", "args": { "jobId": "<crawl-job-id>" } }
172
- ```
173
- - PASS if job cancelled or already completed
174
- - SKIP if job already completed
175
-
176
- 20. **Delete crawl store**: Call `execute` with:
177
- ```json
178
- { "command": "store:delete", "args": { "store": "bk-crawl-test" } }
179
- ```
180
- - PASS if deletion succeeds
181
-
182
- ## Part 5: Hook Tests
183
-
184
- 21. **Hook Registration**:
185
- ```bash
186
- cat hooks/hooks.json | jq -e '.hooks.PostToolUse and .hooks.UserPromptSubmit and .hooks.SessionStart'
187
- ```
188
- - PASS if returns `true`
189
-
190
- 22. **PostToolUse Hook - Library Detection**:
191
- ```bash
192
- echo '{"tool_name": "Read", "tool_input": {"file_path": "/project/node_modules/express/index.js"}}' | python3 hooks/posttooluse-bk-reminder.py
193
- ```
194
- - PASS if output contains "BLUERA-KNOWLEDGE REMINDER"
195
-
196
- 23. **PostToolUse Hook - Non-Library**:
197
- ```bash
198
- echo '{"tool_name": "Read", "tool_input": {"file_path": "/project/src/index.ts"}}' | python3 hooks/posttooluse-bk-reminder.py
199
- ```
200
- - PASS if output is empty
201
-
202
- 24. **Skill Activation Hook - Matching**:
203
- ```bash
204
- export CLAUDE_PLUGIN_ROOT="$(pwd)" && echo '{"prompt": "why does the express package throw this error?"}' | python3 hooks/skill-activation.py
205
- ```
206
- - PASS if output contains "MANDATORY EVALUATION"
207
-
208
- 25. **Skill Activation Hook - Excluded**:
209
- ```bash
210
- export CLAUDE_PLUGIN_ROOT="$(pwd)" && echo '{"prompt": "/bluera-knowledge:search express"}' | python3 hooks/skill-activation.py
211
- ```
212
- - PASS if output is empty
213
-
214
- 26. **Skill Rules File**:
215
- ```bash
216
- jq -e '(.skills | length) > 0 and (.globalExclusions | length) > 0' hooks/skill-rules.json
217
- ```
218
- - PASS if returns `true`
219
-
220
- ## Part 6: Cleanup
221
-
222
- 27. **Delete test store**: Call `execute` with:
223
- ```json
224
- { "command": "store:delete", "args": { "store": "bk-test-store" } }
225
- ```
226
- - PASS if deletion succeeds
227
-
228
- 28. **Remove test content**:
229
- ```bash
230
- rm -rf .bluera/bluera-knowledge/test-content
231
- ```
232
- - PASS if command succeeds
233
-
234
- 29. **Verify store cleanup**: Call `execute` with `{ command: "stores" }`
235
- - PASS if bk-test-store is NOT in the list
236
-
237
- 30. **Verify no test artifacts**:
238
- ```bash
239
- test ! -d .bluera/bluera-knowledge/test-content && echo "clean"
240
- ```
241
- - PASS if outputs "clean"
242
-
243
- ---
244
-
245
- # DEVELOPMENT MODE (`--dev`)
246
-
247
- Use this section if `--dev` flag is present. Uses `scripts/test-mcp-dev.js`.
248
-
249
- ### Part 1: MCP Commands (via dev script)
250
-
251
- 1. **help**:
252
- ```bash
253
- node scripts/test-mcp-dev.js call execute '{"command":"help"}'
254
- ```
255
- - PASS if contains "Available commands"
256
-
257
- 2. **commands**:
258
- ```bash
259
- node scripts/test-mcp-dev.js call execute '{"command":"commands"}'
260
- ```
261
- - PASS if contains commands array
262
-
263
- 3. **stores**:
264
- ```bash
265
- node scripts/test-mcp-dev.js call execute '{"command":"stores"}'
266
- ```
267
- - PASS if no error
268
-
269
- 4. **store:create**:
270
- ```bash
271
- node scripts/test-mcp-dev.js call execute '{"command":"store:create","args":{"name":"bk-test-store","type":"file","source":".bluera/bluera-knowledge/test-content"}}'
272
- ```
273
- - PASS if success
274
-
275
- 5. **store:info**:
276
- ```bash
277
- node scripts/test-mcp-dev.js call execute '{"command":"store:info","args":{"store":"bk-test-store"}}'
278
- ```
279
- - PASS if contains store details
280
-
281
- 6. **store:index**:
282
- ```bash
283
- node scripts/test-mcp-dev.js call execute '{"command":"store:index","args":{"store":"bk-test-store"}}'
284
- ```
285
- - PASS if indexing starts
286
-
287
- 7. **jobs**:
288
- ```bash
289
- node scripts/test-mcp-dev.js call execute '{"command":"jobs"}'
290
- ```
291
- - PASS if returns jobs array
292
-
293
- 8. **job:status** (if job available):
294
- ```bash
295
- node scripts/test-mcp-dev.js call execute '{"command":"job:status","args":{"jobId":"<job-id>"}}'
296
- ```
297
- - PASS if returns status
298
-
299
- ### Part 2: Search (via dev script)
300
-
301
- 9-10. **Search + Get Full Context**:
302
- ```bash
303
- node scripts/test-mcp-dev.js session << 'EOF'
304
- search {"query":"validateBKPlugin","stores":["bk-test-store"]}
305
- get_full_context {"resultId":"$LAST_ID"}
306
- EOF
307
- ```
308
- - PASS if search returns results and context contains content
309
-
310
- ### Part 3: Slash Commands (SKIPPED in --dev mode)
311
-
312
- Tests 11-16 are skipped - slash commands require Claude's skill router.
313
-
314
- ### Part 4: Web Crawl (via dev script)
315
-
316
- 17. **Create crawl store**:
317
- ```bash
318
- node scripts/test-mcp-dev.js call execute '{"command":"store:create","args":{"name":"bk-crawl-test","type":"web","source":"https://httpbin.org/html","options":{"maxPages":1}}}'
319
- ```
320
- - PASS if returns job id
321
-
322
- 18. **Verify crawl job**:
323
- ```bash
324
- node scripts/test-mcp-dev.js call execute '{"command":"jobs"}'
325
- ```
326
- - PASS if job appears
327
-
328
- 19. **job:cancel** (if running):
329
- ```bash
330
- node scripts/test-mcp-dev.js call execute '{"command":"job:cancel","args":{"jobId":"<crawl-job-id>"}}'
331
- ```
332
- - PASS if cancelled or completed
333
-
334
- 20. **Delete crawl store**:
335
- ```bash
336
- node scripts/test-mcp-dev.js call execute '{"command":"store:delete","args":{"store":"bk-crawl-test"}}'
337
- ```
338
- - PASS if deleted
339
-
340
- ### Part 5: Hook Tests (same as production)
341
-
342
- [Tests 21-26 - same bash commands as production mode]
343
-
344
- ### Part 6: Cleanup (via dev script)
345
-
346
- 27-30: Same cleanup steps using dev script for MCP calls.
347
-
348
- ---
349
-
350
- ## Output Format
351
-
352
- ### Production mode (30 tests):
353
-
354
- | # | Test | Status |
355
- |---|------|--------|
356
- | 1 | MCP help | ? |
357
- | 2 | MCP commands | ? |
358
- | 3 | MCP stores | ? |
359
- | 4 | MCP store:create | ? |
360
- | 5 | MCP store:info | ? |
361
- | 6 | MCP store:index | ? |
362
- | 7 | MCP jobs | ? |
363
- | 8 | MCP job:status | ? |
364
- | 9 | MCP search | ? |
365
- | 10 | MCP get_full_context | ? |
366
- | 11 | /stores | ? |
367
- | 12 | /search | ? |
368
- | 13 | /suggest | ? |
369
- | 14 | /check-status | ? |
370
- | 15 | /skill-activation | ? |
371
- | 16 | /index | ? |
372
- | 17 | Crawl store create | ? |
373
- | 18 | Crawl job verify | ? |
374
- | 19 | Crawl job:cancel | ? |
375
- | 20 | Crawl store delete | ? |
376
- | 21 | Hook registration | ? |
377
- | 22 | PostToolUse - library | ? |
378
- | 23 | PostToolUse - non-library | ? |
379
- | 24 | Skill activation - match | ? |
380
- | 25 | Skill activation - exclude | ? |
381
- | 26 | Skill rules file | ? |
382
- | 27 | Delete test store | ? |
383
- | 28 | Remove test content | ? |
384
- | 29 | Verify store cleanup | ? |
385
- | 30 | Verify no artifacts | ? |
386
-
387
- **Result: X/30 tests passed**
388
-
389
- ### Development mode (24 tests):
390
-
391
- Same table but tests 11-16 show "SKIPPED (--dev mode)"
392
-
393
- **Result: X/24 tests passed (6 skipped)**
394
-
395
- ---
396
-
397
- ## Error Recovery
398
-
399
- If tests fail partway through, clean up manually:
400
-
401
- ```bash
402
- # Delete test stores
403
- node scripts/test-mcp-dev.js call execute '{"command":"store:delete","args":{"store":"bk-test-store"}}' 2>/dev/null || true
404
- node scripts/test-mcp-dev.js call execute '{"command":"store:delete","args":{"store":"bk-crawl-test"}}' 2>/dev/null || true
405
-
406
- # Remove test content
407
- rm -rf .bluera/bluera-knowledge/test-content
408
- ```
@@ -1,65 +0,0 @@
1
- ---
2
- description: Remove Bluera Knowledge data from this project
3
- allowed-tools: ["mcp__bluera-knowledge__execute"]
4
- ---
5
-
6
- # Uninstall Bluera Knowledge
7
-
8
- Remove Bluera Knowledge data from this project.
9
-
10
- ## Steps
11
-
12
- 1. Use mcp__bluera-knowledge__execute tool with command "uninstall":
13
- - Optional args.global: true to also remove global data
14
- - Optional args.keepDefinitions: false to also remove stores.config.json
15
-
16
- 2. Display the result showing what was deleted and cleanup instructions.
17
-
18
- ## Options
19
-
20
- | Flag | Description |
21
- |------|-------------|
22
- | `global` | Also delete global data (~/.local/share/bluera-knowledge/) |
23
- | `keepDefinitions` | Keep stores.config.json for team sharing (default: true) |
24
-
25
- ## Examples
26
-
27
- **Clean project data (preserves stores.config.json):**
28
- ```
29
- /bluera-knowledge:uninstall
30
- ```
31
-
32
- **Full cleanup including store definitions:**
33
- ```
34
- Use uninstall with keepDefinitions: false
35
- ```
36
-
37
- **Full cleanup including global data:**
38
- ```
39
- Use uninstall with global: true
40
- ```
41
-
42
- ## What Gets Deleted
43
-
44
- **Project data** (`.bluera/bluera-knowledge/`):
45
- - `data/` - Vector indices, cloned repos, stores.json
46
- - `config.json` - Plugin configuration
47
- - `stores.config.json` - Only if keepDefinitions: false
48
-
49
- **Global data** (with --global flag):
50
- - `~/.local/share/bluera-knowledge/` - Job history, skill settings
51
-
52
- ## What Is NOT Deleted
53
-
54
- - **Plugin cache** - Managed by Claude Code, instructions provided
55
- - **Python venv** - Inside plugin cache, cleaned when cache is cleared
56
-
57
- ## Testing Fresh Plugin Installs
58
-
59
- After running uninstall, to test a completely fresh plugin install:
60
-
61
- 1. Exit Claude Code
62
- 2. Clear plugin cache: `rm -rf ~/.claude/plugins/cache/bluera-knowledge-*`
63
- 3. Restart Claude Code and reinstall the plugin
64
-
65
- _Clearing the plugin cache removes everything: plugin code, Python venv, and all dependencies._