27 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
92a26ae3cc fix(storage): isolate attachment writes and settle document parsing
Local dev repairs for #2244, #2245, #2255, #2426, #2453. Regression checks cover reported symptoms and compatibility boundaries.
2026-11-15 00:44:09 +08: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
Bingxi Zhao (Frank)
cc9a60237b Merge remote-tracking branch 'origin/dev' into codex/land-2163
# Conflicts:
#	deeptutor/utils/document_extractor.py
2026-10-31 17:25:30 +08:00
Bingxi Zhao
10dace6fdb Merge pull request #2236 from rudycelekli/fix/pptx-presentation-slide-order-20261031
fix(documents): follow PPTX presentation slide order in fallbacks
2026-10-31 17:02:04 +08:00
Rudy Celekli
eea3b870aa fix(documents): preserve sparse XLSX cell columns in fallback
Use worksheet cell coordinates to retain missing leading and interior cells. Bound padding to Excel columns A through XFD and keep sequential fallback for missing or malformed references.

AI-assisted: implemented and validated with OpenAI Codex; real saved openpyxl workbooks provide independent row oracles.
2026-10-31 01:43:08 -04:00
Rudy Celekli
0628c03240 fix(documents): follow PPTX presentation slide order in fallbacks
Resolve presentation slide IDs through their relationships instead of sorting part filenames. Share ordering across both OOXML extraction paths and preserve metadata-free extraction.

AI-assisted: implemented and validated with OpenAI Codex; actual generated decks checked against python-pptx.
2026-10-31 01:39:12 -04:00
朱鸿儒
47e39c40ca fix(docx): preserve OMML across fallback paths 2026-10-30 10:50:12 +08:00
Bingxi Zhao (Frank)
fbab59acbf feat: modularize installation and enforce feature dependency boundaries 2026-10-28 01:02:29 +08:00
XZH
95e913a787 fix(reading): preserve EPUB outline anchors 2026-10-01 17:26:44 -07:00
Bingxi Zhao (Frank)
a053fecf6e release: v1.6.11
The interface ships in French and Ukrainian alongside English and
Chinese, and /language pins a reply language for one conversation.
Immersive reading organizes collections as colored folders, adds a
fullscreen learning mode, and turns Explain / Translate / Guide me on a
selection into ordinary messages in the reading chat; "Quiz me on this
page" runs one quiz turn without changing the conversation's mode, which
retires the reading-openers endpoint and its task model. Images embedded
in DOCX, PPTX and PDF are extracted in place and reach vision models.

Office files preview as paged PDFs through LibreOffice (now in the Docker
image), falling back to the in-browser renderers without it. Web sources
re-sync on a durable schedule, linked folders sync on demand, .bib files
index, and a zotero_search tool queries Zotero. Settings gains Learning
progress and credential-free presets; admins import users from CSV;
split deployments can hand a session to a public device. Grok CLI joins
the subagents, Unifically the providers, ChatGPT exports the importers.

Gate cleanup: mypy/bandit findings in the new launcher, audio-overview,
web-source, reading-store and textbook modules; the task-model copy test
follows the retired reading_openers kind.

See assets/releases/ver1-6-11.md for the full notes, and the README
Releases row plus its eleven translations.
2026-09-24 09:59:56 +08:00
Bingxi Zhao (Frank)
1203688304 style: format integrated auth config and extraction changes 2026-09-23 11:09:14 +08:00
Bingxi Zhao (Frank)
705e9bf9d5 Merge branch 'codex/reading-learning-prs-20260923' into codex/pr-batch-root
# Conflicts:
#	deeptutor/reading/extract.py
#	deeptutor/reading/store.py
#	web/components/notebook/NotebookRecordRow.tsx
#	web/locales/en/app.json
#	web/locales/zh/app.json
2026-09-23 10:58:38 +08:00
flower-moon
e1b4954a23 feat(documents): Office/PDF 嵌入图片全链路支持 — 提取、显示、喂视觉模型
- 新增 utils/document_images.py:docx(OOXML单遍扫描)/pptx(python-pptx+OOXML兜底)/pdf(pymupdf, xref去重)
  嵌入图片提取,统一 [图片 N: name] 正文标记 + ImageBudget 预算(单文档12张/12MB,单回合16张/12MB)
- 聊天附件:extract_documents_from_records 产出嵌入图片 image 记录(embedded 标记),
  turn_runtime 托管附件库后经现有多模态注入管道发给视觉模型,UI 零改动渲染图片附件
- 阅读区:Extraction.media + 标记→locator 映射,入库 media/ + media.json,
  新增 GET /materials/{id}/media(/{name}) API,TextUnitView 图片条(article 外侧,不动逐字锚定),
  immersive_reading 回合注入当前页图片(≤4张),read_material 结果附图片清单
- docx 富提取顺带补齐 python-docx 一直丢掉的表格文本;EMF/WMF 矢量图计数尾注不静默丢弃
- MaterialManifest 新增 media_count(向后兼容);media_path 索引校验防路径穿越
- tests: test_document_images.py 8 用例;utils 51 + 阅读区全套 + session 209 通过

详细文档: docs/文档图片支持_提取显示与视觉模型_2026-09-07.md (gitignored)
2026-09-17 18:46: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
Bingxi Zhao (Frank)
04040a2c06 release: v1.6.5
Ship a content workspace you choose, one exec tool for every language,
Mastery Path modes that gate its tools, and Settings that grades
readiness instead of listing faults.

Release notes: assets/releases/ver1-6-5.md
2026-09-06 13:46:29 +08:00
Bingxi Zhao (Frank)
93df3d48b7 release: v1.6.4
Ship lighter isolated runtimes, richer Books and Mastery flows,
Reading/session polish, and explicit model API capabilities.

Release notes: assets/releases/ver1-6-4.md
2026-09-03 01:38:54 +08:00
XZH
d3b19f3a2e feat(reading): add source-faithful EPUB contract 2026-08-23 04:38:24 -07: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)
ef5ce9f952 fix: RAM issues 2026-08-02 13:07:32 +08:00
Bingxi Zhao (Frank)
b728354863 release: v1.5.2
Configurable chat attachment limits, PageIndex retrieval by reasoning
over your documents, broader Anthropic/OpenAI model support, and a
sweep of Book / Knowledge Base / chat-UI reliability fixes. Drop-in —
no migrations.

- attachments: size caps + extraction budgets editable in Settings →
  Chat → Attachments (admin), stored in system.json with CHAT_ATTACHMENT_*
  env overrides; the WebSocket frame ceiling is now derived from the
  total cap, fixing large uploads silently dropping the connection.
- pageindex: chat retrieves via an internal MCP server (agentic tool
  calls over the document tree); search() returns the outline; ingestion
  accepts PDF/Office/Markdown/text/CSV.
- llm: newer Anthropic/OpenAI models via official SDKs incl. Codex native
  tools; effort-based Claude → adaptive thinking; corrected temperature-
  rejection set; streamed usage counted once per completion.
- book/knowledge: rescue stuck GENERATING/PLANNING pages + reset on
  failure; KB status updates on upload/sync; atomic manager writes.
- web/channels: full-width chat + single scrollbar, aligned composer,
  Enter sends edited message, malformed-markdown crash fix; WeCom aligned
  with SDK 1.0.8; Mastery recency weighting restored (#618).
- release notes ver1-5-2.md (v1.5.0/v1.5.1 archived to past_releases/),
  __version__ bump to 1.5.2, README Releases row + one-week fold.
- README Settings/config prose + all 10 translations synced; docs
  settings/knowledge/chat pages updated separately in site/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 17:15:36 +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)
6428458049 chore: prepare v1.2.5 release 2026-04-25 22:08:44 +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