diff --git a/.github/ISSUE_TEMPLATE/docs.yml b/.github/ISSUE_TEMPLATE/docs.yml
index 4a0c9ab5d..ee7f7e3ea 100644
--- a/.github/ISSUE_TEMPLATE/docs.yml
+++ b/.github/ISSUE_TEMPLATE/docs.yml
@@ -1,5 +1,5 @@
name: Documentation Issue
-description: Report an inaccuracy, broken link, missing topic, or unclear explanation in the docs at deeptutor.info
+description: Report an inaccuracy, broken link, missing topic, or unclear explanation in the docs at docs.deeptutor.info
title: "[Docs]: "
labels: ["docs", "triage"]
@@ -10,13 +10,13 @@ body:
label: Before filing
options:
- label: I have searched the existing docs issues and this report is not already filed.
- - label: This is about the docs at https://deeptutor.info — not a product bug.
+ - label: This is about the docs at https://docs.deeptutor.info — not a product bug.
- type: input
id: page
attributes:
label: Page URL
description: Which page does the issue affect?
- placeholder: https://deeptutor.info/docs/...
+ placeholder: https://docs.deeptutor.info/...
validations:
required: true
- type: dropdown
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
new file mode 100644
index 000000000..b2e12a22d
--- /dev/null
+++ b/.github/workflows/docs.yml
@@ -0,0 +1,61 @@
+name: Docs
+
+on:
+ push:
+ branches:
+ - main
+ - dev
+ - preview
+ paths:
+ - "docs/**"
+ - "deeptutor/modules/manifests/**"
+ - "deeptutor/api/router_index.json"
+ - "assets/figs/web-dev/**"
+ - ".github/workflows/docs.yml"
+ pull_request:
+ paths:
+ - "docs/**"
+ - "deeptutor/modules/manifests/**"
+ - "deeptutor/api/router_index.json"
+ - "assets/figs/web-dev/**"
+ - ".github/workflows/docs.yml"
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ docs:
+ name: Build and check the docs site
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: docs
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: "22"
+ cache: npm
+ cache-dependency-path: docs/package-lock.json
+
+ - name: Check sources
+ working-directory: .
+ run: python3 docs/scripts/check_docs.py
+
+ - name: Install and build
+ run: npm ci
+ env:
+ ASTRO_TELEMETRY_DISABLED: "1"
+
+ - name: Build
+ run: npm run build
+ env:
+ ASTRO_TELEMETRY_DISABLED: "1"
+
+ - name: Check built links
+ working-directory: .
+ run: python3 docs/scripts/check_docs.py dist
diff --git a/docs/README.md b/docs/README.md
index 295fd8db2..af8d323d3 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,127 +1,152 @@
# DeepTutor Documentation
-This directory contains the public DeepTutor documentation site (`docs.deeptutor.info`), built with [Astro](https://astro.build/) and [Starlight](https://starlight.astro.build/).
+Public documentation for DeepTutor, published at [https://docs.deeptutor.info](https://docs.deeptutor.info). The site is Astro and Starlight. This file is the authoring guide for `docs/`.
-## Stack
+Three sites stay separate:
-- Astro + Starlight
-- English source locale at `/` (`src/content/docs/`)
-- Simplified Chinese mirror at `/zh-cn/` (`src/content/docs/zh-cn/`)
-- Static screenshots and icons in `public/`
+| Surface | Role |
+| --- | --- |
+| `docs/` | This site. End users, self-hosters, and integrators. |
+| [deeptutor.info](https://deeptutor.info/) | Marketing site. Its source is not in this repository. The docs homepage reproduces that landing. |
+| `docs-for-dev/` | Internal notes. Unpublished, and not linked from the sidebar. A public page may link to a file on GitHub when the reader needs the internal manual. |
-## Local Development
+The repository root `README.md` is the GitHub project page. It is not the source of truth for this site.
-```bash
-cd docs
-npm install
-npm run dev
-```
+## Design
-Build the static site:
+Organize pages by what the reader is trying to do, then by product area. Diátaxis decides the job of a page. The quadrant name never appears in a folder, a slug, or a sidebar label.
-```bash
-npm run build
-```
-
-Preview the built output:
-
-```bash
-npm run preview
-```
-
-## Documentation Layout
-
-```text
-src/content/docs/ # English docs (root locale /)
-src/content/docs/zh-cn/ # Simplified Chinese docs (locale /zh-cn/)
-astro.config.mjs # Starlight config, sidebar, redirects, i18n
-src/content.config.ts # docs schema, including the quadrant field
-src/components/ # Custom header / social icon components
-src/styles/ # Global & Starlight theme styles
-public/screenshots/ # Documentation screenshots
-```
-
-When adding a docs page, add both locale files in the same relative path. Example:
-
-```text
-src/content/docs/partners/channels.md
-src/content/docs/zh-cn/partners/channels.md
-```
-
-Then add a sidebar item in `astro.config.mjs` with a Chinese translation label.
-
-The public site stays English and Simplified Chinese. Sidebar groups follow product areas (Get started, Learning workspace, Multimodal studio, Customize, Channels, Self-hosting, Developers). Page slugs stay on their current paths until a later directory move; the sidebar already hangs existing pages under those groups.
-
-## Diátaxis quadrant
-
-Every page except the splash homepage (`index.mdx`) sets exactly one `quadrant` in frontmatter:
+Every page except the splash homepage sets exactly one `quadrant` in frontmatter:
| Value | Job |
| --- | --- |
-| `tutorial` | One shortest path to a first success. No alternate install or feature branches. |
-| `how-to` | Steps for one task. Link out for theory and parameter lists. |
+| `tutorial` | The shortest path to a first success. One path, with no alternate install or feature branches in the body. |
+| `how-to` | Steps for one task. Link out for theory and for parameter lists. |
| `reference` | Parameters, schemas, and catalogs. Prefer a code source over a second prose copy. |
| `explanation` | How a design fits together. No procedures. |
-Do not put the quadrant name in the sidebar label or the folder name. The homepage is the only page without the field.
+The homepage is `template: splash` and omits `quadrant`. Welcome (`welcome.mdx`) is an explanation page and is the front door of the documentation. Its cards follow one concrete task each: a title, one sentence, and a link to the page that finishes that task.
-## Current Docs Map
+### Install paths
-Sidebar groups and the paths they currently open:
+Desktop is the only default install tutorial (`get-started/desktop/`). Docker is a second, independent tutorial (`get-started/docker/`) and stops at the first successful run. Host folders, reverse proxies, local models, and upgrades live on the self-hosting operations page.
-- **Get started** — `get-started/` including Desktop quickstart and Changelog. Docker still opens the existing install page.
-- **Learning workspace** — `explore/` study pages (Chat, practice, mastery, knowledge, books, reading, notebook, memory).
-- **Multimodal studio** — generation still opens Chat until dedicated guides exist.
-- **Customize** — `explore/personalization`, `explore/subagents`, and `ecosystem/`.
-- **Channels** — `explore/partners`, `partners/`, with domestic and international IM grouped in the sidebar.
-- **Self-hosting** — PyPI, source, CLI-only, multi-user, settings, troubleshooting.
-- **Developers** — `cli/` and `contributing.md`.
+PyPI, source, CLI-only, multi-user, and troubleshooting are self-hosting how-tos. `get-started/` explains the choice among those paths and links to them. It does not repeat their steps.
-## Screenshot Policy
+### Homepage
-Prefer screenshots synced from canonical assets or freshly captured from a running local DeepTutor UI using synthetic demo data (never personal history, credentials, or private paths). Keep docs references under `/screenshots/...` and verify the files exist before building.
+`src/components/HomeLanding.astro` renders the marketing landing for both locales: navigation, hero, product shot, eight places, and four install tabs in this order: PyPI, Docker, source, CLI. Both `index.mdx` files import that component and do not set Starlight `hero` frontmatter.
-## Checks
+The Docs button and the Docs nav item open Welcome (`/welcome/` and `/zh-cn/welcome/`). Eight-place and footer links use the current docs slugs. Community and Collaborate stay on deeptutor.info. `src/styles/landing.css` hides the Starlight header, sidebar, and the splash `
`. Hide that heading, not the content panel that contains the landing.
-Before opening a PR, run from `docs/`:
+### Product areas
+
+Sidebar groups are product areas. Add a page under the area that owns the task, with a `zh-CN` label.
+
+| Group | Slug | What belongs here |
+| --- | --- | --- |
+| Get started | `welcome/`, `get-started/` | Welcome, install choices, Desktop, Docker, providers, changelog |
+| Learning workspace | `learning-workspace/` | Chat, agent loop, Vision Solver, questions, mastery, knowledge, books, reading, research, notebook, resources, calendar, memory |
+| Multimodal studio | `multimodal-studio/` | Which generator to use, Visualize, Math Animator, Video Lesson |
+| Customize | `customize/` | Personas, skills, MCP, CLI apps, EduHub, agents, RAG |
+| Channels | `channels/` | Create a partner, channel schema, domestic IM, international IM |
+| Self-hosting | `self-hosting/` | Runtime home, PyPI, source, Docker operations, CLI-only, multi-user, Codex sign-in, desktop editions, settings, configuration files, troubleshooting |
+| Developers | `developers/` | Architecture, CLI guides, capabilities, command reference, turn protocol, HTTP API |
+
+Home, Learning, and Resources follow the active workspace. Partners and Personalization belong to the account. Say that when a page could mix the two.
+
+Settings in the product are **Settings → Models & services**. Configuration lives in `data/user/settings/*.json`. Process environment variables override only a few startup values. `.env.example` documents Podman host ports, not application settings.
+
+Desktop data and logs:
+
+| | macOS | Windows |
+| --- | --- | --- |
+| Data | `~/Library/Application Support/Open DeepTutor/workspace/data` | `%LOCALAPPDATA%\Open DeepTutor\workspace\data` |
+| Logs | `~/Library/Application Support/Open DeepTutor/logs/runtime.log` | `%LOCALAPPDATA%\Open DeepTutor\logs\runtime.log` |
+
+Public download links use the unversioned files on the latest GitHub Release. Packaging and signing stay in `apps/desktop/README.md`.
+
+The changelog page keeps the five newest user-visible releases. Older notes point at GitHub Releases and `assets/releases/`.
+
+### Reference that follows code
+
+Hand-write a reference page when the prose is the guide. Generate or check it when the page would drift from code:
+
+- `docs/scripts/generate_reference.py` rewrites the capability table and appends the HTTP route index from `deeptutor/modules/manifests/*.json` and `deeptutor/api/router_index.json`. Run it after those sources change, then commit the generated Markdown.
+- `channels/schema.md` stays hand-written in both locales. `check_docs.py` requires every config field declared under `deeptutor/partners/channels` to appear in the matching section. Channel how-tos describe the platform steps and link here for fields.
+
+Keep one primary job per page. Move content to the successor page before deleting the old one, and add a redirect.
+
+## Languages
+
+English is the source locale at `/`. Simplified Chinese is the mirror at `/zh-cn/`, with the same relative path. Other README languages do not get Starlight locales.
+
+Add both files together:
+
+```text
+src/content/docs/learning-workspace/chat.md
+src/content/docs/zh-cn/learning-workspace/chat.md
+```
+
+Starlight rewrites Markdown links between locales. It does not rewrite `href` values in MDX or Astro components. Chinese `LinkCard`, hero actions, and landing links must start with `/zh-cn/`.
+
+Quote a frontmatter `description` that contains a colon.
+
+## Layout
+
+```text
+src/content/docs/ English pages
+src/content/docs/zh-cn/ Simplified Chinese pages
+src/components/ HomeLanding, header, social icons
+src/styles/ global.css, starlight.css, landing.css
+public/screenshots/dev/ Product screenshots and their manifest
+astro.config.mjs Locales, sidebar, redirects
+src/content.config.ts Docs schema, including quadrant
+scripts/check_docs.py Locale, quadrant, screenshot, channel, and link checks
+scripts/generate_reference.py
+```
+
+When a slug moves, add both `/old/` and `/zh-cn/old/` to `redirects` in `astro.config.mjs`, pointing at the final slug. Prefer that final slug in new links. Do not rewrite a short fragment such as `/partners/` across the tree; it also appears inside paths like `data/partners/`.
+
+Legacy `/explore/`, `/ecosystem/`, `/partners/`, `/tutorbot/`, `/cli/`, and `/contributing/` URLs already redirect. Leave the pre-existing `/docs` redirect conflict alone.
+
+## Screenshots
+
+Use `public/screenshots/dev/` and refer to files as `/screenshots/dev/.png`. Images that also exist in `assets/figs/web-dev/` must keep that manifest's SHA-256. Capture new shots from a local DeepTutor UI with synthetic demo data. Do not include personal history, credentials, or private paths.
+
+## Local development
+
+Use Node.js 22, the version CI installs.
+
+```bash
+cd docs
+npm ci
+npm run dev
+```
+
+Build and preview:
```bash
npm run build
+npm run preview
```
-And check EN / ZH locale parity from the repository root:
+Set `ASTRO_TELEMETRY_DISABLED=1` if the Astro telemetry directory cannot be created.
+
+## Checks
+
+From the repository root, before opening a PR:
```bash
-python3 - <<'PY'
-from pathlib import Path
-root = Path('docs/src/content/docs')
-
-def pages(base: Path):
- found = set()
- for pattern in ('*.md', '*.mdx'):
- for path in base.rglob(pattern):
- rel = path.relative_to(base).as_posix()
- if rel.startswith('zh-cn/'):
- continue
- found.add(rel)
- return found
-
-en = pages(root)
-zh = pages(root / 'zh-cn')
-print('only_en', sorted(en - zh))
-print('only_zh', sorted(zh - en))
-
-missing_quadrant = []
-for path in list(root.rglob('*.md')) + list(root.rglob('*.mdx')):
- rel = path.relative_to(root).as_posix()
- if rel in {'index.mdx', 'zh-cn/index.mdx'}:
- continue
- text = path.read_text(encoding='utf-8')
- end = text.find('\n---', 3)
- if 'quadrant:' not in text[:end]:
- missing_quadrant.append(rel)
-print('missing_quadrant', missing_quadrant)
-PY
+python3 docs/scripts/check_docs.py
+cd docs && ASTRO_TELEMETRY_DISABLED=1 npm run build && cd ..
+python3 docs/scripts/check_docs.py dist
```
-Both lists should be empty; otherwise language switching can fall back to the wrong locale.
+`check_docs.py` checks that English and Chinese paths match, that every page except the splash homepage has `quadrant`, that copied screenshots match `assets/figs/web-dev/manifest.json`, and that channel schema pages name the source fields. `dist` also checks that internal links in the built HTML resolve. GitHub Actions runs the same steps in `.github/workflows/docs.yml`.
+
+After changing a module manifest or `router_index.json`:
+
+```bash
+python3 docs/scripts/generate_reference.py
+```
diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs
index 5d940f8ed..bf061c434 100644
--- a/docs/astro.config.mjs
+++ b/docs/astro.config.mjs
@@ -10,36 +10,144 @@ const zh = "zh-CN";
export default defineConfig({
site: "https://docs.deeptutor.info",
redirects: {
- "/developer/contributing/": "/contributing/",
- "/zh-cn/developer/contributing/": "/zh-cn/contributing/",
- "/tutorbot/": "/partners/",
- "/tutorbot/discord/": "/partners/discord/",
- "/tutorbot/slack/": "/partners/slack/",
- "/tutorbot/telegram/": "/partners/telegram/",
- "/tutorbot/whatsapp/": "/partners/whatsapp/",
- "/tutorbot/wecom/": "/partners/wecom/",
- "/tutorbot/feishu/": "/partners/feishu/",
- "/tutorbot/dingtalk/": "/partners/dingtalk/",
- "/tutorbot/qq/": "/partners/qq/",
- "/tutorbot/mattermost/": "/partners/mattermost/",
- "/tutorbot/matrix/": "/partners/matrix/",
- "/tutorbot/zulip/": "/partners/zulip/",
- "/tutorbot/mochat/": "/partners/mochat/",
- "/zh-cn/tutorbot/": "/zh-cn/partners/",
- "/zh-cn/tutorbot/discord/": "/zh-cn/partners/discord/",
- "/zh-cn/tutorbot/slack/": "/zh-cn/partners/slack/",
- "/zh-cn/tutorbot/telegram/": "/zh-cn/partners/telegram/",
- "/zh-cn/tutorbot/whatsapp/": "/zh-cn/partners/whatsapp/",
- "/zh-cn/tutorbot/wecom/": "/zh-cn/partners/wecom/",
- "/zh-cn/tutorbot/feishu/": "/zh-cn/partners/feishu/",
- "/zh-cn/tutorbot/dingtalk/": "/zh-cn/partners/dingtalk/",
- "/zh-cn/tutorbot/qq/": "/zh-cn/partners/qq/",
- "/zh-cn/tutorbot/mattermost/": "/zh-cn/partners/mattermost/",
- "/zh-cn/tutorbot/matrix/": "/zh-cn/partners/matrix/",
- "/zh-cn/tutorbot/zulip/": "/zh-cn/partners/zulip/",
- "/zh-cn/tutorbot/mochat/": "/zh-cn/partners/mochat/",
- "/explore/extensions/": "/ecosystem/",
- "/zh-cn/explore/extensions/": "/zh-cn/ecosystem/",
+ "/tutorbot/": "/channels/",
+ "/tutorbot/discord/": "/channels/international/discord/",
+ "/tutorbot/slack/": "/channels/international/slack/",
+ "/tutorbot/telegram/": "/channels/international/telegram/",
+ "/tutorbot/whatsapp/": "/channels/international/whatsapp/",
+ "/tutorbot/wecom/": "/channels/domestic/wecom/",
+ "/tutorbot/feishu/": "/channels/domestic/feishu/",
+ "/tutorbot/dingtalk/": "/channels/domestic/dingtalk/",
+ "/tutorbot/qq/": "/channels/domestic/qq/",
+ "/tutorbot/mattermost/": "/channels/international/mattermost/",
+ "/tutorbot/matrix/": "/channels/international/matrix/",
+ "/tutorbot/zulip/": "/channels/international/zulip/",
+ "/tutorbot/mochat/": "/channels/domestic/mochat/",
+ "/zh-cn/tutorbot/": "/zh-cn/channels/",
+ "/zh-cn/tutorbot/discord/": "/zh-cn/channels/international/discord/",
+ "/zh-cn/tutorbot/slack/": "/zh-cn/channels/international/slack/",
+ "/zh-cn/tutorbot/telegram/": "/zh-cn/channels/international/telegram/",
+ "/zh-cn/tutorbot/whatsapp/": "/zh-cn/channels/international/whatsapp/",
+ "/zh-cn/tutorbot/wecom/": "/zh-cn/channels/domestic/wecom/",
+ "/zh-cn/tutorbot/feishu/": "/zh-cn/channels/domestic/feishu/",
+ "/zh-cn/tutorbot/dingtalk/": "/zh-cn/channels/domestic/dingtalk/",
+ "/zh-cn/tutorbot/qq/": "/zh-cn/channels/domestic/qq/",
+ "/zh-cn/tutorbot/mattermost/": "/zh-cn/channels/international/mattermost/",
+ "/zh-cn/tutorbot/matrix/": "/zh-cn/channels/international/matrix/",
+ "/zh-cn/tutorbot/zulip/": "/zh-cn/channels/international/zulip/",
+ "/zh-cn/tutorbot/mochat/": "/zh-cn/channels/domestic/mochat/",
+ "/explore/extensions/": "/customize/",
+ "/zh-cn/explore/extensions/": "/zh-cn/customize/",
+ "/ecosystem/rag-integration/": "/customize/rag/",
+ "/zh-cn/ecosystem/rag-integration/": "/zh-cn/customize/rag/",
+ "/explore/personalization/": "/customize/",
+ "/zh-cn/explore/personalization/": "/zh-cn/customize/",
+ "/explore/chat-workspace/": "/learning-workspace/chat/",
+ "/zh-cn/explore/chat-workspace/": "/zh-cn/learning-workspace/chat/",
+ "/explore/mastery-path/": "/learning-workspace/mastery/",
+ "/zh-cn/explore/mastery-path/": "/zh-cn/learning-workspace/mastery/",
+ "/partners/mattermost/": "/channels/international/mattermost/",
+ "/zh-cn/partners/mattermost/": "/zh-cn/channels/international/mattermost/",
+ "/explore/task-board/": "/learning-workspace/task-board/",
+ "/zh-cn/explore/task-board/": "/zh-cn/learning-workspace/task-board/",
+ "/explore/workspaces/": "/learning-workspace/workspaces/",
+ "/zh-cn/explore/workspaces/": "/zh-cn/learning-workspace/workspaces/",
+ "/ecosystem/cli-apps/": "/customize/cli-apps/",
+ "/zh-cn/ecosystem/cli-apps/": "/zh-cn/customize/cli-apps/",
+ "/explore/co-writer/": "/learning-workspace/notebook/",
+ "/zh-cn/explore/co-writer/": "/zh-cn/learning-workspace/notebook/",
+ "/explore/subagents/": "/customize/agents/",
+ "/zh-cn/explore/subagents/": "/zh-cn/customize/agents/",
+ "/explore/knowledge/": "/learning-workspace/knowledge/",
+ "/zh-cn/explore/knowledge/": "/zh-cn/learning-workspace/knowledge/",
+ "/explore/favorites/": "/learning-workspace/favorites/",
+ "/zh-cn/explore/favorites/": "/zh-cn/learning-workspace/favorites/",
+ "/partners/channels/": "/channels/schema/",
+ "/zh-cn/partners/channels/": "/zh-cn/channels/schema/",
+ "/partners/dingtalk/": "/channels/domestic/dingtalk/",
+ "/zh-cn/partners/dingtalk/": "/zh-cn/channels/domestic/dingtalk/",
+ "/partners/telegram/": "/channels/international/telegram/",
+ "/zh-cn/partners/telegram/": "/zh-cn/channels/international/telegram/",
+ "/partners/whatsapp/": "/channels/international/whatsapp/",
+ "/zh-cn/partners/whatsapp/": "/zh-cn/channels/international/whatsapp/",
+ "/explore/settings/": "/self-hosting/settings/",
+ "/zh-cn/explore/settings/": "/zh-cn/self-hosting/settings/",
+ "/explore/calendar/": "/learning-workspace/calendar/",
+ "/zh-cn/explore/calendar/": "/zh-cn/learning-workspace/calendar/",
+ "/explore/partners/": "/channels/",
+ "/zh-cn/explore/partners/": "/zh-cn/channels/",
+ "/explore/practice/": "/learning-workspace/questions/",
+ "/zh-cn/explore/practice/": "/zh-cn/learning-workspace/questions/",
+ "/explore/learning/": "/learning-workspace/",
+ "/zh-cn/explore/learning/": "/zh-cn/learning-workspace/",
+ "/ecosystem/skills/": "/customize/skills/",
+ "/zh-cn/ecosystem/skills/": "/zh-cn/customize/skills/",
+ "/ecosystem/eduhub/": "/customize/eduhub/",
+ "/zh-cn/ecosystem/eduhub/": "/zh-cn/customize/eduhub/",
+ "/partners/discord/": "/channels/international/discord/",
+ "/zh-cn/partners/discord/": "/zh-cn/channels/international/discord/",
+ "/partners/msteams/": "/channels/international/msteams/",
+ "/zh-cn/partners/msteams/": "/zh-cn/channels/international/msteams/",
+ "/explore/reading/": "/learning-workspace/reading/",
+ "/zh-cn/explore/reading/": "/zh-cn/learning-workspace/reading/",
+ "/partners/weixin/": "/channels/domestic/weixin/",
+ "/zh-cn/partners/weixin/": "/zh-cn/channels/domestic/weixin/",
+ "/partners/feishu/": "/channels/domestic/feishu/",
+ "/zh-cn/partners/feishu/": "/zh-cn/channels/domestic/feishu/",
+ "/partners/mochat/": "/channels/domestic/mochat/",
+ "/zh-cn/partners/mochat/": "/zh-cn/channels/domestic/mochat/",
+ "/partners/matrix/": "/channels/international/matrix/",
+ "/zh-cn/partners/matrix/": "/zh-cn/channels/international/matrix/",
+ "/explore/memory/": "/learning-workspace/memory/",
+ "/zh-cn/explore/memory/": "/zh-cn/learning-workspace/memory/",
+ "/partners/wecom/": "/channels/domestic/wecom/",
+ "/zh-cn/partners/wecom/": "/zh-cn/channels/domestic/wecom/",
+ "/partners/slack/": "/channels/international/slack/",
+ "/zh-cn/partners/slack/": "/zh-cn/channels/international/slack/",
+ "/partners/zulip/": "/channels/international/zulip/",
+ "/zh-cn/partners/zulip/": "/zh-cn/channels/international/zulip/",
+ "/partners/email/": "/channels/international/email/",
+ "/zh-cn/partners/email/": "/zh-cn/channels/international/email/",
+ "/explore/space/": "/learning-workspace/resources/",
+ "/zh-cn/explore/space/": "/zh-cn/learning-workspace/resources/",
+ "/ecosystem/mcp/": "/customize/mcp/",
+ "/zh-cn/ecosystem/mcp/": "/zh-cn/customize/mcp/",
+ "/explore/book/": "/learning-workspace/books/",
+ "/zh-cn/explore/book/": "/zh-cn/learning-workspace/books/",
+ "/partners/qq/": "/channels/domestic/qq/",
+ "/zh-cn/partners/qq/": "/zh-cn/channels/domestic/qq/",
+ "/explore/": "/learning-workspace/",
+ "/zh-cn/explore/": "/zh-cn/learning-workspace/",
+ "/ecosystem/": "/customize/",
+ "/zh-cn/ecosystem/": "/zh-cn/customize/",
+ "/partners/": "/channels/",
+ "/zh-cn/partners/": "/zh-cn/channels/",
+ "/get-started/pypi/": "/self-hosting/pypi/",
+ "/zh-cn/get-started/pypi/": "/zh-cn/self-hosting/pypi/",
+ "/get-started/from-source/": "/self-hosting/source/",
+ "/zh-cn/get-started/from-source/": "/zh-cn/self-hosting/source/",
+ "/get-started/cli-only/": "/self-hosting/cli-only/",
+ "/zh-cn/get-started/cli-only/": "/zh-cn/self-hosting/cli-only/",
+ "/get-started/multi-user/": "/self-hosting/multi-user/",
+ "/zh-cn/get-started/multi-user/": "/zh-cn/self-hosting/multi-user/",
+ "/get-started/troubleshooting/": "/self-hosting/troubleshooting/",
+ "/zh-cn/get-started/troubleshooting/": "/zh-cn/self-hosting/troubleshooting/",
+ "/cli/commands/": "/developers/reference/cli/",
+ "/zh-cn/cli/commands/": "/zh-cn/developers/reference/cli/",
+ "/cli/chat-repl/": "/developers/guides/repl/",
+ "/zh-cn/cli/chat-repl/": "/zh-cn/developers/guides/repl/",
+ "/cli/python-sdk/": "/developers/guides/sdk/",
+ "/zh-cn/cli/python-sdk/": "/zh-cn/developers/guides/sdk/",
+ "/cli/agent-handoff/": "/developers/guides/agent-handoff/",
+ "/zh-cn/cli/agent-handoff/": "/zh-cn/developers/guides/agent-handoff/",
+ "/cli/server-api/": "/developers/reference/http-api/",
+ "/zh-cn/cli/server-api/": "/zh-cn/developers/reference/http-api/",
+ "/cli/": "/developers/guides/cli/",
+ "/zh-cn/cli/": "/zh-cn/developers/guides/cli/",
+ "/contributing/": "/developers/guides/contributing/",
+ "/zh-cn/contributing/": "/zh-cn/developers/guides/contributing/",
+ "/developer/contributing/": "/developers/guides/contributing/",
+ "/zh-cn/developer/contributing/": "/zh-cn/developers/guides/contributing/",
// 旧的 /docs/* 路径(拆站前)整体回到根
"/docs": "/",
"/docs/[...slug]": "/[...slug]",
@@ -58,7 +166,11 @@ export default defineConfig({
src: "./src/assets/logo.png",
replacesTitle: false,
},
- customCss: ["./src/styles/global.css", "./src/styles/starlight.css"],
+ customCss: [
+ "./src/styles/global.css",
+ "./src/styles/starlight.css",
+ "./src/styles/landing.css",
+ ],
components: {
SiteTitle: "./src/components/SiteTitle.astro",
SocialIcons: "./src/components/SocialIcons.astro",
@@ -75,12 +187,13 @@ export default defineConfig({
href: "https://discord.gg/eRsjPgMU4t",
},
],
- // Product-domain groups. Slugs stay on current paths until the directory move.
+ // Product-domain groups. Legacy paths redirect to these slugs.
sidebar: [
{
label: "Get started",
translations: { "zh-CN": "从这里开始" },
items: [
+ { label: "Welcome", translations: { "zh-CN": "欢迎" }, slug: "welcome" },
{ label: "Install choices", translations: { "zh-CN": "安装方式" }, slug: "get-started" },
{ label: "Desktop", translations: { "zh-CN": "桌面端" }, slug: "get-started/desktop" },
{ label: "Docker", translations: { "zh-CN": "Docker" }, slug: "get-started/docker" },
@@ -92,80 +205,82 @@ export default defineConfig({
label: "Learning workspace",
translations: { "zh-CN": "学习工作区" },
items: [
- { label: "A first study session", translations: { "zh-CN": "串起一次完整学习" }, slug: "explore" },
- { label: "Workspaces", translations: { "zh-CN": "工作区" }, slug: "explore/workspaces" },
- { label: "Chat", translations: { "zh-CN": "对话" }, slug: "explore/chat-workspace" },
- { label: "Questions & practice", translations: { "zh-CN": "出题与练习" }, slug: "explore/practice" },
- { label: "Mastery Path", translations: { "zh-CN": "精通之路" }, slug: "explore/mastery-path" },
- { label: "Knowledge", translations: { "zh-CN": "知识库" }, slug: "explore/knowledge" },
- { label: "Books", translations: { "zh-CN": "书籍" }, slug: "explore/book" },
- { label: "Immersive Reading", translations: { "zh-CN": "沉浸式阅读" }, slug: "explore/reading" },
- { label: "Notebook", translations: { "zh-CN": "笔记本" }, slug: "explore/co-writer" },
- { label: "Favorites", translations: { "zh-CN": "收藏夹" }, slug: "explore/favorites" },
- { label: "Resources", translations: { "zh-CN": "资料" }, slug: "explore/space" },
- { label: "Task Board", translations: { "zh-CN": "任务看板" }, slug: "explore/task-board" },
- { label: "Calendar", translations: { "zh-CN": "日历" }, slug: "explore/calendar" },
- { label: "Memory", translations: { "zh-CN": "记忆" }, slug: "explore/memory" },
- { label: "Choose a learning method", translations: { "zh-CN": "选择学习方式" }, slug: "explore/learning" },
+ { label: "A first study session", translations: { "zh-CN": "串起一次完整学习" }, slug: "learning-workspace" },
+ { label: "Workspaces", translations: { "zh-CN": "工作区" }, slug: "learning-workspace/workspaces" },
+ { label: "Chat", translations: { "zh-CN": "对话" }, slug: "learning-workspace/chat" },
+ { label: "How the agent loop works", translations: { "zh-CN": "智能体循环" }, slug: "learning-workspace/agent-loop" },
+ { label: "Vision Solver", translations: { "zh-CN": "视觉解题" }, slug: "learning-workspace/vision-solver" },
+ { label: "Questions & practice", translations: { "zh-CN": "出题与练习" }, slug: "learning-workspace/questions" },
+ { label: "Mastery Path", translations: { "zh-CN": "精通之路" }, slug: "learning-workspace/mastery" },
+ { label: "Knowledge", translations: { "zh-CN": "知识库" }, slug: "learning-workspace/knowledge" },
+ { label: "Books", translations: { "zh-CN": "书籍" }, slug: "learning-workspace/books" },
+ { label: "Immersive Reading", translations: { "zh-CN": "沉浸式阅读" }, slug: "learning-workspace/reading" },
+ { label: "Research", translations: { "zh-CN": "深度研究" }, slug: "learning-workspace/research" },
+ { label: "Notebook", translations: { "zh-CN": "笔记本" }, slug: "learning-workspace/notebook" },
+ { label: "Favorites", translations: { "zh-CN": "收藏夹" }, slug: "learning-workspace/favorites" },
+ { label: "Resources", translations: { "zh-CN": "资料" }, slug: "learning-workspace/resources" },
+ { label: "Task Board", translations: { "zh-CN": "任务看板" }, slug: "learning-workspace/task-board" },
+ { label: "Calendar", translations: { "zh-CN": "日历" }, slug: "learning-workspace/calendar" },
+ { label: "Memory", translations: { "zh-CN": "记忆" }, slug: "learning-workspace/memory" },
],
},
{
label: "Multimodal studio",
translations: { "zh-CN": "多模态工作室" },
items: [
- {
- label: "Generate from Chat",
- translations: { "zh-CN": "在对话里生成" },
- slug: "explore/chat-workspace",
- },
+ { label: "Which generator to use", translations: { "zh-CN": "该用哪种生成" }, slug: "multimodal-studio" },
+ { label: "Visualize", translations: { "zh-CN": "可视化" }, slug: "multimodal-studio/visualize" },
+ { label: "Math Animator", translations: { "zh-CN": "数学动画" }, slug: "multimodal-studio/math-animator" },
+ { label: "Video Lesson", translations: { "zh-CN": "视频课" }, slug: "multimodal-studio/video-lesson" },
],
},
{
label: "Customize",
translations: { "zh-CN": "定制" },
items: [
- { label: "Personas & account", translations: { "zh-CN": "人格与账号" }, slug: "explore/personalization" },
- { label: "Skills", translations: { "zh-CN": "技能" }, slug: "ecosystem/skills" },
- { label: "MCP services", translations: { "zh-CN": "MCP 服务" }, slug: "ecosystem/mcp" },
- { label: "CLI Apps", translations: { "zh-CN": "CLI 应用" }, slug: "ecosystem/cli-apps" },
- { label: "EduHub", translations: { "zh-CN": "EduHub" }, slug: "ecosystem/eduhub" },
- { label: "My Agents", translations: { "zh-CN": "我的智能体" }, slug: "explore/subagents" },
- { label: "RAG integrations", translations: { "zh-CN": "RAG 集成" }, slug: "ecosystem/rag-integration" },
- { label: "Extension overview", translations: { "zh-CN": "扩展概览" }, slug: "ecosystem" },
+ { label: "Overview", translations: { "zh-CN": "概览" }, slug: "customize" },
+ { label: "Personas", translations: { "zh-CN": "人格" }, slug: "customize/personas" },
+ { label: "Skills", translations: { "zh-CN": "技能" }, slug: "customize/skills" },
+ { label: "MCP services", translations: { "zh-CN": "MCP 服务" }, slug: "customize/mcp" },
+ { label: "CLI Apps", translations: { "zh-CN": "CLI 应用" }, slug: "customize/cli-apps" },
+ { label: "EduHub", translations: { "zh-CN": "EduHub" }, slug: "customize/eduhub" },
+ { label: "My Agents", translations: { "zh-CN": "我的智能体" }, slug: "customize/agents" },
+ { label: "RAG integrations", translations: { "zh-CN": "RAG 集成" }, slug: "customize/rag" },
],
},
{
label: "Channels",
translations: { "zh-CN": "渠道" },
items: [
- { label: "Partners", translations: { "zh-CN": "伙伴" }, slug: "explore/partners" },
- { label: "Create & manage", translations: { "zh-CN": "创建与管理" }, slug: "partners" },
- { label: "Channel matrix", translations: { "zh-CN": "渠道矩阵" }, slug: "partners/channels" },
+ { label: "Create a partner", translations: { "zh-CN": "创建一个伙伴" }, slug: "channels" },
+ { label: "Channel schema", translations: { "zh-CN": "渠道 schema" }, slug: "channels/schema" },
{
label: "Domestic IM",
translations: { "zh-CN": "国内 IM" },
items: [
- { label: "WeChat", translations: { "zh-CN": "个人微信" }, slug: "partners/weixin" },
- { label: "WeCom", translations: { "zh-CN": "企业微信" }, slug: "partners/wecom" },
- { label: "QQ / NapCat", translations: { "zh-CN": "QQ / NapCat" }, slug: "partners/qq" },
- { label: "Feishu / Lark", translations: { "zh-CN": "飞书 / Lark" }, slug: "partners/feishu" },
- { label: "DingTalk", translations: { "zh-CN": "钉钉" }, slug: "partners/dingtalk" },
- { label: "Mochat", translations: { "zh-CN": "Mochat" }, slug: "partners/mochat" },
+ { label: "How to choose", translations: { "zh-CN": "怎么选" }, slug: "channels/domestic" },
+ { label: "WeChat", translations: { "zh-CN": "个人微信" }, slug: "channels/domestic/weixin" },
+ { label: "WeCom", translations: { "zh-CN": "企业微信" }, slug: "channels/domestic/wecom" },
+ { label: "QQ / NapCat", translations: { "zh-CN": "QQ / NapCat" }, slug: "channels/domestic/qq" },
+ { label: "Feishu / Lark", translations: { "zh-CN": "飞书 / Lark" }, slug: "channels/domestic/feishu" },
+ { label: "DingTalk", translations: { "zh-CN": "钉钉" }, slug: "channels/domestic/dingtalk" },
+ { label: "Mochat", translations: { "zh-CN": "Mochat" }, slug: "channels/domestic/mochat" },
],
},
{
label: "International IM",
translations: { "zh-CN": "海外 IM" },
items: [
- { label: "Telegram", translations: { "zh-CN": "Telegram" }, slug: "partners/telegram" },
- { label: "Discord", translations: { "zh-CN": "Discord" }, slug: "partners/discord" },
- { label: "Slack", translations: { "zh-CN": "Slack" }, slug: "partners/slack" },
- { label: "WhatsApp", translations: { "zh-CN": "WhatsApp" }, slug: "partners/whatsapp" },
- { label: "Matrix", translations: { "zh-CN": "Matrix" }, slug: "partners/matrix" },
- { label: "Zulip", translations: { "zh-CN": "Zulip" }, slug: "partners/zulip" },
- { label: "Mattermost", translations: { "zh-CN": "Mattermost" }, slug: "partners/mattermost" },
- { label: "Microsoft Teams", translations: { "zh-CN": "Microsoft Teams" }, slug: "partners/msteams" },
- { label: "Email", translations: { "zh-CN": "邮件" }, slug: "partners/email" },
+ { label: "How to choose", translations: { "zh-CN": "怎么选" }, slug: "channels/international" },
+ { label: "Telegram", translations: { "zh-CN": "Telegram" }, slug: "channels/international/telegram" },
+ { label: "Discord", translations: { "zh-CN": "Discord" }, slug: "channels/international/discord" },
+ { label: "Slack", translations: { "zh-CN": "Slack" }, slug: "channels/international/slack" },
+ { label: "WhatsApp", translations: { "zh-CN": "WhatsApp" }, slug: "channels/international/whatsapp" },
+ { label: "Matrix", translations: { "zh-CN": "Matrix" }, slug: "channels/international/matrix" },
+ { label: "Zulip", translations: { "zh-CN": "Zulip" }, slug: "channels/international/zulip" },
+ { label: "Mattermost", translations: { "zh-CN": "Mattermost" }, slug: "channels/international/mattermost" },
+ { label: "Microsoft Teams", translations: { "zh-CN": "Microsoft Teams" }, slug: "channels/international/msteams" },
+ { label: "Email", translations: { "zh-CN": "邮件" }, slug: "channels/international/email" },
],
},
],
@@ -174,25 +289,33 @@ export default defineConfig({
label: "Self-hosting",
translations: { "zh-CN": "自部署" },
items: [
- { label: "PyPI", translations: { "zh-CN": "PyPI 安装" }, slug: "get-started/pypi" },
- { label: "From source", translations: { "zh-CN": "从源码运行" }, slug: "get-started/from-source" },
- { label: "CLI only", translations: { "zh-CN": "纯 CLI" }, slug: "get-started/cli-only" },
- { label: "Multi-user", translations: { "zh-CN": "多用户部署" }, slug: "get-started/multi-user" },
- { label: "Settings", translations: { "zh-CN": "设置" }, slug: "explore/settings" },
- { label: "Troubleshooting", translations: { "zh-CN": "故障排查" }, slug: "get-started/troubleshooting" },
+ { label: "Runtime home", translations: { "zh-CN": "运行目录" }, slug: "self-hosting" },
+ { label: "PyPI", translations: { "zh-CN": "PyPI 安装" }, slug: "self-hosting/pypi" },
+ { label: "From source", translations: { "zh-CN": "从源码运行" }, slug: "self-hosting/source" },
+ { label: "Docker operations", translations: { "zh-CN": "Docker 运维" }, slug: "self-hosting/docker" },
+ { label: "CLI only", translations: { "zh-CN": "纯 CLI" }, slug: "self-hosting/cli-only" },
+ { label: "Multi-user", translations: { "zh-CN": "多用户部署" }, slug: "self-hosting/multi-user" },
+ { label: "Codex sign-in", translations: { "zh-CN": "Codex 登录" }, slug: "self-hosting/oauth" },
+ { label: "Desktop editions", translations: { "zh-CN": "桌面版本" }, slug: "self-hosting/desktop" },
+ { label: "Settings", translations: { "zh-CN": "设置" }, slug: "self-hosting/settings" },
+ { label: "Configuration files", translations: { "zh-CN": "配置文件" }, slug: "self-hosting/configuration" },
+ { label: "Troubleshooting", translations: { "zh-CN": "故障排查" }, slug: "self-hosting/troubleshooting" },
],
},
{
label: "Developers",
translations: { "zh-CN": "开发者" },
items: [
- { label: "CLI overview", translations: { "zh-CN": "CLI 概览" }, slug: "cli" },
- { label: "Command reference", translations: { "zh-CN": "命令参考" }, slug: "cli/commands" },
- { label: "Interactive REPL", translations: { "zh-CN": "交互式 REPL" }, slug: "cli/chat-repl" },
- { label: "Agent handoff", translations: { "zh-CN": "Agent 交接" }, slug: "cli/agent-handoff" },
- { label: "Python SDK", translations: { "zh-CN": "Python SDK" }, slug: "cli/python-sdk" },
- { label: "Server API", translations: { "zh-CN": "服务端 API" }, slug: "cli/server-api" },
- { label: "Contributing", translations: { "zh-CN": "参与贡献" }, slug: "contributing" },
+ { label: "Architecture", translations: { "zh-CN": "架构" }, slug: "developers/architecture" },
+ { label: "CLI overview", translations: { "zh-CN": "CLI 概览" }, slug: "developers/guides/cli" },
+ { label: "Interactive REPL", translations: { "zh-CN": "交互式 REPL" }, slug: "developers/guides/repl" },
+ { label: "Python SDK", translations: { "zh-CN": "Python SDK" }, slug: "developers/guides/sdk" },
+ { label: "Agent handoff", translations: { "zh-CN": "Agent 交接" }, slug: "developers/guides/agent-handoff" },
+ { label: "Contributing", translations: { "zh-CN": "参与贡献" }, slug: "developers/guides/contributing" },
+ { label: "Capabilities", translations: { "zh-CN": "能力" }, slug: "developers/reference/capabilities" },
+ { label: "Command reference", translations: { "zh-CN": "命令参考" }, slug: "developers/reference/cli" },
+ { label: "Turn protocol", translations: { "zh-CN": "Turn 协议" }, slug: "developers/reference/turn-protocol" },
+ { label: "HTTP API", translations: { "zh-CN": "HTTP API" }, slug: "developers/reference/http-api" },
],
},
],
diff --git a/docs/scripts/check_docs.py b/docs/scripts/check_docs.py
new file mode 100644
index 000000000..9092e1795
--- /dev/null
+++ b/docs/scripts/check_docs.py
@@ -0,0 +1,238 @@
+"""Locale parity, screenshot hashes, channel-schema drift, and built-site link checks."""
+
+from __future__ import annotations
+
+import ast
+import hashlib
+import json
+import re
+import sys
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parents[2]
+CONTENT = ROOT / "docs" / "src" / "content" / "docs"
+PUBLIC = ROOT / "docs" / "public" / "screenshots" / "dev"
+MANIFEST = ROOT / "assets" / "figs" / "web-dev" / "manifest.json"
+DIST = ROOT / "docs" / "dist"
+CHANNELS = ROOT / "deeptutor" / "partners" / "channels"
+CHANNEL_SCHEMA = ROOT / "deeptutor" / "partners" / "config" / "schema.py"
+HREF = re.compile(r"""(?:href|src)=["']([^"']+)["']""")
+SKIP_CHANNEL_MODULES = {"base", "manager", "registry", "weixin_qr", "lark_http"}
+SHARED_SWITCHES = {"enabled", "send_progress", "send_tool_hints", "streaming", "allow_from"}
+
+
+def pages(base: Path) -> set[str]:
+ found = set()
+ for pattern in ("*.md", "*.mdx"):
+ for path in base.rglob(pattern):
+ rel = path.relative_to(base).as_posix()
+ if rel.startswith("zh-cn/"):
+ continue
+ found.add(rel)
+ return found
+
+
+def check_parity() -> list[str]:
+ errors = []
+ en = pages(CONTENT)
+ zh = pages(CONTENT / "zh-cn")
+ if en - zh:
+ errors.append("only English: " + ", ".join(sorted(en - zh)))
+ if zh - en:
+ errors.append("only Chinese: " + ", ".join(sorted(zh - en)))
+ for path in list(CONTENT.rglob("*.md")) + list(CONTENT.rglob("*.mdx")):
+ rel = path.relative_to(CONTENT).as_posix()
+ if rel in {"index.mdx", "zh-cn/index.mdx"}:
+ continue
+ text = path.read_text()
+ if not text.startswith("---"):
+ errors.append(f"{rel} is missing frontmatter")
+ continue
+ block = text.split("---", 2)[1]
+ if "quadrant:" not in block and "template: splash" not in block:
+ errors.append(f"{rel} is missing quadrant")
+ return errors
+
+
+def check_screenshots() -> list[str]:
+ errors = []
+ manifest = json.loads(MANIFEST.read_text())
+ for row in manifest["files"]:
+ name = row["file"]
+ copy = PUBLIC / name
+ if not copy.exists():
+ continue
+ digest = hashlib.sha256(copy.read_bytes()).hexdigest()
+ if digest != row["sha256"]:
+ errors.append(f"{name} sha256 {digest} != manifest {row['sha256']}")
+ referenced = set()
+ for path in CONTENT.rglob("*"):
+ if path.suffix not in {".md", ".mdx"}:
+ continue
+ referenced.update(re.findall(r"/screenshots/dev/([A-Za-z0-9_.-]+)", path.read_text()))
+ for name in sorted(referenced):
+ if not (PUBLIC / name).exists():
+ errors.append(f"missing screenshot {name}")
+ return errors
+
+
+def dest_exists(url: str) -> bool:
+ path = url.split("#", 1)[0].split("?", 1)[0]
+ if path in {"", "/"}:
+ return (DIST / "index.html").exists()
+ relative = path.lstrip("/")
+ candidates = [
+ DIST / relative,
+ DIST / relative / "index.html",
+ DIST / f"{relative}.html",
+ ]
+ return any(item.exists() for item in candidates)
+
+
+def _class_fields(node: ast.ClassDef) -> list[str]:
+ fields = []
+ for stmt in node.body:
+ if isinstance(stmt, ast.AnnAssign) and isinstance(stmt.target, ast.Name):
+ name = stmt.target.id
+ if not name.startswith("_"):
+ fields.append(name)
+ return fields
+
+
+def _class_index(paths: list[Path]) -> dict[str, tuple[list[str], list[str]]]:
+ index: dict[str, tuple[list[str], list[str]]] = {}
+ for path in paths:
+ tree = ast.parse(path.read_text())
+ for node in tree.body:
+ if not isinstance(node, ast.ClassDef):
+ continue
+ bases = []
+ for base in node.bases:
+ if isinstance(base, ast.Name):
+ bases.append(base.id)
+ elif isinstance(base, ast.Attribute):
+ bases.append(base.attr)
+ index[node.name] = (bases, _class_fields(node))
+ return index
+
+
+def _resolved_fields(index: dict[str, tuple[list[str], list[str]]], name: str, seen: set[str] | None = None) -> list[str]:
+ seen = seen or set()
+ if name in seen or name not in index:
+ return []
+ seen.add(name)
+ bases, fields = index[name]
+ resolved: list[str] = []
+ for base in bases:
+ resolved.extend(_resolved_fields(index, base, seen))
+ resolved.extend(fields)
+ return resolved
+
+
+def _channel_configs() -> dict[str, list[str]]:
+ index = _class_index([CHANNEL_SCHEMA, *sorted(CHANNELS.glob("*.py"))])
+ configs: dict[str, list[str]] = {}
+ for path in sorted(CHANNELS.glob("*.py")):
+ if path.stem in SKIP_CHANNEL_MODULES:
+ continue
+ tree = ast.parse(path.read_text())
+ for node in tree.body:
+ if not isinstance(node, ast.ClassDef) or not node.name.endswith("Channel"):
+ continue
+ key = None
+ for stmt in node.body:
+ if (
+ isinstance(stmt, ast.Assign)
+ and any(isinstance(target, ast.Name) and target.id == "name" for target in stmt.targets)
+ and isinstance(stmt.value, ast.Constant)
+ and isinstance(stmt.value.value, str)
+ ):
+ key = stmt.value.value
+ if not key:
+ continue
+ config_name = node.name.replace("Channel", "Config")
+ fields = _resolved_fields(index, config_name)
+ if fields:
+ configs[key] = list(dict.fromkeys(fields))
+ return configs
+
+
+def _mentioned_fields(text: str) -> set[str]:
+ names = set(re.findall(r"`([a-z][a-z0-9_]*)`", text))
+ for label in re.findall(r"\*\*([^*]+)\*\*", text):
+ slug = re.sub(r"[^a-z0-9_]", "", label.strip().lower().replace(" ", "_").replace("-", "_"))
+ if slug:
+ names.add(slug)
+ return names
+
+
+def _schema_sections(text: str) -> tuple[str, dict[str, str]]:
+ parts = re.split(r'', text)
+ sections: dict[str, str] = {}
+ iterator = iter(parts[1:])
+ for key, body in zip(iterator, iterator):
+ sections[key] = body
+ shared = ""
+ match = re.search(r"## (?:Shared delivery switches|共享投递开关)(.*?)(?:\n## |\Z)", parts[0], re.S)
+ if match:
+ shared = match.group(1)
+ return shared, sections
+
+
+def check_channel_schema() -> list[str]:
+ """The hand-written channel pages must name every config field the source declares."""
+ errors = []
+ configs = _channel_configs()
+ if not configs:
+ return ["channel schema source produced no configs"]
+ pages = {
+ "en": CONTENT / "channels" / "schema.md",
+ "zh": CONTENT / "zh-cn" / "channels" / "schema.md",
+ }
+ for locale, path in pages.items():
+ text = path.read_text()
+ shared, sections = _schema_sections(text)
+ shared_names = _mentioned_fields(shared)
+ for key, fields in sorted(configs.items()):
+ if f"`{key}`" not in text:
+ errors.append(f"{locale} channel matrix is missing `{key}`")
+ section = sections.get(key, "")
+ if not section:
+ errors.append(f"{locale} channel schema is missing the {key} field section")
+ continue
+ mentioned = _mentioned_fields(section) | (shared_names & SHARED_SWITCHES)
+ missing = [field for field in fields if field not in mentioned]
+ if missing:
+ errors.append(f"{locale} {key} docs omit {', '.join(missing)}")
+ return errors
+
+
+def check_links() -> list[str]:
+ if not DIST.exists():
+ return ["docs/dist is missing; run the docs build first"]
+ errors = []
+ for page in DIST.rglob("*.html"):
+ for match in HREF.findall(page.read_text(errors="ignore")):
+ if match.startswith(("http://", "https://", "mailto:", "data:", "#", "javascript:")):
+ continue
+ if not match.startswith("/"):
+ continue
+ if not dest_exists(match):
+ errors.append(f"{page.relative_to(DIST)} -> {match}")
+ return errors
+
+
+def main() -> int:
+ mode = sys.argv[1] if len(sys.argv) > 1 else "source"
+ errors = check_parity() + check_screenshots() + check_channel_schema()
+ if mode == "dist":
+ errors.extend(check_links())
+ if errors:
+ print("\n".join(errors))
+ return 1
+ print("docs checks passed")
+ return 0
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/docs/scripts/generate_reference.py b/docs/scripts/generate_reference.py
new file mode 100644
index 000000000..5066c9514
--- /dev/null
+++ b/docs/scripts/generate_reference.py
@@ -0,0 +1,162 @@
+"""Regenerate public reference pages from module manifests and the router index.
+
+Run from the repository root:
+
+ python3 docs/scripts/generate_reference.py
+"""
+
+from __future__ import annotations
+
+import json
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parents[2]
+MANIFESTS = ROOT / "deeptutor" / "modules" / "manifests"
+ROUTER_INDEX = ROOT / "deeptutor" / "api" / "router_index.json"
+DOCS = ROOT / "docs" / "src" / "content" / "docs"
+MARKER = ""
+
+EXTRA_MOUNTS = {
+ "deeptutor.api.routers.modules:router": {
+ "prefix": "/api/modules",
+ "auth": "authenticated",
+ "module": "server",
+ }
+}
+
+
+def load_mounts() -> dict[str, dict]:
+ mounts = dict(EXTRA_MOUNTS)
+ for path in sorted(MANIFESTS.glob("*.json")):
+ data = json.loads(path.read_text())
+ for route in data.get("routes", []):
+ options = route.get("options") or {}
+ mounts[route["reference"]] = {
+ "prefix": options.get("prefix") or "",
+ "auth": route.get("auth") or "",
+ "module": data["id"],
+ }
+ return mounts
+
+
+def route_index(locale: str) -> str:
+ index = json.loads(ROUTER_INDEX.read_text())
+ mounts = load_mounts()
+ groups: list[tuple[str, str, str, list[dict]]] = []
+ missing = []
+ for reference, patterns in index["routers"].items():
+ mount = mounts.get(reference)
+ if mount is None:
+ missing.append(reference)
+ continue
+ groups.append((mount["module"], mount["prefix"], mount["auth"], reference, patterns))
+ groups.sort(key=lambda row: (row[0], row[1], row[3]))
+
+ if locale == "zh":
+ intro = (
+ "## 路由索引\n\n"
+ "下面的表由 `deeptutor/modules/manifests/*.json` 与 "
+ "`deeptutor/api/router_index.json` 生成。路径是挂载前缀加上路由模板。"
+ "字段和请求体以运行中的 `GET /openapi.json` 为准。\n"
+ )
+ columns = "| 方法 | 路径 |\n| --- | --- |"
+ missing_label = "索引里有、清单未挂载"
+ else:
+ intro = (
+ "## Route index\n\n"
+ "Generated from `deeptutor/modules/manifests/*.json` and "
+ "`deeptutor/api/router_index.json`. Each path is the mount prefix plus the route template. "
+ "Request and response fields stay in the live `GET /openapi.json`.\n"
+ )
+ columns = "| Method | Path |\n| --- | --- |"
+ missing_label = "Indexed but not mounted by a manifest"
+
+ lines = [MARKER, "", intro]
+ current = None
+ for module, prefix, auth, reference, patterns in groups:
+ if module != current:
+ current = module
+ lines.append(f"### {module}\n")
+ short = reference.rsplit(".", 1)[-1]
+ lines.append(f"#### `{short}` — `{prefix or '/'}` · {auth}\n")
+ lines.append(columns)
+ for pattern in patterns:
+ methods = ", ".join(pattern["methods"]) or "WS"
+ path = f"{prefix}{pattern['path']}"
+ lines.append(f"| `{methods}` | `{path}` |")
+ lines.append("")
+ if missing:
+ lines.append(f"### {missing_label}\n")
+ for reference in missing:
+ lines.append(f"- `{reference}`")
+ lines.append("")
+ return "\n".join(lines).rstrip() + "\n"
+
+
+def capabilities(locale: str) -> str:
+ rows = []
+ for path in sorted(MANIFESTS.glob("*.json")):
+ data = json.loads(path.read_text())
+ for name, spec in (data.get("capabilities") or {}).items():
+ manifest = spec.get("manifest") or {}
+ stages = ", ".join(f"`{stage}`" for stage in manifest.get("stages") or [])
+ aliases = ", ".join(f"`{alias}`" for alias in manifest.get("cli_aliases") or []) or "—"
+ description = (manifest.get("description") or "").replace("|", "\\|")
+ rows.append((spec.get("order", 0), data["id"], name, stages, aliases, description))
+ rows.sort(key=lambda row: (row[1], row[0], row[2]))
+ if locale == "zh":
+ head = """---
+title: 能力
+description: 已注册能力的名称、阶段、所属模块和 CLI 别名。
+quadrant: reference
+---
+
+名称、阶段和 CLI 别名来自 `deeptutor/modules/manifests/*.json` 里每个能力的 `manifest`。描述保持清单中的英文原文。
+
+| 能力 | 模块 | 阶段 | CLI | 说明 |
+| --- | --- | --- | --- | --- |
+"""
+ else:
+ head = """---
+title: Capabilities
+description: Registered capability names, stages, owning modules, and CLI aliases.
+quadrant: reference
+---
+
+Names, stages, and CLI aliases come from each capability `manifest` in `deeptutor/modules/manifests/*.json`.
+
+| Capability | Module | Stages | CLI | Description |
+| --- | --- | --- | --- | --- |
+"""
+ body = "\n".join(
+ f"| `{name}` | `{module}` | {stages or '—'} | {aliases} | {description} |"
+ for _, module, name, stages, aliases, description in rows
+ )
+ return head + body + "\n"
+
+
+def write_capabilities() -> None:
+ for locale, folder in (("en", DOCS), ("zh", DOCS / "zh-cn")):
+ target = folder / "developers" / "reference" / "capabilities.md"
+ target.parent.mkdir(parents=True, exist_ok=True)
+ target.write_text(capabilities(locale))
+
+
+def append_routes() -> None:
+ for locale, folder in (("en", DOCS), ("zh", DOCS / "zh-cn")):
+ target = folder / "developers" / "reference" / "http-api.md"
+ text = target.read_text()
+ if MARKER in text:
+ text = text.split(MARKER, 1)[0].rstrip() + "\n\n"
+ else:
+ text = text.rstrip() + "\n\n"
+ target.write_text(text + route_index(locale))
+
+
+def main() -> None:
+ write_capabilities()
+ append_routes()
+
+
+if __name__ == "__main__":
+ main()
diff --git a/docs/src/components/HomeLanding.astro b/docs/src/components/HomeLanding.astro
new file mode 100644
index 000000000..71c173483
--- /dev/null
+++ b/docs/src/components/HomeLanding.astro
@@ -0,0 +1,449 @@
+---
+interface Props {
+ locale?: "en" | "zh";
+}
+
+const { locale = "en" } = Astro.props;
+const zh = locale === "zh";
+const root = zh ? "/zh-cn" : "";
+
+const copy = zh
+ ? {
+ docs: "文档",
+ eduhub: "EduHub",
+ community: "社区",
+ collaborate: "合作",
+ theme: "主题",
+ auto: "自动",
+ light: "浅色",
+ dark: "深色",
+ language: "语言",
+ taglineLead: "个性化学习,",
+ taglineEm: "重新想象。",
+ subLead: "Agent-native 学习伴侣,与你一起成长。",
+ subRest: "完全开源。",
+ docsBtn: "文档",
+ eduhubBtn: "EduHub 生态",
+ stars: "Stars",
+ shotAlt: "当前 dev 主页:主页、学习、资料随工作区切换,伙伴和个性化属于账户。",
+ eightLead: "八个入口,",
+ eightEm: "串起",
+ eightRest: "你的学习。",
+ eightBody:
+ "对话、日历、笔记本、学习、资料跟随当前工作区;伙伴与个性化属于账户。切换科目时复用熟悉的助手,同时让各项目的材料保持清晰。",
+ installLead: "几",
+ installEm: "分钟",
+ installRest: "就能跑起来。",
+ installBody: "四种安装方式 —— 挑一个适合你的。最终都落到同一个配置好的工作区。",
+ fullGuide: "完整指南",
+ footerDocs: "文档",
+ footerCommunity: "社区",
+ footerProject: "项目",
+ footerLead: "源自",
+ footerEm1: "社区",
+ footerMid: ",连接",
+ footerEm2: "世界",
+ footerEnd: "。",
+ footerLatest: "最新:",
+ visits: "次访问",
+ requests: "次请求",
+ credit: "香港大学数据智能实验室",
+ license: "基于 Apache 2.0 协议发布",
+ }
+ : {
+ docs: "Docs",
+ eduhub: "EduHub",
+ community: "Community",
+ collaborate: "Collaborate",
+ theme: "Theme",
+ auto: "Auto",
+ light: "Light",
+ dark: "Dark",
+ language: "Language",
+ taglineLead: "Personal tutoring,",
+ taglineEm: "reimagined.",
+ subLead: "Agent-native Learning Companion that grows with you.",
+ subRest: "Fully Open-Sourced.",
+ docsBtn: "Docs",
+ eduhubBtn: "EduHub Ecosystem",
+ stars: "Stars",
+ shotAlt:
+ "Current dev Home, with workspace-scoped Home, Learning and Resources and account-level Partners and Personalization.",
+ eightLead: "Eight places, ",
+ eightEm: "one",
+ eightRest: " learning flow.",
+ eightBody:
+ "Chat, Calendar, Notebook, Learning, and Resources follow your active workspace. Partners and Personalization belong to your account, ready to support another subject without mixing its materials with this one.",
+ installLead: "Up and running in ",
+ installEm: "minutes",
+ installRest: ".",
+ installBody: "Four ways to install — pick the one that fits. Every path lands at the same configured workspace.",
+ fullGuide: "Full guide",
+ footerDocs: "Docs",
+ footerCommunity: "Community",
+ footerProject: "Project",
+ footerLead: "From the ",
+ footerEm1: "community",
+ footerMid: ", to ",
+ footerEm2: "the world",
+ footerEnd: ".",
+ footerLatest: "Latest:",
+ visits: "Visits",
+ requests: "Requests",
+ credit: "Data Intelligence Lab @ The University of Hong Kong",
+ license: "Released under the Apache 2.0 License",
+ };
+
+const places = zh
+ ? [
+ ["I", "工作区", "按科目或项目分开组织,让各自的对话、学习与资料留在对应工作区。", `${root}/learning-workspace/workspaces/`],
+ ["II", "对话", "结合上下文提问、选择模式,由同一个智能体循环调用工具、技能与资料。", `${root}/learning-workspace/chat/`],
+ ["III", "日历", "把账号日程与工作区任务、到期复习、定时指令和学习活动放在一起规划。", `${root}/learning-workspace/calendar/`],
+ ["IV", "笔记本", "把来源整理成自己的页面,与 Dito 讨论段落,并从收藏夹插入证据。", `${root}/learning-workspace/notebook/`],
+ ["V", "学习", "通过书籍、精通之路、阅读与练习开展学习,对话始终围绕当前活动。", `${root}/learning-workspace/`],
+ ["VI", "资料", "复用当前工作区的聊天记录、收藏、题目、学习日志与知识库。", `${root}/learning-workspace/resources/`],
+ ["VII", "伙伴", "账户级的持久伙伴,拥有明确的工作上下文、可复用指令与 IM 渠道。", `${root}/channels/`],
+ ["VIII", "个性化", "将角色、技能、外部智能体和已连接工具带到不同工作区使用。", `${root}/customize/`],
+ ]
+ : [
+ ["I", "Workspaces", "Separate subjects and projects; keep each workspace’s conversations, learning, and resources together.", `${root}/learning-workspace/workspaces/`],
+ ["II", "Chat", "Ask with context, pick a mode, and let one agent loop use your tools, skills, and sources.", `${root}/learning-workspace/chat/`],
+ ["III", "Calendar", "Plan account events beside workspace tasks, due reviews, scheduled instructions, and study activity.", `${root}/learning-workspace/calendar/`],
+ ["IV", "Notebook", "Turn sources into your own pages; discuss a passage with Dito and insert evidence from Favorites.", `${root}/learning-workspace/notebook/`],
+ ["V", "Learning", "Study through Books, Mastery Paths, Reading, and Practice, with conversations tied to the activity.", `${root}/learning-workspace/`],
+ ["VI", "Resources", "Reuse chat history, Favorites, questions, learning records, and knowledge bases from this workspace.", `${root}/learning-workspace/resources/`],
+ ["VII", "Partners", "Account-level companions with explicit working context, reusable instructions, and IM channels.", `${root}/channels/`],
+ ["VIII", "Personalization", "Bring your personas, skills, agents, and connected tools into different workspaces.", `${root}/customize/`],
+ ];
+
+const installs = zh
+ ? [
+ {
+ id: "pypi",
+ mark: "I",
+ name: "PyPI",
+ tag: "推荐",
+ blurb: "1.7.0 发布后的完整 Web 应用 + CLI 安装方式。现在体验 dev 请选源码。",
+ code: `# 1. 准备运行数据目录\nmkdir -p my-deeptutor && cd my-deeptutor\n\n# 2. 安装、配置、启动\npip install -U "deeptutor[full]"\ndeeptutor init\ndeeptutor start`,
+ note: "然后打开 127.0.0.1:3782",
+ href: `${root}/self-hosting/pypi/`,
+ },
+ {
+ id: "docker",
+ mark: "II",
+ name: "Docker",
+ tag: "单容器",
+ blurb: "已发布的稳定版镜像。需要当前 dev 时,请使用源码构建 Dockerfile。",
+ code: `docker run --rm --name deeptutor \\\n -p 127.0.0.1:3782:3782 \\\n -v deeptutor-data:/app/data \\\n ghcr.io/hkuds/deeptutor:latest`,
+ note: "打开 127.0.0.1:3782 即可,应用会在内部代理 API。数据持久化在命名 volume 里。",
+ href: `${root}/get-started/docker/`,
+ },
+ {
+ id: "source",
+ mark: "III",
+ name: "源码",
+ tag: "贡献者",
+ blurb: "使用当前 dev 源码,安装完整 Python 依赖与前端。",
+ code: `git clone --branch dev https://github.com/HKUDS/DeepTutor.git\ncd DeepTutor\n\npython3 -m venv .venv && source .venv/bin/activate\npython -m pip install -r requirements/full.txt\npython -m pip install -e . --no-deps\n( cd web && npm ci --legacy-peer-deps )\n\ndeeptutor init && deeptutor start`,
+ note: "Python 3.11–3.14 · Node.js 22 LTS。start 加 --dev 可启用前端热重载。",
+ href: `${root}/self-hosting/source/`,
+ },
+ {
+ id: "cli",
+ mark: "IV",
+ name: "CLI",
+ tag: "无界面",
+ blurb: "从终端使用当前 dev 源码;若要最小 core 环境,请按指南选择独立 wheel 安装。",
+ code: `git clone --branch dev https://github.com/HKUDS/DeepTutor.git\ncd DeepTutor\n\npython3 -m venv .venv-cli && source .venv-cli/bin/activate\npython -m pip install -r requirements/full.txt\npython -m pip install -e . --no-deps\n\ndeeptutor init --cli\ndeeptutor chat`,
+ note: "跳过前端安装。使用知识库时配置 embedding;运行可选能力前检查模块状态。",
+ href: `${root}/self-hosting/cli-only/`,
+ },
+ ]
+ : [
+ {
+ id: "pypi",
+ mark: "I",
+ name: "PyPI",
+ tag: "After 1.7.0",
+ blurb: "Full Web app + CLI after 1.7.0 publication. Use Source to try the current dev now.",
+ code: `# 1. Choose a runtime-home directory\nmkdir -p my-deeptutor && cd my-deeptutor\n\n# 2. Install, configure, launch\npip install -U "deeptutor[full]"\ndeeptutor init\ndeeptutor start`,
+ note: "Then open 127.0.0.1:3782",
+ href: `${root}/self-hosting/pypi/`,
+ },
+ {
+ id: "docker",
+ mark: "II",
+ name: "Docker",
+ tag: "One container",
+ blurb: "Published stable image. To run current dev, build the source Dockerfile.",
+ code: `docker run --rm --name deeptutor \\\n -p 127.0.0.1:3782:3782 \\\n -v deeptutor-data:/app/data \\\n ghcr.io/hkuds/deeptutor:latest`,
+ note: "Open 127.0.0.1:3782 — the app proxies the API internally. Data persists in the named volume.",
+ href: `${root}/get-started/docker/`,
+ },
+ {
+ id: "source",
+ mark: "III",
+ name: "Source",
+ tag: "Contributors",
+ blurb: "Use the current dev source with the complete Python dependencies and frontend.",
+ code: `git clone --branch dev https://github.com/HKUDS/DeepTutor.git\ncd DeepTutor\n\npython3 -m venv .venv && source .venv/bin/activate\npython -m pip install -r requirements/full.txt\npython -m pip install -e . --no-deps\n( cd web && npm ci --legacy-peer-deps )\n\ndeeptutor init && deeptutor start`,
+ note: "Python 3.11–3.14 · Node.js 22 LTS. Add --dev to start for frontend hot reload.",
+ href: `${root}/self-hosting/source/`,
+ },
+ {
+ id: "cli",
+ mark: "IV",
+ name: "CLI",
+ tag: "Headless",
+ blurb: "Use the current source from a terminal. The minimal core wheel is a separate installation choice.",
+ code: `git clone --branch dev https://github.com/HKUDS/DeepTutor.git\ncd DeepTutor\n\npython3 -m venv .venv-cli && source .venv-cli/bin/activate\npython -m pip install -r requirements/full.txt\npython -m pip install -e . --no-deps\n\ndeeptutor init --cli\ndeeptutor chat`,
+ note: "No frontend setup. Configure embedding when using knowledge bases; check modules before running optional capabilities.",
+ href: `${root}/self-hosting/cli-only/`,
+ },
+ ];
+
+const communityHref = zh ? "https://deeptutor.info/zh-cn/community/" : "https://deeptutor.info/community/";
+const collaborateHref = zh ? "https://deeptutor.info/zh-cn/collaborate/" : "https://deeptutor.info/collaborate/";
+const arrow = ``;
+---
+
+
+
+
diff --git a/docs/src/content/docs/partners/dingtalk.md b/docs/src/content/docs/channels/domestic/dingtalk.md
similarity index 84%
rename from docs/src/content/docs/partners/dingtalk.md
rename to docs/src/content/docs/channels/domestic/dingtalk.md
index 0bf550179..b44838014 100644
--- a/docs/src/content/docs/partners/dingtalk.md
+++ b/docs/src/content/docs/channels/domestic/dingtalk.md
@@ -35,14 +35,8 @@ pip install "deeptutor[partners]"
Open **Partners -> your partner -> Channels -> DingTalk**.
-| Field | What to enter |
-| --- | --- |
-| **Send Progress** | Keep on while testing. It delivers narration updates during long turns. |
-| **Send Tool Hints** | Keep on for debugging; turn off if users should not see one-line tool calls. |
-| **Enabled** | Turn on only when you are ready to start the channel. |
-| **Client Id** | The AppKey from Credentials & Basic Info (often starts with `ding...`). |
-| **Client Secret** | The AppSecret from the same page. Stored as a secret and masked after save. |
-| **Allow From** | One value per line. Use `*` for a first test, or DingTalk staff ids (the partner logs print the sender id with every inbound message). Empty denies everyone. |
+Card fields for this channel are in the [channel schema](/channels/schema/#dingtalk).
+
Replies are sent as markdown messages, so headings, lists, and links render natively in DingTalk. Voice messages are handled too: DingTalk's built-in speech-to-text result is forwarded to the partner as plain text.
@@ -80,5 +74,5 @@ Almost always **Allow From**. An empty list denies everyone — including you. P
## See also
-- [Channel Matrix](/partners/channels/) — all channels at a glance
-- [Feishu](/partners/feishu/) — the other major Chinese workplace chat, same no-webhook model
+- [Channel Matrix](/channels/schema/) — all channels at a glance
+- [Feishu](/channels/domestic/feishu/) — the other major Chinese workplace chat, same no-webhook model
diff --git a/docs/src/content/docs/partners/feishu.md b/docs/src/content/docs/channels/domestic/feishu.md
similarity index 78%
rename from docs/src/content/docs/partners/feishu.md
rename to docs/src/content/docs/channels/domestic/feishu.md
index 4184a9dbf..881d7e2a8 100644
--- a/docs/src/content/docs/partners/feishu.md
+++ b/docs/src/content/docs/channels/domestic/feishu.md
@@ -51,20 +51,8 @@ If you enable event encryption on the platform (under Events & Callbacks), also
Open **Partners -> your partner -> Channels -> Feishu**.
-| Field | What to enter |
-| --- | --- |
-| **Streaming** | Off by default. Streams the reply live into a CardKit card with a typewriter effect. Requires **Send Progress**: narration rounds stream as they happen. |
-| **Send Progress** | Keep on while testing. It delivers narration updates during long turns. |
-| **Send Tool Hints** | Keep on for debugging; turn off if users should not see one-line tool calls. |
-| **Enabled** | Turn on only when you are ready to start the channel. |
-| **App Id** | The `cli_...` App ID from Credentials & Basic Info. |
-| **App Secret** | The App Secret from the same page. Stored as a secret and masked after save. |
-| **Domain** | `feishu` (default) for mainland Feishu apps; select `lark` for international Lark tenants so the SDK uses `open.larksuite.com`. The scan flow fills this automatically. |
-| **Encrypt Key** | Only needed when event encryption is enabled on the platform. Leave blank otherwise. |
-| **Verification Token** | The event Verification Token from the platform; used to verify event signatures. Leave blank if you did not configure one. |
-| **Allow From** | One value per line. Use `*` for an open test bot, or `ou_...` open ids (copy them from the partner logs after a first message). Empty denies everyone. |
-| **React Emoji** | The reaction the bot adds to every message it accepts, as an instant acknowledgement. Default `THUMBSUP`; other common types: `OK`, `EYES`, `DONE`, `OnIt`, `HEART`. |
-| **Group Policy** | `mention` (default): in groups the bot only answers when @mentioned. `open`: it answers every group message. DMs always get a response. |
+Card fields for this channel are in the [channel schema](/channels/schema/#feishu).
+
DeepTutor picks the outbound message format automatically: short plain text goes out as a text message, link-only content as a rich-text post, and anything with headings, code blocks, lists, or tables as an interactive card. Feishu allows one table per card, so multi-table replies are split across several cards.
@@ -102,5 +90,5 @@ If you configured an Encrypt Key on the platform, the same value must be in the
## See also
-- [Channel Matrix](/partners/channels/) — all channels at a glance
-- [DingTalk](/partners/dingtalk/) — the other major Chinese workplace chat, similar no-webhook model
+- [Channel Matrix](/channels/schema/) — all channels at a glance
+- [DingTalk](/channels/domestic/dingtalk/) — the other major Chinese workplace chat, similar no-webhook model
diff --git a/docs/src/content/docs/channels/domestic/index.md b/docs/src/content/docs/channels/domestic/index.md
new file mode 100644
index 000000000..564d7bab3
--- /dev/null
+++ b/docs/src/content/docs/channels/domestic/index.md
@@ -0,0 +1,18 @@
+---
+title: Domestic IM
+description: Which built-in China-region chat channels fit which kind of partner.
+quadrant: explanation
+---
+
+These channels deliver the same partner. They differ in who operates the account and how the connection is held.
+
+| Channel | Connection | Fits |
+| --- | --- | --- |
+| [WeChat](/channels/domestic/weixin/) | QR login and HTTP long-poll | A personal WeChat assistant. A person has to scan. |
+| [WeCom](/channels/domestic/wecom/) | WeCom AI Bot WebSocket | Enterprise WeChat / WeChat Work |
+| [QQ / NapCat](/channels/domestic/qq/) | Official bot WebSocket, or a personal account through NapCat | An official QQ bot, or a personal QQ you intentionally bridge |
+| [Feishu / Lark](/channels/domestic/feishu/) | Open Platform WebSocket and CardKit cards | Feishu or Lark enterprise chat |
+| [DingTalk](/channels/domestic/dingtalk/) | Stream Mode | DingTalk enterprise chat, without a public callback URL |
+| [Mochat](/channels/domestic/mochat/) | Socket.IO, with HTTP polling as fallback | A customer-support panel |
+
+Use one channel until it answers, then add another. Shared switches and per-card fields are in the [channel schema](/channels/schema/).
diff --git a/docs/src/content/docs/partners/mochat.md b/docs/src/content/docs/channels/domestic/mochat.md
similarity index 59%
rename from docs/src/content/docs/partners/mochat.md
rename to docs/src/content/docs/channels/domestic/mochat.md
index 64d043470..d4a02ed04 100644
--- a/docs/src/content/docs/partners/mochat.md
+++ b/docs/src/content/docs/channels/domestic/mochat.md
@@ -30,39 +30,15 @@ In your Mochat admin panel, create a bot account and copy its **Claw Token**. Th
Open **Partners -> your partner -> Channels -> Mochat**.
-| Field | What to enter |
-| --- | --- |
-| **Send Progress** | Keep on while testing. It sends narration updates during long turns. |
-| **Send Tool Hints** | Keep on for debugging; turn off if you do not want users to see one-line tool calls. |
-| **Enabled** | Turn on only when you are ready to start the channel. |
-| **Base Url** | Your Mochat instance. Default: `https://mochat.io`. |
-| **Socket Url** | Optional separate Socket.IO endpoint. Blank means use **Base Url**. |
-| **Socket Path** | Socket.IO mount path. Default: `/socket.io`. |
-| **Socket Disable Msgpack** | Off by default (msgpack is used when available). Turn on to force JSON if your server has no msgpack parser. |
-| **Socket Reconnect Delay Ms** | Initial reconnect delay. Default `1000`. |
-| **Socket Max Reconnect Delay Ms** | Reconnect backoff cap. Default `10000`. |
-| **Socket Connect Timeout Ms** | Connection timeout. Default `10000`. |
-| **Refresh Interval Ms** | How often the channel refreshes its session/panel directory. Default `30000`. |
-| **Watch Timeout Ms** | Long-poll timeout in HTTP fallback mode. Default `25000`. |
-| **Claw Token** | Required. The bot token from your Mochat admin panel. |
-| **Sessions** | Session ids to watch, one per line. `*` auto-discovers and subscribes new sessions. |
-| **Panels** | Panel ids to watch, one per line. `*` auto-discovers panels. Leave both lists empty and the channel watches nothing. |
-| **Allow From** | One value per line. Use `*` for an open test channel, or specific Mochat user ids. Empty denies access. |
+Card fields for this channel are in the [channel schema](/channels/schema/#mochat).
+
### Advanced fields
These tune retries and group behavior; the defaults are fine for a first deployment.
-| Field | Notes |
-| --- | --- |
-| **Watch Limit** | Max events fetched per poll. Default `100`. |
-| **Retry Delay Ms** | Delay between failed HTTP retries. Default `500`. |
-| **Max Retry Attempts** | Maximum Socket.IO reconnection attempts. `0` means reconnect forever. This field does not cap HTTP fallback loops. |
-| **Agent User Id** | The bot's own Mochat user id. Used to ignore the bot's own messages and to detect @-mentions. |
-| **Mention** | `require_in_groups` — require an @-mention before answering in group sessions. |
-| **Groups** | Per-group overrides, keyed by group id: `{"": {"require_mention": true}}`. |
-| **Reply Delay Mode** | `non-mention` (default) buffers panel messages that do not mention the bot; any other value disables buffering. |
-| **Reply Delay Ms** | Buffer window. Default `120000` (2 minutes). |
+Card fields for this channel are in the [channel schema](/channels/schema/#mochat).
+
With the default reply-delay mode, rapid-fire panel messages are batched into one Partner turn: each new message restarts the timer, and a direct @-mention flushes the buffer immediately.
diff --git a/docs/src/content/docs/partners/qq.md b/docs/src/content/docs/channels/domestic/qq.md
similarity index 71%
rename from docs/src/content/docs/partners/qq.md
rename to docs/src/content/docs/channels/domestic/qq.md
index 93f15bdac..ef5617511 100644
--- a/docs/src/content/docs/partners/qq.md
+++ b/docs/src/content/docs/channels/domestic/qq.md
@@ -23,13 +23,8 @@ Install the Partners extra, then create a bot in the [QQ Bot Development Platfor
Configuration fields:
-| Field | Notes |
-| --- | --- |
-| `enabled` | Start the channel with the partner. |
-| `app_id` | App ID from Tencent's bot platform. |
-| `secret` | Bot secret. |
-| `allow_from` | Allowed QQ user ids / openids. Empty denies access; use explicit ids for production. |
-| `msg_format` | `plain` or `markdown`. Start with `plain` if clients render Markdown inconsistently. |
+Card fields for this channel are in the [channel schema](/channels/schema/#qq).
+
Start with:
@@ -45,16 +40,8 @@ NapCat exposes a personal QQ account through a OneBot v11 WebSocket endpoint. Ru
Configuration fields:
-| Field | Notes |
-| --- | --- |
-| `enabled` | Start the channel with the partner. |
-| `ws_url` | NapCat WebSocket endpoint, default `ws://127.0.0.1:3001`. |
-| `access_token` | Optional OneBot access token. |
-| `allow_from` | Allowed user ids. Use `*` only for local testing. |
-| `group_policy` | `mention`, `open`, or a probability between `0` and `1`. Mentions/replies always respond. |
-| `group_policy_overrides` | Per-group policy map, keyed by group id. |
-| `welcome_new_members` | Whether to welcome new group members. |
-| `max_image_bytes` | Hard cap for inbound image downloads. |
+Card fields for this channel are in the [channel schema](/channels/schema/#qq).
+
## Choosing between them
diff --git a/docs/src/content/docs/partners/wecom.md b/docs/src/content/docs/channels/domestic/wecom.md
similarity index 84%
rename from docs/src/content/docs/partners/wecom.md
rename to docs/src/content/docs/channels/domestic/wecom.md
index 8893c2808..8deda0d9d 100644
--- a/docs/src/content/docs/partners/wecom.md
+++ b/docs/src/content/docs/channels/domestic/wecom.md
@@ -6,7 +6,7 @@ quadrant: how-to
-Use `wecom` for Enterprise WeChat / WeChat Work. It connects through the WeCom AI Bot WebSocket long connection and is different from personal [WeChat (`weixin`)](/partners/weixin/).
+Use `wecom` for Enterprise WeChat / WeChat Work. It connects through the WeCom AI Bot WebSocket long connection and is different from personal [WeChat (`weixin`)](/channels/domestic/weixin/).

@@ -45,14 +45,8 @@ Use the manual Bot ID / Secret path below when QR onboarding is not suitable for
Open **Partners -> your partner -> Channels -> WeCom** and fill:
-| Field | Notes |
-| --- | --- |
-| `enabled` | Start this channel when the partner starts. |
-| `bot_id` | Bot ID from WeCom AI Bot platform. |
-| `secret` | Secret from WeCom. Treat it as a credential. |
-| `allow_from` | User ids allowed to talk to this partner. Empty denies access; `*` opens it where supported by the base channel policy. |
-| `welcome_message` | Optional text sent when a user opens the chat. |
-| `send_progress` / `send_tool_hints` | Delivery switches for narration and one-line tool calls. |
+Card fields for this channel are in the [channel schema](/channels/schema/#wecom).
+
## Access control and visibility
diff --git a/docs/src/content/docs/partners/weixin.md b/docs/src/content/docs/channels/domestic/weixin.md
similarity index 72%
rename from docs/src/content/docs/partners/weixin.md
rename to docs/src/content/docs/channels/domestic/weixin.md
index 7ded445a1..9cbce1b6a 100644
--- a/docs/src/content/docs/partners/weixin.md
+++ b/docs/src/content/docs/channels/domestic/weixin.md
@@ -6,7 +6,7 @@ quadrant: how-to
-The `weixin` channel connects a Partner to a personal WeChat account through the iLink long-poll API. It is different from **WeCom**: use this page for normal personal WeChat, and [WeCom](/partners/wecom/) for Enterprise WeChat / WeChat Work.
+The `weixin` channel connects a Partner to a personal WeChat account through the iLink long-poll API. It is different from **WeCom**: use this page for normal personal WeChat, and [WeCom](/channels/domestic/wecom/) for Enterprise WeChat / WeChat Work.

@@ -26,18 +26,8 @@ pip install "deeptutor[partners]"
Open **Partners -> your partner -> Channels -> WeChat**.
-| Field | What to enter |
-| --- | --- |
-| **Send Progress** | Keep on while testing. It sends narration updates during long turns. |
-| **Send Tool Hints** | Keep on for debugging; turn off if you do not want users to see one-line tool calls. |
-| **Enabled** | Turn on only when you are ready to login/start the channel. |
-| **Allow From** | One value per line. Use `*` for an open test channel, or specific WeChat user ids once you know them. Empty denies access. |
-| **Base Url** | Default: `https://ilinkai.weixin.qq.com`. Usually leave unchanged. |
-| **Cdn Base Url** | Default: `https://novac2c.cdn.weixin.qq.com/c2c`. Used for media upload/download. |
-| **Route Tag** | Optional Tencent route tag. Leave blank unless your deployment requires it. |
-| **Token** | Optional bot token. Leave blank for QR-code login; the channel saves the token after a successful scan. |
-| **State Dir** | Optional custom state directory. Blank means DeepTutor uses `data/partners//channels/weixin/` for `account.json`. |
-| **Poll Timeout** | Long-poll timeout in seconds. `35` is the default and works for most networks. |
+Card fields for this channel are in the [channel schema](/channels/schema/#weixin).
+
## Login flow
diff --git a/docs/src/content/docs/channels/index.md b/docs/src/content/docs/channels/index.md
new file mode 100644
index 000000000..469f23de2
--- /dev/null
+++ b/docs/src/content/docs/channels/index.md
@@ -0,0 +1,28 @@
+---
+title: Create a partner
+description: Create one partner, talk to it in the app, then deliver one reply through a single channel.
+quadrant: how-to
+---
+
+A partner is a persistent companion on the same chat loop as [Chat](/learning-workspace/chat/). It has its own soul, library, and memory. A channel only delivers that loop to an external app.
+
+Partners used to be a separate TutorBot engine with `deeptutor bot` commands and YAML channels. Those URLs redirect here. The companion now runs as a scoped chat turn, and channels are cards in the partner UI.
+
+## Create one and send one message
+
+1. Open **Partners** and choose **New partner**.
+2. Set **Identity** (name and default reply language) and **Soul** (role and tone). The first reply uses this soul.
+3. In **Mind**, pick a model. Leave extra tools off until the first reply works.
+4. In **Library**, copy one small knowledge base or skill into a private library, or bind one existing workspace. Finish the wizard.
+5. Open the partner's **Chat** tab and send one question. Continue only after it answers in the soul you wrote.
+6. Open **Channels**, enable one channel, and save. Use your own sender id in **Allow From**. Keep **Send Progress** and **Send Tool Hints** on for this test.
+7. Send one message from that app. The reply should land in the same thread you see in the partner's Chat tab.
+
+Field names for the card are in the [channel schema](/channels/schema/). Choose the app in [Domestic IM](/channels/domestic/) or [International IM](/channels/international/).
+
+You own the partners you create. An admin can assign one to other people; they can talk to it and cannot see its credentials. Each person gets a private conversation and relationship memory.
+
+## See also
+
+- [My Agents](/customize/agents/) — consult a partner from a normal chat turn
+- [Memory](/learning-workspace/memory/) — what the partner can read and write
diff --git a/docs/src/content/docs/partners/discord.md b/docs/src/content/docs/channels/international/discord.md
similarity index 73%
rename from docs/src/content/docs/partners/discord.md
rename to docs/src/content/docs/channels/international/discord.md
index faadf958e..8dbf92384 100644
--- a/docs/src/content/docs/partners/discord.md
+++ b/docs/src/content/docs/channels/international/discord.md
@@ -36,17 +36,8 @@ pip install "deeptutor[partners]"
Open **Partners -> your partner -> Channels -> Discord**.
-| Field | What to enter |
-| --- | --- |
-| **Streaming** | Off by default. Streams the reply live by editing the message in place as text arrives. Requires **Send Progress**: narration rounds stream as they happen. |
-| **Send Progress** | Keep on while testing. It delivers narration updates during long turns. |
-| **Send Tool Hints** | Keep on for debugging; turn off if users should not see one-line tool calls. |
-| **Enabled** | Turn on only when you are ready to start the channel. |
-| **Token** | The bot token from the Developer Portal (**Bot** -> **Reset Token**). Stored as a secret and masked after save. |
-| **Allow From** | One value per line. Use `*` for an open test bot, or Discord user ids (right-click -> Copy User ID with Developer Mode on). Empty denies everyone. |
-| **Gateway Url** | Default `wss://gateway.discord.gg/?v=10&encoding=json`. Change it only if you proxy the gateway. |
-| **Intents** | Gateway intent bitfield. The default `37377` covers Guilds, Guild Messages, Direct Messages, and Message Content. Any privileged intent in this number must also be enabled in the Developer Portal. |
-| **Group Policy** | `mention` (default): in server channels the bot only answers when @mentioned. `open`: it answers every message in channels it can read. DMs always get a response. |
+Card fields for this channel are in the [channel schema](/channels/schema/#discord).
+
Replies longer than Discord's 2000-character limit are split into multiple messages automatically.
@@ -87,6 +78,6 @@ With **Group Policy** = `mention`, the message must actually @mention the bot. A
## See also
-- [Channel Matrix](/partners/channels/) — all channels at a glance
-- [Telegram](/partners/telegram/) — simpler polling model, same streaming switch
-- [Slack](/partners/slack/) — similar developer-portal feel, Socket Mode
+- [Channel Matrix](/channels/schema/) — all channels at a glance
+- [Telegram](/channels/international/telegram/) — simpler polling model, same streaming switch
+- [Slack](/channels/international/slack/) — similar developer-portal feel, Socket Mode
diff --git a/docs/src/content/docs/partners/email.md b/docs/src/content/docs/channels/international/email.md
similarity index 65%
rename from docs/src/content/docs/partners/email.md
rename to docs/src/content/docs/channels/international/email.md
index 262edc111..e5e293fda 100644
--- a/docs/src/content/docs/partners/email.md
+++ b/docs/src/content/docs/channels/international/email.md
@@ -35,31 +35,8 @@ The Partner needs its own mailbox with IMAP and SMTP access. Do not reuse a pers
Open **Partners -> your partner -> Channels -> Email**.
-| Field | What to enter |
-| --- | --- |
-| **Send Progress** | Each progress update becomes a separate email. Fine for a first test; most deployments turn it off to keep inboxes quiet. |
-| **Send Tool Hints** | Same caveat — one email per hint. Turn off outside debugging. |
-| **Enabled** | Turn on when you are ready to start polling. |
-| **Consent Granted** | Hard privacy gate. The channel refuses to read or send any mail until this is on. Enable it only after the mailbox owner has explicitly agreed to let DeepTutor process the inbox. |
-| **Imap Host** | e.g. `imap.gmail.com`. |
-| **Imap Port** | Default `993` (IMAP over SSL). |
-| **Imap Username** | Usually the full address, e.g. `tutor@example.com`. |
-| **Imap Password** | The App Password (Gmail/Outlook with 2FA) or account password (self-hosted). Stored as a secret. |
-| **Imap Mailbox** | Default `INBOX`. Some providers spell folders differently — check webmail if polling finds nothing. |
-| **Imap Use Ssl** | Keep on for port 993. |
-| **Smtp Host** | e.g. `smtp.gmail.com`. |
-| **Smtp Port** | Default `587` (STARTTLS). Use `465` together with **Smtp Use Ssl**. |
-| **Smtp Username** | Usually the same as Imap Username. |
-| **Smtp Password** | Usually the same App Password. Stored as a secret. |
-| **Smtp Use Tls** | STARTTLS on port 587. Keep on unless you switch to implicit SSL below. |
-| **Smtp Use Ssl** | Implicit SSL, typically port 465. Enable one of the two TLS options, not both. |
-| **From Address** | Optional. Blank falls back to Smtp Username, then Imap Username. |
-| **Auto Reply Enabled** | When off, the Partner stops replying automatically to inbound mail (proactive sends still work). Useful as a brake while testing. |
-| **Poll Interval Seconds** | Default `30`. How often the inbox is checked; values below 5 are clamped to 5. |
-| **Mark Seen** | Marks processed mail as read — this is the primary duplicate protection. Leave on. |
-| **Max Body Chars** | Default `12000`. Longer bodies are truncated before reaching the Partner. |
-| **Subject Prefix** | Default `Re: `. Prepended to reply subjects unless the subject already starts with `Re:`. |
-| **Allow From** | One email address per line, lowercase. `*` for an open test channel. Empty denies everyone. |
+Card fields for this channel are in the [channel schema](/channels/schema/#email).
+
Each unique sender address is its own session, and replies carry `In-Reply-To` headers so they thread correctly in the sender's mail client.
diff --git a/docs/src/content/docs/channels/international/index.md b/docs/src/content/docs/channels/international/index.md
new file mode 100644
index 000000000..b9a2a23ce
--- /dev/null
+++ b/docs/src/content/docs/channels/international/index.md
@@ -0,0 +1,21 @@
+---
+title: International IM
+description: Which built-in international and asynchronous channels fit which kind of partner.
+quadrant: explanation
+---
+
+These channels deliver the same partner outside the domestic set. Email is in this group because it is an asynchronous inbox, not a regional IM.
+
+| Channel | Connection | Fits |
+| --- | --- | --- |
+| [Telegram](/channels/international/telegram/) | Bot API long-poll | The shortest setup: a BotFather token and no public URL |
+| [Discord](/channels/international/discord/) | Gateway WebSocket | A Discord server or DMs |
+| [Slack](/channels/international/slack/) | Socket Mode | A Slack workspace, including threads |
+| [Microsoft Teams](/channels/international/msteams/) | Bot Framework webhook | Teams, with a public messaging endpoint |
+| [WhatsApp](/channels/international/whatsapp/) | An external bridge | WhatsApp through that bridge runtime |
+| [Matrix](/channels/international/matrix/) | Sync against a homeserver | Rooms on a homeserver you choose, with optional encryption |
+| [Zulip](/channels/international/zulip/) | Event queue | Stream and topic conversations |
+| [Mattermost](/channels/international/mattermost/) | Native v4 WebSocket | A Mattermost server you host |
+| [Email](/channels/international/email/) | IMAP poll and SMTP reply | An inbox, when a delayed reply is acceptable |
+
+Shared switches and per-card fields are in the [channel schema](/channels/schema/).
diff --git a/docs/src/content/docs/partners/matrix.md b/docs/src/content/docs/channels/international/matrix.md
similarity index 72%
rename from docs/src/content/docs/partners/matrix.md
rename to docs/src/content/docs/channels/international/matrix.md
index 73ce5c3bc..1b52a7f52 100644
--- a/docs/src/content/docs/partners/matrix.md
+++ b/docs/src/content/docs/channels/international/matrix.md
@@ -59,22 +59,8 @@ curl -X POST https://matrix.org/_matrix/client/r0/login \
Open **Partners -> your partner -> Channels -> Matrix**.
-| Field | What to enter |
-| --- | --- |
-| **Send Progress** | Keep on while testing. It sends narration updates during long turns. |
-| **Send Tool Hints** | Keep on for debugging; turn off if you do not want users to see one-line tool calls. |
-| **Enabled** | Turn on when you are ready to start the channel. |
-| **Homeserver** | Default `https://matrix.org`. Use your own server's URL if self-hosted. |
-| **Access Token** | The token from Element or the login API. Stored as a secret. |
-| **User Id** | The bot's full Matrix id, e.g. `@my-bot:matrix.org`. Also used to detect mentions. |
-| **Device Id** | Optional but recommended: pick any stable string and keep it. If blank, a restart may replay recent messages. |
-| **E2Ee Enabled** | Turn on only after installing the `[matrix-e2e]` extra plus libolm. Without them the bot cannot decrypt encrypted rooms. |
-| **Sync Stop Grace Seconds** | Default `2`. How long an in-flight sync may finish during shutdown. Rarely changed. |
-| **Max Media Bytes** | Default `20971520` (20 MB). Size cap for attachment uploads and downloads. |
-| **Allow From** | One Matrix user id per line, e.g. `@frank:matrix.org`. `*` for an open test channel. Empty denies everyone — including room invites. |
-| **Group Policy** | For multi-person rooms: `open` (default) answers every message, `mention` answers only when the bot is mentioned, `allowlist` answers only in rooms listed below. Direct 1:1 chats are always answered. |
-| **Group Allow From** | Room ids (`!abc123:matrix.org`), one per line. Only used with the `allowlist` policy. |
-| **Allow Room Mentions** | Whether an `@room` ping counts as mentioning the bot under the `mention` policy. Off by default. |
+Card fields for this channel are in the [channel schema](/channels/schema/#matrix).
+
## After you save
diff --git a/docs/src/content/docs/partners/mattermost.md b/docs/src/content/docs/channels/international/mattermost.md
similarity index 76%
rename from docs/src/content/docs/partners/mattermost.md
rename to docs/src/content/docs/channels/international/mattermost.md
index 66e3f0306..9a0c855f9 100644
--- a/docs/src/content/docs/partners/mattermost.md
+++ b/docs/src/content/docs/channels/international/mattermost.md
@@ -36,17 +36,8 @@ pip install "deeptutor[partners]"
Open **Partners -> your partner -> Channels -> Mattermost**.
-| Field | What to enter |
-| --- | --- |
-| **Send Progress** | Keep on while testing. It delivers narration updates during long turns. |
-| **Send Tool Hints** | Keep on for debugging; turn off if users should not see one-line tool calls. |
-| **Enabled** | Turn on only when you are ready to start the channel. |
-| **Server Url** | Your Mattermost base URL, e.g. `https://mattermost.example.com`. The scheme is optional (defaults to `https`) and the WebSocket URL is derived automatically — do not append `/api/v4`. |
-| **Bot Token** | The bot account's access token from **Integrations -> Bot Accounts**. Stored as a secret and masked after save. |
-| **Allow From** | One value per line. Use `*` for an open test bot, or Mattermost user ids. Empty denies everyone. |
-| **Group Policy** | `mention` (default): in channels the bot only answers when @mentioned. `open`: it answers every message in channels it has joined. Direct messages always get a reply. |
-| **Reply In Thread** | On (default): the bot answers in a thread rooted at the triggering post. Thread follow-ups still pass **Group Policy** first, so with the default `mention` policy they must @mention the bot. Off: replies go straight into the channel. |
-| **Verify Ssl** | On (default). Turn off only for a self-hosted server whose TLS certificate is self-signed or issued by an internal CA. |
+Card fields for this channel are in the [channel schema](/channels/schema/#mattermost).
+
Replies longer than Mattermost's post limit (~16k characters) are split into multiple messages automatically; file attachments up to 50 MB are supported.
@@ -87,6 +78,6 @@ Two gates to check:
## See also
-- [Channel Matrix](/partners/channels/) — all channels at a glance
-- [Slack](/partners/slack/) — the team-chat channel Mattermost's native API replaces
-- [Discord](/partners/discord/) — the same direct WebSocket + REST transport
+- [Channel Matrix](/channels/schema/) — all channels at a glance
+- [Slack](/channels/international/slack/) — the team-chat channel Mattermost's native API replaces
+- [Discord](/channels/international/discord/) — the same direct WebSocket + REST transport
diff --git a/docs/src/content/docs/partners/msteams.md b/docs/src/content/docs/channels/international/msteams.md
similarity index 67%
rename from docs/src/content/docs/partners/msteams.md
rename to docs/src/content/docs/channels/international/msteams.md
index 0ba009dc6..9d60517e0 100644
--- a/docs/src/content/docs/partners/msteams.md
+++ b/docs/src/content/docs/channels/international/msteams.md
@@ -39,26 +39,8 @@ pip install "deeptutor[partners]"
Open **Partners -> your partner -> Channels -> Microsoft Teams**.
-| Field | What to enter |
-| --- | --- |
-| **Send Progress** | Keep on while testing. It delivers narration updates during long turns. |
-| **Send Tool Hints** | Keep on for debugging; turn off if users should not see one-line tool calls. |
-| **Enabled** | Turn on only when you are ready to start the channel. |
-| **App Id** | The Application (client) ID of the app registration. Also used as the expected audience when validating inbound JWTs. |
-| **App Password** | The client secret value. Stored as a secret and masked after save. |
-| **Tenant Id** | The Directory (tenant) ID. Required for single-tenant registrations; leave blank only for multi-tenant bots. |
-| **Host** | Bind address for the built-in HTTP server. Default `0.0.0.0` listens on all interfaces; use `127.0.0.1` if a local reverse proxy is the only client. |
-| **Port** | Listening port. Default `3978`, the Bot Framework convention. It must be unique among all enabled Teams Partners running on the same host. |
-| **Path** | URL path for inbound activities. Default `/api/messages`; it must match the tail of the messaging endpoint. |
-| **Allow From** | One value per line. Use `*` for a first test, or Microsoft Entra object ids — the partner logs print the id of any denied sender. Empty denies everyone. |
-| **Reply In Thread** | When on (default), replies attach to the triggering message instead of starting a new one. |
-| **Mention Only Response** | The text sent back when a message contains nothing but the bot @mention. |
-| **Validate Inbound Auth** | Keep on. Verifies the Bot Framework JWT on every request (RS256 against Microsoft's published keys, audience = App Id). Turning it off lets anyone who finds the URL talk to your partner as any user — local testing only. |
-| **Ref Ttl Days** | Days an idle conversation reference is kept before pruning. Default `30`. |
-| **Prune Web Chat Refs** | Drops Bot Framework Web Chat conversations from the stored references (Web Chat is not supported). |
-| **Prune Non Personal Refs** | Drops group/channel conversation references; the channel is DM-only for now. |
-| **Ref Touch Interval S** | Minimum seconds between timestamp refreshes on an active conversation reference. Default `300`. |
-| **Trusted Service Url Hosts** | Allowlist of Bot Framework hosts the channel accepts and replies to. The default covers the public, GCC, and DoD Teams clouds — extend it only if Microsoft routes you elsewhere. |
+Card fields for this channel are in the [channel schema](/channels/schema/#msteams).
+
## After you save
@@ -94,5 +76,5 @@ By design: the channel is currently DM-only. Non-personal conversations are drop
## See also
-- [Channel Matrix](/partners/channels/) — all channels at a glance
-- [Slack](/partners/slack/) — the other big workplace platform, Socket Mode instead of a public endpoint
+- [Channel Matrix](/channels/schema/) — all channels at a glance
+- [Slack](/channels/international/slack/) — the other big workplace platform, Socket Mode instead of a public endpoint
diff --git a/docs/src/content/docs/partners/slack.md b/docs/src/content/docs/channels/international/slack.md
similarity index 70%
rename from docs/src/content/docs/partners/slack.md
rename to docs/src/content/docs/channels/international/slack.md
index b4723595e..decaeef56 100644
--- a/docs/src/content/docs/partners/slack.md
+++ b/docs/src/content/docs/channels/international/slack.md
@@ -36,22 +36,8 @@ pip install "deeptutor[partners]"
Open **Partners -> your partner -> Channels -> Slack**.
-| Field | What to enter |
-| --- | --- |
-| **Send Progress** | Keep on while testing. It delivers narration updates during long turns. |
-| **Send Tool Hints** | Keep on for debugging; turn off if users should not see one-line tool calls. |
-| **Enabled** | Turn on only when you are ready to start the channel. |
-| **Mode** | `socket` is the only supported mode. Leave it unchanged. |
-| **Webhook Path** | Reserved for a future webhook mode; unused while **Mode** is `socket`. Leave the default `/slack/events`. |
-| **Bot Token** | The `xoxb-…` token from **OAuth & Permissions**. Stored as a secret and masked after save. |
-| **App Token** | The `xapp-…` App-Level Token from **Socket Mode** (needs `connections:write`). Also a secret. Do not swap it with the Bot Token. |
-| **User Token Read Only** | Keep the default (on). |
-| **Reply In Thread** | On (default): the bot answers in a thread under the triggering message. Follow-ups in that thread still pass **Group Policy** first, so with the default `mention` policy they must @mention the bot. Off: replies go straight into the channel. |
-| **React Emoji** | Emoji name (no colons) the bot adds to your message as a receipt acknowledgement. Default `eyes`. |
-| **Allow From** | One value per line. Use `*` for an open test bot, or Slack user ids (`U…`). Empty denies everyone. |
-| **Group Policy** | `mention` (default): in channels the bot only answers @mentions. `open`: it answers every message in channels it is in. `allowlist`: only channels listed in **Group Allow From**. |
-| **Group Allow From** | Channel ids (`C…`), one per line. Used when **Group Policy** is `allowlist`. |
-| **Dm** | DM sub-policy: **Enabled** toggles DMs as a whole; **Policy** `open` answers any DM, `allowlist` restricts DMs to the ids in its own **Allow From** list. |
+Card fields for this channel are in the [channel schema](/channels/schema/#slack).
+
## After you save
@@ -91,5 +77,5 @@ Three gates to check:
## See also
-- [Channel Matrix](/partners/channels/) — all channels at a glance
-- [Discord](/partners/discord/) — similar developer-portal setup over a Gateway WebSocket
+- [Channel Matrix](/channels/schema/) — all channels at a glance
+- [Discord](/channels/international/discord/) — similar developer-portal setup over a Gateway WebSocket
diff --git a/docs/src/content/docs/partners/telegram.md b/docs/src/content/docs/channels/international/telegram.md
similarity index 68%
rename from docs/src/content/docs/partners/telegram.md
rename to docs/src/content/docs/channels/international/telegram.md
index 0c17f8119..0e2184a8a 100644
--- a/docs/src/content/docs/partners/telegram.md
+++ b/docs/src/content/docs/channels/international/telegram.md
@@ -36,21 +36,8 @@ pip install "deeptutor[partners]"
Open **Partners -> your partner -> Channels -> Telegram**.
-| Field | What to enter |
-| --- | --- |
-| **Streaming** | Off by default. Streams the reply live by editing the Telegram message in place as text arrives. Requires **Send Progress**: narration rounds stream as they happen. |
-| **Send Progress** | Keep on while testing. It delivers narration updates during long turns. |
-| **Send Tool Hints** | Keep on for debugging; turn off if users should not see one-line tool calls. |
-| **Enabled** | Turn on only when you are ready to start the channel. |
-| **Token** | The HTTP API token from BotFather. Stored as a secret and masked after save. |
-| **Allow From** | One value per line. Use `*` for an open test bot, or numeric user ids from `@userinfobot` (usernames also match). Empty denies everyone. |
-| **Proxy** | Optional proxy URL for networks where Telegram is unreachable, e.g. `socks5://127.0.0.1:1080` or `http://proxy:8080`. Leave blank for a direct connection. |
-| **Reply To Message** | When on, the bot's answers quote the message that triggered them. Useful in busy groups, redundant in DMs. |
-| **Group Policy** | Fallback for groups: `mention` (default) requires an @mention or bot reply; `open` answers every message. DMs bypass group policies; **Allow From** still applies. |
-| **Chat Policies** | Per-chat overrides keyed by `chat_id`: `open`, `mention`, or `topics_only`. The latter auto-replies in `allowed_topics`; elsewhere an @mention or bot reply is required. First matching rule wins. |
-| **Connection Pool Size** | HTTP connection pool for the Bot API client. Default `16` is fine for one bot. |
-| **Pool Timeout** | Seconds to wait for a free pooled connection. Default `15`. |
-| **Stream Edit Interval** | Minimum seconds between in-place edits while streaming. Default `0.6`; raise it if Telegram answers with flood-control errors. |
+Card fields for this channel are in the [channel schema](/channels/schema/#telegram).
+
Replies longer than Telegram's 4096-character limit are split into multiple messages automatically (DeepTutor splits at 4000 to stay clear of the cap).
@@ -91,5 +78,5 @@ Fill in **Proxy** with a SOCKS or HTTP proxy URL (e.g. `socks5://127.0.0.1:1080`
## See also
-- [Channel Matrix](/partners/channels/) — all channels at a glance
-- [Discord](/partners/discord/) — Gateway WebSocket model, similar streaming support
+- [Channel Matrix](/channels/schema/) — all channels at a glance
+- [Discord](/channels/international/discord/) — Gateway WebSocket model, similar streaming support
diff --git a/docs/src/content/docs/partners/whatsapp.md b/docs/src/content/docs/channels/international/whatsapp.md
similarity index 89%
rename from docs/src/content/docs/partners/whatsapp.md
rename to docs/src/content/docs/channels/international/whatsapp.md
index 9bd57ff59..c0c0c0b30 100644
--- a/docs/src/content/docs/partners/whatsapp.md
+++ b/docs/src/content/docs/channels/international/whatsapp.md
@@ -97,14 +97,8 @@ Voice messages are not transcribed yet; they arrive as a placeholder note.
Open **Partners -> your partner -> Channels -> WhatsApp**.
-| Field | What to enter |
-| --- | --- |
-| **Send Progress** | Keep on while testing. It sends narration updates during long turns. |
-| **Send Tool Hints** | Keep on for debugging; turn off if you do not want users to see one-line tool calls. |
-| **Enabled** | Turn on only when the bridge is running and you are ready to start the channel. |
-| **Bridge Url** | WebSocket URL of the bridge. Default: `ws://localhost:3001`. |
-| **Bridge Token** | Optional shared secret. Set it only if your bridge checks the `auth` message. |
-| **Allow From** | One value per line. Use `*` for an open test channel, or specific sender ids (the part before `@` in WhatsApp ids — usually the phone number). Empty denies access. |
+Card fields for this channel are in the [channel schema](/channels/schema/#whatsapp).
+
## After you save
diff --git a/docs/src/content/docs/partners/zulip.md b/docs/src/content/docs/channels/international/zulip.md
similarity index 75%
rename from docs/src/content/docs/partners/zulip.md
rename to docs/src/content/docs/channels/international/zulip.md
index 89c7a0cf6..14f14f7f7 100644
--- a/docs/src/content/docs/partners/zulip.md
+++ b/docs/src/content/docs/channels/international/zulip.md
@@ -34,18 +34,8 @@ pip install "deeptutor[partners]"
Open **Partners -> your partner -> Channels -> Zulip**.
-| Field | What to enter |
-| --- | --- |
-| **Send Progress** | Keep on while testing. It sends narration updates during long turns. |
-| **Send Tool Hints** | Keep on for debugging; turn off if you do not want users to see one-line tool calls. |
-| **Enabled** | Turn on when you are ready to start the channel. |
-| **Site** | Your Zulip server URL, e.g. `https://yourorg.zulipchat.com`. Include the scheme and the correct realm subdomain. |
-| **Email** | The bot's generated email from the creation page — not your own. |
-| **Api Key** | The bot's API key. Stored as a secret. |
-| **Allow From** | One Zulip user id or email per line — either form matches. `*` for an open test channel. Empty denies everyone. |
-| **Group Policy** | For stream messages: `mention` (default) answers only when the bot is @-mentioned, `open` answers every message in subscribed streams. Direct messages are always answered. |
-| **Subscribe Streams** | Stream names, one per line. The channel subscribes the bot to them at startup. |
-| **Timeout** | Event-queue long-poll timeout in seconds. Default `60` works for most servers. |
+Card fields for this channel are in the [channel schema](/channels/schema/#zulip).
+
## After you save
diff --git a/docs/src/content/docs/channels/schema.md b/docs/src/content/docs/channels/schema.md
new file mode 100644
index 000000000..ff2431ecb
--- /dev/null
+++ b/docs/src/content/docs/channels/schema.md
@@ -0,0 +1,404 @@
+---
+title: Channel Matrix
+description: All built-in Partner channels, their connection model, required fields, and when to use each one.
+quadrant: reference
+---
+
+Partner channels are delivery adapters around the same Partner brain. They do not create a second agent runtime: an inbound IM event becomes a scoped chat turn, and the reply is delivered back through the channel.
+
+Use the web UI for most configuration: **Partners -> your partner -> Channels** renders the live schema from `/api/partners/channels/schema`, masks secret fields, polls `/channels/status`, and lets you reload channels without rewriting YAML by hand.
+
+
+
+## Built-in channels
+
+| Channel | Key | Connection model | Best for | Required core fields |
+| --- | --- | --- | --- | --- |
+| WeChat | `weixin` | HTTP long-poll + QR login | Personal WeChat assistant | `allow_from`; optional `token`, `state_dir`, `route_tag`, `poll_timeout` |
+| WeCom | `wecom` | WeCom AI Bot WebSocket | Enterprise WeChat / WeChat Work | `bot_id`, `secret`, `allow_from` |
+| QQ | `qq` | Tencent botpy WebSocket | Official QQ bot deployments | `app_id`, `secret`, `allow_from`, `msg_format` |
+| QQ (NapCat) | `napcat` | OneBot v11 WebSocket | Personal QQ via NapCat | `ws_url`, optional `access_token`, `allow_from`, `group_policy` |
+| Telegram | `telegram` | Bot API polling | Simple personal or group bot | `token`, `allow_from` |
+| Discord | `discord` | Gateway WebSocket | Discord servers and DMs | `token`, `allow_from`, group policy fields |
+| Slack | `slack` | Socket Mode | Slack teams, DMs, threaded channel help | `bot_token`, `app_token`, `allow_from`, `group_policy` |
+| Feishu / Lark | `feishu` | Lark SDK WebSocket | Feishu/Lark enterprise chat | `app_id`, `app_secret`, verification/encryption fields where used |
+| DingTalk | `dingtalk` | Stream Mode | DingTalk enterprise chat | `client_id`, `client_secret`, `allow_from` |
+| Matrix | `matrix` | Matrix sync loop | Decentralized rooms, optional E2EE setup | `homeserver`, user credentials or `access_token`, `allow_from`, `group_policy` |
+| Zulip | `zulip` | Event queue | Stream + topic workflows | `email`, `api_key`, `site`, `allow_from`, `group_policy` |
+| Mattermost | `mattermost` | Native v4 WebSocket + REST | Self-hosted open-source team chat | `server_url`, `bot_token`, `allow_from`, optional `group_policy`, `reply_in_thread`, `verify_ssl` |
+| WhatsApp | `whatsapp` | Bridge WebSocket | WhatsApp via a bridge runtime | bridge URL/token, `allow_from` |
+| Email | `email` | IMAP poll + SMTP send | Async email tutoring/helpdesk | IMAP host/user/password, SMTP host/user/password, `allow_from` |
+| Mochat | `mochat` | Socket.IO or HTTP polling | Customer-service style chat panel | `base_url` / socket URL, `claw_token`, `allow_from` |
+| Microsoft Teams | `msteams` | Built-in HTTP webhook listener | Teams DM-first Bot Framework integration | `app_id`, `app_password`, `tenant_id`, host/port/path |
+
+## Install requirements
+
+Every built-in channel except Matrix is covered by the Partners extra:
+
+```bash
+python scripts/install_extras.py partners
+# or, from an installed release when partners extras are available:
+pip install "deeptutor[partners]"
+```
+
+This pulls in all channel SDKs — `python-telegram-bot`, `slack-sdk`, `lark-oapi`, `dingtalk-stream`, `qq-botpy`, `wecom-aibot-sdk`, `python-socketio`, and friends (the full list lives in `requirements/partners.txt`). Email needs nothing beyond the Python standard library. Matrix ships as its own extra because encrypted rooms need the native `libolm` library: run `python scripts/install_extras.py matrix` for plain rooms or `python scripts/install_extras.py matrix-e2e` for E2EE in a source checkout.
+
+If a channel's dependency is missing on the server, the Channels panel greys that channel out and shows the import error (for example `No module named 'lark_oapi'`). Installed cards distinguish **Connected**, **Connecting**, **Listener running**, **Waiting for scan**, **Configuration required**, **Connection failed**, and **Not connected**. Install a missing package or fix the displayed setup action, then restart/reload the Partner.
+
+Stop DeepTutor before changing installed modules or dependencies. Run the source helper from the repository root, restart with the same data directory, then check `deeptutor module list` and the Channels status. Wheel-based installations should use the extras supported by their matching release; do not install feature wheels over a source checkout.
+
+## Shared delivery switches
+
+Most channels inherit the same delivery controls:
+
+| Field | Meaning |
+| --- | --- |
+| `enabled` | Whether the Partner should start this channel. |
+| `send_progress` | Deliver narration/progress updates during long turns. |
+| `send_tool_hints` | Deliver one-line tool-call hints. Useful while debugging, noisy in production. |
+| `streaming` | Telegram, Discord, and Feishu only: stream the reply live by editing the message in place as text arrives (Feishu uses CardKit streaming cards). Requires `send_progress`. Off by default. |
+| `allow_from` | User/chat allowlist. `*` is convenient for tests; explicit ids are safer for deployment. |
+
+## Configuration workflow
+
+1. Create and test the Partner in the web UI before enabling any IM channel.
+2. Enable only one channel first.
+3. Keep `send_progress` and `send_tool_hints` on while debugging.
+4. Start with `allow_from: ["*"]` only in local/private tests.
+5. Confirm the live card reaches a connected/listening state, send a short message, then replace `*` with real sender ids; inspect logs only if the status detail is insufficient.
+6. Add more channels only after the first channel is stable.
+
+## Choosing a channel
+
+- Use **WeChat** for personal WeChat. It requires a human QR-code scan and persisted state.
+- Use **WeCom**, **Feishu**, **DingTalk**, **Slack**, or **Teams** for enterprise/team deployments.
+- Use **QQ** for official Tencent bot accounts; use **NapCat** only when you intentionally operate a personal QQ bridge.
+- Use **Email** when asynchronous replies are acceptable and users prefer inbox workflows.
+- Use **Matrix** or **Zulip** when room/topic structure matters more than consumer IM convenience.
+- Use **Mattermost** for a self-hosted, open-source team chat you run yourself.
+
+## Where state lives
+
+Channel state is stored below the Partner's `channels/` directory, for example:
+
+```text
+data/partners//channels/weixin/account.json
+data/partners//channels/msteams/msteams_conversations.json
+```
+
+Persist the whole `data/partners/` tree in Docker or production hosts. Losing channel state can force new QR scans or conversation-reference collection.
+
+## Detailed pages
+
+Every built-in channel has a dedicated page with platform-side registration steps, a field-by-field walkthrough of the channel card, and troubleshooting:
+
+- [WeChat](/channels/domestic/weixin/) — personal WeChat QR login and long-poll setup
+- [WeCom](/channels/domestic/wecom/) — Enterprise WeChat AI Bot setup
+- [QQ / NapCat](/channels/domestic/qq/) — official QQ bot and personal QQ bridge paths
+- [Telegram](/channels/international/telegram/) — BotFather registration, Bot API polling, live streaming
+- [Discord](/channels/international/discord/) — Developer Portal app, intents, Gateway WebSocket
+- [Slack](/channels/international/slack/) — Socket Mode app with bot + app tokens
+- [Feishu / Lark](/channels/domestic/feishu/) — open-platform app and CardKit streaming cards
+- [DingTalk](/channels/domestic/dingtalk/) — Stream Mode enterprise bot
+- [Matrix](/channels/international/matrix/) — homeserver credentials and optional E2EE
+- [Zulip](/channels/international/zulip/) — bot account and stream subscriptions
+- [Mattermost](/channels/international/mattermost/) — self-hosted server via bot token over the native v4 API
+- [WhatsApp](/channels/international/whatsapp/) — bridge runtime setup
+- [Email](/channels/international/email/) — IMAP polling and SMTP replies
+- [Mochat](/channels/domestic/mochat/) — Socket.IO customer-service panel
+- [Microsoft Teams](/channels/international/msteams/) — Bot Framework webhook listener
+
+## Per-channel fields
+
+These are the fields on each channel card. The card is rendered from `GET /api/v1/partners/channels/schema`. Shared switches stay in the matrix above.
+
+
+
+### DingTalk
+
+| Field | What to enter |
+| --- | --- |
+| **Send Progress** | Keep on while testing. It delivers narration updates during long turns. |
+| **Send Tool Hints** | Keep on for debugging; turn off if users should not see one-line tool calls. |
+| **Enabled** | Turn on only when you are ready to start the channel. |
+| **Client Id** | The AppKey from Credentials & Basic Info (often starts with `ding...`). |
+| **Client Secret** | The AppSecret from the same page. Stored as a secret and masked after save. |
+| **Allow From** | One value per line. Use `*` for a first test, or DingTalk staff ids (the partner logs print the sender id with every inbound message). Empty denies everyone. |
+
+
+### Feishu
+
+| Field | What to enter |
+| --- | --- |
+| **Streaming** | Off by default. Streams the reply live into a CardKit card with a typewriter effect. Requires **Send Progress**: narration rounds stream as they happen. |
+| **Send Progress** | Keep on while testing. It delivers narration updates during long turns. |
+| **Send Tool Hints** | Keep on for debugging; turn off if users should not see one-line tool calls. |
+| **Enabled** | Turn on only when you are ready to start the channel. |
+| **App Id** | The `cli_...` App ID from Credentials & Basic Info. |
+| **App Secret** | The App Secret from the same page. Stored as a secret and masked after save. |
+| **Domain** | `feishu` (default) for mainland Feishu apps; select `lark` for international Lark tenants so the SDK uses `open.larksuite.com`. The scan flow fills this automatically. |
+| **Encrypt Key** | Only needed when event encryption is enabled on the platform. Leave blank otherwise. |
+| **Verification Token** | The event Verification Token from the platform; used to verify event signatures. Leave blank if you did not configure one. |
+| **Allow From** | One value per line. Use `*` for an open test bot, or `ou_...` open ids (copy them from the partner logs after a first message). Empty denies everyone. |
+| **React Emoji** | The reaction the bot adds to every message it accepts, as an instant acknowledgement. Default `THUMBSUP`; other common types: `OK`, `EYES`, `DONE`, `OnIt`, `HEART`. |
+| **Group Policy** | `mention` (default): in groups the bot only answers when @mentioned. `open`: it answers every group message. DMs always get a response. |
+| **Reply In Thread** | On by default. Group replies stay in the triggering message's thread. Single chats always get a plain reply. |
+| **Thinking Notice** | On by default. Posts a short thinking notice while the model reasons, and removes it when the answer starts. |
+| **Stream Print Frequency Ms** | CardKit typewriter interval in milliseconds. Default `30`. `0` uses the platform default. |
+| **Stream Print Step** | Characters revealed on each typewriter step. Default `6`. `0` uses the platform default. |
+| **Stream Print Strategy** | `fast` (default) or `delay`. |
+
+
+### Mochat
+
+| Field | What to enter |
+| --- | --- |
+| **Send Progress** | Keep on while testing. It sends narration updates during long turns. |
+| **Send Tool Hints** | Keep on for debugging; turn off if you do not want users to see one-line tool calls. |
+| **Enabled** | Turn on only when you are ready to start the channel. |
+| **Base Url** | Your Mochat instance. Default: `https://mochat.io`. |
+| **Socket Url** | Optional separate Socket.IO endpoint. Blank means use **Base Url**. |
+| **Socket Path** | Socket.IO mount path. Default: `/socket.io`. |
+| **Socket Disable Msgpack** | Off by default (msgpack is used when available). Turn on to force JSON if your server has no msgpack parser. |
+| **Socket Reconnect Delay Ms** | Initial reconnect delay. Default `1000`. |
+| **Socket Max Reconnect Delay Ms** | Reconnect backoff cap. Default `10000`. |
+| **Socket Connect Timeout Ms** | Connection timeout. Default `10000`. |
+| **Refresh Interval Ms** | How often the channel refreshes its session/panel directory. Default `30000`. |
+| **Watch Timeout Ms** | Long-poll timeout in HTTP fallback mode. Default `25000`. |
+| **Claw Token** | Required. The bot token from your Mochat admin panel. |
+| **Sessions** | Session ids to watch, one per line. `*` auto-discovers and subscribes new sessions. |
+| **Panels** | Panel ids to watch, one per line. `*` auto-discovers panels. Leave both lists empty and the channel watches nothing. |
+| **Allow From** | One value per line. Use `*` for an open test channel, or specific Mochat user ids. Empty denies access. |
+
+| Field | Notes |
+| --- | --- |
+| **Watch Limit** | Max events fetched per poll. Default `100`. |
+| **Retry Delay Ms** | Delay between failed HTTP retries. Default `500`. |
+| **Max Retry Attempts** | Maximum Socket.IO reconnection attempts. `0` means reconnect forever. This field does not cap HTTP fallback loops. |
+| **Agent User Id** | The bot's own Mochat user id. Used to ignore the bot's own messages and to detect @-mentions. |
+| **Mention** | `require_in_groups` — require an @-mention before answering in group sessions. |
+| **Groups** | Per-group overrides, keyed by group id: `{"": {"require_mention": true}}`. |
+| **Reply Delay Mode** | `non-mention` (default) buffers panel messages that do not mention the bot; any other value disables buffering. |
+| **Reply Delay Ms** | Buffer window. Default `120000` (2 minutes). |
+
+
+### QQ / NapCat
+
+| Field | Notes |
+| --- | --- |
+| `enabled` | Start the channel with the partner. |
+| `app_id` | App ID from Tencent's bot platform. |
+| `secret` | Bot secret. |
+| `allow_from` | Allowed QQ user ids / openids. Empty denies access; use explicit ids for production. |
+| `msg_format` | `plain` or `markdown`. Start with `plain` if clients render Markdown inconsistently. |
+
+
+
+| Field | Notes |
+| --- | --- |
+| `enabled` | Start the channel with the partner. |
+| `ws_url` | NapCat WebSocket endpoint, default `ws://127.0.0.1:3001`. |
+| `access_token` | Optional OneBot access token. |
+| `allow_from` | Allowed user ids. Use `*` only for local testing. |
+| `group_policy` | `mention`, `open`, or a probability between `0` and `1`. Mentions/replies always respond. |
+| `group_policy_overrides` | Per-group policy map, keyed by group id. |
+| `welcome_new_members` | Whether to welcome new group members. |
+| `max_image_bytes` | Hard cap for inbound image downloads. |
+
+
+### WeCom (WeChat Work)
+
+| Field | Notes |
+| --- | --- |
+| `enabled` | Start this channel when the partner starts. |
+| `bot_id` | Bot ID from WeCom AI Bot platform. |
+| `secret` | Secret from WeCom. Treat it as a credential. |
+| `allow_from` | User ids allowed to talk to this partner. Empty denies access; `*` opens it where supported by the base channel policy. |
+| `welcome_message` | Optional text sent when a user opens the chat. |
+| `send_progress` / `send_tool_hints` | Delivery switches for narration and one-line tool calls. |
+
+
+### WeChat (Personal Weixin)
+
+| Field | What to enter |
+| --- | --- |
+| **Send Progress** | Keep on while testing. It sends narration updates during long turns. |
+| **Send Tool Hints** | Keep on for debugging; turn off if you do not want users to see one-line tool calls. |
+| **Enabled** | Turn on only when you are ready to login/start the channel. |
+| **Allow From** | One value per line. Use `*` for an open test channel, or specific WeChat user ids once you know them. Empty denies access. |
+| **Base Url** | Default: `https://ilinkai.weixin.qq.com`. Usually leave unchanged. |
+| **Cdn Base Url** | Default: `https://novac2c.cdn.weixin.qq.com/c2c`. Used for media upload/download. |
+| **Route Tag** | Optional Tencent route tag. Leave blank unless your deployment requires it. |
+| **Token** | Optional bot token. Leave blank for QR-code login; the channel saves the token after a successful scan. |
+| **State Dir** | Optional custom state directory. Blank means DeepTutor uses `data/partners//channels/weixin/` for `account.json`. |
+| **Poll Timeout** | Long-poll timeout in seconds. `35` is the default and works for most networks. |
+
+
+### Discord
+
+| Field | What to enter |
+| --- | --- |
+| **Streaming** | Off by default. Streams the reply live by editing the message in place as text arrives. Requires **Send Progress**: narration rounds stream as they happen. |
+| **Send Progress** | Keep on while testing. It delivers narration updates during long turns. |
+| **Send Tool Hints** | Keep on for debugging; turn off if users should not see one-line tool calls. |
+| **Enabled** | Turn on only when you are ready to start the channel. |
+| **Token** | The bot token from the Developer Portal (**Bot** -> **Reset Token**). Stored as a secret and masked after save. |
+| **Allow From** | One value per line. Use `*` for an open test bot, or Discord user ids (right-click -> Copy User ID with Developer Mode on). Empty denies everyone. |
+| **Gateway Url** | Default `wss://gateway.discord.gg/?v=10&encoding=json`. Change it only if you proxy the gateway. |
+| **Intents** | Gateway intent bitfield. The default `37377` covers Guilds, Guild Messages, Direct Messages, and Message Content. Any privileged intent in this number must also be enabled in the Developer Portal. |
+| **Group Policy** | `mention` (default): in server channels the bot only answers when @mentioned. `open`: it answers every message in channels it can read. DMs always get a response. |
+
+
+### Email
+
+| Field | What to enter |
+| --- | --- |
+| **Send Progress** | Each progress update becomes a separate email. Fine for a first test; most deployments turn it off to keep inboxes quiet. |
+| **Send Tool Hints** | Same caveat — one email per hint. Turn off outside debugging. |
+| **Enabled** | Turn on when you are ready to start polling. |
+| **Consent Granted** | Hard privacy gate. The channel refuses to read or send any mail until this is on. Enable it only after the mailbox owner has explicitly agreed to let DeepTutor process the inbox. |
+| **Imap Host** | e.g. `imap.gmail.com`. |
+| **Imap Port** | Default `993` (IMAP over SSL). |
+| **Imap Username** | Usually the full address, e.g. `tutor@example.com`. |
+| **Imap Password** | The App Password (Gmail/Outlook with 2FA) or account password (self-hosted). Stored as a secret. |
+| **Imap Mailbox** | Default `INBOX`. Some providers spell folders differently — check webmail if polling finds nothing. |
+| **Imap Use Ssl** | Keep on for port 993. |
+| **Smtp Host** | e.g. `smtp.gmail.com`. |
+| **Smtp Port** | Default `587` (STARTTLS). Use `465` together with **Smtp Use Ssl**. |
+| **Smtp Username** | Usually the same as Imap Username. |
+| **Smtp Password** | Usually the same App Password. Stored as a secret. |
+| **Smtp Use Tls** | STARTTLS on port 587. Keep on unless you switch to implicit SSL below. |
+| **Smtp Use Ssl** | Implicit SSL, typically port 465. Enable one of the two TLS options, not both. |
+| **From Address** | Optional. Blank falls back to Smtp Username, then Imap Username. |
+| **Auto Reply Enabled** | When off, the Partner stops replying automatically to inbound mail (proactive sends still work). Useful as a brake while testing. |
+| **Poll Interval Seconds** | Default `30`. How often the inbox is checked; values below 5 are clamped to 5. |
+| **Mark Seen** | Marks processed mail as read — this is the primary duplicate protection. Leave on. |
+| **Max Body Chars** | Default `12000`. Longer bodies are truncated before reaching the Partner. |
+| **Subject Prefix** | Default `Re: `. Prepended to reply subjects unless the subject already starts with `Re:`. |
+| **Allow From** | One email address per line, lowercase. `*` for an open test channel. Empty denies everyone. |
+
+
+### Matrix
+
+| Field | What to enter |
+| --- | --- |
+| **Send Progress** | Keep on while testing. It sends narration updates during long turns. |
+| **Send Tool Hints** | Keep on for debugging; turn off if you do not want users to see one-line tool calls. |
+| **Enabled** | Turn on when you are ready to start the channel. |
+| **Homeserver** | Default `https://matrix.org`. Use your own server's URL if self-hosted. |
+| **Access Token** | The token from Element or the login API. Stored as a secret. |
+| **User Id** | The bot's full Matrix id, e.g. `@my-bot:matrix.org`. Also used to detect mentions. |
+| **Device Id** | Optional but recommended: pick any stable string and keep it. If blank, a restart may replay recent messages. |
+| **E2Ee Enabled** | Turn on only after installing the `[matrix-e2e]` extra plus libolm. Without them the bot cannot decrypt encrypted rooms. |
+| **Sync Stop Grace Seconds** | Default `2`. How long an in-flight sync may finish during shutdown. Rarely changed. |
+| **Max Media Bytes** | Default `20971520` (20 MB). Size cap for attachment uploads and downloads. |
+| **Allow From** | One Matrix user id per line, e.g. `@frank:matrix.org`. `*` for an open test channel. Empty denies everyone — including room invites. |
+| **Group Policy** | For multi-person rooms: `open` (default) answers every message, `mention` answers only when the bot is mentioned, `allowlist` answers only in rooms listed below. Direct 1:1 chats are always answered. |
+| **Group Allow From** | Room ids (`!abc123:matrix.org`), one per line. Only used with the `allowlist` policy. |
+| **Allow Room Mentions** | Whether an `@room` ping counts as mentioning the bot under the `mention` policy. Off by default. |
+
+
+### Mattermost
+
+| Field | What to enter |
+| --- | --- |
+| **Send Progress** | Keep on while testing. It delivers narration updates during long turns. |
+| **Send Tool Hints** | Keep on for debugging; turn off if users should not see one-line tool calls. |
+| **Enabled** | Turn on only when you are ready to start the channel. |
+| **Server Url** | Your Mattermost base URL, e.g. `https://mattermost.example.com`. The scheme is optional (defaults to `https`) and the WebSocket URL is derived automatically — do not append `/api/v4`. |
+| **Bot Token** | The bot account's access token from **Integrations -> Bot Accounts**. Stored as a secret and masked after save. |
+| **Allow From** | One value per line. Use `*` for an open test bot, or Mattermost user ids. Empty denies everyone. |
+| **Group Policy** | `mention` (default): in channels the bot only answers when @mentioned. `open`: it answers every message in channels it has joined. Direct messages always get a reply. |
+| **Reply In Thread** | On (default): the bot answers in a thread rooted at the triggering post. Thread follow-ups still pass **Group Policy** first, so with the default `mention` policy they must @mention the bot. Off: replies go straight into the channel. |
+| **Verify Ssl** | On (default). Turn off only for a self-hosted server whose TLS certificate is self-signed or issued by an internal CA. |
+
+
+### Microsoft Teams
+
+| Field | What to enter |
+| --- | --- |
+| **Send Progress** | Keep on while testing. It delivers narration updates during long turns. |
+| **Send Tool Hints** | Keep on for debugging; turn off if users should not see one-line tool calls. |
+| **Enabled** | Turn on only when you are ready to start the channel. |
+| **App Id** | The Application (client) ID of the app registration. Also used as the expected audience when validating inbound JWTs. |
+| **App Password** | The client secret value. Stored as a secret and masked after save. |
+| **Tenant Id** | The Directory (tenant) ID. Required for single-tenant registrations; leave blank only for multi-tenant bots. |
+| **Host** | Bind address for the built-in HTTP server. Default `0.0.0.0` listens on all interfaces; use `127.0.0.1` if a local reverse proxy is the only client. |
+| **Port** | Listening port. Default `3978`, the Bot Framework convention. It must be unique among all enabled Teams Partners running on the same host. |
+| **Path** | URL path for inbound activities. Default `/api/messages`; it must match the tail of the messaging endpoint. |
+| **Allow From** | One value per line. Use `*` for a first test, or Microsoft Entra object ids — the partner logs print the id of any denied sender. Empty denies everyone. |
+| **Reply In Thread** | When on (default), replies attach to the triggering message instead of starting a new one. |
+| **Mention Only Response** | The text sent back when a message contains nothing but the bot @mention. |
+| **Validate Inbound Auth** | Keep on. Verifies the Bot Framework JWT on every request (RS256 against Microsoft's published keys, audience = App Id). Turning it off lets anyone who finds the URL talk to your partner as any user — local testing only. |
+| **Ref Ttl Days** | Days an idle conversation reference is kept before pruning. Default `30`. |
+| **Prune Web Chat Refs** | Drops Bot Framework Web Chat conversations from the stored references (Web Chat is not supported). |
+| **Prune Non Personal Refs** | Drops group/channel conversation references; the channel is DM-only for now. |
+| **Ref Touch Interval S** | Minimum seconds between timestamp refreshes on an active conversation reference. Default `300`. |
+| **Trusted Service Url Hosts** | Allowlist of Bot Framework hosts the channel accepts and replies to. The default covers the public, GCC, and DoD Teams clouds — extend it only if Microsoft routes you elsewhere. |
+
+
+### Slack
+
+| Field | What to enter |
+| --- | --- |
+| **Send Progress** | Keep on while testing. It delivers narration updates during long turns. |
+| **Send Tool Hints** | Keep on for debugging; turn off if users should not see one-line tool calls. |
+| **Enabled** | Turn on only when you are ready to start the channel. |
+| **Mode** | `socket` is the only supported mode. Leave it unchanged. |
+| **Webhook Path** | Reserved for a future webhook mode; unused while **Mode** is `socket`. Leave the default `/slack/events`. |
+| **Bot Token** | The `xoxb-…` token from **OAuth & Permissions**. Stored as a secret and masked after save. |
+| **App Token** | The `xapp-…` App-Level Token from **Socket Mode** (needs `connections:write`). Also a secret. Do not swap it with the Bot Token. |
+| **User Token Read Only** | Keep the default (on). |
+| **Reply In Thread** | On (default): the bot answers in a thread under the triggering message. Follow-ups in that thread still pass **Group Policy** first, so with the default `mention` policy they must @mention the bot. Off: replies go straight into the channel. |
+| **React Emoji** | Emoji name (no colons) the bot adds to your message as a receipt acknowledgement. Default `eyes`. |
+| **Allow From** | One value per line. Use `*` for an open test bot, or Slack user ids (`U…`). Empty denies everyone. |
+| **Group Policy** | `mention` (default): in channels the bot only answers @mentions. `open`: it answers every message in channels it is in. `allowlist`: only channels listed in **Group Allow From**. |
+| **Group Allow From** | Channel ids (`C…`), one per line. Used when **Group Policy** is `allowlist`. |
+| **Dm** | DM sub-policy: **Enabled** toggles DMs as a whole; **Policy** `open` answers any DM, `allowlist` restricts DMs to the ids in its own **Allow From** list. |
+
+
+### Telegram
+
+| Field | What to enter |
+| --- | --- |
+| **Streaming** | Off by default. Streams the reply live by editing the Telegram message in place as text arrives. Requires **Send Progress**: narration rounds stream as they happen. |
+| **Send Progress** | Keep on while testing. It delivers narration updates during long turns. |
+| **Send Tool Hints** | Keep on for debugging; turn off if users should not see one-line tool calls. |
+| **Enabled** | Turn on only when you are ready to start the channel. |
+| **Token** | The HTTP API token from BotFather. Stored as a secret and masked after save. |
+| **Allow From** | One value per line. Use `*` for an open test bot, or numeric user ids from `@userinfobot` (usernames also match). Empty denies everyone. |
+| **Proxy** | Optional proxy URL for networks where Telegram is unreachable, e.g. `socks5://127.0.0.1:1080` or `http://proxy:8080`. Leave blank for a direct connection. |
+| **Reply To Message** | When on, the bot's answers quote the message that triggered them. Useful in busy groups, redundant in DMs. |
+| **Group Policy** | Fallback for groups: `mention` (default) requires an @mention or bot reply; `open` answers every message. DMs bypass group policies; **Allow From** still applies. |
+| **Chat Policies** | Per-chat overrides keyed by `chat_id`: `open`, `mention`, or `topics_only`. The latter auto-replies in `allowed_topics`; elsewhere an @mention or bot reply is required. First matching rule wins. |
+| **Connection Pool Size** | HTTP connection pool for the Bot API client. Default `16` is fine for one bot. |
+| **Pool Timeout** | Seconds to wait for a free pooled connection. Default `15`. |
+| **Stream Edit Interval** | Minimum seconds between in-place edits while streaming. Default `0.6`; raise it if Telegram answers with flood-control errors. |
+
+
+### WhatsApp
+
+| Field | What to enter |
+| --- | --- |
+| **Send Progress** | Keep on while testing. It sends narration updates during long turns. |
+| **Send Tool Hints** | Keep on for debugging; turn off if you do not want users to see one-line tool calls. |
+| **Enabled** | Turn on only when the bridge is running and you are ready to start the channel. |
+| **Bridge Url** | WebSocket URL of the bridge. Default: `ws://localhost:3001`. |
+| **Bridge Token** | Optional shared secret. Set it only if your bridge checks the `auth` message. |
+| **Allow From** | One value per line. Use `*` for an open test channel, or specific sender ids (the part before `@` in WhatsApp ids — usually the phone number). Empty denies access. |
+
+
+### Zulip
+
+| Field | What to enter |
+| --- | --- |
+| **Send Progress** | Keep on while testing. It sends narration updates during long turns. |
+| **Send Tool Hints** | Keep on for debugging; turn off if you do not want users to see one-line tool calls. |
+| **Enabled** | Turn on when you are ready to start the channel. |
+| **Site** | Your Zulip server URL, e.g. `https://yourorg.zulipchat.com`. Include the scheme and the correct realm subdomain. |
+| **Email** | The bot's generated email from the creation page — not your own. |
+| **Api Key** | The bot's API key. Stored as a secret. |
+| **Allow From** | One Zulip user id or email per line — either form matches. `*` for an open test channel. Empty denies everyone. |
+| **Group Policy** | For stream messages: `mention` (default) answers only when the bot is @-mentioned, `open` answers every message in subscribed streams. Direct messages are always answered. |
+| **Subscribe Streams** | Stream names, one per line. The channel subscribes the bot to them at startup. |
+| **Timeout** | Event-queue long-poll timeout in seconds. Default `60` works for most servers. |
diff --git a/docs/src/content/docs/cli/server-api.md b/docs/src/content/docs/cli/server-api.md
deleted file mode 100644
index e2e76a289..000000000
--- a/docs/src/content/docs/cli/server-api.md
+++ /dev/null
@@ -1,368 +0,0 @@
----
-title: Server API
-description: The HTTP and WebSocket surface exposed by deeptutor serve -- for custom frontends and integrations.
-quadrant: reference
----
-
-`deeptutor serve` exposes a FastAPI backend at `http://localhost:8001/` unless you configured a different backend port. This page gives the high-signal map for custom frontends, mobile apps, and service-to-service integrations.
-
-For the exhaustive, always-current schema, start the server and open:
-
-```text
-GET /openapi.json # Full OpenAPI 3.1 spec
-GET /docs # Interactive Swagger UI
-GET /redoc # Alternative ReDoc UI
-```
-
-## Starting the server
-
-```bash
-# Backend only. Port comes from data/user/settings/system.json, default 8001.
-deeptutor serve
-
-# Custom host/port for this process
-deeptutor serve --host 127.0.0.1 --port 18001
-
-# Development: hot reload on Python file changes
-deeptutor serve --reload
-```
-
-## Authentication
-
-When enabled, protected routes require a Bearer JWT or `dt_token` cookie. Auth routes mix public login/bootstrap and guarded profile/admin endpoints; `GET /api/settings/ui` is public. MarginNote `/sync` and `/heartbeat` use `Authorization: MarginNote :`.
-
-```bash
-# Login
-curl -X POST http://localhost:8001/api/auth/login \
- -c cookies.txt \
- -H "Content-Type: application/json" \
- -d '{"username":"alice","password":"..."}'
-
-# Response contains user metadata; the JWT is set in the dt_token cookie.
-
-# Reuse the cookie
-curl -b cookies.txt http://localhost:8001/api/sessions
-```
-
-If auth is disabled, auth dependencies are no-ops and local single-user requests do not need a token.
-
-## Turn execution WebSocket
-
-```text
-WS /ws
-```
-
-This is the unified turn WebSocket used by the Web UI. It supports every capability uniformly and streams the same event family that `deeptutor run --format json` prints.
-
-Start a turn by sending a `type: "start_turn"` or `type: "message"` payload:
-
-```json
-{
- "type": "start_turn",
- "protocol_version": "2.0",
- "content": "Find d/dx [sin(x^2)]",
- "capability": "deep_solve",
- "session_id": null,
- "tools": ["reason"],
- "knowledge_bases": ["math"],
- "language": "en",
- "config": {},
- "notebook_references": [],
- "history_references": [],
- "partner_group_references": [],
- "attachments": []
-}
-```
-
-The example above shows the payload for one turn. Every client frame on `/ws` must also carry `"protocol_version": "2.0"` — `start_turn`, `subscribe_turn`, `cancel_turn`, `ping`, and the rest. A frame that omits it is rejected with a `protocol_error` event (`error_code: "unsupported_protocol_version"`) before the payload is validated against any command model.
-
-`skills` narrows the turn rather than being ignored: the selection is intersected with the workspace allowlist, so a turn that names skills gives `read_skill` only those. Omitting it, or sending an empty list, inherits the workspace's full visible set. A turn selection can never exceed what the workspace permits.
-
-Other client types include `subscribe_turn`, `subscribe_session`, `resume_from`, `unsubscribe`, `cancel_turn`, `submit_user_reply`, `regenerate`, and `ping`; subscriptions replay after `after_seq` and terminal turns end with `done` (`error` first on failure).
-
-Typical received events:
-
-```json
-{"type":"stage_start","stage":"responding"}
-{"type":"tool_call","content":"rag","metadata":{"args":{"query":"chain rule","kb_name":"math"}}}
-{"type":"tool_result","content":"...","metadata":{"tool":"rag"}}
-{"type":"content","content":"## Solution\n\nThe derivative..."}
-{"type":"stage_end","stage":"responding"}
-{"type":"done","session_id":"sess_abc123","turn_id":"turn_xyz789","metadata":{"status":"completed"}}
-```
-
-## WebSocket endpoints
-
-```text
-WS /ws
-WS /ws/books
-WS /ws/questions/mimic
-WS /ws/questions/generate
-WS /ws/questions/judge
-WS /ws/knowledge-bases/{kb_name}/progress
-WS /ws/mastery-paths
-WS /ws/partners/{partner_id}
-WS /ws/partner-groups/{group_id}
-```
-
-The legacy `/api/v1/chat`, `/api/v1/ws`, and feature-specific API-prefixed sockets are removed. The list above is the complete canonical WebSocket namespace; `/ws` handles all turn capabilities, replay, cancellation, regeneration, and `ask_user` replies.
-
-## Sessions
-
-```text
-GET /api/sessions List sessions
-GET /api/sessions/{session_id} Get a session + messages
-PATCH /api/sessions/{session_id} Rename (body: {"title":"..."})
-DELETE /api/sessions/{session_id} Delete
-PUT /api/sessions/{session_id}/branch-selection
-DELETE /api/sessions/{session_id}/messages/{message_id}
-POST /api/sessions/{session_id}/quiz-results
-```
-
-Additional session-state endpoints:
-
-```text
-GET /api/sessions/{session_id}/ask-hint
-PATCH /api/sessions/{session_id}/organization
-```
-
-## Knowledge Bases
-
-```text
-GET /api/knowledge-bases List KBs
-GET /api/knowledge-bases/{kb_name} KB info
-DELETE /api/knowledge-bases/{kb_name} Delete
-POST /api/knowledge-bases Create a KB
-POST /api/knowledge-bases/{kb_name}/upload Add documents
-POST /api/knowledge-bases/{kb_name}/reindex Re-embed docs
-GET /api/knowledge-bases/default Get default KB
-PUT /api/knowledge-bases/default/{kb_name} Set default KB
-GET /api/knowledge-bases/supported-file-types Supported uploads
-GET /api/knowledge-bases/{kb_name}/files List source files
-GET /api/knowledge-bases/{kb_name}/files/{filename} Serve a source file (preview / download)
-GET /api/knowledge-bases/{kb_name}/file-preview-text/{filename} Extracted plain-text preview
-GET /api/knowledge-bases/{kb_name}/progress Indexing progress
-WS /ws/knowledge-bases/{kb_name}/progress `task_id` replays terminal; orphan → `knowledge_task_interrupted`
-```
-
-Ad-hoc KB search is exposed through the RAG runtime/tool path rather than a dedicated `POST /knowledge/{name}/search` route in the current API. From CLI, use `deeptutor kb search `.
-
-## Notebook
-
-```text
-GET /api/notebooks
-GET /api/notebooks/statistics
-POST /api/notebooks
-GET /api/notebooks/{notebook_id}
-PUT /api/notebooks/{notebook_id}
-DELETE /api/notebooks/{notebook_id}
-POST /api/notebooks/actions/add-record
-POST /api/notebooks/actions/add-record-with-summary
-DELETE /api/notebooks/{notebook_id}/records/{record_id}
-PUT /api/notebooks/{notebook_id}/records/{record_id}
-POST /api/notebooks/{notebook_id}/records/{record_id}/actions/copy
-POST /api/notebooks/{notebook_id}/records/{record_id}/actions/move
-GET /api/notebooks/{notebook_id}/export
-```
-
-## Memory
-
-```text
-GET /api/memory/overview
-GET /api/memory/doc/{layer}/{key}
-PUT /api/memory/doc/{layer}/{key}
-POST /api/memory/doc/{layer}/{key}/reset
-POST /api/memory/doc/{layer}/{key}/update
-POST /api/memory/doc/{layer}/{key}/audit
-POST /api/memory/doc/{layer}/{key}/dedup
-POST /api/memory/runs/start
-GET /api/memory/runs
-GET /api/memory/runs/{run_id}
-GET /api/memory/runs/{run_id}/events?since=N Absolute N = last_seen_seq + 1
-POST /api/memory/runs/{run_id}/cancel
-POST /api/memory/runs/{run_id}/undo
-GET /api/memory/trace/{surface}
-DELETE /api/memory/trace/{surface}
-GET /api/memory/settings
-PUT /api/memory/settings
-```
-
-Layers are `L2` and `L3`; examples: `/api/memory/doc/L3/profile` and `/api/memory/doc/L2/chat`.
-
-## Settings, tools, visualizers, and system
-
-```text
-GET /api/settings
-GET /api/settings/catalog
-PUT /api/settings/catalog
-POST /api/settings/apply
-POST /api/settings/model-capabilities
-PUT /api/settings/enabled-tools
-GET /api/tools
-GET /api/system/status
-GET /api/system/memory
-GET /api/system/runtime
-GET /api/system/update
-POST /api/system/update/check
-PUT /api/system/update/settings
-GET /api/system/update/job
-POST /api/system/update
-POST /api/system/test/llm
-POST /api/system/test/embeddings
-POST /api/system/test/search
-GET /api/visualizers/list
-POST /api/visualizers/bundled/{visualizer_id}/install
-POST /api/visualizers/{visualizer_id}/enable
-POST /api/visualizers/{visualizer_id}/disable
-DELETE /api/visualizers/{visualizer_id}
-POST /api/visualizers/import
-GET /api/visualizers/{visualizer_id}/assets/{asset_path}
-```
-
-Provider profiles are edited through the catalog endpoints; there are not separate `/settings/llm` or `/settings/embedding` routes in the current API. Capabilities run through the unified WebSocket/CLI contracts. Visualizer imports are declarative browser packages, not executable backend plugins.
-
-## Partners Manager
-
-```text
-GET /api/partners
-POST /api/partners
-GET /api/partners/recent
-GET /api/partners/channels/schema
-GET /api/partners/tool-options
-GET /api/partners/souls
-POST /api/partners/souls
-GET /api/partners/soul-sources
-GET /api/partners/{partner_id}
-PATCH /api/partners/{partner_id}
-POST /api/partners/{partner_id}/start
-POST /api/partners/{partner_id}/stop
-DELETE /api/partners/{partner_id}
-POST /api/partners/{partner_id}/channels/reload
-GET /api/partners/{partner_id}/channels/status
-POST /api/partners/{partner_id}/channel-onboarding/start
-GET /api/partners/{partner_id}/channel-onboarding/{session_id}
-DELETE /api/partners/{partner_id}/channel-onboarding/{session_id}
-POST /api/partners/{partner_id}/channel-onboarding/{session_id}/apply
-GET /api/partners/{partner_id}/soul
-PUT /api/partners/{partner_id}/soul
-GET /api/partners/{partner_id}/assets
-POST /api/partners/{partner_id}/assets
-DELETE /api/partners/{partner_id}/assets/{asset_type}/{name}
-GET /api/partners/{partner_id}/history
-GET /api/partners/{partner_id}/sessions
-POST /api/partners/{partner_id}/sessions/archive
-POST /api/partners/{partner_id}/sessions/resume
-POST /api/partners/{partner_id}/sessions/delete
-POST /api/partners/{partner_id}/sessions/branch
-POST /api/partners/{partner_id}/chat
-POST /api/partners/{partner_id}/chat/execute-stream
-WS /ws/partners/{partner_id}
-```
-
-Authenticated users may create Partners. Resource routes enforce **use** or **manage** rights; owners/admins manage, while grants can be conversation-only. Secrets are masked unless manageable callers request `include_secrets=true`.
-
-## Book Engine
-
-```text
-GET /api/books
-POST /api/books
-GET /api/books/block-types Available generated content types
-GET /api/books/{book_id}
-GET /api/books/{book_id}/spine
-GET /api/books/{book_id}/pages/{page_id}
-DELETE /api/books/{book_id}
-POST /api/books/confirm-proposal
-POST /api/books/confirm-spine
-POST /api/books/compile-page
-POST /api/books/pause Persist, cancel work, keep completed pages
-POST /api/books/resume Queue unfinished pages only
-POST /api/books/{book_id}/refresh-fingerprints
-WS /ws/books Subscribe with `after_seq`; may acknowledge reset
-```
-
-## Immersive Reading
-
-```text
-GET /api/reading/supported-formats Extensions, size cap, raw-view formats
-GET /api/reading/materials List this account's materials
-POST /api/reading/materials Upload a document (multipart)
-GET /api/reading/materials/{material_id} Manifest: unit kind, unit count, outline
-DELETE /api/reading/materials/{material_id} Forget a material
-GET /api/reading/materials/{material_id}/units/{locator} One unit's text
-GET /api/reading/materials/{material_id}/revisions Prior immutable URL snapshots
-GET /api/reading/materials/{material_id}/revisions/{revision}/units/{locator}
-GET /api/reading/materials/{material_id}/raw Original bytes (PDF)
-GET /api/reading/materials/{material_id}/assets/{asset_name} Authenticated snapshot image
-GET /api/reading/materials/{material_id}/bookmarks List bookmarks
-POST /api/reading/materials/{material_id}/bookmarks Save a bookmark
-DELETE /api/reading/materials/{material_id}/bookmarks/{bookmark_id}
-GET /api/reading/materials/{material_id}/annotations List annotations
-PUT /api/reading/materials/{material_id}/annotations Create or update one; returns AnnotationInfo
-DELETE /api/reading/materials/{material_id}/annotations/{id} Delete one
-GET /api/reading/materials/{material_id}/export?fmt=auto|pdf|markdown
-```
-
-A material is content-addressed: uploading the same bytes twice returns the same `material_id` and keeps the annotations already on it. `export?fmt=pdf` returns the original file with real PDF annotations written in, and is only available for materials that kept their raw bytes.
-
-URL refreshes preserve immutable prior revisions. Snapshot assets are authenticated, MIME-sniffed, and served with `nosniff` rather than exposing a live third-party page inside the reader.
-
-## Immersive Watching
-
-```text
-GET /api/settings/video-learning
-PUT /api/settings/video-learning
-POST /api/settings/video-learning/test-invidious
-POST /api/video-learning/materials/resolve
-GET /api/video-learning/materials/{material_id}
-PUT /api/video-learning/materials/{material_id}/progress
-GET /api/video-learning/materials/{material_id}/subtitles.vtt
-GET|HEAD /api/video-learning/materials/{material_id}/stream/{format_id}
-```
-
-These compatibility endpoints retain YouTube playback, transcript cues, and provider-independent progress. Current video sessions use Reading; legacy Watching sessions migrate when reopened. Resolve accepts a YouTube URL and optional language/provider override; VTT returns normalized cues.
-
-## Other routers
-
-Not every surface is expanded above. These exist and follow the same conventions; use `/openapi.json` for their schemas:
-
-```text
-/api/skills Skill library and hub installs
-/api/personas Persona presets
-/api/plugins Managed plugin lifecycle and approvals
-/api/learning-journal Workspace missions, handoffs, and confirmed records
-/api/documents Co-Writer documents and edit streams
-/api/mastery-paths Mastery paths, objectives, and progress
-/api/subagents Connected agent configuration
-/api/imports Claude Code / Codex conversation import
-/api/space/mcp Per-account MCP services and the curated catalog
-/api/space/cli-apps CLI app catalog, installs, and grants
-/api/voice Text-to-speech and speech-to-text
-/api/dashboard Recent activity, starter suggestions/refresh, and activity detail
-```
-
-## Outputs and attachments
-
-User-generated artifacts are served by an authenticated, request-scoped router:
-
-```text
-GET /files/outputs/
-```
-
-Requests resolve allowlisted files in the caller's or one visible Partner workspace; invalid/private/traversal paths fail closed. Original chat attachments are served under:
-
-```text
-GET /files/attachments/{session_id}/{attachment_id}/{filename}
-```
-
-## Generate a typed client
-
-```bash
-curl http://localhost:8001/openapi.json > deeptutor.openapi.json
-
-# TypeScript client
-npx openapi-typescript deeptutor.openapi.json -o deeptutor.d.ts
-
-# Python client
-pip install openapi-python-client
-openapi-python-client generate --path deeptutor.openapi.json
-```
diff --git a/docs/src/content/docs/explore/subagents.md b/docs/src/content/docs/customize/agents.md
similarity index 95%
rename from docs/src/content/docs/explore/subagents.md
rename to docs/src/content/docs/customize/agents.md
index b754ee46f..ab1456a82 100644
--- a/docs/src/content/docs/explore/subagents.md
+++ b/docs/src/content/docs/customize/agents.md
@@ -70,6 +70,6 @@ Imported agents show their source, conversation count, and last sync time. From
## See also
-- [Home](/explore/chat-workspace/) — where you consult and reference agents
-- [Partners](/explore/partners/) — connect a Partner as a consultable agent
-- [Memory](/explore/memory/) — how imported context is kept separable from DeepTutor's own voice
+- [Home](/learning-workspace/chat/) — where you consult and reference agents
+- [Partners](/channels/) — connect a Partner as a consultable agent
+- [Memory](/learning-workspace/memory/) — how imported context is kept separable from DeepTutor's own voice
diff --git a/docs/src/content/docs/ecosystem/cli-apps.md b/docs/src/content/docs/customize/cli-apps.md
similarity index 94%
rename from docs/src/content/docs/ecosystem/cli-apps.md
rename to docs/src/content/docs/customize/cli-apps.md
index 21db72a9d..91eef8a99 100644
--- a/docs/src/content/docs/ecosystem/cli-apps.md
+++ b/docs/src/content/docs/customize/cli-apps.md
@@ -47,7 +47,7 @@ Administrators manage the installed environment and enabled state. If an update
## See also
-- [MCP Services](/ecosystem/mcp/) — connect remote tools without installing host code
-- [Home](/explore/chat-workspace/) — where permitted CLI Apps become callable tools
-- [Multi-User Deployment](/get-started/multi-user/) — grant apps to accounts
+- [MCP Services](/customize/mcp/) — connect remote tools without installing host code
+- [Home](/learning-workspace/chat/) — where permitted CLI Apps become callable tools
+- [Multi-User Deployment](/self-hosting/multi-user/) — grant apps to accounts
diff --git a/docs/src/content/docs/ecosystem/eduhub.md b/docs/src/content/docs/customize/eduhub.md
similarity index 92%
rename from docs/src/content/docs/ecosystem/eduhub.md
rename to docs/src/content/docs/customize/eduhub.md
index 56ba37213..deca0035b 100644
--- a/docs/src/content/docs/ecosystem/eduhub.md
+++ b/docs/src/content/docs/customize/eduhub.md
@@ -48,7 +48,7 @@ deeptutor skill install clawhub:
## See also
-- [Skills](/ecosystem/skills/) — how Skills work after they enter DeepTutor
-- [CLI commands](/cli/commands/) — full Skill command reference
-- [DeepTutor Ecosystem](/ecosystem/) — compare Skills with MCP Services and CLI Apps
+- [Skills](/customize/skills/) — how Skills work after they enter DeepTutor
+- [CLI commands](/developers/reference/cli/) — full Skill command reference
+- [DeepTutor Ecosystem](/customize/) — compare Skills with MCP Services and CLI Apps
diff --git a/docs/src/content/docs/customize/index.md b/docs/src/content/docs/customize/index.md
new file mode 100644
index 000000000..fb1cba0af
--- /dev/null
+++ b/docs/src/content/docs/customize/index.md
@@ -0,0 +1,23 @@
+---
+title: Customize
+description: How account-level personas, skills, and connections relate to a workspace.
+quadrant: explanation
+---
+
+**Personalization** is the account shelf. A workspace holds the work: conversations, learning activities, and materials. The shelf supplies ways of working that stay available when you switch workspaces. A workspace still decides which of those resources a turn may use, and a conversation can narrow that further. Nothing on the shelf is visible to another account.
+
+| You keep it here | It is |
+| --- | --- |
+| [Personas](/customize/personas/) | A voice and a response policy for a turn |
+| [My Agents](/customize/agents/) | A connected harness, or an imported transcript you can consult |
+| [Skills](/customize/skills/) | A reusable procedure the model reads when the task calls for it |
+| [MCP services](/customize/mcp/) | Tools from a remote server, authorized on the account |
+| [CLI Apps](/customize/cli-apps/) | A program an administrator installed, run in a sandbox |
+| [Memory](/learning-workspace/memory/) | Preferences and summaries you can open and correct |
+| [EduHub](/customize/eduhub/) | Community skills you review before import |
+
+Retrieval is not one of those account objects. A [RAG integration](/customize/rag/) belongs to a knowledge base and the files that base indexes.
+
+Each path has its own trust boundary. A skill is instructions. An MCP service is a remote tool boundary. A CLI app is code on the host. EduHub distributes skills and does not run them. The workspace assignment references the account catalog. It does not copy credentials or bypass a per-user grant.
+
+A partner can start from a persona, then keep its own soul, library, and channels. That identity is the partner's, so later edits to the persona do not rewrite it. See [Channels](/channels/).
diff --git a/docs/src/content/docs/ecosystem/mcp.md b/docs/src/content/docs/customize/mcp.md
similarity index 94%
rename from docs/src/content/docs/ecosystem/mcp.md
rename to docs/src/content/docs/customize/mcp.md
index 8dcbded7b..e6550eb30 100644
--- a/docs/src/content/docs/ecosystem/mcp.md
+++ b/docs/src/content/docs/customize/mcp.md
@@ -50,7 +50,7 @@ Disabling or removing a server makes its tools unavailable. Review its reference
## See also
-- [Skills](/ecosystem/skills/) — instruction-only workflow extensions
-- [CLI Apps](/ecosystem/cli-apps/) — sandboxed command-line tools installed on the deployment
-- [Multi-User Deployment](/get-started/multi-user/) — edit per-account grants
+- [Skills](/customize/skills/) — instruction-only workflow extensions
+- [CLI Apps](/customize/cli-apps/) — sandboxed command-line tools installed on the deployment
+- [Multi-User Deployment](/self-hosting/multi-user/) — edit per-account grants
diff --git a/docs/src/content/docs/customize/personas.md b/docs/src/content/docs/customize/personas.md
new file mode 100644
index 000000000..1d0c889a3
--- /dev/null
+++ b/docs/src/content/docs/customize/personas.md
@@ -0,0 +1,24 @@
+---
+title: Personas
+description: Create one persona and use it for a chat turn.
+quadrant: how-to
+---
+
+A persona is an account-level preset: a name, a short description, and Markdown instructions for voice and pedagogy. The capability you select still decides the task. A persona only changes how that task is carried.
+
+## Create one and try it
+
+1. Open **Personalization → Personas**.
+2. Create a preset. Name it, add a one-line description, and write behavior you can test. “Ask for my next step before showing a solution” is a usable instruction.
+3. Save.
+4. In [Chat](/learning-workspace/chat/), choose that persona in the composer and ask one short question.
+5. If the reply ignores the instruction, edit the preset and ask again. Delete the preset when you no longer want it.
+
+`Default` is the plain assistant. Built-ins such as **peer**, **research-assistant**, and **teacher** are available before you create your own. On a shared deployment, deployment presets are read-only for ordinary users. Your own persona with the same name takes precedence.
+
+The same preset can be the starting text for a partner's soul. Creating the partner copies it. Later edits to the persona do not change that partner. Connect the partner in [Channels](/channels/).
+
+## See also
+
+- [Customize](/customize/) — where a persona sits relative to skills and memory
+- [Chat](/learning-workspace/chat/) — the composer control
diff --git a/docs/src/content/docs/ecosystem/rag-integration.md b/docs/src/content/docs/customize/rag.md
similarity index 88%
rename from docs/src/content/docs/ecosystem/rag-integration.md
rename to docs/src/content/docs/customize/rag.md
index 9bf688406..46f220f4a 100644
--- a/docs/src/content/docs/ecosystem/rag-integration.md
+++ b/docs/src/content/docs/customize/rag.md
@@ -4,7 +4,7 @@ description: Choose how DeepTutor retrieves from local indexes, agentic document
quadrant: how-to
---
-DeepTutor treats retrieval as an ecosystem boundary rather than one hard-coded vector store. A Knowledge Base in the [Knowledge Center](/explore/knowledge/) is the user-facing container; its **RAG integration** decides how material is indexed, queried, cited, and kept in sync.
+DeepTutor treats retrieval as an ecosystem boundary rather than one hard-coded vector store. A Knowledge Base in the [Knowledge Center](/learning-workspace/knowledge/) is the user-facing container; its **RAG integration** decides how material is indexed, queried, cited, and kept in sync.
## Available integrations
@@ -55,6 +55,6 @@ LightRAG's extra installs the supported LightRAG SDK only; document parsing rema
## See also
-- [Knowledge Center](/explore/knowledge/) — create, version, sync, and use Knowledge Bases
-- [Immersive Reading](/explore/reading/) — read one collection directly instead of indexing a corpus
-- [Settings](/explore/settings/) — configure embedding providers and document parsing
+- [Knowledge Center](/learning-workspace/knowledge/) — create, version, sync, and use Knowledge Bases
+- [Immersive Reading](/learning-workspace/reading/) — read one collection directly instead of indexing a corpus
+- [Settings](/self-hosting/settings/) — configure embedding providers and document parsing
diff --git a/docs/src/content/docs/ecosystem/skills.md b/docs/src/content/docs/customize/skills.md
similarity index 90%
rename from docs/src/content/docs/ecosystem/skills.md
rename to docs/src/content/docs/customize/skills.md
index a25f3f420..6f2c0940a 100644
--- a/docs/src/content/docs/ecosystem/skills.md
+++ b/docs/src/content/docs/customize/skills.md
@@ -16,7 +16,7 @@ A useful skill says **when** to use it, what inputs it expects, the steps or con
## Import from EduHub
-Choose **Import from EduHub** to browse and download community Skills directly into your library. Imports cross a security gate before they become available. See [EduHub](/ecosystem/eduhub/) for discovery, review, safety checks, publishing, and version management.
+Choose **Import from EduHub** to browse and download community Skills directly into your library. Imports cross a security gate before they become available. See [EduHub](/customize/eduhub/) for discovery, review, safety checks, publishing, and version management.
## Install and publish from the CLI
@@ -48,7 +48,7 @@ Keep reusable procedures in the account library and course-specific variations i
## See also
-- [Personalization](/explore/personalization/) — the account shelf and workspace selection
-- [EduHub](/ecosystem/eduhub/) — discover and publish community Skills
-- [MCP Services](/ecosystem/mcp/) — connect tools that run outside DeepTutor
-- [CLI commands](/cli/commands/) — full command reference
+- [Personalization](/customize/) — the account shelf and workspace selection
+- [EduHub](/customize/eduhub/) — discover and publish community Skills
+- [MCP Services](/customize/mcp/) — connect tools that run outside DeepTutor
+- [CLI commands](/developers/reference/cli/) — full command reference
diff --git a/docs/src/content/docs/developers/architecture.md b/docs/src/content/docs/developers/architecture.md
new file mode 100644
index 000000000..3a576595f
--- /dev/null
+++ b/docs/src/content/docs/developers/architecture.md
@@ -0,0 +1,23 @@
+---
+title: Architecture
+description: How a turn enters DeepTutor and reaches a tool or a capability.
+quadrant: explanation
+---
+
+DeepTutor has three entry points: the CLI, the WebSocket API, and the Python SDK. All three enter the turn application service. That service persists the turn, then the turn engine routes one normalized context to the selected capability. The default capability is `chat`.
+
+```text
+CLI | WebSocket /ws | Python SDK
+ |
+ Turn application service
+ |
+ Turn engine
+ / \
+ Tool registry Capability registry
+```
+
+Tools are single functions the model calls during a turn. Capabilities are multi-stage pipelines that own the turn, such as `deep_solve`, `deep_research`, and `visualize`. The registered names, stages, and CLI aliases are in the [capability reference](/developers/reference/capabilities/).
+
+A running turn speaks the [turn protocol](/developers/reference/turn-protocol/) on `WS /ws`. HTTP routes outside that socket are indexed in the [HTTP API](/developers/reference/http-api/).
+
+Implementation layout, tests, and module ownership stay in the repository's [architecture notes](https://github.com/HKUDS/DeepTutor/blob/dev/docs-for-dev/ARCHITECTURE.md). This site does not publish that tree.
diff --git a/docs/src/content/docs/cli/agent-handoff.md b/docs/src/content/docs/developers/guides/agent-handoff.md
similarity index 97%
rename from docs/src/content/docs/cli/agent-handoff.md
rename to docs/src/content/docs/developers/guides/agent-handoff.md
index b752a393b..b8c2ff490 100644
--- a/docs/src/content/docs/cli/agent-handoff.md
+++ b/docs/src/content/docs/developers/guides/agent-handoff.md
@@ -254,6 +254,6 @@ For RAG-heavy workflows, also allow whatever search provider you've configured (
## See also
-- [**Commands**](/cli/commands/) — full CLI reference
-- [**Interactive REPL**](/cli/chat-repl/) — for human-driven sessions
-- [**Memory**](/explore/memory/) — how persistent state flows through sessions
+- [**Commands**](/developers/reference/cli/) — full CLI reference
+- [**Interactive REPL**](/developers/guides/repl/) — for human-driven sessions
+- [**Memory**](/learning-workspace/memory/) — how persistent state flows through sessions
diff --git a/docs/src/content/docs/cli/index.md b/docs/src/content/docs/developers/guides/cli.md
similarity index 92%
rename from docs/src/content/docs/cli/index.md
rename to docs/src/content/docs/developers/guides/cli.md
index fbd863f54..2d0df27da 100644
--- a/docs/src/content/docs/cli/index.md
+++ b/docs/src/content/docs/developers/guides/cli.md
@@ -8,10 +8,10 @@ DeepTutor is built around an **agent-native CLI**: core runtime surfaces have te
This section covers:
-- [**Commands**](/cli/commands/) — every top-level command and subcommand group with flags, schemas, and examples
-- [**Interactive REPL**](/cli/chat-repl/) — drive a long chat session with `/slash` commands inline
-- [**Agent handoff**](/cli/agent-handoff/) — let Claude Code, Codex, OpenCode, or Hermes drive `deeptutor` for you
-- [**Server API**](/cli/server-api/) — the HTTP / WebSocket surface that `deeptutor serve` exposes
+- [**Commands**](/developers/reference/cli/) — every top-level command and subcommand group with flags, schemas, and examples
+- [**Interactive REPL**](/developers/guides/repl/) — drive a long chat session with `/slash` commands inline
+- [**Agent handoff**](/developers/guides/agent-handoff/) — let Claude Code, Codex, OpenCode, or Hermes drive `deeptutor` for you
+- [**Server API**](/developers/reference/http-api/) — the HTTP / WebSocket surface that `deeptutor serve` exposes
Current dev uses the source installation below from the repository root. With the 1.7.x modular family, bare `deeptutor` supplies core chat/SDK; add feature modules or `[full]` for the broader commands. Inspect `deeptutor module list` and `deeptutor plugin list` before using optional capabilities.
@@ -75,7 +75,7 @@ This means:
| `deeptutor provider` | Provider auth flows | `deeptutor provider login openai-codex` |
| `deeptutor book` | Knowledge Books (Guided Learning) | `deeptutor book list / health` |
-See [**Commands**](/cli/commands/) for the full reference.
+See [**Commands**](/developers/reference/cli/) for the full reference.
## Two modes of use
@@ -93,7 +93,7 @@ $ deeptutor chat --kb physics
You> Explain the chain rule with a worked example
```
-Full guide: [**Interactive REPL**](/cli/chat-repl/).
+Full guide: [**Interactive REPL**](/developers/guides/repl/).
### Mode 2 — Agent-style one-shot
@@ -107,7 +107,7 @@ deeptutor run deep_solve "Find the eigenvalues of [[4,1],[2,3]]" \
Each JSON line is one event — `stage_start`, `content`, `tool_call`, `tool_result`, `thinking`, `done`. You can pipe these into a downstream agent or extract the final answer with `jq`.
-Full guide: [**Agent handoff**](/cli/agent-handoff/).
+Full guide: [**Agent handoff**](/developers/guides/agent-handoff/).
## Where state lives
diff --git a/docs/src/content/docs/contributing.md b/docs/src/content/docs/developers/guides/contributing.md
similarity index 100%
rename from docs/src/content/docs/contributing.md
rename to docs/src/content/docs/developers/guides/contributing.md
diff --git a/docs/src/content/docs/cli/chat-repl.md b/docs/src/content/docs/developers/guides/repl.md
similarity index 97%
rename from docs/src/content/docs/cli/chat-repl.md
rename to docs/src/content/docs/developers/guides/repl.md
index 23c2d12a8..4ea6f6b52 100644
--- a/docs/src/content/docs/cli/chat-repl.md
+++ b/docs/src/content/docs/developers/guides/repl.md
@@ -99,7 +99,7 @@ $
Valid names: `chat`, `ask_questions`, `deep_solve`, `deep_question`, `deep_research`, `visualize`, `math_animator`, `mastery_path`, `immersive_reading`, `video_lesson`, `audio_overview`. CLI aliases also work — `ask`, `solve`, `quiz`, `research`, `viz`, `animate`, `mastery`, `reading` / `read`, `lesson`, and `audio-overview` / `overview`.
-Note that `immersive_reading` runs the loop without a reader: the CLI has no viewport to scroll and no selection to act on, so use it for the web UI (see [Immersive Reading](/explore/reading/)).
+Note that `immersive_reading` runs the loop without a reader: the CLI has no viewport to scroll and no selection to act on, so use it for the web UI (see [Immersive Reading](/learning-workspace/reading/)).
```text
You> /cap deep_solve
@@ -268,5 +268,5 @@ deeptutor notebook add-md my-answer.md --title "Chain rule explana
## See also
-- [**Commands**](/cli/commands/) — full reference for `run`, `kb`, `partner`, etc.
-- [**Agent handoff**](/cli/agent-handoff/) — letting an agent do this for you
+- [**Commands**](/developers/reference/cli/) — full reference for `run`, `kb`, `partner`, etc.
+- [**Agent handoff**](/developers/guides/agent-handoff/) — letting an agent do this for you
diff --git a/docs/src/content/docs/cli/python-sdk.md b/docs/src/content/docs/developers/guides/sdk.md
similarity index 91%
rename from docs/src/content/docs/cli/python-sdk.md
rename to docs/src/content/docs/developers/guides/sdk.md
index 4a2aaba54..bfdd97b18 100644
--- a/docs/src/content/docs/cli/python-sdk.md
+++ b/docs/src/content/docs/developers/guides/sdk.md
@@ -68,6 +68,6 @@ Use the **CLI** for shell pipelines and agent handoff, the **Python SDK** for an
## See also
-- [Agent Handoff](/cli/agent-handoff/) — consume the same stream as NDJSON
-- [Server API](/cli/server-api/) — connect across a process or network boundary
-- [Command Reference](/cli/commands/) — configure and inspect the shared workspace
+- [Agent Handoff](/developers/guides/agent-handoff/) — consume the same stream as NDJSON
+- [Server API](/developers/reference/http-api/) — connect across a process or network boundary
+- [Command Reference](/developers/reference/cli/) — configure and inspect the shared workspace
diff --git a/docs/src/content/docs/developers/reference/capabilities.md b/docs/src/content/docs/developers/reference/capabilities.md
new file mode 100644
index 000000000..d681a72ab
--- /dev/null
+++ b/docs/src/content/docs/developers/reference/capabilities.md
@@ -0,0 +1,21 @@
+---
+title: Capabilities
+description: Registered capability names, stages, owning modules, and CLI aliases.
+quadrant: reference
+---
+
+Names, stages, and CLI aliases come from each capability `manifest` in `deeptutor/modules/manifests/*.json`.
+
+| Capability | Module | Stages | CLI | Description |
+| --- | --- | --- | --- | --- |
+| `audio_overview` | `audio-overview` | `retrieving`, `script_writing`, `voice_generation`, `publishing` | `audio-overview`, `overview` | Create a grounded two-voice audio overview and transcript from a knowledge base. |
+| `chat` | `core` | `exploring`, `responding` | `chat` | Agentic chat: an exploring agent loop with tools, followed by a respond stage that streams the answer. |
+| `ask_questions` | `core` | `responding` | `ask` | Ask the user high-value questions to fill in missing context, then complete the original request with their answers. |
+| `mastery_path` | `mastery` | `responding` | `mastery` | Mastery-based tutoring: a dedicated agent loop drives an adaptive mastery path with a hard, per-type mastery gate and spaced review. |
+| `deep_question` | `questions` | `ideation`, `generation` | `quiz` | Fast question generation (Template batches -> Generate). |
+| `immersive_reading` | `reading` | `responding` | `reading`, `read` | Read a document alongside the assistant, which cites the exact page or section behind every claim. |
+| `math_animator` | `renderer-manim` | `concept_analysis`, `concept_design`, `code_generation`, `code_retry`, `summary`, `render_output` | `animate` | Generate math animations or storyboard images with Manim. |
+| `deep_research` | `research` | `rephrasing`, `decomposing`, `researching`, `reporting` | `research` | Agentic-loop deep research with iterative report generation. |
+| `deep_solve` | `solve` | `responding` | `solve` | Multi-step problem solving driven by the chat agent loop. |
+| `video_lesson` | `video-lesson` | `code_generation`, `render_check`, `render_output` | `lesson` | Generate an animated video lesson (Remotion) that plays in the browser. |
+| `visualize` | `visualize` | `analyzing`, `generating`, `reviewing`, `concept_analysis`, `concept_design`, `code_generation`, `code_retry`, `summary`, `render_output` | `visualize`, `viz` | Generate a validated visualization with any installed visualizer type, or render a Manim animation/storyboard artifact. |
diff --git a/docs/src/content/docs/cli/commands.md b/docs/src/content/docs/developers/reference/cli.md
similarity index 96%
rename from docs/src/content/docs/cli/commands.md
rename to docs/src/content/docs/developers/reference/cli.md
index f82174ad4..38b7d7892 100644
--- a/docs/src/content/docs/cli/commands.md
+++ b/docs/src/content/docs/developers/reference/cli.md
@@ -4,7 +4,7 @@ description: Common deeptutor commands — flags, output schemas, examples.
quadrant: reference
---
-This page documents commonly used `deeptutor` subcommands and flags. For interactive REPL usage, see [**Interactive REPL**](/cli/chat-repl/). For automation patterns, see [**Agent handoff**](/cli/agent-handoff/).
+This page documents commonly used `deeptutor` subcommands and flags. For interactive REPL usage, see [**Interactive REPL**](/developers/guides/repl/). For automation patterns, see [**Agent handoff**](/developers/guides/agent-handoff/).
## `deeptutor run` — single-turn capability execution
@@ -97,7 +97,7 @@ Drop into an interactive chat session with `/slash` commands for in-session conf
deeptutor chat [options]
```
-Options mirror the turn-shaping flags from `run`: `--session`, `--tool / -t`, `--capability / -c`, `--kb`, `--notebook-ref`, `--history-ref`, `--language / -l`, `--config`, and `--config-json`. Full walkthrough at [**Interactive REPL**](/cli/chat-repl/).
+Options mirror the turn-shaping flags from `run`: `--session`, `--tool / -t`, `--capability / -c`, `--kb`, `--notebook-ref`, `--history-ref`, `--language / -l`, `--config`, and `--config-json`. Full walkthrough at [**Interactive REPL**](/developers/guides/repl/).
## `deeptutor init` — guided setup wizard
@@ -406,7 +406,7 @@ Only `create` takes a notebook name, and `list` takes no argument at all. The ot
## `deeptutor memory` — three-layer memory
-DeepTutor stores user memory in three layers (see [**Memory**](/explore/memory/) for the deep dive):
+DeepTutor stores user memory in three layers (see [**Memory**](/learning-workspace/memory/) for the deep dive):
- **L1** — raw event trace per surface (chat, notebook, quiz, etc.)
- **L2** — per-surface curated markdown summaries
@@ -456,7 +456,7 @@ deeptutor partner start math-tutor
Subcommands: `list`, `create`, `start`, `stop`. `create` writes partner config and attempts to start the partner. The Web UI is the recommended place to configure channel schemas, assets, tools, and secrets; the CLI is best for listing, creating, starting, and stopping.
-Partners run inside `data/partners//workspace/`. See [**Partners & Channels**](/partners/) for channel setup.
+Partners run inside `data/partners//workspace/`. See [**Partners & Channels**](/channels/) for channel setup.
## `deeptutor config show`
@@ -581,7 +581,7 @@ deeptutor book health book_abc123
deeptutor book refresh-fingerprints book_abc123
```
-Books are the storage layer for **Guided Learning** journeys. See [**Interactive Book**](/explore/book/).
+Books are the storage layer for **Guided Learning** journeys. See [**Interactive Book**](/learning-workspace/books/).
## `deeptutor workspace` — Content Workspace
@@ -596,7 +596,7 @@ deeptutor workspace set /absolute/path/to/my-folder
deeptutor workspace reset
```
-The content workspace is the one folder agents may read; everything they create lands in its `outputs/`. `show` prints the path, its status, and the output security level — the strength of the boundary that keeps execution out of the rest of the folder. On Docker and server deployments the path is fixed at startup and `set` is refused. See [**Chat workspace**](/explore/chat-workspace/).
+The content workspace is the one folder agents may read; everything they create lands in its `outputs/`. `show` prints the path, its status, and the output security level — the strength of the boundary that keeps execution out of the rest of the folder. On Docker and server deployments the path is fixed at startup and `set` is refused. See [**Chat workspace**](/learning-workspace/chat/).
## Common output schemas
@@ -640,6 +640,6 @@ class TurnRequest(BaseModel):
## See also
-- [**Interactive REPL**](/cli/chat-repl/) — using `deeptutor chat` day-to-day
-- [**Agent handoff**](/cli/agent-handoff/) — letting Claude Code / Codex drive the CLI
-- [**Server API**](/cli/server-api/) — the HTTP / WebSocket surface from `deeptutor serve`
+- [**Interactive REPL**](/developers/guides/repl/) — using `deeptutor chat` day-to-day
+- [**Agent handoff**](/developers/guides/agent-handoff/) — letting Claude Code / Codex drive the CLI
+- [**Server API**](/developers/reference/http-api/) — the HTTP / WebSocket surface from `deeptutor serve`
diff --git a/docs/src/content/docs/developers/reference/http-api.md b/docs/src/content/docs/developers/reference/http-api.md
new file mode 100644
index 000000000..92d58d091
--- /dev/null
+++ b/docs/src/content/docs/developers/reference/http-api.md
@@ -0,0 +1,1404 @@
+---
+title: HTTP API
+description: The HTTP and WebSocket surface exposed by deeptutor serve -- for custom frontends and integrations.
+quadrant: reference
+---
+
+`deeptutor serve` exposes a FastAPI backend at `http://localhost:8001/` unless you configured a different backend port. This page gives the high-signal map for custom frontends, mobile apps, and service-to-service integrations. Turn commands and events are specified in the [turn protocol](/developers/reference/turn-protocol/).
+
+For the exhaustive, always-current schema, start the server and open:
+
+```text
+GET /openapi.json # Full OpenAPI 3.1 spec
+GET /docs # Interactive Swagger UI
+GET /redoc # Alternative ReDoc UI
+```
+
+## Starting the server
+
+```bash
+# Backend only. Port comes from data/user/settings/system.json, default 8001.
+deeptutor serve
+
+# Custom host/port for this process
+deeptutor serve --host 127.0.0.1 --port 18001
+
+# Development: hot reload on Python file changes
+deeptutor serve --reload
+```
+
+## Authentication
+
+When enabled, protected routes require a Bearer JWT or `dt_token` cookie. Auth routes mix public login/bootstrap and guarded profile/admin endpoints; `GET /api/settings/ui` is public. MarginNote `/sync` and `/heartbeat` use `Authorization: MarginNote :`.
+
+```bash
+# Login
+curl -X POST http://localhost:8001/api/auth/login \
+ -c cookies.txt \
+ -H "Content-Type: application/json" \
+ -d '{"username":"alice","password":"..."}'
+
+# Response contains user metadata; the JWT is set in the dt_token cookie.
+
+# Reuse the cookie
+curl -b cookies.txt http://localhost:8001/api/sessions
+```
+
+If auth is disabled, auth dependencies are no-ops and local single-user requests do not need a token.
+
+## Turn execution WebSocket
+
+```text
+WS /ws
+```
+
+This is the unified turn WebSocket used by the Web UI. It supports every capability uniformly and streams the same event family that `deeptutor run --format json` prints.
+
+Start a turn by sending a `type: "start_turn"` or `type: "message"` payload:
+
+```json
+{
+ "type": "start_turn",
+ "protocol_version": "2.0",
+ "content": "Find d/dx [sin(x^2)]",
+ "capability": "deep_solve",
+ "session_id": null,
+ "tools": ["reason"],
+ "knowledge_bases": ["math"],
+ "language": "en",
+ "config": {},
+ "notebook_references": [],
+ "history_references": [],
+ "partner_group_references": [],
+ "attachments": []
+}
+```
+
+The example above shows the payload for one turn. Every client frame on `/ws` must also carry `"protocol_version": "2.0"` — `start_turn`, `subscribe_turn`, `cancel_turn`, `ping`, and the rest. A frame that omits it is rejected with a `protocol_error` event (`error_code: "unsupported_protocol_version"`) before the payload is validated against any command model.
+
+`skills` narrows the turn rather than being ignored: the selection is intersected with the workspace allowlist, so a turn that names skills gives `read_skill` only those. Omitting it, or sending an empty list, inherits the workspace's full visible set. A turn selection can never exceed what the workspace permits.
+
+Other client types include `subscribe_turn`, `subscribe_session`, `resume_from`, `unsubscribe`, `cancel_turn`, `submit_user_reply`, `regenerate`, and `ping`; subscriptions replay after `after_seq` and terminal turns end with `done` (`error` first on failure).
+
+Typical received events:
+
+```json
+{"type":"stage_start","stage":"responding"}
+{"type":"tool_call","content":"rag","metadata":{"args":{"query":"chain rule","kb_name":"math"}}}
+{"type":"tool_result","content":"...","metadata":{"tool":"rag"}}
+{"type":"content","content":"## Solution\n\nThe derivative..."}
+{"type":"stage_end","stage":"responding"}
+{"type":"done","session_id":"sess_abc123","turn_id":"turn_xyz789","metadata":{"status":"completed"}}
+```
+
+## WebSocket endpoints
+
+```text
+WS /ws
+WS /ws/books
+WS /ws/questions/mimic
+WS /ws/questions/generate
+WS /ws/questions/judge
+WS /ws/knowledge-bases/{kb_name}/progress
+WS /ws/mastery-paths
+WS /ws/partners/{partner_id}
+WS /ws/partner-groups/{group_id}
+```
+
+The legacy `/api/v1/chat`, `/api/v1/ws`, and feature-specific API-prefixed sockets are removed. The list above is the complete canonical WebSocket namespace; `/ws` handles all turn capabilities, replay, cancellation, regeneration, and `ask_user` replies.
+
+## Sessions
+
+```text
+GET /api/sessions List sessions
+GET /api/sessions/{session_id} Get a session + messages
+PATCH /api/sessions/{session_id} Rename (body: {"title":"..."})
+DELETE /api/sessions/{session_id} Delete
+PUT /api/sessions/{session_id}/branch-selection
+DELETE /api/sessions/{session_id}/messages/{message_id}
+POST /api/sessions/{session_id}/quiz-results
+```
+
+Additional session-state endpoints:
+
+```text
+GET /api/sessions/{session_id}/ask-hint
+PATCH /api/sessions/{session_id}/organization
+```
+
+## Knowledge Bases
+
+```text
+GET /api/knowledge-bases List KBs
+GET /api/knowledge-bases/{kb_name} KB info
+DELETE /api/knowledge-bases/{kb_name} Delete
+POST /api/knowledge-bases Create a KB
+POST /api/knowledge-bases/{kb_name}/upload Add documents
+POST /api/knowledge-bases/{kb_name}/reindex Re-embed docs
+GET /api/knowledge-bases/default Get default KB
+PUT /api/knowledge-bases/default/{kb_name} Set default KB
+GET /api/knowledge-bases/supported-file-types Supported uploads
+GET /api/knowledge-bases/{kb_name}/files List source files
+GET /api/knowledge-bases/{kb_name}/files/{filename} Serve a source file (preview / download)
+GET /api/knowledge-bases/{kb_name}/file-preview-text/{filename} Extracted plain-text preview
+GET /api/knowledge-bases/{kb_name}/progress Indexing progress
+WS /ws/knowledge-bases/{kb_name}/progress `task_id` replays terminal; orphan → `knowledge_task_interrupted`
+```
+
+Ad-hoc KB search is exposed through the RAG runtime/tool path rather than a dedicated `POST /knowledge/{name}/search` route in the current API. From CLI, use `deeptutor kb search `.
+
+## Notebook
+
+```text
+GET /api/notebooks
+GET /api/notebooks/statistics
+POST /api/notebooks
+GET /api/notebooks/{notebook_id}
+PUT /api/notebooks/{notebook_id}
+DELETE /api/notebooks/{notebook_id}
+POST /api/notebooks/actions/add-record
+POST /api/notebooks/actions/add-record-with-summary
+DELETE /api/notebooks/{notebook_id}/records/{record_id}
+PUT /api/notebooks/{notebook_id}/records/{record_id}
+POST /api/notebooks/{notebook_id}/records/{record_id}/actions/copy
+POST /api/notebooks/{notebook_id}/records/{record_id}/actions/move
+GET /api/notebooks/{notebook_id}/export
+```
+
+## Memory
+
+```text
+GET /api/memory/overview
+GET /api/memory/doc/{layer}/{key}
+PUT /api/memory/doc/{layer}/{key}
+POST /api/memory/doc/{layer}/{key}/reset
+POST /api/memory/doc/{layer}/{key}/update
+POST /api/memory/doc/{layer}/{key}/audit
+POST /api/memory/doc/{layer}/{key}/dedup
+POST /api/memory/runs/start
+GET /api/memory/runs
+GET /api/memory/runs/{run_id}
+GET /api/memory/runs/{run_id}/events?since=N Absolute N = last_seen_seq + 1
+POST /api/memory/runs/{run_id}/cancel
+POST /api/memory/runs/{run_id}/undo
+GET /api/memory/trace/{surface}
+DELETE /api/memory/trace/{surface}
+GET /api/memory/settings
+PUT /api/memory/settings
+```
+
+Layers are `L2` and `L3`; examples: `/api/memory/doc/L3/profile` and `/api/memory/doc/L2/chat`.
+
+## Settings, tools, visualizers, and system
+
+```text
+GET /api/settings
+GET /api/settings/catalog
+PUT /api/settings/catalog
+POST /api/settings/apply
+POST /api/settings/model-capabilities
+PUT /api/settings/enabled-tools
+GET /api/tools
+GET /api/system/status
+GET /api/system/memory
+GET /api/system/runtime
+GET /api/system/update
+POST /api/system/update/check
+PUT /api/system/update/settings
+GET /api/system/update/job
+POST /api/system/update
+POST /api/system/test/llm
+POST /api/system/test/embeddings
+POST /api/system/test/search
+GET /api/visualizers/list
+POST /api/visualizers/bundled/{visualizer_id}/install
+POST /api/visualizers/{visualizer_id}/enable
+POST /api/visualizers/{visualizer_id}/disable
+DELETE /api/visualizers/{visualizer_id}
+POST /api/visualizers/import
+GET /api/visualizers/{visualizer_id}/assets/{asset_path}
+```
+
+Provider profiles are edited through the catalog endpoints; there are not separate `/settings/llm` or `/settings/embedding` routes in the current API. Capabilities run through the unified WebSocket/CLI contracts. Visualizer imports are declarative browser packages, not executable backend plugins.
+
+## Partners Manager
+
+```text
+GET /api/partners
+POST /api/partners
+GET /api/partners/recent
+GET /api/channels/schema/schema
+GET /api/partners/tool-options
+GET /api/partners/souls
+POST /api/partners/souls
+GET /api/partners/soul-sources
+GET /api/partners/{partner_id}
+PATCH /api/partners/{partner_id}
+POST /api/partners/{partner_id}/start
+POST /api/partners/{partner_id}/stop
+DELETE /api/partners/{partner_id}
+POST /api/partners/{partner_id}/channels/reload
+GET /api/partners/{partner_id}/channels/status
+POST /api/partners/{partner_id}/channel-onboarding/start
+GET /api/partners/{partner_id}/channel-onboarding/{session_id}
+DELETE /api/partners/{partner_id}/channel-onboarding/{session_id}
+POST /api/partners/{partner_id}/channel-onboarding/{session_id}/apply
+GET /api/partners/{partner_id}/soul
+PUT /api/partners/{partner_id}/soul
+GET /api/partners/{partner_id}/assets
+POST /api/partners/{partner_id}/assets
+DELETE /api/partners/{partner_id}/assets/{asset_type}/{name}
+GET /api/partners/{partner_id}/history
+GET /api/partners/{partner_id}/sessions
+POST /api/partners/{partner_id}/sessions/archive
+POST /api/partners/{partner_id}/sessions/resume
+POST /api/partners/{partner_id}/sessions/delete
+POST /api/partners/{partner_id}/sessions/branch
+POST /api/partners/{partner_id}/chat
+POST /api/partners/{partner_id}/chat/execute-stream
+WS /ws/partners/{partner_id}
+```
+
+Authenticated users may create Partners. Resource routes enforce **use** or **manage** rights; owners/admins manage, while grants can be conversation-only. Secrets are masked unless manageable callers request `include_secrets=true`.
+
+## Book Engine
+
+```text
+GET /api/books
+POST /api/books
+GET /api/books/block-types Available generated content types
+GET /api/books/{book_id}
+GET /api/books/{book_id}/spine
+GET /api/books/{book_id}/pages/{page_id}
+DELETE /api/books/{book_id}
+POST /api/books/confirm-proposal
+POST /api/books/confirm-spine
+POST /api/books/compile-page
+POST /api/books/pause Persist, cancel work, keep completed pages
+POST /api/books/resume Queue unfinished pages only
+POST /api/books/{book_id}/refresh-fingerprints
+WS /ws/books Subscribe with `after_seq`; may acknowledge reset
+```
+
+## Immersive Reading
+
+```text
+GET /api/reading/supported-formats Extensions, size cap, raw-view formats
+GET /api/reading/materials List this account's materials
+POST /api/reading/materials Upload a document (multipart)
+GET /api/reading/materials/{material_id} Manifest: unit kind, unit count, outline
+DELETE /api/reading/materials/{material_id} Forget a material
+GET /api/reading/materials/{material_id}/units/{locator} One unit's text
+GET /api/reading/materials/{material_id}/revisions Prior immutable URL snapshots
+GET /api/reading/materials/{material_id}/revisions/{revision}/units/{locator}
+GET /api/reading/materials/{material_id}/raw Original bytes (PDF)
+GET /api/reading/materials/{material_id}/assets/{asset_name} Authenticated snapshot image
+GET /api/reading/materials/{material_id}/bookmarks List bookmarks
+POST /api/reading/materials/{material_id}/bookmarks Save a bookmark
+DELETE /api/reading/materials/{material_id}/bookmarks/{bookmark_id}
+GET /api/reading/materials/{material_id}/annotations List annotations
+PUT /api/reading/materials/{material_id}/annotations Create or update one; returns AnnotationInfo
+DELETE /api/reading/materials/{material_id}/annotations/{id} Delete one
+GET /api/reading/materials/{material_id}/export?fmt=auto|pdf|markdown
+```
+
+A material is content-addressed: uploading the same bytes twice returns the same `material_id` and keeps the annotations already on it. `export?fmt=pdf` returns the original file with real PDF annotations written in, and is only available for materials that kept their raw bytes.
+
+URL refreshes preserve immutable prior revisions. Snapshot assets are authenticated, MIME-sniffed, and served with `nosniff` rather than exposing a live third-party page inside the reader.
+
+## Immersive Watching
+
+```text
+GET /api/settings/video-learning
+PUT /api/settings/video-learning
+POST /api/settings/video-learning/test-invidious
+POST /api/video-learning/materials/resolve
+GET /api/video-learning/materials/{material_id}
+PUT /api/video-learning/materials/{material_id}/progress
+GET /api/video-learning/materials/{material_id}/subtitles.vtt
+GET|HEAD /api/video-learning/materials/{material_id}/stream/{format_id}
+```
+
+These compatibility endpoints retain YouTube playback, transcript cues, and provider-independent progress. Current video sessions use Reading; legacy Watching sessions migrate when reopened. Resolve accepts a YouTube URL and optional language/provider override; VTT returns normalized cues.
+
+## Other routers
+
+Not every surface is expanded above. These exist and follow the same conventions; use `/openapi.json` for their schemas:
+
+```text
+/api/skills Skill library and hub installs
+/api/personas Persona presets
+/api/plugins Managed plugin lifecycle and approvals
+/api/learning-journal Workspace missions, handoffs, and confirmed records
+/api/documents Co-Writer documents and edit streams
+/api/mastery-paths Mastery paths, objectives, and progress
+/api/subagents Connected agent configuration
+/api/imports Claude Code / Codex conversation import
+/api/space/mcp Per-account MCP services and the curated catalog
+/api/space/cli-apps CLI app catalog, installs, and grants
+/api/voice Text-to-speech and speech-to-text
+/api/dashboard Recent activity, starter suggestions/refresh, and activity detail
+```
+
+## Outputs and attachments
+
+User-generated artifacts are served by an authenticated, request-scoped router:
+
+```text
+GET /files/outputs/
+```
+
+Requests resolve allowlisted files in the caller's or one visible Partner workspace; invalid/private/traversal paths fail closed. Original chat attachments are served under:
+
+```text
+GET /files/attachments/{session_id}/{attachment_id}/{filename}
+```
+
+## Generate a typed client
+
+```bash
+curl http://localhost:8001/openapi.json > deeptutor.openapi.json
+
+# TypeScript client
+npx openapi-typescript deeptutor.openapi.json -o deeptutor.d.ts
+
+# Python client
+pip install openapi-python-client
+openapi-python-client generate --path deeptutor.openapi.json
+```
+
+
+
+## Route index
+
+Generated from `deeptutor/modules/manifests/*.json` and `deeptutor/api/router_index.json`. Each path is the mount prefix plus the route template. Request and response fields stay in the live `GET /openapi.json`.
+
+### books
+
+#### `book:router` — `/api` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/books/health` |
+| `GET` | `/api/books/estimate-basis` |
+| `GET` | `/api/books/block-types` |
+| `GET` | `/api/books` |
+| `GET` | `/api/books/{book_id}/learning-captures` |
+| `POST` | `/api/books/{book_id}/learning-captures` |
+| `PATCH` | `/api/books/{book_id}/learning-captures/{capture_id}` |
+| `GET` | `/api/books/{book_id}` |
+| `GET` | `/api/books/{book_id}/spine` |
+| `GET` | `/api/books/{book_id}/pages/{page_id}` |
+| `DELETE` | `/api/books/{book_id}` |
+| `POST` | `/api/books` |
+| `POST` | `/api/books/confirm-proposal` |
+| `POST` | `/api/books/confirm-spine` |
+| `POST` | `/api/books/compile-page` |
+| `POST` | `/api/books/regenerate-block` |
+| `POST` | `/api/books/insert-block` |
+| `POST` | `/api/books/delete-block` |
+| `POST` | `/api/books/move-block` |
+| `POST` | `/api/books/change-block-type` |
+| `POST` | `/api/books/{book_id}/chapters` |
+| `PATCH` | `/api/books/{book_id}/chapters/{chapter_id}` |
+| `DELETE` | `/api/books/{book_id}/chapters/{chapter_id}` |
+| `POST` | `/api/books/{book_id}/chapters/{chapter_id}/move` |
+| `POST` | `/api/books/deep-dive` |
+| `POST` | `/api/books/quiz-attempt` |
+| `POST` | `/api/books/update-block` |
+| `POST` | `/api/books/progress/visit` |
+| `POST` | `/api/books/progress/bookmark` |
+| `GET` | `/api/books/{book_id}/export` |
+| `GET` | `/api/books/{book_id}/health` |
+| `POST` | `/api/books/{book_id}/refresh-fingerprints` |
+| `POST` | `/api/books/supplement` |
+| `POST` | `/api/books/page-chat-session` |
+| `POST` | `/api/books/resume` |
+| `POST` | `/api/books/pause` |
+| `POST` | `/api/books/rebuild` |
+| `POST` | `/api/books/{book_id}/edits/preview` |
+| `GET` | `/api/books/{book_id}/edits` |
+| `POST` | `/api/books/{book_id}/edits/{edit_id}/apply` |
+| `POST` | `/api/books/{book_id}/edits/{edit_id}/undo` |
+
+#### `book:ws_router` — `/ws` · public
+
+| Method | Path |
+| --- | --- |
+| `WS` | `/ws/books` |
+
+### calendar
+
+#### `calendar:router` — `/api/calendar` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/calendar/export.ics` |
+| `GET` | `/api/calendar/calendars` |
+| `POST` | `/api/calendar/calendars` |
+| `PATCH` | `/api/calendar/calendars/{id}` |
+| `DELETE` | `/api/calendar/calendars/{id}` |
+| `GET` | `/api/calendar/events` |
+| `POST` | `/api/calendar/events` |
+| `PATCH` | `/api/calendar/events/{id}` |
+| `DELETE` | `/api/calendar/events/{id}` |
+| `POST` | `/api/calendar/undo/{token}` |
+| `GET` | `/api/calendar/search` |
+| `GET` | `/api/calendar/layers` |
+| `DELETE` | `/api/calendar/automations/{job_id}` |
+| `GET` | `/api/calendar/stream` |
+| `GET` | `/api/calendar/task-blocks` |
+
+### co-writer
+
+#### `co_writer:router` — `/api` · learning
+
+| Method | Path |
+| --- | --- |
+| `POST` | `/api/documents/actions/edit` |
+| `POST` | `/api/documents/actions/edit-react` |
+| `POST` | `/api/documents/actions/edit-react/stream` |
+| `POST` | `/api/documents/actions/automark` |
+| `GET` | `/api/documents/history` |
+| `GET` | `/api/documents/history/{operation_id}` |
+| `GET` | `/api/documents/tool-calls/{operation_id}` |
+| `GET` | `/api/documents` |
+| `POST` | `/api/documents` |
+| `POST` | `/api/documents/import/docx` |
+| `POST` | `/api/documents/export/docx` |
+| `GET` | `/api/documents/flashcards/export` |
+| `GET` | `/api/documents/{doc_id}` |
+| `PUT` | `/api/documents/{doc_id}` |
+| `DELETE` | `/api/documents/{doc_id}` |
+| `GET` | `/api/documents/{doc_id}/suggestions` |
+| `POST` | `/api/documents/{doc_id}/suggestions/{suggestion_id}` |
+| `GET` | `/api/documents/{doc_id}/backlinks` |
+| `POST` | `/api/documents/{doc_id}/assets` |
+| `GET` | `/api/documents/{doc_id}/assets/{name}` |
+| `POST` | `/api/documents/{doc_id}/clips` |
+| `GET` | `/api/documents/review/due` |
+| `GET` | `/api/documents/{doc_id}/flashcards/export` |
+| `POST` | `/api/documents/{doc_id}/review` |
+| `POST` | `/api/documents/{doc_id}/suggestions` |
+| `GET` | `/api/documents/{doc_id}/threads` |
+| `POST` | `/api/documents/{doc_id}/threads` |
+| `DELETE` | `/api/documents/{doc_id}/threads/{session_id}` |
+
+### knowledge
+
+#### `knowledge:router` — `/api` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/knowledge-bases/health` |
+| `GET` | `/api/knowledge-bases/rag-providers` |
+| `PUT` | `/api/knowledge-bases/rag-providers/{provider}/mode` |
+| `GET` | `/api/knowledge-bases/rag-pipelines/pageindex/config` |
+| `PUT` | `/api/knowledge-bases/rag-pipelines/pageindex/config` |
+| `GET` | `/api/knowledge-bases/rag-pipelines/ima/config` |
+| `PUT` | `/api/knowledge-bases/rag-pipelines/ima/config` |
+| `GET` | `/api/knowledge-bases/rag-pipelines/llamaindex/config` |
+| `PUT` | `/api/knowledge-bases/rag-pipelines/llamaindex/config` |
+| `GET` | `/api/knowledge-bases/rag-pipelines/graphrag/config` |
+| `PUT` | `/api/knowledge-bases/rag-pipelines/graphrag/config` |
+| `GET` | `/api/knowledge-bases/rag-pipelines/lightrag/config` |
+| `GET` | `/api/knowledge-bases/rag-pipelines/lightrag/model-options` |
+| `PUT` | `/api/knowledge-bases/rag-pipelines/lightrag/config` |
+| `GET` | `/api/knowledge-bases/rag-pipelines/lightrag-server/config` |
+| `PUT` | `/api/knowledge-bases/rag-pipelines/lightrag-server/config` |
+| `GET` | `/api/knowledge-bases/rag-pipelines/{provider}/preflight` |
+| `GET` | `/api/knowledge-bases/rag-pipelines/model-options` |
+| `GET` | `/api/knowledge-bases/embedding-usage` |
+| `POST` | `/api/knowledge-bases/rag-pipelines/graphrag/model-compatibility` |
+| `PUT` | `/api/knowledge-bases/rag-pipelines/active-model` |
+| `GET` | `/api/knowledge-bases/supported-file-types` |
+| `GET` | `/api/knowledge-bases/configs` |
+| `GET` | `/api/knowledge-bases/{kb_name}/config` |
+| `PUT` | `/api/knowledge-bases/{kb_name}/config` |
+| `POST` | `/api/knowledge-bases/configs/sync` |
+| `GET` | `/api/knowledge-bases/default` |
+| `PUT` | `/api/knowledge-bases/default/{kb_name}` |
+| `POST` | `/api/knowledge-bases/connect-obsidian` |
+| `POST` | `/api/knowledge-bases/connect-marginnote4` |
+| `POST` | `/api/knowledge-bases/probe-folder` |
+| `POST` | `/api/knowledge-bases/connect-folder` |
+| `POST` | `/api/knowledge-bases/probe-lightrag-server` |
+| `POST` | `/api/knowledge-bases/connect-lightrag-server` |
+| `POST` | `/api/knowledge-bases/probe-weknora` |
+| `POST` | `/api/knowledge-bases/connect-weknora` |
+| `POST` | `/api/knowledge-bases/list-ima` |
+| `GET` | `/api/knowledge-bases/kiwix-catalog` |
+| `POST` | `/api/knowledge-bases/probe-kiwix` |
+| `POST` | `/api/knowledge-bases/connect-kiwix` |
+| `GET` | `/api/knowledge-bases/kiwix-articles` |
+| `POST` | `/api/knowledge-bases/probe-ima` |
+| `POST` | `/api/knowledge-bases/connect-ima` |
+| `GET` | `/api/knowledge-bases` |
+| `GET` | `/api/knowledge-bases/list` |
+| `GET` | `/api/knowledge-bases/{kb_name}` |
+| `GET` | `/api/knowledge-bases/{kb_name}/files` |
+| `POST` | `/api/knowledge-bases/{kb_name}/folders` |
+| `POST` | `/api/knowledge-bases/{kb_name}/files/move` |
+| `GET` | `/api/knowledge-bases/{kb_name}/file-preview-text/{filename:path}` |
+| `GET` | `/api/knowledge-bases/{kb_name}/files/{filename:path}` |
+| `GET` | `/api/knowledge-bases/{kb_name}/visual-assets/{asset_id}` |
+| `GET` | `/api/knowledge-bases/{kb_name}/visual-coverage` |
+| `GET` | `/api/knowledge-bases/{kb_name}/source-page` |
+| `DELETE` | `/api/knowledge-bases/{kb_name}/files/{filename:path}` |
+| `POST` | `/api/knowledge-bases/delete` |
+| `DELETE` | `/api/knowledge-bases/{kb_name}` |
+| `GET` | `/api/knowledge-bases/tasks/{task_id}/stream` |
+| `POST` | `/api/knowledge-bases/{kb_name}/upload` |
+| `POST` | `/api/knowledge-bases` |
+| `GET` | `/api/knowledge-bases/{kb_name}/reindex-config` |
+| `POST` | `/api/knowledge-bases/{kb_name}/reindex` |
+| `PUT` | `/api/knowledge-bases/{kb_name}/indexing-policy` |
+| `POST` | `/api/knowledge-bases/{kb_name}/retry` |
+| `GET` | `/api/knowledge-bases/{kb_name}/indexing-run` |
+| `POST` | `/api/knowledge-bases/{kb_name}/indexing-run/{task_id}/cancel` |
+| `GET` | `/api/knowledge-bases/{kb_name}/indexing-readiness` |
+| `GET` | `/api/knowledge-bases/{kb_name}/progress` |
+| `POST` | `/api/knowledge-bases/{kb_name}/progress/clear` |
+| `POST` | `/api/knowledge-bases/{kb_name}/link-folder` |
+| `GET` | `/api/knowledge-bases/{kb_name}/linked-folders` |
+| `DELETE` | `/api/knowledge-bases/{kb_name}/linked-folders/{folder_id}` |
+| `POST` | `/api/knowledge-bases/{kb_name}/sync-folder/{folder_id}` |
+| `POST` | `/api/knowledge-bases/{kb_name}/github-source` |
+| `GET` | `/api/knowledge-bases/{kb_name}/github-sources` |
+| `DELETE` | `/api/knowledge-bases/{kb_name}/github-source/{source_id}` |
+| `POST` | `/api/knowledge-bases/{kb_name}/sync-github` |
+| `POST` | `/api/knowledge-bases/{kb_name}/web-source` |
+| `GET` | `/api/knowledge-bases/{kb_name}/web-sources` |
+| `DELETE` | `/api/knowledge-bases/{kb_name}/web-source/{source_id}` |
+| `GET` | `/api/knowledge-bases/{kb_name}/web-source-sync` |
+| `GET` | `/api/knowledge-bases/{kb_name}/web-source/{source_id}/pairings` |
+| `PUT` | `/api/knowledge-bases/{kb_name}/web-source/{source_id}/schedule` |
+| `POST` | `/api/knowledge-bases/{kb_name}/web-source/{source_id}/cancel` |
+| `POST` | `/api/knowledge-bases/{kb_name}/web-source/{source_id}/retry` |
+| `POST` | `/api/knowledge-bases/{kb_name}/sync-web` |
+
+#### `marginnote4:router` — `/api/marginnote4` · public
+
+| Method | Path |
+| --- | --- |
+| `POST` | `/api/marginnote4/pair` |
+| `GET` | `/api/marginnote4/devices` |
+| `DELETE` | `/api/marginnote4/devices/{device_id}` |
+| `GET` | `/api/marginnote4/status` |
+| `POST` | `/api/marginnote4/sync` |
+| `POST` | `/api/marginnote4/heartbeat` |
+
+#### `knowledge:ws_router` — `/ws` · public
+
+| Method | Path |
+| --- | --- |
+| `WS` | `/ws/knowledge-bases/{kb_name}/progress` |
+
+### mastery
+
+#### `mastery_path:router` — `/api/mastery-paths` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/mastery-paths/topics` |
+| `GET` | `/api/mastery-paths/topics/index` |
+| `GET` | `/api/mastery-paths/reading/records` |
+| `POST` | `/api/mastery-paths/topics/draft` |
+| `POST` | `/api/mastery-paths/topics` |
+| `GET` | `/api/mastery-paths/topics/{path_id}` |
+| `GET` | `/api/mastery-paths/topics/{path_id}/review-settings` |
+| `PUT` | `/api/mastery-paths/topics/{path_id}/review-settings` |
+| `GET` | `/api/mastery-paths/review-strategies` |
+| `POST` | `/api/mastery-paths/review-strategies` |
+| `GET` | `/api/mastery-paths/review-strategies/{template_id}` |
+| `PUT` | `/api/mastery-paths/review-strategies/{template_id}` |
+| `POST` | `/api/mastery-paths/review-strategies/{template_id}/duplicate` |
+| `DELETE` | `/api/mastery-paths/review-strategies/{template_id}` |
+| `PUT` | `/api/mastery-paths/topics/{path_id}/review-strategy` |
+| `PUT` | `/api/mastery-paths/topics/{path_id}/map` |
+| `POST` | `/api/mastery-paths/topics/{path_id}/objectives/{kp_id}/override` |
+| `GET` | `/api/mastery-paths/topics/{path_id}/sessions` |
+| `PUT` | `/api/mastery-paths/topics/{path_id}/sessions/{session_id}/mode` |
+| `GET` | `/api/mastery-paths/topics/{path_id}/ask-hint` |
+| `GET` | `/api/mastery-paths/progress` |
+| `GET` | `/api/mastery-paths/progress/{book_id}` |
+| `GET` | `/api/mastery-paths/progress/{book_id}/map` |
+| `GET` | `/api/mastery-paths/progress/{book_id}/board` |
+| `GET` | `/api/mastery-paths/progress/{book_id}/objectives/{kp_id}` |
+| `GET` | `/api/mastery-paths/progress/{book_id}/events` |
+| `GET` | `/api/mastery-paths/progress/{book_id}/sessions` |
+| `POST` | `/api/mastery-paths/progress/{book_id}/init-modules` |
+| `POST` | `/api/mastery-paths/progress/{book_id}/import-from-book` |
+| `PATCH` | `/api/mastery-paths/progress/{book_id}` |
+| `DELETE` | `/api/mastery-paths/progress/{book_id}` |
+| `POST` | `/api/mastery-paths/progress/{book_id}/skip-question` |
+| `POST` | `/api/mastery-paths/progress/{book_id}/redo` |
+| `POST` | `/api/mastery-paths/progress/{book_id}/generate-from-notebook` |
+| `POST` | `/api/mastery-paths/progress/{book_id}/generate-from-reading` |
+
+#### `mastery_path:ws_router` — `/ws` · public
+
+| Method | Path |
+| --- | --- |
+| `WS` | `/ws/mastery-paths` |
+
+### memory
+
+#### `memory:router` — `/api/memory` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/memory/overview` |
+| `GET` | `/api/memory/resolve_entry/{entry_id}` |
+| `GET` | `/api/memory/backup` |
+| `GET` | `/api/memory/doc/{layer}/{key}` |
+| `PUT` | `/api/memory/doc/{layer}/{key}` |
+| `DELETE` | `/api/memory/doc/{layer}/{key}/entry/{entry_id}` |
+| `POST` | `/api/memory/doc/{layer}/{key}/reset` |
+| `POST` | `/api/memory/runs/start` |
+| `GET` | `/api/memory/runs/{run_id}` |
+| `POST` | `/api/memory/runs/{run_id}/cancel` |
+| `POST` | `/api/memory/runs/{run_id}/undo` |
+| `GET` | `/api/memory/runs` |
+| `GET` | `/api/memory/runs/{run_id}/events` |
+| `POST` | `/api/memory/doc/{layer}/{key}/update` |
+| `POST` | `/api/memory/doc/{layer}/{key}/audit` |
+| `POST` | `/api/memory/doc/{layer}/{key}/dedup` |
+| `GET` | `/api/memory/doc/{layer}/{key}/lines` |
+| `GET` | `/api/memory/settings` |
+| `PUT` | `/api/memory/settings` |
+| `POST` | `/api/memory/doc/{layer}/{key}/apply` |
+| `GET` | `/api/memory/trace/{surface}` |
+| `DELETE` | `/api/memory/trace/{surface}` |
+| `DELETE` | `/api/memory/trace/{surface}/day/{day}` |
+| `GET` | `/api/memory/snapshot/{surface}` |
+| `POST` | `/api/memory/snapshot/{surface}/refresh` |
+| `GET` | `/api/memory/snapshot/{surface}/changes` |
+| `DELETE` | `/api/memory/snapshot/{surface}/changes` |
+
+### notebook
+
+#### `notebook:router` — `/api` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/notebooks/health` |
+| `GET` | `/api/notebooks` |
+| `GET` | `/api/notebooks/statistics` |
+| `POST` | `/api/notebooks` |
+| `GET` | `/api/notebooks/{notebook_id}` |
+| `PUT` | `/api/notebooks/{notebook_id}` |
+| `DELETE` | `/api/notebooks/{notebook_id}` |
+| `POST` | `/api/notebooks/actions/add-record` |
+| `POST` | `/api/notebooks/actions/add-record-with-summary` |
+| `DELETE` | `/api/notebooks/{notebook_id}/records/{record_id}` |
+| `GET` | `/api/notebooks/records/{record_id}/location` |
+| `PUT` | `/api/notebooks/{notebook_id}/records/{record_id}` |
+| `POST` | `/api/notebooks/{notebook_id}/records/{record_id}/actions/copy` |
+| `POST` | `/api/notebooks/{notebook_id}/records/{record_id}/actions/move` |
+| `GET` | `/api/notebooks/{notebook_id}/export` |
+
+### partners
+
+#### `partner_groups:router` — `/api/partner-groups` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/partner-groups` |
+| `GET` | `/api/partner-groups/discussion-modes` |
+| `GET` | `/api/partner-groups/shared-memory-types` |
+| `POST` | `/api/partner-groups` |
+| `GET` | `/api/partner-groups/{group_id}` |
+| `PATCH` | `/api/partner-groups/{group_id}` |
+| `DELETE` | `/api/partner-groups/{group_id}` |
+| `GET` | `/api/partner-groups/{group_id}/history` |
+| `GET` | `/api/partner-groups/{group_id}/sessions` |
+| `POST` | `/api/partner-groups/{group_id}/sessions` |
+| `DELETE` | `/api/partner-groups/{group_id}/sessions/{session_key}` |
+| `GET` | `/api/partner-groups/{group_id}/whiteboard` |
+| `POST` | `/api/partner-groups/{group_id}/whiteboard/pins` |
+| `DELETE` | `/api/partner-groups/{group_id}/whiteboard/pins/{event_id}` |
+| `GET` | `/api/partner-groups/{group_id}/invocations` |
+| `POST` | `/api/partner-groups/{group_id}/invocations` |
+| `POST` | `/api/partner-groups/{group_id}/messages` |
+| `POST` | `/api/partner-groups/{group_id}/turns/{turn_id}/partners/{partner_id}/retry` |
+| `POST` | `/api/partner-groups/{group_id}/rounds/{turn_id}/summary` |
+| `POST` | `/api/partner-groups/{group_id}/invocations/{invocation_id}/approve` |
+| `POST` | `/api/partner-groups/{group_id}/invocations/{invocation_id}/reject` |
+
+#### `partners:router` — `/api/partners` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/partners/souls` |
+| `POST` | `/api/partners/souls` |
+| `GET` | `/api/partners/souls/{soul_id}` |
+| `PUT` | `/api/partners/souls/{soul_id}` |
+| `DELETE` | `/api/partners/souls/{soul_id}` |
+| `GET` | `/api/partners/soul-sources` |
+| `GET` | `/api/partners` |
+| `GET` | `/api/partners/navigation` |
+| `GET` | `/api/partners/consultation-session` |
+| `GET` | `/api/partners/recent` |
+| `GET` | `/api/partners/channels/schema` |
+| `POST` | `/api/partners/{partner_id}/channels/weixin/qr` |
+| `GET` | `/api/partners/{partner_id}/channels/weixin/qr/{session_id}` |
+| `GET` | `/api/partners/tool-options` |
+| `POST` | `/api/partners` |
+| `GET` | `/api/partners/drafts/{draft_id}` |
+| `POST` | `/api/partners/drafts/{draft_id}/confirm` |
+| `GET` | `/api/partners/{partner_id}` |
+| `PATCH` | `/api/partners/{partner_id}` |
+| `POST` | `/api/partners/{partner_id}/start` |
+| `POST` | `/api/partners/{partner_id}/stop` |
+| `DELETE` | `/api/partners/{partner_id}` |
+| `POST` | `/api/partners/{partner_id}/channels/reload` |
+| `GET` | `/api/partners/{partner_id}/channels/status` |
+| `POST` | `/api/partners/{partner_id}/channel-onboarding/start` |
+| `GET` | `/api/partners/{partner_id}/channel-onboarding/{session_id}` |
+| `DELETE` | `/api/partners/{partner_id}/channel-onboarding/{session_id}` |
+| `POST` | `/api/partners/{partner_id}/channel-onboarding/{session_id}/apply` |
+| `GET` | `/api/partners/{partner_id}/soul` |
+| `PUT` | `/api/partners/{partner_id}/soul` |
+| `GET` | `/api/partners/{partner_id}/workspaces` |
+| `GET` | `/api/partners/{partner_id}/assets` |
+| `POST` | `/api/partners/{partner_id}/assets` |
+| `DELETE` | `/api/partners/{partner_id}/assets/{asset_type}/{name}` |
+| `POST` | `/api/partners/{partner_id}/links/code` |
+| `GET` | `/api/partners/{partner_id}/links` |
+| `DELETE` | `/api/partners/{partner_id}/links/{key:path}` |
+| `GET` | `/api/partners/{partner_id}/history` |
+| `GET` | `/api/partners/{partner_id}/history/page` |
+| `GET` | `/api/partners/{partner_id}/web-continuity` |
+| `PUT` | `/api/partners/{partner_id}/web-continuity` |
+| `GET` | `/api/partners/{partner_id}/sessions` |
+| `POST` | `/api/partners/{partner_id}/sessions/archive` |
+| `POST` | `/api/partners/{partner_id}/sessions/resume` |
+| `POST` | `/api/partners/{partner_id}/sessions/delete` |
+| `POST` | `/api/partners/{partner_id}/sessions/branch` |
+| `GET` | `/api/partners/commands/palette` |
+| `POST` | `/api/partners/{partner_id}/chat` |
+| `POST` | `/api/partners/{partner_id}/chat/execute-stream` |
+
+#### `partner_groups:ws_router` — `/ws/partner-groups` · public
+
+| Method | Path |
+| --- | --- |
+| `WS` | `/ws/partner-groups/{group_id}` |
+
+#### `partners:ws_router` — `/ws/partners` · public
+
+| Method | Path |
+| --- | --- |
+| `WS` | `/ws/partners/{partner_id}` |
+
+### questions
+
+#### `question:router` — `/api/question` · learning
+
+| Method | Path |
+| --- | --- |
+
+#### `question_notebook:router` — `/api/question-notebook` · learning
+
+| Method | Path |
+| --- | --- |
+| `POST` | `/api/question-notebook/entries/upsert` |
+| `GET` | `/api/question-notebook/entries` |
+| `GET` | `/api/question-notebook/entries/lookup/by-question` |
+| `GET` | `/api/question-notebook/entries/{entry_id}` |
+| `PATCH` | `/api/question-notebook/entries/{entry_id}` |
+| `DELETE` | `/api/question-notebook/entries/{entry_id}` |
+| `POST` | `/api/question-notebook/entries/categories/bulk` |
+| `POST` | `/api/question-notebook/entries/{entry_id}/categories` |
+| `DELETE` | `/api/question-notebook/entries/{entry_id}/categories/{category_id}` |
+| `GET` | `/api/question-notebook/stats` |
+| `GET` | `/api/question-notebook/materials` |
+| `GET` | `/api/question-notebook/categories` |
+| `POST` | `/api/question-notebook/categories` |
+| `PATCH` | `/api/question-notebook/categories/{category_id}` |
+| `DELETE` | `/api/question-notebook/categories/{category_id}` |
+
+#### `practice:router` — `/api/question-notebook/practice` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/question-notebook/practice/summary` |
+| `GET` | `/api/question-notebook/practice/queue` |
+| `GET` | `/api/question-notebook/practice/analytics` |
+| `GET` | `/api/question-notebook/practice/questions/{entry_id}` |
+| `POST` | `/api/question-notebook/practice/questions/{entry_id}/check` |
+| `POST` | `/api/question-notebook/practice/questions/{entry_id}/review` |
+| `GET` | `/api/question-notebook/practice/import/template` |
+| `POST` | `/api/question-notebook/practice/import/preview` |
+| `POST` | `/api/question-notebook/practice/import/commit` |
+
+#### `question:ws_router` — `/ws/questions` · public
+
+| Method | Path |
+| --- | --- |
+| `WS` | `/ws/questions/mimic` |
+| `WS` | `/ws/questions/generate` |
+
+### reading
+
+#### `reading:router` — `/api/reading` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/reading/library/materials` |
+| `POST` | `/api/reading/library/duplicate-check` |
+| `POST` | `/api/reading/library/import-urls` |
+| `POST` | `/api/reading/library/import-zim-article` |
+| `POST` | `/api/reading/materials/{material_id}/retry` |
+| `GET` | `/api/reading/workspaces` |
+| `GET` | `/api/reading/workspaces/index` |
+| `POST` | `/api/reading/workspaces` |
+| `GET` | `/api/reading/workspaces/{workspace_id}` |
+| `GET` | `/api/reading/workspaces/{workspace_id}/ask-hint` |
+| `PATCH` | `/api/reading/workspaces/{workspace_id}` |
+| `DELETE` | `/api/reading/workspaces/{workspace_id}` |
+| `POST` | `/api/reading/workspaces/{workspace_id}/materials` |
+| `PUT` | `/api/reading/workspaces/{workspace_id}/materials/order` |
+| `PUT` | `/api/reading/workspaces/{workspace_id}/materials/{material_id}/active` |
+| `DELETE` | `/api/reading/workspaces/{workspace_id}/materials/{material_id}` |
+| `GET` | `/api/reading/workspaces/{workspace_id}/sessions` |
+| `POST` | `/api/reading/workspaces/{workspace_id}/sessions` |
+| `PATCH` | `/api/reading/workspaces/{workspace_id}/sessions/{session_id}` |
+| `DELETE` | `/api/reading/workspaces/{workspace_id}/sessions/{session_id}` |
+| `POST` | `/api/reading/workspaces/{workspace_id}/sessions/{session_id}/links` |
+| `DELETE` | `/api/reading/workspaces/{workspace_id}/sessions/{session_id}/links/{target_session_id}` |
+| `POST` | `/api/reading/workspaces/{workspace_id}/notes/organize` |
+| `POST` | `/api/reading/workspaces/{workspace_id}/notebook` |
+| `GET` | `/api/reading/supported-formats` |
+| `GET` | `/api/reading/materials` |
+| `POST` | `/api/reading/materials` |
+| `GET` | `/api/reading/materials/{material_id}` |
+| `GET` | `/api/reading/materials/{material_id}/epub-pairing-candidates` |
+| `GET` | `/api/reading/epub-pairings` |
+| `POST` | `/api/reading/epub-pairings` |
+| `DELETE` | `/api/reading/epub-pairings/{pairing_id}` |
+| `DELETE` | `/api/reading/materials/{material_id}` |
+| `GET` | `/api/reading/materials/{material_id}/transcript` |
+| `GET` | `/api/reading/materials/{material_id}/units/{locator}` |
+| `GET` | `/api/reading/materials/{material_id}/revisions` |
+| `GET` | `/api/reading/materials/{material_id}/revisions/{revision}/units/{locator}` |
+| `GET` | `/api/reading/materials/{material_id}/raw` |
+| `GET` | `/api/reading/materials/{material_id}/render` |
+| `GET` | `/api/reading/materials/{material_id}/assets/{asset_name}` |
+| `GET` | `/api/reading/materials/{material_id}/media` |
+| `GET` | `/api/reading/materials/{material_id}/media/{name}` |
+| `GET` | `/api/reading/materials/{material_id}/annotations` |
+| `GET` | `/api/reading/materials/{material_id}/position` |
+| `PUT` | `/api/reading/materials/{material_id}/position` |
+| `GET` | `/api/reading/materials/{material_id}/bookmarks` |
+| `POST` | `/api/reading/materials/{material_id}/bookmarks` |
+| `DELETE` | `/api/reading/materials/{material_id}/bookmarks/{bookmark_id}` |
+| `PUT` | `/api/reading/materials/{material_id}/annotations` |
+| `DELETE` | `/api/reading/materials/{material_id}/annotations/{annotation_id}` |
+| `GET` | `/api/reading/materials/{material_id}/export` |
+
+#### `reading_extensions:router` — `/api/reading` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/reading/extensions` |
+| `POST` | `/api/reading/materials/{material_id}/read-aloud` |
+| `POST` | `/api/reading/materials/{material_id}/extensions/{extension_id}/actions/{action}` |
+| `POST` | `/api/reading/materials/{material_id}/extensions/quiz/answers` |
+| `GET` | `/api/reading/materials/{material_id}/quiz/rewards` |
+
+#### `video_learning:settings_router` — `/api/settings/video-learning` · admin
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/settings/video-learning` |
+| `PUT` | `/api/settings/video-learning` |
+| `POST` | `/api/settings/video-learning/test-invidious` |
+
+#### `video_learning:router` — `/api/video-learning` · learning
+
+| Method | Path |
+| --- | --- |
+| `POST` | `/api/video-learning/invidious/account/authorize` |
+| `GET` | `/api/video-learning/invidious/account/callback` |
+| `GET` | `/api/video-learning/invidious/browse/{kind}` |
+| `GET` | `/api/video-learning/invidious/account/status` |
+| `POST` | `/api/video-learning/invidious/account/disconnect` |
+| `POST` | `/api/video-learning/materials/resolve` |
+| `GET` | `/api/video-learning/materials/{material_id}` |
+| `POST` | `/api/video-learning/materials/{material_id}/transcript/refresh` |
+| `PUT` | `/api/video-learning/materials/{material_id}/progress` |
+| `GET` | `/api/video-learning/materials/{material_id}/notes` |
+| `GET` | `/api/video-learning/materials/{material_id}/notes.md` |
+| `POST` | `/api/video-learning/materials/{material_id}/notes` |
+| `PUT` | `/api/video-learning/materials/{material_id}/notes/{note_id}` |
+| `DELETE` | `/api/video-learning/materials/{material_id}/notes/{note_id}` |
+| `GET` | `/api/video-learning/materials/{material_id}/marks` |
+| `GET` | `/api/video-learning/materials/{material_id}/marks/{mark_id}` |
+| `POST` | `/api/video-learning/materials/{material_id}/marks` |
+| `PATCH` | `/api/video-learning/materials/{material_id}/marks/{mark_id}` |
+| `DELETE` | `/api/video-learning/materials/{material_id}/marks/{mark_id}` |
+| `POST` | `/api/video-learning/materials/{material_id}/mark-suggestions` |
+| `GET` | `/api/video-learning/materials/{material_id}/subtitles.vtt` |
+| `HEAD` | `/api/video-learning/materials/{material_id}/stream/{format_id}` |
+| `GET` | `/api/video-learning/materials/{material_id}/stream/{format_id}` |
+
+#### `voice:router` — `/api/voice` · learning
+
+| Method | Path |
+| --- | --- |
+| `POST` | `/api/voice/tts` |
+| `POST` | `/api/voice/stt` |
+
+### server
+
+#### `unified_ws:router` — `/` · public
+
+| Method | Path |
+| --- | --- |
+| `WS` | `/ws` |
+
+#### `personas:router` — `/api` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/personas` |
+| `GET` | `/api/personas/{name}` |
+| `POST` | `/api/personas` |
+| `PUT` | `/api/personas/{name}` |
+| `DELETE` | `/api/personas/{name}` |
+
+#### `agent_config:router` — `/api/agent-config` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/agent-config/agents` |
+| `GET` | `/api/agent-config/agents/{agent_type}` |
+
+#### `auth:router` — `/api/auth` · public
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/auth/openai-codex/callback` |
+| `GET` | `/api/auth/status` |
+| `POST` | `/api/auth/login` |
+| `POST` | `/api/auth/device-login` |
+| `POST` | `/api/auth/session-handoff` |
+| `POST` | `/api/auth/session-handoff/exchange` |
+| `POST` | `/api/auth/session-handoff/complete` |
+| `POST` | `/api/auth/device/heartbeat` |
+| `POST` | `/api/auth/logout` |
+| `POST` | `/api/auth/register` |
+| `GET` | `/api/auth/is_first_user` |
+| `GET` | `/api/auth/profile` |
+| `PUT` | `/api/auth/profile` |
+| `PUT` | `/api/auth/profile/avatar` |
+| `DELETE` | `/api/auth/profile/avatar` |
+| `GET` | `/api/auth/avatar/{user_id}` |
+| `PUT` | `/api/auth/profile/password` |
+| `GET` | `/api/auth/devices` |
+| `POST` | `/api/auth/devices` |
+| `DELETE` | `/api/auth/devices/{device_credential_id}` |
+| `GET` | `/api/auth/users` |
+| `GET` | `/api/auth/profile/learner-profile` |
+| `PUT` | `/api/auth/profile/learner-profile` |
+| `GET` | `/api/auth/users/{username}/learner-profile` |
+| `PUT` | `/api/auth/users/{username}/learner-profile` |
+| `POST` | `/api/auth/users` |
+| `POST` | `/api/auth/users/import` |
+| `DELETE` | `/api/auth/users/{username}` |
+| `POST` | `/api/auth/users/batch-delete` |
+| `PUT` | `/api/auth/users/{username}/role` |
+| `PUT` | `/api/auth/users/{username}/password` |
+
+#### `capabilities:router` — `/api/capabilities` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/capabilities/registered` |
+
+#### `capabilities_settings:router` — `/api/capabilities` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/capabilities/settings` |
+| `PUT` | `/api/capabilities/settings` |
+
+#### `creations:router` — `/api/creations` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/creations/drafts/{draft_id}` |
+| `POST` | `/api/creations/drafts/{draft_id}/approve` |
+
+#### `dashboard:router` — `/api/dashboard` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/dashboard/recent` |
+| `GET` | `/api/dashboard/suggestions` |
+| `POST` | `/api/dashboard/suggestions/refresh` |
+| `GET` | `/api/dashboard/learning-index` |
+| `GET` | `/api/dashboard/source-library/{kind}` |
+| `GET` | `/api/dashboard/learning-library/{kind}` |
+| `GET` | `/api/dashboard/{entry_id}` |
+
+#### `file_preview:router` — `/api/file-preview` · authenticated
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/file-preview/pdf` |
+| `POST` | `/api/file-preview/pdf` |
+
+#### `imports:router` — `/api/imports` · learning
+
+| Method | Path |
+| --- | --- |
+| `POST` | `/api/imports/chat-history` |
+| `GET` | `/api/imports/chat-history` |
+
+#### `learning_journal:router` — `/api/learning-journal` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/learning-journal` |
+
+#### `modules:router` — `/api/modules` · authenticated
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/modules` |
+
+#### `multi_user:router` — `/api/multi-user` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/multi-user/admin/resources` |
+| `GET` | `/api/multi-user/admin/books` |
+| `GET` | `/api/multi-user/guardians` |
+| `POST` | `/api/multi-user/guardians` |
+| `DELETE` | `/api/multi-user/guardians/{relationship_id}` |
+| `GET` | `/api/multi-user/me/guardianships` |
+| `DELETE` | `/api/multi-user/me/guardianships/{relationship_id}` |
+| `GET` | `/api/multi-user/learners/{learner_user_id}/guardian-report` |
+| `GET` | `/api/multi-user/learners/{learner_user_id}/materials` |
+| `PUT` | `/api/multi-user/learners/{learner_user_id}/materials` |
+| `GET` | `/api/multi-user/learners/{learner_user_id}/restrictions` |
+| `PUT` | `/api/multi-user/learners/{learner_user_id}/restrictions` |
+| `POST` | `/api/multi-user/learners/{learner_user_id}/credentials/reset` |
+| `GET` | `/api/multi-user/users/{user_id}/grants` |
+| `PUT` | `/api/multi-user/users/{user_id}/grants` |
+| `GET` | `/api/multi-user/users/{user_id}/book-permission` |
+| `PUT` | `/api/multi-user/users/{user_id}/book-permission` |
+| `POST` | `/api/multi-user/admin/skills/install` |
+| `GET` | `/api/multi-user/users` |
+
+#### `plugins:router` — `/api/plugins` · public
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/plugins/extensions` |
+| `GET` | `/api/plugins/{plugin_id}/pages/{extension_id}` |
+| `GET` | `/api/plugins/{plugin_id}/pages/{extension_id}/` |
+| `GET` | `/api/plugins/{plugin_id}/pages/{extension_id}/assets/{asset_path:path}` |
+| `GET` | `/api/plugins/catalog` |
+| `GET` | `/api/plugins/state` |
+| `GET` | `/api/plugins/{plugin_id}/info` |
+| `POST` | `/api/plugins/{plugin_id}/approve` |
+| `POST` | `/api/plugins/{plugin_id}/enable` |
+| `POST` | `/api/plugins/{plugin_id}/disable` |
+| `POST` | `/api/plugins/{plugin_id}/install` |
+| `POST` | `/api/plugins/{plugin_id}/rollback` |
+| `DELETE` | `/api/plugins/{plugin_id}/installation` |
+| `GET` | `/api/plugins/{plugin_id}/{plugin_path:path}` |
+| `POST` | `/api/plugins/{plugin_id}/{plugin_path:path}` |
+| `PUT` | `/api/plugins/{plugin_id}/{plugin_path:path}` |
+| `PATCH` | `/api/plugins/{plugin_id}/{plugin_path:path}` |
+| `DELETE` | `/api/plugins/{plugin_id}/{plugin_path:path}` |
+
+#### `sessions:router` — `/api/sessions` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/sessions/capabilities` |
+| `POST` | `/api/sessions/submission-replacement` |
+| `GET` | `/api/sessions` |
+| `GET` | `/api/sessions/search` |
+| `GET` | `/api/sessions/recycle-bin` |
+| `POST` | `/api/sessions/{session_id}/migrate-watching` |
+| `GET` | `/api/sessions/{session_id}` |
+| `GET` | `/api/sessions/{session_id}/organization` |
+| `GET` | `/api/sessions/{session_id}/threads` |
+| `GET` | `/api/sessions/{session_id}/messages/{message_id}/events` |
+| `GET` | `/api/sessions/{session_id}/ask-hint` |
+| `PATCH` | `/api/sessions/{session_id}` |
+| `PATCH` | `/api/sessions/{session_id}/reply-language` |
+| `PATCH` | `/api/sessions/{session_id}/organization` |
+| `DELETE` | `/api/sessions/{session_id}` |
+| `POST` | `/api/sessions/{session_id}/restore` |
+| `DELETE` | `/api/sessions/{session_id}/purge` |
+| `PUT` | `/api/sessions/{session_id}/branch-selection` |
+| `DELETE` | `/api/sessions/{session_id}/messages/{message_id}` |
+| `POST` | `/api/sessions/{session_id}/quiz-results` |
+
+#### `settings:public_router` — `/api/settings` · public
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/settings/ui` |
+
+#### `settings:router` — `/api/settings` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/settings` |
+| `POST` | `/api/settings/providers/openai-codex/oauth/start` |
+| `GET` | `/api/settings/providers/openai-codex/oauth/status` |
+| `POST` | `/api/settings/providers/openai-codex/oauth/complete` |
+| `POST` | `/api/settings/providers/openai-codex/oauth/cancel` |
+| `POST` | `/api/settings/providers/openai-codex/oauth/logout` |
+| `POST` | `/api/settings/providers/openai-codex/models/refresh` |
+| `GET` | `/api/settings/providers/codebuddy/auth/status` |
+| `POST` | `/api/settings/providers/codebuddy/auth/start` |
+| `POST` | `/api/settings/providers/codebuddy/auth/cancel` |
+| `POST` | `/api/settings/providers/codebuddy/auth/logout` |
+| `POST` | `/api/settings/providers/openai-codex/models/reasoning-effort` |
+| `GET` | `/api/settings/catalog` |
+| `GET` | `/api/settings/network` |
+| `PUT` | `/api/settings/network` |
+| `GET` | `/api/settings/web-fetch` |
+| `PUT` | `/api/settings/web-fetch` |
+| `GET` | `/api/settings/chat-attachments` |
+| `GET` | `/api/settings/chat-starters` |
+| `PUT` | `/api/settings/chat-starters` |
+| `PUT` | `/api/settings/chat-attachments` |
+| `GET` | `/api/settings/mineru` |
+| `PUT` | `/api/settings/mineru` |
+| `GET` | `/api/settings/document-parsing` |
+| `GET` | `/api/settings/readiness` |
+| `GET` | `/api/settings/profile` |
+| `POST` | `/api/settings/profile/diff` |
+| `GET` | `/api/settings/presets` |
+| `POST` | `/api/settings/presets/{preset_id}/draft` |
+| `PUT` | `/api/settings/document-parsing` |
+| `POST` | `/api/settings/document-parsing/test` |
+| `POST` | `/api/settings/document-parsing/docling/test` |
+| `POST` | `/api/settings/document-parsing/tika/test` |
+| `POST` | `/api/settings/document-parsing/install` |
+| `POST` | `/api/settings/document-parsing/models/download` |
+| `GET` | `/api/settings/document-parsing/job/status` |
+| `POST` | `/api/settings/document-parsing/job/cancel` |
+| `POST` | `/api/settings/mineru/models/download` |
+| `GET` | `/api/settings/mineru/models/download/status` |
+| `POST` | `/api/settings/mineru/models/download/cancel` |
+| `POST` | `/api/settings/mineru/test` |
+| `GET` | `/api/settings/llm-options` |
+| `PUT` | `/api/settings/catalog` |
+| `POST` | `/api/settings/apply/registry` |
+| `POST` | `/api/settings/apply/provider` |
+| `POST` | `/api/settings/apply/service` |
+| `GET` | `/api/settings/draft` |
+| `PUT` | `/api/settings/draft` |
+| `DELETE` | `/api/settings/draft` |
+| `POST` | `/api/settings/apply` |
+| `POST` | `/api/settings/test-provider` |
+| `POST` | `/api/settings/fetch-models` |
+| `POST` | `/api/settings/model-capabilities` |
+| `PUT` | `/api/settings/theme` |
+| `PUT` | `/api/settings/language` |
+| `PUT` | `/api/settings/voice-autoplay` |
+| `PUT` | `/api/settings/voice-math-speak` |
+| `PUT` | `/api/settings/chat-response-timeout` |
+| `GET` | `/api/settings/page-customization` |
+| `PUT` | `/api/settings/page-customization/chat` |
+| `PUT` | `/api/settings/page-customization/learning` |
+| `GET` | `/api/settings/display` |
+| `PUT` | `/api/settings/ui` |
+| `POST` | `/api/settings/reset` |
+| `GET` | `/api/settings/themes` |
+| `GET` | `/api/settings/sidebar` |
+| `PUT` | `/api/settings/sidebar/description` |
+| `PUT` | `/api/settings/sidebar/nav-order` |
+| `PUT` | `/api/settings/enabled-tools` |
+| `POST` | `/api/settings/voice/voices` |
+| `POST` | `/api/settings/voice/preview` |
+| `POST` | `/api/settings/services/{service}/preview` |
+| `POST` | `/api/settings/tests/{service}/start` |
+| `GET` | `/api/settings/tests/{service}/{run_id}/events` |
+| `POST` | `/api/settings/tests/{service}/{run_id}/cancel` |
+| `GET` | `/api/settings/tour/status` |
+| `POST` | `/api/settings/tour/complete` |
+| `POST` | `/api/settings/tour/reopen` |
+| `GET` | `/api/settings/usage` |
+
+#### `mcp_settings:router` — `/api/settings/mcp` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/settings/mcp` |
+| `PUT` | `/api/settings/mcp` |
+| `PUT` | `/api/settings/mcp/servers/{name}` |
+| `DELETE` | `/api/settings/mcp/servers/{name}` |
+| `POST` | `/api/settings/mcp/test` |
+
+#### `workspace:settings_router` — `/api/settings/workspace` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/settings/workspace/folders` |
+| `POST` | `/api/settings/workspace/knowledge-bases/preview-move` |
+| `POST` | `/api/settings/workspace/knowledge-bases/move` |
+| `GET` | `/api/settings/workspace/data/discover` |
+| `POST` | `/api/settings/workspace/data/preview` |
+| `POST` | `/api/settings/workspace/data/migrate` |
+| `POST` | `/api/settings/workspace/data/export` |
+| `GET` | `/api/settings/workspace/data/operations` |
+| `POST` | `/api/settings/workspace/data/operations/{operation_id}/recover` |
+| `GET` | `/api/settings/workspace/data/exports/{operation_id}` |
+| `GET` | `/api/settings/workspace/registrations` |
+| `POST` | `/api/settings/workspace/registrations/migrate-root` |
+| `POST` | `/api/settings/workspace/registrations/{workspace_id}/migrate` |
+| `POST` | `/api/settings/workspace/registrations/system-snapshot` |
+| `GET` | `/api/settings/workspace/registrations/system-snapshot` |
+| `GET` | `/api/settings/workspace/resource-usage` |
+| `GET` | `/api/settings/workspace/resources` |
+| `POST` | `/api/settings/workspace/registrations` |
+| `PATCH` | `/api/settings/workspace/registrations/{workspace_id}` |
+| `GET` | `/api/settings/workspace` |
+| `POST` | `/api/settings/workspace/validate` |
+| `PUT` | `/api/settings/workspace` |
+
+#### `skills:router` — `/api/skills` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/skills/tags/list` |
+| `POST` | `/api/skills/tags/create` |
+| `PUT` | `/api/skills/tags/{tag}` |
+| `DELETE` | `/api/skills/tags/{tag}` |
+| `GET` | `/api/skills/list` |
+| `GET` | `/api/skills/hub/catalog` |
+| `GET` | `/api/skills/hub/detail` |
+| `GET` | `/api/skills/{name}` |
+| `POST` | `/api/skills/create` |
+| `POST` | `/api/skills/install` |
+| `PUT` | `/api/skills/{name}` |
+| `DELETE` | `/api/skills/{name}` |
+
+#### `space_cli_apps:router` — `/api/space/cli-apps` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/space/cli-apps/apps` |
+| `PUT` | `/api/space/cli-apps/apps/{app_id}/enabled` |
+| `GET` | `/api/space/cli-apps/catalog` |
+| `POST` | `/api/space/cli-apps/catalog/{app_id}/install` |
+| `DELETE` | `/api/space/cli-apps/apps/{app_id}` |
+
+#### `space_mcp:router` — `/api/space/mcp` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/space/mcp/servers` |
+| `PUT` | `/api/space/mcp/servers/{name}` |
+| `DELETE` | `/api/space/mcp/servers/{name}` |
+| `POST` | `/api/space/mcp/servers/{name}/authorize` |
+| `GET` | `/api/space/mcp/oauth/callback` |
+| `POST` | `/api/space/mcp/servers/{name}/test` |
+| `GET` | `/api/space/mcp/catalog` |
+| `POST` | `/api/space/mcp/catalog/{entry_id}/install` |
+
+#### `subagents:router` — `/api/subagents` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/subagents/detect` |
+| `GET` | `/api/subagents/backends/options` |
+| `POST` | `/api/subagents/backends/{kind}/sync` |
+| `GET` | `/api/subagents/connections` |
+| `POST` | `/api/subagents/connections` |
+| `DELETE` | `/api/subagents/connections/{name}` |
+| `POST` | `/api/subagents/connections/{name}/message` |
+| `GET` | `/api/subagents/settings` |
+| `PUT` | `/api/subagents/settings` |
+
+#### `system:router` — `/api/system` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/system/runtime` |
+| `GET` | `/api/system/update` |
+| `POST` | `/api/system/update/check` |
+| `PUT` | `/api/system/update/settings` |
+| `GET` | `/api/system/update/job` |
+| `POST` | `/api/system/update` |
+| `GET` | `/api/system/status` |
+| `GET` | `/api/system/memory` |
+| `POST` | `/api/system/test/llm` |
+| `POST` | `/api/system/test/embeddings` |
+| `POST` | `/api/system/test/search` |
+
+#### `task_board:router` — `/api/task-board` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/task-board` |
+| `GET` | `/api/task-board/events` |
+| `POST` | `/api/task-board/cards` |
+| `PATCH` | `/api/task-board/cards/{card_id}` |
+| `PUT` | `/api/task-board/colors` |
+| `PUT` | `/api/task-board/sessions/{session_id}` |
+| `PATCH` | `/api/task-board/sessions/{session_id}/status` |
+
+#### `tools:router` — `/api/tools` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/tools` |
+
+#### `attachments:router` — `/files/attachments` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/files/attachments/{session_id}/{attachment_id}/{filename:path}` |
+
+#### `file_library:router` — `/files/library` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/files/library/` |
+| `POST` | `/files/library/` |
+| `GET` | `/files/library/search` |
+| `GET` | `/files/library/{file_id}` |
+| `GET` | `/files/library/{file_id}/download` |
+| `HEAD` | `/files/library/{file_id}/download` |
+| `DELETE` | `/files/library/{file_id}` |
+| `POST` | `/files/library/{file_id}/restore` |
+
+#### `outputs:router` — `/files/outputs` · public
+
+| Method | Path |
+| --- | --- |
+| `HEAD` | `/files/outputs/{output_path:path}` |
+| `GET` | `/files/outputs/{output_path:path}` |
+
+#### `quiz_judge:router` — `/ws` · public
+
+| Method | Path |
+| --- | --- |
+| `WS` | `/ws/questions/judge` |
+
+### visualize
+
+#### `visualizers:router` — `/api/visualizers` · learning
+
+| Method | Path |
+| --- | --- |
+| `GET` | `/api/visualizers/list` |
+| `POST` | `/api/visualizers/bundled/{visualizer_id}/install` |
+| `POST` | `/api/visualizers/{visualizer_id}/enable` |
+| `POST` | `/api/visualizers/{visualizer_id}/disable` |
+| `DELETE` | `/api/visualizers/{visualizer_id}` |
+| `POST` | `/api/visualizers/import` |
+| `GET` | `/api/visualizers/{visualizer_id}/assets/{asset_path:path}` |
diff --git a/docs/src/content/docs/developers/reference/turn-protocol.md b/docs/src/content/docs/developers/reference/turn-protocol.md
new file mode 100644
index 000000000..77ff5e8f9
--- /dev/null
+++ b/docs/src/content/docs/developers/reference/turn-protocol.md
@@ -0,0 +1,35 @@
+---
+title: Turn protocol
+description: Client commands and server events on the unified turn WebSocket.
+quadrant: reference
+---
+
+The web UI and `deeptutor run --format json` share one socket:
+
+```text
+WS /ws
+```
+
+Commands and events are the models in `deeptutor/api/contracts/turn_protocol.py`. Extra fields are rejected. Current commands set `protocol_version` to `"2.0"`. How to open the socket and authenticate is on the [HTTP API](/developers/reference/http-api/) page.
+
+## Commands
+
+| `type` | Required fields |
+| --- | --- |
+| `start_turn` or `message` | The turn request: `content`, and optional `capability`, `session_id`, `tools`, `knowledge_bases`, `language`, `config`, `skills`, references, and `attachments`. `skills` narrows `read_skill` to its intersection with the workspace allowlist (omitting or sending `[]` inherits the workspace's visible set). |
+| `subscribe_turn` | `turn_id`, optional `after_seq` |
+| `subscribe_session` | `session_id`, optional `after_seq` |
+| `resume_from` | `turn_id`, optional `seq` |
+| `unsubscribe` | `turn_id` or `session_id` |
+| `cancel_turn` | `turn_id`, `command_id` |
+| `regenerate` | `session_id`, optional `overrides` |
+| `submit_user_reply` | The reply payload defined on `SubmitUserReplyCommand` |
+| `ping` | none |
+
+Subscriptions replay events after `after_seq`. A terminal turn ends with `done`. A failed turn emits `error` first.
+
+## Events
+
+`stage_start`, `stage_end`, `thinking`, `observation`, `content`, `tool_call`, `tool_result`, `progress`, `sources`, `result`, `error`, `session`, `session_meta`, `wait_for_input`, `done`.
+
+Control messages on the same socket also include `pong`, a command acknowledgement, and a protocol error. Their fields are the corresponding models in `turn_protocol.py`.
diff --git a/docs/src/content/docs/ecosystem/index.md b/docs/src/content/docs/ecosystem/index.md
deleted file mode 100644
index 35beace45..000000000
--- a/docs/src/content/docs/ecosystem/index.md
+++ /dev/null
@@ -1,35 +0,0 @@
----
-title: DeepTutor Ecosystem
-description: Extend DeepTutor through RAG integrations, reusable Skills, remote MCP services, sandboxed CLI Apps, and EduHub.
-quadrant: explanation
----
-
-DeepTutor's built-in learning surfaces cover the everyday product. The **ecosystem** is how you add behavior and tools without changing that core: connect a retrieval engine, teach the model a workflow, connect an external service, install a command-line application, or discover community Skills.
-
-
-
-## Five extension paths
-
-| Extension | What it adds | Ownership |
-|---|---|---|
-| [**Skills**](/ecosystem/skills/) | `SKILL.md` playbooks the model reads when a workflow calls for them | Built-in, local, ClawHub, or EduHub |
-| [**MCP Services**](/ecosystem/mcp/) | Tools exposed by hosted or deployment-managed MCP servers | Per account for remote services; admin for deployment registry |
-| [**CLI Apps**](/ecosystem/cli-apps/) | Installed command-line programs exposed to turns as sandboxed tools | Admin installs and grants; permitted accounts run |
-| [**RAG Integration**](/ecosystem/rag-integration/) | Local, agentic, remote, or live-library retrieval behind a Knowledge Base | Deployment configuration plus per-KB choice |
-| [**EduHub**](/ecosystem/eduhub/) | Community discovery, versioning, import, and publishing for Skills | Community authors publish; users review and import |
-
-The trust boundary is different for each path. RAG integrations own retrieval, a Skill is instructions, an MCP service is a remote tool boundary, and a CLI App is code installed on the host. EduHub distributes Skills without becoming their runtime. DeepTutor therefore gives each path a different configuration, installation, credential, sandbox, and grant model.
-
-## Where they appear in the product
-
-Knowledge engines are selected through the **Knowledge Center**. Skills, MCP Services, and CLI Apps are managed from **Personalization**, with EduHub embedded in the Skills importer. Once enabled, tools appear to the Home agent through the same discovery flow as built-ins.
-
-## Start with a workspace task
-
-Keep course or project files in that workspace's **Resources**, study them through **Learning**, and use **Home** to ask for an explanation or create an output. [Personalization](/explore/personalization/) is the account shelf from which you supply personas, skills, agents, and connections. The same shelf remains available across workspace switches.
-
-For skills and MCP services, configure the workspace's **Assigned resources** in Settings, then narrow the current conversation if needed. Workspace assignments reference the account catalog; they do not copy credentials or bypass user grants. CLI Apps have their own administrator installation and grant controls. RAG remains associated with a Knowledge Base and the materials it retrieves.
-
-## Next
-
-Start with [RAG Integration](/ecosystem/rag-integration/) when retrieval is the extension point. Use [Skills](/ecosystem/skills/) for repeatable workflows, [MCP Services](/ecosystem/mcp/) for account-connected online services, and [CLI Apps](/ecosystem/cli-apps/) when the job needs a real command-line program. Visit [EduHub](/ecosystem/eduhub/) to discover or publish community Skills.
diff --git a/docs/src/content/docs/explore/chat-workspace.md b/docs/src/content/docs/explore/chat-workspace.md
deleted file mode 100644
index b9ca31bfb..000000000
--- a/docs/src/content/docs/explore/chat-workspace.md
+++ /dev/null
@@ -1,205 +0,0 @@
----
-title: Chat
-description: "The default DeepTutor agent loop — capabilities, session context, reusable references, tools, the Activity panel, and the models behind it all."
-quadrant: how-to
----
-
-Home is the heart of DeepTutor. It is not a plain message box: it is the **default agent loop** that can call tools, read your sources, search knowledge bases, write notes, generate images, consult other agents, ask you clarifying questions, and switch into deeper capabilities — all inside one thread.
-
-## Where it is
-
-Select your [workspace](/explore/workspaces/), then open **Home → Chat** (`/chat`). Home also contains the [Task Board](/explore/task-board/), [Learning notebook](/explore/co-writer/) and [Calendar](/explore/calendar/). Chat, tasks and notebook pages follow the workspace; Calendar events are account level, with workspace study layers.
-
-
-
-The window has three regions:
-
-| Region | What it does |
-| --- | --- |
-| **Left sidebar** | The workspace menu sits above **Home**, **Learning** and **Resources**. **Partners** and **Personalization** are account-level areas. Conversations reopen with their learning context; Settings and workspace management are available from the workspace menu. Classic layout uses a different navigation arrangement. |
-| **Composer** | The message box. Its **bottom-left** sets *what kind of turn* this is (capability) and adds references (`+`); its **bottom-right** exposes connected-agent, knowledge, persona, and model selectors. The microphone only transcribes the current message. |
-| **Activity panel** (top-right toggle) | Tool calls, references, generated files, attachments, and previews for the current session, plus a quick way to open a URL or local file. |
-
-With authentication enabled, signed-in users also see **My profile** in the sidebar. It shows the username (not editable here), role, and join date; use it to upload an avatar image or choose an icon and color, and to sign out.
-
-The top-right icons above the thread let you **save useful content to Favorites**, **export the session as Markdown**, and **toggle the Activity panel**.
-
-## Your first useful conversation
-
-1. Select the workspace for your project and open a new Chat.
-2. Add a PDF or a specific saved reference with the resource control; attach a knowledge base when you need retrieval across its library.
-3. State the outcome and constraints: “Explain the sampling theorem using this lecture, then give me two questions. Let me try before showing answers.”
-4. Follow tool progress in Activity and open cited sources or generated files when you need to inspect the evidence.
-5. Save a useful result to [Favorites](/explore/favorites/), or develop your own explanation in the [Learning notebook](/explore/co-writer/). Reopen the conversation from Resources → Chat History.
-
-Selecting a connected agent is by default a persistent choice for the session; importing an old agent transcript is a reference. Likewise, an attached file supplies this turn's material by default, while workspace instructions and session preferences shape later turns. Check the visible chips before sending if a reply seems to be using the wrong sources or persona.
-
-## Starting points
-
-Under the empty composer, Explain, Solve, Practice, Plan, and Research offer editable starting prompts. A separate personalized suggestion draws on your memory and recent activities; **Suggest something else** replaces it. Choose either to fill the composer, then review before sending. **Customize page → Starting prompts** edits the reusable titles and requests.
-
-**Settings → Conversation** sets how much history feeds them: raise the activity count for suggestions that range wider, lower it to keep them close to what you were just doing.
-
-
-## The agent loop (how it thinks)
-
-DeepTutor Chat runs a single agent loop, so one message can take several internal rounds before you see an answer:
-
-1. The model reads your message and the mounted context, then either answers directly or plans a tool call.
-2. If tools are needed, DeepTutor dispatches them and appends the observations (you can watch this in the Activity panel).
-3. The model continues with better evidence — reading a source, querying a KB, running code, fetching a URL.
-4. A final, tool-free message ends the turn.
-
-`ask_user` is special: instead of guessing, the agent can **pause the turn**, ask you a structured clarifying question, and resume once you answer.
-
-## Choosing a capability
-
-The selector at the bottom-left of the composer (the Modern layout labels the default **Auto**; Classic calls it **Chat**) decides which capability handles the turn. Capabilities share orchestration and session context; some reuse Chat's loop, while others run a purpose-built pipeline.
-
-The capability menu offers dedicated modes including **Ask Questions**, **Quiz**, **Visualize**, and **Video Lesson**; **Research** and **Solve** sit behind the *More Capabilities* flyout. **Mastery Path** and **Immersive Reading** are learning activities under **Learning**, alongside Books and Practice. The grouping is presentation only, not a statement about how any mode runs internally.
-
-| Capability | Use it for |
-| --- | --- |
-| **Chat** | Flexible conversation with any tool — open-ended Q&A, lightweight tool use, the everyday default. |
-| **Ask Questions** | Start with a context-aware clarification card, then complete the original request using your answers. |
-| **Quiz** | Auto-validated question generation: practice sets, mimic-an-exam workflows, quizzes from your sources. |
-| **Visualize** | Charts, diagrams, interactive HTML, SVG, Mermaid, and Manim — selected from an extensible visualizer catalog. |
-| **Video Lesson** | Generate a browser-played lesson with captions and optional narration from the configured Text-to-Speech provider or Edge; the backend needs Node.js 22+ and npm. |
-| **Immersive Reading** (learning activity) | Documents, audio, and video with source-grounded tutoring; media transcripts use timestamps. |
-| **Research** (under *More Capabilities*) | Comprehensive multi-agent research: subtopic decomposition, RAG / web / arXiv retrieval, cited reports. |
-| **Solve** (under *More Capabilities*) | Multi-step reasoning and problem solving with verification and worked solutions. |
-
-
-Video learning now opens in **Immersive Reading** collections, alongside documents and audio. YouTube playback uses the native player; Settings selects caption sources and configures optional Invidious browsing. The companion cites transcript timestamps and cannot see video frames. Without a transcript, playback remains available. Reopening a legacy Watching session migrates retained material and notes into Reading; if material is missing, the conversation remains available as Chat.
-
-
-Visualize now reads its render modes from a catalog. SVG, Mermaid, Mermaid mind maps, Chart.js, interactive HTML, Manim animation, and Manim storyboard are core types; GeoGebra is a bundled optional install. You can also import a visualizer ZIP containing `visualizer.json` and browser assets. Imported renderers run in a sandboxed iframe, contain no backend Python, and can be enabled, disabled, or removed per user.
-
-
-### Little Tutor — follow up on a selection
-
-Select text in a conversation and open **Little Tutor** to start an independent, source-grounded sidebar thread. It stays nested under the source conversation and keeps its own focused context without global memory or general-purpose tools, so a close reading does not derail the main thread.
-
-## Sticky context vs. one-time references
-
-DeepTutor splits context into two kinds, and the composer keeps them in two different places — this is the single most important idea to learn here.
-
-**Sticky session context** persists across turns until you change it: capability, workspace or course binding, tools, **knowledge bases**, **persona**, **model**, and Reading / Mastery state. The right side exposes the relevant selectors; an agent selected with the Agent chip or `@` stays attached by default, while the microphone only fills the current draft.
-
-**References** live behind the **`+` button** on the left. They default to *this* turn only; use the reuse control to reuse a supported reference on every turn.
-
-
-| `+` reference | What it pulls in |
-| --- | --- |
-| **Attach files** | A PDF, image, Office doc, Markdown, or data file for the agent to read. |
-| **Chat History** | A past session as grounding context. |
-| **My Agents** | An imported Claude Code / Codex / ChatGPT transcript to explore — see [My Agents](/explore/subagents/). |
-| **Books / Reading / Notebooks / Question Bank** | A compiled book, a reading section, a saved notebook, or practice questions from your [Resources](/explore/space/). Filter questions by material or category; **Select all** keeps earlier selections. |
-| **Memory** | A specific memory document, when you want the agent to work from a fact you can point at rather than whatever recall surfaces. |
-
-Typing **`@`** in the main Chat composer filters the same connected-agent list as the Agent chip and keeps the selection attached by default. Follow-up surfaces without live-agent selection use `@` for their Space reference menu instead.
-
-### Knowledge — ground answers in your library
-
-The **database icon** opens the knowledge picker. Untouched conversations inherit ready workspace assignments or the default KB; explicit selections, including none, persist until changed. The agent retrieves from these bases when grounding is needed.
-
-How it retrieves depends on the base's engine, and the difference is worth knowing when an answer surprises you. Most bases — LlamaIndex, GraphRAG, LightRAG, a linked index, a remote LightRAG Server, a Tencent IMA library — are served by the `rag` tool. **PageIndex OSS** and **PageIndex Cloud** are not: their retrieval is agentic, so a reading loop walks the local or hosted document tree instead, and those bases are deliberately absent from `rag`'s list. An **Obsidian** vault has no index at all and is routed to the Obsidian capability, which navigates the live files; a **MarginNote 4** library is the same shape, walked by its own tools.
-
-
-### Persona — set the voice and stance
-
-The **person icon** chooses a persona. `Default` is the plain assistant; built-ins like **peer**, **research-assistant**, and **teacher** change tone and pedagogy. Personas are managed under **Personalization → Personas** and can be reused by Partners.
-
-
-### Model — switch per turn
-
-The **model chip** picks which model runs this turn. Every model you configured in Settings appears here with its provider and context window, and the default is marked. Switch to a long-context model for big documents, or a cheaper/faster one for quick exchanges — mid-session, without losing your place.
-
-
-## The Activity panel
-
-The panel toggle (top-right) opens **Activity** — a live record of the tools, references, and files the current session has used — generated files listed above your uploads — plus an **Open** box to pull a URL or a local file into the in-app viewer.
-
-
-
-As a turn runs, each tool call collapses into a compact header (for example, `Done · 21s`) that you can expand to inspect inputs and outputs — so the thread stays readable while the full trace stays auditable.
-
-## Knowing how full the window is
-
-A chip in the composer reports how much of the model's context window this turn actually used and what is filling it — prompt blocks, tool schemas, the message list. It is measured from the assembled prompt rather than re-derived afterwards, so the readout cannot drift from what was sent. Open it to see the breakdown before deciding whether to switch to a longer-context model or start a fresh session.
-
-Long conversations also grow a rail of ticks in the transcript's left gutter, one per question you asked, for jumping back without scrolling.
-
-## Tools — including generation
-
-Tools come in three kinds, and the split is about who decides.
-
-**You decide** for the experience-enhancement tools in **Settings → Tools**: `brainstorm`, `web_search`, `paper_search`, `zotero_search`, `reason`, and `geogebra_analysis` — plus `imagegen` and `videogen` once you configure the matching generation model.
-
-**Context decides** for the rest, which mount automatically when they are useful and are locked on from the composer's point of view: `rag`, `kb_files`, `knowledge_frontier`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `list_favorites`, `save_favorite`, `question_bank`, `web_fetch`, `github`, `preprint`, `research_audit`, `research_lit`, `learning_status`, `learning_update`, `ask_user`, `load_tools`, `cron`, `mastery_topics`, `mastery_sessions`, `mastery_open_session`, `mastery_new_session`, and the single code path `exec` (python, c, cpp, or shell). A capability adds its own on top: the eight reading tools, the mastery tutoring tools, `consult_subagent`, and so on. A third group answers to neither: the workspace baseline includes file tools plus `write_note` and `search_notes`, while `workspace_export` needs your approval to move a file out of `outputs/`. (Partners are the exception: a companion can be denied context-gated tools individually — see [Partners](/explore/partners/).)
-
-### Scheduling something for later
-
-`cron` lets a turn schedule work instead of doing it now: **at** a time, **every** N seconds, or on a **cron expression** with a timezone. When the job is due, its message runs as a new instruction **in this same conversation** and the reply lands here — so "quiz me on this chapter every weekday at 9" is a sentence, not a setup screen. The same tool lists this conversation's jobs and cancels one. For a Partner, a due job rides back out through the IM channel the partner is connected to.
-
-Configure an **Image Generation** (or Video Generation) model in Settings and it becomes a chat tool too — ask in plain language and the agent calls it, then previews the result inline with a downloadable file.
-
-## The content workspace
-
-The **content workspace** is the folder bound to a conversation. Unbound sessions use the General workspace; you can create custom workspaces for separate projects. The System workspace holds shared skills and sanitized configuration snapshots; private runtime settings, API keys, databases, and memory stay outside conversational file access.
-
-Manage roots, workspaces, and **Workspace instructions** in **Settings → Workspace**. Instructions apply from the next turn for supported capabilities, excluding Deep Research, Quiz, and Manim; capability rules and permissions still apply. Built-in and managed custom folders live under `/data/user/workspaces` by default. The CLI also manages the legacy content-folder binding:
-
-```bash
-deeptutor workspace show
-deeptutor workspace set /absolute/path/to/my-folder
-deeptutor workspace reset
-```
-
-Reading is free; writing is not. Everything a turn creates — downloads, generated files, code output, rendered assets — lands under a turn-scoped `outputs////` directory. Execution is read-only everywhere else in the folder, and copying a generated file out of `outputs/` into the rest of your material takes an explicit **Allow once** confirmation naming that exact source and destination.
-
-The model never sees an absolute path — only relative ones such as `outputs/report.docx`. When it calls `workspace_present`, the UI renders an authenticated, openable snapshot; the same relative path also works in an ordinary Markdown link or image. Changing the source file later does not change a snapshot already presented.
-
-On Docker and server deployments the deployment folder constrains managed workspace storage — see [Docker](/get-started/docker/).
-
-## Configure what Chat can use
-
-Everything in the composer toolbar resolves to configuration in **Settings**.
-
-**Settings → Models & services** is where the models live: LLM, Task Models, Embedding, Search, Text-to-Speech, Speech-to-Text, Image Generation, and Video Generation. **Task Models** handles titles, suggestions, and reading helpers, with overrides per task; TTS powers read-aloud, STT powers the microphone, and image/video models become chat tools.
-
-
-
-Separate **Settings** pages provide five controls: **Video Learning** (caption sources and optional Invidious browsing settings), **Tools**, **Capabilities** (per-capability LLM parameters and runtime knobs), **Starting points**, and **Attachments** (upload caps and extraction budgets). MCP services and CLI Apps live in account-level Personalization; see [DeepTutor Ecosystem](/ecosystem/).
-
-
-See [Settings](/explore/settings/) for the full control plane.
-
-## On a phone
-
-Below tablet width the workspace collapses to a single column with a slide-over sidebar, so the same thread is usable on a phone rather than rendering a three-pane desktop layout off the edge of the viewport.
-
-## Practical examples
-
-```text
-Attach a KB + ask: "Explain chapter 4 and quiz me on the weak spots."
-```
-
-```text
-Attach a PDF + ask: "Extract the assumptions and save the final summary to my notebook."
-```
-
-```bash
-deeptutor run chat "Explain the Fourier transform" --kb signals
-deeptutor chat --capability deep_research --kb papers
-```
-
-## See also
-
-- [Immersive Reading](/explore/reading/) — the same loop, with documents or media open beside it
-- [DeepTutor Ecosystem](/ecosystem/) — Skills, MCP Services, and CLI Apps the agent can call
-- [Partners](/explore/partners/) — the same loop, running inside IM companions
-- [My Agents](/explore/subagents/) — consult Claude Code, Codex, or a Partner from a chat turn
-- [Knowledge Center](/explore/knowledge/) — build the RAG libraries you attach here
-- [Memory](/explore/memory/) — the personalization the loop reads and writes
-- [Settings](/explore/settings/) — models, tools, capabilities, and runtime control
diff --git a/docs/src/content/docs/explore/index.md b/docs/src/content/docs/explore/index.md
deleted file mode 100644
index 7622877a2..000000000
--- a/docs/src/content/docs/explore/index.md
+++ /dev/null
@@ -1,50 +0,0 @@
----
-title: A connected learning workflow
-description: Follow one project through workspace-scoped Home, Learning, and Resources, with account-level Partners and Personalization.
-quadrant: tutorial
----
-
-The sidebar is a map of **where your work belongs**. Choose a workspace first, then move between its conversations, learning activities, and reusable sources. Your account supplies the companions and preferences you can bring into that work.
-
-## Two scopes, five shelves
-
-| Shelf | Scope | What you use it for |
-| --- | --- | --- |
-| [Chat](/explore/chat-workspace/) | Workspace | Conversations, a task board, and your Learning notebook |
-| [Learning](/explore/learning/) | Workspace | Books, Mastery Paths, Reading collections, and Practice |
-| [Resources](/explore/space/) | Workspace | Chat history, Favorites, question bank, learning journal, and knowledge bases |
-| [Partners](/explore/partners/) | Account | Persistent companions, their instructions, resource access, and channels |
-| [Personalization](/explore/personalization/) | Account | Personas, skills, connected agents, MCP, CLI apps, and memory controls |
-
-**Calendar is an exception within Home:** it offers an account-wide view across workspaces. [Calendar](/explore/calendar/) explains how to read the source workspace of an event. A Partner also has an explicit working context: its account-level identity does not mean every conversation can read every workspace.
-
-## 1. Give a project its own workspace
-
-Create or select a workspace for “Signals and sampling.” Keep its lecture notes and exercises separate from another project such as “Academic writing.” Before adding material or starting a learning activity, check the active workspace. Switching changes the first three shelves’ contents, while your Partner and Personalization libraries remain available. See [scope and switching](/explore/workspaces/).
-
-## 2. Bring in sources, then ask a focused question
-
-Add reusable material to [Knowledge Center](/explore/knowledge/), or open a specific document in [Reading](/explore/reading/) when you want to work beside the source. In Home, attach the relevant context and ask something concrete: “Explain why low sampling rates can make two different signals look identical; cite this primer.”
-
-A stored asset is not automatically included in every model request. Attach sources or select the supported learning context explicitly. Check cited passages before building on an answer.
-
-## 3. Separate evidence from your own understanding
-
-Save useful original passages to [Favorites](/explore/favorites/). Then write your interpretation in a [Learning notebook](/explore/co-writer/), inserting references where useful. The notebook is where you develop an explanation; Favorites preserves the material you may want to reuse. Reopen the source when a claim needs checking, and use Dito beside a paragraph when you need help improving it.
-
-## 4. Choose the learning activity that fits
-
-- Use [Books](/explore/book/) for a structured sequence of pages and interactive blocks.
-- Use [Mastery Path](/explore/mastery-path/) for a goal broken into topics and guided study.
-- Use [Reading](/explore/reading/) for questions tied to a document or media timestamp.
-- Use [Practice](/explore/practice/) to answer, inspect feedback, and revisit weak areas.
-
-These are different ways to work with a topic, not steps you must complete in order. Start with one and use the supported capture or attachment controls to connect it to the next.
-
-## 5. Reuse assistance without mixing projects
-
-Choose a persona that asks you to explain your reasoning. Add a relevant skill when you need a repeatable method. Connect an external agent for consultation, or configure a Partner with a particular role and resource scope. Those account assets remain available in another workspace, while each workspace keeps its own learning records and materials.
-
-## Return to the work
-
-Use Home’s [Task Board](/explore/task-board/) for next actions, [Resources](/explore/space/) for saved evidence and history, and the Learning list to reopen an activity. You do not need to repeat setup or recreate a Partner whenever you switch subjects.
diff --git a/docs/src/content/docs/explore/learning.md b/docs/src/content/docs/explore/learning.md
deleted file mode 100644
index 1f9f2c915..000000000
--- a/docs/src/content/docs/explore/learning.md
+++ /dev/null
@@ -1,39 +0,0 @@
----
-title: Learning
-description: Choose a learning activity, resume your records, and connect reading, structured study and daily practice.
-quadrant: explanation
----
-
-**Learning** is the current workspace's study area. Open it from the sidebar to create an activity, search existing records, or continue where you stopped. In the Classic layout this area is called **Personalized Learning**.
-
-
-
-## Choose a way to learn
-
-| Activity | Start with | What you keep |
-| --- | --- | --- |
-| [Books](/explore/book/) | A subject and optional source material | An editable chapter plan, generated pages, reading position and page conversations |
-| [Mastery Path](/explore/mastery-path/) | A goal describing what you want to be able to do | A knowledge-point map, topic conversations and mastery evidence |
-| [Practice](/explore/practice/) | Collected or imported questions | Answers, mistakes, recall ratings and next review dates |
-| [Immersive Reading](/explore/reading/) | A document, web page, video or audio source | A material collection, source-linked conversations, highlights and notes |
-
-Books build a resource to read; Mastery Path tracks abilities; Practice exercises recall; Immersive Reading stays close to an existing source. Pick the one that fits the task, then move between them as needed.
-
-## Start and resume
-
-1. Check the selected [workspace](/explore/workspaces/).
-2. Use the create control in Learning or the sidebar's new-learning entry. Choose an activity and provide its topic, goal or materials.
-3. Reopen the resulting record from **All learning** or the feature's own library.
-4. Filter by activity type or search by title when the list grows. **Show more** reveals older records.
-
-The overview orders activity by recent updates. Books show reading progress; paths show mastered knowledge points. **What needs your attention** highlights due path reviews and books still compiling or paused. A paused book needs inspection before you treat it as complete. If one source fails to load, retry that source; an incomplete overview does not mean your records were deleted.
-
-## Turn a chapter into lasting knowledge
-
-For a probability exam, import your lecture PDF into Reading and ask about a difficult proof. Use the clarified objective to create a Mastery Path. Save a concise explanation to Favorites and insert it into your Learning notebook beside your own worked example. Review collected questions in Practice the next day. You can also generate a Book when you need a coherent account of the whole subject.
-
-[Resources](/explore/space/) holds the reusable inputs and saved results. **Learning journal** records the current mission, session handoff and confirmed learning records; it complements individual activity progress.
-
-## Access and scope
-
-Activities depend on the modules, models and account permissions available in your deployment. A locked or missing feature may require administrator access or module setup. Learning records belong to the active workspace; switching workspace changes the library. Partners and Personalization remain available across workspaces. In shared deployments, administrators manage the model catalog and user grants govern model access.
diff --git a/docs/src/content/docs/explore/partners.md b/docs/src/content/docs/explore/partners.md
deleted file mode 100644
index a7975ccc9..000000000
--- a/docs/src/content/docs/explore/partners.md
+++ /dev/null
@@ -1,103 +0,0 @@
----
-title: Partners
-description: Persistent IM-connected companions that run on the same chat agent loop as DeepTutor Chat — with their own soul, library, memory, and channels.
-quadrant: how-to
----
-
-Partners are persistent companions with their own identity, soul, model policy, library, memory, and channel configuration. They are not a separate bot engine: every inbound message — from the web or from an IM app — is routed through the **same** `ChatOrchestrator → AgenticChatPipeline` loop that powers [Home](/explore/chat-workspace/). A Partner is "a chat that has a personality and a phone number."
-
-## Where it is
-
-Open the account-level **Partners** entry in the left sidebar. The page lists the companions you own and any that an admin assigned to you, with their avatar, status, description, and connected channels. It also shows your Partner Groups and a **New partner** button.
-
-
-
-## Account companions and workspace resources
-
-**Partners belongs to your account.** The same companions and Partner Groups appear as you switch workspaces. A Partner's identity, channels, and relationship history therefore do not disappear when you move from a course to a research project.
-
-For resources, choose one of two arrangements in **Configure → Workspace**:
-
-| Arrangement | What the Partner uses | When to choose it |
-| --- | --- | --- |
-| **Partner private workspace** | Its own library; assign knowledge bases, skills, and Favorites collections as copies | A stable specialist companion whose materials should evolve separately |
-| **An existing workspace** | That workspace's current files, knowledge bases, skills, and Favorites collections; generated files go to its outputs folder | A project or course companion that should stay synchronized with your work |
-
-The workspace picker lists workspaces belonging to the Partner's owner. Binding one does not transfer ownership or grant access to another user's resources. Resource choices and the owner's model/tool grants still constrain the turn. Changing the binding applies from the next message; it does not move previous conversations into Home.
-
-In private mode, ordinary KBs, skills, and Favorites collections are copied when assigned. Editing the original later does not update the copy. Connected knowledge bases have no folder to copy, so supported connections retain a live source pointer instead. In bound mode, manage shared materials in that workspace's **Resources** and use **Learning** to study the same source collection; you do not also copy a private Library onto the Partner.
-
-The Partner retains its own soul and relationship state in both modes. Channel runtime state lives under `data/partners//channels//`. For an authenticated non-admin user, conversation history and relationship memory are private per user under `users//`; the Partner can also read that user's own shared memory. Admin and unattributed channel turns use the Partner's top-level history and memory as a fallback. Sharing materials does not merge these private relationships.
-
-## Ownership and shared access
-
-Partners are no longer admin-only resources. Any authenticated user can create one and becomes its owner; the owner and admins can configure its soul, library, channels, tools, models, and lifecycle. An admin can assign a Partner to other users, who may chat with it without seeing or changing its wiring.
-
-That split matters when a Partner is shared: identity and knowledge assets stay consistent, while each human keeps private sessions and relationship memory. An external IM account can join the same private scope after the user links it with `/link ` in a direct message.
-
-## Create a partner
-
-Press **New partner** and complete the wizard:
-
-1. **Identity** — name, avatar, description, and default reply language.
-2. **Soul** — the partner's role and communication style. This becomes its `SOUL.md`.
-3. **Mind** — model selection, enabled system tools, MCP tools, and delivery preferences.
-4. **Library** — choose a private workspace and copy permitted assets, or bind an existing workspace for live shared resources. Private copying excludes Obsidian, MarginNote, and subagent bases.
-5. **Review** — check identity, model, workspace, and selected assets, then create the Partner. Add channels afterwards; they are optional.
-
-Everything chosen here stays editable afterwards from the partner detail page.
-
-## Talk to a partner
-
-Open a partner to land on its **Chat** tab — a full conversation view that behaves like the main workspace, but as that companion. The tabs across the top are **Chat**, **Configure**, **Channels**, and **Archive**.
-
-
-Because a partner has memory, it builds up a picture of you over time. Ask it "what do you know about me?" and you'll see a `Recalling memory` step — the partner reads its own memory layers before answering in its soul. The **Configure** tab covers identity, soul, mind, and library. **Archive** is soft: Resume reopens the exact session key, Branch copies its full history and archives the source, and only Delete removes a conversation permanently.
-
-## Partner Groups
-
-A **Partner Group** brings two or more Partners into one shared conversation. Choose the member roster, discussion mode, and shared-memory mode, then address everyone or @mention selected members. Each Partner answers in its own seat, so their views remain distinct even when they reason over the same public discussion.
-
-Groups have their own conversation sessions and durable history. If one seat fails, that member can be retried independently without rerunning completed answers. Groups appear below the individual Partner cards on the Partners page; create at least two accessible Partners before forming one.
-
-## Channels
-
-Channels are delivery adapters around the same partner brain. The **Channels** tab lists every supported app down the left; pick one to configure its credentials and behavior on the right, then **Save** and enable it. The page polls the running Partner and reports whether each adapter is connected, connecting, listening, waiting for a scan, missing configuration, unavailable, failed, or simply stopped.
-
-
-
-Most channel cards share a few switches:
-
-| Field | Meaning |
-| --- | --- |
-| **Enabled** | Start this channel for the partner. Leave off while you collect credentials. |
-| **Send Progress** | Deliver narration/progress for long-running turns. Useful where a silent 60-second wait feels broken. |
-| **Send Tool Hints** | Deliver one-line tool-call hints such as `rag(query=…)`. Turn off for quieter production channels. |
-| **Allow From** | Allowlist of user ids, group ids, emails, or `*` (one per line). Empty usually denies all; `*` opens the channel. |
-
-The rest of each card is channel-specific (base URLs, tokens, polling). For the full list of apps and per-channel setup steps, see the [**Channel Matrix**](/partners/channels/) — start with [**WeChat**](/partners/weixin/), [**WeCom**](/partners/wecom/), or [**QQ / NapCat**](/partners/qq/).
-
-For QR-backed channels, setup stays in the browser. WeChat/WeCom onboarding and a WhatsApp bridge can publish a server-generated code into the card; scan or refresh it there, then watch the same panel move from **Waiting for scan** to a connected state. Use logs only when the status detail does not already explain the failure.
-
-
-## Partners as consultable agents
-
-A partner can also be **connected as an agent** and consulted from a normal chat turn — DeepTutor sends your question into the partner's own session and folds its answer back. See [My Agents](/explore/subagents/).
-
-## CLI mirror
-
-```bash
-deeptutor partner list
-deeptutor partner create math-tutor --soul "Socratic math tutor"
-deeptutor partner start math-tutor
-deeptutor partner stop math-tutor
-```
-
-The CLI is handy for smoke tests, but the web UI is the recommended place to configure channels — it masks secrets, shows each channel's schema inline, and exposes live setup/runtime state.
-
-## See also
-
-- [Home](/explore/chat-workspace/) — the same loop, without a personality or channels
-- [My Agents](/explore/subagents/) — consult a partner from chat
-- [Partners & Channels](/partners/) — the full channel setup guides
-- [Memory](/explore/memory/) — how a partner's memory relates to yours
diff --git a/docs/src/content/docs/explore/personalization.md b/docs/src/content/docs/explore/personalization.md
deleted file mode 100644
index b030ff527..000000000
--- a/docs/src/content/docs/explore/personalization.md
+++ /dev/null
@@ -1,56 +0,0 @@
----
-title: Personalization
-description: Manage the agents, personas, skills, connected services, CLI apps, and memory that accompany your account across workspaces.
-quadrant: how-to
----
-
-**Personalization** is your account's shelf of reusable behavior and connections. Open it from the sidebar to reach **My Agents**, **Personas**, **Skills**, **MCP Services**, **CLI Apps**, and **Memory**. Switching from a course workspace to a research workspace keeps this shelf available; each workspace decides which resources its turns may use.
-
-
-
-## Account shelf and workspace context
-
-A workspace groups the work itself: **Home** for conversations, **Learning** for study and practice, and **Resources** for materials. Personalization supplies ways of working with those materials. For example, a patient teaching persona can serve both a calculus course and a language course, while each course keeps its own files, reading progress, and learning topics.
-
-| Keep here | Use it for | Scope to remember |
-| --- | --- | --- |
-| **My Agents** | Consult a connected harness or Partner; import earlier agent conversations | The connection belongs to the account; a local harness uses its configured working directory |
-| **Personas** | Reuse a voice, teaching style, or response policy | Account behavior preset selected for a turn |
-| **Skills** | Reuse a workflow and its supporting instructions | Account shared library or an explicitly selected workspace library |
-| **MCP Services** | Authorize an external service and discover its tools | Account connection, plus any administrator-managed services you may use |
-| **CLI Apps** | Run an installed command-line application through tools | Administrator installs; account grants govern use |
-| **Memory** | Review retained preferences and learning experiences | Personal memory accompanies the learner; Partner relationship memory is separate |
-
-A library entry is not automatic permission to use it everywhere. In **Settings → Workspace**, configure the workspace's allowed skills, MCP services, and knowledge bases. A conversation may narrow skills and MCP services further in its composer. These selections intersect with the signed-in user's grants; they never grant access to another account's resources. An unselected composer inherits its workspace selection. See [Settings](/explore/settings/) for configuration and [Resources](/explore/space/) for materials.
-
-## Create and use a persona
-
-Open **Personalization → Personas**, create a preset, and give it a name, a short description, and Markdown instructions. Describe behavior concretely: “ask for the learner's next step before revealing a solution” is more useful than “be helpful.” Save it, select it in the chat composer's persona control, and test it on a short question.
-
-Personas change how DeepTutor responds; the selected capability still determines the task and stages. A teacher persona can guide an explanation, and a research-assistant persona can guide a literature discussion, without replacing those workflows. Edit your own preset when its style needs adjustment; delete it when it is no longer useful. Deployment presets are read-only to ordinary users. Your own persona with the same name takes precedence over the deployment preset.
-
-A persona is also a starting point for a Partner's soul: the creation wizard can clone its content. That produces the Partner's own identity; later edits to the original persona do not silently rewrite the Partner. Use [Partners](/explore/partners/) for a persistent companion with channels and relationship memory.
-
-## Build a reusable skill library
-
-Open **Personalization → Skills** and check **Skill library** before creating or importing anything. **Account shared skills** can be assigned to several workspaces. Selecting a workspace creates and edits its local skills instead. An enabled workspace skill overrides a shared skill of the same name; the scope picker prevents a course-specific workflow from accidentally becoming your account-wide version.
-
-Create a skill for a repeatable procedure, such as reviewing an essay against a rubric or turning lab notes into a report. Include its trigger, expected inputs, steps, and output requirements. Import community skills through EduHub, inspect their instructions, and test against a small real example. Keep the account version general; use a local override when a course has a different rubric. See [Skills](/ecosystem/skills/) for authoring and lifecycle details.
-
-## Connect services and applications
-
-Use **MCP Services** when the work depends on a remote service. Connect from the store or add a server URL, finish its API-key or OAuth flow, and confirm it is connected. Allow the service in the intended workspace and select it for the conversation when needed. If a service changes to **needs auth**, reconnect from Installed. Removing a connection makes its tools unavailable; update workspaces that reference it. Credentials stay with the account connection rather than the workspace's files.
-
-Use **CLI Apps** for installed programs that operate on files. An administrator installs the app and grants access; the agent runs it in the sandbox. A skill may explain when and how to use that app, but importing the skill does not install the program or grant permission. See [MCP Services](/ecosystem/mcp/) and [CLI Apps](/ecosystem/cli-apps/).
-
-## Put the pieces together
-
-For a literature project, keep PDFs and reading notes in the project's **Resources**, read and annotate them in **Learning**, then open **Home** with the research persona and an allowed citation skill. Add a connected service for live reference lookup only when the task needs it. Outputs and conversation context remain associated with the working workspace.
-
-For exam preparation, use a course workspace's materials and learning topics with a teaching persona. Keep a general study-planning skill in the account shelf and a course-specific marking rubric in the workspace skill library. Review remembered preferences in **Memory** if the tutoring style stops matching your needs.
-
-For a companion available in IM, create an account-level Partner and choose whether it uses a private copied library or a live workspace binding. A connected Partner can also be consulted from Home through My Agents. Those choices control different things: where you reach the companion, which resources it sees, and which conversation it continues.
-
-## When something is missing
-
-Check the account library first, then the workspace selection, then the conversation selection. For a shared deployment, also check your per-user grants. A skill may be present but filtered out by the workspace; an MCP service may be selected but awaiting authorization; a CLI App may be listed but not installed, enabled, or granted. **Settings → Runtime status** helps distinguish a missing module or provider from a resource selection problem.
diff --git a/docs/src/content/docs/get-started/desktop.md b/docs/src/content/docs/get-started/desktop.md
index 2371f0c60..212b6e0ee 100644
--- a/docs/src/content/docs/get-started/desktop.md
+++ b/docs/src/content/docs/get-started/desktop.md
@@ -48,5 +48,5 @@ Learning data and settings stay in the app’s workspace folder. Replacing the a
## Next
-- [A first study session](/explore/) — one topic, one source, one question.
+- [A first study session](/learning-workspace/) — one topic, one source, one question.
- [Changelog](/get-started/changelog/) — read this before replacing an older desktop app. v1.7.4 changes the runtime signing key, so install that app itself rather than importing an update into an older build.
diff --git a/docs/src/content/docs/get-started/docker.md b/docs/src/content/docs/get-started/docker.md
index 4e8d2d1ea..c16d5b5f5 100644
--- a/docs/src/content/docs/get-started/docker.md
+++ b/docs/src/content/docs/get-started/docker.md
@@ -22,183 +22,8 @@ docker run --rm --name deeptutor \
Open . The container creates `/app/data/user/settings/*.json` on first boot; configure model providers from the Web Settings page. Config, API keys, logs, the default content workspace, memory, knowledge bases, and Partner workspaces (`data/partners//`) all persist in the `deeptutor-data` volume. Optional extras belong on the deployment, not in a shell: set `DEEPTUTOR_EXTRAS` (and `DEEPTUTOR_APT_PACKAGES`), and every container re-applies them at start.
-## Select a host content workspace
-
-By default content workspace storage lives inside the `deeptutor-data` volume. To use a folder on the host instead, mount it at the stable container path `/workspace` and lock DeepTutor to it:
-
-```bash
-mkdir -p "$PWD/deeptutor-workspace/outputs"
-docker run --rm --name deeptutor \
- -p 127.0.0.1:3782:3782 \
- -v deeptutor-data:/app/data \
- -v "$PWD/deeptutor-workspace:/workspace" \
- -e DEEPTUTOR_WORKSPACE_ROOT=/workspace \
- -e DEEPTUTOR_WORKSPACE_ALLOWED_ROOTS=/workspace \
- ghcr.io/hkuds/deeptutor:latest
-```
-
-Create `outputs/` yourself before the first run — otherwise Docker creates the bind source as root and the unprivileged app cannot write into it.
-
-The container always sees `/workspace`, so paths stay portable across hosts. This deployment root constrains every account. Managed workspaces use account-scoped directories under `outputs/.deeptutor/chat/`; **Settings → Workspace** manages their identities and storage without exposing private runtime settings.
-
-With Compose, set `DEEPTUTOR_WORKSPACE_HOST=/absolute/host/folder` before `python scripts/docker_compose.py up -d`; the helper creates the folder and its `outputs/` for you. Omit it to keep `./data/user/workspace`.
-
-## Detached mode
-
-Add `-d` to run in the background:
-
-```bash
-docker run -d --name deeptutor \
- -p 127.0.0.1:3782:3782 \
- -v deeptutor-data:/app/data \
- ghcr.io/hkuds/deeptutor:latest
-
-docker logs -f deeptutor # follow logs
-docker stop deeptutor # stop
-docker rm deeptutor # remove (volume persists)
-```
-
-The `deeptutor-data` volume keeps your settings and default content workspace across `stop` / `rm` cycles. To truly start over: `docker volume rm deeptutor-data`.
-
-## Remote Docker / reverse proxy
-
-The browser only ever talks to the frontend origin (`:3782`); the in-container
-Next.js middleware forwards `/api/*` and `/ws/*` to the backend on
-`localhost:8001` server-side. So for the common **single-container** case you do
-**not** need to configure an API base at all — just point your reverse proxy /
-TLS terminator at the published `:3782`:
-
-```text
-deeptutor.example.com {
- reverse_proxy localhost:3782
-}
-```
-
-You only need an API base for a **split deployment**, where the backend runs in a
-separate container or host. Set it in `data/user/settings/system.json` in the
-mounted volume to the in-network address the **frontend server** uses to reach
-the backend — it's read server-side by the proxy, not sent to the browser:
-
-```json
-{
- "next_public_api_base": "http://backend:8001"
-}
-```
-
-`next_public_api_base_external` (and its alias `public_api_base`) are accepted as
-lower-precedence fallbacks and normalized on save.
-
-CORS only matters with auth enabled and a cross-origin frontend: `cors_origins`
-lists the frontend page origins allowed to call the backend. With auth disabled,
-DeepTutor permits normal HTTP/HTTPS browser origins by default.
-
-```json
-{
- "cors_origins": ["https://deeptutor.example.com"]
-}
-```
-
-## Different host ports
-
-Change the left side of the `-p host:container` mapping:
-
-```bash
-docker run --rm --name deeptutor \
- -p 127.0.0.1:8088:3782 \
- -v deeptutor-data:/app/data \
- ghcr.io/hkuds/deeptutor:latest
-```
-
-Add `-p 127.0.0.1:8089:8001` as well if you also want the API exposed on the host. If you change container-side ports in `/app/data/user/settings/system.json`, restart and update the right side of each mapping to match.
-
-## Connecting to a local LLM (Ollama / LM Studio / llama.cpp / vLLM)
-
-Inside Docker, `localhost` is the container itself, not your host machine. To reach a model service running on the host, use the host gateway:
-
-```bash
-docker run --rm --name deeptutor \
- -p 127.0.0.1:3782:3782 \
- --add-host=host.docker.internal:host-gateway \
- -v deeptutor-data:/app/data \
- ghcr.io/hkuds/deeptutor:latest
-```
-
-Then in **Settings → LLM** (or **Embedding**), point the provider Base URL at `host.docker.internal`:
-
-| Service | Base URL |
-|---------|----------|
-| Ollama LLM | `http://host.docker.internal:11434/v1` |
-| Ollama embedding | `http://host.docker.internal:11434/api/embed` |
-| LM Studio | `http://host.docker.internal:1234/v1` |
-| llama.cpp | `http://host.docker.internal:8080/v1` |
-
-Docker Desktop (macOS / Windows) usually resolves `host.docker.internal` **without** `--add-host`. On Linux, the flag is the portable way to create that hostname on modern Docker Engine.
-
-### Linux alternative — host networking
-
-Add `--network=host` and drop the `-p` flags:
-
-```bash
-docker run --rm --name deeptutor \
- --network=host \
- -v deeptutor-data:/app/data \
- ghcr.io/hkuds/deeptutor:latest
-```
-
-The container shares the host network directly, so open (or the `frontend_port` in `system.json`), and host services can be reached with normal localhost URLs like `http://127.0.0.1:11434/v1`.
-
-> Host networking exposes container ports directly on the host and may conflict with existing services.
-
-## Updating
-
-```bash
-docker pull ghcr.io/hkuds/deeptutor:latest
-docker rm -f deeptutor 2>/dev/null
-docker run --rm --name deeptutor \
- -p 127.0.0.1:3782:3782 \
- -v deeptutor-data:/app/data \
- ghcr.io/hkuds/deeptutor:latest
-```
-
-The volume persists — your settings, KBs, memory all survive the upgrade.
-
-**Settings → About** identifies the Docker image and can check whether a newer release exists, but container replacement remains a deployment action: pull the new image and recreate the container as shown above. DeepTutor never upgrades packages inside the running container.
-
-## Common errors
-
-### `Bind for 0.0.0.0:3782 failed: port is already allocated`
-
-```bash
-lsof -i :3782 # macOS
-ss -ltnp | grep :3782 # Linux
-```
-
-Kill the conflicting process, or choose different host ports in your `-p` mapping.
-
-### Container exits immediately
-
-```bash
-docker logs deeptutor | tail -30
-```
-
-An invalid LLM credential is caught and logged as a warning; it does **not** make backend startup fail. If the container exited, look in the log for a different fatal error. Once the Web UI is available, correct the credential under **Settings → Models & services**.
-
-### Frontend loads but API calls fail (split deployment)
-
-With the single-container image this shouldn't happen — the in-container proxy
-forwards `/api/*` to the backend automatically. If you run a **split
-deployment** with the backend in a separate container or host, set
-`next_public_api_base` in `data/user/settings/system.json` (inside the volume) to
-the in-network address the frontend server uses to reach the backend, then
-restart.
-
-### Multi-user mode in Docker
-
-Just toggle auth in the volume's `data/user/settings/auth.json` (`"enabled": true`) and restart. The container picks it up. See [**Multi-User Deployment**](/get-started/multi-user/) for the full setup.
-
-More: [**Troubleshooting**](/get-started/troubleshooting/).
-
## Next
-- [**Multi-User Deployment**](/get-started/multi-user/) — team setup
-- [**Explore DeepTutor**](/explore/) — tour the running app
+Host folders, detached mode, reverse proxies, local models, and upgrades are on [Docker operations](/self-hosting/docker/).
+
+- [**Explore DeepTutor**](/learning-workspace/)
diff --git a/docs/src/content/docs/get-started/index.md b/docs/src/content/docs/get-started/index.md
index a81baaae9..cfeb71911 100644
--- a/docs/src/content/docs/get-started/index.md
+++ b/docs/src/content/docs/get-started/index.md
@@ -12,10 +12,10 @@ For the full app, the recommended flow is **pick a runtime-home directory → in
| Option | When to use | Page |
|--------|-------------|------|
-| **PyPI** | Published packages; full app uses [full] in 1.7.x | [**Install from PyPI**](/get-started/pypi/) |
-| **From Source** | Current dev, local development, optional hot reload | [**Install from Source**](/get-started/from-source/) |
+| **PyPI** | Published packages; full app uses [full] in 1.7.x | [**Install from PyPI**](/self-hosting/pypi/) |
+| **From Source** | Current dev, local development, optional hot reload | [**Install from Source**](/self-hosting/source/) |
| **Docker** | Production deployments, hosted hosts, persistent volumes | [**Docker**](/get-started/docker/) |
-| **CLI Only** | Headless server, agent harness, no Web UI needed | [**CLI-Only Install**](/get-started/cli-only/) |
+| **CLI Only** | Headless server, agent harness, no Web UI needed | [**CLI-Only Install**](/self-hosting/cli-only/) |
> **1.7.x installation:** `deeptutor[full]` installs the Web app; bare `deeptutor` installs core CLI/SDK. Stop DeepTutor before changing modules and keep feature wheels at the core version. For development, use the source instructions or [build local wheels](https://github.com/HKUDS/DeepTutor/blob/dev/docs-for-dev/MODULES.md). Back up your runtime home before upgrading older installations.
@@ -45,9 +45,9 @@ Both are overridable via `data/user/settings/system.json` or during `deeptutor i
Once you can reach `http://localhost:3782/`:
-- [**Explore DeepTutor**](/explore/) — start with workspaces, then Home, Learning, Resources, Partners, and Personalization
-- [**DeepTutor CLI**](/cli/) — drive core runtime and workspace operations from the terminal
-- [**Partners: channels**](/partners/) — connect autonomous tutors to WeChat, WeCom, QQ, Telegram, Slack, Feishu, and more
-- [**Multi-User Deployment**](/get-started/multi-user/) — host DeepTutor for a team
+- [**Explore DeepTutor**](/learning-workspace/) — start with workspaces, then Home, Learning, Resources, Partners, and Personalization
+- [**DeepTutor CLI**](/developers/guides/cli/) — drive core runtime and workspace operations from the terminal
+- [**Partners: channels**](/channels/) — connect autonomous tutors to WeChat, WeCom, QQ, Telegram, Slack, Feishu, and more
+- [**Multi-User Deployment**](/self-hosting/multi-user/) — host DeepTutor for a team
-If something breaks, jump to [**Troubleshooting**](/get-started/troubleshooting/).
+If something breaks, jump to [**Troubleshooting**](/self-hosting/troubleshooting/).
diff --git a/docs/src/content/docs/index.mdx b/docs/src/content/docs/index.mdx
index 055f27bec..c177cd109 100644
--- a/docs/src/content/docs/index.mdx
+++ b/docs/src/content/docs/index.mdx
@@ -1,66 +1,9 @@
---
title: Home
-description: Open-source learning workspace for chat, practice, research, and the materials they share.
+description: An open-source, agent-native learning companion. Home, Learning, and Resources follow the workspace. Partners and Personalization stay with the account.
template: splash
-hero:
- title: DeepTutor
- tagline: Conversations, source materials, practice, and reusable assistance in one workspace.
- actions:
- - text: Desktop quickstart
- link: /get-started/desktop/
- icon: right-arrow
- - text: Docker quickstart
- link: /get-started/docker/
- icon: rocket
- variant: minimal
---
-import { CardGrid, LinkCard } from '@astrojs/starlight/components';
+import HomeLanding from '../../components/HomeLanding.astro';
-## Start here
-
-
-
-
-
-
-
-
-## What you can do with DeepTutor
-
-
-
-
-
-
-
-
-
-
-## Supported capabilities
-
-Capability names, module ids, and requirements come from `deeptutor/modules/manifests/`. The “What it does” column is a short guide to that manifest. Optional modules are noted in the sentence, not in **Also needs**.
-
-| Capability | Module | Also needs | What it does | Read |
-| --- | --- | --- | --- | --- |
-| `chat` | `core` | — | Everyday agent loop with tools | [Chat](/explore/chat-workspace/) |
-| `ask_questions` | `core` | — | Asks for missing context, then finishes the request | [Chat](/explore/chat-workspace/) |
-| `deep_solve` | `solve` | — | Multi-step worked solutions, including photo problems | [Chat](/explore/chat-workspace/) |
-| `deep_question` | `questions` | `parsing` | Generates a practice set from a topic or a source | [Practice](/explore/practice/) |
-| `deep_research` | `research` | — | Cited research report. The knowledge module is optional | [Chat](/explore/chat-workspace/) |
-| `visualize` | `visualize` | — | SVG, Mermaid, Chart.js, or HTML. The Manim renderer is optional | [Chat](/explore/chat-workspace/) |
-| `math_animator` | `renderer-manim` | — | Manim math video or storyboard | [Chat](/explore/chat-workspace/) |
-| `mastery_path` | `mastery` | `knowledge` | Adaptive path with a per-topic mastery gate | [Mastery Path](/explore/mastery-path/) |
-| `immersive_reading` | `reading` | `knowledge`, `parsing`, `mastery`, `notebook` | Reading beside the thread, with citations back to the source | [Reading](/explore/reading/) |
-| `video_lesson` | `video-lesson` | — | Browser lesson with captions and optional narration | [Chat](/explore/chat-workspace/) |
-
-## More resources
-
-
-
-
-
-
-
-
-
+
diff --git a/docs/src/content/docs/learning-workspace/agent-loop.md b/docs/src/content/docs/learning-workspace/agent-loop.md
new file mode 100644
index 000000000..69e728953
--- /dev/null
+++ b/docs/src/content/docs/learning-workspace/agent-loop.md
@@ -0,0 +1,44 @@
+---
+title: How the agent loop works
+description: How one chat turn plans, calls tools, reads observations, and stops.
+quadrant: explanation
+---
+
+A chat turn is not one completion. The model can call a tool, read the observation, and decide whether to continue or answer. The steps to send a turn are in [Chat](/learning-workspace/chat/).
+
+### Little Tutor — follow up on a selection
+
+Select text in a conversation and open **Little Tutor** to start an independent, source-grounded sidebar thread. It stays nested under the source conversation and keeps its own focused context without global memory or general-purpose tools, so a close reading does not derail the main thread.
+
+
+## The agent loop (how it thinks)
+
+DeepTutor Chat runs a single agent loop, so one message can take several internal rounds before you see an answer:
+
+1. The model reads your message and the mounted context, then either answers directly or plans a tool call.
+2. If tools are needed, DeepTutor dispatches them and appends the observations (you can watch this in the Activity panel).
+3. The model continues with better evidence — reading a source, querying a KB, running code, fetching a URL.
+4. A final, tool-free message ends the turn.
+
+`ask_user` is special: instead of guessing, the agent can **pause the turn**, ask you a structured clarifying question, and resume once you answer.
+
+## Knowing how full the window is
+
+A chip in the composer reports how much of the model's context window this turn actually used and what is filling it — prompt blocks, tool schemas, the message list. It is measured from the assembled prompt rather than re-derived afterwards, so the readout cannot drift from what was sent. Open it to see the breakdown before deciding whether to switch to a longer-context model or start a fresh session.
+
+Long conversations also grow a rail of ticks in the transcript's left gutter, one per question you asked, for jumping back without scrolling.
+
+## Tools — including generation
+
+Tools come in three kinds, and the split is about who decides.
+
+**You decide** for the experience-enhancement tools in **Settings → Tools**: `brainstorm`, `web_search`, `paper_search`, `zotero_search`, `reason`, and `geogebra_analysis` — plus `imagegen` and `videogen` once you configure the matching generation model.
+
+**Context decides** for the rest, which mount automatically when they are useful and are locked on from the composer's point of view: `rag`, `kb_files`, `knowledge_frontier`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `list_favorites`, `save_favorite`, `question_bank`, `web_fetch`, `github`, `preprint`, `research_audit`, `research_lit`, `learning_status`, `learning_update`, `ask_user`, `load_tools`, `cron`, `mastery_topics`, `mastery_sessions`, `mastery_open_session`, `mastery_new_session`, and the single code path `exec` (python, c, cpp, or shell). A capability adds its own on top: the eight reading tools, the mastery tutoring tools, `consult_subagent`, and so on. A third group answers to neither: the workspace baseline includes file tools plus `write_note` and `search_notes`, while `workspace_export` needs your approval to move a file out of `outputs/`. (Partners are the exception: a companion can be denied context-gated tools individually — see [Partners](/channels/).)
+
+### Scheduling something for later
+
+`cron` lets a turn schedule work instead of doing it now: **at** a time, **every** N seconds, or on a **cron expression** with a timezone. When the job is due, its message runs as a new instruction **in this same conversation** and the reply lands here — so "quiz me on this chapter every weekday at 9" is a sentence, not a setup screen. The same tool lists this conversation's jobs and cancels one. For a Partner, a due job rides back out through the IM channel the partner is connected to.
+
+Configure an **Image Generation** (or Video Generation) model in Settings and it becomes a chat tool too — ask in plain language and the agent calls it, then previews the result inline with a downloadable file.
+
diff --git a/docs/src/content/docs/explore/book.md b/docs/src/content/docs/learning-workspace/books.md
similarity index 95%
rename from docs/src/content/docs/explore/book.md
rename to docs/src/content/docs/learning-workspace/books.md
index 306e0adfc..e909e1afb 100644
--- a/docs/src/content/docs/explore/book.md
+++ b/docs/src/content/docs/learning-workspace/books.md
@@ -81,6 +81,6 @@ Source pickers may retain **Notebook** terminology for saved Favorites collectio
## See also
-- [Knowledge Center](/explore/knowledge/) — build the document libraries a book is compiled from
-- [Home](/explore/chat-workspace/) — discuss book pages in context
-- [CLI commands](/cli/commands/) — book maintenance commands
+- [Knowledge Center](/learning-workspace/knowledge/) — build the document libraries a book is compiled from
+- [Home](/learning-workspace/chat/) — discuss book pages in context
+- [CLI commands](/developers/reference/cli/) — book maintenance commands
diff --git a/docs/src/content/docs/explore/calendar.md b/docs/src/content/docs/learning-workspace/calendar.md
similarity index 93%
rename from docs/src/content/docs/explore/calendar.md
rename to docs/src/content/docs/learning-workspace/calendar.md
index 1352188ca..b32051405 100644
--- a/docs/src/content/docs/explore/calendar.md
+++ b/docs/src/content/docs/learning-workspace/calendar.md
@@ -32,4 +32,4 @@ Toggle layers to reduce visual clutter. A scheduled instruction is different fro
Keep your classes in an account calendar. In the `Probability` workspace, add a task due Friday and reserve a study event on Wednesday. Review the due-learning layer before choosing that slot. When you switch to another workspace, Wednesday's event remains visible while the task and study layers change to that project's context.
-See [Task Board](/explore/task-board/), [Practice](/explore/practice/) and [Workspaces](/explore/workspaces/).
+See [Task Board](/learning-workspace/task-board/), [Practice](/learning-workspace/questions/) and [Workspaces](/learning-workspace/workspaces/).
diff --git a/docs/src/content/docs/learning-workspace/chat.md b/docs/src/content/docs/learning-workspace/chat.md
new file mode 100644
index 000000000..d115b4ee0
--- /dev/null
+++ b/docs/src/content/docs/learning-workspace/chat.md
@@ -0,0 +1,137 @@
+---
+title: Chat
+description: "Send one useful chat turn: pick the workspace, attach material, and read the result in Activity."
+quadrant: how-to
+---
+
+Home is where a turn runs. This page is how to send a useful one. For how a turn plans, calls tools, and stops, see [How the agent loop works](/learning-workspace/agent-loop/).
+
+## Where it is
+
+Select your [workspace](/learning-workspace/workspaces/), then open **Home → Chat** (`/chat`). Home also contains the [Task Board](/learning-workspace/task-board/), [Learning notebook](/learning-workspace/notebook/) and [Calendar](/learning-workspace/calendar/). Chat, tasks and notebook pages follow the workspace; Calendar events are account level, with workspace study layers.
+
+
+
+The window has three regions:
+
+| Region | What it does |
+| --- | --- |
+| **Left sidebar** | The workspace menu sits above **Home**, **Learning** and **Resources**. **Partners** and **Personalization** are account-level areas. Conversations reopen with their learning context; Settings and workspace management are available from the workspace menu. Classic layout uses a different navigation arrangement. |
+| **Composer** | The message box. Its **bottom-left** sets *what kind of turn* this is (capability) and adds references (`+`); its **bottom-right** exposes connected-agent, knowledge, persona, and model selectors. The microphone only transcribes the current message. |
+| **Activity panel** (top-right toggle) | Tool calls, references, generated files, attachments, and previews for the current session, plus a quick way to open a URL or local file. |
+
+With authentication enabled, signed-in users also see **My profile** in the sidebar. It shows the username (not editable here), role, and join date; use it to upload an avatar image or choose an icon and color, and to sign out.
+
+The top-right icons above the thread let you **save useful content to Favorites**, **export the session as Markdown**, and **toggle the Activity panel**.
+
+## Your first useful conversation
+
+1. Select the workspace for your project and open a new Chat.
+2. Add a PDF or a specific saved reference with the resource control; attach a knowledge base when you need retrieval across its library.
+3. State the outcome and constraints: “Explain the sampling theorem using this lecture, then give me two questions. Let me try before showing answers.”
+4. Follow tool progress in Activity and open cited sources or generated files when you need to inspect the evidence.
+5. Save a useful result to [Favorites](/learning-workspace/favorites/), or develop your own explanation in the [Learning notebook](/learning-workspace/notebook/). Reopen the conversation from Resources → Chat History.
+
+Selecting a connected agent is by default a persistent choice for the session; importing an old agent transcript is a reference. Likewise, an attached file supplies this turn's material by default, while workspace instructions and session preferences shape later turns. Check the visible chips before sending if a reply seems to be using the wrong sources or persona.
+
+## Starting points
+
+Under the empty composer, Explain, Solve, Practice, Plan, and Research offer editable starting prompts. A separate personalized suggestion draws on your memory and recent activities; **Suggest something else** replaces it. Choose either to fill the composer, then review before sending. **Customize page → Starting prompts** edits the reusable titles and requests.
+
+**Settings → Conversation** sets how much history feeds them: raise the activity count for suggestions that range wider, lower it to keep them close to what you were just doing.
+
+
+## Sticky context vs. one-time references
+
+DeepTutor splits context into two kinds, and the composer keeps them in two different places — this is the single most important idea to learn here.
+
+**Sticky session context** persists across turns until you change it: capability, workspace or course binding, tools, **knowledge bases**, **persona**, **model**, and Reading / Mastery state. The right side exposes the relevant selectors; an agent selected with the Agent chip or `@` stays attached by default, while the microphone only fills the current draft.
+
+**References** live behind the **`+` button** on the left. They default to *this* turn only; use the reuse control to reuse a supported reference on every turn.
+
+
+| `+` reference | What it pulls in |
+| --- | --- |
+| **Attach files** | A PDF, image, Office doc, Markdown, or data file for the agent to read. |
+| **Chat History** | A past session as grounding context. |
+| **My Agents** | An imported Claude Code / Codex / ChatGPT transcript to explore — see [My Agents](/customize/agents/). |
+| **Books / Reading / Notebooks / Question Bank** | A compiled book, a reading section, a saved notebook, or practice questions from your [Resources](/learning-workspace/resources/). Filter questions by material or category; **Select all** keeps earlier selections. |
+| **Memory** | A specific memory document, when you want the agent to work from a fact you can point at rather than whatever recall surfaces. |
+
+Typing **`@`** in the main Chat composer filters the same connected-agent list as the Agent chip and keeps the selection attached by default. Follow-up surfaces without live-agent selection use `@` for their Space reference menu instead.
+
+### Knowledge — ground answers in your library
+
+The **database icon** opens the knowledge picker. Untouched conversations inherit ready workspace assignments or the default KB; explicit selections, including none, persist until changed. The agent retrieves from these bases when grounding is needed.
+
+How it retrieves depends on the base's engine, and the difference is worth knowing when an answer surprises you. Most bases — LlamaIndex, GraphRAG, LightRAG, a linked index, a remote LightRAG Server, a Tencent IMA library — are served by the `rag` tool. **PageIndex OSS** and **PageIndex Cloud** are not: their retrieval is agentic, so a reading loop walks the local or hosted document tree instead, and those bases are deliberately absent from `rag`'s list. An **Obsidian** vault has no index at all and is routed to the Obsidian capability, which navigates the live files; a **MarginNote 4** library is the same shape, walked by its own tools.
+
+
+### Persona — set the voice and stance
+
+The **person icon** chooses a persona. `Default` is the plain assistant; built-ins like **peer**, **research-assistant**, and **teacher** change tone and pedagogy. Personas are managed under **Personalization → Personas** and can be reused by Partners.
+
+
+### Model — switch per turn
+
+The **model chip** picks which model runs this turn. Every model you configured in Settings appears here with its provider and context window, and the default is marked. Switch to a long-context model for big documents, or a cheaper/faster one for quick exchanges — mid-session, without losing your place.
+
+
+## The Activity panel
+
+The panel toggle (top-right) opens **Activity** — a live record of the tools, references, and files the current session has used — generated files listed above your uploads — plus an **Open** box to pull a URL or a local file into the in-app viewer.
+
+
+
+As a turn runs, each tool call collapses into a compact header (for example, `Done · 21s`) that you can expand to inspect inputs and outputs — so the thread stays readable while the full trace stays auditable.
+
+## The content workspace
+
+The **content workspace** is the folder bound to a conversation. Unbound sessions use the General workspace; you can create custom workspaces for separate projects. The System workspace holds shared skills and sanitized configuration snapshots; private runtime settings, API keys, databases, and memory stay outside conversational file access.
+
+Manage roots, workspaces, and **Workspace instructions** in **Settings → Workspace**. Instructions apply from the next turn for supported capabilities, excluding Deep Research, Quiz, and Manim; capability rules and permissions still apply. Built-in and managed custom folders live under `/data/user/workspaces` by default. The CLI also manages the legacy content-folder binding:
+
+```bash
+deeptutor workspace show
+deeptutor workspace set /absolute/path/to/my-folder
+deeptutor workspace reset
+```
+
+Reading is free; writing is not. Everything a turn creates — downloads, generated files, code output, rendered assets — lands under a turn-scoped `outputs////` directory. Execution is read-only everywhere else in the folder, and copying a generated file out of `outputs/` into the rest of your material takes an explicit **Allow once** confirmation naming that exact source and destination.
+
+The model never sees an absolute path — only relative ones such as `outputs/report.docx`. When it calls `workspace_present`, the UI renders an authenticated, openable snapshot; the same relative path also works in an ordinary Markdown link or image. Changing the source file later does not change a snapshot already presented.
+
+On Docker and server deployments the deployment folder constrains managed workspace storage — see [Docker](/get-started/docker/).
+
+## On a phone
+
+Below tablet width the workspace collapses to a single column with a slide-over sidebar, so the same thread is usable on a phone rather than rendering a three-pane desktop layout off the edge of the viewport.
+
+## Practical examples
+
+```text
+Attach a KB + ask: "Explain chapter 4 and quiz me on the weak spots."
+```
+
+```text
+Attach a PDF + ask: "Extract the assumptions and save the final summary to my notebook."
+```
+
+```bash
+deeptutor run chat "Explain the Fourier transform" --kb signals
+deeptutor chat --capability deep_research --kb papers
+```
+
+## See also
+
+- [Immersive Reading](/learning-workspace/reading/) — the same loop, with documents or media open beside it
+- [DeepTutor Ecosystem](/customize/) — Skills, MCP Services, and CLI Apps the agent can call
+- [Partners](/channels/) — the same loop, running inside IM companions
+- [My Agents](/customize/agents/) — consult Claude Code, Codex, or a Partner from a chat turn
+- [Knowledge Center](/learning-workspace/knowledge/) — build the RAG libraries you attach here
+- [Memory](/learning-workspace/memory/) — the personalization the loop reads and writes
+- [Settings](/self-hosting/settings/) — models, tools, capabilities, and runtime control
+- [How the agent loop works](/learning-workspace/agent-loop/)
+- [Vision Solver](/learning-workspace/vision-solver/)
+- [Research](/learning-workspace/research/)
+- [Multimodal studio](/multimodal-studio/)
diff --git a/docs/src/content/docs/explore/favorites.md b/docs/src/content/docs/learning-workspace/favorites.md
similarity index 92%
rename from docs/src/content/docs/explore/favorites.md
rename to docs/src/content/docs/learning-workspace/favorites.md
index 993640a53..998450e08 100644
--- a/docs/src/content/docs/explore/favorites.md
+++ b/docs/src/content/docs/learning-workspace/favorites.md
@@ -21,7 +21,7 @@ A favorite is saved material rather than a new AI request. Opening a record does
## Use favorites in a notebook page
-1. Open a [Learning notebook](/explore/co-writer/) page.
+1. Open a [Learning notebook](/learning-workspace/notebook/) page.
2. Choose **Insert favorite** from the page menu.
3. Search **All favorites**, or narrow to a collection and content type.
4. Preview records and select one or several. The insertion order follows the order you selected them.
@@ -35,4 +35,4 @@ For one module, keep three collections: `Sources`, `Worked examples`, and `Quest
Favorites belong to your current workspace's resources. They do not automatically become a knowledge-base index or global memory. Attach saved material in workflows that offer it, insert it into a notebook page, or use it as an explicit source when creating supported learning activities.
-See [Resources](/explore/space/), [Learning notebook](/explore/co-writer/) and [Knowledge Center](/explore/knowledge/) for the related workflows.
+See [Resources](/learning-workspace/resources/), [Learning notebook](/learning-workspace/notebook/) and [Knowledge Center](/learning-workspace/knowledge/) for the related workflows.
diff --git a/docs/src/content/docs/learning-workspace/index.md b/docs/src/content/docs/learning-workspace/index.md
new file mode 100644
index 000000000..51c10eb83
--- /dev/null
+++ b/docs/src/content/docs/learning-workspace/index.md
@@ -0,0 +1,50 @@
+---
+title: A connected learning workflow
+description: Follow one project through workspace-scoped Home, Learning, and Resources, with account-level Partners and Personalization.
+quadrant: tutorial
+---
+
+The sidebar is a map of **where your work belongs**. Choose a workspace first, then move between its conversations, learning activities, and reusable sources. Your account supplies the companions and preferences you can bring into that work.
+
+## Two scopes, five shelves
+
+| Shelf | Scope | What you use it for |
+| --- | --- | --- |
+| [Chat](/learning-workspace/chat/) | Workspace | Conversations, a task board, and your Learning notebook |
+| [Books](/learning-workspace/books/) | Workspace | Books, Mastery Paths, Reading collections, and Practice |
+| [Resources](/learning-workspace/resources/) | Workspace | Chat history, Favorites, question bank, learning journal, and knowledge bases |
+| [Partners](/channels/) | Account | Persistent companions, their instructions, resource access, and channels |
+| [Personalization](/customize/) | Account | Personas, skills, connected agents, MCP, CLI apps, and memory controls |
+
+**Calendar is an exception within Home:** it offers an account-wide view across workspaces. [Calendar](/learning-workspace/calendar/) explains how to read the source workspace of an event. A Partner also has an explicit working context: its account-level identity does not mean every conversation can read every workspace.
+
+## 1. Give a project its own workspace
+
+Create or select a workspace for “Signals and sampling.” Keep its lecture notes and exercises separate from another project such as “Academic writing.” Before adding material or starting a learning activity, check the active workspace. Switching changes the first three shelves’ contents, while your Partner and Personalization libraries remain available. See [scope and switching](/learning-workspace/workspaces/).
+
+## 2. Bring in sources, then ask a focused question
+
+Add reusable material to [Knowledge Center](/learning-workspace/knowledge/), or open a specific document in [Reading](/learning-workspace/reading/) when you want to work beside the source. In Home, attach the relevant context and ask something concrete: “Explain why low sampling rates can make two different signals look identical; cite this primer.”
+
+A stored asset is not automatically included in every model request. Attach sources or select the supported learning context explicitly. Check cited passages before building on an answer.
+
+## 3. Separate evidence from your own understanding
+
+Save useful original passages to [Favorites](/learning-workspace/favorites/). Then write your interpretation in a [Learning notebook](/learning-workspace/notebook/), inserting references where useful. The notebook is where you develop an explanation; Favorites preserves the material you may want to reuse. Reopen the source when a claim needs checking, and use Dito beside a paragraph when you need help improving it.
+
+## 4. Choose the learning activity that fits
+
+- Use [Books](/learning-workspace/books/) for a structured sequence of pages and interactive blocks.
+- Use [Mastery Path](/learning-workspace/mastery/) for a goal broken into topics and guided study.
+- Use [Reading](/learning-workspace/reading/) for questions tied to a document or media timestamp.
+- Use [Practice](/learning-workspace/questions/) to answer, inspect feedback, and revisit weak areas.
+
+These are different ways to work with a topic, not steps you must complete in order. Start with one and use the supported capture or attachment controls to connect it to the next.
+
+## 5. Reuse assistance without mixing projects
+
+Choose a persona that asks you to explain your reasoning. Add a relevant skill when you need a repeatable method. Connect an external agent for consultation, or configure a Partner with a particular role and resource scope. Those account assets remain available in another workspace, while each workspace keeps its own learning records and materials.
+
+## Return to the work
+
+Use Home’s [Task Board](/learning-workspace/task-board/) for next actions, [Resources](/learning-workspace/resources/) for saved evidence and history, and the Learning list to reopen an activity. You do not need to repeat setup or recreate a Partner whenever you switch subjects.
diff --git a/docs/src/content/docs/explore/knowledge.md b/docs/src/content/docs/learning-workspace/knowledge.md
similarity index 82%
rename from docs/src/content/docs/explore/knowledge.md
rename to docs/src/content/docs/learning-workspace/knowledge.md
index d98d14699..a620d0f8e 100644
--- a/docs/src/content/docs/explore/knowledge.md
+++ b/docs/src/content/docs/learning-workspace/knowledge.md
@@ -4,7 +4,7 @@ description: Create, version, sync, inspect, and reuse the Knowledge Bases that
quadrant: how-to
---
-The Knowledge Center is where you build and manage the document libraries behind **RAG**. A knowledge base (KB) can ground Home turns, Learning notebook edits, Book generation, and Partner conversations. This page focuses on the KB lifecycle; engine architecture and selection live under [RAG Integration](/ecosystem/rag-integration/).
+The Knowledge Center is where you build and manage the document libraries behind **RAG**. A knowledge base (KB) can ground Home turns, Learning notebook edits, Book generation, and Partner conversations. This page focuses on the KB lifecycle; engine architecture and selection live under [RAG Integration](/customize/rag/).
## Where it is
@@ -14,7 +14,7 @@ Open **Resources → Knowledge Center** from the left sidebar. Two tabs keep its
## Choose the RAG integration
-Every KB is bound to one retrieval integration. Open **Knowledge engines** to see the catalog grouped as Local, Server, Cloud, and External knowledge sources. Each card reports **Ready**, **Needs key**, **Needs setup**, or **Not installed** before you create a base. Open [RAG Integration](/ecosystem/rag-integration/) for the full comparison, including the distinct PageIndex OSS and PageIndex Cloud contracts.
+Every KB is bound to one retrieval integration. Open **Knowledge engines** to see the catalog grouped as Local, Server, Cloud, and External knowledge sources. Each card reports **Ready**, **Needs key**, **Needs setup**, or **Not installed** before you create a base. Open [RAG Integration](/customize/rag/) for the full comparison, including the distinct PageIndex OSS and PageIndex Cloud contracts.
## Create a knowledge base
@@ -62,22 +62,7 @@ MarginNote instead shows **Devices** and **Settings** because its paired add-on
| **PyMuPDF4LLM** | Lightweight, no downloads or CUDA. Converts PDF, e-books, XPS, images, text, and Markdown while extracting images. `pip install deeptutor[parse-pymupdf4llm]`. |
| **LiteParse** | Lightweight structured parsing, no local model downloads. `pip install deeptutor[parse-liteparse]`. |
-## CLI mirror
-
-```bash
-deeptutor kb list
-deeptutor kb create physics --doc chapter1.pdf
-deeptutor kb create textbooks --docs-dir ./pdfs
-deeptutor kb connect-kiwix wiki --server-url http://localhost:8080 --zim-name wikipedia_en
-deeptutor kb add physics --doc chapter2.pdf
-deeptutor kb add-github-source physics --repo owner/repo --branch main --path docs --glob '*.md'
-deeptutor kb add-web-source physics --url https://docs.example.com --max-depth 3 --max-pages 200
-deeptutor kb list-sources physics
-deeptutor kb sync physics
-deeptutor kb search physics "What is angular momentum?"
-deeptutor kb eval physics --dataset physics-qa.jsonl --top-k 5 --format json
-deeptutor kb set-default physics
-```
+The same operations are on the CLI. See the [command reference](/developers/reference/cli/).
## Tips
@@ -95,9 +80,9 @@ Assigned resources determine which bases are available to a workspace. Sharing a
## See also
-- [RAG Integration](/ecosystem/rag-integration/) — compare the knowledge engines behind a KB
-- [Home](/explore/chat-workspace/) — attach KBs to a turn
-- [Immersive Reading](/explore/reading/) — read one document instead of indexing a corpus
-- [Books](/explore/book/) — compile learning material from KBs
-- [Partners](/explore/partners/) — copy KBs into partner workspaces
-- [Settings](/explore/settings/) — embedding providers and parsing engines
+- [RAG Integration](/customize/rag/) — compare the knowledge engines behind a KB
+- [Home](/learning-workspace/chat/) — attach KBs to a turn
+- [Immersive Reading](/learning-workspace/reading/) — read one document instead of indexing a corpus
+- [Books](/learning-workspace/books/) — compile learning material from KBs
+- [Partners](/channels/) — copy KBs into partner workspaces
+- [Settings](/self-hosting/settings/) — embedding providers and parsing engines
diff --git a/docs/src/content/docs/explore/mastery-path.md b/docs/src/content/docs/learning-workspace/mastery.md
similarity index 93%
rename from docs/src/content/docs/explore/mastery-path.md
rename to docs/src/content/docs/learning-workspace/mastery.md
index 9dd1adde9..95ea11d3b 100644
--- a/docs/src/content/docs/explore/mastery-path.md
+++ b/docs/src/content/docs/learning-workspace/mastery.md
@@ -43,6 +43,6 @@ Paths and their study conversations belong to the current workspace. Reopen the
## See also
-- [Resources](/explore/space/) — the library for reusable materials and personalization
-- [Immersive Reading](/explore/reading/) — turn an open collection into a new mastery path
-- [Home](/explore/chat-workspace/) — the shared agent loop behind study conversations
+- [Resources](/learning-workspace/resources/) — the library for reusable materials and personalization
+- [Immersive Reading](/learning-workspace/reading/) — turn an open collection into a new mastery path
+- [Home](/learning-workspace/chat/) — the shared agent loop behind study conversations
diff --git a/docs/src/content/docs/explore/memory.md b/docs/src/content/docs/learning-workspace/memory.md
similarity index 78%
rename from docs/src/content/docs/explore/memory.md
rename to docs/src/content/docs/learning-workspace/memory.md
index add40162c..a207605fb 100644
--- a/docs/src/content/docs/explore/memory.md
+++ b/docs/src/content/docs/learning-workspace/memory.md
@@ -32,27 +32,7 @@ The graph places the automatically synthesized L3 slots — profile, recent, and
L2-to-L1 links can target a cited entity. Current L3 references name a surface, so the graph draws a soft link to its L2 cluster, not an exact end-to-end chain. Use it to locate supporting areas and inspect their facts and entities.
-## Tuning the consolidator
-
-**Settings → Memory** sets **Update** / **Audit** LLM budgets, **Dedup** iterations, chunking and reference checks, and no-LLM footnote merging. Changes save to `data/user/settings/main.yaml`.
-
-
-| Mode | What it does |
-| --- | --- |
-| **Update** | Incremental fact extraction with L2 and L3 budgets; per-doc overrides live in the workbench. |
-| **Audit** | Line edits checked against source entities or L2 facts. |
-| **Dedup** | Iterative dedup over the full doc; stops early when an iteration emits zero edits. |
-| **Merge footnotes** | No-LLM cleanup that collapses and renumbers duplicate reference rows; three toggles run it after Update, Audit, or Dedup. |
-
-## CLI
-
-```bash
-deeptutor memory show L3
-deeptutor memory show L2
-deeptutor memory show profile
-deeptutor memory show chat
-deeptutor memory clear trace --force
-```
+Update, Audit, and Dedup budgets are **Settings → Memory**. See [Settings](/self-hosting/settings/). `deeptutor memory show` prints a layer; the flags are in the [command reference](/developers/reference/cli/).
## Good practice
@@ -69,6 +49,6 @@ Try stating a preference explicitly in Chat, then inspect Memory to verify what
## See also
-- [Home](/explore/chat-workspace/) — the loop that reads and writes memory
-- [Partners](/explore/partners/) — how a partner's memory relates to yours
-- [Settings](/explore/settings/) — the full control plane
+- [Home](/learning-workspace/chat/) — the loop that reads and writes memory
+- [Partners](/channels/) — how a partner's memory relates to yours
+- [Settings](/self-hosting/settings/) — the full control plane
diff --git a/docs/src/content/docs/explore/co-writer.md b/docs/src/content/docs/learning-workspace/notebook.md
similarity index 89%
rename from docs/src/content/docs/explore/co-writer.md
rename to docs/src/content/docs/learning-workspace/notebook.md
index 8d2879214..90763d37e 100644
--- a/docs/src/content/docs/explore/co-writer.md
+++ b/docs/src/content/docs/learning-workspace/notebook.md
@@ -27,7 +27,7 @@ A reply can be inserted below the line for review or saved as a subpage. Propose
## Bring sources into your own writing
-Use **Insert favorite** to search, preview and insert original records from [Favorites](/explore/favorites/). You can also ask Dito to synthesize several favorites with citations. Source insertion and knowledge-base actions help ground notes in material you can revisit.
+Use **Insert favorite** to search, preview and insert original records from [Favorites](/learning-workspace/favorites/). You can also ask Dito to synthesize several favorites with citations. Source insertion and knowledge-base actions help ground notes in material you can revisit.
For example, create `Conditional probability`, insert a saved explanation, then write your own counterexample. Ask Dito to check the argument and propose a clearer paragraph; review the suggestion before applying it. Keep a `Practice` subpage for the questions the topic raises.
@@ -39,4 +39,4 @@ The notebook can hold learning blocks such as quizzes, flashcards, diagrams and
The page menu exports **Markdown** or **Word**. Word keeps text and source links; interactive blocks become static. Review the export when you need to submit or share it. Keep Favorites for original source records and the notebook for your synthesis, structure and study activity.
-Notebook pages belong to the active workspace. Switching workspaces changes the page library. [Personalization](/explore/personalization/) can shape how the assistant helps across workspaces, while the page content remains with its project.
+Notebook pages belong to the active workspace. Switching workspaces changes the page library. [Personalization](/customize/) can shape how the assistant helps across workspaces, while the page content remains with its project.
diff --git a/docs/src/content/docs/explore/practice.md b/docs/src/content/docs/learning-workspace/questions.md
similarity index 82%
rename from docs/src/content/docs/explore/practice.md
rename to docs/src/content/docs/learning-workspace/questions.md
index 8b097ac09..d722887e0 100644
--- a/docs/src/content/docs/explore/practice.md
+++ b/docs/src/content/docs/learning-workspace/questions.md
@@ -1,5 +1,5 @@
---
-title: Practice
+title: Questions and practice
description: Collect questions, import your own, review mistakes, and schedule the next recall attempt.
quadrant: how-to
---
@@ -8,6 +8,11 @@ Practice turns questions from your learning activities into repeatable recall. O

+
+## Generate a set
+
+In [Chat](/learning-workspace/chat/), choose **Quiz**. Ask for a set on one topic, or attach a source first. When the set looks right, collect it into this workspace's question bank and review it with the steps below.
+
## Build a question collection
Questions from supported chat, book and mastery activities can be collected in the bank. You can also import your own material rather than generating everything again.
@@ -41,4 +46,4 @@ If there are no questions due, the page shows that you are caught up. You can st
## Combine practice with the tutor
-When you repeatedly miss an item, return to its source chat or open the relevant material in [Reading](/explore/reading/). Ask for an explanation and produce your own example in the [Learning notebook](/explore/co-writer/). Use [Mastery Path](/explore/mastery-path/) when you need assessment of a broader ability; Practice's recall schedule and a path's mastery gate serve different purposes.
+When you repeatedly miss an item, return to its source chat or open the relevant material in [Reading](/learning-workspace/reading/). Ask for an explanation and produce your own example in the [Learning notebook](/learning-workspace/notebook/). Use [Mastery Path](/learning-workspace/mastery/) when you need assessment of a broader ability; Practice's recall schedule and a path's mastery gate serve different purposes.
diff --git a/docs/src/content/docs/explore/reading.md b/docs/src/content/docs/learning-workspace/reading.md
similarity index 96%
rename from docs/src/content/docs/explore/reading.md
rename to docs/src/content/docs/learning-workspace/reading.md
index f530ea083..c111085c3 100644
--- a/docs/src/content/docs/explore/reading.md
+++ b/docs/src/content/docs/learning-workspace/reading.md
@@ -99,7 +99,7 @@ Use Favorites to preserve a useful result, and the Learning notebook to write yo
## See also
-- [Home](/explore/chat-workspace/) — the loop this capability runs on
-- [Knowledge Center](/explore/knowledge/) — index a corpus instead of reading one document
-- [Resources](/explore/space/) — save what you found into a notebook
-- [Server API](/cli/server-api/#immersive-reading) — the `/api/reading` surface
+- [Home](/learning-workspace/chat/) — the loop this capability runs on
+- [Knowledge Center](/learning-workspace/knowledge/) — index a corpus instead of reading one document
+- [Resources](/learning-workspace/resources/) — save what you found into a notebook
+- [Server API](/developers/reference/http-api/#immersive-reading) — the `/api/reading` surface
diff --git a/docs/src/content/docs/learning-workspace/research.md b/docs/src/content/docs/learning-workspace/research.md
new file mode 100644
index 000000000..2f9e717ad
--- /dev/null
+++ b/docs/src/content/docs/learning-workspace/research.md
@@ -0,0 +1,24 @@
+---
+title: Research
+description: Run one Deep Research question and file the cited report in your notebook.
+quadrant: how-to
+---
+
+**Research** (`deep_research`) investigates one question and returns a cited report. Use it when a chat answer is too thin and you want the sources kept with the writing.
+
+## Produce one cited report
+
+1. Open [Chat](/learning-workspace/chat/) in the project workspace.
+2. Choose **Research** under **More Capabilities**.
+3. Attach a knowledge base when the sources should come from your library. Otherwise the run can use the web and preprint search that the workspace already allows.
+4. Ask one question, and say what the report must decide. Example: “What changed in retrieval-augmented generation after 2023? Cite the papers you use, and stop at six.”
+5. Wait until the report is in the thread. Open cited items before you rely on a claim.
+
+## File it
+
+Save passages you will quote to [Favorites](/learning-workspace/favorites/). Continue in the [notebook](/learning-workspace/notebook/) when the report should become your own draft. Favorites keep the source; the notebook keeps your writing.
+
+## See also
+
+- [Knowledge](/learning-workspace/knowledge/) — build the library you attach
+- [How the agent loop works](/learning-workspace/agent-loop/)
diff --git a/docs/src/content/docs/explore/space.md b/docs/src/content/docs/learning-workspace/resources.md
similarity index 70%
rename from docs/src/content/docs/explore/space.md
rename to docs/src/content/docs/learning-workspace/resources.md
index b2abf2925..59de6b23a 100644
--- a/docs/src/content/docs/explore/space.md
+++ b/docs/src/content/docs/learning-workspace/resources.md
@@ -4,7 +4,7 @@ description: Find the current workspace's conversations, favorites, learning jou
quadrant: how-to
---
-**Resources** is the current [workspace](/explore/workspaces/)'s reusable material shelf. Open it from the sidebar (`/space`). The Classic layout calls this area **Learning Space**. It holds inputs and saved records that you can bring back into Chat and Learning.
+**Resources** is the current [workspace](/learning-workspace/workspaces/)'s reusable material shelf. Open it from the sidebar (`/space`). The Classic layout calls this area **Learning Space**. It holds inputs and saved records that you can bring back into Chat and Learning.

@@ -13,10 +13,10 @@ quadrant: how-to
| Resource | What it keeps | A useful next step |
| --- | --- | --- |
| **Chat History** | Previous conversations with their organization and source context | Reopen the original thread or reference it in a new turn |
-| **[Favorites](/explore/favorites/)** | Collections of saved original conversations and results | Insert selected records into a Learning notebook page |
+| **[Favorites](/learning-workspace/favorites/)** | Collections of saved original conversations and results | Insert selected records into a Learning notebook page |
| **Learning journal** | Current mission, session handoff and confirmed learning records | Check what you were working toward before resuming |
-| **Question Bank** | Questions, answers, explanations and mistakes | Choose a set for [Practice](/explore/practice/) |
-| **[Knowledge Center](/explore/knowledge/)** | Knowledge bases and retrieval integrations | Attach an available base to a conversation or learning task |
+| **Question Bank** | Questions, answers, explanations and mistakes | Choose a set for [Practice](/learning-workspace/questions/) |
+| **[Knowledge Center](/learning-workspace/knowledge/)** | Knowledge bases and retrieval integrations | Attach an available base to a conversation or learning task |
Counts help locate populated resources. Their scope follows the active workspace and resource availability; a failed count does not mean the underlying records disappeared.
@@ -25,7 +25,7 @@ Counts help locate populated resources. Their scope follows the active workspace
1. Select the workspace for your subject.
2. Add source documents to a knowledge base if you want reusable retrieval, or use Reading when you want the original document beside the conversation.
3. Work in Chat, Reading, Books or Mastery Path and save useful results to Favorites.
-4. Open the [Learning notebook](/explore/co-writer/) from **Home** to write your own notes, inserting favorites and source links as needed.
+4. Open the [Learning notebook](/learning-workspace/notebook/) from **Home** to write your own notes, inserting favorites and source links as needed.
5. Return to Question Bank for organization and Practice for scheduled recall.
For example, keep lecture PDFs in a `Signals` knowledge base, clear explanations in a Favorites collection, and your own derivations in notebook pages. These assets can work together without being interchangeable.
@@ -44,7 +44,7 @@ Some optional deployments show extra resource tiles only when the corresponding
## Continue from here
-- [Workspaces](/explore/workspaces/) — choose the container before organizing materials.
-- [Learning](/explore/learning/) — create and resume learning activities.
-- [Home](/explore/chat-workspace/) — attach the appropriate material to a turn.
-- [DeepTutor Ecosystem](/ecosystem/) — configure retrieval, Skills and connected tools.
+- [Workspaces](/learning-workspace/workspaces/) — choose the container before organizing materials.
+- [Learning](/learning-workspace/) — create and resume learning activities.
+- [Home](/learning-workspace/chat/) — attach the appropriate material to a turn.
+- [DeepTutor Ecosystem](/customize/) — configure retrieval, Skills and connected tools.
diff --git a/docs/src/content/docs/explore/task-board.md b/docs/src/content/docs/learning-workspace/task-board.md
similarity index 74%
rename from docs/src/content/docs/explore/task-board.md
rename to docs/src/content/docs/learning-workspace/task-board.md
index 803e09f10..479e79fa5 100644
--- a/docs/src/content/docs/explore/task-board.md
+++ b/docs/src/content/docs/learning-workspace/task-board.md
@@ -16,10 +16,10 @@ Open **Home → Task Board** (`/kanban`) to organize the active workspace's task
4. Filter to **Today** or **This week** to narrow the board by date.
5. Archive completed tasks when you want to clear the active view. Use the archived view to restore them.
-A card's due date appears on the card; overdue unfinished work is highlighted. Cards can also show how many calendar time blocks are linked to them. Open [Calendar](/explore/calendar/) to plan time around the work. A deadline and a reserved study period are distinct: giving a task a due date does not by itself mean you reserved time to do it.
+A card's due date appears on the card; overdue unfinished work is highlighted. Cards can also show how many calendar time blocks are linked to them. Open [Calendar](/learning-workspace/calendar/) to plan time around the work. A deadline and a reserved study period are distinct: giving a task a due date does not by itself mean you reserved time to do it.
## A practical revision board
Create three tasks: “Read the conditional-probability proof,” “Write my own example,” and “Complete today's review.” Keep the reading collection, notebook page and Practice session in their own learning surfaces; put their next actions on the board. Move each card as you finish it, and archive the set after the exam.
-The board follows the selected [workspace](/explore/workspaces/). If you switch from `Probability` to `Research project`, you see that project's tasks. Calendar events remain account level, with workspace task and study layers shown alongside them.
+The board follows the selected [workspace](/learning-workspace/workspaces/). If you switch from `Probability` to `Research project`, you see that project's tasks. Calendar events remain account level, with workspace task and study layers shown alongside them.
diff --git a/docs/src/content/docs/learning-workspace/vision-solver.md b/docs/src/content/docs/learning-workspace/vision-solver.md
new file mode 100644
index 000000000..312ccf0f3
--- /dev/null
+++ b/docs/src/content/docs/learning-workspace/vision-solver.md
@@ -0,0 +1,30 @@
+---
+title: Vision Solver
+description: Solve one photographed problem in Chat, then keep the question for practice.
+quadrant: how-to
+---
+
+Vision Solver is the **Solve** capability working from an image. The same turn can plan steps, run a check, and, for a geometric figure, call GeoGebra.
+
+## Solve one photo
+
+1. Open [Chat](/learning-workspace/chat/) in the workspace for this subject.
+2. In the capability menu, open **More Capabilities** and choose **Solve**.
+3. Use **+** and attach one photo of the problem. Crop to the question you want solved.
+4. Send: “Solve this. Show each step, then the final answer. Stop and ask if the figure is ambiguous.”
+5. Read the steps in the thread. Open Activity if you want the tool trace.
+
+You are done when the thread contains a worked solution you can check against the photo.
+
+## A geometric figure
+
+If the picture is a construction, turn on `geogebra_analysis` under **Settings → Tools** before you send. Solve can then turn the figure into GeoGebra commands. Leave it off for a purely algebraic photo.
+
+## Keep the question
+
+When the solution is worth practicing, collect it into [Questions and practice](/learning-workspace/questions/) and review it later. A [Mastery Path](/learning-workspace/mastery/) is the place to test a wider topic, not this single photo.
+
+## See also
+
+- [How the agent loop works](/learning-workspace/agent-loop/)
+- [Math Animator](/multimodal-studio/math-animator/) — animate a derivation after you understand the steps
diff --git a/docs/src/content/docs/explore/workspaces.md b/docs/src/content/docs/learning-workspace/workspaces.md
similarity index 88%
rename from docs/src/content/docs/explore/workspaces.md
rename to docs/src/content/docs/learning-workspace/workspaces.md
index eeacbdd9b..29aeb43a1 100644
--- a/docs/src/content/docs/explore/workspaces.md
+++ b/docs/src/content/docs/learning-workspace/workspaces.md
@@ -48,4 +48,4 @@ Settings lets you rename a custom workspace, edit its instructions and resource
## A practical study setup
-Create `Signals and systems`, add lecture files, and assign the relevant knowledge base. Ask in [Home](/explore/chat-workspace/) for a short explanation, open the source in [Immersive Reading](/explore/reading/), and create a [Mastery Path](/explore/mastery-path/) for the skills you need. Save useful answers to [Favorites](/explore/favorites/) and build your own synthesis in the [Learning notebook](/explore/co-writer/). Return to [Practice](/explore/practice/) for daily recall. All of these remain organized under that workspace.
+Create `Signals and systems`, add lecture files, and assign the relevant knowledge base. Ask in [Home](/learning-workspace/chat/) for a short explanation, open the source in [Immersive Reading](/learning-workspace/reading/), and create a [Mastery Path](/learning-workspace/mastery/) for the skills you need. Save useful answers to [Favorites](/learning-workspace/favorites/) and build your own synthesis in the [Learning notebook](/learning-workspace/notebook/). Return to [Practice](/learning-workspace/questions/) for daily recall. All of these remain organized under that workspace.
diff --git a/docs/src/content/docs/multimodal-studio/index.md b/docs/src/content/docs/multimodal-studio/index.md
new file mode 100644
index 000000000..6c6ca9916
--- /dev/null
+++ b/docs/src/content/docs/multimodal-studio/index.md
@@ -0,0 +1,17 @@
+---
+title: Which generator to use
+description: How Visualize, Math Animator, and Video Lesson divide the work of making something you can watch.
+quadrant: explanation
+---
+
+DeepTutor has three generators. They share the chat thread and a model, and they answer different jobs.
+
+| Generator | You want | What comes back |
+| --- | --- | --- |
+| [Visualize](/multimodal-studio/visualize/) | A figure you can read: a plot, a diagram, a small interactive page | SVG, Mermaid, Chart.js, or HTML in the thread |
+| [Math Animator](/multimodal-studio/math-animator/) | A derivation or geometric construction that has to move | A Manim video or a storyboard |
+| [Video Lesson](/multimodal-studio/video-lesson/) | A short lesson someone can play, with captions | A browser lesson, optionally narrated |
+
+Visualize can also hand a math animation to the Manim renderer. Math Animator is the path when the subject is the mathematics itself. Video Lesson is a lesson, not a single figure: it writes a sequence, checks the render, and plays it in the browser.
+
+All three are capabilities on top of the same [agent loop](/learning-workspace/agent-loop/). A missing system tool (LaTeX, ffmpeg, or Node for a source install) stops the render. It does not change which generator you should have chosen.
diff --git a/docs/src/content/docs/multimodal-studio/math-animator.md b/docs/src/content/docs/multimodal-studio/math-animator.md
new file mode 100644
index 000000000..479e3e103
--- /dev/null
+++ b/docs/src/content/docs/multimodal-studio/math-animator.md
@@ -0,0 +1,23 @@
+---
+title: Math Animator
+description: Render one Manim math animation from Chat.
+quadrant: how-to
+---
+
+**Math Animator** (`math_animator`) writes a Manim scene for one derivation or construction and renders a video or a storyboard. The machine that renders needs LaTeX and ffmpeg. A desktop install does not bundle those tools.
+
+On a source or PyPI install, the renderer comes from the `math-animator` extra. See [Install from source](/self-hosting/source/#optional-install-extras).
+
+## Render one animation
+
+1. Confirm `latex` and `ffmpeg` run in a terminal on this computer.
+2. Open [Chat](/learning-workspace/chat/) and choose **Math Animator**.
+3. Describe one transformation. Example: “Animate the derivative of sin(x²) as the chain rule, one step at a time, then hold the final expression.”
+4. Wait for the video or storyboard in the thread. Play it once and check that each step matches the algebra.
+
+If the render fails on a missing binary, install that binary and send the same request again. Do not switch generators to hide a missing tool.
+
+## See also
+
+- [Visualize](/multimodal-studio/visualize/) — a still figure
+- [Which generator to use](/multimodal-studio/)
diff --git a/docs/src/content/docs/multimodal-studio/video-lesson.md b/docs/src/content/docs/multimodal-studio/video-lesson.md
new file mode 100644
index 000000000..e7e731412
--- /dev/null
+++ b/docs/src/content/docs/multimodal-studio/video-lesson.md
@@ -0,0 +1,23 @@
+---
+title: Video Lesson
+description: Generate one captioned lesson that plays in the browser.
+quadrant: how-to
+---
+
+**Video Lesson** (`video_lesson`) writes a short lesson, checks the render, and plays it in the browser with captions. Narration uses the Text-to-Speech provider in Settings, or Edge when that provider is not set.
+
+A source install needs Node.js 22 or newer and npm on the machine that renders. The desktop app already includes Node.
+
+## Generate one lesson
+
+1. Open [Chat](/learning-workspace/chat/) and choose **Video Lesson**.
+2. Ask for one idea and a length. Example: “A three-minute lesson on the sampling theorem for a first-year class. Captions on. One worked numeric example.”
+3. Wait until the player appears in the thread. Play it through once.
+4. If you wanted a voice and the lesson is silent, set a TTS provider under **Settings → Models & services** and generate the lesson again.
+
+The lesson is done when you can watch it in the thread with captions that match the pictures.
+
+## See also
+
+- [Which generator to use](/multimodal-studio/)
+- [Providers and models](/get-started/providers/) — TTS lives with the other model profiles
diff --git a/docs/src/content/docs/multimodal-studio/visualize.md b/docs/src/content/docs/multimodal-studio/visualize.md
new file mode 100644
index 000000000..518ad3447
--- /dev/null
+++ b/docs/src/content/docs/multimodal-studio/visualize.md
@@ -0,0 +1,23 @@
+---
+title: Visualize
+description: Generate one diagram from Chat with the Visualize capability.
+quadrant: how-to
+---
+
+**Visualize** turns one description into a figure in the thread. Core results are SVG, Mermaid, Mermaid mind maps, Chart.js, and interactive HTML.
+
+## Make one figure
+
+1. Open [Chat](/learning-workspace/chat/).
+2. Choose **Visualize** in the capability menu.
+3. Name the figure and the claim it must show. Example: “A Chart.js line chart of sampling rate against aliasing, with the Nyquist rate marked. No 3D.”
+4. Wait until the figure renders in the thread. If the type is wrong, reply with the type you wanted (SVG, Mermaid, or Chart.js) and ask for a replacement.
+
+The figure is done when you can read the claim off the picture without the surrounding prose.
+
+Manim animation and storyboard are also render modes of this capability. For a derivation you want to watch, use [Math Animator](/multimodal-studio/math-animator/). GeoGebra is an optional install, not one of the core types.
+
+## See also
+
+- [Which generator to use](/multimodal-studio/)
+- [Vision Solver](/learning-workspace/vision-solver/) — start from a photo of a problem instead of a description
diff --git a/docs/src/content/docs/partners/channels.md b/docs/src/content/docs/partners/channels.md
deleted file mode 100644
index 06dd96019..000000000
--- a/docs/src/content/docs/partners/channels.md
+++ /dev/null
@@ -1,109 +0,0 @@
----
-title: Channel Matrix
-description: All built-in Partner channels, their connection model, required fields, and when to use each one.
-quadrant: reference
----
-
-Partner channels are delivery adapters around the same Partner brain. They do not create a second agent runtime: an inbound IM event becomes a scoped chat turn, and the reply is delivered back through the channel.
-
-Use the web UI for most configuration: **Partners -> your partner -> Channels** renders the live schema from `/api/partners/channels/schema`, masks secret fields, polls `/channels/status`, and lets you reload channels without rewriting YAML by hand.
-
-
-
-## Built-in channels
-
-| Channel | Key | Connection model | Best for | Required core fields |
-| --- | --- | --- | --- | --- |
-| WeChat | `weixin` | HTTP long-poll + QR login | Personal WeChat assistant | `allow_from`; optional `token`, `state_dir`, `route_tag`, `poll_timeout` |
-| WeCom | `wecom` | WeCom AI Bot WebSocket | Enterprise WeChat / WeChat Work | `bot_id`, `secret`, `allow_from` |
-| QQ | `qq` | Tencent botpy WebSocket | Official QQ bot deployments | `app_id`, `secret`, `allow_from`, `msg_format` |
-| QQ (NapCat) | `napcat` | OneBot v11 WebSocket | Personal QQ via NapCat | `ws_url`, optional `access_token`, `allow_from`, `group_policy` |
-| Telegram | `telegram` | Bot API polling | Simple personal or group bot | `token`, `allow_from` |
-| Discord | `discord` | Gateway WebSocket | Discord servers and DMs | `token`, `allow_from`, group policy fields |
-| Slack | `slack` | Socket Mode | Slack teams, DMs, threaded channel help | `bot_token`, `app_token`, `allow_from`, `group_policy` |
-| Feishu / Lark | `feishu` | Lark SDK WebSocket | Feishu/Lark enterprise chat | `app_id`, `app_secret`, verification/encryption fields where used |
-| DingTalk | `dingtalk` | Stream Mode | DingTalk enterprise chat | `client_id`, `client_secret`, `allow_from` |
-| Matrix | `matrix` | Matrix sync loop | Decentralized rooms, optional E2EE setup | `homeserver`, user credentials or `access_token`, `allow_from`, `group_policy` |
-| Zulip | `zulip` | Event queue | Stream + topic workflows | `email`, `api_key`, `site`, `allow_from`, `group_policy` |
-| Mattermost | `mattermost` | Native v4 WebSocket + REST | Self-hosted open-source team chat | `server_url`, `bot_token`, `allow_from`, optional `group_policy`, `reply_in_thread`, `verify_ssl` |
-| WhatsApp | `whatsapp` | Bridge WebSocket | WhatsApp via a bridge runtime | bridge URL/token, `allow_from` |
-| Email | `email` | IMAP poll + SMTP send | Async email tutoring/helpdesk | IMAP host/user/password, SMTP host/user/password, `allow_from` |
-| Mochat | `mochat` | Socket.IO or HTTP polling | Customer-service style chat panel | `base_url` / socket URL, `claw_token`, `allow_from` |
-| Microsoft Teams | `msteams` | Built-in HTTP webhook listener | Teams DM-first Bot Framework integration | `app_id`, `app_password`, `tenant_id`, host/port/path |
-
-## Install requirements
-
-Every built-in channel except Matrix is covered by the Partners extra:
-
-```bash
-python scripts/install_extras.py partners
-# or, from an installed release when partners extras are available:
-pip install "deeptutor[partners]"
-```
-
-This pulls in all channel SDKs — `python-telegram-bot`, `slack-sdk`, `lark-oapi`, `dingtalk-stream`, `qq-botpy`, `wecom-aibot-sdk`, `python-socketio`, and friends (the full list lives in `requirements/partners.txt`). Email needs nothing beyond the Python standard library. Matrix ships as its own extra because encrypted rooms need the native `libolm` library: run `python scripts/install_extras.py matrix` for plain rooms or `python scripts/install_extras.py matrix-e2e` for E2EE in a source checkout.
-
-If a channel's dependency is missing on the server, the Channels panel greys that channel out and shows the import error (for example `No module named 'lark_oapi'`). Installed cards distinguish **Connected**, **Connecting**, **Listener running**, **Waiting for scan**, **Configuration required**, **Connection failed**, and **Not connected**. Install a missing package or fix the displayed setup action, then restart/reload the Partner.
-
-Stop DeepTutor before changing installed modules or dependencies. Run the source helper from the repository root, restart with the same data directory, then check `deeptutor module list` and the Channels status. Wheel-based installations should use the extras supported by their matching release; do not install feature wheels over a source checkout.
-
-## Shared delivery switches
-
-Most channels inherit the same delivery controls:
-
-| Field | Meaning |
-| --- | --- |
-| `enabled` | Whether the Partner should start this channel. |
-| `send_progress` | Deliver narration/progress updates during long turns. |
-| `send_tool_hints` | Deliver one-line tool-call hints. Useful while debugging, noisy in production. |
-| `streaming` | Telegram, Discord, and Feishu only: stream the reply live by editing the message in place as text arrives (Feishu uses CardKit streaming cards). Requires `send_progress`. Off by default. |
-| `allow_from` | User/chat allowlist. `*` is convenient for tests; explicit ids are safer for deployment. |
-
-## Configuration workflow
-
-1. Create and test the Partner in the web UI before enabling any IM channel.
-2. Enable only one channel first.
-3. Keep `send_progress` and `send_tool_hints` on while debugging.
-4. Start with `allow_from: ["*"]` only in local/private tests.
-5. Confirm the live card reaches a connected/listening state, send a short message, then replace `*` with real sender ids; inspect logs only if the status detail is insufficient.
-6. Add more channels only after the first channel is stable.
-
-## Choosing a channel
-
-- Use **WeChat** for personal WeChat. It requires a human QR-code scan and persisted state.
-- Use **WeCom**, **Feishu**, **DingTalk**, **Slack**, or **Teams** for enterprise/team deployments.
-- Use **QQ** for official Tencent bot accounts; use **NapCat** only when you intentionally operate a personal QQ bridge.
-- Use **Email** when asynchronous replies are acceptable and users prefer inbox workflows.
-- Use **Matrix** or **Zulip** when room/topic structure matters more than consumer IM convenience.
-- Use **Mattermost** for a self-hosted, open-source team chat you run yourself.
-
-## Where state lives
-
-Channel state is stored below the Partner's `channels/` directory, for example:
-
-```text
-data/partners//channels/weixin/account.json
-data/partners//channels/msteams/msteams_conversations.json
-```
-
-Persist the whole `data/partners/` tree in Docker or production hosts. Losing channel state can force new QR scans or conversation-reference collection.
-
-## Detailed pages
-
-Every built-in channel has a dedicated page with platform-side registration steps, a field-by-field walkthrough of the channel card, and troubleshooting:
-
-- [WeChat](/partners/weixin/) — personal WeChat QR login and long-poll setup
-- [WeCom](/partners/wecom/) — Enterprise WeChat AI Bot setup
-- [QQ / NapCat](/partners/qq/) — official QQ bot and personal QQ bridge paths
-- [Telegram](/partners/telegram/) — BotFather registration, Bot API polling, live streaming
-- [Discord](/partners/discord/) — Developer Portal app, intents, Gateway WebSocket
-- [Slack](/partners/slack/) — Socket Mode app with bot + app tokens
-- [Feishu / Lark](/partners/feishu/) — open-platform app and CardKit streaming cards
-- [DingTalk](/partners/dingtalk/) — Stream Mode enterprise bot
-- [Matrix](/partners/matrix/) — homeserver credentials and optional E2EE
-- [Zulip](/partners/zulip/) — bot account and stream subscriptions
-- [Mattermost](/partners/mattermost/) — self-hosted server via bot token over the native v4 API
-- [WhatsApp](/partners/whatsapp/) — bridge runtime setup
-- [Email](/partners/email/) — IMAP polling and SMTP replies
-- [Mochat](/partners/mochat/) — Socket.IO customer-service panel
-- [Microsoft Teams](/partners/msteams/) — Bot Framework webhook listener
diff --git a/docs/src/content/docs/partners/index.md b/docs/src/content/docs/partners/index.md
deleted file mode 100644
index 87df10715..000000000
--- a/docs/src/content/docs/partners/index.md
+++ /dev/null
@@ -1,119 +0,0 @@
----
-title: Partners & Channels
-description: Operator guide for DeepTutor Partners, channel configuration, workspace layout, and IM delivery behavior.
-quadrant: how-to
----
-
-Partners are persistent DeepTutor companions that can live in the web UI and in external IM apps. They are not a second bot engine. Every incoming message becomes a normal chat-agent turn scoped to that Partner:
-
-```text
-IM / Web message -> PartnerRunner -> ChatOrchestrator -> AgenticChatPipeline -> tools -> reply
-```
-
-
-
-This page is the operator guide. For the product tour of what a Partner *is* — its soul, library, memory, and web Chat view — see [Explore → Partners](/explore/partners/). A Partner can also be [consulted through My Agents](/explore/subagents/) from a normal chat turn.
-
-## What changed from TutorBot
-
-| Old TutorBot | New Partner |
-| --- | --- |
-| Separate bot engine and `data/tutorbot//` workspace | Same Chat loop, scoped workspace under `data/partners//workspace/` |
-| Bot-specific CLI commands such as `deeptutor bot ...` | `deeptutor partner list/create/start/stop` |
-| Channels edited in bot YAML | Schema-driven channel cards in the Partners UI |
-| Bot skills / memory handled separately | Assigned KBs, skills, notebooks, tools, and memory are mounted like normal chat context |
-
-Old `/tutorbot/*` documentation URLs redirect to their `/partners/*` replacements so existing external links and bookmarks keep working.
-
-## Ownership, assignment, and private histories
-
-Any authenticated user can create a Partner and becomes its owner. The owner and any admin can manage its soul, library, channels, model, lifecycle, and deletion. An admin can also assign a Partner to other users; an assigned user can talk to it, but sees only its identity card rather than its configuration and credentials.
-
-Configuration and copied library assets are shared, but relationship state is not. Each authenticated non-admin user gets private conversation files and relationship memory under `users//`. During that user's turns, the Partner can also read the interacting user's own shared memory, while learned preferences are written to the private Partner-user relationship memory. Two people using the same Partner therefore do not see each other's threads or learned preferences. Admin turns and unattributed channel traffic use the Partner's top-level session and memory scope as a compatibility fallback.
-
-## Recommended setup flow
-
-1. Create the Partner in **Partners -> New partner**.
-2. Fill **Identity** and **Soul** before enabling any channel. The first IM reply uses this soul.
-3. In **Mind**, pick a model and keep optional tools minimal while testing.
-4. In **Library**, choose a private copied library or bind an existing owner workspace for live resources. Test one small KB or skill first. See [resource modes](/explore/partners/#account-companions-and-workspace-resources).
-5. In **Channels**, enable exactly one channel and start with a private/local test.
-6. Keep `send_progress` and `send_tool_hints` on during debugging, then quiet them down for production.
-7. Replace `allow_from: ["*"]` with explicit sender ids before opening a channel to real users.
-
-
-
-## Partner Groups
-
-The Partners page also supports first-class **Partner Groups**. Create a group from two or more Partners, choose its member roster, discussion mode, and shared-memory mode, then hold a shared discussion in which every selected Partner keeps its own role and reasoning.
-
-Groups keep separate conversation sessions and durable history. A turn can address all members or selected members, and every member's response occupies its own seat. If one seat fails, it can be retried independently without rerunning the Partners that already answered.
-
-## Channel entry points
-
-| Channel | Use when | Page |
-| --- | --- | --- |
-| WeChat (`weixin`) | Personal WeChat via QR-code login and HTTP long-poll | [WeChat](/partners/weixin/) |
-| WeCom (`wecom`) | Enterprise WeChat / WeChat Work AI Bot platform | [WeCom](/partners/wecom/) |
-| QQ (`qq`) | Official Tencent QQ bot account via botpy | [QQ / NapCat](/partners/qq/) |
-| NapCat (`napcat`) | Personal QQ account through OneBot v11 / NapCat | [QQ / NapCat](/partners/qq/) |
-| Telegram (`telegram`) | Fastest setup — BotFather token, no public IP | [Telegram](/partners/telegram/) |
-| Discord (`discord`) | Discord servers and DMs via Gateway WebSocket | [Discord](/partners/discord/) |
-| Slack (`slack`) | Slack teams over Socket Mode, threaded replies | [Slack](/partners/slack/) |
-| Feishu (`feishu`) | Feishu / Lark with CardKit streaming cards | [Feishu](/partners/feishu/) |
-| DingTalk (`dingtalk`) | DingTalk enterprise bot over Stream Mode | [DingTalk](/partners/dingtalk/) |
-| Matrix (`matrix`) | Decentralized rooms, optional E2EE | [Matrix](/partners/matrix/) |
-| Zulip (`zulip`) | Stream + topic structured team chat | [Zulip](/partners/zulip/) |
-| Mattermost (`mattermost`) | Self-hosted Mattermost via native v4 WebSocket | [Mattermost](/partners/mattermost/) |
-| WhatsApp (`whatsapp`) | WhatsApp through a bridge runtime | [WhatsApp](/partners/whatsapp/) |
-| Email (`email`) | Async inbox workflows over IMAP/SMTP | [Email](/partners/email/) |
-| Mochat (`mochat`) | Customer-service style chat panels | [Mochat](/partners/mochat/) |
-| Microsoft Teams (`msteams`) | Teams via Bot Framework webhook listener | [Microsoft Teams](/partners/msteams/) |
-
-For a side-by-side comparison of connection models, required fields, and delivery switches, see the [Channel Matrix](/partners/channels/).
-
-## Runtime state
-
-```text
-data/partners//
-├── config.yaml # Partner identity, model, channels, tools
-├── sessions/ # Shared/unattributed conversations
-│ ├── .jsonl # One append-only file per conversation
-│ └── _index.json # Archive metadata, created when needed
-├── channels/
-│ └── /... # QR tokens, cursors, conversation refs
-├── users// # Private state for an authenticated user
-│ ├── sessions/.jsonl
-│ └── workspace/memory/
-└── workspace/
- ├── knowledge_bases/ # Copied assigned KBs
- └── user/
- ├── workspace/SOUL.md
- ├── workspace/skills//SKILL.md
- ├── workspace/notebook/
- └── workspace/memory/
-```
-
-This tree shows the private-library arrangement. A Partner bound to an existing owner workspace uses that workspace's current resources and outputs folder instead. Soul, channel state, sessions, and relationship memory remain Partner state. Partners and Partner Groups belong to the account, so their cards remain available across workspace switches.
-
-## Conversation commands
-
-Partner chats share these slash commands:
-
-- `/help` — show the available commands.
-- `/new` — archive the current conversation and start fresh; `/branch` archives it and continues in a copy; `/stop` halts a running reply.
-- `/sessions` — list conversation ids; `/resume ` reopens an archived one and `/delete ` permanently removes one.
-- `/status` — Partner, session, model, and tool status; `/history [n]` shows recent messages.
-- `/tool [on|off |reset]` — inspect or change enabled tools.
-- `/model [number|model name]` — owner or admin lists or switches the model, in a DM.
-- `/link ` — in an external DM, link that chat account to the DeepTutor user who generated the code in the web app.
-
-## Web UI vs CLI
-
-Use the Web UI for channel configuration because it renders the live schema from `/api/partners/channels/schema` and masks secret-looking fields. Use the CLI for lifecycle checks:
-
-```bash
-deeptutor partner list
-deeptutor partner start math-tutor
-deeptutor partner stop math-tutor
-```
diff --git a/docs/src/content/docs/get-started/cli-only.md b/docs/src/content/docs/self-hosting/cli-only.md
similarity index 92%
rename from docs/src/content/docs/get-started/cli-only.md
rename to docs/src/content/docs/self-hosting/cli-only.md
index 3168daffb..ebfa3a8c8 100644
--- a/docs/src/content/docs/get-started/cli-only.md
+++ b/docs/src/content/docs/self-hosting/cli-only.md
@@ -50,7 +50,7 @@ deeptutor memory show
deeptutor config show
```
-Full surface: [**DeepTutor CLI**](/cli/).
+Full surface: [**DeepTutor CLI**](/developers/guides/cli/).
## Source CLI and minimal core are different installs
@@ -79,13 +79,13 @@ python -m pip check
deeptutor module list
```
-Restart using the same `DEEPTUTOR_HOME`. Account Partner state is stored under `data/partners//`; choosing a content workspace for the Partner is separate from its runtime home. Channel credentials and private relationship histories remain Partner state. See [Partners](/explore/partners/).
+Restart using the same `DEEPTUTOR_HOME`. Account Partner state is stored under `data/partners//`; choosing a content workspace for the Partner is separate from its runtime home. Channel credentials and private relationship histories remain Partner state. See [Partners](/channels/).
## Use it from another agent
The CLI is **agent-native**. `deeptutor run --format json` emits one JSON event per line, and data-inspection commands such as `kb list`, `kb search`, `session show`, and `notebook show` expose JSON where implemented — useful for piping into another agent's harness.
-Hand the [`SKILL.md`](https://github.com/HKUDS/DeepTutor/blob/main/SKILL.md) at the project root to any tool-using LLM and it can drive DeepTutor on its own. See [**Agent handoff**](/cli/agent-handoff/) for the patterns.
+Hand the [`SKILL.md`](https://github.com/HKUDS/DeepTutor/blob/main/SKILL.md) at the project root to any tool-using LLM and it can drive DeepTutor on its own. See [**Agent handoff**](/developers/guides/agent-handoff/) for the patterns.
## Updating
@@ -120,10 +120,10 @@ Stop DeepTutor, then add the Partner dependency group from the source root:
python scripts/install_extras.py partners
```
-More: [**Troubleshooting**](/get-started/troubleshooting/).
+More: [**Troubleshooting**](/self-hosting/troubleshooting/).
## Next
-- [**DeepTutor CLI**](/cli/) — full CLI reference
-- [**Agent handoff**](/cli/agent-handoff/) — let your agent drive
-- [**Partners & Channels**](/partners/) — run a Partner from CLI
+- [**DeepTutor CLI**](/developers/guides/cli/) — full CLI reference
+- [**Agent handoff**](/developers/guides/agent-handoff/) — let your agent drive
+- [**Partners & Channels**](/channels/) — run a Partner from CLI
diff --git a/docs/src/content/docs/self-hosting/configuration.md b/docs/src/content/docs/self-hosting/configuration.md
new file mode 100644
index 000000000..4731d70c7
--- /dev/null
+++ b/docs/src/content/docs/self-hosting/configuration.md
@@ -0,0 +1,36 @@
+---
+title: Configuration files
+description: The settings JSON files a deployment actually reads, and the keys the setup capability may write.
+quadrant: reference
+---
+
+DeepTutor reads configuration from `data/user/settings/*.json` inside the runtime home. A process environment variable overrides only a few startup values. Podman host-port mappings are the variables in `.env.example`.
+
+## Files the app reads
+
+| File | What it holds |
+| --- | --- |
+| `interface.json` | Personal interface choices, including language and theme. |
+| `system.json` | Ports and the server-side API base. `next_public_api_base` is the address the frontend server uses to reach the backend. `cors_origins` lists page origins allowed to call the API when auth is on. |
+| `document_parsing.json` | The document parsing engine. |
+| `model_catalog.json` | Provider profiles and the selected models. |
+| `auth.json` | Multi-user auth. `enabled`, `token_expire_hours`, and `cookie_secure` are the switch documented in [Multi-user](/self-hosting/multi-user/). |
+
+The screen that edits these values is [Settings](/self-hosting/settings/).
+
+## Keys the setup capability may write
+
+These rows come from `deeptutor/services/config/settings_spec.py`. They are the knobs that capability is allowed to change. They are not a dump of every JSON field. Secrets are not in this table; credentials are entered in the Settings card.
+
+| Key | Area | Scope | Effect |
+| --- | --- | --- | --- |
+| `interface.language` | interface | personal | instant |
+| `interface.response_language` | interface | personal | instant |
+| `interface.theme` | interface | personal | instant |
+| `document_parsing.engine` | parsing | global | instant; already parsed documents keep their text until re-upload |
+| `catalog.llm` | models | global | instant, after a connectivity probe |
+| `catalog.embedding` | models | global | reindex, after a connectivity probe |
+| `catalog.search` | models | global | instant |
+| `web_fetch.backend` | models | global | instant |
+
+Personal rows live in the caller's `interface.json`. Global rows live in the shared deployment settings and are administrator-only.
diff --git a/docs/src/content/docs/self-hosting/desktop.md b/docs/src/content/docs/self-hosting/desktop.md
new file mode 100644
index 000000000..3c5d60686
--- /dev/null
+++ b/docs/src/content/docs/self-hosting/desktop.md
@@ -0,0 +1,29 @@
+---
+title: Desktop editions
+description: The four Open DeepTutor downloads and where each edition stores data and logs.
+quadrant: reference
+---
+
+Open DeepTutor is the double-click app for macOS and Windows. The first launch installs the bundled runtime, starts the services on loopback, and opens the web UI. Packaging and signing stay in the repository's `apps/desktop/README.md`.
+
+## Downloads
+
+Each release publishes four files. `` is the DeepTutor version bundled in that build.
+
+| Target | App | Download |
+| --- | --- | --- |
+| `macos-arm64` | Open DeepTutor for MacOS with Apple Silicon | `Open-DeepTutor-MacOS-Apple-Silicon-v.dmg` |
+| `macos-x64` | Open DeepTutor for MacOS with Intel | `Open-DeepTutor-MacOS-Intel-v.dmg` |
+| `windows-x64` | Open DeepTutor for Windows | `Open-DeepTutor-Windows-v-Setup.exe` and `Open-DeepTutor-Windows-v-Portable.zip` |
+
+The GitHub Release also keeps unversioned aliases for the latest files. Install steps are in the [Desktop tutorial](/get-started/desktop/).
+
+## Data and logs
+
+| | macOS | Windows |
+| --- | --- | --- |
+| Data | `~/Library/Application Support/Open DeepTutor/workspace/data` | `%LOCALAPPDATA%\Open DeepTutor\workspace\data` |
+| Runtimes | `…/Open DeepTutor/runtimes/` | the same path under `%LOCALAPPDATA%` |
+| Logs | `…/Open DeepTutor/logs/runtime.log` | the same path under `%LOCALAPPDATA%` |
+
+Quitting the app stops the services that app started. It does not stop a separate `deeptutor start`.
diff --git a/docs/src/content/docs/self-hosting/docker.md b/docs/src/content/docs/self-hosting/docker.md
new file mode 100644
index 000000000..ae9325703
--- /dev/null
+++ b/docs/src/content/docs/self-hosting/docker.md
@@ -0,0 +1,188 @@
+---
+title: Docker operations
+description: Volumes, ports, reverse proxies, local models, and upgrades for the published container.
+quadrant: how-to
+---
+
+The first-run command stays on the [Docker tutorial](/get-started/docker/). This page is the rest of the deployment.
+
+## Select a host content workspace
+
+By default content workspace storage lives inside the `deeptutor-data` volume. To use a folder on the host instead, mount it at the stable container path `/workspace` and lock DeepTutor to it:
+
+```bash
+mkdir -p "$PWD/deeptutor-workspace/outputs"
+docker run --rm --name deeptutor \
+ -p 127.0.0.1:3782:3782 \
+ -v deeptutor-data:/app/data \
+ -v "$PWD/deeptutor-workspace:/workspace" \
+ -e DEEPTUTOR_WORKSPACE_ROOT=/workspace \
+ -e DEEPTUTOR_WORKSPACE_ALLOWED_ROOTS=/workspace \
+ ghcr.io/hkuds/deeptutor:latest
+```
+
+Create `outputs/` yourself before the first run — otherwise Docker creates the bind source as root and the unprivileged app cannot write into it.
+
+The container always sees `/workspace`, so paths stay portable across hosts. This deployment root constrains every account. Managed workspaces use account-scoped directories under `outputs/.deeptutor/chat/`; **Settings → Workspace** manages their identities and storage without exposing private runtime settings.
+
+With Compose, set `DEEPTUTOR_WORKSPACE_HOST=/absolute/host/folder` before `python scripts/docker_compose.py up -d`; the helper creates the folder and its `outputs/` for you. Omit it to keep `./data/user/workspace`.
+
+## Detached mode
+
+Add `-d` to run in the background:
+
+```bash
+docker run -d --name deeptutor \
+ -p 127.0.0.1:3782:3782 \
+ -v deeptutor-data:/app/data \
+ ghcr.io/hkuds/deeptutor:latest
+
+docker logs -f deeptutor # follow logs
+docker stop deeptutor # stop
+docker rm deeptutor # remove (volume persists)
+```
+
+The `deeptutor-data` volume keeps your settings and default content workspace across `stop` / `rm` cycles. To truly start over: `docker volume rm deeptutor-data`.
+
+## Remote Docker / reverse proxy
+
+The browser only ever talks to the frontend origin (`:3782`); the in-container
+Next.js middleware forwards `/api/*` and `/ws/*` to the backend on
+`localhost:8001` server-side. So for the common **single-container** case you do
+**not** need to configure an API base at all — just point your reverse proxy /
+TLS terminator at the published `:3782`:
+
+```text
+deeptutor.example.com {
+ reverse_proxy localhost:3782
+}
+```
+
+You only need an API base for a **split deployment**, where the backend runs in a
+separate container or host. Set it in `data/user/settings/system.json` in the
+mounted volume to the in-network address the **frontend server** uses to reach
+the backend — it's read server-side by the proxy, not sent to the browser:
+
+```json
+{
+ "next_public_api_base": "http://backend:8001"
+}
+```
+
+`next_public_api_base_external` (and its alias `public_api_base`) are accepted as
+lower-precedence fallbacks and normalized on save.
+
+CORS only matters with auth enabled and a cross-origin frontend: `cors_origins`
+lists the frontend page origins allowed to call the backend. With auth disabled,
+DeepTutor permits normal HTTP/HTTPS browser origins by default.
+
+```json
+{
+ "cors_origins": ["https://deeptutor.example.com"]
+}
+```
+
+## Different host ports
+
+Change the left side of the `-p host:container` mapping:
+
+```bash
+docker run --rm --name deeptutor \
+ -p 127.0.0.1:8088:3782 \
+ -v deeptutor-data:/app/data \
+ ghcr.io/hkuds/deeptutor:latest
+```
+
+Add `-p 127.0.0.1:8089:8001` as well if you also want the API exposed on the host. If you change container-side ports in `/app/data/user/settings/system.json`, restart and update the right side of each mapping to match.
+
+## Connecting to a local LLM (Ollama / LM Studio / llama.cpp / vLLM)
+
+Inside Docker, `localhost` is the container itself, not your host machine. To reach a model service running on the host, use the host gateway:
+
+```bash
+docker run --rm --name deeptutor \
+ -p 127.0.0.1:3782:3782 \
+ --add-host=host.docker.internal:host-gateway \
+ -v deeptutor-data:/app/data \
+ ghcr.io/hkuds/deeptutor:latest
+```
+
+Then in **Settings → LLM** (or **Embedding**), point the provider Base URL at `host.docker.internal`:
+
+| Service | Base URL |
+|---------|----------|
+| Ollama LLM | `http://host.docker.internal:11434/v1` |
+| Ollama embedding | `http://host.docker.internal:11434/api/embed` |
+| LM Studio | `http://host.docker.internal:1234/v1` |
+| llama.cpp | `http://host.docker.internal:8080/v1` |
+
+Docker Desktop (macOS / Windows) usually resolves `host.docker.internal` **without** `--add-host`. On Linux, the flag is the portable way to create that hostname on modern Docker Engine.
+
+### Linux alternative — host networking
+
+Add `--network=host` and drop the `-p` flags:
+
+```bash
+docker run --rm --name deeptutor \
+ --network=host \
+ -v deeptutor-data:/app/data \
+ ghcr.io/hkuds/deeptutor:latest
+```
+
+The container shares the host network directly, so open (or the `frontend_port` in `system.json`), and host services can be reached with normal localhost URLs like `http://127.0.0.1:11434/v1`.
+
+> Host networking exposes container ports directly on the host and may conflict with existing services.
+
+## Updating
+
+```bash
+docker pull ghcr.io/hkuds/deeptutor:latest
+docker rm -f deeptutor 2>/dev/null
+docker run --rm --name deeptutor \
+ -p 127.0.0.1:3782:3782 \
+ -v deeptutor-data:/app/data \
+ ghcr.io/hkuds/deeptutor:latest
+```
+
+The volume persists — your settings, KBs, memory all survive the upgrade.
+
+**Settings → About** identifies the Docker image and can check whether a newer release exists, but container replacement remains a deployment action: pull the new image and recreate the container as shown above. DeepTutor never upgrades packages inside the running container.
+
+## Common errors
+
+### `Bind for 0.0.0.0:3782 failed: port is already allocated`
+
+```bash
+lsof -i :3782 # macOS
+ss -ltnp | grep :3782 # Linux
+```
+
+Kill the conflicting process, or choose different host ports in your `-p` mapping.
+
+### Container exits immediately
+
+```bash
+docker logs deeptutor | tail -30
+```
+
+An invalid LLM credential is caught and logged as a warning; it does **not** make backend startup fail. If the container exited, look in the log for a different fatal error. Once the Web UI is available, correct the credential under **Settings → Models & services**.
+
+### Frontend loads but API calls fail (split deployment)
+
+With the single-container image this shouldn't happen — the in-container proxy
+forwards `/api/*` to the backend automatically. If you run a **split
+deployment** with the backend in a separate container or host, set
+`next_public_api_base` in `data/user/settings/system.json` (inside the volume) to
+the in-network address the frontend server uses to reach the backend, then
+restart.
+
+### Multi-user mode in Docker
+
+Just toggle auth in the volume's `data/user/settings/auth.json` (`"enabled": true`) and restart. The container picks it up. See [**Multi-User Deployment**](/self-hosting/multi-user/) for the full setup.
+
+More: [**Troubleshooting**](/self-hosting/troubleshooting/).
+
+## Next
+
+- [**Multi-User Deployment**](/self-hosting/multi-user/) — team setup
+- [**Explore DeepTutor**](/explore/) — tour the running app
diff --git a/docs/src/content/docs/self-hosting/index.md b/docs/src/content/docs/self-hosting/index.md
new file mode 100644
index 000000000..6bc9f0bb1
--- /dev/null
+++ b/docs/src/content/docs/self-hosting/index.md
@@ -0,0 +1,23 @@
+---
+title: Runtime home
+description: Where a self-hosted DeepTutor keeps settings, workspaces, and account data.
+quadrant: explanation
+---
+
+Every install path lands in the same runtime home. Settings live in `data/user/settings/` under the directory you launch from, or under `DEEPTUTOR_HOME` / `deeptutor start --home` when you set one. Knowledge bases, memory, Partner runtime state, multi-user accounts, and audit logs live in that same `data/` tree. Persist the tree, and persist any content-workspace directories you configured separately.
+
+The runtime home is the deployment storage root. It is separate from the workspaces you select inside the app. Home, Learning, and Resources follow the active workspace. Partners and Personalization stay with the account.
+
+Process environment variables override only a few startup values, such as the ports passed to `deeptutor start`. Podman host-port mappings live in `.env.example`, not in the application settings files.
+
+## Install paths
+
+| Path | When it fits | Page |
+| --- | --- | --- |
+| PyPI | Published packages, full app after 1.7.0 | [PyPI](/self-hosting/pypi/) |
+| Source | Current dev checkout | [From source](/self-hosting/source/) |
+| Docker | One published container | [Docker tutorial](/get-started/docker/) and [operations](/self-hosting/docker/) |
+| CLI only | No web frontend | [CLI only](/self-hosting/cli-only/) |
+| Desktop | Double-click app on macOS or Windows | [Desktop editions](/self-hosting/desktop/) |
+
+Desktop and Docker quickstarts stay under [Get started](/get-started/). This section is the deployment map.
diff --git a/docs/src/content/docs/get-started/multi-user.md b/docs/src/content/docs/self-hosting/multi-user.md
similarity index 99%
rename from docs/src/content/docs/get-started/multi-user.md
rename to docs/src/content/docs/self-hosting/multi-user.md
index ab645137e..52273b804 100644
--- a/docs/src/content/docs/get-started/multi-user.md
+++ b/docs/src/content/docs/self-hosting/multi-user.md
@@ -171,4 +171,4 @@ print(bcrypt.hashpw(b"your-password", bcrypt.gensalt()).decode())
Then `deeptutor start` and log in with `alice` + your-password.
-More fixes: [**Troubleshooting**](/get-started/troubleshooting/).
+More fixes: [**Troubleshooting**](/self-hosting/troubleshooting/).
diff --git a/docs/src/content/docs/self-hosting/oauth.md b/docs/src/content/docs/self-hosting/oauth.md
new file mode 100644
index 000000000..1417a74e9
--- /dev/null
+++ b/docs/src/content/docs/self-hosting/oauth.md
@@ -0,0 +1,24 @@
+---
+title: Codex sign-in
+description: Sign in to OpenAI Codex with your own ChatGPT plan and confirm the callback.
+quadrant: how-to
+---
+
+OpenAI Codex sign-in uses your own ChatGPT plan. It does not need `OPENAI_API_KEY`.
+
+## Sign in
+
+1. Open **Settings → Models & services** and add **OpenAI Codex**.
+2. Complete the browser sign-in that DeepTutor opens.
+3. The provider redirects the browser to `GET /api/auth/openai-codex/callback` with `code` and `state`, or `error` if the provider refused the login.
+4. A successful callback page says that authentication was received. Return to DeepTutor.
+
+The model list comes from that account's live catalog. Signing in publishes a profile. The profile becomes the active model only when no LLM is configured yet.
+
+## Where the token lives
+
+Tokens are stored only in `data/system/user-secrets//private/openai-codex/`. DeepTutor does not read or modify a `~/.codex` CLI login. A token authorizes one person's plan, so the profile cannot be shared through user grants. Each account, including a non-admin user, signs in for itself. The resulting models, catalog, and sign-out stay on that account.
+
+## Containers
+
+A default local Docker or Podman deployment uses its own loopback network, so the browser callback needs a temporary bridge during sign-in. The exact Docker, Compose, Podman, and teardown commands are in the repository's [containerization guide](https://github.com/HKUDS/DeepTutor/blob/dev/docs-for-dev/CONTAINERIZATION.md#temporary-local-codex-oauth-bridge).
diff --git a/docs/src/content/docs/get-started/pypi.md b/docs/src/content/docs/self-hosting/pypi.md
similarity index 93%
rename from docs/src/content/docs/get-started/pypi.md
rename to docs/src/content/docs/self-hosting/pypi.md
index 5eaa98176..05d59a64e 100644
--- a/docs/src/content/docs/get-started/pypi.md
+++ b/docs/src/content/docs/self-hosting/pypi.md
@@ -4,7 +4,7 @@ description: Understand the published package layout, the modular full profile,
quadrant: how-to
---
-This page explains the **1.7.x** modular family (the current release is 1.7.4) and migration from the **1.6.15** package layout. Choose the full profile for the Web app or core for terminal chat. For current development features, use [Install from Source](/get-started/from-source/) or build a complete matching local wheel family in a separate environment.
+This page explains the **1.7.x** modular family (the current release is 1.7.4) and migration from the **1.6.15** package layout. Choose the full profile for the Web app or core for terminal chat. For current development features, use [Install from Source](/self-hosting/source/) or build a complete matching local wheel family in a separate environment.
The 1.6.15 full package includes the Web app and CLI. In the 1.7.x family, **`deeptutor` is core CLI/SDK**, **`deeptutor-cli` is a compatibility alias**, and **`deeptutor[full]` selects the full Web application**. Feature wheels must match the core version. Use Python 3.11–3.14 and Node.js 22 LTS for the current development setup.
@@ -59,7 +59,7 @@ For the published 1.6.15 layout, the full PyPI wheel includes Web + CLI. The 1.7
pip install -U "deeptutor[partners]"
```
-The full extras table (`matrix`, `matrix-e2e`, `math-animator`, `dev`, `all`) is in [**Install from Source**](/get-started/from-source/#optional-install-extras) — the same extra names work against the PyPI package.
+The full extras table (`matrix`, `matrix-e2e`, `math-animator`, `dev`, `all`) is in [**Install from Source**](/self-hosting/source/#optional-install-extras) — the same extra names work against the PyPI package.
## Where things live
@@ -110,7 +110,7 @@ deeptutor memory show # inspect memory
deeptutor config show # current config
```
-Full surface: [**DeepTutor CLI**](/cli/).
+Full surface: [**DeepTutor CLI**](/developers/guides/cli/).
## Updating
@@ -170,9 +170,9 @@ API key was rejected. Re-enter it in **Settings → Language models**, or:
deeptutor init # re-runs the wizard, preserves the workspace
```
-For more, see [**Troubleshooting**](/get-started/troubleshooting/).
+For more, see [**Troubleshooting**](/self-hosting/troubleshooting/).
## Next
-- [**Explore DeepTutor**](/explore/) — tour the running app
-- [**Multi-User Deployment**](/get-started/multi-user/) — turn it into a team server
+- [**Explore DeepTutor**](/learning-workspace/) — tour the running app
+- [**Multi-User Deployment**](/self-hosting/multi-user/) — turn it into a team server
diff --git a/docs/src/content/docs/explore/settings.md b/docs/src/content/docs/self-hosting/settings.md
similarity index 90%
rename from docs/src/content/docs/explore/settings.md
rename to docs/src/content/docs/self-hosting/settings.md
index 36279777d..aecd7fb07 100644
--- a/docs/src/content/docs/explore/settings.md
+++ b/docs/src/content/docs/self-hosting/settings.md
@@ -4,7 +4,7 @@ description: The control plane for DeepTutor — appearance, network, workspace,
quadrant: how-to
---
-Settings is the operational control plane for DeepTutor. Most sections use a **draft-and-apply** model: you edit a draft, test it, then **Apply** — so a bad provider change never takes down a working setup. Values persist to `data/user/settings/*.json` (and a couple of YAML files) in your account.
+Settings is the operational control plane for DeepTutor. Most sections use a **draft-and-apply** model: you edit a draft, test it, then **Apply** — so a bad provider change never takes down a working setup. Values persist to `data/user/settings/*.json` (and a couple of YAML files) in your account. The file names and the setup-agent keys are listed in [Configuration files](/self-hosting/configuration/).
## Where it is
@@ -26,7 +26,7 @@ Open **Settings** at the bottom of the left sidebar. Its searchable navigator op
## Choose the right scope
-Use **Settings** to configure the application, services, and workspace policy. Use [Personalization](/explore/personalization/) to manage reusable personas, skills, agents, and service connections. Use the working workspace's **Home**, **Learning**, and **Resources** for conversations, study, and materials. Partners has its own account-level shelf.
+Use **Settings** to configure the application, services, and workspace policy. Use [Personalization](/customize/) to manage reusable personas, skills, agents, and service connections. Use the working workspace's **Home**, **Learning**, and **Resources** for conversations, study, and materials. Partners has its own account-level shelf.
Personal preferences accompany the account across workspace switches. Deployment settings such as provider infrastructure, local harness execution, and application installation may require an administrator. Changing a workspace's resource selection does not change either type of ownership.
@@ -45,7 +45,7 @@ Save the selection, return to Home, and check its resource picker. Assignments a
The workspace policy is an upper bound. Selecting skills or MCP services in a conversation can narrow it further; clearing a conversation selection restores inheritance from the workspace. On a shared deployment, per-user grants are applied as well. The policy never reveals another account's files or credentials.
-A Partner can bind an owner workspace to share its current materials. Manage those materials in the workspace's Resources; configure the Partner's identity, channels, and model from Partners. See [Partners](/explore/partners/).
+A Partner can bind an owner workspace to share its current materials. Manage those materials in the workspace's Resources; configure the Partner's identity, channels, and model from Partners. See [Partners](/channels/).
## Appearance
@@ -57,11 +57,11 @@ Theme, learning text, and code blocks. The two language toggles moved to the Gen
The hub for every model and service: language models, a **task model** for automatic calls and Math Animator/Video Lesson repairs, embeddings, web search, voice (TTS/STT), and generation (image/video). Each service uses profiles and a model catalog; credential edits trigger discovery for bulk model import. LLM and Task profiles offer provider-supported API formats: default URLs follow the format, while custom URLs stay unchanged. Models use automatic capability detection or overrides for tools, images, JSON, and reasoning. The **Providers** page holds one vendor credential and links it into every service that vendor serves — one key, entered once. A voice model powers read-aloud and the composer mic; image/video models become chat tools. Use **Test** before **Apply** — a green test proves the profile can make a minimal call, not that the model suits every capability.
-See [Chat Workspace → Configure what Chat can use](/explore/chat-workspace/#configure-what-chat-can-use) for the Models page in context, and [Providers](/get-started/providers/) for setup recipes.
+See [Chat Workspace → Configure what Chat can use](/learning-workspace/chat/#configure-what-chat-can-use) for the Models page in context, and [Providers](/get-started/providers/) for setup recipes.
## Knowledge Base
-The **document parsing** engine that converts uploads into text for knowledge bases and question generation — Text-only, MinerU, Docling, Tika, markitdown, PyMuPDF4LLM, or LiteParse. Local model downloads are **off by default**. See [Knowledge Center → Document parsing](/explore/knowledge/#document-parsing).
+The **document parsing** engine that converts uploads into text for knowledge bases and question generation — Text-only, MinerU, Docling, Tika, markitdown, PyMuPDF4LLM, or LiteParse. Local model downloads are **off by default**. See [Knowledge Center → Document parsing](/learning-workspace/knowledge/#document-parsing).
## Chat
@@ -73,7 +73,7 @@ Five related controls have their own settings pages:
- **Starting points** — how much recent activity feeds the three suggestions under an empty composer.
- **Attachments** — upload size caps and extracted-text budgets for chat attachments (admin-gated).
-MCP servers are **not** here any more: each account installs its own from the MCP Services store at `/space/mcp` in Personalization, or adds a remote server by URL. See [MCP Services](/ecosystem/mcp/).
+MCP servers are **not** here any more: each account installs its own from the MCP Services store at `/space/mcp` in Personalization, or adds a remote server by URL. See [MCP Services](/customize/mcp/).

@@ -93,13 +93,13 @@ It can also do the slow jobs: installing a parsing engine or fetching its model
## Partners & Agents
-Configure the **local agent harnesses you can call on in chat** — Claude Code, Codex, Grok CLI, Antigravity CLI, Kimi CLI, opencode, MiMo Code, Hermes Agent, OpenClaw, and DeepSeek Harness, plus a remote Hermes connection. Each local block reports whether the command exists on this machine, offers model-list sync where supported, and exposes that harness's unattended-run parameters. See [My Agents](/explore/subagents/).
+Configure the **local agent harnesses you can call on in chat** — Claude Code, Codex, Grok CLI, Antigravity CLI, Kimi CLI, opencode, MiMo Code, Hermes Agent, OpenClaw, and DeepSeek Harness, plus a remote Hermes connection. Each local block reports whether the command exists on this machine, offers model-list sync where supported, and exposes that harness's unattended-run parameters. See [My Agents](/customize/agents/).

## Memory
-Tunes the chunk-based consolidator: LLM-round budgets per L2 surface and L3 slot for **Update** and **Audit**, plus **Dedup** iterations. See [Memory → Tuning the consolidator](/explore/memory/#tuning-the-consolidator).
+Tunes the chunk-based consolidator: LLM-round budgets per L2 surface and L3 slot for **Update** and **Audit**, plus **Dedup** iterations. See [Memory → Tuning the consolidator](/learning-workspace/memory/#tuning-the-consolidator).
## About and updates
@@ -118,6 +118,6 @@ Automatic **Update and restart** is offered only for a regular PyPI install insi
## See also
- [Providers](/get-started/providers/) — model and search setup recipes
-- [DeepTutor Ecosystem](/ecosystem/) — Skills, MCP Services, and CLI Apps managed from Personalization
+- [DeepTutor Ecosystem](/customize/) — Skills, MCP Services, and CLI Apps managed from Personalization
- [Docker](/get-started/docker/) — port and reverse-proxy notes
-- [Memory](/explore/memory/) · [Knowledge Center](/explore/knowledge/) · [My Agents](/explore/subagents/)
+- [Memory](/learning-workspace/memory/) · [Knowledge Center](/learning-workspace/knowledge/) · [My Agents](/customize/agents/)
diff --git a/docs/src/content/docs/get-started/from-source.md b/docs/src/content/docs/self-hosting/source.md
similarity index 96%
rename from docs/src/content/docs/get-started/from-source.md
rename to docs/src/content/docs/self-hosting/source.md
index 17e361719..d6643305f 100644
--- a/docs/src/content/docs/get-started/from-source.md
+++ b/docs/src/content/docs/self-hosting/source.md
@@ -27,7 +27,7 @@ deeptutor init
deeptutor start --dev
```
-`deeptutor start` builds the local `web/` frontend for production once and reuses it; `--dev` runs Next.js with HMR. Config layout, ports, and `Ctrl+C` match the [**PyPI install**](/get-started/pypi/).
+`deeptutor start` builds the local `web/` frontend for production once and reuses it; `--dev` runs Next.js with HMR. Config layout, ports, and `Ctrl+C` match the [**PyPI install**](/self-hosting/pypi/).
Before changing modules or dependency groups, stop DeepTutor. Check `python -m pip check` and `deeptutor module list` after installation. In source, `module enable/disable` controls assembly; installing or uninstalling module wheels is reserved for a separate wheel environment. Keep the same runtime home when restarting.
@@ -167,9 +167,9 @@ python -m uvicorn deeptutor.api.main:app \
--reload --reload-exclude "web/*" --reload-exclude "data/*"
```
-More fixes: [**Troubleshooting**](/get-started/troubleshooting/).
+More fixes: [**Troubleshooting**](/self-hosting/troubleshooting/).
## Next
-- [**DeepTutor CLI**](/cli/) — drive the CLI from the same workspace
-- [**Explore DeepTutor**](/explore/) — tour the running app
+- [**DeepTutor CLI**](/developers/guides/cli/) — drive the CLI from the same workspace
+- [**Explore DeepTutor**](/learning-workspace/) — tour the running app
diff --git a/docs/src/content/docs/get-started/troubleshooting.md b/docs/src/content/docs/self-hosting/troubleshooting.md
similarity index 99%
rename from docs/src/content/docs/get-started/troubleshooting.md
rename to docs/src/content/docs/self-hosting/troubleshooting.md
index ba84e0a19..bb119d322 100644
--- a/docs/src/content/docs/get-started/troubleshooting.md
+++ b/docs/src/content/docs/self-hosting/troubleshooting.md
@@ -298,7 +298,7 @@ Long-poll / WebSocket connections drop occasionally. The channel manager auto-re
- For Teams/webhook-style channels, confirm the public callback URL reaches the configured host/port/path
- For Matrix, verify the homeserver is not aggressively timing out
-See [**Partners & Channels**](/partners/) and the [**Channel Matrix**](/partners/channels/) for channel-specific debugging.
+See [**Partners & Channels**](/channels/) and the [**Channel Matrix**](/channels/schema/) for channel-specific debugging.
## Memory / RAG accuracy
diff --git a/docs/src/content/docs/welcome.mdx b/docs/src/content/docs/welcome.mdx
new file mode 100644
index 000000000..7757f855c
--- /dev/null
+++ b/docs/src/content/docs/welcome.mdx
@@ -0,0 +1,44 @@
+---
+title: Welcome
+description: DeepTutor is an agent-native learning companion. Use it to study with your own materials, practice, research, and keep each subject in its own workspace.
+quadrant: explanation
+---
+
+import { CardGrid, LinkCard } from '@astrojs/starlight/components';
+
+DeepTutor is an agent-native learning companion. Use it to study with your own materials, practice, research, and keep each subject in its own workspace.
+
+
+
+## Start here
+
+