Commit Graph

76 Commits

Author SHA1 Message Date
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)
5c31f0dee6 Merge remote-tracking branch 'origin/main' into multi-user
# Conflicts:
#	deeptutor/knowledge/manager.py
#	deeptutor/services/memory/service.py
#	pyproject.toml
#	requirements/server.txt
#	web/app/(workspace)/agents/page.tsx
2026-05-04 17:12:06 +08:00
Bingxi Zhao (Frank)
93891789fa prepare v1.3.7 release
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-04 16:21:41 +08:00
Bingxi Zhao (Frank)
eff1c0dff6 prepare v1.3.6 release
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-03 16:35:52 +08:00
sagnikonly
504da9e05a fix(ui): skill editor validation and modal background 2026-05-03 11:07:03 +05:30
Bingxi Zhao (Frank)
49661211ce prepare v1.3.5 release
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-02 20:16:07 +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)
255738d991 prepare v1.3.3 release
Document v1.3.3 and include the latest Space context, memory, RAG, provider, and session stability updates for release.

Made-with: Cursor
2026-04-30 23:41:58 +08:00
WeDone
583e8aa939 fix: handle non-string message content in TutorBot chat
When TutorBot is connected to IM channels (e.g. Feishu, WeChat),
users can send images and other multimedia messages. These messages
are stored with content as an array of content-part objects rather
than a plain string. The frontend assumes content is always a string,
causing React Error #31 (Objects are not valid as a React child)
and rendering the chat page unusable.

Changes:
- Add normalizeMessageContent() utility to safely convert array/object
  content to displayable strings
- Fix BotChatPage history parsing to handle non-string content
- Fix UnifiedChatContext hydrateMessages for non-string content
- Fix last_message display with truncation and type safety in
  SessionList and HistorySessionPicker
- Normalize content to string and strip reasoning_content in backend
  get_bot_history and get_recent_active_bots
2026-04-30 01:32:20 +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)
7fce54d98a chore: prepare v1.3.0 release
Made-with: Cursor
2026-04-27 21:09:25 +08:00
Bingxi Zhao (Frank)
e53985d7f0 Merge origin/main into multi-user 2026-04-26 11:45:57 +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)
b5eab8b67a fix: tour 2026-04-24 23:15:26 +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
Bingxi Zhao (Frank)
77f29cbcc7 fix lint 2026-04-23 19:29:16 +08:00
Bingxi Zhao (Frank)
4d60ec8cbb fix: version# 2026-04-22 20:55:48 +08:00
Bingxi Zhao (Frank)
2f6ac5aa80 release: v1.2.2 — Skills system, input perf, response_format auto-fallback, version badge
- User-authored Skills system (CRUD backend + REST API + chat composer integration)
- Chat input performance overhaul: ComposerInput / SimpleComposerInput state colocation
- response_format auto-fallback & runtime cache for incompatible providers
- LAN remote access fix (resolveBase hostname swap)
- Sidebar version badge with GitHub release comparison + GitHub icon link
- Deep Solve image attachment support via unified Attachment pipeline
- Agentic chat pipeline attachment passthrough in responding + acting stages
- TutorBot WebSocket auto-start, _safe_send, graceful disconnect
- Settings page API key masking with Eye/EyeOff toggle
- Book Library UI with search, status cards, and simplified BookSidebar
- Visualization fullscreen mode for SVG/Mermaid/ChartJS
- Embedding ConnectError retry, RAG None-embedding hardening
- KB delete robustness for orphaned config entries
- CLI parse_json_object whitespace normalization
- answer_now response_format guard
- New tests: TutorBot WS, CLI helpers, route-params, api-resolve-base
- Release notes (ver1-2-2.md) and README update

Made-with: Cursor
2026-04-22 20:45:51 +08:00
jiakeboge
3bd857cf7e perf(web): resolve residual input lag in tutorbot interface (#351)
Extract lightweight `SimpleComposerInput` to isolate keystroke renders.
 Colocate input state in `agents/[botId]/chat/page.tsx` to prevent full-page lag.
Export @mention utility helpers from `ComposerInput.tsx` for cross-component use.
Address follow-up feedback from StarNight2021 regarding tutorbot-only performance.
This completes the performance overhaul by ensuring all chat entry points use optimized state colocation patterns.
2026-04-22 18:03:37 +08:00
jiakeboge
a3a645a7da perf(web): decouple chat input state to resolve lag in long conversations (#351)
Extract `ComposerInput` component to isolate frequent keystroke renders.
Refactor `ChatComposer` to use `hasContent` flag instead of full `input` state.
 Apply `React.memo` to heavy config panels (Quiz, Math, Research, Visualize).
Stabilize parent callbacks in `ChatPage` using `useCallback`.
Fix residual syntax errors and missing `canSend` definition in composer.
Address HKUDS/DeepTutor#351 by implementing deep state colocation.
2026-04-22 11:40:10 +08:00
Bingxi Zhao (Frank)
cb7deebc78 fix: readme, kb-management, book management 2026-04-21 01:20:53 +08:00
Bingxi Zhao (Frank)
106a3b4cf0 polish(chat): i18n Regenerate button + restore popped assistant on reject
- Add i18n keys for the Regenerate action button (en: "Regenerate",
  zh: "重新生成") and switch `ChatMessages.tsx` from the hardcoded
  "Regenerate" string to `t("Regenerate")`, matching the existing
  `t("Copy")` pattern in the same row.
- When a regenerate request is rejected pre-flight (server returns a
  terminal `error` with `reason` = `regenerate_busy` or
  `nothing_to_regenerate`), the optimistic `POP_LAST_ASSISTANT` +
  `STREAM_START` placeholder is now rolled back via a new
  `RESTORE_ASSISTANT` reducer action. The popped message is kept in a
  per-key ref (`pendingRegenerateRef`) and cleared on `done` or any
  terminal result, so the transcript stays in sync with the server and
  the user doesn't silently lose their last reply.

Made-with: Cursor
2026-04-21 00:21:42 +08:00
Roman Barlos
0f6c81b732 feat(chat): regenerate last response (CLI, WebSocket, Web UI) (#349)
Rebased onto dev (post-#348) and resolved two UI conflicts (`web/app/(workspace)/chat/[[...sessionId]]/page.tsx` drops the now-dead `replaySnapshot` helper; `web/components/chat/home/ChatMessages.tsx` switches the last-assistant action button from the old `RotateCcw`/Retry to `RefreshCcw`/Regenerate). Smoke tests green (199 passed) and all required checks pass.

Merging: adds a `regenerate` capability wired through CLI (`/regenerate` · `/retry`), WebSocket (`type: "regenerate"`), and Web UI (per-message Regenerate button). Backend rolls back the trailing assistant via `SQLiteSessionStore.delete_message`, reuses `start_turn` through `_persist_user_message=False` / `_regenerate=True`, skips `memory_service.refresh_from_turn` on regeneration, and surfaces non-fatal `regenerate_busy` / `nothing_to_regenerate` errors. Also includes empty-response diagnostics in `_stage_responding`. 18 new tests.
2026-04-21 00:14:58 +08:00
Bingxi Zhao
1fa0c399d9 Merge pull request #352 from DarkGenius/fix/dark-code-block-text-contrast
fix(web): ensure readable text in dark code blocks on light theme
2026-04-20 23:52:34 +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
Roman Barlos
49a26d93d6 fix(web): ensure readable text in dark code blocks on light theme
The hard-coded dark code block background (#1f2937 / #292524) combined
with `.prose` rules was producing near-black text in the light theme:
`.prose pre` forced color #D6D3D1 and
`.prose code:not(.md-code-block__code):not(.md-inline-code)` pulled the
code element back to var(--foreground), overriding the Tailwind classes
on the fallback <pre>/<code>.

Add a higher-specificity rule on .md-renderer .md-code-block {,pre,code}
that pins the text color to #e5e7eb regardless of theme, and tag the
<code> elements in the Rich/Simple markdown fallbacks with the existing
md-code-block__code class so the :not() guard kicks in and inheritance
resolves to the light color.
2026-04-20 14:31:32 +03:00
Bingxi Zhao (Frank)
72a9dc9f3a Merge branch 'guide2.0' into dev: book capability + restructure
Resolved conflicts in:
- deeptutor/agents/notebook/summarize_agent.py
  Kept the YAML-driven record_hints lookup from dev (covers chat,
  co_writer, guided_learning, default), instead of the inline
  dict from guide2.0 which only had chat + co_writer.
- deeptutor/capabilities/visualize.py
  Kept dev's load_answer_now_prompts(...) path so the answer-now
  fast path stays prompt-externalised under
  deeptutor/agents/visualize/prompts/{en,zh}/answer_now.yaml.
- deeptutor/services/prompt/manager.py
  Merged the MODULES list: dropped 'guide' (deleted by guide2.0),
  added 'book' from guide2.0, and kept dev's 'notebook',
  'visualize', 'chat' modules.

Made-with: Cursor
2026-04-20 17:36:43 +08:00
Bingxi Zhao (Frank)
5f29b508e0 refactor(prompts): externalize answer_now/notebook prompts to YAML and tidy capability/UI configs
- Move inline LLM prompts out of capabilities/agents into versioned
  prompt YAMLs under each agent's prompts/{en,zh}/:
  - notebook: analysis_agent, summarize_agent
  - question/research/solve/visualize: answer_now
- Slim down capability modules (_answer_now, deep_question,
  deep_research, deep_solve, visualize) to load prompts via the
  prompt manager instead of hard-coding strings
- Update services/prompt/manager.py to support the new prompt paths
- Refresh web config panels (quiz, research, visualize, math-animator)
  and shared types to align with the new capability options
- Update Mermaid, ChatMessages, TracePanels and settings page,
  plus en/zh locales for the new copy

Made-with: Cursor
2026-04-20 17:34:33 +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
xor_xe
6688408800 feat: add optional auth with login, registration, and admin dashboard
Closes #227. Auth is disabled by default (AUTH_ENABLED=false) so
localhost usage is unaffected. Set AUTH_ENABLED=true +
NEXT_PUBLIC_AUTH_ENABLED=true to require login when hosting publicly.

Backend
- New deeptutor/services/auth.py: bcrypt password hashing, JWT
  create/decode, multi-user JSON store with role + created_at schema,
  auto-migration of old flat-hash format, first-user → admin bootstrap
- New deeptutor/api/routers/auth.py: require_auth / require_admin
  FastAPI dependencies; public endpoints /login /logout /status
  /register /is_first_user; admin-only /users /users/{u}/role
- deeptutor/api/main.py: Depends(require_auth) applied to all 14
  protected routers
- deeptutor/api/routers/unified_ws.py: cookie-based JWT check before
  ws.accept() when AUTH_ENABLED
- Added bcrypt>=4.0.0 and python-jose[cryptography]>=3.3.0 to
  requirements/server.txt and pyproject.toml extras

Frontend
- web/middleware.ts: route protection; /login and /register are public
- web/lib/api.ts: apiFetch wrapper — credentials:include + 401→login
- web/lib/auth.ts: login/logout/fetchAuthStatus + register() +
  checkIsFirstUser()
- web/lib/admin-api.ts: listUsers / deleteUser / setUserRole
- web/lib/session-api.ts: credentials:include on all fetches;
  expectJson redirects to /login on 401 instead of throwing
- web/app/(auth)/login/page.tsx: auto-redirects to /register when no
  users exist; shows success banner after registration
- web/app/(auth)/register/page.tsx: new registration page with
  first-user admin notice and password confirmation
- web/app/(admin)/admin/users/page.tsx: admin dashboard — user table
  with role toggle and delete; guards against self-demotion/deletion
- AdminLink and LogoutButton hidden when AUTH_ENABLED=false
- .env.example and README.md updated with auth vars and setup guide

Made-with: Cursor
2026-04-17 21:40:28 +04:00
Bingxi Zhao (Frank)
e8aa57d737 release: v1.1.1 — universal answer-now, co-writer scroll sync, notebook system unification, tutorbot config refactor
- Promote "Answer now" to a universal escape hatch via answer_now_context;
  orchestrator re-routes any capability to chat._stage_answer_now.
- Co-Writer: draggable split + persistent ratio + line-anchored
  bidirectional scroll sync using a hidden mirror for wrap-aware editor y.
- SaveToNotebookModal: optional message-selection mode with quick presets;
  rebuild transcript / userQuery from the selected subset.
- Adopt the real notebook API (/api/v1/notebook/*) across Knowledge tab,
  guide notebook picker, and save-to-notebook flow; new typed helpers in
  web/lib/notebook-api.ts (listNotebooks/getNotebook/createNotebook/...).
- Extract CollapsibleConfigSection; unify Quiz / Math Animator / Visualize
  / Deep Research panels behind one collapsed-summary header.
- Replace streaming spinner with a dedicated Stop button; persistent
  composer header; mask-gradient on messages container.
- TutorBotManager: public load/save/merge API; atomic write via temp +
  Path.replace; merge_bot_config with explicit-clear semantics; new
  tests/services/tutorbot/test_manager_config.py.
- MarkdownRenderer: trackSourceLines passes data-source-line through;
  RichCodeBlock skips Prism for unlabeled/plaintext fences; mermaid
  detection includes flow/seq/sequence editor.md fences.
- UI/theme: deeper foregrounds + warmer borders for light/Snow themes;
  /guide migrated off hardcoded slate/indigo to design tokens;
  HistorySessionPicker themed and timestamp-seconds bug fixed.
- Filter system messages out of UnifiedChatContext.hydrateMessages and
  ChatMessageList so backend grounding context never renders as a bubble.
- Bug fixes (already merged earlier in dev):
  * tutorbot config wipe on restart (#332)
  * selective_access_log middleware unpack crash (#334/#335)
  * 15 npm security vulnerabilities — jspdf/next/mermaid (#330)
- Drive-by: remove "// README" typo from .env.example_CN.
- Add v1.1.1 release notes and update README.

Made-with: Cursor
2026-04-17 22:43:52 +08:00
Bingxi Zhao (Frank)
727d49cf8b release: v1.1.0 — LaTeX parsing overhaul, LLM probe config, extra_headers fix, notebook UUID fix
- Rewrite LaTeX block math normalization with heuristic-based $→$$ promotion
- Move LLM diagnostic probe max_tokens from env var to agents.yaml
- Fix extra_headers merge in LLM factory complete/stream (prevents TypeError)
- Fix SaveToNotebookModal to use notebook UUIDs instead of category IDs (#301)
- Add Docker + local LLM (host.docker.internal) guidance in env/compose files
- Add tests: LaTeX, notebook router, summarize agent, LLM probe, extra_headers
- Add v1.1.0 release notes and update README

Made-with: Cursor
2026-04-15 02:15:19 +08:00
Bingxi Zhao (Frank)
9544075d60 v1.1.0-beta
URL-based chat routing, Snow theme, WebSocket heartbeat & auto-reconnect,
ChatComposer perf optimization, embedding provider registry overhaul,
Serper search provider, streaming idle timeout, and expanded test suite.

Made-with: Cursor
2026-04-14 22:11:48 +08:00
jiakeboge
5f0553e3e9 perf(web): fix severe input lag in long conversations (#317)
- Memoize ChatMessageList, UserMessage, and ReferenceChips components.
- Stabilize onRetryMessage callback using useCallback in HomePage.
- Prevent unnecessary re-renders of the entire message history during text input.
2026-04-14 20:10:08 +08:00
Bingxi Zhao (Frank)
8659d996f5 v1.0.3
Question Notebook with bookmarks & categories, Mermaid diagram support
in Visualize, embedding mismatch detection refinement, system message
merging for Qwen/vLLM, LM Studio & llama.cpp providers, Glass theme,
reporting agent retry resilience, and docs migration.

Made-with: Cursor
2026-04-13 03:18:26 +08:00
cskwork
95b0609605 feat: add wrong-answer note for cross-session quiz review
Persist structured quiz mistakes on submission and expose them in a
new review page accessible from the utility sidebar.

Backend:
- New wrong_answers SQLite table (cascade on session delete) with
  add/list/count/update/delete store methods
- Hook POST /api/v1/sessions/{id}/quiz-results to also insert one row
  per incorrect answer, preserving the existing [Quiz Performance]
  text message consumed by the LLM context builder
- New GET /api/v1/wrong-answers (resolved filter + pagination),
  PATCH /{id} (resolved toggle), DELETE /{id}

Frontend:
- New /wrong-answers page under the (utility) route group with
  unresolved/all filter, mark-as-resolved, delete, and session link
- Sidebar nav entry using the NotebookPen icon
- English and Chinese i18n strings for all new UI text

Tests:
- 8 store tests covering filter, cascade, resolved toggle, delete
- 6 router tests including a regression test that record_quiz_results
  still writes the [Quiz Performance] text message
2026-04-12 00:40:06 +09:00
Bingxi Zhao (Frank)
5384224932 fix: leakage repair 2026-04-11 12:23:32 +08:00
Bingxi Zhao (Frank)
445e7622e9 fix: docker, chat with refs 2026-04-10 22:54:58 +08:00
Bingxi Zhao (Frank)
df844b8216 feat: add visualize capability with Chart.js/SVG rendering pipeline
- Add visualize agent pipeline (analysis → code generation → review)
- Add VisualizeCapability with request config and registry wiring
- Add frontend VisualizeConfigPanel, VisualizationViewer components
- Add chart.js and react-chartjs-2 dependencies
- Improve math_animator YON_IMAGE anchor block prompts (en/zh)
- Add minimax model override (supports_response_format: false)
- Suppress noisy uvicorn WebSocket connection logs
- Add selective HTTP access logging middleware (non-200 only)

Made-with: Cursor
2026-04-10 20:09:36 +08:00
Bingxi Zhao (Frank)
5960fbc0f7 refactor: remove litellm dependency, align provider architecture
- Replace litellm with native openai + anthropic SDKs across both
  services and tutorbot layers
- Add 5 new providers: mistral, stepfun, xiaomi_mimo, qianfan, ovms
- Add `backend` field to ProviderSpec for SDK routing
- New TutorBot OpenAICompatProvider (openai SDK) and AnthropicProvider
  (anthropic SDK), replacing LiteLLMProvider
- Rewrite services/llm/executors.py to use openai SDK directly
- Remove litellm from factory.py routing, token_tracker, provider_cmd
- Auto-fallback to streaming for tool-call format errors (fixes #265)
- Settings UI: provider dropdown with auto base-url fill
- Clean up litellm from requirements/cli.txt and pyproject.toml

Made-with: Cursor
2026-04-08 19:59:44 +08:00
kevin
7b55f11c7e Fix Windows compatibility for Math Animator renderer
This PR fixes multiple Windows compatibility issues that prevented
the Math Animator from generating videos on Windows systems.

### Changes

1. **renderer.py**: Fix subprocess execution on Windows
   - Replace `asyncio.create_subprocess_exec` with `subprocess.run` + `asyncio.to_thread`
   - The original approach silently fails on Windows when uvicorn uses SelectorEventLoop (default)
   - New approach works regardless of event loop type

2. **code_generator_agent.yaml (en/zh)**: Add Manim v0.20.1 compatibility constraints
   - Prohibit `MarkupText` (requires LaTeX)
   - Prohibit `stroke_dash_pattern` parameter (not supported in v0.20.1)
   - Prohibit `save_state()` method (not supported in MovingCameraScene)
   - Applied to both `generate_system` and `retry_system` sections

3. **ChatComposer.tsx**: Suppress hydration warning for i18n placeholder
   - Add `suppressHydrationWarning` to textarea
   - Resolves SSR/CSR text mismatch warning for language-specific placeholders

### Testing

- ✅ CLI mode: Successfully generated Pythagorean theorem animation (660KB)
- ✅ Web mode: Successfully generated cone cross-section animation
- ✅ Auto-retry: First attempt error → LLM repair → second attempt success

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 22:36:03 +08:00
zzhtx258
58d72b9c22 update 2026-03-29 13:16:14 +08:00
zzhtx258
f04851e536 fix bugs, and enforce math video length 2026-03-22 19:49:14 +08:00
Bingxi Zhao (Frank)
c15e22a4b3 chore: stable fix, add tutorbot 2026-03-20 20:27:17 +08:00
Bingxi Zhao (Frank)
9c18bf0705 codebase cleanup and decoupled, introduce cli operation 2026-03-13 20:42:16 +08:00
Bingxi Zhao (Frank)
91197f3729 chore: deeptutor 2.0 2026-03-13 01:47:38 +08:00
Bingxi Zhao (Frank)
6ff107d960 Merge branch 'dev' into feat/vision_slover 2026-03-09 14:47:53 +08:00
Bingxi Zhao
e1bedcb336 refact solver+questiongen, add base module for personalization 2026-02-12 12:29:16 +08:00