From b90a07bc19c24d71e3ec85a5a179b17c80f4e8e0 Mon Sep 17 00:00:00 2001 From: Kayvan Sylvan Date: Sun, 2 Aug 2026 16:25:25 -0700 Subject: [PATCH] feat(web): replace PDF.js conversion with WASM worker - Process PDF attachments through reusable pdf-inspector WASM worker - Transfer ArrayBuffers and initialize WASM once per worker - Reject pending conversions and recreate workers after crashes - Parse attachments without triggering duplicate chat requests - Surface OCR, encoding, and empty-content conversion errors - Remove PDF.js pipeline and obsolete transitive dependencies - Add tests for conversion results and chat boundaries --- cmd/generate_changelog/incoming/2185.txt | 7 + web/package-lock.json | 353 +----------------- web/package.json | 3 +- web/pnpm-lock.yaml | 179 +-------- web/pnpm-workspace.yaml | 5 - web/src/lib/components/chat/ChatInput.svelte | 151 +------- .../components/chat/read-file-content.test.ts | 56 +++ .../lib/components/chat/read-file-content.ts | 17 + .../lib/services/PdfConversionService.test.ts | 199 ++++++++++ web/src/lib/services/PdfConversionService.ts | 139 +++---- web/src/lib/services/pdf-config.ts | 19 - web/src/lib/workers/pdf-inspector.worker.ts | 29 ++ web/vite.config.ts | 7 - 13 files changed, 401 insertions(+), 763 deletions(-) create mode 100644 cmd/generate_changelog/incoming/2185.txt create mode 100644 web/src/lib/components/chat/read-file-content.test.ts create mode 100644 web/src/lib/components/chat/read-file-content.ts create mode 100644 web/src/lib/services/PdfConversionService.test.ts delete mode 100644 web/src/lib/services/pdf-config.ts create mode 100644 web/src/lib/workers/pdf-inspector.worker.ts diff --git a/cmd/generate_changelog/incoming/2185.txt b/cmd/generate_changelog/incoming/2185.txt new file mode 100644 index 00000000..7b77dd3a --- /dev/null +++ b/cmd/generate_changelog/incoming/2185.txt @@ -0,0 +1,7 @@ +### PR [#2185](https://github.com/danielmiessler/Fabric/pull/2185) by [ksylvan](https://github.com/ksylvan): feat(web): replace PDF.js pipeline with pdf-inspector WASM worker + +- Replaced the PDF.js processing pipeline with the new `pdf-inspector.worker.ts`, backed by `@firecrawl/pdf-inspector-wasm`. The worker initializes WASM one time and processes transferred ArrayBuffers. +- Added worker error handling. A worker crash now rejects all pending requests with a clear error and terminates the worker. The next request starts a new worker. +- Fixed the file attachment behavior. The app now parses each file and stores its content without a chat request. One submit sends exactly one `streamChat` call, not one call for each attached file. +- Removed the legacy PDF dependency chain: `pdf-to-markdown-core`, `pdfjs-dist`, `pdf-config.ts`, and the related build configuration. `@firecrawl/pdf-inspector-wasm` is now the only PDF dependency. +- Simplified the worker boundary in follow-up refactors: merged redundant methods, removed dead code, and inlined a single-use interface. The full test suite continued to pass. diff --git a/web/package-lock.json b/web/package-lock.json index 5ebcafa3..b3edd926 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -25,6 +25,7 @@ }, "devDependencies": { "@eslint/js": "^9.39.5", + "@firecrawl/pdf-inspector-wasm": "0.1.3", "@skeletonlabs/skeleton": "^5.0.0", "@skeletonlabs/skeleton-svelte": "^5.0.0", "@sveltejs/adapter-auto": "^3.3.1", @@ -41,8 +42,6 @@ "lucide-svelte": "^0.575.0", "mdsvex": "^0.12.8", "patch-package": "^8.0.1", - "pdf-to-markdown-core": "github:jzillmann/pdf-to-markdown#modularize", - "pdfjs-dist": "^6.2.108", "postcss": "^8.5.25", "prettier": "^3.9.6", "prettier-plugin-svelte": "^4.1.1", @@ -266,6 +265,13 @@ "node": "^20.19.0 || ^22.13.0 || >=24" } }, + "node_modules/@firecrawl/pdf-inspector-wasm": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@firecrawl/pdf-inspector-wasm/-/pdf-inspector-wasm-0.1.3.tgz", + "integrity": "sha512-8gz3s3H/WABomls64YCZ8W6zd+eIxFgNAfCXI9+a7axDekZQHX21rsng1uxImoBZD3mXpN7XqLH/LS68WnGWhw==", + "dev": true, + "license": "MIT" + }, "node_modules/@floating-ui/core": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.8.0.tgz", @@ -417,283 +423,6 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@napi-rs/canvas": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-1.0.3.tgz", - "integrity": "sha512-OlI657a5XXvKGFX7kNeIzJ8rO7IXt87Mqu2H8rXE46viAuOfum/JA7ysX7+eBhxNKznT+RCZh418mndlcFX3+w==", - "dev": true, - "license": "MIT", - "optional": true, - "workspaces": [ - "e2e/*" - ], - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - }, - "optionalDependencies": { - "@napi-rs/canvas-android-arm64": "1.0.3", - "@napi-rs/canvas-darwin-arm64": "1.0.3", - "@napi-rs/canvas-darwin-x64": "1.0.3", - "@napi-rs/canvas-linux-arm-gnueabihf": "1.0.3", - "@napi-rs/canvas-linux-arm64-gnu": "1.0.3", - "@napi-rs/canvas-linux-arm64-musl": "1.0.3", - "@napi-rs/canvas-linux-riscv64-gnu": "1.0.3", - "@napi-rs/canvas-linux-x64-gnu": "1.0.3", - "@napi-rs/canvas-linux-x64-musl": "1.0.3", - "@napi-rs/canvas-win32-arm64-msvc": "1.0.3", - "@napi-rs/canvas-win32-x64-msvc": "1.0.3" - } - }, - "node_modules/@napi-rs/canvas-android-arm64": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-android-arm64/-/canvas-android-arm64-1.0.3.tgz", - "integrity": "sha512-7kSCdUhoXiO+AaIMXdBGdtp6EctZNkmF62Rea/BmVQlwKaM3bBhOzyGUzxyxz9dv5vdBfpyAaxhSRSJF4kqK4A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - } - }, - "node_modules/@napi-rs/canvas-darwin-arm64": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-arm64/-/canvas-darwin-arm64-1.0.3.tgz", - "integrity": "sha512-ds14V1BPagLszQyaDTeggny5fNeTCqsUQ5QhFj9VDxSEfzrVxXtdbR0LoFyKa0Siaaw8KvqSk4t7k/WoZJwvbg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - } - }, - "node_modules/@napi-rs/canvas-darwin-x64": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-x64/-/canvas-darwin-x64-1.0.3.tgz", - "integrity": "sha512-qof3LRAAycmkV2I1izZo9RoSHF8kCQr5O05sFwv0jK8rSdYV6KHVwimo6Qb7RxZj40WHKbLHm5JDaUF0o5XUAA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - } - }, - "node_modules/@napi-rs/canvas-linux-arm-gnueabihf": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm-gnueabihf/-/canvas-linux-arm-gnueabihf-1.0.3.tgz", - "integrity": "sha512-FU2kKZLmolHA9+KcUA+l1+xH3WTLUUTQDU/kLv9SEUr2TrRPu94aytOeizFJDHPs/QBcw4QL1mCQhetQXYBbag==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - } - }, - "node_modules/@napi-rs/canvas-linux-arm64-gnu": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-gnu/-/canvas-linux-arm64-gnu-1.0.3.tgz", - "integrity": "sha512-GVSjntxKeA+/y/ZKf1F+cmUw1WeIkE5aMRPqnZUlBTBvBcrvgWccJAWuYCKPX4QJQwZILIIwhgdAbl51yj6fpA==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - } - }, - "node_modules/@napi-rs/canvas-linux-arm64-musl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-musl/-/canvas-linux-arm64-musl-1.0.3.tgz", - "integrity": "sha512-J51oK/axyZ13kxycumSMfLiDZMdWdOVvqDFI28BpuViZHE3A0bQfr8B5vg8YnPEnqLD3BSn1hkdlh2buspEcNQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - } - }, - "node_modules/@napi-rs/canvas-linux-riscv64-gnu": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-riscv64-gnu/-/canvas-linux-riscv64-gnu-1.0.3.tgz", - "integrity": "sha512-CtQgQjoVTX67jS9XuCTtJ40Sl7wRLMguoFnnGnfDmCWf7kzKFZVwj5ynqUOIGKFMSB61ZCuQlwPvVNxYTTseaw==", - "cpu": [ - "riscv64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - } - }, - "node_modules/@napi-rs/canvas-linux-x64-gnu": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-gnu/-/canvas-linux-x64-gnu-1.0.3.tgz", - "integrity": "sha512-jtfzAHFp+FRaR7zGT4jyCe6wUgAG/dVb5A4Apd8FY9jKarntDfUAlJXscugiH7ZF5kKnu7/lHFk9LaDPcrGEVQ==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - } - }, - "node_modules/@napi-rs/canvas-linux-x64-musl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-musl/-/canvas-linux-x64-musl-1.0.3.tgz", - "integrity": "sha512-xTzaUCKUHTY4bCGadeeRZggbRVbGUT1petg7Z8r9AJR2+D9Bqu6nQAgqBGC6D47tA70LjaaaLTrJ7wNY1T74dg==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - } - }, - "node_modules/@napi-rs/canvas-win32-arm64-msvc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-arm64-msvc/-/canvas-win32-arm64-msvc-1.0.3.tgz", - "integrity": "sha512-ktVLuBkI6QVOm5BwO/WbdGwxgeetAMJa7TTmR8qBarXF0OU2NKjvjUtPJAl2y8t+zBRczJl/1VOl9gua6WcK2g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - } - }, - "node_modules/@napi-rs/canvas-win32-x64-msvc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-x64-msvc/-/canvas-win32-x64-msvc-1.0.3.tgz", - "integrity": "sha512-SGhlQ8bDjL1Cz2KnsKMasr/5sTcwG/SZkB6WCJxLsmSm/3aS2C+3p39bA7iZ2/94+NkVDySZfbiGoaSZSFHYxA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - } - }, "node_modules/@napi-rs/wasm-runtime": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.1.tgz", @@ -2041,13 +1770,6 @@ "undici-types": "~8.3.0" } }, - "node_modules/@types/string-similarity": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/string-similarity/-/string-similarity-4.0.2.tgz", - "integrity": "sha512-LkJQ/jsXtCVMK+sKYAmX/8zEq+/46f1PTQw7YtmQwb74jemS1SlNLmARM2Zml9DgdDTWKAtc5L13WorpHPDjDA==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/trusted-types": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", @@ -5633,32 +5355,6 @@ "dev": true, "license": "MIT" }, - "node_modules/pdf-to-markdown-core": { - "version": "0.5.0", - "resolved": "git+ssh://git@github.com/jzillmann/pdf-to-markdown.git#5e930fafd305644cff00a3824030f0d6741acde8", - "dev": true, - "hasInstallScript": true, - "license": "AGPL-3.0", - "dependencies": { - "@types/string-similarity": "^4.0.0", - "simple-statistics": "^7.7.0", - "string-similarity": "^4.0.4", - "uuid": "^9.0.1" - } - }, - "node_modules/pdfjs-dist": { - "version": "6.2.108", - "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-6.2.108.tgz", - "integrity": "sha512-YxFb+SQcodN2rnX9Tn3dHYlqfb7NjlzzfONPpJd+AKoKtUjEdevTfbC07d5TcczzOK6261auRkP/M8OBHs9vFQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=22.13.0 || >=24" - }, - "optionalDependencies": { - "@napi-rs/canvas": "^1.0.0" - } - }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -6392,16 +6088,6 @@ "dev": true, "license": "ISC" }, - "node_modules/simple-statistics": { - "version": "7.9.3", - "resolved": "https://registry.npmjs.org/simple-statistics/-/simple-statistics-7.9.3.tgz", - "integrity": "sha512-WXpxUfo7BJCRpyl4besiuMV7wNj9xiPIq7IKmUQO4upIaF8pK2AXwhjttHN5L8KXZrLkGMCHGHq4p+pJXiIahQ==", - "dev": true, - "license": "ISC", - "engines": { - "node": "*" - } - }, "node_modules/sirv": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz", @@ -6461,14 +6147,6 @@ "dev": true, "license": "MIT" }, - "node_modules/string-similarity": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/string-similarity/-/string-similarity-4.0.4.tgz", - "integrity": "sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ==", - "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", - "dev": true, - "license": "ISC" - }, "node_modules/stringify-entities": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", @@ -7016,21 +6694,6 @@ "dev": true, "license": "MIT" }, - "node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", - "dev": true, - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/vfile": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", diff --git a/web/package.json b/web/package.json index df291256..6dd79817 100644 --- a/web/package.json +++ b/web/package.json @@ -17,6 +17,7 @@ }, "devDependencies": { "@eslint/js": "^9.39.5", + "@firecrawl/pdf-inspector-wasm": "0.1.3", "@skeletonlabs/skeleton": "^5.0.0", "@skeletonlabs/skeleton-svelte": "^5.0.0", "@sveltejs/adapter-auto": "^3.3.1", @@ -33,8 +34,6 @@ "lucide-svelte": "^0.575.0", "mdsvex": "^0.12.8", "patch-package": "^8.0.1", - "pdf-to-markdown-core": "github:jzillmann/pdf-to-markdown#modularize", - "pdfjs-dist": "^6.2.108", "postcss": "^8.5.25", "prettier": "^3.9.6", "prettier-plugin-svelte": "^4.1.1", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 3950f5b7..531b14fd 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -71,6 +71,9 @@ importers: '@eslint/js': specifier: ^9.39.5 version: 9.39.5 + '@firecrawl/pdf-inspector-wasm': + specifier: 0.1.3 + version: 0.1.3 '@skeletonlabs/skeleton': specifier: ^5.0.0 version: 5.0.0(tailwindcss@4.3.3) @@ -119,12 +122,6 @@ importers: patch-package: specifier: ^8.0.1 version: 8.0.1 - pdf-to-markdown-core: - specifier: github:jzillmann/pdf-to-markdown#modularize - version: https://codeload.github.com/jzillmann/pdf-to-markdown/tar.gz/5e930fafd305644cff00a3824030f0d6741acde8 - pdfjs-dist: - specifier: ^6.2.108 - version: 6.2.108 postcss: specifier: ^8.5.25 version: 8.5.25 @@ -382,6 +379,9 @@ packages: resolution: {integrity: sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@firecrawl/pdf-inspector-wasm@0.1.3': + resolution: {integrity: sha512-8gz3s3H/WABomls64YCZ8W6zd+eIxFgNAfCXI9+a7axDekZQHX21rsng1uxImoBZD3mXpN7XqLH/LS68WnGWhw==} + '@floating-ui/core@1.8.0': resolution: {integrity: sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==} @@ -430,81 +430,6 @@ packages: '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} - '@napi-rs/canvas-android-arm64@1.0.3': - resolution: {integrity: sha512-7kSCdUhoXiO+AaIMXdBGdtp6EctZNkmF62Rea/BmVQlwKaM3bBhOzyGUzxyxz9dv5vdBfpyAaxhSRSJF4kqK4A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/canvas-darwin-arm64@1.0.3': - resolution: {integrity: sha512-ds14V1BPagLszQyaDTeggny5fNeTCqsUQ5QhFj9VDxSEfzrVxXtdbR0LoFyKa0Siaaw8KvqSk4t7k/WoZJwvbg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/canvas-darwin-x64@1.0.3': - resolution: {integrity: sha512-qof3LRAAycmkV2I1izZo9RoSHF8kCQr5O05sFwv0jK8rSdYV6KHVwimo6Qb7RxZj40WHKbLHm5JDaUF0o5XUAA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/canvas-linux-arm-gnueabihf@1.0.3': - resolution: {integrity: sha512-FU2kKZLmolHA9+KcUA+l1+xH3WTLUUTQDU/kLv9SEUr2TrRPu94aytOeizFJDHPs/QBcw4QL1mCQhetQXYBbag==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/canvas-linux-arm64-gnu@1.0.3': - resolution: {integrity: sha512-GVSjntxKeA+/y/ZKf1F+cmUw1WeIkE5aMRPqnZUlBTBvBcrvgWccJAWuYCKPX4QJQwZILIIwhgdAbl51yj6fpA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@napi-rs/canvas-linux-arm64-musl@1.0.3': - resolution: {integrity: sha512-J51oK/axyZ13kxycumSMfLiDZMdWdOVvqDFI28BpuViZHE3A0bQfr8B5vg8YnPEnqLD3BSn1hkdlh2buspEcNQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@napi-rs/canvas-linux-riscv64-gnu@1.0.3': - resolution: {integrity: sha512-CtQgQjoVTX67jS9XuCTtJ40Sl7wRLMguoFnnGnfDmCWf7kzKFZVwj5ynqUOIGKFMSB61ZCuQlwPvVNxYTTseaw==} - engines: {node: '>= 10'} - cpu: [riscv64] - os: [linux] - libc: [glibc] - - '@napi-rs/canvas-linux-x64-gnu@1.0.3': - resolution: {integrity: sha512-jtfzAHFp+FRaR7zGT4jyCe6wUgAG/dVb5A4Apd8FY9jKarntDfUAlJXscugiH7ZF5kKnu7/lHFk9LaDPcrGEVQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@napi-rs/canvas-linux-x64-musl@1.0.3': - resolution: {integrity: sha512-xTzaUCKUHTY4bCGadeeRZggbRVbGUT1petg7Z8r9AJR2+D9Bqu6nQAgqBGC6D47tA70LjaaaLTrJ7wNY1T74dg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - libc: [musl] - - '@napi-rs/canvas-win32-arm64-msvc@1.0.3': - resolution: {integrity: sha512-ktVLuBkI6QVOm5BwO/WbdGwxgeetAMJa7TTmR8qBarXF0OU2NKjvjUtPJAl2y8t+zBRczJl/1VOl9gua6WcK2g==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/canvas-win32-x64-msvc@1.0.3': - resolution: {integrity: sha512-SGhlQ8bDjL1Cz2KnsKMasr/5sTcwG/SZkB6WCJxLsmSm/3aS2C+3p39bA7iZ2/94+NkVDySZfbiGoaSZSFHYxA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/canvas@1.0.3': - resolution: {integrity: sha512-OlI657a5XXvKGFX7kNeIzJ8rO7IXt87Mqu2H8rXE46viAuOfum/JA7ysX7+eBhxNKznT+RCZh418mndlcFX3+w==} - engines: {node: '>= 10'} - '@napi-rs/wasm-runtime@1.2.0': resolution: {integrity: sha512-kDoONqMa+VnZ4vvvu/ZUurpJ4gkZU57e7g69qpNgWhYcZFPUHZM2CEMKm+cG6ufDVALbjMvfmMjFVqaK7uEMnA==} engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} @@ -834,9 +759,6 @@ packages: '@types/node@26.1.2': resolution: {integrity: sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg==} - '@types/string-similarity@4.0.2': - resolution: {integrity: sha512-LkJQ/jsXtCVMK+sKYAmX/8zEq+/46f1PTQw7YtmQwb74jemS1SlNLmARM2Zml9DgdDTWKAtc5L13WorpHPDjDA==} - '@types/trusted-types@2.0.7': resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} @@ -1919,14 +1841,6 @@ packages: pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} - pdf-to-markdown-core@https://codeload.github.com/jzillmann/pdf-to-markdown/tar.gz/5e930fafd305644cff00a3824030f0d6741acde8: - resolution: {gitHosted: true, tarball: https://codeload.github.com/jzillmann/pdf-to-markdown/tar.gz/5e930fafd305644cff00a3824030f0d6741acde8} - version: 0.5.0 - - pdfjs-dist@6.2.108: - resolution: {integrity: sha512-YxFb+SQcodN2rnX9Tn3dHYlqfb7NjlzzfONPpJd+AKoKtUjEdevTfbC07d5TcczzOK6261auRkP/M8OBHs9vFQ==} - engines: {node: '>=22.13.0 || >=24'} - picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -2084,9 +1998,6 @@ packages: siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} - simple-statistics@7.9.3: - resolution: {integrity: sha512-WXpxUfo7BJCRpyl4besiuMV7wNj9xiPIq7IKmUQO4upIaF8pK2AXwhjttHN5L8KXZrLkGMCHGHq4p+pJXiIahQ==} - sirv@3.0.2: resolution: {integrity: sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==} engines: {node: '>=18'} @@ -2108,10 +2019,6 @@ packages: std-env@4.2.0: resolution: {integrity: sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==} - string-similarity@4.0.4: - resolution: {integrity: sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ==} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. - stringify-entities@4.0.4: resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==} @@ -2277,11 +2184,6 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - uuid@9.0.1: - resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} - deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028). - hasBin: true - vfile-location@5.0.3: resolution: {integrity: sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==} @@ -2568,6 +2470,8 @@ snapshots: '@eslint/core': 0.17.0 levn: 0.4.1 + '@firecrawl/pdf-inspector-wasm@0.1.3': {} + '@floating-ui/core@1.8.0': dependencies: '@floating-ui/utils': 0.2.12 @@ -2618,54 +2522,6 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 - '@napi-rs/canvas-android-arm64@1.0.3': - optional: true - - '@napi-rs/canvas-darwin-arm64@1.0.3': - optional: true - - '@napi-rs/canvas-darwin-x64@1.0.3': - optional: true - - '@napi-rs/canvas-linux-arm-gnueabihf@1.0.3': - optional: true - - '@napi-rs/canvas-linux-arm64-gnu@1.0.3': - optional: true - - '@napi-rs/canvas-linux-arm64-musl@1.0.3': - optional: true - - '@napi-rs/canvas-linux-riscv64-gnu@1.0.3': - optional: true - - '@napi-rs/canvas-linux-x64-gnu@1.0.3': - optional: true - - '@napi-rs/canvas-linux-x64-musl@1.0.3': - optional: true - - '@napi-rs/canvas-win32-arm64-msvc@1.0.3': - optional: true - - '@napi-rs/canvas-win32-x64-msvc@1.0.3': - optional: true - - '@napi-rs/canvas@1.0.3': - optionalDependencies: - '@napi-rs/canvas-android-arm64': 1.0.3 - '@napi-rs/canvas-darwin-arm64': 1.0.3 - '@napi-rs/canvas-darwin-x64': 1.0.3 - '@napi-rs/canvas-linux-arm-gnueabihf': 1.0.3 - '@napi-rs/canvas-linux-arm64-gnu': 1.0.3 - '@napi-rs/canvas-linux-arm64-musl': 1.0.3 - '@napi-rs/canvas-linux-riscv64-gnu': 1.0.3 - '@napi-rs/canvas-linux-x64-gnu': 1.0.3 - '@napi-rs/canvas-linux-x64-musl': 1.0.3 - '@napi-rs/canvas-win32-arm64-msvc': 1.0.3 - '@napi-rs/canvas-win32-x64-msvc': 1.0.3 - optional: true - '@napi-rs/wasm-runtime@1.2.0(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)': dependencies: '@emnapi/core': 1.11.1 @@ -2964,8 +2820,6 @@ snapshots: dependencies: undici-types: 8.3.0 - '@types/string-similarity@4.0.2': {} - '@types/trusted-types@2.0.7': {} '@types/unist@2.0.11': {} @@ -4257,17 +4111,6 @@ snapshots: pathe@2.0.3: {} - pdf-to-markdown-core@https://codeload.github.com/jzillmann/pdf-to-markdown/tar.gz/5e930fafd305644cff00a3824030f0d6741acde8: - dependencies: - '@types/string-similarity': 4.0.2 - simple-statistics: 7.9.3 - string-similarity: 4.0.4 - uuid: 9.0.1 - - pdfjs-dist@6.2.108: - optionalDependencies: - '@napi-rs/canvas': 1.0.3 - picocolors@1.1.1: {} picomatch@2.3.2: {} @@ -4451,8 +4294,6 @@ snapshots: siginfo@2.0.0: {} - simple-statistics@7.9.3: {} - sirv@3.0.2: dependencies: '@polka/url': 1.0.0-next.29 @@ -4469,8 +4310,6 @@ snapshots: std-env@4.2.0: {} - string-similarity@4.0.4: {} - stringify-entities@4.0.4: dependencies: character-entities-html4: 2.1.0 @@ -4660,8 +4499,6 @@ snapshots: util-deprecate@1.0.2: {} - uuid@9.0.1: {} - vfile-location@5.0.3: dependencies: '@types/unist': 3.0.3 diff --git a/web/pnpm-workspace.yaml b/web/pnpm-workspace.yaml index 7d8f1ee9..191b181c 100644 --- a/web/pnpm-workspace.yaml +++ b/web/pnpm-workspace.yaml @@ -46,8 +46,3 @@ peerDependencyRules: allowBuilds: esbuild: true svelte-preprocess: true - # A git-hosted package needs the full dependency path as the key, because - # pnpm does not trust the identity of a package that has no semver version. - # The commit hash must agree with the version in pnpm-lock.yaml. If you move - # the "modularize" branch, update this key and the lockfile together. - 'pdf-to-markdown-core@https://codeload.github.com/jzillmann/pdf-to-markdown/tar.gz/5e930fafd305644cff00a3824030f0d6741acde8': true diff --git a/web/src/lib/components/chat/ChatInput.svelte b/web/src/lib/components/chat/ChatInput.svelte index 46effcf2..dea99510 100644 --- a/web/src/lib/components/chat/ChatInput.svelte +++ b/web/src/lib/components/chat/ChatInput.svelte @@ -1,7 +1,7 @@