mirror of
https://github.com/bitbaum/chatkit.git
synced 2026-12-04 05:07:23 +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>
1 line
1.4 KiB
Plaintext
1 line
1.4 KiB
Plaintext
{"version":3,"file":"pdf.d.ts","sourceRoot":"","sources":["../src/pdf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,kCAAkC;AAClC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,cAAc,IAAI,CAAC;AAChC,eAAO,MAAM,mBAAmB,QAAqC,CAAC;AAEtE,0EAA0E;AAC1E,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,0DAA0D;AAC1D,eAAO,MAAM,aAAa,QAAmB,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAI9C,MAAM,MAAM,UAAU,GAClB;I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