72 Commits

Author SHA1 Message Date
lytanjie
284e06145d fix(web): render GFM tables in learner card stems (#2879)
Learner-card stems go through InlineMarkdown, which only switches to the
rich renderer for math, emphasis, code and links; a stem whose only markup
was a table reached the learner as raw pipes. Detect GFM tables and route
those stems through RichInlineMarkdown, and add markdown-table.ts (table
detection plus a blank line after each table so a trailing sentence is not
swallowed as another row).

Tests: learner-card-table.spec.tsx, markdown-table.test.ts.

Co-authored-by: Claude Code <noreply@anthropic.com>
2026-11-29 14:53:07 +08:00
Qiu
506cea9d4f feat(desktop): finish Windows chat file actions (#3051)
Continues #2978 and closes #2887. Includes the original Windows file actions, integrates the changes with dev, and adds an explicit default-app action.

Co-authored-by: Botong Wu <2048400180@qq.com>
2026-11-28 13:09:15 -03:00
GLM DeepTutor Worker
5e6ccfa6eb fix(web): language-aware CJK font stacks for chat prose (#2143)
Set message-scoped lang from the reply language and add :lang(ja/ko/zh-Hant)
font stacks so Japanese/Korean/Traditional Chinese replies no longer fall
through to SimSun/Songti SC. Leave the shared SC-first Tailwind stacks alone.
2026-11-09 13:40:39 +08:00
yert
edb205369a fix: preserve Redis event JSON arrays and tolerate legacy artifacts 2026-11-02 02:51:36 +00:00
Bingxi Zhao (Frank)
bc75a93a5e Merge commit '0cfbaf738093ab1aa2a3f1b5499acc925baa2b0c' into codex/validate-reviewed-integration 2026-10-31 18:52:54 +08:00
Bingxi Zhao (Frank)
6c4218eb89 Merge commit '584472fb427ac84d739d315885da1525832f913c' into codex/validate-reviewed-integration
# Conflicts:
#	web/features/chat/messages/ChatMessageList.tsx
2026-10-31 18:52:47 +08:00
Bingxi Zhao (Frank)
584472fb42 fix(markdown): isolate code math and diagrams within RTL prose 2026-10-31 16:47:06 +08:00
Bingxi Zhao (Frank)
0cfbaf7380 fix(chat): hide generated previews only for embedded images 2026-10-31 16:42:56 +08:00
x-labb
72a5a172a8 feat(web): render right-to-left text correctly with per-block dir=auto 2026-10-30 22:27:33 +01:00
hongthana
98cfb501a5 feat(web): add account-scoped learning typography 2026-10-30 07:41:44 +07:00
Frankisfrank
fc13e0f998 fix: resolve generated files in partner archives 2026-10-20 01:09:43 +11:00
Bingxi Zhao (Frank)
8986c31580 feat(reading): complete Watching convergence with safe legacy migration (#1378)
Adapted the migration foundation from PR #1384 while preserving current workspace, caption and turn-admission safeguards.

Co-authored-by: XZH <cto@xzh.ai>
2026-10-08 02:48:50 +08:00
Bingxi Zhao (Frank)
f0146a2a9e Polish settings UI and localize provider brand labels 2026-10-07 21:30:50 +08:00
Bingxi Zhao (Frank)
d2810c2812 Replace forwarded link titles with accessible tooltips 2026-09-27 10:41:33 +08:00
Bingxi Zhao (Frank)
a46439632e fix(web): expose remaining partner and coworker action hints on touch 2026-09-27 10:21:30 +08:00
Bingxi Zhao (Frank)
61952363ef fix(partners): preserve external links and code example attachments 2026-09-27 02:27:33 +08:00
dxhome
98fd2d7551 fix(partners): render generated file links in chat 2026-09-26 14:31:00 +08:00
Bingxi Zhao (Frank)
b38a2245eb Merge PR #1334 linked folder manual sync 2026-09-23 10:28:15 +08:00
Bingxi Zhao (Frank)
ee24f44fa7 fix(ui): unify accessible tooltips (#1526) 2026-09-21 14:51:29 +08:00
Bingxi Zhao (Frank)
da856ad670 release: v1.6.9
Ship folder-based workspaces and data migration, daily practice, redesigned
provider and model settings, and streaming conversation improvements.
Synchronize README translations and document the archive/permanent-delete
upgrade behavior in assets/releases/ver1-6-9.md.

Reduce initial JavaScript by deduplicating English resources and loading
animation features after hydration. Keep the existing route size budgets.
Update regression fixtures and browser audits for scoped URLs and the new
settings and learning interfaces.
2026-09-21 02:30:40 +08:00
Bingxi Zhao (Frank)
70650c02d1 fix(web): render the tutor's formulas on the surfaces a learner reads
A maths or physics tutoring turn reaches the learner with its LaTeX
intact: a Bellman question shows `$G_t = R_{t+1} + \gamma G_{t+1}$`, a
derivation shows `$\Delta = 4 - 20 = -16 < 0$`, and a bolded cue shows
its asterisks. Three separate surfaces, one cause each.

`MarkdownRenderer` refused the rich renderer whenever the variant was
`trace`, so no trace bubble could ever reach KaTeX — and
`RichMarkdownRenderer`'s entire `isTrace` branch, written for exactly
this, was unreachable code. Rich is chosen by what the content contains,
not by which surface shows it; a trace bubble with no math still takes
the cheap path, which is what that exclusion was really protecting.

The mastery question card and the ask_user card interpolated plain
strings. They are also short, and they sit inside `<button>` and
one-line rows, so the block renderer is the wrong tool: a `<p>` is not
valid there and brings block spacing with it. `InlineMarkdown` emits
phrasing content only and loads KaTeX at all only when the string has
something to render, so an ordinary question costs nothing. It now
renders the mastery stem, its options and its verdict explanation, and
the ask_user intro, stem, option labels and option descriptions.

Escaped-unicode decoding moved inside it, so callers no longer choose
between decoding a string and rendering it.
2026-09-10 22:51:27 +08:00
Gao-Chenkai
d033272f93 feat(knowledge): add linked folder manual sync 2026-09-09 21:24:41 +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
Boooobby
4069f900cc fix: preserve raw content during Chinese Markdown streaming (#1178)
* fix: normalize Chinese Markdown emphasis boundaries

* fix: preserve raw content during markdown streaming

* fix: sort turn executor imports
2026-09-03 15:30:26 +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
Bingxi Zhao (Frank)
6e6e56aedb release: v1.6.3
Ship the breaking front- and back-end runtime and route refactor,
learner and guardian flows, grounded reading, knowledge and parser
updates, and recoverable long-running streams.

Release notes: assets/releases/ver1-6-3.md
2026-09-02 04:09:11 +08:00
Bingxi Zhao (Frank)
bfdf874a10 refactor(web): remove v1 chat transport and legacy surfaces 2026-09-01 20:16:46 +08:00
Bingxi Zhao (Frank)
829be646a1 chore(web): enforce frontend architecture boundaries 2026-09-01 19:55:48 +08:00
Bingxi Zhao (Frank)
13698a9a7e refactor(web): retire the unified chat context path 2026-09-01 17:59:50 +08:00
Bingxi Zhao (Frank)
efcee00757 Merge pull request #1036 from Zuan0/reading-citation-grounding
# Conflicts:
#	web/components/chat/home/ChatMessages.tsx
#	web/components/common/AssistantResponse.tsx
#	web/components/reading/ReaderPane.tsx
#	web/context/ReadingContext.tsx
#	web/context/UnifiedChatContext.tsx
#	web/lib/reading-turn-state.ts
#	web/tests/e2e/reading-citation-material.audit.ts
#	web/tests/reading-citations.test.ts
#	web/tests/reading-turn-state.test.ts
2026-08-31 19:34:01 +08:00
Bingxi Zhao (Frank)
3dc372f551 release: v1.6.2 — immersive watching and extensible visualizers
Add synchronized YouTube learning, a plugin-driven visualizer catalog, and Hermes, OpenClaw, and DeepSeek agent harnesses. Refresh Reading, Knowledge, Partner status, guided updates, documentation, translations, and release notes for v1.6.2.
2026-08-31 01:13:07 +08:00
Bingxi Zhao (Frank)
7d23ed8a28 merge: integrate video learning and WebVTT fixes
# Conflicts:
#	deeptutor/capabilities/registry.py
#	deeptutor/runtime/bootstrap/builtin_capabilities.py
#	deeptutor/services/session/turn_runtime.py
#	tests/core/test_capabilities_runtime.py
#	web/app/(workspace)/home/[[...sessionId]]/page.tsx
#	web/components/common/AssistantResponse.tsx
#	web/context/UnifiedChatContext.tsx
#	web/lib/settings-nav.ts
#	web/locales/en/app.json
#	web/locales/zh/app.json
2026-08-30 18:07:23 +08:00
Bingxi Zhao (Frank)
3f3bf0b841 feat(reading): render safe versioned web snapshots 2026-08-30 16:01:40 +08:00
XZH
d5d381650f fix(reading): bind citations to turn materials and verified locators 2026-08-30 15:45:45 +08:00
Bingxi Zhao (Frank)
ce7c2dc2dc release: v1.6.1 — one key, one navigator, one sidebar you arrange
Model configuration was one layer replicated seven times: every service
stored its own profile with its own credentials, so a single OpenRouter
key had to be pasted into five separate pages. This release splits that
in two — a **connection** holds one vendor credential and links it down
to every service that vendor can serve, and a **task model** takes the
calls nobody asks for (naming a conversation, writing the composer's
starting points) off the model picked for actual reasoning. Both are
opt-in; existing per-service profiles resolve exactly as before.

Around that: Settings drops the card grid for a persistent searchable
navigator whose landing page answers "what state am I in" instead of
repeating the directory; Mastery Path files study conversations under
their topic and opens them in the tutor rather than dropping them on
/home; the sidebar folds features into More and reorders by drag; the
reading companion is rebuilt from /home's own chat components; and the
LightRAG engine talks to the SDK directly, so its extra no longer drags
MinerU in transitively.

Also back-merges PR #1041 (Anthropic SDK 1.x temperature via extra_body)
and PR #741 (owner-only auth secret/token files), which had been merged
straight into main and never flowed back to dev.

Release notes: assets/releases/ver1-6-1.md
Gates: pre-commit 15/15, ruff clean, pytest 5802 passed, web 450 node
tests, eslint 0 errors, docs build clean.
2026-08-30 13:19:42 +08:00
Bingxi Zhao (Frank)
97a4d0eeef feat(reading): add immersive reading workspace 2026-08-28 14:58:48 +08:00
XZH
999c658187 fix(reading): bind citations to turn materials and verified locators 2026-08-27 07:26:17 -07:00
XZH
50d0472527 feat(video-learning): add YouTube immersive watching 2026-08-27 07:24:12 -07:00
Bingxi Zhao (Frank)
7c6bcfaef7 release: v1.5.14
Immersive Reading, self-configuration, and a two-way IMA library.

- Immersive Reading: a new capability that opens a document beside the
  thread. New reading engine (PDF pages / slides / page-sized sections),
  five reading tools, a deterministic locate pre-pass that grounds the
  turn without a second LLM call, /api/v1/reading, and a reader pane with
  selection, highlights, notes, and export to an annotated PDF or Markdown.
- Setup capability: inspect the install, apply a setting, install a
  parsing engine, or request a credential from a chat turn. New settings
  spec table; a candidate value is probed before it is committed, and API
  keys never enter the model's context.
- Tencent IMA: pipeline split into transport/envelope/models/sources/
  notes/media/inventory, an additive capability with five tools, and
  connected libraries that can finally be enumerated (bounded listings
  are reported as a lower bound).
- Retrieval: supports_rag_retrieval() replaces is_connected_kb() for the
  "can I sweep this?" question, so linked / lightrag_server / ima sources
  stop being silently dropped from every book.
- Notebooks: their own console at /notebook, per-notebook locks and atomic
  writes, copy / move / export routes, damaged files surfaced instead of
  dropped, and renaming a record no longer clears its knowledge-base link.
- Settings persistence: one lock and one atomic replace shared by every
  writer of interface.json; the PUT endpoints stop writing the
  defaults-merged view back to disk.

Release notes: assets/releases/ver1-5-14.md
2026-08-19 17:34:52 +08:00
Bingxi Zhao (Frank)
f4f2a73b2a feat(search): rebuild the search provider layer and add six providers
Two pieces of work land together because the second is built on the
first: the provider layer was consolidated onto one spec table, then six
new providers were registered against it.

Layer overhaul
- Converge seven separate provider lists (backend registry, runtime
  config, settings router, CLI wizard, frontend catalog, i18n, tests)
  onto a single SEARCH_PROVIDERS spec table; every consumer derives from
  it instead of keeping its own copy.
- Fix three silent defects: serper's `num` never reached the API (it was
  swallowed by **kwargs, so max_results did nothing), serper dropped its
  proxies, and jina had no result-count limit at all.
- A runtime failure (rate limit, timeout, unreachable network) no longer
  fails the whole turn. The request walks the user's other credentialed
  search profiles and finally DuckDuckGo, recording the downgrade under
  a top-level `search_fallback` key so the trace shows what happened.
- Drop three provider modules that were never registered (exa, baidu,
  openrouter). They stay in the deprecated list, so a stale config reads
  as outdated rather than as a misspelled name.

Six new providers
doubao, bocha, zhipu, firecrawl, qianfan, aliyun_iqs — selectable under
Settings > Catalog > Search with their credential fields derived from the
spec table, and offered by `deeptutor init`. All six set
`soft_fallback=False`: five are China-hosted and the DuckDuckGo fallback
is unreachable on those networks, so a missing API key has to fail
loudly instead of silently timing out somewhere else.

Baidu returns as `qianfan` on the official Qianfan API; the old `baidu`
key stays deprecated.
2026-08-13 16:41:39 +08:00
p421098
cfbd49bad0 fix(web): repair malformed strong-emphasis spacing in assistant output (#786)
* fix(web): repair malformed strong-emphasis spacing in assistant output

* style(web): keep removeEmptyMarkdownTables' loop header as dev has it

The branch reformatted an untouched line ('; )' -> ';)'). The repo's real
style is not what .prettierrc reports, so a stray prettier pass here would
land as unrelated churn in the squashed commit.

* fix(web): make the strong-emphasis repair fail-safe

The rewrite paired an opening ``**`` with the next one on the line
regardless of whether the line's markers pair off at all, so it corrupted
Markdown the renderer already handles correctly (checked against the
repo's own micromark):

- ``In Markdown, use ** to make text **bold**.`` lost its bold — the
  capture was allowed to start at whitespace, so a literal ``**`` in
  prose swallowed the sentence up to the next opener.
- ``**Note: **Important**`` became ``**Note:** Important**``, dropping
  the bold and leaking a stray ``**``.
- ``**重點 **必讀** 內容**`` — valid nested emphasis — lost most of its
  bold.

Anchor the capture at a non-space, require it to end at a colon (the
reported shape), and skip any line whose ``**`` count is odd: with an odd
count at least one marker is literal or unclosed, and there is no way to
tell which two were meant to pair. Bailing out is free — the line then
renders exactly as it does without this repair. Also skip indented code
blocks, which are shown verbatim and are not masked with the fenced ones.

---------

Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-08-12 17:06:47 +08:00
Bingxi Zhao (Frank)
44fa7a1552 release: v1.5.8
Memory. A v1.5.7 source deployment grew past 14 GB before V8 aborted; the
causes were independent, so this cut fixes each one and bounds what was
previously unbounded.

- The dev server was never actually capped: `next dev` renders in a worker it
  spawns, and V8 flags in argv are not inherited, so
  `node --max-old-space-size=4096 .../next dev` never reached the process
  holding the memory. Next then substituted 50% of total RAM — a 12 GB heap on
  a 24 GB machine. web/scripts/dev.mjs routes the ceiling through NODE_OPTIONS
  (which the worker inherits and Next honors), clamped to 4 GB and sized off
  the cgroup limit in a container.
- Source installs serve a production build: `deeptutor start` builds once into
  .next-deeptutor and reuses it until a fingerprint over the web/ tree, the
  version file, or the build-time public settings changes. `--dev` is the
  opt-in for HMR and keeps using .next, so neither mode invalidates the other.
- LLM clients and providers come from a bounded event-loop-local LRU pool of 2
  instead of one per turn, closed on shutdown and retired on a settings
  reload; only the selected backend's SDK is imported.
- Caches gained ceilings: knowledge-task log streams cap events and bytes per
  task with a 1h TTL and a completion tombstone, the completed-task table
  keeps 256, the LlamaIndex index cache drops 8 -> 2 with a 10-minute idle
  evict, and a book runtime is released when its queue drains.
- After a turn, a finished book job, or a completed KB task, cycles are
  collected and glibc is asked to return free pages via malloc_trim; the
  container and launcher set MALLOC_ARENA_MAX=2 and a lower trim threshold,
  both operator-overridable.
- Every uvicorn launch sets --timeout-keep-alive 300. web/proxy.ts forwards
  over Node's http.globalAgent, whose 5s idle reaper matched uvicorn's default
  exactly; both ends raced to close the same socket and the loser's request
  died with ECONNRESET ("Failed to load sessions").
- deeptutor.agents, deeptutor.core.agentic, provider_core, the document
  extractor's parser libraries and the LLM error-mapping rules resolve on
  first use. `python -m deeptutor.api.run_server` no longer reloads by
  default (DEEPTUTOR_DEV_RELOAD=1 restores it).

README prose and all ten translated READMEs now describe the production-build
default instead of dev mode. Release notes: assets/releases/ver1-5-8.md
2026-08-02 13:23:45 +08:00
Bingxi Zhao (Frank)
740ec413a0 release: v1.5.7
Per-account MCP Services and CLI Apps — the two ways a deployment plugs in
tools DeepTutor never shipped — plus the isolation that makes them safe on a
shared install.

- MCP Services: a 45-entry curated store of hosted servers each account
  installs for itself, OAuth 2.1 (PKCE + dynamic client registration) for the
  servers that require it, static keys held by reference and resolved in memory
  at connect time, stdio refused for self-service. Settings no longer
  configures MCP; /settings/mcp redirects to the store.
- CLI Apps: 101 tools snapshotted from the two CLI-Anything registries.
  Installs are admin-only, the registry's install_cmd is parsed into an argv we
  build rather than executed, npm install scripts are forced off, and 66
  first-party entries are pinned to one reviewed commit. Apps land in
  data/cli-apps, one environment each, mounted read-only into the runner.
- Credentials that authorise a person move to data/system, the one branch the
  exec sandbox never mounts: Codex tokens relocate themselves on first use
  (refusing to follow a symlink), per-user MCP configs and keys land beside
  them.
- Grants gain a cli_apps whitelist with the same deny-by-default posture as
  MCP tools; a per-turn registry view keeps one owner's provider tools out of
  the process-global registry and refuses an unauthorised tool at execute, not
  just in the manifest.
- The composer reports what filled this turn's context window, a gutter rail
  jumps back through long conversations, and the workspace collapses to a
  drawer on small screens.
- The composer keeps focus after sending and across tab switches (#720);
  released images carry provenance and SBOM attestations (#722).

README prose, all ten translated READMEs, and the docs-site pages that named
Settings → MCP are updated to match. Release notes:
assets/releases/ver1-5-7.md
2026-07-31 00:25:48 +08:00
Dongyu
a63fa22317 fix(web): localize the admin user management UI (#718)
Routes the remaining admin, sign-out, confirm-dialog and toast copy through i18next and adds the matching en/zh entries, so switching DeepTutor to Chinese no longer leaves account management in English.
2026-07-28 19:19:13 +08:00
Dryice Liu
be39000688 style(web): apply prettier v4.0.0-alpha.8 formatting to code-block theme files
Pre-commit auto-fixes from the project's pinned prettier (alpha.8).
Pure formatting — long object/array literals and assert.equal() calls
broken across multiple lines to satisfy print-width. No logic changes.

Files: code-block-themes registry, RichCodeBlock renderer, AppShell +
SettingsContext plumbing, appearance settings page, and the 6 affected
test files. Also adds a missing trailing newline to
app-shell-storage-code-block.test.ts.
2026-07-19 21:31:10 +08:00
Dryice Liu
45948d9fcc Merge branch 'dev' into feat/code_block_theme 2026-07-19 16:02:43 +08:00
Bingxi Zhao (Frank)
b030697df7 refactor(web): shared IME-composing hook + citation-anchor helper; symmetric scrollbar gutter
Follow-up to #615/#608/#634: the isComposingRef + composition-handler
trio duplicated across five textareas (ComposerInput,
SimpleComposerInput, ChatMessages edit, BookChatPanel, PartnerComposer)
becomes one useImeComposing() hook; the citation-anchor fallback chain
+ <details> auto-open duplicated in both markdown renderers moves to
lib/markdown-anchors.ts; and the chat scrollport reserves the
scrollbar gutter on both edges so the message column centers on the
same axis as header and composer on classic-scrollbar platforms.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 01:38:06 +08:00
Dryice Liu
2bd9ce1538 feat(settings): preview selected code block theme
Add a live Python code-block preview to Settings → Appearance that uses the real RichCodeBlock renderer, so selected syntax theme, line numbers, and wrapping are visible immediately. Dynamically load the preview client-side to avoid server/client style mismatches from persisted AppShell preferences. Also use wordWrap consistently in RichCodeBlock to avoid React shorthand/non-shorthand style warnings when wrapping changes.
2026-07-18 15:47:20 +08:00
Dryice Liu
1ce246a546 feat(settings): add code block appearance controls and renderer
Add a Code blocks section to Settings → Appearance with one Prism
theme dropdown and two toggles (line numbers, wrap long lines).
Update RichCodeBlock to derive background/color from the selected
Prism style via getCodeBlockThemeBackground, route plain text
through SyntaxHighlighter so line numbers and wrapping stay
consistent, and remove the hardcoded #1f2937 dark panel so light
themes remain readable.
2026-07-18 14:51:55 +08:00
Dryice Liu
7ff6b23c2b feat(web): add code block theme registry and shell distribution
Add a registry of every installed Prism theme (46 options) using
individual module imports rather than the barrel, plus type
declarations for the style modules. Extend AppShell storage and
context so code-block preferences are available synchronously to
renderers outside /settings/*. Sync backend-loaded values from
SettingsContext into AppShell storage and add update helpers that
PUT only the changed field.
2026-07-18 14:51:47 +08:00