@sylphx/pdf-reader-mcp 2.4.1 → 2.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +18 -19
  2. package/dist/index.js +3 -2
  3. package/package.json +6 -8
package/README.md CHANGED
@@ -8,11 +8,10 @@
8
8
  [![License](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](https://opensource.org/licenses/MIT)
9
9
  [![CI/CD](https://img.shields.io/github/actions/workflow/status/SylphxAI/pdf-reader-mcp/ci.yml?style=flat-square&label=CI/CD)](https://github.com/SylphxAI/pdf-reader-mcp/actions/workflows/ci.yml)
10
10
  [![codecov](https://img.shields.io/codecov/c/github/SylphxAI/pdf-reader-mcp?style=flat-square)](https://codecov.io/gh/SylphxAI/pdf-reader-mcp)
11
- [![coverage](https://img.shields.io/badge/coverage-94.17%25-brightgreen?style=flat-square)](https://pdf-reader-msu3esos4-sylphx.vercel.app)
12
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue.svg?style=flat-square)](https://www.typescriptlang.org/)
11
+ [![TypeScript](https://img.shields.io/badge/TypeScript-6.0-blue.svg?style=flat-square)](https://www.typescriptlang.org/)
13
12
  [![Downloads](https://img.shields.io/npm/dm/@sylphx/pdf-reader-mcp?style=flat-square)](https://www.npmjs.com/package/@sylphx/pdf-reader-mcp)
14
13
 
15
- **5-10x faster parallel processing** • **Y-coordinate content ordering** • **94%+ test coverage** • **103 tests passing**
14
+ **5-10x faster parallel processing** • **Y-coordinate content ordering** • **94%+ test coverage** • **173 tests passing**
16
15
 
17
16
  <a href="https://mseep.ai/app/SylphxAI-pdf-reader-mcp">
18
17
  <img src="https://mseep.net/pr/SylphxAI-pdf-reader-mcp-badge.png" alt="Security Validated" width="200"/>
@@ -63,7 +62,7 @@ PDF Reader MCP is a **production-ready** Model Context Protocol server that empo
63
62
  - 🎯 **Path Flexibility** - Absolute & relative paths, Windows/Unix support (v1.3.0)
64
63
  - 🖼️ **Smart Ordering** - Y-coordinate based content preserves document layout
65
64
  - 🛡️ **Type Safe** - Full TypeScript with strict mode enabled
66
- - 📚 **Battle-tested** - 103 tests, 94%+ coverage, 98%+ function coverage
65
+ - 📚 **Battle-tested** - 173 tests, 94%+ coverage, 98%+ function coverage
67
66
  - 🎨 **Simple API** - Single tool handles all operations elegantly
68
67
 
69
68
  ---
@@ -325,7 +324,7 @@ npm install -g @sylphx/pdf-reader-mcp
325
324
  **Other Improvements:**
326
325
  - 🐛 Fixed Zod validation error handling
327
326
  - 📦 Updated all dependencies to latest versions
328
- - ✅ 103 tests passing, 94%+ coverage maintained
327
+ - ✅ 173 tests passing, 94%+ coverage maintained
329
328
 
330
329
  <details>
331
330
  <summary><strong>📋 View Full Changelog</strong></summary>
@@ -711,10 +710,10 @@ CMD ["bun", "node_modules/@sylphx/pdf-reader-mcp/dist/index.js"]
711
710
  |:----------|:-----------|
712
711
  | **Runtime** | Node.js 22+ ESM |
713
712
  | **PDF Engine** | PDF.js (Mozilla) |
714
- | **Validation** | Zod + JSON Schema |
713
+ | **Validation** | Vex + JSON Schema |
715
714
  | **Protocol** | MCP SDK |
716
715
  | **Language** | TypeScript (strict) |
717
- | **Testing** | Vitest (103 tests) |
716
+ | **Testing** | Bun test (173 tests) |
718
717
  | **Quality** | Biome (50x faster) |
719
718
  | **CI/CD** | GitHub Actions |
720
719
 
@@ -738,28 +737,28 @@ CMD ["bun", "node_modules/@sylphx/pdf-reader-mcp/dist/index.js"]
738
737
  <br/>
739
738
 
740
739
  **Prerequisites:**
741
- - Node.js >= 22.0.0
742
- - pnpm (recommended) or npm
740
+ - Node.js >= 22.13.0 (required by pdfjs-dist v6)
741
+ - Bun (this repo uses `bun@1.3.1`)
743
742
 
744
743
  **Setup:**
745
744
  ```bash
746
745
  git clone https://github.com/SylphxAI/pdf-reader-mcp.git
747
746
  cd pdf-reader-mcp
748
- pnpm install && pnpm build
747
+ bun install && bun run build
749
748
  ```
750
749
 
751
750
  **Scripts:**
752
751
  ```bash
753
- pnpm run build # Build TypeScript
754
- pnpm run test # Run 103 tests
755
- pnpm run test:cov # Coverage (94%+)
756
- pnpm run check # Lint + format
757
- pnpm run check:fix # Auto-fix
758
- pnpm run benchmark # Performance tests
752
+ bun run build # Build with bunup
753
+ bun test # Run 173 tests
754
+ bun run test:cov # Coverage (94%+)
755
+ bun run check # Lint + format
756
+ bun run check:fix # Auto-fix
757
+ bun run benchmark # Performance tests
759
758
  ```
760
759
 
761
760
  **Quality:**
762
- - ✅ 103 tests
761
+ - ✅ 173 tests
763
762
  - ✅ 94%+ coverage
764
763
  - ✅ 98%+ function coverage
765
764
  - ✅ Zero lint errors
@@ -775,8 +774,8 @@ pnpm run benchmark # Performance tests
775
774
  **Quick Start:**
776
775
  1. Fork repository
777
776
  2. Create branch: `git checkout -b feature/awesome`
778
- 3. Make changes: `pnpm test`
779
- 4. Format: `pnpm run check:fix`
777
+ 3. Make changes: `bun test`
778
+ 4. Format: `bun run check:fix`
780
779
  5. Commit: Use [Conventional Commits](https://www.conventionalcommits.org/)
781
780
  6. Open PR
782
781
 
package/dist/index.js CHANGED
@@ -1152,9 +1152,10 @@ var processSingleSource = async (source, options) => {
1152
1152
  individualResult.success = false;
1153
1153
  individualResult.data = undefined;
1154
1154
  } finally {
1155
- if (pdfDocument && typeof pdfDocument.destroy === "function") {
1155
+ const loadingTask = pdfDocument?.loadingTask;
1156
+ if (loadingTask && typeof loadingTask.destroy === "function") {
1156
1157
  try {
1157
- await pdfDocument.destroy();
1158
+ await loadingTask.destroy();
1158
1159
  } catch (destroyError) {
1159
1160
  const message = destroyError instanceof Error ? destroyError.message : String(destroyError);
1160
1161
  logger6.warn("Error destroying PDF document", { sourceDescription, error: message });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sylphx/pdf-reader-mcp",
3
- "version": "2.4.1",
3
+ "version": "2.4.3",
4
4
  "description": "An MCP server providing tools to read PDF files.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,7 +18,7 @@
18
18
  "access": "public"
19
19
  },
20
20
  "engines": {
21
- "node": ">=22.0.0"
21
+ "node": ">=22.13.0"
22
22
  },
23
23
  "repository": {
24
24
  "type": "git",
@@ -71,8 +71,7 @@
71
71
  "dependencies": {
72
72
  "@sylphx/mcp-server-sdk": "^2.1.1",
73
73
  "@sylphx/vex": "^0.1.11",
74
- "glob": "^13.0.6",
75
- "pdfjs-dist": "^5.6.205",
74
+ "pdfjs-dist": "^6.0.227",
76
75
  "pngjs": "^7.0.0"
77
76
  },
78
77
  "overrides": {
@@ -83,16 +82,15 @@
83
82
  "vite": "^6.4.2"
84
83
  },
85
84
  "devDependencies": {
86
- "@biomejs/biome": "^2.4.12",
85
+ "@biomejs/biome": "^2.4.16",
87
86
  "@sylphx/biome-config": "^0.4.1",
88
87
  "@sylphx/bump": "^1.6.1",
89
88
  "@sylphx/doctor": "^1.34.0",
90
89
  "@sylphx/tsconfig": "^0.3.1",
91
- "@types/glob": "^8.1.0",
92
- "@types/node": "^25.6.0",
90
+ "@types/node": "^25.9.1",
93
91
  "@types/pngjs": "^6.0.5",
94
92
  "bunup": "0.16.31",
95
- "lefthook": "^2.1.6",
93
+ "lefthook": "^2.1.9",
96
94
  "typedoc": "^0.28.19",
97
95
  "typedoc-plugin-markdown": "^4.11.0",
98
96
  "typescript": "^6.0.3",