23 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
ebcebd4723 Unify migration locks and plugin environments, and cover compatibility boundaries 2026-11-06 02:04:52 +08:00
Bingxi Zhao (Frank)
60df53fcf3 Merge #2316 from rudycelekli 2026-11-06 01:56:40 +08:00
Rudy Celekli
2c30cf5e1d fix(co_writer): don't italicize intra-word underscores in DOCX export
markdown_to_docx matched _..._ anywhere, so prose mentioning an identifier like
snake_case_word was exported with "case" italicized and the surrounding
underscores dropped ("snakecaseword"). Per CommonMark, _ only opens or closes
emphasis at a word boundary (unlike *, which may emphasise intra-word).

Guard the _ emphasis branch with word-boundary lookarounds, matching the
pattern already used for Anki export in deeptutor/notes/anki_export.py.
Word-bounded _italic_ is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-01 09:25:11 -05:00
RRFZ
953a6106f5 fix(co_writer): stop the Windows write lock file growing on every save
CoWriterStorage.locked() is taken by every document save, note-thread
change, proposal and review. Its Windows branch appended b"0" to the
append-mode .write.lock file before each msvcrt lock, so the file grew
by one byte per acquisition (1,000 saves: 1,000 bytes) and never shrank.

Write the byte only when the file is empty, as the other msvcrt locks
in the codebase do.
2026-10-31 22:25:42 -04:00
Bingxi Zhao (Frank)
f41f9cfe74 fix: sanitize XML text before rendering every DOCX block 2026-10-27 21:41:24 +08:00
Bingxi Zhao (Frank)
67977de2ce Merge remote-tracking branch 'origin/dev' into HEAD 2026-10-27 21:41:07 +08:00
Rudy Celekli
f008dce902 fix(co_writer): don't crash DOCX export on a literal NUL in Markdown
_add_inline_runs masks backslash escapes with the sentinel _MASK = '\x00' and
pops one saved character per sentinel in _unmask. A NUL already present in the
input collides with the sentinel but has no saved entry, so _unmask called
deque.popleft() on an empty deque and raised IndexError, aborting the entire
Word export. NUL is not valid XML text content, so strip it at the single
inline-text choke point before masking.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-26 10:28:17 -04:00
Bingxi Zhao (Frank)
28c11e2ae8 feat: update notes, chat interactions and workspace UI on preview
Remove course pages, APIs and the course_study capability. Add anchored note
threads and reviewed learning-block generation, queued and withdrawable chat
messages, quote attachments, side chats, and the calendar/favorites/navigation
updates.

Keep preview's existing backend architecture. Wire the new features through
its Python application and existing chat engine, retain legacy selected-text
requests, persist mid-turn messages in replay, and restore note context when
regenerating. Leave stored user data intact.

Validate frontend contracts, dependency boundaries, types, 1290 node tests,
840 rendered tests, lint, localization and the production build. Exercise
session/notes/API regressions, 53 chat-engine tests and 20 Python/native
integration tests with isolated runtime data.
2026-10-26 22:13:34 +08:00
Bingxi Zhao (Frank)
857a82e74a feat(notes): add block notebooks with inline reviews and linked favorites
Add rich text and learning blocks, media uploads, page trees, and revisioned notebook storage. Present AI suggestions at their target blocks with durable accept and dismiss actions.

Unify saved outputs as Favorites with typed expandable blocks, stable source links, atomic batch insertion, nesting, dragging, and undo/redo.

Validation: 99 frontend tests and 99 backend tests pass in an isolated snapshot, along with TypeScript, scoped ESLint, dependency architecture, and locale parity checks.
2026-10-17 23:15:23 +08:00
evan188199-tech
65d9b8f557 fix(co-writer): keep a placeholder row and warn when DOCX table row parsing fails (#1700)
* fix(co-writer): warn and keep placeholder row when DOCX table row parsing fails

_table_to_markdown swallowed per-row cell errors with 'except Exception:
continue', silently dropping rows (e.g. malformed merged cells) from the
converted markdown. Log a warning with the table/row ordinal and keep a
placeholder row so the loss is visible in the output itself.

Use an English placeholder '(unparseable row)' so non-Chinese documents
are not polluted, and keep test imports sorted for CI.

* test(codebuddy): make credential fixture expiry relative to now

test_load_credentials_parses_session wrote a hard-coded expiresAt of
1791055241000 (2026-10-03 15:40:41 UTC) and asserted is_expired() is
False. Once that instant passed the assertion flipped, so the test now
fails on every Python version for every branch.

Derive expiresAt / refreshExpiresAt from time.time() so the fixture
always describes a live session, and assert against the value written.

---------

Co-authored-by: XZH <cto@xzh.ai>
2026-10-07 20:22:52 +08:00
Bingxi Zhao (Frank)
1e1e02beae fix(co-writer): keep automark annotations readable (#1603) 2026-09-27 04:55:15 +08:00
Alok Saboo
6bfff9d3cf style: ruff format 2026-08-30 12:10:26 -04:00
Alok Saboo
580286b844 add initial docx support for cowriter 2026-08-30 12:03:07 -04:00
Bukely_
07abbd7326 feat(pageindex): add OSS knowledge bases and reasoning-based retrieval (#907)
Adds PageIndex OSS as a knowledge-base type and moves PageIndex retrieval from traditional RAG to reasoning-based retrieval: a small workflow-owned agent loop reads the document tree instead of going through the built-in MCP server, which this removes.
2026-08-20 00:35:15 +08:00
Bingxi Zhao (Frank)
fb3c568697 fix pageindex & minor bugs 2026-07-18 19:47:03 +08:00
Bingxi Zhao (Frank)
46093e5e2b update msg 2026-06-11 20:03:34 +08:00
iwedo
4de4f5e9c9 fix: 系统性修复多用户数据隔离问题
核心问题:
1. HTTP请求的用户上下文仅依赖require_auth依赖,中间件层无保障
2. WebSocket端点(tutorbot/vision_solver/question/knowledge/book)缺少手动认证
3. CoWriterStorage在__init__中固定path_service,单例后路径不再变化
4. get_path_service()静默降级到默认实例,无日志

修复内容:
- 添加user_context_middleware中间件,确保每个HTTP请求都正确设置用户ContextVar
- 添加ws_require_auth()统一WebSocket认证函数,所有WS端点使用
- 修复tutorbot/vision_solver/question/knowledge/book的WebSocket认证
- 统一chat/solve/unified_ws的WebSocket认证为ws_require_auth()
- CoWriterStorage改为@property延迟获取path_service + 按workspace缓存
- get_path_service()降级时输出warning日志
2026-05-12 15:32:57 +08:00
Bingxi Zhao (Frank)
2c4769a96f prepare v1.3.8 release
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-08 02:36:24 +08:00
Bingxi Zhao (Frank)
824bf778df fix: lint & logging system 2026-05-01 01:39:08 +08:00
Bingxi Zhao (Frank)
28e225ee0e chore: prepare v1.3.1 release
Stability release after v1.3.0 covering safer RAG/KB routing, stronger
embedding validation, more reliable Docker/TutorBot restarts, Web UX
fixes, and Windows/encoding hardening. See assets/releases/ver1-3-1.md
for the full notes.

Made-with: Cursor
2026-04-28 12:00:11 +08:00
Bingxi Zhao (Frank)
77f29cbcc7 fix lint 2026-04-23 19:29:16 +08:00
Bingxi Zhao (Frank)
593ddba3fb feat(co-writer): add multi-doc co-writer workspace with backend storage
- Add co-writer storage module and API router for document persistence
- Restructure co-writer page to per-doc routing ([docId]) with sidebar recent list
- Wire CoWriterRecent into sidebar shell and AppShellContext
- Tidy notebook prompts, facade, path service, and builtin tools wiring
- Refresh tests (add missing __init__.py, drop obsolete app_facade test)
- Add favicon/apple-touch-icon assets and minor i18n cleanup

Made-with: Cursor
2026-04-20 19:46:41 +08:00
Bingxi Zhao (Frank)
2745e8bde9 feat(book): introduce book capability and restructure guide/co_writer modules
- Add new `deeptutor/book/` module with multi-agent pipeline
  (ideation, spine, page planner, source explorer, synthesizer)
  and rich block system (text, code, figure, quiz, flash cards,
  callout, deep dive, timeline, animation, concept graph, etc.)
- Add `/api/routers/book.py` and `deeptutor_cli/book.py` entry points
- Add web UI under `web/app/(workspace)/book/` with sidebar,
  chat panel, page reader, spine editor, progress timeline, and
  block renderers
- Move `deeptutor/agents/co_writer` -> `deeptutor/co_writer` and
  `deeptutor/agents/guide` -> `deeptutor/guide` (then remove guide
  entirely now superseded by book)
- Remove legacy guide UI, hooks, types, and API router
- Update visualize agents/prompts, notebook service, prompt manager,
  session turn runtime, and shared services to support new flows
- Refresh chat composer, sidebar, notebook selector, and locales

Made-with: Cursor
2026-04-20 00:33:33 +08:00