Commit Graph

14 Commits

Author SHA1 Message Date
Qiu
3e66b30aa0 fix(chat): isolate PDF attachment extraction (#3026)
* fix(chat): isolate PDF attachment extraction

Run PDF-bearing chat attachment extraction outside the API process and reuse the single PDF image pass for both page markers and embedded attachments. Addresses the chat attachment reproduction in #2865.

* perf(pdf): skip decoding images after the count cap

Keep lookups for previously accepted image references ahead of the quota check so repeated pictures are still mapped to each page.

* perf(chat): reuse native PDF markdown for text-only parsing

Match the stored attachment bytes and preserve the configured parser path for other engines and incomplete native results.
2026-11-30 13:56:01 +08:00
bluefateludi
934a1922d3 fix: skip chart sheets when extracting XLSX text (#2960) 2026-11-28 19:41:34 +08:00
markxu
fdae1dfdf0 fix: sync and index MDX documentation in knowledge bases
GitHub source sync kept only .md and .markdown, so a docs glob of *.mdx
reported success with zero files and left raw/ empty. Re-index then failed
because no supported source files were present. Treat .mdx as text next to
Markdown in the sync filter, the knowledge-base file router, and the chat
attachment list that mirrors it.

Fixes #2552
2026-11-09 14:09:57 +00:00
Rudy Celekli
f930c5ece8 fix(ingestion): separate EPUB table cells during text extraction
td/th were missing from _EPUB_BLOCK_TAGS, and nothing else emits a
separator between table cells. Both EPUB text renderers (_epub_render_text
and the _EpubHTMLTextParser fallback) only break on block tags, so they
relied on source whitespace between cells. Commercially produced EPUBs
often ship minified, whitespace-free XHTML, where a row like
<tr><td>Revenue</td><td>100</td><td>Q1</td></tr> extracts as the single
glued token "Revenue100Q1" — unreadable data fed to the model.

Add td and th to _EPUB_BLOCK_TAGS so each cell is separated, the same way
li/dd/dt already are. One constant fixes both renderers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-01 09:35:37 -05:00
朱鸿儒
47e39c40ca fix(docx): preserve OMML across fallback paths 2026-10-30 10:50:12 +08:00
朱鸿儒
e51c25f726 fix(docx): preserve native OMML equation structure 2026-10-30 10:41:28 +08:00
XZH
28aa40ff45 fix(reading): normalize packaged EPUB archives 2026-09-15 02:11:01 -07:00
Bingxi Zhao (Frank)
752fba35d4 fix(reading): read an EPUB that macOS re-zipped as the book it is
Finder's "Compress" does two things to an EPUB: it nests the whole book
under one folder, and it writes a parallel `__MACOSX/` tree of AppleDouble
resource forks that carry the content files' names and extensions.

The package lookup only ever looked for `META-INF/container.xml` at the
archive root, so a wrapped book found no container, no OPF and no spine,
and fell back to matching file extensions over the whole archive. That
fallback then read `__MACOSX/OEBPS/._index_split_000.xhtml` — 60 bytes of
binary resource fork — as a chapter. Hence the phantom `._…` sections in
the sidebar and "Could not load this section" on opening them (#1447).

Both halves of the same rule, in one place. Packaging residue (`__MACOSX`,
dotfiles) is not book content and never reaches either reader; the other
archive readers in this codebase already drop it. And a single wrapper
directory is resolved from wherever the container actually sits, so spine
order survives it.

The container/OPF chain was written out twice — once for the spine, once
for the navigation — so a wrapped book silently lost its whole outline
too, by a `return []` in the half nobody was looking at. One resolver now
answers "where is this book's package document" for both.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 20:42:23 +08:00
zhouraym
0f22353806 feat: add EPUB support for knowledge base (#843)
* feat: add EPUB support for knowledge base

* fix: bound and tolerate EPUB extraction

---------

Co-authored-by: zhouruim <zhouruim@digitalchina.com>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-08-16 19:24:04 +08:00
Bingxi Zhao (Frank)
c0037dfb58 fix chat attatchments 2026-07-19 16:56:34 +08:00
Bingxi Zhao (Frank)
144c90f3f7 prepare v1.3.4 release
Made-with: Cursor
2026-05-01 13:51:45 +08:00
Bingxi Zhao (Frank)
824bf778df fix: lint & logging system 2026-05-01 01:39:08 +08:00
Bingxi Zhao (Frank)
c89a3df8a5 chore: prepare v1.2.4 release 2026-04-25 15:10:55 +08:00
Bingxi Zhao (Frank)
4b7d24d33e release: v1.2.3 — document attachments, thinking blocks, provider core refactor
- Chat document attachments (PDF/DOCX/XLSX/PPTX) with text extraction
- Reasoning model <think> block display as collapsible cards
- Tri-state send_dimensions toggle for embeddings (#368)
- LLM provider_core module refactor + context_window detection
- Soul template editor (PR #373), Co-Writer save-to-notebook
- Knowledge Base drag-and-drop upload, delete resilience (#370),
  progress persistence, supported-file-types endpoint
- Question generation language fidelity via shared prompt directives
- Settings tour redesign, CLI notebook add-md/replace-md
- Bug fixes: CJK bot name slug, I18nProvider init, Skills default off,
  Moonshot base URL, version badge
- Provider registry: custom_anthropic, thinking_style, alias expansion
- +1900 test lines across 15 new/expanded test files

Made-with: Cursor
2026-04-24 22:36:32 +08:00