Commit Graph

7 Commits

Author SHA1 Message Date
01c32c7908 Add New Relic APM monitoring integration
- Install newrelic package (v13.6.6) and @newrelic/native-metrics
- Add 'import newrelic' as first import in src/mcp/index.ts
- Update dev script to use --env-file=.env for environment variables
- Configure for ES modules support with environment-based config

New Relic will monitor Express routes, track performance metrics,
and capture errors when NEW_RELIC_LICENSE_KEY is set.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 13:36:31 -06:00
e82bd1737d Add repository cloning script and update docs
Created npm run clone:repos script to clone required Babylon.js
repositories before indexing. Updated README to document the
two-step setup process:
1. Clone repositories
2. Index all data

This makes the setup process clearer and handles the missing
repository error users were encountering.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 10:46:14 -06:00
28f5d83d67 Add Alpine Linux support via stub onnxruntime-node module
The @xenova/transformers package unconditionally imports both
onnxruntime-node and onnxruntime-web at module load time. This
causes immediate failure on Alpine Linux (musl libc) because
onnxruntime-node requires glibc.

Solution: Created alpine:setup script that replaces onnxruntime-node
with a stub module after npm install. The transformers library will
automatically fall back to onnxruntime-web (WASM backend).

Usage on Alpine:
  npm install
  npm run alpine:setup
  npm run build
  npm run index:all

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 10:41:05 -06:00
779fa53363 Add source code indexing and search with comprehensive documentation
Features:
- Implemented SourceCodeIndexer class for indexing TypeScript/JavaScript source files
  - Chunks large files into 200-line segments with 20-line overlap
  - Extracts imports, exports, and metadata
  - Generates semantic embeddings using Xenova/all-MiniLM-L6-v2
  - Creates GitHub URLs with line numbers for easy navigation

- Enhanced LanceDBSearch with source code search capabilities
  - Added searchSourceCode() method for semantic source code search
  - Added getSourceFile() method for retrieving specific files or line ranges
  - Supports package filtering and configurable table names
  - Fixed score calculation to ensure values between 0-100%

- Added two new MCP tools
  - search_babylon_source: Search Babylon.js source code with semantic search
  - get_babylon_source: Retrieve full source files or specific line ranges
  - Both tools include comprehensive error handling and JSON responses

- Created indexing and testing scripts
  - scripts/index-source.ts: Production script for indexing all packages
  - scripts/test-source-indexing.ts: Test script for core package only
  - scripts/test-source-search.ts: Test script for search functionality

- Updated package.json with comprehensive indexing commands
  - npm run index:docs - Index documentation only
  - npm run index:api - Index API documentation only
  - npm run index:source - Index source code only
  - npm run index:all - Master script to index everything

- Created comprehensive README.md
  - Complete setup and installation instructions
  - Claude Desktop integration guide with configuration examples
  - Documentation of all 5 MCP tools with parameters and examples
  - Project structure, development commands, and troubleshooting guide
  - Architecture overview and disk space requirements

Testing:
- All 118 tests passing
- TypeScript compilation successful
- Source code search verified with real queries
- Successfully indexed 1,561 files into 5,650 searchable chunks

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 06:34:00 -06:00
5459fe9179 feat: Add TypeScript API documentation indexing and search with improved test coverage
## New Features
- Implemented TSDoc extraction using TypeDoc API
- Added API documentation indexing with LanceDB vector search
- Created search_babylon_api MCP tool for querying API docs
- Added 6 indexing and testing scripts

## API Indexing System
- TSDocExtractor: Parses TypeScript source files and extracts documentation
- ApiIndexer: Converts API docs to embeddings and stores in LanceDB
- Support for all Babylon.js packages (core, gui, materials, loaders, etc.)
- Successfully indexed 44,253 API entries from core package

## Bug Fixes
- Fixed TypeScript strict mode errors with exactOptionalPropertyTypes
- Fixed optional property handling in tsConfigPath and returns fields
- Resolved EventEmitter MaxListeners warning in test suite
- Updated all failing handler tests for real implementation

## Test Coverage Improvements
- Added 27 new tests (92 → 119 tests passing)
- Lines: 93.88% (was 82.53%, target 80%) ✓
- Functions: 100% (was 91.17%, target 80%) ✓
- Statements: 93.3% (was 81.58%, target 80%) ✓
- Branches: 69.72% (was 51.37%, target 75%)

## New Test Files
- src/search/lancedb-search.test.ts (15 tests)
- Enhanced handlers.test.ts with API search tests
- Enhanced document-parser.test.ts with edge case tests

## Scripts Added
- scripts/index-api.ts: Index all Babylon.js API documentation
- scripts/test-api-indexing.ts: Test API indexing for core package
- scripts/test-api-search.ts: Test API search functionality
- scripts/get-api-details.ts: Display detailed API documentation
- scripts/search-handmenu-api.ts: Search for HandMenu API examples

## Technical Details
- TypeDoc integration for TSDoc extraction
- Vector embeddings using Xenova/all-MiniLM-L6-v2 model
- Semantic search across 11 Babylon.js packages
- GitHub source links with line numbers in search results

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 05:58:16 -06:00
6ca8339387 Update dependencies, roadmap, and add indexing scripts
- Add LanceDB (@lancedb/lancedb) for vector database
- Add @xenova/transformers for local embeddings
- Add gray-matter for YAML frontmatter parsing
- Update ROADMAP.md with Phase 1 completion status
- Add indexing scripts: index-docs.ts, test-parser.ts, test-search.ts
- Add .claude/ configuration for MCP server settings
- Add npm script: index-docs for rebuilding search index

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 04:58:14 -06:00
a3e027ef02 Initial commit: Babylon MCP server
- MCP server infrastructure with Express and SSE transport
- Repository management for BabylonJS repos (Documentation, Babylon.js, havok)
- Comprehensive test suite with 100% coverage (87 tests passing)
- All code meets standards (files <100 lines, functions <20 lines)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 14:42:47 -06:00