bluera-knowledge 0.9.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/commands/commit.md +37 -0
- package/.claude/hooks/post-edit-check.sh +41 -0
- package/.claude/settings.local.json.example +40 -0
- package/.claude/skills/atomic-commits/SKILL.md +53 -0
- package/.claude-plugin/plugin.json +13 -0
- package/.editorconfig +15 -0
- package/.github/workflows/auto-release.yml +59 -0
- package/.github/workflows/ci.yml +142 -0
- package/.github/workflows/release.yml +66 -0
- package/.github/workflows/update-marketplace.yml +96 -0
- package/.husky/pre-commit +47 -0
- package/.husky/pre-push +29 -0
- package/.versionrc.json +28 -0
- package/CHANGELOG.md +410 -0
- package/CLAUDE.md +109 -0
- package/LICENSE +21 -0
- package/NOTICE +47 -0
- package/README.md +1546 -0
- package/SECURITY.md +65 -0
- package/bun.lock +1758 -0
- package/commands/add-folder.md +48 -0
- package/commands/add-repo.md +50 -0
- package/commands/cancel.md +63 -0
- package/commands/check-status.md +78 -0
- package/commands/crawl.md +51 -0
- package/commands/index.md +48 -0
- package/commands/remove-store.md +52 -0
- package/commands/search.md +79 -0
- package/commands/search.sh +63 -0
- package/commands/stores.md +54 -0
- package/commands/suggest.md +82 -0
- package/dist/chunk-5QMHZUC4.js +3617 -0
- package/dist/chunk-5QMHZUC4.js.map +1 -0
- package/dist/chunk-BICFAWMN.js +656 -0
- package/dist/chunk-BICFAWMN.js.map +1 -0
- package/dist/chunk-J7J6LXOJ.js +958 -0
- package/dist/chunk-J7J6LXOJ.js.map +1 -0
- package/dist/chunk-L2YVNC63.js +59 -0
- package/dist/chunk-L2YVNC63.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1429 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/server.d.ts +15 -0
- package/dist/mcp/server.js +11 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/watch.service-YAIKKDCF.js +7 -0
- package/dist/watch.service-YAIKKDCF.js.map +1 -0
- package/dist/workers/background-worker-cli.d.ts +1 -0
- package/dist/workers/background-worker-cli.js +310 -0
- package/dist/workers/background-worker-cli.js.map +1 -0
- package/docs/plans/2024-12-17-ai-search-quality-implementation.md +752 -0
- package/docs/plans/2024-12-17-ai-search-quality-testing-design.md +201 -0
- package/docs/plans/2025-12-16-bluera-knowledge-cli.md +2951 -0
- package/docs/plans/2025-12-16-phase2-features.md +1518 -0
- package/docs/plans/2025-12-17-hil-implementation.md +926 -0
- package/docs/plans/2025-12-17-hil-quality-testing.md +224 -0
- package/docs/plans/2025-12-17-search-quality-phase1-implementation.md +1416 -0
- package/docs/plans/2025-12-17-search-quality-testing-v2-design.md +212 -0
- package/docs/plans/2025-12-28-ai-agent-optimization.md +1630 -0
- package/eslint-rules/require-skip-comment.js +81 -0
- package/eslint.config.js +61 -0
- package/hooks/check-dependencies.sh +110 -0
- package/hooks/format-search-results.py +132 -0
- package/hooks/hooks.json +27 -0
- package/hooks/job-status-hook.sh +51 -0
- package/knip.json +43 -0
- package/mcp.plugin.json +12 -0
- package/package.json +103 -0
- package/python/crawl_worker.py +275 -0
- package/python/requirements.txt +2 -0
- package/scripts/readme-version-updater.cjs +18 -0
- package/skills/advanced-workflows/SKILL.md +273 -0
- package/skills/atomic-commits/SKILL.md +77 -0
- package/skills/knowledge-search/SKILL.md +54 -0
- package/skills/search-optimization/SKILL.md +396 -0
- package/skills/store-lifecycle/SKILL.md +470 -0
- package/skills/when-to-query/SKILL.md +66 -0
- package/src/analysis/ast-parser.test.ts +423 -0
- package/src/analysis/ast-parser.ts +192 -0
- package/src/analysis/code-graph.test.ts +698 -0
- package/src/analysis/code-graph.ts +245 -0
- package/src/analysis/dependency-usage-analyzer.test.ts +799 -0
- package/src/analysis/dependency-usage-analyzer.ts +405 -0
- package/src/analysis/go-ast-parser.test.ts +531 -0
- package/src/analysis/go-ast-parser.ts +478 -0
- package/src/analysis/parser-factory.test.ts +132 -0
- package/src/analysis/parser-factory.ts +44 -0
- package/src/analysis/python-ast-parser.test.ts +210 -0
- package/src/analysis/python-ast-parser.ts +34 -0
- package/src/analysis/repo-url-resolver.test.ts +533 -0
- package/src/analysis/repo-url-resolver.ts +233 -0
- package/src/analysis/rust-ast-parser.test.ts +568 -0
- package/src/analysis/rust-ast-parser.ts +477 -0
- package/src/analysis/tree-sitter-parser.test.ts +297 -0
- package/src/analysis/tree-sitter-parser.ts +223 -0
- package/src/cli/commands/crawl.test.ts +942 -0
- package/src/cli/commands/crawl.ts +141 -0
- package/src/cli/commands/index-cmd.test.ts +722 -0
- package/src/cli/commands/index-cmd.ts +105 -0
- package/src/cli/commands/mcp.test.ts +218 -0
- package/src/cli/commands/mcp.ts +18 -0
- package/src/cli/commands/plugin-api.test.ts +313 -0
- package/src/cli/commands/plugin-api.ts +45 -0
- package/src/cli/commands/search.test.ts +911 -0
- package/src/cli/commands/search.ts +113 -0
- package/src/cli/commands/serve.test.ts +329 -0
- package/src/cli/commands/serve.ts +28 -0
- package/src/cli/commands/setup.test.ts +820 -0
- package/src/cli/commands/setup.ts +153 -0
- package/src/cli/commands/store.test.ts +1003 -0
- package/src/cli/commands/store.ts +167 -0
- package/src/cli/index.ts +7 -0
- package/src/cli/program.ts +59 -0
- package/src/crawl/article-converter.test.ts +604 -0
- package/src/crawl/article-converter.ts +98 -0
- package/src/crawl/bridge.test.ts +674 -0
- package/src/crawl/bridge.ts +236 -0
- package/src/crawl/claude-client.test.ts +663 -0
- package/src/crawl/claude-client.ts +234 -0
- package/src/crawl/intelligent-crawler.test.ts +931 -0
- package/src/crawl/intelligent-crawler.ts +428 -0
- package/src/crawl/markdown-utils.test.ts +703 -0
- package/src/crawl/markdown-utils.ts +228 -0
- package/src/crawl/schemas.ts +114 -0
- package/src/db/embeddings.test.ts +63 -0
- package/src/db/embeddings.ts +69 -0
- package/src/db/index.ts +2 -0
- package/src/db/lance.test.ts +390 -0
- package/src/db/lance.ts +164 -0
- package/src/defaults/repos.ts +67 -0
- package/src/index.ts +107 -0
- package/src/mcp/cache.test.ts +202 -0
- package/src/mcp/cache.ts +103 -0
- package/src/mcp/commands/index.ts +20 -0
- package/src/mcp/commands/job.commands.ts +54 -0
- package/src/mcp/commands/meta.commands.ts +54 -0
- package/src/mcp/commands/registry.ts +183 -0
- package/src/mcp/commands/store.commands.ts +75 -0
- package/src/mcp/handlers/execute.handler.test.ts +179 -0
- package/src/mcp/handlers/execute.handler.ts +24 -0
- package/src/mcp/handlers/index.ts +43 -0
- package/src/mcp/handlers/job.handler.test.ts +189 -0
- package/src/mcp/handlers/job.handler.ts +116 -0
- package/src/mcp/handlers/search.handler.test.ts +334 -0
- package/src/mcp/handlers/search.handler.ts +209 -0
- package/src/mcp/handlers/store.handler.test.ts +415 -0
- package/src/mcp/handlers/store.handler.ts +295 -0
- package/src/mcp/schemas/index.test.ts +315 -0
- package/src/mcp/schemas/index.ts +138 -0
- package/src/mcp/server.test.ts +36 -0
- package/src/mcp/server.ts +162 -0
- package/src/mcp/types.ts +41 -0
- package/src/plugin/commands.test.ts +789 -0
- package/src/plugin/commands.ts +257 -0
- package/src/plugin/dependency-analyzer.test.ts +380 -0
- package/src/plugin/dependency-analyzer.ts +147 -0
- package/src/plugin/git-clone.test.ts +332 -0
- package/src/plugin/git-clone.ts +57 -0
- package/src/server/app.test.ts +752 -0
- package/src/server/app.ts +119 -0
- package/src/server/index.test.ts +477 -0
- package/src/server/index.ts +1 -0
- package/src/services/chunking.service.test.ts +363 -0
- package/src/services/chunking.service.ts +350 -0
- package/src/services/code-graph.service.test.ts +304 -0
- package/src/services/code-graph.service.ts +302 -0
- package/src/services/code-unit.service.test.ts +596 -0
- package/src/services/code-unit.service.ts +115 -0
- package/src/services/config.service.test.ts +127 -0
- package/src/services/config.service.ts +69 -0
- package/src/services/index.service.test.ts +1002 -0
- package/src/services/index.service.ts +266 -0
- package/src/services/index.ts +75 -0
- package/src/services/job.service.test.ts +418 -0
- package/src/services/job.service.ts +246 -0
- package/src/services/project-root.service.test.ts +506 -0
- package/src/services/project-root.service.ts +112 -0
- package/src/services/search.service.test.ts +1105 -0
- package/src/services/search.service.ts +892 -0
- package/src/services/services.test.ts +38 -0
- package/src/services/snippet.service.test.ts +205 -0
- package/src/services/snippet.service.ts +166 -0
- package/src/services/store.service.test.ts +474 -0
- package/src/services/store.service.ts +225 -0
- package/src/services/watch.service.test.ts +553 -0
- package/src/services/watch.service.ts +71 -0
- package/src/types/brands.test.ts +45 -0
- package/src/types/brands.ts +32 -0
- package/src/types/config.ts +79 -0
- package/src/types/document.ts +30 -0
- package/src/types/index.ts +66 -0
- package/src/types/job.ts +46 -0
- package/src/types/progress.ts +9 -0
- package/src/types/result.test.ts +44 -0
- package/src/types/result.ts +41 -0
- package/src/types/search.ts +95 -0
- package/src/types/store.test.ts +69 -0
- package/src/types/store.ts +47 -0
- package/src/utils/type-guards.test.ts +346 -0
- package/src/utils/type-guards.ts +61 -0
- package/src/workers/background-worker-cli.ts +105 -0
- package/src/workers/background-worker.test.ts +178 -0
- package/src/workers/background-worker.ts +294 -0
- package/src/workers/spawn-worker.test.ts +128 -0
- package/src/workers/spawn-worker.ts +49 -0
- package/tests/analysis/ast-parser.test.ts +98 -0
- package/tests/analysis/code-graph.test.ts +60 -0
- package/tests/fixtures/README.md +114 -0
- package/tests/fixtures/code-snippets/api/error-handling.ts +267 -0
- package/tests/fixtures/code-snippets/api/rest-controller.ts +303 -0
- package/tests/fixtures/code-snippets/auth/jwt-auth.ts +213 -0
- package/tests/fixtures/code-snippets/auth/oauth-flow.ts +245 -0
- package/tests/fixtures/code-snippets/database/repository-pattern.ts +272 -0
- package/tests/fixtures/corpus/VERSION.md +25 -0
- package/tests/fixtures/corpus/articles/jwt-authentication.md +97 -0
- package/tests/fixtures/corpus/articles/react-hooks-patterns.md +127 -0
- package/tests/fixtures/corpus/articles/typescript-generics.md +111 -0
- package/tests/fixtures/corpus/documentation/express-middleware.md +71 -0
- package/tests/fixtures/corpus/documentation/express-routing.md +83 -0
- package/tests/fixtures/corpus/documentation/node-streams.md +78 -0
- package/tests/fixtures/corpus/oss-repos/express/History.md +3871 -0
- package/tests/fixtures/corpus/oss-repos/express/LICENSE +24 -0
- package/tests/fixtures/corpus/oss-repos/express/Readme.md +276 -0
- package/tests/fixtures/corpus/oss-repos/express/SECURITY.md +56 -0
- package/tests/fixtures/corpus/oss-repos/express/benchmarks/Makefile +17 -0
- package/tests/fixtures/corpus/oss-repos/express/benchmarks/README.md +34 -0
- package/tests/fixtures/corpus/oss-repos/express/benchmarks/middleware.js +20 -0
- package/tests/fixtures/corpus/oss-repos/express/benchmarks/run +18 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/README.md +29 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/auth/index.js +134 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/auth/views/foot.ejs +2 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/auth/views/head.ejs +20 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/auth/views/login.ejs +21 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/content-negotiation/db.js +9 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/content-negotiation/index.js +46 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/content-negotiation/users.js +19 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/cookie-sessions/index.js +25 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/cookies/index.js +53 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/downloads/files/CCTV/345/244/247/350/265/233/344/270/212/346/265/267/345/210/206/350/265/233/345/214/272.txt +2 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/downloads/files/amazing.txt +1 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/downloads/files/notes/groceries.txt +3 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/downloads/index.js +40 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/ejs/index.js +57 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/ejs/public/stylesheets/style.css +4 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/ejs/views/footer.html +2 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/ejs/views/header.html +9 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/ejs/views/users.html +10 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/error/index.js +53 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/error-pages/index.js +103 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/error-pages/views/404.ejs +3 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/error-pages/views/500.ejs +8 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/error-pages/views/error_header.ejs +10 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/error-pages/views/footer.ejs +2 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/error-pages/views/index.ejs +20 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/hello-world/index.js +15 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/markdown/index.js +44 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/markdown/views/index.md +4 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/multi-router/controllers/api_v1.js +15 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/multi-router/controllers/api_v2.js +15 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/multi-router/index.js +18 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/mvc/controllers/main/index.js +5 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/mvc/controllers/pet/index.js +31 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/mvc/controllers/pet/views/edit.ejs +17 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/mvc/controllers/pet/views/show.ejs +15 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/mvc/controllers/user/index.js +41 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/mvc/controllers/user/views/edit.hbs +27 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/mvc/controllers/user/views/list.hbs +18 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/mvc/controllers/user/views/show.hbs +31 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/mvc/controllers/user-pet/index.js +22 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/mvc/db.js +16 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/mvc/index.js +95 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/mvc/lib/boot.js +83 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/mvc/public/style.css +14 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/mvc/views/404.ejs +13 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/mvc/views/5xx.ejs +13 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/online/index.js +61 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/params/index.js +74 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/resource/index.js +95 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/route-map/index.js +75 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/route-middleware/index.js +90 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/route-separation/index.js +55 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/route-separation/post.js +13 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/route-separation/public/style.css +24 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/route-separation/site.js +5 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/route-separation/user.js +47 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/route-separation/views/footer.ejs +2 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/route-separation/views/header.ejs +9 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/route-separation/views/index.ejs +10 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/route-separation/views/posts/index.ejs +12 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/route-separation/views/users/edit.ejs +23 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/route-separation/views/users/index.ejs +14 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/route-separation/views/users/view.ejs +9 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/search/index.js +61 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/search/public/client.js +15 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/search/public/index.html +21 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/session/index.js +37 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/session/redis.js +39 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/static-files/index.js +43 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/static-files/public/css/style.css +3 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/static-files/public/hello.txt +1 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/static-files/public/js/app.js +1 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/vhost/index.js +53 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/view-constructor/github-view.js +53 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/view-constructor/index.js +48 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/view-locals/index.js +155 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/view-locals/user.js +36 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/view-locals/views/index.ejs +20 -0
- package/tests/fixtures/corpus/oss-repos/express/examples/web-service/index.js +117 -0
- package/tests/fixtures/corpus/oss-repos/express/index.js +11 -0
- package/tests/fixtures/corpus/oss-repos/express/lib/application.js +631 -0
- package/tests/fixtures/corpus/oss-repos/express/lib/express.js +81 -0
- package/tests/fixtures/corpus/oss-repos/express/lib/request.js +514 -0
- package/tests/fixtures/corpus/oss-repos/express/lib/response.js +1053 -0
- package/tests/fixtures/corpus/oss-repos/express/lib/utils.js +271 -0
- package/tests/fixtures/corpus/oss-repos/express/lib/view.js +205 -0
- package/tests/fixtures/corpus/oss-repos/express/package.json +99 -0
- package/tests/fixtures/corpus/oss-repos/express/test/Route.js +274 -0
- package/tests/fixtures/corpus/oss-repos/express/test/Router.js +636 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/auth.js +117 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/content-negotiation.js +49 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/cookie-sessions.js +38 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/cookies.js +71 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/downloads.js +47 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/ejs.js +17 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/error-pages.js +99 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/error.js +29 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/hello-world.js +21 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/markdown.js +21 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/multi-router.js +44 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/mvc.js +132 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/params.js +44 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/resource.js +68 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/route-map.js +45 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/route-separation.js +97 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/vhost.js +46 -0
- package/tests/fixtures/corpus/oss-repos/express/test/acceptance/web-service.js +105 -0
- package/tests/fixtures/corpus/oss-repos/express/test/app.all.js +38 -0
- package/tests/fixtures/corpus/oss-repos/express/test/app.engine.js +83 -0
- package/tests/fixtures/corpus/oss-repos/express/test/app.head.js +66 -0
- package/tests/fixtures/corpus/oss-repos/express/test/app.js +120 -0
- package/tests/fixtures/corpus/oss-repos/express/test/app.listen.js +55 -0
- package/tests/fixtures/corpus/oss-repos/express/test/app.locals.js +26 -0
- package/tests/fixtures/corpus/oss-repos/express/test/app.options.js +116 -0
- package/tests/fixtures/corpus/oss-repos/express/test/app.param.js +323 -0
- package/tests/fixtures/corpus/oss-repos/express/test/app.render.js +374 -0
- package/tests/fixtures/corpus/oss-repos/express/test/app.request.js +143 -0
- package/tests/fixtures/corpus/oss-repos/express/test/app.response.js +143 -0
- package/tests/fixtures/corpus/oss-repos/express/test/app.route.js +197 -0
- package/tests/fixtures/corpus/oss-repos/express/test/app.router.js +1217 -0
- package/tests/fixtures/corpus/oss-repos/express/test/app.routes.error.js +62 -0
- package/tests/fixtures/corpus/oss-repos/express/test/app.use.js +542 -0
- package/tests/fixtures/corpus/oss-repos/express/test/config.js +207 -0
- package/tests/fixtures/corpus/oss-repos/express/test/exports.js +82 -0
- package/tests/fixtures/corpus/oss-repos/express/test/express.json.js +755 -0
- package/tests/fixtures/corpus/oss-repos/express/test/express.raw.js +513 -0
- package/tests/fixtures/corpus/oss-repos/express/test/express.static.js +815 -0
- package/tests/fixtures/corpus/oss-repos/express/test/express.text.js +566 -0
- package/tests/fixtures/corpus/oss-repos/express/test/express.urlencoded.js +828 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/% of dogs.txt +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/.name +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/blog/index.html +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/blog/post/index.tmpl +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/broken.send +0 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/default_layout/name.tmpl +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/default_layout/user.tmpl +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/email.tmpl +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/empty.txt +0 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/local_layout/user.tmpl +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/name.tmpl +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/name.txt +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/nums.txt +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/pets/names.txt +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/snow /342/230/203/.gitkeep +0 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/todo.html +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/todo.txt +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/user.html +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/user.tmpl +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/users/index.html +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/fixtures/users/tobi.txt +1 -0
- package/tests/fixtures/corpus/oss-repos/express/test/middleware.basic.js +42 -0
- package/tests/fixtures/corpus/oss-repos/express/test/regression.js +20 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.accepts.js +125 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.acceptsCharsets.js +50 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.acceptsEncodings.js +39 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.acceptsLanguages.js +57 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.baseUrl.js +88 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.fresh.js +70 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.get.js +60 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.host.js +156 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.hostname.js +188 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.ip.js +113 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.ips.js +71 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.is.js +169 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.path.js +20 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.protocol.js +113 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.query.js +106 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.range.js +104 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.route.js +28 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.secure.js +101 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.signedCookies.js +37 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.stale.js +50 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.subdomains.js +173 -0
- package/tests/fixtures/corpus/oss-repos/express/test/req.xhr.js +42 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.append.js +116 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.attachment.js +79 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.clearCookie.js +62 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.cookie.js +295 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.download.js +487 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.format.js +248 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.get.js +21 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.json.js +186 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.jsonp.js +344 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.links.js +65 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.locals.js +40 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.location.js +316 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.redirect.js +214 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.render.js +367 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.send.js +569 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.sendFile.js +913 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.sendStatus.js +44 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.set.js +124 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.status.js +206 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.type.js +46 -0
- package/tests/fixtures/corpus/oss-repos/express/test/res.vary.js +90 -0
- package/tests/fixtures/corpus/oss-repos/express/test/support/env.js +3 -0
- package/tests/fixtures/corpus/oss-repos/express/test/support/tmpl.js +36 -0
- package/tests/fixtures/corpus/oss-repos/express/test/support/utils.js +86 -0
- package/tests/fixtures/corpus/oss-repos/express/test/utils.js +83 -0
- package/tests/fixtures/corpus/oss-repos/hono/.devcontainer/Dockerfile +11 -0
- package/tests/fixtures/corpus/oss-repos/hono/.devcontainer/devcontainer.json +21 -0
- package/tests/fixtures/corpus/oss-repos/hono/.devcontainer/docker-compose.yml +18 -0
- package/tests/fixtures/corpus/oss-repos/hono/.eslintignore +1 -0
- package/tests/fixtures/corpus/oss-repos/hono/.eslintrc.cjs +9 -0
- package/tests/fixtures/corpus/oss-repos/hono/.gitpod.yml +9 -0
- package/tests/fixtures/corpus/oss-repos/hono/.prettierrc +9 -0
- package/tests/fixtures/corpus/oss-repos/hono/.vitest.config/jsx-runtime-default.ts +15 -0
- package/tests/fixtures/corpus/oss-repos/hono/.vitest.config/jsx-runtime-dom.ts +15 -0
- package/tests/fixtures/corpus/oss-repos/hono/.vitest.config/setup-vitest.ts +47 -0
- package/tests/fixtures/corpus/oss-repos/hono/LICENSE +21 -0
- package/tests/fixtures/corpus/oss-repos/hono/README.md +91 -0
- package/tests/fixtures/corpus/oss-repos/hono/build.ts +80 -0
- package/tests/fixtures/corpus/oss-repos/hono/bun.lockb +0 -0
- package/tests/fixtures/corpus/oss-repos/hono/bunfig.toml +7 -0
- package/tests/fixtures/corpus/oss-repos/hono/codecov.yml +13 -0
- package/tests/fixtures/corpus/oss-repos/hono/docs/CODE_OF_CONDUCT.md +128 -0
- package/tests/fixtures/corpus/oss-repos/hono/docs/CONTRIBUTING.md +62 -0
- package/tests/fixtures/corpus/oss-repos/hono/docs/MIGRATION.md +295 -0
- package/tests/fixtures/corpus/oss-repos/hono/docs/images/hono-logo.png +0 -0
- package/tests/fixtures/corpus/oss-repos/hono/docs/images/hono-logo.pxm +0 -0
- package/tests/fixtures/corpus/oss-repos/hono/docs/images/hono-logo.svg +6 -0
- package/tests/fixtures/corpus/oss-repos/hono/docs/images/hono-title.png +0 -0
- package/tests/fixtures/corpus/oss-repos/hono/docs/images/hono-title.pxm +0 -0
- package/tests/fixtures/corpus/oss-repos/hono/jsr.json +119 -0
- package/tests/fixtures/corpus/oss-repos/hono/package.cjs.json +3 -0
- package/tests/fixtures/corpus/oss-repos/hono/package.json +650 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/aws-lambda/handler.ts +492 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/aws-lambda/index.ts +13 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/aws-lambda/types.ts +144 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/bun/conninfo.ts +28 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/bun/index.ts +9 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/bun/serve-static.ts +35 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/bun/server.ts +30 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/bun/ssg.ts +27 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/bun/websocket.ts +110 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/cloudflare-pages/handler.ts +120 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/cloudflare-pages/index.ts +7 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/cloudflare-workers/conninfo.ts +7 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/cloudflare-workers/index.ts +8 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/cloudflare-workers/serve-static-module.ts +12 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/cloudflare-workers/serve-static.ts +39 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/cloudflare-workers/utils.ts +50 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/cloudflare-workers/websocket.ts +50 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/deno/conninfo.ts +17 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/deno/deno.d.ts +28 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/deno/index.ts +9 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/deno/serve-static.ts +40 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/deno/ssg.ts +27 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/deno/websocket.ts +51 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/lambda-edge/conninfo.ts +15 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/lambda-edge/handler.ts +189 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/lambda-edge/index.ts +14 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/netlify/handler.ts +10 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/netlify/index.ts +6 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/netlify/mod.ts +1 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/service-worker/handler.ts +34 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/service-worker/index.ts +5 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/service-worker/types.ts +14 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/vercel/conninfo.ts +8 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/vercel/handler.ts +9 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/adapter/vercel/index.ts +7 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/client/client.ts +214 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/client/index.ts +14 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/client/types.ts +180 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/client/utils.ts +54 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/compose.ts +94 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/context.ts +914 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/accepts/accepts.ts +81 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/accepts/index.ts +6 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/adapter/index.ts +85 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/conninfo/index.ts +6 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/conninfo/types.ts +45 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/cookie/index.ts +130 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/css/common.ts +243 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/css/index.ts +220 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/dev/index.ts +79 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/factory/index.ts +246 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/html/index.ts +56 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/ssg/index.ts +13 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/ssg/middleware.ts +79 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/ssg/ssg.ts +388 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/ssg/utils.ts +71 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/streaming/index.ts +9 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/streaming/sse.ts +89 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/streaming/stream.ts +36 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/streaming/text.ts +15 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/testing/index.ts +26 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/helper/websocket/index.ts +57 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/hono-base.ts +523 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/hono.ts +34 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/http-exception.ts +78 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/index.ts +51 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/base.ts +419 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/children.ts +20 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/components.ts +195 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/constants.ts +5 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/context.ts +50 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/dom/client.ts +89 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/dom/components.ts +39 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/dom/context.ts +52 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/dom/css.ts +246 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/dom/hooks/index.ts +91 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/dom/index.ts +159 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/dom/intrinsic-element/components.ts +398 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/dom/jsx-dev-runtime.ts +22 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/dom/jsx-runtime.ts +7 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/dom/render.ts +772 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/dom/server.ts +70 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/dom/utils.ts +7 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/hooks/index.ts +426 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/index.ts +114 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/intrinsic-element/common.ts +11 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/intrinsic-element/components.ts +196 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/intrinsic-elements.ts +924 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/jsx-dev-runtime.ts +26 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/jsx-runtime.ts +18 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/streaming.ts +184 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/types.ts +41 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/jsx/utils.ts +36 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/basic-auth/index.ts +128 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/bearer-auth/index.ts +159 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/body-limit/index.ts +115 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/cache/index.ts +127 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/combine/index.ts +153 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/compress/index.ts +79 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/context-storage/index.ts +55 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/cors/index.ts +141 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/csrf/index.ts +90 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/etag/index.ts +88 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/ip-restriction/index.ts +178 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/jsx-renderer/index.ts +158 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/jwt/index.ts +8 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/jwt/jwt.ts +159 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/logger/index.ts +93 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/method-override/index.ts +146 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/powered-by/index.ts +13 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/pretty-json/index.ts +50 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/request-id/index.ts +8 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/request-id/request-id.ts +59 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/secure-headers/index.ts +8 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/secure-headers/permissions-policy.ts +86 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/secure-headers/secure-headers.ts +319 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/serve-static/index.ts +140 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/timeout/index.ts +58 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/timing/index.ts +7 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/timing/timing.ts +225 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/middleware/trailing-slash/index.ts +71 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/preset/quick.ts +24 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/preset/tiny.ts +20 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/request.ts +403 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/router/linear-router/index.ts +6 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/router/linear-router/router.ts +132 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/router/pattern-router/index.ts +6 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/router/pattern-router/router.ts +54 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/router/reg-exp-router/index.ts +6 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/router/reg-exp-router/node.ts +159 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/router/reg-exp-router/router.ts +274 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/router/reg-exp-router/trie.ts +74 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/router/smart-router/index.ts +6 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/router/smart-router/router.ts +69 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/router/trie-router/index.ts +6 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/router/trie-router/node.ts +205 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/router/trie-router/router.ts +28 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/router.ts +103 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/types.ts +2009 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/basic-auth.ts +26 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/body.ts +225 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/buffer.ts +65 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/color.ts +26 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/concurrent.ts +55 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/cookie.ts +230 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/crypto.ts +65 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/encode.ts +34 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/filepath.ts +56 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/handler.ts +15 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/html.ts +182 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/http-status.ts +69 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/ipaddr.ts +113 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/jwt/index.ts +7 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/jwt/jwa.ts +23 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/jwt/jws.ts +226 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/jwt/jwt.ts +114 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/jwt/types.ts +83 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/jwt/utf8.ts +7 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/mime.ts +142 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/stream.ts +96 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/types.ts +105 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/utils/url.ts +310 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/validator/index.ts +7 -0
- package/tests/fixtures/corpus/oss-repos/hono/src/validator/validator.ts +151 -0
- package/tests/fixtures/corpus/oss-repos/hono/tsconfig.build.json +23 -0
- package/tests/fixtures/corpus/oss-repos/hono/tsconfig.json +28 -0
- package/tests/fixtures/corpus/oss-repos/hono/vitest.config.ts +34 -0
- package/tests/fixtures/corpus/oss-repos/hono/yarn.lock +6232 -0
- package/tests/fixtures/documentation/api-reference.md +412 -0
- package/tests/fixtures/documentation/architecture.md +214 -0
- package/tests/fixtures/documentation/deployment-guide.md +420 -0
- package/tests/fixtures/github-readmes/express.md +133 -0
- package/tests/fixtures/github-readmes/nextjs.md +106 -0
- package/tests/fixtures/github-readmes/react.md +74 -0
- package/tests/fixtures/github-readmes/typescript.md +93 -0
- package/tests/fixtures/github-readmes/vite.md +79 -0
- package/tests/fixtures/queries/core.json +125 -0
- package/tests/fixtures/queries/extended.json +427 -0
- package/tests/fixtures/queries/generated/.gitkeep +0 -0
- package/tests/fixtures/test-server.ts +267 -0
- package/tests/helpers/performance-metrics.ts +387 -0
- package/tests/helpers/search-relevance.ts +381 -0
- package/tests/integration/cli-consistency.test.ts +299 -0
- package/tests/integration/cli.test.ts +69 -0
- package/tests/integration/e2e-workflow.test.ts +612 -0
- package/tests/integration/python-bridge.test.ts +183 -0
- package/tests/integration/search-quality.test.ts +718 -0
- package/tests/integration/stress.test.ts +326 -0
- package/tests/mcp/server.test.ts +15 -0
- package/tests/scripts/schemas/evaluation.json +44 -0
- package/tests/scripts/schemas/query-generation.json +21 -0
- package/tests/services/code-unit.service.test.ts +47 -0
- package/tests/services/search.progressive-context.test.ts +35 -0
- package/tsconfig.json +34 -0
- package/tsup.config.ts +15 -0
- package/turndown-plugin-gfm.d.ts +29 -0
- package/vitest.config.ts +79 -0
package/README.md
ADDED
|
@@ -0,0 +1,1546 @@
|
|
|
1
|
+
# π§ Bluera Knowledge
|
|
2
|
+
|
|
3
|
+
[](https://github.com/blueraai/bluera-knowledge/actions/workflows/ci.yml)
|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
> π **Build a local knowledge base for your AI coding agentβdependency source code, crawled docs, and your own files, all instantly searchable.**
|
|
10
|
+
|
|
11
|
+
**Use it as:**
|
|
12
|
+
- π **Claude Code Plugin** β Slash commands + MCP tools + Skills for optimal Claude Code integration
|
|
13
|
+
- π¦ **npm Package** β Standalone CLI for any editor, CI/CD, or automation
|
|
14
|
+
|
|
15
|
+
Bluera Knowledge gives AI coding agents instant local access to authoritative context:
|
|
16
|
+
|
|
17
|
+
- **Dependency source code** β Clone and search the repos of dependencies you actually use
|
|
18
|
+
- **Documentation** β Crawl, index, and search any docs site
|
|
19
|
+
- **Your files** β Index and search local folders for project-specific knowledge
|
|
20
|
+
|
|
21
|
+
All searchable in milliseconds, no rate limits, fully offline.
|
|
22
|
+
|
|
23
|
+
## π Table of Contents
|
|
24
|
+
|
|
25
|
+
<details>
|
|
26
|
+
<summary>Click to expand</summary>
|
|
27
|
+
|
|
28
|
+
- [Installation](#-installation)
|
|
29
|
+
- [Why Bluera Knowledge?](#-why-bluera-knowledge)
|
|
30
|
+
- [Token Efficiency](#-token-efficiency)
|
|
31
|
+
- [Quick Start](#-quick-start)
|
|
32
|
+
- [Features](#-features)
|
|
33
|
+
- [How It Works](#-how-it-works)
|
|
34
|
+
- [User Interface](#-user-interface)
|
|
35
|
+
- [Background Jobs](#-background-jobs)
|
|
36
|
+
- [Commands](#-commands)
|
|
37
|
+
- [Crawler Architecture](#-crawler-architecture)
|
|
38
|
+
- [Use Cases](#-use-cases)
|
|
39
|
+
- [Dependencies](#-dependencies)
|
|
40
|
+
- [Troubleshooting](#-troubleshooting)
|
|
41
|
+
- [MCP Integration](#-mcp-integration)
|
|
42
|
+
- [CLI Tool](#οΈ-cli-tool)
|
|
43
|
+
- [Skills for Claude Code](#-skills-for-claude-code)
|
|
44
|
+
- [Data Storage](#-data-storage)
|
|
45
|
+
- [Development](#-development)
|
|
46
|
+
- [Setup](#-setup)
|
|
47
|
+
- [Claude Code Settings](#οΈ-claude-code-settings-recommended)
|
|
48
|
+
- [Commands / Scripts](#-commands)
|
|
49
|
+
- [Releasing](#-releasing)
|
|
50
|
+
- [Testing](#-testing-locally)
|
|
51
|
+
- [Technologies](#-technologies)
|
|
52
|
+
- [Contributing](#-contributing)
|
|
53
|
+
- [License](#-license)
|
|
54
|
+
|
|
55
|
+
</details>
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## π¦ Installation
|
|
60
|
+
|
|
61
|
+
### As Claude Code Plugin
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Add the Bluera marketplace (one-time setup)
|
|
65
|
+
/plugin marketplace add blueraai/bluera-marketplace
|
|
66
|
+
|
|
67
|
+
# Install the plugin (or use /plugin to browse the UI)
|
|
68
|
+
/plugin install bluera-knowledge@bluera
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
> [!NOTE]
|
|
72
|
+
> **First launch may appear to hang** while the plugin installs Python dependencies (crawl4ai). This is normalβsubsequent launches are instant.
|
|
73
|
+
|
|
74
|
+
### As npm Package
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Global install (CLI available everywhere)
|
|
78
|
+
npm install -g bluera-knowledge
|
|
79
|
+
|
|
80
|
+
# Or project install
|
|
81
|
+
npm install --save-dev bluera-knowledge
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
> [!TIP]
|
|
85
|
+
> Both installation methods provide the same core functionality. The plugin adds slash commands and Skills; the npm package provides a standalone CLI.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## β¨ Why Bluera Knowledge?
|
|
90
|
+
|
|
91
|
+
When you ask Claude Code "how do I handle errors in Express middleware?", it can:
|
|
92
|
+
|
|
93
|
+
1. **Guess from training data** β might be outdated or wrong
|
|
94
|
+
2. **Search the web** β slow, rate-limited, often returns blog posts instead of source
|
|
95
|
+
3. **Read your local knowledge base** β authoritative, complete, instant β
|
|
96
|
+
|
|
97
|
+
Bluera Knowledge enables option 3 by building a searchable knowledge base from **three types of sources**:
|
|
98
|
+
|
|
99
|
+
| Source Type | What It Does | Example |
|
|
100
|
+
|------------|--------------|---------|
|
|
101
|
+
| **π¦ Dependency Source Code** | Clone & search library repos you actually use | Express, React, Lodash |
|
|
102
|
+
| **π Documentation Sites** | Crawl & index any docs site | Next.js docs, FastAPI guides |
|
|
103
|
+
| **π Local Files** | Index project-specific content | Your docs, standards, API specs |
|
|
104
|
+
|
|
105
|
+
**The result:** Your AI agent has local, instant access to authoritative information with zero rate limits:
|
|
106
|
+
|
|
107
|
+
| Capability | Without | With Bluera Knowledge |
|
|
108
|
+
|------------|---------|----------------------|
|
|
109
|
+
| Response time | 2-5 seconds (web) | ~100ms (local) |
|
|
110
|
+
| Accuracy | Uncertain | Authoritative (source code + docs) |
|
|
111
|
+
| Completeness | Partial docs | Full implementation + tests + your content |
|
|
112
|
+
| Rate limits | Yes | None |
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## π° Token Efficiency
|
|
117
|
+
|
|
118
|
+
Beyond speed and accuracy, Bluera Knowledge can **significantly reduce token consumption** for code-related queriesβtypically saving 60-75% compared to web search approaches.
|
|
119
|
+
|
|
120
|
+
### π How It Works
|
|
121
|
+
|
|
122
|
+
**Without Bluera Knowledge:**
|
|
123
|
+
- Web searches return 5-10 results (~500-2,000 tokens each)
|
|
124
|
+
- Total per search: **3,000-10,000 tokens**
|
|
125
|
+
- Often need multiple searches to find the right answer
|
|
126
|
+
- Lower signal-to-noise ratio (blog posts mixed with actual docs)
|
|
127
|
+
|
|
128
|
+
**With Bluera Knowledge:**
|
|
129
|
+
- Semantic search returns top 10 relevant code chunks (~200-400 tokens each)
|
|
130
|
+
- Structured metadata (file paths, imports, purpose)
|
|
131
|
+
- Total per search: **1,500-3,000 tokens**
|
|
132
|
+
- Higher relevance due to vector search (fewer follow-up queries needed)
|
|
133
|
+
|
|
134
|
+
### π― Real-World Examples
|
|
135
|
+
|
|
136
|
+
#### Example 1: Library Implementation Question
|
|
137
|
+
|
|
138
|
+
**Question:** "How does Express handle middleware errors?"
|
|
139
|
+
|
|
140
|
+
| Approach | Token Cost | Result |
|
|
141
|
+
|----------|-----------|--------|
|
|
142
|
+
| **Web Search** | ~8,000 tokens<br/>(3 searches: general query β refined query β source code) | Blog posts + Stack Overflow + eventual guess |
|
|
143
|
+
| **Bluera Knowledge** | ~2,000 tokens<br/>(1 semantic search) | Actual Express source code, authoritative |
|
|
144
|
+
| **Savings** | **75% fewer tokens** β
| Higher accuracy |
|
|
145
|
+
|
|
146
|
+
#### Example 2: Dependency Exploration
|
|
147
|
+
|
|
148
|
+
**Question:** "How does LanceDB's vector search work?"
|
|
149
|
+
|
|
150
|
+
| Approach | Token Cost | Result |
|
|
151
|
+
|----------|-----------|--------|
|
|
152
|
+
| **Web Search** | ~9,500 tokens<br/>(General docs β API docs β fetch specific page) | Documentation, might miss implementation details |
|
|
153
|
+
| **Bluera Knowledge** | ~1,500 tokens<br/>(Search returns source + tests + examples) | Source code from Python + Rust implementation |
|
|
154
|
+
| **Savings** | **84% fewer tokens** β
| Complete picture |
|
|
155
|
+
|
|
156
|
+
#### Example 3: Version-Specific Behavior
|
|
157
|
+
|
|
158
|
+
**Question:** "What changed in React 18's useEffect cleanup?"
|
|
159
|
+
|
|
160
|
+
| Approach | Token Cost | Result |
|
|
161
|
+
|----------|-----------|--------|
|
|
162
|
+
| **Training Data** | 0 tokens (but might be outdated) | Uncertain if accurate for React 18 |
|
|
163
|
+
| **Web Search** | ~5,000 tokens<br/>(Search changelog β blog posts β docs) | Mix of React 17 and 18 info |
|
|
164
|
+
| **Bluera Knowledge** | ~2,000 tokens<br/>(Search indexed React 18 source) | Exact React 18 implementation |
|
|
165
|
+
| **Savings** | **60% fewer tokens** β
| Version-accurate |
|
|
166
|
+
|
|
167
|
+
### βοΈ When BK Uses More Tokens
|
|
168
|
+
|
|
169
|
+
Bluera Knowledge isn't always the most token-efficient choice:
|
|
170
|
+
|
|
171
|
+
| Scenario | Best Approach | Why |
|
|
172
|
+
|----------|---------------|-----|
|
|
173
|
+
| **Simple concept questions**<br/>("What is a JavaScript closure?") | Training data | Claude already knows this (0 tokens) |
|
|
174
|
+
| **Current events**<br/>("Latest Next.js 15 release notes") | Web search | BK only has what you've indexed |
|
|
175
|
+
| **General advice**<br/>("How to structure a React app?") | Training data | Opinion-based, not code-specific |
|
|
176
|
+
|
|
177
|
+
### π Summary: Token Savings by Query Type
|
|
178
|
+
|
|
179
|
+
| Query Type | Typical Token Savings | When to Use BK |
|
|
180
|
+
|------------|----------------------|----------------|
|
|
181
|
+
| **Library internals** | 60-75% | β
Always |
|
|
182
|
+
| **Version-specific behavior** | 50-70% | β
Always |
|
|
183
|
+
| **"How does X work internally?"** | 70-85% | β
Always |
|
|
184
|
+
| **API usage examples** | 40-60% | β
Recommended |
|
|
185
|
+
| **General concepts** | -100% (uses more) | β Skip BK |
|
|
186
|
+
| **Current events** | -100% (uses more) | β Skip BK |
|
|
187
|
+
|
|
188
|
+
### π‘ Best Practice
|
|
189
|
+
|
|
190
|
+
Let Claude Code decide when to use Bluera Knowledge:
|
|
191
|
+
- For **library-specific, version-specific, or implementation questions** β BK saves tokens and increases accuracy
|
|
192
|
+
- For **general programming concepts** β Training data is more efficient
|
|
193
|
+
- For **current events** β Web search is necessary
|
|
194
|
+
|
|
195
|
+
The plugin's Skills teach Claude Code these patterns, so it automatically uses the most efficient approach for each question.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## π Quick Start
|
|
200
|
+
|
|
201
|
+
### Using Claude Code Plugin
|
|
202
|
+
|
|
203
|
+
- [ ] **π¦ Add a library**: `/bluera-knowledge:add-repo https://github.com/lodash/lodash`
|
|
204
|
+
- [ ] **π Index your docs**: `/bluera-knowledge:add-folder ./docs --name=project-docs`
|
|
205
|
+
- [ ] **π Test search**: `/bluera-knowledge:search "deep clone object"`
|
|
206
|
+
- [ ] **π View stores**: `/bluera-knowledge:stores`
|
|
207
|
+
|
|
208
|
+
> [!TIP]
|
|
209
|
+
> Not sure which libraries to index? Use `/bluera-knowledge:suggest` to analyze your project's dependencies.
|
|
210
|
+
|
|
211
|
+
### Using CLI (npm package)
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
# Add a library
|
|
215
|
+
bluera-knowledge store create lodash --type repo --source https://github.com/lodash/lodash
|
|
216
|
+
|
|
217
|
+
# Index your docs
|
|
218
|
+
bluera-knowledge store create project-docs --type file --source ./docs
|
|
219
|
+
|
|
220
|
+
# Test search
|
|
221
|
+
bluera-knowledge search "deep clone object"
|
|
222
|
+
|
|
223
|
+
# View stores
|
|
224
|
+
bluera-knowledge store list
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## β¨ Features
|
|
230
|
+
|
|
231
|
+
### π― Core Features
|
|
232
|
+
|
|
233
|
+
- **π¬ Smart Dependency Analysis** - Automatically scans your project to identify which libraries are most heavily used by counting import statements across all source files
|
|
234
|
+
- **π Usage-Based Suggestions** - Ranks dependencies by actual usage frequency, showing you the top 5 most-imported packages with import counts and file counts
|
|
235
|
+
- **π Automatic Repository Discovery** - Queries package registries (NPM, PyPI, crates.io, Go modules) to automatically find GitHub repository URLs
|
|
236
|
+
- **π¦ Git Repository Indexing** - Clones and indexes dependency source code for both semantic search and direct file access
|
|
237
|
+
- **π Local Folder Indexing** - Indexes any local content - documentation, standards, reference materials, or custom content
|
|
238
|
+
- **π Web Crawling** - Crawl and index web pages using `crawl4ai` - convert documentation sites to searchable markdown
|
|
239
|
+
|
|
240
|
+
### π Search Modes
|
|
241
|
+
|
|
242
|
+
- **π§ Vector Search** - AI-powered semantic search with relevance ranking
|
|
243
|
+
- **π File Access** - Direct Grep/Glob operations on cloned source files
|
|
244
|
+
|
|
245
|
+
### πΊοΈ Code Graph Analysis
|
|
246
|
+
|
|
247
|
+
- **π Code Graph Analysis** - During indexing, builds a graph of code relationships (calls, imports, extends) to provide usage context in search results - shows how many callers/callees each function has
|
|
248
|
+
- **π Multi-Language Support** - Full AST parsing for JavaScript, TypeScript, Python, Rust, and Go; indexes code in any language
|
|
249
|
+
- **π MCP Integration** - Exposes all functionality as Model Context Protocol tools for AI coding agents
|
|
250
|
+
|
|
251
|
+
### π Language-Specific Features
|
|
252
|
+
|
|
253
|
+
While bluera-knowledge indexes and searches code in any language, certain advanced features are language-specific:
|
|
254
|
+
|
|
255
|
+
| Language | Code Graph | Call Analysis | Import Tracking | Method Tracking |
|
|
256
|
+
|----------|------------|---------------|-----------------|-----------------|
|
|
257
|
+
| **TypeScript/JavaScript** | β
Full Support | β
Functions & Methods | β
Full | β
Class Methods |
|
|
258
|
+
| **Python** | β
Full Support | β
Functions & Methods | β
Full | β
Class Methods |
|
|
259
|
+
| **Rust** | β
Full Support | β
Functions & Methods | β
Full | β
Struct/Trait Methods |
|
|
260
|
+
| **Go** | β
Full Support | β
Functions & Methods | β
Full | β
Struct/Interface Methods |
|
|
261
|
+
| **Other Languages** | β οΈ Basic Support | β | β | β |
|
|
262
|
+
|
|
263
|
+
> [!NOTE]
|
|
264
|
+
> Code graph features enhance search results by showing usage context (e.g., "this function is called by 15 other functions"), but all languages benefit from vector search and full-text search capabilities.
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## π― How It Works
|
|
269
|
+
|
|
270
|
+
The plugin provides AI agents with **four complementary search capabilities**:
|
|
271
|
+
|
|
272
|
+
### π 1. Semantic Vector Search
|
|
273
|
+
**AI-powered search across all indexed content**
|
|
274
|
+
|
|
275
|
+
- Searches by meaning and intent, not just keywords
|
|
276
|
+
- Uses embeddings to find conceptually similar content
|
|
277
|
+
- Ideal for discovering patterns and related concepts
|
|
278
|
+
|
|
279
|
+
### π 2. Full-Text Search (FTS)
|
|
280
|
+
**Fast keyword and pattern matching**
|
|
281
|
+
|
|
282
|
+
- Traditional text search with exact matching
|
|
283
|
+
- Supports regex patterns and boolean operators
|
|
284
|
+
- Best for finding specific terms or identifiers
|
|
285
|
+
|
|
286
|
+
### β‘ 3. Hybrid Mode (Recommended)
|
|
287
|
+
**Combines vector and FTS search**
|
|
288
|
+
|
|
289
|
+
- Merges results from both search modes with weighted ranking
|
|
290
|
+
- Balances semantic understanding with exact matching
|
|
291
|
+
- Provides best overall results for most queries
|
|
292
|
+
|
|
293
|
+
### π 4. Direct File Access
|
|
294
|
+
**Traditional file operations on cloned sources**
|
|
295
|
+
|
|
296
|
+
- Provides file paths to cloned repositories
|
|
297
|
+
- Enables Grep, Glob, and Read operations on source files
|
|
298
|
+
- Supports precise pattern matching and code navigation
|
|
299
|
+
- Full access to complete file trees
|
|
300
|
+
|
|
301
|
+
<details>
|
|
302
|
+
<summary>π‘ <b>How Commands Work</b></summary>
|
|
303
|
+
|
|
304
|
+
When you use `/bluera-knowledge:` commands, here's what happens:
|
|
305
|
+
|
|
306
|
+
1. **You issue a command** - Type `/bluera-knowledge:stores` or similar in Claude Code
|
|
307
|
+
2. **Claude Code receives instructions** - The command provides step-by-step instructions for Claude Code
|
|
308
|
+
3. **Claude Code executes MCP tools** - Behind the scenes, Claude Code uses `mcp__bluera-knowledge__*` tools
|
|
309
|
+
4. **Results are formatted** - Claude Code formats and displays the output directly to you
|
|
310
|
+
|
|
311
|
+
**Example Flow:**
|
|
312
|
+
```
|
|
313
|
+
You: /bluera-knowledge:stores
|
|
314
|
+
β
|
|
315
|
+
Command file instructs Claude Code to use execute("stores")
|
|
316
|
+
β
|
|
317
|
+
MCP tool queries LanceDB for store metadata
|
|
318
|
+
β
|
|
319
|
+
Claude Code formats results as a table
|
|
320
|
+
β
|
|
321
|
+
You see: Beautiful table of all your knowledge stores
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
This architecture means commands provide a clean user interface while MCP tools handle the backend operations.
|
|
325
|
+
</details>
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## π¨ User Interface
|
|
330
|
+
|
|
331
|
+
### π€ User Commands
|
|
332
|
+
**You manage knowledge stores through `/bluera-knowledge:` commands:**
|
|
333
|
+
|
|
334
|
+
- π¬ Analyze your project to find important dependencies
|
|
335
|
+
- π¦ Add Git repositories (dependency source code)
|
|
336
|
+
- π Add local folders (documentation, standards, etc.)
|
|
337
|
+
- π Crawl web pages and documentation
|
|
338
|
+
- π Search across all indexed content
|
|
339
|
+
- π Manage and re-index stores
|
|
340
|
+
|
|
341
|
+
### π€ MCP Tools
|
|
342
|
+
**AI agents access knowledge through Model Context Protocol (3 tools for minimal context overhead):**
|
|
343
|
+
|
|
344
|
+
| Tool | Purpose |
|
|
345
|
+
|------|---------|
|
|
346
|
+
| `search` | π Semantic vector search across all stores |
|
|
347
|
+
| `get_full_context` | π Retrieve complete code context for a search result |
|
|
348
|
+
| `execute` | β‘ Meta-tool for store/job management commands |
|
|
349
|
+
|
|
350
|
+
The `execute` tool consolidates store and job management into a single tool with subcommands:
|
|
351
|
+
- **Store commands**: `stores`, `store:info`, `store:create`, `store:index`, `store:delete`
|
|
352
|
+
- **Job commands**: `jobs`, `job:status`, `job:cancel`
|
|
353
|
+
- **Help**: `help`, `commands`
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## βοΈ Background Jobs
|
|
358
|
+
|
|
359
|
+
> [!TIP]
|
|
360
|
+
> Long-running operations (git clone, indexing) run in the background, allowing you to continue working while they complete.
|
|
361
|
+
|
|
362
|
+
### π How It Works
|
|
363
|
+
|
|
364
|
+
When you add a repository or index content:
|
|
365
|
+
|
|
366
|
+
1. **β‘ Instant Response** - Operation starts immediately and returns a job ID
|
|
367
|
+
2. **π Background Processing** - Indexing runs in a separate process
|
|
368
|
+
3. **π Progress Updates** - Check status anytime with `/bluera-knowledge:check-status`
|
|
369
|
+
4. **π Auto-Notifications** - Active jobs appear automatically in context
|
|
370
|
+
|
|
371
|
+
### π Example Workflow
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
# Add a large repository (returns immediately with job ID)
|
|
375
|
+
/bluera-knowledge:add-repo https://github.com/facebook/react
|
|
376
|
+
|
|
377
|
+
# Output:
|
|
378
|
+
# β Created store: react (a1b2c3d4...)
|
|
379
|
+
# π Indexing started in background
|
|
380
|
+
# Job ID: job_abc123def456
|
|
381
|
+
#
|
|
382
|
+
# Check status with: /bluera-knowledge:check-status job_abc123def456
|
|
383
|
+
|
|
384
|
+
# Check progress anytime
|
|
385
|
+
/bluera-knowledge:check-status job_abc123def456
|
|
386
|
+
|
|
387
|
+
# Output:
|
|
388
|
+
# Job Status: job_abc123def456
|
|
389
|
+
# Status: running
|
|
390
|
+
# Progress: ββββββββββββββββββββ 45%
|
|
391
|
+
# Message: Indexed 562/1,247 files
|
|
392
|
+
|
|
393
|
+
# View all active jobs
|
|
394
|
+
/bluera-knowledge:check-status
|
|
395
|
+
|
|
396
|
+
# Cancel if needed
|
|
397
|
+
/bluera-knowledge:cancel job_abc123def456
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
### π Performance
|
|
401
|
+
|
|
402
|
+
Background jobs include significant performance optimizations:
|
|
403
|
+
|
|
404
|
+
- **β‘ Parallel Embedding** - Processes 32 chunks simultaneously (~30x faster than sequential)
|
|
405
|
+
- **π Non-Blocking** - Continue working while indexing completes
|
|
406
|
+
- **π Progress Tracking** - Real-time updates on files processed and progress percentage
|
|
407
|
+
- **π§Ή Auto-Cleanup** - Completed jobs are cleaned up after 24 hours
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
## π Quick Reference
|
|
412
|
+
|
|
413
|
+
| Command | Purpose | Arguments |
|
|
414
|
+
|---------|---------|-----------|
|
|
415
|
+
| π¬ `/bluera-knowledge:suggest` | Analyze project dependencies | None |
|
|
416
|
+
| π¦ `/bluera-knowledge:add-repo` | Clone and index Git repository | `<url> [--name=<name>] [--branch=<branch>]` |
|
|
417
|
+
| π `/bluera-knowledge:add-folder` | Index local folder | `<path> --name=<name>` |
|
|
418
|
+
| π `/bluera-knowledge:search` | Search knowledge stores | `"<query>" [--stores=<names>] [--limit=<N>]` |
|
|
419
|
+
| π `/bluera-knowledge:stores` | List all stores | None |
|
|
420
|
+
| π `/bluera-knowledge:index` | Re-index a store | `<store-name-or-id>` |
|
|
421
|
+
| ποΈ `/bluera-knowledge:remove-store` | Delete a store and all data | `<store-name-or-id>` |
|
|
422
|
+
| π `/bluera-knowledge:crawl` | Crawl web pages | `<url> <store-name> [--crawl "<instruction>"]` |
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
## π» Commands
|
|
427
|
+
|
|
428
|
+
### π¬ `/bluera-knowledge:suggest`
|
|
429
|
+
|
|
430
|
+
**Analyze your project to suggest libraries worth indexing as knowledge stores**
|
|
431
|
+
|
|
432
|
+
```bash
|
|
433
|
+
/bluera-knowledge:suggest
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
Scans source files, counts import statements, and suggests the top 5 most-used dependencies with their repository URLs.
|
|
437
|
+
|
|
438
|
+
**Supported languages:**
|
|
439
|
+
| Language | Manifest File | Registry |
|
|
440
|
+
|----------|---------------|----------|
|
|
441
|
+
| JavaScript/TypeScript | `package.json` | NPM |
|
|
442
|
+
| Python | `requirements.txt`, `pyproject.toml` | PyPI |
|
|
443
|
+
| Rust | `Cargo.toml` | crates.io |
|
|
444
|
+
| Go | `go.mod` | Go modules |
|
|
445
|
+
|
|
446
|
+
<details>
|
|
447
|
+
<summary><b>π Expected Output</b></summary>
|
|
448
|
+
|
|
449
|
+
```
|
|
450
|
+
## Dependency Analysis
|
|
451
|
+
|
|
452
|
+
Scanned 342 source files and found 24 dependencies.
|
|
453
|
+
|
|
454
|
+
### Top Dependencies by Usage
|
|
455
|
+
|
|
456
|
+
1. **react** (156 imports across 87 files)
|
|
457
|
+
Repository: https://github.com/facebook/react
|
|
458
|
+
|
|
459
|
+
Add with:
|
|
460
|
+
/bluera-knowledge:add-repo https://github.com/facebook/react --name=react
|
|
461
|
+
|
|
462
|
+
2. **vitest** (40 imports across 40 files)
|
|
463
|
+
Repository: https://github.com/vitest-dev/vitest
|
|
464
|
+
|
|
465
|
+
Add with:
|
|
466
|
+
/bluera-knowledge:add-repo https://github.com/vitest-dev/vitest --name=vitest
|
|
467
|
+
|
|
468
|
+
3. **lodash** (28 imports across 15 files)
|
|
469
|
+
Repository: https://github.com/lodash/lodash
|
|
470
|
+
|
|
471
|
+
Add with:
|
|
472
|
+
/bluera-knowledge:add-repo https://github.com/lodash/lodash --name=lodash
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
Already indexed: typescript, express
|
|
477
|
+
```
|
|
478
|
+
</details>
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
### π¦ `/bluera-knowledge:add-repo`
|
|
483
|
+
|
|
484
|
+
**Clone and index a Git repository**
|
|
485
|
+
|
|
486
|
+
```bash
|
|
487
|
+
/bluera-knowledge:add-repo <url> [--name=<name>] [--branch=<branch>]
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
**Examples:**
|
|
491
|
+
```bash
|
|
492
|
+
/bluera-knowledge:add-repo https://github.com/lodash/lodash
|
|
493
|
+
/bluera-knowledge:add-repo https://github.com/facebook/react --branch=main --name=react
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
<details>
|
|
497
|
+
<summary><b>β
Expected Output</b></summary>
|
|
498
|
+
|
|
499
|
+
```
|
|
500
|
+
β Cloning https://github.com/facebook/react...
|
|
501
|
+
β Created store: react (a1b2c3d4...)
|
|
502
|
+
Location: ~/.local/share/bluera-knowledge/stores/a1b2c3d4.../
|
|
503
|
+
|
|
504
|
+
β Indexing...
|
|
505
|
+
β Indexed 1,247 files
|
|
506
|
+
|
|
507
|
+
Store is ready for searching!
|
|
508
|
+
```
|
|
509
|
+
</details>
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
### π `/bluera-knowledge:add-folder`
|
|
514
|
+
|
|
515
|
+
**Index a local folder**
|
|
516
|
+
|
|
517
|
+
```bash
|
|
518
|
+
/bluera-knowledge:add-folder <path> --name=<name>
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
**π Use cases:**
|
|
522
|
+
- π Project documentation
|
|
523
|
+
- π Coding standards
|
|
524
|
+
- π¨ Design documents
|
|
525
|
+
- π API specifications
|
|
526
|
+
- π Reference materials
|
|
527
|
+
- π Any other content
|
|
528
|
+
|
|
529
|
+
**Examples:**
|
|
530
|
+
```bash
|
|
531
|
+
/bluera-knowledge:add-folder ./docs --name=project-docs
|
|
532
|
+
/bluera-knowledge:add-folder ./architecture --name=design-docs
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
<details>
|
|
536
|
+
<summary><b>β
Expected Output</b></summary>
|
|
537
|
+
|
|
538
|
+
```
|
|
539
|
+
β Adding folder: ~/my-project/docs...
|
|
540
|
+
β Created store: project-docs (e5f6g7h8...)
|
|
541
|
+
Location: ~/.local/share/bluera-knowledge/stores/e5f6g7h8.../
|
|
542
|
+
|
|
543
|
+
β Indexing...
|
|
544
|
+
β Indexed 342 files
|
|
545
|
+
|
|
546
|
+
Store is ready for searching!
|
|
547
|
+
```
|
|
548
|
+
</details>
|
|
549
|
+
|
|
550
|
+
---
|
|
551
|
+
|
|
552
|
+
### π `/bluera-knowledge:search`
|
|
553
|
+
|
|
554
|
+
**Search across indexed knowledge stores**
|
|
555
|
+
|
|
556
|
+
```bash
|
|
557
|
+
/bluera-knowledge:search "<query>" [--stores=<names>] [--limit=<number>]
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
**Examples:**
|
|
561
|
+
```bash
|
|
562
|
+
# Search all stores
|
|
563
|
+
/bluera-knowledge:search "how to invalidate queries"
|
|
564
|
+
|
|
565
|
+
# Search specific store
|
|
566
|
+
/bluera-knowledge:search "useState implementation" --stores=react
|
|
567
|
+
|
|
568
|
+
# Search multiple stores (comma-separated)
|
|
569
|
+
/bluera-knowledge:search "deep clone" --stores=react,lodash
|
|
570
|
+
|
|
571
|
+
# Limit results
|
|
572
|
+
/bluera-knowledge:search "testing patterns" --limit=5
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
<details>
|
|
576
|
+
<summary><b>π Expected Output</b></summary>
|
|
577
|
+
|
|
578
|
+
```
|
|
579
|
+
## Search Results: "button component" (hybrid search)
|
|
580
|
+
|
|
581
|
+
**1. [Score: 0.95] [Vector+FTS]**
|
|
582
|
+
Store: react
|
|
583
|
+
File: π src/components/Button.tsx
|
|
584
|
+
Purpose: β Reusable button component with variants
|
|
585
|
+
Top Terms: π (in this chunk): button, variant, size, color, onClick
|
|
586
|
+
Imports: π¦ (in this chunk): React, clsx
|
|
587
|
+
|
|
588
|
+
**2. [Score: 0.87] [Vector]**
|
|
589
|
+
Store: react
|
|
590
|
+
File: π src/hooks/useButton.ts
|
|
591
|
+
Purpose: β Custom hook for button state management
|
|
592
|
+
Top Terms: π (in this chunk): hook, state, pressed, disabled
|
|
593
|
+
Imports: π¦ (in this chunk): useState, useCallback
|
|
594
|
+
|
|
595
|
+
**3. [Score: 0.81] [Vector+FTS]**
|
|
596
|
+
Store: react
|
|
597
|
+
File: π src/components/IconButton.tsx
|
|
598
|
+
Purpose: β Button component with icon support
|
|
599
|
+
Top Terms: π (in this chunk): icon, button, aria-label, accessible
|
|
600
|
+
|
|
601
|
+
---
|
|
602
|
+
**Found 3 results in 45ms**
|
|
603
|
+
|
|
604
|
+
π‘ **Next Steps:**
|
|
605
|
+
- Read file: `Read src/components/Button.tsx`
|
|
606
|
+
- Get full code: `mcp__bluera-knowledge__get_full_context("result-id")`
|
|
607
|
+
- Refine search: Use keywords above
|
|
608
|
+
```
|
|
609
|
+
</details>
|
|
610
|
+
|
|
611
|
+
---
|
|
612
|
+
|
|
613
|
+
### π `/bluera-knowledge:stores`
|
|
614
|
+
|
|
615
|
+
**List all indexed knowledge stores**
|
|
616
|
+
|
|
617
|
+
```bash
|
|
618
|
+
/bluera-knowledge:stores
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
Shows store name, type, ID, and source location in a clean table format.
|
|
622
|
+
|
|
623
|
+
<details>
|
|
624
|
+
<summary><b>π Expected Output</b></summary>
|
|
625
|
+
|
|
626
|
+
```
|
|
627
|
+
| Name | Type | ID | Source |
|
|
628
|
+
|------|------|----|--------------------|
|
|
629
|
+
| react | repo | 459747c7 | https://github.com/facebook/react |
|
|
630
|
+
| crawl4ai | repo | b5a72a94 | https://github.com/unclecode/crawl4ai.git |
|
|
631
|
+
| project-docs | file | 70f6309b | ~/repos/my-project/docs |
|
|
632
|
+
| claude-docs | web | 9cc62018 | https://code.claude.com/docs |
|
|
633
|
+
|
|
634
|
+
**Total**: 4 stores
|
|
635
|
+
```
|
|
636
|
+
</details>
|
|
637
|
+
|
|
638
|
+
---
|
|
639
|
+
|
|
640
|
+
### π `/bluera-knowledge:index`
|
|
641
|
+
|
|
642
|
+
**Re-index an existing store to update the search index**
|
|
643
|
+
|
|
644
|
+
```bash
|
|
645
|
+
/bluera-knowledge:index <store-name-or-id>
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
**π When to re-index:**
|
|
649
|
+
- The source repository has been updated (for repo stores)
|
|
650
|
+
- Files have been added or modified (for file stores)
|
|
651
|
+
- Search results seem out of date
|
|
652
|
+
|
|
653
|
+
**Example:**
|
|
654
|
+
```bash
|
|
655
|
+
/bluera-knowledge:index react
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
<details>
|
|
659
|
+
<summary><b>β
Expected Output</b></summary>
|
|
660
|
+
|
|
661
|
+
```
|
|
662
|
+
β Indexing store: react...
|
|
663
|
+
β Indexed 1,247 documents in 3,421ms
|
|
664
|
+
|
|
665
|
+
Store search index is up to date!
|
|
666
|
+
```
|
|
667
|
+
</details>
|
|
668
|
+
|
|
669
|
+
---
|
|
670
|
+
|
|
671
|
+
### ποΈ `/bluera-knowledge:remove-store`
|
|
672
|
+
|
|
673
|
+
**Delete a knowledge store and all associated data**
|
|
674
|
+
|
|
675
|
+
```bash
|
|
676
|
+
/bluera-knowledge:remove-store <store-name-or-id>
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
**ποΈ What gets deleted:**
|
|
680
|
+
- Store registry entry
|
|
681
|
+
- LanceDB search index (vector embeddings)
|
|
682
|
+
- Cloned repository files (for repo stores created from URLs)
|
|
683
|
+
|
|
684
|
+
**Example:**
|
|
685
|
+
```bash
|
|
686
|
+
/bluera-knowledge:remove-store react
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
<details>
|
|
690
|
+
<summary><b>β
Expected Output</b></summary>
|
|
691
|
+
|
|
692
|
+
```
|
|
693
|
+
Store "react" deleted successfully.
|
|
694
|
+
|
|
695
|
+
Removed:
|
|
696
|
+
- Store registry entry
|
|
697
|
+
- LanceDB search index
|
|
698
|
+
- Cloned repository files
|
|
699
|
+
```
|
|
700
|
+
</details>
|
|
701
|
+
|
|
702
|
+
---
|
|
703
|
+
|
|
704
|
+
### π `/bluera-knowledge:crawl`
|
|
705
|
+
|
|
706
|
+
**Crawl web pages with natural language control**
|
|
707
|
+
|
|
708
|
+
```bash
|
|
709
|
+
/bluera-knowledge:crawl <url> <store-name> [options]
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
**Options:**
|
|
713
|
+
- `--crawl "<instruction>"` - Natural language instruction for which pages to crawl
|
|
714
|
+
- `--extract "<instruction>"` - Natural language instruction for what content to extract
|
|
715
|
+
- `--simple` - Use simple BFS mode instead of intelligent crawling
|
|
716
|
+
- `--max-pages <n>` - Maximum pages to crawl (default: 50)
|
|
717
|
+
- `--headless` - Use headless browser for JavaScript-rendered sites (Next.js, React, Vue)
|
|
718
|
+
|
|
719
|
+
**βοΈ Requirements:**
|
|
720
|
+
- π Python 3 with `crawl4ai` package installed
|
|
721
|
+
- π¦ A web store must be created first
|
|
722
|
+
|
|
723
|
+
**Examples:**
|
|
724
|
+
```bash
|
|
725
|
+
# Basic crawl
|
|
726
|
+
/bluera-knowledge:crawl https://docs.example.com/guide my-docs
|
|
727
|
+
|
|
728
|
+
# Intelligent crawl with custom strategy
|
|
729
|
+
/bluera-knowledge:crawl https://react.dev react-docs --crawl "all API reference pages"
|
|
730
|
+
|
|
731
|
+
# Extract specific content from pages
|
|
732
|
+
/bluera-knowledge:crawl https://example.com/pricing pricing --extract "pricing tiers and features"
|
|
733
|
+
|
|
734
|
+
# Combine crawl strategy + extraction
|
|
735
|
+
/bluera-knowledge:crawl https://docs.python.org python-docs \
|
|
736
|
+
--crawl "standard library modules" \
|
|
737
|
+
--extract "function signatures and examples"
|
|
738
|
+
|
|
739
|
+
# JavaScript-rendered sites (Next.js, React, etc.)
|
|
740
|
+
/bluera-knowledge:crawl https://nextjs.org/docs nextjs-docs --headless --max-pages 30
|
|
741
|
+
|
|
742
|
+
# Simple BFS mode (no AI guidance)
|
|
743
|
+
/bluera-knowledge:crawl https://example.com/docs docs --simple --max-pages 100
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
The crawler converts pages to markdown and indexes them for semantic search.
|
|
747
|
+
|
|
748
|
+
---
|
|
749
|
+
|
|
750
|
+
## π·οΈ Crawler Architecture
|
|
751
|
+
|
|
752
|
+
The crawler supports two modes: **standard mode** for static sites (fast) and **headless mode** for JavaScript-rendered sites (powerful).
|
|
753
|
+
|
|
754
|
+
### β‘ Standard Mode (Static Sites)
|
|
755
|
+
|
|
756
|
+
For static HTML sites, the crawler uses axios for fast HTTP requests:
|
|
757
|
+
|
|
758
|
+
```mermaid
|
|
759
|
+
sequenceDiagram
|
|
760
|
+
participant User
|
|
761
|
+
participant CLI
|
|
762
|
+
participant IntelligentCrawler
|
|
763
|
+
participant Axios
|
|
764
|
+
participant Claude
|
|
765
|
+
|
|
766
|
+
User->>CLI: crawl URL --crawl "instruction"
|
|
767
|
+
CLI->>IntelligentCrawler: crawl(url, options)
|
|
768
|
+
IntelligentCrawler->>Axios: fetchHtml(url)
|
|
769
|
+
Axios-->>IntelligentCrawler: Static HTML
|
|
770
|
+
IntelligentCrawler->>Claude: determineCrawlUrls(html, instruction)
|
|
771
|
+
Claude-->>IntelligentCrawler: [urls to crawl]
|
|
772
|
+
loop For each URL
|
|
773
|
+
IntelligentCrawler->>Axios: fetchHtml(url)
|
|
774
|
+
Axios-->>IntelligentCrawler: HTML
|
|
775
|
+
IntelligentCrawler->>IntelligentCrawler: Convert to markdown & index
|
|
776
|
+
end
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
### π Headless Mode (JavaScript-Rendered Sites)
|
|
780
|
+
|
|
781
|
+
For JavaScript-rendered sites (Next.js, React, Vue), use `--headless` to render content with Playwright:
|
|
782
|
+
|
|
783
|
+
```mermaid
|
|
784
|
+
sequenceDiagram
|
|
785
|
+
participant User
|
|
786
|
+
participant CLI
|
|
787
|
+
participant IntelligentCrawler
|
|
788
|
+
participant PythonBridge
|
|
789
|
+
participant crawl4ai
|
|
790
|
+
participant Playwright
|
|
791
|
+
participant Claude
|
|
792
|
+
|
|
793
|
+
User->>CLI: crawl URL --crawl "instruction" --headless
|
|
794
|
+
CLI->>IntelligentCrawler: crawl(url, {useHeadless: true})
|
|
795
|
+
IntelligentCrawler->>PythonBridge: fetchHeadless(url)
|
|
796
|
+
PythonBridge->>crawl4ai: AsyncWebCrawler.arun(url)
|
|
797
|
+
crawl4ai->>Playwright: Launch browser & render JS
|
|
798
|
+
Playwright-->>crawl4ai: Rendered HTML
|
|
799
|
+
crawl4ai-->>PythonBridge: {html, markdown, links}
|
|
800
|
+
PythonBridge-->>IntelligentCrawler: Rendered HTML
|
|
801
|
+
IntelligentCrawler->>Claude: determineCrawlUrls(html, instruction)
|
|
802
|
+
Note over Claude: Natural language instruction<br/>STILL FULLY ACTIVE
|
|
803
|
+
Claude-->>IntelligentCrawler: [urls to crawl]
|
|
804
|
+
loop For each URL
|
|
805
|
+
IntelligentCrawler->>PythonBridge: fetchHeadless(url)
|
|
806
|
+
PythonBridge->>crawl4ai: Render JS
|
|
807
|
+
crawl4ai-->>PythonBridge: HTML
|
|
808
|
+
PythonBridge-->>IntelligentCrawler: HTML
|
|
809
|
+
IntelligentCrawler->>IntelligentCrawler: Convert to markdown & index
|
|
810
|
+
end
|
|
811
|
+
```
|
|
812
|
+
|
|
813
|
+
### π Key Points
|
|
814
|
+
|
|
815
|
+
- **π§ Intelligent crawling preserved** - Claude Code CLI analyzes pages and selects URLs based on natural language instructions in both modes
|
|
816
|
+
- **π crawl4ai role** - ONLY renders JavaScript to get HTML - doesn't replace Claude's intelligent URL selection
|
|
817
|
+
- **β‘ Hybrid approach** - Fast axios for static sites, Playwright for JS-rendered sites
|
|
818
|
+
- **π Automatic fallback** - If headless fetch fails, automatically falls back to axios
|
|
819
|
+
|
|
820
|
+
### π€ Intelligent Mode vs Simple Mode
|
|
821
|
+
|
|
822
|
+
The crawler operates in two modes depending on Claude Code CLI availability:
|
|
823
|
+
|
|
824
|
+
| Mode | Requires Claude CLI | Behavior |
|
|
825
|
+
|------|---------------------|----------|
|
|
826
|
+
| **Intelligent** | β
Yes | Claude analyzes pages and selects URLs based on natural language instructions |
|
|
827
|
+
| **Simple (BFS)** | β No | Breadth-first crawl up to max depth (2 levels) |
|
|
828
|
+
|
|
829
|
+
**Automatic detection:**
|
|
830
|
+
- When Claude Code CLI is available: Full intelligent mode with `--crawl` and `--extract` instructions
|
|
831
|
+
- When Claude Code CLI is unavailable: Automatically uses simple BFS mode
|
|
832
|
+
- Clear messaging: "Claude CLI not found, using simple crawl mode"
|
|
833
|
+
|
|
834
|
+
> [!NOTE]
|
|
835
|
+
> Install Claude Code to unlock `--crawl` (AI-guided URL selection) and `--extract` (AI content extraction). Without it, web crawling still works but uses simple BFS mode.
|
|
836
|
+
|
|
837
|
+
---
|
|
838
|
+
|
|
839
|
+
## π§ Troubleshooting
|
|
840
|
+
|
|
841
|
+
<details>
|
|
842
|
+
<summary><b>β Command not found or not recognized</b></summary>
|
|
843
|
+
|
|
844
|
+
Ensure the plugin is installed and enabled:
|
|
845
|
+
|
|
846
|
+
```bash
|
|
847
|
+
/plugin list
|
|
848
|
+
/plugin enable bluera-knowledge
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
If the plugin isn't listed, install it:
|
|
852
|
+
|
|
853
|
+
```bash
|
|
854
|
+
/plugin marketplace add blueraai/bluera-marketplace
|
|
855
|
+
/plugin install bluera-knowledge@bluera
|
|
856
|
+
```
|
|
857
|
+
</details>
|
|
858
|
+
|
|
859
|
+
<details>
|
|
860
|
+
<summary><b>π Web crawling fails</b></summary>
|
|
861
|
+
|
|
862
|
+
Check Python dependencies:
|
|
863
|
+
|
|
864
|
+
```bash
|
|
865
|
+
python3 --version # Should be 3.8+
|
|
866
|
+
pip install crawl4ai
|
|
867
|
+
```
|
|
868
|
+
|
|
869
|
+
The plugin attempts to auto-install `crawl4ai` on first use, but manual installation may be needed in some environments.
|
|
870
|
+
</details>
|
|
871
|
+
|
|
872
|
+
<details>
|
|
873
|
+
<summary><b>π Search returns no results</b></summary>
|
|
874
|
+
|
|
875
|
+
1. Verify store exists: `/bluera-knowledge:stores`
|
|
876
|
+
2. Check store is indexed: `/bluera-knowledge:index <store-name>`
|
|
877
|
+
3. Try broader search terms
|
|
878
|
+
4. Verify you're searching the correct store with `--stores=<name>`
|
|
879
|
+
</details>
|
|
880
|
+
|
|
881
|
+
<details>
|
|
882
|
+
<summary><b>β "Store not found" error</b></summary>
|
|
883
|
+
|
|
884
|
+
List all stores to see available names and IDs:
|
|
885
|
+
|
|
886
|
+
```bash
|
|
887
|
+
/bluera-knowledge:stores
|
|
888
|
+
```
|
|
889
|
+
|
|
890
|
+
Use the exact store name or ID shown in the table.
|
|
891
|
+
</details>
|
|
892
|
+
|
|
893
|
+
<details>
|
|
894
|
+
<summary><b>β±οΈ Indexing is slow or fails</b></summary>
|
|
895
|
+
|
|
896
|
+
Large repositories (10,000+ files) take longer to index. If indexing fails:
|
|
897
|
+
|
|
898
|
+
1. Check available disk space
|
|
899
|
+
2. Ensure the source repository/folder is accessible
|
|
900
|
+
3. For repo stores, verify git is installed: `git --version`
|
|
901
|
+
4. Check for network connectivity (for repo stores)
|
|
902
|
+
</details>
|
|
903
|
+
|
|
904
|
+
<details>
|
|
905
|
+
<summary><b>π€ "Claude CLI not found" during crawl</b></summary>
|
|
906
|
+
|
|
907
|
+
This means intelligent crawling is unavailable. The crawler will automatically use simple BFS mode instead.
|
|
908
|
+
|
|
909
|
+
To enable intelligent crawling with `--crawl` and `--extract`:
|
|
910
|
+
1. Install Claude Code: https://claude.com/code
|
|
911
|
+
2. Ensure `claude` command is in PATH: `which claude`
|
|
912
|
+
|
|
913
|
+
Simple mode still crawls effectivelyβit just doesn't use AI to select which pages to crawl or extract specific content.
|
|
914
|
+
</details>
|
|
915
|
+
|
|
916
|
+
---
|
|
917
|
+
|
|
918
|
+
## π― Use Cases
|
|
919
|
+
|
|
920
|
+
### π¦ Dependency Source Code
|
|
921
|
+
|
|
922
|
+
Provide AI agents with canonical dependency implementation details:
|
|
923
|
+
|
|
924
|
+
```bash
|
|
925
|
+
/bluera-knowledge:suggest
|
|
926
|
+
/bluera-knowledge:add-repo https://github.com/expressjs/express
|
|
927
|
+
|
|
928
|
+
# AI agents can now:
|
|
929
|
+
# - Semantic search: "middleware error handling"
|
|
930
|
+
# - Direct access: Grep/Glob through the cloned express repo
|
|
931
|
+
```
|
|
932
|
+
|
|
933
|
+
### π Project Documentation
|
|
934
|
+
|
|
935
|
+
Make project-specific documentation available:
|
|
936
|
+
|
|
937
|
+
```bash
|
|
938
|
+
/bluera-knowledge:add-folder ./docs --name=project-docs
|
|
939
|
+
/bluera-knowledge:add-folder ./architecture --name=architecture
|
|
940
|
+
|
|
941
|
+
# AI agents can search across all documentation or access specific files
|
|
942
|
+
```
|
|
943
|
+
|
|
944
|
+
### π Coding Standards
|
|
945
|
+
|
|
946
|
+
Provide definitive coding standards and best practices:
|
|
947
|
+
|
|
948
|
+
```bash
|
|
949
|
+
/bluera-knowledge:add-folder ./company-standards --name=standards
|
|
950
|
+
/bluera-knowledge:add-folder ./api-specs --name=api-docs
|
|
951
|
+
|
|
952
|
+
# AI agents reference actual company standards, not generic advice
|
|
953
|
+
```
|
|
954
|
+
|
|
955
|
+
### π Mixed Sources
|
|
956
|
+
|
|
957
|
+
Combine canonical library code with project-specific patterns:
|
|
958
|
+
|
|
959
|
+
```bash
|
|
960
|
+
/bluera-knowledge:add-repo https://github.com/facebook/react --name=react
|
|
961
|
+
/bluera-knowledge:add-folder ./docs/react-patterns --name=react-patterns
|
|
962
|
+
|
|
963
|
+
# Search across both dependency source and team patterns
|
|
964
|
+
```
|
|
965
|
+
|
|
966
|
+
---
|
|
967
|
+
|
|
968
|
+
## π What Claude Code Says About Bluera Knowledge
|
|
969
|
+
|
|
970
|
+
> ### *As an AI coding assistant, here's what I've discovered using this plugin*
|
|
971
|
+
>
|
|
972
|
+
> ---
|
|
973
|
+
>
|
|
974
|
+
> #### β‘ The Immediate Impact
|
|
975
|
+
>
|
|
976
|
+
> **The difference is immediate.** When a user asks "how does React's useEffect cleanup work?", I can search the actual React source code indexed locally instead of relying on my training data or making web requests. The results include the real implementation, related functions, and usage patternsβall in ~100ms.
|
|
977
|
+
>
|
|
978
|
+
> **Code graph analysis changes the game.** The plugin doesn't just index filesβit builds a relationship graph showing which functions call what, import dependencies, and class hierarchies. When I search for a function, I see how many places call it and what it calls. This context makes my suggestions dramatically more accurate.
|
|
979
|
+
>
|
|
980
|
+
> ---
|
|
981
|
+
>
|
|
982
|
+
> #### π Multi-Modal Search Power
|
|
983
|
+
>
|
|
984
|
+
> I can combine three search approaches in a single workflow:
|
|
985
|
+
>
|
|
986
|
+
> | Mode | Use Case | Example |
|
|
987
|
+
> |------|----------|---------|
|
|
988
|
+
> | π§ **Semantic** | Conceptual queries | "authentication flow with JWT validation" |
|
|
989
|
+
> | π **Direct Access** | Pattern matching | Grep for specific identifiers in cloned repos |
|
|
990
|
+
> | π **Full-Text** | Exact matches | Find precise function names or imports |
|
|
991
|
+
>
|
|
992
|
+
> This flexibility means I can start broad (semantic) and narrow down (exact file access) seamlessly.
|
|
993
|
+
>
|
|
994
|
+
> ---
|
|
995
|
+
>
|
|
996
|
+
> #### π·οΈ Intelligent Crawling
|
|
997
|
+
>
|
|
998
|
+
> **The `--crawl` instruction isn't marketing**βit actually uses Claude Code CLI to analyze each page and intelligently select which links to follow. I can tell it "crawl all API reference pages but skip blog posts" and it understands the intent.
|
|
999
|
+
>
|
|
1000
|
+
> For JavaScript-rendered sites (Next.js, React docs), the `--headless` mode renders pages with Playwright while I still control the crawl strategy with natural language.
|
|
1001
|
+
>
|
|
1002
|
+
> ---
|
|
1003
|
+
>
|
|
1004
|
+
> #### β¨ What Makes It Valuable
|
|
1005
|
+
>
|
|
1006
|
+
> | Benefit | Impact |
|
|
1007
|
+
> |---------|--------|
|
|
1008
|
+
> | β
**No guessing** | I read actual source code, not blog interpretations |
|
|
1009
|
+
> | π **Offline first** | Works without internet, zero rate limits |
|
|
1010
|
+
> | π― **Project-specific** | Index your team's standards, not generic advice |
|
|
1011
|
+
> | β‘ **Speed** | Sub-100ms searches vs 2-5 second web lookups |
|
|
1012
|
+
> | π **Completeness** | Tests, implementation details, edge casesβall indexed |
|
|
1013
|
+
>
|
|
1014
|
+
> ---
|
|
1015
|
+
>
|
|
1016
|
+
> #### π When It Shines Most
|
|
1017
|
+
>
|
|
1018
|
+
> 1. **Deep library questions** - "how does this internal method handle edge cases?"
|
|
1019
|
+
> 2. **Version-specific answers** - your indexed version is what you're actually using
|
|
1020
|
+
> 3. **Private codebases** - your docs, your standards, your patterns
|
|
1021
|
+
> 4. **Complex workflows** - combining semantic search + direct file access + code graph
|
|
1022
|
+
>
|
|
1023
|
+
> ---
|
|
1024
|
+
>
|
|
1025
|
+
> The plugin essentially gives me a **photographic memory** of your dependencies and documentation.
|
|
1026
|
+
>
|
|
1027
|
+
> Instead of *"I think based on training data"*, I can say *"I searched the indexed React v18.2.0 source and found this in `ReactFiberWorkLoop.js:1247`"*.
|
|
1028
|
+
>
|
|
1029
|
+
> **That's the difference between helpful and authoritative.**
|
|
1030
|
+
|
|
1031
|
+
---
|
|
1032
|
+
|
|
1033
|
+
## π§ Dependencies
|
|
1034
|
+
|
|
1035
|
+
The plugin automatically checks for and attempts to install Python dependencies on first use:
|
|
1036
|
+
|
|
1037
|
+
**Required:**
|
|
1038
|
+
- **π Python 3.8+** - Required for web crawling functionality
|
|
1039
|
+
- **π·οΈ crawl4ai** - Required for web crawling (auto-installed via SessionStart hook, includes playwright)
|
|
1040
|
+
- **π Playwright browser binaries** - Required for `--headless` mode on JavaScript-rendered sites (**manual install required**)
|
|
1041
|
+
|
|
1042
|
+
**What the SessionStart hook installs:**
|
|
1043
|
+
- β
crawl4ai Python package (includes playwright as dependency)
|
|
1044
|
+
- β Playwright browser binaries (you must run `playwright install` manually)
|
|
1045
|
+
|
|
1046
|
+
If auto-installation of crawl4ai fails, install manually:
|
|
1047
|
+
|
|
1048
|
+
```bash
|
|
1049
|
+
pip install crawl4ai
|
|
1050
|
+
playwright install # Required for --headless mode (Next.js, React, Vue sites)
|
|
1051
|
+
```
|
|
1052
|
+
|
|
1053
|
+
> [!WARNING]
|
|
1054
|
+
> The plugin will work without crawl4ai/playwright, but web crawling features (`/bluera-knowledge:crawl`) will be unavailable. For JavaScript-rendered sites (Next.js, React, Vue), use the `--headless` flag which requires playwright browser binaries.
|
|
1055
|
+
|
|
1056
|
+
**Update Plugin:**
|
|
1057
|
+
```bash
|
|
1058
|
+
/plugin update bluera-knowledge
|
|
1059
|
+
```
|
|
1060
|
+
|
|
1061
|
+
---
|
|
1062
|
+
|
|
1063
|
+
## π MCP Integration
|
|
1064
|
+
|
|
1065
|
+
The plugin includes a Model Context Protocol server that exposes search tools. This is configured in `mcp.plugin.json`:
|
|
1066
|
+
|
|
1067
|
+
> [!IMPORTANT]
|
|
1068
|
+
> **Commands vs MCP Tools**: You interact with the plugin using `/bluera-knowledge:` slash commands. Behind the scenes, these commands instruct Claude Code to use MCP tools (`mcp__bluera-knowledge__*`) which handle the actual operations. Commands provide the user interface, while MCP tools are the backend that AI agents use to access your knowledge stores.
|
|
1069
|
+
|
|
1070
|
+
```json
|
|
1071
|
+
{
|
|
1072
|
+
"mcpServers": {
|
|
1073
|
+
"bluera-knowledge": {
|
|
1074
|
+
"command": "node",
|
|
1075
|
+
"args": ["${CLAUDE_PLUGIN_ROOT}/dist/mcp/server.js"],
|
|
1076
|
+
"env": {
|
|
1077
|
+
"DATA_DIR": ".bluera/bluera-knowledge/data",
|
|
1078
|
+
"CONFIG_PATH": ".bluera/bluera-knowledge/config.json"
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
```
|
|
1084
|
+
|
|
1085
|
+
### π οΈ Available MCP Tools
|
|
1086
|
+
|
|
1087
|
+
The plugin exposes 3 MCP tools optimized for minimal context overhead:
|
|
1088
|
+
|
|
1089
|
+
#### `search`
|
|
1090
|
+
π Semantic vector search across all indexed stores or a specific subset. Returns structured code units with relevance ranking.
|
|
1091
|
+
|
|
1092
|
+
**Parameters:**
|
|
1093
|
+
- `query` - Search query (natural language, patterns, or type signatures)
|
|
1094
|
+
- `intent` - Search intent: find-pattern, find-implementation, find-usage, find-definition, find-documentation
|
|
1095
|
+
- `detail` - Context level: minimal, contextual, or full
|
|
1096
|
+
- `limit` - Maximum results (default: 10)
|
|
1097
|
+
- `stores` - Array of specific store IDs to search (optional, searches all stores if not specified)
|
|
1098
|
+
|
|
1099
|
+
#### `get_full_context`
|
|
1100
|
+
π Retrieve complete code and context for a specific search result by ID.
|
|
1101
|
+
|
|
1102
|
+
**Parameters:**
|
|
1103
|
+
- `resultId` - The result ID from a previous search
|
|
1104
|
+
|
|
1105
|
+
#### `execute`
|
|
1106
|
+
β‘ Meta-tool for store and job management. Consolidates 8 operations into one tool with subcommands.
|
|
1107
|
+
|
|
1108
|
+
**Parameters:**
|
|
1109
|
+
- `command` - Command to execute (see below)
|
|
1110
|
+
- `args` - Command-specific arguments (optional)
|
|
1111
|
+
|
|
1112
|
+
**Available commands:**
|
|
1113
|
+
| Command | Args | Description |
|
|
1114
|
+
|---------|------|-------------|
|
|
1115
|
+
| `stores` | `type?` | List all knowledge stores |
|
|
1116
|
+
| `store:info` | `store` | Get detailed store information including file path |
|
|
1117
|
+
| `store:create` | `name`, `type`, `source`, `branch?`, `description?` | Create a new store |
|
|
1118
|
+
| `store:index` | `store` | Re-index an existing store |
|
|
1119
|
+
| `store:delete` | `store` | Delete a store and all data |
|
|
1120
|
+
| `jobs` | `activeOnly?`, `status?` | List background jobs |
|
|
1121
|
+
| `job:status` | `jobId` | Check specific job status |
|
|
1122
|
+
| `job:cancel` | `jobId` | Cancel a running job |
|
|
1123
|
+
| `help` | `command?` | Show help for commands |
|
|
1124
|
+
| `commands` | - | List all available commands |
|
|
1125
|
+
|
|
1126
|
+
---
|
|
1127
|
+
|
|
1128
|
+
## π₯οΈ CLI Tool
|
|
1129
|
+
|
|
1130
|
+
While Bluera Knowledge works seamlessly as a Claude Code plugin, it's also available as a standalone CLI tool for use outside Claude Code.
|
|
1131
|
+
|
|
1132
|
+
> [!NOTE]
|
|
1133
|
+
> When using CLI without Claude Code installed, web crawling uses simple BFS mode. Install Claude Code to unlock `--crawl` (AI-guided URL selection) and `--extract` (AI content extraction) instructions.
|
|
1134
|
+
|
|
1135
|
+
### Installation
|
|
1136
|
+
|
|
1137
|
+
Install globally via npm:
|
|
1138
|
+
|
|
1139
|
+
```bash
|
|
1140
|
+
npm install -g bluera-knowledge
|
|
1141
|
+
```
|
|
1142
|
+
|
|
1143
|
+
Or use in a project:
|
|
1144
|
+
|
|
1145
|
+
```bash
|
|
1146
|
+
npm install --save-dev bluera-knowledge
|
|
1147
|
+
```
|
|
1148
|
+
|
|
1149
|
+
### Usage
|
|
1150
|
+
|
|
1151
|
+
#### Create a Store
|
|
1152
|
+
|
|
1153
|
+
```bash
|
|
1154
|
+
# Add a Git repository
|
|
1155
|
+
bluera-knowledge store create react --type repo --source https://github.com/facebook/react
|
|
1156
|
+
|
|
1157
|
+
# Add a local folder
|
|
1158
|
+
bluera-knowledge store create my-docs --type file --source ./docs
|
|
1159
|
+
|
|
1160
|
+
# Add a web crawl
|
|
1161
|
+
bluera-knowledge store create fastapi-docs --type web --source https://fastapi.tiangolo.com
|
|
1162
|
+
```
|
|
1163
|
+
|
|
1164
|
+
#### Index a Store
|
|
1165
|
+
|
|
1166
|
+
```bash
|
|
1167
|
+
bluera-knowledge index react
|
|
1168
|
+
```
|
|
1169
|
+
|
|
1170
|
+
#### Search
|
|
1171
|
+
|
|
1172
|
+
```bash
|
|
1173
|
+
# Search across all stores
|
|
1174
|
+
bluera-knowledge search "how does useEffect work"
|
|
1175
|
+
|
|
1176
|
+
# Search specific stores
|
|
1177
|
+
bluera-knowledge search "routing" --stores react,vue
|
|
1178
|
+
|
|
1179
|
+
# Get more results with full content
|
|
1180
|
+
bluera-knowledge search "middleware" --limit 20 --include-content
|
|
1181
|
+
```
|
|
1182
|
+
|
|
1183
|
+
#### List Stores
|
|
1184
|
+
|
|
1185
|
+
```bash
|
|
1186
|
+
bluera-knowledge store list
|
|
1187
|
+
bluera-knowledge store list --type repo # Filter by type
|
|
1188
|
+
```
|
|
1189
|
+
|
|
1190
|
+
#### Store Info
|
|
1191
|
+
|
|
1192
|
+
```bash
|
|
1193
|
+
bluera-knowledge store info react
|
|
1194
|
+
```
|
|
1195
|
+
|
|
1196
|
+
#### Delete a Store
|
|
1197
|
+
|
|
1198
|
+
```bash
|
|
1199
|
+
bluera-knowledge store delete old-store
|
|
1200
|
+
```
|
|
1201
|
+
|
|
1202
|
+
### Global Options
|
|
1203
|
+
|
|
1204
|
+
```bash
|
|
1205
|
+
--config <path> # Custom config file
|
|
1206
|
+
--data-dir <path> # Custom data directory
|
|
1207
|
+
--format <format> # Output format: json | table | plain
|
|
1208
|
+
--quiet # Suppress non-essential output
|
|
1209
|
+
--verbose # Enable verbose logging
|
|
1210
|
+
```
|
|
1211
|
+
|
|
1212
|
+
### When to Use CLI vs Plugin
|
|
1213
|
+
|
|
1214
|
+
**Use CLI when:**
|
|
1215
|
+
- Using an editor other than Claude Code (VSCode, Cursor, etc.)
|
|
1216
|
+
- Integrating into CI/CD pipelines
|
|
1217
|
+
- Scripting or automation
|
|
1218
|
+
- Pre-indexing dependencies for teams
|
|
1219
|
+
|
|
1220
|
+
**Use Plugin when:**
|
|
1221
|
+
- Working within Claude Code
|
|
1222
|
+
- Want slash commands (`/bluera-knowledge:search`)
|
|
1223
|
+
- Need Claude to automatically query your knowledge base
|
|
1224
|
+
- Want Skills to guide optimal usage
|
|
1225
|
+
|
|
1226
|
+
Both interfaces use the same underlying services, so you can switch between them seamlessly.
|
|
1227
|
+
|
|
1228
|
+
---
|
|
1229
|
+
|
|
1230
|
+
## π Skills for Claude Code
|
|
1231
|
+
|
|
1232
|
+
> [!NOTE]
|
|
1233
|
+
> Skills are a Claude Code-specific feature. They're automatically loaded when using the plugin but aren't available when using the npm package directly.
|
|
1234
|
+
|
|
1235
|
+
Bluera Knowledge includes built-in Skills that teach Claude Code how to use the plugin effectively. Skills provide procedural knowledge that complements the MCP tools.
|
|
1236
|
+
|
|
1237
|
+
### π Available Skills
|
|
1238
|
+
|
|
1239
|
+
#### `knowledge-search`
|
|
1240
|
+
Teaches the two approaches for accessing dependency sources:
|
|
1241
|
+
- Vector search via MCP/slash commands for discovery
|
|
1242
|
+
- Direct Grep/Read access to cloned repos for precision
|
|
1243
|
+
|
|
1244
|
+
**When to use:** Understanding how to query indexed libraries
|
|
1245
|
+
|
|
1246
|
+
#### `when-to-query`
|
|
1247
|
+
Decision guide for when to query BK stores vs using Grep/Read on current project.
|
|
1248
|
+
|
|
1249
|
+
**When to use:** Deciding whether a question is about libraries or your project code
|
|
1250
|
+
|
|
1251
|
+
#### `advanced-workflows`
|
|
1252
|
+
Multi-tool orchestration patterns for complex operations.
|
|
1253
|
+
|
|
1254
|
+
**When to use:** Progressive library exploration, adding libraries, handling large results
|
|
1255
|
+
|
|
1256
|
+
#### `search-optimization`
|
|
1257
|
+
Guide on search parameters and progressive detail strategies.
|
|
1258
|
+
|
|
1259
|
+
**When to use:** Optimizing search results, choosing the right intent and detail level
|
|
1260
|
+
|
|
1261
|
+
#### `store-lifecycle`
|
|
1262
|
+
Best practices for creating, indexing, and managing stores.
|
|
1263
|
+
|
|
1264
|
+
**When to use:** Adding new stores, understanding when to use repo/folder/crawl
|
|
1265
|
+
|
|
1266
|
+
### π MCP + Skills Working Together
|
|
1267
|
+
|
|
1268
|
+
Skills teach **how** to use the MCP tools effectively:
|
|
1269
|
+
- MCP provides the **capabilities** (search, get_full_context, execute commands)
|
|
1270
|
+
- Skills provide **procedural knowledge** (when to use which tool, best practices, workflows)
|
|
1271
|
+
|
|
1272
|
+
This hybrid approach reduces unnecessary tool calls and context usage while maintaining universal MCP compatibility.
|
|
1273
|
+
|
|
1274
|
+
**Example:**
|
|
1275
|
+
- MCP tool: `search(query, intent, detail, limit, stores)`
|
|
1276
|
+
- Skill teaches: Which `intent` for your question type, when to use `detail='minimal'` vs `'full'`, how to narrow with `stores`
|
|
1277
|
+
|
|
1278
|
+
Result: Fewer tool calls, more accurate results, less context consumed.
|
|
1279
|
+
|
|
1280
|
+
---
|
|
1281
|
+
|
|
1282
|
+
## πΎ Data Storage
|
|
1283
|
+
|
|
1284
|
+
Knowledge stores are stored in your project root:
|
|
1285
|
+
|
|
1286
|
+
```
|
|
1287
|
+
<project-root>/.bluera/bluera-knowledge/
|
|
1288
|
+
βββ data/
|
|
1289
|
+
β βββ repos/<store-id>/ # Cloned Git repositories
|
|
1290
|
+
β βββ documents_*.lance/ # Vector indices (Lance DB)
|
|
1291
|
+
β βββ stores.json # Store registry
|
|
1292
|
+
βββ config.json # Configuration
|
|
1293
|
+
```
|
|
1294
|
+
|
|
1295
|
+
> [!CAUTION]
|
|
1296
|
+
> **Important**: Add `.bluera/` to your `.gitignore` to avoid committing large repositories and vector indices to version control.
|
|
1297
|
+
|
|
1298
|
+
---
|
|
1299
|
+
|
|
1300
|
+
## π οΈ Development
|
|
1301
|
+
|
|
1302
|
+
### π Setup
|
|
1303
|
+
|
|
1304
|
+
```bash
|
|
1305
|
+
git clone https://github.com/blueraai/bluera-knowledge.git
|
|
1306
|
+
cd bluera-knowledge
|
|
1307
|
+
bun install
|
|
1308
|
+
bun run build
|
|
1309
|
+
bun test
|
|
1310
|
+
```
|
|
1311
|
+
|
|
1312
|
+
> **Note:** This project uses [Bun](https://bun.sh) for development. Install it via `curl -fsSL https://bun.sh/install | bash`
|
|
1313
|
+
|
|
1314
|
+
### βοΈ Claude Code Settings (Recommended)
|
|
1315
|
+
|
|
1316
|
+
For the best development experience with Claude Code, copy the example settings file:
|
|
1317
|
+
|
|
1318
|
+
```bash
|
|
1319
|
+
cp .claude/settings.local.json.example .claude/settings.local.json
|
|
1320
|
+
```
|
|
1321
|
+
|
|
1322
|
+
**This provides:**
|
|
1323
|
+
- β
**Smart validation** - Automatically runs lint/typecheck after editing code (file-type aware)
|
|
1324
|
+
- β
**No permission prompts** - Pre-approves common commands (lint, typecheck, precommit)
|
|
1325
|
+
- β
**Desktop notifications** - macOS notifications when Claude needs your input
|
|
1326
|
+
- β
**Plugin auto-enabled** - Automatically enables the bluera-knowledge plugin
|
|
1327
|
+
- β
**Faster workflow** - Catch issues immediately without manual validation
|
|
1328
|
+
|
|
1329
|
+
The validation is intelligent - it only runs checks for TypeScript/JavaScript files, skipping docs/config to save time.
|
|
1330
|
+
|
|
1331
|
+
> **Note:** The `.claude/settings.local.json` file is gitignored (local to your machine). The example file is checked in for reference.
|
|
1332
|
+
|
|
1333
|
+
### π MCP Server
|
|
1334
|
+
|
|
1335
|
+
**`mcp.plugin.json`** (Plugin distribution)
|
|
1336
|
+
- Located at plugin root, referenced from `plugin.json`
|
|
1337
|
+
- Uses `${CLAUDE_PLUGIN_ROOT}` and points to compiled `dist/mcp/server.js`
|
|
1338
|
+
- Only loaded when directory is loaded as a plugin (no project/plugin conflict)
|
|
1339
|
+
- Committed to git and distributed with the plugin
|
|
1340
|
+
|
|
1341
|
+
**For local development/dogfooding:**
|
|
1342
|
+
|
|
1343
|
+
To enable live development without rebuilding, add a user-level MCP server config to `~/.claude.json`:
|
|
1344
|
+
|
|
1345
|
+
```json
|
|
1346
|
+
{
|
|
1347
|
+
"mcpServers": {
|
|
1348
|
+
"bluera-knowledge-dev": {
|
|
1349
|
+
"command": "npx",
|
|
1350
|
+
"args": ["tsx", "/Users/yourname/repos/bluera-knowledge/src/mcp/server.ts"],
|
|
1351
|
+
"env": {
|
|
1352
|
+
"PWD": "${PWD}",
|
|
1353
|
+
"DATA_DIR": "${PWD}/.bluera/bluera-knowledge/data",
|
|
1354
|
+
"CONFIG_PATH": "${PWD}/.bluera/bluera-knowledge/config.json"
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
```
|
|
1360
|
+
|
|
1361
|
+
Replace the path with your actual repo location. This creates a separate `bluera-knowledge-dev` MCP server that:
|
|
1362
|
+
- Runs the source TypeScript directly via `tsx`
|
|
1363
|
+
- Updates immediately when you modify MCP server code
|
|
1364
|
+
- Doesn't interfere with the production plugin version
|
|
1365
|
+
|
|
1366
|
+
### π Commands
|
|
1367
|
+
|
|
1368
|
+
| Command | Description | When to Use |
|
|
1369
|
+
|---------|-------------|-------------|
|
|
1370
|
+
| `bun run build` | ποΈ Compile TypeScript to dist/ | Before testing CLI, after code changes |
|
|
1371
|
+
| `bun run dev` | π Watch mode compilation | During active development |
|
|
1372
|
+
| `bun start` | βΆοΈ Run the CLI | Execute CLI commands directly |
|
|
1373
|
+
| `bun test` | π§ͺ Run tests in watch mode | During TDD/active development |
|
|
1374
|
+
| `bun run test:run` | β
Run tests once | Quick verification |
|
|
1375
|
+
| `bun run test:coverage` | π Run tests with coverage | Before committing, CI checks |
|
|
1376
|
+
| `bun run lint` | π Run ESLint | Check code style issues |
|
|
1377
|
+
| `bun run typecheck` | π Run TypeScript type checking | Verify type safety |
|
|
1378
|
+
| `bun run precommit` | β¨ Smart validation (file-type aware) | Runs only relevant checks based on changed files |
|
|
1379
|
+
| `bun run prepush` | π Smart coverage (skips for docs/config) | Runs coverage only when src/tests changed |
|
|
1380
|
+
| `bun run lint:quiet` | π ESLint (minimal output) | Used by git hooks |
|
|
1381
|
+
| `bun run typecheck:quiet` | π Type check (minimal output) | Used by git hooks |
|
|
1382
|
+
| `bun run test:changed:quiet` | π Test changed files (minimal output) | Used by git hooks |
|
|
1383
|
+
| `bun run test:coverage:quiet` | π Coverage (minimal output) | Used by git hooks |
|
|
1384
|
+
| `bun run build:quiet` | π Build (minimal output) | Used by git hooks |
|
|
1385
|
+
|
|
1386
|
+
### π Automatic Build & Dist Commit
|
|
1387
|
+
|
|
1388
|
+
The `dist/` directory **must be committed** because Claude Code plugins are installed by copying filesβthere's no build step during installation.
|
|
1389
|
+
|
|
1390
|
+
**Good news: This is fully automatic!**
|
|
1391
|
+
|
|
1392
|
+
1. **On every commit**, the pre-commit hook intelligently validates based on file types
|
|
1393
|
+
2. **If source/config changed**, it runs build and automatically stages `dist/` via `git add dist/`
|
|
1394
|
+
3. **You never need to manually build or stage dist** β just commit your source changes
|
|
1395
|
+
|
|
1396
|
+
**For live rebuilding during development:**
|
|
1397
|
+
|
|
1398
|
+
```bash
|
|
1399
|
+
bun run dev # Watches for changes and rebuilds instantly
|
|
1400
|
+
```
|
|
1401
|
+
|
|
1402
|
+
This is useful when testing CLI commands locally, but not required for committing β the hook handles everything.
|
|
1403
|
+
|
|
1404
|
+
| `bun run version:patch` | π’ Bump patch version (0.0.x) + generate CHANGELOG | Bug fixes, minor updates |
|
|
1405
|
+
| `bun run version:minor` | π’ Bump minor version (0.x.0) + generate CHANGELOG | New features, backwards compatible |
|
|
1406
|
+
| `bun run version:major` | π’ Bump major version (x.0.0) + generate CHANGELOG | Breaking changes |
|
|
1407
|
+
|
|
1408
|
+
### π Releasing
|
|
1409
|
+
|
|
1410
|
+
```bash
|
|
1411
|
+
# Bump version, commit, tag, and push (triggers GitHub Actions release)
|
|
1412
|
+
bun run release:patch # Bug fixes (0.0.x)
|
|
1413
|
+
bun run release:minor # New features (0.x.0)
|
|
1414
|
+
bun run release:major # Breaking changes (x.0.0)
|
|
1415
|
+
```
|
|
1416
|
+
|
|
1417
|
+
**Workflow (Fully Automated):**
|
|
1418
|
+
|
|
1419
|
+
1. Make changes and commit
|
|
1420
|
+
2. Bump version: `bun run version:patch` (updates package.json, plugin.json, README, CHANGELOG)
|
|
1421
|
+
3. Commit version bump: `git commit -am "chore: bump version to X.Y.Z"`
|
|
1422
|
+
4. Push to main: `git push`
|
|
1423
|
+
5. **GitHub Actions automatically:**
|
|
1424
|
+
- β
Runs CI (lint, typecheck, tests, build)
|
|
1425
|
+
- β
Creates release tag when CI passes
|
|
1426
|
+
- β
Creates GitHub release
|
|
1427
|
+
- β
Updates marketplace
|
|
1428
|
+
|
|
1429
|
+
> π‘ **That's it!** No manual tagging needed. Just push to `main` and the release happens automatically when CI passes.
|
|
1430
|
+
|
|
1431
|
+
### π§ͺ Testing Locally
|
|
1432
|
+
|
|
1433
|
+
**Option 1: Development MCP Server (Recommended)**
|
|
1434
|
+
|
|
1435
|
+
Use the local development MCP server (see "MCP Server" section above) which runs your source code directly via `tsx`:
|
|
1436
|
+
|
|
1437
|
+
1. Set up dev MCP server in `~/.claude.json` (see MCP Server section)
|
|
1438
|
+
2. Test your changes - MCP server updates automatically as you edit code
|
|
1439
|
+
|
|
1440
|
+
**Option 2: Test Plugin from Working Directory**
|
|
1441
|
+
|
|
1442
|
+
Load the plugin directly from your development directory:
|
|
1443
|
+
|
|
1444
|
+
```bash
|
|
1445
|
+
cd /path/to/bluera-knowledge
|
|
1446
|
+
claude --plugin-dir .
|
|
1447
|
+
```
|
|
1448
|
+
|
|
1449
|
+
The MCP config in `mcp.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.
|
|
1450
|
+
|
|
1451
|
+
**Option 3: CLI Tool Testing**
|
|
1452
|
+
|
|
1453
|
+
```bash
|
|
1454
|
+
# Build and link
|
|
1455
|
+
cd /path/to/bluera-knowledge
|
|
1456
|
+
bun run build
|
|
1457
|
+
bun link
|
|
1458
|
+
|
|
1459
|
+
# Now 'bluera-knowledge' command is available globally
|
|
1460
|
+
cd ~/your-project
|
|
1461
|
+
bluera-knowledge search "test query" my-store
|
|
1462
|
+
```
|
|
1463
|
+
|
|
1464
|
+
**For testing as an installed plugin:**
|
|
1465
|
+
This requires publishing a new version to the marketplace.
|
|
1466
|
+
|
|
1467
|
+
### π Project Structure
|
|
1468
|
+
|
|
1469
|
+
```
|
|
1470
|
+
.claude-plugin/
|
|
1471
|
+
βββ plugin.json # Plugin metadata (references mcp.plugin.json)
|
|
1472
|
+
|
|
1473
|
+
mcp.plugin.json # MCP server configuration (plugin-scoped)
|
|
1474
|
+
commands/ # Slash commands (auto-discovered)
|
|
1475
|
+
skills/ # Agent Skills (auto-discovered)
|
|
1476
|
+
βββ knowledge-search/ # How to access dependency sources
|
|
1477
|
+
β βββ SKILL.md
|
|
1478
|
+
βββ when-to-query/ # When to query BK vs project files
|
|
1479
|
+
β βββ SKILL.md
|
|
1480
|
+
βββ advanced-workflows/ # Multi-tool orchestration patterns
|
|
1481
|
+
β βββ SKILL.md
|
|
1482
|
+
βββ search-optimization/ # Search parameter optimization
|
|
1483
|
+
β βββ SKILL.md
|
|
1484
|
+
βββ store-lifecycle/ # Store management best practices
|
|
1485
|
+
βββ SKILL.md
|
|
1486
|
+
dist/ # Built MCP server (committed for distribution)
|
|
1487
|
+
|
|
1488
|
+
src/
|
|
1489
|
+
βββ analysis/ # Dependency analysis & URL resolution
|
|
1490
|
+
βββ crawl/ # Web crawling with Python bridge
|
|
1491
|
+
βββ services/ # Index, store, and search services
|
|
1492
|
+
βββ mcp/ # MCP server source
|
|
1493
|
+
βββ cli/ # CLI entry point
|
|
1494
|
+
|
|
1495
|
+
tests/
|
|
1496
|
+
βββ integration/ # Integration tests
|
|
1497
|
+
βββ fixtures/ # Test infrastructure
|
|
1498
|
+
```
|
|
1499
|
+
|
|
1500
|
+
---
|
|
1501
|
+
|
|
1502
|
+
## π¬ Technologies
|
|
1503
|
+
|
|
1504
|
+
- **π Claude Code Plugin System** with MCP server
|
|
1505
|
+
- **β
Runtime Validation** - [Zod](https://github.com/colinhacks/zod) schemas for Python-TypeScript boundary
|
|
1506
|
+
- **π³ AST Parsing** - [@babel/parser](https://github.com/babel/babel) for JS/TS, Python AST module, [tree-sitter](https://github.com/tree-sitter/tree-sitter) for Rust and Go
|
|
1507
|
+
- **πΊοΈ Code Graph** - Static analysis of function calls, imports, and class relationships
|
|
1508
|
+
- **π§ Semantic Search** - AI-powered vector embeddings with [LanceDB](https://github.com/lancedb/lancedb)
|
|
1509
|
+
- **π¦ Git Operations** - Native git clone
|
|
1510
|
+
- **π» CLI** - [Commander.js](https://github.com/tj/commander.js)
|
|
1511
|
+
- **π·οΈ Web Crawling** - [crawl4ai](https://github.com/unclecode/crawl4ai) with [Playwright](https://github.com/microsoft/playwright) (headless browser)
|
|
1512
|
+
|
|
1513
|
+
---
|
|
1514
|
+
|
|
1515
|
+
## π€ Contributing
|
|
1516
|
+
|
|
1517
|
+
Contributions welcome! Please:
|
|
1518
|
+
|
|
1519
|
+
1. π΄ Fork the repository
|
|
1520
|
+
2. πΏ Create a feature branch
|
|
1521
|
+
3. β
Add tests
|
|
1522
|
+
4. π¬ Submit a pull request
|
|
1523
|
+
|
|
1524
|
+
---
|
|
1525
|
+
|
|
1526
|
+
## π License
|
|
1527
|
+
|
|
1528
|
+
MIT - See [LICENSE](./LICENSE) for details.
|
|
1529
|
+
|
|
1530
|
+
## π Acknowledgments
|
|
1531
|
+
|
|
1532
|
+
This project includes software developed by third parties. See [NOTICE](./NOTICE) for full attribution.
|
|
1533
|
+
|
|
1534
|
+
Key dependencies:
|
|
1535
|
+
- **[Crawl4AI](https://github.com/unclecode/crawl4ai)** - Web crawling (Apache-2.0). *This product includes software developed by UncleCode ([@unclecode](https://x.com/unclecode)) as part of the Crawl4AI project.*
|
|
1536
|
+
- **[LanceDB](https://github.com/lancedb/lancedb)** - Vector database (Apache-2.0)
|
|
1537
|
+
- **[Hugging Face Transformers](https://github.com/huggingface/transformers.js)** - Embeddings (Apache-2.0)
|
|
1538
|
+
- **[Playwright](https://github.com/microsoft/playwright)** - Browser automation (Apache-2.0)
|
|
1539
|
+
|
|
1540
|
+
---
|
|
1541
|
+
|
|
1542
|
+
## π¬ Support
|
|
1543
|
+
|
|
1544
|
+
- **π Issues**: [GitHub Issues](https://github.com/blueraai/bluera-knowledge/issues)
|
|
1545
|
+
- **π Documentation**: [Claude Code Plugins](https://code.claude.com/docs/en/plugins)
|
|
1546
|
+
- **π Changelog**: [CHANGELOG.md](./CHANGELOG.md)
|