mirror of
https://github.com/bitbaum/chatkit.git
synced 2026-12-04 04:07:20 +01:00
* feat(pdf): read a PDF someone attaches, as text or as pictures of its pages No model on a free chain reads a PDF file, so a PDF never leaves the device as one. @bitbaum/chatkit/pdf reads it in the browser with pdf.js: - a PDF with a text layer comes back as text, page markers kept; - one without (slides exported as pictures, a scan) comes back as its pages, four to a sheet at 784px a page, for a model that can see. chatkit-copy-pdf-assets copies pdf.js's worker and decoders into the app's static folder; readPdf takes their URL. Without the decoders, JPEG 2000 pages (macOS's "reduce file size" export) draw blank. The legacy build is used so older iPhones read PDFs too; pdf.js loads only on the first PDF. Found on OrangeCat 2026-10-27: a 17-slide investor deck (no text layer, JPEG 2000 images) could not be shared with the Cat at all. Checked in Chromium against that deck: 5 sheets, every slide legible. Release 0.20.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmt7KKvAA6LzcgFqXA3 * docs(pdf): describe the app's static folder without naming it as a chatkit path; chain the copy into build (pnpm skips prebuild) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmt7KKvAA6LzcgFqXA3 --------- Co-authored-by: Claude <noreply@anthropic.com>
105 lines
2.9 KiB
JSON
105 lines
2.9 KiB
JSON
{
|
|
"name": "@bitbaum/chatkit",
|
|
"version": "0.20.0",
|
|
"description": "One chat for every product: a composer with a microphone that always works, a thread that does not fight the reader, messages with copy and retry, and LLM markdown — the fleet's chat standard as a package.",
|
|
"license": "MIT",
|
|
"author": "Cato",
|
|
"homepage": "https://github.com/bitbaum/chatkit#readme",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/bitbaum/chatkit.git"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/bitbaum/chatkit/issues"
|
|
},
|
|
"keywords": [
|
|
"chat",
|
|
"composer",
|
|
"voice",
|
|
"dictation",
|
|
"speech-to-text",
|
|
"markdown",
|
|
"react",
|
|
"ai",
|
|
"pdf"
|
|
],
|
|
"type": "module",
|
|
"sideEffects": [
|
|
"*.css"
|
|
],
|
|
"packageManager": "pnpm@11.25.0",
|
|
"engines": {
|
|
"node": ">=20"
|
|
},
|
|
"publishConfig": {
|
|
"access": "public",
|
|
"provenance": true
|
|
},
|
|
"files": [
|
|
"dist",
|
|
"bin",
|
|
"styles.css"
|
|
],
|
|
"bin": {
|
|
"chatkit-check-file-inputs": "./bin/chatkit-check-file-inputs.mjs",
|
|
"chatkit-copy-pdf-assets": "./bin/chatkit-copy-pdf-assets.mjs"
|
|
},
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.ts",
|
|
"default": "./dist/index.js"
|
|
},
|
|
"./react": {
|
|
"types": "./dist/react/index.d.ts",
|
|
"default": "./dist/react/index.js"
|
|
},
|
|
"./audit": {
|
|
"types": "./dist/audit.d.ts",
|
|
"default": "./dist/audit.js"
|
|
},
|
|
"./attach": {
|
|
"types": "./dist/react/attach.d.ts",
|
|
"default": "./dist/react/attach.js"
|
|
},
|
|
"./pdf": {
|
|
"types": "./dist/pdf.d.ts",
|
|
"default": "./dist/pdf.js"
|
|
},
|
|
"./styles.css": "./styles.css"
|
|
},
|
|
"scripts": {
|
|
"build": "rm -rf dist && tsc -p tsconfig.json",
|
|
"lint": "eslint .",
|
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
"test": "node --test test/*.test.js",
|
|
"check:dist": "git diff --exit-code --stat -- dist",
|
|
"verify": "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run build && pnpm test && pnpm run test:browser",
|
|
"format": "prettier --write .",
|
|
"format:check": "prettier --check .",
|
|
"demo": "esbuild demo/demo.tsx --bundle --jsx=automatic --format=iife --define:process.env.NODE_ENV='\"production\"' --outfile=demo/dist/demo.js --log-level=warning",
|
|
"test:browser": "pnpm run demo && node test/browser.mjs && node test/browser-scroll.mjs && node test/browser-app.mjs && node test/browser-pdf.mjs"
|
|
},
|
|
"devDependencies": {
|
|
"@bitbaum/design-tokens": "^1.2.0",
|
|
"@eslint/js": "^10.0.1",
|
|
"@types/node": "^26.4.0",
|
|
"@types/react": "^19.2.18",
|
|
"@types/react-dom": "^19.2.3",
|
|
"esbuild": "^0.28.2",
|
|
"eslint": "^10.9.1",
|
|
"globals": "^17.11.0",
|
|
"playwright": "1.63.0",
|
|
"prettier": "^3.9.6",
|
|
"react": "^19.2.8",
|
|
"react-dom": "^19.2.8",
|
|
"typescript": "^6.0.3",
|
|
"typescript-eslint": "^8.68.0"
|
|
},
|
|
"peerDependencies": {
|
|
"react": ">=18"
|
|
},
|
|
"dependencies": {
|
|
"pdfjs-dist": "^6.4.299"
|
|
}
|
|
}
|