Commit d8153ba
refactor: complete v3 cleanup and critical bug fixes
Phase 1: Remove legacy v2 handlers and schemas
- Delete 6 legacy handlers (getMetadata, getPageStats, getToc, listImages, renderPage, readPdf)
- Delete 6 legacy schemas
- Remove pdfCacheStats from cache handler
Phase 2: Streamline to 6 core tools
- Register only: pdf_info, pdf_read, pdf_extract_image, pdf_ocr, pdf_search, _pdf_cache_clear
- Update server instructions and tool comments
Phase 3: Critical stability fixes
- Remove debug file I/O from render.ts (prevents disk filling)
- Add ReDoS protection to searchPdf.ts (100 char regex limit)
- Verify pdfDocument.destroy() cleanup in all handlers
- Remove useless try-catch in render.ts
Phase 4: Performance optimizations
- Replace inefficient regex character counting in pdfOcr.ts with loop
- Fix non-null assertion in character counting
- Verify tool naming consistency
Tests: Update integration tests and remove obsolete test files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent f5fb70d commit d8153ba
File tree
26 files changed
+1742
-5028
lines changed- dist
- src
- handlers
- pdf
- schemas
- test-data
- test
- handlers
- integration
26 files changed
+1742
-5028
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 2 | + | |
| 3 | + | |
12 | 4 | | |
13 | 5 | | |
14 | 6 | | |
| |||
This file was deleted.
This file was deleted.
0 commit comments