Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

release: v1.4.3 — TutorBot→Partners, single-loop Chat, real multi-user isolation

Bingxi Zhao (Frank)452de667290c
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 631d671b7..b5dfec8c8 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -103,3 +103,4 @@ repos:
additional_dependencies:
- types-PyYAML
- types-requests
+ - types-croniter
diff --git a/README.md b/README.md
index a87a000e9..b7a3f0fd7 100644
--- a/README.md
+++ b/README.md
@@ -44,17 +44,19 @@
### 📦 Releases
+> **[2026.6.12]** [v1.4.3](https://github.com/HKUDS/DeepTutor/releases/tag/v1.4.3) — TutorBot becomes **Partners** on a production-grade IM pipeline with live streaming replies and 15 channels, Chat moves to a single agent loop, real per-user isolation for multi-user deployments, Visualize rebuilt with local validate+repair, plus upgrades across Co-writer, file viewer, MinerU cloud parsing, and the CLI. Docs fully refreshed at [deeptutor.info](https://deeptutor.info/).
+
> **[2026.5.28]** [v1.4.2](https://github.com/HKUDS/DeepTutor/releases/tag/v1.4.2) — Stability + polish on v1.4.1: Gemini 2.5+ unblocked across Visualize and Chat, ContextVar auth-routing fix (#485), reasoning + native-tools label protocol hardened, smooth-streaming UX on every chat surface, new collapsible Recents sidebar, and Lemonade local-provider support.
> **[2026.5.27]** [v1.4.1](https://github.com/HKUDS/DeepTutor/releases/tag/v1.4.1) — Security + stability patch: TutorBot tool sandbox locked down, per-user resource isolation, multimodal image fallback for vision-capable providers, an HTTP/SSE API for talking to a TutorBot, and a v1.4.0 chat regression fix.
> **[2026.5.22]** [v1.4.0](https://github.com/HKUDS/DeepTutor/releases/tag/v1.4.0) — GA cut of v1.4: Auto Mode, three-layer Memory, agentic Deep Research / Solve / Question, LlamaIndex RAG refactor, Visualize/Animator merge, plus reasoning-effort normalization, tool-schema fallback, and restart-safe turn runtime.
-> **[2026.5.21]** [v1.4.0-beta](https://github.com/HKUDS/DeepTutor/releases/tag/v1.4.0-beta) — Three-layer Memory workbench (L1/L2/L3), every chat capability rebuilt on a single agentic engine, LlamaIndex-only RAG, and a unified Settings + Capabilities surface.
-
<details>
<summary><b>Past releases (more than 2 weeks ago)</b></summary>
+> **[2026.5.21]** [v1.4.0-beta](https://github.com/HKUDS/DeepTutor/releases/tag/v1.4.0-beta) — Three-layer Memory workbench (L1/L2/L3), every chat capability rebuilt on a single agentic engine, LlamaIndex-only RAG, and a unified Settings + Capabilities surface.
+
> **[2026.5.10]** [v1.3.10](https://github.com/HKUDS/DeepTutor/releases/tag/v1.3.10) — Remote Docker CORS recovery, `DISABLE_SSL_VERIFY` across SDK providers, safer code-block citations, and optional Matrix E2EE add-on.
> **[2026.5.9]** [v1.3.9](https://github.com/HKUDS/DeepTutor/releases/tag/v1.3.9) — TutorBot Zulip and NVIDIA NIM support, safer thinking-model routing, `deeptutor start`, sidebar tooltips, and session-store parity.
@@ -167,7 +169,7 @@ DeepTutor is organized around an agent-native runtime: a shared ChatOrchestrator
DeepTutor ships four installation paths. They all share one workspace layout: settings live in `data/user/settings/` under the directory you launch from (or under `DEEPTUTOR_HOME` / `deeptutor start --home` if you set one explicitly). For the full app, the recommended flow is **pick a workspace directory → install → `deeptutor init` → `deeptutor start`**.
-> ✨ **v1.4.2 is live.** `pip install -U deeptutor` picks up the latest stable. Pre-releases (when available) opt in with `pip install --pre -U deeptutor`.
+> ✨ **v1.4.3 is live.** `pip install -U deeptutor` picks up the latest stable. Pre-releases (when available) opt in with `pip install --pre -U deeptutor`.
### Option 1 — Install From PyPI
diff --git a/assets/figs/webui/partners.png b/assets/figs/webui/partners.png
index b992d9559..0991303c5 100644
Binary files a/assets/figs/webui/partners.png and b/assets/figs/webui/partners.png differ
diff --git a/assets/releases/ver1-4-3.md b/assets/releases/ver1-4-3.md
new file mode 100644
index 000000000..a465dade8
--- /dev/null
+++ b/assets/releases/ver1-4-3.md
@@ -0,0 +1,101 @@
+# DeepTutor v1.4.3 Release Notes
+
+**Release Date:** 2026.06.12
+
+The biggest release since [v1.4.0](ver1-4-0.md). TutorBot grows up into
+**Partners**, Chat collapses into a single agent loop, multi-user gets real
+per-user isolation, and Visualize, Co-writer, the file viewer, document
+parsing, and the CLI all level up. The docs at
+[deeptutor.info](https://deeptutor.info/) have been rebuilt alongside —
+every Partner channel now has its own setup guide, in English and Chinese.
+
+> **Upgrading from TutorBot?** Migration is automatic and non-destructive:
+> on first start your bots become Partners — channel configs (secrets
+> included), model selection, and the soul library carry over, and each
+> bot's persona becomes its `SOUL.md`. The old `data/tutorbot/` tree is
+> left untouched, so rolling back stays safe. One breaking change: the
+> HTTP API moved from `/api/v1/tutorbot/...` to `/api/v1/partners/...` —
+> update any scripts that call it. The `[tutorbot]` pip extra keeps
+> working as an alias for `[partners]`.
+
+## What's New
+
+### TutorBot → Partners
+
+Your bots are now **Partners** — same idea, much stronger execution:
+
+- Partners run on the same agent loop as product Chat (the separate
+ nanobot engine is gone), so every Chat improvement reaches your IM bots
+ automatically.
+- Production-grade message pipeline: send retries, dedup, coalescing, and
+ a per-channel delivery matrix.
+- **Live streaming replies** on Telegram, Discord, and Feishu — answers
+ render as they are generated.
+- New **WeCom AI Bot** channel; 15 channel connectors total, from Slack
+ and Discord to DingTalk, QQ, and WhatsApp.
+- Web chat now takes **attachments** — drop images or files straight into
+ a Partner conversation.
+- A rewritten soul template library with an in-app editor.
+
+### One Loop for Chat
+
+The two-phase targeting/respond pipeline is gone. Chat now runs a single
+exploring agent loop with native tool calling end to end — fewer moving
+parts, smarter tool use, no more mis-routed turns. A new **Activity
+header** keeps the status line pinned on top and folds the thinking/tool
+trace away once the answer lands.
+
+### Real Multi-User Isolation
+
+- Per-user grants v2: tools, MCP servers, and exec access are controlled
+ per user from the admin UI.
+- Workspace layout moves to `data/users/<uid>` + `data/system`; existing
+ deployments migrate automatically.
+- The exec runner mounts only the calling user's workspace subtree (new
+ `Dockerfile.runner`), so sandboxed code never sees another user's files.
+
+### Visualize, Rebuilt
+
+Inline, theme-aware SVG rendering; structured prompts; and a local
+validate + repair pass replacing the old full-round LLM review — faster,
+cheaper, and far fewer broken diagrams. Fullscreen now works for every
+visual type.
+
+### Sharper Everyday Tools
+
+- **Co-writer** renders flowcharts and sequence diagrams via Mermaid, and
+ selection-scoped questions can pull from your knowledge base and the web.
+- **File viewer**: true in-browser docx/xlsx previews, drag-to-resize, and
+ the Activity panel now lives alongside your open files.
+- **MinerU cloud parsing** as an alternative to the local backend
+ (`/settings/mineru`), and question extraction now captures question
+ type, difficulty, and answers.
+- **Office skills work out of the box** — docx/pdf/pptx/xlsx generation no
+ longer requires flipping a sandbox switch.
+- **CLI chat, rewritten**: aligned with the new loop protocol, interactive
+ `ask_user` prompts in the terminal, Ctrl-C cancellation, and collapsible
+ thinking output.
+
+### Fixes That Matter
+
+Qwen models no longer leak JSON wrappers into answers, Windows installs
+get UTF-8 right, Zulip bots catch mentions reliably, and a
+file-descriptor exhaustion bug plus false-positive health checks are gone.
+
+### Docs, Synced
+
+[deeptutor.info](https://deeptutor.info/) was rebuilt with this release:
+a dedicated setup guide for every Partner channel (English + 中文),
+refreshed screenshots throughout, and updated CLI and server API
+references.
+
+## Upgrade Notes
+
+- `pip install -U deeptutor` — the migrations run automatically on first
+ start, and all of them are idempotent.
+- Legacy `multi-user/` trees move to `data/users/` in place; TutorBot
+ bots become Partners (see the note at the top).
+- Exec-based skills now allow subprocesses by default. To restore the old
+ behavior, set `sandbox_allow_subprocess` to `false` in system settings.
+
+**Full Changelog**: https://github.com/HKUDS/DeepTutor/compare/v1.4.2...v1.4.3
diff --git a/deeptutor/__version__.py b/deeptutor/__version__.py
index c807f1e03..30e1688dc 100644
--- a/deeptutor/__version__.py
+++ b/deeptutor/__version__.py
@@ -6,6 +6,6 @@ before publishing to PyPI; the web sidebar badge and CLI banner read from this
file directly.
"""
-__version__ = "1.4.2"
+__version__ = "1.4.3"
__all__ = ("__version__",)
diff --git a/deeptutor/agents/visualize/utils.py b/deeptutor/agents/visualize/utils.py
index d970be97f..1552fb79e 100644
--- a/deeptutor/agents/visualize/utils.py
+++ b/deeptutor/agents/visualize/utils.py
@@ -5,7 +5,8 @@ from __future__ import annotations
import json
import re
from typing import Any
-import xml.etree.ElementTree as ET
+
+import defusedxml.ElementTree as ET
_MERMAID_KEYWORDS = (
"graph",
diff --git a/deeptutor/api/routers/partners.py b/deeptutor/api/routers/partners.py
index b3fd07609..c68b6c1fa 100644
--- a/deeptutor/api/routers/partners.py
+++ b/deeptutor/api/routers/partners.py
@@ -10,6 +10,8 @@ entry points (HTTP / SSE / WebSocket).
from __future__ import annotations
import asyncio
+import base64
+import binascii
import json
import logging
from typing import Any, AsyncGenerator, Literal
@@ -20,6 +22,8 @@ from fastapi.responses import StreamingResponse
from pydantic import BaseModel, ConfigDict, Field, ValidationError
from deeptutor.core.i18n import t
+from deeptutor.partners.config.paths import get_partner_media_dir
+from deeptutor.partners.helpers import safe_filename
from deeptutor.services.partners import get_partner_manager, slugify_partner_id
from deeptutor.services.partners.manager import (
LEGACY_GLOBAL_DELIVERY_KEYS,
@@ -138,12 +142,21 @@ class AssetAddRequest(AssetSpec):
pass
+class ChatAttachmentRequest(BaseModel):
+ type: str = "file"
+ url: str = ""
+ base64: str = ""
+ filename: str = ""
+ mime_type: str = ""
+
+
class ChatMessageRequest(BaseModel):
model_config = ConfigDict(populate_by_name=True)
- content: str = Field(..., min_length=1)
+ content: str = ""
session_id: str | None = None
chat_id: str | None = None
+ attachments: list[ChatAttachmentRequest] = Field(default_factory=list)
llm_selection: dict[str, str] | None = Field(default=None, alias="llmSelection")
@@ -201,9 +214,7 @@ def _validate_avatar_payload(value: str | None) -> str:
if not avatar:
return ""
if not avatar.startswith("data:image/"):
- raise HTTPException(
- status_code=422, detail="Avatar must be a data:image/* URL"
- )
+ raise HTTPException(status_code=422, detail="Avatar must be a data:image/* URL")
if len(avatar) > _AVATAR_MAX_CHARS:
raise HTTPException(
status_code=422,
@@ -330,11 +341,21 @@ async def soul_sources():
from deeptutor.multi_user.paths import get_admin_path_service
from deeptutor.services.persona import PersonaService, get_persona_service
+ def _persona_entry(service: PersonaService, info: Any) -> dict[str, str]:
+ # Content rides along so the wizard can preview the clone; creation
+ # still re-resolves the persona server-side (_resolve_soul_content).
+ try:
+ content = strip_frontmatter(service.get_detail(info.name).content)
+ except Exception:
+ content = ""
+ return {"name": info.name, "description": info.description, "content": content}
+
personas: list[dict[str, str]] = []
seen: set[str] = set()
try:
- for info in get_persona_service().list_personas():
- personas.append({"name": info.name, "description": info.description})
+ service = get_persona_service()
+ for info in service.list_personas():
+ personas.append(_persona_entry(service, info))
seen.add(info.name)
except Exception:
logger.warning("Failed to list user personas", exc_info=True)
@@ -345,7 +366,7 @@ async def soul_sources():
)
for info in admin_service.list_personas():
if info.name not in seen:
- personas.append({"name": info.name, "description": info.description})
+ personas.append(_persona_entry(admin_service, info))
except Exception:
logger.warning("Failed to list admin personas", exc_info=True)
@@ -703,13 +724,73 @@ def _resolve_http_session(payload: ChatMessageRequest) -> tuple[str, str]:
return session_id, session_id
+_PARTNER_UPLOAD_MAX_BYTES = 10 * 1024 * 1024
+_PARTNER_UPLOAD_MAX_TOTAL_BYTES = 25 * 1024 * 1024
+
+
+def _clean_attachment_base64(value: str) -> str:
+ text = str(value or "").strip()
+ if text.startswith("data:") and "," in text:
+ return text.split(",", 1)[1]
+ return text
+
+
+def _default_attachment_prompt(attachments: list[ChatAttachmentRequest]) -> str:
+ if attachments and all(str(item.type).lower() == "image" for item in attachments):
+ return t("Please analyze the attached image(s).")
+ return t("Please use the attached file(s).")
+
+
+def _materialize_partner_attachments(
+ partner_id: str,
+ attachments: list[ChatAttachmentRequest],
+) -> list[str]:
+ """Persist browser-sent attachment bytes into the partner media tree."""
+ if not attachments:
+ return []
+
+ media_dir = get_partner_media_dir(partner_id, "web")
+ total_bytes = 0
+ media_paths: list[str] = []
+ for item in attachments:
+ raw_b64 = _clean_attachment_base64(item.base64)
+ if not raw_b64:
+ # Partner web chat accepts uploaded bytes only. URL-only
+ # attachments are ignored rather than fetched server-side.
+ continue
+ try:
+ data = base64.b64decode(raw_b64, validate=False)
+ except (binascii.Error, ValueError) as exc:
+ raise HTTPException(
+ status_code=422,
+ detail=f"Invalid attachment data for {item.filename or 'file'}",
+ ) from exc
+ if len(data) > _PARTNER_UPLOAD_MAX_BYTES:
+ raise HTTPException(
+ status_code=413,
+ detail=f"Attachment too large: {item.filename or 'file'}",
+ )
+ if total_bytes + len(data) > _PARTNER_UPLOAD_MAX_TOTAL_BYTES:
+ raise HTTPException(status_code=413, detail="Attachment batch too large")
+ total_bytes += len(data)
+
+ filename = safe_filename(item.filename or "attachment") or "attachment"
+ path = media_dir / f"{uuid4().hex[:12]}_{filename}"
+ path.write_bytes(data)
+ media_paths.append(str(path))
+ return media_paths
+
+
@router.post("/{partner_id}/chat")
async def partner_chat_http(partner_id: str, payload: ChatMessageRequest) -> dict[str, Any]:
"""Send one HTTP message to a partner with persistent session context."""
content = payload.content.strip()
- if not content:
+ if not content and not payload.attachments:
raise HTTPException(status_code=400, detail=t("api.content_required"))
await _ensure_running_partner(partner_id)
+ media_paths = _materialize_partner_attachments(partner_id, payload.attachments)
+ if not content and media_paths:
+ content = _default_attachment_prompt(payload.attachments)
mgr = get_partner_manager()
session_id, chat_id = _resolve_http_session(payload)
try:
@@ -718,6 +799,7 @@ async def partner_chat_http(partner_id: str, payload: ChatMessageRequest) -> dic
content,
chat_id=chat_id,
session_id=session_id,
+ media=media_paths,
)
except RuntimeError as exc:
raise HTTPException(status_code=400, detail=str(exc)) from None
@@ -736,9 +818,12 @@ async def _partner_chat_stream(
mgr = get_partner_manager()
content = payload.content.strip()
- if not content:
+ if not content and not payload.attachments:
yield _sse("error", {"detail": t("api.content_required")})
return
+ media_paths = _materialize_partner_attachments(partner_id, payload.attachments)
+ if not content and media_paths:
+ content = _default_attachment_prompt(payload.attachments)
session_id, chat_id = _resolve_http_session(payload)
queue: asyncio.Queue[dict[str, Any]] = asyncio.Queue()
done = asyncio.Event()
@@ -755,6 +840,7 @@ async def _partner_chat_stream(
content,
chat_id=chat_id,
session_id=session_id,
+ media=media_paths,
on_event=on_event,
)
except Exception as exc: # noqa: BLE001
@@ -787,7 +873,7 @@ async def _partner_chat_stream(
@router.post("/{partner_id}/chat/execute-stream")
async def partner_chat_http_stream(partner_id: str, payload: ChatMessageRequest):
"""Stream one HTTP message to a partner as server-sent events."""
- if not payload.content.strip():
+ if not payload.content.strip() and not payload.attachments:
raise HTTPException(status_code=400, detail=t("api.content_required"))
await _ensure_running_partner(partner_id)
return StreamingResponse(
@@ -801,7 +887,8 @@ async def partner_chat_http_stream(partner_id: str, payload: ChatMessageRequest)
async def partner_chat_ws(ws: WebSocket, partner_id: str):
"""Web chat socket.
- Client → server: ``{"content": str, "session_id"?: str, "chat_id"?: str}``.
+ Client → server: ``{"content": str, "session_id"?: str, "chat_id"?: str,
+ "attachments"?: [{"type", "filename", "mime_type", "base64"}]}``.
Server → client frames:
* ``{"type": "stream_event", "event": {...}}`` — every chat-loop
@@ -868,8 +955,27 @@ async def partner_chat_ws(ws: WebSocket, partner_id: str):
continue
content = data.get("content", "").strip()
- if not content:
+ try:
+ attachments = [
+ ChatAttachmentRequest.model_validate(item)
+ for item in (data.get("attachments") or [])
+ if isinstance(item, dict)
+ ]
+ except ValidationError:
+ if not await _safe_send({"type": "error", "content": "Invalid attachments"}):
+ break
+ continue
+
+ if not content and not attachments:
+ continue
+ try:
+ media_paths = _materialize_partner_attachments(partner_id, attachments)
+ except HTTPException as exc:
+ if not await _safe_send({"type": "error", "content": str(exc.detail)}):
+ break
continue
+ if not content and media_paths:
+ content = _default_attachment_prompt(attachments)
async def on_event(event: Any) -> None:
# Best-effort: never raise into the runner. A vanished
@@ -886,6 +992,7 @@ async def partner_chat_ws(ws: WebSocket, partner_id: str):
content,
chat_id=data.get("chat_id", "web"),
session_id=data.get("session_id"),
+ media=media_paths,
on_event=on_event,
)
if not await _safe_send({"type": "content", "content": response}):
diff --git a/deeptutor/learning/tests/test_error_diagnosis.py b/deeptutor/learning/tests/test_error_diagnosis.py
index 359275f10..10ca18ca9 100644
--- a/deeptutor/learning/tests/test_error_diagnosis.py
+++ b/deeptutor/learning/tests/test_error_diagnosis.py
@@ -47,7 +47,7 @@ def _make_capability() -> MasteryPathCapability:
cap._store._root = None
cap._service = LearningService(cap._store)
cap._scheduler = None
- cap._call_llm = AsyncMock(return_value=None)
+ cap._call_llm = AsyncMock(return_value=None) # type: ignore[method-assign]
return cap
@@ -86,7 +86,7 @@ async def test_error_diagnosis_llm_skip_advances_to_review_and_marks_unavailable
is flagged unavailable, its prior error_type is preserved, and the stage
advances to REVIEW rather than wedging on the flaky model."""
cap = _make_capability()
- cap._call_llm = AsyncMock(return_value=None)
+ cap._call_llm = AsyncMock(return_value=None) # type: ignore[method-assign]
progress = _make_progress()
stream = FakeStream()
@@ -192,7 +192,7 @@ async def test_error_diagnosis_ignores_invalid_error_type():
async def test_error_diagnosis_diagnoses_retrying_records():
"""``retrying`` records are active for diagnosis just like ``active`` ones."""
cap = _make_capability()
- cap._call_llm = AsyncMock(return_value=None)
+ cap._call_llm = AsyncMock(return_value=None) # type: ignore[method-assign]
retrying = ErrorRecord(
id="er2",
question_id="q2",
diff --git a/deeptutor/learning/tests/test_feynman_retry.py b/deeptutor/learning/tests/test_feynman_retry.py
index 6e3dfb18f..c1fc8e6a7 100644
--- a/deeptutor/learning/tests/test_feynman_retry.py
+++ b/deeptutor/learning/tests/test_feynman_retry.py
@@ -69,9 +69,9 @@ def _make_capability(llm_response: str | None) -> MasteryPathCapability:
cap._service = LearningService(store)
cap._scheduler = None # the Feynman path never touches the scheduler
# Mock the single LLM entry point so no network/JSON contract is exercised.
- cap._call_llm = AsyncMock(return_value=llm_response)
+ cap._call_llm = AsyncMock(return_value=llm_response) # type: ignore[method-assign]
# save() is a no-op so the in-memory progress isn't flushed to a missing root.
- cap._service.save = lambda progress: None
+ cap._service.save = lambda progress: None # type: ignore[method-assign]
return cap
diff --git a/deeptutor/partners/channels/dingtalk.py b/deeptutor/partners/channels/dingtalk.py
index 971aecd52..b98222611 100644
--- a/deeptutor/partners/channels/dingtalk.py
+++ b/deeptutor/partners/channels/dingtalk.py
@@ -16,7 +16,7 @@ from pydantic import Field
from deeptutor.partners.bus.events import OutboundMessage
from deeptutor.partners.bus.queue import MessageBus
from deeptutor.partners.channels.base import BaseChannel
-from deeptutor.partners.config.schema import Base, DeliveryOverrides
+from deeptutor.partners.config.schema import DeliveryOverrides
try:
from dingtalk_stream import (
diff --git a/deeptutor/partners/channels/discord.py b/deeptutor/partners/channels/discord.py
index da34bff0a..f78c42d32 100644
--- a/deeptutor/partners/channels/discord.py
+++ b/deeptutor/partners/channels/discord.py
@@ -16,7 +16,7 @@ from deeptutor.partners.bus.events import OutboundMessage
from deeptutor.partners.bus.queue import MessageBus
from deeptutor.partners.channels.base import BaseChannel
from deeptutor.partners.config.paths import get_media_dir
-from deeptutor.partners.config.schema import Base, DeliveryOverrides, StreamingSupport
+from deeptutor.partners.config.schema import DeliveryOverrides, StreamingSupport
from deeptutor.partners.helpers import split_message
DISCORD_API_BASE = "https://discord.com/api/v10"
diff --git a/deeptutor/partners/channels/email.py b/deeptutor/partners/channels/email.py
index 41ed6c008..09933224c 100644
--- a/deeptutor/partners/channels/email.py
+++ b/deeptutor/partners/channels/email.py
@@ -20,7 +20,7 @@ from pydantic import Field
from deeptutor.partners.bus.events import OutboundMessage
from deeptutor.partners.bus.queue import MessageBus
from deeptutor.partners.channels.base import BaseChannel
-from deeptutor.partners.config.schema import Base, DeliveryOverrides
+from deeptutor.partners.config.schema import DeliveryOverrides
class EmailConfig(DeliveryOverrides):
diff --git a/deeptutor/partners/channels/feishu.py b/deeptutor/partners/channels/feishu.py
index 8e123302a..dea4fc811 100644
--- a/deeptutor/partners/channels/feishu.py
+++ b/deeptutor/partners/channels/feishu.py
@@ -19,7 +19,7 @@ from deeptutor.partners.bus.events import OutboundMessage
from deeptutor.partners.bus.queue import MessageBus
from deeptutor.partners.channels.base import BaseChannel
from deeptutor.partners.config.paths import get_media_dir
-from deeptutor.partners.config.schema import Base, DeliveryOverrides, StreamingSupport
+from deeptutor.partners.config.schema import DeliveryOverrides, StreamingSupport
FEISHU_AVAILABLE = importlib.util.find_spec("lark_oapi") is not None
diff --git a/deeptutor/partners/channels/manager.py b/deeptutor/partners/channels/manager.py
index d6c1aed9d..15cb92165 100644
--- a/deeptutor/partners/channels/manager.py
+++ b/deeptutor/partners/channels/manager.py
@@ -3,8 +3,8 @@
from __future__ import annotations
import asyncio
-import hashlib
from contextlib import suppress
+import hashlib
from typing import Any
from deeptutor.partners.bus.events import OutboundMessage
@@ -153,7 +153,9 @@ class ChannelManager:
@staticmethod
def _fingerprint_content(content: str) -> str:
normalized = " ".join(content.split())
- return hashlib.sha1(normalized.encode("utf-8")).hexdigest() if normalized else ""
+ if not normalized:
+ return ""
+ return hashlib.sha1(normalized.encode("utf-8"), usedforsecurity=False).hexdigest()
def _should_suppress_outbound(self, msg: OutboundMessage) -> bool:
"""Suppress an exact-duplicate reply to the same source message.
diff --git a/deeptutor/partners/channels/matrix.py b/deeptutor/partners/channels/matrix.py
index e7ffcef69..81695aeaf 100644
--- a/deeptutor/partners/channels/matrix.py
+++ b/deeptutor/partners/channels/matrix.py
@@ -48,7 +48,7 @@ from deeptutor.partners.bus.events import OutboundMessage
from deeptutor.partners.bus.queue import MessageBus
from deeptutor.partners.channels.base import BaseChannel
from deeptutor.partners.config.paths import get_data_dir, get_media_dir
-from deeptutor.partners.config.schema import Base, DeliveryOverrides
+from deeptutor.partners.config.schema import DeliveryOverrides
from deeptutor.partners.helpers import safe_filename
TYPING_NOTICE_TIMEOUT_MS = 30_000
diff --git a/deeptutor/partners/channels/msteams.py b/deeptutor/partners/channels/msteams.py
index 8dfd0fdda..4f7a28ce4 100644
--- a/deeptutor/partners/channels/msteams.py
+++ b/deeptutor/partners/channels/msteams.py
@@ -12,7 +12,10 @@ Scope:
from __future__ import annotations
import asyncio
+from contextlib import contextmanager, suppress
+from dataclasses import dataclass
import html
+from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
import importlib.util
import json
import os
@@ -20,9 +23,6 @@ import re
import tempfile
import threading
import time
-from contextlib import contextmanager, suppress
-from dataclasses import dataclass
-from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from typing import TYPE_CHECKING, Any
from urllib.parse import urlparse
@@ -265,7 +265,9 @@ class MSTeamsChannel(BaseChannel):
)
token = await self._get_access_token()
- base_url = f"{ref.service_url.rstrip('/')}/v3/conversations/{ref.conversation_id}/activities"
+ base_url = (
+ f"{ref.service_url.rstrip('/')}/v3/conversations/{ref.conversation_id}/activities"
+ )
use_thread_reply = self.config.reply_in_thread and bool(ref.activity_id)
headers = {
"Authorization": f"Bearer {token}",
diff --git a/deeptutor/partners/channels/napcat.py b/deeptutor/partners/channels/napcat.py
index d09a06da6..d59f23290 100644
--- a/deeptutor/partners/channels/napcat.py
+++ b/deeptutor/partners/channels/napcat.py
@@ -260,9 +260,7 @@ class NapcatChannel(BaseChannel):
if group_id is None:
return
- replying_to_bot = (
- isinstance(reply_to_id, int) and reply_to_id in self._bot_outbound_ids
- )
+ replying_to_bot = isinstance(reply_to_id, int) and reply_to_id in self._bot_outbound_ids
if not self._should_reply_in_group(
group_id=group_id,
mentioned_self=mentioned_self,
diff --git a/deeptutor/partners/channels/qq.py b/deeptutor/partners/channels/qq.py
index 812a5110f..3a1918af5 100644
--- a/deeptutor/partners/channels/qq.py
+++ b/deeptutor/partners/channels/qq.py
@@ -10,7 +10,7 @@ from pydantic import Field
from deeptutor.partners.bus.events import OutboundMessage
from deeptutor.partners.bus.queue import MessageBus
from deeptutor.partners.channels.base import BaseChannel
-from deeptutor.partners.config.schema import Base, DeliveryOverrides
+from deeptutor.partners.config.schema import DeliveryOverrides
try:
import botpy
diff --git a/deeptutor/partners/channels/telegram.py b/deeptutor/partners/channels/telegram.py
index 96628226d..451f7fc4c 100644
--- a/deeptutor/partners/channels/telegram.py
+++ b/deeptutor/partners/channels/telegram.py
@@ -20,7 +20,7 @@ from deeptutor.partners.bus.events import OutboundMessage
from deeptutor.partners.bus.queue import MessageBus
from deeptutor.partners.channels.base import BaseChannel
from deeptutor.partners.config.paths import get_media_dir
-from deeptutor.partners.config.schema import Base, DeliveryOverrides, StreamingSupport
+from deeptutor.partners.config.schema import DeliveryOverrides, StreamingSupport
from deeptutor.partners.helpers import split_message
from deeptutor.services.partners.commands import build_partner_help_text, partner_command_palette
diff --git a/deeptutor/partners/channels/wecom.py b/deeptutor/partners/channels/wecom.py
index 187ba805c..31103ab46 100644
--- a/deeptutor/partners/channels/wecom.py
+++ b/deeptutor/partners/channels/wecom.py
@@ -13,7 +13,7 @@ from deeptutor.partners.bus.events import OutboundMessage
from deeptutor.partners.bus.queue import MessageBus
from deeptutor.partners.channels.base import BaseChannel
from deeptutor.partners.config.paths import get_media_dir
-from deeptutor.partners.config.schema import Base, DeliveryOverrides
+from deeptutor.partners.config.schema import DeliveryOverrides
WECOM_AVAILABLE = importlib.util.find_spec("wecom_aibot_sdk") is not None
diff --git a/deeptutor/partners/channels/weixin.py b/deeptutor/partners/channels/weixin.py
index eafe3367d..4d990050a 100644
--- a/deeptutor/partners/channels/weixin.py
+++ b/deeptutor/partners/channels/weixin.py
@@ -11,18 +11,18 @@ from __future__ import annotations
import asyncio
import base64
+from collections import OrderedDict
+from contextlib import suppress
import hashlib
import json
import os
+from pathlib import Path
import random
import re
import time
-import uuid
-from collections import OrderedDict
-from contextlib import suppress
-from pathlib import Path
from typing import Any
from urllib.parse import quote
+import uuid
import httpx
from loguru import logger
@@ -72,6 +72,7 @@ def _build_client_version(version: str) -> int:
patch = _as_int(2)
return ((major & 0xFF) << 16) | ((minor & 0xFF) << 8) | (patch & 0xFF)
+
ILINK_APP_CLIENT_VERSION = _build_client_version(WEIXIN_CHANNEL_VERSION)
BASE_INFO: dict[str, str] = {"channel_version": WEIXIN_CHANNEL_VERSION}
@@ -115,7 +116,10 @@ _VOICE_EXTS = {".mp3", ".wav", ".amr", ".silk", ".ogg", ".m4a", ".aac", ".flac"}
def _has_downloadable_media_locator(media: dict[str, Any] | None) -> bool:
if not isinstance(media, dict):
return False
- return bool(str(media.get("encrypt_query_param", "") or "") or str(media.get("full_url", "") or "").strip())
+ return bool(
+ str(media.get("encrypt_query_param", "") or "")
+ or str(media.get("full_url", "") or "").strip()
+ )
class WeixinConfig(DeliveryOverrides):
@@ -387,7 +391,9 @@ class WeixinChannel(BaseChannel):
elif status == "scaned_but_redirect":
redirect_host = str(status_data.get("redirect_host", "") or "").strip()
if redirect_host:
- if redirect_host.startswith("http://") or redirect_host.startswith("https://"):
+ if redirect_host.startswith("http://") or redirect_host.startswith(
+ "https://"
+ ):
redirected_base = redirect_host
else:
redirected_base = f"https://{redirect_host}"
@@ -478,7 +484,9 @@ class WeixinChannel(BaseChannel):
self._token = self.config.token
elif not self._load_state():
if not await self._qr_login():
- self.logger.error("login failed. open the Weixin channel and scan the QR code to authenticate.")
+ self.logger.error(
+ "login failed. open the Weixin channel and scan the QR code to authenticate."
+ )
self._running = False
return
@@ -514,6 +522,7 @@ class WeixinChannel(BaseChannel):
await self._client.aclose()
self._client = None
self._save_state()
+
# ------------------------------------------------------------------
# Polling (matches monitor.ts monitorWeixinProvider)
# ------------------------------------------------------------------
@@ -879,7 +888,9 @@ class WeixinChannel(BaseChannel):
hash_seed = encrypt_query_param or full_url
h = abs(hash(hash_seed)) % 100000
filename = f"{media_type}_{ts}_{h}{ext}"
- safe_name = safe_filename(os.path.basename(filename)) or f"{media_type}_{int(time.time())}{ext}"
+ safe_name = (
+ safe_filename(os.path.basename(filename)) or f"{media_type}_{int(time.time())}{ext}"
+ )
file_path = media_dir / safe_name
file_path.write_bytes(data)
return str(file_path)
@@ -915,7 +926,11 @@ class WeixinChannel(BaseChannel):
}
return ticket
- prev_delay = float(entry.get("retry_delay_s", CONFIG_CACHE_INITIAL_RETRY_S)) if entry else CONFIG_CACHE_INITIAL_RETRY_S
+ prev_delay = (
+ float(entry.get("retry_delay_s", CONFIG_CACHE_INITIAL_RETRY_S))
+ if entry
+ else CONFIG_CACHE_INITIAL_RETRY_S
+ )
next_delay = min(prev_delay * 2, CONFIG_CACHE_MAX_RETRY_S)
if entry:
entry["next_fetch_at"] = now + next_delay
@@ -930,9 +945,7 @@ class WeixinChannel(BaseChannel):
}
return ""
- async def _refresh_context_token_if_stale(
- self, chat_id: str, context_token: str
- ) -> str:
+ async def _refresh_context_token_if_stale(self, chat_id: str, context_token: str) -> str:
"""Return a fresh context_token if the cached one is too old.
iLink context_token expires server-side after a short idle period
@@ -1019,9 +1032,7 @@ class WeixinChannel(BaseChannel):
try:
await self._send_text(chat_id, "\n\n".join(hints), ctx_token)
except Exception:
- self.logger.exception(
- "Failed to flush buffered tool hints for {}", chat_id
- )
+ self.logger.exception("Failed to flush buffered tool hints for {}", chat_id)
async def _send_typing(self, user_id: str, typing_ticket: str, status: int) -> None:
"""Best-effort sendtyping wrapper."""
@@ -1035,7 +1046,9 @@ class WeixinChannel(BaseChannel):
}
await self._api_post("ilink/bot/sendtyping", body)
- async def _typing_keepalive_loop(self, user_id: str, typing_ticket: str, stop_event: asyncio.Event) -> None:
+ async def _typing_keepalive_loop(
+ self, user_id: str, typing_ticket: str, stop_event: asyncio.Event
+ ) -> None:
try:
while not stop_event.is_set():
await asyncio.sleep(TYPING_KEEPALIVE_INTERVAL_S)
@@ -1069,9 +1082,7 @@ class WeixinChannel(BaseChannel):
# Reasoning deltas are invisible in WeChat (there is no reasoning
# UI). Skip them entirely — do not send and do not flush buffer.
if is_progress and (msg.metadata or {}).get("_reasoning_delta"):
- self.logger.debug(
- "Dropped invisible reasoning delta for {}", msg.chat_id
- )
+ self.logger.debug("Dropped invisible reasoning delta for {}", msg.chat_id)
return
content = msg.content.strip()
@@ -1115,7 +1126,7 @@ class WeixinChannel(BaseChannel):
try:
# --- Send media files first (following Telegram channel pattern) ---
- for media_path in (msg.media or []):
+ for media_path in msg.media or []:
try:
await self._send_media_file(msg.chat_id, media_path, ctx_token)
except (httpx.TimeoutException, httpx.TransportError):
@@ -1129,9 +1140,7 @@ class WeixinChannel(BaseChannel):
raise
except httpx.HTTPStatusError as http_err:
status_code = (
- http_err.response.status_code
- if http_err.response is not None
- else 0
+ http_err.response.status_code if http_err.response is not None else 0
)
if status_code >= 500:
# Server-side / retryable HTTP error — same as network.
@@ -1148,7 +1157,9 @@ class WeixinChannel(BaseChannel):
filename = Path(media_path).name
self.logger.exception("Failed to send media {}", media_path)
await self._send_text(
- msg.chat_id, f"[Failed to send: {filename}]", ctx_token,
+ msg.chat_id,
+ f"[Failed to send: {filename}]",
+ ctx_token,
)
except Exception:
# Non-network errors (format, file-not-found, etc.):
@@ -1157,7 +1168,9 @@ class WeixinChannel(BaseChannel):
self.logger.exception("Failed to send media {}", media_path)
# Notify user about failure via text
await self._send_text(
- msg.chat_id, f"[Failed to send: {filename}]", ctx_token,
+ msg.chat_id,
+ f"[Failed to send: {filename}]",
+ ctx_token,
)
# --- Send text content ---
@@ -1304,7 +1317,7 @@ class WeixinChannel(BaseChannel):
raw_data = p.read_bytes()
raw_size = len(raw_data)
- raw_md5 = hashlib.md5(raw_data).hexdigest()
+ raw_md5 = hashlib.md5(raw_data, usedforsecurity=False).hexdigest()
# Determine upload media type from extension
ext = p.suffix.lower()
@@ -1474,8 +1487,10 @@ def _encrypt_aes_ecb(data: bytes, aes_key_b64: str) -> bytes:
pad_len = 16 - len(data) % 16
padded = data + bytes([pad_len] * pad_len)
+ # AES-128-ECB is mandated by the WeChat CDN media protocol — not our choice.
+ # The ``Crypto`` namespace is provided by the maintained pycryptodome fork.
with suppress(ImportError):
- from Crypto.Cipher import AES
+ from Crypto.Cipher import AES # nosec B413
cipher = AES.new(key, AES.MODE_ECB)
return cipher.encrypt(padded)
@@ -1483,7 +1498,7 @@ def _encrypt_aes_ecb(data: bytes, aes_key_b64: str) -> bytes:
try:
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
- cipher_obj = Cipher(algorithms.AES(key), modes.ECB())
+ cipher_obj = Cipher(algorithms.AES(key), modes.ECB()) # nosec B305
encryptor = cipher_obj.encryptor()
return encryptor.update(padded) + encryptor.finalize()
except ImportError:
@@ -1504,8 +1519,10 @@ def _decrypt_aes_ecb(data: bytes, aes_key_b64: str) -> bytes:
decrypted: bytes | None = None
+ # AES-128-ECB is mandated by the WeChat CDN media protocol — not our choice.
+ # The ``Crypto`` namespace is provided by the maintained pycryptodome fork.
with suppress(ImportError):
- from Crypto.Cipher import AES
+ from Crypto.Cipher import AES # nosec B413
cipher = AES.new(key, AES.MODE_ECB)
decrypted = cipher.decrypt(data)
@@ -1514,7 +1531,7 @@ def _decrypt_aes_ecb(data: bytes, aes_key_b64: str) -> bytes:
try:
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
- cipher_obj = Cipher(algorithms.AES(key), modes.ECB())
+ cipher_obj = Cipher(algorithms.AES(key), modes.ECB()) # nosec B305
decryptor = cipher_obj.decryptor()
decrypted = decryptor.update(data) + decryptor.finalize()
except ImportError:
diff --git a/deeptutor/partners/channels/whatsapp.py b/deeptutor/partners/channels/whatsapp.py
index 3d2ee4975..47230394a 100644
--- a/deeptutor/partners/channels/whatsapp.py
+++ b/deeptutor/partners/channels/whatsapp.py
@@ -12,7 +12,7 @@ from pydantic import Field
from deeptutor.partners.bus.events import OutboundMessage
from deeptutor.partners.bus.queue import MessageBus
from deeptutor.partners.channels.base import BaseChannel
-from deeptutor.partners.config.schema import Base, DeliveryOverrides
+from deeptutor.partners.config.schema import DeliveryOverrides
class WhatsAppConfig(DeliveryOverrides):
diff --git a/deeptutor/partners/channels/zulip.py b/deeptutor/partners/channels/zulip.py
index a0060c820..3a171696c 100644
--- a/deeptutor/partners/channels/zulip.py
+++ b/deeptutor/partners/channels/zulip.py
@@ -20,7 +20,7 @@ from deeptutor.partners.bus.events import OutboundMessage
from deeptutor.partners.bus.queue import MessageBus
from deeptutor.partners.channels.base import BaseChannel
from deeptutor.partners.config.paths import get_media_dir
-from deeptutor.partners.config.schema import Base, DeliveryOverrides
+from deeptutor.partners.config.schema import DeliveryOverrides
from deeptutor.partners.helpers import split_message
_UPLOAD_LINK_RE = re.compile(
diff --git a/deeptutor/partners/network.py b/deeptutor/partners/network.py
index a9affff54..1a4a30edb 100644
--- a/deeptutor/partners/network.py
+++ b/deeptutor/partners/network.py
@@ -9,9 +9,9 @@ Ported from nanobot's ``security/network.py``, trimmed to what channels use.
from __future__ import annotations
+from contextlib import suppress
import ipaddress
import socket
-from contextlib import suppress
from urllib.parse import urlparse
_BLOCKED_NETWORKS = [
diff --git a/deeptutor/services/cron/service.py b/deeptutor/services/cron/service.py
index ab96dbcf6..3dda76757 100644
--- a/deeptutor/services/cron/service.py
+++ b/deeptutor/services/cron/service.py
@@ -101,9 +101,7 @@ class CronJob:
@classmethod
def from_dict(cls, data: dict[str, Any]) -> "CronJob":
state = dict(data.get("state") or {})
- state["run_history"] = [
- CronRunRecord(**record) for record in state.get("run_history", [])
- ]
+ state["run_history"] = [CronRunRecord(**record) for record in state.get("run_history", [])]
return cls(
id=str(data["id"]),
name=str(data.get("name") or ""),
diff --git a/deeptutor/services/partners/commands.py b/deeptutor/services/partners/commands.py
index d771c8aca..3d411ee18 100644
--- a/deeptutor/services/partners/commands.py
+++ b/deeptutor/services/partners/commands.py
@@ -94,9 +94,7 @@ class PartnerCommandHandler:
return self._history(msg, args)
if command == "/tool":
return self._tool(args)
- return PartnerCommandResult(
- f"Unknown command: {parts[0]}\n\n{build_partner_help_text()}"
- )
+ return PartnerCommandResult(f"Unknown command: {parts[0]}\n\n{build_partner_help_text()}")
def _new(self, msg: InboundMessage) -> PartnerCommandResult:
archived = self.store.archive(msg.session_key)
@@ -110,10 +108,10 @@ class PartnerCommandHandler:
def _status(self, msg: InboundMessage) -> PartnerCommandResult:
selection = getattr(self.config, "llm_selection", None) or {}
model = (
- selection.get("model_id")
- if isinstance(selection, dict)
- else None
- ) or getattr(self.config, "model", None) or "default"
+ (selection.get("model_id") if isinstance(selection, dict) else None)
+ or getattr(self.config, "model", None)
+ or "default"
+ )
tools = self._current_tools()
messages = self.store.messages(msg.session_key, limit=10_000)
lines = [
@@ -139,9 +137,7 @@ class PartnerCommandHandler:
visible = [line for line in visible if line]
if not visible:
return PartnerCommandResult("No conversation history yet.")
- return PartnerCommandResult(
- f"Last {len(visible)} message(s):\n" + "\n".join(visible)
- )
+ return PartnerCommandResult(f"Last {len(visible)} message(s):\n" + "\n".join(visible))
def _tool(self, args: list[str]) -> PartnerCommandResult:
available = default_optional_tools()
diff --git a/deeptutor/services/partners/manager.py b/deeptutor/services/partners/manager.py
index 4b7447bba..444b8b6bd 100644
--- a/deeptutor/services/partners/manager.py
+++ b/deeptutor/services/partners/manager.py
@@ -657,6 +657,7 @@ class PartnerManager:
content: str,
chat_id: str = "web",
session_id: str | None = None,
+ media: list[str] | None = None,
on_event: Callable[[Any], Awaitable[None]] | None = None,
) -> str:
"""Send a web message to a running partner and return the reply."""
@@ -672,6 +673,7 @@ class PartnerManager:
sender_id="web",
chat_id=session_id or chat_id,
content=content,
+ media=media or [],
session_key_override=session_key,
)
return await instance.runner.process_message(msg, on_event=on_event)
@@ -786,9 +788,14 @@ class PartnerManager:
self._seed_default_souls()
try:
data = yaml.safe_load(path.read_text(encoding="utf-8"))
- return data if isinstance(data, list) else []
+ souls = data if isinstance(data, list) else []
except Exception:
return []
+ refreshed = _refresh_stale_default_souls(souls)
+ if refreshed is not None:
+ self._save_souls(refreshed)
+ return refreshed
+ return souls
def _save_souls(self, souls: list[dict[str, str]]) -> None:
self._partners_dir.mkdir(parents=True, exist_ok=True)
@@ -798,63 +805,7 @@ class PartnerManager:
)
def _seed_default_souls(self) -> None:
- defaults = [
- {
- "id": "companion",
- "name": "Learning Companion",
- "content": (
- "# Soul\n\nI am a personal learning companion.\n\n"
- "## Personality\n\n- Helpful and friendly\n- Clear, encouraging, and patient\n"
- "- Adapts explanations to the user's level\n\n"
- "## Values\n\n- Accuracy over speed\n- User privacy and safety\n- Transparency in actions"
- ),
- },
- {
- "id": "math-tutor",
- "name": "Math Tutor",
- "content": (
- "# Soul\n\nI am a math tutor specializing in clear, step-by-step problem solving.\n\n"
- "## Personality\n\n- Patient and methodical\n- Encourages showing work\n"
- "- Celebrates progress on hard problems\n\n"
- "## Teaching Style\n\n- Break complex problems into small steps\n"
- "- Use visual representations when possible\n- Always verify final answers"
- ),
- },
- {
- "id": "coding-assistant",
- "name": "Coding Assistant",
- "content": (
- "# Soul\n\nI am a coding assistant focused on helping developers write better software.\n\n"
- "## Personality\n\n- Precise and detail-oriented\n"
- "- Pragmatic — working code over perfect code\n- Explains trade-offs clearly\n\n"
- "## Approach\n\n- Read before writing; understand context first\n"
- "- Suggest tests alongside implementations\n- Prefer standard patterns over clever tricks"
- ),
- },
- {
- "id": "research-helper",
- "name": "Research Helper",
- "content": (
- "# Soul\n\nI am a research assistant helping users explore academic topics in depth.\n\n"
- "## Personality\n\n- Curious and thorough\n"
- "- Balanced — presents multiple perspectives\n- Cites sources when possible\n\n"
- "## Approach\n\n- Decompose broad questions into focused sub-questions\n"
- "- Distinguish established facts from open questions\n- Suggest further reading"
- ),
- },
- {
- "id": "language-tutor",
- "name": "Language Tutor",
- "content": (
- "# Soul\n\nI am a language learning companion helping users practice and improve.\n\n"
- "## Personality\n\n- Encouraging and patient\n"
- "- Adapts difficulty to learner level\n- Makes learning fun with examples\n\n"
- "## Teaching Style\n\n- Correct mistakes gently with explanations\n"
- "- Use contextual examples over abstract rules\n- Encourage speaking/writing practice"
- ),
- },
- ]
- self._save_souls(defaults)
+ self._save_souls([dict(entry) for entry in DEFAULT_SOUL_TEMPLATES])
def list_souls(self) -> list[dict[str, str]]:
return self._load_souls()
@@ -895,6 +846,229 @@ class PartnerManager:
return True
+# ── Default soul templates ────────────────────────────────────────
+#
+# Seeded into a fresh library, and used to refresh untouched copies of the
+# old seeds (see ``_refresh_stale_default_souls``). Partners live in IM
+# channels, so every template bakes in a chat-sized voice.
+
+DEFAULT_SOUL_TEMPLATES: tuple[dict[str, str], ...] = (
+ {
+ "id": "companion",
+ "name": "Learning Companion",
+ "content": """# Soul
+
+I am a learning companion — a steady, curious presence that helps people
+actually understand things, not just collect answers.
+
+## Voice
+
+- Warm, direct, and concrete; no lecture-hall tone
+- Chat-sized messages: one idea at a time, short paragraphs
+- Plain words first, precise terms second — I define jargon the moment I use it
+
+## How I help
+
+- Start from what you already know, then build exactly one step up
+- Prefer a worked example over an abstract explanation
+- Check understanding with one small question, never a quiz barrage
+- When I don't know, I say so and find out — accuracy beats fluency
+
+## Boundaries
+
+- On homework-style questions I guide before I reveal: hint, stronger hint, then the step
+- I keep your pace — encouragement, never condescension
+""",
+ },
+ {
+ "id": "math-tutor",
+ "name": "Math Tutor",
+ "content": """# Soul
+
+I am a math tutor. What I'm after is the moment it clicks — not the answer itself.
+
+## Voice
+
+- Calm and unhurried; math anxiety is real and I never feed it
+- Small steps, one per message, written to be read in a chat window
+- Notation when it sharpens the idea, words when they're clearer
+
+## Method
+
+- Diagnose first: where exactly does your reasoning break?
+- Socratic by default — a nudge, then a stronger hint, then the step itself
+- Always ask "why does this rule work", not just "apply this rule"
+- After we solve it, one quick variation to confirm it actually clicked
+
+## Habits
+
+- Estimate before computing; sanity-check after
+- A wrong answer is information, not failure — we find the good idea inside it
+""",
+ },
+ {
+ "id": "coding-assistant",
+ "name": "Coding Assistant",
+ "content": """# Soul
+
+I am a coding assistant — a pragmatic pair programmer living in your chat.
+
+## Voice
+
+- Precise and to the point: the snippet that matters, not a wall of code
+- Code speaks first, prose explains why
+- Honest about uncertainty and trade-offs — no hand-waving
+
+## Craft
+
+- Read before writing: respect the existing style and constraints
+- Smallest change that solves the problem; name the trade-off when there is one
+- Errors and edge cases are part of the answer, not an afterthought
+- Every fix ships with a way to verify it — a test, a command, an expected output
+
+## Boundaries
+
+- I don't guess APIs; when unsure I say so and show how to check
+""",
+ },
+ {
+ "id": "research-helper",
+ "name": "Research Helper",
+ "content": """# Soul
+
+I am a research helper. I turn vague questions into answerable ones, and
+answers into something you can actually trust.
+
+## Voice
+
+- Neutral and curious; I argue with evidence, not adjectives
+- Structured replies sized for chat: the claim, the evidence, what's still open
+
+## Method
+
+- Decompose broad questions into specific sub-questions before searching
+- Separate established findings, active debate, and speculation — and label which is which
+- Prefer primary sources; cite what I rely on so you can check it
+- Steelman the opposing reading before settling a question
+
+## Honesty
+
+- "The evidence is thin here" is a finding, not an apology
+- I flag my own uncertainty instead of smoothing it over
+""",
+ },
+ {
+ "id": "language-tutor",
+ "name": "Language Tutor",
+ "content": """# Soul
+
+I am a language tutor. You learn a language by using it — so this chat is
+the classroom.
+
+## Voice
+
+- Friendly and a little playful; mistakes are welcome here
+- I match your level: simple words for beginners, nuance as you grow
+
+## Method
+
+- Converse first, correct second: I respond to what you said, then gently fix how you said it
+- One correction at a time, with a one-line why
+- Phrases in context, never isolated word lists
+- I recycle yesterday's vocabulary into today's conversation
+
+## Habits
+
+- I celebrate attempts at structures we haven't covered yet
+- Ask me "how do I say X" and you get the natural phrasing, not the literal one
+""",
+ },
+)
+
+# Verbatim texts of retired seeds (including the TutorBot-era variants).
+# A library entry that still matches one of these — or that sits on a seed
+# id and still mentions TutorBot — is an untouched old seed: safe to swap
+# for the current template without losing any user writing.
+_TUTORBOT_SEED = (
+ "# Soul\n\nI am TutorBot, a personal learning companion.\n\n"
+ "## Personality\n\n- Helpful and friendly\n- Clear, encouraging, and patient\n"
+ "- Adapts explanations to the user's level\n\n"
+ "## Values\n\n- Accuracy over speed\n- User privacy and safety\n- Transparency in actions"
+)
+_SUPERSEDED_SOUL_CONTENTS = frozenset(
+ {
+ _TUTORBOT_SEED,
+ _TUTORBOT_SEED.replace("I am TutorBot,", "I am"),
+ (
+ "# Soul\n\nI am a math tutor specializing in clear, step-by-step problem solving.\n\n"
+ "## Personality\n\n- Patient and methodical\n- Encourages showing work\n"
+ "- Celebrates progress on hard problems\n\n"
+ "## Teaching Style\n\n- Break complex problems into small steps\n"
+ "- Use visual representations when possible\n- Always verify final answers"
+ ),
+ (
+ "# Soul\n\nI am a coding assistant focused on helping developers write better software.\n\n"
+ "## Personality\n\n- Precise and detail-oriented\n"
+ "- Pragmatic — working code over perfect code\n- Explains trade-offs clearly\n\n"
+ "## Approach\n\n- Read before writing; understand context first\n"
+ "- Suggest tests alongside implementations\n- Prefer standard patterns over clever tricks"
+ ),
+ (
+ "# Soul\n\nI am a research assistant helping users explore academic topics in depth.\n\n"
+ "## Personality\n\n- Curious and thorough\n"
+ "- Balanced — presents multiple perspectives\n- Cites sources when possible\n\n"
+ "## Approach\n\n- Decompose broad questions into focused sub-questions\n"
+ "- Distinguish established facts from open questions\n- Suggest further reading"
+ ),
+ (
+ "# Soul\n\nI am a language learning companion helping users practice and improve.\n\n"
+ "## Personality\n\n- Encouraging and patient\n"
+ "- Adapts difficulty to learner level\n- Makes learning fun with examples\n\n"
+ "## Teaching Style\n\n- Correct mistakes gently with explanations\n"
+ "- Use contextual examples over abstract rules\n- Encourage speaking/writing practice"
+ ),
+ }
+)
+# TutorBot-era libraries shipped the default under these ids.
+_LEGACY_SOUL_ID_ALIASES = {"default-tutorbot": "companion", "default": "companion"}
+
+
+def _is_stale_seed(entry: dict[str, str]) -> bool:
+ content = str(entry.get("content") or "")
+ return content.strip() in {c.strip() for c in _SUPERSEDED_SOUL_CONTENTS} or (
+ "tutorbot" in content.lower()
+ )
+
+
+def _refresh_stale_default_souls(
+ souls: list[dict[str, str]],
+) -> list[dict[str, str]] | None:
+ """Upgrade untouched old-seed entries in place; ``None`` if nothing changed.
+
+ Only entries on known seed ids (or their TutorBot-era aliases) are
+ touched, and only when their content is provably an old seed — user-
+ authored and user-edited souls pass through verbatim.
+ """
+ defaults = {e["id"]: e for e in DEFAULT_SOUL_TEMPLATES}
+ present_ids = {str(e.get("id") or "") for e in souls}
+ out: list[dict[str, str]] = []
+ changed = False
+ for entry in souls:
+ sid = str(entry.get("id") or "")
+ canonical = _LEGACY_SOUL_ID_ALIASES.get(sid, sid)
+ if canonical not in defaults or not _is_stale_seed(entry):
+ out.append(entry)
+ continue
+ changed = True
+ if canonical != sid and canonical in present_ids:
+ continue # canonical entry exists separately; drop the legacy alias
+ if any(str(e.get("id")) == canonical for e in out):
+ continue # a second alias already collapsed into this id
+ out.append(dict(defaults[canonical]))
+ present_ids.add(canonical)
+ return out if changed else None
+
+
_manager: PartnerManager | None = None
diff --git a/deeptutor/services/partners/runtime.py b/deeptutor/services/partners/runtime.py
index 3e5f76cb9..f4798a73c 100644
--- a/deeptutor/services/partners/runtime.py
+++ b/deeptutor/services/partners/runtime.py
@@ -22,8 +22,11 @@ from __future__ import annotations
import asyncio
import base64
+import hashlib
import json
import logging
+import mimetypes
+from pathlib import Path
from typing import Any, Awaitable, Callable
import uuid
@@ -43,6 +46,7 @@ logger = logging.getLogger(__name__)
EventCallback = Callable[[StreamEvent], Awaitable[None]]
_MAX_IMAGE_BYTES = 8 * 1024 * 1024
+_MAX_MEDIA_BYTES = 10 * 1024 * 1024
_TOOL_HINT_MAX_CHARS = 120
@@ -161,6 +165,7 @@ class PartnerRunner:
msg.content,
channel=msg.channel,
sender_id=msg.sender_id,
+ attachments=list((msg.metadata or {}).get("_attachment_records") or []),
)
if final:
self.store.append(session_key, "assistant", final, channel=msg.channel)
@@ -226,12 +231,8 @@ class PartnerRunner:
context = self._build_context(msg)
turn_id = str(context.metadata.get("turn_id") or "")
- send_progress = self._channel_delivery_flag(
- msg.channel, "send_progress", default=True
- )
- send_tool_hints = self._channel_delivery_flag(
- msg.channel, "send_tool_hints", default=True
- )
+ send_progress = self._channel_delivery_flag(msg.channel, "send_progress", default=True)
+ send_tool_hints = self._channel_delivery_flag(msg.channel, "send_tool_hints", default=True)
is_im = msg.channel != "web"
# Streaming requires send_progress: narration rounds stream live as
# they happen, so with progress muted we keep buffered delivery.
@@ -324,7 +325,12 @@ class PartnerRunner:
session_key = msg.session_key
turn_id = f"partner-{self.partner_id}-{uuid.uuid4().hex[:12]}"
history = self.store.conversation_history(session_key)
- attachments = self._attachments_from_media(msg.media)
+ attachments, attachment_records = self._attachments_from_media(msg.media)
+ source_manifest, source_index = self._source_manifest_from_records(
+ session_key,
+ fresh_records=attachment_records,
+ )
+ msg.metadata["_attachment_records"] = attachment_records
# Partner-scope context blocks (soul / skills / KBs) are assembled
# inside the partner scope so the same service locators the chat
@@ -362,6 +368,8 @@ class PartnerRunner:
channel_meta[key_text] = str(value)
if channel_meta:
metadata["channel_metadata"] = channel_meta
+ if source_index:
+ metadata["source_index"] = source_index
cron_job_id = str((msg.metadata or {}).get("_cron_job_id") or "").strip()
if cron_job_id:
metadata["cron_job_id"] = cron_job_id
@@ -380,6 +388,7 @@ class PartnerRunner:
language=self._language(),
persona_context=read_soul(self.partner_id).strip(),
skills_manifest=skills_manifest,
+ source_manifest=source_manifest,
metadata=metadata,
)
@@ -433,9 +442,7 @@ class PartnerRunner:
lang = str(getattr(self.config, "language", "") or "").strip().lower()
return "zh" if lang.startswith("zh") else "en"
- def _channel_delivery_flag(
- self, channel_name: str, name: str, *, default: bool
- ) -> bool:
+ def _channel_delivery_flag(self, channel_name: str, name: str, *, default: bool) -> bool:
channels = getattr(self.config, "channels", None) or {}
if not isinstance(channels, dict):
return default
@@ -448,30 +455,167 @@ class PartnerRunner:
value = section.get(camel)
return value if isinstance(value, bool) else default
- def _attachments_from_media(self, media: list[str]) -> list[Attachment]:
+ @staticmethod
+ def _attachment_id_for_path(path: Path) -> str:
+ try:
+ seed = str(path.resolve())
+ except OSError:
+ seed = str(path)
+ return hashlib.sha1(seed.encode("utf-8"), usedforsecurity=False).hexdigest()[:12]
+
+ def _attachments_from_media(self, media: list[str]) -> tuple[list[Attachment], list[dict]]:
attachments: list[Attachment] = []
+ records: list[dict[str, Any]] = []
+ document_records: list[dict[str, Any]] = []
for raw_path in media or []:
try:
- from pathlib import Path
-
path = Path(raw_path)
- if not path.is_file() or path.stat().st_size > _MAX_IMAGE_BYTES:
+ if not path.is_file():
+ continue
+ size = path.stat().st_size
+ if size > _MAX_MEDIA_BYTES:
continue
data = path.read_bytes()
+ attachment_id = self._attachment_id_for_path(path)
+ mime_type = mimetypes.guess_type(path.name)[0] or ""
mime = detect_image_mime(data)
- if not mime:
- continue
- attachments.append(
- Attachment(
- type="image",
- base64=base64.b64encode(data).decode("ascii"),
- filename=path.name,
- mime_type=mime,
+ if mime and size <= _MAX_IMAGE_BYTES:
+ encoded = base64.b64encode(data).decode("ascii")
+ attachments.append(
+ Attachment(
+ type="image",
+ base64=encoded,
+ filename=path.name,
+ mime_type=mime,
+ id=attachment_id,
+ )
)
+ records.append(
+ {
+ "id": attachment_id,
+ "type": "image",
+ "filename": path.name,
+ "mime_type": mime,
+ "path": str(path),
+ "size": size,
+ }
+ )
+ continue
+
+ document_records.append(
+ {
+ "id": attachment_id,
+ "type": "pdf" if path.suffix.lower() == ".pdf" else "file",
+ "filename": path.name,
+ "mime_type": mime_type,
+ "base64": base64.b64encode(data).decode("ascii"),
+ "path": str(path),
+ "size": size,
+ }
)
except OSError:
logger.warning("Skipping unreadable media file: %s", raw_path, exc_info=True)
- return attachments
+
+ if document_records:
+ try:
+ from deeptutor.utils.document_extractor import extract_documents_from_records
+
+ _document_texts, updated_records = extract_documents_from_records(document_records)
+ except Exception:
+ logger.warning(
+ "Failed to extract partner media documents for %s",
+ self.partner_id,
+ exc_info=True,
+ )
+ updated_records = [
+ {**record, "base64": "", "extracted_chars": 0} for record in document_records
+ ]
+
+ for record in updated_records:
+ cleaned = {k: v for k, v in record.items() if k != "base64"}
+ records.append(cleaned)
+ if str(cleaned.get("extracted_text", "") or "").strip():
+ attachments.append(
+ Attachment(
+ type=str(cleaned.get("type") or "file"),
+ filename=str(cleaned.get("filename") or ""),
+ mime_type=str(cleaned.get("mime_type") or ""),
+ id=str(cleaned.get("id") or ""),
+ extracted_text=str(cleaned.get("extracted_text") or ""),
+ )
+ )
+
+ return attachments, records
+
+ def _source_manifest_from_records(
+ self,
+ session_key: str,
+ *,
+ fresh_records: list[dict[str, Any]],
+ ) -> tuple[str, dict[str, str]]:
+ try:
+ from deeptutor.services.session.source_inventory import (
+ SourceEntry,
+ SourceInventory,
+ render_manifest,
+ )
+ except Exception:
+ logger.warning("Failed to import source inventory helpers", exc_info=True)
+ return "", {}
+
+ inv = SourceInventory()
+ turn_ordinal = 1
+ historical_messages = self.store.messages(session_key, limit=200)
+ for message in historical_messages:
+ if message.get("role") == "user":
+ turn_ordinal += 1
+ for record in message.get("attachments") or []:
+ self._add_attachment_source(
+ inv,
+ record,
+ fresh=False,
+ first_seen_turn=turn_ordinal - 1,
+ source_entry_cls=SourceEntry,
+ )
+
+ for record in fresh_records:
+ self._add_attachment_source(
+ inv,
+ record,
+ fresh=True,
+ first_seen_turn=turn_ordinal,
+ source_entry_cls=SourceEntry,
+ )
+ return render_manifest(inv)
+
+ @staticmethod
+ def _add_attachment_source(
+ inv: Any,
+ record: dict[str, Any],
+ *,
+ fresh: bool,
+ first_seen_turn: int,
+ source_entry_cls: Any,
+ ) -> None:
+ if str(record.get("type", "")).lower() == "image":
+ return
+ mime = str(record.get("mime_type", "") or "").lower()
+ if mime.startswith("image/"):
+ return
+ text = str(record.get("extracted_text", "") or "")
+ attachment_id = str(record.get("id", "") or "").strip()
+ if not text.strip() or not attachment_id:
+ return
+ inv.add(
+ source_entry_cls(
+ sid=f"at-{attachment_id}",
+ kind="attachment",
+ name=str(record.get("filename") or "Untitled file"),
+ full_text=text,
+ fresh=fresh,
+ first_seen_turn=first_seen_turn,
+ )
+ )
async def _publish_hint(self, msg: InboundMessage, text: str, *, tool_hint: bool) -> None:
await self.bus.publish_outbound(
diff --git a/deeptutor/services/partners/sessions.py b/deeptutor/services/partners/sessions.py
index fece0d9a1..0188d7378 100644
--- a/deeptutor/services/partners/sessions.py
+++ b/deeptutor/services/partners/sessions.py
@@ -51,8 +51,9 @@ class PartnerSessionStore:
channel: str = "",
sender_id: str = "",
metadata: dict[str, Any] | None = None,
+ attachments: list[dict[str, Any]] | None = None,
) -> None:
- record = {
+ record: dict[str, Any] = {
"role": role,
"content": content,
"timestamp": datetime.now().isoformat(),
@@ -63,6 +64,8 @@ class PartnerSessionStore:
record["sender_id"] = sender_id
if metadata:
record["metadata"] = metadata
+ if attachments:
+ record["attachments"] = attachments
line = json.dumps(record, ensure_ascii=False)
with self._write_lock:
with open(self._path(session_key), "a", encoding="utf-8") as f:
diff --git a/deeptutor/services/partners/workspace.py b/deeptutor/services/partners/workspace.py
index 0126b658e..3191e8d36 100644
--- a/deeptutor/services/partners/workspace.py
+++ b/deeptutor/services/partners/workspace.py
@@ -304,12 +304,12 @@ def list_assets(partner_id: str) -> dict[str, list[dict[str, Any]]]:
if index_path.exists():
try:
data = json.loads(index_path.read_text(encoding="utf-8"))
- for entry in data.get("notebooks", []) or []:
+ for nb_entry in data.get("notebooks", []) or []:
notebooks.append(
{
- "id": str(entry.get("id", "")),
- "name": str(entry.get("name", "")),
- "record_count": entry.get("record_count", 0),
+ "id": str(nb_entry.get("id", "")),
+ "name": str(nb_entry.get("name", "")),
+ "record_count": nb_entry.get("record_count", 0),
}
)
except (OSError, json.JSONDecodeError):
diff --git a/deeptutor/services/sandbox/backends.py b/deeptutor/services/sandbox/backends.py
index 3993d9f3a..268a441b8 100644
--- a/deeptutor/services/sandbox/backends.py
+++ b/deeptutor/services/sandbox/backends.py
@@ -125,7 +125,7 @@ class BwrapBackend(SandboxBackend):
"--dev",
"/dev",
"--tmpfs",
- "/tmp",
+ "/tmp", # nosec B108 — path inside the bwrap mount namespace, not the host
]
for system_dir in self._RO_SYSTEM_DIRS:
if Path(system_dir).exists():
diff --git a/deeptutor/services/sandbox/runner/server.py b/deeptutor/services/sandbox/runner/server.py
index af1ca21ad..0dfc83f3e 100644
--- a/deeptutor/services/sandbox/runner/server.py
+++ b/deeptutor/services/sandbox/runner/server.py
@@ -214,7 +214,7 @@ def execute(payload: dict[str, Any]) -> dict[str, Any]:
try:
completed = subprocess.run( # noqa: S602 - shell=True is the contract
command,
- shell=True,
+ shell=True, # nosec B602 — the runner exists to execute shell commands in-sandbox
cwd=workdir,
env=env,
timeout=timeout_s,
diff --git a/deeptutor/tools/cron_tool.py b/deeptutor/tools/cron_tool.py
index eeb7c7b07..6f8654452 100644
--- a/deeptutor/tools/cron_tool.py
+++ b/deeptutor/tools/cron_tool.py
@@ -70,9 +70,7 @@ def _build_schedule(kwargs: dict[str, Any]) -> CronSchedule:
return CronSchedule(kind="at", at_ms=_parse_at(at_raw))
if every_raw is not None:
return CronSchedule(kind="every", every_seconds=int(every_raw))
- return CronSchedule(
- kind="cron", expr=expr, tz=str(kwargs.get("tz") or "").strip() or None
- )
+ return CronSchedule(kind="cron", expr=expr, tz=str(kwargs.get("tz") or "").strip() or None)
def run_cron_action(kwargs: dict[str, Any]) -> CronActionOutcome:
@@ -95,9 +93,7 @@ def run_cron_action(kwargs: dict[str, Any]) -> CronActionOutcome:
if not jobs:
return CronActionOutcome(ok=True, text="No scheduled tasks for this conversation.")
lines = [f"{len(jobs)} scheduled task(s):"] + [_render_job(job) for job in jobs]
- return CronActionOutcome(
- ok=True, text="\n".join(lines), meta={"count": len(jobs)}
- )
+ return CronActionOutcome(ok=True, text="\n".join(lines), meta={"count": len(jobs)})
if action == "cancel":
job_id = str(kwargs.get("job_id") or "").strip()
@@ -105,9 +101,7 @@ def run_cron_action(kwargs: dict[str, Any]) -> CronActionOutcome:
return CronActionOutcome(ok=False, text="cancel needs a job_id (see action='list').")
if service.cancel_job(job_id, owner_key=owner.key):
return CronActionOutcome(ok=True, text=f"Task `{job_id}` cancelled.")
- return CronActionOutcome(
- ok=False, text=f"No task `{job_id}` found for this conversation."
- )
+ return CronActionOutcome(ok=False, text=f"No task `{job_id}` found for this conversation.")
if action == "schedule":
if bool(kwargs.get("_cron_in_context")):
@@ -128,9 +122,7 @@ def run_cron_action(kwargs: dict[str, Any]) -> CronActionOutcome:
message=message,
schedule=schedule,
owner=owner,
- delete_after_run=(
- bool(delete_after_run) if delete_after_run is not None else None
- ),
+ delete_after_run=(bool(delete_after_run) if delete_after_run is not None else None),
)
except (ValueError, TypeError) as exc:
return CronActionOutcome(ok=False, text=f"Could not schedule: {exc}")
diff --git a/pyproject.toml b/pyproject.toml
index 476f7fc66..056fbb97a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -110,6 +110,7 @@ partners = [
"deeptutor[server]",
"mcp>=1.26.0,<2.0.0",
"python-telegram-bot[socks]>=22.6,<23.0",
+ "wecom-aibot-sdk>=1.0.8,<2.0.0",
"lark-oapi>=1.5.0,<2.0.0",
"dingtalk-stream>=0.24.0,<1.0.0",
"slack-sdk>=3.39.0,<4.0.0",
diff --git a/requirements/partners.txt b/requirements/partners.txt
index 3abfe69de..38bff910f 100644
--- a/requirements/partners.txt
+++ b/requirements/partners.txt
@@ -17,6 +17,8 @@ mcp>=1.26.0,<2.0.0
# --- Channel SDKs ---
python-telegram-bot[socks]>=22.6,<23.0
+# wecom (WeCom AI Bot WebSocket client)
+wecom-aibot-sdk>=1.0.8,<2.0.0
lark-oapi>=1.5.0,<2.0.0
dingtalk-stream>=0.24.0,<1.0.0
slack-sdk>=3.39.0,<4.0.0
diff --git a/site/README.md b/site/README.md
index 1b7f5c3d7..c7ea34b2b 100644
--- a/site/README.md
+++ b/site/README.md
@@ -1,49 +1,88 @@
-# Starlight Starter Kit: Basics
+# DeepTutor Website
-[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)
+This directory contains the public DeepTutor website and documentation at `deeptutor.info`.
+## Stack
+
+- Astro + Starlight for docs
+- English source locale at `/docs/`
+- Simplified Chinese mirror at `/zh-cn/docs/`
+- Custom landing pages at `/` and `/zh-cn/`
+- Static screenshots in `public/screenshots/`
+- Cloudflare Pages helpers in `functions/`
+
+## Local Development
+
+```bash
+cd site
+npm install
+npm run dev
```
-npm create astro@latest -- --template starlight
+
+Build the static site:
+
+```bash
+npm run build
```
-> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
+Preview the built output:
-## 🚀 Project Structure
+```bash
+npm run preview
+```
-Inside of your Astro + Starlight project, you'll see the following folders and files:
+## Documentation Layout
+```text
+src/content/docs/docs/ # English docs, route prefix /docs/
+src/content/docs/zh-cn/docs/ # Chinese docs, route prefix /zh-cn/docs/
+astro.config.mjs # Starlight config, sidebar, i18n
+src/pages/index.astro # English landing page
+src/pages/zh-cn/index.astro # Chinese landing page
+public/screenshots/ # Docs and landing screenshots
```
-.
-├── public/
-├── src/
-│ ├── assets/
-│ ├── content/
-│ │ └── docs/
-│ └── content.config.ts
-├── astro.config.mjs
-├── package.json
-└── tsconfig.json
+
+When adding a docs page, add both locale files in the same relative path. Example:
+
+```text
+src/content/docs/docs/partners/channels.md
+src/content/docs/zh-cn/docs/partners/channels.md
```
-Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.
+Then add a sidebar item in `astro.config.mjs` with a Chinese translation label.
+
+## Current Docs Map
-Images can be added to `src/assets/` and embedded in Markdown with a relative link.
+- `docs/get-started/` — install paths, providers, Docker, multi-user, troubleshooting
+- `docs/explore/` — Chat, Partners, Co-Writer, Book, Knowledge, Space, Memory, Settings
+- `docs/partners/` — Partner architecture and channel configuration
+- `docs/cli/` — CLI, command reference, agent handoff, server API
-Static assets, like favicons, can be placed in the `public/` directory.
+Legacy `docs/tutorbot/` pages are retained as migration notices so old links do not hard 404. Product-facing docs should point to `docs/partners/`.
-## 🧞 Commands
+## Screenshot Policy
-All commands are run from the root of the project, from a terminal:
+Prefer screenshots synced from the main repository's canonical assets in `assets/figs/`, or freshly captured from a running local DeepTutor UI. Keep docs references under `/screenshots/...` and verify the files exist before building.
-| Command | Action |
-| :------------------------ | :----------------------------------------------- |
-| `npm install` | Installs dependencies |
-| `npm run dev` | Starts local dev server at `localhost:4321` |
-| `npm run build` | Build your production site to `./dist/` |
-| `npm run preview` | Preview your build locally, before deploying |
-| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
-| `npm run astro -- --help` | Get help using the Astro CLI |
+## Checks
-## 👀 Want to learn more?
+Before publishing, run:
+
+```bash
+npm run build
+```
+
+Useful extra checks from the repository root:
+
+```bash
+python - <<'PY'
+from pathlib import Path
+root = Path('site/src/content/docs')
+en = {p.relative_to(root / 'docs').as_posix() for p in (root / 'docs').rglob('*.md')}
+zh = {p.relative_to(root / 'zh-cn/docs').as_posix() for p in (root / 'zh-cn/docs').rglob('*.md')}
+print('only_en', sorted(en - zh))
+print('only_zh', sorted(zh - en))
+PY
+```
-Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).
+Both lists should be empty; otherwise language switching can fall back to the wrong locale.
diff --git a/site/astro.config.mjs b/site/astro.config.mjs
index 3f379283d..d9651b59f 100644
--- a/site/astro.config.mjs
+++ b/site/astro.config.mjs
@@ -120,6 +120,11 @@ export default defineConfig({
translations: { [zh]: "聊天工作台" },
slug: "docs/explore/chat-workspace",
},
+ {
+ label: "Partners",
+ translations: { [zh]: "伙伴" },
+ slug: "docs/explore/partners",
+ },
{
label: "Co-Writer",
translations: { [zh]: "Co-Writer 协同写作" },
@@ -153,42 +158,89 @@ export default defineConfig({
],
},
{
- label: "Explore TutorBot",
- translations: { [zh]: "TutorBot 渠道" },
+ label: "Partners & Channels",
+ translations: { [zh]: "伙伴与渠道" },
items: [
{
label: "Overview",
translations: { [zh]: "概览" },
- slug: "docs/tutorbot",
+ slug: "docs/partners",
},
- { label: "Telegram", slug: "docs/tutorbot/telegram" },
- { label: "Discord", slug: "docs/tutorbot/discord" },
- { label: "Slack", slug: "docs/tutorbot/slack" },
- { label: "Matrix", slug: "docs/tutorbot/matrix" },
- { label: "Zulip", slug: "docs/tutorbot/zulip" },
{
- label: "Feishu / Lark",
- translations: { [zh]: "飞书 / Lark" },
- slug: "docs/tutorbot/feishu",
+ label: "Channel Matrix",
+ translations: { [zh]: "渠道矩阵" },
+ slug: "docs/partners/channels",
+ },
+ {
+ label: "WeChat",
+ translations: { [zh]: "个人微信" },
+ slug: "docs/partners/weixin",
},
{
label: "WeCom",
translations: { [zh]: "企业微信" },
- slug: "docs/tutorbot/wecom",
+ slug: "docs/partners/wecom",
+ },
+ {
+ label: "QQ / NapCat",
+ translations: { [zh]: "QQ / NapCat" },
+ slug: "docs/partners/qq",
+ },
+ {
+ label: "Telegram",
+ translations: { [zh]: "Telegram" },
+ slug: "docs/partners/telegram",
+ },
+ {
+ label: "Discord",
+ translations: { [zh]: "Discord" },
+ slug: "docs/partners/discord",
+ },
+ {
+ label: "Slack",
+ translations: { [zh]: "Slack" },
+ slug: "docs/partners/slack",
+ },
+ {
+ label: "Feishu / Lark",
+ translations: { [zh]: "飞书 / Lark" },
+ slug: "docs/partners/feishu",
},
{
label: "DingTalk",
translations: { [zh]: "钉钉" },
- slug: "docs/tutorbot/dingtalk",
+ slug: "docs/partners/dingtalk",
+ },
+ {
+ label: "Matrix",
+ translations: { [zh]: "Matrix" },
+ slug: "docs/partners/matrix",
+ },
+ {
+ label: "Zulip",
+ translations: { [zh]: "Zulip" },
+ slug: "docs/partners/zulip",
+ },
+ {
+ label: "WhatsApp",
+ translations: { [zh]: "WhatsApp" },
+ slug: "docs/partners/whatsapp",
},
- { label: "QQ", slug: "docs/tutorbot/qq" },
- { label: "WhatsApp", slug: "docs/tutorbot/whatsapp" },
{
label: "Email",
- translations: { [zh]: "电子邮件" },
- slug: "docs/tutorbot/email",
+ translations: { [zh]: "邮件" },
+ slug: "docs/partners/email",
+ },
+ {
+ label: "Mochat",
+ translations: { [zh]: "Mochat" },
+ slug: "docs/partners/mochat",
+ },
+ {
+ label: "Microsoft Teams",
+ translations: { [zh]: "Microsoft Teams" },
+ slug: "docs/partners/msteams",
},
- { label: "Mochat", slug: "docs/tutorbot/mochat" },
],
},
{
diff --git a/site/package-lock.json b/site/package-lock.json
index 4f92cf972..c8978d91f 100644
--- a/site/package-lock.json
+++ b/site/package-lock.json
@@ -13,7 +13,8 @@
"sharp": "^0.34.5"
},
"devDependencies": {
- "i18n-iso-countries": "^7.14.0"
+ "i18n-iso-countries": "^7.14.0",
+ "wrangler": "^4.100.0"
}
},
"node_modules/@astrojs/compiler": {
@@ -251,6 +252,130 @@
"node": ">= 20.12.0"
}
},
+ "node_modules/@cloudflare/kv-asset-handler": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.5.0.tgz",
+ "integrity": "sha512-jxQYkj8dSIzc0cD6cMMNdOc1UVjqSqu8BZdor5s8cGjW2I8BjODt/kWPVdY+u9zj3ms75Q5qaZgnxUad83+eAg==",
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "engines": {
+ "node": ">=22.0.0"
+ }
+ },
+ "node_modules/@cloudflare/unenv-preset": {
+ "version": "2.16.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.16.1.tgz",
+ "integrity": "sha512-ECxObrMfyTl5bhQf/lZCXwo5G6xX9IAUo+nDMKK4SZ8m4Jvvxp52vilxyySSWh2YTZz8+HQ07qGH/2rEom1vDw==",
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "peerDependencies": {
+ "unenv": "2.0.0-rc.24",
+ "workerd": ">1.20260305.0 <2.0.0-0"
+ },
+ "peerDependenciesMeta": {
+ "workerd": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@cloudflare/workerd-darwin-64": {
+ "version": "1.20260611.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260611.1.tgz",
+ "integrity": "sha512-iJICldmi4sBGgi7IrQles8cStOGXM/Tmv95C4OODVs6VIbMsJPqThUM5h3uYVQNULuJ8I/aVvnJ3Eh/wZCKwuA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workerd-darwin-arm64": {
+ "version": "1.20260611.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20260611.1.tgz",
+ "integrity": "sha512-yBbVXvbZyltR3I7NJdC4C4ItkItjZSiabcA/3HzEWOUQjLVKFqRh4so6ToHr70VCYh8VGeR8EDZL23igLhXqFQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workerd-linux-64": {
+ "version": "1.20260611.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20260611.1.tgz",
+ "integrity": "sha512-PfNjpxOlaIgZFYuhD7+neEEewCN2Ud993wEEN0fmbtSOax1AK53LGqmXUDvFhnbkHxJLFAxYCSNISW8QbzaAIg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workerd-linux-arm64": {
+ "version": "1.20260611.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20260611.1.tgz",
+ "integrity": "sha512-GEp4XbuIKjlF8pakqXcUDJfKiJosD/Q7S83J0d+r+z9XIlYGfF3ntm08e2aiF5TFTwp3fnG4yMoPUAKNhNJpvQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workerd-windows-64": {
+ "version": "1.20260611.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20260611.1.tgz",
+ "integrity": "sha512-S6JkS0kEbcCKs19RGqEPhjCRbP8GBkQwqYLp2fhBJtD/KTlwqLzOJ9E6PQ7gQKgWHtxy1NBG3oXarlNFRNU/dw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cspotcode/source-map-support": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
+ "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/trace-mapping": "0.3.9"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
"node_modules/@ctrl/tinycolor": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-4.2.0.tgz",
@@ -1196,12 +1321,33 @@
"url": "https://opencollective.com/libvips"
}
},
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
"node_modules/@jridgewell/sourcemap-codec": {
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
"integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
"license": "MIT"
},
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.9",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
+ "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.0.3",
+ "@jridgewell/sourcemap-codec": "^1.4.10"
+ }
+ },
"node_modules/@mdx-js/mdx": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.1.1.tgz",
@@ -1342,6 +1488,35 @@
"win32"
]
},
+ "node_modules/@poppinss/colors": {
+ "version": "4.1.6",
+ "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.6.tgz",
+ "integrity": "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "kleur": "^4.1.5"
+ }
+ },
+ "node_modules/@poppinss/dumper": {
+ "version": "0.6.5",
+ "resolved": "https://registry.npmjs.org/@poppinss/dumper/-/dumper-0.6.5.tgz",
+ "integrity": "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@poppinss/colors": "^4.1.5",
+ "@sindresorhus/is": "^7.0.2",
+ "supports-color": "^10.0.0"
+ }
+ },
+ "node_modules/@poppinss/exception": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.3.tgz",
+ "integrity": "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/@rollup/pluginutils": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.3.0.tgz",
@@ -1795,6 +1970,26 @@
"integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==",
"license": "MIT"
},
+ "node_modules/@sindresorhus/is": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.2.0.tgz",
+ "integrity": "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/is?sponsor=1"
+ }
+ },
+ "node_modules/@speed-highlight/core": {
+ "version": "1.2.16",
+ "resolved": "https://registry.npmjs.org/@speed-highlight/core/-/core-1.2.16.tgz",
+ "integrity": "sha512-yNm/fYEcnpRjYduLMaddTK9XKYil6xB88+qFg79ZdZhHu1PadfoQmFW7pVTx7FZqMBNcUuThiAhxhENgtAO2/w==",
+ "dev": true,
+ "license": "CC0-1.0"
+ },
"node_modules/@types/debug": {
"version": "4.1.13",
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz",
@@ -2114,6 +2309,13 @@
"url": "https://github.com/sponsors/wooorm"
}
},
+ "node_modules/blake3-wasm": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz",
+ "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/boolbase": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
@@ -2573,6 +2775,16 @@
"url": "https://github.com/fb55/entities?sponsor=1"
}
},
+ "node_modules/error-stack-parser-es": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/error-stack-parser-es/-/error-stack-parser-es-1.0.5.tgz",
+ "integrity": "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
+ }
+ },
"node_modules/es-module-lexer": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.1.0.tgz",
@@ -3492,6 +3704,16 @@
"integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==",
"license": "MIT"
},
+ "node_modules/kleur": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",
+ "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/klona": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz",
@@ -4627,6 +4849,27 @@
],
"license": "MIT"
},
+ "node_modules/miniflare": {
+ "version": "4.20260611.0",
+ "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20260611.0.tgz",
+ "integrity": "sha512-i+JwEo8vN96naz1WL3ntFgFyRluBDYL408zwhHKvR2jefJ464KsZ/gCmJAQ5k+oaWeb5Ug+s7yne5AyiAEswjg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@cspotcode/source-map-support": "0.8.1",
+ "sharp": "0.34.5",
+ "undici": "7.24.8",
+ "workerd": "1.20260611.1",
+ "ws": "8.20.1",
+ "youch": "4.1.0-beta.10"
+ },
+ "bin": {
+ "miniflare": "bootstrap.js"
+ },
+ "engines": {
+ "node": ">=22.0.0"
+ }
+ },
"node_modules/mrmime": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz",
@@ -4881,6 +5124,20 @@
"url": "https://github.com/inikulin/parse5?sponsor=1"
}
},
+ "node_modules/path-to-regexp": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz",
+ "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/pathe": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
+ "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/piccolore": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/piccolore/-/piccolore-0.1.3.tgz",
@@ -5617,6 +5874,19 @@
"inline-style-parser": "0.2.7"
}
},
+ "node_modules/supports-color": {
+ "version": "10.2.2",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz",
+ "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/supports-color?sponsor=1"
+ }
+ },
"node_modules/svgo": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/svgo/-/svgo-4.0.1.tgz",
@@ -5727,12 +5997,32 @@
"integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==",
"license": "MIT"
},
+ "node_modules/undici": {
+ "version": "7.24.8",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-7.24.8.tgz",
+ "integrity": "sha512-6KQ/+QxK49Z/p3HO6E5ZCZWNnCasyZLa5ExaVYyvPxUwKtbCPMKELJOqh7EqOle0t9cH/7d2TaaTRRa6Nhs4YQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.18.1"
+ }
+ },
"node_modules/undici-types": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
"integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
"license": "MIT"
},
+ "node_modules/unenv": {
+ "version": "2.0.0-rc.24",
+ "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.24.tgz",
+ "integrity": "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "pathe": "^2.0.3"
+ }
+ },
"node_modules/unified": {
"version": "11.0.5",
"resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz",
@@ -6155,31 +6445,619 @@
"node": ">=4"
}
},
- "node_modules/xxhash-wasm": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/xxhash-wasm/-/xxhash-wasm-1.1.0.tgz",
- "integrity": "sha512-147y/6YNh+tlp6nd/2pWq38i9h6mz/EuQ6njIrmW8D1BS5nCqs0P6DG+m6zTGnNz5I+uhZ0SHxBs9BsPrwcKDA==",
- "license": "MIT"
+ "node_modules/workerd": {
+ "version": "1.20260611.1",
+ "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20260611.1.tgz",
+ "integrity": "sha512-CS/640T7pIJ2HYX6x2DwKFGbcSckAWN3tgcdq+ptB6SaqjWUhlzIgA/YhPuwIU+/NnMnGpqOFX/hC18Oyge63w==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "workerd": "bin/workerd"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "optionalDependencies": {
+ "@cloudflare/workerd-darwin-64": "1.20260611.1",
+ "@cloudflare/workerd-darwin-arm64": "1.20260611.1",
+ "@cloudflare/workerd-linux-64": "1.20260611.1",
+ "@cloudflare/workerd-linux-arm64": "1.20260611.1",
+ "@cloudflare/workerd-windows-64": "1.20260611.1"
+ }
},
- "node_modules/yargs-parser": {
- "version": "22.0.0",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz",
- "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==",
- "license": "ISC",
+ "node_modules/wrangler": {
+ "version": "4.100.0",
+ "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.100.0.tgz",
+ "integrity": "sha512-dSQO7DO+mD6XDzkVWIWBoGLO3yw+lacWSc/KhFvd7pgfpth+kX98qb5SGRHZN8ACCDhhfwzDLXwB6qHsIHhfBg==",
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "dependencies": {
+ "@cloudflare/kv-asset-handler": "0.5.0",
+ "@cloudflare/unenv-preset": "2.16.1",
+ "blake3-wasm": "2.1.5",
+ "esbuild": "0.27.3",
+ "miniflare": "4.20260611.0",
+ "path-to-regexp": "6.3.0",
+ "unenv": "2.0.0-rc.24",
+ "workerd": "1.20260611.1"
+ },
+ "bin": {
+ "cf-wrangler": "bin/cf-wrangler.js",
+ "wrangler": "bin/wrangler.js",
+ "wrangler2": "bin/wrangler.js"
+ },
"engines": {
- "node": "^20.19.0 || ^22.12.0 || >=23"
+ "node": ">=22.0.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "2.3.3"
+ },
+ "peerDependencies": {
+ "@cloudflare/workers-types": "^4.20260611.1"
+ },
+ "peerDependenciesMeta": {
+ "@cloudflare/workers-types": {
+ "optional": true
+ }
}
},
- "node_modules/yocto-queue": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.2.tgz",
- "integrity": "sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==",
+ "node_modules/wrangler/node_modules/@esbuild/aix-ppc64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz",
+ "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
"license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
"engines": {
- "node": ">=12.20"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/android-arm": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz",
+ "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/android-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz",
+ "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/android-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz",
+ "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/darwin-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz",
+ "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/darwin-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz",
+ "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz",
+ "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/freebsd-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz",
+ "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/linux-arm": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz",
+ "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/linux-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz",
+ "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/linux-ia32": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz",
+ "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/linux-loong64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz",
+ "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/linux-mips64el": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz",
+ "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/linux-ppc64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz",
+ "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/linux-riscv64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz",
+ "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/linux-s390x": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz",
+ "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/linux-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz",
+ "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz",
+ "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/netbsd-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz",
+ "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz",
+ "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/openbsd-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz",
+ "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz",
+ "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/sunos-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz",
+ "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/win32-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz",
+ "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/win32-ia32": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz",
+ "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/@esbuild/win32-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz",
+ "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/wrangler/node_modules/esbuild": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz",
+ "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.27.3",
+ "@esbuild/android-arm": "0.27.3",
+ "@esbuild/android-arm64": "0.27.3",
+ "@esbuild/android-x64": "0.27.3",
+ "@esbuild/darwin-arm64": "0.27.3",
+ "@esbuild/darwin-x64": "0.27.3",
+ "@esbuild/freebsd-arm64": "0.27.3",
+ "@esbuild/freebsd-x64": "0.27.3",
+ "@esbuild/linux-arm": "0.27.3",
+ "@esbuild/linux-arm64": "0.27.3",
+ "@esbuild/linux-ia32": "0.27.3",
+ "@esbuild/linux-loong64": "0.27.3",
+ "@esbuild/linux-mips64el": "0.27.3",
+ "@esbuild/linux-ppc64": "0.27.3",
+ "@esbuild/linux-riscv64": "0.27.3",
+ "@esbuild/linux-s390x": "0.27.3",
+ "@esbuild/linux-x64": "0.27.3",
+ "@esbuild/netbsd-arm64": "0.27.3",
+ "@esbuild/netbsd-x64": "0.27.3",
+ "@esbuild/openbsd-arm64": "0.27.3",
+ "@esbuild/openbsd-x64": "0.27.3",
+ "@esbuild/openharmony-arm64": "0.27.3",
+ "@esbuild/sunos-x64": "0.27.3",
+ "@esbuild/win32-arm64": "0.27.3",
+ "@esbuild/win32-ia32": "0.27.3",
+ "@esbuild/win32-x64": "0.27.3"
+ }
+ },
+ "node_modules/ws": {
+ "version": "8.20.1",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.1.tgz",
+ "integrity": "sha512-It4dO0K5v//JtTXuPkfEOaI3uUN87iYPnqo/ZzqCoG3g8uhA66QUMs/SrM0YK7/NAu+r4LMh/9dq2A7k+rHs+w==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/xxhash-wasm": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/xxhash-wasm/-/xxhash-wasm-1.1.0.tgz",
+ "integrity": "sha512-147y/6YNh+tlp6nd/2pWq38i9h6mz/EuQ6njIrmW8D1BS5nCqs0P6DG+m6zTGnNz5I+uhZ0SHxBs9BsPrwcKDA==",
+ "license": "MIT"
+ },
+ "node_modules/yargs-parser": {
+ "version": "22.0.0",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz",
+ "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==",
+ "license": "ISC",
+ "engines": {
+ "node": "^20.19.0 || ^22.12.0 || >=23"
+ }
+ },
+ "node_modules/yocto-queue": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.2.tgz",
+ "integrity": "sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/youch": {
+ "version": "4.1.0-beta.10",
+ "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz",
+ "integrity": "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@poppinss/colors": "^4.1.5",
+ "@poppinss/dumper": "^0.6.4",
+ "@speed-highlight/core": "^1.2.7",
+ "cookie": "^1.0.2",
+ "youch-core": "^0.3.3"
+ }
+ },
+ "node_modules/youch-core": {
+ "version": "0.3.3",
+ "resolved": "https://registry.npmjs.org/youch-core/-/youch-core-0.3.3.tgz",
+ "integrity": "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@poppinss/exception": "^1.2.2",
+ "error-stack-parser-es": "^1.0.5"
}
},
"node_modules/zod": {
diff --git a/site/package.json b/site/package.json
index 3b8969396..cc87ab191 100644
--- a/site/package.json
+++ b/site/package.json
@@ -7,6 +7,7 @@
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
+ "deploy": "astro build && wrangler deploy",
"build:pages": "astro build && cp -R functions dist/functions",
"deploy:pages": "npm run build:pages && npx wrangler pages deploy dist",
"astro": "astro"
@@ -17,6 +18,7 @@
"sharp": "^0.34.5"
},
"devDependencies": {
- "i18n-iso-countries": "^7.14.0"
+ "i18n-iso-countries": "^7.14.0",
+ "wrangler": "^4.100.0"
}
}
diff --git a/site/public/channel-icons/dingtalk.svg b/site/public/channel-icons/dingtalk.svg
new file mode 100644
index 000000000..063d85235
--- /dev/null
+++ b/site/public/channel-icons/dingtalk.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="#0089FF" d="M573.7 252.5C422.5 197.4 201.3 96.7 201.3 96.7c-15.7-4.1-17.9 11.1-17.9 11.1c-5 61.1 33.6 160.5 53.6 182.8c19.9 22.3 319.1 113.7 319.1 113.7S326 357.9 270.5 341.9c-55.6-16-37.9 17.8-37.9 17.8c11.4 61.7 64.9 131.8 107.2 138.4c42.2 6.6 220.1 4 220.1 4s-35.5 4.1-93.2 11.9c-42.7 5.8-97 12.5-111.1 17.8c-33.1 12.5 24 62.6 24 62.6c84.7 76.8 129.7 50.5 129.7 50.5c33.3-10.7 61.4-18.5 85.2-24.2L565 743.1h84.6L603 928l205.3-271.9H700.8l22.3-38.7c.3.5.4.8.4.8S799.8 496.1 829 433.8l.6-1h-.1c5-10.8 8.6-19.7 10-25.8c17-71.3-114.5-99.4-265.8-154.5"/></svg>
diff --git a/site/public/channel-icons/discord.svg b/site/public/channel-icons/discord.svg
new file mode 100644
index 000000000..36da1de2a
--- /dev/null
+++ b/site/public/channel-icons/discord.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#5865F2" d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg>
diff --git a/site/public/channel-icons/email.svg b/site/public/channel-icons/email.svg
new file mode 100644
index 000000000..4b76497a2
--- /dev/null
+++ b/site/public/channel-icons/email.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="#71717a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/></g></svg>
diff --git a/site/public/channel-icons/feishu.svg b/site/public/channel-icons/feishu.svg
new file mode 100644
index 000000000..a711df046
--- /dev/null
+++ b/site/public/channel-icons/feishu.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><g fill="none"><path stroke="#3370FF" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M17 29C21 29 25 26.9339 28 23.4065C36 14 41.4242 16.8166 44 17.9998C38.5 20.9998 40.5 29.6233 33 35.9998C28.382 39.9259 23.4945 41.014 19 41C12.5231 40.9799 6.86226 37.7637 4 35.4063V16.9998"/><path fill="#3370FF" d="M5.64808 15.8669C5.02231 14.9567 3.77715 14.7261 2.86694 15.3519C1.95673 15.9777 1.72615 17.2228 2.35192 18.1331L5.64808 15.8669ZM36.0021 35.7309C36.958 35.1774 37.2843 33.9539 36.7309 32.9979C36.1774 32.042 34.9539 31.7157 33.9979 32.2691L36.0021 35.7309ZM2.35192 18.1331C5.2435 22.339 10.7992 28.144 16.8865 32.2239C19.9345 34.2667 23.217 35.946 26.449 36.7324C29.6946 37.522 33.0451 37.4428 36.0021 35.7309L33.9979 32.2691C32.2049 33.3072 29.9929 33.478 27.3947 32.8458C24.783 32.2103 21.9405 30.7958 19.1135 28.9011C13.4508 25.106 8.2565 19.661 5.64808 15.8669L2.35192 18.1331Z"/><path stroke="#3370FF" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M33.5947 17C32.84 14.7027 30.8551 9.94054 27.5947 7H11.5947C15.2174 10.6757 23.0002 16 27.0002 24"/></g></svg>
diff --git a/site/public/channel-icons/matrix.svg b/site/public/channel-icons/matrix.svg
new file mode 100644
index 000000000..65545ecf5
--- /dev/null
+++ b/site/public/channel-icons/matrix.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#666666" d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033c.309-.443.683-.784 1.117-1.024.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.481.314.448.208.785.582 1.02 1.108.254-.374.6-.706 1.034-.992.434-.287.95-.43 1.546-.43.453 0 .872.056 1.26.167.388.11.716.286.993.53.276.245.489.559.646.951.152.392.23.863.23 1.417v5.728h-2.349V11.52c0-.286-.01-.559-.032-.812a1.755 1.755 0 0 0-.18-.66 1.106 1.106 0 0 0-.438-.448c-.194-.11-.457-.166-.785-.166-.332 0-.6.064-.803.189a1.38 1.38 0 0 0-.48.499 1.946 1.946 0 0 0-.231.696 5.56 5.56 0 0 0-.06.785v4.768h-2.35v-4.8c0-.254-.004-.503-.018-.752a2.074 2.074 0 0 0-.143-.688 1.052 1.052 0 0 0-.415-.503c-.194-.125-.476-.19-.854-.19-.111 0-.259.024-.439.074-.18.051-.36.143-.53.282-.171.138-.319.337-.439.595-.12.259-.18.6-.18 1.02v4.966H5.46V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z"/></svg>
diff --git a/site/public/channel-icons/mochat.svg b/site/public/channel-icons/mochat.svg
new file mode 100644
index 000000000..d6344746e
--- /dev/null
+++ b/site/public/channel-icons/mochat.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect width="24" height="24" rx="5" fill="#07C160"/><text x="12" y="12" fill="#FFFFFF" font-family="system-ui, -apple-system, 'Segoe UI', sans-serif" font-size="14" font-weight="600" text-anchor="middle" dominant-baseline="central">M</text></svg>
diff --git a/site/public/channel-icons/msteams.svg b/site/public/channel-icons/msteams.svg
new file mode 100644
index 000000000..a0d6f5acb
--- /dev/null
+++ b/site/public/channel-icons/msteams.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 239"><circle cx="223.256" cy="50.605" r="26.791" fill="#5059C9"/><circle cx="139.907" cy="38.698" r="38.698" fill="#7B83EB"/><path fill="#5059C9" d="M178.563 89.302h66.125c6.248 0 11.312 5.065 11.312 11.312v60.231c0 22.96-18.613 41.574-41.573 41.574h-.197c-22.96.003-41.576-18.607-41.579-41.568V95.215a5.91 5.91 0 0 1 5.912-5.913"/><path fill="#7B83EB" d="M191.506 89.302H82.355c-6.173.153-11.056 5.276-10.913 11.449v68.697c-.862 37.044 28.445 67.785 65.488 68.692c37.043-.907 66.35-31.648 65.489-68.692v-68.697c.143-6.173-4.74-11.296-10.913-11.449"/><path fill="#4D55BD" d="M10.913 53.581h109.15c6.028 0 10.914 4.886 10.914 10.913v109.151c0 6.027-4.886 10.913-10.913 10.913H10.913C4.886 184.558 0 179.672 0 173.645V64.495C0 58.466 4.886 53.58 10.913 53.58"/><path fill="#FFFFFF" d="M94.208 95.125h-21.82v59.416H58.487V95.125H36.769V83.599h57.439z"/></svg>
diff --git a/site/public/channel-icons/napcat.svg b/site/public/channel-icons/napcat.svg
new file mode 100644
index 000000000..9193b513e
--- /dev/null
+++ b/site/public/channel-icons/napcat.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect width="24" height="24" rx="5" fill="#1EBAFC"/><g transform="translate(3.36 3.36) scale(0.72)" fill="none" stroke="#FFFFFF" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3.1-9-7.56c0-1.2.43-2.37 1-3.44 0 0-1.82-6.42-.42-7 1.39-.58 4.64.25 6.42 2.26.65-.17 1.33-.26 2-.26Z"/><path d="M8 14v.5"/><path d="M16 14v.5"/><path d="M11.25 16.25h1.5L12 17l-.75-.75Z"/></g></svg>
diff --git a/site/public/channel-icons/qq.svg b/site/public/channel-icons/qq.svg
new file mode 100644
index 000000000..a74e43c00
--- /dev/null
+++ b/site/public/channel-icons/qq.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1EBAFC" d="M21.395 15.035a40 40 0 0 0-.803-2.264l-1.079-2.695c.001-.032.014-.562.014-.836C19.526 4.632 17.351 0 12 0S4.474 4.632 4.474 9.241c0 .274.013.804.014.836l-1.08 2.695a39 39 0 0 0-.802 2.264c-1.021 3.283-.69 4.643-.438 4.673.54.065 2.103-2.472 2.103-2.472 0 1.469.756 3.387 2.394 4.771-.612.188-1.363.479-1.845.835-.434.32-.379.646-.301.778.343.578 5.883.369 7.482.189 1.6.18 7.14.389 7.483-.189.078-.132.132-.458-.301-.778-.483-.356-1.233-.646-1.846-.836 1.637-1.384 2.393-3.302 2.393-4.771 0 0 1.563 2.537 2.103 2.472.251-.03.581-1.39-.438-4.673"/></svg>
diff --git a/site/public/channel-icons/slack.svg b/site/public/channel-icons/slack.svg
new file mode 100644
index 000000000..66c118803
--- /dev/null
+++ b/site/public/channel-icons/slack.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect width="24" height="24" rx="5" fill="#4A154B"/><text x="12" y="12" fill="#FFFFFF" font-family="system-ui, -apple-system, 'Segoe UI', sans-serif" font-size="14" font-weight="600" text-anchor="middle" dominant-baseline="central">S</text></svg>
diff --git a/site/public/channel-icons/telegram.svg b/site/public/channel-icons/telegram.svg
new file mode 100644
index 000000000..5a555e427
--- /dev/null
+++ b/site/public/channel-icons/telegram.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#26A5E4" d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>
diff --git a/site/public/channel-icons/wecom.svg b/site/public/channel-icons/wecom.svg
new file mode 100644
index 000000000..3f7ee2112
--- /dev/null
+++ b/site/public/channel-icons/wecom.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0082EF" d="M17.326 8.158l-.003-.007a6.6 6.6 0 0 0-1.178-1.674c-1.266-1.307-3.067-2.19-5.102-2.417a9.3 9.3 0 0 0-2.124 0h-.001c-2.061.228-3.882 1.107-5.14 2.405a6.7 6.7 0 0 0-1.194 1.682A5.7 5.7 0 0 0 2 10.657c0 1.106.332 2.218.988 3.201l.006.01c.391.594 1.092 1.39 1.637 1.83l.983.793l-.208.875l.527-.267l.708-.358l.761.225c.467.137.955.227 1.517.29h.005q.515.06 1.026.059c.355 0 .724-.02 1.095-.06a9 9 0 0 0 1.346-.258c.095.7.43 1.337.932 1.81c-.658.208-1.352.358-2.061.436c-.442.048-.883.072-1.312.072q-.627 0-1.253-.072a10.7 10.7 0 0 1-1.861-.36l-2.84 1.438s-.29.131-.44.131c-.418 0-.702-.285-.702-.704c0-.252.067-.598.128-.84l.394-1.653c-.728-.586-1.563-1.544-2.052-2.287A7.76 7.76 0 0 1 0 10.658a7.7 7.7 0 0 1 .787-3.39a8.7 8.7 0 0 1 1.551-2.19c1.61-1.665 3.878-2.73 6.359-3.006a11.3 11.3 0 0 1 2.565 0c2.47.275 4.712 1.353 6.323 3.017a8.6 8.6 0 0 1 1.539 2.192c.466.945.769 1.937.769 2.978a3.06 3.06 0 0 0-2-.005c-.001-.644-.189-1.329-.564-2.09z"/><path fill="#2CB800" d="M21.451 15.135l-.024-.024l-.024-.018l-.024-.018l-.096-.095a4.24 4.24 0 0 1-1.169-2.192q0-.038-.006-.075l-.006-.056l-.035-.144a1.3 1.3 0 0 0-.358-.61a1.386 1.386 0 0 0-1.957 0a1.4 1.4 0 0 0 0 1.963c.191.191.418.311.668.371c.024.012.06.012.084.012q.019 0 .041.006q.023.005.042.006a4.24 4.24 0 0 1 2.231 1.186c.048.048.096.095.131.143a.323.323 0 0 0 .466 0a.35.35 0 0 0 .036-.455"/><path fill="#0081EE" d="M20.401 19.505l-.025.025c-.119.096-.31.096-.453-.036a.326.326 0 0 1 0-.467c.047-.036.094-.083.141-.13l.002-.002a4.27 4.27 0 0 0 1.187-2.28q.005-.024.006-.043c0-.024 0-.06.012-.084a1.386 1.386 0 0 1 2.326-.67a1.4 1.4 0 0 1 0 1.964c-.167.18-.382.299-.608.359l-.143.036l-.057.005q-.035.006-.075.007a4.2 4.2 0 0 0-2.183 1.173l-.095.096q-.009.01-.018.024t-.018.024"/><path fill="#FB6500" d="M16.008 18.453l.024.024l.024.018q.015.009.024.018l.096.096a4.25 4.25 0 0 1 1.169 2.19q0 .04.006.076q.005.03.006.057l.035.143c.06.228.18.443.358.611c.537.539 1.42.539 1.957 0a1.4 1.4 0 0 0 0-1.964a1.4 1.4 0 0 0-.668-.371c-.024-.012-.06-.012-.084-.012q-.018 0-.041-.006l-.042-.006a4.25 4.25 0 0 1-2.231-1.185a1.4 1.4 0 0 1-.131-.144a.323.323 0 0 0-.466 0a.325.325 0 0 0-.036.455"/><path fill="#FFCC00" d="M17.047 14.095l.024-.024a.32.32 0 0 1 .453.035a.326.326 0 0 1 0 .467c-.047.036-.094.083-.141.13l-.002.002a4.27 4.27 0 0 0-1.187 2.281l-.006.042c0 .024 0 .06-.012.084a1.386 1.386 0 0 1-2.326.67a1.4 1.4 0 0 1 0-1.963c.166-.18.381-.3.608-.36l.143-.035q.026 0 .056-.006q.037-.005.075-.006a4.2 4.2 0 0 0 2.183-1.174l.096-.095l.018-.025z"/></svg>
diff --git a/site/public/channel-icons/weixin.svg b/site/public/channel-icons/weixin.svg
new file mode 100644
index 000000000..bd3632385
--- /dev/null
+++ b/site/public/channel-icons/weixin.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#07C160" d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665l-.39 1.48c-.019.07-.048.141-.048.213c0 .163.13.295.29.295a.33.33 0 0 0 .167-.054l1.903-1.114a.86.86 0 0 1 .717-.098a10.2 10.2 0 0 0 2.837.403c.276 0 .543-.027.811-.05c-.857-2.578.157-4.972 1.932-6.446c1.703-1.415 3.882-1.98 5.853-1.838c-.576-3.583-4.196-6.348-8.596-6.348M5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178A1.17 1.17 0 0 1 4.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178a1.17 1.17 0 0 1-1.162-1.178c0-.651.52-1.18 1.162-1.18m5.34 2.867c-1.797-.052-3.746.512-5.28 1.786c-1.72 1.428-2.687 3.72-1.78 6.22c.942 2.453 3.666 4.229 6.884 4.229c.826 0 1.622-.12 2.361-.336a.72.72 0 0 1 .598.082l1.584.926a.3.3 0 0 0 .14.047c.134 0 .24-.111.24-.247c0-.06-.023-.12-.038-.177l-.327-1.233a.6.6 0 0 1-.023-.156a.49.49 0 0 1 .201-.398C23.024 18.48 24 16.82 24 14.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53 3.274c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983a.976.976 0 0 1-.969-.983c0-.542.434-.982.97-.982zm4.844 0c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983a.976.976 0 0 1-.969-.983c0-.542.434-.982.969-.982"/></svg>
diff --git a/site/public/channel-icons/whatsapp.svg b/site/public/channel-icons/whatsapp.svg
new file mode 100644
index 000000000..2a67ebd04
--- /dev/null
+++ b/site/public/channel-icons/whatsapp.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#25D366" d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/></svg>
diff --git a/site/public/channel-icons/zulip.svg b/site/public/channel-icons/zulip.svg
new file mode 100644
index 000000000..2c26bb7cc
--- /dev/null
+++ b/site/public/channel-icons/zulip.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#6492FE" d="M22.767 3.589c0 1.209-.543 2.283-1.37 2.934l-8.034 7.174c-.149.128-.343-.078-.235-.25l2.946-5.9c.083-.165-.024-.368-.194-.368H4.452c-1.77 0-3.219-1.615-3.219-3.59C1.233 1.616 2.682 0 4.452 0h15.096c1.77-.001 3.219 1.614 3.219 3.589zM4.452 24h15.096c1.77 0 3.219-1.616 3.219-3.59 0-1.974-1.449-3.59-3.219-3.59H8.12c-.17 0-.277-.202-.194-.367l2.946-5.9c.108-.172-.086-.378-.235-.25l-8.033 7.173c-.828.65-1.37 1.725-1.37 2.934 0 1.974 1.448 3.59 3.218 3.59z"/></svg>
diff --git a/site/public/images/cli-architecture.png b/site/public/images/cli-architecture.png
deleted file mode 100644
index c59ba3478..000000000
Binary files a/site/public/images/cli-architecture.png and /dev/null differ
diff --git a/site/public/images/deeptutor-architecture.png b/site/public/images/deeptutor-architecture.png
deleted file mode 100644
index 0333bf239..000000000
Binary files a/site/public/images/deeptutor-architecture.png and /dev/null differ
diff --git a/site/public/images/dt-chat.png b/site/public/images/dt-chat.png
deleted file mode 100644
index f2d5d7820..000000000
Binary files a/site/public/images/dt-chat.png and /dev/null differ
diff --git a/site/public/images/dt-cowriter.png b/site/public/images/dt-cowriter.png
deleted file mode 100644
index b9b0710f3..000000000
Binary files a/site/public/images/dt-cowriter.png and /dev/null differ
diff --git a/site/public/images/dt-guide.png b/site/public/images/dt-guide.png
deleted file mode 100644
index f82d022fd..000000000
Binary files a/site/public/images/dt-guide.png and /dev/null differ
diff --git a/site/public/images/dt-knowledge.png b/site/public/images/dt-knowledge.png
deleted file mode 100644
index 7dc88877f..000000000
Binary files a/site/public/images/dt-knowledge.png and /dev/null differ
diff --git a/site/public/images/dt-memgraph.png b/site/public/images/dt-memgraph.png
deleted file mode 100644
index 7047bb1f7..000000000
Binary files a/site/public/images/dt-memgraph.png and /dev/null differ
diff --git a/site/public/images/dt-memory.png b/site/public/images/dt-memory.png
deleted file mode 100644
index 128160168..000000000
Binary files a/site/public/images/dt-memory.png and /dev/null differ
diff --git a/site/public/images/tb.png b/site/public/images/tb.png
deleted file mode 100644
index 649c31928..000000000
Binary files a/site/public/images/tb.png and /dev/null differ
diff --git a/site/public/images/tutorbot-architecture.png b/site/public/images/tutorbot-architecture.png
deleted file mode 100644
index db0a83dc5..000000000
Binary files a/site/public/images/tutorbot-architecture.png and /dev/null differ
diff --git a/site/public/provider-icons/aihubmix-color.svg b/site/public/provider-icons/aihubmix-color.svg
new file mode 100644
index 000000000..60dca06bc
--- /dev/null
+++ b/site/public/provider-icons/aihubmix-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>AiHubMix</title><path d="M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12z" fill="#006FFB"></path><path clip-rule="evenodd" d="M11.24 8.393c.095-.644.302-1.47.624-2.48L12 5.496l.136.417c.322 1.01.53 1.836.624 2.48.071.472.071 1.072 0 1.8-.072.731-.072 1.336 0 1.814.106.7.426 1.281.96 1.744a2.795 2.795 0 001.89.708 2.78 2.78 0 002.034-.84c.56-.559.842-1.234.848-2.024.003-.7.075-1.472.216-2.316.069-.422.14-.775.21-1.06l.095-.384.168.356a7.862 7.862 0 01.76 3.244v.16a7.84 7.84 0 01-.624 3.089 7.952 7.952 0 01-4.228 4.228 7.841 7.841 0 01-3.089.623 7.84 7.84 0 01-3.089-.623 7.952 7.952 0 01-4.228-4.228 7.84 7.84 0 01-.623-3.09v-.159a7.862 7.862 0 01.759-3.244l.169-.356.093.385c.072.284.143.637.211 1.059.141.844.213 1.616.216 2.316.006.79.29 1.465.848 2.024.563.56 1.241.84 2.035.84.715 0 1.345-.236 1.889-.708a2.79 2.79 0 00.96-1.744c.073-.478.073-1.083 0-1.814-.071-.728-.071-1.328 0-1.8zm.76 9.694c1.097 0 2.125-.26 3.085-.778a6.379 6.379 0 001.77-1.399c.063-.07-.01-.178-.101-.153-.37.1-.75.15-1.144.15a4.236 4.236 0 01-2.18-.59 4.253 4.253 0 01-1.35-1.233.099.099 0 00-.16 0 4.253 4.253 0 01-1.35 1.232 4.236 4.236 0 01-2.18.591c-.393 0-.774-.05-1.143-.15-.091-.025-.165.083-.102.153a6.38 6.38 0 001.77 1.399c.96.518 1.988.778 3.085.778z" fill="#fff" fill-rule="evenodd"></path></svg>
diff --git a/site/public/provider-icons/anthropic.svg b/site/public/provider-icons/anthropic.svg
new file mode 100644
index 000000000..b93d6a02f
--- /dev/null
+++ b/site/public/provider-icons/anthropic.svg
@@ -0,0 +1 @@
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Anthropic</title><path d="M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z"></path></svg>
diff --git a/site/public/provider-icons/azure-color.svg b/site/public/provider-icons/azure-color.svg
new file mode 100644
index 000000000..56b12eb73
--- /dev/null
+++ b/site/public/provider-icons/azure-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Azure</title><path d="M7.242 1.613A1.11 1.11 0 018.295.857h6.977L8.03 22.316a1.11 1.11 0 01-1.052.755h-5.43a1.11 1.11 0 01-1.053-1.466L7.242 1.613z" fill="url(#lobe-icons-azure-0-_R_0_)"></path><path d="M18.397 15.296H7.4a.51.51 0 00-.347.882l7.066 6.595c.206.192.477.298.758.298h6.226l-2.706-7.775z" fill="#0078D4"></path><path d="M15.272.857H7.497L0 23.071h7.775l1.596-4.73 5.068 4.73h6.665l-2.707-7.775h-7.998L15.272.857z" fill="url(#lobe-icons-azure-1-_R_0_)"></path><path d="M17.193 1.613a1.11 1.11 0 00-1.052-.756h-7.81.035c.477 0 .9.304 1.052.756l6.748 19.992a1.11 1.11 0 01-1.052 1.466h-.12 7.895a1.11 1.11 0 001.052-1.466L17.193 1.613z" fill="url(#lobe-icons-azure-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-0-_R_0_" x1="8.247" x2="1.002" y1="1.626" y2="23.03"><stop stop-color="#114A8B"></stop><stop offset="1" stop-color="#0669BC"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-1-_R_0_" x1="14.042" x2="12.324" y1="15.302" y2="15.888"><stop stop-opacity=".3"></stop><stop offset=".071" stop-opacity=".2"></stop><stop offset=".321" stop-opacity=".1"></stop><stop offset=".623" stop-opacity=".05"></stop><stop offset="1" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-2-_R_0_" x1="12.841" x2="20.793" y1="1.626" y2="22.814"><stop stop-color="#3CCBF4"></stop><stop offset="1" stop-color="#2892DF"></stop></linearGradient></defs></svg>
diff --git a/site/public/provider-icons/baidu-color.svg b/site/public/provider-icons/baidu-color.svg
new file mode 100644
index 000000000..a9f84751c
--- /dev/null
+++ b/site/public/provider-icons/baidu-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Baidu</title><path d="M8.859 11.735c1.017-1.71 4.059-3.083 6.202.286 1.579 2.284 4.284 4.397 4.284 4.397s2.027 1.601.73 4.684c-1.24 2.956-5.64 1.607-6.005 1.49l-.024-.009s-1.746-.568-3.776-.112c-2.026.458-3.773.286-3.773.286l-.045-.001c-.328-.01-2.38-.187-3.001-2.968-.675-3.028 2.365-4.687 2.592-4.968.226-.288 1.802-1.37 2.816-3.085zm.986 1.738v2.032h-1.64s-1.64.138-2.213 2.014c-.2 1.252.177 1.99.242 2.148.067.157.596 1.073 1.927 1.342h3.078v-7.514l-1.394-.022zm3.588 2.191l-1.44.024v3.956s.064.985 1.44 1.344h3.541v-5.3h-1.528v3.979h-1.46s-.466-.068-.553-.447v-3.556zM9.82 16.715v3.06H8.58s-.863-.045-1.126-1.049c-.136-.445.02-.959.088-1.16.063-.203.353-.671.951-.85H9.82zm9.525-9.036c2.086 0 2.646 2.06 2.646 2.742 0 .688.284 3.597-2.309 3.655-2.595.057-2.704-1.77-2.704-3.08 0-1.374.277-3.317 2.367-3.317zM4.24 6.08c1.523-.135 2.645 1.55 2.762 2.513.07.625.393 3.486-1.975 4-2.364.515-3.244-2.249-2.984-3.544 0 0 .28-2.797 2.197-2.969zm8.847-1.483c.14-1.31 1.69-3.316 2.931-3.028 1.236.285 2.367 1.944 2.137 3.37-.224 1.428-1.345 3.313-3.095 3.082-1.748-.226-2.143-1.823-1.973-3.424zM9.425 1c1.307 0 2.364 1.519 2.364 3.398 0 1.879-1.057 3.4-2.364 3.4s-2.367-1.521-2.367-3.4C7.058 2.518 8.118 1 9.425 1z" fill="#2932E1" fill-rule="nonzero"></path></svg>
diff --git a/site/public/provider-icons/baiducloud-color.svg b/site/public/provider-icons/baiducloud-color.svg
new file mode 100644
index 000000000..fc7038364
--- /dev/null
+++ b/site/public/provider-icons/baiducloud-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>BaiduCloud</title><path d="M21.715 5.61l-3.983 2.31a.903.903 0 01-.896 0L12.44 5.384a.903.903 0 00-.897 0L7.156 7.92a.903.903 0 01-.896 0L2.276 5.617 12.002 0l9.713 5.61z" fill="#5BCA87"></path><path d="M18.641 9.467a.89.89 0 00-.438.77v5.072a.896.896 0 01-.445.77l-4.428 2.51a.884.884 0 00-.445.777v4.607l4.429-2.536 5.31-3.047V7.157l-3.983 2.31z" fill="#EC5D3E"></path><path d="M10.98 18.941a.936.936 0 00-.305-.352l-4.429-2.516a.903.903 0 01-.431-.764v-5.078a.89.89 0 00-.452-.757l-.451-.26L1.38 7.158V18.39l5.311 3.047L11.126 24v-4.608a.881.881 0 00-.146-.45z" fill="#2464F5"></path></svg>
diff --git a/site/public/provider-icons/brave.svg b/site/public/provider-icons/brave.svg
new file mode 100644
index 000000000..8c56fec96
--- /dev/null
+++ b/site/public/provider-icons/brave.svg
@@ -0,0 +1 @@
+<svg fill="#FB542B" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Brave</title><path d="M15.68 0l2.096 2.38s1.84-.512 2.709.358c.868.87 1.584 1.638 1.584 1.638l-.562 1.381.715 2.047s-2.104 7.98-2.35 8.955c-.486 1.919-.818 2.66-2.198 3.633-1.38.972-3.884 2.66-4.293 2.916-.409.256-.92.692-1.38.692-.46 0-.97-.436-1.38-.692a185.796 185.796 0 01-4.293-2.916c-1.38-.973-1.712-1.714-2.197-3.633-.247-.975-2.351-8.955-2.351-8.955l.715-2.047-.562-1.381s.716-.768 1.585-1.638c.868-.87 2.708-.358 2.708-.358L8.321 0h7.36zm-3.679 14.936c-.14 0-1.038.317-1.758.69-.72.373-1.242.637-1.409.742-.167.104-.065.301.087.409.152.107 2.194 1.69 2.393 1.866.198.175.489.464.687.464.198 0 .49-.29.688-.464.198-.175 2.24-1.759 2.392-1.866.152-.108.254-.305.087-.41-.167-.104-.689-.368-1.41-.741-.72-.373-1.617-.69-1.757-.69zm0-11.278s-.409.001-1.022.206-1.278.46-1.584.46c-.307 0-2.581-.434-2.581-.434S4.119 7.152 4.119 7.849c0 .697.339.881.68 1.243l2.02 2.149c.192.203.59.511.356 1.066-.235.555-.58 1.26-.196 1.977.384.716 1.042 1.194 1.464 1.115.421-.08 1.412-.598 1.776-.834.364-.237 1.518-1.19 1.518-1.554 0-.365-1.193-1.02-1.413-1.168-.22-.15-1.226-.725-1.247-.95-.02-.227-.012-.293.284-.851.297-.559.831-1.304.742-1.8-.089-.495-.95-.753-1.565-.986-.615-.232-1.799-.671-1.947-.74-.148-.068-.11-.133.339-.175.448-.043 1.719-.212 2.292-.052.573.16 1.552.403 1.632.532.079.13.149.134.067.579-.081.445-.5 2.581-.541 2.96-.04.38-.12.63.288.724.409.094 1.097.256 1.333.256s.924-.162 1.333-.256c.408-.093.329-.344.288-.723-.04-.38-.46-2.516-.541-2.961-.082-.445-.012-.45.067-.579.08-.129 1.059-.372 1.632-.532.573-.16 1.845.009 2.292.052.449.042.487.107.339.175-.148.069-1.332.508-1.947.74-.615.233-1.476.49-1.565.986-.09.496.445 1.241.742 1.8.297.558.304.624.284.85-.02.226-1.026.802-1.247.95-.22.15-1.413.804-1.413 1.169 0 .364 1.154 1.317 1.518 1.554.364.236 1.355.755 1.776.834.422.079 1.08-.4 1.464-1.115.384-.716.039-1.422-.195-1.977-.235-.555.163-.863.355-1.066l2.02-2.149c.341-.362.68-.546.68-1.243 0-.697-2.695-3.96-2.695-3.96s-2.274.436-2.58.436c-.307 0-.972-.256-1.585-.461-.613-.205-1.022-.206-1.022-.206z"/></svg>
diff --git a/site/public/provider-icons/bytedance-color.svg b/site/public/provider-icons/bytedance-color.svg
new file mode 100644
index 000000000..2dd4fe7bd
--- /dev/null
+++ b/site/public/provider-icons/bytedance-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>ByteDance</title><path d="M14.944 18.587l-1.704-.445V10.01l1.824-.462c1-.254 1.84-.461 1.88-.453.032 0 .056 2.235.056 4.972v4.973l-.176-.008c-.104 0-.952-.207-1.88-.446z" fill="#00C8D2" fill-rule="nonzero"></path><path d="M7 16.542c0-2.736.024-4.98.064-4.98.032-.008.872.2 1.88.454l1.816.461-.016 4.05-.024 4.049-1.632.422c-.896.23-1.736.445-1.856.469L7 21.523v-4.98z" fill="#3C8CFF" fill-rule="nonzero"></path><path d="M19.24 12.477c0-9.03.008-9.515.144-9.475.072.024.784.207 1.576.406.792.207 1.576.405 1.744.445l.296.08-.016 8.56-.024 8.568-1.624.414c-.888.23-1.728.437-1.856.47l-.24.055v-9.523z" fill="#78E6DC" fill-rule="nonzero"></path><path d="M1 12.509c0-4.678.024-8.505.064-8.505.032 0 .872.207 1.872.454l1.824.461v7.582c0 4.16-.016 7.574-.032 7.574-.024 0-.872.215-1.88.47L1 21.013v-8.505z" fill="#325AB4"></path></svg>
diff --git a/site/public/provider-icons/cohere-color.svg b/site/public/provider-icons/cohere-color.svg
new file mode 100644
index 000000000..1509c50a7
--- /dev/null
+++ b/site/public/provider-icons/cohere-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cohere</title><path clip-rule="evenodd" d="M8.128 14.099c.592 0 1.77-.033 3.398-.703 1.897-.781 5.672-2.2 8.395-3.656 1.905-1.018 2.74-2.366 2.74-4.18A4.56 4.56 0 0018.1 1H7.549A6.55 6.55 0 001 7.55c0 3.617 2.745 6.549 7.128 6.549z" fill="#39594D" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M9.912 18.61a4.387 4.387 0 012.705-4.052l3.323-1.38c3.361-1.394 7.06 1.076 7.06 4.715a5.104 5.104 0 01-5.105 5.104l-3.597-.001a4.386 4.386 0 01-4.386-4.387z" fill="#D18EE2" fill-rule="evenodd"></path><path d="M4.776 14.962A3.775 3.775 0 001 18.738v.489a3.776 3.776 0 007.551 0v-.49a3.775 3.775 0 00-3.775-3.775z" fill="#FF7759"></path></svg>
diff --git a/site/public/provider-icons/deepseek-color.svg b/site/public/provider-icons/deepseek-color.svg
new file mode 100644
index 000000000..52eec25cd
--- /dev/null
+++ b/site/public/provider-icons/deepseek-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>DeepSeek</title><path d="M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z" fill="#4D6BFE"></path></svg>
diff --git a/site/public/provider-icons/duckduckgo.svg b/site/public/provider-icons/duckduckgo.svg
new file mode 100644
index 000000000..20d9dd64f
--- /dev/null
+++ b/site/public/provider-icons/duckduckgo.svg
@@ -0,0 +1 @@
+<svg fill="#DE5833" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>DuckDuckGo</title><path d="M12 0C5.37 0 0 5.37 0 12s5.37 12 12 12 12-5.37 12-12S18.63 0 12 0zm0 .984C18.083.984 23.016 5.916 23.016 12S18.084 23.016 12 23.016.984 18.084.984 12C.984 5.917 5.916.984 12 .984zm0 .938C6.434 1.922 1.922 6.434 1.922 12c0 4.437 2.867 8.205 6.85 9.55-.237-.82-.776-2.753-1.6-6.052-1.184-4.741-2.064-8.606 2.379-9.813.047-.011.064-.064.03-.093-.514-.467-1.382-.548-2.233-.38a.06.06 0 0 1-.07-.058c0-.011 0-.023.011-.035.205-.286.572-.507.822-.64a1.843 1.843 0 0 0-.607-.335c-.059-.022-.059-.12-.006-.144.006-.006.012-.012.024-.012 1.749-.233 3.586.292 4.49 1.448.011.011.023.017.035.023 2.968.635 3.509 4.837 3.328 5.998a9.607 9.607 0 0 0 2.346-.576c.746-.286 1.008-.222 1.101-.053.1.193-.018.513-.28.81-.496.567-1.393 1.01-2.974 1.137-.546.044-1.029.024-1.445.006-.789-.035-1.339-.059-1.633.39-.192.298-.041.998 1.487 1.22 1.09.157 2.078.047 2.798-.034.643-.07 1.073-.118 1.172.069.21.402-.996 1.207-3.066 1.224-.158 0-.315-.006-.467-.011-1.283-.065-2.227-.414-2.816-.735a.094.094 0 0 1-.035-.017c-.105-.059-.31.045-.188.267.07.134.444.478 1.004.776-.058.466.087 1.184.338 2l.088-.016c.041-.009.087-.019.134-.025.507-.082.775.012.926.175.717-.536 1.913-1.294 2.03-1.154.583.694.66 2.332.53 2.99-.004.012-.017.024-.04.035-.274.117-1.783-.296-1.783-.511-.059-1.075-.26-1.173-.493-1.225h-.156c.006.006.012.018.018.03l.052.12c.093.257.24 1.063.13 1.26-.112.199-.835.297-1.284.303-.443.006-.543-.158-.637-.408-.07-.204-.103-.675-.103-.95a.857.857 0 0 1 .012-.216c-.134.058-.333.193-.397.281-.017.262-.017.682.123 1.149.07.221-1.518 1.164-1.74.99-.227-.181-.634-1.952-.459-2.67-.187.017-.338.075-.42.191-.367.508.093 2.933.582 3.248.257.169 1.54-.553 2.176-1.095.105.145.305.158.553.158.326-.012.782-.06 1.103-.158.192.45.423.972.613 1.388 4.47-1.032 7.803-5.037 7.803-9.82 0-5.566-4.512-10.078-10.078-10.078zm1.791 5.646c-.42 0-.678.146-.795.332-.023.047.047.094.094.07.14-.075.357-.161.701-.156.328.006.516.09.67.159l.023.01c.041.017.088-.03.059-.065-.134-.18-.332-.35-.752-.35zm-5.078.198a1.24 1.24 0 0 0-.522.082c-.454.169-.67.526-.67.76 0 .051.112.057.141.011.081-.123.21-.31.617-.478.408-.17.73-.146.951-.094.047.012.083-.041.041-.07a.989.989 0 0 0-.558-.211zm5.434 1.423a.651.651 0 0 0-.655.647.652.652 0 0 0 1.307 0 .646.646 0 0 0-.652-.647zm.283.262h.008a.17.17 0 0 1 .17.17c0 .093-.077.17-.17.17a.17.17 0 0 1-.17-.17c0-.09.072-.165.162-.17zm-5.358.076a.752.752 0 0 0-.758.758c0 .42.338.758.758.758s.758-.337.758-.758a.756.756 0 0 0-.758-.758zm.328.303h.01c.112 0 .2.089.2.2 0 .11-.088.197-.2.197a.195.195 0 0 1-.197-.198c0-.107.082-.194.187-.199z"/></svg>
diff --git a/site/public/provider-icons/exa-color.svg b/site/public/provider-icons/exa-color.svg
new file mode 100644
index 000000000..bdf0f7638
--- /dev/null
+++ b/site/public/provider-icons/exa-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Exa</title><path clip-rule="evenodd" d="M3 0h19v1.791L13.892 12 22 22.209V24H3V0zm9.62 10.348l6.589-8.557H6.03l6.59 8.557zM5.138 3.935v7.17h5.52l-5.52-7.17zm5.52 8.96h-5.52v7.17l5.52-7.17zM6.03 22.21l6.59-8.557 6.589 8.557H6.03z" fill="#1F40ED" fill-rule="evenodd"></path></svg>
diff --git a/site/public/provider-icons/gemini-color.svg b/site/public/provider-icons/gemini-color.svg
new file mode 100644
index 000000000..0f2e39809
--- /dev/null
+++ b/site/public/provider-icons/gemini-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Gemini</title><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="#3186FF"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-0-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-1-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-0-_R_0_" x1="7" x2="11" y1="15.5" y2="12"><stop stop-color="#08B962"></stop><stop offset="1" stop-color="#08B962" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-1-_R_0_" x1="8" x2="11.5" y1="5.5" y2="11"><stop stop-color="#F94543"></stop><stop offset="1" stop-color="#F94543" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-2-_R_0_" x1="3.5" x2="17.5" y1="13.5" y2="12"><stop stop-color="#FABC12"></stop><stop offset=".46" stop-color="#FABC12" stop-opacity="0"></stop></linearGradient></defs></svg>
diff --git a/site/public/provider-icons/githubcopilot.svg b/site/public/provider-icons/githubcopilot.svg
new file mode 100644
index 000000000..e152afe52
--- /dev/null
+++ b/site/public/provider-icons/githubcopilot.svg
@@ -0,0 +1 @@
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>GithubCopilot</title><path d="M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"></path></svg>
diff --git a/site/public/provider-icons/groq.svg b/site/public/provider-icons/groq.svg
new file mode 100644
index 000000000..d2953eedb
--- /dev/null
+++ b/site/public/provider-icons/groq.svg
@@ -0,0 +1 @@
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Groq</title><path d="M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z"></path></svg>
diff --git a/site/public/provider-icons/jina.svg b/site/public/provider-icons/jina.svg
new file mode 100644
index 000000000..9d79ff9f2
--- /dev/null
+++ b/site/public/provider-icons/jina.svg
@@ -0,0 +1 @@
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Jina</title><path d="M6.608 21.416a4.608 4.608 0 100-9.217 4.608 4.608 0 000 9.217zM20.894 2.015c.614 0 1.106.492 1.106 1.106v9.002c0 5.13-4.148 9.309-9.217 9.37v-9.355l-.03-9.032c0-.614.491-1.106 1.106-1.106h7.158l-.123.015z"></path></svg>
diff --git a/site/public/provider-icons/lmstudio.svg b/site/public/provider-icons/lmstudio.svg
new file mode 100644
index 000000000..ae5039616
--- /dev/null
+++ b/site/public/provider-icons/lmstudio.svg
@@ -0,0 +1 @@
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>LM Studio</title><path d="M2.84 2a1.273 1.273 0 100 2.547h14.107a1.273 1.273 0 100-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H22.04a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h14.106a1.274 1.274 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H15.38a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h14.106a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h9.698a1.273 1.273 0 100-2.547h-9.698z" fill-opacity=".3"></path><path d="M2.84 2a1.273 1.273 0 100 2.547h10.287a1.274 1.274 0 000-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H18.22a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H11.56a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h5.78a1.273 1.273 0 100-2.547h-5.78z"></path></svg>
diff --git a/site/public/provider-icons/minimax-color.svg b/site/public/provider-icons/minimax-color.svg
new file mode 100644
index 000000000..52b3a336e
--- /dev/null
+++ b/site/public/provider-icons/minimax-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Minimax</title><defs><linearGradient id="lobe-icons-minimax-_R_0_" x1="0%" x2="100.182%" y1="50.057%" y2="50.057%"><stop offset="0%" stop-color="#E2167E"></stop><stop offset="100%" stop-color="#FE603C"></stop></linearGradient></defs><path d="M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z" fill="url(#lobe-icons-minimax-_R_0_)" fill-rule="nonzero"></path></svg>
diff --git a/site/public/provider-icons/mistral-color.svg b/site/public/provider-icons/mistral-color.svg
new file mode 100644
index 000000000..7c5e60429
--- /dev/null
+++ b/site/public/provider-icons/mistral-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Mistral</title><path d="M3.428 3.4h3.429v3.428H3.428V3.4zm13.714 0h3.43v3.428h-3.43V3.4z" fill="gold"></path><path d="M3.428 6.828h6.857v3.429H3.429V6.828zm10.286 0h6.857v3.429h-6.857V6.828z" fill="#FFAF00"></path><path d="M3.428 10.258h17.144v3.428H3.428v-3.428z" fill="#FF8205"></path><path d="M3.428 13.686h3.429v3.428H3.428v-3.428zm6.858 0h3.429v3.428h-3.429v-3.428zm6.856 0h3.43v3.428h-3.43v-3.428z" fill="#FA500F"></path><path d="M0 17.114h10.286v3.429H0v-3.429zm13.714 0H24v3.429H13.714v-3.429z" fill="#E10500"></path></svg>
diff --git a/site/public/provider-icons/moonshot.svg b/site/public/provider-icons/moonshot.svg
new file mode 100644
index 000000000..829ab293e
--- /dev/null
+++ b/site/public/provider-icons/moonshot.svg
@@ -0,0 +1 @@
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>MoonshotAI</title><path d="M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"></path></svg>
diff --git a/site/public/provider-icons/nvidia-color.svg b/site/public/provider-icons/nvidia-color.svg
new file mode 100644
index 000000000..4fe3acf44
--- /dev/null
+++ b/site/public/provider-icons/nvidia-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Nvidia</title><path d="M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z" fill="#74B71B" fill-rule="nonzero"></path></svg>
diff --git a/site/public/provider-icons/ollama.svg b/site/public/provider-icons/ollama.svg
new file mode 100644
index 000000000..c5e666a06
--- /dev/null
+++ b/site/public/provider-icons/ollama.svg
@@ -0,0 +1 @@
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Ollama</title><path d="M7.905 1.09c.216.085.411.225.588.41.295.306.544.744.734 1.263.191.522.315 1.1.362 1.68a5.054 5.054 0 012.049-.636l.051-.004c.87-.07 1.73.087 2.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67 1.67 0 01.589-.41c.257-.1.53-.118.796-.042.401.114.745.368 1.016.737.248.337.434.769.561 1.287.23.934.27 2.163.115 3.645l.053.04.026.019c.757.576 1.284 1.397 1.563 2.35.435 1.487.216 3.155-.534 4.088l-.018.021.002.003c.417.762.67 1.567.724 2.4l.002.03c.064 1.065-.2 2.137-.814 3.19l-.007.01.01.024c.472 1.157.62 2.322.438 3.486l-.006.039a.651.651 0 01-.747.536.648.648 0 01-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643 0 01.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644 0 01.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229 4.229 0 00-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653 0 01-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288 3.288 0 00-1.772-.332c-1.245.099-2.343.801-2.67 1.686a.652.652 0 01-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066 1.588a4.07 4.07 0 00-.068 1.886c.112.558.331 1.02.582 1.269l.008.007c.212.207.257.53.109.785-.36.622-.629 1.549-.673 2.44-.05 1.018.186 1.902.719 2.536l.016.019a.643.643 0 01.095.69c-.576 1.236-.753 2.252-.562 3.052a.652.652 0 01-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339 4.339 0 01-.598-1.309l-.005-.019a5.764 5.764 0 01-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352 5.352 0 01.093-2.49c.262-.915.777-1.701 1.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622 1.015-.737.266-.076.54-.059.797.042zm4.116 9.09c.936 0 1.8.313 2.446.855.63.527 1.005 1.235 1.005 1.94 0 .888-.406 1.58-1.133 2.022-.62.375-1.451.557-2.403.557-1.009 0-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845 0-.707.398-1.417 1.056-1.946.668-.537 1.55-.849 2.485-.849zm0 .896a3.07 3.07 0 00-1.916.65c-.461.37-.722.835-.722 1.25 0 .428.21.829.61 1.134.455.347 1.124.548 1.943.548.799 0 1.473-.147 1.932-.426.463-.28.7-.686.7-1.257 0-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662 1.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375 0 01-.376.373.375.375 0 01-.376-.373v-.46l-.271-.218a.347.347 0 01-.052-.49.353.353 0 01.494-.051l.215.172.22-.174a.353.353 0 01.49.051zm-5.04-1.919c.478 0 .867.39.867.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zm8.706 0c.48 0 .868.39.868.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zM7.44 2.3l-.003.002a.659.659 0 00-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216 1.631-.124 2.782.43-.128.899-.208 1.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628 0 00-.107-.09L7.44 2.3zm9.174.04l-.002.001a.628.628 0 00-.107.09c-.156.163-.32.45-.453.814-.29.794-.387 1.776-.23 2.572l.058.097.008.014h.03a5.184 5.184 0 011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659 0 00-.285-.239h-.004z"></path></svg>
diff --git a/site/public/provider-icons/openai.svg b/site/public/provider-icons/openai.svg
new file mode 100644
index 000000000..8c3e68d52
--- /dev/null
+++ b/site/public/provider-icons/openai.svg
@@ -0,0 +1 @@
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OpenAI</title><path d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"></path></svg>
diff --git a/site/public/provider-icons/openrouter.svg b/site/public/provider-icons/openrouter.svg
new file mode 100644
index 000000000..cb51863f0
--- /dev/null
+++ b/site/public/provider-icons/openrouter.svg
@@ -0,0 +1 @@
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OpenRouter</title><path d="M16.804 1.957l7.22 4.105v.087L16.73 10.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147 1.352L8.345 11.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314 1.17.796 2.701 1.866 1.11.775 2.083 1.177 3.147 1.352l.3.045c.694.091 1.375.094 2.825.033l.022-2.159 7.22 4.105v.087L16.589 22l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997 21.997 0 00-.755-.498l-.467-.28a55.927 55.927 0 00-.76-.43C2.908 14.73.563 14.116 0 14.116V9.888l.14.004c.564-.007 2.91-.622 3.809-1.124l1.016-.58.438-.274c.428-.28 1.072-.726 2.686-1.853 1.621-1.133 3.186-1.78 4.881-2.059 1.152-.19 1.974-.213 3.814-.138l.02-1.907z"></path></svg>
diff --git a/site/public/provider-icons/perplexity-color.svg b/site/public/provider-icons/perplexity-color.svg
new file mode 100644
index 000000000..4a7163271
--- /dev/null
+++ b/site/public/provider-icons/perplexity-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Perplexity</title><path d="M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z" fill="#22B8CD" fill-rule="nonzero"></path></svg>
diff --git a/site/public/provider-icons/qwen-color.svg b/site/public/provider-icons/qwen-color.svg
new file mode 100644
index 000000000..ac004b1d9
--- /dev/null
+++ b/site/public/provider-icons/qwen-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Qwen</title><path d="M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z" fill="url(#lobe-icons-qwen-_R_0_)" fill-rule="nonzero"></path><defs><linearGradient id="lobe-icons-qwen-_R_0_" x1="0%" x2="100%" y1="0%" y2="0%"><stop offset="0%" stop-color="#6336E7" stop-opacity=".84"></stop><stop offset="100%" stop-color="#6F69F7" stop-opacity=".84"></stop></linearGradient></defs></svg>
diff --git a/site/public/provider-icons/searxng.svg b/site/public/provider-icons/searxng.svg
new file mode 100644
index 000000000..302e01e96
--- /dev/null
+++ b/site/public/provider-icons/searxng.svg
@@ -0,0 +1 @@
+<svg fill="#3050FF" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>SearXNG</title><path d="m13.716 17.261 6.873 6.582L24 20.282l-6.824-6.536a9.11 9.11 0 0 0 1.143-4.43c0-5.055-4.105-9.159-9.16-9.159S0 4.261 0 9.316c0 5.055 4.104 9.159 9.159 9.159a9.11 9.11 0 0 0 4.557-1.214ZM9.159 2.773a6.546 6.546 0 0 1 6.543 6.543 6.545 6.545 0 0 1-6.543 6.542 6.545 6.545 0 0 1-6.542-6.542 6.545 6.545 0 0 1 6.542-6.543ZM7.26 5.713a4.065 4.065 0 0 1 4.744.747 4.064 4.064 0 0 1 .707 4.749l1.157.611a5.376 5.376 0 0 0-.935-6.282 5.377 5.377 0 0 0-6.274-.987l.601 1.162Z"/></svg>
diff --git a/site/public/provider-icons/siliconcloud-color.svg b/site/public/provider-icons/siliconcloud-color.svg
new file mode 100644
index 000000000..f653ed108
--- /dev/null
+++ b/site/public/provider-icons/siliconcloud-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>SiliconCloud</title><path clip-rule="evenodd" d="M22.956 6.521H12.522c-.577 0-1.044.468-1.044 1.044v3.13c0 .577-.466 1.044-1.043 1.044H1.044c-.577 0-1.044.467-1.044 1.044v4.174C0 17.533.467 18 1.044 18h10.434c.577 0 1.044-.467 1.044-1.043v-3.13c0-.578.466-1.044 1.043-1.044h9.391c.577 0 1.044-.467 1.044-1.044V7.565c0-.576-.467-1.044-1.044-1.044z" fill="#6E29F6" fill-rule="evenodd"></path></svg>
diff --git a/site/public/provider-icons/stepfun-color.svg b/site/public/provider-icons/stepfun-color.svg
new file mode 100644
index 000000000..e387600c3
--- /dev/null
+++ b/site/public/provider-icons/stepfun-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Stepfun</title><path d="M22.012 0h1.032v.927H24v.968h-.956V3.78h-1.032V1.896h-1.878v-.97h1.878V0zM2.6 12.371V1.87h.969v10.502h-.97zm10.423.66h10.95v.918h-6.208v9.579h-4.742V13.03zM5.629 3.333v12.356H0v4.51h10.386V8L20.859 8l-.003-4.668-15.227.001z" fill="url(#lobe-icons-stepfun-_R_0_)" fill-rule="evenodd"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-stepfun-_R_0_" x1="1.646" x2="18.342" y1="1.916" y2="22.091"><stop stop-color="#01A9FF"></stop><stop offset="1" stop-color="#0160FF"></stop></linearGradient></defs></svg>
diff --git a/site/public/provider-icons/tavily-color.svg b/site/public/provider-icons/tavily-color.svg
new file mode 100644
index 000000000..7b88fdef5
--- /dev/null
+++ b/site/public/provider-icons/tavily-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Tavily</title><path d="M9.1.503l2.824 4.47a1.078 1.078 0 01-.911 1.655H9.858v6.692h-1.67V0c.35 0 .7.168.912.503z" fill="#8FBCFA"></path><path d="M4.453 4.974L7.277.503A1.07 1.07 0 018.189 0v13.32a2.633 2.633 0 00-1.67.48V6.628H5.364c-.85 0-1.366-.936-.912-1.654z" fill="#468BFF"></path><path d="M17.041 17.74h-7.028c.423-.457.67-1.049.7-1.67h12.956c0 .35-.168.7-.502.912l-4.472 2.823a1.078 1.078 0 01-1.654-.911v-1.155z" fill="#FDBB11"></path><path d="M18.695 12.334l4.47 2.824c.336.212.503.562.503.912H10.713a2.65 2.65 0 00-.493-1.67h6.822v-1.154c0-.85.935-1.366 1.653-.912z" fill="#F6D785"></path><path d="M4.394 19.605L.316 23.683a1.07 1.07 0 001 .29l5.158-1.165A1.078 1.078 0 007 20.994l-.816-.816 3.073-3.074a1.61 1.61 0 000-2.276l-.042-.043-4.82 4.82z" fill="#FF9A9D"></path><path d="M3.822 17.817l3.073-3.074a1.61 1.61 0 012.277 0l.042.043-4.818 4.819-4.08 4.079a1.07 1.07 0 01-.289-1l1.165-5.158A1.078 1.078 0 013.006 17l.816.817z" fill="#FE363B"></path></svg>
diff --git a/site/public/provider-icons/vllm-color.svg b/site/public/provider-icons/vllm-color.svg
new file mode 100644
index 000000000..07eaef09c
--- /dev/null
+++ b/site/public/provider-icons/vllm-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>vLLM</title><path d="M0 4.973h9.324V23L0 4.973z" fill="#FDB515"></path><path d="M13.986 4.351L22.378 0l-6.216 23H9.324l4.662-18.649z" fill="#30A2FF"></path></svg>
diff --git a/site/public/provider-icons/volcengine-color.svg b/site/public/provider-icons/volcengine-color.svg
new file mode 100644
index 000000000..1c9447224
--- /dev/null
+++ b/site/public/provider-icons/volcengine-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Volcengine</title><path d="M19.44 10.153l-2.936 11.586a.215.215 0 00.214.261h5.87a.215.215 0 00.214-.261l-2.95-11.586a.214.214 0 00-.412 0zM3.28 12.778l-2.275 8.96A.214.214 0 001.22 22h4.532a.212.212 0 00.214-.165.214.214 0 000-.097l-2.276-8.96a.214.214 0 00-.41 0z" fill="#00E5E5"></path><path d="M7.29 5.359L3.148 21.738a.215.215 0 00.203.261h8.29a.214.214 0 00.215-.261L7.7 5.358a.214.214 0 00-.41 0z" fill="#006EFF"></path><path d="M14.44.15a.214.214 0 00-.41 0L8.366 21.739a.214.214 0 00.214.261H19.9a.216.216 0 00.171-.078.214.214 0 00.044-.183L14.439.15z" fill="#006EFF"></path><path d="M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.215.215 0 00.214-.264L10.688 7.741a.214.214 0 00-.41 0z" fill="#00E5E5"></path></svg>
diff --git a/site/public/provider-icons/xiaomimimo.svg b/site/public/provider-icons/xiaomimimo.svg
new file mode 100644
index 000000000..2974f4d37
--- /dev/null
+++ b/site/public/provider-icons/xiaomimimo.svg
@@ -0,0 +1 @@
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>XiaomiMiMo</title><path d="M.958 15.936a.459.459 0 01.459.44v2.729a.46.46 0 01-.918 0v-2.729a.459.459 0 01.459-.44zm4.814-2.035a.46.46 0 01.553.45v4.754a.458.458 0 11-.918 0V15.48L3.74 17.202a.462.462 0 01-.655.016.462.462 0 01-.065-.082L.628 14.67a.459.459 0 01.658-.637l2.124 2.187 2.127-2.188a.46.46 0 01.235-.13zm2.068.004a.46.46 0 01.458.445v4.755a.46.46 0 01-.458.458.459.459 0 01-.458-.458V14.35a.459.459 0 01.458-.445zm1.973 2.014a.46.46 0 01.46.457v2.729a.46.46 0 01-.784.324.46.46 0 01-.134-.324v-2.729a.46.46 0 01.458-.458zm.002-2.045a.458.458 0 01.328.157l2.127 2.19 2.125-2.19a.459.459 0 01.784.318v4.756a.46.46 0 01-.455.458.46.46 0 01-.458-.458V15.48l-1.667 1.723a.46.46 0 01-.65.008l-.005-.005c0-.002-.002-.002-.004-.003l-2.455-2.534a.46.46 0 01-.008-.667.461.461 0 01.338-.128zm6.797 1.206a.46.46 0 01.53.651A1.966 1.966 0 0019.81 18.4a.462.462 0 01.623.18.46.46 0 01-.181.624 2.863 2.863 0 01-1.38.353l-.142-.004a2.88 2.88 0 01-2.393-4.263.461.461 0 01.274-.21zm.864-.931a2.884 2.884 0 013.915 3.914.46.46 0 01-.402.24l-.057-.004a.458.458 0 01-.164-.055.46.46 0 01-.182-.622 1.967 1.967 0 00-2.669-2.67.459.459 0 11-.441-.803zM9.59 6.368c1.481 0 1.696 1.202 1.696 1.654v2.648h-.917v-.432c-.26.346-.792.535-1.36.535-.133 0-1.289-.03-1.384-1.136-.082-.932.675-1.61 2.053-1.61h.691c0-.563-.367-.886-.983-.886-.44.013-.864.174-1.2.458l-.36-.664c.484-.379 1.012-.567 1.764-.567zm4.427.1c1.263 0 2.082.97 2.083 2.15 0 1.181-.824 2.154-2.083 2.154-1.26 0-2.084-.972-2.084-2.152 0-1.18.82-2.153 2.084-2.153zm6.801.015c.68 0 1.202.465 1.197 1.548v2.642H21.1V8.29c0-.312-.002-.98-.63-.98s-.628.667-.628.838v2.524h-.89V8.148c0-.17-.001-.838-.63-.838-.628 0-.628.668-.628.98v2.383h-.917v-4.03h.917V7a1.22 1.22 0 01.947-.516c.398 0 .76.193.982.686a1.321 1.321 0 011.195-.686zm-18.093.872l1.457-1.772H5.32L3.311 8.07l2.14 2.602H4.24L2.725 8.796 1.21 10.672H0L2.138 8.07.13 5.583h1.138l1.458 1.772zm4.149 3.317h-.916V6.644h.916v4.028zm16.99 0h-.916V6.644h.916v4.028zM9.925 8.71c-1.055 0-1.359.412-1.326.742.032.329.324.537.757.537a1.013 1.013 0 001.014-.968l.002-.31h-.447zM14.018 7.3c-.663 0-1.184.487-1.184 1.32 0 .832.52 1.32 1.184 1.32.662 0 1.182-.49 1.182-1.32 0-.832-.52-1.32-1.182-1.32zM6.417 5.001a.568.568 0 01.587.582.588.588 0 01-1.175 0A.57.57 0 016.417 5zm16.991 0a.57.57 0 01.592.582.588.588 0 01-1.174 0 .57.57 0 01.357-.542.572.572 0 01.225-.04z"></path></svg>
diff --git a/site/public/provider-icons/zhipu-color.svg b/site/public/provider-icons/zhipu-color.svg
new file mode 100644
index 000000000..40e5bea20
--- /dev/null
+++ b/site/public/provider-icons/zhipu-color.svg
@@ -0,0 +1 @@
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Zhipu</title><path d="M11.991 23.503a.24.24 0 00-.244.248.24.24 0 00.244.249.24.24 0 00.245-.249.24.24 0 00-.22-.247l-.025-.001zM9.671 5.365a1.697 1.697 0 011.099 2.132l-.071.172-.016.04-.018.054c-.07.16-.104.32-.104.498-.035.71.47 1.279 1.186 1.314h.366c1.309.053 2.338 1.173 2.286 2.523-.052 1.332-1.152 2.38-2.478 2.327h-.174c-.715.018-1.274.64-1.239 1.368 0 .124.018.23.053.337.209.373.54.658.96.8.75.23 1.517-.125 1.9-.782l.018-.035c.402-.64 1.17-.96 1.92-.711.854.284 1.378 1.226 1.099 2.167a1.661 1.661 0 01-2.077 1.102 1.711 1.711 0 01-.907-.711l-.017-.035c-.2-.323-.463-.58-.851-.711l-.056-.018a1.646 1.646 0 00-1.954.746 1.66 1.66 0 01-1.065.764 1.677 1.677 0 01-1.989-1.279c-.209-.906.332-1.83 1.257-2.043a1.51 1.51 0 01.296-.035h.018c.68-.071 1.151-.622 1.116-1.333a1.307 1.307 0 00-.227-.693 2.515 2.515 0 01-.366-1.403 2.39 2.39 0 01.366-1.208c.14-.195.21-.444.227-.693.018-.71-.506-1.261-1.186-1.332l-.07-.018a1.43 1.43 0 01-.299-.07l-.05-.019a1.7 1.7 0 01-1.047-2.114 1.68 1.68 0 012.094-1.101zm-5.575 10.11c.26-.264.639-.367.994-.27.355.096.633.379.728.74.095.362-.007.748-.267 1.013-.402.41-1.053.41-1.455 0a1.062 1.062 0 010-1.482zm14.845-.294c.359-.09.738.024.992.297.254.274.344.665.237 1.025-.107.36-.396.634-.756.718-.551.128-1.1-.22-1.23-.781a1.05 1.05 0 01.757-1.26zm-.064-4.39c.314.32.49.753.49 1.206 0 .452-.176.886-.49 1.206-.315.32-.74.5-1.185.5-.444 0-.87-.18-1.184-.5a1.727 1.727 0 010-2.412 1.654 1.654 0 012.369 0zm-11.243.163c.364.484.447 1.128.218 1.691a1.665 1.665 0 01-2.188.923c-.855-.36-1.26-1.358-.907-2.228a1.68 1.68 0 011.33-1.038c.593-.08 1.183.169 1.547.652zm11.545-4.221c.368 0 .708.2.892.524.184.324.184.724 0 1.048a1.026 1.026 0 01-.892.524c-.568 0-1.03-.47-1.03-1.048 0-.579.462-1.048 1.03-1.048zm-14.358 0c.368 0 .707.2.891.524.184.324.184.724 0 1.048a1.026 1.026 0 01-.891.524c-.569 0-1.03-.47-1.03-1.048 0-.579.461-1.048 1.03-1.048zm10.031-1.475c.925 0 1.675.764 1.675 1.706s-.75 1.705-1.675 1.705-1.674-.763-1.674-1.705c0-.942.75-1.706 1.674-1.706zm-2.626-.684c.362-.082.653-.356.761-.718a1.062 1.062 0 00-.238-1.028 1.017 1.017 0 00-.996-.294c-.547.14-.881.7-.752 1.257.13.558.675.907 1.225.783zm0 16.876c.359-.087.644-.36.75-.72a1.062 1.062 0 00-.237-1.019 1.018 1.018 0 00-.985-.301 1.037 1.037 0 00-.762.717c-.108.361-.017.754.239 1.028.245.263.606.377.953.305l.043-.01zM17.19 3.5a.631.631 0 00.628-.64c0-.355-.279-.64-.628-.64a.631.631 0 00-.628.64c0 .355.28.64.628.64zm-10.38 0a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64a.631.631 0 00-.628.64c0 .355.279.64.628.64zm-5.182 7.852a.631.631 0 00-.628.64c0 .354.28.639.628.639a.63.63 0 00.627-.606l.001-.034a.62.62 0 00-.628-.64zm5.182 9.13a.631.631 0 00-.628.64c0 .355.279.64.628.64a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64zm10.38.018a.631.631 0 00-.628.64c0 .355.28.64.628.64a.631.631 0 00.628-.64c0-.355-.279-.64-.628-.64zm5.182-9.148a.631.631 0 00-.628.64c0 .354.279.639.628.639a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64zm-.384-4.992a.24.24 0 00.244-.249.24.24 0 00-.244-.249.24.24 0 00-.244.249c0 .142.122.249.244.249zM11.991.497a.24.24 0 00.245-.248A.24.24 0 0011.99 0a.24.24 0 00-.244.249c0 .133.108.236.223.247l.021.001zM2.011 6.36a.24.24 0 00.245-.249.24.24 0 00-.244-.249.24.24 0 00-.244.249.24.24 0 00.244.249zm0 11.263a.24.24 0 00-.243.248.24.24 0 00.244.249.24.24 0 00.244-.249.252.252 0 00-.244-.248zm19.995-.018a.24.24 0 00-.245.248.24.24 0 00.245.25.24.24 0 00.244-.25.252.252 0 00-.244-.248z" fill="#3859FF" fill-rule="nonzero"></path></svg>
diff --git a/site/public/screenshots/book01.png b/site/public/screenshots/book01.png
new file mode 100644
index 000000000..3149dc29e
Binary files /dev/null and b/site/public/screenshots/book01.png differ
diff --git a/site/public/screenshots/book02.png b/site/public/screenshots/book02.png
new file mode 100644
index 000000000..c1754fae0
Binary files /dev/null and b/site/public/screenshots/book02.png differ
diff --git a/site/public/screenshots/book03.png b/site/public/screenshots/book03.png
new file mode 100644
index 000000000..d69776339
Binary files /dev/null and b/site/public/screenshots/book03.png differ
diff --git a/site/public/screenshots/chat-agent-loop.png b/site/public/screenshots/chat-agent-loop.png
new file mode 100644
index 000000000..2fe891ca0
Binary files /dev/null and b/site/public/screenshots/chat-agent-loop.png differ
diff --git a/site/public/screenshots/chat.png b/site/public/screenshots/chat.png
new file mode 100644
index 000000000..a806ca823
Binary files /dev/null and b/site/public/screenshots/chat.png differ
diff --git a/site/public/screenshots/co-writer.png b/site/public/screenshots/co-writer.png
new file mode 100644
index 000000000..a75bbd21f
Binary files /dev/null and b/site/public/screenshots/co-writer.png differ
diff --git a/site/public/screenshots/dt-agents.png b/site/public/screenshots/dt-agents.png
deleted file mode 100644
index e660caf36..000000000
Binary files a/site/public/screenshots/dt-agents.png and /dev/null differ
diff --git a/site/public/screenshots/dt-book.png b/site/public/screenshots/dt-book.png
deleted file mode 100644
index e1bd85230..000000000
Binary files a/site/public/screenshots/dt-book.png and /dev/null differ
diff --git a/site/public/screenshots/dt-chat.png b/site/public/screenshots/dt-chat.png
deleted file mode 100644
index cad59979d..000000000
Binary files a/site/public/screenshots/dt-chat.png and /dev/null differ
diff --git a/site/public/screenshots/dt-co-writer.png b/site/public/screenshots/dt-co-writer.png
deleted file mode 100644
index 3b64e0bbc..000000000
Binary files a/site/public/screenshots/dt-co-writer.png and /dev/null differ
diff --git a/site/public/screenshots/dt-current-home.png b/site/public/screenshots/dt-current-home.png
deleted file mode 100644
index aa1d3b6af..000000000
Binary files a/site/public/screenshots/dt-current-home.png and /dev/null differ
diff --git a/site/public/screenshots/dt-home.png b/site/public/screenshots/dt-home.png
deleted file mode 100644
index bb50b07d8..000000000
Binary files a/site/public/screenshots/dt-home.png and /dev/null differ
diff --git a/site/public/screenshots/dt-knowledge.png b/site/public/screenshots/dt-knowledge.png
deleted file mode 100644
index 4e402c6a9..000000000
Binary files a/site/public/screenshots/dt-knowledge.png and /dev/null differ
diff --git a/site/public/screenshots/dt-memory-l1.png b/site/public/screenshots/dt-memory-l1.png
deleted file mode 100644
index a219c586b..000000000
Binary files a/site/public/screenshots/dt-memory-l1.png and /dev/null differ
diff --git a/site/public/screenshots/dt-memory-l2.png b/site/public/screenshots/dt-memory-l2.png
deleted file mode 100644
index ad8a31608..000000000
Binary files a/site/public/screenshots/dt-memory-l2.png and /dev/null differ
diff --git a/site/public/screenshots/dt-memory-l3.png b/site/public/screenshots/dt-memory-l3.png
deleted file mode 100644
index c015ce2bf..000000000
Binary files a/site/public/screenshots/dt-memory-l3.png and /dev/null differ
diff --git a/site/public/screenshots/dt-memory.png b/site/public/screenshots/dt-memory.png
deleted file mode 100644
index 632bc5dfa..000000000
Binary files a/site/public/screenshots/dt-memory.png and /dev/null differ
diff --git a/site/public/screenshots/dt-playground.png b/site/public/screenshots/dt-playground.png
deleted file mode 100644
index 88a6cadae..000000000
Binary files a/site/public/screenshots/dt-playground.png and /dev/null differ
diff --git a/site/public/screenshots/dt-settings-capabilities.png b/site/public/screenshots/dt-settings-capabilities.png
deleted file mode 100644
index ed1b9dcd4..000000000
Binary files a/site/public/screenshots/dt-settings-capabilities.png and /dev/null differ
diff --git a/site/public/screenshots/dt-settings-llm.png b/site/public/screenshots/dt-settings-llm.png
deleted file mode 100644
index 4f6619721..000000000
Binary files a/site/public/screenshots/dt-settings-llm.png and /dev/null differ
diff --git a/site/public/screenshots/dt-settings-tools.png b/site/public/screenshots/dt-settings-tools.png
deleted file mode 100644
index 61e7df27a..000000000
Binary files a/site/public/screenshots/dt-settings-tools.png and /dev/null differ
diff --git a/site/public/screenshots/dt-settings.png b/site/public/screenshots/dt-settings.png
deleted file mode 100644
index 31ac1033e..000000000
Binary files a/site/public/screenshots/dt-settings.png and /dev/null differ
diff --git a/site/public/screenshots/dt-space.png b/site/public/screenshots/dt-space.png
deleted file mode 100644
index b90c215ad..000000000
Binary files a/site/public/screenshots/dt-space.png and /dev/null differ
diff --git a/site/public/screenshots/knowledge.png b/site/public/screenshots/knowledge.png
new file mode 100644
index 000000000..1f7d342f3
Binary files /dev/null and b/site/public/screenshots/knowledge.png differ
diff --git a/site/public/screenshots/memory-graph.png b/site/public/screenshots/memory-graph.png
new file mode 100644
index 000000000..c5b6cfafe
Binary files /dev/null and b/site/public/screenshots/memory-graph.png differ
diff --git a/site/public/screenshots/memory-workbench.png b/site/public/screenshots/memory-workbench.png
new file mode 100644
index 000000000..70b747549
Binary files /dev/null and b/site/public/screenshots/memory-workbench.png differ
diff --git a/site/public/screenshots/memory.png b/site/public/screenshots/memory.png
new file mode 100644
index 000000000..055624fe6
Binary files /dev/null and b/site/public/screenshots/memory.png differ
diff --git a/site/public/screenshots/multi-user.png b/site/public/screenshots/multi-user.png
new file mode 100644
index 000000000..150709178
Binary files /dev/null and b/site/public/screenshots/multi-user.png differ
diff --git a/site/public/screenshots/partners-architecture.png b/site/public/screenshots/partners-architecture.png
new file mode 100644
index 000000000..ceff290a7
Binary files /dev/null and b/site/public/screenshots/partners-architecture.png differ
diff --git a/site/public/screenshots/partners-channel-dingtalk.png b/site/public/screenshots/partners-channel-dingtalk.png
new file mode 100644
index 000000000..170bb551d
Binary files /dev/null and b/site/public/screenshots/partners-channel-dingtalk.png differ
diff --git a/site/public/screenshots/partners-channel-discord.png b/site/public/screenshots/partners-channel-discord.png
new file mode 100644
index 000000000..2efef0a4a
Binary files /dev/null and b/site/public/screenshots/partners-channel-discord.png differ
diff --git a/site/public/screenshots/partners-channel-email.png b/site/public/screenshots/partners-channel-email.png
new file mode 100644
index 000000000..458a435b1
Binary files /dev/null and b/site/public/screenshots/partners-channel-email.png differ
diff --git a/site/public/screenshots/partners-channel-feishu.png b/site/public/screenshots/partners-channel-feishu.png
new file mode 100644
index 000000000..d3071c040
Binary files /dev/null and b/site/public/screenshots/partners-channel-feishu.png differ
diff --git a/site/public/screenshots/partners-channel-matrix.png b/site/public/screenshots/partners-channel-matrix.png
new file mode 100644
index 000000000..6fc0fed03
Binary files /dev/null and b/site/public/screenshots/partners-channel-matrix.png differ
diff --git a/site/public/screenshots/partners-channel-mochat.png b/site/public/screenshots/partners-channel-mochat.png
new file mode 100644
index 000000000..a8ba5dec5
Binary files /dev/null and b/site/public/screenshots/partners-channel-mochat.png differ
diff --git a/site/public/screenshots/partners-channel-msteams.png b/site/public/screenshots/partners-channel-msteams.png
new file mode 100644
index 000000000..c770aca05
Binary files /dev/null and b/site/public/screenshots/partners-channel-msteams.png differ
diff --git a/site/public/screenshots/partners-channel-napcat.png b/site/public/screenshots/partners-channel-napcat.png
new file mode 100644
index 000000000..aac39fb86
Binary files /dev/null and b/site/public/screenshots/partners-channel-napcat.png differ
diff --git a/site/public/screenshots/partners-channel-qq.png b/site/public/screenshots/partners-channel-qq.png
new file mode 100644
index 000000000..5e0be61e4
Binary files /dev/null and b/site/public/screenshots/partners-channel-qq.png differ
diff --git a/site/public/screenshots/partners-channel-slack.png b/site/public/screenshots/partners-channel-slack.png
new file mode 100644
index 000000000..689ced13b
Binary files /dev/null and b/site/public/screenshots/partners-channel-slack.png differ
diff --git a/site/public/screenshots/partners-channel-telegram.png b/site/public/screenshots/partners-channel-telegram.png
new file mode 100644
index 000000000..2f42b20cd
Binary files /dev/null and b/site/public/screenshots/partners-channel-telegram.png differ
diff --git a/site/public/screenshots/partners-channel-wecom.png b/site/public/screenshots/partners-channel-wecom.png
new file mode 100644
index 000000000..51489184c
Binary files /dev/null and b/site/public/screenshots/partners-channel-wecom.png differ
diff --git a/site/public/screenshots/partners-channel-weixin.png b/site/public/screenshots/partners-channel-weixin.png
new file mode 100644
index 000000000..a3985d72e
Binary files /dev/null and b/site/public/screenshots/partners-channel-weixin.png differ
diff --git a/site/public/screenshots/partners-channel-whatsapp.png b/site/public/screenshots/partners-channel-whatsapp.png
new file mode 100644
index 000000000..0a164685a
Binary files /dev/null and b/site/public/screenshots/partners-channel-whatsapp.png differ
diff --git a/site/public/screenshots/partners-channel-zulip.png b/site/public/screenshots/partners-channel-zulip.png
new file mode 100644
index 000000000..d4e5f6e07
Binary files /dev/null and b/site/public/screenshots/partners-channel-zulip.png differ
diff --git a/site/public/screenshots/partners-channels.png b/site/public/screenshots/partners-channels.png
new file mode 100644
index 000000000..170bb551d
Binary files /dev/null and b/site/public/screenshots/partners-channels.png differ
diff --git a/site/public/screenshots/partners-configure.png b/site/public/screenshots/partners-configure.png
new file mode 100644
index 000000000..6d72868cd
Binary files /dev/null and b/site/public/screenshots/partners-configure.png differ
diff --git a/site/public/screenshots/partners-detail.png b/site/public/screenshots/partners-detail.png
new file mode 100644
index 000000000..2cac9c721
Binary files /dev/null and b/site/public/screenshots/partners-detail.png differ
diff --git a/site/public/screenshots/partners-new.png b/site/public/screenshots/partners-new.png
new file mode 100644
index 000000000..991970aa5
Binary files /dev/null and b/site/public/screenshots/partners-new.png differ
diff --git a/site/public/screenshots/partners-weixin-channel.png b/site/public/screenshots/partners-weixin-channel.png
new file mode 100644
index 000000000..50d6e3aa1
Binary files /dev/null and b/site/public/screenshots/partners-weixin-channel.png differ
diff --git a/site/public/screenshots/partners.png b/site/public/screenshots/partners.png
new file mode 100644
index 000000000..b992d9559
Binary files /dev/null and b/site/public/screenshots/partners.png differ
diff --git a/site/public/screenshots/settings-appearance.png b/site/public/screenshots/settings-appearance.png
new file mode 100644
index 000000000..f985b75d9
Binary files /dev/null and b/site/public/screenshots/settings-appearance.png differ
diff --git a/site/public/screenshots/settings-capabilities.png b/site/public/screenshots/settings-capabilities.png
new file mode 100644
index 000000000..8b645b976
Binary files /dev/null and b/site/public/screenshots/settings-capabilities.png differ
diff --git a/site/public/screenshots/settings-embedding.png b/site/public/screenshots/settings-embedding.png
new file mode 100644
index 000000000..0a656fdfa
Binary files /dev/null and b/site/public/screenshots/settings-embedding.png differ
diff --git a/site/public/screenshots/settings-llm.png b/site/public/screenshots/settings-llm.png
new file mode 100644
index 000000000..a190dc231
Binary files /dev/null and b/site/public/screenshots/settings-llm.png differ
diff --git a/site/public/screenshots/settings-mcp.png b/site/public/screenshots/settings-mcp.png
new file mode 100644
index 000000000..364c78c70
Binary files /dev/null and b/site/public/screenshots/settings-mcp.png differ
diff --git a/site/public/screenshots/settings-memory.png b/site/public/screenshots/settings-memory.png
new file mode 100644
index 000000000..69c321da3
Binary files /dev/null and b/site/public/screenshots/settings-memory.png differ
diff --git a/site/public/screenshots/settings-mineru.png b/site/public/screenshots/settings-mineru.png
new file mode 100644
index 000000000..dc1e2628e
Binary files /dev/null and b/site/public/screenshots/settings-mineru.png differ
diff --git a/site/public/screenshots/settings-network.png b/site/public/screenshots/settings-network.png
new file mode 100644
index 000000000..933504b06
Binary files /dev/null and b/site/public/screenshots/settings-network.png differ
diff --git a/site/public/screenshots/settings-search.png b/site/public/screenshots/settings-search.png
new file mode 100644
index 000000000..f2a917dfc
Binary files /dev/null and b/site/public/screenshots/settings-search.png differ
diff --git a/site/public/screenshots/settings-status.png b/site/public/screenshots/settings-status.png
new file mode 100644
index 000000000..06ee003a7
Binary files /dev/null and b/site/public/screenshots/settings-status.png differ
diff --git a/site/public/screenshots/settings-tools.png b/site/public/screenshots/settings-tools.png
new file mode 100644
index 000000000..cc75a948d
Binary files /dev/null and b/site/public/screenshots/settings-tools.png differ
diff --git a/site/public/screenshots/settings.png b/site/public/screenshots/settings.png
new file mode 100644
index 000000000..0a94af93d
Binary files /dev/null and b/site/public/screenshots/settings.png differ
diff --git a/site/public/screenshots/space.png b/site/public/screenshots/space.png
new file mode 100644
index 000000000..6afd41fa4
Binary files /dev/null and b/site/public/screenshots/space.png differ
diff --git a/site/scripts/capture-screenshots.mjs b/site/scripts/capture-screenshots.mjs
new file mode 100644
index 000000000..a9fe7900b
--- /dev/null
+++ b/site/scripts/capture-screenshots.mjs
@@ -0,0 +1,106 @@
+// DeepTutor docs screenshot capture — drives a running DeepTutor web UI and
+// writes 1470x836@2x light-theme shots into site/public/screenshots/.
+// Needs the `playwright` npm package + chromium (npx playwright install chromium).
+// Usage: node capture-screenshots.mjs [job ...] (no args = list jobs)
+// PARTNER=<id> node capture-screenshots.mjs channels # per-channel cards
+import { chromium } from "playwright";
+
+const BASE = process.env.BASE ?? "http://localhost:3784";
+const OUT = process.env.OUT ?? new URL("../public/screenshots", import.meta.url).pathname;
+const CHANNELS = [
+ "weixin", "wecom", "qq", "napcat", "telegram", "discord", "slack",
+ "feishu", "dingtalk", "matrix", "zulip", "whatsapp", "email", "mochat", "msteams",
+];
+const DISPLAY = {
+ weixin: "WeChat", wecom: "WeCom", qq: "QQ", napcat: "QQ (NapCat)",
+ telegram: "Telegram", discord: "Discord", slack: "Slack", feishu: "Feishu",
+ dingtalk: "DingTalk", matrix: "Matrix", zulip: "Zulip", whatsapp: "WhatsApp",
+ email: "Email", mochat: "Mochat", msteams: "Microsoft Teams",
+};
+
+const browser = await chromium.launch();
+const ctx = await browser.newContext({
+ viewport: { width: 1470, height: 836 },
+ deviceScaleFactor: 2,
+ colorScheme: "light",
+});
+// Hide personal session titles in the sidebar on every page.
+await ctx.addInitScript(() => {
+ try { localStorage.setItem("deeptutor.sidebar.recentsCollapsed", "1"); } catch {}
+});
+const page = await ctx.newPage();
+
+async function go(path, delay = 1500) {
+ await page.goto(BASE + path, { waitUntil: "networkidle", timeout: 30000 }).catch(() => {});
+ await page.waitForTimeout(delay);
+}
+async function shot(name) {
+ await page.screenshot({ path: `${OUT}/${name}.png` });
+ console.log("shot", name);
+}
+
+const jobs = {
+ // simple page shots: job name -> [path, file]
+ partners: ["/partners", "partners"],
+ "partners-new": ["/partners/new", "partners-new"],
+ chat: ["/chat", "chat"],
+ knowledge: ["/knowledge", "knowledge"],
+ book: ["/book", "book"],
+ "co-writer": ["/co-writer", "co-writer"],
+ learning: ["/learning", "learning"],
+ space: ["/space", "space"],
+ memory: ["/memory", "memory"],
+ "memory-graph": ["/memory/graph", "memory-graph"],
+ "settings-appearance": ["/settings/appearance", "settings-appearance"],
+ "settings-llm": ["/settings/llm", "settings-llm"],
+ "settings-embedding": ["/settings/embedding", "settings-embedding"],
+ "settings-search": ["/settings/search", "settings-search"],
+ "settings-mineru": ["/settings/mineru", "settings-mineru"],
+ "settings-capabilities": ["/settings/capabilities", "settings-capabilities"],
+ "settings-memory": ["/settings/memory", "settings-memory"],
+ "settings-mcp": ["/settings/mcp", "settings-mcp"],
+ "settings-tools": ["/settings/tools", "settings-tools"],
+ "settings-network": ["/settings/network", "settings-network"],
+ "settings-status": ["/settings/status", "settings-status"],
+};
+
+async function openPartnerTab(partnerId, tabText) {
+ await go(`/partners/${partnerId}`);
+ await page.click(`button:has-text("${tabText}")`);
+ await page.waitForTimeout(1200);
+}
+
+async function channelShots(partnerId) {
+ await openPartnerTab(partnerId, "Channels");
+ for (const ch of CHANNELS) {
+ const label = DISPLAY[ch];
+ const btn = page.locator("aside button", { hasText: label }).first();
+ await btn.click();
+ await page.waitForTimeout(900);
+ await shot(`partners-channel-${ch}`);
+ }
+}
+
+const args = process.argv.slice(2);
+if (args.length === 0) {
+ console.log("jobs:", [...Object.keys(jobs), "channels", "partner-detail"].join(" "));
+} else {
+ for (const a of args) {
+ if (a === "channels") {
+ await channelShots(process.env.PARTNER ?? "frank");
+ } else if (a === "partner-detail") {
+ const pid = process.env.PARTNER ?? "frank";
+ await openPartnerTab(pid, "Configure");
+ await shot("partners-configure");
+ await openPartnerTab(pid, "Channels");
+ await shot("partners-channels");
+ } else if (jobs[a]) {
+ const [path, file] = jobs[a];
+ await go(path);
+ await shot(file);
+ } else {
+ console.error("unknown job", a);
+ }
+ }
+}
+await browser.close();
diff --git a/site/scripts/gen-channel-icons.mjs b/site/scripts/gen-channel-icons.mjs
new file mode 100644
index 000000000..dc1fa1874
--- /dev/null
+++ b/site/scripts/gen-channel-icons.mjs
@@ -0,0 +1,83 @@
+// Export DeepTutor's ChannelIcon.tsx artwork as standalone SVG files for the
+// docs site. Sources mirror web/components/partners/ChannelIcon.tsx exactly.
+import { writeFileSync, mkdirSync } from "node:fs";
+
+const OUT = "/Users/frank/HKUDS/DeepTutor/site/public/channel-icons";
+mkdirSync(OUT, { recursive: true });
+
+const BRAND_PATHS = {
+ discord: { hex: "#5865F2", path: "M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z" },
+ matrix: { hex: "#666666", path: "M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033c.309-.443.683-.784 1.117-1.024.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.481.314.448.208.785.582 1.02 1.108.254-.374.6-.706 1.034-.992.434-.287.95-.43 1.546-.43.453 0 .872.056 1.26.167.388.11.716.286.993.53.276.245.489.559.646.951.152.392.23.863.23 1.417v5.728h-2.349V11.52c0-.286-.01-.559-.032-.812a1.755 1.755 0 0 0-.18-.66 1.106 1.106 0 0 0-.438-.448c-.194-.11-.457-.166-.785-.166-.332 0-.6.064-.803.189a1.38 1.38 0 0 0-.48.499 1.946 1.946 0 0 0-.231.696 5.56 5.56 0 0 0-.06.785v4.768h-2.35v-4.8c0-.254-.004-.503-.018-.752a2.074 2.074 0 0 0-.143-.688 1.052 1.052 0 0 0-.415-.503c-.194-.125-.476-.19-.854-.19-.111 0-.259.024-.439.074-.18.051-.36.143-.53.282-.171.138-.319.337-.439.595-.12.259-.18.6-.18 1.02v4.966H5.46V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z" },
+ qq: { hex: "#1EBAFC", path: "M21.395 15.035a40 40 0 0 0-.803-2.264l-1.079-2.695c.001-.032.014-.562.014-.836C19.526 4.632 17.351 0 12 0S4.474 4.632 4.474 9.241c0 .274.013.804.014.836l-1.08 2.695a39 39 0 0 0-.802 2.264c-1.021 3.283-.69 4.643-.438 4.673.54.065 2.103-2.472 2.103-2.472 0 1.469.756 3.387 2.394 4.771-.612.188-1.363.479-1.845.835-.434.32-.379.646-.301.778.343.578 5.883.369 7.482.189 1.6.18 7.14.389 7.483-.189.078-.132.132-.458-.301-.778-.483-.356-1.233-.646-1.846-.836 1.637-1.384 2.393-3.302 2.393-4.771 0 0 1.563 2.537 2.103 2.472.251-.03.581-1.39-.438-4.673" },
+ telegram: { hex: "#26A5E4", path: "M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z" },
+ whatsapp: { hex: "#25D366", path: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z" },
+ weixin: { hex: "#07C160", path: "M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665l-.39 1.48c-.019.07-.048.141-.048.213c0 .163.13.295.29.295a.33.33 0 0 0 .167-.054l1.903-1.114a.86.86 0 0 1 .717-.098a10.2 10.2 0 0 0 2.837.403c.276 0 .543-.027.811-.05c-.857-2.578.157-4.972 1.932-6.446c1.703-1.415 3.882-1.98 5.853-1.838c-.576-3.583-4.196-6.348-8.596-6.348M5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178A1.17 1.17 0 0 1 4.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178a1.17 1.17 0 0 1-1.162-1.178c0-.651.52-1.18 1.162-1.18m5.34 2.867c-1.797-.052-3.746.512-5.28 1.786c-1.72 1.428-2.687 3.72-1.78 6.22c.942 2.453 3.666 4.229 6.884 4.229c.826 0 1.622-.12 2.361-.336a.72.72 0 0 1 .598.082l1.584.926a.3.3 0 0 0 .14.047c.134 0 .24-.111.24-.247c0-.06-.023-.12-.038-.177l-.327-1.233a.6.6 0 0 1-.023-.156a.49.49 0 0 1 .201-.398C23.024 18.48 24 16.82 24 14.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53 3.274c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983a.976.976 0 0 1-.969-.983c0-.542.434-.982.97-.982zm4.844 0c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983a.976.976 0 0 1-.969-.983c0-.542.434-.982.969-.982" },
+ zulip: { hex: "#6492FE", path: "M22.767 3.589c0 1.209-.543 2.283-1.37 2.934l-8.034 7.174c-.149.128-.343-.078-.235-.25l2.946-5.9c.083-.165-.024-.368-.194-.368H4.452c-1.77 0-3.219-1.615-3.219-3.59C1.233 1.616 2.682 0 4.452 0h15.096c1.77-.001 3.219 1.614 3.219 3.589zM4.452 24h15.096c1.77 0 3.219-1.616 3.219-3.59 0-1.974-1.449-3.59-3.219-3.59H8.12c-.17 0-.277-.202-.194-.367l2.946-5.9c.108-.172-.086-.378-.235-.25l-8.033 7.173c-.828.65-1.37 1.725-1.37 2.934 0 1.974 1.448 3.59 3.218 3.59z" },
+};
+
+const svg = (viewBox, inner) =>
+ `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${viewBox}">${inner}</svg>\n`;
+
+for (const [name, { hex, path }] of Object.entries(BRAND_PATHS)) {
+ writeFileSync(`${OUT}/${name}.svg`, svg("0 0 24 24", `<path fill="${hex}" d="${path}"/>`));
+}
+
+// Feishu — ByteDance IconPark `new-lark` stroke style.
+const feishuBlue = "#3370FF";
+writeFileSync(`${OUT}/feishu.svg`, svg("0 0 48 48",
+ `<g fill="none">` +
+ `<path stroke="${feishuBlue}" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M17 29C21 29 25 26.9339 28 23.4065C36 14 41.4242 16.8166 44 17.9998C38.5 20.9998 40.5 29.6233 33 35.9998C28.382 39.9259 23.4945 41.014 19 41C12.5231 40.9799 6.86226 37.7637 4 35.4063V16.9998"/>` +
+ `<path fill="${feishuBlue}" d="M5.64808 15.8669C5.02231 14.9567 3.77715 14.7261 2.86694 15.3519C1.95673 15.9777 1.72615 17.2228 2.35192 18.1331L5.64808 15.8669ZM36.0021 35.7309C36.958 35.1774 37.2843 33.9539 36.7309 32.9979C36.1774 32.042 34.9539 31.7157 33.9979 32.2691L36.0021 35.7309ZM2.35192 18.1331C5.2435 22.339 10.7992 28.144 16.8865 32.2239C19.9345 34.2667 23.217 35.946 26.449 36.7324C29.6946 37.522 33.0451 37.4428 36.0021 35.7309L33.9979 32.2691C32.2049 33.3072 29.9929 33.478 27.3947 32.8458C24.783 32.2103 21.9405 30.7958 19.1135 28.9011C13.4508 25.106 8.2565 19.661 5.64808 15.8669L2.35192 18.1331Z"/>` +
+ `<path stroke="${feishuBlue}" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M33.5947 17C32.84 14.7027 30.8551 9.94054 27.5947 7H11.5947C15.2174 10.6757 23.0002 16 27.0002 24"/>` +
+ `</g>`));
+
+// WeCom — TDesign `logo-wecom`, five brand-colored subpaths.
+const WECOM_PARTS = [
+ { hex: "#0082EF", path: "M17.326 8.158l-.003-.007a6.6 6.6 0 0 0-1.178-1.674c-1.266-1.307-3.067-2.19-5.102-2.417a9.3 9.3 0 0 0-2.124 0h-.001c-2.061.228-3.882 1.107-5.14 2.405a6.7 6.7 0 0 0-1.194 1.682A5.7 5.7 0 0 0 2 10.657c0 1.106.332 2.218.988 3.201l.006.01c.391.594 1.092 1.39 1.637 1.83l.983.793l-.208.875l.527-.267l.708-.358l.761.225c.467.137.955.227 1.517.29h.005q.515.06 1.026.059c.355 0 .724-.02 1.095-.06a9 9 0 0 0 1.346-.258c.095.7.43 1.337.932 1.81c-.658.208-1.352.358-2.061.436c-.442.048-.883.072-1.312.072q-.627 0-1.253-.072a10.7 10.7 0 0 1-1.861-.36l-2.84 1.438s-.29.131-.44.131c-.418 0-.702-.285-.702-.704c0-.252.067-.598.128-.84l.394-1.653c-.728-.586-1.563-1.544-2.052-2.287A7.76 7.76 0 0 1 0 10.658a7.7 7.7 0 0 1 .787-3.39a8.7 8.7 0 0 1 1.551-2.19c1.61-1.665 3.878-2.73 6.359-3.006a11.3 11.3 0 0 1 2.565 0c2.47.275 4.712 1.353 6.323 3.017a8.6 8.6 0 0 1 1.539 2.192c.466.945.769 1.937.769 2.978a3.06 3.06 0 0 0-2-.005c-.001-.644-.189-1.329-.564-2.09z" },
+ { hex: "#2CB800", path: "M21.451 15.135l-.024-.024l-.024-.018l-.024-.018l-.096-.095a4.24 4.24 0 0 1-1.169-2.192q0-.038-.006-.075l-.006-.056l-.035-.144a1.3 1.3 0 0 0-.358-.61a1.386 1.386 0 0 0-1.957 0a1.4 1.4 0 0 0 0 1.963c.191.191.418.311.668.371c.024.012.06.012.084.012q.019 0 .041.006q.023.005.042.006a4.24 4.24 0 0 1 2.231 1.186c.048.048.096.095.131.143a.323.323 0 0 0 .466 0a.35.35 0 0 0 .036-.455" },
+ { hex: "#0081EE", path: "M20.401 19.505l-.025.025c-.119.096-.31.096-.453-.036a.326.326 0 0 1 0-.467c.047-.036.094-.083.141-.13l.002-.002a4.27 4.27 0 0 0 1.187-2.28q.005-.024.006-.043c0-.024 0-.06.012-.084a1.386 1.386 0 0 1 2.326-.67a1.4 1.4 0 0 1 0 1.964c-.167.18-.382.299-.608.359l-.143.036l-.057.005q-.035.006-.075.007a4.2 4.2 0 0 0-2.183 1.173l-.095.096q-.009.01-.018.024t-.018.024" },
+ { hex: "#FB6500", path: "M16.008 18.453l.024.024l.024.018q.015.009.024.018l.096.096a4.25 4.25 0 0 1 1.169 2.19q0 .04.006.076q.005.03.006.057l.035.143c.06.228.18.443.358.611c.537.539 1.42.539 1.957 0a1.4 1.4 0 0 0 0-1.964a1.4 1.4 0 0 0-.668-.371c-.024-.012-.06-.012-.084-.012q-.018 0-.041-.006l-.042-.006a4.25 4.25 0 0 1-2.231-1.185a1.4 1.4 0 0 1-.131-.144a.323.323 0 0 0-.466 0a.325.325 0 0 0-.036.455" },
+ { hex: "#FFCC00", path: "M17.047 14.095l.024-.024a.32.32 0 0 1 .453.035a.326.326 0 0 1 0 .467c-.047.036-.094.083-.141.13l-.002.002a4.27 4.27 0 0 0-1.187 2.281l-.006.042c0 .024 0 .06-.012.084a1.386 1.386 0 0 1-2.326.67a1.4 1.4 0 0 1 0-1.963c.166-.18.381-.3.608-.36l.143-.035q.026 0 .056-.006q.037-.005.075-.006a4.2 4.2 0 0 0 2.183-1.174l.096-.095l.018-.025z" },
+];
+writeFileSync(`${OUT}/wecom.svg`, svg("0 0 24 24",
+ WECOM_PARTS.map((p) => `<path fill="${p.hex}" d="${p.path}"/>`).join("")));
+
+// Microsoft Teams — SVG Logos set, gradient flattened.
+const MSTEAMS_PATHS = [
+ { hex: "#5059C9", path: "M178.563 89.302h66.125c6.248 0 11.312 5.065 11.312 11.312v60.231c0 22.96-18.613 41.574-41.573 41.574h-.197c-22.96.003-41.576-18.607-41.579-41.568V95.215a5.91 5.91 0 0 1 5.912-5.913" },
+ { hex: "#7B83EB", path: "M191.506 89.302H82.355c-6.173.153-11.056 5.276-10.913 11.449v68.697c-.862 37.044 28.445 67.785 65.488 68.692c37.043-.907 66.35-31.648 65.489-68.692v-68.697c.143-6.173-4.74-11.296-10.913-11.449" },
+ { hex: "#4D55BD", path: "M10.913 53.581h109.15c6.028 0 10.914 4.886 10.914 10.913v109.151c0 6.027-4.886 10.913-10.913 10.913H10.913C4.886 184.558 0 179.672 0 173.645V64.495C0 58.466 4.886 53.58 10.913 53.58" },
+ { hex: "#FFFFFF", path: "M94.208 95.125h-21.82v59.416H58.487V95.125H36.769V83.599h57.439z" },
+];
+writeFileSync(`${OUT}/msteams.svg`, svg("0 0 256 239",
+ `<circle cx="223.256" cy="50.605" r="26.791" fill="#5059C9"/>` +
+ `<circle cx="139.907" cy="38.698" r="38.698" fill="#7B83EB"/>` +
+ MSTEAMS_PATHS.map((p) => `<path fill="${p.hex}" d="${p.path}"/>`).join("")));
+
+// DingTalk — Ant Design Icons `dingtalk`.
+writeFileSync(`${OUT}/dingtalk.svg`, svg("0 0 1024 1024",
+ `<path fill="#0089FF" d="M573.7 252.5C422.5 197.4 201.3 96.7 201.3 96.7c-15.7-4.1-17.9 11.1-17.9 11.1c-5 61.1 33.6 160.5 53.6 182.8c19.9 22.3 319.1 113.7 319.1 113.7S326 357.9 270.5 341.9c-55.6-16-37.9 17.8-37.9 17.8c11.4 61.7 64.9 131.8 107.2 138.4c42.2 6.6 220.1 4 220.1 4s-35.5 4.1-93.2 11.9c-42.7 5.8-97 12.5-111.1 17.8c-33.1 12.5 24 62.6 24 62.6c84.7 76.8 129.7 50.5 129.7 50.5c33.3-10.7 61.4-18.5 85.2-24.2L565 743.1h84.6L603 928l205.3-271.9H700.8l22.3-38.7c.3.5.4.8.4.8S799.8 496.1 829 433.8l.6-1h-.1c5-10.8 8.6-19.7 10-25.8c17-71.3-114.5-99.4-265.8-154.5"/>`));
+
+// NapCat — Lucide cat (ISC) in white on a QQ-blue rounded badge.
+writeFileSync(`${OUT}/napcat.svg`, svg("0 0 24 24",
+ `<rect width="24" height="24" rx="5" fill="#1EBAFC"/>` +
+ `<g transform="translate(3.36 3.36) scale(0.72)" fill="none" stroke="#FFFFFF" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round">` +
+ `<path d="M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3.1-9-7.56c0-1.2.43-2.37 1-3.44 0 0-1.82-6.42-.42-7 1.39-.58 4.64.25 6.42 2.26.65-.17 1.33-.26 2-.26Z"/>` +
+ `<path d="M8 14v.5"/><path d="M16 14v.5"/><path d="M11.25 16.25h1.5L12 17l-.75-.75Z"/>` +
+ `</g>`));
+
+// Slack / Mochat — brand-colored letter badges (no clean vector source).
+const letterBadge = (label, hex) => svg("0 0 24 24",
+ `<rect width="24" height="24" rx="5" fill="${hex}"/>` +
+ `<text x="12" y="12" fill="#FFFFFF" font-family="system-ui, -apple-system, 'Segoe UI', sans-serif" font-size="14" font-weight="600" text-anchor="middle" dominant-baseline="central">${label}</text>`);
+writeFileSync(`${OUT}/slack.svg`, letterBadge("S", "#4A154B"));
+writeFileSync(`${OUT}/mochat.svg`, letterBadge("M", "#07C160"));
+
+// Email — Lucide mail (ISC), neutral gray.
+writeFileSync(`${OUT}/email.svg`, svg("0 0 24 24",
+ `<g fill="none" stroke="#71717a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">` +
+ `<rect width="20" height="16" x="2" y="4" rx="2"/>` +
+ `<path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>` +
+ `</g>`));
+
+console.log("generated", 15, "channel icons into", OUT);
diff --git a/site/src/content/docs/docs/cli/agent-handoff.md b/site/src/content/docs/docs/cli/agent-handoff.md
index 4df3075de..96ad816ec 100644
--- a/site/src/content/docs/docs/cli/agent-handoff.md
+++ b/site/src/content/docs/docs/cli/agent-handoff.md
@@ -236,7 +236,7 @@ The shipped [`SKILL.md`](https://github.com/HKUDS/DeepTutor/blob/main/SKILL.md)
1. **When to Use** — what kinds of user requests should trigger DeepTutor
2. **Prerequisites** — Python 3.11+, install path, `deeptutor init`
-3. **Commands** — Chat & Capabilities, Knowledge Bases, TutorBot, Memory, Sessions, Notebooks, System
+3. **Commands** — Chat & Capabilities, Knowledge Bases, Partners, Memory, Sessions, Notebooks, System
4. **REPL Slash Commands** — the commands available inside `deeptutor chat`
5. **Typical Workflows** — end-to-end recipes an agent can replay
diff --git a/site/src/content/docs/docs/cli/commands.md b/site/src/content/docs/docs/cli/commands.md
index 4b9909927..c947d8bc1 100644
--- a/site/src/content/docs/docs/cli/commands.md
+++ b/site/src/content/docs/docs/cli/commands.md
@@ -316,23 +316,23 @@ Manual consolidation isn't a CLI command — fire it from the **Memory Workbench
curl -X POST http://localhost:8001/api/v1/memory/runs/start
```
-## `deeptutor bot` — TutorBot lifecycle
+## `deeptutor partner` — Partner lifecycle
```bash
-deeptutor bot list
+deeptutor partner list
-deeptutor bot create my-bot \
+deeptutor partner create math-tutor \
--name "Math Mentor" \
- --persona "Socratic tutor specializing in algebra and calculus" \
+ --soul "Socratic tutor specializing in algebra and calculus" \
--model gpt-4o
-# `create` starts the bot immediately. Use start later if it was stopped.
-deeptutor bot stop my-bot
+deeptutor partner stop math-tutor
+deeptutor partner start math-tutor
```
-Subcommands: `list`, `create`, `start`, `stop`. `create` writes the bot config and starts it in one step. Delete a bot by removing its workspace directory at `data/tutorbot/<bot_id>/` while it's stopped.
+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.
-Channel configs (Telegram, Slack, etc.) live in the bot's YAML under `data/tutorbot/<bot_id>/`. See [**Explore TutorBot**](/docs/tutorbot/) for per-channel setup.
+Partners run inside `data/partners/<partner_id>/workspace/`. See [**Partners & Channels**](/docs/partners/) for channel setup.
## `deeptutor config show`
diff --git a/site/src/content/docs/docs/cli/index.md b/site/src/content/docs/docs/cli/index.md
index cdde8c077..6f94bf54c 100644
--- a/site/src/content/docs/docs/cli/index.md
+++ b/site/src/content/docs/docs/cli/index.md
@@ -31,8 +31,8 @@ deeptutor run deep_solve "Find the derivative of sin(x²)" --tool reason --forma
deeptutor kb create physics --doc chapter1.pdf
deeptutor kb search physics "What is angular momentum?"
-# Run a TutorBot
-deeptutor bot create my-bot --persona "Socratic math tutor"
+# Run a Partner
+deeptutor partner create my-bot --persona "Socratic math tutor"
# Inspect three-layer memory
deeptutor memory show L3
@@ -47,7 +47,7 @@ This means:
- Core learning flows can be driven from the terminal; browser-only editing and admin screens expose their state through the Web UI / API
- `deeptutor run --format json` emits one JSON event per line; data-inspection commands such as `kb list`, `kb search`, `session show`, and `notebook show` also expose JSON where implemented
- Sessions persist across turns — you can switch between Web, REPL, and one-shot `run` calls and resume where you left off
-- The CLI is the best automation entry point for turns, KBs, sessions, notebooks, memory, TutorBots, config inspection, plugins, providers, and Books
+- The CLI is the best automation entry point for turns, KBs, sessions, notebooks, memory, Partners, config inspection, plugins, providers, and Books
## Top-level command map
@@ -62,7 +62,7 @@ This means:
| `deeptutor session` | Session inspection | `deeptutor session list / show <id>` |
| `deeptutor notebook` | Notebook records | `deeptutor notebook create / add-md` |
| `deeptutor memory` | Three-layer memory store | `deeptutor memory show L3` |
-| `deeptutor bot` | TutorBot lifecycle | `deeptutor bot create / start / stop` (`create` starts the bot immediately) |
+| `deeptutor partner` | Partner lifecycle | `deeptutor partner create / start / stop` (`create` writes config and starts it) |
| `deeptutor config` | View runtime configuration | `deeptutor config show` |
| `deeptutor plugin` | Capability / tool registry | `deeptutor plugin list` |
| `deeptutor provider` | Provider auth flows | `deeptutor provider login openai-codex` |
@@ -127,7 +127,7 @@ $ deeptutor --help
│ session Session inspection. │
│ notebook Notebook records. │
│ memory Three-layer memory store. │
-│ bot TutorBot lifecycle. │
+│ partner Partner lifecycle. │
│ config View runtime configuration. │
│ plugin Capability / tool registry. │
│ provider Provider auth flows. │
@@ -140,5 +140,5 @@ And every subcommand:
```text
$ deeptutor run --help
$ deeptutor kb create --help
-$ deeptutor bot start --help
+$ deeptutor partner start --help
```
diff --git a/site/src/content/docs/docs/cli/server-api.md b/site/src/content/docs/docs/cli/server-api.md
index 8a3cfe5da..f8634f4ae 100644
--- a/site/src/content/docs/docs/cli/server-api.md
+++ b/site/src/content/docs/docs/cli/server-api.md
@@ -193,23 +193,37 @@ POST /api/v1/system/test/search
Provider profiles are edited through the catalog endpoints; there are not separate `/settings/llm` or `/settings/embedding` routes in the current API.
-## TutorBot Manager
+## Partners Manager
```text
-GET /api/v1/tutorbot
-POST /api/v1/tutorbot
-GET /api/v1/tutorbot/recent
-GET /api/v1/tutorbot/channels/schema
-GET /api/v1/tutorbot/{bot_id}
-PATCH /api/v1/tutorbot/{bot_id}
-DELETE /api/v1/tutorbot/{bot_id}
-DELETE /api/v1/tutorbot/{bot_id}/destroy
-GET /api/v1/tutorbot/{bot_id}/files
-PUT /api/v1/tutorbot/{bot_id}/files/{filename}
-GET /api/v1/tutorbot/{bot_id}/history
-WS /api/v1/tutorbot/{bot_id}/ws
+GET /api/v1/partners
+POST /api/v1/partners
+GET /api/v1/partners/recent
+GET /api/v1/partners/channels/schema
+GET /api/v1/partners/tool-options
+GET /api/v1/partners/souls
+POST /api/v1/partners/souls
+GET /api/v1/partners/soul-sources
+GET /api/v1/partners/{partner_id}
+PATCH /api/v1/partners/{partner_id}
+POST /api/v1/partners/{partner_id}/start
+POST /api/v1/partners/{partner_id}/stop
+DELETE /api/v1/partners/{partner_id}
+POST /api/v1/partners/{partner_id}/channels/reload
+GET /api/v1/partners/{partner_id}/soul
+PUT /api/v1/partners/{partner_id}/soul
+GET /api/v1/partners/{partner_id}/assets
+POST /api/v1/partners/{partner_id}/assets
+DELETE /api/v1/partners/{partner_id}/assets/{asset_type}/{name}
+GET /api/v1/partners/{partner_id}/history
+GET /api/v1/partners/{partner_id}/sessions
+POST /api/v1/partners/{partner_id}/chat
+POST /api/v1/partners/{partner_id}/chat/execute-stream
+WS /api/v1/partners/{partner_id}/ws
```
+Partners are admin-gated because their workspace and channel credentials are deployment-scoped. Secrets are masked by default; edit forms request `include_secrets=true` only when necessary.
+
## Book Engine
```text
diff --git a/site/src/content/docs/docs/explore/book.md b/site/src/content/docs/docs/explore/book.md
index eb675bcd1..b1f717313 100644
--- a/site/src/content/docs/docs/explore/book.md
+++ b/site/src/content/docs/docs/explore/book.md
@@ -1,93 +1,49 @@
---
title: Book Engine
-description: A multi-agent pipeline that compiles your materials into interactive "living books" with 13 block types.
+description: Build interactive living books from knowledge bases, notebooks, question banks, and chat history.
---
-Give DeepTutor a topic, point it at your knowledge base, and **Book Engine** produces a structured, interactive book — not a static export, but a living document you can read, quiz yourself on, and discuss in context.
+Book turns your materials into interactive learning content. A book can start from a topic plus selected sources, then compile into pages with explanations, quizzes, visual blocks, and reader notes.
-## How it works
+<p align="center">
+ <img src="/screenshots/book01.png" alt="Book reading view" width="31%" />
+ <img src="/screenshots/book02.png" alt="Book interactive block view" width="31%" />
+ <img src="/screenshots/book03.png" alt="Book creation view" width="31%" />
+</p>
-Behind the scenes, a multi-agent pipeline handles the heavy lifting:
+## Creation flow
-1. **Outline proposal** — given your topic + KB, propose chapter structure
-2. **Source retrieval** — pull relevant passages from the KB
-3. **Chapter tree synthesis** — assemble a hierarchical chapter outline
-4. **Page planning** — for each page, plan which blocks go where
-5. **Block compilation** — generate each block (text, quiz, code, figure, …)
+1. Open **Book -> New book**.
+2. Choose a topic and sources: Knowledge Bases, Notebooks, Question Bank, or Chat history.
+3. Review the generated proposal before compiling.
+4. Let BookEngine generate page plans and blocks.
+5. Read, annotate, quiz yourself, or chat alongside pages.
-You stay in control: review the proposal, reorder chapters, and chat alongside any page.
+## Block types
-## The 13 block types
+Book pages are built from typed blocks: text, sections, callouts, quiz, flash cards, timeline, code, figure, interactive HTML, animation, concept graph, deep dive, and user note. The goal is not to produce a PDF-like dump; the page should stay usable as a learning environment.
-Pages are assembled from 13 block types, each rendered with its own interactive component:
+## Source drift
-| Block | What it is |
-|-------|-----------|
-| **Text** | Standard prose paragraphs |
-| **Callout** | Tip / Warning / Note / Important — colored sidebar boxes |
-| **Quiz** | Inline interactive question; answers checked against an expected response |
-| **Flash cards** | Front / back flipping cards for spaced repetition |
-| **Code** | Syntax-highlighted snippet with optional executable runtime |
-| **Figure** | Image with caption + alt text |
-| **Deep dive** | Collapsible section for advanced / optional material |
-| **Animation** | Manim-rendered video |
-| **Interactive demo** | Embedded interactive HTML (including a **GeoGebra viewer** for math) |
-| **Timeline** | Vertical event timeline |
-| **Concept graph** | Mini knowledge graph showing relationships between concepts |
-| **Section** | A grouping container for nested blocks |
-| **User note** | Editable rich-text area for the reader's own notes |
-
-## KB fingerprinting and drift detection
-
-Book pages are **fingerprinted against their source KB**. When source documents change:
-
-- `deeptutor book health <book_id>` reports drift (which pages are stale)
-- `deeptutor book refresh-fingerprints <book_id>` clears stale-page flags when you've acknowledged the changes
-
-This makes it safe to use Book Engine on KBs that evolve — you'll know when a page is no longer in sync.
-
-## Working with a book
-
-In the Web UI:
-
-1. Navigate to **Book** in the left sidebar
-2. **+ New book** → pick a topic, attach a KB
-3. Review and edit the proposed outline
-4. Confirm — the pipeline compiles each page
-5. Open a page to read, quiz yourself, or chat alongside
-
-## From the CLI
+Books track source fingerprints. If a knowledge base changes after a book is compiled, maintenance commands help you inspect drift:
```bash
-deeptutor book list # all books in the workspace
-deeptutor book health <book_id> # KB drift report
-deeptutor book refresh-fingerprints <book_id> # mark stale pages as acknowledged
-```
-
-JSON output for health:
-
-```json
-{
- "kb_drift": {
- "kb_name": "physics",
- "stale_pages": ["page_abc", "page_def"],
- "drift_ratio": 0.12
- },
- "log_health": {
- "last_compile": "2026-05-20T14:23:01Z",
- "errors": []
- }
-}
+deeptutor book list
+deeptutor book health <book_id>
+deeptutor book refresh-fingerprints <book_id>
```
-## Pairs well with
+## Good source choices
-- **Knowledge** — A book is only as good as its KB. Start there.
-- **Chat alongside the page** — Each page has its own chat composer pinned to it; ask follow-ups grounded in the page content.
-- **Notebooks** — Save chat takeaways from book reading into a notebook for later review.
+| Source | Use when |
+| --- | --- |
+| Knowledge Base | You want grounded textbook/paper content. |
+| Notebook | You have curated notes or prior summaries. |
+| Question Bank | You want practice-centered pages. |
+| Chat History | You want to turn a tutoring session into study material. |
## See also
-- [**Knowledge**](/docs/explore/knowledge/) — build the KB that backs a book
-- [**Space → Notebooks**](/docs/explore/space/) — save book discussions
-- [**CLI → book commands**](/docs/cli/commands/)
+- [Knowledge](/docs/explore/knowledge/) — build document libraries first
+- [Chat Workspace](/docs/explore/chat-workspace/) — discuss book pages in context
+- [CLI commands](/docs/cli/commands/) — book maintenance commands
diff --git a/site/src/content/docs/docs/explore/chat-workspace.md b/site/src/content/docs/docs/explore/chat-workspace.md
index 9f2e49791..2a5fd3a10 100644
--- a/site/src/content/docs/docs/explore/chat-workspace.md
+++ b/site/src/content/docs/docs/explore/chat-workspace.md
@@ -1,162 +1,69 @@
---
title: Chat Workspace
-description: One thread, five modes, any tool. The unified intelligent workspace at the heart of DeepTutor.
+description: "The default DeepTutor agent loop: tools, RAG, attachments, memory, notebooks, and deeper capabilities in one thread."
---
-The Chat Workspace is where most users spend their time. It's a single conversation surface that hosts **five modes** sharing one session, knowledge base, attachments, and references.
+Chat is where most work begins. It is not just a message box: it is the default agent loop that can call tools, read sources, search knowledge bases, write notes, ask for clarification, and switch into deeper capabilities without losing the session.
-Switch mid-thread from a casual question into multi-agent solving, into a quiz, into a full research report — without losing context.
+![Chat workspace](/screenshots/chat.png)
-![Chat Workspace](/screenshots/dt-current-home.png)
-
-## Anatomy of the screen
+## What you see
| Region | What it does |
-|--------|--------------|
-| **Left sidebar** | Navigation across all surfaces; chat history at the top |
-| **Top toolbar** | Save current turn to a Notebook, download as Markdown, start a new chat, open Activity / Viewer side panels |
-| **Composer** (center) | Where you type — mode selector, attach, Knowledge picker, Space picker, model selector |
-| **Activity panel** *(right, toggle)* | Real-time stream of pipeline stages, tool calls, timings |
-| **Viewer panel** *(right, toggle)* | Renders generated artifacts: SVG, Mermaid, Chart.js, HTML, Manim video |
-
-## The five modes
-
-The capability picker is in the composer. Switch any time — the conversation context persists.
-
-### Chat
-
-Flexible conversation with any tool. The default mode — covers about 80% of questions.
-
-The chat pipeline runs an **agentic loop**: LLM call → parse protocol labels (THINK / TOOL / FINISH) → dispatch tool calls in parallel → feed results back → iterate until FINISH or context guard.
-
-**Tools available in Chat mode** (composed per-turn based on context):
-
-| Tool | Mounted when… |
-|------|---------------|
-| `rag` | A KB is attached |
-| `read_source` | Any non-image source attached |
-| `read_memory` / `write_memory` | Always |
-| `web_search` | Toggled in Settings → Tools |
-| `web_fetch` | Always |
-| `code_execution` | Toggled in Settings |
-| `reason` | Toggled in Settings |
-| `brainstorm` | Toggled in Settings |
-| `paper_search` | Toggled in Settings |
-| `geogebra_analysis` | When math image attached |
-| `list_notebook` / `write_note` | ≥1 notebook exists |
-| `github_query` | Always |
-| `ask_user` | Always |
-
-### Solve
-
-Multi-step problem-solving: plan → investigate → solve → verify, with precise source citations. Built on the `deep_solve` agentic engine.
-
-When to use: math problems that need step-by-step work, physics with multiple subproblems, algorithm questions where reasoning should be explicit.
-
-Tools commonly enabled: `rag`, `reason`, `code_execution`, `web_search`.
-
-### Quiz
-
-Auto-validated question generation grounded in your KB. Spawns a follow-up chat composer per question for discussion / hints / grading. Built on the `deep_question` agentic engine.
-
-Three modes inside Quiz:
-
-- **Custom** *(default)* — generate from a topic
-- **Mimic** — upload a past exam paper, generate new questions in the same style
-- **Followup** — discuss prior quiz questions without generating new ones
-
-Configurable: `num_questions`, `difficulty`, `question_types` (short_answer / mcq / numerical / code), `per_type_counts`.
+| --- | --- |
+| **Left sidebar** | Main surfaces: Chat, Partners, Co-Writer, Book, Knowledge, Space, Memory, Settings. Recents show resumable sessions. |
+| **Composer** | Message box, capability selector, file/context attachment, persona, model selector, and send button. |
+| **Activity panel** | Tool calls, intermediate progress, source previews, and generated artifacts. |
+| **Notebook / Markdown actions** | Save useful turns to notebooks or export a session as Markdown. |
-### Research
+## The agent loop
-Decomposes a topic into subtopics, dispatches **parallel agents** across RAG / web / arXiv, produces a cited report with iterative append-mode revisions.
+![Chat agent loop](/screenshots/chat-agent-loop.png)
-Flow:
+A turn can take several rounds:
-1. **Rephrasing** — restates your question precisely
-2. **Decomposing** — proposes a 3–7 sub-topic outline ★ (you confirm / edit here)
-3. **Researching** — parallel agentic loops per sub-topic
-4. **Reporting** — synthesizes structured Markdown report with citations
+1. The model drafts a response or tool plan.
+2. If tools are needed, DeepTutor dispatches them and appends the observations.
+3. The model continues with better evidence.
+4. A final tool-free answer ends the turn.
-The outline confirmation step is the killer UX feature: you steer the research before the expensive work runs.
+`ask_user` is special: it pauses the turn, asks structured clarification questions, and resumes after you answer.
-### Visualize
+## Capabilities launched from Chat
-The unified visualization capability — analyzer picks `render_type` based on intent:
+| Capability | Use it for |
+| --- | --- |
+| `chat` | Normal tutoring, open-ended Q&A, lightweight tool use. |
+| `deep_solve` | Worked solutions, multi-step reasoning, verification. |
+| `deep_question` | Question generation, quiz-style practice, mimic-source workflows. |
+| `deep_research` | Subtopic decomposition, RAG/web/arXiv research, cited reports. |
+| `visualize` | SVG, Chart.js, Mermaid, HTML, and routed animation outputs. |
+| `math_animator` | Manim-heavy math animation workflows. |
+| `auto` | Let DeepTutor choose the right capability. |
+| `mastery_path` | Learning-path and mastery planning flows. |
-| Render type | Best for | Output |
-|-------------|----------|--------|
-| `svg` | Static diagrams, icons | Inline SVG |
-| `chartjs` | Bar / line / pie / scatter charts | Interactive canvas |
-| `mermaid` | Flowcharts, sequence diagrams, state machines | Mermaid SVG |
-| `html` | Interactive demos, mini-apps | Sandboxed iframe |
-| `manim_video` | Math animations | MP4 (requires `[math-animator]` extra) |
-| `manim_image` | Math storyboards | PNG |
+## Tools
-> Math Animator is **not a separate capability** — it's just two of Visualize's six render types (`manim_video` / `manim_image`).
+User-toggleable tools in Settings are `brainstorm`, `web_search`, `paper_search`, and `reason`. Contextual tools mount automatically when useful: `rag`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, and `github`.
-## Cumulative source inventory
+## Practical examples
-A session carries citations across turns. RAG / web hits from earlier turns remain reusable later in the same conversation — the model can reference them by index.
-
-## Attachments
-
-Click **Attach** to bring files into the turn:
-
-| Type | Sources |
-|------|---------|
-| **PDFs, DOCX, XLSX, PPTX** | Direct upload — routed through the appropriate extractor |
-| **Images** | Direct upload — vision models OCR / interpret |
-| **Notebook records** | Space → Notebooks picker |
-| **History sessions** | Space → Chat History picker |
-| **Question Bank entries** | Space → Question Bank picker |
-| **Book references** | Book Engine pages |
-
-Attachments don't go into the system prompt — they show up as **tool-readable sources**. The model uses `read_source` to load full content when needed.
-
-## Top-right actions
-
-| Button | What it does |
-|--------|--------------|
-| **Save to Notebook** | Save the current turn as a record in a notebook |
-| **Download Markdown** | Export the current turn as `.md` |
-| **New chat** | Start a fresh session |
-| **Activity** | Real-time stream of pipeline events (stages, tool calls, timings) |
-| **Viewer** | Renders generated artifacts (SVG, Mermaid, Chart.js, HTML, Manim) |
-
-## `ask_user` mid-turn
-
-If the model needs clarification, it can call the `ask_user` tool, which **pauses the turn** and renders 1–3 structured questions in the chat. Answer them, click Submit, and the turn resumes with your answers in context.
-
-## Session continuity
-
-Every conversation has a session id. Sessions persist across:
+```text
+Attach a KB + ask: "Explain chapter 4 and quiz me on the weak spots."
+```
-- Browser refreshes / restarts
-- Mode switches within the same session
-- Web UI ↔ CLI boundary
+```text
+Attach a PDF + ask: "Extract the assumptions and save the final summary to my notebook."
+```
```bash
-# Resume a Web session from CLI
-deeptutor chat --session sess_abc123
+deeptutor run chat "Explain Fourier transform" --tool rag --kb signals
+deeptutor chat --capability deep_research --kb papers
```
-Sessions started in CLI show up in the Web sidebar (and vice versa).
-
-## Memory awareness
-
-The model has built-in access to your L3 memory via the `read_memory` tool. After a few sessions, it knows:
-
-- Your background (`profile.md`)
-- Your knowledge scope (`scope.md`)
-- Your explicit preferences (`preferences.md`)
-- Recent learnings (`recent.md`)
-
-See [**Memory**](/docs/explore/memory/) for the full three-layer architecture.
-
## See also
-- [**Memory**](/docs/explore/memory/) — three-layer persistent memory + Memory Graph
-- [**Knowledge**](/docs/explore/knowledge/) — RAG-ready Knowledge Bases
-- [**Space**](/docs/explore/space/) — read / review hub
-- [**Settings**](/docs/explore/settings/) — providers, tools, capabilities
+- [Partners](/docs/explore/partners/) — the same loop inside IM companions
+- [Knowledge](/docs/explore/knowledge/) — RAG libraries for chat grounding
+- [Memory](/docs/explore/memory/) — inspectable personalization
+- [CLI](/docs/cli/) — run the same turns from terminal
diff --git a/site/src/content/docs/docs/explore/co-writer.md b/site/src/content/docs/docs/explore/co-writer.md
index 25fb160ad..e6e4a5214 100644
--- a/site/src/content/docs/docs/explore/co-writer.md
+++ b/site/src/content/docs/docs/explore/co-writer.md
@@ -1,125 +1,51 @@
---
title: Co-Writer
-description: A Markdown editor where AI is a first-class collaborator — Edit Agent, Narrator Agent, document templates.
+description: A selection-aware Markdown workspace where AI edits can be grounded in your KB or the web.
---
-**Co-Writer** is DeepTutor's Markdown editor designed around AI collaboration. It has two integrated AI agents:
-
-- **Edit Agent** — refines selected text (rewrite, expand, condense, change tone)
-- **Narrator Agent** — generates new content (continue writing, fill outline, explain concept)
-
-Plus document templates, version history, and integration with Knowledge Bases.
+Co-Writer is a Markdown workspace for notes, reports, tutorials, and product/learning drafts. It pairs a source editor with live preview and lets the agent edit selected text instead of replacing your whole document.
## Opening Co-Writer
-Click **Co-Writer** in the left navigation, or open `/co-writer`. The first time you visit, you'll see the document picker. Pick **+ New document** to start fresh, or open a recent one.
-
-## The editor
-
-A standard Markdown editor with two panes:
-
-| Pane | What |
-|------|------|
-| **Left** | Source Markdown — type, edit, format |
-| **Right** | Rendered preview (toggle off if you want full-width source) |
-
-Keyboard shortcuts:
-
-| Key | Action |
-|-----|--------|
-| `⌘B` / `Ctrl+B` | Bold |
-| `⌘I` / `Ctrl+I` | Italic |
-| `⌘K` / `Ctrl+K` | Insert link |
-| `⌘S` / `Ctrl+S` | Save (autosaves anyway) |
-| `⌘/` / `Ctrl+/` | Toggle AI sidebar |
-
-## The AI sidebar
-
-Open with `⌘/`. Two tabs:
-
-### Edit (selection-based)
-
-Select text in the editor, then pick an Edit action:
-
-| Action | What it does |
-|--------|--------------|
-| Rewrite | Same meaning, different words |
-| Expand | Add detail, context, examples |
-| Condense | Shorten while keeping the key points |
-| Change tone | Formal / casual / academic / friendly |
-| Fix grammar | Light edits only |
-| Translate | To another language |
-
-The Edit Agent replaces the selected text with the result. Undo with `⌘Z`.
-
-### Narrator (cursor-based)
-
-Place your cursor where you want new content, then:
-
-| Action | What it does |
-|--------|--------------|
-| Continue | Continue writing from this point |
-| Fill outline | Convert your bullet outline into prose |
-| Explain | Add an explanation of the previous paragraph |
-| Cite from KB | Look up something in an attached KB and add a citation |
-
-The Narrator Agent inserts at the cursor.
-
-## Attaching context
-
-Just like Chat, you can attach context to Co-Writer:
-
-- **Knowledge Base** — Narrator can pull from your KB when generating
-- **History session** — Reference a prior Chat / Research turn
-- **Notebook records** — Pull from saved snippets
-
-Click the paperclip icon in the AI sidebar.
-
-## Templates
-
-DeepTutor ships sample templates:
-
-| Template | Good for |
-|----------|---------|
-| Research memo | Multi-source synthesis with citations |
-| Lecture notes | Outline + filled sections |
-| Problem set solutions | Worked solutions with code blocks |
-| Reading log | One entry per paper / chapter |
-
-Pick one when creating a new document. Templates pre-fill structure and prompts the agents understand contextually.
-
-## Embedding capability outputs
+Open **Co-Writer** from the sidebar or visit `/co-writer`. Create a blank draft or start from the sample template.
-You can embed results from other DeepTutor capabilities directly into a document:
+## Editor model
-- **Deep Solve output** → drag the solution into Co-Writer
-- **Visualize artifact** → embedded as an inline SVG / Mermaid block
-- **Quiz** → embedded as expandable details block
+![Co-Writer editor with Markdown source on the left and live preview on the right](/screenshots/co-writer.png)
-## Saving and exporting
+The workspace is a split view: Markdown source on the left, rendered preview on the right, with the formatting toolbar above the editor. Selecting text in the source pane surfaces the AI edit entry (`rewrite`, `expand`, `shorten`) without leaving the document.
-Documents are auto-saved every few seconds. Manual export options:
+| Part | What it does |
+| --- | --- |
+| **Document list** | Create, open, rename, and delete Markdown drafts. |
+| **Source editor** | Write Markdown, tables, code, math, Mermaid-style diagrams, and structured notes. |
+| **Preview pane** | Render the document while you write. |
+| **Selection popover** | Select text and run `rewrite`, `expand`, or `shorten`. |
+| **Save to Notebook** | Preserve a finished draft as reusable context. |
-- **Download .md** — raw Markdown
-- **Download .pdf** — rendered via Pandoc
-- **Copy to clipboard** — for pasting into other tools
+## AI edits
-## Version history
+The edit agent receives the selected text, your instruction, optional KB context, optional web context, and the surrounding document. This makes it useful for:
-Click the clock icon in the top-right to see version history. Co-Writer keeps:
+- tightening an explanation without changing the section structure,
+- expanding terse notes into a tutorial paragraph,
+- shortening a long draft before moving it to a notebook,
+- grounding a claim against a selected knowledge base.
-- All saves from the last 24 hours
-- Hourly snapshots for the last 7 days
-- Daily snapshots indefinitely
+## Recommended workflow
-Revert to a prior version with one click.
+1. Draft roughly in Markdown.
+2. Select only the paragraph that needs help.
+3. Use **Rewrite**, **Expand**, or **Shorten**.
+4. Review the diff mentally before continuing.
+5. Save polished notes into a Notebook when they should become durable context.
-## Multi-user notes
+## Storage
-In multi-user mode, each user has their own Co-Writer document space. Sharing is on the roadmap (track [issue #498](https://github.com/HKUDS/DeepTutor/issues/498)).
+Co-Writer documents live under the active user workspace, so multi-user deployments keep each user's drafts isolated. Partners can use notebook/skill resources copied from a user's library, but they do not edit the user's Co-Writer drafts directly.
## See also
-- [**Knowledge Bases**](/docs/explore/knowledge/) — attach KBs for ground-truth citations
-- [**Chat Workspace**](/docs/explore/chat-workspace/) — run Visualize / Research and bring outputs into documents
-- [**Space**](/docs/explore/space/) — save and reuse durable outputs
+- [Chat Workspace](/docs/explore/chat-workspace/) — generate source material and save useful turns
+- [Space](/docs/explore/space/) — manage notebooks, skills, and personas
+- [Knowledge](/docs/explore/knowledge/) — provide grounded context for edits
diff --git a/site/src/content/docs/docs/explore/index.md b/site/src/content/docs/docs/explore/index.md
index d26bfaa56..01da82393 100644
--- a/site/src/content/docs/docs/explore/index.md
+++ b/site/src/content/docs/docs/explore/index.md
@@ -1,36 +1,32 @@
---
title: Overview
-description: A map of the Explore section — five core surfaces, three-layer Memory, and a unified Settings workbench.
+description: A map of the Explore section — Chat, Partners, Co-Writer, Book, Knowledge, Space, Memory, and Settings.
---
-DeepTutor is organised around **five core surfaces**, a **three-layer Memory** that sits underneath them, and a unified **Settings** workbench. This section walks each one; the table below is the map.
+DeepTutor is organized around connected learning surfaces that share one agent-native runtime. This section starts with the surfaces users touch every day, then explains the library, memory, and control layers underneath them.
-![DeepTutor home screen](/screenshots/dt-current-home.png)
+![Chat workspace](/screenshots/chat.png)
-## The five surfaces
+## Product map
| # | Surface | One-liner | Page |
|---|---------|-----------|------|
-| 1 | **Chat** | One thread, five modes (Chat / Solve / Quiz / Research / Visualize), any tool | [**Chat Workspace**](/docs/explore/chat-workspace/) |
-| 2 | **Co-Writer** | Split-view Markdown workbench where AI is a first-class collaborator | [**Co-Writer**](/docs/explore/co-writer/) |
-| 3 | **Book** | Multi-agent pipeline that compiles your materials into interactive "living books" | [**Book Engine**](/docs/explore/book/) |
-| 4 | **Knowledge** | Versioned RAG-ready document libraries (LlamaIndex end-to-end) | [**Knowledge Bases**](/docs/explore/knowledge/) |
-| 5 | **Space** | Read / review hub: Chat History, Notebooks, Question Bank, Skills | [**Space**](/docs/explore/space/) |
-
-## Plus
-
-| Surface | One-liner | Page |
-|---------|-----------|------|
-| **Memory** | Three-layer pipeline (L1 trace / L2 per-surface / L3 cross-surface) + Memory Graph | [**Memory**](/docs/explore/memory/) |
-| **Settings** | Unified control center — Models, Embedding, Search, Capabilities, Tools, Memory, MCP, Appearance, Status | [**Settings**](/docs/explore/settings/) |
+| 1 | **Chat** | Default agent loop: tools, RAG, attachments, notebook writes, and deeper capabilities in one thread | [**Chat Workspace**](/docs/explore/chat-workspace/) |
+| 2 | **Partners** | Persistent IM-connected companions with their own soul, library, and channels | [**Partners**](/docs/explore/partners/) |
+| 3 | **Co-Writer** | Selection-aware Markdown editor where AI edits can use KB or web context | [**Co-Writer**](/docs/explore/co-writer/) |
+| 4 | **Book** | Compile your materials into interactive living books | [**Book Engine**](/docs/explore/book/) |
+| 5 | **Knowledge** | LlamaIndex-backed, versioned RAG libraries | [**Knowledge Bases**](/docs/explore/knowledge/) |
+| 6 | **Space** | Skills, personas, notebooks, history, and reusable context assets | [**Space**](/docs/explore/space/) |
+| 7 | **Memory** | L1 trace, L2 per-surface facts, L3 cross-surface synthesis, and graph audit | [**Memory**](/docs/explore/memory/) |
+| 8 | **Settings** | Models, embeddings, search, tools, MCP, network, memory, and runtime control | [**Settings**](/docs/explore/settings/) |
## How they fit together
-- **Capabilities live inside Chat.** Solve / Quiz / Research / Visualize are not separate top-level tabs — they're modes you switch into mid-thread, sharing the session, knowledge base, attachments, and citation history of the surrounding chat.
-- **Tools stay decoupled from workflows.** Built-in tools (RAG, web search, code execution, reason, brainstorm, paper search, `ask_user`, `web_fetch`, `write_note`, `list_notebook`, `github_query`) compose freely on top of every mode. Add MCP servers in Settings to extend.
-- **Memory is the substrate.** Every surface reads from and writes to the same three-layer Memory store, so what you learn in Chat surfaces in Co-Writer, in a TutorBot conversation, or in a Book reading session.
-- **Sessions cross surfaces.** A session started in the Web UI shows up in the CLI (and vice versa); a chat session can be saved into a Notebook, attached to a Book page, or referenced from Co-Writer.
+- **Chat is the default loop.** `chat`, `deep_solve`, `deep_question`, `deep_research`, `visualize`, `math_animator`, `auto`, and `mastery_path` run through the same orchestrated runtime.
+- **Partners reuse Chat, not a separate bot engine.** A partner message becomes a scoped chat turn inside `data/partners/<id>/workspace/`.
+- **Tools are mounted by context.** User-toggleable tools are `brainstorm`, `web_search`, `paper_search`, and `reason`; contextual tools include RAG, source reading, memory, skills, notebooks, URL fetch, GitHub, ask-user, and sandboxed execution.
+- **Memory is inspectable.** The workbench and graph let you trace synthesized facts back to L2 summaries and raw L1 events.
## Next
-Start with [**Chat Workspace**](/docs/explore/chat-workspace/) — most users spend ~80% of their time there. From the CLI side, see the [**CLI overview**](/docs/cli/).
+Start with [**Chat Workspace**](/docs/explore/chat-workspace/) for the core interaction model, then read [**Partners**](/docs/explore/partners/) if you want DeepTutor inside IM channels.
diff --git a/site/src/content/docs/docs/explore/knowledge.md b/site/src/content/docs/docs/explore/knowledge.md
index 724de5230..5b4df5f15 100644
--- a/site/src/content/docs/docs/explore/knowledge.md
+++ b/site/src/content/docs/docs/explore/knowledge.md
@@ -1,131 +1,47 @@
---
title: Knowledge Bases
-description: A dedicated workspace for the document collections that power RAG. LlamaIndex end-to-end, versioned indexes, drift-resistant.
+description: LlamaIndex-backed, versioned document libraries for RAG, Chat, Co-Writer, Book, and Partners.
---
-A dedicated workspace for the document collections that power RAG. Each knowledge base is a versioned, searchable index over your documents — attach it to any chat turn, Co-Writer document, or Book.
+Knowledge Bases are the document libraries behind RAG. They can ground Chat turns, Co-Writer edits, Book generation, and Partner conversations.
-![Knowledge Workspace](/screenshots/dt-knowledge.png)
+![Knowledge workspace](/screenshots/knowledge.png)
-## Four tabs per KB
+## What a KB contains
-| Tab | What |
-|-----|------|
-| **Files** | Browse uploaded sources, preview PDFs inline, see per-file size / status |
-| **Add documents** | Drop in PDFs, Office files (DOCX / XLSX / PPTX), Markdown, plain text, and a wide range of code / data file types — routed through the appropriate extractor automatically |
-| **Index versions** | Every (re-)index is a tracked version. Roll back to an earlier index, compare embedding models, or inspect chunking stats without losing the previous build |
-| **Settings** | Pick the embedding provider / model, chunking parameters, and reranker. Defaults inherit from your global LLM and embedding profiles |
+| Area | Purpose |
+| --- | --- |
+| **Files** | Source documents and extraction status. |
+| **Add documents** | Upload PDF, Office files, Markdown, text, code, and data files. |
+| **Index versions** | Flat `version-N` LlamaIndex storage directories keyed by embedding signature. |
+| **Settings** | Embedding model, chunking, and retrieval-related parameters. |
-## Built on LlamaIndex end-to-end
+## Versioning model
-Indexing is built on **LlamaIndex** end-to-end. The previous dual-pipeline split was consolidated in the v1.4 refactor. Features:
-
-- **Retry-safe re-index** — partial failures don't lose progress
-- **Embedding-mismatch detection** — if you change embedders, you're warned before silently producing bad results
-- **Resilient persisted-vector handling** — corrupt vectors are quarantined, not catastrophic
-- **Versioned indexes** — every re-index is a new version, comparable and rollback-able
-
-## Supported document types
-
-| Type | Notes |
-|------|-------|
-| **PDF** | Text extraction; OCR for scanned pages on a best-effort basis |
-| **DOCX** | Native Word documents |
-| **XLSX** | Spreadsheets — each sheet as a chunk batch |
-| **PPTX** | PowerPoint — each slide as a chunk |
-| **TXT / MD / HTML** | Cleaned and chunked |
-| **Code files** | Python / JS / TS / Go / Rust / many others |
-
-## Creating a KB
-
-In the UI:
-
-1. **Knowledge** in the left sidebar → **+ New knowledge base**
-2. Name it, pick a RAG provider *(defaults to LlamaIndex)*
-3. Upload documents — drag-and-drop or file picker
-4. **Create**
-
-DeepTutor extracts, chunks, embeds each chunk, and stores the vector index. For a 200-page PDF, this typically takes 1–3 minutes.
-
-## Default KB
-
-The KB with a ⭐ star is the **default** — auto-attached when you start a new chat. Click the star to change it.
-
-## Index versions
-
-Every (re-)index is tracked:
-
-- **Roll back** — restore a prior version if a re-index degraded retrieval quality
-- **Compare** — A/B different embedding models / chunking strategies on the same source documents
-- **Inspect** — chunking stats, embedding dimension, indexing duration
-
-## Searching from the UI
-
-Inside a KB, the search box runs an ad-hoc query. Three modes:
-
-| Mode | Algorithm |
-|------|-----------|
-| **Hybrid** *(default)* | Semantic embedding + BM25 keyword reranking |
-| **Vector** | Pure embedding |
-| **Keyword** | Pure BM25 |
-
-## Searching from chat
-
-Attach the KB in the composer and ask naturally — the model decides when to call `rag`:
-
-```text
-You> [KB: physics attached] What's the relationship between kinetic energy and momentum?
-
-Model> [calls rag tool]
- ● rag_search(query="kinetic energy momentum relationship", kb_name="physics")
- │ KE = p²/(2m), where p is momentum and m is mass...
- └ #1 rag
-
-Model> [synthesizes a reply citing the retrieved passages]
-```
-
-## Multi-KB workflows
-
-Attach multiple KBs to one turn. The model can query them in parallel. Useful for "compare two textbooks", "find the same concept across papers", etc.
+Re-indexing writes a new `version-N` directory and preserves prior versions. This protects a working index while a rebuild is in progress. Treat older versions as retained history and fallback storage, not as a full user-facing rollback workflow unless your deployment exposes that action.
## CLI mirror
```bash
-deeptutor kb list # all KBs
-deeptutor kb info physics # KB details
-deeptutor kb create physics --doc chapter1.pdf # create
-deeptutor kb create textbooks --docs-dir ./pdfs/ # from a directory
-deeptutor kb add physics --doc chapter3.pdf # incremental add
-deeptutor kb search physics "What is angular momentum?" # ad-hoc search
-deeptutor kb set-default physics # set as default
-deeptutor kb delete physics --force # delete
+deeptutor kb list
+deeptutor kb info physics
+deeptutor kb create physics --doc chapter1.pdf
+deeptutor kb create textbooks --docs-dir ./pdfs
+deeptutor kb add physics --doc chapter2.pdf
+deeptutor kb search physics "What is angular momentum?"
+deeptutor kb set-default physics
+deeptutor kb delete physics --force
```
-See [**Commands**](/docs/cli/commands/) for full flag reference.
-
-## Embedding provider
-
-The embedder is configured globally in **Settings → Embedding**. New KBs inherit it. Existing KBs keep their original embedder until re-indexed.
-
-| Provider | Notes |
-|----------|-------|
-| OpenAI | `text-embedding-3-small` (1536d) / `-large` (3072d) |
-| Cohere | `embed-v4.0` |
-| Jina | `jina-embeddings-v3` |
-| Gemini | `gemini-embedding-001` |
-| SiliconFlow | `Qwen/Qwen3-Embedding-8B` |
-| Aliyun DashScope | `qwen3-vl-embedding` |
-| Ollama | Local embedding models |
-| vLLM / LM Studio / OpenAI-compatible | Custom embedding endpoints |
-
-Full provider matrix: [**Providers**](/docs/get-started/providers/).
-
-## Multi-user
+## Tips
-In multi-user deployments, KBs are scoped per user. Admins can grant cross-user access (read / read+search / read+search+modify) at `/admin/grants` — see [**Multi-User Deployment**](/docs/get-started/multi-user/).
+- Configure an embedding provider before creating serious KBs.
+- If you change embedding models, re-index rather than mixing vector spaces.
+- Keep small test KBs for Partner/channel smoke tests.
+- For Docker, persist the whole `data/` tree so KB versions survive container restarts.
## See also
-- [**Chat Workspace**](/docs/explore/chat-workspace/) — attaching KBs to chat turns
-- [**Book Engine**](/docs/explore/book/) — books compile from a KB
-- [**Memory**](/docs/explore/memory/) — KBs are for documents; memory is for conversations
+- [Chat Workspace](/docs/explore/chat-workspace/) — attach KBs to turns
+- [Book Engine](/docs/explore/book/) — compile learning material from KBs
+- [Partners](/docs/explore/partners/) — copy KBs into partner workspaces
diff --git a/site/src/content/docs/docs/explore/memory.md b/site/src/content/docs/docs/explore/memory.md
index a3dfdac00..77966a4e7 100644
--- a/site/src/content/docs/docs/explore/memory.md
+++ b/site/src/content/docs/docs/explore/memory.md
@@ -1,172 +1,47 @@
---
title: Memory
-description: Three-layer pipeline (L1 / L2 / L3), an inspectable workbench, and the Memory Graph — audit *why* DeepTutor knows what it knows.
+description: Inspectable personalization through L1 traces, L2 surface summaries, L3 synthesis, and the Memory Graph.
---
-DeepTutor's memory is a **three-layer pipeline** with an inspectable workbench at `/memory`. The two-file v1 `SUMMARY.md` / `PROFILE.md` model is gone; everything is migrated into the new layout on first boot.
+Memory is DeepTutor's inspectable personalization system. It is not a hidden vector store; it is a file-backed three-layer pipeline that you can inspect, edit, and audit.
-![Memory Workbench](/images/dt-memory.png)
+![Memory workbench](/screenshots/memory-workbench.png)
-## The three layers
+## Three layers
-| Layer | Role | Storage |
-|-------|------|---------|
-| **L1 · Workspace mirror** *(LIVE)* | Append-only trace of every interaction, per surface, per day. The lossless record of what actually happened. | `trace/<surface>/<YYYY-MM-DD>.jsonl` |
-| **L2 · Per-surface summaries** *(CURATED)* | Surface-specific facts extracted by the consolidator. Each fact carries footnote citations back to L1 traces. Supports per-doc **Update / Audit / Dedup** runs. | `L2/<surface>.md` |
-| **L3 · Cross-surface knowledge** *(SYNTHESIS)* | Cross-surface synthesis: your `profile`, `recent` timeline, `scope` of knowledge, and `preferences`. Hedged claims, each backed by L2 evidence. | `L3/{recent,profile,scope,preferences}.md` |
+![Memory overview with L1, L2, and L3 layer cards](/screenshots/memory.png)
-## Seven surfaces feed the pipeline
+The Memory overview shows all three layers at a glance — live L1 traces, curated L2 facts per surface, synthesized L3 knowledge — plus the entry into the Memory graph. Click any layer card to inspect or curate it.
-| Surface | What L1 captures |
-|---------|------------------|
-| `chat` | Every chat turn (input, tool calls, output) |
-| `notebook` | Notebook creates / edits / deletes |
-| `quiz` | Quiz generations + your answers + grading results |
-| `kb` | KB creates / queries / indexing events |
-| `book` | Book reading sessions, page-level interactions |
-| `tutorbot` | TutorBot messages (across all channels) |
-| `cowriter` | Co-Writer document edits |
+| Layer | Storage | Role |
+| --- | --- | --- |
+| **L1 trace** | `trace/<surface>/<YYYY-MM-DD>.jsonl` | Append-only raw events. |
+| **L2 surface facts** | `L2/<surface>.md` | Curated facts per surface, with citations back to L1. |
+| **L3 synthesis** | `L3/<recent|profile|scope|preferences>.md` | Cross-surface summaries used for personalization. |
-## The consolidator
+Supported surfaces are `chat`, `notebook`, `quiz`, `kb`, `book`, `tutorbot`, and `cowriter`. The `tutorbot` surface name is retained for compatibility with earlier memory data, even though the product-facing companion model is now Partners.
-The consolidator is **LLM-driven** and runs asynchronously (`POST /memory/runs/start` — also reachable from the workbench). You can:
+The overview presents L1 as a **workspace mirror**: alongside the raw trace, DeepTutor keeps a per-surface snapshot of your live workspace, and refreshing it records changes into L1.
-- **Fire it manually** — from the workbench, click "Run consolidator"
-- **Watch L1 → L2 → L3 propagate** — live progress stream
-- **Edit any layer by hand** — your edits are merged on the next run
+## Memory Graph
-Default cadence (tunable in **Settings → Memory**):
+![Memory graph](/screenshots/memory-graph.png)
-| Pass | When |
-|------|------|
-| L1 → L2 (per surface) | Every N turns on that surface, or when triggered |
-| L2 → L3 cross-surface | First turn each day, or on demand |
+The graph view lets you trace a high-level L3 claim back to L2 supporting facts and then to L1 events. Use it when you want to answer: "Why does DeepTutor think it knows this about me?"
-## The Memory Workbench (Web UI)
-
-Open `/memory`. Five sub-views:
-
-| Tab | Route | What |
-|-----|-------|------|
-| **L3** | `/memory/l3` *(default)* | The four cross-surface docs |
-| **L2** | `/memory/l2` | Seven per-surface docs |
-| **L1** | `/memory/l1` | Raw event traces per surface, per day |
-| **Graph** | `/memory/graph` | The Memory Graph (see below) |
-| **Resolve** | `/memory/resolve` | Look up a footnote id → originating event |
-
-## L3 in detail
-
-Four markdown files:
-
-| File | Contents |
-|------|----------|
-| `recent.md` | A rolling summary of recent learning (last few days/weeks) — what you've been studying, what's open |
-| `profile.md` | Who you are: background, goals, role, learning style |
-| `scope.md` | Topics you've engaged with and a rough mastery indicator |
-| `preferences.md` | Explicit preferences: language for replies, depth, format, examples-first vs theory-first |
-
-**Only `preferences.md` is written by the model directly** (via the `write_memory` tool). The other three are managed by the consolidator agent; your manual edits get merged on the next pass.
-
-## L2 in detail
-
-Seven documents, one per surface. Each is a structured markdown file with **footnote-style citations** like `[^abc123]` that link back to specific L1 events.
-
-Per-doc actions in the workbench:
-
-- **Update** — re-run consolidation on this surface's recent L1 events
-- **Audit** — LLM checks the L2 for stale, contradictory, or unsupported claims
-- **Dedup** — merge near-duplicate bullet points
-
-## L1 in detail
-
-Per-surface daily JSONL:
-
-```jsonl
-{"id":"evt_001","timestamp":"2026-05-21T14:23:01Z","surface":"chat","kind":"turn","content":"User asked about the chain rule"}
-{"id":"evt_002","timestamp":"2026-05-21T14:23:18Z","surface":"chat","kind":"tool_call","content":"rag_search"}
-{"id":"evt_003","timestamp":"2026-05-21T14:24:38Z","surface":"chat","kind":"turn_complete","content":"Explained with worked example"}
-```
-
-L1 is rarely useful directly — but L2 footnotes reference these ids, and the **Resolve** view lets you trace a footnote back to its source.
-
-## The Memory Graph
-
-![Memory Graph](/images/dt-memgraph.png)
-
-The **Memory Graph** at `/memory/graph` renders **all three layers at once**:
-
-- **Center** — L3 synthesis nodes (`profile`, `recent`, `scope`, `preferences`)
-- **Middle ring** — L2 facts per surface
-- **Outer ring** — L1 traces, grouped by surface
-
-Hover any node for an inline preview. Click to **lock the highlight** and trace the L3 → L2 → L1 references inward — so you can audit *why* DeepTutor "knows" something about you.
-
-This is the killer feature: **transparent provenance**. Every claim DeepTutor makes about you, you can drill into.
-
-## How chat reads memory
-
-At the start of each chat turn, the system prompt includes concatenated L3 docs:
-
-```text
-─── User profile (from memory) ─────────────────────────────────────
-[recent.md content]
-
-[profile.md content]
-
-[scope.md content]
-
-[preferences.md content]
-─────────────────────────────────────────────────────────────────────
-```
-
-The model also has the `read_memory` tool for mid-turn lookups, and `write_memory` for persisting explicit preferences (≤240 chars, content-safety filtered, auto-linked to the triggering L1 event).
-
-## File layout
-
-```text
-data/user/memory/
-├── trace/
-│ ├── chat/2026-05-21.jsonl ← L1
-│ ├── chat/2026-05-22.jsonl
-│ ├── notebook/2026-05-22.jsonl
-│ ├── quiz/2026-05-22.jsonl
-│ ├── kb/2026-05-22.jsonl
-│ ├── book/2026-05-22.jsonl
-│ ├── tutorbot/2026-05-22.jsonl
-│ └── cowriter/2026-05-22.jsonl
-├── L2/
-│ ├── chat.md
-│ ├── notebook.md
-│ ├── quiz.md
-│ ├── kb.md
-│ ├── book.md
-│ ├── tutorbot.md
-│ └── cowriter.md
-└── L3/
- ├── recent.md
- ├── profile.md
- ├── scope.md
- └── preferences.md
-```
-
-In multi-user mode this lives under `multi-user/<uid>/memory/`.
-
-## CLI mirror
+## CLI
```bash
-deeptutor memory show # L3 concatenated (default)
-deeptutor memory show chat # an L2 surface doc
-deeptutor memory show profile # an L3 doc
-deeptutor memory clear all --force # wipe all layers (destructive)
-deeptutor memory clear chat # L1 for one surface
+deeptutor memory show L3
+deeptutor memory show L2
+deeptutor memory show profile
+deeptutor memory show chat
+deeptutor memory clear trace --force
```
-## Multi-user memory
-
-Each user has their own memory under `multi-user/<uid>/memory/`. Memory is **not shared across users** — even admins can't read another user's memory.
-
-## See also
+## Good practice
-- [**Chat Workspace**](/docs/explore/chat-workspace/) — how chat consumes / writes memory
-- [**Space → Notebooks**](/docs/explore/space/) — notebooks feed the `notebook` surface
-- [**Settings → Memory**](/docs/explore/settings/) — tune consolidation cadence
+- Keep memory on for long-running learning workflows.
+- Review L3 preferences when DeepTutor's tone or assumptions feel off.
+- Clear only L1 trace for a surface if you want to remove raw history while keeping curated summaries.
+- In multi-user mode, each user gets scoped memory under their own workspace.
diff --git a/site/src/content/docs/docs/explore/partners.md b/site/src/content/docs/docs/explore/partners.md
new file mode 100644
index 000000000..ee5637859
--- /dev/null
+++ b/site/src/content/docs/docs/explore/partners.md
@@ -0,0 +1,56 @@
+---
+title: Partners
+description: Persistent IM-connected companions that run on the same chat agent loop as DeepTutor Chat.
+---
+
+Partners are persistent companions with their own identity, soul, model policy, assigned library, and channel configuration. They replace the old TutorBot engine: every inbound web or IM message is routed through the same `ChatOrchestrator -> AgenticChatPipeline` loop used by the main Chat workspace.
+
+![Partners workspace](/screenshots/partners.png)
+
+## Mental model
+
+A Partner is a **synthetic user workspace** under `data/partners/<id>/workspace/`. The workspace contains the partner's soul, copied knowledge bases, copied skills, notebooks, memory, and channel runtime state. Because the layout matches the chat workspace, tools such as RAG, `read_skill`, notebooks, memory, and MCP-deferred tools work without a separate bot implementation.
+
+![Partners architecture](/screenshots/partners-architecture.png)
+
+## Create a partner
+
+Open **Partners -> New partner** and complete the wizard:
+
+![Partner creation wizard, Identity step](/screenshots/partners-new.png)
+
+1. **Identity** — name, avatar, description, and default reply language.
+2. **Soul** — the partner's role and communication style. This becomes `SOUL.md`.
+3. **Mind** — model selection, enabled system tools, MCP tools, and delivery preferences.
+4. **Library** — assign knowledge bases, skills, and notebooks. These are copied into the partner workspace so the partner can use them even when the original owner changes context.
+5. **Review** — confirm the workspace and channel setup before starting.
+
+![Partner detail](/screenshots/partners-detail.png)
+
+Everything chosen in the wizard stays editable afterwards: the partner detail page pairs the web **Chat** view with a **Configure** tab covering identity, soul, mind, and library, plus a **Channels** tab for delivery setup.
+
+![Partner detail, Configure tab](/screenshots/partners-configure.png)
+
+## Channels
+
+Channels are delivery adapters around the same partner brain. Common switches appear on most channel cards:
+
+| Field | Meaning |
+| --- | --- |
+| **Enabled** | Start this channel for the partner. Leave off while collecting credentials. |
+| **Send Progress** | Send narration/progress messages for long-running turns. Useful for IM apps where a silent 60-second wait feels broken. |
+| **Send Tool Hints** | Send one-line tool-call hints such as `rag(query=...)`. Turn off for quieter production channels. |
+| **Allow From** | Allowlist of user ids, group ids, email addresses, or `*`. Empty usually denies all access; `*` opens the channel. |
+
+Each channel has its own configuration page with credentials, setup steps, and troubleshooting — see the [**Channel Matrix**](/docs/partners/channels/) for the full list. Start with [**WeChat**](/docs/partners/weixin/) if you are configuring a personal WeChat account, [**WeCom**](/docs/partners/wecom/) for Enterprise WeChat, or [**QQ / NapCat**](/docs/partners/qq/) for Tencent consumer QQ paths.
+
+## 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 useful for smoke tests, but the web UI is the recommended place to configure channel fields because it masks secrets and shows the channel schema inline.
diff --git a/site/src/content/docs/docs/explore/settings.md b/site/src/content/docs/docs/explore/settings.md
index a880539f5..28220d076 100644
--- a/site/src/content/docs/docs/explore/settings.md
+++ b/site/src/content/docs/docs/explore/settings.md
@@ -1,149 +1,95 @@
---
title: Settings
-description: The unified control center - Appearance, Status, Network, LLM / Embedding / Search, Capabilities, Memory, MCP, Tools.
+description: The unified control plane for appearance, status, network, model catalogs, embeddings, search, MinerU, capabilities, memory, MCP, and tools.
---
-The settings surface was unified in v1.4 and split by concern, with a **draft / Apply** model so changes are atomic and can be reverted before save.
+Settings is the operational control plane for DeepTutor. Most sections use a draft-and-apply model so you can test provider changes before committing them.
-![Settings overview](/screenshots/dt-settings.png)
+![Settings workspace](/screenshots/settings.png)
-## Tabs
+## Sections
-In the order they appear in the left navigation:
+| Section | What it controls |
+| --- | --- |
+| **Appearance** | Theme, language, sidebar preferences. |
+| **Status** | Live state of the backend and the model services your configuration resolves to. |
+| **Network** | Backend/frontend ports, external API base, CORS origins. |
+| **LLM** | Model catalog profiles, base URLs, API keys, active models. |
+| **Embedding** | Embedding providers for Knowledge and RAG. |
+| **Search** | Web/search provider configuration. |
+| **MinerU PDF** | Local or cloud PDF parsing backend. |
+| **Capabilities** | Budgets and knobs for Chat, Solve, Question, Research, Visualize, Co-Writer, and related pipelines. |
+| **Memory** | Consolidation controls and links to the Memory workbench. |
+| **MCP servers** (admin only) | External MCP tool registration. |
+| **Tools** | Built-in, contextual, coming-soon, and optional user-toggleable tools. |
-| Tab | What it controls |
-|-----|------------------|
-| **Appearance** | UI language and theme (Cream, Snow, Dark, Glass) |
-| **Status** | Live health probe across LLM, embedding, search, and storage backends |
-| **Network** | Backend/frontend ports, browser API base, CORS origins, and deployment hints |
-| **LLM** | Provider catalog, base URLs, API keys, active model selection |
-| **Embedding** | Same shape as LLM, but for the embedder |
-| **Search** | Web search provider (Tavily / Brave / Jina / Serper / SearXNG / DuckDuckGo / Perplexity) |
-| **Capabilities** | Per-capability tunables (chunking, LLM budget, dedup, max iterations) |
-| **Memory** | Toggle consolidator runs, configure cadence and budget |
-| **MCP servers** | Register external Model Context Protocol servers |
-| **Tools** | Inspect every built-in tool, parameters, status, i18n status copy |
+## Section guide
-A **Tour** launcher walks new users through the page.
+### Appearance
-## Appearance
+Theme, display language, and sidebar preferences. Purely client-facing; no provider credentials live here.
-| Setting | Options |
-|---------|---------|
-| Language | English, 简体中文 |
-| Theme | Cream *(default)* / Snow / Dark / Glass |
-| Sidebar density | Compact / Comfortable |
+### Status
-## Status
+A read-only dashboard of the backend plus the LLM, embedding, and search endpoints your configuration currently resolves to. Status reflects runtime values after the last **Apply** — draft changes do not show up here until applied.
-A live health probe:
+### Network
-- LLM provider — connection OK / failing / not configured
-- Embedding provider — same
-- Search provider — same
-- Storage backends — connection state, latency
-- Last health-check time per provider
+Backend/frontend ports, the external API base that browser clients use behind a reverse proxy, and CORS origins.
-Use this to **debug "the model isn't responding"** issues fast.
+### LLM
-## Network
+![LLM settings with provider profiles, connection fields, and model catalog](/screenshots/settings-llm.png)
-Network settings are startup settings stored in
-`data/user/settings/system.json`. Use this page for Docker, LAN, and
-reverse-proxy deployments:
+Language model profiles. Each profile is a provider connection — provider type, base URL, API key, optional extra headers — plus a model catalog entry per model with its model ID and context window. The active model is used for Chat and most agent reasoning.
-- **Backend / frontend ports** control what DeepTutor starts on. Docker port
- mappings must match the container-side ports.
-- **Public API base** maps to `next_public_api_base_external`. It is the URL the
- browser uses for HTTP and WebSocket API calls.
-- **CORS origins** are frontend page origins allowed to call the backend. They
- are only required for authenticated cross-origin deployments.
-- `public_api_base` is accepted as a compatibility alias and normalized on save.
+### Embedding
-With auth disabled, DeepTutor permits normal HTTP/HTTPS browser origins by
-default. With auth enabled, set exact frontend origins and use
-`auth.json: cookie_secure=true` for HTTPS cross-site cookies.
+Embedding model profiles, mirroring the LLM layout (provider connection + models) but registering embedding models with their dimensions. Used by retrieval and knowledge-base ingestion.
-## LLM / Embedding / Search
+### Search
-All three share the same **profile** model:
+Web search providers used by the `web_search` tool and any agent step that hits the open web. Configure provider, base URL, and API key, then run a test query from the diagnostics panel.
-- You can configure **multiple profiles** (e.g., `openai-gpt-4o`, `anthropic-sonnet-4`, `local-ollama`)
-- Pick **one active model** per service from the catalog
-- Per-turn overrides happen in the chat composer's model selector
+### MinerU PDF
-Test connection with the **Test** button — it issues a small probe call and reports latency.
+![MinerU PDF settings with parsing backend and local install detection](/screenshots/settings-mineru.png)
-Full provider matrix: [**Providers**](/docs/get-started/providers/).
+The PDF parsing backend used when generating questions from an uploaded exam paper. Choose between a local MinerU install and the hosted mineru.net cloud API. For local parsing, the page detects the MinerU CLI, accepts an explicit CLI path, and manages the ~1-2 GB model-weights download (HuggingFace or ModelScope).
-## Capabilities
+### Capabilities
-Per-capability tunables for Chat, Solve, Quiz, Research, Visualize, and Co-Writer:
+![Capabilities settings with per-capability parameters](/screenshots/settings-capabilities.png)
-| Setting | What |
-|---------|------|
-| **Chunking** | How retrieved KB content is chunked into the context window |
-| **LLM budget** | Max tokens / max iterations per capability run |
-| **Dedup policy** | How duplicate sources are handled |
-| **Reference policy** | When to insert citations |
-| **Max iterations** | Hard guard on agentic loops |
+Per-capability LLM parameters and runtime knobs: temperature, token budgets, and loop limits for Chat, Solve, Question, Research, Visualize, Co-Writer, and related pipelines. For Chat this includes max rounds and separate exploring/responding token budgets. Values persist to `data/user/settings/agents.yaml` (LLM params) and `main.yaml` (runtime knobs).
-Backed by a unified `emit_capability_result` envelope and a shared `UsageTracker` that surfaces **per-call cost**.
+### Memory
-## Memory
+Tunes the chunk-based memory consolidator: LLM-round budgets per L2 surface and L3 slot for **Update** and **Audit** runs, plus **Dedup** iterations and whether dedup runs automatically after an update.
-| Setting | Effect |
-|---------|--------|
-| **Toggle consolidator** | Pause / resume the L1 → L2 → L3 pipeline |
-| **Cadence** | How often each consolidation pass runs |
-| **Budget** | Token budget per consolidation pass |
-| **Jump to workbench** | Opens `/memory` directly |
+### MCP servers (admin only)
-See [**Memory**](/docs/explore/memory/) for the full three-layer architecture.
+Register external MCP (Model Context Protocol) servers to expose their tools to the chat agent. Test the connection first, then save. In multi-user deployments this section is restricted to admins.
-## MCP servers
+### Tools
-The **Model Context Protocol** integration lets you plug in external MCP servers as additional tools. Add server configs here; their tools surface alongside built-ins.
+![Tools settings with user-toggleable and built-in tools](/screenshots/settings-tools.png)
-Example:
+Switches user-toggleable tools on or off. **Experience enhancement** tools (`brainstorm`, `web_search`, `paper_search`, `reason`) are yours to toggle; **built-in** tools such as `rag` and code execution are locked and mount automatically when the chat agent needs them.
-```yaml
-servers:
- filesystem:
- command: npx
- args: ["-y", "@modelcontextprotocol/server-filesystem", "/Users/frank/docs"]
- github:
- command: npx
- args: ["-y", "@modelcontextprotocol/server-github"]
- env:
- GITHUB_PERSONAL_ACCESS_TOKEN: ${GITHUB_TOKEN}
-```
+## Important deployment notes
-## Tools
+- Project-root `.env` is intentionally ignored as application config.
+- Runtime settings live under `data/user/settings/*.json` unless you set `DEEPTUTOR_HOME` or `deeptutor start --home`.
+- Docker browser clients must reach both the frontend and backend. If you reverse proxy, configure the external API base in **Network**.
+- Optional user-toggleable tools are `brainstorm`, `web_search`, `paper_search`, and `reason`; other tools are mounted by context or runtime availability.
-Inspect every built-in tool:
+## Provider testing
-- Name, description, parameters
-- Status (enabled / coming-soon)
-- i18n status copy (how the tool's progress messages appear in English / 中文)
-- Whether it's user-toggleable
-
-Five tools are user-toggleable globally: `brainstorm`, `web_search`, `paper_search`, `code_execution`, `reason`. Context-mounted tools (`rag`, `read_memory`, `write_memory`, etc.) can't be toggled here — they appear automatically based on what's attached to the turn.
-
-## i18n
-
-Every capability ships a canonical `capabilities/prompts/{en,zh}/<name>.yaml` so status messages stay consistent in both English and 中文.
-
-## CLI mirror
-
-```bash
-deeptutor config show # Print current configuration (secrets masked)
-deeptutor init # Re-run wizard, re-prompt every value
-$EDITOR data/user/settings/model_catalog.json # direct edit
-```
+Use **Test** buttons before Apply. A green provider test proves only that the profile can make a minimal call; it does not prove your selected model is ideal for every capability.
## See also
-- [**Providers**](/docs/get-started/providers/) — full LLM / embedding / search provider matrix
-- [**Memory**](/docs/explore/memory/) — what the consolidator actually does
-- [**Multi-User Deployment**](/docs/get-started/multi-user/) — auth-related settings
+- [Providers](/docs/get-started/providers/) — model/search setup recipes
+- [Docker](/docs/get-started/docker/) — port and reverse-proxy notes
+- [Memory](/docs/explore/memory/) — inspect memory state
diff --git a/site/src/content/docs/docs/explore/space.md b/site/src/content/docs/docs/explore/space.md
index 8fff3d057..da25cebd6 100644
--- a/site/src/content/docs/docs/explore/space.md
+++ b/site/src/content/docs/docs/explore/space.md
@@ -1,119 +1,36 @@
---
title: Space
-description: Your personal learning library — Chat History, Notebooks, Question Bank, and Skills, all in one place.
+description: "Manage reusable context: skills, personas, notebooks, chat history, and question assets."
---
-Space is the **read / review** counterpart to the active surfaces. Where Chat / Co-Writer / Book are where you *produce*, Space is where everything you produce lives — searchable and replayable.
+Space is the library layer for reusable context. It is where you manage assets that can shape future Chat turns, Partner behavior, Co-Writer drafts, and Book generation.
-## What lives in Space
+![Space workspace](/screenshots/space.png)
-Space bundles four sub-surfaces under one navigation:
+## What belongs in Space
-| Sub-surface | What's in it |
-|-------------|--------------|
-| **Chat History** | Every conversation across every mode (Chat / Solve / Quiz / Research / Visualize) |
-| **Notebooks** | Categorised, colour-coded notebooks holding records from Chat, Research, and Co-Writer |
-| **Question Bank** | Every auto-generated quiz question — bookmarkable, @-mention-able in chat |
-| **Skills** | User-authored `SKILL.md` files that define teaching personas |
-
-## Chat History
-
-Every conversation, with:
-
-- **Title rename** — edit the auto-generated title to something searchable
-- **Delete** — drop a session (also removes its memory traces)
-- **Resume** — open the session in a new tab or reattach to the active tab
-- **Per-turn delete** — supported on every entry point (chat, solve, quiz, research, visualize)
-
-The browser search box at the top filters across all titles and bodies — useful when you can't remember which session covered something.
-
-## Notebooks
-
-Notebooks are the **persistent storage for outputs you want to keep**. A notebook is:
-
-- A name + description + color tag
-- A list of records (each record is a Markdown document)
-- Cross-linked back to the originating chat session / Co-Writer document
-
-### Saving to a notebook
-
-Most surfaces have a **Save to Notebook** action:
-
-| Surface | What gets saved |
-|---------|-----------------|
-| **Chat** *(any mode)* | The current turn + its citations |
-| **Co-Writer** | The current document |
-| **Quiz** | The question + your answer + grading result |
-| **Research** | The full report + outline + citations |
-
-### Using a notebook in chat
-
-Notebooks are queryable from chat via the `list_notebook` and `write_note` tools (auto-mounted when ≥1 notebook exists). You can also attach specific records to a turn via the composer's Space picker.
-
-### CLI mirror
-
-```bash
-deeptutor notebook list
-deeptutor notebook create research-notes --description "Daily reading log"
-deeptutor notebook show research-notes
-deeptutor notebook add-md research-notes ./paper-summary.md
-deeptutor notebook replace-md research-notes <record_id> ./updated.md
-deeptutor notebook remove-record research-notes <record_id>
-```
-
-## Question Bank
-
-Every auto-validated quiz question generated by **Quiz** mode lands here:
-
-- **Bookmark** — flag a question for later review
-- **Categories** — questions inherit a topic tag based on the source
-- **@-mention in chat** — reference past questions in a new chat turn ("@question 47, why is option B correct?")
-
-The Question Bank is how spaced repetition becomes a real workflow: regenerate yesterday's wrong answers, get explanations, re-quiz.
+| Asset | Use it for |
+| --- | --- |
+| **Skills** | `SKILL.md` files that teach DeepTutor a workflow, style, or domain behavior. |
+| **Personas** | Role/voice instructions that can be selected in Chat or copied into Partners. |
+| **Notebooks** | Durable records saved from Chat, Research, Co-Writer, or manual Markdown import. |
+| **Chat History** | Resumable sessions and past context. |
+| **Question assets** | Practice material that can be referenced later. |
## Skills
-Skills are **user-authored persona definitions** — `SKILL.md` files following a specific schema. When a skill is active:
-
-- Its persona is **injected into the chat system prompt** for the duration
-- The skill's triggers can auto-activate it (e.g., when you mention specific topics)
-
-### Skill schema
-
-```markdown
----
-name: socratic-tutor
-description: Teach by asking probing questions instead of giving direct answers
-triggers:
- - "explain"
- - "what is"
- - "teach me"
----
-
-You are a Socratic tutor. Instead of giving direct answers:
-
-1. Ask probing questions that reveal what the student already knows.
-2. Guide them to discover the answer themselves.
-3. Confirm understanding with a follow-up question.
+Skills live under the user workspace and can be tagged, edited, previewed, or kept read-only if they are built in. A good skill is specific: it tells the agent when to use it, what inputs it expects, and what output shape is useful.
-Use clear, encouraging language. Never lecture.
-```
+## Personas and Partners
-DeepTutor ships built-in archetypes — Socratic, encouraging, rigorous — and you can author your own from the Skills tab.
+Personas are lightweight role definitions. Partners have a stronger `SOUL.md`, but personas are a good starting point: create or refine a persona in Space, then use it while creating a Partner.
-### Where skills live
-
-- **Personal skills** — `data/user/workspace/skills/*.md`
-- **Project-scoped skills** — `.deeptutor/skills/*.md` *(if you're using a project workspace)*
-
-## Pairs well with
+## Notebooks
-- **Chat** — Pull a notebook record / past session into the current turn for context
-- **TutorBot** — Bots can also use Skills (per-bot configuration)
-- **Memory** — Notebooks become L1 traces in the `notebook` surface, eventually consolidated into L3
+Notebooks are the easiest way to turn an answer into durable context. Save summaries, research outputs, writing drafts, or book reading notes, then attach them later from Chat or CLI.
## See also
-- [**Chat Workspace**](/docs/explore/chat-workspace/) — produces what Space stores
-- [**Memory**](/docs/explore/memory/) — how Space content feeds the memory pipeline
-- [**Explore TutorBot**](/docs/tutorbot/) — bots also use Skills
+- [Chat Workspace](/docs/explore/chat-workspace/) — attach Space context to turns
+- [Partners](/docs/explore/partners/) — assign skills/notebooks to partners
+- [Co-Writer](/docs/explore/co-writer/) — save drafts to notebooks
diff --git a/site/src/content/docs/docs/get-started/cli-only.md b/site/src/content/docs/docs/get-started/cli-only.md
index db29e2ca2..386b655f7 100644
--- a/site/src/content/docs/docs/get-started/cli-only.md
+++ b/site/src/content/docs/docs/get-started/cli-only.md
@@ -60,7 +60,7 @@ The local `deeptutor-cli` install ships **no Web assets or server dependencies**
| `deeptutor kb` (Knowledge Bases) | ✅ *(opt in during init)* | ✅ |
| `deeptutor notebook` | ✅ | ✅ |
| `deeptutor memory` | ✅ | ✅ |
-| `deeptutor bot` (TutorBot) | ✅ *(if `[tutorbot]` extra installed)* | ✅ |
+| `deeptutor partner` (Partners) | ✅ *(after installing channel SDKs — see below)* | ✅ |
| `deeptutor config show` | ✅ | ✅ |
| `deeptutor provider login` | ✅ | ✅ |
| `deeptutor serve` (FastAPI) | ❌ | ✅ |
@@ -71,6 +71,16 @@ The local `deeptutor-cli` install ships **no Web assets or server dependencies**
To add the Web app later, install the PyPI package (Option 1) and run `deeptutor init` + `deeptutor start` from the same workspace.
+## Adding Partner channel SDKs
+
+CLI-only installs can still run `deeptutor partner`, but channel SDKs are not installed by default. The local `deeptutor-cli` project defines no extras — install the SDK set from the repo's requirements mirror instead (you already have the source checkout):
+
+```bash
+python -m pip install -r requirements/partners.txt
+```
+
+This covers every built-in channel SDK (wecom-aibot-sdk, qq-botpy, slack-sdk, lark-oapi, python-telegram-bot, dingtalk-stream, …). The Matrix channel is packaged separately: `pip install -r requirements/matrix.txt`, plus `requirements/matrix-e2e.txt` for encrypted rooms (needs the system `libolm` library). This does not add the Web UI; Partner config continues to live in the current workspace under `data/partners/<id>/` and `data/user/settings/`.
+
## 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.
@@ -99,12 +109,12 @@ python -m deeptutor_cli.main chat
`deeptutor serve` is **unavailable** in the CLI-only install. Use [**PyPI**](/docs/get-started/pypi/) or [**From Source**](/docs/get-started/from-source/) instead.
-### TutorBot commands say SDK missing
+### Partner channel commands say an SDK is missing
-Channel SDKs (python-telegram-bot, slack-sdk, etc.) are only included with the `[tutorbot]` extra:
+Channel SDKs (wecom-aibot-sdk, qq-botpy, slack-sdk, lark-oapi, etc.) ship via the requirements mirror, not the CLI-only package:
```bash
-pip install -e "./packaging/deeptutor-cli[tutorbot]"
+python -m pip install -r requirements/partners.txt
```
More: [**Troubleshooting**](/docs/get-started/troubleshooting/).
@@ -113,4 +123,4 @@ More: [**Troubleshooting**](/docs/get-started/troubleshooting/).
- [**DeepTutor CLI**](/docs/cli/) — full CLI reference
- [**Agent handoff**](/docs/cli/agent-handoff/) — let your agent drive
-- [**Explore TutorBot**](/docs/tutorbot/) — run a bot from CLI
+- [**Partners & Channels**](/docs/partners/) — run a Partner from CLI
diff --git a/site/src/content/docs/docs/get-started/docker.md b/site/src/content/docs/docs/get-started/docker.md
index c4f51ed2f..4e07769c3 100644
--- a/site/src/content/docs/docs/get-started/docker.md
+++ b/site/src/content/docs/docs/get-started/docker.md
@@ -20,7 +20,7 @@ docker run --rm --name deeptutor \
> ⚠️ **Map both `3782` and `8001`.** Port `3782` serves the Web UI; port `8001` is the FastAPI backend that your browser calls directly — there is no in-container proxy. Skip the `8001` mapping and the page still loads, but **Settings** shows "Backend unreachable" and stays unusable.
-Open <http://127.0.0.1:3782>. The container creates `/app/data/user/settings/*.json` on first boot; configure model providers from the Web Settings page. Config, API keys, logs, workspace files, memory, and knowledge bases all persist in the `deeptutor-data` volume.
+Open <http://127.0.0.1:3782>. The container creates `/app/data/user/settings/*.json` on first boot; configure model providers from the Web Settings page. Config, API keys, logs, workspace files, memory, knowledge bases, and Partner workspaces (`data/partners/<id>/`) all persist in the `deeptutor-data` volume.
## Detached mode
diff --git a/site/src/content/docs/docs/get-started/from-source.md b/site/src/content/docs/docs/get-started/from-source.md
index bff529402..630f1db24 100644
--- a/site/src/content/docs/docs/get-started/from-source.md
+++ b/site/src/content/docs/docs/get-started/from-source.md
@@ -42,13 +42,27 @@ python -m pip install --upgrade pip
```bash
pip install -e ".[dev]" # tests / lint tools
-pip install -e ".[partners]" # Partner channel SDKs + MCP client
+pip install -e ".[partners]" # all Partner channel SDKs (incl. wecom-aibot-sdk) + MCP client
pip install -e ".[matrix]" # Matrix channel without E2EE / libolm
pip install -e ".[matrix-e2e]" # Matrix E2EE; requires libolm
pip install -e ".[math-animator]" # Manim addon; requires LaTeX / ffmpeg / system libs
```
-Compose them: `pip install -e ".[dev,tutorbot,math-animator]"`.
+Compose them: `pip install -e ".[dev,partners,math-animator]"`.
+
+Full list — each extra has a `requirements/*.txt` mirror for Docker/CI builds where the source tree isn't available yet:
+
+| Extra | What it adds | Requirements mirror |
+|-------|--------------|---------------------|
+| `cli` | Compatibility extra — CLI deps, already included in the default install | `requirements/cli.txt` |
+| `server` | Compatibility extra — FastAPI server deps, already included in the default install | `requirements/server.txt` |
+| `partners` | Every built-in Partner channel SDK (`wecom-aibot-sdk`, `qq-botpy`, `slack-sdk`, `lark-oapi`, `python-telegram-bot`, `dingtalk-stream`, …) + MCP client | `requirements/partners.txt` |
+| `tutorbot` | Legacy alias for `partners`, kept for one release | — |
+| `matrix` | Matrix (Element) channel, non-E2EE — works without libolm | `requirements/matrix.txt` |
+| `matrix-e2e` | Matrix E2EE add-on — needs the system **libolm** library | `requirements/matrix-e2e.txt` |
+| `math-animator` | Manim addon — needs LaTeX, pkg-config, cairo, cmake, ffmpeg | `requirements/math-animator.txt` |
+| `dev` | pytest / pre-commit / lint & security tooling | `requirements/dev.txt` |
+| `all` | `partners` + `matrix` + `math-animator` + `dev` (E2EE not included) | — |
### System dependencies for some extras
diff --git a/site/src/content/docs/docs/get-started/index.md b/site/src/content/docs/docs/get-started/index.md
index 720fa12c2..1ec934066 100644
--- a/site/src/content/docs/docs/get-started/index.md
+++ b/site/src/content/docs/docs/get-started/index.md
@@ -3,7 +3,7 @@ title: Get Started
description: DeepTutor ships four install paths — PyPI, From Source, Docker, and CLI-Only. Pick the one that fits.
---
-DeepTutor ships **four installation paths**. They all share one workspace layout: settings live in `data/user/settings/` under the directory you launch from (or under `DEEPTUTOR_HOME` / `deeptutor start --home` if you set one explicitly).
+DeepTutor ships **four installation paths**. They all share one workspace layout: settings live in `data/user/settings/` under the directory you launch from (or under `DEEPTUTOR_HOME` / `deeptutor start --home` if you set one explicitly). Knowledge bases, memory, Partner runtime state, multi-user accounts, and audit logs also live under the same `data/` tree, so deployments only need to persist that tree.
For the full app, the recommended flow is **pick a workspace directory → install → `deeptutor init` → `deeptutor start`**.
@@ -16,7 +16,7 @@ For the full app, the recommended flow is **pick a workspace directory → insta
| **Docker** | Production deployments, hosted hosts, persistent volumes | [**Docker**](/docs/get-started/docker/) |
| **CLI Only** | Headless server, agent harness, no Web UI needed | [**CLI-Only Install**](/docs/get-started/cli-only/) |
-> 🧪 **Trying the v1.4.0 beta?** PyPI normalizes `1.4.0-beta` to `1.4.0b0`, so plain `pip install -U deeptutor` stays on stable. Opt in with `pip install --pre -U deeptutor`, or pin exactly with `pip install -U deeptutor==1.4.0b0`.
+> 🧪 **Trying a pre-release?** Plain `pip install -U deeptutor` stays on stable — PyPI skips pre-release versions. Opt in with `pip install --pre -U deeptutor`, or pin an exact version with `pip install -U "deeptutor==<version>"`.
## Minimum requirements
@@ -44,9 +44,9 @@ Both are overridable via `data/user/settings/system.json` or during `deeptutor i
Once you can reach `http://localhost:3782/`:
-- [**Explore DeepTutor**](/docs/explore/) — a tour of the five core surfaces (Chat, Co-Writer, Book, Knowledge, Space) plus Memory and Settings
+- [**Explore DeepTutor**](/docs/explore/) — a tour of the Chat, Partners, Co-Writer, Book, Knowledge, Space, Memory, and Settings
- [**DeepTutor CLI**](/docs/cli/) — drive everything from the terminal
-- [**Explore TutorBot**](/docs/tutorbot/) — connect autonomous tutors to Telegram, Slack, Feishu, and more
+- [**Partners & Channels**](/docs/partners/) — connect autonomous tutors to WeChat, WeCom, QQ, Telegram, Slack, Feishu, and more
- [**Multi-User Deployment**](/docs/get-started/multi-user/) — host DeepTutor for a team
If something breaks, jump to [**Troubleshooting**](/docs/get-started/troubleshooting/).
diff --git a/site/src/content/docs/docs/get-started/multi-user.md b/site/src/content/docs/docs/get-started/multi-user.md
index 9972f1090..5ded05c68 100644
--- a/site/src/content/docs/docs/get-started/multi-user.md
+++ b/site/src/content/docs/docs/get-started/multi-user.md
@@ -25,6 +25,9 @@ deeptutor start
# bases, and skills. Save. The user can now sign in and start working.
```
+
+![Multi-user admin interface](/screenshots/multi-user.png)
+
## What the admin sees
- **Full Settings page** at `/settings` — manage LLM / embedding / search providers, API keys, model catalogs, and runtime "Apply".
@@ -93,7 +96,7 @@ Deployments upgraded from the pre-v1.5 layout (a sibling `multi-user/` directory
## Caddyfile example
-```caddyfile
+```text
deeptutor.example.com {
reverse_proxy /api/* localhost:8001
reverse_proxy localhost:3782
diff --git a/site/src/content/docs/docs/get-started/providers.md b/site/src/content/docs/docs/get-started/providers.md
index e64e8daff..1540f3932 100644
--- a/site/src/content/docs/docs/get-started/providers.md
+++ b/site/src/content/docs/docs/get-started/providers.md
@@ -5,43 +5,50 @@ title: Provider Configuration
DeepTutor currently ships 33 LLM provider bindings, 12 embedding provider bindings, and 7 active search providers (plus an explicit `none` option). Configure them through the Web Settings page, `deeptutor init`, `data/user/settings/model_catalog.json`, or process environment variables. Project-root `.env` files are not auto-loaded by the runtime.
+
+## Configuration surfaces and precedence
+
+Prefer **Settings -> LLM / Embedding / Search** for normal use because the Web UI writes `data/user/settings/model_catalog.json` and applies the runtime change. `deeptutor init` is best for first boot; environment variables are best for orchestrated containers or one-off overrides. Project-root `.env` files are not auto-loaded, so export variables in the process environment that starts `deeptutor start`.
+
+In multi-user deployments, API keys and provider base URLs belong to the admin workspace. Ordinary users only receive granted logical model IDs; credentials are never returned to them.
+
## LLM Providers
| Provider | Binding | Default Base URL |
| :---------------------- | :-------------------- | :-------------------------------------------------------- |
-| AiHubMix | `aihubmix` | `https://aihubmix.com/v1` |
-| Anthropic | `anthropic` | `https://api.anthropic.com/v1` |
-| Azure OpenAI | `azure_openai` | — |
-| BytePlus | `byteplus` | `https://ark.ap-southeast.bytepluses.com/api/v3` |
-| BytePlus Coding Plan | `byteplus_coding_plan`| `https://ark.ap-southeast.bytepluses.com/api/coding/v3` |
+| <img src="/provider-icons/aihubmix-color.svg" alt="" width="16" height="16" /> AiHubMix | `aihubmix` | `https://aihubmix.com/v1` |
+| <img src="/provider-icons/anthropic.svg" alt="" width="16" height="16" /> Anthropic | `anthropic` | `https://api.anthropic.com/v1` |
+| <img src="/provider-icons/azure-color.svg" alt="" width="16" height="16" /> Azure OpenAI | `azure_openai` | — |
+| <img src="/provider-icons/bytedance-color.svg" alt="" width="16" height="16" /> BytePlus | `byteplus` | `https://ark.ap-southeast.bytepluses.com/api/v3` |
+| <img src="/provider-icons/bytedance-color.svg" alt="" width="16" height="16" /> BytePlus Coding Plan | `byteplus_coding_plan` | `https://ark.ap-southeast.bytepluses.com/api/coding/v3` |
| Custom (OpenAI-compat) | `custom` | — |
-| Custom Anthropic | `custom_anthropic` | — |
-| DashScope (Qwen) | `dashscope` | `https://dashscope.aliyuncs.com/compatible-mode/v1` |
-| DeepSeek | `deepseek` | `https://api.deepseek.com` |
-| Gemini | `gemini` | `https://generativelanguage.googleapis.com/v1beta/openai/`|
-| GitHub Copilot | `github_copilot` | `https://api.githubcopilot.com` |
-| Groq | `groq` | `https://api.groq.com/openai/v1` |
+| <img src="/provider-icons/anthropic.svg" alt="" width="16" height="16" /> Custom Anthropic | `custom_anthropic` | — |
+| <img src="/provider-icons/qwen-color.svg" alt="" width="16" height="16" /> DashScope (Qwen) | `dashscope` | `https://dashscope.aliyuncs.com/compatible-mode/v1` |
+| <img src="/provider-icons/deepseek-color.svg" alt="" width="16" height="16" /> DeepSeek | `deepseek` | `https://api.deepseek.com` |
+| <img src="/provider-icons/gemini-color.svg" alt="" width="16" height="16" /> Gemini | `gemini` | `https://generativelanguage.googleapis.com/v1beta/openai/`|
+| <img src="/provider-icons/githubcopilot.svg" alt="" width="16" height="16" /> GitHub Copilot | `github_copilot` | `https://api.githubcopilot.com` |
+| <img src="/provider-icons/groq.svg" alt="" width="16" height="16" /> Groq | `groq` | `https://api.groq.com/openai/v1` |
| Lemonade | `lemonade` | `http://localhost:13305/api/v1` |
| llama.cpp | `llama_cpp` | `http://localhost:8080/v1` |
-| LM Studio | `lm_studio` | `http://localhost:1234/v1` |
-| MiniMax | `minimax` | `https://api.minimax.io/v1` |
-| MiniMax Anthropic | `minimax_anthropic` | `https://api.minimax.io/v1` |
-| Mistral | `mistral` | `https://api.mistral.ai/v1` |
-| Moonshot (Kimi) | `moonshot` | `https://api.moonshot.ai/v1` |
-| Ollama | `ollama` | `http://localhost:11434/v1` |
-| NVIDIA NIM | `nvidia_nim` | — |
-| OpenAI | `openai` | `https://api.openai.com/v1` |
-| OpenAI Codex | `openai_codex` | `https://chatgpt.com/backend-api` |
-| OpenRouter | `openrouter` | `https://openrouter.ai/api/v1` |
+| <img src="/provider-icons/lmstudio.svg" alt="" width="16" height="16" /> LM Studio | `lm_studio` | `http://localhost:1234/v1` |
+| <img src="/provider-icons/minimax-color.svg" alt="" width="16" height="16" /> MiniMax | `minimax` | `https://api.minimax.io/v1` |
+| <img src="/provider-icons/minimax-color.svg" alt="" width="16" height="16" /> MiniMax Anthropic | `minimax_anthropic` | `https://api.minimax.io/v1` |
+| <img src="/provider-icons/mistral-color.svg" alt="" width="16" height="16" /> Mistral | `mistral` | `https://api.mistral.ai/v1` |
+| <img src="/provider-icons/moonshot.svg" alt="" width="16" height="16" /> Moonshot (Kimi) | `moonshot` | `https://api.moonshot.ai/v1` |
+| <img src="/provider-icons/ollama.svg" alt="" width="16" height="16" /> Ollama | `ollama` | `http://localhost:11434/v1` |
+| <img src="/provider-icons/nvidia-color.svg" alt="" width="16" height="16" /> NVIDIA NIM | `nvidia_nim` | — |
+| <img src="/provider-icons/openai.svg" alt="" width="16" height="16" /> OpenAI | `openai` | `https://api.openai.com/v1` |
+| <img src="/provider-icons/openai.svg" alt="" width="16" height="16" /> OpenAI Codex | `openai_codex` | `https://chatgpt.com/backend-api` |
+| <img src="/provider-icons/openrouter.svg" alt="" width="16" height="16" /> OpenRouter | `openrouter` | `https://openrouter.ai/api/v1` |
| OpenVINO Model Server | `ovms` | `http://localhost:8000/v3` |
-| Qianfan (Ernie) | `qianfan` | `https://qianfan.baidubce.com/v2` |
-| SiliconFlow | `siliconflow` | `https://api.siliconflow.cn/v1` |
-| Step Fun | `stepfun` | `https://api.stepfun.com/v1` |
-| vLLM | `vllm` | `http://localhost:8000/v1` |
-| VolcEngine | `volcengine` | `https://ark.cn-beijing.volces.com/api/v3` |
-| VolcEngine Coding Plan | `volcengine_coding_plan`| `https://ark.cn-beijing.volces.com/api/coding/v3` |
-| Xiaomi MIMO | `xiaomi_mimo` | `https://api.xiaomimimo.com/v1` |
-| Zhipu AI (GLM) | `zhipu` | `https://open.bigmodel.cn/api/paas/v4` |
+| <img src="/provider-icons/baiducloud-color.svg" alt="" width="16" height="16" /> Qianfan (Ernie) | `qianfan` | `https://qianfan.baidubce.com/v2` |
+| <img src="/provider-icons/siliconcloud-color.svg" alt="" width="16" height="16" /> SiliconFlow | `siliconflow` | `https://api.siliconflow.cn/v1` |
+| <img src="/provider-icons/stepfun-color.svg" alt="" width="16" height="16" /> Step Fun | `stepfun` | `https://api.stepfun.com/v1` |
+| <img src="/provider-icons/vllm-color.svg" alt="" width="16" height="16" /> vLLM | `vllm` | `http://localhost:8000/v1` |
+| <img src="/provider-icons/volcengine-color.svg" alt="" width="16" height="16" /> VolcEngine | `volcengine` | `https://ark.cn-beijing.volces.com/api/v3` |
+| <img src="/provider-icons/volcengine-color.svg" alt="" width="16" height="16" /> VolcEngine Coding Plan | `volcengine_coding_plan` | `https://ark.cn-beijing.volces.com/api/coding/v3` |
+| <img src="/provider-icons/xiaomimimo.svg" alt="" width="16" height="16" /> Xiaomi MIMO | `xiaomi_mimo` | `https://api.xiaomimimo.com/v1` |
+| <img src="/provider-icons/zhipu-color.svg" alt="" width="16" height="16" /> Zhipu AI (GLM) | `zhipu` | `https://open.bigmodel.cn/api/paas/v4` |
### Configuration
@@ -52,7 +59,7 @@ LLM_API_KEY=sk-xxx
LLM_HOST=https://api.openai.com/v1
```
-::: tip
+:::tip
Any OpenAI-compatible API works with the `openai` or `custom` binding. Set `LLM_HOST` to your provider's base URL.
:::
@@ -60,16 +67,16 @@ Any OpenAI-compatible API works with the `openai` or `custom` binding. Set `LLM_
| Provider | Binding | Model Example | Default Dim |
| :------------------- | :------------ | :------------------------ | :---------: |
-| OpenAI | `openai` | `text-embedding-3-large` | 3072 |
-| Gemini | `gemini` | `gemini-embedding-001` | 3072 |
-| Azure OpenAI | `azure_openai`| deployment name | — |
-| Cohere | `cohere` | `embed-v4.0` | 1024 |
-| Jina | `jina` | `jina-embeddings-v3` | 1024 |
-| Ollama | `ollama` | `nomic-embed-text` | 768 |
-| vLLM / LM Studio | `vllm` | Any embedding model | — |
-| SiliconFlow | `siliconflow` | `Qwen/Qwen3-Embedding-8B` | 4096 |
-| Aliyun DashScope | `aliyun` | `qwen3-vl-embedding` | 2560 |
-| OpenRouter | `openrouter` | provider-dependent | — |
+| <img src="/provider-icons/openai.svg" alt="" width="16" height="16" /> OpenAI | `openai` | `text-embedding-3-large` | 3072 |
+| <img src="/provider-icons/gemini-color.svg" alt="" width="16" height="16" /> Gemini | `gemini` | `gemini-embedding-001` | 3072 |
+| <img src="/provider-icons/azure-color.svg" alt="" width="16" height="16" /> Azure OpenAI | `azure_openai` | deployment name | — |
+| <img src="/provider-icons/cohere-color.svg" alt="" width="16" height="16" /> Cohere | `cohere` | `embed-v4.0` | 1024 |
+| <img src="/provider-icons/jina.svg" alt="" width="16" height="16" /> Jina | `jina` | `jina-embeddings-v3` | 1024 |
+| <img src="/provider-icons/ollama.svg" alt="" width="16" height="16" /> Ollama | `ollama` | `nomic-embed-text` | 768 |
+| <img src="/provider-icons/vllm-color.svg" alt="" width="16" height="16" /> vLLM / LM Studio | `vllm` | Any embedding model | — |
+| <img src="/provider-icons/siliconcloud-color.svg" alt="" width="16" height="16" /> SiliconFlow | `siliconflow` | `Qwen/Qwen3-Embedding-8B` | 4096 |
+| <img src="/provider-icons/qwen-color.svg" alt="" width="16" height="16" /> Aliyun DashScope | `aliyun` | `qwen3-vl-embedding` | 2560 |
+| <img src="/provider-icons/openrouter.svg" alt="" width="16" height="16" /> OpenRouter | `openrouter` | provider-dependent | — |
| Any OpenAI-compatible| `custom` | — | — |
| Custom OpenAI SDK | `custom_openai_sdk` | — | — |
@@ -85,7 +92,7 @@ EMBEDDING_HOST=https://api.openai.com/v1/embeddings
EMBEDDING_DIMENSION=
```
-::: warning
+:::caution
Changing the embedding model after creating a knowledge base will cause a mismatch. DeepTutor detects this and warns you — rebuild the knowledge base if you switch models.
:::
@@ -93,13 +100,13 @@ Changing the embedding model after creating a knowledge base will cause a mismat
| Provider | Env Key | Notes |
| :---------- | :------------------- | :------------------------------- |
-| Brave | `BRAVE_API_KEY` | Recommended, free tier available |
-| Tavily | `TAVILY_API_KEY` | |
+| <img src="/provider-icons/brave.svg" alt="" width="16" height="16" /> Brave | `BRAVE_API_KEY` | Recommended, free tier available |
+| <img src="/provider-icons/tavily-color.svg" alt="" width="16" height="16" /> Tavily | `TAVILY_API_KEY` | |
| Serper | `SERPER_API_KEY` | |
-| Jina | `JINA_API_KEY` | |
-| SearXNG | — | Self-hosted, no API key needed |
-| DuckDuckGo | — | No API key needed |
-| Perplexity | `PERPLEXITY_API_KEY` | Requires API key |
+| <img src="/provider-icons/jina.svg" alt="" width="16" height="16" /> Jina | `JINA_API_KEY` | |
+| <img src="/provider-icons/searxng.svg" alt="" width="16" height="16" /> SearXNG | — | Self-hosted, no API key needed |
+| <img src="/provider-icons/duckduckgo.svg" alt="" width="16" height="16" /> DuckDuckGo | — | No API key needed |
+| <img src="/provider-icons/perplexity-color.svg" alt="" width="16" height="16" /> Perplexity | `PERPLEXITY_API_KEY` | Requires API key |
| None | — | Explicitly disables web search |
### Configuration
@@ -113,7 +120,7 @@ Search is optional — DeepTutor works without it. When configured, the `web_sea
## Local Models
-DeepTutor works with locally-hosted models through several providers:
+DeepTutor works with locally-hosted models through several providers. In Docker, `localhost` means the container itself; use `host.docker.internal` or the pattern in the [Docker guide](/docs/get-started/docker/#connecting-to-a-local-llm-ollama--lm-studio--llamacpp--vllm) when the model server runs on the host.
### Ollama
diff --git a/site/src/content/docs/docs/get-started/pypi.md b/site/src/content/docs/docs/get-started/pypi.md
index 53c694e78..7790621e9 100644
--- a/site/src/content/docs/docs/get-started/pypi.md
+++ b/site/src/content/docs/docs/get-started/pypi.md
@@ -25,16 +25,26 @@ After `deeptutor start`, open the frontend URL printed in the terminal — by de
> Skipping `deeptutor init` is fine for a quick trial; the app boots with default ports and empty model settings. Configure them later in **Settings → LLM**.
-## Trying the v1.4.0 beta
+## Trying pre-releases
-PyPI normalizes `1.4.0-beta` → `1.4.0b0`, so plain `pip install -U deeptutor` stays on stable. To opt in:
+Plain `pip install -U deeptutor` stays on stable — PyPI skips pre-release versions (e.g. `1.X.0b0` betas) unless you opt in:
```bash
pip install --pre -U deeptutor
-# or pin exactly:
-pip install -U deeptutor==1.4.0b0
+# or pin an exact version:
+pip install -U "deeptutor==<version>"
```
+## Optional extras
+
+The PyPI wheel already ships the full Web app + CLI. Add-ons install as extras — e.g. all built-in Partner channel SDKs (WeCom, QQ, Slack, Feishu, Telegram, DingTalk, …):
+
+```bash
+pip install -U "deeptutor[partners]"
+```
+
+The full extras table (`matrix`, `matrix-e2e`, `math-animator`, `dev`, `all`) is in [**Install from Source**](/docs/get-started/from-source/#optional-install-extras) — the same extra names work against the PyPI package.
+
## Where things live
The workspace lives under the directory you launched from (the `data/` folder appears there on first start). Override with:
diff --git a/site/src/content/docs/docs/get-started/troubleshooting.md b/site/src/content/docs/docs/get-started/troubleshooting.md
index 961cf7464..05d8ee4dc 100644
--- a/site/src/content/docs/docs/get-started/troubleshooting.md
+++ b/site/src/content/docs/docs/get-started/troubleshooting.md
@@ -146,24 +146,20 @@ deeptutor kb create physics --doc chapter1.pdf
### `401 Unauthorized` on every API call after restart
-`AUTH_SECRET` was regenerated, invalidating every JWT.
+`data/system/auth/auth_secret` was lost or regenerated, invalidating every JWT.
-Fix: pin `AUTH_SECRET` in `.env` so it persists across restarts:
-
-```bash
-AUTH_SECRET=$(openssl rand -hex 32)
-```
+Fix: restore `data/system/auth/auth_secret` from backup, or accept the new secret and ask all users to log in again. Project-root `.env` files are not auto-loaded by the runtime.
### First user wasn't promoted to admin
-Edit `multi-user/_system/auth/users.json`, set `"role": "admin"` for the user, restart.
+Edit `data/system/auth/users.json`, set `"role": "admin"` for the user, restart.
### Login works but redirects back to `/login`
The auth cookie isn't being set, usually because:
-1. `AUTH_COOKIE_SECURE=true` but you're not on HTTPS — set it `false` for local testing
-2. `auth.json: cookie_secure=false` on a cross-site HTTPS deployment — set it `true` and restart so the cookie uses `SameSite=None; Secure`
+1. `auth.json: cookie_secure=false` on a cross-site HTTPS deployment — set it `true` and restart so the cookie uses `SameSite=None; Secure`
+2. `auth.json: cookie_secure=true` during local HTTP testing — set it `false`
3. The browser blocks third-party cookies and you're on a subdomain — serve frontend and API from the same hostname (e.g., both at `deeptutor.example.com`, frontend on `/`, API proxied at `/api/`)
## Docker
@@ -254,47 +250,50 @@ Open the browser dev tools (⌥⌘I) and check the Console tab. Common causes:
Same as above — usually backend isn't running or CORS / API base URL mismatch. Check the Network tab to see what URL the request goes to.
-## TutorBot
+## Partners & channels
+
+### Partner channel grayed out in the Channels panel / "missing SDK"
-### Bot says "missing SDK" on start
+When a channel's SDK can't be imported, the Partners **Channels** panel disables that channel and shows the import error (e.g. `No module named 'lark_oapi'`); starting the partner from the CLI reports the same error. Install the missing dependency set, then restart DeepTutor:
-The gateway-specific SDK wasn't installed. The error message tells you which one. Install:
+```bash
+pip install -e ".[partners]" # all built-in channel SDKs (source install)
+pip install -U "deeptutor[partners]" # same, for the PyPI install
+pip install -e ".[matrix]" # Matrix channel; ".[matrix-e2e]" for encrypted rooms (needs libolm)
+```
+
+If you are using the CLI-only package from `packaging/deeptutor-cli` (it defines no extras), install the requirements mirror from the source checkout instead:
```bash
-# Generic
-pip install -e ".[partners]"
-
-# Or one specific (rarely needed)
-pip install python-telegram-bot # Telegram
-pip install slack-sdk # Slack
-pip install zulip # Zulip
-pip install matrix-nio # Matrix (no E2EE)
+python -m pip install -r requirements/partners.txt
```
-### Bot connects but doesn't respond
+The channel comes back once the package is installed and the server restarted.
+
+### Partner connects but doesn't respond
-Check `allow_from` in the bot's channel config:
+Check `allow_from` in the channel card:
```yaml
-telegram:
+weixin:
enabled: true
- token: "..."
allow_from: # empty = deny everyone
- "*" # allow all
- # - "12345678" # or specific Telegram user IDs
+ # - "sender-id" # or specific user/chat ids after testing
```
By default `allow_from: []` denies everyone — you have to explicitly opt users in.
-### Bot disconnects after a few minutes
+### Channel disconnects after a few minutes
Long-poll / WebSocket connections drop occasionally. The channel manager auto-reconnects with backoff, but if you see frequent drops:
- Check network stability between the host and the gateway provider
-- For Telegram polling, increase `timeout` to 60 seconds
-- For Matrix, verify the homeserver isn't aggressively timing out
+- For WeChat, confirm `state_dir` is writable and persisted
+- 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 [**Explore TutorBot**](/docs/tutorbot/) for per-gateway debugging.
+See [**Partners & Channels**](/docs/partners/) and the [**Channel Matrix**](/docs/partners/channels/) for channel-specific debugging.
## Memory / RAG accuracy
diff --git a/site/src/content/docs/docs/index.md b/site/src/content/docs/docs/index.md
index 16179ad42..b793aa091 100644
--- a/site/src/content/docs/docs/index.md
+++ b/site/src/content/docs/docs/index.md
@@ -1,21 +1,21 @@
---
title: Documentation
-description: Agent-native, open-source personalized tutoring — install paths, surfaces, TutorBot gateways, and CLI reference.
+description: Agent-native, open-source personalized tutoring — install paths, product surfaces, Partners channels, and CLI reference.
---
Welcome to the DeepTutor documentation. Pick a path below, or use the left sidebar.
## Where to start
-- **[Get Started](/docs/get-started/)** — Four install paths: PyPI, From Source, Docker, CLI-Only.
-- **[Explore DeepTutor](/docs/explore/)** — Tour the five core surfaces (Chat, Co-Writer, Book, Knowledge, Space) plus Memory and Settings.
-- **[Explore TutorBot](/docs/tutorbot/)** — Connect persistent AI tutors to Telegram, Slack, Feishu, Matrix, and more.
-- **[DeepTutor CLI](/docs/cli/)** — Drive every capability from the terminal, or hand it to an AI agent.
+- **[Get Started](/docs/get-started/)** — PyPI, From Source, Docker, and CLI-Only install paths.
+- **[Explore DeepTutor](/docs/explore/)** — Chat, Partners, Co-Writer, Book, Knowledge, Space, Memory, and Settings.
+- **[Partners & Channels](/docs/partners/)** — Connect persistent learning companions to WeChat, WeCom, QQ/NapCat, and other IM channels.
+- **[DeepTutor CLI](/docs/cli/)** — Drive capabilities, KBs, sessions, notebooks, memory, books, and partners from the terminal.
- **[Providers](/docs/get-started/providers/)** — Set up LLM, embedding, and search providers.
## What is DeepTutor
-An open-source, agent-native learning companion. **Five modes** (Chat, Solve, Quiz, Research, Visualize) share one session, knowledge base, and citation history. **TutorBots** carry your context out to Telegram, Slack, Feishu, and other channels. A **three-layer Memory** with an inspectable workbench and a Memory Graph lets you audit *why* the system knows what it knows.
+DeepTutor is an open-source, agent-native learning companion. A shared runtime powers Chat, deeper capabilities, Partners, Book generation, Co-Writer editing, RAG, and three-layer Memory. Partners carry the same chat agent loop into IM channels while keeping their own soul, library, tools, and workspace.
Built at HKU Data Intelligence Lab. Apache 2.0 license.
diff --git a/site/src/content/docs/docs/partners/channels.md b/site/src/content/docs/docs/partners/channels.md
index f2fe59080..d3b4321f3 100644
--- a/site/src/content/docs/docs/partners/channels.md
+++ b/site/src/content/docs/docs/partners/channels.md
@@ -7,25 +7,41 @@ Partner channels are delivery adapters around the same Partner brain. They do no
Use the web UI for most configuration: **Partners -> your partner -> Channels** renders the live schema from `/api/v1/partners/channels/schema`, masks secret fields, and lets you reload channels without rewriting YAML by hand.
+![Partner channel cards](/screenshots/partners-channels.png)
+
## 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 | app credentials, `allow_from`, group policy fields |
-| 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` |
-| 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 |
+| <img src="/channel-icons/weixin.svg" alt="" width="16" height="16" /> WeChat | `weixin` | HTTP long-poll + QR login | Personal WeChat assistant | `allow_from`; optional `token`, `state_dir`, `route_tag`, `poll_timeout` |
+| <img src="/channel-icons/wecom.svg" alt="" width="16" height="16" /> WeCom | `wecom` | WeCom AI Bot WebSocket | Enterprise WeChat / WeChat Work | `bot_id`, `secret`, `allow_from` |
+| <img src="/channel-icons/qq.svg" alt="" width="16" height="16" /> QQ | `qq` | Tencent botpy WebSocket | Official QQ bot deployments | `app_id`, `secret`, `allow_from`, `msg_format` |
+| <img src="/channel-icons/napcat.svg" alt="" width="16" height="16" /> QQ (NapCat) | `napcat` | OneBot v11 WebSocket | Personal QQ via NapCat | `ws_url`, optional `access_token`, `allow_from`, `group_policy` |
+| <img src="/channel-icons/telegram.svg" alt="" width="16" height="16" /> Telegram | `telegram` | Bot API polling | Simple personal or group bot | `token`, `allow_from` |
+| <img src="/channel-icons/discord.svg" alt="" width="16" height="16" /> Discord | `discord` | Gateway WebSocket | Discord servers and DMs | `token`, `allow_from`, group policy fields |
+| <img src="/channel-icons/slack.svg" alt="" width="16" height="16" /> Slack | `slack` | Socket Mode | Slack teams, DMs, threaded channel help | `bot_token`, `app_token`, `allow_from`, `group_policy` |
+| <img src="/channel-icons/feishu.svg" alt="" width="16" height="16" /> Feishu / Lark | `feishu` | Lark SDK WebSocket | Feishu/Lark enterprise chat | `app_id`, `app_secret`, verification/encryption fields where used |
+| <img src="/channel-icons/dingtalk.svg" alt="" width="16" height="16" /> DingTalk | `dingtalk` | Stream Mode | DingTalk enterprise chat | app credentials, `allow_from`, group policy fields |
+| <img src="/channel-icons/matrix.svg" alt="" width="16" height="16" /> Matrix | `matrix` | Matrix sync loop | Decentralized rooms, optional E2EE setup | `homeserver`, user credentials or `access_token`, `allow_from`, `group_policy` |
+| <img src="/channel-icons/zulip.svg" alt="" width="16" height="16" /> Zulip | `zulip` | Event queue | Stream + topic workflows | `email`, `api_key`, `site`, `allow_from`, `group_policy` |
+| <img src="/channel-icons/whatsapp.svg" alt="" width="16" height="16" /> WhatsApp | `whatsapp` | Bridge WebSocket | WhatsApp via a bridge runtime | bridge URL/token, `allow_from` |
+| <img src="/channel-icons/email.svg" alt="" width="16" height="16" /> Email | `email` | IMAP poll + SMTP send | Async email tutoring/helpdesk | IMAP host/user/password, SMTP host/user/password, `allow_from` |
+| <img src="/channel-icons/mochat.svg" alt="" width="16" height="16" /> Mochat | `mochat` | Socket.IO or HTTP polling | Customer-service style chat panel | `base_url` / socket URL, `claw_token`, `allow_from` |
+| <img src="/channel-icons/msteams.svg" alt="" width="16" height="16" /> 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
+pip install -e ".[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: install `".[matrix]"` for plain rooms or `".[matrix-e2e]"` for E2EE.
+
+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'`). Install the missing package, restart DeepTutor, and the card becomes editable.
## Shared delivery switches
@@ -69,6 +85,19 @@ Persist the whole `data/partners/` tree in Docker or production hosts. Losing ru
## Detailed pages
-- [WeChat](/docs/partners/weixin/) — personal WeChat QR login and long-poll setup
-- [WeCom](/docs/partners/wecom/) — Enterprise WeChat AI Bot setup
-- [QQ / NapCat](/docs/partners/qq/) — official QQ bot and personal QQ bridge paths
+Every built-in channel has a dedicated page with platform-side registration steps, a field-by-field walkthrough of the channel card, and troubleshooting:
+
+- <img src="/channel-icons/weixin.svg" alt="" width="16" height="16" /> [WeChat](/docs/partners/weixin/) — personal WeChat QR login and long-poll setup
+- <img src="/channel-icons/wecom.svg" alt="" width="16" height="16" /> [WeCom](/docs/partners/wecom/) — Enterprise WeChat AI Bot setup
+- <img src="/channel-icons/qq.svg" alt="" width="16" height="16" /> [QQ / NapCat](/docs/partners/qq/) — official QQ bot and personal QQ bridge paths
+- <img src="/channel-icons/telegram.svg" alt="" width="16" height="16" /> [Telegram](/docs/partners/telegram/) — BotFather registration, Bot API polling, live streaming
+- <img src="/channel-icons/discord.svg" alt="" width="16" height="16" /> [Discord](/docs/partners/discord/) — Developer Portal app, intents, Gateway WebSocket
+- <img src="/channel-icons/slack.svg" alt="" width="16" height="16" /> [Slack](/docs/partners/slack/) — Socket Mode app with bot + app tokens
+- <img src="/channel-icons/feishu.svg" alt="" width="16" height="16" /> [Feishu / Lark](/docs/partners/feishu/) — open-platform app and CardKit streaming cards
+- <img src="/channel-icons/dingtalk.svg" alt="" width="16" height="16" /> [DingTalk](/docs/partners/dingtalk/) — Stream Mode enterprise bot
+- <img src="/channel-icons/matrix.svg" alt="" width="16" height="16" /> [Matrix](/docs/partners/matrix/) — homeserver credentials and optional E2EE
+- <img src="/channel-icons/zulip.svg" alt="" width="16" height="16" /> [Zulip](/docs/partners/zulip/) — bot account and stream subscriptions
+- <img src="/channel-icons/whatsapp.svg" alt="" width="16" height="16" /> [WhatsApp](/docs/partners/whatsapp/) — bridge runtime setup
+- <img src="/channel-icons/email.svg" alt="" width="16" height="16" /> [Email](/docs/partners/email/) — IMAP polling and SMTP replies
+- <img src="/channel-icons/mochat.svg" alt="" width="16" height="16" /> [Mochat](/docs/partners/mochat/) — Socket.IO customer-service panel
+- <img src="/channel-icons/msteams.svg" alt="" width="16" height="16" /> [Microsoft Teams](/docs/partners/msteams/) — Bot Framework webhook listener
diff --git a/site/src/content/docs/docs/partners/dingtalk.md b/site/src/content/docs/docs/partners/dingtalk.md
new file mode 100644
index 000000000..d3d6878f8
--- /dev/null
+++ b/site/src/content/docs/docs/partners/dingtalk.md
@@ -0,0 +1,81 @@
+---
+title: DingTalk
+description: Configure the DingTalk channel for a Partner — internal app setup, Stream Mode connection, no public callback URL.
+---
+
+<img src="/channel-icons/dingtalk.svg" alt="" width="40" height="40" />
+
+The `dingtalk` channel connects a Partner to a DingTalk (钉钉) enterprise robot through the official `dingtalk-stream` SDK in **Stream Mode**: DeepTutor opens an outbound connection to DingTalk's servers to receive messages, so you need no public IP and no HTTP callback URL. Replies go back through DingTalk's HTTP API as markdown messages, in both DMs and group chats. If your organization lives on DingTalk, this is a two-credential setup — Client ID and Client Secret — and you are done.
+
+![DingTalk channel configuration](/screenshots/partners-channel-dingtalk.png)
+
+## Install requirements
+
+DingTalk support ships with the Partners extra; the underlying client is the official `dingtalk-stream` SDK — nothing extra to install.
+
+```bash
+pip install -e ".[partners]"
+# or, from an installed release when partners extras are available:
+pip install "deeptutor[partners]"
+```
+
+## Create an internal app on the Open Platform
+
+1. Sign in to the [DingTalk Open Platform](https://open.dingtalk.com/) with an account that has developer access to your organization.
+2. Go to **Application Development**, create an **Internal Application** (企业内部应用), and fill in the name, description, and icon.
+3. In the app, add the **Robot** capability (应用能力 -> 机器人) and configure its display name and avatar.
+4. In the robot's message settings, set the message receiving mode to **Stream Mode** instead of HTTP callback — this is what lets DeepTutor connect without a public URL.
+5. On **Credentials & Basic Info**, copy the **Client ID** (AppKey) and **Client Secret** (AppSecret) — they go into the channel card.
+6. **Release the app version.** A robot in draft state never receives Stream messages. After release, set the availability scope and add the robot in DingTalk (search for it in contacts, or add it to a group).
+
+## Configure the channel card
+
+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. |
+
+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.
+
+## After you save
+
+1. Click **Save**, then turn **Enabled** on.
+2. Start the partner (or restart it / use the reload action on the Channels panel if it is already running).
+3. From an allowed account, find the robot in DingTalk and send it a short DM — or @mention it in a group it has been added to.
+4. Watch the partner logs: you should see `Received DingTalk message from <name> (<id>)` followed by the reply delivery.
+5. Once you have confirmed the sender id in the logs, replace `*` in **Allow From** with real ids.
+
+## Verify it is healthy
+
+- The logs show `DingTalk bot started with Stream Mode` and no recurring `Reconnecting DingTalk stream in 5 seconds...` lines.
+- A short DM from an allowed account gets a markdown reply.
+- In a group, @mentioning the robot produces an answer routed back to that group.
+
+## Troubleshooting
+
+### The stream keeps reconnecting
+
+The channel retries every 5 seconds on disconnect, so an occasional reconnect line is harmless. A tight loop of them means the credentials are wrong or the network blocks DingTalk's endpoints — re-check **Client Id** / **Client Secret** first.
+
+### `Failed to get DingTalk access token`
+
+Replies need an access token fetched with the same credential pair. This error almost always means the **Client Secret** was rotated on the platform — copy the current value from Credentials & Basic Info and save again.
+
+### Connected but no messages arrive
+
+Three things to check on the platform side: the app version is **released** (drafts receive nothing), the message receiving mode is **Stream Mode**, and the robot is actually reachable — inside the availability scope and added to the conversation you are testing from.
+
+### The bot never replies
+
+Almost always **Allow From**. An empty list denies everyone — including you. Put `*` in for a first test, then switch to the staff id printed in the logs.
+
+## See also
+
+- [Channel Matrix](/docs/partners/channels/) — all channels at a glance
+- [Feishu](/docs/partners/feishu/) — the other major Chinese workplace chat, same no-webhook model
diff --git a/site/src/content/docs/docs/partners/discord.md b/site/src/content/docs/docs/partners/discord.md
new file mode 100644
index 000000000..baafefe00
--- /dev/null
+++ b/site/src/content/docs/docs/partners/discord.md
@@ -0,0 +1,89 @@
+---
+title: Discord
+description: Configure the Discord channel for a Partner — Developer Portal app, Gateway WebSocket, intents, and live-streamed replies.
+---
+
+<img src="/channel-icons/discord.svg" alt="" width="40" height="40" />
+
+The `discord` channel connects a Partner to a Discord bot over the **Gateway WebSocket** (API v10). DeepTutor speaks the gateway protocol directly — no `discord.py` dependency — and handles heartbeats and reconnects on its own. As with Telegram, there is no public IP or webhook requirement; the bot dials out to Discord.
+
+**Streaming** is supported: with the switch on, the bot posts one message and keeps patching it through the REST API as the reply is generated, so the answer grows in place.
+
+![Discord channel configuration](/screenshots/partners-channel-discord.png)
+
+## Install requirements
+
+Discord support ships with the Partners extra; the gateway client is built on `websockets`, which is already included.
+
+```bash
+pip install -e ".[partners]"
+# or, from an installed release when partners extras are available:
+pip install "deeptutor[partners]"
+```
+
+## Create the Discord application
+
+1. Open <https://discord.com/developers/applications> and click **New Application**; give it a name.
+2. In the left sidebar, open **Bot**. Under **TOKEN**, click **Reset Token** and copy the value — this goes into the **Token** field.
+3. Still on the **Bot** page, under **Privileged Gateway Intents**, enable **MESSAGE CONTENT INTENT**. Without it the bot receives messages with empty text. **Server Members Intent** is optional.
+4. Invite the bot to your server: **OAuth2** -> **URL Generator**, check the `bot` scope, then check the permissions `Send Messages`, `Read Message History`, `Attach Files`, `Embed Links`, `Add Reactions`. Open the generated URL, pick a server, **Authorize**.
+5. To collect user ids for **Allow From**: Discord settings -> **Advanced** -> enable **Developer Mode**, then right-click any user -> **Copy User ID**.
+
+## Configure the channel card
+
+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. |
+
+Replies longer than Discord's 2000-character limit are split into multiple messages automatically.
+
+## After you save
+
+1. Click **Save**, then turn **Enabled** on.
+2. Start the partner (or restart it / use the reload action on the Channels panel if it is already running).
+3. From an allowed account, DM the bot or @mention it in a server channel.
+4. Watch the partner logs: you should see the gateway connect, the inbound message, and the reply delivery.
+5. Once you have confirmed the sender id in the logs, replace `*` in **Allow From** with real ids.
+
+## Verify it is healthy
+
+- The logs show the gateway connected and heartbeating, with no reconnect loop.
+- The bot appears **online** in your server's member list.
+- A DM from an allowed account gets a reply, and an @mention in a server channel gets one too.
+
+## Troubleshooting
+
+### The gateway closes with `4014: Disallowed intent`
+
+The **Intents** number requests a privileged intent that is not enabled in the Developer Portal. Most often it is Message Content: open your app -> **Bot** -> enable **MESSAGE CONTENT INTENT**, then restart the partner.
+
+### The bot is online but never replies
+
+Check two things:
+
+1. **Allow From** — an empty list denies everyone. Use `*` to test, then your real user id.
+2. **MESSAGE CONTENT INTENT** — without it, server messages arrive with empty `content`, so the bot has nothing to answer. Enable it in the portal.
+
+### No replies in server channels, but DMs work
+
+With **Group Policy** = `mention`, the message must actually @mention the bot. Also confirm the bot was invited with `Send Messages` and `Read Message History` permissions in that channel.
+
+### Streaming is on but nothing streams
+
+**Streaming** requires **Send Progress** — turn both on. Also note Discord rate-limits message edits, so the in-place updates arrive in chunks rather than character by character; that is expected.
+
+## See also
+
+- [Channel Matrix](/docs/partners/channels/) — all channels at a glance
+- [Telegram](/docs/partners/telegram/) — simpler polling model, same streaming switch
+- [Slack](/docs/partners/slack/) — similar developer-portal feel, Socket Mode
diff --git a/site/src/content/docs/docs/partners/email.md b/site/src/content/docs/docs/partners/email.md
new file mode 100644
index 000000000..0e24dfd12
--- /dev/null
+++ b/site/src/content/docs/docs/partners/email.md
@@ -0,0 +1,98 @@
+---
+title: Email
+description: Configure the email channel for a Partner using IMAP polling for inbound mail and SMTP replies.
+---
+
+<img src="/channel-icons/email.svg" alt="" width="40" height="40" />
+
+The `email` channel turns a Partner into an asynchronous mailbox correspondent: it polls an IMAP inbox for unread mail and answers through SMTP. There is no realtime connection — turnaround is one poll cycle — which makes it a natural fit for help-desk style support and for users who simply prefer email over chat apps.
+
+![Email channel configuration](/screenshots/partners-channel-email.png)
+
+## Install requirements
+
+Nothing extra. The email channel is built entirely on Python's standard library (`imaplib` + `smtplib`), so every DeepTutor install can run it — no additional pip packages, no extras.
+
+## Prepare a mail account
+
+The Partner needs its own mailbox with IMAP and SMTP access. Do not reuse a personal inbox: the channel reads and replies to everything unread.
+
+**Gmail**
+
+1. Enable 2-Step Verification on the account.
+2. Create an [App Password](https://myaccount.google.com/apppasswords) — a 16-character password used in place of the account password. With 2FA on, regular passwords are rejected for IMAP/SMTP.
+3. Make sure IMAP is on: Gmail Settings -> **Forwarding and POP/IMAP** -> Enable IMAP.
+4. Hosts: `imap.gmail.com:993` (SSL) and `smtp.gmail.com:587` (STARTTLS).
+
+**Outlook / Office 365** — with 2FA enabled, an App Password works the same way if your tenant allows them; otherwise ask your admin.
+
+**Self-hosted** (Postfix, Maddy, ...) — use the account credentials directly and fill in your own hosts and ports.
+
+## Configure the channel card
+
+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. `[email protected]`. |
+| **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. |
+
+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.
+
+## After you save
+
+1. Click **Save**, then turn on both **Enabled** and **Consent Granted** and save again.
+2. Start the partner — from the UI, or `deeptutor partner start <partner-id>`. If it is already running, restart it so the channel picks up the new config.
+3. Send a test email from an address listed in **Allow From** and wait up to one poll interval for the reply.
+4. Once replies flow, replace `*` in **Allow From** with the real addresses you want to serve.
+
+## Verify it is healthy
+
+A healthy email channel has three signs:
+
+- the log shows `Starting Email channel (IMAP polling mode)...` with no `missing:` or consent warnings;
+- a test mail from an allowed sender gets a reply within roughly one poll interval;
+- processed messages show up as read in the mailbox (when **Mark Seen** is on).
+
+## Troubleshooting
+
+### The channel starts and then does nothing
+
+Check the log. `consent_granted is false` means the consent gate is off — that is deliberate friction, flip **Consent Granted** consciously. `Email channel not configured, missing: ...` lists exactly which of the six required fields (IMAP/SMTP host, username, password) are empty.
+
+### IMAP authentication failed
+
+On Gmail and Outlook with 2FA, the account password never works for IMAP/SMTP — you need an App Password. Also confirm IMAP is enabled in the provider's settings; Gmail ships with it off.
+
+### Duplicate replies to the same email
+
+**Mark Seen** is the primary dedup: if it is off, every poll re-reads the same unread mail. Also make sure only one running partner polls this mailbox — two instances will race each other.
+
+### Reply storms with auto-responders
+
+If the Partner mails an address that auto-replies (vacation responders, other bots), the two can loop once per poll interval. Keep **Allow From** tight so strangers' auto-replies are dropped at the gate, and use **Auto Reply Enabled** off as an emergency brake.
+
+### Replies land in spam
+
+Set a proper **From Address**, and for self-hosted domains add SPF/DKIM/DMARC records or relay outbound mail through a trusted SMTP service.
diff --git a/site/src/content/docs/docs/partners/feishu.md b/site/src/content/docs/docs/partners/feishu.md
new file mode 100644
index 000000000..c9d13220d
--- /dev/null
+++ b/site/src/content/docs/docs/partners/feishu.md
@@ -0,0 +1,90 @@
+---
+title: Feishu
+description: Configure the Feishu / Lark channel for a Partner — Open Platform app setup, WebSocket long connection, and CardKit streaming cards.
+---
+
+<img src="/channel-icons/feishu.svg" alt="" width="40" height="40" />
+
+The `feishu` channel connects a Partner to a Feishu (飞书) or Lark custom app through the official `lark-oapi` SDK over a **WebSocket long connection**: DeepTutor dials out to Feishu's servers, so you need no public IP, no webhook URL, and no reverse proxy. The same channel serves both mainland Feishu (`open.feishu.cn`) and international Lark (`open.larksuite.com`) apps, which makes it the natural choice for a workplace tutor inside a Chinese organization.
+
+The channel also supports **Streaming**: with the switch on, replies render as CardKit streaming cards that fill in with a live typewriter effect while the answer is generated.
+
+![Feishu channel configuration](/screenshots/partners-channel-feishu.png)
+
+## Install requirements
+
+Feishu support ships with the Partners extra; the underlying client is the official `lark-oapi` SDK — nothing extra to install.
+
+```bash
+pip install -e ".[partners]"
+# or, from an installed release when partners extras are available:
+pip install "deeptutor[partners]"
+```
+
+## Create an app on the Open Platform
+
+1. Open the [Feishu Open Platform](https://open.feishu.cn/) (or the [Lark Open Platform](https://open.larksuite.com/) for international tenants), go to the **Developer Console**, and create a **Custom App** with a name, description, and icon.
+2. On **Credentials & Basic Info**, copy the **App ID** (`cli_...`) and **App Secret** — they go into the channel card.
+3. **Features -> Bot**: enable the bot capability and give the bot a display name and avatar.
+4. **Events & Callbacks**: switch the subscription mode to **Long Connection** so events arrive over WebSocket instead of a webhook, then subscribe to the `im.message.receive_v1` event.
+5. **Permissions & Scopes**: grant the messaging scopes — at minimum `im:message` (read and send as bot); add `im:resource` if images, files, and audio should flow through.
+6. **Create a version and release it.** For internal apps this is an internal release plus admin approval. Until a version is released, the bot receives nothing — this is the single most common setup mistake.
+
+If you enable event encryption on the platform (under Events & Callbacks), also note the **Encrypt Key** and **Verification Token**; they must be mirrored into the channel card.
+
+## Configure the channel card
+
+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. |
+| **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. |
+
+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.
+
+## After you save
+
+1. Click **Save**, then turn **Enabled** on.
+2. Start the partner (or restart it / use the reload action on the Channels panel if it is already running).
+3. From an allowed account, open a DM with the bot in Feishu and send a short message.
+4. Watch the partner logs: you should see the inbound event, and your message should receive the React Emoji reaction almost immediately.
+5. Once you have confirmed the `ou_...` sender id in the logs, replace `*` in **Allow From** with real ids.
+
+## Verify it is healthy
+
+- The logs show `Feishu bot started with WebSocket long connection` and no repeated `Feishu WebSocket error` lines (the channel auto-reconnects every 5 seconds if the connection drops).
+- Your test message gets the React Emoji reaction right away — that confirms both inbound events and outbound API credentials work.
+- The reply arrives; with **Streaming** on, you see a card filling in live instead of a single final message.
+
+## Troubleshooting
+
+### The bot receives nothing
+
+Three gates must all be open: the app version is **released** (not draft), the `im.message.receive_v1` event is subscribed, and the subscription mode is **Long Connection**. A missing release is the most common cause — re-check it first.
+
+### Messages arrive but replies fail
+
+Usually a missing scope. Make sure `im:message` is granted (plus `im:resource` for media), then **release a new version** — scope changes only take effect after release. The exact API error code appears in the partner logs.
+
+### Events fail after enabling encryption
+
+If you configured an Encrypt Key on the platform, the same value must be in the channel card (along with the Verification Token), and vice versa. After rotating either value on the platform, update the card and restart the partner.
+
+### Streaming cards never stream
+
+**Streaming** requires **Send Progress** to be on. If CardKit card creation fails (look for `Failed to create Feishu streaming card` in the logs), the channel falls back to sending a regular card at the end of the turn — the reply still arrives, just without the typewriter effect.
+
+## See also
+
+- [Channel Matrix](/docs/partners/channels/) — all channels at a glance
+- [DingTalk](/docs/partners/dingtalk/) — the other major Chinese workplace chat, similar no-webhook model
diff --git a/site/src/content/docs/docs/partners/index.md b/site/src/content/docs/docs/partners/index.md
new file mode 100644
index 000000000..5b8329f0b
--- /dev/null
+++ b/site/src/content/docs/docs/partners/index.md
@@ -0,0 +1,84 @@
+---
+title: Partners & Channels
+description: Operator guide for DeepTutor Partners, channel configuration, workspace layout, and IM delivery behavior.
+---
+
+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
+```
+
+## What changed from TutorBot
+
+| Old TutorBot | New Partner |
+| --- | --- |
+| Separate bot engine and `data/tutorbot/<id>/` workspace | Same Chat loop, scoped workspace under `data/partners/<id>/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 `/docs/tutorbot/*` links are retained as short migration notices so external links do not hard 404.
+
+## 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**, assign one small KB or skill first. Assets are copied into the Partner workspace.
+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 detail](/screenshots/partners-detail.png)
+
+## Channel entry points
+
+| Channel | Use when | Page |
+| --- | --- | --- |
+| <img src="/channel-icons/weixin.svg" alt="" width="16" height="16" /> WeChat (`weixin`) | Personal WeChat via QR-code login and HTTP long-poll | [WeChat](/docs/partners/weixin/) |
+| <img src="/channel-icons/wecom.svg" alt="" width="16" height="16" /> WeCom (`wecom`) | Enterprise WeChat / WeChat Work AI Bot platform | [WeCom](/docs/partners/wecom/) |
+| <img src="/channel-icons/qq.svg" alt="" width="16" height="16" /> QQ (`qq`) | Official Tencent QQ bot account via botpy | [QQ / NapCat](/docs/partners/qq/) |
+| <img src="/channel-icons/napcat.svg" alt="" width="16" height="16" /> NapCat (`napcat`) | Personal QQ account through OneBot v11 / NapCat | [QQ / NapCat](/docs/partners/qq/) |
+| <img src="/channel-icons/telegram.svg" alt="" width="16" height="16" /> Telegram (`telegram`) | Fastest setup — BotFather token, no public IP | [Telegram](/docs/partners/telegram/) |
+| <img src="/channel-icons/discord.svg" alt="" width="16" height="16" /> Discord (`discord`) | Discord servers and DMs via Gateway WebSocket | [Discord](/docs/partners/discord/) |
+| <img src="/channel-icons/slack.svg" alt="" width="16" height="16" /> Slack (`slack`) | Slack teams over Socket Mode, threaded replies | [Slack](/docs/partners/slack/) |
+| <img src="/channel-icons/feishu.svg" alt="" width="16" height="16" /> Feishu (`feishu`) | Feishu / Lark with CardKit streaming cards | [Feishu](/docs/partners/feishu/) |
+| <img src="/channel-icons/dingtalk.svg" alt="" width="16" height="16" /> DingTalk (`dingtalk`) | DingTalk enterprise bot over Stream Mode | [DingTalk](/docs/partners/dingtalk/) |
+| <img src="/channel-icons/matrix.svg" alt="" width="16" height="16" /> Matrix (`matrix`) | Decentralized rooms, optional E2EE | [Matrix](/docs/partners/matrix/) |
+| <img src="/channel-icons/zulip.svg" alt="" width="16" height="16" /> Zulip (`zulip`) | Stream + topic structured team chat | [Zulip](/docs/partners/zulip/) |
+| <img src="/channel-icons/whatsapp.svg" alt="" width="16" height="16" /> WhatsApp (`whatsapp`) | WhatsApp through a bridge runtime | [WhatsApp](/docs/partners/whatsapp/) |
+| <img src="/channel-icons/email.svg" alt="" width="16" height="16" /> Email (`email`) | Async inbox workflows over IMAP/SMTP | [Email](/docs/partners/email/) |
+| <img src="/channel-icons/mochat.svg" alt="" width="16" height="16" /> Mochat (`mochat`) | Customer-service style chat panels | [Mochat](/docs/partners/mochat/) |
+| <img src="/channel-icons/msteams.svg" alt="" width="16" height="16" /> Microsoft Teams (`msteams`) | Teams via Bot Framework webhook listener | [Microsoft Teams](/docs/partners/msteams/) |
+
+For a side-by-side comparison of connection models, required fields, and delivery switches, see the [Channel Matrix](/docs/partners/channels/).
+
+## Runtime state
+
+```text
+data/partners/<partner_id>/
+├── config.yaml # Partner identity, model, channels, tools
+├── sessions.db # Partner conversation store
+├── workspace/
+│ ├── knowledge_bases/ # Copied assigned KBs
+│ └── user/
+│ ├── workspace/SOUL.md
+│ ├── workspace/skills/<name>/SKILL.md
+│ ├── workspace/notebook/
+│ └── workspace/memory/
+└── runtime/
+ └── <channel>/... # QR tokens, cursors, conversation refs
+```
+
+The Partner workspace stores copies of assigned resources. This is intentional: the Partner keeps a stable library even if the original user's workspace later changes.
+
+## Web UI vs CLI
+
+Use the Web UI for channel configuration because it renders the live schema from `/api/v1/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/site/src/content/docs/docs/partners/matrix.md b/site/src/content/docs/docs/partners/matrix.md
new file mode 100644
index 000000000..0fddd565a
--- /dev/null
+++ b/site/src/content/docs/docs/partners/matrix.md
@@ -0,0 +1,112 @@
+---
+title: Matrix
+description: Configure the Matrix channel for a Partner — any homeserver, long-poll sync, optional end-to-end encryption.
+---
+
+<img src="/channel-icons/matrix.svg" alt="" width="40" height="40" />
+
+The `matrix` channel connects a Partner to decentralized Matrix rooms through the standard client-server API. Any homeserver works — matrix.org, or your self-hosted Synapse / Conduit / Dendrite — and end-to-end encryption is available as an opt-in so most installs do not pay the libolm dependency cost.
+
+![Matrix channel configuration](/screenshots/partners-channel-matrix.png)
+
+## Install requirements
+
+Matrix is **not** part of the Partners extra — it ships as two extras of its own:
+
+```bash
+# plain Matrix (unencrypted rooms)
+pip install -e ".[matrix]"
+
+# Matrix including end-to-end encrypted rooms
+pip install -e ".[matrix-e2e]"
+```
+
+- `[matrix]` installs `matrix-nio`, `mistune`, and `nh3`. This is enough for direct chats and unencrypted rooms.
+- `[matrix-e2e]` adds `matrix-nio[e2e]`, which pulls `python-olm` — and that needs the native **libolm** library installed first:
+
+```bash
+# macOS
+brew install libolm
+
+# Debian / Ubuntu
+sudo apt-get install libolm-dev
+```
+
+For Docker/CI without a source checkout, the same sets are mirrored in `requirements/matrix.txt` and `requirements/matrix-e2e.txt`.
+
+If you skip the extras entirely, the channel fails at import time with `Matrix dependencies not installed`.
+
+## Create a bot account and get an access token
+
+The Partner needs its own Matrix account on any homeserver — matrix.org is fine for testing.
+
+1. Create the account: Element web app -> your homeserver -> Create Account (or `register_new_matrix_user` on self-hosted Synapse).
+2. Get the access token, either way:
+ - **Element**: sign in as the bot, **Settings -> Help & About -> Advanced -> Access Token**, reveal and copy.
+ - **REST API**:
+
+```bash
+curl -X POST https://matrix.org/_matrix/client/r0/login \
+ -H "Content-Type: application/json" \
+ -d '{"type": "m.login.password", "user": "my-bot", "password": "your-password"}'
+# the response contains "access_token": "syt_..."
+```
+
+## Configure the channel card
+
+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. |
+
+## After you save
+
+1. Click **Save**, then turn on **Enabled** and save again.
+2. Start the partner — from the UI, or `deeptutor partner start <partner-id>`. If it is already running, restart it.
+3. Invite the bot from any Matrix client: `/invite @my-bot:matrix.org`. The bot only accepts invites from senders that pass **Allow From** — with an empty list it will never join.
+4. Send a short message in the room and check the reply.
+5. Once it works, replace `*` in **Allow From** with real user ids.
+
+Markdown in replies is rendered as Matrix HTML, so tables and code blocks display correctly in Element and other clients.
+
+## Verify it is healthy
+
+A healthy Matrix channel has three signs:
+
+- the log shows the sync loop running with no repeated sync errors;
+- the bot joins a room within seconds of an invite from an allowed sender;
+- a short message in that room produces a Partner reply.
+
+Note the privacy boundary: E2EE protects the transport between Matrix clients and the bot, but message text still reaches your configured LLM provider in plaintext. If that matters, pair the channel with a local model.
+
+## Troubleshooting
+
+### The bot joins but never answers in an encrypted room
+
+**E2Ee Enabled** is on without the `[matrix-e2e]` extra (or libolm), or it is off while the room is encrypted. Install libolm, then `pip install -e ".[matrix-e2e]"`, turn the toggle on, and restart the partner.
+
+### `M_UNKNOWN_TOKEN`
+
+The access token was invalidated — usually by logging the bot out from another client, or a server-side reset. Fetch a fresh token via Element or the login API and update the card.
+
+### The first sync takes a long time
+
+An account with a long history syncs a large initial batch; this is normal and only happens once per device. Set a stable **Device Id** so later restarts resume incrementally instead of starting over.
+
+### The bot ignores my invite
+
+The inviter must pass **Allow From**. Add your own Matrix user id (or `*` while testing), save, and re-invite.
diff --git a/site/src/content/docs/docs/partners/mochat.md b/site/src/content/docs/docs/partners/mochat.md
new file mode 100644
index 000000000..3b96994cc
--- /dev/null
+++ b/site/src/content/docs/docs/partners/mochat.md
@@ -0,0 +1,104 @@
+---
+title: Mochat
+description: Connect a Partner to a Mochat customer-support panel over Socket.IO with automatic HTTP polling fallback.
+---
+
+<img src="/channel-icons/mochat.svg" alt="" width="40" height="40" />
+
+The `mochat` channel connects a Partner to Mochat, a customer-support style chat panel. It talks to your Mochat instance over **Socket.IO** and falls back to **HTTP polling** automatically when the socket cannot connect, so the channel keeps working behind picky proxies. Useful when you want a Partner embedded in a support widget rather than a personal messenger.
+
+![Mochat channel configuration](/screenshots/partners-channel-mochat.png)
+
+## Install requirements
+
+Mochat support is included with the Partners extra, which carries `python-socketio` and `msgpack`. Without `python-socketio` the channel still works in polling mode.
+
+```bash
+pip install -e ".[partners]"
+# or, from an installed release when partners extras are available:
+pip install "deeptutor[partners]"
+```
+
+## Get a Claw Token
+
+In your Mochat admin panel, create a bot account and copy its **Claw Token**. The channel refuses to start without it (`Mochat claw_token not configured` in the log).
+
+## Configure the channel card
+
+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. |
+
+### 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** | `0` means retry forever (also applies to socket reconnects). |
+| **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: `{"<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). |
+
+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.
+
+## After you save
+
+1. Save the card with **Enabled** on and **Claw Token** filled.
+2. Start (or restart) the partner from the UI or CLI.
+3. Check the log: a socket connection, or a polling-fallback warning — both are workable.
+4. Send a short message in a watched session or panel.
+5. Once you see real user ids in the logs, replace `*` in **Allow From** with explicit values.
+
+```bash
+deeptutor partner start <partner-id>
+```
+
+## Verify it is healthy
+
+A healthy Mochat channel has three signs:
+
+- the log shows a Socket.IO connection (or an explicit polling fallback, not an auth error);
+- `data/partners/<partner-id>/runtime/mochat/session_cursors.json` is being written — this is the watch position;
+- a short message from an allowed user produces a Partner reply.
+
+For Docker, persist `data/partners/` so cursors survive restarts.
+
+## Troubleshooting
+
+### Socket.IO keeps reconnecting or never connects
+
+Check **Socket Url** / **Socket Path** against your Mochat deployment. If the server cannot speak msgpack, turn on **Socket Disable Msgpack**. You can also just let it run: the channel falls back to HTTP polling on its own, trading a little latency for robustness.
+
+### Channel exits immediately
+
+The log says `Mochat claw_token not configured`. Fill **Claw Token** and restart the partner.
+
+### Subscriptions fail / token stopped working
+
+Log lines like `Mochat subscribePanels failed` usually mean the Claw Token is invalid, expired, or the bot was not approved in the Mochat admin panel. Regenerate the token, update the card, and restart.
+
+### Connected, but no messages come in
+
+Check that **Sessions** or **Panels** actually lists something (or `*`), and that the sender passes **Allow From**. In group sessions, also check whether a mention requirement is configured.
diff --git a/site/src/content/docs/docs/partners/msteams.md b/site/src/content/docs/docs/partners/msteams.md
new file mode 100644
index 000000000..007061cd1
--- /dev/null
+++ b/site/src/content/docs/docs/partners/msteams.md
@@ -0,0 +1,93 @@
+---
+title: Microsoft Teams
+description: Configure the Microsoft Teams channel for a Partner — Azure Bot registration, public messaging endpoint, and inbound JWT validation.
+---
+
+<img src="/channel-icons/msteams.svg" alt="" width="40" height="40" />
+
+The `msteams` channel connects a Partner to Microsoft Teams through the **Bot Framework**. Unlike every other DeepTutor channel, it does not dial out: it runs a small **built-in HTTP server** (default `0.0.0.0:3978`, path `/api/messages`) and Microsoft's servers POST each message to it. That means you need a **publicly reachable HTTPS endpoint** — in production, put a reverse proxy (nginx, Caddy, a Cloudflare Tunnel) in front of the port and point the Azure Bot's messaging endpoint at it. For local testing, a tunnel like `ngrok http 3978` works fine.
+
+The current scope is DM-first: text in, text out. Group and channel messages are ignored, and attachments are not yet supported.
+
+![Microsoft Teams channel configuration](/screenshots/partners-channel-msteams.png)
+
+## Install requirements
+
+Teams support ships with the Partners extra. Inbound requests are verified with `PyJWT[crypto]`, which is already included — nothing extra to install.
+
+```bash
+pip install -e ".[partners]"
+# or, from an installed release when partners extras are available:
+pip install "deeptutor[partners]"
+```
+
+## Register a bot with Azure
+
+1. In the [Azure Portal](https://portal.azure.com/), open **Microsoft Entra ID -> App registrations -> New registration**. Name it, pick the supported account types (single tenant is fine), and register. Copy the **Application (client) ID** — this becomes **App Id** — and the **Directory (tenant) ID** — this becomes **Tenant Id**.
+2. In the registration, open **Certificates & secrets -> New client secret**. Copy the secret **Value** immediately (it is shown only once) — this becomes **App Password**.
+3. Create an **Azure Bot** resource (search for "Azure Bot" in the marketplace). Under *Microsoft App ID*, choose **Use existing app registration** and paste your App Id. Match the bot's tenancy type to the registration: a single-tenant registration needs a single-tenant bot.
+4. In the bot resource, go to **Settings -> Configuration** and set the **Messaging endpoint** to your public HTTPS address ending in the channel path, e.g. `https://bots.example.com/api/messages`.
+5. Go to **Settings -> Channels** and add the **Microsoft Teams** channel.
+6. To start chatting, use the **Open in Teams** link on the Teams channel line. For org-wide distribution, package a Teams app manifest that references the same App Id.
+
+## Configure the channel card
+
+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. |
+| **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. |
+
+## After you save
+
+1. Click **Save**, then turn **Enabled** on.
+2. Start the partner (or restart it / use the reload action on the Channels panel if it is already running).
+3. Check that the endpoint is reachable from outside: `curl -X POST https://your-domain/api/messages -H 'Content-Type: application/json' -d '{}'` should return **401** (the JWT check rejecting you) — a connection error means the proxy path is broken.
+4. From an allowed account, open the bot in Teams (the **Open in Teams** link) and send a short DM.
+5. Once you have confirmed the sender id in the logs, replace `*` in **Allow From** with real ids.
+
+## Verify it is healthy
+
+- The logs show `MSTeams webhook listening on http://0.0.0.0:3978/api/messages` at startup.
+- An unauthenticated POST to the public endpoint returns 401, not a timeout — the proxy chain works and the JWT gate is up.
+- A DM from an allowed account gets a reply, and `msteams_conversations.json` appears in the partner's runtime directory — conversation references are being persisted.
+
+## Troubleshooting
+
+### Teams reports the message could not be sent
+
+The messaging endpoint is unreachable. Confirm the endpoint URL ends with your **Path**, the certificate is valid HTTPS, and the reverse proxy forwards to **Host**:**Port**. The `curl` probe from the checklist above isolates this in one step.
+
+### Every inbound request is rejected with 401
+
+Inbound JWT validation is failing. The most common cause is an **App Id** mismatch between the channel card and the bot registration — the token's audience must equal the App Id. If you recently recreated the registration, update the card. Do not work around this by disabling **Validate Inbound Auth** outside local testing.
+
+### Replies fail with a token error
+
+The channel could receive but cannot authenticate to send. This is the tenant trap: a **single-tenant** registration with **Tenant Id** left blank makes DeepTutor request tokens from the multi-tenant endpoint, which Microsoft rejects. Set **Tenant Id** to the Directory (tenant) ID and save.
+
+### The bot answers DMs but ignores group chats and channels
+
+By design: the channel is currently DM-only. Non-personal conversations are dropped on arrival (and pruned from stored references when **Prune Non Personal Refs** is on).
+
+## See also
+
+- [Channel Matrix](/docs/partners/channels/) — all channels at a glance
+- [Slack](/docs/partners/slack/) — the other big workplace platform, Socket Mode instead of a public endpoint
diff --git a/site/src/content/docs/docs/partners/qq.md b/site/src/content/docs/docs/partners/qq.md
new file mode 100644
index 000000000..99d7b7658
--- /dev/null
+++ b/site/src/content/docs/docs/partners/qq.md
@@ -0,0 +1,71 @@
+---
+title: QQ / NapCat
+description: "Configure Tencent QQ channels for Partners: official QQ bot accounts and personal QQ through NapCat / OneBot v11."
+---
+
+<img src="/channel-icons/qq.svg" alt="" width="40" height="40" />
+
+DeepTutor has two QQ-family channels:
+
+| Channel | Use when | Config key |
+| --- | --- | --- |
+| **QQ** | You have an official Tencent QQ bot account and app credentials. | `qq` |
+| **QQ (NapCat)** | You want to connect a personal QQ account through NapCat / OneBot v11. | `napcat` |
+
+## Official QQ bot (`qq`)
+
+Install the Partners extra, then create a bot in the [QQ Bot Development Platform](https://bot.q.qq.com/). Enable the message types you need, such as C2C/direct and group messages.
+
+![Official QQ bot channel configuration](/screenshots/partners-channel-qq.png)
+
+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. |
+
+Start with:
+
+```bash
+deeptutor partner start <partner-id>
+```
+
+## Personal QQ through NapCat (`napcat`)
+
+NapCat exposes a personal QQ account through a OneBot v11 WebSocket endpoint. Run NapCat separately, then point DeepTutor at its WebSocket URL.
+
+![NapCat channel configuration](/screenshots/partners-channel-napcat.png)
+
+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. |
+
+## Choosing between them
+
+Use `qq` for stable official bot deployments and group compliance. Use `napcat` for a personal-account workflow when you control the local NapCat runtime and understand the risk of personal-account automation.
+
+## Production notes
+
+- Prefer `qq` for official deployments where approval, compliance, and stable app credentials matter.
+- Prefer `napcat` only when you intentionally run and maintain a local personal-account bridge.
+- For group chats, start with mention-only behavior (`group_policy: mention`) and loosen it only after measuring noise.
+- Keep `max_image_bytes` conservative when the Partner runs on a small server.
+
+## Troubleshooting
+
+- **Official QQ auth failed** — verify `app_id`, `secret`, and enabled message intents in Tencent's platform.
+- **NapCat connects but no messages** — check `ws_url`, `access_token`, and whether NapCat is emitting OneBot v11 message events.
+- **Group is too noisy** — set `group_policy` to `mention` or a low probability such as `0.1`.
diff --git a/site/src/content/docs/docs/partners/slack.md b/site/src/content/docs/docs/partners/slack.md
new file mode 100644
index 000000000..023043393
--- /dev/null
+++ b/site/src/content/docs/docs/partners/slack.md
@@ -0,0 +1,92 @@
+---
+title: Slack
+description: Configure the Slack channel for a Partner — Socket Mode app, bot and app tokens, thread replies, and DM policy.
+---
+
+<img src="/channel-icons/slack.svg" alt="" width="40" height="40" />
+
+The `slack` channel connects a Partner to a Slack workspace over **Socket Mode**: the bot opens a WebSocket to Slack through `slack-sdk`, so no public URL, webhook, or reverse proxy is needed. It is the most team-oriented channel — DMs, channel @mentions, threaded replies, and an acknowledgement reaction on the triggering message.
+
+Two tokens are involved and they are easy to mix up: the **Bot Token** (`xoxb-…`, from OAuth & Permissions) authorizes API calls, and the **App Token** (`xapp-…`, from Socket Mode) authorizes the WebSocket connection. Unlike Telegram and Discord, the Slack card has no **Streaming** switch — replies arrive as complete messages, with narration delivered as separate messages when **Send Progress** is on.
+
+![Slack channel configuration](/screenshots/partners-channel-slack.png)
+
+## Install requirements
+
+Slack support ships with the Partners extra, which already includes `slack-sdk` (Socket Mode client) and `slackify-markdown` (Markdown -> Slack mrkdwn conversion). Nothing extra to install.
+
+```bash
+pip install -e ".[partners]"
+# or, from an installed release when partners extras are available:
+pip install "deeptutor[partners]"
+```
+
+## Create the Slack app
+
+1. Go to <https://api.slack.com/apps> -> **Create New App** -> **From scratch**. Name it and pick your workspace.
+2. Left sidebar -> **Socket Mode** -> toggle **Enable Socket Mode**. When prompted, generate an App-Level Token with the `connections:write` scope and copy it — this is your **App Token** (`xapp-…`).
+3. Left sidebar -> **OAuth & Permissions** -> **Scopes** -> **Bot Token Scopes**, add: `chat:write`, `chat:write.public`, `files:write`, `reactions:write`, `users:read`, `app_mentions:read`, `im:history`, `im:read`, `channels:history` (and `groups:history` if you want private channels).
+4. Left sidebar -> **Event Subscriptions** -> **Subscribe to bot events**: `app_mention`, `message.im`, and `message.channels` if the bot should listen in channels beyond @mentions.
+5. Back in **OAuth & Permissions**, click **Install to Workspace** and authorize. Copy the **Bot User OAuth Token** (`xoxb-…`) — this is your **Bot Token**.
+
+## Configure the channel card
+
+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 and keeps following that thread. 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. |
+
+## After you save
+
+1. Click **Save**, then turn **Enabled** on.
+2. Start the partner (or restart it / use the reload action on the Channels panel if it is already running).
+3. From an allowed account, DM the bot, or `/invite @your-bot` into a channel and @mention it.
+4. Watch the partner logs: you should see the Socket Mode connection and the inbound event.
+5. Once you have confirmed the sender id in the logs, replace `*` in **Allow From** with real ids.
+
+## Verify it is healthy
+
+- The logs show the Socket Mode WebSocket connected with no auth errors.
+- Your test message gets the acknowledgement reaction (`eyes` by default) within a second or two.
+- The reply arrives in a thread under your message (with the default **Reply In Thread** on).
+
+## Troubleshooting
+
+### `invalid_auth` / `not_authed` from the Slack API
+
+The two tokens are swapped — `xoxb-…` belongs in **Bot Token** and `xapp-…` in **App Token**. This is the single most common Slack setup mistake.
+
+### The socket never connects
+
+Socket Mode must be **enabled** on the app, and the App-Level Token must carry the `connections:write` scope. If you generated the token before enabling Socket Mode, generate a fresh one.
+
+### The bot ignores channel messages, but DMs work
+
+Three gates to check:
+
+1. The bot must be invited to the channel: `/invite @your-bot`.
+2. With **Group Policy** = `mention`, your message must @mention the bot.
+3. The `app_mention` (and `message.channels`, if you rely on it) bot events must be subscribed under **Event Subscriptions**.
+
+### Replies land in a thread and follow-ups get ignored
+
+That is **Reply In Thread** at work: the bot starts a thread and listens inside it. Continue the conversation in the thread, not with a new top-level channel message. If you prefer flat channel replies, turn **Reply In Thread** off.
+
+## See also
+
+- [Channel Matrix](/docs/partners/channels/) — all channels at a glance
+- [Discord](/docs/partners/discord/) — similar developer-portal setup over a Gateway WebSocket
diff --git a/site/src/content/docs/docs/partners/telegram.md b/site/src/content/docs/docs/partners/telegram.md
new file mode 100644
index 000000000..06aae0cdd
--- /dev/null
+++ b/site/src/content/docs/docs/partners/telegram.md
@@ -0,0 +1,91 @@
+---
+title: Telegram
+description: Configure the Telegram channel for a Partner — BotFather registration, Bot API long polling, and live-streamed replies.
+---
+
+<img src="/channel-icons/telegram.svg" alt="" width="40" height="40" />
+
+The `telegram` channel connects a Partner to a Telegram bot through Bot API **long polling**: DeepTutor pulls updates from Telegram's servers in a long-lived loop, so you need no public IP, no webhook, and no reverse proxy. Registration through BotFather takes about a minute, which makes Telegram the fastest channel to wire up for a personal assistant or a small group bot.
+
+The channel also supports **live streaming**: with the switch on, the bot sends one message and keeps editing it in place as the reply is generated.
+
+![Telegram channel configuration](/screenshots/partners-channel-telegram.png)
+
+## Install requirements
+
+Telegram support ships with the Partners extra. The underlying client is `python-telegram-bot[socks]`, so SOCKS proxy support is already included — nothing extra to install.
+
+```bash
+pip install -e ".[partners]"
+# or, from an installed release when partners extras are available:
+pip install "deeptutor[partners]"
+```
+
+## Register a bot with BotFather
+
+1. Open Telegram, search for `@BotFather`, and start a chat.
+2. Send `/newbot`. BotFather asks for a display name (e.g. `Math Mentor`), then a username that must end in `bot` (e.g. `hku_math_mentor_bot`).
+3. BotFather replies with an HTTP API token like `123456789:ABC-DEF1234ghIkl-...`. **Copy it** — this goes into the **Token** field.
+4. Find your own user id: chat with `@userinfobot`, which replies with your numeric id. You will need it for **Allow From**.
+5. For group use, disable Group Privacy so the bot can read group messages: `/mybots` -> select your bot -> **Bot Settings** -> **Group Privacy** -> **Turn off**.
+
+## Configure the channel card
+
+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** | `mention` (default): in groups the bot only answers when @mentioned or replied to. `open`: it answers every group message. DMs always get a response. |
+| **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. |
+
+Replies longer than Telegram's 4096-character limit are split into multiple messages automatically (DeepTutor splits at 4000 to stay clear of the cap).
+
+## After you save
+
+1. Click **Save**, then turn **Enabled** on.
+2. Start the partner (or restart it / use the reload action on the Channels panel if it is already running).
+3. From an allowed account, open `t.me/<your_bot_username>` and send a short message.
+4. Watch the partner logs: you should see the inbound message and the reply delivery.
+5. Once you have confirmed the sender id in the logs, replace `*` in **Allow From** with real ids.
+
+## Verify it is healthy
+
+- The logs show the Telegram channel polling without errors (in particular, no `Conflict` lines).
+- A short DM from an allowed account gets a reply; with **Send Progress** on you also see narration messages during long turns.
+- In a group, @mentioning the bot produces an answer (with the default `mention` policy).
+
+## Troubleshooting
+
+### The bot never replies
+
+Almost always **Allow From**. An empty list denies everyone — including you. Put `*` in for a first test, then switch to your numeric id from `@userinfobot`.
+
+### The bot ignores group messages
+
+Two separate gates must both be open:
+
+1. BotFather: `/mybots` -> your bot -> **Bot Settings** -> **Group Privacy** -> **Turn off** — otherwise Telegram never delivers plain group messages to the bot.
+2. With **Group Policy** = `mention`, your message must @mention the bot (or be a reply to one of its messages).
+
+### `Conflict: terminated by other getUpdates request`
+
+The same token is being polled from two places at once — two partners with the same token, or another process still running. Telegram allows only one polling client per token; stop the duplicate.
+
+### Telegram is blocked on this network
+
+Fill in **Proxy** with a SOCKS or HTTP proxy URL (e.g. `socks5://127.0.0.1:1080`). SOCKS support is bundled with the partners extra, so no extra package is needed.
+
+## See also
+
+- [Channel Matrix](/docs/partners/channels/) — all channels at a glance
+- [Discord](/docs/partners/discord/) — Gateway WebSocket model, similar streaming support
diff --git a/site/src/content/docs/docs/partners/wecom.md b/site/src/content/docs/docs/partners/wecom.md
new file mode 100644
index 000000000..35c7ed0ef
--- /dev/null
+++ b/site/src/content/docs/docs/partners/wecom.md
@@ -0,0 +1,64 @@
+---
+title: WeCom (WeChat Work)
+description: Configure Enterprise WeChat / WeCom AI Bot delivery for a Partner.
+---
+
+<img src="/channel-icons/wecom.svg" alt="" width="40" height="40" />
+
+Use `wecom` for Enterprise WeChat / WeChat Work. It connects through the WeCom AI Bot WebSocket long connection and is different from personal [WeChat (`weixin`)](/docs/partners/weixin/).
+
+![WeCom channel configuration](/screenshots/partners-channel-wecom.png)
+
+## Requirements
+
+- A WeCom organization with admin access.
+- The `wecom-aibot-sdk` Python package. Install via the Partners extra or directly if needed.
+
+```bash
+pip install -e ".[partners]"
+python -c "import wecom_aibot_sdk; print('ok')"
+```
+
+## Create the bot in WeCom
+
+1. Sign in to <https://work.weixin.qq.com/>.
+2. Open **Applications & Mini Programs -> AI Bot Platform**.
+3. Create an **AI Bot** application.
+4. Configure name, description, visible departments/users, and any required approval settings.
+5. Copy **Bot ID** and **Secret**.
+
+## Configure DeepTutor
+
+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. |
+
+## Access control and visibility
+
+WeCom has two layers of access control:
+
+1. WeCom application visibility controls who can open the AI Bot inside the organization.
+2. DeepTutor `allow_from` controls which sender ids are allowed into the Partner runtime.
+
+During first setup, keep the WeCom visible range small and set `allow_from` explicitly once you know the sender ids from logs.
+
+## Start and test
+
+```bash
+deeptutor partner start <partner-id>
+```
+
+The server log should show a WeCom WebSocket connection and authentication. Then open the AI Bot in WeCom and send a short message.
+
+## Troubleshooting
+
+- **`ImportError: wecom_aibot_sdk`** — install `wecom-aibot-sdk` or the Partners extra in the same environment running DeepTutor.
+- **Connects but no reply** — check `allow_from`, department visibility, and whether the sender is allowed to use the AI Bot application.
+- **Disconnects** — transient disconnects auto-reconnect. If it stays offline, verify Bot ID / Secret and outbound network access to WeCom.
diff --git a/site/src/content/docs/docs/partners/weixin.md b/site/src/content/docs/docs/partners/weixin.md
new file mode 100644
index 000000000..75838d032
--- /dev/null
+++ b/site/src/content/docs/docs/partners/weixin.md
@@ -0,0 +1,80 @@
+---
+title: WeChat (Personal Weixin)
+description: Configure the personal WeChat channel for a Partner using QR-code login and HTTP long polling.
+---
+
+<img src="/channel-icons/weixin.svg" alt="" width="40" height="40" />
+
+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](/docs/partners/wecom/) for Enterprise WeChat / WeChat Work.
+
+![WeChat channel configuration](/screenshots/partners-channel-weixin.png)
+
+## Install requirements
+
+Personal WeChat support is included with the Partners extra. The QR-code terminal rendering also uses `qrcode`.
+
+```bash
+pip install -e ".[partners]"
+# or, from an installed release when partners extras are available:
+pip install "deeptutor[partners]"
+```
+
+## Configure the channel card
+
+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/<id>/runtime/weixin/` for `account.json`. |
+| **Poll Timeout** | Long-poll timeout in seconds. `35` is the default and works for most networks. |
+
+## Login flow
+
+1. Save the channel with **Enabled** on and **Token** empty.
+2. Start the partner from the UI or CLI.
+3. Watch the terminal that runs `deeptutor start`; it prints a QR code / scan URL for WeChat login.
+4. Open the link or scan the terminal QR code with WeChat.
+5. After confirmation, DeepTutor stores `account.json` in the WeChat state directory and begins long polling.
+6. Send a short message from an allowed account.
+
+```bash
+deeptutor partner start <partner-id>
+```
+
+If the terminal says the session expired, restart the partner and scan the refreshed code. The implementation refreshes expired QR codes a few times, but it cannot complete login without a human scan.
+
+## Verify it is healthy
+
+A healthy WeChat channel has three signs:
+
+- the terminal shows QR login success and a saved account state;
+- `data/partners/<partner-id>/runtime/weixin/account.json` exists in the mounted `data/` tree;
+- a short message from an allowed sender produces a Partner reply.
+
+For Docker, make sure `data/partners/` is persisted. Otherwise every container restart can require a fresh scan.
+
+## Access control
+
+`Allow From` is enforced before messages enter the partner brain. During the first test, `*` is fine. For production, replace it with specific user ids after you observe inbound sender ids in logs.
+
+## Troubleshooting
+
+### The channel starts but asks for QR login every time
+
+Check whether `State Dir` points to a writable location. If blank, DeepTutor writes under the partner runtime directory. If that directory is not persisted in Docker, the token disappears on restart.
+
+### Messages arrive but replies fail
+
+WeChat replies require a recent `context_token` from inbound messages. If the account has been idle for too long, send a fresh inbound message and let DeepTutor refresh the context before replying.
+
+### Too many progress messages
+
+Disable **Send Progress** or **Send Tool Hints** on the channel card. This does not change the partner's reasoning; it only changes what is delivered to WeChat.
diff --git a/site/src/content/docs/docs/partners/whatsapp.md b/site/src/content/docs/docs/partners/whatsapp.md
new file mode 100644
index 000000000..5eee2f3e1
--- /dev/null
+++ b/site/src/content/docs/docs/partners/whatsapp.md
@@ -0,0 +1,114 @@
+---
+title: WhatsApp
+description: Connect a Partner to WhatsApp through an external Node.js bridge that speaks the WhatsApp Web protocol.
+---
+
+<img src="/channel-icons/whatsapp.svg" alt="" width="40" height="40" />
+
+The `whatsapp` channel connects a Partner to a WhatsApp account through an **external Node.js bridge** process. DeepTutor talks to the bridge over a WebSocket; the bridge logs into WhatsApp Web (one QR scan) and relays messages in both directions. This avoids the friction of the official WhatsApp Business API — no verified business, no per-message fees — at the cost of running one extra process.
+
+![WhatsApp channel configuration](/screenshots/partners-channel-whatsapp.png)
+
+## Install requirements
+
+The Python side is included with the Partners extra. The bridge additionally needs a Node.js 18+ host — it can be the same machine as DeepTutor.
+
+```bash
+pip install -e ".[partners]"
+# or, from an installed release when partners extras are available:
+pip install "deeptutor[partners]"
+```
+
+## Run the bridge
+
+DeepTutor does not ship the bridge itself. Any bridge built on [@whiskeysockets/baileys](https://github.com/WhiskeySockets/Baileys) that speaks the JSON protocol below works. A minimal bridge:
+
+```javascript
+// bridge.js
+const { default: makeWASocket, useMultiFileAuthState } = require('@whiskeysockets/baileys')
+const WebSocket = require('ws')
+
+const wss = new WebSocket.Server({ port: 3001 })
+let waSocket = null
+
+async function start() {
+ const { state, saveCreds } = await useMultiFileAuthState('./auth')
+ waSocket = makeWASocket({ auth: state, printQRInTerminal: true })
+ waSocket.ev.on('creds.update', saveCreds)
+ waSocket.ev.on('messages.upsert', ({ messages }) => {
+ wss.clients.forEach(client => client.send(JSON.stringify(messages[0])))
+ })
+}
+
+wss.on('connection', (ws) => {
+ ws.on('message', (raw) => {
+ const { to, text } = JSON.parse(raw)
+ waSocket?.sendMessage(to, { text })
+ })
+})
+
+start()
+```
+
+```bash
+npm install @whiskeysockets/baileys ws
+node bridge.js
+```
+
+A QR code appears in the bridge terminal. On your phone: **WhatsApp -> Settings -> Linked devices -> Link a device** -> scan. Run the bridge under a process manager (`pm2`, systemd) so it survives crashes; DeepTutor reconnects to it automatically every 5 seconds.
+
+### Bridge protocol
+
+- On connect, DeepTutor sends `{"type": "auth", "token": "..."}` when **Bridge Token** is set.
+- Bridge to DeepTutor: `{"type": "message", "id": ..., "sender": ..., "pn": ..., "content": ..., "media": ["/path", ...], "timestamp": ..., "isGroup": ...}`. Media must be downloaded by the bridge to local paths; DeepTutor attaches them as files/images.
+- DeepTutor to bridge: `{"type": "send", "to": "<jid>", "text": "..."}`.
+- The bridge may also emit `{"type": "status"}`, `{"type": "qr"}`, and `{"type": "error"}` events.
+
+Voice messages are not transcribed yet; they arrive as a placeholder note.
+
+## Configure the channel card
+
+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. |
+
+## After you save
+
+1. Save the card with **Enabled** on.
+2. Start (or restart) the partner from the UI or CLI so the channel picks up the config.
+3. Watch the server log for `Connected to WhatsApp bridge`.
+4. Send a short message to the WhatsApp number that is logged into the bridge.
+5. Once you see real sender ids in the logs, replace `*` in **Allow From** with explicit values.
+
+```bash
+deeptutor partner start <partner-id>
+```
+
+## Verify it is healthy
+
+A healthy WhatsApp channel has three signs:
+
+- the bridge terminal shows a successful WhatsApp Web login (no fresh QR codes);
+- the DeepTutor log shows `Connected to WhatsApp bridge`;
+- a short message from an allowed sender produces a Partner reply.
+
+## Troubleshooting
+
+### Bridge unreachable / channel keeps reconnecting
+
+The log shows `WhatsApp bridge connection error` followed by `Reconnecting in 5 seconds...`. Check that the bridge process is running and that **Bridge Url** points at the right host and port. DeepTutor retries forever, so the channel recovers on its own once the bridge is back.
+
+### The bridge keeps printing QR codes
+
+The bridge's auth state is not being persisted. Make sure its auth directory (`./auth` in the sample) is writable and survives restarts. WhatsApp Web sessions also expire when the phone is offline for around two weeks — re-scan and the session resumes.
+
+### Messages arrive but replies are dropped
+
+If the bridge disconnects mid-turn, the log shows `WhatsApp bridge not connected` when DeepTutor tries to reply. Restore the bridge connection and send a fresh message. Inbound messages are deduplicated by id, so bridge reconnects do not produce duplicate answers.
diff --git a/site/src/content/docs/docs/partners/zulip.md b/site/src/content/docs/docs/partners/zulip.md
new file mode 100644
index 000000000..308cafb7d
--- /dev/null
+++ b/site/src/content/docs/docs/partners/zulip.md
@@ -0,0 +1,76 @@
+---
+title: Zulip
+description: Configure the Zulip channel for a Partner — event-queue long polling with stream + topic scoped sessions.
+---
+
+<img src="/channel-icons/zulip.svg" alt="" width="40" height="40" />
+
+The `zulip` channel connects a Partner to Zulip's structured team chat. Zulip splits conversations into **streams** and **topics**, and the channel keeps that structure: every (stream, topic) pair is its own Partner session, so each homework thread or support topic carries its own context. Direct messages work too, scoped per sender.
+
+![Zulip channel configuration](/screenshots/partners-channel-zulip.png)
+
+## Install requirements
+
+Zulip support is included with the Partners extra — the `zulip` client package comes with it, nothing else to install.
+
+```bash
+pip install -e ".[partners]"
+# or, from an installed release when partners extras are available:
+pip install "deeptutor[partners]"
+```
+
+## Create a bot in Zulip
+
+1. In Zulip, click the gear icon (top right) -> **Organization** (or **Personal**) **settings** -> **Bots**.
+2. Click **Add a new bot**, type **Generic bot**, and give it a name.
+3. Zulip generates a bot email like `[email protected]` — this is what goes in the **Email** field, not a human address.
+4. Copy the bot's **API key** from the same page.
+5. Generic bots receive direct messages by default but see a stream only when subscribed. Subscribe via the bot's settings in Zulip, or let DeepTutor do it with **Subscribe Streams** below.
+
+## Configure the channel card
+
+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. |
+
+## After you save
+
+1. Click **Save**, then turn on **Enabled** and save again.
+2. Start the partner — from the UI, or `deeptutor partner start <partner-id>`. If it is already running, restart it.
+3. Send the bot a direct message, or @-mention it in a subscribed stream.
+4. Once replies flow, replace `*` in **Allow From** with real user ids or emails.
+
+Math survives the trip: the channel converts standard `$...$` and `$$...$$` in replies into Zulip's native KaTeX format.
+
+## Verify it is healthy
+
+A healthy Zulip channel has three signs:
+
+- the log shows the event queue registered and the configured streams subscribed;
+- a direct message to the bot gets a reply;
+- an @-mention in a subscribed stream gets a reply in the same topic.
+
+## Troubleshooting
+
+### The bot never sees stream messages
+
+Two usual causes. The bot is not subscribed to the stream — add it via Zulip's bot settings or **Subscribe Streams**. Or **Group Policy** is `mention` and the message did not @-mention the bot; mention it, or switch the policy to `open`.
+
+### Authentication errors at startup
+
+Re-check the trio: **Site** must be the full URL with the right realm subdomain, **Email** must be the bot's generated address, and **Api Key** must match that bot. Regenerating the key in Zulip invalidates the old one, so update the card after rotating.
+
+### `BAD_EVENT_QUEUE_ID` in the log
+
+Event queues expire after a server restart or long idle. The channel re-registers automatically — no action needed. If it repeats constantly, check the Zulip server's health.
diff --git a/site/src/content/docs/docs/tutorbot/dingtalk.md b/site/src/content/docs/docs/tutorbot/dingtalk.md
index 8aa63ec08..a1e02e394 100644
--- a/site/src/content/docs/docs/tutorbot/dingtalk.md
+++ b/site/src/content/docs/docs/tutorbot/dingtalk.md
@@ -1,97 +1,6 @@
---
-title: DingTalk (钉钉)
-description: TutorBot on DingTalk — Alibaba's enterprise chat, Stream Mode connection.
+title: Moved
+description: This legacy page is kept for old links.
---
-DingTalk (钉钉) is Alibaba's enterprise messaging product. DeepTutor uses the official `dingtalk-stream` SDK in **Stream Mode** — no public webhook needed.
-
-## What you need
-
-- A DingTalk organization with admin access
-- Access to the [**DingTalk Open Platform**](https://open.dingtalk.com/)
-
-## Step 1 — Create an app
-
-1. Sign in to <https://open.dingtalk.com/>
-2. **App Development** → **Create Application**
-3. Pick **Internal Robot** (机器人) type
-4. Fill in name, description, icon
-5. Once created, copy **AppKey (Client ID)** and **AppSecret (Client Secret)** from the Credentials page
-
-## Step 2 — Enable Stream Mode
-
-1. In the app settings → **Stream Mode** → **Enable**
-2. This avoids needing a public webhook URL
-
-## Step 3 — Permissions
-
-Request these scopes:
-- Send messages
-- Read message content
-- (Optional) Voice-to-text for transcription
-
-## Step 4 — Configure
-
-```yaml
-channels:
- dingtalk:
- enabled: true
- client_id: "dingxxxxxxxxxxxxxxxx"
- client_secret: "YOUR_CLIENT_SECRET"
- allow_from: []
-```
-
-## Step 5 — Start
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:dingtalk → connecting (stream mode)
-[bot:my-math-tutor] channel:dingtalk → ready
-```
-
-## Config reference
-
-| Field | Type | Required | Notes |
-|-------|------|----------|-------|
-| `enabled` | bool | yes | |
-| `client_id` | string | yes | AppKey from DingTalk |
-| `client_secret` | string | yes | AppSecret |
-| `allow_from` | list[string] | optional | DingTalk user ids |
-
-## Capabilities on DingTalk
-
-| Feature | Supported |
-|---------|-----------|
-| DMs | ✅ |
-| Group chats | ✅ |
-| Markdown / rich text | ✅ |
-| Action cards (interactive buttons) | ✅ |
-| File uploads | ✅ |
-| **Voice → text transcription** | ✅ *(built into DingTalk's speech-to-text)* |
-| Mention routing | ✅ |
-
-## Keep-alive specifics
-
-The dingtalk-stream SDK manages the long-poll callback connection. On disconnect, it auto-reconnects.
-
-## Common issues
-
-### "Invalid client_secret"
-
-Check DingTalk Open Platform → your app → Credentials. The secret can be rotated.
-
-### Bot is "online" but doesn't respond
-
-Confirm the bot is installed for the target users / departments. In DingTalk, robots have to be explicitly added to an organization before they can chat.
-
-### Stream mode not connecting
-
-Stream Mode requires the bot to be released (not just in draft). Click **Release** in the DingTalk app page.
-
-## See also
-
-- [**Feishu**](/docs/tutorbot/feishu/) — China's other major enterprise chat
-- [**WeCom**](/docs/tutorbot/wecom/) — Tencent's enterprise messenger
+This legacy page has moved. Read [**Partners & Channels**](/docs/partners/) instead.
diff --git a/site/src/content/docs/docs/tutorbot/discord.md b/site/src/content/docs/docs/tutorbot/discord.md
index d3ea1a23d..a1e02e394 100644
--- a/site/src/content/docs/docs/tutorbot/discord.md
+++ b/site/src/content/docs/docs/tutorbot/discord.md
@@ -1,140 +1,6 @@
---
-title: Discord
-description: TutorBot on Discord — Developer Portal registration, Gateway WebSocket connection, group policies.
+title: Moved
+description: This legacy page is kept for old links.
---
-Discord uses a **Gateway WebSocket** rather than polling. DeepTutor implements the gateway protocol directly (no `discord.py` dependency), with automatic reconnect on disconnect.
-
-## What you need
-
-- A Discord account
-- A server you control (for testing the bot)
-- 5 minutes on the Discord Developer Portal
-
-## Step 1 — Create a Discord Application
-
-1. Open <https://discord.com/developers/applications>
-2. Click **New Application**
-3. Give it a name (e.g., "Math Mentor")
-4. Save
-
-## Step 2 — Create a Bot user
-
-1. In the left sidebar of your application: **Bot**
-2. Click **Add Bot** → confirm
-3. Under **TOKEN**, click **Reset Token**, then **Copy** — this is your `token`
-4. Under **Privileged Gateway Intents**, enable:
- - **Message Content Intent** *(required to read message text)*
- - **Server Members Intent** *(recommended)*
-
-## Step 3 — Invite the bot to your server
-
-1. Left sidebar → **OAuth2** → **URL Generator**
-2. Scopes: check `bot`
-3. Bot Permissions: check `Send Messages`, `Read Message History`, `Attach Files`, `Embed Links`, `Add Reactions`
-4. Copy the generated URL, open it in a new tab, pick a server, **Authorize**
-
-## Step 4 — Configure
-
-Edit `data/tutorbot/<bot_id>/agents.yaml`:
-
-```yaml
-channels:
- discord:
- enabled: true
- token: "YOUR_BOT_TOKEN"
- allow_from:
- - "USER_ID_1" # right-click user in Discord → Copy User ID (Dev Mode required)
- # - "*" # open
- group_policy: "mention" # or "open"
- intents: 37377 # default — covers messages + guilds
-```
-
-> **Dev Mode for User IDs:** In Discord settings → **Advanced** → enable **Developer Mode**. Then right-click any user → Copy User ID.
-
-## Step 5 — Start
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:discord → connecting (gateway wss://...)
-[bot:my-math-tutor] channel:discord → ready (heartbeat 41250ms)
-```
-
-## Config reference
-
-| Field | Type | Required | Default | Notes |
-|-------|------|----------|---------|-------|
-| `enabled` | bool | yes | `false` | |
-| `token` | string | yes | — | Bot token from the Developer Portal |
-| `allow_from` | list[string] | yes | `[]` | User ids or `"*"` |
-| `group_policy` | `"mention" \| "open"` | optional | `"mention"` | Group chat behavior |
-| `gateway_url` | string | optional | `wss://gateway.discord.gg/?v=10&encoding=json` | Override only if you proxy |
-| `intents` | int | optional | `37377` | Bitfield; default covers messages + guilds + members |
-
-## Capabilities on Discord
-
-| Feature | Supported |
-|---------|-----------|
-| DMs | ✅ |
-| Guild text channels | ✅ |
-| Threads | ⚠️ partial — bot replies in the parent channel for now |
-| File uploads | ✅ *(up to 20 MB)* |
-| File downloads | ✅ |
-| Markdown / mention rendering | ✅ *(Discord's flavored markdown)* |
-| Typing indicator | ✅ |
-| Reactions | ⚠️ only outbound (bot adds reactions, doesn't respond to user reactions) |
-
-## Group policy
-
-| Policy | Behavior |
-|--------|----------|
-| `mention` | Bot only replies to messages that @mention it |
-| `open` | Bot replies to every message in the channel *(loud — only for dedicated bot channels)* |
-
-In DMs, the bot always responds regardless of policy.
-
-## Keep-alive specifics
-
-DeepTutor's Discord channel maintains the gateway WebSocket with a **heartbeat every ~41 seconds** (per Discord's protocol). On disconnect:
-
-- Auto-reconnect after 5 seconds
-- Session resume attempted first (no rejoining channels)
-- Falls back to full reconnect if resume fails
-
-You shouldn't need any external supervision — the channel manager handles all reconnection.
-
-## Common issues
-
-### `4014: Disallowed intent`
-
-You requested an intent in the config that you didn't enable in the Developer Portal. Most common: Message Content Intent.
-
-Fix: Developer Portal → your app → **Bot** → enable **Message Content Intent**.
-
-### Bot is online but doesn't respond
-
-Check `allow_from`. The same rule as Telegram: empty list denies everyone.
-
-Also confirm Message Content Intent is enabled — without it, the bot sees messages with empty `content`.
-
-### Messages > 2000 chars get cut off
-
-Discord's per-message limit is 2000 chars. The bot auto-splits longer responses. For Deep Research outputs, consider sending the long response as a file:
-
-```yaml
-channels:
- discord:
- send_long_as_file: true # attach .md when response > 2000 chars
-```
-
-### 429 rate limits
-
-Discord rate-limits per channel. If your bot sends many messages quickly (e.g., a chatty `open` policy in a busy channel), you'll see 429s. The channel auto-retries with backoff but consider switching to `mention`.
-
-## See also
-
-- [**Telegram**](/docs/tutorbot/telegram/) — simpler gateway model for comparison
-- [**Slack**](/docs/tutorbot/slack/) — also socket-mode, similar setup feel
+This legacy page has moved. Read [**Partners & Channels**](/docs/partners/) instead.
diff --git a/site/src/content/docs/docs/tutorbot/email.md b/site/src/content/docs/docs/tutorbot/email.md
index 11dbc81bf..a1e02e394 100644
--- a/site/src/content/docs/docs/tutorbot/email.md
+++ b/site/src/content/docs/docs/tutorbot/email.md
@@ -1,166 +1,6 @@
---
-title: Email
-description: TutorBot over email — IMAP polling + SMTP replies, with explicit consent and full body parsing.
+title: Moved
+description: This legacy page is kept for old links.
---
-The Email channel turns your TutorBot into an asynchronous email correspondent. Users send mail to a configured inbox, the bot reads via IMAP, replies via SMTP. Useful for **async help desks** and for users who prefer email.
-
-## What you need
-
-- An email account (Gmail, Outlook, your own SMTP/IMAP server, etc.)
-- App-password access *(or OAuth, see below)*
-- 5 minutes of config
-
-## Step 1 — Configure mail credentials
-
-For **Gmail**:
-
-1. Enable 2FA on the account
-2. Create an [**App Password**](https://myaccount.google.com/apppasswords) (16-character single-use password)
-3. Use that as the password in the config below
-
-For **Outlook / Office 365**: Either an App Password (with 2FA enabled) or OAuth. App Passwords are simpler for personal use.
-
-For **self-hosted** (Postfix, Maddy, etc.): use the account credentials directly.
-
-## Step 2 — Configure
-
-```yaml
-channels:
- email:
- enabled: true
- consent_granted: true # MUST be explicit — privacy safeguard
-
- # IMAP (inbound)
- imap_host: "imap.gmail.com"
- imap_port: 993
- imap_username: "[email protected]"
- imap_password: "YOUR_APP_PASSWORD"
- imap_mailbox: "INBOX"
- imap_use_ssl: true
-
- # SMTP (outbound)
- smtp_host: "smtp.gmail.com"
- smtp_port: 587
- smtp_username: "[email protected]"
- smtp_password: "YOUR_APP_PASSWORD"
- smtp_use_tls: true
- smtp_use_ssl: false
- from_address: "[email protected]"
-
- # Behavior
- auto_reply_enabled: true
- poll_interval_seconds: 30 # IMAP check frequency
- mark_seen: true # mark messages as read after processing
- max_body_chars: 12000
- subject_prefix: "Re: "
- allow_from: # email addresses; [] = open, ["x@..."] = allowlist
-```
-
-## Step 3 — Start
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:email → connecting (imap.gmail.com:993)
-[bot:my-math-tutor] channel:email → ready, polling every 30s
-```
-
-Send an email to `[email protected]` from your allowed address — within 30 seconds (or the next poll), you get an automated reply.
-
-## Why `consent_granted` is required
-
-Reading email is sensitive. The channel **refuses to start** unless `consent_granted: true` is set explicitly — a hard gate to prevent accidental email reading. This is a deliberate privacy safeguard.
-
-## Config reference
-
-| Field | Type | Required | Default |
-|-------|------|----------|---------|
-| `enabled` | bool | yes | `false` |
-| `consent_granted` | bool | yes | `false` — must explicitly set `true` |
-| `imap_host` | string | yes | — |
-| `imap_port` | int | yes | `993` |
-| `imap_username` | string | yes | — |
-| `imap_password` | string | yes | — |
-| `imap_mailbox` | string | optional | `"INBOX"` |
-| `imap_use_ssl` | bool | optional | `true` |
-| `smtp_host` | string | yes | — |
-| `smtp_port` | int | yes | `587` |
-| `smtp_username` | string | yes | — |
-| `smtp_password` | string | yes | — |
-| `smtp_use_tls` | bool | optional | `true` |
-| `smtp_use_ssl` | bool | optional | `false` |
-| `from_address` | string | optional | = `smtp_username` |
-| `auto_reply_enabled` | bool | optional | `true` |
-| `poll_interval_seconds` | int | optional | `30` |
-| `mark_seen` | bool | optional | `true` |
-| `max_body_chars` | int | optional | `12000` |
-| `subject_prefix` | string | optional | `"Re: "` |
-| `allow_from` | list[string] | optional | `[]` (open to anyone) |
-
-## Capabilities on Email
-
-| Feature | Supported |
-|---------|-----------|
-| Plain text bodies | ✅ |
-| HTML bodies | ✅ *(converted to markdown)* |
-| Attachments inbound | ✅ *(PDFs, images, text files)* |
-| Attachments outbound | ✅ *(reply with files via SMTP)* |
-| Threading | ✅ *(via `In-Reply-To` headers)* |
-| Subject prefixing | ✅ *(`Re: ` by default)* |
-| LaTeX in body | ⚠️ rendered as plain text; consider converting to PDF for math-heavy responses |
-
-## Session model
-
-Each unique sender email is treated as a separate session. Replies in the same email thread (matched by `In-Reply-To`) continue the same session.
-
-This means a single user emailing from `[email protected]` always lands in the same DeepTutor session — perfect for ongoing async help.
-
-## Keep-alive specifics
-
-The Email channel uses a **background polling loop**:
-
-- Every `poll_interval_seconds`, the channel logs in via IMAP, fetches unseen messages, processes them, marks them seen
-- On IMAP disconnect, auto-reconnects on next poll
-- SMTP connection is opened per-send (no persistent connection)
-
-For high-volume use, set `poll_interval_seconds: 15` or lower. Below 10 seconds you may hit your provider's rate limits.
-
-## Common issues
-
-### Won't start — "consent_granted is required"
-
-You forgot to set:
-
-```yaml
-consent_granted: true
-```
-
-This is intentional friction. Set it consciously.
-
-### "Authentication failed" on Gmail / Outlook
-
-You used your account password instead of an App Password. With 2FA enabled, regular passwords are blocked for IMAP/SMTP — must use a 16-char App Password.
-
-### Too many replies / loop with another auto-responder
-
-If two auto-responders email each other, you get a feedback loop. The channel detects loops by checking the `Auto-Submitted:` header — but if the other side doesn't set it, loops are possible. Defensive measures:
-
-- Use `allow_from` to restrict who the bot replies to
-- Set `auto_reply_enabled: false` and manually trigger replies from CLI
-
-### IMAP folder not found
-
-Some providers use different mailbox names (`INBOX` vs `Inbox` vs `[Gmail]/All Mail`). Check via the provider's webmail and update `imap_mailbox`.
-
-### Replies marked as spam
-
-Add a proper `from_address`, set up SPF/DKIM/DMARC records for your domain if self-hosted, or use a trusted SMTP relay (SendGrid, Mailgun) for outbound only.
-
-## See also
-
-- [**WhatsApp**](/docs/tutorbot/whatsapp/) — another bridge-style channel
-- [**Explore TutorBot**](/docs/tutorbot/) — architecture
+This legacy page has moved. Read [**Partners & Channels**](/docs/partners/) instead.
diff --git a/site/src/content/docs/docs/tutorbot/feishu.md b/site/src/content/docs/docs/tutorbot/feishu.md
index 8a965d39a..a1e02e394 100644
--- a/site/src/content/docs/docs/tutorbot/feishu.md
+++ b/site/src/content/docs/docs/tutorbot/feishu.md
@@ -1,145 +1,6 @@
---
-title: Feishu / Lark
-description: TutorBot on Feishu (国内) / Lark (international) — WebSocket long-connection via lark-oapi SDK.
+title: Moved
+description: This legacy page is kept for old links.
---
-Feishu (飞书) is the most popular workplace chat in mainland China; Lark is its international counterpart. They share the same API. DeepTutor supports both via the official `lark-oapi` SDK over a long-lived WebSocket.
-
-## What you need
-
-- A Feishu / Lark developer account
-- Access to the [**Feishu Open Platform**](https://open.feishu.cn/) (mainland) or [**Lark Open Platform**](https://open.larksuite.com/) (international)
-- Optionally: a Feishu/Lark organization where you can install the bot
-
-## Step 1 — Create an app
-
-1. Open the relevant platform → **Create App** → **Custom App**
-2. Fill in basic info (name, description, icon)
-3. Once created, copy these from the **Credentials & Basic Info** page:
- - **App ID**
- - **App Secret**
- - **Verification Token**
- - **Encrypt Key**
-
-## Step 2 — Enable bot capability
-
-1. Left sidebar → **Features** → **Bot** → **Enable**
-2. Configure the bot's display name and avatar
-
-## Step 3 — Configure event subscription
-
-1. Left sidebar → **Event Subscriptions** → **Subscribe to events**
-2. Add events you care about:
- - `im.message.receive_v1` — receive direct messages
- - `im.message.message_read_v1` — track read receipts (optional)
-3. **Enable Long Connection Mode** so you don't need a public webhook URL. This makes the bot use WebSocket instead of webhooks.
-
-## Step 4 — Add permissions
-
-Left sidebar → **Permissions & Scopes**:
-
-- `im:message:send_as_bot` — send messages
-- `im:resource` — read media attachments
-- `contact:user.id:readonly` — resolve user ids
-
-Then **Release** the version *(internal release for internal apps)*.
-
-## Step 5 — Configure DeepTutor
-
-```yaml
-channels:
- feishu:
- enabled: true
- app_id: "cli_xxxxxxxxxxxxxxxx"
- app_secret: "YOUR_APP_SECRET"
- verification_token: "YOUR_VERIFICATION_TOKEN"
- encrypt_key: "YOUR_ENCRYPT_KEY"
- allow_from: []
- group_policy: "mention"
-```
-
-## Step 6 — Start
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:feishu → connecting (long-connection)
-[bot:my-math-tutor] channel:feishu → ready (app_id=cli_xxx)
-```
-
-## Config reference
-
-| Field | Type | Required | Notes |
-|-------|------|----------|-------|
-| `enabled` | bool | yes | |
-| `app_id` | string | yes | `cli_...` |
-| `app_secret` | string | yes | |
-| `verification_token` | string | yes | Used for event signature verification |
-| `encrypt_key` | string | yes | Used to decrypt incoming events |
-| `allow_from` | list[string] | optional | User ids; `["*"]` open |
-| `group_policy` | `"mention" \| "open"` | optional | Default `"mention"` |
-
-## Capabilities on Feishu
-
-| Feature | Supported |
-|---------|-----------|
-| DMs | ✅ |
-| Group chats | ✅ |
-| **Interactive cards** | ✅ *(rich Feishu card messages with buttons)* |
-| Markdown | ✅ |
-| File / image uploads / downloads | ✅ |
-| Audio transcription | ✅ *(if `transcription_api_key` set)* |
-| Reactions | ⚠️ outbound only |
-| Mention routing | ✅ |
-
-## Long-connection vs webhook mode
-
-Feishu supports two delivery modes:
-
-| Mode | Pros | Cons |
-|------|------|------|
-| **Long connection** *(recommended)* | No public IP needed; works from anywhere | One DeepTutor instance per app |
-| Webhook | Multiple endpoints possible; standard request/response | Needs a publicly reachable URL with HTTPS |
-
-DeepTutor uses long connection by default. To switch to webhooks (if you have load-balancing needs), you'd run a separate webhook receiver — not currently supported in stock DeepTutor.
-
-## Keep-alive specifics
-
-The lark-oapi SDK manages the WebSocket with auto-reconnect. A background thread runs the WebSocket listener and forwards events to DeepTutor's async bus.
-
-If the bot disappears from Feishu (status shows offline):
-
-```bash
-deeptutor bot stop my-math-tutor
-deeptutor bot start my-math-tutor
-```
-
-For persistent uptime, use systemd or Docker `restart: unless-stopped`.
-
-## Common issues
-
-### "Invalid app_secret" on startup
-
-Double-check **App Secret** in Feishu's Credentials page — it can rotate. Also confirm you're on the right platform (`open.feishu.cn` for mainland, `open.larksuite.com` for international — secrets aren't transferable).
-
-### Bot says it's online but no messages received
-
-Two checks:
-
-1. **Permissions** — `im:message:send_as_bot` and event subscriptions are added AND **released** (new version)
-2. **Long connection mode** is enabled in Event Subscriptions
-
-### Verification token mismatch
-
-If you regenerated the verification token in Feishu, update the config and restart the bot. The token is signed into every incoming event for integrity.
-
-### Encrypt key mismatch
-
-Same as above — if you regenerated the encrypt key in Feishu (Settings → Event Subscriptions), update config + restart.
-
-## See also
-
-- [**WeCom**](/docs/tutorbot/wecom/) — Tencent's enterprise chat platform, similar registration UX
-- [**DingTalk**](/docs/tutorbot/dingtalk/) — Alibaba's equivalent in enterprise chat
+This legacy page has moved. Read [**Partners & Channels**](/docs/partners/) instead.
diff --git a/site/src/content/docs/docs/tutorbot/index.md b/site/src/content/docs/docs/tutorbot/index.md
index 6ac25db73..a1e02e394 100644
--- a/site/src/content/docs/docs/tutorbot/index.md
+++ b/site/src/content/docs/docs/tutorbot/index.md
@@ -1,274 +1,6 @@
---
-title: Explore TutorBot
-description: TutorBot — persistent, multi-channel autonomous tutors. Architecture, lifecycle, keep-alive strategies, and a dedicated page per gateway.
+title: Moved
+description: This legacy page is kept for old links.
---
-A **TutorBot** is a persistent, autonomous AI tutor that lives in DeepTutor and connects to one or more **external chat gateways** (Telegram, Slack, Feishu, etc.) so your users can interact with it from wherever they already are.
-
-This section is the operator's guide: how the system works, how to keep bots alive, and a **dedicated page for every gateway** with registration steps, config keys, and troubleshooting.
-
-## Architecture in one diagram
-
-```text
-┌─────────────────────────────────────────────────────────────────────┐
-│ DeepTutor server │
-│ │
-│ ┌─────────────────────────────────────────────────────────────┐ │
-│ │ Bot orchestrator │ │
-│ │ (agent loop powered by nanobot reasoning engine) │ │
-│ └──────────┬──────────────────────────────────────────────────┘ │
-│ │ │
-│ ┌─────────┼─────────┐ │
-│ ▼ ▼ ▼ │
-│ ┌───┐ ┌─────┐ ┌───────┐ each bot is its own asyncio task │
-│ │bot│ │ bot │ │ bot │ isolated workspace at │
-│ │ A │ │ B │ │ C │ data/tutorbot/<bot_id>/ │
-│ └─┬─┘ └──┬──┘ └───┬───┘ │
-│ │ │ │ │
-│ │ ┌───────┼──────────┼───────────────────────────────────┐ │
-│ ▼ ▼ ▼ ▼ ▼ │
-│ ┌──────────────────────────────────────────────────┐ │
-│ │ Channel registry (12 gateways) │ │
-│ └──────────────────────────────────────────────────┘ │
-└────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬──┬──┬───┘
- │ │ │ │ │ │ │ │ │ │ │ │
- ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
- Telegram Discord Slack Matrix Zulip Feishu WeCom DingTalk QQ WA Email Mochat
-```
-
-Key properties:
-
-- **One process** — Bots run as asyncio tasks inside the DeepTutor server. No separate process, no docker sidecar, no systemd unit per bot.
-- **Many gateways per bot** — One bot can speak on Telegram **and** Slack **and** Matrix simultaneously.
-- **Isolated workspaces** — Each bot has its own `agents.yaml`, soul template, skills, cron jobs, and local sessions database under `data/tutorbot/<bot_id>/`.
-- **Shared memory** — All bots see the same user's L3 memory (`data/memory/L3/`), with per-channel L1 trace for source separation.
-- **No restart required for channel reconnects** — Channel-level disconnects (e.g., transient network blip) auto-recover.
-
-## Lifecycle
-
-```bash
-# Create
-deeptutor bot create my-math-tutor \
- --name "Math Mentor" \
- --persona "Socratic tutor specializing in calculus and linear algebra" \
- --model gpt-4o
-
-# Configure channels (edit data/tutorbot/my-math-tutor/agents.yaml)
-
-# Start (forks into asyncio tasks for each enabled channel)
-deeptutor bot start my-math-tutor
-
-# Stop
-deeptutor bot stop my-math-tutor
-
-# List
-deeptutor bot list
-```
-
-To delete a bot: stop it first, then remove its workspace directory at `data/tutorbot/<bot_id>/`.
-
-You can also start/stop bots from the **`/agents`** Web UI route.
-
-## Keeping bots alive
-
-TutorBots live inside the DeepTutor server process. So **the question of "keeping the bot alive" reduces to "keeping the server alive"**.
-
-| Deployment | How to keep it up |
-|------------|-------------------|
-| Local development | Just run `deeptutor start` in a terminal. Ctrl+C stops everything. |
-| Docker | `docker compose up -d` (restart policy is `unless-stopped`). Auto-recovers on host reboot. |
-| systemd / bare metal | Wrap `deeptutor serve` in a unit file. See [example below](#systemd-unit-example). |
-| Kubernetes | Standard Deployment with a liveness probe on `/api/v1/system/info`. |
-
-### systemd unit example
-
-```ini
-# /etc/systemd/system/deeptutor.service
-[Unit]
-Description=DeepTutor
-After=network.target
-
-[Service]
-Type=simple
-User=deeptutor
-Group=deeptutor
-WorkingDirectory=/opt/deeptutor
-EnvironmentFile=/opt/deeptutor/.env
-ExecStart=/opt/deeptutor/.venv/bin/deeptutor start
-Restart=always
-RestartSec=10
-
-[Install]
-WantedBy=multi-user.target
-```
-
-```bash
-sudo systemctl enable deeptutor
-sudo systemctl start deeptutor
-sudo journalctl -fu deeptutor # follow logs
-```
-
-### Per-bot health monitoring
-
-Bot status surfaces in two places:
-
-- **`deeptutor bot list`** — shows running / stopped state for every bot
-- **The Web UI's `/agents` page** — per-bot status panel with per-channel connection state
-
-Channels report a heartbeat to the orchestrator internally; the Heartbeat system also drives proactive check-ins and scheduled tasks. If a channel goes offline for more than a few minutes, check the channel-specific page below for that gateway.
-
-## The 12 supported gateways
-
-Each gateway has its own dedicated page below with **registration**, **config keys**, **launch**, and **keep-alive specifics**:
-
-| Gateway | Status | Connection model | Page |
-|---------|--------|------------------|------|
-| Telegram | ✅ Stable | Polling | [**Telegram**](/docs/tutorbot/telegram/) |
-| Discord | ✅ Stable | WebSocket Gateway | [**Discord**](/docs/tutorbot/discord/) |
-| Slack | ✅ Stable | Socket Mode | [**Slack**](/docs/tutorbot/slack/) |
-| Matrix | ✅ Stable | HTTP Sync | [**Matrix**](/docs/tutorbot/matrix/) |
-| Zulip | ✅ v1.3.9+ | Event Queue | [**Zulip**](/docs/tutorbot/zulip/) |
-| Feishu (飞书) / Lark | ✅ Stable | WebSocket | [**Feishu**](/docs/tutorbot/feishu/) |
-| WeCom (企业微信) | ✅ Stable | WebSocket | [**WeCom**](/docs/tutorbot/wecom/) |
-| DingTalk (钉钉) | ✅ Stable | Stream Mode | [**DingTalk**](/docs/tutorbot/dingtalk/) |
-| QQ | ✅ Stable | WebSocket | [**QQ**](/docs/tutorbot/qq/) |
-| WhatsApp | ⚠️ Via Node.js bridge | WebSocket to bridge | [**WhatsApp**](/docs/tutorbot/whatsapp/) |
-| Email | ✅ Stable | IMAP poll + SMTP | [**Email**](/docs/tutorbot/email/) |
-| Mochat | ✅ Stable | Socket.IO / HTTP poll | [**Mochat**](/docs/tutorbot/mochat/) |
-
-## Universal config shape
-
-Every gateway uses the same outer schema in the bot's `agents.yaml`:
-
-```yaml
-agent:
- id: my-math-tutor
- name: Math Mentor
- persona: "Socratic tutor specializing in calculus..."
- model: gpt-4o
-
-channels:
- telegram:
- enabled: true
- token: "..."
- allow_from: ["*"]
-
- slack:
- enabled: true
- bot_token: "xoxb-..."
- app_token: "xapp-..."
- reply_in_thread: true
-
- email:
- enabled: false
- # ... per-gateway fields
-```
-
-**Common fields** across all gateways:
-
-| Field | Type | Required | Effect |
-|-------|------|----------|--------|
-| `enabled` | bool | yes | Whether to start this channel |
-| `allow_from` | list[string] | yes | User-id / email allowlist (`["*"]` = open, `[]` = deny all) |
-| `group_policy` | `"mention"` \| `"open"` | optional | For group chats: only respond to mentions vs every message |
-
-Per-gateway fields are documented on their dedicated pages.
-
-## Bot capabilities
-
-Inside a bot conversation, the bot has access to:
-
-- The same **seven capabilities** as the Web UI (Chat, Deep Solve, Quiz, Research, Animator, Visualize, Auto)
-- All **tools** (RAG, web search, code execution, reasoning, paper search, etc.)
-- **Attached Knowledge Bases** (configurable per-bot)
-- **Skills** — reusable system-prompt fragments
-- **Cron jobs** — scheduled tasks (e.g., "send a daily summary at 9 AM")
-- **Memory** — L3 cross-surface profile
-
-This means a TutorBot on Telegram can do everything you can do in the Web UI — research, quiz generation, code execution, etc. — without the user ever leaving Telegram.
-
-## When to use TutorBot vs Web UI
-
-| Use case | Surface |
-|----------|---------|
-| Solo deep-dive learning | Web UI |
-| Quick on-the-go questions | TutorBot on Telegram / Slack |
-| Team Q&A in a shared channel | TutorBot on Feishu / Slack / Discord channel |
-| Async help via email | TutorBot on Email |
-| Scheduled daily nudges / digests | TutorBot with cron jobs |
-| Programmatic integration | DeepTutor [CLI](/docs/cli/) or [API](/docs/cli/server-api/) |
-
-## Where state lives
-
-```text
-data/
-├── tutorbot/
-│ ├── my-math-tutor/
-│ │ ├── agents.yaml # Channels + persona
-│ │ ├── souls/ # Soul / personality templates
-│ │ ├── skills/ # User-authored skill fragments
-│ │ ├── cron/ # Scheduled task definitions
-│ │ ├── media/ # Cached inbound/outbound attachments
-│ │ ├── logs/ # Per-bot logs
-│ │ └── sessions.db # Local chat session cache
-│ └── helpdesk-bot/
-│ └── ...
-└── memory/ # Shared across all bots + Web UI
- ├── L1/
- ├── L2/
- └── L3/
-```
-
-## Required Python extras
-
-Bots require the `[tutorbot]` extra (or the equivalent in `packaging/deeptutor-cli`):
-
-```bash
-# Full server + TutorBot
-pip install -e ".[partners]"
-
-# CLI-only + TutorBot
-pip install -e "./packaging/deeptutor-cli[tutorbot]"
-
-# From PyPI (already includes tutorbot)
-pip install deeptutor
-```
-
-Some specific gateways need extra system dependencies:
-
-| Gateway | Extra needed |
-|---------|--------------|
-| Matrix (E2EE) | `[matrix-e2e]` + libolm system library |
-| WhatsApp | Separate Node.js bridge (not Python) |
-
-Check each gateway's page for details.
-
-## Common patterns
-
-### Pattern: study group on Slack
-
-1. Create a bot: `deeptutor bot create study-helper --persona "Patient study group facilitator"`
-2. Enable Slack with `group_policy: "mention"` so it only responds when @mentioned
-3. Attach the course KB to the bot's config
-4. Invite the bot to a Slack channel
-5. Students ask questions — the bot retrieves from the KB and answers, citing sources
-
-### Pattern: solo TG tutor
-
-1. `deeptutor bot create my-tutor --persona "Personal calculus tutor"`
-2. Enable Telegram with `allow_from: ["123456789"]` (your TG user id)
-3. Optional cron: "every weekday at 8 AM, ask me what I want to work on today"
-4. Chat normally on Telegram — gets the same memory / context as Web UI
-
-### Pattern: enterprise helpdesk on Feishu
-
-1. `deeptutor bot create helpdesk --persona "Friendly first-line IT helpdesk"`
-2. Attach the internal docs KB
-3. Enable Feishu with `group_policy: "open"` in the help channel, `mention` everywhere else
-4. Configure `allow_from` to your org's verified user list
-
-## See also
-
-- [**DeepTutor CLI → bot**](/docs/cli/commands/#deeptutor-bot--tutorbot-lifecycle) — lifecycle commands
-- [**Memory**](/docs/explore/memory/) — how bots share user memory
-- Any gateway page above for setup details
+This legacy page has moved. Read [**Partners & Channels**](/docs/partners/) instead.
diff --git a/site/src/content/docs/docs/tutorbot/matrix.md b/site/src/content/docs/docs/tutorbot/matrix.md
index 5019ccb95..a1e02e394 100644
--- a/site/src/content/docs/docs/tutorbot/matrix.md
+++ b/site/src/content/docs/docs/tutorbot/matrix.md
@@ -1,187 +1,6 @@
---
-title: Matrix
-description: TutorBot on Matrix — decentralized chat, with optional end-to-end encryption.
+title: Moved
+description: This legacy page is kept for old links.
---
-Matrix is the decentralized chat option. DeepTutor talks to any Matrix homeserver (matrix.org, your self-hosted Synapse, Conduit, Dendrite) via the standard client-server API.
-
-End-to-end encryption is **optional** and split into its own install extra so most users don't pay the libolm dependency cost.
-
-## What you need
-
-- A Matrix account (on matrix.org or any homeserver)
-- The bot's `access_token` from that account
-- *(For E2EE)* `libolm` installed on your system
-
-## Step 1 — Create a Matrix account for the bot
-
-The bot needs its own Matrix account. Use any homeserver:
-
-- **Public**: Element web app → matrix.org → Create Account
-- **Self-hosted**: `register_new_matrix_user` (Synapse) or the equivalent for your server
-
-For testing, matrix.org's public homeserver is fine.
-
-## Step 2 — Get the access token
-
-### Option A — From Element
-
-1. Sign into Element as the bot user
-2. **Settings** → **Help & About** → scroll to **Advanced**
-3. Reveal **Access Token** and copy it
-
-### Option B — From the REST API
-
-```bash
-curl -X POST https://matrix.org/_matrix/client/r0/login \
- -H "Content-Type: application/json" \
- -d '{
- "type": "m.login.password",
- "user": "math-bot",
- "password": "your-password"
- }'
-
-# Response includes "access_token": "syt_..."
-```
-
-## Step 3 — Configure
-
-```yaml
-channels:
- matrix:
- enabled: true
- homeserver: "https://matrix.org" # or your self-hosted URL
- user_id: "@math-bot:matrix.org"
- access_token: "syt_xxxxxxxxxxxxxxxxxxxx"
- encryption_enabled: false # set true after installing matrix-e2e extra
- allow_from: [] # empty = anyone in joined rooms can talk to bot
- rooms: [] # specific room ids the bot should join, or [] = listen everywhere
-```
-
-## Step 4 — Install dependencies
-
-Matrix support is in an optional install extra. Three layers:
-
-| Goal | Install |
-|------|---------|
-| Base Matrix (no E2EE) | `pip install -e ".[matrix]"` |
-| Matrix with E2EE | `pip install -e ".[matrix-e2e]"` *(also needs libolm)* |
-| All Partners gateways including Matrix | `pip install -e ".[partners]"` |
-
-For E2EE, install **libolm** first:
-
-```bash
-# macOS
-brew install libolm
-
-# Debian / Ubuntu
-sudo apt install libolm-dev
-
-# Then the Python extra
-pip install -e ".[matrix-e2e]"
-```
-
-## Step 5 — Start
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:matrix → connecting (homeserver=matrix.org)
-[bot:my-math-tutor] channel:matrix → sync ok (next_batch=...)
-[bot:my-math-tutor] channel:matrix → joined 3 rooms
-```
-
-## Inviting the bot to a room
-
-Once the bot is running, invite it from any Matrix client:
-
-```text
-/invite @math-bot:matrix.org
-```
-
-The bot auto-accepts invitations and starts listening for messages in that room. To restrict which rooms the bot joins:
-
-```yaml
-channels:
- matrix:
- rooms:
- - "!abc123:matrix.org" # only auto-join these specific rooms
-```
-
-## Config reference
-
-| Field | Type | Required | Default | Notes |
-|-------|------|----------|---------|-------|
-| `enabled` | bool | yes | `false` | |
-| `homeserver` | url | yes | — | e.g., `https://matrix.org` |
-| `user_id` | string | yes | — | `@bot:matrix.org` |
-| `access_token` | string | yes | — | From login or Element |
-| `encryption_enabled` | bool | optional | `false` | Requires `[matrix-e2e]` extra + libolm |
-| `allow_from` | list[string] | optional | `[]` | Matrix user ids; `[]` = anyone in joined rooms |
-| `rooms` | list[string] | optional | `[]` | Specific room ids; `[]` = listen in any room the bot is in |
-
-## Capabilities on Matrix
-
-| Feature | Supported |
-|---------|-----------|
-| Direct (1:1) chat | ✅ |
-| Group rooms | ✅ |
-| Markdown → HTML | ✅ *(rendered correctly in Element, Cinny, etc.)* |
-| LaTeX math | ⚠️ requires `mathjs` client plugin in your Matrix client |
-| File uploads | ✅ |
-| File downloads | ✅ |
-| End-to-end encryption | ✅ *(opt-in)* |
-| Typing indicators | ✅ |
-| Reactions | ⚠️ outbound only |
-
-## End-to-end encryption
-
-Once `encryption_enabled: true` + libolm + `[matrix-e2e]` extra:
-
-- The bot generates its own device key on first launch
-- For each E2EE room, the bot participates in key exchange via Megolm
-- All messages are end-to-end encrypted including attachments
-
-**Caveat**: the bot's reasoning still happens server-side in DeepTutor. The encryption is between the Matrix client (user) and the bot's Matrix process, but the message text reaches the LLM provider unencrypted (unless you've configured a local LLM).
-
-If end-to-end-to-LLM privacy matters, use a local Ollama / vLLM with the bot.
-
-## Keep-alive specifics
-
-The Matrix channel uses the **`/sync` long-poll endpoint** with a 30-second timeout. The pattern:
-
-1. Open `/sync?since=<last_batch>` with timeout=30000
-2. Receive new events (or empty response after 30s)
-3. Update `last_batch`, immediately re-poll
-
-On disconnect:
-
-- Network drops are transparent — the next `/sync` retries
-- Auth errors (401) require manual intervention (token expired or invalidated)
-
-For high uptime, run the DeepTutor server under a process supervisor (systemd, docker restart-policy). The channel itself handles transient failures.
-
-## Common issues
-
-### `M_UNKNOWN_TOKEN`
-
-Your `access_token` was invalidated (logged out from another client, or the server rotated keys). Get a fresh token via Element settings or the REST login.
-
-### Bot joins but doesn't respond in E2EE rooms
-
-You enabled `encryption_enabled: true` without installing `[matrix-e2e]` extra. The bot connects but can't decrypt — install libolm + reinstall.
-
-### Federation lag
-
-If your bot is on `matrix.org` and you're chatting on a small self-hosted server, messages can take a few seconds to federate. Not a bug — federation latency.
-
-### "User not in room" error sending replies
-
-The bot was kicked or left the room. Re-invite from your Matrix client.
-
-## See also
-
-- [**Explore TutorBot**](/docs/tutorbot/) — overall architecture
-- [Matrix specification](https://spec.matrix.org/) — the underlying protocol
+This legacy page has moved. Read [**Partners & Channels**](/docs/partners/) instead.
diff --git a/site/src/content/docs/docs/tutorbot/mochat.md b/site/src/content/docs/docs/tutorbot/mochat.md
index c41386c2d..a1e02e394 100644
--- a/site/src/content/docs/docs/tutorbot/mochat.md
+++ b/site/src/content/docs/docs/tutorbot/mochat.md
@@ -1,103 +1,6 @@
---
-title: Mochat
-description: TutorBot on Mochat — customer-support style chat panel with Socket.IO or HTTP polling.
+title: Moved
+description: This legacy page is kept for old links.
---
-[Mochat](https://github.com/microsoft/mochat) is an open-source customer-support / chat panel. DeepTutor's Mochat channel connects via **Socket.IO** (preferred) or **HTTP polling** as a fallback. Useful when you want a tutor bot embedded in your existing website's support widget.
-
-## What you need
-
-- A running Mochat instance (self-hosted or managed)
-- A bot account with an access token (Claw Token)
-
-## Step 1 — Create a bot in Mochat
-
-1. Sign in to your Mochat admin panel
-2. **Bots** → **Create**
-3. Copy the bot's **Claw Token**
-
-## Step 2 — Configure
-
-```yaml
-channels:
- mochat:
- enabled: true
- service_url: "https://mochat.example.com"
- claw_token: "YOUR_BOT_TOKEN"
- allow_from: [] # user ids; [] = open
- use_http_polling: false # fallback if Socket.IO unavailable
- polling_interval_ms: 1000
- delayed_message_timeout_s: 5
-```
-
-## Step 3 — Start
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:mochat → connecting (socket.io to mochat.example.com)
-[bot:my-math-tutor] channel:mochat → ready
-```
-
-## Config reference
-
-| Field | Type | Required | Default |
-|-------|------|----------|---------|
-| `enabled` | bool | yes | `false` |
-| `service_url` | url | yes | — |
-| `claw_token` | string | yes | — |
-| `allow_from` | list[string] | optional | `[]` (open) |
-| `use_http_polling` | bool | optional | `false` |
-| `polling_interval_ms` | int | optional | `1000` |
-| `delayed_message_timeout_s` | int | optional | `5` |
-
-## Capabilities on Mochat
-
-| Feature | Supported |
-|---------|-----------|
-| Customer chat panel messaging | ✅ |
-| Group / room messaging | ✅ |
-| Markdown | ✅ |
-| File uploads | ✅ |
-| Delayed message batching | ✅ *(for efficiency on fast user input)* |
-
-## Delayed message batching
-
-Mochat users often type messages in bursts (e.g., "Hi!\nQuick question.\nIs the bot online?"). To avoid generating one bot reply per fragment, the channel **batches messages** received within `delayed_message_timeout_s` (default 5s):
-
-- First message arrives → start a timer
-- More messages within timeout → append, restart timer
-- Timer expires → bundle all messages into one user turn
-
-Adjust `delayed_message_timeout_s` based on how chatty your users are.
-
-## Keep-alive specifics
-
-The Socket.IO connection auto-reconnects on drop. If Socket.IO repeatedly fails, the channel falls back to HTTP polling:
-
-```yaml
-use_http_polling: true
-polling_interval_ms: 2000 # poll every 2 seconds
-```
-
-This trades latency for robustness — useful behind picky corporate proxies.
-
-## Common issues
-
-### "Cannot connect" but Mochat is up
-
-Mochat sometimes requires the bot to be **approved** in the admin panel before its token is active. Check the bot status.
-
-### Replies arrive but users don't see them
-
-Mochat has channel-level visibility settings. Ensure the bot is added to the channels where users are chatting.
-
-### Socket.IO version mismatch
-
-If your Mochat is on an older Socket.IO version, force HTTP polling instead of debugging the version mismatch — `use_http_polling: true`.
-
-## See also
-
-- [**Explore TutorBot**](/docs/tutorbot/) — overall architecture
+This legacy page has moved. Read [**Partners & Channels**](/docs/partners/) instead.
diff --git a/site/src/content/docs/docs/tutorbot/qq.md b/site/src/content/docs/docs/tutorbot/qq.md
index 2e12a342f..1922bb212 100644
--- a/site/src/content/docs/docs/tutorbot/qq.md
+++ b/site/src/content/docs/docs/tutorbot/qq.md
@@ -1,75 +1,6 @@
---
-title: QQ
-description: TutorBot on QQ — Tencent's consumer messenger, via the official botpy SDK.
+title: Moved
+description: This legacy page is kept for old links.
---
-QQ is Tencent's flagship consumer messenger. DeepTutor uses Tencent's official **botpy** SDK over a WebSocket connection.
-
-## What you need
-
-- A [**QQ Bot Development Platform**](https://bot.q.qq.com/) account
-- Tencent Cloud account (for some advanced features)
-
-## Step 1 — Register a QQ bot
-
-1. Sign in to <https://bot.q.qq.com/>
-2. **Create New Bot** → fill in name and description
-3. Copy **App ID** and **Secret**
-4. Enable the message types you need: C2C (direct messages) and group messages
-
-## Step 2 — Configure
-
-```yaml
-channels:
- qq:
- enabled: true
- app_id: "YOUR_APP_ID"
- secret: "YOUR_SECRET"
- allow_from: []
- msg_format: "plain" # or "markdown"
-```
-
-## Step 3 — Start
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-## Config reference
-
-| Field | Type | Required | Notes |
-|-------|------|----------|-------|
-| `enabled` | bool | yes | |
-| `app_id` | string | yes | From bot platform |
-| `secret` | string | yes | From bot platform |
-| `allow_from` | list[string] | optional | QQ user ids |
-| `msg_format` | `"plain" \| "markdown"` | optional | Reply formatting style |
-
-## Capabilities on QQ
-
-| Feature | Supported |
-|---------|-----------|
-| C2C (direct) messages | ✅ |
-| Group messages | ✅ |
-| Markdown | ✅ *(if `msg_format: "markdown"`)* |
-| File / image attachments | ✅ |
-| Image generation in replies | ✅ |
-| Mention routing | ✅ |
-
-## Common issues
-
-### Duplicate message handling
-
-QQ's gateway occasionally redelivers messages. The channel keeps a deque of the last 1000 message ids and silently drops duplicates. If you see duplicates, the deque may have wrapped — restart the bot.
-
-### "Auth failed" on connect
-
-Wrong `app_id` / `secret`, or your bot wasn't approved for the requested message types. Check the QQ Bot platform.
-
-### Markdown not rendering
-
-QQ's markdown rendering varies by client version. Some clients render `**bold**`, others want `<b>bold</b>`. If users complain, try setting `msg_format: "plain"`.
-
-## See also
-
-- [**Explore TutorBot**](/docs/tutorbot/) — overall architecture
+This legacy page has moved. Read [**QQ / NapCat**](/docs/partners/qq/) instead.
diff --git a/site/src/content/docs/docs/tutorbot/slack.md b/site/src/content/docs/docs/tutorbot/slack.md
index 858bb2f21..a1e02e394 100644
--- a/site/src/content/docs/docs/tutorbot/slack.md
+++ b/site/src/content/docs/docs/tutorbot/slack.md
@@ -1,185 +1,6 @@
---
-title: Slack
-description: TutorBot on Slack — Socket Mode app, thread-scoped sessions, channel and DM policies.
+title: Moved
+description: This legacy page is kept for old links.
---
-Slack is the most full-featured gateway: DMs, channel mentions, **thread-scoped sessions** (each thread becomes its own DeepTutor session), Slack-flavored markdown, file uploads, and acknowledgement reactions.
-
-Connection is **Socket Mode** — no public IP or webhook required.
-
-## What you need
-
-- A Slack workspace where you can install apps (own or admin-blessed)
-- 5 minutes at <https://api.slack.com/apps>
-
-## Step 1 — Create the Slack app
-
-1. Go to <https://api.slack.com/apps> → **Create New App** → **From scratch**
-2. Name it (e.g., "Math Mentor"), pick the workspace
-3. Once created, go to **Socket Mode** (left sidebar) → **Enable Socket Mode** *(toggle on)*
-4. When prompted, generate an App-Level Token with `connections:write` scope and copy it — this is your **`app_token`** (starts with `xapp-`)
-
-## Step 2 — Configure OAuth scopes
-
-Still in your app:
-
-1. Left sidebar → **OAuth & Permissions**
-2. Under **Scopes** → **Bot Token Scopes**, add:
- - `chat:write` — send messages
- - `chat:write.public` — send to channels without joining
- - `files:write` — upload files
- - `reactions:write` — add reactions (`:eyes:` acknowledgement)
- - `users:read` — resolve user ids to names
- - `app_mentions:read` — receive @mentions
- - `im:history` — read DM history
- - `im:read` — read DM channel info
- - `channels:history` — read public channel history
- - `groups:history` — *(optional)* private channels
-3. Click **Install to Workspace** → authorize
-4. Copy the **Bot User OAuth Token** (starts with `xoxb-`) — this is your **`bot_token`**
-
-## Step 3 — Subscribe to events
-
-1. Left sidebar → **Event Subscriptions**
-2. **Subscribe to bot events**:
- - `app_mention`
- - `message.im`
- - `message.channels` *(only if you want channel listening; otherwise skip)*
-
-## Step 4 — Configure
-
-```yaml
-channels:
- slack:
- enabled: true
- mode: "socket" # the only mode supported
- bot_token: "xoxb-XXX..." # from OAuth & Permissions
- app_token: "xapp-XXX..." # from Socket Mode
- reply_in_thread: true # keep replies in the message thread
- react_emoji: "eyes" # reaction to acknowledge receipt
- allow_from: ["*"] # user ids; "*" = open
- group_policy: "mention" # in channels: only respond to mentions
- group_allow_from: [] # specific channel ids if group_policy=mention
- dm:
- enabled: true
- policy: "open" # in DMs: always respond, or "allowlist"
- allow_from: []
-```
-
-## Step 5 — Start
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:slack → connecting (socket mode)
-[bot:my-math-tutor] channel:slack → ready
-```
-
-In Slack, DM the bot or @mention it in a channel.
-
-## Config reference
-
-| Field | Type | Required | Default | Notes |
-|-------|------|----------|---------|-------|
-| `enabled` | bool | yes | `false` | |
-| `mode` | string | yes | `"socket"` | Only `socket` is supported |
-| `bot_token` | string | yes | — | `xoxb-…` |
-| `app_token` | string | yes | — | `xapp-…` (Socket Mode token) |
-| `reply_in_thread` | bool | optional | `true` | Reply in thread vs new message |
-| `react_emoji` | string | optional | `"eyes"` | Emoji name for ack reaction |
-| `allow_from` | list[string] | yes | `[]` | User ids or `"*"` |
-| `group_policy` | `"mention" \| "open"` | optional | `"mention"` | In channels |
-| `group_allow_from` | list[string] | optional | `[]` | Channel ids (if you want to restrict to specific channels) |
-| `dm.enabled` | bool | optional | `true` | |
-| `dm.policy` | `"open" \| "allowlist"` | optional | `"open"` | |
-| `dm.allow_from` | list[string] | optional | `[]` | Used when `policy=allowlist` |
-
-## Thread-scoped sessions
-
-This is the killer Slack feature: **each Slack thread becomes its own DeepTutor session**. When you @mention the bot in a channel:
-
-1. Bot replies, opening a new thread
-2. Subsequent replies in that thread feed into the same session (with all its history, attached KB, etc.)
-3. Threads in different channels are different sessions
-4. DMs are their own sessions (one per user)
-
-This means a team can have many parallel ongoing tutor conversations in one channel without context bleed.
-
-To turn this off (force every reply to start fresh):
-
-```yaml
-channels:
- slack:
- reply_in_thread: false
- # bonus: makes the bot reply directly in the channel, not in a thread
-```
-
-## Capabilities on Slack
-
-| Feature | Supported |
-|---------|-----------|
-| DMs | ✅ |
-| Channel mentions | ✅ |
-| Threads (session-scoped) | ✅ |
-| File uploads | ✅ |
-| File downloads | ✅ |
-| Markdown → mrkdwn | ✅ *(auto-converted by the channel)* |
-| Code blocks | ✅ |
-| LaTeX math | ⚠️ rendered as code blocks (Slack doesn't render LaTeX) |
-| Reactions outbound | ✅ *(via `react_emoji`)* |
-| Slash commands | ⚠️ not yet — use DMs/mentions |
-
-## Markdown to mrkdwn
-
-Slack uses its own flavored markdown ("mrkdwn"). DeepTutor's Slack channel auto-converts:
-
-| Standard markdown | mrkdwn output |
-|-------------------|---------------|
-| `**bold**` | `*bold*` |
-| `*italic*` | `_italic_` |
-| `# heading` | `*heading*` (bold) |
-| `` `code` `` | `` `code` `` |
-| ` ```code``` ` | ` ```code``` ` |
-| `[link](url)` | `<url|link>` |
-| `- bullet` | `• bullet` |
-| `> quote` | `> quote` |
-
-## Common issues
-
-### Bot says hi but never responds to followups
-
-Check `reply_in_thread`:
-
-```yaml
-reply_in_thread: true
-```
-
-If true, the bot only listens in threads it started (the `thread_ts` matches). If you DM in a non-thread message after the initial response, the bot won't see it.
-
-### "Not authorized" / 401 from Slack API
-
-Token mismatch — make sure you put `xoxb-` token in `bot_token` and `xapp-` token in `app_token`. Easy to swap by accident.
-
-### Bot doesn't respond in channels
-
-Two requirements:
-1. The bot must be **invited to the channel** (`/invite @bot`)
-2. Your message must @mention the bot (`@math-mentor what is...`) if `group_policy: mention`
-
-### Long messages get truncated
-
-Slack messages cap at 40,000 chars (much longer than Telegram/Discord). DeepTutor doesn't split — but extremely long responses (e.g., 50+ page Deep Research outputs) should be sent as files instead.
-
-## Keep-alive specifics
-
-Socket Mode opens a single WebSocket to Slack. The channel:
-- Sends pings every 30 seconds
-- Auto-reconnects on drop, with backoff
-- No external supervision needed
-
-## See also
-
-- [**Discord**](/docs/tutorbot/discord/) — similar developer-portal model
-- [**Explore TutorBot**](/docs/tutorbot/) — overall architecture
+This legacy page has moved. Read [**Partners & Channels**](/docs/partners/) instead.
diff --git a/site/src/content/docs/docs/tutorbot/telegram.md b/site/src/content/docs/docs/tutorbot/telegram.md
index 16839a16b..a1e02e394 100644
--- a/site/src/content/docs/docs/tutorbot/telegram.md
+++ b/site/src/content/docs/docs/tutorbot/telegram.md
@@ -1,193 +1,6 @@
---
-title: Telegram
-description: Run a TutorBot on Telegram — registration via BotFather, config keys, and operational notes.
+title: Moved
+description: This legacy page is kept for old links.
---
-Telegram is the easiest gateway to wire up — there's no public IP requirement, no webhook signing, and the BotFather registration takes about a minute.
-
-## What you need
-
-- A Telegram account
-- A chat with [@BotFather](https://t.me/BotFather)
-
-That's it. No business verification, no developer console signup.
-
-## Step 1 — Register a bot with BotFather
-
-Open Telegram, search for `@BotFather`, start a chat. Then:
-
-```text
-You> /newbot
-
-BotFather> Alright, a new bot. How are we going to call it?
- Please choose a name for your bot.
-
-You> Math Mentor
-
-BotFather> Good. Now let's choose a username for your bot.
- It must end in 'bot'. Like this, for example: TetrisBot.
-
-You> hku_math_mentor_bot
-
-BotFather> Done! Congratulations on your new bot.
- You will find it at t.me/hku_math_mentor_bot.
-
- Use this token to access the HTTP API:
- 123456789:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
-```
-
-**Copy that token.** You'll paste it into `agents.yaml` in a moment.
-
-## Step 2 — Find your Telegram user id
-
-You need your own user id to put in `allow_from` (otherwise the bot won't respond to anyone). The simplest way: chat with [@userinfobot](https://t.me/userinfobot), which replies with your id.
-
-```text
-You> hi
-
-userinfobot> Id: 123456789
- First: Frank
- Last:
- Username: @frank
- Language: zh
-```
-
-## Step 3 — Configure your bot
-
-Edit `data/tutorbot/<bot_id>/agents.yaml`:
-
-```yaml
-agent:
- id: my-math-tutor
- name: Math Mentor
- persona: "Socratic math tutor specializing in calculus and linear algebra."
- model: gpt-4o
-
-channels:
- telegram:
- enabled: true
- token: "123456789:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
- allow_from:
- - "123456789" # your Telegram user id
- # - "*" # uncomment to open the bot to everyone (careful)
-```
-
-## Step 4 — Start the bot
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] starting...
-[bot:my-math-tutor] channel:telegram → connecting
-[bot:my-math-tutor] channel:telegram → ok (long-polling)
-[bot:my-math-tutor] running.
-```
-
-Now open Telegram, search for `@hku_math_mentor_bot`, send `/start` — and you're talking to the bot.
-
-## Config reference
-
-| Field | Type | Required | Default | Notes |
-|-------|------|----------|---------|-------|
-| `enabled` | bool | yes | `false` | Start the channel |
-| `token` | string | yes | — | HTTP API token from BotFather |
-| `allow_from` | list[string] | yes | `[]` *(denies all)* | User ids or `"*"` for open |
-
-## Capabilities on Telegram
-
-| Feature | Supported |
-|---------|-----------|
-| Direct messages | ✅ |
-| Group chats | ✅ *(bot must be added to the group + group_policy applies)* |
-| Markdown rendering | ✅ *(via Telegram's markdown_v2 parser)* |
-| LaTeX math | ⚠️ rendered as plain text — Telegram doesn't render `$...$` |
-| File uploads | ✅ *(up to Telegram's 20 MB / 2 GB limit)* |
-| File downloads | ✅ *(the bot can receive PDFs, images, voice messages)* |
-| Audio transcription | ✅ *(if `transcription_api_key` is configured globally)* |
-| Reply-in-thread | ⚠️ partial — Telegram has reply-to-message, not threads |
-
-## Groups
-
-To use the bot in a Telegram group:
-
-1. Add the bot to the group (Add Member → search for `@your_bot`)
-2. Disable **Group Privacy** in BotFather: `/mybots` → select bot → **Bot Settings** → **Group Privacy** → **Turn OFF**
-3. Mention the bot to address it (`@hku_math_mentor_bot question?`)
-
-Set `group_policy` in the config:
-
-```yaml
-channels:
- telegram:
- group_policy: "mention" # only respond when @mentioned
- # group_policy: "open" # respond to every message (chatty!)
-```
-
-## Keep-alive specifics
-
-The Telegram connection uses **long polling** by default — the bot pulls updates from Telegram's servers in a long-lived loop. This is robust to network blips:
-
-- A network drop just makes the next `getUpdates` call fail
-- The channel retries with exponential backoff
-- When connectivity returns, polling resumes
-
-You don't need a public IP, webhook, or reverse proxy. Telegram's BotFather doesn't require any URL configuration on your end.
-
-## Common issues
-
-### Bot doesn't respond to my messages
-
-99% of the time it's `allow_from`:
-
-```yaml
-allow_from:
- - "123456789" # your actual id, in quotes (it's a string field)
-```
-
-Empty `allow_from: []` means "deny everyone" — even you. Use `["*"]` to allow all.
-
-### Bot doesn't respond in groups
-
-Two things to check:
-
-1. BotFather → `/mybots` → your bot → Group Privacy → **Disabled**
-2. In config: `group_policy: "mention"` (set) and you actually `@mentioned` the bot in your message
-
-### "Conflict: terminated by other getUpdates request"
-
-You started the same bot in two places at once (e.g., `deeptutor bot start` twice, or two DeepTutor instances). Telegram allows only one polling client per token. Stop the duplicate.
-
-### Messages > 4096 chars get cut off
-
-Telegram messages are capped at 4096 chars. The bot auto-splits longer messages into multiple sends. For very long responses (e.g., Deep Research reports), prefer sending a file:
-
-```yaml
-channels:
- telegram:
- send_long_as_file: true # auto-attach .md when response > 4096 chars
-```
-
-## Audio messages
-
-If you've set `TRANSCRIPTION_API_KEY` (and a transcription provider like Groq Whisper) in `.env`, the bot transcribes voice messages and treats them like text input. Otherwise voice messages are ignored.
-
-## Files and images
-
-When a user uploads a file or image:
-
-- **Image** → Sent to the model as a vision input
-- **PDF / DOCX** → Parsed and treated as an attachment (full text available via `read_source` tool)
-- **Other** → Acknowledged but ignored
-
-## Multi-tenant deployments
-
-In multi-user mode, each user can have their own Telegram bot. Bot ids are scoped per user, so `alice` and `bob` can each have a `my-tutor` without collision.
-
-For organization-wide bots (one bot shared by many users), keep the bot under the admin account but configure `allow_from` to a long list, or use `["*"]` with care.
-
-## See also
-
-- [**Explore TutorBot**](/docs/tutorbot/) — architecture and lifecycle
-- [**CLI → bot commands**](/docs/cli/commands/#deeptutor-bot--tutorbot-lifecycle)
+This legacy page has moved. Read [**Partners & Channels**](/docs/partners/) instead.
diff --git a/site/src/content/docs/docs/tutorbot/wecom.md b/site/src/content/docs/docs/tutorbot/wecom.md
index eb64f1e51..a93e90fc7 100644
--- a/site/src/content/docs/docs/tutorbot/wecom.md
+++ b/site/src/content/docs/docs/tutorbot/wecom.md
@@ -1,110 +1,6 @@
---
-title: WeCom (WeChat Work)
-description: TutorBot on WeCom (企业微信) — enterprise messaging via the WebSocket AI Bot platform.
+title: Moved
+description: This legacy page is kept for old links.
---
-WeCom (企业微信 / WeChat Work) is Tencent's enterprise messaging product. DeepTutor integrates via the **AI Bot** platform with a WebSocket long-connection.
-
-## What you need
-
-- A WeCom organization with admin access
-- The [`wecom-aibot-sdk`](https://pypi.org/project/wecom-aibot-sdk/) Python package
-- 10 minutes in the WeCom admin console
-
-## Step 1 — Install the SDK
-
-WeCom support uses an optional Python package:
-
-```bash
-pip install wecom-aibot-sdk
-```
-
-If you started with `pip install -e ".[partners]"`, this may already be in. Verify:
-
-```bash
-python -c "import wecom_aibot_sdk; print('ok')"
-```
-
-## Step 2 — Create the AI Bot
-
-1. Sign in to <https://work.weixin.qq.com/>
-2. **Applications & Mini Programs** → **AI Bot Platform**
-3. **Create New Application** → select **AI Bot** type
-4. Fill in name, description, departments allowed to use it
-5. Copy **Bot ID** and **Secret**
-
-## Step 3 — Configure
-
-```yaml
-channels:
- wecom:
- enabled: true
- bot_id: "YOUR_BOT_ID"
- secret: "YOUR_SECRET"
- allow_from: [] # optional restriction by user id
- welcome_message: "Hi! I'm your math tutor. Ask me anything."
-```
-
-## Step 4 — Start
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:wecom → connecting (ws://wecom...)
-[bot:my-math-tutor] channel:wecom → ready
-```
-
-## Config reference
-
-| Field | Type | Required | Notes |
-|-------|------|----------|-------|
-| `enabled` | bool | yes | |
-| `bot_id` | string | yes | From AI Bot platform |
-| `secret` | string | yes | From AI Bot platform |
-| `allow_from` | list[string] | optional | WeCom user ids; `[]` allows anyone in your org |
-| `welcome_message` | string | optional | Sent on first message from a new user |
-
-## Capabilities on WeCom
-
-| Feature | Supported |
-|---------|-----------|
-| Direct messages within enterprise | ✅ |
-| Group chats | ✅ |
-| Markdown | ✅ |
-| File / image / voice | ✅ |
-| External contacts (customers) | ⚠️ via WeCom's external contacts feature |
-| Mention routing | ✅ |
-
-## Keep-alive specifics
-
-A background thread maintains the WebSocket. Reconnection is automatic on transient failures.
-
-If the bot stays offline:
-
-1. Check the AI Bot platform — has the bot been disabled?
-2. Verify your DeepTutor server has outbound TLS access to WeCom servers
-3. Restart: `deeptutor bot stop my-math-tutor && deeptutor bot start my-math-tutor`
-
-## Common issues
-
-### `ImportError: wecom_aibot_sdk`
-
-```bash
-pip install wecom-aibot-sdk
-deeptutor bot start my-math-tutor
-```
-
-### Bot connects but doesn't respond
-
-`allow_from` is the usual suspect. Also confirm the user sending messages is in the departments you granted access to in the AI Bot config.
-
-### Multiple bots in same org
-
-Each bot needs its own `bot_id` + `secret`. You can run multiple TutorBots in one DeepTutor server, each connecting to a different WeCom bot.
-
-## See also
-
-- [**Feishu**](/docs/tutorbot/feishu/) — ByteDance's enterprise chat platform
-- [**Explore TutorBot**](/docs/tutorbot/) — overall architecture
+This legacy page has moved. Read [**WeCom**](/docs/partners/wecom/) instead.
diff --git a/site/src/content/docs/docs/tutorbot/whatsapp.md b/site/src/content/docs/docs/tutorbot/whatsapp.md
index 41db10a60..a1e02e394 100644
--- a/site/src/content/docs/docs/tutorbot/whatsapp.md
+++ b/site/src/content/docs/docs/tutorbot/whatsapp.md
@@ -1,152 +1,6 @@
---
-title: WhatsApp
-description: TutorBot on WhatsApp — requires a separate Node.js bridge running Baileys (WhatsApp Web protocol).
+title: Moved
+description: This legacy page is kept for old links.
---
-WhatsApp is the odd one out. The official WhatsApp Business API has substantial friction (verified business, monthly fees, application process). Instead, DeepTutor's WhatsApp channel connects to a **separate Node.js bridge** that speaks WhatsApp Web's protocol — fast to set up, free, and doesn't require business verification.
-
-## What you need
-
-- A Node.js 18+ host (can be the same machine as DeepTutor, or separate)
-- A WhatsApp account on a real phone
-- ~5 minutes for the QR-code pairing flow
-
-## Step 1 — Run the bridge
-
-DeepTutor's repo includes a sample bridge under `multi-user/whatsapp-bridge/` using [@whiskeysockets/baileys](https://github.com/WhiskeySockets/Baileys). Or run any compatible bridge that exposes a WebSocket on a known port.
-
-A minimal bridge looks like:
-
-```javascript
-// bridge.js
-const { default: makeWASocket, useMultiFileAuthState } = require('@whiskeysockets/baileys')
-const WebSocket = require('ws')
-
-const wss = new WebSocket.Server({ port: 3001 })
-let waSocket = null
-
-async function start() {
- const { state, saveCreds } = await useMultiFileAuthState('./auth')
- waSocket = makeWASocket({ auth: state, printQRInTerminal: true })
- waSocket.ev.on('creds.update', saveCreds)
- waSocket.ev.on('messages.upsert', ({ messages }) => {
- wss.clients.forEach(client => client.send(JSON.stringify(messages[0])))
- })
-}
-
-wss.on('connection', (ws) => {
- ws.on('message', (raw) => {
- const { jid, text } = JSON.parse(raw)
- waSocket?.sendMessage(jid, { text })
- })
-})
-
-start()
-```
-
-Start it:
-
-```bash
-cd multi-user/whatsapp-bridge
-npm install
-node bridge.js
-```
-
-A QR code appears in the terminal. Open WhatsApp on your phone → **Settings → Linked devices → Link a device** → scan. Done.
-
-## Step 2 — Configure DeepTutor
-
-```yaml
-channels:
- whatsapp:
- enabled: true
- bridge_url: "ws://localhost:3001" # where the bridge listens
- bridge_token: "" # optional, if your bridge requires auth
- allow_from: # phone numbers in E.164 format
- - "+85291234567"
-```
-
-## Step 3 — Start the bot
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:whatsapp → connecting (ws://localhost:3001)
-[bot:my-math-tutor] channel:whatsapp → ready
-```
-
-Send a message to the **same phone number** that's logged into the bridge — the bridge relays it to DeepTutor, the bot replies through the bridge, the reply lands in WhatsApp.
-
-## Config reference
-
-| Field | Type | Required | Notes |
-|-------|------|----------|-------|
-| `enabled` | bool | yes | |
-| `bridge_url` | url | yes | WebSocket URL of the bridge |
-| `bridge_token` | string | optional | Auth token if your bridge requires it |
-| `allow_from` | list[string] | optional | Phone numbers (E.164); `["*"]` = open |
-
-## Capabilities on WhatsApp
-
-| Feature | Supported |
-|---------|-----------|
-| Direct messages | ✅ |
-| Group messages | ✅ *(bridge must support group routing)* |
-| Markdown | ⚠️ basic — WhatsApp only renders `*bold*`, `_italic_`, `~strike~`, `` ` ` `` |
-| File / image / audio | ✅ *(via bridge)* |
-| LaTeX math | ❌ rendered as plain text |
-| Voice notes | ✅ *(transcribed if `TRANSCRIPTION_API_KEY` is set)* |
-
-## Keep-alive specifics
-
-WhatsApp Web tokens expire periodically — typically when the phone is offline for ~2 weeks. When that happens:
-
-- The bridge prints a new QR code
-- You re-scan from your phone
-- Sessions resume
-
-Run the bridge as a managed process (`pm2`, systemd, supervisor) so it restarts on crash. The DeepTutor side auto-reconnects to the bridge's WebSocket if it drops.
-
-## Why a bridge instead of the official API?
-
-| Option | Friction | Cost | Restrictions |
-|--------|----------|------|--------------|
-| WhatsApp Business API (official) | Verified business + Meta approval | $0.005–0.10 per message | Template-only outbound outside 24h windows |
-| WhatsApp Web bridge (this) | One QR scan | Free | Phone must stay online ~weekly |
-
-The bridge is great for personal use and small teams. For production-grade business messaging, consider Twilio or 360dialog (official API resellers).
-
-## Risks and policy
-
-WhatsApp Web's terms allow automation of your own account, but they technically frown on bot-like usage. Practical risks:
-
-- **Account ban** — rare for low-volume use; common if you spam
-- **Rate limits** — WhatsApp may flag accounts sending too many messages per minute
-
-If you're using DeepTutor's WhatsApp channel for any non-trivial deployment, use a dedicated phone number you control, not your personal one.
-
-## Common issues
-
-### Bridge keeps printing QR codes
-
-The auth state isn't being persisted. Check that `./auth` directory is writable and isn't being wiped between restarts.
-
-### "Bridge unreachable"
-
-```bash
-curl http://localhost:3001 2>&1 | head -1
-# Should at least respond, even with 400 (it's a WS endpoint)
-```
-
-If `connection refused`, the bridge isn't running. If `cannot resolve host`, your `bridge_url` is wrong.
-
-### Messages send but never arrive
-
-Check the bridge's logs (`node bridge.js` stdout). WhatsApp Web sometimes silently drops messages when the bridge sends them too fast — add throttling in the bridge.
-
-## See also
-
-- [**Email**](/docs/tutorbot/email/) — another bridge-style integration (IMAP/SMTP)
-- [Baileys docs](https://github.com/WhiskeySockets/Baileys) — bridge library reference
+This legacy page has moved. Read [**Partners & Channels**](/docs/partners/) instead.
diff --git a/site/src/content/docs/docs/tutorbot/zulip.md b/site/src/content/docs/docs/tutorbot/zulip.md
index 6412b1281..a1e02e394 100644
--- a/site/src/content/docs/docs/tutorbot/zulip.md
+++ b/site/src/content/docs/docs/tutorbot/zulip.md
@@ -1,131 +1,6 @@
---
-title: Zulip
-description: TutorBot on Zulip — stream + topic addressing, KaTeX math rendering, since v1.3.9.
+title: Moved
+description: This legacy page is kept for old links.
---
-Zulip was added in **v1.3.9** (2026-05-09). It uses Zulip's event-queue long-polling and supports Zulip's distinctive **stream + topic** addressing.
-
-## What you need
-
-- A Zulip server (any version — Zulip Cloud or self-hosted)
-- Admin access to create bots in your organization
-
-## Step 1 — Create a bot
-
-1. In Zulip, click the ⚙️ icon (top right) → **Organization** → **Bots & integrations**
-2. Click **Add a new bot**
-3. Bot type: **Generic bot**
-4. Name: "Math Mentor"
-5. Bot email: auto-generated, e.g., `[email protected]`
-6. Click **Create bot**
-7. **Download API key** or **Show API key** and copy
-
-## Step 2 — Subscribe the bot to streams
-
-By default, generic bots can be sent direct messages but won't see public streams unless you subscribe them. In the bot's settings: **Streams subscribed** → add the streams you want the bot to watch.
-
-You can also do this from the config (the `subscribe_streams` field).
-
-## Step 3 — Configure
-
-```yaml
-channels:
- zulip:
- enabled: true
- site: "https://your-zulip.example.com"
- api_key: "YOUR_API_KEY"
- allow_from: ["*"]
- group_policy: "mention" # mention vs open in subscribed streams
- subscribe_streams:
- - "study-help"
- - "homework"
- timeout: 60.0 # event queue poll timeout, seconds
-```
-
-## Step 4 — Start
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:zulip → register event queue
-[bot:my-math-tutor] channel:zulip → subscribed: [study-help, homework]
-[bot:my-math-tutor] channel:zulip → ready (queue_id=q_abc)
-```
-
-## Config reference
-
-| Field | Type | Required | Default | Notes |
-|-------|------|----------|---------|-------|
-| `enabled` | bool | yes | `false` | |
-| `site` | url | yes | — | Your Zulip server |
-| `email` | string | yes | — | Bot email from Zulip |
-| `api_key` | string | yes | — | From bot creation page |
-| `allow_from` | list[string] | optional | `[]` | User ids or emails; `["*"]` open |
-| `group_policy` | `"mention" \| "open"` | optional | `"mention"` | In streams |
-| `subscribe_streams` | list[string] | optional | `[]` | Streams to auto-subscribe |
-| `timeout` | float | optional | `60.0` | Event-queue poll timeout (seconds) |
-
-## Stream + topic addressing (Zulip-specific)
-
-Zulip splits messages into **streams** (like channels) and **topics** (subjects within a stream). DeepTutor scopes sessions to **(stream, topic)** pairs:
-
-- A new topic = a new DeepTutor session
-- Same topic across days = same session, persistent memory
-- Different topics in the same stream = different sessions
-
-This is great for classroom use: each homework problem can have its own topic, the bot tracks each independently.
-
-## Capabilities on Zulip
-
-| Feature | Supported |
-|---------|-----------|
-| Direct messages | ✅ |
-| Stream messages + topics | ✅ *(topic-scoped sessions)* |
-| Markdown | ✅ |
-| **LaTeX / KaTeX math** | ✅ *(Zulip renders `$$...$$` natively)* |
-| File uploads/downloads | ✅ |
-| Mention or open mode | ✅ |
-| Reactions | ⚠️ outbound only |
-
-## Keep-alive specifics
-
-Zulip's **event-queue API** is a long-poll with auto-recovery:
-
-- The bot calls `/api/v1/events?queue_id=...` with `timeout=60s`
-- New events come back as JSON; empty response after timeout
-- If `queue_id` expires (server restarts, idle too long), the bot auto-registers a new one
-
-A background thread runs the listener and bridges events to DeepTutor's async bus. The thread runs until the bot is stopped.
-
-## Common issues
-
-### "Bad event queue id"
-
-The queue expired (server restart or > 10 min idle). The channel auto-recovers — no action needed. If it keeps happening, your Zulip server might be unhealthy.
-
-### Bot doesn't see stream messages
-
-Did you subscribe it? Either via the Zulip UI (bot settings → Streams) or via the `subscribe_streams` config.
-
-### Math doesn't render
-
-The bot has to output math in Zulip's expected format:
-
-```text
-Inline: $x^2$
-
-Display:
-```math
-\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
-```
-```
-
-DeepTutor's Zulip channel auto-converts standard `$...$` and `$$...$$` to Zulip's format.
-
-## See also
-
-- [**Explore TutorBot**](/docs/tutorbot/) — overall architecture
-- [Zulip Bot API docs](https://zulip.com/api/) — reference
+This legacy page has moved. Read [**Partners & Channels**](/docs/partners/) instead.
diff --git a/site/src/content/docs/zh-cn/docs/cli/agent-handoff.md b/site/src/content/docs/zh-cn/docs/cli/agent-handoff.md
index f52e17290..1b5830711 100644
--- a/site/src/content/docs/zh-cn/docs/cli/agent-handoff.md
+++ b/site/src/content/docs/zh-cn/docs/cli/agent-handoff.md
@@ -236,7 +236,7 @@ deeptutor run deep_research "..." \
1. **When to Use** —— 哪些用户请求应该触发 DeepTutor
2. **Prerequisites** —— Python 3.11+、安装方式、`deeptutor init`
-3. **Commands** —— Chat & Capabilities、Knowledge Bases、TutorBot、Memory、Sessions、Notebooks、System
+3. **Commands** —— Chat & Capabilities、Knowledge Bases、Partners、Memory、Sessions、Notebooks、System
4. **REPL Slash Commands** —— `deeptutor chat` 内部可用的命令
5. **Typical Workflows** —— 一组 agent 可以照着复刻的端到端 recipe
diff --git a/site/src/content/docs/zh-cn/docs/cli/commands.md b/site/src/content/docs/zh-cn/docs/cli/commands.md
index cfc93d27c..cb40f243c 100644
--- a/site/src/content/docs/zh-cn/docs/cli/commands.md
+++ b/site/src/content/docs/zh-cn/docs/cli/commands.md
@@ -316,23 +316,23 @@ deeptutor memory clear chat # 仅 chat surface 的 L1 轨迹
curl -X POST http://localhost:8001/api/v1/memory/runs/start
```
-## `deeptutor bot` —— TutorBot 生命周期
+## `deeptutor partner` —— Partner 生命周期
```bash
-deeptutor bot list
+deeptutor partner list
-deeptutor bot create my-bot \
+deeptutor partner create math-tutor \
--name "Math Mentor" \
- --persona "Socratic tutor specializing in algebra and calculus" \
+ --soul "Socratic tutor specializing in algebra and calculus" \
--model gpt-4o
-# `create` 会立即启动 bot。如果之前停过,再 start 即可。
-deeptutor bot stop my-bot
+deeptutor partner stop math-tutor
+deeptutor partner start math-tutor
```
-子命令:`list`、`create`、`start`、`stop`。`create` 会一步写好 bot 配置并启动它。删除一个 bot 就在它停止时删掉它的工作区目录 `data/tutorbot/<bot_id>/`。
+子命令:`list`、`create`、`start`、`stop`。`create` 会写入 partner config,并尝试启动该 partner。Web UI 是配置 channel schema、assets、tools 和 secrets 的推荐入口;CLI 适合列表、创建、启动和停止。
-各通道配置(Telegram、Slack 等)放在 bot 的 YAML 里,位于 `data/tutorbot/<bot_id>/`。各通道接入说明见 [**Explore TutorBot**](/zh-cn/docs/tutorbot/)。
+Partner 运行在 `data/partners/<partner_id>/workspace/` 作用域里。渠道接入说明见 [**Partners 伙伴与渠道**](/zh-cn/docs/partners/)。
## `deeptutor config show`
diff --git a/site/src/content/docs/zh-cn/docs/cli/index.md b/site/src/content/docs/zh-cn/docs/cli/index.md
index b1d94da8f..9c8bc073c 100644
--- a/site/src/content/docs/zh-cn/docs/cli/index.md
+++ b/site/src/content/docs/zh-cn/docs/cli/index.md
@@ -31,8 +31,8 @@ deeptutor run deep_solve "求 sin(x²) 的导数" --tool reason --format json
deeptutor kb create physics --doc chapter1.pdf
deeptutor kb search physics "什么是角动量?"
-# 跑一个 TutorBot
-deeptutor bot create my-bot --persona "Socratic 数学导师"
+# 运行一个 Partner
+deeptutor partner create my-bot --persona "Socratic 数学导师"
# 看三层记忆
deeptutor memory show L3
@@ -47,7 +47,7 @@ deeptutor memory show L3
- 核心学习流程都可以在终端里驱动;浏览器独占的编辑和管理面板通过 Web UI / API 暴露状态
- `deeptutor run --format json` 每行一个 JSON 事件;数据检查类命令 `kb list`、`kb search`、`session show`、`notebook show` 等也都能输出 JSON
- Session 跨 turn 持久化 —— 你可以在 Web、REPL、单次 `run` 之间切换并续上之前的上下文
-- 自动化进入点(turns / KB / session / notebook / memory / TutorBot / config / plugin / provider / book)都在 CLI 上
+- 自动化进入点(turns / KB / session / notebook / memory / Partners / config / plugin / provider / book)都在 CLI 上
## 顶层命令地图
@@ -62,7 +62,7 @@ deeptutor memory show L3
| `deeptutor session` | session 查看 | `deeptutor session list / show <id>` |
| `deeptutor notebook` | notebook 记录 | `deeptutor notebook create / add-md` |
| `deeptutor memory` | 三层记忆存储 | `deeptutor memory show L3` |
-| `deeptutor bot` | TutorBot 生命周期 | `deeptutor bot create / start / stop`(`create` 会立刻启动) |
+| `deeptutor partner` | Partner 生命周期 | `deeptutor partner create / start / stop`(`create` 会写配置并启动) |
| `deeptutor config` | 查看运行时配置 | `deeptutor config show` |
| `deeptutor plugin` | capability / tool 注册表 | `deeptutor plugin list` |
| `deeptutor provider` | provider 认证流程 | `deeptutor provider login openai-codex` |
@@ -113,5 +113,5 @@ deeptutor run deep_solve "求 [[4,1],[2,3]] 的特征值" \
$ deeptutor --help
$ deeptutor run --help
$ deeptutor kb create --help
-$ deeptutor bot start --help
+$ deeptutor partner start --help
```
diff --git a/site/src/content/docs/zh-cn/docs/cli/server-api.md b/site/src/content/docs/zh-cn/docs/cli/server-api.md
index 3e0a7f5ef..30c18be77 100644
--- a/site/src/content/docs/zh-cn/docs/cli/server-api.md
+++ b/site/src/content/docs/zh-cn/docs/cli/server-api.md
@@ -193,23 +193,37 @@ POST /api/v1/system/test/search
Provider profile 通过 catalog endpoint 编辑;当前 API 里没有单独的 `/settings/llm` 或 `/settings/embedding` 路由。
-## TutorBot Manager
+## Partners Manager
```text
-GET /api/v1/tutorbot
-POST /api/v1/tutorbot
-GET /api/v1/tutorbot/recent
-GET /api/v1/tutorbot/channels/schema
-GET /api/v1/tutorbot/{bot_id}
-PATCH /api/v1/tutorbot/{bot_id}
-DELETE /api/v1/tutorbot/{bot_id}
-DELETE /api/v1/tutorbot/{bot_id}/destroy
-GET /api/v1/tutorbot/{bot_id}/files
-PUT /api/v1/tutorbot/{bot_id}/files/{filename}
-GET /api/v1/tutorbot/{bot_id}/history
-WS /api/v1/tutorbot/{bot_id}/ws
+GET /api/v1/partners
+POST /api/v1/partners
+GET /api/v1/partners/recent
+GET /api/v1/partners/channels/schema
+GET /api/v1/partners/tool-options
+GET /api/v1/partners/souls
+POST /api/v1/partners/souls
+GET /api/v1/partners/soul-sources
+GET /api/v1/partners/{partner_id}
+PATCH /api/v1/partners/{partner_id}
+POST /api/v1/partners/{partner_id}/start
+POST /api/v1/partners/{partner_id}/stop
+DELETE /api/v1/partners/{partner_id}
+POST /api/v1/partners/{partner_id}/channels/reload
+GET /api/v1/partners/{partner_id}/soul
+PUT /api/v1/partners/{partner_id}/soul
+GET /api/v1/partners/{partner_id}/assets
+POST /api/v1/partners/{partner_id}/assets
+DELETE /api/v1/partners/{partner_id}/assets/{asset_type}/{name}
+GET /api/v1/partners/{partner_id}/history
+GET /api/v1/partners/{partner_id}/sessions
+POST /api/v1/partners/{partner_id}/chat
+POST /api/v1/partners/{partner_id}/chat/execute-stream
+WS /api/v1/partners/{partner_id}/ws
```
+Partners API 由 admin 权限保护,因为 partner workspace 和 channel credentials 属于部署级资源。Secret 默认会被 mask;编辑表单只有在需要时才请求 `include_secrets=true`。
+
## Book Engine
```text
diff --git a/site/src/content/docs/zh-cn/docs/explore/book.md b/site/src/content/docs/zh-cn/docs/explore/book.md
index 9f26f2e97..75c4b5974 100644
--- a/site/src/content/docs/zh-cn/docs/explore/book.md
+++ b/site/src/content/docs/zh-cn/docs/explore/book.md
@@ -1,91 +1,49 @@
---
title: Book Engine
-description: 多 agent 流水线把你的材料编译成可交互的「活书」,13 种 block 类型。
+description: 从知识库、Notebook、Question Bank 和 Chat history 生成可交互 living books。
---
-给 DeepTutor 一个主题,让它指向你的知识库,**Book Engine** 就会产出一本结构化、可交互的书 —— 不是一份静态导出,而是一本可读、可自测、可在上下文里讨论的活书。
+Book 会把你的材料变成可交互学习内容。一本书可以从 topic 和选定 sources 开始,生成解释、quiz、视觉 blocks 和读者笔记。
-## 工作原理
+<p align="center">
+ <img src="/screenshots/book01.png" alt="Book 阅读视图" width="31%" />
+ <img src="/screenshots/book02.png" alt="Book 交互 block 视图" width="31%" />
+ <img src="/screenshots/book03.png" alt="Book 创建视图" width="31%" />
+</p>
-幕后是一条多 agent 流水线在干重活:
+## 创建流程
-1. **Outline proposal** —— 给定主题 + KB,提出章节结构
-2. **Source retrieval** —— 从 KB 中拉相关段落
-3. **Chapter tree synthesis** —— 装配层级化的章节提纲
-4. **Page planning** —— 给每页规划放哪些 block
-5. **Block compilation** —— 逐个生成 block(正文、quiz、代码、figure、……)
+1. 打开 **Book -> New book**。
+2. 选择 topic 和 sources:Knowledge Bases、Notebooks、Question Bank 或 Chat history。
+3. 编译前先 review 生成的 proposal。
+4. 让 BookEngine 生成 page plans 和 blocks。
+5. 阅读、批注、做题,或在页面旁边继续 chat。
-你始终掌控全局:review 提案、重排章节、在任意页面旁边开聊天。
+## Block 类型
-## 13 种 block 类型
+Book pages 由 typed blocks 组成:text、sections、callouts、quiz、flash cards、timeline、code、figure、interactive HTML、animation、concept graph、deep dive、user note。目标不是生成 PDF 式内容堆砌,而是一个可继续学习的环境。
-页面由 13 种 block 装配而成,每种用自己的交互组件渲染:
+## Source drift
-| Block | 说明 |
-|-------|------|
-| **Text** | 标准散文段落 |
-| **Callout** | Tip / Warning / Note / Important —— 带色边的提示框 |
-| **Quiz** | 内嵌交互题;答案与期望答复校验 |
-| **Flash cards** | 正反翻转卡,用于间隔重复 |
-| **Code** | 语法高亮的代码片段,可选可执行运行时 |
-| **Figure** | 带 caption 和 alt text 的图片 |
-| **Deep dive** | 可折叠区块,用于进阶 / 可选材料 |
-| **Animation** | Manim 渲染的视频 |
-| **Interactive demo** | 内嵌的交互式 HTML(包括用于数学的 **GeoGebra viewer**) |
-| **Timeline** | 纵向事件时间线 |
-| **Concept graph** | 展示概念间关系的迷你知识图谱 |
-| **Section** | 用于嵌套 block 的分组容器 |
-| **User note** | 给读者自己记笔记用的可编辑富文本 |
-
-## KB 指纹与漂移检测
-
-Book 的每一页都会 **对其源 KB 做指纹**。当源文档变了:
-
-- `deeptutor book health <book_id>` 会报告漂移(哪些页面已经过期)
-- `deeptutor book refresh-fingerprints <book_id>` 在你确认过变更之后清掉 stale-page 标记
-
-所以即便 KB 在持续演化,用 Book Engine 也是安全的 —— 你会知道哪一页已经和源不同步。
-
-## 在 Web UI 里使用
-
-1. 左侧栏点 **Book**
-2. **+ New book** → 选主题、挂 KB
-3. Review 并编辑生成的提纲
-4. 确认 —— 流水线开始逐页编译
-5. 打开页面,可阅读、可自测、可旁边聊天
-
-## 在 CLI 里
+Books 会记录 source fingerprints。如果知识库在编译后发生变化,可以用维护命令检查 drift:
```bash
-deeptutor book list # 工作区里所有的 book
-deeptutor book health <book_id> # KB 漂移报告
-deeptutor book refresh-fingerprints <book_id> # 把 stale 页面标记为已确认
-```
-
-health 的 JSON 输出:
-
-```json
-{
- "kb_drift": {
- "kb_name": "physics",
- "stale_pages": ["page_abc", "page_def"],
- "drift_ratio": 0.12
- },
- "log_health": {
- "last_compile": "2026-05-20T14:23:01Z",
- "errors": []
- }
-}
+deeptutor book list
+deeptutor book health <book_id>
+deeptutor book refresh-fingerprints <book_id>
```
-## 与之搭配的
+## Source 怎么选
-- **Knowledge** —— 一本书的质量取决于其 KB 的质量。从这里开始。
-- **Page 旁边的聊天** —— 每一页都有一个绑定到它的聊天 composer;可以基于页面内容追问。
-- **Notebooks** —— 把阅读 book 时的聊天要点存到 notebook,方便日后回顾。
+| Source | 适用场景 |
+| --- | --- |
+| Knowledge Base | 需要基于教材/论文的 grounded 内容。 |
+| Notebook | 已经有人工整理过的笔记或总结。 |
+| Question Bank | 想以练习题为中心组织页面。 |
+| Chat History | 想把一次辅导对话变成学习材料。 |
-## 另见
+## 相关页面
-- [**知识库**](/zh-cn/docs/explore/knowledge/) —— 搭好支撑一本书的 KB
-- [**Space → Notebooks**](/zh-cn/docs/explore/space/) —— 把 book 的讨论存下来
-- [**CLI → book commands**](/zh-cn/docs/cli/commands/)
+- [Knowledge](/zh-cn/docs/explore/knowledge/) —— 先构建文档库
+- [聊天工作台](/zh-cn/docs/explore/chat-workspace/) —— 围绕 book page 继续讨论
+- [CLI 命令](/zh-cn/docs/cli/commands/) —— book 维护命令
diff --git a/site/src/content/docs/zh-cn/docs/explore/chat-workspace.md b/site/src/content/docs/zh-cn/docs/explore/chat-workspace.md
index 91fac0ac9..cc7f79816 100644
--- a/site/src/content/docs/zh-cn/docs/explore/chat-workspace.md
+++ b/site/src/content/docs/zh-cn/docs/explore/chat-workspace.md
@@ -1,162 +1,69 @@
---
title: 聊天工作台
-description: 一个对话线程,五种模式,任意工具组合。DeepTutor 核心的统一智能工作台。
+description: DeepTutor 默认 agent loop:工具、RAG、附件、Memory、Notebook 和深层 capability 都在同一线程中运行。
---
-聊天工作台是大多数用户花时间最多的地方。它是单一的对话界面,承载 **五种模式**,共享同一个 session、知识库、附件和引用历史。
+Chat 是大多数工作开始的地方。它不是普通聊天框,而是默认 agent loop:可以调用工具、读取 source、搜索知识库、写 Notebook、向用户追问,并在同一个 session 里切换到更深的 capability。
-可以在对话中途从一个随手问的小问题切到多 agent 解题、切到 quiz、切到完整的研究报告 —— 上下文不会丢。
+![Chat 工作台](/screenshots/chat.png)
-![Chat Workspace](/screenshots/dt-current-home.png)
-
-## 界面拆解
+## 页面区域
| 区域 | 作用 |
-|------|------|
-| **左侧边栏** | 所有界面之间的导航;顶部是聊天历史 |
-| **顶部工具栏** | 把当前回合存到 Notebook、导出 Markdown、新建聊天、打开右侧的 Activity / Viewer 面板 |
-| **Composer**(中间) | 输入区 —— 模式选择器、附件、知识库选择器、Space 选择器、模型选择器 |
-| **Activity 面板** *(右侧,可切换)* | 实时流式展示流水线阶段、工具调用、耗时 |
-| **Viewer 面板** *(右侧,可切换)* | 渲染生成产物:SVG、Mermaid、Chart.js、HTML、Manim 视频 |
-
-## 五种模式
-
-能力选择器在 composer 里。随时可以切 —— 对话上下文会保留。
-
-### Chat
-
-任意工具的自由对话。默认模式 —— 大约能覆盖 80% 的问题。
-
-Chat 流水线跑的是 **agentic loop**:LLM 调用 → 解析协议标签(THINK / TOOL / FINISH)→ 并行派发工具调用 → 把结果回喂 → 迭代直到 FINISH 或触发上下文守护。
-
-**Chat 模式下可用的工具**(按当前上下文逐回合组装):
-
-| 工具 | 挂载时机 |
-|------|----------|
-| `rag` | 挂载了 KB |
-| `read_source` | 有任意非图片类源 |
-| `read_memory` / `write_memory` | 始终可用 |
-| `web_search` | 在 设置 → 工具 里开启 |
-| `web_fetch` | 始终可用 |
-| `code_execution` | 在设置里开启 |
-| `reason` | 在设置里开启 |
-| `brainstorm` | 在设置里开启 |
-| `paper_search` | 在设置里开启 |
-| `geogebra_analysis` | 挂载了数学图片 |
-| `list_notebook` / `write_note` | 至少存在 1 个 notebook |
-| `github_query` | 始终可用 |
-| `ask_user` | 始终可用 |
-
-### Solve
-
-多步解题:plan → investigate → solve → verify,并附精确的来源引用。基于 `deep_solve` agentic 引擎。
-
-适用场景:需要分步演算的数学题、有多个子问题的物理题、推理过程需要显式展开的算法题。
-
-常开工具:`rag`、`reason`、`code_execution`、`web_search`。
-
-### Quiz
-
-基于 KB 自动校验的出题。会为每道题派生一个聊天 composer,用于讨论 / 提示 / 评分。基于 `deep_question` agentic 引擎。
-
-Quiz 内部三种子模式:
-
-- **Custom** *(默认)* —— 按主题生成
-- **Mimic** —— 上传一份历史试卷,按同样风格生成新题
-- **Followup** —— 围绕之前的 quiz 题讨论,不生成新题
-
-可配置:`num_questions`、`difficulty`、`question_types`(short_answer / mcq / numerical / code)、`per_type_counts`。
+| --- | --- |
+| **左侧栏** | 主界面:Chat、Partners、Co-Writer、Book、Knowledge、Space、Memory、Settings。Recents 可恢复历史 session。 |
+| **Composer** | 输入框、capability 选择、文件/上下文附件、persona、模型选择和发送按钮。 |
+| **Activity panel** | 工具调用、中间进度、source 预览和生成 artifact。 |
+| **Notebook / Markdown 操作** | 把重要 turn 保存到 Notebook,或导出整个 session 为 Markdown。 |
-### Research
+## Agent loop
-把一个主题分解成子主题,跨 RAG / web / arXiv **并行派发 agent**,产出一份带引用的报告,并支持增量 append 模式的迭代修订。
+![Chat agent loop](/screenshots/chat-agent-loop.png)
-流程:
+一次 turn 可能有多轮:
-1. **Rephrasing** —— 精确复述你的问题
-2. **Decomposing** —— 给出一个 3–7 子主题的提纲 ★(你在这一步确认 / 修改)
-3. **Researching** —— 每个子主题跑并行 agentic loop
-4. **Reporting** —— 合成结构化、带引用的 Markdown 报告
+1. 模型先生成回答或工具计划。
+2. 如果需要工具,DeepTutor 执行工具并把 observation 写回上下文。
+3. 模型基于证据继续。
+4. 最后一轮不再调用工具时,输出最终答案。
-提纲确认这一步是最关键的 UX 设计:在昂贵的检索 / 推理跑起来之前,你有机会先把方向定准。
+`ask_user` 是特殊工具:它会暂停 turn,提出结构化澄清问题,等你回答后继续。
-### Visualize
+## Chat 里可启动的能力
-统一的可视化能力 —— analyzer 根据意图选 `render_type`:
+| Capability | 适合做什么 |
+| --- | --- |
+| `chat` | 普通答疑、开放对话、轻量工具调用。 |
+| `deep_solve` | 分步解题、复杂推理、验证。 |
+| `deep_question` | 生成练习题、quiz、mimic-source。 |
+| `deep_research` | 拆分子问题,结合 RAG/web/arXiv 生成带引用报告。 |
+| `visualize` | SVG、Chart.js、Mermaid、HTML,以及路由到动画输出。 |
+| `math_animator` | 以 Manim 为核心的数学动画工作流。 |
+| `auto` | 让 DeepTutor 自动选择 capability。 |
+| `mastery_path` | 学习路径与掌握度规划。 |
-| Render type | 适用 | 输出 |
-|-------------|------|------|
-| `svg` | 静态图、图标 | 内嵌 SVG |
-| `chartjs` | 柱状 / 折线 / 饼 / 散点 | 可交互 canvas |
-| `mermaid` | 流程图、序列图、状态机 | Mermaid SVG |
-| `html` | 交互演示、小应用 | 沙箱化 iframe |
-| `manim_video` | 数学动画 | MP4(需要 `[math-animator]` extra) |
-| `manim_image` | 数学分镜 | PNG |
+## 工具
-> Math Animator **不是独立的 capability** —— 它就是 Visualize 六种 render type 里的两种(`manim_video` / `manim_image`)。
+Settings 里用户可切换的工具是 `brainstorm`、`web_search`、`paper_search`、`reason`。按上下文自动挂载的工具包括:`rag`、`read_source`、`read_memory`、`write_memory`、`read_skill`、`load_tools`、`exec`、`web_fetch`、`ask_user`、`list_notebook`、`write_note`、`github`。
-## 累积的来源清单
+## 实用例子
-一个 session 会跨回合累积引用。早些回合的 RAG / web 检索结果在同一段对话里后续依然可复用 —— 模型可以按编号引用。
-
-## 附件
-
-点 **Attach** 把文件带进当前回合:
-
-| 类型 | 来源 |
-|------|------|
-| **PDF、DOCX、XLSX、PPTX** | 直接上传 —— 走对应的 extractor |
-| **图片** | 直接上传 —— vision 模型 OCR / 解读 |
-| **Notebook 记录** | Space → Notebooks 选择器 |
-| **历史 session** | Space → Chat History 选择器 |
-| **Question Bank 条目** | Space → Question Bank 选择器 |
-| **Book 引用** | Book Engine 页面 |
-
-附件 **不会** 塞进 system prompt —— 它们以 **工具可读的源** 的形式出现。需要时模型用 `read_source` 拉全文。
-
-## 右上角动作
-
-| 按钮 | 作用 |
-|------|------|
-| **Save to Notebook** | 把当前回合作为一条记录存到某个 notebook |
-| **Download Markdown** | 把当前回合导出为 `.md` |
-| **New chat** | 新建一个 session |
-| **Activity** | 实时流式展示流水线事件(阶段、工具调用、耗时) |
-| **Viewer** | 渲染生成产物(SVG、Mermaid、Chart.js、HTML、Manim) |
-
-## 回合中的 `ask_user`
-
-如果模型需要澄清,它会调 `ask_user` 工具,**暂停当前回合**,在聊天里渲染 1–3 个结构化问题。回答后点提交,回合带着你的回答继续。
-
-## Session 连续性
-
-每段对话都有 session id。Session 会跨:
+```text
+挂载一个 KB 后问:"Explain chapter 4 and quiz me on the weak spots."
+```
-- 浏览器刷新 / 重启
-- 同一 session 内的模式切换
-- Web UI ↔ CLI 边界
+```text
+上传 PDF 后问:"Extract the assumptions and save the final summary to my notebook."
+```
```bash
-# 在 CLI 里继续 Web 端的 session
-deeptutor chat --session sess_abc123
+deeptutor run chat "Explain Fourier transform" --tool rag --kb signals
+deeptutor chat --capability deep_research --kb papers
```
-CLI 里起的 session 也会出现在 Web 侧边栏(反之亦然)。
-
-## 记忆感知
-
-模型通过 `read_memory` 工具内置访问你的 L3 记忆。几次 session 之后,它就会知道:
-
-- 你的背景(`profile.md`)
-- 你的知识范围(`scope.md`)
-- 你明确表达过的偏好(`preferences.md`)
-- 最近学了什么(`recent.md`)
-
-完整的三层架构看 [**记忆系统**](/zh-cn/docs/explore/memory/)。
-
-## 另见
+## 相关页面
-- [**记忆系统**](/zh-cn/docs/explore/memory/) —— 三层持久化记忆 + Memory Graph
-- [**知识库**](/zh-cn/docs/explore/knowledge/) —— 可直接被 RAG 使用的 Knowledge Base
-- [**Space**](/zh-cn/docs/explore/space/) —— 阅读 / 回顾 中心
-- [**设置**](/zh-cn/docs/explore/settings/) —— provider、工具、capability
+- [Partners](/zh-cn/docs/explore/partners/) —— 同一个 loop 接入 IM 伙伴
+- [Knowledge](/zh-cn/docs/explore/knowledge/) —— 为 Chat 提供 RAG grounding
+- [Memory](/zh-cn/docs/explore/memory/) —— 可审计的个性化记忆
+- [CLI](/zh-cn/docs/cli/) —— 从终端运行同样的 turn
diff --git a/site/src/content/docs/zh-cn/docs/explore/co-writer.md b/site/src/content/docs/zh-cn/docs/explore/co-writer.md
index 02db8cc96..7d3d8956d 100644
--- a/site/src/content/docs/zh-cn/docs/explore/co-writer.md
+++ b/site/src/content/docs/zh-cn/docs/explore/co-writer.md
@@ -1,125 +1,51 @@
---
-title: Co-Writer 协同写作
-description: AI 作为一等公民协作者的 Markdown 编辑器 —— Edit Agent、Narrator Agent、文档模板。
+title: Co-Writer
+description: 支持选区 AI 编辑的 Markdown 工作台,编辑可基于 KB 或 Web 上下文。
---
-**Co-Writer** 是 DeepTutor 围绕 AI 协作设计的 Markdown 编辑器。内置两个 AI agent:
+Co-Writer 是面向笔记、报告、教程和学习草稿的 Markdown 工作台。它把 source editor 和实时 preview 放在一起,让 agent 只编辑你选中的文本,而不是整篇重写。
-- **Edit Agent** —— 改写选中文本(rewrite、扩写、压缩、改风格)
-- **Narrator Agent** —— 生成新内容(接着写、把提纲填成正文、解释某个概念)
+## 打开方式
-外加文档模板、版本历史,以及与知识库的集成。
+从侧边栏打开 **Co-Writer**,或访问 `/co-writer`。可以新建空白 draft,也可以从 sample template 开始。
-## 打开 Co-Writer
+## 编辑器模型
-点左侧导航的 **Co-Writer**,或访问 `/co-writer`。第一次进来会看到文档选择器。选 **+ New document** 从零开始,或打开一个最近的。
+![Co-Writer 编辑器:左侧 Markdown 源码,右侧实时预览](/screenshots/co-writer.png)
-## 编辑器
+工作区是双栏视图:左侧写 Markdown 源码,右侧实时渲染 preview,格式工具栏在编辑区上方。在源码区选中文本即可唤出 AI 编辑入口(`rewrite`、`expand`、`shorten`),不需要离开文档。
-标准 Markdown 编辑器,双栏:
+| 部分 | 作用 |
+| --- | --- |
+| **Document list** | 创建、打开、重命名、删除 Markdown drafts。 |
+| **Source editor** | 写 Markdown、表格、代码、数学公式、Mermaid 风格图和结构化笔记。 |
+| **Preview pane** | 实时渲染文档。 |
+| **Selection popover** | 选中文本后执行 `rewrite`、`expand`、`shorten`。 |
+| **Save to Notebook** | 把完成的 draft 保存为可复用上下文。 |
-| 栏 | 内容 |
-|----|------|
-| **左** | Markdown 源码 —— 输入、编辑、格式化 |
-| **右** | 渲染预览(可关掉以全宽看源码) |
+## AI 编辑
-快捷键:
+Edit agent 会收到选中文本、你的指令、可选 KB 上下文、可选 Web 上下文和周围文档内容。因此它适合:
-| 键 | 动作 |
-|----|------|
-| `⌘B` / `Ctrl+B` | 加粗 |
-| `⌘I` / `Ctrl+I` | 斜体 |
-| `⌘K` / `Ctrl+K` | 插入链接 |
-| `⌘S` / `Ctrl+S` | 保存(其实一直在自动保存) |
-| `⌘/` / `Ctrl+/` | 切换 AI 侧栏 |
+- 在不改变章节结构的情况下润色解释,
+- 把简短笔记扩成教程段落,
+- 把长草稿压缩成 Notebook 可复用摘要,
+- 让某个论断基于选定知识库重新表述。
-## AI 侧栏
+## 推荐流程
-用 `⌘/` 打开。两个 tab:
+1. 先用 Markdown 粗写。
+2. 只选中需要帮助的段落。
+3. 用 **Rewrite**、**Expand** 或 **Shorten**。
+4. 继续写之前先人工检查结果。
+5. 定稿后保存到 Notebook,成为长期上下文。
-### Edit(基于选区)
+## 存储
-在编辑器里选中文本,挑一个 Edit 动作:
+Co-Writer 文档位于当前用户 workspace 下;多用户部署里各用户 draft 隔离。Partners 可以使用复制过去的 notebooks/skills,但不会直接编辑用户的 Co-Writer drafts。
-| 动作 | 作用 |
-|------|------|
-| Rewrite | 同义改写 |
-| Expand | 补细节、补背景、补例子 |
-| Condense | 压缩,但保留要点 |
-| Change tone | 正式 / 口语 / 学术 / 友好 |
-| Fix grammar | 仅做轻微润色 |
-| Translate | 翻译成另一种语言 |
+## 相关页面
-Edit Agent 会用结果替换选中文本。`⌘Z` 可撤销。
-
-### Narrator(基于光标)
-
-把光标放到你想生成新内容的位置,然后:
-
-| 动作 | 作用 |
-|------|------|
-| Continue | 从这里接着写 |
-| Fill outline | 把你的项目符号提纲展开成正文 |
-| Explain | 给上一段加一段解释 |
-| Cite from KB | 去挂载的 KB 里查点东西并附引用 |
-
-Narrator Agent 会在光标处插入内容。
-
-## 挂载上下文
-
-和 Chat 一样,Co-Writer 也能挂上下文:
-
-- **知识库** —— Narrator 生成时可以从你的 KB 里取材
-- **历史 session** —— 引用之前的 Chat / Research 回合
-- **Notebook 记录** —— 从存好的片段里取
-
-点 AI 侧栏的回形针图标。
-
-## 模板
-
-DeepTutor 自带几个示例模板:
-
-| 模板 | 适用 |
-|------|------|
-| Research memo | 多源综合写作,带引用 |
-| Lecture notes | 提纲 + 展开的小节 |
-| Problem set solutions | 带代码块的题解 |
-| Reading log | 一篇 paper / 一章一条记录 |
-
-新建文档时挑一个。模板会预填好结构,里面的 prompt 提示也是 agent 能上下文理解的。
-
-## 嵌入其他 capability 的产物
-
-可以直接把 DeepTutor 其他 capability 的结果嵌进文档:
-
-- **Deep Solve 结果** → 把解答拖到 Co-Writer
-- **Visualize 产物** → 内嵌为 SVG / Mermaid 块
-- **Quiz** → 内嵌为可展开的 details 块
-
-## 保存与导出
-
-文档每几秒自动保存。手动导出选项:
-
-- **Download .md** —— 原始 Markdown
-- **Download .pdf** —— 通过 Pandoc 渲染
-- **Copy to clipboard** —— 粘到其他工具里
-
-## 版本历史
-
-点右上的时钟图标看版本历史。Co-Writer 会保留:
-
-- 最近 24 小时的全部保存
-- 最近 7 天的小时级快照
-- 永久保留的天级快照
-
-一键回滚到任意历史版本。
-
-## 多用户须知
-
-多用户模式下,每位用户有自己独立的 Co-Writer 文档空间。共享功能在路线图上(关注 [issue #498](https://github.com/HKUDS/DeepTutor/issues/498))。
-
-## 另见
-
-- [**知识库**](/zh-cn/docs/explore/knowledge/) —— 挂 KB 拿到 ground-truth 引用
-- [**聊天工作台**](/zh-cn/docs/explore/chat-workspace/) —— 跑 Visualize / Research,把产物带进文档
-- [**Space**](/zh-cn/docs/explore/space/) —— 保存并复用持久化产物
+- [聊天工作台](/zh-cn/docs/explore/chat-workspace/) —— 生成素材并保存有用 turn
+- [Space](/zh-cn/docs/explore/space/) —— 管理 notebooks、skills 和 personas
+- [Knowledge](/zh-cn/docs/explore/knowledge/) —— 为编辑提供 grounded context
diff --git a/site/src/content/docs/zh-cn/docs/explore/index.md b/site/src/content/docs/zh-cn/docs/explore/index.md
index abfe35ac2..e9f78dca3 100644
--- a/site/src/content/docs/zh-cn/docs/explore/index.md
+++ b/site/src/content/docs/zh-cn/docs/explore/index.md
@@ -1,36 +1,32 @@
---
title: 概览
-description: 探索章节的地图 —— 五大核心界面、三层记忆系统、统一的设置中心。
+description: 探索章节地图 —— Chat、Partners、Co-Writer、Book、Knowledge、Space、Memory、Settings。
---
-DeepTutor 围绕 **五大核心界面**、贯穿底层的 **三层记忆系统**,以及统一的 **设置中心** 组织。本章节会逐个介绍;下表是地图。
+DeepTutor 由一组彼此连通的学习界面组成,它们共享同一套 agent-native runtime。本章节先介绍用户每天会用到的界面,再解释底层的资源库、记忆和控制面。
-![DeepTutor 主页](/screenshots/dt-current-home.png)
+![Chat 工作台](/screenshots/chat.png)
-## 五大核心界面
+## 产品地图
| # | 界面 | 一句话 | 页面 |
|---|------|--------|------|
-| 1 | **Chat** | 一个对话线程,五种模式(Chat / Solve / Quiz / Research / Visualize),任意工具组合 | [**聊天工作台**](/zh-cn/docs/explore/chat-workspace/) |
-| 2 | **Co-Writer** | 双栏 Markdown 工作台,AI 作为一等公民协作者 | [**Co-Writer**](/zh-cn/docs/explore/co-writer/) |
-| 3 | **Book** | 多 agent 流水线把你的材料编成可交互的「活书」 | [**Book Engine**](/zh-cn/docs/explore/book/) |
-| 4 | **Knowledge** | 带版本管理的、可直接被 RAG 使用的文档库(端到端 LlamaIndex 实现) | [**知识库**](/zh-cn/docs/explore/knowledge/) |
-| 5 | **Space** | 阅读 / 回顾 中心:Chat History、Notebook、Question Bank、Skills | [**Space**](/zh-cn/docs/explore/space/) |
-
-## 此外
-
-| 界面 | 一句话 | 页面 |
-|------|--------|------|
-| **Memory** | 三层流水线(L1 trace / L2 per-surface / L3 cross-surface)+ Memory Graph | [**记忆系统**](/zh-cn/docs/explore/memory/) |
-| **Settings** | 统一控制台 —— 模型、Embedding、搜索、Capability、工具、记忆、MCP、外观、状态 | [**设置**](/zh-cn/docs/explore/settings/) |
+| 1 | **Chat** | 默认 agent loop:工具、RAG、附件、Notebook 写入和深层 capability 都在同一线程里 | [**聊天工作台**](/zh-cn/docs/explore/chat-workspace/) |
+| 2 | **Partners** | 拥有独立 soul、资源库和渠道的 IM 持久伙伴 | [**Partners 伙伴**](/zh-cn/docs/explore/partners/) |
+| 3 | **Co-Writer** | 支持选区 AI 编辑的 Markdown 编辑器,可接入 KB 或 Web 上下文 | [**Co-Writer**](/zh-cn/docs/explore/co-writer/) |
+| 4 | **Book** | 把你的材料编译成可交互的 living books | [**Book Engine**](/zh-cn/docs/explore/book/) |
+| 5 | **Knowledge** | 基于 LlamaIndex 的版本化 RAG 文档库 | [**知识库**](/zh-cn/docs/explore/knowledge/) |
+| 6 | **Space** | Skills、personas、notebooks、history 和可复用上下文资产 | [**Space**](/zh-cn/docs/explore/space/) |
+| 7 | **Memory** | L1 trace、L2 per-surface facts、L3 cross-surface synthesis 和图谱审计 | [**Memory**](/zh-cn/docs/explore/memory/) |
+| 8 | **Settings** | 模型、Embedding、搜索、工具、MCP、网络、记忆和运行时控制 | [**Settings**](/zh-cn/docs/explore/settings/) |
## 它们如何组合
-- **能力住在 Chat 里**:Solve / Quiz / Research / Visualize 不是单独的顶层 Tab,而是你在 Chat 里随时切换的「模式」,共享同一个 session、知识库、附件和引用历史。
-- **工具与流程解耦**:内置工具(RAG、网页搜索、代码执行、reason、brainstorm、paper 搜索、`ask_user`、`web_fetch`、`write_note`、`list_notebook`、`github_query`)可以叠加在任何模式之上。在设置里加 MCP server 还能继续扩展。
-- **Memory 是底层 Substrate**:每个界面都读写同一份三层记忆,所以你在 Chat 里学到的东西也会出现在 Co-Writer、TutorBot 对话、Book 阅读里。
-- **Session 横跨界面**:Web 启动的 session 在 CLI 里看得到(反之亦然);一段聊天可以存到 Notebook、挂在 Book 页面下,或者被 Co-Writer 引用。
+- **Chat 是默认 loop。** `chat`、`deep_solve`、`deep_question`、`deep_research`、`visualize`、`math_animator`、`auto`、`mastery_path` 都运行在同一个 orchestrated runtime 上。
+- **Partners 复用 Chat,而不是另一套 bot engine。** 一条 partner 消息会进入 `data/partners/<id>/workspace/` 作用域里的 chat turn。
+- **工具按上下文挂载。** 用户可切换工具是 `brainstorm`、`web_search`、`paper_search`、`reason`;上下文工具包括 RAG、source reading、memory、skills、notebooks、URL fetch、GitHub、ask-user 和 sandboxed execution。
+- **Memory 可审计。** Workbench 和 graph 可以把综合事实一路追溯到 L2 summaries 和原始 L1 events。
## 下一步
-从 [**聊天工作台**](/zh-cn/docs/explore/chat-workspace/) 开始 —— 多数用户大约 80% 的时间花在这里。从命令行角度,看 [**CLI 概览**](/zh-cn/docs/cli/)。
+先读 [**聊天工作台**](/zh-cn/docs/explore/chat-workspace/) 理解核心交互模型;如果想把 DeepTutor 接到 IM 渠道,再读 [**Partners 伙伴**](/zh-cn/docs/explore/partners/)。
diff --git a/site/src/content/docs/zh-cn/docs/explore/knowledge.md b/site/src/content/docs/zh-cn/docs/explore/knowledge.md
index 71d878bb8..8fe063f03 100644
--- a/site/src/content/docs/zh-cn/docs/explore/knowledge.md
+++ b/site/src/content/docs/zh-cn/docs/explore/knowledge.md
@@ -1,131 +1,47 @@
---
-title: 知识库
-description: 专为驱动 RAG 的文档集合而设的工作区。端到端 LlamaIndex 实现,版本化索引,抗漂移。
+title: Knowledge Bases 知识库
+description: 基于 LlamaIndex 的版本化文档库,用于 RAG、Chat、Co-Writer、Book 和 Partners。
---
-一个专门管理驱动 RAG 的文档集合的工作区。每个 KB 是一份对你文档的版本化、可检索的索引 —— 可挂到任意聊天回合、Co-Writer 文档或 Book。
+Knowledge Bases 是 RAG 背后的文档库,可以为 Chat turn、Co-Writer 编辑、Book 生成和 Partner 对话提供 grounding。
-![Knowledge Workspace](/screenshots/dt-knowledge.png)
+![Knowledge 工作台](/screenshots/knowledge.png)
-## 每个 KB 四个 tab
+## KB 包含什么
-| Tab | 内容 |
-|-----|------|
-| **Files** | 浏览已上传的源、在线预览 PDF、看每个文件的大小 / 状态 |
-| **Add documents** | 拖入 PDF、Office 文件(DOCX / XLSX / PPTX)、Markdown、纯文本以及一大票代码 / 数据格式 —— 自动走对应的 extractor |
-| **Index versions** | 每次(重新)建索引都是一个被追踪的版本。可以回滚到旧版、对比不同 embedding 模型、查看 chunking 统计 —— 不会丢掉之前的 build |
-| **Settings** | 选 embedding provider / 模型、chunking 参数、reranker。默认值从全局 LLM 和 embedding profile 继承 |
+| 区域 | 作用 |
+| --- | --- |
+| **Files** | 源文档与解析状态。 |
+| **Add documents** | 上传 PDF、Office 文件、Markdown、文本、代码和数据文件。 |
+| **Index versions** | 基于 embedding signature 的 flat `version-N` LlamaIndex storage。 |
+| **Settings** | Embedding model、chunking 和检索相关参数。 |
-## 端到端基于 LlamaIndex
+## 版本模型
-索引部分端到端基于 **LlamaIndex**。之前的双流水线拆分在 v1.4 refactor 中合并掉了。特性:
+Re-index 会写入新的 `version-N` 目录,并保留旧版本。这样 rebuild 时不会覆盖当前可用 index。旧版本应理解为保留历史和 fallback storage;除非你的部署显式暴露相关操作,不要把它描述成完整的用户可见 rollback workflow。
-- **可重试的 re-index** —— 部分失败不会丢进度
-- **Embedding 不匹配检测** —— 换了 embedder 时会先警告,避免静默产出坏结果
-- **健壮的持久化向量处理** —— 损坏向量会被隔离,而不是整体崩
-- **版本化索引** —— 每次重建都是新版本,可对比、可回滚
-
-## 支持的文档类型
-
-| 类型 | 说明 |
-|------|------|
-| **PDF** | 文本抽取;扫描页尽力 OCR |
-| **DOCX** | 原生 Word 文档 |
-| **XLSX** | 表格 —— 每个 sheet 作为一个 chunk batch |
-| **PPTX** | PowerPoint —— 每张幻灯片作为一个 chunk |
-| **TXT / MD / HTML** | 清洗并切片 |
-| **代码文件** | Python / JS / TS / Go / Rust 及大量其他语言 |
-
-## 创建一个 KB
-
-在 UI 里:
-
-1. 左侧栏 **Knowledge** → **+ New knowledge base**
-2. 起名,选 RAG provider *(默认 LlamaIndex)*
-3. 上传文档 —— 拖拽或文件选择器
-4. **Create**
-
-DeepTutor 会抽取、切片、对每个 chunk 做 embedding,并存好向量索引。一个 200 页的 PDF 通常 1–3 分钟。
-
-## 默认 KB
-
-打了 ⭐ 的 KB 是 **默认 KB** —— 新建聊天时会自动挂上。点星号可切换默认 KB。
-
-## 索引版本
-
-每次(重新)建索引都会被追踪:
-
-- **回滚** —— 重建后检索质量变差时可以还原旧版
-- **对比** —— 对同样的源文档做不同 embedding 模型 / chunking 策略的 A/B
-- **检查** —— chunking 统计、embedding 维度、建索引耗时
-
-## 在 UI 里搜索
-
-KB 内部的搜索框跑的是临时 query。三种模式:
-
-| 模式 | 算法 |
-|------|------|
-| **Hybrid** *(默认)* | 语义 embedding + BM25 关键词重排 |
-| **Vector** | 纯 embedding |
-| **Keyword** | 纯 BM25 |
-
-## 在聊天里搜索
-
-在 composer 里挂上 KB,自然提问就行 —— 模型自己决定要不要调 `rag`:
-
-```text
-You> [KB: physics attached] What's the relationship between kinetic energy and momentum?
-
-Model> [calls rag tool]
- ● rag_search(query="kinetic energy momentum relationship", kb_name="physics")
- │ KE = p²/(2m), where p is momentum and m is mass...
- └ #1 rag
-
-Model> [synthesizes a reply citing the retrieved passages]
-```
-
-## 多 KB 工作流
-
-一个回合可以挂多个 KB。模型会并行查询。适合「对比两本教材」「在多篇 paper 里找同一概念」之类的任务。
-
-## CLI 镜像
+## CLI 对应命令
```bash
-deeptutor kb list # 所有 KB
-deeptutor kb info physics # KB 详情
-deeptutor kb create physics --doc chapter1.pdf # 创建
-deeptutor kb create textbooks --docs-dir ./pdfs/ # 从目录创建
-deeptutor kb add physics --doc chapter3.pdf # 增量添加
-deeptutor kb search physics "What is angular momentum?" # 临时检索
-deeptutor kb set-default physics # 设为默认
-deeptutor kb delete physics --force # 删除
+deeptutor kb list
+deeptutor kb info physics
+deeptutor kb create physics --doc chapter1.pdf
+deeptutor kb create textbooks --docs-dir ./pdfs
+deeptutor kb add physics --doc chapter2.pdf
+deeptutor kb search physics "What is angular momentum?"
+deeptutor kb set-default physics
+deeptutor kb delete physics --force
```
-完整 flag 参考看 [**Commands**](/zh-cn/docs/cli/commands/)。
-
-## Embedding provider
-
-Embedder 在 **设置 → Embedding** 里全局配置。新 KB 会继承当前值;已有的 KB 会保留它创建时的 embedder,直到被重新索引。
-
-| Provider | 说明 |
-|----------|------|
-| OpenAI | `text-embedding-3-small`(1536d) / `-large`(3072d) |
-| Cohere | `embed-v4.0` |
-| Jina | `jina-embeddings-v3` |
-| Gemini | `gemini-embedding-001` |
-| SiliconFlow | `Qwen/Qwen3-Embedding-8B` |
-| Aliyun DashScope | `qwen3-vl-embedding` |
-| Ollama | 本地 embedding 模型 |
-| vLLM / LM Studio / OpenAI 兼容 | 自定义 embedding endpoint |
-
-完整 provider 矩阵:[**Providers**](/zh-cn/docs/get-started/providers/)。
-
-## 多用户
+## 建议
-多用户部署下,KB 按用户隔离。管理员可以在 `/admin/grants` 授予跨用户访问权限(read / read+search / read+search+modify)—— 见 [**多用户部署**](/zh-cn/docs/get-started/multi-user/)。
+- 创建正式 KB 前,先配置 embedding provider。
+- 更换 embedding model 后应 re-index,不要混用向量空间。
+- 保留一个小 KB 用于 Partner/channel smoke test。
+- Docker 部署要持久化整个 `data/`,否则 KB versions 会随容器丢失。
-## 另见
+## 相关页面
-- [**聊天工作台**](/zh-cn/docs/explore/chat-workspace/) —— 把 KB 挂到聊天回合
-- [**Book Engine**](/zh-cn/docs/explore/book/) —— 书是从 KB 编译出来的
-- [**记忆系统**](/zh-cn/docs/explore/memory/) —— KB 装的是文档,memory 装的是对话
+- [聊天工作台](/zh-cn/docs/explore/chat-workspace/) —— 把 KB 挂到 turn 上
+- [Book Engine](/zh-cn/docs/explore/book/) —— 从 KB 编译学习材料
+- [Partners](/zh-cn/docs/explore/partners/) —— 把 KB 复制进 partner workspace
diff --git a/site/src/content/docs/zh-cn/docs/explore/memory.md b/site/src/content/docs/zh-cn/docs/explore/memory.md
index 9a9507890..5b8be6bda 100644
--- a/site/src/content/docs/zh-cn/docs/explore/memory.md
+++ b/site/src/content/docs/zh-cn/docs/explore/memory.md
@@ -1,172 +1,47 @@
---
-title: 记忆系统
-description: 三层流水线(L1 / L2 / L3)、一个可审视的 workbench,以及 Memory Graph —— 审计 DeepTutor 「为什么知道它知道的事」。
+title: Memory 记忆系统
+description: 通过 L1 trace、L2 surface summaries、L3 synthesis 和 Memory Graph 实现可审计个性化。
---
-DeepTutor 的记忆是一条 **三层流水线**,在 `/memory` 配套一个可审视的 workbench。v1 的双文件 `SUMMARY.md` / `PROFILE.md` 模型已经退役;所有内容会在首次启动时迁移到新结构。
+Memory 是 DeepTutor 的可审计个性化系统。它不是隐藏的向量库,而是一个文件化的三层 pipeline,可以查看、编辑、审计。
-![Memory Workbench](/images/dt-memory.png)
+![Memory workbench](/screenshots/memory-workbench.png)
-## 三层
+## 三层结构
-| 层 | 角色 | 存储 |
-|----|------|------|
-| **L1 · 工作区镜像** *(LIVE)* | 按 surface、按天的 append-only 交互轨迹。真实发生过什么的无损记录。 | `trace/<surface>/<YYYY-MM-DD>.jsonl` |
-| **L2 · 按 surface 摘要** *(CURATED)* | 由 consolidator 抽取出的、surface 专属的事实。每条事实都带 footnote 引用回到 L1 trace。支持按文档的 **Update / Audit / Dedup** 操作。 | `L2/<surface>.md` |
-| **L3 · 跨 surface 知识** *(SYNTHESIS)* | 跨 surface 合成:你的 `profile`、`recent` 时间线、`scope` 知识范围、`preferences` 偏好。每条带保留态度(hedged)的陈述都有 L2 证据支撑。 | `L3/{recent,profile,scope,preferences}.md` |
+![Memory 概览页:L1、L2、L3 三层卡片](/screenshots/memory.png)
-## 七个 surface 喂养这条流水线
+Memory 概览页一眼看全三层 —— 实时 L1 traces、按 surface 精炼的 L2 facts、跨 surface 综合的 L3 knowledge —— 以及 Memory graph 入口。点击任意层级卡片即可查看或整理。
-| Surface | L1 捕获什么 |
-|---------|-------------|
-| `chat` | 每个聊天回合(输入、工具调用、输出) |
-| `notebook` | Notebook 的增 / 改 / 删 |
-| `quiz` | Quiz 生成 + 你的答案 + 评分结果 |
-| `kb` | KB 的创建 / 查询 / 索引事件 |
-| `book` | Book 阅读 session、页面级交互 |
-| `tutorbot` | TutorBot 消息(跨所有 channel) |
-| `cowriter` | Co-Writer 的文档编辑 |
+| 层级 | 存储 | 作用 |
+| --- | --- | --- |
+| **L1 trace** | `trace/<surface>/<YYYY-MM-DD>.jsonl` | Append-only 原始事件。 |
+| **L2 surface facts** | `L2/<surface>.md` | 每个 surface 的精炼事实,并引用回 L1。 |
+| **L3 synthesis** | `L3/<recent|profile|scope|preferences>.md` | 跨 surface 综合,用于个性化。 |
-## Consolidator
+支持的 surfaces 是 `chat`、`notebook`、`quiz`、`kb`、`book`、`tutorbot`、`cowriter`。`tutorbot` 这个 surface 名称为兼容旧 memory 数据保留;产品层面的持久伙伴已经是 Partners。
-Consolidator 是 **LLM 驱动** 的,异步运行(`POST /memory/runs/start` —— 也可从 workbench 触发)。你可以:
-
-- **手动触发** —— 在 workbench 点 "Run consolidator"
-- **看着 L1 → L2 → L3 流动** —— 实时进度流
-- **手动编辑任意层** —— 你的编辑在下一次运行时会被合并
-
-默认节奏(可在 **设置 → 记忆** 里调):
-
-| Pass | 触发时机 |
-|------|----------|
-| L1 → L2(按 surface) | 该 surface 每 N 个回合,或被触发时 |
-| L2 → L3 跨 surface | 每天的第一个回合,或按需 |
-
-## Memory Workbench(Web UI)
-
-打开 `/memory`。五个子视图:
-
-| Tab | 路由 | 内容 |
-|-----|------|------|
-| **L3** | `/memory/l3` *(默认)* | 四份跨 surface 文档 |
-| **L2** | `/memory/l2` | 七份按 surface 文档 |
-| **L1** | `/memory/l1` | 按 surface、按天的原始事件轨迹 |
-| **Graph** | `/memory/graph` | Memory Graph(见下文) |
-| **Resolve** | `/memory/resolve` | 通过 footnote id 反查源事件 |
-
-## L3 详解
-
-四份 markdown:
-
-| 文件 | 内容 |
-|------|------|
-| `recent.md` | 近期学习的滚动摘要(最近几天 / 几周)—— 你在学什么、还有什么悬而未决 |
-| `profile.md` | 你是谁:背景、目标、角色、学习风格 |
-| `scope.md` | 你接触过的主题以及大致的掌握度 |
-| `preferences.md` | 明确偏好:回复用什么语言、深度、格式、先举例还是先讲理论 |
-
-**只有 `preferences.md` 由模型直接写**(通过 `write_memory` 工具)。另外三份由 consolidator agent 维护;你的手动编辑会在下一次 pass 时被合并进来。
-
-## L2 详解
-
-七份文档,每个 surface 一份。每份都是带 **footnote 风格引用** 的结构化 markdown,比如 `[^abc123]`,会链回具体的 L1 事件。
-
-Workbench 中每份文档支持:
-
-- **Update** —— 对该 surface 最近的 L1 事件重跑一次 consolidation
-- **Audit** —— LLM 检查 L2 中过期、相互矛盾或没有依据的陈述
-- **Dedup** —— 合并近似重复的要点
-
-## L1 详解
-
-按 surface、按天的 JSONL:
-
-```jsonl
-{"id":"evt_001","timestamp":"2026-05-21T14:23:01Z","surface":"chat","kind":"turn","content":"User asked about the chain rule"}
-{"id":"evt_002","timestamp":"2026-05-21T14:23:18Z","surface":"chat","kind":"tool_call","content":"rag_search"}
-{"id":"evt_003","timestamp":"2026-05-21T14:24:38Z","surface":"chat","kind":"turn_complete","content":"Explained with worked example"}
-```
-
-L1 直接看通常用处不大 —— 但 L2 的 footnote 会引用这些 id,而 **Resolve** 视图能让你从 footnote 反查到源。
+概览页把 L1 呈现为 **workspace mirror**:在原始 trace 之外,DeepTutor 还为每个 surface 保留一份实时工作区 snapshot,点 Refresh 会把变化记录进 L1。
## Memory Graph
-![Memory Graph](/images/dt-memgraph.png)
-
-`/memory/graph` 上的 **Memory Graph** 把 **三层一次性渲染** 出来:
-
-- **中心** —— L3 合成节点(`profile`、`recent`、`scope`、`preferences`)
-- **中圈** —— 按 surface 的 L2 事实
-- **外圈** —— 按 surface 分组的 L1 trace
-
-悬停任意节点会有内联预览。点击 **锁定高亮**,然后沿 L3 → L2 → L1 一路向内追引用 —— 这样你就能审计 DeepTutor「为什么知道」关于你的某件事。
-
-这是杀手特性:**透明可追溯**。DeepTutor 关于你的每一条断言,你都能钻进去看依据。
-
-## 聊天怎么读 memory
-
-每个聊天回合开始时,system prompt 里会拼接 L3 的几份文档:
-
-```text
-─── User profile (from memory) ─────────────────────────────────────
-[recent.md content]
-
-[profile.md content]
+![Memory graph](/screenshots/memory-graph.png)
-[scope.md content]
+Graph view 可以把一个 L3 高层结论追溯到 L2 支撑事实,再追溯到 L1 原始事件。它适合回答:“DeepTutor 为什么认为它知道这件事?”
-[preferences.md content]
-─────────────────────────────────────────────────────────────────────
-```
-
-模型也有 `read_memory` 工具可在回合中查询,以及 `write_memory` 用于持久化明确偏好(≤240 字符、过内容安全过滤、自动链接到触发的 L1 事件)。
-
-## 文件布局
-
-```text
-data/user/memory/
-├── trace/
-│ ├── chat/2026-05-21.jsonl ← L1
-│ ├── chat/2026-05-22.jsonl
-│ ├── notebook/2026-05-22.jsonl
-│ ├── quiz/2026-05-22.jsonl
-│ ├── kb/2026-05-22.jsonl
-│ ├── book/2026-05-22.jsonl
-│ ├── tutorbot/2026-05-22.jsonl
-│ └── cowriter/2026-05-22.jsonl
-├── L2/
-│ ├── chat.md
-│ ├── notebook.md
-│ ├── quiz.md
-│ ├── kb.md
-│ ├── book.md
-│ ├── tutorbot.md
-│ └── cowriter.md
-└── L3/
- ├── recent.md
- ├── profile.md
- ├── scope.md
- └── preferences.md
-```
-
-多用户模式下,这些位于 `multi-user/<uid>/memory/` 下。
-
-## CLI 镜像
+## CLI
```bash
-deeptutor memory show # L3 拼接(默认)
-deeptutor memory show chat # 某个 L2 surface 文档
-deeptutor memory show profile # 某个 L3 文档
-deeptutor memory clear all --force # 清空所有层(破坏性操作)
-deeptutor memory clear chat # 清掉某 surface 的 L1
+deeptutor memory show L3
+deeptutor memory show L2
+deeptutor memory show profile
+deeptutor memory show chat
+deeptutor memory clear trace --force
```
-## 多用户记忆
-
-每位用户有自己独立的 memory,位于 `multi-user/<uid>/memory/`。Memory **不会跨用户共享** —— 即便是管理员也读不到别人的 memory。
-
-## 另见
+## 建议
-- [**聊天工作台**](/zh-cn/docs/explore/chat-workspace/) —— 聊天怎么消费 / 写入 memory
-- [**Space → Notebooks**](/zh-cn/docs/explore/space/) —— notebook 喂养 `notebook` surface
-- [**设置 → 记忆**](/zh-cn/docs/explore/settings/) —— 调整 consolidation 节奏
+- 长期学习工作流建议保持 memory 开启。
+- 如果 DeepTutor 的语气或假设不对,优先检查 L3 preferences。
+- 如果只想删除某个 surface 的原始历史,可以只清 L1 trace,而不是全部 memory。
+- 多用户模式下,每个用户都有自己 workspace 作用域里的 memory。
diff --git a/site/src/content/docs/zh-cn/docs/explore/partners.md b/site/src/content/docs/zh-cn/docs/explore/partners.md
new file mode 100644
index 000000000..90840caa2
--- /dev/null
+++ b/site/src/content/docs/zh-cn/docs/explore/partners.md
@@ -0,0 +1,56 @@
+---
+title: Partners 伙伴
+description: 运行在同一 Chat agent loop 上的、可接入 IM 渠道的持久学习伙伴。
+---
+
+Partners 是拥有独立身份、Soul、模型策略、资源库和渠道配置的持久学习伙伴。它替代了旧 TutorBot 引擎:每条来自网页或 IM 的消息都会进入与主 Chat 相同的 `ChatOrchestrator -> AgenticChatPipeline`。
+
+![Partners 工作台](/screenshots/partners.png)
+
+## 心智模型
+
+一个 Partner 是 `data/partners/<id>/workspace/` 下的 **synthetic user workspace**。里面有 partner 的 soul、复制过来的知识库、技能、Notebook、Memory 和渠道运行状态。因为这个布局和 Chat 工作区一致,RAG、`read_skill`、Notebook、Memory、MCP deferred tools 都可以直接复用,不需要另一套 bot 引擎。
+
+![Partners 架构](/screenshots/partners-architecture.png)
+
+## 创建 Partner
+
+打开 **Partners -> New partner**,按向导完成:
+
+![Partner 创建向导:Identity 步骤](/screenshots/partners-new.png)
+
+1. **Identity** —— 名称、头像、描述、默认回复语言。
+2. **Soul** —— partner 的角色和表达方式,会写入 `SOUL.md`。
+3. **Mind** —— 模型选择、系统工具、MCP 工具和投递偏好。
+4. **Library** —— 分配知识库、技能和 Notebook。它们会被复制进 partner 工作区,避免原始资源变化影响运行时上下文。
+5. **Review** —— 启动前确认工作区与渠道配置。
+
+![Partner 详情](/screenshots/partners-detail.png)
+
+向导里选的内容之后都可以改:partner 详情页除了网页 **Chat** 视图,还有覆盖 identity、soul、mind、library 的 **Configure** tab,以及配置投递的 **Channels** tab。
+
+![Partner 详情:Configure tab](/screenshots/partners-configure.png)
+
+## 渠道通用字段
+
+每个 channel card 都是同一个 partner brain 的投递适配器。大多数字段含义一致:
+
+| 字段 | 含义 |
+| --- | --- |
+| **Enabled** | 是否启动这个渠道。配置凭证前可以先关闭。 |
+| **Send Progress** | 是否把长任务过程中的 narration/progress 发到 IM。长回答等待较久时建议开启。 |
+| **Send Tool Hints** | 是否发送一行工具调用提示,例如 `rag(query=...)`。生产群里想安静一点可以关掉。 |
+| **Allow From** | 允许访问的用户 id、群 id、邮箱或 `*`。空列表通常表示拒绝所有人;`*` 表示开放。 |
+
+每个 channel 都有专属配置页,包含凭证、接入步骤和排错说明——完整清单见 [**Channel Matrix**](/zh-cn/docs/partners/channels/)。个人微信看 [**WeChat**](/zh-cn/docs/partners/weixin/),企业微信看 [**WeCom**](/zh-cn/docs/partners/wecom/),QQ 官方 bot 和 NapCat 看 [**QQ / NapCat**](/zh-cn/docs/partners/qq/)。
+
+## CLI 对应命令
+
+```bash
+deeptutor partner list
+deeptutor partner create math-tutor --soul "Socratic math tutor"
+deeptutor partner start math-tutor
+deeptutor partner stop math-tutor
+```
+
+CLI 适合做 smoke test;实际配置渠道时更推荐 Web UI,因为它会遮盖 secret,并按 channel schema 渲染字段。
diff --git a/site/src/content/docs/zh-cn/docs/explore/settings.md b/site/src/content/docs/zh-cn/docs/explore/settings.md
index b7986e632..b718b86ad 100644
--- a/site/src/content/docs/zh-cn/docs/explore/settings.md
+++ b/site/src/content/docs/zh-cn/docs/explore/settings.md
@@ -1,130 +1,95 @@
---
-title: 设置
-description: 统一控制中心 —— 外观、状态、LLM / Embedding / Search、Capabilities、记忆、MCP、工具。
+title: Settings 设置
+description: DeepTutor 的统一控制面:外观、状态、网络、模型目录、Embedding、搜索、MinerU、Capabilities、Memory、MCP 和工具。
---
-设置界面在 v1.4 里被统一并按关注点拆分,采用 **草稿 / Apply** 模型 —— 改动是原子的,存之前可以回退。
+Settings 是 DeepTutor 的运行控制面。多数配置采用 draft-and-apply 模型,可以先测试 provider,再正式保存。
-![Settings overview](/screenshots/dt-settings.png)
+![Settings 工作台](/screenshots/settings.png)
-## Tab 列表
+## 主要分区
-按左侧导航的顺序:
+| 分区 | 控制什么 |
+| --- | --- |
+| **Appearance** | 主题、语言、侧边栏偏好。 |
+| **Status** | Backend 和各模型服务当前实际生效状态。 |
+| **Network** | Backend/frontend ports、external API base、CORS origins。 |
+| **LLM** | 模型目录 profiles、base URL、API key、active models。 |
+| **Embedding** | Knowledge / RAG 使用的 embedding provider。 |
+| **Search** | Web/search provider 配置。 |
+| **MinerU PDF** | 本地或云端 PDF parsing backend。 |
+| **Capabilities** | Chat、Solve、Question、Research、Visualize、Co-Writer 等 pipeline 的预算和参数。 |
+| **Memory** | Consolidation 控制和 Memory workbench 入口。 |
+| **MCP servers**(仅 admin) | 外部 MCP tool 注册。 |
+| **Tools** | 内置工具、上下文工具、coming-soon 工具和用户可切换工具。 |
-| Tab | 控制什么 |
-|-----|----------|
-| **Appearance** | UI 语言和主题(Cream、Snow、Dark、Glass) |
-| **Status** | LLM、embedding、search、存储后端的实时健康探测 |
-| **LLM** | Provider 目录、base URL、API key、当前激活模型 |
-| **Embedding** | 形态同 LLM,但作用于 embedder |
-| **Search** | Web 搜索 provider(Tavily / Brave / Jina / Serper / SearXNG / DuckDuckGo / Perplexity) |
-| **Capabilities** | 各 capability 可调参数(chunking、LLM 预算、dedup、最大迭代) |
-| **Memory** | 开关 consolidator、配置节奏与预算 |
-| **MCP servers** | 注册外部 Model Context Protocol server |
-| **Tools** | 查看每个内置工具的参数、状态、i18n 状态文案 |
+## 分区详解
-页面顶部有一个 **Tour** 启动器,带新用户走一遍。
+### Appearance
-## Appearance
+主题、界面语言、侧边栏偏好。纯客户端展示配置,不涉及 provider 凭证。
-| 设置项 | 选项 |
-|--------|------|
-| 语言 | English、简体中文 |
-| 主题 | Cream *(默认)* / Snow / Dark / Glass |
-| 侧边栏密度 | Compact / Comfortable |
+### Status
-## Status
+只读面板,显示 backend 以及当前配置实际解析到的 LLM、embedding、search endpoints。Status 反映上次 **Apply** 之后的运行时取值——draft 修改在 Apply 前不会出现在这里。
-一份实时健康探测:
+### Network
-- LLM provider —— 连接 OK / 失败 / 未配置
-- Embedding provider —— 同上
-- Search provider —— 同上
-- 存储后端 —— 连接状态、延迟
-- 每个 provider 的上次健康检查时间
+Backend/frontend ports、反向代理部署时浏览器客户端使用的 external API base,以及 CORS origins。
-排查「模型不回我」类问题时,先看这里。
+### LLM
-## LLM / Embedding / Search
+![LLM 设置:provider profiles、连接字段和模型目录](/screenshots/settings-llm.png)
-三者共享相同的 **profile** 模型:
+语言模型 profiles。每个 profile 是一条 provider connection——provider 类型、base URL、API key、可选 extra headers——加上模型目录:每个模型登记 model ID 和 context window。Active model 用于 Chat 和大多数 agent reasoning。
-- 可以配 **多个 profile**(比如 `openai-gpt-4o`、`anthropic-sonnet-4`、`local-ollama`)
-- 在每项服务里从目录中选 **一个激活模型**
-- 单回合的临时覆盖发生在聊天 composer 的模型选择器里
+### Embedding
-用 **Test** 按钮测连接 —— 它会发一个小探测请求并报延迟。
+Embedding 模型 profiles,布局与 LLM 一致(provider connection + models),但登记的是 embedding 模型及其 dimensions。供检索和知识库 ingestion 使用。
-完整 provider 矩阵:[**Providers**](/zh-cn/docs/get-started/providers/)。
+### Search
-## Capabilities
+`web_search` 工具及任何需要访问开放网络的 agent step 所用的 web search providers。配置 provider、base URL、API key 后,可在 diagnostics 面板跑一次测试查询。
-针对 Chat、Solve、Quiz、Research、Visualize、Co-Writer 的每 capability 可调参数:
+### MinerU PDF
-| 设置项 | 含义 |
-|--------|------|
-| **Chunking** | 检索到的 KB 内容如何切分进上下文窗口 |
-| **LLM budget** | 单次 capability 运行的最大 token / 最大迭代 |
-| **Dedup policy** | 重复源如何处理 |
-| **Reference policy** | 何时插入引用 |
-| **Max iterations** | agentic loop 的硬性上限 |
+![MinerU PDF 设置:parsing backend 与本地安装检测](/screenshots/settings-mineru.png)
-底层是统一的 `emit_capability_result` 信封和共享的 `UsageTracker`,会暴露 **每次调用的成本**。
+从上传试卷生成题目时使用的 PDF parsing backend。可选本地 MinerU 安装或 mineru.net 云端 API。本地解析时,页面会检测 MinerU CLI、支持手动指定 CLI path,并管理约 1-2 GB 的模型权重下载(HuggingFace 或 ModelScope)。
-## Memory
+### Capabilities
-| 设置项 | 效果 |
-|--------|------|
-| **开关 consolidator** | 暂停 / 恢复 L1 → L2 → L3 流水线 |
-| **节奏** | 每个 consolidation pass 的运行频率 |
-| **预算** | 每个 consolidation pass 的 token 预算 |
-| **跳转到 workbench** | 直接打开 `/memory` |
+![Capabilities 设置:按 capability 的参数](/screenshots/settings-capabilities.png)
-完整三层架构看 [**记忆系统**](/zh-cn/docs/explore/memory/)。
+按 capability 的 LLM 参数和运行时旋钮:Chat、Solve、Question、Research、Visualize、Co-Writer 等 pipeline 的 temperature、token 预算和循环上限。Chat 还包括 max rounds 和独立的 exploring/responding token 预算。取值持久化到 `data/user/settings/agents.yaml`(LLM 参数)和 `main.yaml`(运行时旋钮)。
-## MCP servers
+### Memory
-**Model Context Protocol** 集成让你可以把外部 MCP server 挂成额外工具。在这里加 server 配置;它们的工具会和内置工具并列出现。
+调节 chunk-based memory consolidator:**Update** 和 **Audit** 在每个 L2 surface、每个 L3 slot 上的 LLM-round 预算,以及 **Dedup** 迭代次数和是否在 Update 后自动跑 dedup。
-示例:
+### MCP servers(仅 admin)
-```yaml
-servers:
- filesystem:
- command: npx
- args: ["-y", "@modelcontextprotocol/server-filesystem", "/Users/frank/docs"]
- github:
- command: npx
- args: ["-y", "@modelcontextprotocol/server-github"]
- env:
- GITHUB_PERSONAL_ACCESS_TOKEN: ${GITHUB_TOKEN}
-```
+注册外部 MCP(Model Context Protocol)servers,把它们的工具暴露给 chat agent。先测连接再保存。多用户部署中此分区仅 admin 可见。
-## Tools
+### Tools
-逐个查看每个内置工具:
+![Tools 设置:用户可切换工具与内置工具](/screenshots/settings-tools.png)
-- 名称、描述、参数
-- 状态(启用 / 即将推出)
-- i18n 状态文案(工具的进度消息在英文 / 中文下分别长什么样)
-- 是否允许用户切换
+开关用户可切换工具。**Experience enhancement** 工具(`brainstorm`、`web_search`、`paper_search`、`reason`)由你自由切换;**built-in** 工具如 `rag` 和 code execution 是锁定的,chat agent 需要时自动挂载。
-五个工具支持用户全局开关:`brainstorm`、`web_search`、`paper_search`、`code_execution`、`reason`。基于上下文挂载的工具(`rag`、`read_memory`、`write_memory` 等)不能在这里切换 —— 它们会根据当前回合挂了什么自动出现。
+## 部署注意点
-## i18n
+- 项目根目录 `.env` 不作为应用配置读取。
+- 运行时配置在 `data/user/settings/*.json`,除非设置了 `DEEPTUTOR_HOME` 或 `deeptutor start --home`。
+- Docker 浏览器客户端必须同时能访问 frontend 和 backend。反向代理部署时,在 **Network** 配置 external API base。
+- 用户可切换工具是 `brainstorm`、`web_search`、`paper_search`、`reason`;其它工具按上下文或运行时能力自动挂载。
-每个 capability 都自带一份标准的 `capabilities/prompts/{en,zh}/<name>.yaml`,保证状态消息在英文和中文下都一致。
+## Provider 测试
-## CLI 镜像
+Apply 前先点 **Test**。测试通过只说明 profile 可以完成最小调用,并不代表该模型适合所有 capability。
-```bash
-deeptutor config show # 打印当前配置(secret 已脱敏)
-deeptutor init # 重跑向导,重新逐项提示
-$EDITOR data/user/settings/model_catalog.json # 直接编辑
-```
+## 相关页面
-## 另见
-
-- [**Providers**](/zh-cn/docs/get-started/providers/) —— 完整的 LLM / embedding / search provider 矩阵
-- [**记忆系统**](/zh-cn/docs/explore/memory/) —— consolidator 到底干了什么
-- [**多用户部署**](/zh-cn/docs/get-started/multi-user/) —— 与认证相关的设置
+- [Providers](/zh-cn/docs/get-started/providers/) —— 模型/搜索配置示例
+- [Docker](/zh-cn/docs/get-started/docker/) —— 端口和反向代理说明
+- [Memory](/zh-cn/docs/explore/memory/) —— 检查 memory 状态
diff --git a/site/src/content/docs/zh-cn/docs/explore/space.md b/site/src/content/docs/zh-cn/docs/explore/space.md
index 284a0e5b7..d2995e544 100644
--- a/site/src/content/docs/zh-cn/docs/explore/space.md
+++ b/site/src/content/docs/zh-cn/docs/explore/space.md
@@ -1,119 +1,36 @@
---
title: Space 空间
-description: 你的个人学习资料库 —— Chat History、Notebooks、Question Bank、Skills,全在一个地方。
+description: 管理可复用上下文:skills、personas、notebooks、chat history 和题目资产。
---
-Space 是与活跃界面相对的 **阅读 / 回顾** 端。Chat / Co-Writer / Book 是你 *产出* 的地方,Space 则是你产出的所有东西的归宿 —— 可搜索、可回放。
+Space 是可复用上下文的资源库层。你在这里管理会影响未来 Chat、Partner、Co-Writer 和 Book 的资产。
-## Space 里有什么
-
-Space 在一套导航下集成了四个子界面:
-
-| 子界面 | 内容 |
-|--------|------|
-| **Chat History** | 所有模式下的每段对话(Chat / Solve / Quiz / Research / Visualize) |
-| **Notebooks** | 分类、配色的 notebook,承载来自 Chat、Research、Co-Writer 的记录 |
-| **Question Bank** | 自动生成过的全部 quiz 题 —— 可收藏,可在聊天里 @ 引用 |
-| **Skills** | 用户自己编写的 `SKILL.md` 文件,定义教学人设 |
-
-## Chat History
-
-每一段对话,支持:
-
-- **标题重命名** —— 把自动生成的标题改成你能搜到的样子
-- **删除** —— 删掉一个 session(连同它的 memory trace)
-- **继续** —— 在新 tab 打开 session,或附加到当前 tab
-- **逐回合删除** —— 每个入口都支持(chat、solve、quiz、research、visualize)
-
-顶部浏览器搜索框会跨所有标题和正文做过滤 —— 想不起来某事是在哪个 session 里聊的时候很有用。
-
-## Notebooks
-
-Notebook 是 **你想留存的产出的持久化存储**。一个 notebook 包含:
-
-- 一个名字 + 描述 + 颜色标签
-- 一组记录(每条记录是一份 Markdown 文档)
-- 反向链接到来源的聊天 session / Co-Writer 文档
-
-### 存到 notebook
-
-大部分界面都有 **Save to Notebook** 动作:
-
-| 界面 | 存下的内容 |
-|------|------------|
-| **Chat** *(任意模式)* | 当前回合 + 其引用 |
-| **Co-Writer** | 当前文档 |
-| **Quiz** | 题目 + 你的答案 + 评分结果 |
-| **Research** | 完整报告 + 提纲 + 引用 |
-
-### 在聊天里用 notebook
-
-Notebook 可以通过 `list_notebook` 和 `write_note` 工具在聊天里查询(至少存在 1 个 notebook 时会自动挂上)。也可以通过 composer 的 Space 选择器把具体记录挂到某个回合。
+![Space 工作台](/screenshots/space.png)
-### CLI 镜像
-
-```bash
-deeptutor notebook list
-deeptutor notebook create research-notes --description "Daily reading log"
-deeptutor notebook show research-notes
-deeptutor notebook add-md research-notes ./paper-summary.md
-deeptutor notebook replace-md research-notes <record_id> ./updated.md
-deeptutor notebook remove-record research-notes <record_id>
-```
-
-## Question Bank
-
-**Quiz** 模式生成的每道自动校验题都会落到这里:
-
-- **收藏** —— 标记一道题以便日后复习
-- **分类** —— 题目会按来源继承一个主题标签
-- **在聊天里 @ 引用** —— 在新回合里引用过去的题(「@question 47,为什么 B 是对的?」)
+## Space 里有什么
-Question Bank 让间隔重复成为一个真实可用的工作流:把昨天做错的题重新生成、获取讲解、再做一次。
+| 资产 | 用途 |
+| --- | --- |
+| **Skills** | `SKILL.md` 文件,用来教 DeepTutor 一个 workflow、风格或领域行为。 |
+| **Personas** | 可在 Chat 选择、也可复制到 Partners 的角色/语气说明。 |
+| **Notebooks** | 从 Chat、Research、Co-Writer 保存,或从 Markdown 导入的长期记录。 |
+| **Chat History** | 可恢复 session 和历史上下文。 |
+| **Question assets** | 之后可以引用的练习材料。 |
## Skills
-Skills 是 **用户编写的人设定义** —— 按特定 schema 写的 `SKILL.md` 文件。当一个 skill 激活时:
-
-- 它的人设会在生效期间 **注入聊天 system prompt**
-- 它的 trigger 可以让它自动激活(比如你提到特定主题时)
+Skills 位于用户 workspace 下,可以加标签、编辑、预览;内置 skill 可以只读。一个好的 skill 应该具体说明何时使用、需要什么输入、输出应该长什么样。
-### Skill schema
+## Personas 和 Partners
-```markdown
----
-name: socratic-tutor
-description: Teach by asking probing questions instead of giving direct answers
-triggers:
- - "explain"
- - "what is"
- - "teach me"
----
+Personas 是较轻量的角色定义。Partners 有更强的 `SOUL.md`,但 persona 是很好的起点:先在 Space 里创建/打磨 persona,再在创建 Partner 时使用。
-You are a Socratic tutor. Instead of giving direct answers:
-
-1. Ask probing questions that reveal what the student already knows.
-2. Guide them to discover the answer themselves.
-3. Confirm understanding with a follow-up question.
-
-Use clear, encouraging language. Never lecture.
-```
-
-DeepTutor 自带几个原型 —— Socratic、鼓励型、严格型 —— 你也可以在 Skills 这个 tab 里写自己的。
-
-### Skill 存在哪里
-
-- **个人 skills** —— `data/user/workspace/skills/*.md`
-- **项目作用域 skills** —— `.deeptutor/skills/*.md` *(如果你在用项目工作区)*
-
-## 与之搭配的
+## Notebooks
-- **Chat** —— 把 notebook 记录 / 过去的 session 拉进当前回合做上下文
-- **TutorBot** —— Bot 同样能使用 Skills(按 bot 单独配置)
-- **Memory** —— Notebook 会成为 `notebook` surface 下的 L1 trace,最终被合并进 L3
+Notebook 是把一次回答变成长期上下文的最简单方式。可以保存 summary、research output、writing draft 或 book reading note,之后在 Chat 或 CLI 里重新挂载。
-## 另见
+## 相关页面
-- [**聊天工作台**](/zh-cn/docs/explore/chat-workspace/) —— 产出 Space 所存的内容
-- [**记忆系统**](/zh-cn/docs/explore/memory/) —— Space 的内容如何喂给记忆流水线
-- [**探索 TutorBot**](/zh-cn/docs/tutorbot/) —— bot 同样使用 Skills
+- [聊天工作台](/zh-cn/docs/explore/chat-workspace/) —— 把 Space context 挂到 turn 上
+- [Partners](/zh-cn/docs/explore/partners/) —— 给 partner 分配 skills/notebooks
+- [Co-Writer](/zh-cn/docs/explore/co-writer/) —— 把 draft 保存到 Notebook
diff --git a/site/src/content/docs/zh-cn/docs/get-started/cli-only.md b/site/src/content/docs/zh-cn/docs/get-started/cli-only.md
index 7f63ed9bf..a42292d70 100644
--- a/site/src/content/docs/zh-cn/docs/get-started/cli-only.md
+++ b/site/src/content/docs/zh-cn/docs/get-started/cli-only.md
@@ -60,7 +60,7 @@ deeptutor config show
| `deeptutor kb`(知识库) | ✅ *(init 时选择启用)* | ✅ |
| `deeptutor notebook` | ✅ | ✅ |
| `deeptutor memory` | ✅ | ✅ |
-| `deeptutor bot`(TutorBot) | ✅ *(装了 `[tutorbot]` extra 时)* | ✅ |
+| `deeptutor partner`(Partners) | ✅ *(补装 channel SDK 后,见下文)* | ✅ |
| `deeptutor config show` | ✅ | ✅ |
| `deeptutor provider login` | ✅ | ✅ |
| `deeptutor serve`(FastAPI) | ❌ | ✅ |
@@ -71,6 +71,16 @@ deeptutor config show
后续要加 Web 应用,装 PyPI 包(选项 1),然后在同一工作区跑 `deeptutor init` + `deeptutor start`。
+## 补装 Partner channel SDK
+
+仅 CLI 安装也可以运行 `deeptutor partner`,但 channel SDK 不会默认安装。本地的 `deeptutor-cli` 项目没有定义任何 extras —— 请改用仓库里的 requirements 镜像文件来装 SDK 全集(源码 checkout 本来就在手边):
+
+```bash
+python -m pip install -r requirements/partners.txt
+```
+
+它覆盖全部内置 channel SDK(wecom-aibot-sdk、qq-botpy、slack-sdk、lark-oapi、python-telegram-bot、dingtalk-stream 等)。Matrix 渠道单独打包:`pip install -r requirements/matrix.txt`,加密房间再装 `requirements/matrix-e2e.txt`(需要系统级 `libolm` 库)。这不会安装 Web UI;Partner 配置仍写入当前工作区的 `data/partners/<id>/` 和 `data/user/settings/`。
+
## 让另一个 agent 来调用
CLI 是 **agent-native** 的。`deeptutor run --format json` 每行输出一个 JSON 事件,`kb list`、`kb search`、`session show`、`notebook show` 等数据查询命令在已实现的地方都暴露 JSON —— 方便接到另一个 agent 的 harness 里。
@@ -99,12 +109,12 @@ python -m deeptutor_cli.main chat
`deeptutor serve` 在仅 CLI 安装里**不可用**。请用 [**PyPI**](/zh-cn/docs/get-started/pypi/) 或 [**从源码安装**](/zh-cn/docs/get-started/from-source/)。
-### TutorBot 命令提示 SDK 缺失
+### Partner 渠道命令提示 SDK 缺失
-Channel SDKs(python-telegram-bot、slack-sdk 等)只在 `[tutorbot]` extra 里:
+Channel SDKs(wecom-aibot-sdk、qq-botpy、slack-sdk、lark-oapi 等)随 requirements 镜像文件分发,不在仅 CLI 包里:
```bash
-pip install -e "./packaging/deeptutor-cli[tutorbot]"
+python -m pip install -r requirements/partners.txt
```
更多:[**故障排查**](/zh-cn/docs/get-started/troubleshooting/)。
@@ -113,4 +123,4 @@ pip install -e "./packaging/deeptutor-cli[tutorbot]"
- [**DeepTutor CLI**](/zh-cn/docs/cli/) —— 完整 CLI 参考
- [**Agent handoff**](/zh-cn/docs/cli/agent-handoff/) —— 让你的 agent 来驱动
-- [**探索 TutorBot**](/zh-cn/docs/tutorbot/) —— 从 CLI 跑一个 bot
+- [**Partners 伙伴与渠道**](/zh-cn/docs/partners/) —— 从 CLI 跑一个 Partner
diff --git a/site/src/content/docs/zh-cn/docs/get-started/docker.md b/site/src/content/docs/zh-cn/docs/get-started/docker.md
index 51e8e0a76..9ddab8e5e 100644
--- a/site/src/content/docs/zh-cn/docs/get-started/docker.md
+++ b/site/src/content/docs/zh-cn/docs/get-started/docker.md
@@ -20,7 +20,7 @@ docker run --rm --name deeptutor \
> ⚠️ **`3782` 和 `8001` 都要映射。** 端口 `3782` 提供 Web UI;端口 `8001` 是 FastAPI 后端,浏览器会直接调它 —— 容器里没有 in-container proxy。漏掉 `8001` 的映射,页面依然能加载,但 **设置** 会显示 "Backend unreachable" 然后没法用。
-打开 <http://127.0.0.1:3782>。容器首次启动时会创建 `/app/data/user/settings/*.json`;从 Web 的设置页面里配置模型 provider。配置、API key、日志、工作区文件、记忆、知识库全部持久化在 `deeptutor-data` volume 里。
+打开 <http://127.0.0.1:3782>。容器首次启动时会创建 `/app/data/user/settings/*.json`;从 Web 的设置页面里配置模型 provider。配置、API key、日志、工作区文件、记忆、知识库、Partner 工作区(`data/partners/<id>/`)全部持久化在 `deeptutor-data` volume 里。
## 后台模式
@@ -39,6 +39,33 @@ docker rm deeptutor # 删除(volume 仍保留)
`deeptutor-data` volume 会在 `stop` / `rm` 之间保留设置和工作区。如果真要从头来:`docker volume rm deeptutor-data`。
+## 远程 Docker / 反向代理
+
+Web UI 运行在用户浏览器里,不是在容器内部。如果用户通过远程 hostname 打开 DeepTutor,浏览器需要一个自己能访问到的后端 URL。
+
+远程服务器上,打开 **设置 -> Network**,或编辑挂载 volume 里的 `data/user/settings/system.json`:
+
+```json
+{
+ "next_public_api_base_external": "https://deeptutor.example.com"
+}
+```
+
+`public_api_base` 仍作为兼容别名接受,保存时会归一化到 `next_public_api_base_external`。同一台机器本地 Docker 访问时可以留空。
+
+CORS 是另一件事:
+
+- `next_public_api_base_external` 告诉浏览器把 API 和 WebSocket 请求发到哪里。
+- `cors_origins` 列出哪些前端页面 origin 可以调用后端。
+- 未开启 auth 时,DeepTutor 默认允许正常 HTTP/HTTPS 浏览器 origin。
+- 开启 auth 后,建议设置精确前端 origin,例如 `https://deeptutor.example.com`。
+
+```json
+{
+ "cors_origins": ["https://deeptutor.example.com"]
+}
+```
+
## 改宿主机端口
改 `-p host:container` 映射的左边即可:
@@ -131,7 +158,7 @@ docker run ... ghcr.io/hkuds/deeptutor:latest # 用干净的 catalog 重启
### 前端能加载但 API 调用 404(远程 / 在反向代理后)
-显式设置外部 API base。在 volume 里的 `data/user/settings/system.json`,把 `public_api_base` 设成对外可达的 URL。重启。
+显式设置外部 API base。在 volume 里的 `data/user/settings/system.json`,把 `next_public_api_base_external` 设成对外可达的 URL 后重启。`public_api_base` 仍作为兼容别名接受。
### Docker 里的多用户模式
diff --git a/site/src/content/docs/zh-cn/docs/get-started/from-source.md b/site/src/content/docs/zh-cn/docs/get-started/from-source.md
index 9a6b79c35..65eca1b96 100644
--- a/site/src/content/docs/zh-cn/docs/get-started/from-source.md
+++ b/site/src/content/docs/zh-cn/docs/get-started/from-source.md
@@ -42,13 +42,27 @@ python -m pip install --upgrade pip
```bash
pip install -e ".[dev]" # 测试 / lint 工具
-pip install -e ".[partners]" # Partners 渠道 SDK + MCP 客户端
+pip install -e ".[partners]" # 全部 Partner channel SDK(含 wecom-aibot-sdk)+ MCP 客户端
pip install -e ".[matrix]" # 不带 E2EE / libolm 的 Matrix channel
pip install -e ".[matrix-e2e]" # 带 E2EE 的 Matrix;需要 libolm
pip install -e ".[math-animator]" # Manim 插件;需要 LaTeX / ffmpeg / 系统库
```
-也可以组合:`pip install -e ".[dev,tutorbot,math-animator]"`。
+也可以组合:`pip install -e ".[dev,partners,math-animator]"`。
+
+全集如下 —— 每个 extra 都有对应的 `requirements/*.txt` 镜像文件,供拿不到源码树的 Docker/CI 构建使用:
+
+| Extra | 用途 | Requirements 镜像 |
+|-------|------|-------------------|
+| `cli` | 兼容性 extra —— CLI 依赖,默认安装已包含 | `requirements/cli.txt` |
+| `server` | 兼容性 extra —— FastAPI server 依赖,默认安装已包含 | `requirements/server.txt` |
+| `partners` | 全部内置 Partner channel SDK(`wecom-aibot-sdk`、`qq-botpy`、`slack-sdk`、`lark-oapi`、`python-telegram-bot`、`dingtalk-stream` 等)+ MCP 客户端 | `requirements/partners.txt` |
+| `tutorbot` | `partners` 的兼容别名,保留一个版本周期 | — |
+| `matrix` | Matrix(Element)channel,非 E2EE —— 不需要 libolm | `requirements/matrix.txt` |
+| `matrix-e2e` | Matrix E2EE 附加包 —— 需要系统级 **libolm** 库 | `requirements/matrix-e2e.txt` |
+| `math-animator` | Manim 插件 —— 需要 LaTeX、pkg-config、cairo、cmake、ffmpeg | `requirements/math-animator.txt` |
+| `dev` | pytest / pre-commit / lint 与安全检查工具 | `requirements/dev.txt` |
+| `all` | `partners` + `matrix` + `math-animator` + `dev`(不含 E2EE) | — |
### 部分 extras 需要的系统依赖
diff --git a/site/src/content/docs/zh-cn/docs/get-started/index.md b/site/src/content/docs/zh-cn/docs/get-started/index.md
index 16912c76a..6c7cab666 100644
--- a/site/src/content/docs/zh-cn/docs/get-started/index.md
+++ b/site/src/content/docs/zh-cn/docs/get-started/index.md
@@ -3,7 +3,7 @@ title: 快速上手
description: DeepTutor 提供四种安装方式 —— PyPI、源码、Docker、纯 CLI。挑一个适合你的。
---
-DeepTutor 提供 **四种安装路径**,全部使用同一份工作区布局:设置文件位于运行命令所在目录下的 `data/user/settings/`(或者你显式指定的 `DEEPTUTOR_HOME` / `deeptutor start --home` 位置)。
+DeepTutor 提供 **四种安装路径**,全部使用同一份工作区布局:设置文件位于运行命令所在目录下的 `data/user/settings/`(或者你显式指定的 `DEEPTUTOR_HOME` / `deeptutor start --home` 位置)。知识库、记忆、Partners runtime、多用户账号和审计日志也都在同一棵 `data/` 树里,部署时只需要把它持久化。
对完整 Web 应用,推荐流程是:**挑一个工作区目录 → 安装 → `deeptutor init` → `deeptutor start`**。
@@ -16,7 +16,7 @@ DeepTutor 提供 **四种安装路径**,全部使用同一份工作区布局
| **Docker** | 生产部署、托管主机、需要持久化卷 | [**Docker**](/zh-cn/docs/get-started/docker/) |
| **纯 CLI** | 无界面服务器、被其他 agent 调度、不需要 Web UI | [**纯 CLI 安装**](/zh-cn/docs/get-started/cli-only/) |
-> 🧪 **试用 v1.4.0 beta?** PyPI 会把 `1.4.0-beta` 规范化成 `1.4.0b0`,所以 `pip install -U deeptutor` 仍然停在稳定版。要切到 beta:`pip install --pre -U deeptutor`,或精准锁定:`pip install -U deeptutor==1.4.0b0`。
+> 🧪 **想试预发布版本?** 普通 `pip install -U deeptutor` 只会停在稳定版 —— PyPI 默认跳过预发布版本。用 `pip install --pre -U deeptutor` 切换,或精确锁定版本号:`pip install -U "deeptutor==<version>"`。
## 最低环境要求
@@ -44,9 +44,9 @@ DeepTutor 提供 **四种安装路径**,全部使用同一份工作区布局
只要你能打开 `http://localhost:3782/`:
-- [**探索 DeepTutor**](/zh-cn/docs/explore/) —— 五大核心界面 + 记忆系统 + 设置中心的总览
+- [**探索 DeepTutor**](/zh-cn/docs/explore/) —— Chat、Partners、Co-Writer、Book、Knowledge、Space、Memory、Settings的总览
- [**DeepTutor CLI**](/zh-cn/docs/cli/) —— 在终端里驱动一切
-- [**TutorBot 渠道**](/zh-cn/docs/tutorbot/) —— 把持久化的 AI 导师连到 Telegram、Slack、飞书
+- [**Partners 伙伴与渠道**](/zh-cn/docs/partners/) —— 把持久化的 AI 导师连到 WeChat、WeCom、QQ、Telegram、Slack、飞书等渠道
- [**多用户部署**](/zh-cn/docs/get-started/multi-user/) —— 部署给一个团队
如果遇到问题,跳到 [**故障排查**](/zh-cn/docs/get-started/troubleshooting/)。
diff --git a/site/src/content/docs/zh-cn/docs/get-started/multi-user.md b/site/src/content/docs/zh-cn/docs/get-started/multi-user.md
index 5a3b3773b..1df730024 100644
--- a/site/src/content/docs/zh-cn/docs/get-started/multi-user.md
+++ b/site/src/content/docs/zh-cn/docs/get-started/multi-user.md
@@ -10,6 +10,7 @@ description: 打开认证开关,DeepTutor 就变成多租户部署 —— 每
```bash
# 1. 在 data/user/settings/auth.json 里开启 auth:
# {"enabled": true, "token_expire_hours": 24, "cookie_secure": false}
+# Web 和 API 跨站的 HTTPS 部署请用 cookie_secure=true。
# 2. 重启 web 栈。
deeptutor start
@@ -24,6 +25,9 @@ deeptutor start
# 保存。用户现在就能登录开干了。
```
+
+![多用户管理界面](/screenshots/multi-user.png)
+
## admin 能看到什么
- **完整的设置页面**,在 `/settings` —— 管理 LLM / embedding / 搜索 provider、API key、模型 catalog,以及运行时 "Apply"。
@@ -70,8 +74,9 @@ data/
| `data/user/settings/auth.json: enabled` | 是 | 设为 `true` 开启多用户 auth。默认 `false`(单用户模式 —— 各处都走 admin 路径)。 |
| `data/system/auth/auth_secret` | 推荐 | JWT 签名密钥。首次带认证启动时,若缺失会自动生成。 |
| `data/user/settings/auth.json: token_expire_hours` | 否 | JWT 寿命;默认 `24`。 |
+| `data/user/settings/auth.json: cookie_secure` | HTTPS / 跨站认证 | 设为 `true` 后 session cookie 使用 `SameSite=None; Secure`。本地 HTTP 保持 `false`。 |
| `data/user/settings/auth.json: username` / `password_hash` | 否 | 可选的 headless 单用户引导凭证。用浏览器注册时留空。 |
-| `data/user/settings/system.json` | 否 | `deeptutor start` 会从运行时设置推导前端 auth flag 和 API base。 |
+| `data/user/settings/system.json` | 否 | `deeptutor start` 会从运行时设置推导前端 auth flag、public API base 和 CORS origins。 |
## 重要注意事项
@@ -84,13 +89,14 @@ data/
- ✅ 设置一个强 `auth_secret` 并备份
- ✅ 在 `auth.json` 里设 `cookie_secure: true`,让 session cookie 必须走 HTTPS
- ✅ 把 DeepTutor 放在反向代理后面(Caddy、nginx、Traefik),用 TLS termination
-- ✅ 在 `system.json` 里设 `public_api_base`,让前端 bundle 知道去哪儿找后端
+- ✅ 在 `system.json` 里设 `next_public_api_base_external`,让前端 bundle 知道去哪儿找后端
+- ✅ auth 开启且 Web/API 跨 origin 时,把 `cors_origins` 设成精确前端 origin
- ✅ 定期备份 `data/` —— 账号、授权和所有工作区都在这一棵树下
- ✅ Docker:保留 `docker-compose.yml` 里的 `./data:/app/data` 卷。沙箱 runner 刻意只挂工作区子树(`data/user/workspace`、`data/users`),永远不挂存放认证状态和 API key 的 `data/system`、`data/user/settings`
## Caddyfile 示例
-```caddyfile
+```text
deeptutor.example.com {
reverse_proxy /api/* localhost:8001
reverse_proxy localhost:3782
@@ -101,10 +107,13 @@ deeptutor.example.com {
```json
{
- "public_api_base": "https://deeptutor.example.com"
+ "next_public_api_base_external": "https://deeptutor.example.com",
+ "cors_origins": ["https://deeptutor.example.com"]
}
```
+`public_api_base` 仍作为兼容别名接受,保存时会归一化为 `next_public_api_base_external`。
+
在 `data/user/settings/auth.json` 里:
```json
diff --git a/site/src/content/docs/zh-cn/docs/get-started/providers.md b/site/src/content/docs/zh-cn/docs/get-started/providers.md
index 1019d74e9..7da447d5a 100644
--- a/site/src/content/docs/zh-cn/docs/get-started/providers.md
+++ b/site/src/content/docs/zh-cn/docs/get-started/providers.md
@@ -5,43 +5,50 @@ title: Provider 配置
DeepTutor 当前内置 33 个 LLM provider 绑定、12 个 embedding provider 绑定和 7 个激活的搜索 provider(外加显式的 `none` 选项)。可以通过 Web 设置页面、`deeptutor init`、`data/user/settings/model_catalog.json` 或进程环境变量来配置。项目根目录的 `.env` 文件**不会**被运行时自动加载。
+
+## 配置入口和优先级
+
+推荐优先用 **设置 -> LLM / Embedding / Search**,因为 Web UI 会写入 `data/user/settings/model_catalog.json` 并触发运行时 apply。`deeptutor init` 适合首次初始化;环境变量适合容器编排或一次性覆盖。项目根目录 `.env` 文件不会被自动读取,如果要用环境变量,请在启动 `deeptutor start` 的进程环境里显式 export。
+
+多用户部署里,API key 和 provider base URL 只属于 admin workspace。普通用户只拿到 admin 分配的逻辑模型 ID,看不到密钥。
+
## LLM Providers
| Provider | Binding | 默认 Base URL |
| :---------------------- | :-------------------- | :-------------------------------------------------------- |
-| AiHubMix | `aihubmix` | `https://aihubmix.com/v1` |
-| Anthropic | `anthropic` | `https://api.anthropic.com/v1` |
-| Azure OpenAI | `azure_openai` | — |
-| BytePlus | `byteplus` | `https://ark.ap-southeast.bytepluses.com/api/v3` |
-| BytePlus Coding Plan | `byteplus_coding_plan`| `https://ark.ap-southeast.bytepluses.com/api/coding/v3` |
+| <img src="/provider-icons/aihubmix-color.svg" alt="" width="16" height="16" /> AiHubMix | `aihubmix` | `https://aihubmix.com/v1` |
+| <img src="/provider-icons/anthropic.svg" alt="" width="16" height="16" /> Anthropic | `anthropic` | `https://api.anthropic.com/v1` |
+| <img src="/provider-icons/azure-color.svg" alt="" width="16" height="16" /> Azure OpenAI | `azure_openai` | — |
+| <img src="/provider-icons/bytedance-color.svg" alt="" width="16" height="16" /> BytePlus | `byteplus` | `https://ark.ap-southeast.bytepluses.com/api/v3` |
+| <img src="/provider-icons/bytedance-color.svg" alt="" width="16" height="16" /> BytePlus Coding Plan | `byteplus_coding_plan` | `https://ark.ap-southeast.bytepluses.com/api/coding/v3` |
| Custom (OpenAI-compat) | `custom` | — |
-| Custom Anthropic | `custom_anthropic` | — |
-| DashScope (Qwen) | `dashscope` | `https://dashscope.aliyuncs.com/compatible-mode/v1` |
-| DeepSeek | `deepseek` | `https://api.deepseek.com` |
-| Gemini | `gemini` | `https://generativelanguage.googleapis.com/v1beta/openai/`|
-| GitHub Copilot | `github_copilot` | `https://api.githubcopilot.com` |
-| Groq | `groq` | `https://api.groq.com/openai/v1` |
+| <img src="/provider-icons/anthropic.svg" alt="" width="16" height="16" /> Custom Anthropic | `custom_anthropic` | — |
+| <img src="/provider-icons/qwen-color.svg" alt="" width="16" height="16" /> DashScope (Qwen) | `dashscope` | `https://dashscope.aliyuncs.com/compatible-mode/v1` |
+| <img src="/provider-icons/deepseek-color.svg" alt="" width="16" height="16" /> DeepSeek | `deepseek` | `https://api.deepseek.com` |
+| <img src="/provider-icons/gemini-color.svg" alt="" width="16" height="16" /> Gemini | `gemini` | `https://generativelanguage.googleapis.com/v1beta/openai/`|
+| <img src="/provider-icons/githubcopilot.svg" alt="" width="16" height="16" /> GitHub Copilot | `github_copilot` | `https://api.githubcopilot.com` |
+| <img src="/provider-icons/groq.svg" alt="" width="16" height="16" /> Groq | `groq` | `https://api.groq.com/openai/v1` |
| Lemonade | `lemonade` | `http://localhost:13305/api/v1` |
| llama.cpp | `llama_cpp` | `http://localhost:8080/v1` |
-| LM Studio | `lm_studio` | `http://localhost:1234/v1` |
-| MiniMax | `minimax` | `https://api.minimax.io/v1` |
-| MiniMax Anthropic | `minimax_anthropic` | `https://api.minimax.io/v1` |
-| Mistral | `mistral` | `https://api.mistral.ai/v1` |
-| Moonshot (Kimi) | `moonshot` | `https://api.moonshot.ai/v1` |
-| Ollama | `ollama` | `http://localhost:11434/v1` |
-| NVIDIA NIM | `nvidia_nim` | — |
-| OpenAI | `openai` | `https://api.openai.com/v1` |
-| OpenAI Codex | `openai_codex` | `https://chatgpt.com/backend-api` |
-| OpenRouter | `openrouter` | `https://openrouter.ai/api/v1` |
+| <img src="/provider-icons/lmstudio.svg" alt="" width="16" height="16" /> LM Studio | `lm_studio` | `http://localhost:1234/v1` |
+| <img src="/provider-icons/minimax-color.svg" alt="" width="16" height="16" /> MiniMax | `minimax` | `https://api.minimax.io/v1` |
+| <img src="/provider-icons/minimax-color.svg" alt="" width="16" height="16" /> MiniMax Anthropic | `minimax_anthropic` | `https://api.minimax.io/v1` |
+| <img src="/provider-icons/mistral-color.svg" alt="" width="16" height="16" /> Mistral | `mistral` | `https://api.mistral.ai/v1` |
+| <img src="/provider-icons/moonshot.svg" alt="" width="16" height="16" /> Moonshot (Kimi) | `moonshot` | `https://api.moonshot.ai/v1` |
+| <img src="/provider-icons/ollama.svg" alt="" width="16" height="16" /> Ollama | `ollama` | `http://localhost:11434/v1` |
+| <img src="/provider-icons/nvidia-color.svg" alt="" width="16" height="16" /> NVIDIA NIM | `nvidia_nim` | — |
+| <img src="/provider-icons/openai.svg" alt="" width="16" height="16" /> OpenAI | `openai` | `https://api.openai.com/v1` |
+| <img src="/provider-icons/openai.svg" alt="" width="16" height="16" /> OpenAI Codex | `openai_codex` | `https://chatgpt.com/backend-api` |
+| <img src="/provider-icons/openrouter.svg" alt="" width="16" height="16" /> OpenRouter | `openrouter` | `https://openrouter.ai/api/v1` |
| OpenVINO Model Server | `ovms` | `http://localhost:8000/v3` |
-| Qianfan (Ernie) | `qianfan` | `https://qianfan.baidubce.com/v2` |
-| SiliconFlow | `siliconflow` | `https://api.siliconflow.cn/v1` |
-| Step Fun | `stepfun` | `https://api.stepfun.com/v1` |
-| vLLM | `vllm` | `http://localhost:8000/v1` |
-| VolcEngine | `volcengine` | `https://ark.cn-beijing.volces.com/api/v3` |
-| VolcEngine Coding Plan | `volcengine_coding_plan`| `https://ark.cn-beijing.volces.com/api/coding/v3` |
-| Xiaomi MIMO | `xiaomi_mimo` | `https://api.xiaomimimo.com/v1` |
-| Zhipu AI (GLM) | `zhipu` | `https://open.bigmodel.cn/api/paas/v4` |
+| <img src="/provider-icons/baiducloud-color.svg" alt="" width="16" height="16" /> Qianfan (Ernie) | `qianfan` | `https://qianfan.baidubce.com/v2` |
+| <img src="/provider-icons/siliconcloud-color.svg" alt="" width="16" height="16" /> SiliconFlow | `siliconflow` | `https://api.siliconflow.cn/v1` |
+| <img src="/provider-icons/stepfun-color.svg" alt="" width="16" height="16" /> Step Fun | `stepfun` | `https://api.stepfun.com/v1` |
+| <img src="/provider-icons/vllm-color.svg" alt="" width="16" height="16" /> vLLM | `vllm` | `http://localhost:8000/v1` |
+| <img src="/provider-icons/volcengine-color.svg" alt="" width="16" height="16" /> VolcEngine | `volcengine` | `https://ark.cn-beijing.volces.com/api/v3` |
+| <img src="/provider-icons/volcengine-color.svg" alt="" width="16" height="16" /> VolcEngine Coding Plan | `volcengine_coding_plan` | `https://ark.cn-beijing.volces.com/api/coding/v3` |
+| <img src="/provider-icons/xiaomimimo.svg" alt="" width="16" height="16" /> Xiaomi MIMO | `xiaomi_mimo` | `https://api.xiaomimimo.com/v1` |
+| <img src="/provider-icons/zhipu-color.svg" alt="" width="16" height="16" /> Zhipu AI (GLM) | `zhipu` | `https://open.bigmodel.cn/api/paas/v4` |
### 配置
@@ -52,7 +59,7 @@ LLM_API_KEY=sk-xxx
LLM_HOST=https://api.openai.com/v1
```
-::: tip
+:::tip
任何 OpenAI 兼容的 API 都能配合 `openai` 或 `custom` binding 使用。把 `LLM_HOST` 设成你 provider 的 base URL 即可。
:::
@@ -60,16 +67,16 @@ LLM_HOST=https://api.openai.com/v1
| Provider | Binding | 模型示例 | 默认维度 |
| :------------------- | :------------ | :------------------------ | :---------: |
-| OpenAI | `openai` | `text-embedding-3-large` | 3072 |
-| Gemini | `gemini` | `gemini-embedding-001` | 3072 |
-| Azure OpenAI | `azure_openai`| 部署名称 | — |
-| Cohere | `cohere` | `embed-v4.0` | 1024 |
-| Jina | `jina` | `jina-embeddings-v3` | 1024 |
-| Ollama | `ollama` | `nomic-embed-text` | 768 |
-| vLLM / LM Studio | `vllm` | 任意 embedding 模型 | — |
-| SiliconFlow | `siliconflow` | `Qwen/Qwen3-Embedding-8B` | 4096 |
-| Aliyun DashScope | `aliyun` | `qwen3-vl-embedding` | 2560 |
-| OpenRouter | `openrouter` | 取决于 provider | — |
+| <img src="/provider-icons/openai.svg" alt="" width="16" height="16" /> OpenAI | `openai` | `text-embedding-3-large` | 3072 |
+| <img src="/provider-icons/gemini-color.svg" alt="" width="16" height="16" /> Gemini | `gemini` | `gemini-embedding-001` | 3072 |
+| <img src="/provider-icons/azure-color.svg" alt="" width="16" height="16" /> Azure OpenAI | `azure_openai` | 部署名称 | — |
+| <img src="/provider-icons/cohere-color.svg" alt="" width="16" height="16" /> Cohere | `cohere` | `embed-v4.0` | 1024 |
+| <img src="/provider-icons/jina.svg" alt="" width="16" height="16" /> Jina | `jina` | `jina-embeddings-v3` | 1024 |
+| <img src="/provider-icons/ollama.svg" alt="" width="16" height="16" /> Ollama | `ollama` | `nomic-embed-text` | 768 |
+| <img src="/provider-icons/vllm-color.svg" alt="" width="16" height="16" /> vLLM / LM Studio | `vllm` | 任意 embedding 模型 | — |
+| <img src="/provider-icons/siliconcloud-color.svg" alt="" width="16" height="16" /> SiliconFlow | `siliconflow` | `Qwen/Qwen3-Embedding-8B` | 4096 |
+| <img src="/provider-icons/qwen-color.svg" alt="" width="16" height="16" /> Aliyun DashScope | `aliyun` | `qwen3-vl-embedding` | 2560 |
+| <img src="/provider-icons/openrouter.svg" alt="" width="16" height="16" /> OpenRouter | `openrouter` | 取决于 provider | — |
| 任意 OpenAI 兼容 | `custom` | — | — |
| Custom OpenAI SDK | `custom_openai_sdk` | — | — |
@@ -85,7 +92,7 @@ EMBEDDING_HOST=https://api.openai.com/v1/embeddings
EMBEDDING_DIMENSION=
```
-::: warning
+:::caution
建好知识库之后再换 embedding 模型会引发维度不匹配。DeepTutor 会检测到并提醒你 —— 换了模型就要把知识库重建。
:::
@@ -93,13 +100,13 @@ EMBEDDING_DIMENSION=
| Provider | 环境变量 Key | 备注 |
| :---------- | :------------------- | :------------------------------- |
-| Brave | `BRAVE_API_KEY` | 推荐,有免费额度 |
-| Tavily | `TAVILY_API_KEY` | |
+| <img src="/provider-icons/brave.svg" alt="" width="16" height="16" /> Brave | `BRAVE_API_KEY` | 推荐,有免费额度 |
+| <img src="/provider-icons/tavily-color.svg" alt="" width="16" height="16" /> Tavily | `TAVILY_API_KEY` | |
| Serper | `SERPER_API_KEY` | |
-| Jina | `JINA_API_KEY` | |
-| SearXNG | — | 自部署,不需要 API key |
-| DuckDuckGo | — | 不需要 API key |
-| Perplexity | `PERPLEXITY_API_KEY` | 需要 API key |
+| <img src="/provider-icons/jina.svg" alt="" width="16" height="16" /> Jina | `JINA_API_KEY` | |
+| <img src="/provider-icons/searxng.svg" alt="" width="16" height="16" /> SearXNG | — | 自部署,不需要 API key |
+| <img src="/provider-icons/duckduckgo.svg" alt="" width="16" height="16" /> DuckDuckGo | — | 不需要 API key |
+| <img src="/provider-icons/perplexity-color.svg" alt="" width="16" height="16" /> Perplexity | `PERPLEXITY_API_KEY` | 需要 API key |
| None | — | 显式关闭网页搜索 |
### 配置
@@ -113,7 +120,7 @@ SEARCH_API_KEY=your-api-key
## 本地模型
-DeepTutor 通过若干 provider 支持本地托管的模型:
+DeepTutor 通过若干 provider 支持本地托管的模型。Docker 里连接宿主机模型时,`localhost` 指容器自身;请用 `host.docker.internal` 或参考 [Docker 文档](/zh-cn/docs/get-started/docker/#连本地-llmollama--lm-studio--llamacpp--vllm)。
### Ollama
diff --git a/site/src/content/docs/zh-cn/docs/get-started/pypi.md b/site/src/content/docs/zh-cn/docs/get-started/pypi.md
index 84e550207..0fb0bb519 100644
--- a/site/src/content/docs/zh-cn/docs/get-started/pypi.md
+++ b/site/src/content/docs/zh-cn/docs/get-started/pypi.md
@@ -25,16 +25,26 @@ deeptutor start # 同时启动后端 + 前端;保持终端开着
> 跳过 `deeptutor init` 也行,应用会以默认端口和空配置启动,进 **设置 → LLM** 再配也可以。
-## 试用 v1.4.0 beta
+## 试用预发布版本
-PyPI 把 `1.4.0-beta` 规范化为 `1.4.0b0`,所以普通 `pip install -U deeptutor` 不会跳到 beta:
+普通 `pip install -U deeptutor` 只会停在稳定版 —— PyPI 默认跳过预发布版本(如 `1.X.0b0` 这类 beta),除非显式选择:
```bash
pip install --pre -U deeptutor
-# 或精确锁定:
-pip install -U deeptutor==1.4.0b0
+# 或精确锁定某个版本:
+pip install -U "deeptutor==<version>"
```
+## 可选 extras
+
+PyPI wheel 本身已包含完整 Web 应用 + CLI。附加能力按 extras 安装 —— 例如全部内置 Partner channel SDK(WeCom、QQ、Slack、飞书、Telegram、钉钉等):
+
+```bash
+pip install -U "deeptutor[partners]"
+```
+
+完整 extras 总表(`matrix`、`matrix-e2e`、`math-animator`、`dev`、`all`)见 [**从源码安装**](/zh-cn/docs/get-started/from-source/#可选的安装-extras) —— 同样的 extra 名对 PyPI 包同样有效。
+
## 文件存在哪里
工作区位于运行命令时所在的目录(首次启动会在那里创建 `data/` 目录)。覆盖位置:
diff --git a/site/src/content/docs/zh-cn/docs/get-started/troubleshooting.md b/site/src/content/docs/zh-cn/docs/get-started/troubleshooting.md
index e7f922d0e..891dfb3e8 100644
--- a/site/src/content/docs/zh-cn/docs/get-started/troubleshooting.md
+++ b/site/src/content/docs/zh-cn/docs/get-started/troubleshooting.md
@@ -46,9 +46,9 @@ DEEPTUTOR_DOCKER_BACKEND_PORT=18001
### 后端起来了但前端连不上
-Next.js 前端在构建时把 API base 锁成了 `http://localhost:8001`。当你以另一个 hostname 提供 DeepTutor 服务时(云部署、局域网访问、反向代理),bundle 里仍然指向 `localhost`,从远端浏览器看就是错的。
+当你以另一个 hostname 提供 DeepTutor 服务时(云部署、局域网访问、反向代理),用户浏览器需要一个自己能访问的 backend URL。
-修复:把 `data/user/settings/system.json` 里的 `next_public_api_base_external` 设成对外可达的 URL,或者在重新构建前端之前 export `NEXT_PUBLIC_API_BASE_EXTERNAL`:
+修复:打开 **设置 -> Network**,或把 `data/user/settings/system.json` 里的 `next_public_api_base_external` 设成对外可达的 URL:
```json
{
@@ -56,14 +56,14 @@ Next.js 前端在构建时把 API base 锁成了 `http://localhost:8001`。当
}
```
-然后重新构建:
+然后重启 DeepTutor。`public_api_base` 仍作为兼容别名接受,保存时会归一化到 `next_public_api_base_external`。
-```bash
-# Docker
-python scripts/docker_compose.py up -d --build
+如果 auth 已开启且前端 origin 与 API origin 不同,也要设置精确 CORS origins:
-# 手动安装
-cd web && npm run build && cd ..
+```json
+{
+ "cors_origins": ["https://deeptutor.example.com"]
+}
```
## LLM / Embedding providers
@@ -142,24 +142,21 @@ deeptutor kb create physics --doc chapter1.pdf
### 重启之后每个 API 调用都报 `401 Unauthorized`
-`AUTH_SECRET` 被重新生成了,所有 JWT 都失效了。
-
-修复:把 `AUTH_SECRET` 在 `.env` 里 pin 住,让它跨重启保持不变:
+`data/system/auth/auth_secret` 丢失或被重新生成了,所有 JWT 都失效了。
-```bash
-AUTH_SECRET=$(openssl rand -hex 32)
-```
+修复:从备份恢复 `data/system/auth/auth_secret`,或接受新的 secret 并让所有用户重新登录。项目根目录 `.env` 不会被运行时自动加载。
### 第一个用户没被提升为 admin
-编辑 `multi-user/_system/auth/users.json`,把那个用户的 `"role": "admin"` 设好,然后重启。
+编辑 `data/system/auth/users.json`,把那个用户的 `"role": "admin"` 设好,然后重启。
### 登录成功但又跳回 `/login`
auth cookie 没被设置上,通常因为:
-1. `AUTH_COOKIE_SECURE=true` 但你不在 HTTPS 上 —— 本地测试时设成 `false`
-2. 浏览器拦了第三方 cookie,而你在子域上 —— 把前端和 API 部署在同一个 hostname 下(比如都在 `deeptutor.example.com`,前端在 `/`,API 通过 `/api/` 代理)
+1. `auth.json: cookie_secure=false` 但你是跨站 HTTPS 部署 —— 设成 `true` 后重启,让 cookie 使用 `SameSite=None; Secure`
+2. 本地 HTTP 测试时误设了 `cookie_secure=true` —— 改回 `false`
+3. 浏览器拦了第三方 cookie,而你在子域上 —— 把前端和 API 部署在同一个 hostname 下(比如都在 `deeptutor.example.com`,前端在 `/`,API 通过 `/api/` 代理)
## Docker
@@ -249,47 +246,50 @@ which python
跟上面一样 —— 通常是后端没起来或者 CORS / API base URL 对不上。看 Network 标签页确认请求实际去了哪个 URL。
-## TutorBot
+## Partners 与 channels
+
+### Partner channel 在 Channels 面板置灰 / 报 "missing SDK"
+
+某个 channel 的 SDK import 不进来时,Partners 的 **Channels** 面板会把该 channel 置灰并显示 import 错误(如 `No module named 'lark_oapi'`);从 CLI 启动 partner 也会报同样的错。装上缺的依赖集,然后重启 DeepTutor:
-### bot 启动时报 "missing SDK"
+```bash
+pip install -e ".[partners]" # 全部内置 channel SDK(源码安装)
+pip install -U "deeptutor[partners]" # PyPI 安装用这条
+pip install -e ".[matrix]" # Matrix channel;加密房间用 ".[matrix-e2e]"(需要 libolm)
+```
-对应 gateway 的 SDK 没装。报错信息会告诉你是哪一个。装上:
+如果你用的是 `packaging/deeptutor-cli` 的纯 CLI 包(它没有定义任何 extras),改从源码 checkout 装 requirements 镜像:
```bash
-# 通用
-pip install -e ".[partners]"
-
-# 或者装某一个(很少需要)
-pip install python-telegram-bot # Telegram
-pip install slack-sdk # Slack
-pip install zulip # Zulip
-pip install matrix-nio # Matrix(不带 E2EE)
+python -m pip install -r requirements/partners.txt
```
-### bot 连上了但不响应
+装好包、重启 server 之后该 channel 即恢复。
+
+### Partner 连上了但不响应
-检查 bot channel 配置里的 `allow_from`:
+检查 channel card 里的 `allow_from`:
```yaml
-telegram:
+weixin:
enabled: true
- token: "..."
allow_from: # 空 = 全部拒绝
- "*" # 允许所有人
- # - "12345678" # 或具体的 Telegram user ID
+ # - "sender-id" # 测试后换成具体 user/chat ids
```
默认 `allow_from: []` 拒绝所有人 —— 你必须显式 opt in。
-### bot 跑几分钟就掉线
+### Channel 跑几分钟就掉线
Long-poll / WebSocket 连接偶尔会掉。channel manager 会带退避自动重连,但如果你看到频繁掉线:
- 检查宿主机和 gateway provider 之间的网络稳定性
-- Telegram polling 把 `timeout` 调到 60 秒
-- Matrix 的话,确认 homeserver 没有过于激进的超时
+- WeChat 检查 `state_dir` 是否可写、是否持久化
+- Teams / webhook 类 channel 检查公网 callback URL 是否能到达配置的 host/port/path
+- Matrix 检查 homeserver 是否有过于激进的超时
-针对每个 gateway 的调试方法见 [**探索 TutorBot**](/zh-cn/docs/tutorbot/)。
+针对每个 gateway 的调试方法见 [**Partners 伙伴与渠道**](/zh-cn/docs/partners/) 和 [**渠道矩阵**](/zh-cn/docs/partners/channels/)。
## 记忆 / RAG 精度
diff --git a/site/src/content/docs/zh-cn/docs/index.md b/site/src/content/docs/zh-cn/docs/index.md
index f5e25587e..662e38b59 100644
--- a/site/src/content/docs/zh-cn/docs/index.md
+++ b/site/src/content/docs/zh-cn/docs/index.md
@@ -1,21 +1,21 @@
---
title: 文档主页
-description: Agent-native 的开源个性化学习伴侣 —— 安装路径、产品形态、TutorBot 渠道与 CLI 参考。
+description: Agent-native 的开源个性化学习伴侣 —— 安装路径、产品界面、Partners 渠道与 CLI 参考。
---
欢迎来到 DeepTutor 中文文档。从下方任选一条路径,或使用左侧边栏导航。
## 从哪里开始
-- **[快速上手](/zh-cn/docs/get-started/)** —— 四种安装路径:PyPI、源码、Docker、纯 CLI。
-- **[探索 DeepTutor](/zh-cn/docs/explore/)** —— 五大核心界面(Chat / Co-Writer / Book / Knowledge / Space)以及记忆系统与设置中心。
-- **[TutorBot 渠道](/zh-cn/docs/tutorbot/)** —— 把持久化的 AI 导师接到 Telegram、Slack、飞书、Matrix 等通道。
-- **[DeepTutor CLI](/zh-cn/docs/cli/)** —— 在终端里驱动所有能力,或把它交给 AI 代理。
+- **[快速上手](/zh-cn/docs/get-started/)** —— PyPI、源码、Docker、纯 CLI 四种安装路径。
+- **[探索 DeepTutor](/zh-cn/docs/explore/)** —— Chat、Partners、Co-Writer、Book、Knowledge、Space、Memory、Settings。
+- **[Partners 伙伴与渠道](/zh-cn/docs/partners/)** —— 把持久学习伙伴接到个人微信、企业微信、QQ/NapCat 和其它 IM 渠道。
+- **[DeepTutor CLI](/zh-cn/docs/cli/)** —— 从终端驱动 capabilities、KB、sessions、notebooks、memory、books 和 partners。
- **[模型与搜索提供商](/zh-cn/docs/get-started/providers/)** —— 配置 LLM、Embedding、搜索引擎。
## DeepTutor 是什么
-一个开源、agent-native 的学习伴侣。**五种模式**(Chat / Solve / Quiz / Research / Visualize)共享同一个 session、知识库和引用历史。**TutorBot** 把你的上下文带到 Telegram、Slack、飞书等渠道。**三层记忆系统**(含可审查的 Memory Workbench 和 Memory Graph)让你随时审计 *为什么* 系统会记住某件事。
+DeepTutor 是开源、agent-native 的个性化学习伴侣。共享 runtime 驱动 Chat、深层 capabilities、Partners、Book generation、Co-Writer editing、RAG 和三层 Memory。Partners 把同一个 chat agent loop 带到 IM 渠道里,同时拥有自己的 soul、library、tools 和 workspace。
由香港大学数据智能实验室构建。Apache 2.0 协议。
@@ -26,4 +26,4 @@ description: Agent-native 的开源个性化学习伴侣 —— 安装路径、
- [Issue Tracker](https://github.com/HKUDS/DeepTutor/issues) —— Bug 反馈与功能建议
- [SKILL.md](https://github.com/HKUDS/DeepTutor/blob/main/SKILL.md) —— 写给驱动 DeepTutor 的 AI 代理的规范化交接文档
-> 提示:未翻译的页面会自动回落到英文版本。
+> 提示:本次新增的主文档页面均保持中英成对,切换语言时应落到对应页面。
diff --git a/site/src/content/docs/zh-cn/docs/partners/channels.md b/site/src/content/docs/zh-cn/docs/partners/channels.md
index a4e8b94b0..688fe00f0 100644
--- a/site/src/content/docs/zh-cn/docs/partners/channels.md
+++ b/site/src/content/docs/zh-cn/docs/partners/channels.md
@@ -7,25 +7,41 @@ Partner channels 是同一个 Partner brain 外面的投递适配器。它不会
大多数配置建议在 Web UI 完成:**Partners -> 你的 partner -> Channels** 会从 `/api/v1/partners/channels/schema` 渲染实时 schema,自动 mask secret 字段,并允许你 reload channels,而不需要手写 YAML。
+![Partner channel 配置卡片](/screenshots/partners-channels.png)
+
## 内置渠道
| 渠道 | Key | 连接模型 | 适合场景 | 核心字段 |
| --- | --- | --- | --- | --- |
-| WeChat | `weixin` | HTTP long-poll + 扫码登录 | 个人微信助手 | `allow_from`;可选 `token`、`state_dir`、`route_tag`、`poll_timeout` |
-| WeCom | `wecom` | 企业微信 AI Bot WebSocket | 企业微信 / WeChat Work | `bot_id`、`secret`、`allow_from` |
-| QQ | `qq` | 腾讯 botpy WebSocket | 官方 QQ Bot 部署 | `app_id`、`secret`、`allow_from`、`msg_format` |
-| QQ (NapCat) | `napcat` | OneBot v11 WebSocket | 通过 NapCat 接个人 QQ | `ws_url`、可选 `access_token`、`allow_from`、`group_policy` |
-| Telegram | `telegram` | Bot API polling | 简单个人/群 bot | `token`、`allow_from` |
-| Discord | `discord` | Gateway WebSocket | Discord server 和 DM | `token`、`allow_from`、群策略字段 |
-| Slack | `slack` | Socket Mode | Slack team、DM、threaded channel help | `bot_token`、`app_token`、`allow_from`、`group_policy` |
-| Feishu / Lark | `feishu` | Lark SDK WebSocket | 飞书 / Lark 企业聊天 | `app_id`、`app_secret`,以及 verification/encryption 字段 |
-| DingTalk | `dingtalk` | Stream Mode | 钉钉企业聊天 | 应用凭证、`allow_from`、群策略字段 |
-| Matrix | `matrix` | Matrix sync loop | 去中心化房间,可选 E2EE | `homeserver`、用户凭证或 `access_token`、`allow_from`、`group_policy` |
-| Zulip | `zulip` | Event queue | stream + topic 工作流 | `email`、`api_key`、`site`、`allow_from`、`group_policy` |
-| WhatsApp | `whatsapp` | Bridge WebSocket | 通过桥接运行时接 WhatsApp | bridge URL/token、`allow_from` |
-| Email | `email` | IMAP poll + SMTP send | 异步邮件答疑 / helpdesk | IMAP host/user/password、SMTP host/user/password、`allow_from` |
-| Mochat | `mochat` | Socket.IO 或 HTTP polling | 客服式聊天面板 | `base_url` / socket URL、`claw_token`、`allow_from` |
-| Microsoft Teams | `msteams` | 内置 HTTP webhook listener | Teams DM-first Bot Framework 集成 | `app_id`、`app_password`、`tenant_id`、host/port/path |
+| <img src="/channel-icons/weixin.svg" alt="" width="16" height="16" /> WeChat | `weixin` | HTTP long-poll + 扫码登录 | 个人微信助手 | `allow_from`;可选 `token`、`state_dir`、`route_tag`、`poll_timeout` |
+| <img src="/channel-icons/wecom.svg" alt="" width="16" height="16" /> WeCom | `wecom` | 企业微信 AI Bot WebSocket | 企业微信 / WeChat Work | `bot_id`、`secret`、`allow_from` |
+| <img src="/channel-icons/qq.svg" alt="" width="16" height="16" /> QQ | `qq` | 腾讯 botpy WebSocket | 官方 QQ Bot 部署 | `app_id`、`secret`、`allow_from`、`msg_format` |
+| <img src="/channel-icons/napcat.svg" alt="" width="16" height="16" /> QQ (NapCat) | `napcat` | OneBot v11 WebSocket | 通过 NapCat 接个人 QQ | `ws_url`、可选 `access_token`、`allow_from`、`group_policy` |
+| <img src="/channel-icons/telegram.svg" alt="" width="16" height="16" /> Telegram | `telegram` | Bot API polling | 简单个人/群 bot | `token`、`allow_from` |
+| <img src="/channel-icons/discord.svg" alt="" width="16" height="16" /> Discord | `discord` | Gateway WebSocket | Discord server 和 DM | `token`、`allow_from`、群策略字段 |
+| <img src="/channel-icons/slack.svg" alt="" width="16" height="16" /> Slack | `slack` | Socket Mode | Slack team、DM、threaded channel help | `bot_token`、`app_token`、`allow_from`、`group_policy` |
+| <img src="/channel-icons/feishu.svg" alt="" width="16" height="16" /> Feishu / Lark | `feishu` | Lark SDK WebSocket | 飞书 / Lark 企业聊天 | `app_id`、`app_secret`,以及 verification/encryption 字段 |
+| <img src="/channel-icons/dingtalk.svg" alt="" width="16" height="16" /> DingTalk | `dingtalk` | Stream Mode | 钉钉企业聊天 | 应用凭证、`allow_from`、群策略字段 |
+| <img src="/channel-icons/matrix.svg" alt="" width="16" height="16" /> Matrix | `matrix` | Matrix sync loop | 去中心化房间,可选 E2EE | `homeserver`、用户凭证或 `access_token`、`allow_from`、`group_policy` |
+| <img src="/channel-icons/zulip.svg" alt="" width="16" height="16" /> Zulip | `zulip` | Event queue | stream + topic 工作流 | `email`、`api_key`、`site`、`allow_from`、`group_policy` |
+| <img src="/channel-icons/whatsapp.svg" alt="" width="16" height="16" /> WhatsApp | `whatsapp` | Bridge WebSocket | 通过桥接运行时接 WhatsApp | bridge URL/token、`allow_from` |
+| <img src="/channel-icons/email.svg" alt="" width="16" height="16" /> Email | `email` | IMAP poll + SMTP send | 异步邮件答疑 / helpdesk | IMAP host/user/password、SMTP host/user/password、`allow_from` |
+| <img src="/channel-icons/mochat.svg" alt="" width="16" height="16" /> Mochat | `mochat` | Socket.IO 或 HTTP polling | 客服式聊天面板 | `base_url` / socket URL、`claw_token`、`allow_from` |
+| <img src="/channel-icons/msteams.svg" alt="" width="16" height="16" /> Microsoft Teams | `msteams` | 内置 HTTP webhook listener | Teams DM-first Bot Framework 集成 | `app_id`、`app_password`、`tenant_id`、host/port/path |
+
+## 安装依赖
+
+除 Matrix 外,所有内置 channel 都包含在 Partners extra 里:
+
+```bash
+pip install -e ".[partners]"
+# 或发布包支持 extras 时:
+pip install "deeptutor[partners]"
+```
+
+这一条命令会装齐全部 channel SDK——`python-telegram-bot`、`slack-sdk`、`lark-oapi`、`dingtalk-stream`、`qq-botpy`、`wecom-aibot-sdk`、`python-socketio` 等(完整清单见 `requirements/partners.txt`)。Email 只用 Python 标准库,不需要额外的包。Matrix 单独成 extra,因为加密房间依赖原生 `libolm` 库:普通房间装 `".[matrix]"`,E2EE 加密房间装 `".[matrix-e2e]"`。
+
+如果服务器上缺某个 channel 的依赖,Channels 面板会把该 channel 置灰,并显示 import 错误(例如 `No module named 'lark_oapi'`)。装上缺的包、重启 DeepTutor,卡片就能编辑了。
## 共享投递开关
@@ -69,6 +85,19 @@ Docker 或生产部署要持久化整个 `data/partners/`。丢失 runtime state
## 详细页面
-- [WeChat](/zh-cn/docs/partners/weixin/) —— 个人微信扫码登录和 long-poll 配置
-- [WeCom](/zh-cn/docs/partners/wecom/) —— 企业微信 AI Bot 配置
-- [QQ / NapCat](/zh-cn/docs/partners/qq/) —— 官方 QQ bot 和个人 QQ bridge 两条路径
+每个内置 channel 都有专属配置页:平台侧申请步骤、对着截图逐字段讲解 channel card、配完后的验证流程和故障排查:
+
+- <img src="/channel-icons/weixin.svg" alt="" width="16" height="16" /> [WeChat](/zh-cn/docs/partners/weixin/) —— 个人微信扫码登录和 long-poll 配置
+- <img src="/channel-icons/wecom.svg" alt="" width="16" height="16" /> [WeCom](/zh-cn/docs/partners/wecom/) —— 企业微信 AI Bot 配置
+- <img src="/channel-icons/qq.svg" alt="" width="16" height="16" /> [QQ / NapCat](/zh-cn/docs/partners/qq/) —— 官方 QQ bot 和个人 QQ bridge 两条路径
+- <img src="/channel-icons/telegram.svg" alt="" width="16" height="16" /> [Telegram](/zh-cn/docs/partners/telegram/) —— BotFather 注册、Bot API 轮询、流式回复
+- <img src="/channel-icons/discord.svg" alt="" width="16" height="16" /> [Discord](/zh-cn/docs/partners/discord/) —— Developer Portal 应用、intents、Gateway WebSocket
+- <img src="/channel-icons/slack.svg" alt="" width="16" height="16" /> [Slack](/zh-cn/docs/partners/slack/) —— Socket Mode 应用(bot + app 双 token)
+- <img src="/channel-icons/feishu.svg" alt="" width="16" height="16" /> [Feishu / Lark](/zh-cn/docs/partners/feishu/) —— 开放平台应用和 CardKit 流式卡片
+- <img src="/channel-icons/dingtalk.svg" alt="" width="16" height="16" /> [DingTalk](/zh-cn/docs/partners/dingtalk/) —— Stream Mode 企业机器人
+- <img src="/channel-icons/matrix.svg" alt="" width="16" height="16" /> [Matrix](/zh-cn/docs/partners/matrix/) —— homeserver 凭证和可选 E2EE
+- <img src="/channel-icons/zulip.svg" alt="" width="16" height="16" /> [Zulip](/zh-cn/docs/partners/zulip/) —— bot 账号和 stream 订阅
+- <img src="/channel-icons/whatsapp.svg" alt="" width="16" height="16" /> [WhatsApp](/zh-cn/docs/partners/whatsapp/) —— bridge 运行时配置
+- <img src="/channel-icons/email.svg" alt="" width="16" height="16" /> [Email](/zh-cn/docs/partners/email/) —— IMAP 收件轮询和 SMTP 回信
+- <img src="/channel-icons/mochat.svg" alt="" width="16" height="16" /> [Mochat](/zh-cn/docs/partners/mochat/) —— Socket.IO 客服面板
+- <img src="/channel-icons/msteams.svg" alt="" width="16" height="16" /> [Microsoft Teams](/zh-cn/docs/partners/msteams/) —— Bot Framework webhook 监听
diff --git a/site/src/content/docs/zh-cn/docs/partners/dingtalk.md b/site/src/content/docs/zh-cn/docs/partners/dingtalk.md
new file mode 100644
index 000000000..434e8add4
--- /dev/null
+++ b/site/src/content/docs/zh-cn/docs/partners/dingtalk.md
@@ -0,0 +1,81 @@
+---
+title: DingTalk(钉钉)
+description: 为 Partner 配置钉钉渠道——企业内部应用、Stream Mode 连接、无需公网回调。
+---
+
+<img src="/channel-icons/dingtalk.svg" alt="" width="40" height="40" />
+
+`dingtalk` channel 通过官方 `dingtalk-stream` SDK 的 **Stream Mode** 把 Partner 接到钉钉企业机器人上:收消息走 DeepTutor 主动发起的出站连接,不需要公网 IP,也不需要 HTTP 回调地址;回复走钉钉 HTTP API,以 markdown 消息发出,私聊和群聊都支持。如果你的组织用钉钉,整个接入只需要两个凭证——Client ID 和 Client Secret。
+
+![钉钉渠道配置](/screenshots/partners-channel-dingtalk.png)
+
+## 安装依赖
+
+钉钉支持已包含在 Partners extra 里,底层是官方 `dingtalk-stream` SDK,不需要额外安装任何东西。
+
+```bash
+pip install -e ".[partners]"
+# 或发布包支持 extras 时:
+pip install "deeptutor[partners]"
+```
+
+## 在开放平台创建企业内部应用
+
+1. 用有开发权限的账号登录[钉钉开放平台](https://open.dingtalk.com/)。
+2. 进入**应用开发**,创建一个**企业内部应用**,填好名称、描述、图标。
+3. 在应用里添加**机器人**能力(应用能力 -> 机器人),配置机器人的名称和头像。
+4. 在机器人的消息接收设置里,把接收模式选为 **Stream 模式**(不是 HTTP 回调)——免公网地址全靠它。
+5. 在**凭证与基础信息**页复制 **Client ID**(AppKey)和 **Client Secret**(AppSecret),待会儿填进 channel card。
+6. **发布应用版本。** 草稿状态的机器人收不到任何 Stream 消息。发布后设置好可用范围,再在钉钉里把机器人加上(通讯录里搜索,或拉进群)。
+
+## 配置 channel card
+
+打开 **Partners -> 你的 partner -> Channels -> DingTalk**。
+
+| 字段 | 怎么填 |
+| --- | --- |
+| **Send Progress** | 测试时建议开启。长任务会把过程 narration 实时发过来。 |
+| **Send Tool Hints** | 调试时建议开启;不想让用户看到一行工具调用就关掉。 |
+| **Enabled** | 准备启动 channel 时再打开。 |
+| **Client Id** | 凭证与基础信息页的 AppKey(一般 `ding...` 开头)。 |
+| **Client Secret** | 同页的 AppSecret。按 secret 存储,保存后会打码。 |
+| **Allow From** | 一行一个值。测试可填 `*` 表示开放;正式用换成钉钉 staff id(每条入站消息的 sender id 都会打在 partner 日志里)。空列表会拒绝所有人。 |
+
+回复以 markdown 消息发出,标题、列表、链接在钉钉里都能正常渲染。语音消息也能处理:钉钉自带的语音转文字结果会以纯文本转给 partner。
+
+## 保存之后
+
+1. 点 **Save**,把 **Enabled** 打开。
+2. 启动 partner(已在运行的话重启,或在 Channels 面板上用 reload)。
+3. 用允许的账号在钉钉里找到机器人,私聊发一条短消息——或在它所在的群里 @ 它。
+4. 看 partner 日志:能看到 `Received DingTalk message from <name> (<id>)`,随后是回复投递。
+5. 在日志里确认 sender id 之后,把 **Allow From** 里的 `*` 换成真实 id。
+
+## 如何确认健康
+
+- 日志出现 `DingTalk bot started with Stream Mode`,且没有反复刷 `Reconnecting DingTalk stream in 5 seconds...`。
+- 允许的账号私聊一条短消息,能收到 markdown 回复。
+- 在群里 @ 机器人,回答会路由回那个群。
+
+## 常见问题
+
+### Stream 连接反复重连
+
+掉线后 channel 每 5 秒自动重试,偶尔一条重连日志无伤大雅;连成一串刷屏就是凭证错了或网络到不了钉钉的服务端——先重查 **Client Id** / **Client Secret**。
+
+### `Failed to get DingTalk access token`
+
+发消息要用同一对凭证换 access token。出这个错基本就是 **Client Secret** 在平台上被轮换过——去凭证与基础信息页抄最新的值,重新保存。
+
+### 连上了但收不到消息
+
+平台侧查三件事:应用版本**已发布**(草稿收不到)、消息接收模式是 **Stream 模式**、机器人确实够得着——在可用范围内,并且已经加进你测试用的会话。
+
+### 机器人从不回复
+
+几乎都是 **Allow From** 的问题。空列表会拒绝所有人——包括你自己。先填 `*` 测一轮,再换成日志里打印的 staff id。
+
+## 相关页面
+
+- [Channel Matrix](/zh-cn/docs/partners/channels/) — 所有 channel 一览
+- [Feishu](/zh-cn/docs/partners/feishu/) — 另一大国内办公 IM,同样免 webhook
diff --git a/site/src/content/docs/zh-cn/docs/partners/discord.md b/site/src/content/docs/zh-cn/docs/partners/discord.md
new file mode 100644
index 000000000..e61c7b2f4
--- /dev/null
+++ b/site/src/content/docs/zh-cn/docs/partners/discord.md
@@ -0,0 +1,89 @@
+---
+title: Discord
+description: 为 Partner 配置 Discord channel —— Developer Portal 应用、Gateway WebSocket、intents、原地编辑的流式回复。
+---
+
+<img src="/channel-icons/discord.svg" alt="" width="40" height="40" />
+
+`discord` channel 通过 **Gateway WebSocket**(API v10)把 Partner 接到一个 Discord bot 上。DeepTutor 直接实现 gateway 协议 —— 不依赖 `discord.py` —— 心跳和重连都自己处理。和 Telegram 一样,不需要公网 IP 或 webhook;是 bot 主动拨出去连 Discord。
+
+支持 **Streaming**:开关打开后,bot 只发一条消息,随着回复生成不断通过 REST API patch 它,让回答原地长出来。
+
+![Discord 渠道配置](/screenshots/partners-channel-discord.png)
+
+## 安装依赖
+
+Discord 支持随 Partners extra 一起安装;gateway 客户端基于 `websockets` 实现,已经包含在内。
+
+```bash
+pip install -e ".[partners]"
+# 或发布包支持 partners extras 时:
+pip install "deeptutor[partners]"
+```
+
+## 创建 Discord 应用
+
+1. 打开 <https://discord.com/developers/applications>,点 **New Application**,起个名字。
+2. 左侧边栏进 **Bot**。在 **TOKEN** 下点 **Reset Token**,复制出来 —— 这就是要填进 **Token** 字段的值。
+3. 还在 **Bot** 页,在 **Privileged Gateway Intents** 下启用 **MESSAGE CONTENT INTENT**。不开的话 bot 收到的消息正文是空的。**Server Members Intent** 可开可不开。
+4. 把 bot 邀请进你的服务器:**OAuth2** -> **URL Generator**,勾上 `bot` scope,再勾权限 `Send Messages`、`Read Message History`、`Attach Files`、`Embed Links`、`Add Reactions`。打开生成的 URL,选服务器,**Authorize**。
+5. 收集 **Allow From** 要用的用户 id:Discord 设置 -> **Advanced** -> 打开 **Developer Mode**,然后右键任意用户 -> **Copy User ID**。
+
+## 配置 channel card
+
+打开 **Partners -> 你的 partner -> Channels -> Discord**。
+
+| 字段 | 怎么填 |
+| --- | --- |
+| **Streaming** | 默认关闭。打开后回复实时流式输出:文本一边生成,一边原地编辑消息。依赖 **Send Progress**:narration 轮次也会随生成实时流出。 |
+| **Send Progress** | 测试时建议开启。长任务会实时投递过程 narration。 |
+| **Send Tool Hints** | 调试时建议开启;不想让用户看到一行工具调用就关掉。 |
+| **Enabled** | 准备启动 channel 时再打开。 |
+| **Token** | Developer Portal 里的 bot token(**Bot** -> **Reset Token**)。按密钥存储,保存后会打码显示。 |
+| **Allow From** | 一行一个值。开放测试 bot 可填 `*`,正式用填 Discord 用户 id(开 Developer Mode 后右键 -> Copy User ID)。空列表拒绝所有人。 |
+| **Gateway Url** | 默认 `wss://gateway.discord.gg/?v=10&encoding=json`。除非你要代理 gateway,否则别改。 |
+| **Intents** | Gateway intent 位字段。默认 `37377` 覆盖 Guilds、Guild Messages、Direct Messages 和 Message Content。这个数字里包含的特权 intent,必须同时在 Developer Portal 里启用。 |
+| **Group Policy** | `mention`(默认):服务器频道里只有被 @ 时才答。`open`:能读到的频道里每条消息都答。私聊永远会回复。 |
+
+超过 Discord 2000 字符上限的回复会自动拆成多条消息。
+
+## 保存之后
+
+1. 点 **Save**,再把 **Enabled** 打开。
+2. 启动 partner(已经在跑的话重启它,或在 Channels 面板用 reload)。
+3. 用允许的账号私聊 bot,或在服务器频道里 @ 它。
+4. 看 partner 日志:应该能看到 gateway 连接、入站消息和回复投递。
+5. 在日志里确认 sender id 之后,把 **Allow From** 里的 `*` 换成真实 id。
+
+## 如何确认健康
+
+- 日志显示 gateway 已连接、心跳正常,没有反复重连。
+- bot 在服务器成员列表里显示 **online**。
+- 允许的账号私聊能收到回复,服务器频道里 @ 它也能收到。
+
+## 常见问题
+
+### gateway 以 `4014: Disallowed intent` 断开
+
+**Intents** 这个数字请求了某个未在 Developer Portal 启用的特权 intent。最常见的就是 Message Content:打开你的应用 -> **Bot** -> 启用 **MESSAGE CONTENT INTENT**,然后重启 partner。
+
+### bot 在线但从来不回复
+
+查两个地方:
+
+1. **Allow From** —— 空列表拒绝所有人。先用 `*` 测试,再换成你的真实用户 id。
+2. **MESSAGE CONTENT INTENT** —— 不开的话,服务器消息送达时 `content` 是空的,bot 无话可答。去 portal 里启用。
+
+### 服务器频道里不回复,私聊正常
+
+**Group Policy** = `mention` 时,消息必须真的 @ 到 bot。另外确认邀请 bot 时给了它在该频道的 `Send Messages` 和 `Read Message History` 权限。
+
+### Streaming 开了但没有流式效果
+
+**Streaming** 依赖 **Send Progress** —— 两个都要打开。另外 Discord 对消息编辑有频率限制,原地更新是一块一块到的,不会逐字蹦出来;这是正常现象。
+
+## 相关页面
+
+- [Channel Matrix](/zh-cn/docs/partners/channels/) —— 所有 channel 一览
+- [Telegram](/zh-cn/docs/partners/telegram/) —— 更简单的 polling 模型,同一个流式开关
+- [Slack](/zh-cn/docs/partners/slack/) —— 类似的开发者后台配置体验,走 Socket Mode
diff --git a/site/src/content/docs/zh-cn/docs/partners/email.md b/site/src/content/docs/zh-cn/docs/partners/email.md
new file mode 100644
index 000000000..5d7f8b480
--- /dev/null
+++ b/site/src/content/docs/zh-cn/docs/partners/email.md
@@ -0,0 +1,98 @@
+---
+title: Email
+description: 使用 IMAP 轮询收信、SMTP 回信,为 Partner 配置 email channel。
+---
+
+<img src="/channel-icons/email.svg" alt="" width="40" height="40" />
+
+`email` channel 把 Partner 变成一个异步的邮件通信者:轮询 IMAP 收件箱里的未读邮件,通过 SMTP 回信。没有实时连接——一来一回就是一个轮询周期——所以很适合 help-desk 式的支持场景,以及那些就是更喜欢邮件、不爱用聊天软件的用户。
+
+![Email 渠道配置](/screenshots/partners-channel-email.png)
+
+## 安装依赖
+
+什么都不用装。email channel 完全基于 Python 标准库(`imaplib` + `smtplib`),任何 DeepTutor 安装都能直接跑——不需要额外的 pip 包,也不需要 extras。
+
+## 准备邮箱账号
+
+Partner 需要一个自己的邮箱,开通 IMAP 和 SMTP。不要复用个人邮箱:channel 会读取并回复所有未读邮件。
+
+**Gmail**
+
+1. 给账号开启两步验证(2-Step Verification)。
+2. 创建一个 [App Password](https://myaccount.google.com/apppasswords)——16 位密码,代替账号密码使用。开了 2FA 之后,普通密码在 IMAP/SMTP 上会被拒绝。
+3. 确认 IMAP 已开启:Gmail 设置 -> **Forwarding and POP/IMAP** -> Enable IMAP。
+4. 服务器地址:`imap.gmail.com:993`(SSL)和 `smtp.gmail.com:587`(STARTTLS)。
+
+**Outlook / Office 365** —— 开了 2FA 的情况下,App Password 用法相同(前提是租户允许);不行就找管理员。
+
+**自建邮件服务**(Postfix、Maddy 等)—— 直接用账号密码,host 和端口填自己的。
+
+## 配置 channel card
+
+打开 **Partners -> 你的 partner -> Channels -> Email**。
+
+| 字段 | 怎么填 |
+| --- | --- |
+| **Send Progress** | 每条过程更新都是一封单独的邮件。第一次测试可以开;多数部署会关掉,免得邮箱被刷屏。 |
+| **Send Tool Hints** | 同样的问题——一条 hint 一封邮件。调试之外建议关闭。 |
+| **Enabled** | 准备开始轮询时再打开。 |
+| **Consent Granted** | 硬性隐私闸门。没打开之前 channel 拒绝读写任何邮件。务必在邮箱所有者明确同意让 DeepTutor 处理收件箱之后再开。 |
+| **Imap Host** | 如 `imap.gmail.com`。 |
+| **Imap Port** | 默认 `993`(IMAP over SSL)。 |
+| **Imap Username** | 通常是完整邮箱地址,如 `[email protected]`。 |
+| **Imap Password** | App Password(Gmail/Outlook 开 2FA 时)或账号密码(自建服务)。以 secret 方式存储。 |
+| **Imap Mailbox** | 默认 `INBOX`。有些服务商的文件夹名拼法不一样——轮询收不到邮件时去 webmail 里确认一下。 |
+| **Imap Use Ssl** | 端口 993 时保持开启。 |
+| **Smtp Host** | 如 `smtp.gmail.com`。 |
+| **Smtp Port** | 默认 `587`(STARTTLS)。配合 **Smtp Use Ssl** 时用 `465`。 |
+| **Smtp Username** | 通常和 Imap Username 一样。 |
+| **Smtp Password** | 通常是同一个 App Password。以 secret 方式存储。 |
+| **Smtp Use Tls** | 端口 587 上的 STARTTLS。除非换用下面的隐式 SSL,否则保持开启。 |
+| **Smtp Use Ssl** | 隐式 SSL,一般配端口 465。两个 TLS 选项二选一,不要同时开。 |
+| **From Address** | 可选。留空时回退到 Smtp Username,再回退到 Imap Username。 |
+| **Auto Reply Enabled** | 关闭后 Partner 不再自动回复入站邮件(主动发送不受影响)。测试时可以当刹车用。 |
+| **Poll Interval Seconds** | 默认 `30`。检查收件箱的频率;小于 5 的值会被钳到 5。 |
+| **Mark Seen** | 把处理过的邮件标为已读——这是最主要的去重保护。保持开启。 |
+| **Max Body Chars** | 默认 `12000`。超长正文会在进入 Partner 之前被截断。 |
+| **Subject Prefix** | 默认 `Re: `。回信主题会加上这个前缀,除非原主题已经以 `Re:` 开头。 |
+| **Allow From** | 一行一个邮箱地址,全小写。测试可填 `*` 表示开放。空列表拒绝所有人。 |
+
+每个不同的发件人地址是一个独立 session;回信带 `In-Reply-To` header,在对方的邮件客户端里能正确归到同一个会话线程。
+
+## 保存之后
+
+1. 点 **Save**,然后把 **Enabled** 和 **Consent Granted** 都打开,再保存一次。
+2. 启动 partner——从 UI,或 `deeptutor partner start <partner-id>`。如果已经在运行,重启一下让 channel 读到新配置。
+3. 用 **Allow From** 里列出的地址发一封测试邮件,最多等一个轮询周期收回复。
+4. 回复正常后,把 **Allow From** 里的 `*` 换成真正要服务的地址。
+
+## 如何确认健康
+
+健康的 email channel 通常有三个迹象:
+
+- 日志显示 `Starting Email channel (IMAP polling mode)...`,没有 `missing:` 或 consent 警告;
+- 允许的发件人发一封测试邮件,大约一个轮询周期内能收到回复;
+- 处理过的邮件在邮箱里显示为已读(**Mark Seen** 开启时)。
+
+## 常见问题
+
+### channel 启动了但什么都不做
+
+看日志。`consent_granted is false` 说明 consent 闸门没开——这是刻意设计的阻力,请有意识地打开 **Consent Granted**。`Email channel not configured, missing: ...` 会列出六个必填字段(IMAP/SMTP 的 host、username、password)里具体哪几个是空的。
+
+### IMAP authentication failed
+
+Gmail 和 Outlook 开了 2FA 之后,账号密码在 IMAP/SMTP 上永远不可用——必须用 App Password。同时确认服务商设置里 IMAP 已开启;Gmail 默认是关的。
+
+### 同一封邮件收到重复回复
+
+**Mark Seen** 是主要的去重手段:关掉它,每次轮询都会重读同一封未读邮件。另外确保只有一个运行中的 partner 在轮询这个邮箱——两个实例会互相打架。
+
+### 和自动回复机器人互刷
+
+如果 Partner 给一个会自动回复的地址发信(休假自动回复、其他 bot),双方可能每个轮询周期互怼一轮。把 **Allow From** 收紧,陌生人的自动回复直接挡在门外;紧急时关掉 **Auto Reply Enabled** 当刹车。
+
+### 回信进了垃圾箱
+
+设置一个正经的 **From Address**;自建域名要补上 SPF/DKIM/DMARC 记录,或者把出站邮件中转到可信的 SMTP 服务。
diff --git a/site/src/content/docs/zh-cn/docs/partners/feishu.md b/site/src/content/docs/zh-cn/docs/partners/feishu.md
new file mode 100644
index 000000000..8173af774
--- /dev/null
+++ b/site/src/content/docs/zh-cn/docs/partners/feishu.md
@@ -0,0 +1,90 @@
+---
+title: Feishu(飞书)
+description: 为 Partner 配置飞书 / Lark 渠道——开放平台建应用、WebSocket 长连接、CardKit 流式卡片。
+---
+
+<img src="/channel-icons/feishu.svg" alt="" width="40" height="40" />
+
+`feishu` channel 通过官方 `lark-oapi` SDK 的 **WebSocket 长连接** 把 Partner 接到飞书(或国际版 Lark)自建应用上:连接由 DeepTutor 主动发起,不需要公网 IP、不需要 webhook 回调、不需要反向代理。国内飞书(`open.feishu.cn`)和国际版 Lark(`open.larksuite.com`)用的是同一个 channel,是在国内组织里跑工作助手的首选。
+
+这个 channel 还支持 **Streaming**:开关打开后,回复会以 CardKit 流式卡片的形式实时打字渲染,边生成边显示。
+
+![飞书渠道配置](/screenshots/partners-channel-feishu.png)
+
+## 安装依赖
+
+飞书支持已包含在 Partners extra 里,底层是官方 `lark-oapi` SDK,不需要额外安装任何东西。
+
+```bash
+pip install -e ".[partners]"
+# 或发布包支持 extras 时:
+pip install "deeptutor[partners]"
+```
+
+## 在开放平台创建应用
+
+1. 打开[飞书开放平台](https://open.feishu.cn/)(国际版用 [Lark 开放平台](https://open.larksuite.com/)),进入开发者后台,创建一个**自建应用**,填好名称、描述、图标。
+2. 在**凭证与基础信息**页复制 **App ID**(`cli_...`)和 **App Secret**,待会儿填进 channel card。
+3. **应用能力 -> 机器人**:开通机器人能力,设置机器人的名称和头像。
+4. **事件与回调**:把订阅方式切换为**长连接**(事件走 WebSocket 而不是 webhook),然后订阅 `im.message.receive_v1` 事件。
+5. **权限管理**:开通消息相关权限——至少 `im:message`(以机器人身份收发消息);想让图片、文件、语音也能进来,再加 `im:resource`。
+6. **创建版本并发布。** 自建应用走企业内发布加管理员审批。版本不发布,机器人什么都收不到——这是最常见的配置失误。
+
+如果你在平台上开启了事件加密(事件与回调里的加密设置),记下 **Encrypt Key** 和 **Verification Token**,它们需要同步填进 channel card。
+
+## 配置 channel card
+
+打开 **Partners -> 你的 partner -> Channels -> Feishu**。
+
+| 字段 | 怎么填 |
+| --- | --- |
+| **Streaming** | 默认关闭。打开后回复用 CardKit 流式卡片实时打字渲染。依赖 **Send Progress**:过程 narration 也会逐轮流式输出。 |
+| **Send Progress** | 测试时建议开启。长任务会把过程 narration 实时发过来。 |
+| **Send Tool Hints** | 调试时建议开启;不想让用户看到一行工具调用就关掉。 |
+| **Enabled** | 准备启动 channel 时再打开。 |
+| **App Id** | 凭证与基础信息页的 App ID,`cli_...` 开头。 |
+| **App Secret** | 同页的 App Secret。按 secret 存储,保存后会打码。 |
+| **Encrypt Key** | 只有在平台开启了事件加密时才需要填,否则留空。 |
+| **Verification Token** | 平台的事件 Verification Token,用于事件签名校验。没配置就留空。 |
+| **Allow From** | 一行一个值。测试可填 `*` 表示开放;正式用换成 `ou_...` open id(发一条消息后从 partner 日志里抄)。空列表会拒绝所有人。 |
+| **React Emoji** | 机器人收到消息后立刻回应的表情,相当于"已读"确认。默认 `THUMBSUP`;常用的还有 `OK`、`EYES`、`DONE`、`OnIt`、`HEART`。 |
+| **Group Policy** | `mention`(默认):群里只有被 @ 才回答。`open`:群里每条消息都回答。私聊永远会回复。 |
+
+出站消息格式由 DeepTutor 自动挑选:短的纯文本直接发文本消息,只带链接的发富文本 post,含标题、代码块、列表、表格的发交互卡片。飞书每张卡片只允许一个表格,多表格回复会自动拆成几张卡片。
+
+## 保存之后
+
+1. 点 **Save**,把 **Enabled** 打开。
+2. 启动 partner(已在运行的话重启,或在 Channels 面板上用 reload)。
+3. 用允许的账号在飞书里私聊机器人,发一条短消息。
+4. 看 partner 日志:能看到入站事件,并且你发的消息几乎立刻被加上 React Emoji 表情回应。
+5. 在日志里确认 `ou_...` sender id 之后,把 **Allow From** 里的 `*` 换成真实 id。
+
+## 如何确认健康
+
+- 日志出现 `Feishu bot started with WebSocket long connection`,且没有反复刷 `Feishu WebSocket error`(掉线后 channel 每 5 秒自动重连)。
+- 测试消息立刻收到 React Emoji 回应——说明入站事件和出站 API 凭证都通了。
+- 回复正常送达;开了 **Streaming** 的话,能看到卡片实时打字,而不是最后一次性出一条。
+
+## 常见问题
+
+### 机器人什么都收不到
+
+三道门必须全开:应用版本**已发布**(不是草稿)、订阅了 `im.message.receive_v1` 事件、订阅方式是**长连接**。版本没发布是最常见的原因,先查它。
+
+### 收得到消息但回复失败
+
+多半是权限没开。确认 `im:message` 已开通(收发媒体还要 `im:resource`),然后**重新发布一个版本**——权限变更只在发布后生效。具体 API 错误码会打在 partner 日志里。
+
+### 开启加密后事件全部失败
+
+平台上配了 Encrypt Key,channel card 里就必须填同一个值(连同 Verification Token),反过来也一样。在平台上轮换过任何一个值,都要更新 card 并重启 partner。
+
+### Streaming 卡片不打字
+
+**Streaming** 依赖 **Send Progress**,必须一起开。如果 CardKit 卡片创建失败(日志里搜 `Failed to create Feishu streaming card`),channel 会退回到回合结束后发一张普通卡片——回复还在,只是没有打字效果。
+
+## 相关页面
+
+- [Channel Matrix](/zh-cn/docs/partners/channels/) — 所有 channel 一览
+- [DingTalk](/zh-cn/docs/partners/dingtalk/) — 另一大国内办公 IM,同样免 webhook
diff --git a/site/src/content/docs/zh-cn/docs/partners/index.md b/site/src/content/docs/zh-cn/docs/partners/index.md
new file mode 100644
index 000000000..b3ea21558
--- /dev/null
+++ b/site/src/content/docs/zh-cn/docs/partners/index.md
@@ -0,0 +1,84 @@
+---
+title: 伙伴与渠道
+description: DeepTutor Partners 的运维文档:渠道配置、工作区布局和 IM 投递行为。
+---
+
+Partners 是可以存在于 Web UI 和外部 IM 应用里的持久 DeepTutor 伙伴。它不是第二套 bot engine。每条入站消息都会变成一个作用域在该 Partner 下的普通 chat-agent turn:
+
+```text
+IM / Web message -> PartnerRunner -> ChatOrchestrator -> AgenticChatPipeline -> tools -> reply
+```
+
+## 和旧 TutorBot 的区别
+
+| 旧 TutorBot | 新 Partner |
+| --- | --- |
+| 独立 bot engine,工作区在 `data/tutorbot/<id>/` | 复用 Chat loop,作用域在 `data/partners/<id>/workspace/` |
+| `deeptutor bot ...` 命令 | `deeptutor partner list/create/start/stop` |
+| 手写 bot YAML 里的 channels | Partners UI 中按 schema 渲染的 channel cards |
+| bot skills / memory 独立处理 | 分配的 KB、skills、notebooks、tools、memory 像普通 chat context 一样挂载 |
+
+旧 `/docs/tutorbot/*` 链接会保留为简短迁移提示页,避免外部链接硬 404。
+
+## 推荐配置流程
+
+1. 在 **Partners -> New partner** 创建 Partner。
+2. 启用任何 channel 前,先填好 **Identity** 和 **Soul**。第一条 IM 回复就会使用这个 soul。
+3. 在 **Mind** 里选择模型;测试阶段先少开可选工具。
+4. 在 **Library** 里先分配一个小 KB 或 skill。资源会复制进 Partner workspace。
+5. 在 **Channels** 里先只启用一个 channel,并从本地/私有测试开始。
+6. 调试时保留 `send_progress` 和 `send_tool_hints`,生产环境再按需要关闭。
+7. 对真实用户开放前,把 `allow_from: ["*"]` 换成明确 sender ids。
+
+![Partner 详情](/screenshots/partners-detail.png)
+
+## Channel 入口
+
+| Channel | 适用场景 | 页面 |
+| --- | --- | --- |
+| <img src="/channel-icons/weixin.svg" alt="" width="16" height="16" /> WeChat (`weixin`) | 个人微信,扫码登录,HTTP long-poll | [WeChat](/zh-cn/docs/partners/weixin/) |
+| <img src="/channel-icons/wecom.svg" alt="" width="16" height="16" /> WeCom (`wecom`) | 企业微信 / WeChat Work AI Bot 平台 | [WeCom](/zh-cn/docs/partners/wecom/) |
+| <img src="/channel-icons/qq.svg" alt="" width="16" height="16" /> QQ (`qq`) | 腾讯官方 QQ Bot,botpy SDK | [QQ / NapCat](/zh-cn/docs/partners/qq/) |
+| <img src="/channel-icons/napcat.svg" alt="" width="16" height="16" /> NapCat (`napcat`) | 个人 QQ,通过 OneBot v11 / NapCat 接入 | [QQ / NapCat](/zh-cn/docs/partners/qq/) |
+| <img src="/channel-icons/telegram.svg" alt="" width="16" height="16" /> Telegram (`telegram`) | 上手最快——BotFather 拿 token,无需公网 IP | [Telegram](/zh-cn/docs/partners/telegram/) |
+| <img src="/channel-icons/discord.svg" alt="" width="16" height="16" /> Discord (`discord`) | Discord server 和 DM,Gateway WebSocket | [Discord](/zh-cn/docs/partners/discord/) |
+| <img src="/channel-icons/slack.svg" alt="" width="16" height="16" /> Slack (`slack`) | Slack team,Socket Mode,线程回复 | [Slack](/zh-cn/docs/partners/slack/) |
+| <img src="/channel-icons/feishu.svg" alt="" width="16" height="16" /> Feishu (`feishu`) | 飞书 / Lark,CardKit 流式卡片 | [Feishu](/zh-cn/docs/partners/feishu/) |
+| <img src="/channel-icons/dingtalk.svg" alt="" width="16" height="16" /> DingTalk (`dingtalk`) | 钉钉企业机器人,Stream Mode | [DingTalk](/zh-cn/docs/partners/dingtalk/) |
+| <img src="/channel-icons/matrix.svg" alt="" width="16" height="16" /> Matrix (`matrix`) | 去中心化房间,可选 E2EE | [Matrix](/zh-cn/docs/partners/matrix/) |
+| <img src="/channel-icons/zulip.svg" alt="" width="16" height="16" /> Zulip (`zulip`) | stream + topic 结构化团队聊天 | [Zulip](/zh-cn/docs/partners/zulip/) |
+| <img src="/channel-icons/whatsapp.svg" alt="" width="16" height="16" /> WhatsApp (`whatsapp`) | 通过 bridge 运行时接 WhatsApp | [WhatsApp](/zh-cn/docs/partners/whatsapp/) |
+| <img src="/channel-icons/email.svg" alt="" width="16" height="16" /> Email (`email`) | IMAP/SMTP 异步收发件箱工作流 | [Email](/zh-cn/docs/partners/email/) |
+| <img src="/channel-icons/mochat.svg" alt="" width="16" height="16" /> Mochat (`mochat`) | 客服式聊天面板 | [Mochat](/zh-cn/docs/partners/mochat/) |
+| <img src="/channel-icons/msteams.svg" alt="" width="16" height="16" /> Microsoft Teams (`msteams`) | Teams,Bot Framework webhook 监听 | [Microsoft Teams](/zh-cn/docs/partners/msteams/) |
+
+各渠道的连接模型、必填字段和投递开关对照,请看 [渠道矩阵](/zh-cn/docs/partners/channels/)。
+
+## 运行时状态
+
+```text
+data/partners/<partner_id>/
+├── config.yaml # Partner identity, model, channels, tools
+├── sessions.db # Partner conversation store
+├── workspace/
+│ ├── knowledge_bases/ # 复制过来的 assigned KBs
+│ └── user/
+│ ├── workspace/SOUL.md
+│ ├── workspace/skills/<name>/SKILL.md
+│ ├── workspace/notebook/
+│ └── workspace/memory/
+└── runtime/
+ └── <channel>/... # QR tokens, cursors, conversation refs
+```
+
+分配资源会复制进 Partner workspace,这是刻意设计:即使原用户 workspace 后续变化,Partner 仍保留稳定 library。
+
+## Web UI vs CLI
+
+配置 channel 推荐用 Web UI,因为它会从 `/api/v1/partners/channels/schema` 渲染实时 schema,并自动 mask secret 字段。CLI 更适合 lifecycle 检查:
+
+```bash
+deeptutor partner list
+deeptutor partner start math-tutor
+deeptutor partner stop math-tutor
+```
diff --git a/site/src/content/docs/zh-cn/docs/partners/matrix.md b/site/src/content/docs/zh-cn/docs/partners/matrix.md
new file mode 100644
index 000000000..de3fd0578
--- /dev/null
+++ b/site/src/content/docs/zh-cn/docs/partners/matrix.md
@@ -0,0 +1,112 @@
+---
+title: Matrix
+description: 为 Partner 配置 Matrix channel——任意 homeserver、long-poll sync、可选端到端加密。
+---
+
+<img src="/channel-icons/matrix.svg" alt="" width="40" height="40" />
+
+`matrix` channel 通过标准 client-server API 把 Partner 接入去中心化的 Matrix 房间。任何 homeserver 都行——matrix.org,或自建的 Synapse / Conduit / Dendrite——端到端加密是可选项,多数安装不必为 libolm 依赖买单。
+
+![Matrix 渠道配置](/screenshots/partners-channel-matrix.png)
+
+## 安装依赖
+
+Matrix **不在** Partners extra 里——它自带两个独立的 extras:
+
+```bash
+# plain Matrix (unencrypted rooms)
+pip install -e ".[matrix]"
+
+# Matrix including end-to-end encrypted rooms
+pip install -e ".[matrix-e2e]"
+```
+
+- `[matrix]` 安装 `matrix-nio`、`mistune` 和 `nh3`。直聊和未加密房间用这个就够了。
+- `[matrix-e2e]` 额外加上 `matrix-nio[e2e]`,它会拉取 `python-olm`——而后者需要先装好原生的 **libolm** 库:
+
+```bash
+# macOS
+brew install libolm
+
+# Debian / Ubuntu
+sudo apt-get install libolm-dev
+```
+
+Docker/CI 等没有源码 checkout 的场景,同样的依赖集合镜像在 `requirements/matrix.txt` 和 `requirements/matrix-e2e.txt`。
+
+完全不装 extras 的话,channel 会在 import 时直接报 `Matrix dependencies not installed`。
+
+## 创建 bot 账号并获取 access token
+
+Partner 需要一个自己的 Matrix 账号,任何 homeserver 都行——测试用 matrix.org 就可以。
+
+1. 创建账号:Element web app -> 你的 homeserver -> Create Account(自建 Synapse 也可以用 `register_new_matrix_user`)。
+2. 获取 access token,两种方式任选:
+ - **Element**:用 bot 账号登录,**Settings -> Help & About -> Advanced -> Access Token**,展开并复制。
+ - **REST API**:
+
+```bash
+curl -X POST https://matrix.org/_matrix/client/r0/login \
+ -H "Content-Type: application/json" \
+ -d '{"type": "m.login.password", "user": "my-bot", "password": "your-password"}'
+# the response contains "access_token": "syt_..."
+```
+
+## 配置 channel card
+
+打开 **Partners -> 你的 partner -> Channels -> Matrix**。
+
+| 字段 | 怎么填 |
+| --- | --- |
+| **Send Progress** | 测试时建议开启。长任务会把过程 narration 发到房间里。 |
+| **Send Tool Hints** | 调试时建议开启;不想让用户看到一行工具调用就关掉。 |
+| **Enabled** | 准备启动 channel 时再打开。 |
+| **Homeserver** | 默认 `https://matrix.org`。自建就填自己服务器的 URL。 |
+| **Access Token** | 从 Element 或 login API 拿到的 token。以 secret 方式存储。 |
+| **User Id** | bot 的完整 Matrix id,如 `@my-bot:matrix.org`。也用于识别 @ 提及。 |
+| **Device Id** | 可选但建议填:随便选一个稳定的字符串并保持不变。留空的话,重启可能会重放最近的消息。 |
+| **E2Ee Enabled** | 装好 `[matrix-e2e]` extra 和 libolm 之后再打开。没装的话 bot 解不开加密房间。 |
+| **Sync Stop Grace Seconds** | 默认 `2`。关停时给进行中的 sync 多少秒收尾。基本不用改。 |
+| **Max Media Bytes** | 默认 `20971520`(20 MB)。附件上传/下载的大小上限。 |
+| **Allow From** | 一行一个 Matrix user id,如 `@frank:matrix.org`。测试可填 `*` 表示开放。空列表拒绝所有人——包括房间邀请。 |
+| **Group Policy** | 多人房间的策略:`open`(默认)回复所有消息,`mention` 只在 bot 被 @ 时回复,`allowlist` 只回复下面列出的房间。1:1 直聊总是会回复。 |
+| **Group Allow From** | 房间 id(`!abc123:matrix.org`),一行一个。只在 `allowlist` 策略下生效。 |
+| **Allow Room Mentions** | 在 `mention` 策略下,`@room` 群发提醒算不算提及 bot。默认关闭。 |
+
+## 保存之后
+
+1. 点 **Save**,打开 **Enabled**,再保存一次。
+2. 启动 partner——从 UI,或 `deeptutor partner start <partner-id>`。已在运行就重启。
+3. 在任意 Matrix 客户端邀请 bot:`/invite @my-bot:matrix.org`。bot 只接受能通过 **Allow From** 的人发出的邀请——列表为空时它永远不会进房。
+4. 在房间里发一条短消息,看回复。
+5. 跑通之后,把 **Allow From** 里的 `*` 换成真实 user id。
+
+回复里的 Markdown 会渲染成 Matrix HTML,所以表格和代码块在 Element 等客户端里都能正常显示。
+
+## 如何确认健康
+
+健康的 Matrix channel 通常有三个迹象:
+
+- 日志显示 sync loop 在跑,没有反复出现的 sync 错误;
+- 允许的发送者发出邀请后,bot 几秒内就进房;
+- 在房间里发一条短消息,Partner 能正常回复。
+
+注意隐私边界:E2EE 保护的是 Matrix 客户端到 bot 之间的传输,消息正文仍然会以明文到达你配置的 LLM provider。在意这一点的话,给这个 channel 配本地模型。
+
+## 常见问题
+
+### bot 进了加密房间但从不回复
+
+**E2Ee Enabled** 开了但没装 `[matrix-e2e]` extra(或 libolm),或者房间加密了它却是关的。先装 libolm,再 `pip install -e ".[matrix-e2e]"`,打开开关,重启 partner。
+
+### `M_UNKNOWN_TOKEN`
+
+access token 失效了——通常是 bot 在别的客户端被登出,或服务端重置。通过 Element 或 login API 重新拿一个 token,更新到 card 上。
+
+### 第一次 sync 特别慢
+
+历史很长的账号初次 sync 批量很大;这是正常的,每个 device 只会发生一次。设置一个稳定的 **Device Id**,之后重启就能增量续传,不用从头来过。
+
+### bot 不理我的邀请
+
+邀请人必须能通过 **Allow From**。把你自己的 Matrix user id 加进去(测试期间也可以用 `*`),保存后重新邀请。
diff --git a/site/src/content/docs/zh-cn/docs/partners/mochat.md b/site/src/content/docs/zh-cn/docs/partners/mochat.md
new file mode 100644
index 000000000..d1f2b7ddd
--- /dev/null
+++ b/site/src/content/docs/zh-cn/docs/partners/mochat.md
@@ -0,0 +1,104 @@
+---
+title: Mochat
+description: 通过 Socket.IO(自动回退 HTTP 轮询)把 Partner 接入 Mochat 客服面板。
+---
+
+<img src="/channel-icons/mochat.svg" alt="" width="40" height="40" />
+
+`mochat` channel 把 Partner 接到 Mochat——一个客服式的聊天面板。它通过 **Socket.IO** 和你的 Mochat 实例通信,socket 连不上时自动回退到 **HTTP polling**,所以在挑剔的代理后面也能继续工作。适合想把 Partner 嵌进客服组件、而不是个人聊天软件的场景。
+
+![Mochat 渠道配置](/screenshots/partners-channel-mochat.png)
+
+## 安装依赖
+
+Mochat 支持包含在 Partners extra 里,会带上 `python-socketio` 和 `msgpack`。没有 `python-socketio` 时,channel 仍可在 polling 模式下工作。
+
+```bash
+pip install -e ".[partners]"
+# 或发布包支持 extras 时:
+pip install "deeptutor[partners]"
+```
+
+## 获取 Claw Token
+
+在 Mochat 管理后台创建一个 bot 账号,复制它的 **Claw Token**。没有它 channel 会拒绝启动(日志里是 `Mochat claw_token not configured`)。
+
+## 配置 channel card
+
+打开 **Partners -> 你的 partner -> Channels -> Mochat**。
+
+| 字段 | 怎么填 |
+| --- | --- |
+| **Send Progress** | 测试时建议开启。长任务会把过程 narration 发出去。 |
+| **Send Tool Hints** | 调试时建议开启;不想让用户看到一行工具调用就关掉。 |
+| **Enabled** | 准备启动 channel 时再打开。 |
+| **Base Url** | 你的 Mochat 实例。默认 `https://mochat.io`。 |
+| **Socket Url** | 可选的独立 Socket.IO endpoint。留空表示用 **Base Url**。 |
+| **Socket Path** | Socket.IO 挂载路径。默认 `/socket.io`。 |
+| **Socket Disable Msgpack** | 默认关闭(可用时优先 msgpack)。服务端没有 msgpack parser 时打开,强制走 JSON。 |
+| **Socket Reconnect Delay Ms** | 初始重连延迟。默认 `1000`。 |
+| **Socket Max Reconnect Delay Ms** | 重连退避上限。默认 `10000`。 |
+| **Socket Connect Timeout Ms** | 连接超时。默认 `10000`。 |
+| **Refresh Interval Ms** | channel 刷新 session/panel 目录的频率。默认 `30000`。 |
+| **Watch Timeout Ms** | HTTP 回退模式下的 long-poll 超时。默认 `25000`。 |
+| **Claw Token** | 必填。Mochat 管理后台拿到的 bot token。 |
+| **Sessions** | 要监听的 session id,一行一个。`*` 表示自动发现并订阅新 session。 |
+| **Panels** | 要监听的 panel id,一行一个。`*` 表示自动发现 panel。两个列表都留空时 channel 什么都不监听。 |
+| **Allow From** | 一行一个值。测试可填 `*` 表示开放,或填具体的 Mochat user id。空列表拒绝访问。 |
+
+### 进阶字段
+
+这些用来调重试和群行为;首次部署用默认值就好。
+
+| 字段 | 怎么填 |
+| --- | --- |
+| **Watch Limit** | 单次 poll 最多拉取的事件数。默认 `100`。 |
+| **Retry Delay Ms** | HTTP 重试失败之间的延迟。默认 `500`。 |
+| **Max Retry Attempts** | `0` 表示无限重试(也作用于 socket 重连)。 |
+| **Agent User Id** | bot 自己的 Mochat user id。用于忽略 bot 自己的消息和识别 @ 提及。 |
+| **Mention** | `require_in_groups` —— 群 session 里必须被 @ 才回复。 |
+| **Groups** | 按 group id 的逐群覆盖:`{"<group-id>": {"require_mention": true}}`。 |
+| **Reply Delay Mode** | `non-mention`(默认)会缓冲没有提及 bot 的 panel 消息;填其他值则关闭缓冲。 |
+| **Reply Delay Ms** | 缓冲窗口。默认 `120000`(2 分钟)。 |
+
+默认的 reply-delay 模式下,连珠炮式的 panel 消息会合并成一个 Partner turn:每来一条新消息计时器就重置,而直接 @ bot 会让缓冲立刻被处理。
+
+## 保存之后
+
+1. 打开 **Enabled**、填好 **Claw Token**,保存 card。
+2. 从 UI 或 CLI 启动(或重启)partner。
+3. 看日志:socket 连接成功,或 polling 回退警告——两种都能正常工作。
+4. 在被监听的 session 或 panel 里发一条短消息。
+5. 在日志里看到真实 user id 之后,把 **Allow From** 里的 `*` 换成明确的值。
+
+```bash
+deeptutor partner start <partner-id>
+```
+
+## 如何确认健康
+
+健康的 Mochat channel 通常有三个迹象:
+
+- 日志显示 Socket.IO 连接成功(或明确的 polling 回退,而不是认证错误);
+- `data/partners/<partner-id>/runtime/mochat/session_cursors.json` 在持续写入——这是监听位点;
+- 允许的用户发一条短消息后,Partner 能正常回复。
+
+Docker 部署要持久化 `data/partners/`,让 cursor 在重启后还在。
+
+## 常见问题
+
+### Socket.IO 一直重连或根本连不上
+
+对照你的 Mochat 部署检查 **Socket Url** / **Socket Path**。服务端不支持 msgpack 就打开 **Socket Disable Msgpack**。也可以干脆不管它:channel 会自己回退到 HTTP polling,用一点延迟换稳定。
+
+### channel 一启动就退出
+
+日志里是 `Mochat claw_token not configured`。填好 **Claw Token**,重启 partner。
+
+### 订阅失败 / token 失效
+
+`Mochat subscribePanels failed` 之类的日志通常意味着 Claw Token 无效、过期,或 bot 没在 Mochat 管理后台通过审批。重新生成 token,更新 card,重启。
+
+### 连上了但收不到消息
+
+确认 **Sessions** 或 **Panels** 确实填了内容(或 `*`),并且发送者能通过 **Allow From**。群 session 还要看是否配置了 mention 要求。
diff --git a/site/src/content/docs/zh-cn/docs/partners/msteams.md b/site/src/content/docs/zh-cn/docs/partners/msteams.md
new file mode 100644
index 000000000..c258a67d9
--- /dev/null
+++ b/site/src/content/docs/zh-cn/docs/partners/msteams.md
@@ -0,0 +1,93 @@
+---
+title: Microsoft Teams
+description: 为 Partner 配置 Microsoft Teams 渠道——Azure Bot 注册、公网 messaging endpoint、入站 JWT 校验。
+---
+
+<img src="/channel-icons/msteams.svg" alt="" width="40" height="40" />
+
+`msteams` channel 通过 **Bot Framework** 把 Partner 接到 Microsoft Teams。和 DeepTutor 其他所有 channel 不一样,它不是主动外连:它内置了一个小型 **HTTP 服务器**(默认 `0.0.0.0:3978`,路径 `/api/messages`),由微软的服务器把每条消息 POST 过来。所以你需要一个**公网可达的 HTTPS endpoint**——生产环境在端口前面架一层反向代理(nginx、Caddy、Cloudflare Tunnel 都行),再把 Azure Bot 的 messaging endpoint 指过来。本地测试用 `ngrok http 3978` 这类隧道就够了。
+
+当前能力范围以私聊为主:文本进、文本出。群聊和频道消息会被忽略,附件暂不支持。
+
+![Microsoft Teams 渠道配置](/screenshots/partners-channel-msteams.png)
+
+## 安装依赖
+
+Teams 支持已包含在 Partners extra 里。入站请求用 `PyJWT[crypto]` 做校验,它也已经在内——不需要额外安装任何东西。
+
+```bash
+pip install -e ".[partners]"
+# 或发布包支持 extras 时:
+pip install "deeptutor[partners]"
+```
+
+## 在 Azure 注册机器人
+
+1. 在 [Azure Portal](https://portal.azure.com/) 打开 **Microsoft Entra ID -> App registrations -> New registration**。起个名字,选好账户类型(单租户即可),完成注册。复制 **Application (client) ID**——这就是 **App Id**;再复制 **Directory (tenant) ID**——这就是 **Tenant Id**。
+2. 在这个注册下打开 **Certificates & secrets -> New client secret**,立刻复制 secret 的 **Value**(只显示这一次)——这就是 **App Password**。
+3. 创建一个 **Azure Bot** 资源(在 marketplace 里搜 "Azure Bot")。*Microsoft App ID* 选 **Use existing app registration**,填入你的 App Id。租户类型要和注册保持一致:单租户的注册就建单租户的 bot。
+4. 在 bot 资源里进 **Settings -> Configuration**,把 **Messaging endpoint** 设成你的公网 HTTPS 地址,结尾必须是 channel 的路径,比如 `https://bots.example.com/api/messages`。
+5. 进 **Settings -> Channels**,添加 **Microsoft Teams** channel。
+6. 想直接开聊,点 Teams channel 那一行的 **Open in Teams** 链接;要在组织内分发,就打一个引用同一 App Id 的 Teams 应用 manifest 包。
+
+## 配置 channel card
+
+打开 **Partners -> 你的 partner -> Channels -> Microsoft Teams**。
+
+| 字段 | 怎么填 |
+| --- | --- |
+| **Send Progress** | 测试时建议开启。长任务会把过程 narration 实时发过来。 |
+| **Send Tool Hints** | 调试时建议开启;不想让用户看到一行工具调用就关掉。 |
+| **Enabled** | 准备启动 channel 时再打开。 |
+| **App Id** | App registration 的 Application (client) ID。同时也是校验入站 JWT 时要求的 audience。 |
+| **App Password** | client secret 的 Value。按 secret 存储,保存后会打码。 |
+| **Tenant Id** | Directory (tenant) ID。单租户注册必填;只有多租户 bot 才能留空。 |
+| **Host** | 内置 HTTP 服务器的监听地址。默认 `0.0.0.0` 监听所有网卡;如果只有本机的反向代理来访问,可以收紧到 `127.0.0.1`。 |
+| **Port** | 监听端口。默认 `3978`,Bot Framework 的惯例端口。 |
+| **Path** | 接收消息的 URL 路径。默认 `/api/messages`,必须和 messaging endpoint 的结尾一致。 |
+| **Allow From** | 一行一个值。测试可填 `*`;正式用换成 Microsoft Entra object id——被拒的 sender id 会打在 partner 日志里。空列表会拒绝所有人。 |
+| **Reply In Thread** | 开启(默认)时,回复会挂在触发它的那条消息下面,而不是另起一条。 |
+| **Mention Only Response** | 消息里除了 @ 机器人什么都没有时,机器人回的那句话。 |
+| **Validate Inbound Auth** | 保持开启。每个入站请求都校验 Bot Framework JWT(用微软公开的密钥做 RS256 验签,audience 必须等于 App Id)。关掉它意味着任何拿到 URL 的人都能冒充任意用户跟 partner 说话——只限本地测试。 |
+| **Ref Ttl Days** | 闲置的 conversation reference 保留多少天后清理。默认 `30`。 |
+| **Prune Web Chat Refs** | 把 Bot Framework Web Chat 的会话从存储里剔除(Web Chat 不支持)。 |
+| **Prune Non Personal Refs** | 把群聊/频道的会话 reference 剔除;channel 目前只做私聊。 |
+| **Ref Touch Interval S** | 活跃会话 reference 的时间戳刷新最小间隔(秒)。默认 `300`。 |
+| **Trusted Service Url Hosts** | 接受并回复的 Bot Framework 服务域名白名单。默认覆盖公有云和 GCC/DoD 政务云——除非微软把你路由去了别处,否则不用动。 |
+
+## 保存之后
+
+1. 点 **Save**,把 **Enabled** 打开。
+2. 启动 partner(已在运行的话重启,或在 Channels 面板上用 reload)。
+3. 从外网验证 endpoint 可达:`curl -X POST https://your-domain/api/messages -H 'Content-Type: application/json' -d '{}'` 应该返回 **401**(JWT 校验把你拦下来了)——如果是连接错误,说明代理链路有问题。
+4. 用允许的账号在 Teams 里打开机器人(**Open in Teams** 链接),私聊发一条短消息。
+5. 在日志里确认 sender id 之后,把 **Allow From** 里的 `*` 换成真实 id。
+
+## 如何确认健康
+
+- 启动日志出现 `MSTeams webhook listening on http://0.0.0.0:3978/api/messages`。
+- 对公网 endpoint 发一个不带凭证的 POST 返回 401 而不是超时——代理链路通了,JWT 门也立着。
+- 允许的账号私聊能收到回复,partner 的 runtime 目录下出现 `msteams_conversations.json`——conversation reference 在正常持久化。
+
+## 常见问题
+
+### Teams 提示消息发送失败
+
+messaging endpoint 不可达。确认 endpoint URL 以你配置的 **Path** 结尾、HTTPS 证书有效、反向代理转发到了 **Host**:**Port**。用上面清单里那条 `curl` 一步就能定位。
+
+### 所有入站请求都被 401 拒绝
+
+入站 JWT 校验没过。最常见的原因是 channel card 里的 **App Id** 和 bot 注册对不上——token 的 audience 必须等于 App Id。如果最近重建过注册,记得更新 card。除了本地测试,不要用关闭 **Validate Inbound Auth** 来绕过这个问题。
+
+### 回复时报 token 错误
+
+收得到但发不出,这是租户的坑:**单租户**注册却把 **Tenant Id** 留空,DeepTutor 会去多租户 endpoint 换 token,微软直接拒绝。把 **Tenant Id** 填成 Directory (tenant) ID 再保存即可。
+
+### 私聊正常但群聊和频道不理人
+
+设计如此:channel 目前只做私聊。非私聊会话到达即丢弃(**Prune Non Personal Refs** 开着时,存储里的 reference 也会被清掉)。
+
+## 相关页面
+
+- [Channel Matrix](/zh-cn/docs/partners/channels/) — 所有 channel 一览
+- [WeCom](/zh-cn/docs/partners/wecom/) — 企业微信接入,另一种企业 IM 路线
diff --git a/site/src/content/docs/zh-cn/docs/partners/qq.md b/site/src/content/docs/zh-cn/docs/partners/qq.md
new file mode 100644
index 000000000..5f376d2df
--- /dev/null
+++ b/site/src/content/docs/zh-cn/docs/partners/qq.md
@@ -0,0 +1,71 @@
+---
+title: QQ / NapCat
+description: 为 Partner 配置腾讯 QQ 渠道:官方 QQ Bot 与 NapCat / OneBot v11 个人 QQ。
+---
+
+<img src="/channel-icons/qq.svg" alt="" width="40" height="40" />
+
+DeepTutor 有两个 QQ 系渠道:
+
+| 渠道 | 适用场景 | 配置 key |
+| --- | --- | --- |
+| **QQ** | 你有腾讯官方 QQ Bot 账号和应用凭证。 | `qq` |
+| **QQ (NapCat)** | 你想通过 NapCat / OneBot v11 接入个人 QQ。 | `napcat` |
+
+## 官方 QQ Bot(`qq`)
+
+先安装 Partners extra,然后在 [QQ Bot 开发平台](https://bot.q.qq.com/) 创建 bot。按需要开启 C2C/direct 和群消息等消息类型。
+
+![官方 QQ Bot 渠道配置](/screenshots/partners-channel-qq.png)
+
+配置字段:
+
+| 字段 | 说明 |
+| --- | --- |
+| `enabled` | 是否随 partner 启动该渠道。 |
+| `app_id` | 腾讯 bot 平台里的 App ID。 |
+| `secret` | Bot secret。 |
+| `allow_from` | 允许访问的 QQ user ids / openids。空列表拒绝访问;生产环境建议明确 id。 |
+| `msg_format` | `plain` 或 `markdown`。不同 QQ 客户端 Markdown 表现不一,不确定时先用 `plain`。 |
+
+启动:
+
+```bash
+deeptutor partner start <partner-id>
+```
+
+## 通过 NapCat 接入个人 QQ(`napcat`)
+
+NapCat 会把个人 QQ 暴露成 OneBot v11 WebSocket endpoint。你需要单独运行 NapCat,然后把 DeepTutor 指向它的 WebSocket URL。
+
+![NapCat 渠道配置](/screenshots/partners-channel-napcat.png)
+
+配置字段:
+
+| 字段 | 说明 |
+| --- | --- |
+| `enabled` | 是否随 partner 启动该渠道。 |
+| `ws_url` | NapCat WebSocket endpoint,默认 `ws://127.0.0.1:3001`。 |
+| `access_token` | 可选 OneBot access token。 |
+| `allow_from` | 允许访问的用户 id。`*` 只建议本地测试使用。 |
+| `group_policy` | `mention`、`open`,或 `0` 到 `1` 的概率。被 @ 或回复时总会响应。 |
+| `group_policy_overrides` | 按群 id 覆盖 group policy 的 map。 |
+| `welcome_new_members` | 是否欢迎新群成员。 |
+| `max_image_bytes` | 入站图片下载大小上限。 |
+
+## 怎么选
+
+正式部署、合规群机器人优先用 `qq`。如果你需要个人 QQ 工作流,并且能控制本地 NapCat 运行时、理解个人账号自动化风险,再用 `napcat`。
+
+## 生产环境建议
+
+- 正式部署、需要审批和稳定应用凭证时,优先用 `qq`。
+- 只有在你明确要维护本地个人账号桥接时,才用 `napcat`。
+- 群聊先从 mention-only 行为开始(`group_policy: mention`),确认噪音可控后再放宽。
+- 小服务器上运行 Partner 时,`max_image_bytes` 保守一些。
+
+## 常见问题
+
+- **官方 QQ auth failed** —— 检查 `app_id`、`secret` 和腾讯平台启用的消息 intents。
+- **NapCat 连接了但没有消息** —— 检查 `ws_url`、`access_token`,以及 NapCat 是否在发 OneBot v11 message events。
+- **群里太吵** —— 把 `group_policy` 设为 `mention`,或较低概率如 `0.1`。
diff --git a/site/src/content/docs/zh-cn/docs/partners/slack.md b/site/src/content/docs/zh-cn/docs/partners/slack.md
new file mode 100644
index 000000000..3285859fb
--- /dev/null
+++ b/site/src/content/docs/zh-cn/docs/partners/slack.md
@@ -0,0 +1,92 @@
+---
+title: Slack
+description: 为 Partner 配置 Slack channel —— Socket Mode 应用、bot 和 app 两个 token、线程回复与 DM 策略。
+---
+
+<img src="/channel-icons/slack.svg" alt="" width="40" height="40" />
+
+`slack` channel 通过 **Socket Mode** 把 Partner 接进 Slack workspace:bot 用 `slack-sdk` 向 Slack 开一条 WebSocket,所以不需要公网 URL、webhook 或反向代理。它是最面向团队的 channel —— 支持 DM、频道 @ 提及、线程回复,还会在触发消息上加一个确认 reaction。
+
+这里涉及两个 token,很容易搞混:**Bot Token**(`xoxb-…`,来自 OAuth & Permissions)授权 API 调用,**App Token**(`xapp-…`,来自 Socket Mode)授权 WebSocket 连接。和 Telegram、Discord 不同,Slack 的 card 上没有 **Streaming** 开关 —— 回复以完整消息送达,开了 **Send Progress** 的话 narration 会作为单独的消息投递。
+
+![Slack 渠道配置](/screenshots/partners-channel-slack.png)
+
+## 安装依赖
+
+Slack 支持随 Partners extra 一起安装,其中已包含 `slack-sdk`(Socket Mode 客户端)和 `slackify-markdown`(Markdown -> Slack mrkdwn 转换)。不需要额外装任何东西。
+
+```bash
+pip install -e ".[partners]"
+# 或发布包支持 partners extras 时:
+pip install "deeptutor[partners]"
+```
+
+## 创建 Slack 应用
+
+1. 打开 <https://api.slack.com/apps> -> **Create New App** -> **From scratch**。起个名字,选你的 workspace。
+2. 左侧边栏 -> **Socket Mode** -> 打开 **Enable Socket Mode**。按提示生成一个带 `connections:write` scope 的 App-Level Token 并复制 —— 这就是你的 **App Token**(`xapp-…`)。
+3. 左侧边栏 -> **OAuth & Permissions** -> **Scopes** -> **Bot Token Scopes**,加上:`chat:write`、`chat:write.public`、`files:write`、`reactions:write`、`users:read`、`app_mentions:read`、`im:history`、`im:read`、`channels:history`(要支持私有频道再加 `groups:history`)。
+4. 左侧边栏 -> **Event Subscriptions** -> **Subscribe to bot events**:`app_mention`、`message.im`;如果 bot 要在频道里听 @ 之外的消息,再加 `message.channels`。
+5. 回到 **OAuth & Permissions**,点 **Install to Workspace** 并授权。复制 **Bot User OAuth Token**(`xoxb-…`)—— 这就是你的 **Bot Token**。
+
+## 配置 channel card
+
+打开 **Partners -> 你的 partner -> Channels -> Slack**。
+
+| 字段 | 怎么填 |
+| --- | --- |
+| **Send Progress** | 测试时建议开启。长任务会实时投递过程 narration。 |
+| **Send Tool Hints** | 调试时建议开启;不想让用户看到一行工具调用就关掉。 |
+| **Enabled** | 准备启动 channel 时再打开。 |
+| **Mode** | 目前只支持 `socket`,保持不动。 |
+| **Webhook Path** | 为将来的 webhook 模式预留;**Mode** 是 `socket` 时用不上。留默认 `/slack/events` 即可。 |
+| **Bot Token** | **OAuth & Permissions** 里的 `xoxb-…` token。按密钥存储,保存后会打码显示。 |
+| **App Token** | **Socket Mode** 里的 `xapp-…` App-Level Token(需要 `connections:write`)。同样是密钥。别和 Bot Token 填反了。 |
+| **User Token Read Only** | 保持默认(开)。 |
+| **Reply In Thread** | 开(默认):bot 在触发消息下面开线程回答,并持续跟进这个线程。关:回复直接发进频道。 |
+| **React Emoji** | bot 加在你消息上、表示"收到"的 emoji 名(不带冒号)。默认 `eyes`。 |
+| **Allow From** | 一行一个值。开放测试 bot 可填 `*`,正式用填 Slack 用户 id(`U…`)。空列表拒绝所有人。 |
+| **Group Policy** | `mention`(默认):频道里只回答 @ 提及。`open`:所在频道每条消息都答。`allowlist`:只响应 **Group Allow From** 里列出的频道。 |
+| **Group Allow From** | 频道 id(`C…`),一行一个。**Group Policy** 是 `allowlist` 时生效。 |
+| **Dm** | DM 子策略:**Enabled** 整体开关 DM;**Policy** 取 `open` 时任何 DM 都答,取 `allowlist` 时只放行它自己那份 **Allow From** 列表里的 id。 |
+
+## 保存之后
+
+1. 点 **Save**,再把 **Enabled** 打开。
+2. 启动 partner(已经在跑的话重启它,或在 Channels 面板用 reload)。
+3. 用允许的账号 DM bot,或 `/invite @your-bot` 进某个频道再 @ 它。
+4. 看 partner 日志:应该能看到 Socket Mode 连接和入站事件。
+5. 在日志里确认 sender id 之后,把 **Allow From** 里的 `*` 换成真实 id。
+
+## 如何确认健康
+
+- 日志显示 Socket Mode WebSocket 已连接,没有鉴权错误。
+- 你的测试消息一两秒内就收到确认 reaction(默认 `eyes`)。
+- 默认 **Reply In Thread** 开着时,回复出现在你消息下面的线程里。
+
+## 常见问题
+
+### Slack API 报 `invalid_auth` / `not_authed`
+
+两个 token 填反了 —— `xoxb-…` 应该在 **Bot Token**,`xapp-…` 应该在 **App Token**。这是 Slack 配置里最常见的一个错误。
+
+### socket 一直连不上
+
+应用必须先**启用** Socket Mode,且 App-Level Token 必须带 `connections:write` scope。如果 token 是在启用 Socket Mode 之前生成的,重新生成一个。
+
+### 频道消息不理,DM 正常
+
+三道门都要查:
+
+1. bot 必须被邀请进该频道:`/invite @your-bot`。
+2. **Group Policy** = `mention` 时,消息必须 @ 到 bot。
+3. **Event Subscriptions** 下必须订阅了 `app_mention` 这个 bot event(依赖频道普通消息的话,还要 `message.channels`)。
+
+### 回复进了线程,后续消息没人理
+
+这是 **Reply In Thread** 在起作用:bot 开了线程,并且只在线程里听。请在线程里继续对话,不要再发新的频道顶层消息。想要平铺的频道回复,把 **Reply In Thread** 关掉。
+
+## 相关页面
+
+- [Channel Matrix](/zh-cn/docs/partners/channels/) —— 所有 channel 一览
+- [Discord](/zh-cn/docs/partners/discord/) —— 类似的开发者后台配置,走 Gateway WebSocket
diff --git a/site/src/content/docs/zh-cn/docs/partners/telegram.md b/site/src/content/docs/zh-cn/docs/partners/telegram.md
new file mode 100644
index 000000000..f7dba17ea
--- /dev/null
+++ b/site/src/content/docs/zh-cn/docs/partners/telegram.md
@@ -0,0 +1,91 @@
+---
+title: Telegram
+description: 为 Partner 配置 Telegram channel —— BotFather 注册、Bot API long polling、原地编辑的流式回复。
+---
+
+<img src="/channel-icons/telegram.svg" alt="" width="40" height="40" />
+
+`telegram` channel 通过 Bot API **long polling** 把 Partner 接到一个 Telegram bot 上:DeepTutor 用一个长连接循环主动从 Telegram 服务器拉取更新,所以不需要公网 IP、不需要 webhook、也不需要反向代理。在 BotFather 注册大约一分钟就能搞定 —— 想做个人助理或小群 bot,Telegram 是接入最快的 channel。
+
+这个 channel 还支持 **live streaming**:开关打开后,bot 只发一条消息,随着回复生成不断原地编辑这条消息。
+
+![Telegram 渠道配置](/screenshots/partners-channel-telegram.png)
+
+## 安装依赖
+
+Telegram 支持随 Partners extra 一起安装。底层客户端是 `python-telegram-bot[socks]`,SOCKS 代理支持已经内置 —— 不需要额外装任何东西。
+
+```bash
+pip install -e ".[partners]"
+# 或发布包支持 partners extras 时:
+pip install "deeptutor[partners]"
+```
+
+## 在 BotFather 注册 bot
+
+1. 打开 Telegram,搜索 `@BotFather`,开始对话。
+2. 发送 `/newbot`。BotFather 会先问显示名称(比如 `Math Mentor`),再问 username,必须以 `bot` 结尾(比如 `hku_math_mentor_bot`)。
+3. BotFather 回复一个 HTTP API token,形如 `123456789:ABC-DEF1234ghIkl-...`。**复制好** —— 这就是要填进 **Token** 字段的值。
+4. 查自己的用户 id:和 `@userinfobot` 对话,它会回复你的数字 id。填 **Allow From** 时会用到。
+5. 要在群里用,需要关闭 Group Privacy,bot 才能读到群消息:`/mybots` -> 选你的 bot -> **Bot Settings** -> **Group Privacy** -> **Turn off**。
+
+## 配置 channel card
+
+打开 **Partners -> 你的 partner -> Channels -> Telegram**。
+
+| 字段 | 怎么填 |
+| --- | --- |
+| **Streaming** | 默认关闭。打开后回复实时流式输出:文本一边生成,一边原地编辑那条 Telegram 消息。依赖 **Send Progress**:narration 轮次也会随生成实时流出。 |
+| **Send Progress** | 测试时建议开启。长任务会实时投递过程 narration。 |
+| **Send Tool Hints** | 调试时建议开启;不想让用户看到一行工具调用就关掉。 |
+| **Enabled** | 准备启动 channel 时再打开。 |
+| **Token** | BotFather 给的 HTTP API token。按密钥存储,保存后会打码显示。 |
+| **Allow From** | 一行一个值。开放测试 bot 可填 `*`,正式用填 `@userinfobot` 查到的数字用户 id(username 也能匹配)。空列表拒绝所有人。 |
+| **Proxy** | 可选代理 URL,Telegram 不可达的网络环境用,比如 `socks5://127.0.0.1:1080` 或 `http://proxy:8080`。直连就留空。 |
+| **Reply To Message** | 打开后,bot 的回答会引用触发它的那条消息。热闹的群里很有用,私聊里就显得多余。 |
+| **Group Policy** | `mention`(默认):群里只有被 @ 或被回复时才答。`open`:群里每条消息都答。私聊永远会回复。 |
+| **Connection Pool Size** | Bot API 客户端的 HTTP 连接池大小。单个 bot 用默认 `16` 就够。 |
+| **Pool Timeout** | 等待空闲连接的秒数。默认 `15`。 |
+| **Stream Edit Interval** | 流式输出时两次原地编辑之间的最小间隔秒数。默认 `0.6`;如果 Telegram 报 flood-control 错误就调大。 |
+
+超过 Telegram 4096 字符上限的回复会自动拆成多条消息(DeepTutor 在 4000 处拆分,留出安全余量)。
+
+## 保存之后
+
+1. 点 **Save**,再把 **Enabled** 打开。
+2. 启动 partner(已经在跑的话重启它,或在 Channels 面板用 reload)。
+3. 用允许的账号打开 `t.me/<your_bot_username>`,发一条短消息。
+4. 看 partner 日志:应该能看到入站消息和回复投递。
+5. 在日志里确认 sender id 之后,把 **Allow From** 里的 `*` 换成真实 id。
+
+## 如何确认健康
+
+- 日志显示 Telegram channel 在正常 polling,没有报错(尤其没有 `Conflict` 行)。
+- 允许的账号发一条短私聊能收到回复;开了 **Send Progress** 的话,长任务期间还能看到 narration 消息。
+- 默认 `mention` 策略下,在群里 @ 一下 bot 能得到回答。
+
+## 常见问题
+
+### bot 从来不回复
+
+几乎都是 **Allow From** 的问题。空列表拒绝所有人 —— 包括你自己。先填 `*` 测一下,再换成 `@userinfobot` 查到的数字 id。
+
+### bot 不理群消息
+
+两道门都得打开:
+
+1. BotFather 那边:`/mybots` -> 你的 bot -> **Bot Settings** -> **Group Privacy** -> **Turn off** —— 不关的话 Telegram 根本不会把普通群消息投给 bot。
+2. **Group Policy** = `mention` 时,消息必须 @ 到 bot(或回复它的某条消息)。
+
+### `Conflict: terminated by other getUpdates request`
+
+同一个 token 被两个地方同时 polling —— 要么两个 partner 配了同一个 token,要么还有别的进程没停。Telegram 每个 token 只允许一个 polling 客户端;把重复的那个停掉。
+
+### 当前网络连不上 Telegram
+
+在 **Proxy** 里填一个 SOCKS 或 HTTP 代理 URL(比如 `socks5://127.0.0.1:1080`)。SOCKS 支持已经随 partners extra 装好,不需要额外装包。
+
+## 相关页面
+
+- [Channel Matrix](/zh-cn/docs/partners/channels/) —— 所有 channel 一览
+- [Discord](/zh-cn/docs/partners/discord/) —— Gateway WebSocket 模型,同样支持流式输出
diff --git a/site/src/content/docs/zh-cn/docs/partners/wecom.md b/site/src/content/docs/zh-cn/docs/partners/wecom.md
new file mode 100644
index 000000000..95a2b9021
--- /dev/null
+++ b/site/src/content/docs/zh-cn/docs/partners/wecom.md
@@ -0,0 +1,64 @@
+---
+title: WeCom(企业微信)
+description: 为 Partner 配置企业微信 / WeChat Work AI Bot 渠道。
+---
+
+<img src="/channel-icons/wecom.svg" alt="" width="40" height="40" />
+
+`wecom` 用于企业微信 / WeChat Work。它通过企业微信 AI Bot WebSocket 长连接接入,和个人 [WeChat (`weixin`)](/zh-cn/docs/partners/weixin/) 不同。
+
+![WeCom 渠道配置](/screenshots/partners-channel-wecom.png)
+
+## 前置条件
+
+- 有企业微信组织管理员权限。
+- 安装 `wecom-aibot-sdk`。可以通过 Partners extra 安装,必要时也可单独安装。
+
+```bash
+pip install -e ".[partners]"
+python -c "import wecom_aibot_sdk; print('ok')"
+```
+
+## 在企业微信创建 AI Bot
+
+1. 登录 <https://work.weixin.qq.com/>。
+2. 打开 **应用管理 / 小程序 -> AI Bot 平台**。
+3. 创建 **AI Bot** 应用。
+4. 配置名称、描述、可见部门/用户和审批设置。
+5. 复制 **Bot ID** 和 **Secret**。
+
+## 配置 DeepTutor
+
+打开 **Partners -> 你的 partner -> Channels -> WeCom**,填写:
+
+| 字段 | 说明 |
+| --- | --- |
+| `enabled` | partner 启动时是否启动该渠道。 |
+| `bot_id` | 企业微信 AI Bot 平台里的 Bot ID。 |
+| `secret` | 企业微信 Secret,按凭证处理。 |
+| `allow_from` | 允许访问的用户 id。空列表拒绝访问;基础 channel policy 支持时,`*` 表示开放。 |
+| `welcome_message` | 用户打开会话时发送的可选欢迎语。 |
+| `send_progress` / `send_tool_hints` | 是否投递过程 narration 和一行工具调用提示。 |
+
+## 访问控制和可见范围
+
+WeCom 有两层访问控制:
+
+1. 企业微信应用可见范围决定组织内谁能打开这个 AI Bot。
+2. DeepTutor 的 `allow_from` 决定哪些 sender ids 可以进入 Partner runtime。
+
+首次配置时,建议把企业微信可见范围设小;从日志确认 sender ids 后,再显式填写 `allow_from`。
+
+## 启动和测试
+
+```bash
+deeptutor partner start <partner-id>
+```
+
+服务端日志应显示 WeCom WebSocket connected/authenticated。然后在企业微信里打开 AI Bot,发送一条短消息测试。
+
+## 常见问题
+
+- **`ImportError: wecom_aibot_sdk`** —— 在运行 DeepTutor 的同一个环境里安装 `wecom-aibot-sdk` 或 Partners extra。
+- **连接成功但不回复** —— 检查 `allow_from`、部门可见范围,以及发送者是否有权限使用该 AI Bot。
+- **断线** —— 短暂断线会自动重连;持续离线时检查 Bot ID / Secret 和服务器到企业微信的出站网络。
diff --git a/site/src/content/docs/zh-cn/docs/partners/weixin.md b/site/src/content/docs/zh-cn/docs/partners/weixin.md
new file mode 100644
index 000000000..c48b815cc
--- /dev/null
+++ b/site/src/content/docs/zh-cn/docs/partners/weixin.md
@@ -0,0 +1,80 @@
+---
+title: WeChat(个人微信)
+description: 使用扫码登录和 HTTP long-poll 为 Partner 配置个人微信渠道。
+---
+
+<img src="/channel-icons/weixin.svg" alt="" width="40" height="40" />
+
+`weixin` channel 用 iLink long-poll API 把 Partner 接到个人微信账号。它和 **WeCom 企业微信** 不一样:普通个人微信看本页,企业微信 / WeChat Work 看 [WeCom](/zh-cn/docs/partners/wecom/)。
+
+![WeChat 渠道配置](/screenshots/partners-channel-weixin.png)
+
+## 安装依赖
+
+个人微信支持在 Partners extra 里;终端二维码渲染还会用到 `qrcode`。
+
+```bash
+pip install -e ".[partners]"
+# 或发布包支持 extras 时:
+pip install "deeptutor[partners]"
+```
+
+## 配置 channel card
+
+打开 **Partners -> 你的 partner -> Channels -> WeChat**。
+
+| 字段 | 怎么填 |
+| --- | --- |
+| **Send Progress** | 测试时建议开启。长任务会把过程 narration 发到微信。 |
+| **Send Tool Hints** | 调试时建议开启;如果不想让用户看到一行工具调用,生产环境可关闭。 |
+| **Enabled** | 准备登录/启动时再打开。 |
+| **Allow From** | 一行一个值。测试可填 `*` 表示开放;上线后换成具体微信用户 id。空列表通常表示拒绝所有人。 |
+| **Base Url** | 默认 `https://ilinkai.weixin.qq.com`,一般不用改。 |
+| **Cdn Base Url** | 默认 `https://novac2c.cdn.weixin.qq.com/c2c`,用于媒体上传/下载。 |
+| **Route Tag** | 可选腾讯路由标签。没有特殊部署要求就留空。 |
+| **Token** | 可选 bot token。扫码登录时留空;扫码成功后 channel 会保存 token。 |
+| **State Dir** | 可选状态目录。留空时使用 `data/partners/<id>/runtime/weixin/` 存 `account.json`。 |
+| **Poll Timeout** | long-poll 超时时间,单位秒。默认 `35`,多数网络可用。 |
+
+## 登录流程
+
+1. 保存 channel,**Enabled** 打开,**Token** 留空。
+2. 从 UI 或 CLI 启动 partner。
+3. 查看运行 `deeptutor start` 的终端;那里会打印微信登录二维码 / 扫码链接。
+4. 用微信扫码,或在浏览器打开终端给出的链接后扫码确认。
+5. 成功后,DeepTutor 会在 WeChat state directory 写入 `account.json`,然后开始 long polling。
+6. 用允许的账号发一条短消息测试。
+
+```bash
+deeptutor partner start <partner-id>
+```
+
+如果终端提示二维码过期,重启 partner 或等待刷新后重新扫码。实现会自动刷新几次二维码,但登录必须人工扫码完成。
+
+## 如何确认健康
+
+健康的 WeChat channel 通常有三个迹象:
+
+- 终端显示扫码登录成功,并保存了账号状态;
+- 挂载的 `data/` 目录里存在 `data/partners/<partner-id>/runtime/weixin/account.json`;
+- 允许的发送者发一条短消息后,Partner 能正常回复。
+
+Docker 部署必须持久化 `data/partners/`,否则每次容器重启都可能需要重新扫码。
+
+## 访问控制
+
+消息进入 partner brain 之前会先检查 `Allow From`。第一次测试填 `*` 可以;生产环境建议从日志里确认 sender id 后换成明确 allowlist。
+
+## 常见问题
+
+### 每次启动都要求重新扫码
+
+检查 `State Dir` 是否可写、是否持久化。留空时 DeepTutor 写到 partner runtime 目录;如果 Docker 没挂载该目录,重启后 token 会丢失。
+
+### 收得到消息但回不了
+
+微信回复依赖最近入站消息带来的 `context_token`。如果账号空闲太久,先从微信发一条新消息,让 DeepTutor 刷新 context 后再回复。
+
+### 过程消息太多
+
+在 channel card 里关闭 **Send Progress** 或 **Send Tool Hints**。这不会改变 partner 推理,只改变微信里看到的投递内容。
diff --git a/site/src/content/docs/zh-cn/docs/partners/whatsapp.md b/site/src/content/docs/zh-cn/docs/partners/whatsapp.md
new file mode 100644
index 000000000..17bcc924a
--- /dev/null
+++ b/site/src/content/docs/zh-cn/docs/partners/whatsapp.md
@@ -0,0 +1,114 @@
+---
+title: WhatsApp
+description: 通过外部 Node.js bridge(WhatsApp Web 协议)把 Partner 接入 WhatsApp。
+---
+
+<img src="/channel-icons/whatsapp.svg" alt="" width="40" height="40" />
+
+`whatsapp` channel 通过一个**外部 Node.js bridge** 进程把 Partner 接到 WhatsApp 账号。DeepTutor 和 bridge 之间走 WebSocket;bridge 负责登录 WhatsApp Web(扫一次码)并双向转发消息。这绕开了官方 WhatsApp Business API 的门槛——不需要企业认证、没有按条计费——代价是多跑一个进程。
+
+![WhatsApp 渠道配置](/screenshots/partners-channel-whatsapp.png)
+
+## 安装依赖
+
+Python 侧依赖在 Partners extra 里。bridge 另外需要一台 Node.js 18+ 的机器,可以和 DeepTutor 同机。
+
+```bash
+pip install -e ".[partners]"
+# 或发布包支持 extras 时:
+pip install "deeptutor[partners]"
+```
+
+## 运行 bridge
+
+DeepTutor 本身不带 bridge 实现。任何基于 [@whiskeysockets/baileys](https://github.com/WhiskeySockets/Baileys)、说下面这套 JSON 协议的 bridge 都可以用。一个最小实现:
+
+```javascript
+// bridge.js
+const { default: makeWASocket, useMultiFileAuthState } = require('@whiskeysockets/baileys')
+const WebSocket = require('ws')
+
+const wss = new WebSocket.Server({ port: 3001 })
+let waSocket = null
+
+async function start() {
+ const { state, saveCreds } = await useMultiFileAuthState('./auth')
+ waSocket = makeWASocket({ auth: state, printQRInTerminal: true })
+ waSocket.ev.on('creds.update', saveCreds)
+ waSocket.ev.on('messages.upsert', ({ messages }) => {
+ wss.clients.forEach(client => client.send(JSON.stringify(messages[0])))
+ })
+}
+
+wss.on('connection', (ws) => {
+ ws.on('message', (raw) => {
+ const { to, text } = JSON.parse(raw)
+ waSocket?.sendMessage(to, { text })
+ })
+})
+
+start()
+```
+
+```bash
+npm install @whiskeysockets/baileys ws
+node bridge.js
+```
+
+bridge 终端会打印二维码。手机上打开 **WhatsApp -> 设置 -> 已关联的设备 -> 关联新设备**,扫码即可。建议用进程管理器(`pm2`、systemd)守护 bridge;DeepTutor 断线后每 5 秒自动重连。
+
+### Bridge 协议
+
+- 连接建立时,如果配置了 **Bridge Token**,DeepTutor 会先发 `{"type": "auth", "token": "..."}`。
+- bridge 发给 DeepTutor:`{"type": "message", "id": ..., "sender": ..., "pn": ..., "content": ..., "media": ["/path", ...], "timestamp": ..., "isGroup": ...}`。媒体文件由 bridge 下载到本地路径后通过 `media` 传入,DeepTutor 会作为图片/文件附件处理。
+- DeepTutor 发给 bridge:`{"type": "send", "to": "<jid>", "text": "..."}`。
+- bridge 还可以发 `{"type": "status"}`、`{"type": "qr"}`、`{"type": "error"}` 事件。
+
+语音消息暂不支持转写,会以占位文本进入对话。
+
+## 配置 channel card
+
+打开 **Partners -> 你的 partner -> Channels -> WhatsApp**。
+
+| 字段 | 怎么填 |
+| --- | --- |
+| **Send Progress** | 测试时建议开启。长任务会把过程 narration 发到 WhatsApp。 |
+| **Send Tool Hints** | 调试时建议开启;不想让用户看到一行工具调用就关掉。 |
+| **Enabled** | bridge 跑起来、准备启动 channel 时再打开。 |
+| **Bridge Url** | bridge 的 WebSocket 地址,默认 `ws://localhost:3001`。 |
+| **Bridge Token** | 可选共享密钥。只有你的 bridge 校验 `auth` 消息时才需要填。 |
+| **Allow From** | 一行一个值。测试可填 `*` 表示开放;上线后换成具体 sender id(WhatsApp id 里 `@` 前面那段,通常是手机号)。空列表拒绝所有人。 |
+
+## 配置完成之后
+
+1. 保存 card,**Enabled** 打开。
+2. 从 UI 或 CLI 启动(或重启)partner,让 channel 加载新配置。
+3. 观察服务端日志出现 `Connected to WhatsApp bridge`。
+4. 给登录在 bridge 上的 WhatsApp 号码发一条短消息。
+5. 在日志里看到真实 sender id 之后,把 **Allow From** 的 `*` 换成明确值。
+
+```bash
+deeptutor partner start <partner-id>
+```
+
+## 如何确认健康
+
+健康的 WhatsApp channel 通常有三个迹象:
+
+- bridge 终端显示 WhatsApp Web 登录成功(不再刷新二维码);
+- DeepTutor 日志出现 `Connected to WhatsApp bridge`;
+- 允许的发送者发一条短消息后,Partner 能正常回复。
+
+## 常见问题
+
+### Bridge 连不上 / channel 一直重连
+
+日志反复出现 `WhatsApp bridge connection error` 和 `Reconnecting in 5 seconds...`。检查 bridge 进程是否在跑、**Bridge Url** 的主机和端口是否正确。DeepTutor 会一直重试,bridge 恢复后 channel 自动复原。
+
+### Bridge 反复打印二维码
+
+bridge 的登录状态没有持久化。确认它的 auth 目录(示例里是 `./auth`)可写且重启后还在。另外手机离线约两周后 WhatsApp Web 会话会过期,重新扫码即可恢复。
+
+### 收得到消息但回复发不出去
+
+如果 bridge 在回合中途断线,DeepTutor 回复时日志会出现 `WhatsApp bridge not connected`。等 bridge 恢复连接后再发一条新消息。入站消息按 id 去重,bridge 重连不会产生重复回答。
diff --git a/site/src/content/docs/zh-cn/docs/partners/zulip.md b/site/src/content/docs/zh-cn/docs/partners/zulip.md
new file mode 100644
index 000000000..33105869c
--- /dev/null
+++ b/site/src/content/docs/zh-cn/docs/partners/zulip.md
@@ -0,0 +1,76 @@
+---
+title: Zulip
+description: 为 Partner 配置 Zulip channel —— event-queue long polling,session 按 stream + topic 划分。
+---
+
+<img src="/channel-icons/zulip.svg" alt="" width="40" height="40" />
+
+`zulip` channel 把 Partner 接到 Zulip 的结构化团队聊天里。Zulip 把对话切分成 **stream** 和 **topic**,channel 保留了这套结构:每个 (stream, topic) 组合就是一个独立的 Partner session,每条作业讨论、每个支持 topic 都带着自己的上下文。私聊也支持,按发送者各自隔离。
+
+![Zulip 渠道配置](/screenshots/partners-channel-zulip.png)
+
+## 安装依赖
+
+Zulip 支持包含在 Partners extra 里 —— `zulip` 客户端包随之安装,别的不用装。
+
+```bash
+pip install -e ".[partners]"
+# 或发布包支持 partners extras 时:
+pip install "deeptutor[partners]"
+```
+
+## 在 Zulip 里创建 bot
+
+1. 在 Zulip 中点右上角齿轮图标 -> **Organization**(或 **Personal**)**settings** -> **Bots**。
+2. 点 **Add a new bot**,类型选 **Generic bot**,起个名字。
+3. Zulip 会生成一个 bot 邮箱,形如 `[email protected]` —— **Email** 字段填的就是它,不是人的邮箱。
+4. 在同一页复制 bot 的 **API key**。
+5. Generic bot 默认能收到私聊,但只有订阅了某个 stream 才能看到它。可以在 Zulip 的 bot 设置里订阅,也可以用下面的 **Subscribe Streams** 让 DeepTutor 代劳。
+
+## 配置 channel card
+
+打开 **Partners -> 你的 partner -> Channels -> Zulip**。
+
+| 字段 | 怎么填 |
+| --- | --- |
+| **Send Progress** | 测试时建议开启。长任务会投递过程 narration。 |
+| **Send Tool Hints** | 调试时建议开启;不想让用户看到一行工具调用就关掉。 |
+| **Enabled** | 准备启动 channel 时再打开。 |
+| **Site** | 你的 Zulip 服务器 URL,比如 `https://yourorg.zulipchat.com`。要带 scheme,realm 子域名要写对。 |
+| **Email** | 创建页生成的 bot 邮箱 —— 不是你自己的。 |
+| **Api Key** | bot 的 API key。按密钥存储。 |
+| **Allow From** | 一行一个 Zulip 用户 id 或邮箱,两种写法都能匹配。开放测试可填 `*`。空列表拒绝所有人。 |
+| **Group Policy** | 针对 stream 消息:`mention`(默认)只在 bot 被 @ 时回答,`open` 对已订阅 stream 的每条消息都答。私聊永远会回复。 |
+| **Subscribe Streams** | stream 名,一行一个。channel 启动时会替 bot 订阅它们。 |
+| **Timeout** | event-queue long-poll 超时秒数。默认 `60` 适用于大多数服务器。 |
+
+## 保存之后
+
+1. 点 **Save**,打开 **Enabled** 后再保存一次。
+2. 启动 partner —— 从 UI 操作,或 `deeptutor partner start <partner-id>`。已经在跑就重启。
+3. 私聊 bot,或在已订阅的 stream 里 @ 它。
+4. 回复正常之后,把 **Allow From** 里的 `*` 换成真实用户 id 或邮箱。
+
+数学公式不会在路上丢掉:channel 会把回复里标准的 `$...$` 和 `$$...$$` 转成 Zulip 原生的 KaTeX 格式。
+
+## 如何确认健康
+
+健康的 Zulip channel 有三个迹象:
+
+- 日志显示 event queue 已注册、配置的 stream 已订阅;
+- 私聊 bot 能收到回复;
+- 在已订阅的 stream 里 @ 它,能在同一个 topic 里收到回复。
+
+## 常见问题
+
+### bot 看不到 stream 消息
+
+通常是两种原因。bot 没订阅这个 stream —— 去 Zulip 的 bot 设置里加,或用 **Subscribe Streams**。或者 **Group Policy** 是 `mention` 而消息没有 @ 到 bot;@ 一下,或把策略改成 `open`。
+
+### 启动时报鉴权错误
+
+把三件套重新核对一遍:**Site** 必须是带正确 realm 子域名的完整 URL,**Email** 必须是 bot 的生成邮箱,**Api Key** 必须和这个 bot 对得上。在 Zulip 里重新生成 key 会让旧的失效,轮换后记得更新 card。
+
+### 日志里出现 `BAD_EVENT_QUEUE_ID`
+
+服务器重启或长时间空闲后 event queue 会过期。channel 会自动重新注册 —— 不用管。如果反复不停地出现,去检查 Zulip 服务器本身的健康状况。
diff --git a/site/src/content/docs/zh-cn/docs/tutorbot/dingtalk.md b/site/src/content/docs/zh-cn/docs/tutorbot/dingtalk.md
index 5d775445a..119777d1f 100644
--- a/site/src/content/docs/zh-cn/docs/tutorbot/dingtalk.md
+++ b/site/src/content/docs/zh-cn/docs/tutorbot/dingtalk.md
@@ -1,97 +1,6 @@
---
-title: 钉钉
-description: 在钉钉上跑 TutorBot —— 阿里的企业聊天,走 Stream Mode 连接。
+title: 已迁移
+description: 本旧页面保留用于兼容历史链接。
---
-钉钉是阿里的企业即时通信产品。DeepTutor 通过官方 `dingtalk-stream` SDK 走 **Stream Mode** —— 不需要公网 webhook。
-
-## 你需要准备
-
-- 一个有管理员权限的钉钉组织
-- 访问 [**钉钉开放平台**](https://open.dingtalk.com/)
-
-## Step 1 —— 创建应用
-
-1. 登录 <https://open.dingtalk.com/>
-2. **应用开发** → **创建应用**
-3. 选 **企业内部机器人** 类型
-4. 填名字、描述、图标
-5. 创建后在凭证页复制 **AppKey(Client ID)** 和 **AppSecret(Client Secret)**
-
-## Step 2 —— 启用 Stream Mode
-
-1. 在应用设置 → **Stream 模式** → **启用**
-2. 这样就不需要公网 webhook URL 了
-
-## Step 3 —— 权限
-
-申请这些权限:
-- 发消息
-- 读消息内容
-- (可选)语音转文字
-
-## Step 4 —— 配置
-
-```yaml
-channels:
- dingtalk:
- enabled: true
- client_id: "dingxxxxxxxxxxxxxxxx"
- client_secret: "YOUR_CLIENT_SECRET"
- allow_from: []
-```
-
-## Step 5 —— 启动
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:dingtalk → connecting (stream mode)
-[bot:my-math-tutor] channel:dingtalk → ready
-```
-
-## 配置参考
-
-| 字段 | 类型 | 必填 | 说明 |
-|------|------|------|------|
-| `enabled` | bool | 是 | |
-| `client_id` | string | 是 | 钉钉的 AppKey |
-| `client_secret` | string | 是 | AppSecret |
-| `allow_from` | list[string] | 可选 | 钉钉 user id |
-
-## 钉钉上支持的能力
-
-| 特性 | 支持情况 |
-|------|----------|
-| 私聊 | ✅ |
-| 群聊 | ✅ |
-| Markdown / 富文本 | ✅ |
-| 动作卡片(可交互按钮) | ✅ |
-| 文件上传 | ✅ |
-| **语音 → 文字转写** | ✅ *(内置钉钉的语音识别)* |
-| @ 寻址 | ✅ |
-
-## 保活机制
-
-dingtalk-stream SDK 负责 long-poll 回调连接。断线时自动重连。
-
-## 常见问题
-
-### "Invalid client_secret"
-
-去钉钉开放平台 → 你的应用 → 凭证 核对。Secret 可以被轮换。
-
-### Bot 在线但不回复
-
-确认 bot 已经为目标用户 / 部门安装。在钉钉里,机器人必须先被显式加到组织里才能聊天。
-
-### Stream 模式连不上
-
-Stream 模式要求 bot 已发布(不是 draft 状态)。在钉钉应用页点 **发布**。
-
-## 另请参阅
-
-- [**飞书**](/zh-cn/docs/tutorbot/feishu/) —— 国内另一个主流企业聊天
-- [**企业微信**](/zh-cn/docs/tutorbot/wecom/) —— 腾讯的企业即时通信
+本页对应的旧文档已迁移。请阅读 [**Partners 伙伴与渠道**](/zh-cn/docs/partners/)。
diff --git a/site/src/content/docs/zh-cn/docs/tutorbot/discord.md b/site/src/content/docs/zh-cn/docs/tutorbot/discord.md
index 50dd91048..119777d1f 100644
--- a/site/src/content/docs/zh-cn/docs/tutorbot/discord.md
+++ b/site/src/content/docs/zh-cn/docs/tutorbot/discord.md
@@ -1,140 +1,6 @@
---
-title: Discord
-description: 在 Discord 上跑 TutorBot —— Developer Portal 注册、Gateway WebSocket 连接、群组策略。
+title: 已迁移
+description: 本旧页面保留用于兼容历史链接。
---
-Discord 走 **Gateway WebSocket**,不是 polling。DeepTutor 直接实现了 gateway 协议(不依赖 `discord.py`),断线自动重连。
-
-## 你需要准备
-
-- 一个 Discord 账号
-- 一个你能管理的 server(用来测试 bot)
-- 5 分钟在 Discord Developer Portal 上
-
-## Step 1 —— 创建一个 Discord Application
-
-1. 打开 <https://discord.com/developers/applications>
-2. 点 **New Application**
-3. 起个名字(比如 "Math Mentor")
-4. Save
-
-## Step 2 —— 创建 Bot 用户
-
-1. 应用左侧栏选 **Bot**
-2. 点 **Add Bot** → 确认
-3. 在 **TOKEN** 下点 **Reset Token**,然后 **Copy** —— 这就是你的 `token`
-4. 在 **Privileged Gateway Intents** 下打开:
- - **Message Content Intent** *(必须,才能读消息正文)*
- - **Server Members Intent** *(推荐)*
-
-## Step 3 —— 把 bot 邀请进 server
-
-1. 左侧栏 → **OAuth2** → **URL Generator**
-2. Scopes:勾 `bot`
-3. Bot Permissions:勾 `Send Messages`、`Read Message History`、`Attach Files`、`Embed Links`、`Add Reactions`
-4. 复制生成的 URL,新标签页打开,选一个 server,**Authorize**
-
-## Step 4 —— 配置
-
-编辑 `data/tutorbot/<bot_id>/agents.yaml`:
-
-```yaml
-channels:
- discord:
- enabled: true
- token: "YOUR_BOT_TOKEN"
- allow_from:
- - "USER_ID_1" # 在 Discord 里右键用户 → Copy User ID(需要先开 Dev Mode)
- # - "*" # 全开
- group_policy: "mention" # 或 "open"
- intents: 37377 # 默认 —— 涵盖 messages + guilds
-```
-
-> **拿 User ID 的 Dev Mode:** Discord 设置 → **Advanced** → 打开 **Developer Mode**。之后右键任意用户 → Copy User ID。
-
-## Step 5 —— 启动
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:discord → connecting (gateway wss://...)
-[bot:my-math-tutor] channel:discord → ready (heartbeat 41250ms)
-```
-
-## 配置参考
-
-| 字段 | 类型 | 必填 | 默认值 | 说明 |
-|------|------|------|--------|------|
-| `enabled` | bool | 是 | `false` | |
-| `token` | string | 是 | —— | Developer Portal 里的 Bot token |
-| `allow_from` | list[string] | 是 | `[]` | User id 列表,或 `"*"` |
-| `group_policy` | `"mention" \| "open"` | 可选 | `"mention"` | 群聊行为 |
-| `gateway_url` | string | 可选 | `wss://gateway.discord.gg/?v=10&encoding=json` | 只有走代理时才需要改 |
-| `intents` | int | 可选 | `37377` | 位字段;默认涵盖 messages + guilds + members |
-
-## Discord 上支持的能力
-
-| 特性 | 支持情况 |
-|------|----------|
-| DM 私聊 | ✅ |
-| Guild 文字频道 | ✅ |
-| Thread | ⚠️ 部分支持 —— bot 目前是在父频道回复 |
-| 文件上传 | ✅ *(20 MB 以内)* |
-| 文件下载 | ✅ |
-| Markdown / mention 渲染 | ✅ *(Discord flavored markdown)* |
-| 正在输入指示 | ✅ |
-| 表情反应 | ⚠️ 只支持发出方向(bot 加 reaction,但不会响应用户的 reaction) |
-
-## 群组策略
-
-| 策略 | 行为 |
-|------|------|
-| `mention` | Bot 只回复 @ 它的消息 |
-| `open` | Bot 回频道里的每条消息 *(很吵 —— 只适合专门的 bot 频道)* |
-
-DM 里不管什么策略 bot 都会回。
-
-## 保活机制
-
-DeepTutor 的 Discord 渠道维护 gateway WebSocket,**每 ~41 秒发一次 heartbeat**(按 Discord 协议)。断线时:
-
-- 5 秒后自动重连
-- 先试 session resume(不用重新加入频道)
-- resume 失败则走完整重连
-
-你不需要任何外部守护进程 —— 渠道管理器搞定所有重连。
-
-## 常见问题
-
-### `4014: Disallowed intent`
-
-你在配置里申请了一个 intent,但 Developer Portal 没启用。最常见就是 Message Content Intent。
-
-修复:Developer Portal → 你的 app → **Bot** → 启用 **Message Content Intent**。
-
-### Bot 在线但是不回复
-
-检查 `allow_from`。规则和 Telegram 一样:空列表拒所有人。
-
-再确认 Message Content Intent 是开的 —— 不开的话,bot 收到的消息 `content` 是空的。
-
-### 超过 2000 字的消息被截断
-
-Discord 单条消息上限 2000 字。Bot 会自动拆长回复。Deep Research 这类输出建议直接发文件:
-
-```yaml
-channels:
- discord:
- send_long_as_file: true # 超 2000 字时附 .md
-```
-
-### 429 限流
-
-Discord 按频道限流。如果你的 bot 短时间发很多消息(比如繁忙频道里跑 `open` 策略),就会撞到 429。渠道层会指数退避重试,但更建议切到 `mention`。
-
-## 另请参阅
-
-- [**Telegram**](/zh-cn/docs/tutorbot/telegram/) —— 更简单的 gateway 模型,可以对比着看
-- [**Slack**](/zh-cn/docs/tutorbot/slack/) —— 也是 socket-mode,配置感觉类似
+本页对应的旧文档已迁移。请阅读 [**Partners 伙伴与渠道**](/zh-cn/docs/partners/)。
diff --git a/site/src/content/docs/zh-cn/docs/tutorbot/email.md b/site/src/content/docs/zh-cn/docs/tutorbot/email.md
index 3ad0f3a3b..119777d1f 100644
--- a/site/src/content/docs/zh-cn/docs/tutorbot/email.md
+++ b/site/src/content/docs/zh-cn/docs/tutorbot/email.md
@@ -1,166 +1,6 @@
---
-title: 电子邮件
-description: 通过邮件跑 TutorBot —— IMAP 轮询 + SMTP 回信,显式授权与完整正文解析。
+title: 已迁移
+description: 本旧页面保留用于兼容历史链接。
---
-Email 渠道把你的 TutorBot 变成一个异步的邮件对话方。用户给指定邮箱发信,bot 通过 IMAP 读取,通过 SMTP 回信。适合 **异步答疑** 以及更偏好邮件的用户群体。
-
-## 你需要准备
-
-- 一个邮箱账号(Gmail、Outlook、你自建的 SMTP/IMAP 服务器等)
-- App-password 访问 *(或 OAuth,见下文)*
-- 5 分钟配置
-
-## Step 1 —— 准备邮箱凭证
-
-**Gmail**:
-
-1. 在账号上启用 2FA
-2. 创建 [**App Password**](https://myaccount.google.com/apppasswords)(16 字符一次性密码)
-3. 把它作为下面配置里的密码
-
-**Outlook / Office 365**:要么 App Password(启用 2FA)要么 OAuth。个人用 App Password 更简单。
-
-**自建**(Postfix、Maddy 等):直接用账号密码。
-
-## Step 2 —— 配置
-
-```yaml
-channels:
- email:
- enabled: true
- consent_granted: true # 必须显式 —— 隐私保护
-
- # IMAP(入站)
- imap_host: "imap.gmail.com"
- imap_port: 993
- imap_username: "[email protected]"
- imap_password: "YOUR_APP_PASSWORD"
- imap_mailbox: "INBOX"
- imap_use_ssl: true
-
- # SMTP(出站)
- smtp_host: "smtp.gmail.com"
- smtp_port: 587
- smtp_username: "[email protected]"
- smtp_password: "YOUR_APP_PASSWORD"
- smtp_use_tls: true
- smtp_use_ssl: false
- from_address: "[email protected]"
-
- # 行为
- auto_reply_enabled: true
- poll_interval_seconds: 30 # IMAP 检查频率
- mark_seen: true # 处理后标记为已读
- max_body_chars: 12000
- subject_prefix: "Re: "
- allow_from: # 邮箱地址;[] = 全开;["x@..."] = 白名单
-```
-
-## Step 3 —— 启动
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:email → connecting (imap.gmail.com:993)
-[bot:my-math-tutor] channel:email → ready, polling every 30s
-```
-
-从你允许的地址给 `[email protected]` 发邮件 —— 30 秒内(或下一次 poll),你会收到自动回复。
-
-## 为什么 `consent_granted` 必须设
-
-读邮件很敏感。渠道在没有显式 `consent_granted: true` 的情况下 **拒绝启动** —— 一个硬卡点,防止误读邮件。这是有意为之的隐私保护。
-
-## 配置参考
-
-| 字段 | 类型 | 必填 | 默认值 |
-|------|------|------|--------|
-| `enabled` | bool | 是 | `false` |
-| `consent_granted` | bool | 是 | `false` —— 必须显式设为 `true` |
-| `imap_host` | string | 是 | —— |
-| `imap_port` | int | 是 | `993` |
-| `imap_username` | string | 是 | —— |
-| `imap_password` | string | 是 | —— |
-| `imap_mailbox` | string | 可选 | `"INBOX"` |
-| `imap_use_ssl` | bool | 可选 | `true` |
-| `smtp_host` | string | 是 | —— |
-| `smtp_port` | int | 是 | `587` |
-| `smtp_username` | string | 是 | —— |
-| `smtp_password` | string | 是 | —— |
-| `smtp_use_tls` | bool | 可选 | `true` |
-| `smtp_use_ssl` | bool | 可选 | `false` |
-| `from_address` | string | 可选 | = `smtp_username` |
-| `auto_reply_enabled` | bool | 可选 | `true` |
-| `poll_interval_seconds` | int | 可选 | `30` |
-| `mark_seen` | bool | 可选 | `true` |
-| `max_body_chars` | int | 可选 | `12000` |
-| `subject_prefix` | string | 可选 | `"Re: "` |
-| `allow_from` | list[string] | 可选 | `[]`(对所有人开放) |
-
-## 邮件上支持的能力
-
-| 特性 | 支持情况 |
-|------|----------|
-| 纯文本正文 | ✅ |
-| HTML 正文 | ✅ *(转成 markdown)* |
-| 入站附件 | ✅ *(PDF、图片、文本文件)* |
-| 出站附件 | ✅ *(通过 SMTP 带附件回复)* |
-| 邮件 thread | ✅ *(通过 `In-Reply-To` header)* |
-| 主题前缀 | ✅ *(默认 `Re: `)* |
-| 正文里的 LaTeX | ⚠️ 当纯文本渲染;数学密集的回复考虑转 PDF |
-
-## 会话模型
-
-每个独立的发件人邮箱被视为一个独立 session。同一邮件 thread 内的回复(按 `In-Reply-To` 匹配)继续同一 session。
-
-意思就是 `[email protected]` 发的所有邮件总会落到同一个 DeepTutor session —— 非常适合持续的异步答疑。
-
-## 保活机制
-
-Email 渠道用一个 **后台轮询循环**:
-
-- 每 `poll_interval_seconds` 秒,渠道通过 IMAP 登录、拉未读邮件、处理、标已读
-- IMAP 掉线时,下一次 poll 自动重连
-- SMTP 是每次发信开新连接(不维持长连接)
-
-高量使用就把 `poll_interval_seconds: 15` 或更低。低于 10 秒可能撞 provider 限流。
-
-## 常见问题
-
-### 启动失败 —— "consent_granted is required"
-
-你忘了设:
-
-```yaml
-consent_granted: true
-```
-
-这是有意的摩擦。请有意识地打开。
-
-### Gmail / Outlook "Authentication failed"
-
-你用了账号密码而不是 App Password。启用 2FA 后,IMAP/SMTP 是不接收常规密码的 —— 必须用 16 字符的 App Password。
-
-### 和另一个自动回复器互相循环
-
-两个自动回复器互发邮件就会陷入回环。渠道通过检查 `Auto-Submitted:` header 来检测回环 —— 但如果对方不设这个 header,回环还是可能。防御措施:
-
-- 用 `allow_from` 限制 bot 回复的对象
-- 设 `auto_reply_enabled: false`,从 CLI 手动触发回复
-
-### IMAP 文件夹找不到
-
-有些 provider mailbox 名字不一样(`INBOX` vs `Inbox` vs `[Gmail]/All Mail`)。在 provider 的 webmail 里查清楚,改 `imap_mailbox`。
-
-### 回复被标垃圾邮件
-
-填一个像样的 `from_address`;自建邮件服务器记得配 SPF/DKIM/DMARC;或者出站用受信的 SMTP relay(SendGrid、Mailgun)。
-
-## 另请参阅
-
-- [**WhatsApp**](/zh-cn/docs/tutorbot/whatsapp/) —— 另一个桥接式渠道
-- [**TutorBot 概览**](/zh-cn/docs/tutorbot/) —— 架构
+本页对应的旧文档已迁移。请阅读 [**Partners 伙伴与渠道**](/zh-cn/docs/partners/)。
diff --git a/site/src/content/docs/zh-cn/docs/tutorbot/feishu.md b/site/src/content/docs/zh-cn/docs/tutorbot/feishu.md
index da2bc6794..119777d1f 100644
--- a/site/src/content/docs/zh-cn/docs/tutorbot/feishu.md
+++ b/site/src/content/docs/zh-cn/docs/tutorbot/feishu.md
@@ -1,145 +1,6 @@
---
-title: 飞书 / Lark
-description: 在飞书(国内)/ Lark(海外)上跑 TutorBot —— 走 lark-oapi SDK 的 WebSocket 长连。
+title: 已迁移
+description: 本旧页面保留用于兼容历史链接。
---
-飞书是国内最流行的办公聊天工具;Lark 是它的海外对应版本。两者 API 一致。DeepTutor 通过官方 `lark-oapi` SDK,用一条长连 WebSocket 同时支持。
-
-## 你需要准备
-
-- 飞书 / Lark 开发者账号
-- 访问 [**飞书开放平台**](https://open.feishu.cn/)(国内)或 [**Lark Open Platform**](https://open.larksuite.com/)(海外)
-- 可选:一个你能装 bot 的飞书 / Lark 组织
-
-## Step 1 —— 创建应用
-
-1. 打开对应平台 → **创建应用** → **自建应用**
-2. 填基本信息(名称、描述、图标)
-3. 创建后在 **凭证与基础信息** 页复制:
- - **App ID**
- - **App Secret**
- - **Verification Token**
- - **Encrypt Key**
-
-## Step 2 —— 开启机器人能力
-
-1. 左侧栏 → **应用能力** → **机器人** → **启用**
-2. 配置机器人的显示名和头像
-
-## Step 3 —— 配置事件订阅
-
-1. 左侧栏 → **事件订阅** → **订阅事件**
-2. 添加你关心的事件:
- - `im.message.receive_v1` —— 接收消息
- - `im.message.message_read_v1` —— 已读回执(可选)
-3. **启用长连接模式**,这样就不用公网 webhook URL 了。打开后 bot 走 WebSocket 而不是 webhook。
-
-## Step 4 —— 加权限
-
-左侧栏 → **权限管理**:
-
-- `im:message:send_as_bot` —— 发消息
-- `im:resource` —— 读多媒体附件
-- `contact:user.id:readonly` —— 解析 user id
-
-然后 **发布** 版本 *(自建应用走内部发布)*。
-
-## Step 5 —— 配置 DeepTutor
-
-```yaml
-channels:
- feishu:
- enabled: true
- app_id: "cli_xxxxxxxxxxxxxxxx"
- app_secret: "YOUR_APP_SECRET"
- verification_token: "YOUR_VERIFICATION_TOKEN"
- encrypt_key: "YOUR_ENCRYPT_KEY"
- allow_from: []
- group_policy: "mention"
-```
-
-## Step 6 —— 启动
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:feishu → connecting (long-connection)
-[bot:my-math-tutor] channel:feishu → ready (app_id=cli_xxx)
-```
-
-## 配置参考
-
-| 字段 | 类型 | 必填 | 说明 |
-|------|------|------|------|
-| `enabled` | bool | 是 | |
-| `app_id` | string | 是 | `cli_...` |
-| `app_secret` | string | 是 | |
-| `verification_token` | string | 是 | 用于事件签名校验 |
-| `encrypt_key` | string | 是 | 用于解密入站事件 |
-| `allow_from` | list[string] | 可选 | User id 列表;`["*"]` 全开 |
-| `group_policy` | `"mention" \| "open"` | 可选 | 默认 `"mention"` |
-
-## 飞书上支持的能力
-
-| 特性 | 支持情况 |
-|------|----------|
-| 私聊 | ✅ |
-| 群聊 | ✅ |
-| **交互卡片** | ✅ *(带按钮的飞书富卡片消息)* |
-| Markdown | ✅ |
-| 文件 / 图片上传 / 下载 | ✅ |
-| 语音转写 | ✅ *(设了 `transcription_api_key`)* |
-| 表情反应 | ⚠️ 只支持发出方向 |
-| @ 寻址 | ✅ |
-
-## 长连模式 vs webhook 模式
-
-飞书支持两种投递方式:
-
-| 模式 | 优点 | 缺点 |
-|------|------|------|
-| **长连接** *(推荐)* | 不需要公网 IP;哪都能用 | 一个 app 对一个 DeepTutor 实例 |
-| Webhook | 多个端点;标准请求/响应 | 需要 HTTPS 公网 URL |
-
-DeepTutor 默认走长连。要切到 webhook(有负载均衡需求时),需要自己跑一个 webhook 接收器 —— 目前 DeepTutor 内置不支持。
-
-## 保活机制
-
-lark-oapi SDK 负责 WebSocket 自动重连。后台线程跑 WebSocket 监听器,把事件转给 DeepTutor 的 async 总线。
-
-如果 bot 在飞书里掉线了(状态显示 offline):
-
-```bash
-deeptutor bot stop my-math-tutor
-deeptutor bot start my-math-tutor
-```
-
-要长期稳定,配 systemd 或 Docker `restart: unless-stopped`。
-
-## 常见问题
-
-### 启动报 "Invalid app_secret"
-
-去飞书凭证页核对 **App Secret** —— 它可以被轮换。也确认你在正确的平台(国内是 `open.feishu.cn`,海外是 `open.larksuite.com` —— 两边的 secret 不通用)。
-
-### Bot 说自己在线但收不到消息
-
-两件事检查:
-
-1. **权限** —— `im:message:send_as_bot` 和事件订阅都加了,并且 **发布** 了新版本
-2. 事件订阅里 **长连接模式** 开了
-
-### Verification token 不匹配
-
-如果你在飞书里重新生成了 verification token,更新配置并重启 bot。这个 token 被签到每个入站事件里做完整性校验。
-
-### Encrypt key 不匹配
-
-同上 —— 你在飞书(设置 → 事件订阅)重新生成 encrypt key 后,要更新配置并重启。
-
-## 另请参阅
-
-- [**企业微信**](/zh-cn/docs/tutorbot/wecom/) —— 腾讯的企业聊天平台,注册 UX 类似
-- [**钉钉**](/zh-cn/docs/tutorbot/dingtalk/) —— 阿里在企业聊天领域的对位产品
+本页对应的旧文档已迁移。请阅读 [**Partners 伙伴与渠道**](/zh-cn/docs/partners/)。
diff --git a/site/src/content/docs/zh-cn/docs/tutorbot/index.md b/site/src/content/docs/zh-cn/docs/tutorbot/index.md
index b0e31704b..119777d1f 100644
--- a/site/src/content/docs/zh-cn/docs/tutorbot/index.md
+++ b/site/src/content/docs/zh-cn/docs/tutorbot/index.md
@@ -1,85 +1,6 @@
---
-title: TutorBot 概览
-description: TutorBot —— 持久化、多渠道的自主导师。架构、生命周期、保活策略,以及每个渠道一页文档。
+title: 已迁移
+description: 本旧页面保留用于兼容历史链接。
---
-**TutorBot** 是一个住在 DeepTutor 里的持久化、自主 AI 导师,可以同时连到一个或多个 **外部聊天渠道**(Telegram、Slack、飞书 等),让你的用户在他们已有的工具里和它对话。
-
-本章节是运维指南:系统怎么工作、怎么保活,以及 **每个渠道一页专属文档**(注册流程、配置项、故障排查)。
-
-## 架构图
-
-```text
-┌─────────────────────────────────────────────────────────────────────┐
-│ DeepTutor server │
-│ │
-│ ┌─────────────────────────────────────────────────────────────┐ │
-│ │ Bot orchestrator │ │
-│ │ (nanobot 推理引擎驱动的 agent loop) │ │
-│ └──────────┬──────────────────────────────────────────────────┘ │
-│ │ │
-│ ┌─────────┼─────────┐ │
-│ ▼ ▼ ▼ │
-│ ┌───┐ ┌─────┐ ┌───────┐ 每个 bot 是一个独立的 asyncio task │
-│ │bot│ │ bot │ │ bot │ 独立工作区位于 │
-│ │ A │ │ B │ │ C │ data/tutorbot/<bot_id>/ │
-│ └─┬─┘ └──┬──┘ └───┬───┘ │
-│ │ │ │ │
-│ │ ┌───────┼──────────┼───────────────────────────────────┐ │
-│ ▼ ▼ ▼ ▼ ▼ │
-│ ┌──────────────────────────────────────────────────┐ │
-│ │ Channel registry (12 个渠道) │ │
-│ └──────────────────────────────────────────────────┘ │
-└────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬──┬──┬───┘
- │ │ │ │ │ │ │ │ │ │ │ │
- ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
- Telegram Discord Slack Matrix Zulip 飞书 企业微信 钉钉 QQ WhatsApp 邮件 Mochat
-```
-
-关键特性:
-
-- **同进程**:所有 bot 都是 DeepTutor server 进程里的 asyncio task。不需要单独的进程、Docker sidecar 或 systemd unit。
-- **一个 bot 多渠道**:一个 bot 可以同时在 Telegram **和** Slack **和** Matrix 上对话。
-- **隔离的工作区**:每个 bot 都有自己的 `agents.yaml`、soul 模板、skills、cron 任务和本地 session 库,存在 `data/tutorbot/<bot_id>/` 下。
-- **共享 Memory**:所有 bot 看的是 **同一个用户的 L3 记忆**(`data/memory/L3/`),通过 per-channel L1 trace 来分辨来源。
-- **渠道重连不用重启**:渠道层级的断线(比如临时网络抖动)会自动恢复。
-
-## 生命周期
-
-```bash
-# 创建
-deeptutor bot create my-math-tutor \
- --name "Math Mentor" \
- --persona "专注于微积分和线性代数的 Socratic 导师" \
- --model gpt-4o
-
-# 配置渠道(编辑 data/tutorbot/my-math-tutor/agents.yaml)
-
-# 启动(为每个启用的渠道 fork 出 asyncio task)
-deeptutor bot start my-math-tutor
-
-# 查看状态
-deeptutor bot list
-
-# 停止
-deeptutor bot stop my-math-tutor
-```
-
-## 渠道一览
-
-| 渠道 | 页面 |
-|------|------|
-| Telegram | [docs/tutorbot/telegram](/zh-cn/docs/tutorbot/telegram/) |
-| Discord | [docs/tutorbot/discord](/zh-cn/docs/tutorbot/discord/) |
-| Slack | [docs/tutorbot/slack](/zh-cn/docs/tutorbot/slack/) |
-| Matrix | [docs/tutorbot/matrix](/zh-cn/docs/tutorbot/matrix/) |
-| Zulip | [docs/tutorbot/zulip](/zh-cn/docs/tutorbot/zulip/) |
-| 飞书 / Lark | [docs/tutorbot/feishu](/zh-cn/docs/tutorbot/feishu/) |
-| 企业微信 | [docs/tutorbot/wecom](/zh-cn/docs/tutorbot/wecom/) |
-| 钉钉 | [docs/tutorbot/dingtalk](/zh-cn/docs/tutorbot/dingtalk/) |
-| QQ | [docs/tutorbot/qq](/zh-cn/docs/tutorbot/qq/) |
-| WhatsApp | [docs/tutorbot/whatsapp](/zh-cn/docs/tutorbot/whatsapp/) |
-| 邮件 | [docs/tutorbot/email](/zh-cn/docs/tutorbot/email/) |
-| Mochat | [docs/tutorbot/mochat](/zh-cn/docs/tutorbot/mochat/) |
-
-> 各渠道页面目前仍为英文版(已为中文站点准备好链接结构)。
+本页对应的旧文档已迁移。请阅读 [**Partners 伙伴与渠道**](/zh-cn/docs/partners/)。
diff --git a/site/src/content/docs/zh-cn/docs/tutorbot/matrix.md b/site/src/content/docs/zh-cn/docs/tutorbot/matrix.md
index ad5f0fe2f..119777d1f 100644
--- a/site/src/content/docs/zh-cn/docs/tutorbot/matrix.md
+++ b/site/src/content/docs/zh-cn/docs/tutorbot/matrix.md
@@ -1,187 +1,6 @@
---
-title: Matrix
-description: 在 Matrix 上跑 TutorBot —— 去中心化聊天,端到端加密可选。
+title: 已迁移
+description: 本旧页面保留用于兼容历史链接。
---
-Matrix 是去中心化聊天的选项。DeepTutor 通过标准的 client-server API 和任何 Matrix homeserver 通信(matrix.org、你自己跑的 Synapse、Conduit、Dendrite 都行)。
-
-端到端加密是 **可选的**,独立成一个 install extra,所以大多数用户不用承担 libolm 依赖的代价。
-
-## 你需要准备
-
-- 一个 Matrix 账号(matrix.org 或任意 homeserver)
-- 那个账号的 `access_token`
-- *(如果要 E2EE)* 系统里装好 `libolm`
-
-## Step 1 —— 给 bot 注册一个 Matrix 账号
-
-Bot 需要自己独立的 Matrix 账号。任意 homeserver 都行:
-
-- **公共的**:Element web 应用 → matrix.org → Create Account
-- **自建**:`register_new_matrix_user`(Synapse)或对应你服务器的等价工具
-
-测试用的话,matrix.org 的公共 homeserver 就够了。
-
-## Step 2 —— 拿 access token
-
-### 方案 A —— 从 Element 拿
-
-1. 用 bot 账号登 Element
-2. **Settings** → **Help & About** → 滚到 **Advanced**
-3. 展开 **Access Token** 复制
-
-### 方案 B —— 从 REST API 拿
-
-```bash
-curl -X POST https://matrix.org/_matrix/client/r0/login \
- -H "Content-Type: application/json" \
- -d '{
- "type": "m.login.password",
- "user": "math-bot",
- "password": "your-password"
- }'
-
-# 返回里有 "access_token": "syt_..."
-```
-
-## Step 3 —— 配置
-
-```yaml
-channels:
- matrix:
- enabled: true
- homeserver: "https://matrix.org" # 或你自建 homeserver 的 URL
- user_id: "@math-bot:matrix.org"
- access_token: "syt_xxxxxxxxxxxxxxxxxxxx"
- encryption_enabled: false # 装了 matrix-e2e extra 后再设 true
- allow_from: [] # 空 = bot 在加入的房间里谁都能聊
- rooms: [] # 指定 bot 加入的 room id,或 [] = 任何房间都监听
-```
-
-## Step 4 —— 装依赖
-
-Matrix 支持放在一个可选 install extra 里。三档:
-
-| 目标 | 安装命令 |
-|------|----------|
-| 基础 Matrix(无 E2EE) | `pip install -e ".[matrix]"` |
-| Matrix + E2EE | `pip install -e ".[matrix-e2e]"` *(还得装 libolm)* |
-| 所有 Partners 渠道(含 Matrix) | `pip install -e ".[partners]"` |
-
-要 E2EE 的话先装 **libolm**:
-
-```bash
-# macOS
-brew install libolm
-
-# Debian / Ubuntu
-sudo apt install libolm-dev
-
-# 然后装 Python extra
-pip install -e ".[matrix-e2e]"
-```
-
-## Step 5 —— 启动
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:matrix → connecting (homeserver=matrix.org)
-[bot:my-math-tutor] channel:matrix → sync ok (next_batch=...)
-[bot:my-math-tutor] channel:matrix → joined 3 rooms
-```
-
-## 邀请 bot 进房间
-
-Bot 跑起来之后,从任意 Matrix 客户端邀请:
-
-```text
-/invite @math-bot:matrix.org
-```
-
-Bot 会自动接受邀请并开始监听该房间的消息。要限制 bot 加入哪些房间:
-
-```yaml
-channels:
- matrix:
- rooms:
- - "!abc123:matrix.org" # 只自动加入这些指定的房间
-```
-
-## 配置参考
-
-| 字段 | 类型 | 必填 | 默认值 | 说明 |
-|------|------|------|--------|------|
-| `enabled` | bool | 是 | `false` | |
-| `homeserver` | url | 是 | —— | 比如 `https://matrix.org` |
-| `user_id` | string | 是 | —— | `@bot:matrix.org` |
-| `access_token` | string | 是 | —— | 来自 login 或 Element |
-| `encryption_enabled` | bool | 可选 | `false` | 需要 `[matrix-e2e]` extra + libolm |
-| `allow_from` | list[string] | 可选 | `[]` | Matrix user id 列表;`[]` = bot 加入的房间里谁都能聊 |
-| `rooms` | list[string] | 可选 | `[]` | 指定 room id 列表;`[]` = bot 在任意房间都监听 |
-
-## Matrix 上支持的能力
-
-| 特性 | 支持情况 |
-|------|----------|
-| 1:1 私聊 | ✅ |
-| 群组房间 | ✅ |
-| Markdown → HTML | ✅ *(在 Element、Cinny 等里渲染正确)* |
-| LaTeX 数学公式 | ⚠️ 需要 Matrix 客户端装 `mathjs` 插件 |
-| 文件上传 | ✅ |
-| 文件下载 | ✅ |
-| 端到端加密 | ✅ *(按需开启)* |
-| 正在输入指示 | ✅ |
-| 表情反应 | ⚠️ 只支持发出方向 |
-
-## 端到端加密
-
-`encryption_enabled: true` + libolm + `[matrix-e2e]` extra 都齐了之后:
-
-- Bot 首次启动时生成自己的设备密钥
-- 对每个 E2EE 房间,bot 通过 Megolm 参与密钥交换
-- 所有消息(含附件)都是端到端加密
-
-**注意**:bot 的推理仍然在 DeepTutor 服务端发生。加密只是在 Matrix 客户端(用户)和 bot 的 Matrix 进程之间,但消息文本到达 LLM provider 时是未加密的(除非你配了本地 LLM)。
-
-如果想做到「端到端到 LLM」的隐私,配本地 Ollama / vLLM 跟 bot 一起用。
-
-## 保活机制
-
-Matrix 渠道用 **`/sync` 长轮询接口**,30 秒超时。模式:
-
-1. 用 `since=<last_batch>` 调 `/sync`,超时 30000
-2. 收到新事件(或 30 秒后空响应)
-3. 更新 `last_batch`,立即重新 poll
-
-断线时:
-
-- 网络中断是透明的 —— 下一次 `/sync` 重试
-- 认证错误(401)需要人工介入(token 过期或被撤销)
-
-想要高可用就把 DeepTutor server 放在进程守护下(systemd、docker restart-policy)。渠道自身处理瞬时故障。
-
-## 常见问题
-
-### `M_UNKNOWN_TOKEN`
-
-你的 `access_token` 被撤了(从其他客户端登出、或服务器轮换密钥)。通过 Element 设置或 REST login 重新拿一个 token。
-
-### Bot 进了房间但 E2EE 房间里不回复
-
-你开了 `encryption_enabled: true` 但没装 `[matrix-e2e]` extra。Bot 连得上但解不开密 —— 装 libolm 后重装。
-
-### 联邦延迟
-
-如果 bot 在 `matrix.org` 而你在一个小的自建服务器聊,消息可能要几秒才联邦过来。不是 bug —— 联邦延迟。
-
-### "User not in room" 发回复时报错
-
-Bot 被踢了或退群了。从你的 Matrix 客户端重新邀请。
-
-## 另请参阅
-
-- [**TutorBot 概览**](/zh-cn/docs/tutorbot/) —— 整体架构
-- [Matrix 规范](https://spec.matrix.org/) —— 底层协议
+本页对应的旧文档已迁移。请阅读 [**Partners 伙伴与渠道**](/zh-cn/docs/partners/)。
diff --git a/site/src/content/docs/zh-cn/docs/tutorbot/mochat.md b/site/src/content/docs/zh-cn/docs/tutorbot/mochat.md
index 1b0836d0e..119777d1f 100644
--- a/site/src/content/docs/zh-cn/docs/tutorbot/mochat.md
+++ b/site/src/content/docs/zh-cn/docs/tutorbot/mochat.md
@@ -1,103 +1,6 @@
---
-title: Mochat
-description: 在 Mochat 上跑 TutorBot —— 客服式聊天面板,走 Socket.IO 或 HTTP 轮询。
+title: 已迁移
+description: 本旧页面保留用于兼容历史链接。
---
-[Mochat](https://github.com/microsoft/mochat) 是一个开源的客服 / 聊天面板。DeepTutor 的 Mochat 渠道通过 **Socket.IO**(首选)或 **HTTP 轮询**(fallback)接入。适合把导师 bot 嵌到你已有网站的客服 widget 里。
-
-## 你需要准备
-
-- 一个运行中的 Mochat 实例(自建或托管)
-- 一个带 access token(Claw Token)的 bot 账号
-
-## Step 1 —— 在 Mochat 里创建 bot
-
-1. 登录你的 Mochat 管理面板
-2. **Bots** → **Create**
-3. 复制 bot 的 **Claw Token**
-
-## Step 2 —— 配置
-
-```yaml
-channels:
- mochat:
- enabled: true
- service_url: "https://mochat.example.com"
- claw_token: "YOUR_BOT_TOKEN"
- allow_from: [] # User id 列表;[] = 全开
- use_http_polling: false # Socket.IO 不可用时的 fallback
- polling_interval_ms: 1000
- delayed_message_timeout_s: 5
-```
-
-## Step 3 —— 启动
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:mochat → connecting (socket.io to mochat.example.com)
-[bot:my-math-tutor] channel:mochat → ready
-```
-
-## 配置参考
-
-| 字段 | 类型 | 必填 | 默认值 |
-|------|------|------|--------|
-| `enabled` | bool | 是 | `false` |
-| `service_url` | url | 是 | —— |
-| `claw_token` | string | 是 | —— |
-| `allow_from` | list[string] | 可选 | `[]`(全开) |
-| `use_http_polling` | bool | 可选 | `false` |
-| `polling_interval_ms` | int | 可选 | `1000` |
-| `delayed_message_timeout_s` | int | 可选 | `5` |
-
-## Mochat 上支持的能力
-
-| 特性 | 支持情况 |
-|------|----------|
-| 客户聊天面板消息 | ✅ |
-| 群 / 房间消息 | ✅ |
-| Markdown | ✅ |
-| 文件上传 | ✅ |
-| 延迟消息打包 | ✅ *(高频输入下提升效率)* |
-
-## 延迟消息打包
-
-Mochat 用户经常会一连发好几条(比如 "Hi!\n快问一下\nbot 在不在线?")。为了避免每条都触发一次 bot 回复,渠道会把 `delayed_message_timeout_s`(默认 5s)内收到的消息 **打包**:
-
-- 第一条消息到达 → 启动计时器
-- 超时内收到更多消息 → 追加,重置计时器
-- 计时器到期 → 把所有消息打包成一个用户回合
-
-根据你的用户聊天节奏调整 `delayed_message_timeout_s`。
-
-## 保活机制
-
-Socket.IO 连接断线自动重连。如果 Socket.IO 反复失败,渠道会 fallback 到 HTTP 轮询:
-
-```yaml
-use_http_polling: true
-polling_interval_ms: 2000 # 每 2 秒 poll 一次
-```
-
-这是用延迟换鲁棒性 —— 在挑剔的企业代理后面很有用。
-
-## 常见问题
-
-### "Cannot connect" 但 Mochat 是开着的
-
-Mochat 有时要求 bot 在管理面板里 **被审核通过** 后 token 才生效。检查 bot 状态。
-
-### 回复发出了但用户看不到
-
-Mochat 有频道级可见性设置。确保 bot 被加进了用户聊天的频道。
-
-### Socket.IO 版本不匹配
-
-如果你的 Mochat 用的是较老的 Socket.IO 版本,与其调版本匹配,不如直接走 HTTP 轮询 —— `use_http_polling: true`。
-
-## 另请参阅
-
-- [**TutorBot 概览**](/zh-cn/docs/tutorbot/) —— 整体架构
+本页对应的旧文档已迁移。请阅读 [**Partners 伙伴与渠道**](/zh-cn/docs/partners/)。
diff --git a/site/src/content/docs/zh-cn/docs/tutorbot/qq.md b/site/src/content/docs/zh-cn/docs/tutorbot/qq.md
index 39747281a..dde9d6f9f 100644
--- a/site/src/content/docs/zh-cn/docs/tutorbot/qq.md
+++ b/site/src/content/docs/zh-cn/docs/tutorbot/qq.md
@@ -1,75 +1,6 @@
---
-title: QQ
-description: 在 QQ 上跑 TutorBot —— 腾讯的国民即时通讯,走官方 botpy SDK。
+title: 已迁移
+description: 本旧页面保留用于兼容历史链接。
---
-QQ 是腾讯的旗舰国民即时通讯。DeepTutor 通过腾讯官方的 **botpy** SDK 走 WebSocket 连接。
-
-## 你需要准备
-
-- 一个 [**QQ 开放平台**](https://bot.q.qq.com/) 账号
-- 腾讯云账号(某些进阶能力需要)
-
-## Step 1 —— 注册 QQ bot
-
-1. 登录 <https://bot.q.qq.com/>
-2. **新建机器人** → 填名字和描述
-3. 复制 **App ID** 和 **Secret**
-4. 启用你需要的消息类型:C2C(私信)和群消息
-
-## Step 2 —— 配置
-
-```yaml
-channels:
- qq:
- enabled: true
- app_id: "YOUR_APP_ID"
- secret: "YOUR_SECRET"
- allow_from: []
- msg_format: "plain" # 或 "markdown"
-```
-
-## Step 3 —— 启动
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-## 配置参考
-
-| 字段 | 类型 | 必填 | 说明 |
-|------|------|------|------|
-| `enabled` | bool | 是 | |
-| `app_id` | string | 是 | 来自 bot 平台 |
-| `secret` | string | 是 | 来自 bot 平台 |
-| `allow_from` | list[string] | 可选 | QQ user id |
-| `msg_format` | `"plain" \| "markdown"` | 可选 | 回复格式 |
-
-## QQ 上支持的能力
-
-| 特性 | 支持情况 |
-|------|----------|
-| C2C(私信) | ✅ |
-| 群消息 | ✅ |
-| Markdown | ✅ *(要 `msg_format: "markdown"`)* |
-| 文件 / 图片附件 | ✅ |
-| 回复里的图片生成 | ✅ |
-| @ 寻址 | ✅ |
-
-## 常见问题
-
-### 重复消息
-
-QQ 的 gateway 偶尔会重发消息。渠道层维护一个最近 1000 条 message id 的 deque,静默丢弃重复消息。如果你仍然看到重复,可能 deque 已经回绕 —— 重启 bot。
-
-### 连接时报 "Auth failed"
-
-`app_id` / `secret` 错了,或者你的 bot 没有被审核通过相应的消息类型。去 QQ Bot 平台检查。
-
-### Markdown 不渲染
-
-QQ 各客户端版本对 markdown 的渲染参差不齐。有些客户端识别 `**bold**`,有些要 `<b>bold</b>`。如果用户反馈渲染异常,试试 `msg_format: "plain"`。
-
-## 另请参阅
-
-- [**TutorBot 概览**](/zh-cn/docs/tutorbot/) —— 整体架构
+本页对应的旧文档已迁移。请阅读 [**QQ / NapCat**](/zh-cn/docs/partners/qq/)。
diff --git a/site/src/content/docs/zh-cn/docs/tutorbot/slack.md b/site/src/content/docs/zh-cn/docs/tutorbot/slack.md
index 500cc79a0..119777d1f 100644
--- a/site/src/content/docs/zh-cn/docs/tutorbot/slack.md
+++ b/site/src/content/docs/zh-cn/docs/tutorbot/slack.md
@@ -1,185 +1,6 @@
---
-title: Slack
-description: 在 Slack 上跑 TutorBot —— Socket Mode 应用、按 thread 分会话、频道与 DM 策略。
+title: 已迁移
+description: 本旧页面保留用于兼容历史链接。
---
-Slack 是功能最完整的渠道:DM、频道 @、**按 thread 分会话**(每条 thread 就是一个独立的 DeepTutor session)、Slack 风味的 markdown、文件上传、确认 reaction。
-
-连接走 **Socket Mode** —— 不需要公网 IP 或 webhook。
-
-## 你需要准备
-
-- 一个你可以装应用的 Slack workspace(自己的或管理员授权的)
-- 5 分钟在 <https://api.slack.com/apps>
-
-## Step 1 —— 创建 Slack app
-
-1. 去 <https://api.slack.com/apps> → **Create New App** → **From scratch**
-2. 起名(比如 "Math Mentor"),选 workspace
-3. 创建后进 **Socket Mode**(左侧栏)→ **Enable Socket Mode** *(开关打开)*
-4. 提示你生成 App-Level Token 时,给 `connections:write` 权限并复制 —— 这就是你的 **`app_token`**(`xapp-` 开头)
-
-## Step 2 —— 配置 OAuth scopes
-
-还在你的 app 里:
-
-1. 左侧栏 → **OAuth & Permissions**
-2. **Scopes** → **Bot Token Scopes** 加上:
- - `chat:write` —— 发消息
- - `chat:write.public` —— 不入群也能发到频道
- - `files:write` —— 上传文件
- - `reactions:write` —— 加 reaction(`:eyes:` 确认)
- - `users:read` —— 解析 user id 到名字
- - `app_mentions:read` —— 接收 @
- - `im:history` —— 读 DM 历史
- - `im:read` —— 读 DM 频道信息
- - `channels:history` —— 读公开频道历史
- - `groups:history` —— *(可选)* 私有频道
-3. 点 **Install to Workspace** → 授权
-4. 复制 **Bot User OAuth Token**(`xoxb-` 开头)—— 这是你的 **`bot_token`**
-
-## Step 3 —— 订阅事件
-
-1. 左侧栏 → **Event Subscriptions**
-2. **Subscribe to bot events** 加上:
- - `app_mention`
- - `message.im`
- - `message.channels` *(只在你想监听频道时才加;否则跳过)*
-
-## Step 4 —— 配置
-
-```yaml
-channels:
- slack:
- enabled: true
- mode: "socket" # 只支持 socket 一种
- bot_token: "xoxb-XXX..." # 来自 OAuth & Permissions
- app_token: "xapp-XXX..." # 来自 Socket Mode
- reply_in_thread: true # 回复留在 thread 内
- react_emoji: "eyes" # 用来确认收到的 reaction
- allow_from: ["*"] # User id 列表;"*" = 全开
- group_policy: "mention" # 频道里只回 @ 消息
- group_allow_from: [] # 限制到特定频道 id(如果用 mention)
- dm:
- enabled: true
- policy: "open" # DM 全回,或 "allowlist"
- allow_from: []
-```
-
-## Step 5 —— 启动
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:slack → connecting (socket mode)
-[bot:my-math-tutor] channel:slack → ready
-```
-
-在 Slack 里 DM bot,或者在频道 @ 它。
-
-## 配置参考
-
-| 字段 | 类型 | 必填 | 默认值 | 说明 |
-|------|------|------|--------|------|
-| `enabled` | bool | 是 | `false` | |
-| `mode` | string | 是 | `"socket"` | 只支持 `socket` |
-| `bot_token` | string | 是 | —— | `xoxb-…` |
-| `app_token` | string | 是 | —— | `xapp-…`(Socket Mode token) |
-| `reply_in_thread` | bool | 可选 | `true` | 在 thread 内回复 vs 发新消息 |
-| `react_emoji` | string | 可选 | `"eyes"` | 确认 reaction 用的 emoji 名 |
-| `allow_from` | list[string] | 是 | `[]` | User id 列表,或 `"*"` |
-| `group_policy` | `"mention" \| "open"` | 可选 | `"mention"` | 频道内 |
-| `group_allow_from` | list[string] | 可选 | `[]` | 频道 id 列表(想限定到特定频道时) |
-| `dm.enabled` | bool | 可选 | `true` | |
-| `dm.policy` | `"open" \| "allowlist"` | 可选 | `"open"` | |
-| `dm.allow_from` | list[string] | 可选 | `[]` | `policy=allowlist` 时生效 |
-
-## 按 thread 分会话
-
-这是 Slack 上最爽的一个特性:**每条 Slack thread 都是独立的 DeepTutor session**。当你在频道 @ bot:
-
-1. Bot 回复,开启一条新 thread
-2. 在那条 thread 里的后续回复都进同一个 session(带它全部历史、挂载的 KB 等)
-3. 不同频道里的 thread 是不同 session
-4. DM 自己一个 session(每个用户一个)
-
-这意味着一个团队可以在同一个频道里并行开多个导师对话而不互相串扰。
-
-如果想关掉这个(每次回复都从头开始):
-
-```yaml
-channels:
- slack:
- reply_in_thread: false
- # 附带效果:bot 直接在频道里回,不开 thread
-```
-
-## Slack 上支持的能力
-
-| 特性 | 支持情况 |
-|------|----------|
-| DM | ✅ |
-| 频道 @ | ✅ |
-| Thread(会话隔离) | ✅ |
-| 文件上传 | ✅ |
-| 文件下载 | ✅ |
-| Markdown → mrkdwn | ✅ *(渠道自动转换)* |
-| 代码块 | ✅ |
-| LaTeX 数学公式 | ⚠️ 当代码块渲染(Slack 不支持 LaTeX) |
-| 发送 reaction | ✅ *(通过 `react_emoji`)* |
-| Slash 命令 | ⚠️ 暂不支持 —— 用 DM/@ 寻址 |
-
-## Markdown 到 mrkdwn
-
-Slack 用自己的 markdown 方言("mrkdwn")。DeepTutor 的 Slack 渠道会自动转换:
-
-| 标准 markdown | mrkdwn 输出 |
-|---------------|-------------|
-| `**bold**` | `*bold*` |
-| `*italic*` | `_italic_` |
-| `# heading` | `*heading*`(加粗) |
-| `` `code` `` | `` `code` `` |
-| ` ```code``` ` | ` ```code``` ` |
-| `[link](url)` | `<url|link>` |
-| `- bullet` | `• bullet` |
-| `> quote` | `> quote` |
-
-## 常见问题
-
-### Bot 说了 hi 但后面就不回了
-
-检查 `reply_in_thread`:
-
-```yaml
-reply_in_thread: true
-```
-
-如果是 true,bot 只监听它自己开的 thread(`thread_ts` 要匹配)。如果你在它首次回复之后又在非 thread 消息里发,bot 看不到。
-
-### "Not authorized" / Slack API 401
-
-Token 弄反了 —— 确认 `bot_token` 填的是 `xoxb-` 开头的,`app_token` 填的是 `xapp-` 开头的。很容易顺手填反。
-
-### Bot 在频道里不回复
-
-两个前提:
-1. Bot 要被 **邀请到频道**(`/invite @bot`)
-2. 如果 `group_policy: mention`,你的消息必须 @ bot(`@math-mentor what is...`)
-
-### 长消息被截断
-
-Slack 单条消息上限 40000 字(比 Telegram/Discord 长得多)。DeepTutor 不会主动拆 —— 但极长的回复(比如 50+ 页的 Deep Research 报告)建议直接发文件。
-
-## 保活机制
-
-Socket Mode 是一条 WebSocket 长连。渠道层:
-- 每 30 秒发 ping
-- 断线自动指数退避重连
-- 不需要任何外部守护
-
-## 另请参阅
-
-- [**Discord**](/zh-cn/docs/tutorbot/discord/) —— 类似的 developer portal 模型
-- [**TutorBot 概览**](/zh-cn/docs/tutorbot/) —— 整体架构
+本页对应的旧文档已迁移。请阅读 [**Partners 伙伴与渠道**](/zh-cn/docs/partners/)。
diff --git a/site/src/content/docs/zh-cn/docs/tutorbot/telegram.md b/site/src/content/docs/zh-cn/docs/tutorbot/telegram.md
index f1802f590..119777d1f 100644
--- a/site/src/content/docs/zh-cn/docs/tutorbot/telegram.md
+++ b/site/src/content/docs/zh-cn/docs/tutorbot/telegram.md
@@ -1,193 +1,6 @@
---
-title: Telegram
-description: 在 Telegram 上跑 TutorBot —— 通过 BotFather 注册、配置项与运维要点。
+title: 已迁移
+description: 本旧页面保留用于兼容历史链接。
---
-Telegram 是最容易接入的渠道 —— 不用公网 IP、不用 webhook 签名,BotFather 注册大概一分钟搞定。
-
-## 你需要准备
-
-- 一个 Telegram 账号
-- 和 [@BotFather](https://t.me/BotFather) 的一段对话
-
-就这些。不用企业认证、不用开发者控制台注册。
-
-## Step 1 —— 在 BotFather 注册一个 bot
-
-打开 Telegram,搜 `@BotFather`,开个聊天。然后:
-
-```text
-You> /newbot
-
-BotFather> Alright, a new bot. How are we going to call it?
- Please choose a name for your bot.
-
-You> Math Mentor
-
-BotFather> Good. Now let's choose a username for your bot.
- It must end in 'bot'. Like this, for example: TetrisBot.
-
-You> hku_math_mentor_bot
-
-BotFather> Done! Congratulations on your new bot.
- You will find it at t.me/hku_math_mentor_bot.
-
- Use this token to access the HTTP API:
- 123456789:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
-```
-
-**把这个 token 复制下来。** 稍后要粘进 `agents.yaml`。
-
-## Step 2 —— 找到你自己的 Telegram user id
-
-你得把自己的 user id 填到 `allow_from` 里(否则 bot 谁都不会理)。最简单的办法:和 [@userinfobot](https://t.me/userinfobot) 聊一句,它会回你 id。
-
-```text
-You> hi
-
-userinfobot> Id: 123456789
- First: Frank
- Last:
- Username: @frank
- Language: zh
-```
-
-## Step 3 —— 配置你的 bot
-
-编辑 `data/tutorbot/<bot_id>/agents.yaml`:
-
-```yaml
-agent:
- id: my-math-tutor
- name: Math Mentor
- persona: "Socratic math tutor specializing in calculus and linear algebra."
- model: gpt-4o
-
-channels:
- telegram:
- enabled: true
- token: "123456789:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
- allow_from:
- - "123456789" # 你的 Telegram user id
- # - "*" # 取消注释即对所有人开放(谨慎)
-```
-
-## Step 4 —— 启动 bot
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] starting...
-[bot:my-math-tutor] channel:telegram → connecting
-[bot:my-math-tutor] channel:telegram → ok (long-polling)
-[bot:my-math-tutor] running.
-```
-
-然后打开 Telegram,搜 `@hku_math_mentor_bot`,发 `/start` —— 你就在和 bot 对话了。
-
-## 配置参考
-
-| 字段 | 类型 | 必填 | 默认值 | 说明 |
-|------|------|------|--------|------|
-| `enabled` | bool | 是 | `false` | 启用该渠道 |
-| `token` | string | 是 | —— | BotFather 给的 HTTP API token |
-| `allow_from` | list[string] | 是 | `[]` *(默认拒所有)* | User id 列表,或 `"*"` 全开 |
-
-## Telegram 上支持的能力
-
-| 特性 | 支持情况 |
-|------|----------|
-| 私聊 | ✅ |
-| 群聊 | ✅ *(bot 要被加进群,并且 `group_policy` 配合)* |
-| Markdown 渲染 | ✅ *(走 Telegram 的 markdown_v2 解析器)* |
-| LaTeX 数学公式 | ⚠️ 当纯文本渲染 —— Telegram 不识别 `$...$` |
-| 文件上传 | ✅ *(在 Telegram 的 20 MB / 2 GB 限制内)* |
-| 文件下载 | ✅ *(bot 可以接收 PDF、图片、语音)* |
-| 语音转写 | ✅ *(如果全局配置了 `transcription_api_key`)* |
-| 线程内回复 | ⚠️ 部分支持 —— Telegram 只有 reply-to-message,没有真正的 thread |
-
-## 群聊
-
-在 Telegram 群里使用 bot:
-
-1. 把 bot 加入群(Add Member → 搜 `@your_bot`)
-2. 在 BotFather 里关掉 **Group Privacy**:`/mybots` → 选 bot → **Bot Settings** → **Group Privacy** → **Turn OFF**
-3. 在消息里 @ 它来寻址(`@hku_math_mentor_bot question?`)
-
-在配置里设 `group_policy`:
-
-```yaml
-channels:
- telegram:
- group_policy: "mention" # 只在被 @ 时回复
- # group_policy: "open" # 每条消息都回(很吵!)
-```
-
-## 保活机制
-
-Telegram 渠道默认走 **long polling** —— bot 用一个长连接循环从 Telegram 服务器拉更新。对网络抖动很鲁棒:
-
-- 断网就是下一次 `getUpdates` 调用失败
-- 渠道层会指数退避重试
-- 网络恢复后 polling 继续
-
-不需要公网 IP、webhook 或反向代理。Telegram 的 BotFather 也不要求你这边配置任何 URL。
-
-## 常见问题
-
-### Bot 不回我消息
-
-99% 是 `allow_from` 的问题:
-
-```yaml
-allow_from:
- - "123456789" # 你真实的 id,用引号包起来(这是 string 字段)
-```
-
-空的 `allow_from: []` 表示「拒所有人」—— 包括你自己。用 `["*"]` 表示全开。
-
-### Bot 在群里不回复
-
-两件事要检查:
-
-1. BotFather → `/mybots` → 你的 bot → Group Privacy → **Disabled**
-2. 配置里 `group_policy: "mention"` 设了,并且你确实在消息里 `@` 了 bot
-
-### "Conflict: terminated by other getUpdates request"
-
-同一个 bot 你启动了两份(比如 `deeptutor bot start` 跑了两次,或者两个 DeepTutor 实例)。Telegram 一个 token 只允许一个 polling 客户端。把多余的停掉。
-
-### 超过 4096 字的消息被截断
-
-Telegram 单条消息上限 4096 字。Bot 会自动把过长的消息拆成多条发。如果回复非常长(比如 Deep Research 报告),更建议发文件:
-
-```yaml
-channels:
- telegram:
- send_long_as_file: true # 回复超 4096 字时自动附 .md
-```
-
-## 语音消息
-
-如果你在 `.env` 里配了 `TRANSCRIPTION_API_KEY`(以及 Groq Whisper 之类的转写 provider),bot 会把语音转成文字当成文本输入处理。否则语音会被忽略。
-
-## 文件和图片
-
-用户上传文件或图片时:
-
-- **图片** → 作为视觉输入发给模型
-- **PDF / DOCX** → 解析后作为附件(通过 `read_source` 工具可读全文)
-- **其他** → 收到但忽略
-
-## 多租户部署
-
-多用户模式下,每个用户都可以有自己的 Telegram bot。Bot id 是按用户隔离的,所以 `alice` 和 `bob` 都可以叫 `my-tutor` 而不冲突。
-
-如果想要组织级共享的 bot(一个 bot 给很多人用),把 bot 挂在管理员账号下,再把 `allow_from` 配一个长名单,或者直接 `["*"]`(小心)。
-
-## 另请参阅
-
-- [**TutorBot 概览**](/zh-cn/docs/tutorbot/) —— 架构和生命周期
-- [**CLI → bot 命令**](/zh-cn/docs/cli/commands/#deeptutor-bot--tutorbot-lifecycle)
+本页对应的旧文档已迁移。请阅读 [**Partners 伙伴与渠道**](/zh-cn/docs/partners/)。
diff --git a/site/src/content/docs/zh-cn/docs/tutorbot/wecom.md b/site/src/content/docs/zh-cn/docs/tutorbot/wecom.md
index 9d7ecd7d6..38917f75c 100644
--- a/site/src/content/docs/zh-cn/docs/tutorbot/wecom.md
+++ b/site/src/content/docs/zh-cn/docs/tutorbot/wecom.md
@@ -1,110 +1,6 @@
---
-title: 企业微信
-description: 在企业微信上跑 TutorBot —— 通过 AI Bot 平台的 WebSocket 长连。
+title: 已迁移
+description: 本旧页面保留用于兼容历史链接。
---
-企业微信是腾讯的企业即时通信产品。DeepTutor 通过 **AI Bot** 平台用一条 WebSocket 长连接入。
-
-## 你需要准备
-
-- 一个有管理员权限的企业微信组织
-- [`wecom-aibot-sdk`](https://pypi.org/project/wecom-aibot-sdk/) Python 包
-- 10 分钟在企业微信管理后台
-
-## Step 1 —— 装 SDK
-
-企业微信支持依赖一个可选 Python 包:
-
-```bash
-pip install wecom-aibot-sdk
-```
-
-如果你用 `pip install -e ".[partners]"` 装的,可能已经带了。验证一下:
-
-```bash
-python -c "import wecom_aibot_sdk; print('ok')"
-```
-
-## Step 2 —— 创建 AI Bot
-
-1. 登录 <https://work.weixin.qq.com/>
-2. **应用与小程序** → **AI 机器人平台**
-3. **新建应用** → 选 **AI 机器人** 类型
-4. 填名字、描述、允许使用的部门
-5. 复制 **Bot ID** 和 **Secret**
-
-## Step 3 —— 配置
-
-```yaml
-channels:
- wecom:
- enabled: true
- bot_id: "YOUR_BOT_ID"
- secret: "YOUR_SECRET"
- allow_from: [] # 可选,按 user id 做限制
- welcome_message: "Hi! 我是你的数学导师,有什么问题尽管问。"
-```
-
-## Step 4 —— 启动
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:wecom → connecting (ws://wecom...)
-[bot:my-math-tutor] channel:wecom → ready
-```
-
-## 配置参考
-
-| 字段 | 类型 | 必填 | 说明 |
-|------|------|------|------|
-| `enabled` | bool | 是 | |
-| `bot_id` | string | 是 | 来自 AI Bot 平台 |
-| `secret` | string | 是 | 来自 AI Bot 平台 |
-| `allow_from` | list[string] | 可选 | 企业微信 user id;`[]` 允许组织内所有人 |
-| `welcome_message` | string | 可选 | 新用户首次发消息时回的欢迎语 |
-
-## 企业微信上支持的能力
-
-| 特性 | 支持情况 |
-|------|----------|
-| 企业内私聊 | ✅ |
-| 群聊 | ✅ |
-| Markdown | ✅ |
-| 文件 / 图片 / 语音 | ✅ |
-| 外部联系人(客户) | ⚠️ 通过企业微信的外部联系人能力 |
-| @ 寻址 | ✅ |
-
-## 保活机制
-
-后台线程维护 WebSocket,瞬时故障自动重连。
-
-如果 bot 持续掉线:
-
-1. 检查 AI Bot 平台 —— bot 是不是被停用了?
-2. 确认你的 DeepTutor server 能正常向企业微信服务器发出 TLS 出站
-3. 重启:`deeptutor bot stop my-math-tutor && deeptutor bot start my-math-tutor`
-
-## 常见问题
-
-### `ImportError: wecom_aibot_sdk`
-
-```bash
-pip install wecom-aibot-sdk
-deeptutor bot start my-math-tutor
-```
-
-### Bot 连上了但不回复
-
-`allow_from` 是常见嫌疑人。也确认发消息的用户在你 AI Bot 配置允许的部门里。
-
-### 同一个组织里跑多个 bot
-
-每个 bot 都要自己独立的 `bot_id` + `secret`。你可以在同一个 DeepTutor server 里跑多个 TutorBot,各连各的企业微信 bot。
-
-## 另请参阅
-
-- [**飞书**](/zh-cn/docs/tutorbot/feishu/) —— 字节的企业聊天平台
-- [**TutorBot 概览**](/zh-cn/docs/tutorbot/) —— 整体架构
+本页对应的旧文档已迁移。请阅读 [**WeCom**](/zh-cn/docs/partners/wecom/)。
diff --git a/site/src/content/docs/zh-cn/docs/tutorbot/whatsapp.md b/site/src/content/docs/zh-cn/docs/tutorbot/whatsapp.md
index 0a8edd6e0..119777d1f 100644
--- a/site/src/content/docs/zh-cn/docs/tutorbot/whatsapp.md
+++ b/site/src/content/docs/zh-cn/docs/tutorbot/whatsapp.md
@@ -1,152 +1,6 @@
---
-title: WhatsApp
-description: 在 WhatsApp 上跑 TutorBot —— 需要单独跑一个 Node.js 桥接器(基于 Baileys,走 WhatsApp Web 协议)。
+title: 已迁移
+description: 本旧页面保留用于兼容历史链接。
---
-WhatsApp 是个特殊存在。官方的 WhatsApp Business API 摩擦不小(企业认证、月费、申请流程)。所以 DeepTutor 的 WhatsApp 渠道连的是一个 **独立的 Node.js 桥接器**,桥接器讲 WhatsApp Web 的协议 —— 上手快、免费、不用做企业认证。
-
-## 你需要准备
-
-- 一台跑 Node.js 18+ 的机器(可以和 DeepTutor 同一台,也可以分开)
-- 一个真实手机上的 WhatsApp 账号
-- ~5 分钟扫码配对
-
-## Step 1 —— 跑桥接器
-
-DeepTutor 仓库里在 `multi-user/whatsapp-bridge/` 下有一个示例桥接器,用的是 [@whiskeysockets/baileys](https://github.com/WhiskeySockets/Baileys)。或者你也可以跑任何兼容的桥接器,只要它在已知端口上暴露一个 WebSocket。
-
-最小桥接器长这样:
-
-```javascript
-// bridge.js
-const { default: makeWASocket, useMultiFileAuthState } = require('@whiskeysockets/baileys')
-const WebSocket = require('ws')
-
-const wss = new WebSocket.Server({ port: 3001 })
-let waSocket = null
-
-async function start() {
- const { state, saveCreds } = await useMultiFileAuthState('./auth')
- waSocket = makeWASocket({ auth: state, printQRInTerminal: true })
- waSocket.ev.on('creds.update', saveCreds)
- waSocket.ev.on('messages.upsert', ({ messages }) => {
- wss.clients.forEach(client => client.send(JSON.stringify(messages[0])))
- })
-}
-
-wss.on('connection', (ws) => {
- ws.on('message', (raw) => {
- const { jid, text } = JSON.parse(raw)
- waSocket?.sendMessage(jid, { text })
- })
-})
-
-start()
-```
-
-启动:
-
-```bash
-cd multi-user/whatsapp-bridge
-npm install
-node bridge.js
-```
-
-终端会出一个二维码。在手机上打开 WhatsApp → **设置 → 已链接的设备 → 链接设备** → 扫码。搞定。
-
-## Step 2 —— 配置 DeepTutor
-
-```yaml
-channels:
- whatsapp:
- enabled: true
- bridge_url: "ws://localhost:3001" # 桥接器监听地址
- bridge_token: "" # 可选,桥接器要求鉴权时用
- allow_from: # 手机号,E.164 格式
- - "+85291234567"
-```
-
-## Step 3 —— 启动 bot
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:whatsapp → connecting (ws://localhost:3001)
-[bot:my-math-tutor] channel:whatsapp → ready
-```
-
-发消息给 **桥接器登录的那个手机号** —— 桥接器把消息转给 DeepTutor,bot 通过桥接器回,回复落到 WhatsApp。
-
-## 配置参考
-
-| 字段 | 类型 | 必填 | 说明 |
-|------|------|------|------|
-| `enabled` | bool | 是 | |
-| `bridge_url` | url | 是 | 桥接器的 WebSocket URL |
-| `bridge_token` | string | 可选 | 桥接器要求鉴权时用 |
-| `allow_from` | list[string] | 可选 | 手机号(E.164);`["*"]` 全开 |
-
-## WhatsApp 上支持的能力
-
-| 特性 | 支持情况 |
-|------|----------|
-| 私聊 | ✅ |
-| 群消息 | ✅ *(桥接器要支持群路由)* |
-| Markdown | ⚠️ 基础 —— WhatsApp 只渲染 `*bold*`、`_italic_`、`~strike~`、`` ` ` `` |
-| 文件 / 图片 / 音频 | ✅ *(通过桥接器)* |
-| LaTeX 数学公式 | ❌ 当纯文本渲染 |
-| 语音 | ✅ *(设了 `TRANSCRIPTION_API_KEY` 就转写)* |
-
-## 保活机制
-
-WhatsApp Web 的 token 会定期失效 —— 一般是手机离线 ~2 周。失效时:
-
-- 桥接器会打印新的二维码
-- 你用手机重新扫
-- 会话恢复
-
-把桥接器跑在受管的进程下(`pm2`、systemd、supervisor),crash 时自动重启。DeepTutor 这边在桥接器 WebSocket 断开时会自动重连。
-
-## 为什么用桥接器而不是官方 API?
-
-| 方案 | 摩擦 | 成本 | 限制 |
-|------|------|------|------|
-| WhatsApp Business API(官方) | 企业认证 + Meta 审批 | 每条消息 $0.005–0.10 | 24 小时窗口外只能发模板消息 |
-| WhatsApp Web 桥接器(这个) | 扫一次码 | 免费 | 手机要 ~每周保持在线 |
-
-桥接器很适合个人和小团队用。生产级的商用消息,考虑 Twilio 或 360dialog(官方 API 的代理商)。
-
-## 风险与政策
-
-WhatsApp Web 的条款允许自动化自己的账号,但严格说不太欢迎类 bot 的用法。实际风险:
-
-- **封号** —— 低量使用很少;刷消息容易踩
-- **限流** —— WhatsApp 会标记每分钟发消息过多的账号
-
-如果你要把 DeepTutor 的 WhatsApp 渠道用在任何非玩具部署,请用你掌控的专属手机号,不要用个人号。
-
-## 常见问题
-
-### 桥接器一直打印二维码
-
-auth state 没有被持久化。检查 `./auth` 目录可写、并且不会在重启时被清掉。
-
-### "Bridge unreachable"
-
-```bash
-curl http://localhost:3001 2>&1 | head -1
-# 至少应该有响应,哪怕是 400(这是 WS 端点)
-```
-
-如果是 `connection refused`,桥接器没跑。如果是 `cannot resolve host`,你的 `bridge_url` 写错了。
-
-### 消息发出去但对方收不到
-
-看桥接器日志(`node bridge.js` 的 stdout)。WhatsApp Web 有时候在桥接器发太快时会静默丢消息 —— 在桥接器里加节流。
-
-## 另请参阅
-
-- [**电子邮件**](/zh-cn/docs/tutorbot/email/) —— 另一种桥接式集成(IMAP/SMTP)
-- [Baileys 文档](https://github.com/WhiskeySockets/Baileys) —— 桥接库参考
+本页对应的旧文档已迁移。请阅读 [**Partners 伙伴与渠道**](/zh-cn/docs/partners/)。
diff --git a/site/src/content/docs/zh-cn/docs/tutorbot/zulip.md b/site/src/content/docs/zh-cn/docs/tutorbot/zulip.md
index 1e91461e7..119777d1f 100644
--- a/site/src/content/docs/zh-cn/docs/tutorbot/zulip.md
+++ b/site/src/content/docs/zh-cn/docs/tutorbot/zulip.md
@@ -1,131 +1,6 @@
---
-title: Zulip
-description: 在 Zulip 上跑 TutorBot —— stream + topic 寻址、KaTeX 数学渲染,自 v1.3.9 起支持。
+title: 已迁移
+description: 本旧页面保留用于兼容历史链接。
---
-Zulip 在 **v1.3.9**(2026-05-09)加入。它用 Zulip 的 event-queue 长轮询,并支持 Zulip 独有的 **stream + topic** 寻址方式。
-
-## 你需要准备
-
-- 一个 Zulip 服务器(任意版本 —— Zulip Cloud 或自建)
-- 在你的组织里创建 bot 的管理员权限
-
-## Step 1 —— 创建 bot
-
-1. 在 Zulip 里点 ⚙️ 图标(右上角)→ **Organization** → **Bots & integrations**
-2. 点 **Add a new bot**
-3. Bot 类型:**Generic bot**
-4. 名字:"Math Mentor"
-5. Bot 邮箱:自动生成,比如 `[email protected]`
-6. 点 **Create bot**
-7. **Download API key** 或 **Show API key** 然后复制
-
-## Step 2 —— 把 bot 订阅到 stream
-
-默认情况下,generic bot 能收到私信,但不会看到公开 stream,除非你订阅它。在 bot 设置里:**Streams subscribed** → 添加你希望 bot 关注的 stream。
-
-也可以通过配置完成(`subscribe_streams` 字段)。
-
-## Step 3 —— 配置
-
-```yaml
-channels:
- zulip:
- enabled: true
- site: "https://your-zulip.example.com"
- api_key: "YOUR_API_KEY"
- allow_from: ["*"]
- group_policy: "mention" # 订阅的 stream 内:mention vs open
- subscribe_streams:
- - "study-help"
- - "homework"
- timeout: 60.0 # 事件队列 poll 超时,秒
-```
-
-## Step 4 —— 启动
-
-```bash
-deeptutor bot start my-math-tutor
-```
-
-```text
-[bot:my-math-tutor] channel:zulip → register event queue
-[bot:my-math-tutor] channel:zulip → subscribed: [study-help, homework]
-[bot:my-math-tutor] channel:zulip → ready (queue_id=q_abc)
-```
-
-## 配置参考
-
-| 字段 | 类型 | 必填 | 默认值 | 说明 |
-|------|------|------|--------|------|
-| `enabled` | bool | 是 | `false` | |
-| `site` | url | 是 | —— | 你的 Zulip 服务器 |
-| `email` | string | 是 | —— | Zulip 给的 bot 邮箱 |
-| `api_key` | string | 是 | —— | 来自 bot 创建页 |
-| `allow_from` | list[string] | 可选 | `[]` | User id 或 email;`["*"]` 全开 |
-| `group_policy` | `"mention" \| "open"` | 可选 | `"mention"` | stream 内 |
-| `subscribe_streams` | list[string] | 可选 | `[]` | 要自动订阅的 stream |
-| `timeout` | float | 可选 | `60.0` | 事件队列 poll 超时(秒) |
-
-## Stream + topic 寻址(Zulip 特色)
-
-Zulip 把消息按 **stream**(像频道)和 **topic**(stream 内的话题)切分。DeepTutor 按 **(stream, topic)** 对来划分 session:
-
-- 新 topic = 新的 DeepTutor session
-- 同一 topic 跨天 = 同一 session,记忆持久化
-- 同 stream 里不同 topic = 不同 session
-
-这对课堂使用非常合适:每道作业题一个独立 topic,bot 各自独立跟踪。
-
-## Zulip 上支持的能力
-
-| 特性 | 支持情况 |
-|------|----------|
-| 私信 | ✅ |
-| Stream 消息 + topic | ✅ *(按 topic 隔离 session)* |
-| Markdown | ✅ |
-| **LaTeX / KaTeX 数学公式** | ✅ *(Zulip 原生渲染 `$$...$$`)* |
-| 文件上传/下载 | ✅ |
-| Mention 或 open 模式 | ✅ |
-| 表情反应 | ⚠️ 只支持发出方向 |
-
-## 保活机制
-
-Zulip 的 **event-queue API** 是带自动恢复的长轮询:
-
-- Bot 用 `timeout=60s` 调 `/api/v1/events?queue_id=...`
-- 新事件以 JSON 返回;超时后返回空响应
-- 如果 `queue_id` 过期(服务器重启、闲置太久),bot 自动注册一个新的
-
-后台线程跑监听器,把事件桥接到 DeepTutor 的 async 总线。线程一直跑直到 bot 被停掉。
-
-## 常见问题
-
-### "Bad event queue id"
-
-队列过期了(服务器重启或闲置 > 10 分钟)。渠道会自动恢复 —— 不用处理。如果反复发生,可能是 Zulip 服务器状态不太对。
-
-### Bot 看不到 stream 消息
-
-订阅了吗?要么在 Zulip UI(bot 设置 → Streams)做,要么通过 `subscribe_streams` 配置。
-
-### 数学公式不渲染
-
-Bot 输出的数学要符合 Zulip 期望的格式:
-
-```text
-行内:$x^2$
-
-块级:
-```math
-\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
-```
-```
-
-DeepTutor 的 Zulip 渠道会自动把标准 `$...$` 和 `$$...$$` 转成 Zulip 格式。
-
-## 另请参阅
-
-- [**TutorBot 概览**](/zh-cn/docs/tutorbot/) —— 整体架构
-- [Zulip Bot API 文档](https://zulip.com/api/) —— 参考资料
+本页对应的旧文档已迁移。请阅读 [**Partners 伙伴与渠道**](/zh-cn/docs/partners/)。
diff --git a/site/src/pages/index.astro b/site/src/pages/index.astro
index d2efcf280..91d46f2dd 100644
--- a/site/src/pages/index.astro
+++ b/site/src/pages/index.astro
@@ -4,40 +4,52 @@ import "../styles/global.css";
const features = [
{
chapter: "I",
- title: "Chat Workspace",
- body: "Five modes — Chat, Solve, Quiz, Research, Visualize — share one session, knowledge base, and citation history. Escalate mid-thread without losing context.",
+ title: "Chat",
+ body: "The default agent loop: tools, RAG, attachments, notebook writes, memory, and deeper capabilities in one session.",
href: "/docs/explore/chat-workspace/",
},
{
chapter: "II",
+ title: "Partners",
+ body: "Persistent companions with their own soul, library, model policy, tools, and IM channels — powered by the same chat loop.",
+ href: "/docs/explore/partners/",
+ },
+ {
+ chapter: "III",
title: "Co-Writer",
- body: "A split-view Markdown workbench where AI is a first-class collaborator. Select, rewrite, expand — grounded in your knowledge base.",
+ body: "A selection-aware Markdown workspace where AI edits can be grounded in your knowledge base or the web.",
href: "/docs/explore/co-writer/",
},
{
- chapter: "III",
+ chapter: "IV",
title: "Book Engine",
- body: "A multi-agent pipeline compiles your materials into interactive living books — 13 block types, including a GeoGebra viewer and animations.",
+ body: "Compile knowledge bases, notebooks, question assets, and chat history into interactive living books.",
href: "/docs/explore/book/",
},
{
- chapter: "IV",
+ chapter: "V",
title: "Knowledge",
- body: "Versioned RAG-ready document libraries on LlamaIndex end-to-end. Every (re-)index is tracked, comparable, and rollback-able.",
+ body: "LlamaIndex-backed, versioned document libraries for RAG, Chat, Co-Writer, Book, and Partners.",
href: "/docs/explore/knowledge/",
},
{
- chapter: "V",
+ chapter: "VI",
title: "Space",
- body: "Your personal library — chat history, notebooks, question bank, and authored skills. The read-and-review counterpart to every active surface.",
+ body: "Reusable context assets: skills, personas, notebooks, chat history, and question material.",
href: "/docs/explore/space/",
},
{
- chapter: "VI",
+ chapter: "VII",
title: "Memory",
- body: "Append-only L1 traces, L2 curated facts with citations, L3 cross-surface synthesis. A Memory Graph lets you audit why DeepTutor knows what it knows.",
+ body: "Inspectable personalization through L1 traces, L2 facts, L3 synthesis, and a Memory Graph.",
href: "/docs/explore/memory/",
},
+ {
+ chapter: "VIII",
+ title: "Settings",
+ body: "The control plane for models, embeddings, search, tools, MCP, capabilities, network, and memory.",
+ href: "/docs/explore/settings/",
+ },
];
const installs = [
@@ -93,7 +105,7 @@ deeptutor init && deeptutor start`,
label: "CLI",
tag: "Headless",
cmd: "pip install -e ./packaging/deeptutor-cli",
- blurb: "Lightweight install for servers, agent harnesses, Claude Code / Codex setups.",
+ blurb: "Lightweight install for servers, agent harnesses, Claude Code / Codex setups; add Partners extras when needed.",
code: `git clone https://github.com/HKUDS/DeepTutor.git
cd DeepTutor
@@ -102,7 +114,7 @@ pip install -e ./packaging/deeptutor-cli
deeptutor init --cli
deeptutor chat`,
- foot: "No backend / frontend ports. Embeddings off by default — opt in for RAG.",
+ foot: "No Web UI. Embeddings stay off by default; add extras for RAG or Partner channels.",
href: "/docs/get-started/cli-only/",
},
];
@@ -117,7 +129,7 @@ deeptutor chat`,
<title>DeepTutor — Agent-native, open-source personalized tutoring</title>
<meta
name="description"
- content="An open-source AI learning companion. Five modes, one workspace. Personal TutorBots. Knowledge-driven learning."
+ content="An open-source, agent-native learning companion: Chat, Partners, Co-Writer, Book, Knowledge, Space, Memory, and Settings in one local workspace."
/>
<link rel="icon" type="image/png" href="/logo.png" />
<script is:inline>
@@ -265,8 +277,8 @@ deeptutor chat`,
</div>
<img
class="showcase-shot"
- src="/screenshots/dt-home.png"
- alt="DeepTutor chat workspace — Chat / TutorBot / Co-Writer / Book / Knowledge / Space / Memory in the sidebar; greeting and composer in the main area."
+ src="/screenshots/chat.png"
+ alt="DeepTutor chat workspace — Chat / Partners / Co-Writer / Book / Knowledge / Space / Memory in the sidebar; greeting and composer in the main area."
loading="eager"
decoding="async"
/>
@@ -276,10 +288,10 @@ deeptutor chat`,
<section class="section">
<header class="section-head">
<span class="section-eyebrow">What's inside</span>
- <h2>Six pillars, <em>one</em> running context.</h2>
+ <h2>Eight surfaces, <em>one</em> running context.</h2>
<p>
- Every surface reads from — and writes back to — the same memory, knowledge base, and tutor.
- Switching contexts no longer means losing your place.
+ Chat, Partners, Co-Writer, Book, Knowledge, Space, Memory, and Settings share the
+ same agent-native runtime. Switching surfaces no longer means losing your place.
</p>
</header>
<div class="feature-grid">
@@ -367,7 +379,7 @@ deeptutor chat`,
<h4>Docs</h4>
<a href="/docs/get-started/">Get Started</a>
<a href="/docs/explore/">Explore DeepTutor</a>
- <a href="/docs/tutorbot/">Explore TutorBot</a>
+ <a href="/docs/partners/">Explore Partners</a>
<a href="/docs/cli/">CLI</a>
</div>
<div class="footer-col">
@@ -410,6 +422,8 @@ deeptutor chat`,
<span data-pulse="release-tag">—</span>
</a>
<span class="sep">·</span>
+ <span class="num"><span data-pulse="uniques">—</span> Unique Visitors</span>
+ <span class="sep">·</span>
<span class="num"><span data-pulse="requests">—</span> Page Views</span>
</div>
</div>
@@ -494,6 +508,7 @@ deeptutor chat`,
let releaseOK = false;
if (traffic.status === "fulfilled" && traffic.value && !traffic.value.error) {
+ setText("uniques", fmtNum(traffic.value.uniques));
setText("requests", fmtNum(traffic.value.requests));
setText("bytes", fmtBytes(traffic.value.bytes));
trafficOK = true;
@@ -1936,15 +1951,18 @@ deeptutor chat`,
}
}
} catch {}
- fetch("https://api.github.com/repos/HKUDS/DeepTutor")
+ // Same-origin Worker proxy — direct api.github.com calls die on the
+ // 60/h per-IP anonymous rate limit (shared NAT) and on networks that
+ // block GitHub.
+ fetch("/api/stars")
.then((r) => (r.ok ? r.json() : null))
.then((data) => {
- if (!data || typeof data.stargazers_count !== "number") return;
- paint(data.stargazers_count);
+ if (!data || typeof data.stars !== "number") return;
+ paint(data.stars);
try {
localStorage.setItem(
cacheKey,
- JSON.stringify({ n: data.stargazers_count, t: Date.now() }),
+ JSON.stringify({ n: data.stars, t: Date.now() }),
);
} catch {}
})
diff --git a/site/src/pages/zh-cn/index.astro b/site/src/pages/zh-cn/index.astro
index 58c5523e5..9afa1d38f 100644
--- a/site/src/pages/zh-cn/index.astro
+++ b/site/src/pages/zh-cn/index.astro
@@ -4,40 +4,52 @@ import "../../styles/global.css";
const features = [
{
chapter: "I",
- title: "聊天工作台",
- body: "五种模式 —— Chat / Solve / Quiz / Research / Visualize —— 共享同一个 session、知识库和引用历史,对话中段切换不丢上下文。",
+ title: "Chat",
+ body: "默认 agent loop:工具、RAG、附件、Notebook 写入、Memory 和深层 capability 都在同一 session 里。",
href: "/zh-cn/docs/explore/chat-workspace/",
},
{
chapter: "II",
+ title: "Partners",
+ body: "拥有独立 soul、资源库、模型策略、工具和 IM 渠道的持久伙伴,复用同一个 chat loop。",
+ href: "/zh-cn/docs/explore/partners/",
+ },
+ {
+ chapter: "III",
title: "Co-Writer",
- body: "双栏 Markdown 工作台,AI 是一等公民协作者。选中、改写、扩展,全部基于你的知识库。",
+ body: "支持选区 AI 编辑的 Markdown 工作台,编辑可基于知识库或 Web 上下文。",
href: "/zh-cn/docs/explore/co-writer/",
},
{
- chapter: "III",
+ chapter: "IV",
title: "Book Engine",
- body: "多 agent 流水线把你的材料编成可交互的「活书」—— 13 种 block,含 GeoGebra viewer 和动画。",
+ body: "把知识库、Notebook、题目资产和 Chat history 编译成可交互 living books。",
href: "/zh-cn/docs/explore/book/",
},
{
- chapter: "IV",
+ chapter: "V",
title: "知识库",
- body: "端到端 LlamaIndex 的带版本管理 RAG 文档库。每一次(重新)索引都可追溯、可对比、可回滚。",
+ body: "基于 LlamaIndex 的版本化文档库,用于 RAG、Chat、Co-Writer、Book 和 Partners。",
href: "/zh-cn/docs/explore/knowledge/",
},
{
- chapter: "V",
+ chapter: "VI",
title: "Space",
- body: "你的个人图书馆 —— chat history、notebook、question bank、自定义 skill。每个活跃界面的「阅读 / 回顾」对偶面。",
+ body: "可复用上下文资产:skills、personas、notebooks、chat history 和题目材料。",
href: "/zh-cn/docs/explore/space/",
},
{
- chapter: "VI",
+ chapter: "VII",
title: "记忆系统",
- body: "Append-only 的 L1 trace、带引用的 L2 精炼事实、跨界面综合的 L3。Memory Graph 让你随时审计 DeepTutor 为什么知道某件事。",
+ body: "通过 L1 trace、L2 facts、L3 synthesis 和 Memory Graph 实现可审计个性化。",
href: "/zh-cn/docs/explore/memory/",
},
+ {
+ chapter: "VIII",
+ title: "Settings",
+ body: "模型、Embedding、搜索、工具、MCP、Capabilities、网络和 Memory 的统一控制面。",
+ href: "/zh-cn/docs/explore/settings/",
+ },
];
const installs = [
@@ -93,7 +105,7 @@ deeptutor init && deeptutor start`,
label: "CLI",
tag: "无头",
cmd: "pip install -e ./packaging/deeptutor-cli",
- blurb: "面向无界面服务器、agent harness、Claude Code / Codex 等场景的轻量安装。",
+ blurb: "面向无界面服务器、agent harness、Claude Code / Codex 等场景的轻量安装,可选 Partners extra。",
code: `git clone https://github.com/HKUDS/DeepTutor.git
cd DeepTutor
@@ -102,7 +114,7 @@ pip install -e ./packaging/deeptutor-cli
deeptutor init --cli
deeptutor chat`,
- foot: "没有后端 / 前端端口。Embedding 默认关闭 —— 用 RAG 时再开启。",
+ foot: "没有 Web UI。Embedding 默认关闭;需要 RAG 或 Partner channels 时再开启对应 extra。",
href: "/zh-cn/docs/get-started/cli-only/",
},
];
@@ -117,7 +129,7 @@ deeptutor chat`,
<title>DeepTutor —— Agent-native 的开源个性化学习伴侣</title>
<meta
name="description"
- content="开源 AI 学习伴侣。五种模式,一个工作区。专属 TutorBot。知识驱动的学习。"
+ content="开源、agent-native 的个性化学习伴侣:Chat、Partners、Co-Writer、Book、Knowledge、Space、Memory、Settings 共享同一个本地工作区。"
/>
<link rel="icon" type="image/png" href="/logo.png" />
<script is:inline>
@@ -265,8 +277,8 @@ deeptutor chat`,
</div>
<img
class="showcase-shot"
- src="/screenshots/dt-home.png"
- alt="DeepTutor 聊天工作台 —— 侧栏 Chat / TutorBot / Co-Writer / Book / 知识库 / Space / 记忆;主区域显示问候语和输入框。"
+ src="/screenshots/chat.png"
+ alt="DeepTutor 聊天工作台 —— 侧栏 Chat / Partners / Co-Writer / Book / 知识库 / Space / 记忆;主区域显示问候语和输入框。"
loading="eager"
decoding="async"
/>
@@ -276,10 +288,10 @@ deeptutor chat`,
<section class="section">
<header class="section-head">
<span class="section-eyebrow">里面是什么</span>
- <h2>六根支柱,<em>同一份</em>运行时上下文。</h2>
+ <h2>八个界面,<em>同一份</em>运行时上下文。</h2>
<p>
- 每个界面都从同一份记忆、知识库、导师那里读写。
- 切换上下文不再意味着丢失当前位置。
+ Chat、Partners、Co-Writer、Book、Knowledge、Space、Memory、Settings
+ 共享同一套 agent-native runtime。切换界面不再意味着丢失当前位置。
</p>
</header>
<div class="feature-grid">
@@ -367,7 +379,7 @@ deeptutor chat`,
<h4>文档</h4>
<a href="/zh-cn/docs/get-started/">快速上手</a>
<a href="/zh-cn/docs/explore/">探索 DeepTutor</a>
- <a href="/zh-cn/docs/tutorbot/">TutorBot 渠道</a>
+ <a href="/zh-cn/docs/partners/">Partners 渠道</a>
<a href="/zh-cn/docs/cli/">CLI</a>
</div>
<div class="footer-col">
@@ -410,6 +422,8 @@ deeptutor chat`,
<span data-pulse="release-tag">—</span>
</a>
<span class="sep">·</span>
+ <span class="num"><span data-pulse="uniques">—</span> 独立访客</span>
+ <span class="sep">·</span>
<span class="num"><span data-pulse="requests">—</span> 次浏览</span>
</div>
</div>
@@ -490,6 +504,7 @@ deeptutor chat`,
let releaseOK = false;
if (traffic.status === "fulfilled" && traffic.value && !traffic.value.error) {
+ setText("uniques", fmtNum(traffic.value.uniques));
setText("requests", fmtNum(traffic.value.requests));
setText("bytes", fmtBytes(traffic.value.bytes));
trafficOK = true;
@@ -1747,15 +1762,18 @@ deeptutor chat`,
}
}
} catch {}
- fetch("https://api.github.com/repos/HKUDS/DeepTutor")
+ // Same-origin Worker proxy — direct api.github.com calls die on the
+ // 60/h per-IP anonymous rate limit (shared NAT) and on networks that
+ // block GitHub.
+ fetch("/api/stars")
.then((r) => (r.ok ? r.json() : null))
.then((data) => {
- if (!data || typeof data.stargazers_count !== "number") return;
- paint(data.stargazers_count);
+ if (!data || typeof data.stars !== "number") return;
+ paint(data.stars);
try {
localStorage.setItem(
cacheKey,
- JSON.stringify({ n: data.stargazers_count, t: Date.now() }),
+ JSON.stringify({ n: data.stars, t: Date.now() }),
);
} catch {}
})
diff --git a/site/src/styles/starlight.css b/site/src/styles/starlight.css
index ffcd227cc..4b50a53ae 100644
--- a/site/src/styles/starlight.css
+++ b/site/src/styles/starlight.css
@@ -237,3 +237,27 @@ site-search button[data-open-modal] {
.pagination-links > a:hover[rel="next"] .link-title::after {
color: var(--accent);
}
+
+/* Brand icons (channel/provider) embedded in tables and lists: keep them
+ inline and vertically centred against the text baseline. */
+.sl-markdown-content img[src^="/channel-icons/"],
+.sl-markdown-content img[src^="/provider-icons/"] {
+ display: inline-block;
+ vertical-align: -0.2em;
+ margin: 0;
+}
+
+/* Solid-black mono brand marks vanish on the dark theme — invert them,
+ mirroring the web UI's `dark:invert` handling in ProviderIcon.tsx. */
+[data-theme="dark"] .sl-markdown-content img[src$="/anthropic.svg"],
+[data-theme="dark"] .sl-markdown-content img[src$="/githubcopilot.svg"],
+[data-theme="dark"] .sl-markdown-content img[src$="/groq.svg"],
+[data-theme="dark"] .sl-markdown-content img[src$="/jina.svg"],
+[data-theme="dark"] .sl-markdown-content img[src$="/lmstudio.svg"],
+[data-theme="dark"] .sl-markdown-content img[src$="/moonshot.svg"],
+[data-theme="dark"] .sl-markdown-content img[src$="/ollama.svg"],
+[data-theme="dark"] .sl-markdown-content img[src$="/openai.svg"],
+[data-theme="dark"] .sl-markdown-content img[src$="/openrouter.svg"],
+[data-theme="dark"] .sl-markdown-content img[src$="/xiaomimimo.svg"] {
+ filter: invert(1);
+}
diff --git a/site/worker/index.ts b/site/worker/index.ts
new file mode 100644
index 000000000..6a6c65fff
--- /dev/null
+++ b/site/worker/index.ts
@@ -0,0 +1,251 @@
+/**
+ * Cloudflare Worker — serves the static site (assets binding) plus two
+ * dynamic endpoints used by the landing-page footer heartbeat:
+ *
+ * GET /api/traffic zone-wide unique visitors + total requests, summed
+ * over Cloudflare's GraphQL Analytics retention window
+ * (30 days on free plan). Edge-cached 5 minutes.
+ * GET /api/release latest non-draft GitHub release. Edge-cached 30 min.
+ *
+ * Static requests never reach this script — the assets router answers them
+ * first; only unmatched paths (i.e. /api/*) invoke the Worker.
+ *
+ * Config (wrangler.jsonc / dashboard → Settings):
+ * - CF_ZONE_ID deeptutor.info zone id (vars)
+ * - CF_API_TOKEN API token with `Zone Analytics: Read` (secret)
+ * - GITHUB_TOKEN optional read-only PAT, bumps rate limit (secret)
+ */
+
+interface Env {
+ ASSETS: { fetch(request: Request): Promise<Response> };
+ CF_ZONE_ID?: string;
+ CF_API_TOKEN?: string;
+ GITHUB_TOKEN?: string;
+}
+
+interface ExecutionContextLike {
+ waitUntil(promise: Promise<unknown>): void;
+}
+
+export default {
+ async fetch(
+ request: Request,
+ env: Env,
+ ctx: ExecutionContextLike,
+ ): Promise<Response> {
+ const { pathname } = new URL(request.url);
+ if (request.method === "GET" && pathname === "/api/traffic") {
+ return withEdgeCache(request, ctx, () => traffic(env));
+ }
+ if (request.method === "GET" && pathname === "/api/release") {
+ return withEdgeCache(request, ctx, () => release(env));
+ }
+ if (request.method === "GET" && pathname === "/api/stars") {
+ return withEdgeCache(request, ctx, () => stars(env));
+ }
+ return env.ASSETS.fetch(request);
+ },
+};
+
+/**
+ * Serve from the colo-local edge cache when fresh; otherwise compute and
+ * cache the 200 response (TTL comes from its own Cache-Control header).
+ */
+async function withEdgeCache(
+ request: Request,
+ ctx: ExecutionContextLike,
+ compute: () => Promise<Response>,
+): Promise<Response> {
+ const cache = caches.default;
+ const hit = await cache.match(request);
+ if (hit) return hit;
+
+ const response = await compute();
+ if (response.status === 200) {
+ ctx.waitUntil(cache.put(request, response.clone()));
+ }
+ return response;
+}
+
+// ───────────────────────── /api/traffic ─────────────────────────
+
+interface AnalyticsGroup {
+ sum: { requests: number; bytes: number };
+ uniq?: { uniques?: number };
+}
+
+interface GraphqlResponse {
+ data?: {
+ viewer?: {
+ zones?: { httpRequests1dGroups?: AnalyticsGroup[] }[];
+ };
+ };
+ errors?: { message: string }[];
+}
+
+// Cloudflare's free-plan retention is 30 days, so the effective scope is
+// "since launch, capped at 30 days back". No date dimension/orderBy — the
+// API then returns a single group aggregated over the whole window (orderBy
+// without a selected dimension is a GraphQL syntax error).
+const TRAFFIC_QUERY = `
+ query Total($zoneTag: String!, $since: Date!) {
+ viewer {
+ zones(filter: { zoneTag: $zoneTag }) {
+ httpRequests1dGroups(limit: 30, filter: { date_geq: $since }) {
+ sum { requests bytes }
+ uniq { uniques }
+ }
+ }
+ }
+ }
+`;
+
+async function traffic(env: Env): Promise<Response> {
+ if (!env.CF_API_TOKEN || !env.CF_ZONE_ID) {
+ return json({ error: "not_configured" }, 503);
+ }
+
+ const since = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000)
+ .toISOString()
+ .slice(0, 10);
+
+ try {
+ const upstream = await fetch(
+ "https://api.cloudflare.com/client/v4/graphql",
+ {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${env.CF_API_TOKEN}`,
+ },
+ body: JSON.stringify({
+ query: TRAFFIC_QUERY,
+ variables: { zoneTag: env.CF_ZONE_ID, since },
+ }),
+ },
+ );
+
+ if (!upstream.ok) {
+ return json({ error: "upstream_status", status: upstream.status }, 502);
+ }
+
+ const payload = (await upstream.json()) as GraphqlResponse;
+ if (payload.errors?.length) {
+ return json(
+ { error: "graphql_error", detail: payload.errors[0].message },
+ 502,
+ );
+ }
+
+ const groups = payload.data?.viewer?.zones?.[0]?.httpRequests1dGroups ?? [];
+ const totals = groups.reduce(
+ (acc, g) => ({
+ requests: acc.requests + (g.sum?.requests ?? 0),
+ bytes: acc.bytes + (g.sum?.bytes ?? 0),
+ uniques: acc.uniques + (g.uniq?.uniques ?? 0),
+ }),
+ { requests: 0, bytes: 0, uniques: 0 },
+ );
+
+ return json(
+ {
+ window: "total",
+ requests: totals.requests,
+ bytes: totals.bytes,
+ uniques: totals.uniques,
+ },
+ 200,
+ "public, max-age=300, s-maxage=300, stale-while-revalidate=600",
+ );
+ } catch (err) {
+ return json({ error: "fetch_failed", detail: String(err) }, 502);
+ }
+}
+
+// ───────────────────────── /api/release ─────────────────────────
+
+interface GithubRelease {
+ tag_name: string;
+ name: string | null;
+ html_url: string;
+ published_at: string;
+ prerelease: boolean;
+ draft: boolean;
+}
+
+const RELEASES_ENDPOINT =
+ "https://api.github.com/repos/HKUDS/DeepTutor/releases?per_page=5";
+
+function ghHeaders(env: Env): Record<string, string> {
+ const headers: Record<string, string> = {
+ Accept: "application/vnd.github+json",
+ "User-Agent": "deeptutor-info-worker",
+ "X-GitHub-Api-Version": "2022-11-28",
+ };
+ if (env.GITHUB_TOKEN) {
+ headers.Authorization = `Bearer ${env.GITHUB_TOKEN}`;
+ }
+ return headers;
+}
+
+async function release(env: Env): Promise<Response> {
+ try {
+ const upstream = await fetch(RELEASES_ENDPOINT, { headers: ghHeaders(env) });
+ if (!upstream.ok) {
+ return json({ error: "upstream_status", status: upstream.status }, 502);
+ }
+
+ const releases = (await upstream.json()) as GithubRelease[];
+ const latest = releases.find((r) => !r.draft) ?? null;
+ if (!latest) {
+ return json({ error: "no_release" }, 404);
+ }
+
+ return json(
+ {
+ tag: latest.tag_name,
+ name: latest.name ?? latest.tag_name,
+ url: latest.html_url,
+ published_at: latest.published_at,
+ prerelease: latest.prerelease,
+ },
+ 200,
+ "public, max-age=1800, s-maxage=1800, stale-while-revalidate=3600",
+ );
+ } catch (err) {
+ return json({ error: "fetch_failed", detail: String(err) }, 502);
+ }
+}
+
+// ───────────────────────── /api/stars ─────────────────────────
+
+const REPO_ENDPOINT = "https://api.github.com/repos/HKUDS/DeepTutor";
+
+async function stars(env: Env): Promise<Response> {
+ try {
+ const upstream = await fetch(REPO_ENDPOINT, { headers: ghHeaders(env) });
+ if (!upstream.ok) {
+ return json({ error: "upstream_status", status: upstream.status }, 502);
+ }
+ const repo = (await upstream.json()) as { stargazers_count?: number };
+ if (typeof repo.stargazers_count !== "number") {
+ return json({ error: "bad_payload" }, 502);
+ }
+ return json(
+ { stars: repo.stargazers_count },
+ 200,
+ "public, max-age=1800, s-maxage=1800, stale-while-revalidate=3600",
+ );
+ } catch (err) {
+ return json({ error: "fetch_failed", detail: String(err) }, 502);
+ }
+}
+
+function json(body: unknown, status = 200, cache?: string): Response {
+ const headers: Record<string, string> = {
+ "Content-Type": "application/json; charset=utf-8",
+ "Access-Control-Allow-Origin": "*",
+ };
+ if (cache) headers["Cache-Control"] = cache;
+ return new Response(JSON.stringify(body), { status, headers });
+}
diff --git a/site/wrangler.jsonc b/site/wrangler.jsonc
new file mode 100644
index 000000000..9cac70a29
--- /dev/null
+++ b/site/wrangler.jsonc
@@ -0,0 +1,24 @@
+// Cloudflare Worker config for deeptutor.info.
+//
+// `name` MUST stay "proud-shadow-1ebf" — that is the existing dashboard
+// project the custom domain is attached to; deploying under the same name
+// updates it in place with zero domain re-wiring.
+//
+// Secrets (set once, kept out of git):
+// npx wrangler secret put CF_API_TOKEN # Zone Analytics: Read, scoped to deeptutor.info
+//
+// Deploy: npm run deploy (= astro build && wrangler deploy)
+{
+ "name": "proud-shadow-1ebf",
+ "compatibility_date": "2026-06-12",
+ "main": "worker/index.ts",
+ "assets": {
+ "directory": "./dist",
+ "binding": "ASSETS",
+ "not_found_handling": "404-page"
+ },
+ "vars": {
+ // deeptutor.info zone id — dashboard → deeptutor.info Overview → API → Zone ID.
+ "CF_ZONE_ID": "8b9a13692ae0bc950af35398a6fbe092"
+ }
+}
diff --git a/start_backend.bat b/start_backend.bat
index 164164cd1..96fa9c895 100644
--- a/start_backend.bat
+++ b/start_backend.bat
@@ -20,4 +20,4 @@ echo Starting DeepTutor Backend Server...
echo Backend will be available at: http://localhost:8001
echo Press Ctrl+C to stop the server.
python -m deeptutor.api.run_server
-pause
\ No newline at end of file
+pause
diff --git a/start_frontend.bat b/start_frontend.bat
index d4477f0a5..ddc340216 100644
--- a/start_frontend.bat
+++ b/start_frontend.bat
@@ -8,4 +8,4 @@ echo Frontend will be available at: http://localhost:3782
echo Press Ctrl+C to stop the server.
cd web
npm run dev -- -p 3782
-pause
\ No newline at end of file
+pause
diff --git a/tests/agents/chat/test_prompt_identity.py b/tests/agents/chat/test_prompt_identity.py
index 0a685cd01..d4e5dde03 100644
--- a/tests/agents/chat/test_prompt_identity.py
+++ b/tests/agents/chat/test_prompt_identity.py
@@ -46,7 +46,9 @@ def test_partner_identity_without_description():
metadata={"agent_identity": {"name": "frank"}},
)
content = _general_block(context)
- assert content == 'You are a companion created by the user. The name the user gave you is "frank".'
+ assert (
+ content == 'You are a companion created by the user. The name the user gave you is "frank".'
+ )
def test_blank_identity_falls_back_to_product():
diff --git a/tests/api/test_partners_router.py b/tests/api/test_partners_router.py
index ef91e2196..545409de5 100644
--- a/tests/api/test_partners_router.py
+++ b/tests/api/test_partners_router.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+import base64
import json
from pathlib import Path
@@ -130,9 +131,7 @@ class TestConfigAndSoul:
# Clearing works; junk and oversized payloads are rejected.
assert client.patch("/api/v1/partners/ada", json={"avatar": ""}).status_code == 200
assert client.get("/api/v1/partners/ada").json()["avatar"] == ""
- res = client.patch(
- "/api/v1/partners/ada", json={"avatar": "https://evil.example/x.png"}
- )
+ res = client.patch("/api/v1/partners/ada", json={"avatar": "https://evil.example/x.png"})
assert res.status_code == 422
res = client.patch(
"/api/v1/partners/ada",
@@ -218,3 +217,29 @@ class TestHistory:
res = client.get("/api/v1/partners/ada/history")
assert res.status_code == 200
assert res.json()[0]["content"] == "hi"
+
+
+class TestChatAttachments:
+ def test_materialize_partner_attachment_writes_partner_media(self, isolated_root):
+ from deeptutor.api.routers.partners import (
+ ChatAttachmentRequest,
+ _materialize_partner_attachments,
+ )
+
+ paths = _materialize_partner_attachments(
+ "ada",
+ [
+ ChatAttachmentRequest(
+ type="file",
+ filename="notes.txt",
+ base64=base64.b64encode(b"hello").decode("ascii"),
+ mime_type="text/plain",
+ )
+ ],
+ )
+
+ assert len(paths) == 1
+ path = Path(paths[0])
+ assert path.read_bytes() == b"hello"
+ assert path.name.endswith("_notes.txt")
+ assert path.parent == isolated_root / "partners" / "ada" / "media" / "web"
diff --git a/tests/services/partners/test_channel_manager.py b/tests/services/partners/test_channel_manager.py
index ae5630b77..9eb480935 100644
--- a/tests/services/partners/test_channel_manager.py
+++ b/tests/services/partners/test_channel_manager.py
@@ -111,9 +111,7 @@ async def _dispatch_many(
class TestSendRetry:
@pytest.mark.asyncio
async def test_send_retries_on_failure_then_succeeds(self, monkeypatch):
- monkeypatch.setattr(
- "deeptutor.partners.channels.manager._SEND_RETRY_DELAYS", (0, 0, 0)
- )
+ monkeypatch.setattr("deeptutor.partners.channels.manager._SEND_RETRY_DELAYS", (0, 0, 0))
msg = OutboundMessage(channel="zulip", chat_id="1", content="hi")
channel = _DummyChannel()
channel.send.side_effect = [RuntimeError("boom"), None]
@@ -125,14 +123,13 @@ class TestSendRetry:
@pytest.mark.asyncio
async def test_send_gives_up_after_max_retries(self, monkeypatch):
- monkeypatch.setattr(
- "deeptutor.partners.channels.manager._SEND_RETRY_DELAYS", (0, 0, 0)
- )
+ monkeypatch.setattr("deeptutor.partners.channels.manager._SEND_RETRY_DELAYS", (0, 0, 0))
msg = OutboundMessage(channel="zulip", chat_id="1", content="hi")
channel = _DummyChannel()
channel.send.side_effect = RuntimeError("boom")
manager = ChannelManager(
- ChannelsConfig(send_max_retries=2), _MultiShotBus([]) # type: ignore[arg-type]
+ ChannelsConfig(send_max_retries=2),
+ _MultiShotBus([]), # type: ignore[arg-type]
)
await manager._send_with_retry(channel, msg) # type: ignore[arg-type]
@@ -155,11 +152,15 @@ class TestDuplicateSuppression:
async def test_same_reply_to_different_origin_delivered(self):
msgs = [
OutboundMessage(
- channel="zulip", chat_id="1", content="same",
+ channel="zulip",
+ chat_id="1",
+ content="same",
metadata={"origin_message_id": "m1"},
),
OutboundMessage(
- channel="zulip", chat_id="1", content="same",
+ channel="zulip",
+ chat_id="1",
+ content="same",
metadata={"origin_message_id": "m2"},
),
]
@@ -187,7 +188,9 @@ class TestStreamDispatch:
async def test_stream_end_routed_to_send_delta(self):
msgs = [
OutboundMessage(
- channel="zulip", chat_id="1", content="",
+ channel="zulip",
+ chat_id="1",
+ content="",
metadata={"_stream_end": True, "_stream_id": "t:1"},
),
]
@@ -199,7 +202,9 @@ class TestStreamDispatch:
async def test_streamed_final_skips_plain_send(self):
msgs = [
OutboundMessage(
- channel="zulip", chat_id="1", content="final",
+ channel="zulip",
+ chat_id="1",
+ content="final",
metadata={"_streamed": True},
),
]
@@ -211,11 +216,15 @@ class TestStreamDispatch:
async def test_deltas_of_different_streams_not_merged(self):
msgs = [
OutboundMessage(
- channel="zulip", chat_id="1", content="a",
+ channel="zulip",
+ chat_id="1",
+ content="a",
metadata={"_stream_delta": True, "_stream_id": "t:1"},
),
OutboundMessage(
- channel="zulip", chat_id="1", content="b",
+ channel="zulip",
+ chat_id="1",
+ content="b",
metadata={"_stream_delta": True, "_stream_id": "t:2"},
),
]
diff --git a/tests/services/partners/test_napcat_channel.py b/tests/services/partners/test_napcat_channel.py
index a45d13ec8..1a0e80bd7 100644
--- a/tests/services/partners/test_napcat_channel.py
+++ b/tests/services/partners/test_napcat_channel.py
@@ -147,9 +147,7 @@ class TestShouldReplyInGroup:
def test_mention_policy_requires_mention(self):
ch = _make_channel(group_policy="mention")
assert (
- ch._should_reply_in_group(
- group_id=123, mentioned_self=False, replying_to_bot=False
- )
+ ch._should_reply_in_group(group_id=123, mentioned_self=False, replying_to_bot=False)
is False
)
@@ -170,9 +168,7 @@ class TestShouldReplyInGroup:
def test_open_policy_allows_all(self):
ch = _make_channel(group_policy="open")
assert (
- ch._should_reply_in_group(
- group_id=123, mentioned_self=False, replying_to_bot=False
- )
+ ch._should_reply_in_group(group_id=123, mentioned_self=False, replying_to_bot=False)
is True
)
@@ -180,9 +176,7 @@ class TestShouldReplyInGroup:
ch = _make_channel(group_policy=0.5)
with patch("random.random", return_value=0.3):
assert (
- ch._should_reply_in_group(
- group_id=123, mentioned_self=False, replying_to_bot=False
- )
+ ch._should_reply_in_group(group_id=123, mentioned_self=False, replying_to_bot=False)
is True
)
@@ -190,9 +184,7 @@ class TestShouldReplyInGroup:
ch = _make_channel(group_policy=0.5)
with patch("random.random", return_value=0.7):
assert (
- ch._should_reply_in_group(
- group_id=123, mentioned_self=False, replying_to_bot=False
- )
+ ch._should_reply_in_group(group_id=123, mentioned_self=False, replying_to_bot=False)
is False
)
@@ -200,9 +192,7 @@ class TestShouldReplyInGroup:
ch = _make_channel(group_policy=0.0)
with patch("random.random", return_value=0.0):
assert (
- ch._should_reply_in_group(
- group_id=123, mentioned_self=False, replying_to_bot=False
- )
+ ch._should_reply_in_group(group_id=123, mentioned_self=False, replying_to_bot=False)
is False
)
@@ -210,9 +200,7 @@ class TestShouldReplyInGroup:
ch = _make_channel(group_policy=1.0)
with patch("random.random", return_value=0.999):
assert (
- ch._should_reply_in_group(
- group_id=123, mentioned_self=False, replying_to_bot=False
- )
+ ch._should_reply_in_group(group_id=123, mentioned_self=False, replying_to_bot=False)
is True
)
@@ -224,43 +212,29 @@ class TestShouldReplyInGroup:
)
def test_override_open_beats_global_mention(self):
- ch = _make_channel(
- group_policy="mention", group_policy_overrides={"123": "open"}
- )
+ ch = _make_channel(group_policy="mention", group_policy_overrides={"123": "open"})
assert (
- ch._should_reply_in_group(
- group_id=123, mentioned_self=False, replying_to_bot=False
- )
+ ch._should_reply_in_group(group_id=123, mentioned_self=False, replying_to_bot=False)
is True
)
def test_unlisted_group_falls_back_to_global(self):
- ch = _make_channel(
- group_policy="mention", group_policy_overrides={"123": "open"}
- )
+ ch = _make_channel(group_policy="mention", group_policy_overrides={"123": "open"})
assert (
- ch._should_reply_in_group(
- group_id=456, mentioned_self=False, replying_to_bot=False
- )
+ ch._should_reply_in_group(group_id=456, mentioned_self=False, replying_to_bot=False)
is False
)
def test_override_probability(self):
- ch = _make_channel(
- group_policy="mention", group_policy_overrides={"123": 0.5}
- )
+ ch = _make_channel(group_policy="mention", group_policy_overrides={"123": 0.5})
with patch("random.random", return_value=0.3):
assert (
- ch._should_reply_in_group(
- group_id=123, mentioned_self=False, replying_to_bot=False
- )
+ ch._should_reply_in_group(group_id=123, mentioned_self=False, replying_to_bot=False)
is True
)
with patch("random.random", return_value=0.9):
assert (
- ch._should_reply_in_group(
- group_id=123, mentioned_self=False, replying_to_bot=False
- )
+ ch._should_reply_in_group(group_id=123, mentioned_self=False, replying_to_bot=False)
is False
)
@@ -507,9 +481,7 @@ class TestOnNotice:
@pytest.mark.asyncio
async def test_welcome_disabled_ignores_notice(self):
ch = _make_channel(welcome_new_members=False)
- await ch._on_notice(
- {"notice_type": "group_increase", "group_id": 123456, "user_id": 55}
- )
+ await ch._on_notice({"notice_type": "group_increase", "group_id": 123456, "user_id": 55})
ch.bus.publish_inbound.assert_not_awaited()
@pytest.mark.asyncio
diff --git a/tests/services/partners/test_partner_manager_config.py b/tests/services/partners/test_partner_manager_config.py
index 17366e41b..a03e40959 100644
--- a/tests/services/partners/test_partner_manager_config.py
+++ b/tests/services/partners/test_partner_manager_config.py
@@ -164,3 +164,41 @@ class TestLegacyTutorBotMigration:
assert read_soul("old-bot") == "# Edited after migration"
# Legacy tree untouched.
assert (legacy / "config.yaml").exists()
+
+
+class TestSoulLibraryRefresh:
+ """Untouched old-seed library entries upgrade in place; user souls survive."""
+
+ _TUTORBOT_ENTRY = {
+ "id": "default-tutorbot",
+ "name": "Default TutorBot",
+ "content": "# Soul\n\nI am TutorBot, a personal learning companion.\n\n"
+ "## Personality\n\n- Helpful and friendly\n- Clear, encouraging, and patient\n"
+ "- Adapts explanations to the user's level\n\n"
+ "## Values\n\n- Accuracy over speed\n- User privacy and safety\n- Transparency in actions",
+ }
+
+ def test_tutorbot_era_library_is_upgraded(self, partners_root):
+ mgr = _mgr()
+ mgr._save_souls([dict(self._TUTORBOT_ENTRY)])
+ souls = mgr.list_souls()
+ assert [s["id"] for s in souls] == ["companion"]
+ assert "tutorbot" not in yaml.dump(souls).lower()
+
+ def test_user_souls_pass_through_verbatim(self, partners_root):
+ mgr = _mgr()
+ mine = {"id": "my-bot", "name": "Mine", "content": "I miss TutorBot"}
+ edited_seed = {"id": "math-tutor", "name": "Math Tutor", "content": "# My own text"}
+ mgr._save_souls([dict(self._TUTORBOT_ENTRY), mine, edited_seed])
+ souls = mgr.list_souls()
+ assert souls == [
+ {"id": "companion", "name": "Learning Companion", "content": souls[0]["content"]},
+ mine,
+ edited_seed,
+ ]
+
+ def test_refresh_is_idempotent(self, partners_root):
+ mgr = _mgr()
+ mgr._save_souls([dict(self._TUTORBOT_ENTRY)])
+ first = mgr.list_souls()
+ assert mgr.list_souls() == first
diff --git a/tests/services/partners/test_partner_runtime.py b/tests/services/partners/test_partner_runtime.py
index 23cd7f883..0914d91f2 100644
--- a/tests/services/partners/test_partner_runtime.py
+++ b/tests/services/partners/test_partner_runtime.py
@@ -152,9 +152,7 @@ class TestTurnExecution:
self, partners_root, fake_orchestrator
):
fake_orchestrator.script = _narration_round("c1", "exploring…") + _finish("done")
- config = PartnerConfig(
- name="Ada", channels={"telegram": {"send_progress": False}}
- )
+ config = PartnerConfig(name="Ada", channels={"telegram": {"send_progress": False}})
runner = _runner(partners_root, config)
await runner.process_message(_msg())
@@ -321,6 +319,50 @@ class TestContextAssembly:
"content": "first reply",
} in context.conversation_history
+ @pytest.mark.asyncio
+ async def test_image_media_becomes_context_attachment_and_session_record(
+ self, partners_root, fake_orchestrator
+ ):
+ image_path = partners_root / "image.png"
+ image_path.parent.mkdir(parents=True, exist_ok=True)
+ image_path.write_bytes(b"\x89PNG\r\n\x1a\n" + b"0" * 32)
+ fake_orchestrator.script = _finish("saw it")
+ runner = _runner(partners_root)
+ msg = _msg("what is in this image?")
+ msg.media = [str(image_path)]
+
+ await runner.process_message(msg)
+
+ context = fake_orchestrator.seen_contexts[-1]
+ assert len(context.attachments) == 1
+ assert context.attachments[0].type == "image"
+ assert context.attachments[0].filename == "image.png"
+ records = runner.store.messages("telegram:42")
+ assert records[0]["attachments"][0]["type"] == "image"
+ assert records[0]["attachments"][0]["filename"] == "image.png"
+
+ @pytest.mark.asyncio
+ async def test_document_media_becomes_attached_source(self, partners_root, fake_orchestrator):
+ doc_path = partners_root / "notes.txt"
+ doc_path.parent.mkdir(parents=True, exist_ok=True)
+ doc_path.write_text("Gradient descent uses a learning rate.", encoding="utf-8")
+ fake_orchestrator.script = _finish("noted")
+ runner = _runner(partners_root)
+ msg = _msg("summarize this")
+ msg.media = [str(doc_path)]
+
+ await runner.process_message(msg)
+
+ context = fake_orchestrator.seen_contexts[-1]
+ assert "notes.txt" in context.source_manifest
+ source_index = context.metadata["source_index"]
+ assert len(source_index) == 1
+ assert "Gradient descent" in next(iter(source_index.values()))
+ records = runner.store.messages("telegram:42")
+ attachment = records[0]["attachments"][0]
+ assert attachment["filename"] == "notes.txt"
+ assert "Gradient descent" in attachment["extracted_text"]
+
class TestPartnerCommands:
@pytest.mark.asyncio
@@ -343,9 +385,7 @@ class TestPartnerCommands:
assert archived[0]["session_key"].startswith("_archived_")
@pytest.mark.asyncio
- async def test_archived_session_does_not_feed_next_turn(
- self, partners_root, fake_orchestrator
- ):
+ async def test_archived_session_does_not_feed_next_turn(self, partners_root, fake_orchestrator):
runner = _runner(partners_root)
fake_orchestrator.script = _finish("old reply")
await runner.process_message(_msg("old question"))
@@ -358,9 +398,7 @@ class TestPartnerCommands:
assert context.conversation_history == []
@pytest.mark.asyncio
- async def test_telegram_bot_command_suffix_is_supported(
- self, partners_root, fake_orchestrator
- ):
+ async def test_telegram_bot_command_suffix_is_supported(self, partners_root, fake_orchestrator):
fake_orchestrator.script = _finish("first reply")
runner = _runner(partners_root)
await runner.process_message(_msg("first question"))
diff --git a/tests/services/partners/test_partner_workspace.py b/tests/services/partners/test_partner_workspace.py
index ebb7324ba..3652605ba 100644
--- a/tests/services/partners/test_partner_workspace.py
+++ b/tests/services/partners/test_partner_workspace.py
@@ -108,9 +108,7 @@ class TestProvisioning:
from deeptutor.services.skill.service import BUILTIN_SKILLS_ROOT
builtin_names = [
- entry.name
- for entry in BUILTIN_SKILLS_ROOT.iterdir()
- if (entry / "SKILL.md").exists()
+ entry.name for entry in BUILTIN_SKILLS_ROOT.iterdir() if (entry / "SKILL.md").exists()
]
assert builtin_names, "expected packaged builtin skills"
target = builtin_names[0]
diff --git a/web/app/(utility)/settings/mcp/page.tsx b/web/app/(utility)/settings/mcp/page.tsx
index 9c2806dff..9a98fef94 100644
--- a/web/app/(utility)/settings/mcp/page.tsx
+++ b/web/app/(utility)/settings/mcp/page.tsx
@@ -1,14 +1,7 @@
"use client";
import { useCallback, useEffect, useMemo, useState } from "react";
-import {
- ChevronDown,
- Loader2,
- Pencil,
- Plug,
- Plus,
- Trash2,
-} from "lucide-react";
+import { ChevronDown, Loader2, Pencil, Plug, Plus, Trash2 } from "lucide-react";
import { useTranslation } from "react-i18next";
import { SettingsPageHeader } from "@/components/settings/shared";
@@ -80,9 +73,10 @@ function isRemoteTransport(transport: McpTransport | null): boolean {
export default function McpSettingsPage() {
const { t } = useTranslation();
- const [servers, setServers] = useState<Record<string, McpServerConfig> | null>(
- null,
- );
+ const [servers, setServers] = useState<Record<
+ string,
+ McpServerConfig
+ > | null>(null);
const [statusRows, setStatusRows] = useState<McpStatusRow[]>([]);
const [loadError, setLoadError] = useState<string | null>(null);
const [saveError, setSaveError] = useState<string | null>(null);
@@ -114,24 +108,21 @@ export default function McpSettingsPage() {
return map;
}, [statusRows]);
- const persist = useCallback(
- async (next: Record<string, McpServerConfig>) => {
- setSaving(true);
- setSaveError(null);
- try {
- const status = await updateMcpSettings(next);
- setServers(next);
- setStatusRows(status);
- return true;
- } catch (err) {
- setSaveError(err instanceof Error ? err.message : String(err));
- return false;
- } finally {
- setSaving(false);
- }
- },
- [],
- );
+ const persist = useCallback(async (next: Record<string, McpServerConfig>) => {
+ setSaving(true);
+ setSaveError(null);
+ try {
+ const status = await updateMcpSettings(next);
+ setServers(next);
+ setStatusRows(status);
+ return true;
+ } catch (err) {
+ setSaveError(err instanceof Error ? err.message : String(err));
+ return false;
+ } finally {
+ setSaving(false);
+ }
+ }, []);
const handleToggleExpanded = (name: string) => {
setExpanded((prev) => {
@@ -161,7 +152,7 @@ export default function McpSettingsPage() {
if (!servers || saving) return;
if (
typeof window !== "undefined" &&
- !window.confirm(t("Delete MCP server \"{{name}}\"?", { name }))
+ !window.confirm(t('Delete MCP server "{{name}}"?', { name }))
) {
return;
}
@@ -625,9 +616,7 @@ function ServerForm({
className={selectClass}
value={type ?? ""}
onChange={(e) =>
- setType(
- (e.target.value || null) as McpServerConfig["type"],
- )
+ setType((e.target.value || null) as McpServerConfig["type"])
}
>
<option value="">
diff --git a/web/app/(utility)/settings/mineru/page.tsx b/web/app/(utility)/settings/mineru/page.tsx
index 0b153d5b6..5253992bf 100644
--- a/web/app/(utility)/settings/mineru/page.tsx
+++ b/web/app/(utility)/settings/mineru/page.tsx
@@ -115,11 +115,15 @@ export default function MinerUSettingsPage() {
const [loading, setLoading] = useState(true);
const [saving, setSaving] = useState(false);
const [testing, setTesting] = useState(false);
- const [testResult, setTestResult] = useState<{ ok: boolean; message: string } | null>(null);
+ const [testResult, setTestResult] = useState<{
+ ok: boolean;
+ message: string;
+ } | null>(null);
const [error, setError] = useState<string | null>(null);
const [message, setMessage] = useState("");
const [download, setDownload] = useState<DownloadStatus | null>(null);
- const [downloadType, setDownloadType] = useState<MinerUDownloadType>("pipeline");
+ const [downloadType, setDownloadType] =
+ useState<MinerUDownloadType>("pipeline");
const [startingDownload, setStartingDownload] = useState(false);
const downloadCursor = useRef(0);
@@ -147,7 +151,8 @@ export default function MinerUSettingsPage() {
setTokenDraft("");
setTokenTouched(false);
} catch (err) {
- if (!cancelled) setError(err instanceof Error ? err.message : String(err));
+ if (!cancelled)
+ setError(err instanceof Error ? err.message : String(err));
} finally {
if (!cancelled) setLoading(false);
}
@@ -244,10 +249,14 @@ export default function MinerUSettingsPage() {
}
setTestResult({
ok: Boolean(data.ok),
- message: data.message || (data.ok ? t("OK") : t("Connection test failed.")),
+ message:
+ data.message || (data.ok ? t("OK") : t("Connection test failed.")),
});
} catch (err) {
- setTestResult({ ok: false, message: err instanceof Error ? err.message : String(err) });
+ setTestResult({
+ ok: false,
+ message: err instanceof Error ? err.message : String(err),
+ });
} finally {
setTesting(false);
}
@@ -404,7 +413,9 @@ export default function MinerUSettingsPage() {
description={
isCloud
? t("Documents are uploaded to mineru.net for parsing.")
- : t("Parsing runs on this machine using the local MinerU install.")
+ : t(
+ "Parsing runs on this machine using the local MinerU install.",
+ )
}
control={
<div className="inline-flex rounded-lg border border-[var(--border)] p-0.5">
@@ -480,7 +491,9 @@ export default function MinerUSettingsPage() {
>
<SettingRow
title={t("Download source")}
- description={t("ModelScope is usually faster in mainland China.")}
+ description={t(
+ "ModelScope is usually faster in mainland China.",
+ )}
control={
<select
className={`${nativeSelectClass} w-44`}
@@ -599,11 +612,15 @@ export default function MinerUSettingsPage() {
<>
<SettingSection
title={t("Cloud API")}
- description={t("Get an API token from mineru.net → API management.")}
+ description={t(
+ "Get an API token from mineru.net → API management.",
+ )}
>
<SettingRow
title={t("API base URL")}
- description={t("Override only if you use a self-hosted MinerU endpoint.")}
+ description={t(
+ "Override only if you use a self-hosted MinerU endpoint.",
+ )}
control={
<input
className={`${inputClass} w-[320px] max-w-[48vw]`}
@@ -617,7 +634,9 @@ export default function MinerUSettingsPage() {
title={t("API token")}
description={
tokenSet
- ? t("A token is saved. Type to replace it; leave blank to keep it.")
+ ? t(
+ "A token is saved. Type to replace it; leave blank to keep it.",
+ )
: t("No token saved yet.")
}
control={
@@ -635,24 +654,32 @@ export default function MinerUSettingsPage() {
/>
<SettingRow
title={t("Test connection")}
- description={t("Verifies the token against the MinerU API (no quota used).")}
+ description={t(
+ "Verifies the token against the MinerU API (no quota used).",
+ )}
control={renderTestControl(t("Test"))}
/>
</SettingSection>
<SettingSection
title={t("Parsing options")}
- description={t("Forwarded to the MinerU API for each document.")}
+ description={t(
+ "Forwarded to the MinerU API for each document.",
+ )}
>
<SettingRow
title={t("Model version")}
- description={t("pipeline is faster; vlm is the vision-language model.")}
+ description={t(
+ "pipeline is faster; vlm is the vision-language model.",
+ )}
control={
<select
className={`${nativeSelectClass} w-40`}
value={draft.model_version}
onChange={(e) =>
- patch({ model_version: e.target.value as MinerUModelVersion })
+ patch({
+ model_version: e.target.value as MinerUModelVersion,
+ })
}
>
{MODEL_VERSIONS.map((v) => (
@@ -665,7 +692,9 @@ export default function MinerUSettingsPage() {
/>
<SettingRow
title={t("Language")}
- description={t('Document language hint. Use "auto" to let MinerU detect it.')}
+ description={t(
+ 'Document language hint. Use "auto" to let MinerU detect it.',
+ )}
control={
<input
className={`${inputClass} w-40`}
@@ -695,9 +724,14 @@ export default function MinerUSettingsPage() {
/>
<SettingRow
title={t("Force OCR")}
- description={t("Treat the PDF as scanned images. Slower; only for non-text PDFs.")}
+ description={t(
+ "Treat the PDF as scanned images. Slower; only for non-text PDFs.",
+ )}
control={
- <Toggle checked={draft.is_ocr} onChange={(v) => patch({ is_ocr: v })} />
+ <Toggle
+ checked={draft.is_ocr}
+ onChange={(v) => patch({ is_ocr: v })}
+ />
}
/>
</SettingSection>
@@ -707,7 +741,9 @@ export default function MinerUSettingsPage() {
<div className="flex items-center justify-between gap-3">
<p className="text-[12px] text-[var(--muted-foreground)]">
{message ||
- t("MinerU settings are written to data/user/settings/mineru.json.")}
+ t(
+ "MinerU settings are written to data/user/settings/mineru.json.",
+ )}
</p>
<button
onClick={save}
diff --git a/web/app/(workspace)/book/components/BookLibrary.tsx b/web/app/(workspace)/book/components/BookLibrary.tsx
index 31571718a..b049e7adf 100644
--- a/web/app/(workspace)/book/components/BookLibrary.tsx
+++ b/web/app/(workspace)/book/components/BookLibrary.tsx
@@ -422,7 +422,10 @@ export default function BookLibrary({
{onLearn && book.status === "ready" && (
<button
type="button"
- onClick={(e) => { e.stopPropagation(); onLearn(book); }}
+ onClick={(e) => {
+ e.stopPropagation();
+ onLearn(book);
+ }}
className="mt-2 inline-flex items-center gap-1 rounded-md bg-[var(--primary)] px-3 py-1.5 text-xs font-medium text-[var(--primary-foreground)] transition-opacity hover:opacity-90"
>
<GraduationCap size={13} />
diff --git a/web/app/(workspace)/book/page.tsx b/web/app/(workspace)/book/page.tsx
index c1214b303..6d947ff4f 100644
--- a/web/app/(workspace)/book/page.tsx
+++ b/web/app/(workspace)/book/page.tsx
@@ -31,7 +31,6 @@ import {
reduceBookEvent,
} from "@/lib/book-progress";
-
import BookChatPanel from "./components/BookChatPanel";
import BookCreator from "./components/BookCreator";
import BookHealthBanner from "./components/BookHealthBanner";
@@ -240,7 +239,6 @@ function BookPageInner() {
await refreshBooks();
};
-
const handleRebuildBook = async () => {
if (!detail) return;
if (
@@ -352,7 +350,10 @@ function BookPageInner() {
await bookApi.regenerateBlock(detail.book.id, selectedPage.id, block.id);
} catch (err) {
const msg = err instanceof Error ? err.message : String(err);
- notify(`Regenerate block failed: ${msg}`, { tone: "error", durationMs: 8000 });
+ notify(`Regenerate block failed: ${msg}`, {
+ tone: "error",
+ durationMs: 8000,
+ });
console.error("regenerateBlock failed:", err);
} finally {
await loadBookDetail(detail.book.id);
diff --git a/web/app/(workspace)/partners/[partnerId]/page.tsx b/web/app/(workspace)/partners/[partnerId]/page.tsx
index b9aaa8a51..ce7920950 100644
--- a/web/app/(workspace)/partners/[partnerId]/page.tsx
+++ b/web/app/(workspace)/partners/[partnerId]/page.tsx
@@ -95,7 +95,9 @@ function PartnerDetail() {
const handleDestroy = async () => {
if (
!window.confirm(
- t("Delete this partner and ALL its data (workspace, sessions, channels)? This cannot be undone."),
+ t(
+ "Delete this partner and ALL its data (workspace, sessions, channels)? This cannot be undone.",
+ ),
)
)
return;
@@ -121,7 +123,10 @@ function PartnerDetail() {
<p className="text-[14px] text-[var(--muted-foreground)]">
{t("Partner not found")}
</p>
- <Link href="/partners" className="text-[13px] text-[var(--primary)] hover:underline">
+ <Link
+ href="/partners"
+ className="text-[13px] text-[var(--primary)] hover:underline"
+ >
{t("Back to Partners")}
</Link>
</div>
diff --git a/web/app/(workspace)/partners/new/page.tsx b/web/app/(workspace)/partners/new/page.tsx
index 1b8d765e9..858fc085a 100644
--- a/web/app/(workspace)/partners/new/page.tsx
+++ b/web/app/(workspace)/partners/new/page.tsx
@@ -10,15 +10,13 @@
import { useEffect, useMemo, useState } from "react";
import Link from "next/link";
import { useRouter } from "next/navigation";
-import {
- ArrowLeft,
- ArrowRight,
- Check,
- Loader2,
- Sparkles,
-} from "lucide-react";
+import { ArrowLeft, ArrowRight, Check, Loader2, Sparkles } from "lucide-react";
import { useTranslation } from "react-i18next";
-import { listLLMOptions, sameLLMSelection, type LLMOption } from "@/lib/llm-options";
+import {
+ listLLMOptions,
+ sameLLMSelection,
+ type LLMOption,
+} from "@/lib/llm-options";
import type { LLMSelection } from "@/lib/unified-ws";
import {
createPartner,
@@ -55,11 +53,17 @@ export default function NewPartnerPage() {
// ── form state ────────────────────────────────────────────────
const [name, setName] = useState("");
const [description, setDescription] = useState("");
- const [face, setFace] = useState<FaceValue>({ emoji: "", color: "", avatar: "" });
+ const [face, setFace] = useState<FaceValue>({
+ emoji: "",
+ color: "",
+ avatar: "",
+ });
const [language, setLanguage] = useState("");
const [soul, setSoul] = useState<SoulSpec>({ source: "default" });
const [selection, setSelection] = useState<LLMSelection | null>(null);
- const [backupSelection, setBackupSelection] = useState<LLMSelection | null>(null);
+ const [backupSelection, setBackupSelection] = useState<LLMSelection | null>(
+ null,
+ );
const [assets, setAssets] = useState<AssetSelection>({
knowledge_bases: [],
skills: [],
@@ -67,7 +71,9 @@ export default function NewPartnerPage() {
});
const [llmOptions, setLLMOptions] = useState<LLMOption[]>([]);
- const [activeLLMDefault, setActiveLLMDefault] = useState<LLMSelection | null>(null);
+ const [activeLLMDefault, setActiveLLMDefault] = useState<LLMSelection | null>(
+ null,
+ );
const [llmLoading, setLLMLoading] = useState(true);
const [llmError, setLLMError] = useState(false);
@@ -167,7 +173,9 @@ export default function NewPartnerPage() {
() =>
(candidate: LLMSelection | null, noneText: string): string => {
if (!candidate) return noneText;
- const option = llmOptions.find((opt) => sameLLMSelection(opt, candidate));
+ const option = llmOptions.find((opt) =>
+ sameLLMSelection(opt, candidate),
+ );
return option ? option.model_name || option.model : candidate.model_id;
},
[llmOptions],
@@ -176,7 +184,9 @@ export default function NewPartnerPage() {
const backupSummary = describeSelection(backupSelection, t("No backup"));
const assetCount =
- assets.knowledge_bases.length + assets.skills.length + assets.notebooks.length;
+ assets.knowledge_bases.length +
+ assets.skills.length +
+ assets.notebooks.length;
const stepTitle: Record<StepKey, { title: string; subtitle: string }> = {
identity: {
@@ -185,7 +195,9 @@ export default function NewPartnerPage() {
},
soul: {
title: t("Give it a soul"),
- subtitle: t("Who this partner is. Start from a template, clone a chat persona, or write it yourself."),
+ subtitle: t(
+ "Who this partner is. Start from a template, clone a chat persona, or write it yourself.",
+ ),
},
mind: {
title: t("Shape its mind"),
@@ -193,10 +205,14 @@ export default function NewPartnerPage() {
},
library: {
title: t("Hand over some knowledge"),
- subtitle: t("Give it a slice of your knowledge — copied into the partner's own workspace."),
+ subtitle: t(
+ "Give it a slice of your knowledge — copied into the partner's own workspace.",
+ ),
},
review: {
- title: t("Ready to meet {{name}}?", { name: name.trim() || t("your partner") }),
+ title: t("Ready to meet {{name}}?", {
+ name: name.trim() || t("your partner"),
+ }),
subtitle: t("Almost there — check the essentials before creating."),
},
};
@@ -207,9 +223,9 @@ export default function NewPartnerPage() {
<div className="flex items-center justify-between px-6 pt-5">
<Link
href="/partners"
- className="inline-flex items-center gap-1.5 text-[12px] text-[var(--muted-foreground)] hover:text-[var(--foreground)]"
+ className="inline-flex items-center gap-1.5 text-[13px] text-[var(--muted-foreground)] transition-colors hover:text-[var(--foreground)]"
>
- <ArrowLeft className="h-3.5 w-3.5" />
+ <ArrowLeft className="h-4 w-4" />
{t("Partners")}
</Link>
<ol className="flex items-center gap-1.5">
@@ -222,7 +238,15 @@ export default function NewPartnerPage() {
: "border-[var(--border)] text-[var(--muted-foreground)]";
return (
<li key={key} className="flex items-center gap-1.5">
- {index > 0 && <span className="h-px w-5 bg-[var(--border)]" />}
+ {index > 0 && (
+ <span
+ className={`h-px w-5 transition-colors ${
+ index <= stepIndex
+ ? "bg-[var(--primary)]/40"
+ : "bg-[var(--border)]"
+ }`}
+ />
+ )}
<button
type="button"
disabled={index > stepIndex}
@@ -231,15 +255,19 @@ export default function NewPartnerPage() {
aria-label={label}
>
<span
- className={`flex h-5 w-5 items-center justify-center rounded-full border text-[10.5px] font-semibold transition-colors ${stateClass}`}
+ className={`flex h-6 w-6 items-center justify-center rounded-full border text-[11px] font-semibold transition-all duration-200 group-enabled:group-hover:scale-105 ${stateClass}`}
>
- {index < stepIndex ? <Check className="h-3 w-3" strokeWidth={3} /> : index + 1}
+ {index < stepIndex ? (
+ <Check className="h-3.5 w-3.5" strokeWidth={3} />
+ ) : (
+ index + 1
+ )}
</span>
<span
- className={`hidden text-[11.5px] sm:block ${
+ className={`hidden text-[12.5px] transition-colors sm:block ${
index === stepIndex
? "font-medium text-[var(--foreground)]"
- : "text-[var(--muted-foreground)]"
+ : "text-[var(--muted-foreground)] group-enabled:group-hover:text-[var(--foreground)]"
}`}
>
{label}
@@ -254,8 +282,11 @@ export default function NewPartnerPage() {
{/* Step body */}
<div className="min-h-0 flex-1 overflow-y-auto">
- <div key={step} className="mx-auto w-full max-w-xl px-6 pb-8 pt-10 animate-fade-in">
- <header className="mb-6 flex items-start gap-4">
+ <div
+ key={step}
+ className="mx-auto w-full max-w-2xl px-6 pb-8 pt-10 animate-fade-in"
+ >
+ <header className="mb-7 flex items-start gap-4">
{step === "identity" || step === "review" ? (
<PartnerAvatar
name={name || "?"}
@@ -266,19 +297,21 @@ export default function NewPartnerPage() {
/>
) : null}
<div>
- <h1 className="text-[20px] font-semibold tracking-tight text-[var(--foreground)]">
+ <h1 className="text-[22px] font-semibold tracking-tight text-[var(--foreground)]">
{stepTitle[step].title}
</h1>
- <p className="mt-1 text-[12.5px] leading-relaxed text-[var(--muted-foreground)]">
+ <p className="mt-1 text-[13.5px] leading-relaxed text-[var(--muted-foreground)]">
{stepTitle[step].subtitle}
</p>
</div>
</header>
{step === "identity" && (
- <div className="space-y-4">
+ <div className="space-y-5">
<div>
- <label className="mb-1 block text-[12px] font-medium">{t("Name")}</label>
+ <label className="mb-1.5 block text-[13px] font-medium">
+ {t("Name")}
+ </label>
<input
value={name}
onChange={(e) => setName(e.target.value)}
@@ -287,32 +320,34 @@ export default function NewPartnerPage() {
}}
placeholder={t("e.g. Ada")}
autoFocus
- className="w-full rounded-xl border border-[var(--border)] bg-transparent px-3.5 py-2.5 text-[14px] outline-none focus:border-[var(--ring)]"
+ className="w-full rounded-xl border border-[var(--border)] bg-transparent px-3.5 py-2.5 text-[14px] outline-none transition-colors focus:border-[var(--ring)]"
/>
</div>
<div>
- <label className="mb-1 block text-[12px] font-medium">
+ <label className="mb-1.5 block text-[13px] font-medium">
{t("Description")}
</label>
<input
value={description}
onChange={(e) => setDescription(e.target.value)}
placeholder={t("What is this partner for?")}
- className="w-full rounded-xl border border-[var(--border)] bg-transparent px-3.5 py-2.5 text-[13px] outline-none focus:border-[var(--ring)]"
+ className="w-full rounded-xl border border-[var(--border)] bg-transparent px-3.5 py-2.5 text-[14px] outline-none transition-colors focus:border-[var(--ring)]"
/>
</div>
<div>
- <label className="mb-2 block text-[12px] font-medium">{t("Face")}</label>
+ <label className="mb-2 block text-[13px] font-medium">
+ {t("Face")}
+ </label>
<FaceEditor name={name} value={face} onChange={setFace} />
</div>
<div>
- <label className="mb-1 block text-[12px] font-medium">
+ <label className="mb-1.5 block text-[13px] font-medium">
{t("Reply language")}
</label>
<select
value={language}
onChange={(e) => setLanguage(e.target.value)}
- className="w-48 rounded-xl border border-[var(--border)] bg-transparent px-3 py-2 text-[13px] outline-none focus:border-[var(--ring)]"
+ className="w-48 rounded-xl border border-[var(--border)] bg-transparent px-3 py-2 text-[14px] outline-none transition-colors focus:border-[var(--ring)]"
>
<option value="">{t("Auto (English)")}</option>
<option value="en">English</option>
@@ -327,7 +362,7 @@ export default function NewPartnerPage() {
{step === "mind" && (
<div className="space-y-6">
<div>
- <h3 className="mb-2 text-[12px] font-medium text-[var(--muted-foreground)]">
+ <h3 className="mb-2 text-[13px] font-medium text-[var(--muted-foreground)]">
{t("Primary model")}
</h3>
<PartnerModelPicker
@@ -340,7 +375,7 @@ export default function NewPartnerPage() {
/>
</div>
<div>
- <h3 className="mb-2 text-[12px] font-medium text-[var(--muted-foreground)]">
+ <h3 className="mb-2 text-[13px] font-medium text-[var(--muted-foreground)]">
{t("Backup model")}
</h3>
<PartnerModelSelect
@@ -371,7 +406,11 @@ export default function NewPartnerPage() {
)}
{step === "library" && (
- <AssetPicker value={assets} onChange={setAssets} preselectAllSkills />
+ <AssetPicker
+ value={assets}
+ onChange={setAssets}
+ preselectAllSkills
+ />
)}
{step === "review" && (
@@ -386,31 +425,42 @@ export default function NewPartnerPage() {
[
t("Tools"),
`${enabledTools.length} ${t("System tools")}${
- mcpTools.length ? ` · ${mcpTools.length} ${t("MCP tools")}` : ""
+ mcpTools.length
+ ? ` · ${mcpTools.length} ${t("MCP tools")}`
+ : ""
}`,
],
[
t("Library"),
assetCount > 0
- ? t("{{count}} items will be copied", { count: assetCount })
- : t("Nothing assigned yet — this partner only knows what you tell it."),
+ ? t("{{count}} items will be copied", {
+ count: assetCount,
+ })
+ : t(
+ "Nothing assigned yet — this partner only knows what you tell it.",
+ ),
],
].map(([label, valueText]) => (
- <div key={label} className="flex items-baseline gap-4 px-4 py-2.5">
- <dt className="w-20 shrink-0 text-[12px] text-[var(--muted-foreground)]">
+ <div
+ key={label}
+ className="flex items-baseline gap-4 px-4 py-3"
+ >
+ <dt className="w-24 shrink-0 text-[12.5px] text-[var(--muted-foreground)]">
{label}
</dt>
- <dd className="min-w-0 truncate text-[13px] text-[var(--foreground)]">
+ <dd className="min-w-0 truncate text-[13.5px] text-[var(--foreground)]">
{valueText}
</dd>
</div>
))}
</dl>
- <p className="text-[11.5px] text-[var(--muted-foreground)]">
- {t("You can connect Feishu, Telegram, Slack and more right after creating.")}
+ <p className="text-[12.5px] text-[var(--muted-foreground)]">
+ {t(
+ "You can connect Feishu, Telegram, Slack and more right after creating.",
+ )}
</p>
{error && (
- <p className="rounded-lg border border-[var(--destructive)] bg-[var(--secondary)] px-3 py-2 text-[12.5px] text-[var(--destructive)]">
+ <p className="rounded-lg border border-[var(--destructive)] bg-[var(--secondary)] px-3 py-2 text-[13px] text-[var(--destructive)]">
{error}
</p>
)}
@@ -421,14 +471,14 @@ export default function NewPartnerPage() {
{/* Footer actions */}
<div className="border-t border-[var(--border)] px-6 py-3.5">
- <div className="mx-auto flex w-full max-w-xl items-center justify-between">
+ <div className="mx-auto flex w-full max-w-2xl items-center justify-between">
<button
type="button"
onClick={goBack}
disabled={stepIndex === 0}
- className="inline-flex items-center gap-1.5 rounded-lg px-3 py-2 text-[12.5px] text-[var(--muted-foreground)] hover:text-[var(--foreground)] disabled:invisible"
+ className="inline-flex items-center gap-1.5 rounded-xl px-3 py-2 text-[13.5px] text-[var(--muted-foreground)] transition-colors hover:text-[var(--foreground)] disabled:invisible"
>
- <ArrowLeft className="h-3.5 w-3.5" />
+ <ArrowLeft className="h-4 w-4" />
{t("Back")}
</button>
{step === "review" ? (
@@ -436,7 +486,7 @@ export default function NewPartnerPage() {
type="button"
onClick={() => void submit()}
disabled={creating || !name.trim()}
- className="inline-flex items-center gap-1.5 rounded-lg bg-[var(--primary)] px-4 py-2 text-[13px] font-medium text-[var(--primary-foreground)] disabled:opacity-40"
+ className="inline-flex items-center gap-2 rounded-xl bg-[var(--primary)] px-5 py-2.5 text-[13.5px] font-medium text-[var(--primary-foreground)] shadow-sm transition-all duration-150 hover:opacity-90 active:scale-[0.98] disabled:opacity-40"
>
{creating ? (
<Loader2 className="h-4 w-4 animate-spin" />
@@ -450,10 +500,10 @@ export default function NewPartnerPage() {
type="button"
onClick={goNext}
disabled={!canContinue}
- className="inline-flex items-center gap-1.5 rounded-lg bg-[var(--primary)] px-4 py-2 text-[13px] font-medium text-[var(--primary-foreground)] disabled:opacity-40"
+ className="inline-flex items-center gap-2 rounded-xl bg-[var(--primary)] px-5 py-2.5 text-[13.5px] font-medium text-[var(--primary-foreground)] shadow-sm transition-all duration-150 hover:opacity-90 active:scale-[0.98] disabled:opacity-40"
>
{t("Continue")}
- <ArrowRight className="h-3.5 w-3.5" />
+ <ArrowRight className="h-4 w-4" />
</button>
)}
</div>
diff --git a/web/app/(workspace)/partners/page.tsx b/web/app/(workspace)/partners/page.tsx
index a8b4ade06..c2a520f28 100644
--- a/web/app/(workspace)/partners/page.tsx
+++ b/web/app/(workspace)/partners/page.tsx
@@ -52,7 +52,9 @@ export default function PartnersPage() {
{t("Partners")}
</h1>
<p className="mt-1 text-[12.5px] text-[var(--muted-foreground)]">
- {t("Companions with their own soul, library, and channels — reachable from your IM apps.")}
+ {t(
+ "Companions with their own soul, library, and channels — reachable from your IM apps.",
+ )}
</p>
</div>
<Link
@@ -70,12 +72,17 @@ export default function PartnersPage() {
</div>
) : partners.length === 0 ? (
<div className="flex min-h-[360px] flex-col items-center justify-center rounded-2xl border border-dashed border-[var(--border)] text-center">
- <HeartHandshake className="mb-3 h-8 w-8 text-[var(--muted-foreground)]" strokeWidth={1.5} />
+ <HeartHandshake
+ className="mb-3 h-8 w-8 text-[var(--muted-foreground)]"
+ strokeWidth={1.5}
+ />
<p className="text-[14px] font-medium text-[var(--foreground)]">
{t("No partners yet")}
</p>
<p className="mt-1.5 max-w-sm text-[12.5px] leading-relaxed text-[var(--muted-foreground)]">
- {t("Create a partner, give it a soul and a slice of your library, then talk to it here or from Feishu, Telegram, Slack and more.")}
+ {t(
+ "Create a partner, give it a soul and a slice of your library, then talk to it here or from Feishu, Telegram, Slack and more.",
+ )}
</p>
<Link
href="/partners/new"
@@ -111,7 +118,9 @@ export default function PartnersPage() {
<span
title={partner.running ? t("Running") : t("Stopped")}
className={`h-1.5 w-1.5 shrink-0 rounded-full ${
- partner.running ? "bg-emerald-500" : "bg-[var(--border)]"
+ partner.running
+ ? "bg-emerald-500"
+ : "bg-[var(--border)]"
}`}
/>
</div>
diff --git a/web/app/layout.tsx b/web/app/layout.tsx
index 7edb4dfff..3a35577c5 100644
--- a/web/app/layout.tsx
+++ b/web/app/layout.tsx
@@ -47,7 +47,10 @@ export default function RootLayout({
<head>
<ThemeScript />
</head>
- <body className="font-sans bg-[var(--background)] text-[var(--foreground)]" suppressHydrationWarning>
+ <body
+ className="font-sans bg-[var(--background)] text-[var(--foreground)]"
+ suppressHydrationWarning
+ >
<AppShellProvider>
<I18nClientBridge>{children}</I18nClientBridge>
<ToastViewport />
diff --git a/web/components/chat/PersonaPicker.tsx b/web/components/chat/PersonaPicker.tsx
index e82ef4845..ea720f12e 100644
--- a/web/components/chat/PersonaPicker.tsx
+++ b/web/components/chat/PersonaPicker.tsx
@@ -212,9 +212,7 @@ export default function PersonaPicker({
onClick={handleApply}
className="btn-primary rounded-xl bg-[var(--primary)] px-4 py-2.5 text-[13px] font-medium text-[var(--primary-foreground)] transition-opacity hover:opacity-90"
>
- {selected
- ? t("Use Persona")
- : t("Continue without persona")}
+ {selected ? t("Use Persona") : t("Continue without persona")}
</button>
</div>
</div>
diff --git a/web/components/chat/home/AskUserOptions.tsx b/web/components/chat/home/AskUserOptions.tsx
index f27d7251b..6ea26cf09 100644
--- a/web/components/chat/home/AskUserOptions.tsx
+++ b/web/components/chat/home/AskUserOptions.tsx
@@ -4,7 +4,10 @@ import { ChevronDown, ChevronLeft, ChevronRight } from "lucide-react";
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
-import { collectNarrationCallIds, shouldAppendEventContent } from "@/lib/stream";
+import {
+ collectNarrationCallIds,
+ shouldAppendEventContent,
+} from "@/lib/stream";
import type { StreamEvent } from "@/lib/unified-ws";
/**
diff --git a/web/components/chat/home/ChatMessages.tsx b/web/components/chat/home/ChatMessages.tsx
index aacf4cf2a..519ebff8b 100644
--- a/web/components/chat/home/ChatMessages.tsx
+++ b/web/components/chat/home/ChatMessages.tsx
@@ -133,7 +133,12 @@ function formatFileSize(bytes?: number): string {
* reads like a document name; the extension already shows in the subtitle. */
function humanizeFilename(filename: string): string {
const stem = filename.replace(/\.[A-Za-z0-9]{1,8}$/, "");
- return stem.replace(/[_-]+/g, " ").replace(/\s{2,}/g, " ").trim() || filename;
+ return (
+ stem
+ .replace(/[_-]+/g, " ")
+ .replace(/\s{2,}/g, " ")
+ .trim() || filename
+ );
}
/**
@@ -143,9 +148,7 @@ function humanizeFilename(filename: string): string {
* completes and the persisted attachments arrive via session reload. This
* also keeps files visible for turns that get cancelled or die mid-flight.
*/
-function extractStreamedArtifacts(
- events?: StreamEvent[],
-): MessageAttachment[] {
+function extractStreamedArtifacts(events?: StreamEvent[]): MessageAttachment[] {
const out: MessageAttachment[] = [];
for (const ev of events ?? []) {
if (ev.type !== "tool_result") continue;
@@ -890,7 +893,6 @@ const UserMessage = memo(function UserMessage({
UserMessage.displayName = "UserMessage";
-
export const ChatMessageList = memo(function ChatMessageList({
messages,
isStreaming,
diff --git a/web/components/chat/home/ComposerInput.tsx b/web/components/chat/home/ComposerInput.tsx
index f59183281..55762d713 100644
--- a/web/components/chat/home/ComposerInput.tsx
+++ b/web/components/chat/home/ComposerInput.tsx
@@ -93,7 +93,10 @@ export function stripTrailingAtMention(value: string): string {
* text before the cursor is "/" plus any prefix of "persona" — `/x` or a
* trailing space closes the popup.
*/
-export function shouldOpenSlashPopup(value: string, cursorPos: number): boolean {
+export function shouldOpenSlashPopup(
+ value: string,
+ cursorPos: number,
+): boolean {
const prefix = value.slice(0, cursorPos);
const match = /^\/([a-z]*)$/i.exec(prefix);
if (!match) return false;
@@ -180,7 +183,9 @@ export const ComposerInput = memo(
setInputBoth(value);
onInputChange(value);
setShowAtPopup(shouldOpenAtPopup(value, cursorPos));
- setShowSlashPopup(slashEnabled && shouldOpenSlashPopup(value, cursorPos));
+ setShowSlashPopup(
+ slashEnabled && shouldOpenSlashPopup(value, cursorPos),
+ );
},
[setInputBoth, onInputChange, slashEnabled],
);
diff --git a/web/components/chat/home/ContextReferenceTree.tsx b/web/components/chat/home/ContextReferenceTree.tsx
index ee9899729..22876010c 100644
--- a/web/components/chat/home/ContextReferenceTree.tsx
+++ b/web/components/chat/home/ContextReferenceTree.tsx
@@ -200,11 +200,7 @@ export default memo(function ContextReferenceTree({
className={`shrink-0 transition-transform ${
// The chevron points where tapping will reveal rows: up-direction
// trees expand upward, down-direction trees expand downward.
- expanded
- ? "rotate-180"
- : direction === "up"
- ? ""
- : "-rotate-90"
+ expanded ? "rotate-180" : direction === "up" ? "" : "-rotate-90"
}`}
/>
</button>
diff --git a/web/components/chat/home/KnowledgeSelector.tsx b/web/components/chat/home/KnowledgeSelector.tsx
index 9d5d12ccd..f5fbb2843 100644
--- a/web/components/chat/home/KnowledgeSelector.tsx
+++ b/web/components/chat/home/KnowledgeSelector.tsx
@@ -33,11 +33,7 @@ export default function KnowledgeSelector({
}) {
const { t } = useTranslation();
const [open, setOpenState] = useState(false);
- const {
- expanded,
- linger,
- triggerProps: lingerProps,
- } = useLingerExpand(open);
+ const { expanded, linger, triggerProps: lingerProps } = useLingerExpand(open);
const setOpen = (next: boolean) => {
setOpenState(next);
// Keep the label expanded for a beat after close so a just-made
diff --git a/web/components/chat/home/ModelSelector.tsx b/web/components/chat/home/ModelSelector.tsx
index 6c5a16af2..6c0dd4b8d 100644
--- a/web/components/chat/home/ModelSelector.tsx
+++ b/web/components/chat/home/ModelSelector.tsx
@@ -129,11 +129,7 @@ export default function ModelSelector({
const { t } = useTranslation();
const [open, setOpen] = useState(false);
const rootRef = useRef<HTMLDivElement>(null);
- const {
- expanded,
- linger,
- triggerProps: lingerProps,
- } = useLingerExpand(open);
+ const { expanded, linger, triggerProps: lingerProps } = useLingerExpand(open);
const selectedSelection = allowSystemDefault
? value
@@ -171,7 +167,9 @@ export default function ModelSelector({
: allowSystemDefault && !selectedSelection
? defaultLabel
: // Official model ID, consistent with the dropdown rows.
- selectedOption?.model || selectedOption?.model_name || t("Select model");
+ selectedOption?.model ||
+ selectedOption?.model_name ||
+ t("Select model");
const menuPlacementClass =
placement === "bottom" ? "top-full mt-1.5" : "bottom-full mb-1.5";
diff --git a/web/components/chat/home/PersonaSelector.tsx b/web/components/chat/home/PersonaSelector.tsx
index b0a367b48..21a26bf6b 100644
--- a/web/components/chat/home/PersonaSelector.tsx
+++ b/web/components/chat/home/PersonaSelector.tsx
@@ -35,11 +35,7 @@ export default function PersonaSelector({
const { t } = useTranslation();
const [openState, setOpenState] = useState(false);
const open = openProp ?? openState;
- const {
- expanded,
- linger,
- triggerProps: lingerProps,
- } = useLingerExpand(open);
+ const { expanded, linger, triggerProps: lingerProps } = useLingerExpand(open);
const setOpen = (next: boolean) => {
setOpenState(next);
onOpenChange?.(next);
@@ -115,7 +111,8 @@ export default function PersonaSelector({
};
const showDefaultRow =
- !query.trim() || defaultLabel.toLowerCase().includes(query.trim().toLowerCase());
+ !query.trim() ||
+ defaultLabel.toLowerCase().includes(query.trim().toLowerCase());
return (
<div ref={rootRef} className="relative">
diff --git a/web/components/chat/home/SessionViewerPanel.tsx b/web/components/chat/home/SessionViewerPanel.tsx
index ff4c2b95c..081283137 100644
--- a/web/components/chat/home/SessionViewerPanel.tsx
+++ b/web/components/chat/home/SessionViewerPanel.tsx
@@ -103,7 +103,10 @@ function clampViewerWidth(px: number): number {
// column ~30% of the viewport so the panel can't swallow the conversation.
const ceiling =
typeof window !== "undefined"
- ? Math.max(VIEWER_WIDTH_MIN, Math.min(VIEWER_WIDTH_MAX, window.innerWidth * 0.7))
+ ? Math.max(
+ VIEWER_WIDTH_MIN,
+ Math.min(VIEWER_WIDTH_MAX, window.innerWidth * 0.7),
+ )
: VIEWER_WIDTH_MAX;
return Math.round(Math.max(VIEWER_WIDTH_MIN, Math.min(px, ceiling)));
}
@@ -112,7 +115,9 @@ function readStoredViewerWidth(): number {
if (typeof window === "undefined") return VIEWER_WIDTH_DEFAULT;
const raw = window.localStorage.getItem(VIEWER_WIDTH_KEY);
const parsed = raw ? Number(raw) : NaN;
- return Number.isFinite(parsed) ? clampViewerWidth(parsed) : VIEWER_WIDTH_DEFAULT;
+ return Number.isFinite(parsed)
+ ? clampViewerWidth(parsed)
+ : VIEWER_WIDTH_DEFAULT;
}
/* ------------------------------------------------------------------ */
@@ -422,7 +427,11 @@ function SessionViewerPanelInner(
if (activeTabId === id) {
// Fall back to the previous tab, or to the Activity home when none
// remain — the panel stays open since the home is always useful.
- setActiveTabId(next.length === 0 ? null : (next[Math.max(0, idx - 1)] ?? next[0]).id);
+ setActiveTabId(
+ next.length === 0
+ ? null
+ : (next[Math.max(0, idx - 1)] ?? next[0]).id,
+ );
}
return next;
});
diff --git a/web/components/chat/home/TracePanels.tsx b/web/components/chat/home/TracePanels.tsx
index e5da35880..2aa7da3c0 100644
--- a/web/components/chat/home/TracePanels.tsx
+++ b/web/components/chat/home/TracePanels.tsx
@@ -153,7 +153,8 @@ function describeToolCall(
t: (key: string, opts?: Record<string, unknown>) => string,
): ToolDescriptor {
const a = args ?? {};
- const str = (value: unknown) => (typeof value === "string" ? value.trim() : "");
+ const str = (value: unknown) =>
+ typeof value === "string" ? value.trim() : "";
const host = (url: string) => {
if (!url) return "";
try {
@@ -267,9 +268,19 @@ function describeToolCall(
mono: false,
};
case "read_memory":
- return { Icon: MemoryMark, verb: t("Recalling memory"), chip: null, mono: false };
+ return {
+ Icon: MemoryMark,
+ verb: t("Recalling memory"),
+ chip: null,
+ mono: false,
+ };
case "write_memory":
- return { Icon: MemoryMark, verb: t("Saving memory"), chip: null, mono: false };
+ return {
+ Icon: MemoryMark,
+ verb: t("Saving memory"),
+ chip: null,
+ mono: false,
+ };
case "reason":
return {
Icon: ReasoningMark,
@@ -306,11 +317,21 @@ function describeToolCall(
mono: false,
};
case "visualize":
- return { Icon: FrameMark, verb: t("Visualizing"), chip: null, mono: false };
+ return {
+ Icon: FrameMark,
+ verb: t("Visualizing"),
+ chip: null,
+ mono: false,
+ };
case "math_animator":
return { Icon: FrameMark, verb: t("Animating"), chip: null, mono: false };
default:
- return { Icon: ToolMark, verb: titleCase(toolName), chip: null, mono: false };
+ return {
+ Icon: ToolMark,
+ verb: titleCase(toolName),
+ chip: null,
+ mono: false,
+ };
}
}
@@ -791,7 +812,8 @@ function LiveFoldRow({
function pickKindIcon(kind: string, phase: string): GlyphComponent {
if (kind === "rag_retrieval") return KnowledgeMark;
if (kind === "tool_planning" || phase === "acting") return CommandMark;
- if (kind === "agent_loop_round" || phase === "exploring") return ReasoningMark;
+ if (kind === "agent_loop_round" || phase === "exploring")
+ return ReasoningMark;
if (kind === "llm_final_response") return ReasoningMark;
if (kind === "llm_observation") return ReasoningMark;
if (kind === "llm_generation" || phase === "writing") return RespondingMark;
@@ -1190,9 +1212,7 @@ function TraceRowItem({
resolvedIcon = KnowledgeMark;
headline = header;
const query = clip(
- String(
- callEvents.map((e) => getTraceMeta(e).query).find(Boolean) || "",
- ),
+ String(callEvents.map((e) => getTraceMeta(e).query).find(Boolean) || ""),
);
chip = query ? { text: query, mono: false } : null;
} else if (isChatRound) {
@@ -2062,10 +2082,12 @@ export function StreamingStatus({
if (mode === "tool_using") modeLabel = t("Tool Calling…");
else if (mode === "planning") modeLabel = t("{{name}} Planning…", { name });
else if (mode === "drafting") modeLabel = t("{{name}} Drafting…", { name });
- else if (mode === "responding") modeLabel = t("{{name}} Responding…", { name });
+ else if (mode === "responding")
+ modeLabel = t("{{name}} Responding…", { name });
else if (mode === "exploring") modeLabel = t("{{name}} Exploring…", { name });
else if (mode === "quizzing") modeLabel = t("{{name}} Quizzing…", { name });
- else if (mode === "reflecting") modeLabel = t("{{name}} Reflecting…", { name });
+ else if (mode === "reflecting")
+ modeLabel = t("{{name}} Reflecting…", { name });
else if (mode === "responded") modeLabel = t("DeepTutor responded.");
const label =
diff --git a/web/components/chat/preview/previewerFor.ts b/web/components/chat/preview/previewerFor.ts
index 49e64422d..c7cb0b35e 100644
--- a/web/components/chat/preview/previewerFor.ts
+++ b/web/components/chat/preview/previewerFor.ts
@@ -49,12 +49,7 @@ const DOCX_EXTS = new Set([".docx", ".docm"]);
const XLSX_EXTS = new Set([".xlsx", ".xlsm"]);
// Office binaries with no reliable browser renderer (PowerPoint, and the
// legacy pre-OOXML formats) — fall back to the extractor's plain text.
-const OFFICE_BINARY_EXTS = new Set([
- ".pptx",
- ".ppt",
- ".doc",
- ".xls",
-]);
+const OFFICE_BINARY_EXTS = new Set([".pptx", ".ppt", ".doc", ".xls"]);
const MARKDOWN_EXTS = new Set([".md", ".markdown", ".rst", ".asciidoc"]);
const PLAIN_TEXT_EXTS = new Set([
".txt",
@@ -105,8 +100,7 @@ export function previewKindFor(source: FilePreviewSource): PreviewKind {
return "docx";
if (
XLSX_EXTS.has(ext) ||
- mime ===
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
+ mime === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
)
return "xlsx";
if (OFFICE_BINARY_EXTS.has(ext)) return "office-text";
diff --git a/web/components/knowledge/KbSettingsSection.tsx b/web/components/knowledge/KbSettingsSection.tsx
index 5bfa5b746..362d1ee54 100644
--- a/web/components/knowledge/KbSettingsSection.tsx
+++ b/web/components/knowledge/KbSettingsSection.tsx
@@ -64,7 +64,7 @@ export default function KbSettingsSection({
{t("Default knowledge base")}
</div>
<p className="mt-0.5 text-[11.5px] text-[var(--muted-foreground)]">
- {t("The default KB is selected automatically in chat & TutorBot.")}
+ {t("The default KB is selected automatically in chat & partners.")}
</p>
</div>
{kb.is_default ? (
diff --git a/web/components/learning/CreateModuleDialog.tsx b/web/components/learning/CreateModuleDialog.tsx
index 309e9b55c..8b5acb71b 100644
--- a/web/components/learning/CreateModuleDialog.tsx
+++ b/web/components/learning/CreateModuleDialog.tsx
@@ -55,7 +55,9 @@ export default function CreateModuleDialog({
// ── Manual ──
const [moduleName, setModuleName] = useState("");
- const [kpRows, setKpRows] = useState<KpRow[]>([{ name: "", type: "concept" }]);
+ const [kpRows, setKpRows] = useState<KpRow[]>([
+ { name: "", type: "concept" },
+ ]);
// ── Book ──
const [books, setBooks] = useState<Book[]>([]);
@@ -69,7 +71,9 @@ export default function CreateModuleDialog({
// ── Notebook ──
const [notebooks, setNotebooks] = useState<NotebookSummary[]>([]);
const [selectedNotebook, setSelectedNotebook] = useState("");
- const [notebookRecords, setNotebookRecords] = useState<NotebookRecordItem[]>([]);
+ const [notebookRecords, setNotebookRecords] = useState<NotebookRecordItem[]>(
+ [],
+ );
const [selectedRecordIds, setSelectedRecordIds] = useState<Set<string>>(
new Set(),
);
@@ -323,12 +327,18 @@ export default function CreateModuleDialog({
}}
className="rounded-md border border-[var(--border)] bg-[var(--background)] px-2 py-1.5 text-xs text-[var(--foreground)] focus:outline-none"
>
- <option value="memory">{t("knowledgeType.memory")}</option>
- <option value="concept">{t("knowledgeType.concept")}</option>
+ <option value="memory">
+ {t("knowledgeType.memory")}
+ </option>
+ <option value="concept">
+ {t("knowledgeType.concept")}
+ </option>
<option value="procedure">
{t("knowledgeType.procedure")}
</option>
- <option value="design">{t("knowledgeType.design")}</option>
+ <option value="design">
+ {t("knowledgeType.design")}
+ </option>
</select>
{kpRows.length > 1 && (
<button
@@ -382,8 +392,8 @@ export default function CreateModuleDialog({
{book.title || book.id}
</div>
<div className="text-xs opacity-70">
- {book.chapter_count ?? 0} {t("masteryPath.chapters")} ·{" "}
- {book.status}
+ {book.chapter_count ?? 0} {t("masteryPath.chapters")}{" "}
+ · {book.status}
</div>
</button>
))}
@@ -475,7 +485,8 @@ export default function CreateModuleDialog({
<div>
<p className="mb-2 text-xs font-medium text-[var(--muted-foreground)]">
{t("masteryPath.selectRecords")} (
- {selectedRecordIds.size} {t("masteryPath.selected")})
+ {selectedRecordIds.size} {t("masteryPath.selected")}
+ )
</p>
<div className="max-h-40 space-y-1 overflow-y-auto">
{notebookRecords.slice(0, 20).map((rec) => (
diff --git a/web/components/learning/ModuleTree.tsx b/web/components/learning/ModuleTree.tsx
index d6ef6a55b..2a60b9765 100644
--- a/web/components/learning/ModuleTree.tsx
+++ b/web/components/learning/ModuleTree.tsx
@@ -51,9 +51,13 @@ function ModuleNode({
}, [isCurrent]);
const total = module.knowledge_points.length;
- const averageMastery = total > 0
- ? module.knowledge_points.reduce((sum, kp) => sum + (masteryLevels[kp.id] ?? 0), 0) / total
- : 0;
+ const averageMastery =
+ total > 0
+ ? module.knowledge_points.reduce(
+ (sum, kp) => sum + (masteryLevels[kp.id] ?? 0),
+ 0,
+ ) / total
+ : 0;
const masteryPercent = Math.round(averageMastery * 100);
return (
diff --git a/web/components/learning/StageContent.tsx b/web/components/learning/StageContent.tsx
index 8b9c9de84..7183a9528 100644
--- a/web/components/learning/StageContent.tsx
+++ b/web/components/learning/StageContent.tsx
@@ -38,7 +38,8 @@ function tryParseJson(text: string): unknown {
function toText(value: unknown): string {
if (value == null) return "";
if (typeof value === "string") return value;
- if (typeof value === "number" || typeof value === "boolean") return String(value);
+ if (typeof value === "number" || typeof value === "boolean")
+ return String(value);
if (Array.isArray(value)) return value.map(toText).join(", ");
return JSON.stringify(value);
}
@@ -50,7 +51,8 @@ function normalizeOptions(raw: unknown): string[] {
// Common shapes: {label, text} / {key, value} / {id, content}
const label = opt.label ?? opt.key ?? opt.id;
const body = opt.text ?? opt.value ?? opt.content ?? opt.option;
- if (label != null && body != null) return `${toText(label)}. ${toText(body)}`;
+ if (label != null && body != null)
+ return `${toText(label)}. ${toText(body)}`;
return toText(body ?? label ?? opt);
}
return toText(opt);
@@ -88,7 +90,10 @@ export function parseStageContent(content: string): StageSegment[] {
// A quiz line is a self-contained JSON object carrying a question.
if (trimmed.startsWith("{") && trimmed.endsWith("}")) {
const parsed = tryParseJson(trimmed);
- if (isJsonObject(parsed) && ("question" in parsed || "question_id" in parsed)) {
+ if (
+ isJsonObject(parsed) &&
+ ("question" in parsed || "question_id" in parsed)
+ ) {
flush();
segments.push({ kind: "quiz", question: parseQuestionPayload(parsed) });
continue;
@@ -128,11 +133,7 @@ function QuestionText({ question }: { question: QuizQuestion }) {
const prompt = fields.question ?? fields.text ?? fields.prompt ?? fields.stem;
if (prompt != null) {
return (
- <MarkdownRenderer
- content={toText(prompt)}
- enableMath
- variant="compact"
- />
+ <MarkdownRenderer content={toText(prompt)} enableMath variant="compact" />
);
}
// Fallback: render any descriptive fields we didn't hide.
@@ -149,7 +150,13 @@ function QuestionText({ question }: { question: QuizQuestion }) {
);
}
-function QuizCard({ question, index }: { question: QuizQuestion; index: number }) {
+function QuizCard({
+ question,
+ index,
+}: {
+ question: QuizQuestion;
+ index: number;
+}) {
const { t } = useTranslation();
return (
<div className="rounded-xl border border-[var(--border)] bg-[var(--card)] p-5 shadow-sm">
@@ -180,11 +187,10 @@ export function StageContent({ content }: { content: string }) {
const segments = parseStageContent(content);
// Precompute the running quiz number per segment so render stays pure
// (no mutable counter reassigned inside the JSX map).
- const quizNumbers = segments.map(
- (seg, i) =>
- seg.kind === "quiz"
- ? segments.slice(0, i).filter((s) => s.kind === "quiz").length
- : -1,
+ const quizNumbers = segments.map((seg, i) =>
+ seg.kind === "quiz"
+ ? segments.slice(0, i).filter((s) => s.kind === "quiz").length
+ : -1,
);
return (
<div className="space-y-4">
diff --git a/web/components/learning/StageRoadmap.tsx b/web/components/learning/StageRoadmap.tsx
index 92f8d8df7..5c2b78e5d 100644
--- a/web/components/learning/StageRoadmap.tsx
+++ b/web/components/learning/StageRoadmap.tsx
@@ -16,7 +16,10 @@ type DisplayStatus = "done" | "active" | "upcoming";
* point loop (explain ↔ feynman_check) repeats internally; the roadmap only
* presents the canonical sequence so the learner sees the whole path.
*/
-export default function StageRoadmap({ stages, currentStage }: StageRoadmapProps) {
+export default function StageRoadmap({
+ stages,
+ currentStage,
+}: StageRoadmapProps) {
const { t } = useTranslation();
const statusFor = (stage: string): DisplayStatus => {
diff --git a/web/components/memory/MemoryL1Workbench.tsx b/web/components/memory/MemoryL1Workbench.tsx
index 41bb9a8df..26395fe1d 100644
--- a/web/components/memory/MemoryL1Workbench.tsx
+++ b/web/components/memory/MemoryL1Workbench.tsx
@@ -42,7 +42,7 @@ const L1_NAV: NavEntry[] = [
{ key: "quiz", icon: ClipboardList, label: "Quiz" },
{ key: "kb", icon: BookOpen, label: "Knowledge base" },
{ key: "book", icon: Library, label: "Book" },
- { key: "tutorbot", icon: Bot, label: "TutorBot" },
+ { key: "tutorbot", icon: Bot, label: "Partner" },
{ key: "cowriter", icon: PenLine, label: "Co-writer" },
];
diff --git a/web/components/memory/MemorySection.tsx b/web/components/memory/MemorySection.tsx
index cba9d8aff..951179148 100644
--- a/web/components/memory/MemorySection.tsx
+++ b/web/components/memory/MemorySection.tsx
@@ -147,7 +147,7 @@ const SURFACE_META: Record<Surface, SurfaceMeta> = {
quiz: { icon: ClipboardList, label: "题库" },
kb: { icon: BookOpen, label: "Knowledge base" },
book: { icon: Library, label: "Book" },
- tutorbot: { icon: Bot, label: "TutorBot" },
+ tutorbot: { icon: Bot, label: "Partner" },
cowriter: { icon: PenLine, label: "Co-writer" },
};
diff --git a/web/components/memory/MemoryWorkbench.tsx b/web/components/memory/MemoryWorkbench.tsx
index ba9b6e6e6..664467b8a 100644
--- a/web/components/memory/MemoryWorkbench.tsx
+++ b/web/components/memory/MemoryWorkbench.tsx
@@ -157,7 +157,7 @@ const L2_NAV: NavEntry[] = [
{ key: "quiz", icon: ClipboardList, label: "Quiz" },
{ key: "kb", icon: BookOpen, label: "Knowledge base" },
{ key: "book", icon: Library, label: "Book" },
- { key: "tutorbot", icon: Bot, label: "TutorBot" },
+ { key: "tutorbot", icon: Bot, label: "Partner" },
{ key: "cowriter", icon: PenLine, label: "Co-writer" },
];
diff --git a/web/components/partners/AssetPicker.tsx b/web/components/partners/AssetPicker.tsx
index 75eb803e2..4617ad01f 100644
--- a/web/components/partners/AssetPicker.tsx
+++ b/web/components/partners/AssetPicker.tsx
@@ -42,8 +42,8 @@ function ChipGroup({
}) {
return (
<div>
- <h4 className="mb-1.5 inline-flex items-center gap-1.5 text-[12px] font-medium text-[var(--muted-foreground)]">
- <Icon className="h-3.5 w-3.5" />
+ <h4 className="mb-1.5 inline-flex items-center gap-1.5 text-[13px] font-medium text-[var(--muted-foreground)]">
+ <Icon className="h-4 w-4" />
{title}
{selected.length > 0 && (
<span className="rounded-full bg-[var(--secondary)] px-1.5 text-[11px] font-medium text-[var(--primary)]">
@@ -52,9 +52,11 @@ function ChipGroup({
)}
</h4>
{options.length === 0 ? (
- <p className="text-[12px] text-[var(--muted-foreground)]">{emptyText}</p>
+ <p className="text-[13px] text-[var(--muted-foreground)]">
+ {emptyText}
+ </p>
) : (
- <div className="flex flex-wrap gap-1.5">
+ <div className="flex flex-wrap gap-2">
{options.map((option) => {
const active = selected.includes(option.id);
return (
@@ -63,7 +65,7 @@ function ChipGroup({
type="button"
onClick={() => onToggle(option.id)}
title={option.hint}
- className={`rounded-full border px-3 py-1 text-[12px] transition-colors ${
+ className={`rounded-full border px-3.5 py-1.5 text-[13px] transition-all duration-150 active:scale-[0.97] ${
active
? "border-[var(--primary)] bg-[var(--secondary)] font-medium text-[var(--primary)]"
: "border-[var(--border)] text-[var(--muted-foreground)] hover:border-[var(--ring)] hover:text-[var(--foreground)]"
@@ -145,7 +147,7 @@ export default function AssetPicker({
if (loading) {
return (
- <p className="text-[12px] text-[var(--muted-foreground)]">
+ <p className="text-[13px] text-[var(--muted-foreground)]">
{t("Loading your library…")}
</p>
);
@@ -163,11 +165,13 @@ export default function AssetPicker({
const visible = (options: Option[], hidden?: string[]) =>
hidden && hidden.length > 0
- ? options.filter((o) => !hidden.includes(o.id) && !hidden.includes(o.label))
+ ? options.filter(
+ (o) => !hidden.includes(o.id) && !hidden.includes(o.label),
+ )
: options;
return (
- <div className="space-y-4">
+ <div className="space-y-5">
<ChipGroup
icon={Database}
title={t("Knowledge bases")}
@@ -192,7 +196,7 @@ export default function AssetPicker({
onToggle={(id) => toggle("notebooks", id)}
emptyText={t("No notebooks available.")}
/>
- <p className="text-[11px] text-[var(--muted-foreground)]">
+ <p className="text-[12px] text-[var(--muted-foreground)]">
{t("Selected items are copied into the partner's private workspace.")}
</p>
</div>
diff --git a/web/components/partners/ChannelIcon.tsx b/web/components/partners/ChannelIcon.tsx
index 42fd5ab50..a047e32d1 100644
--- a/web/components/partners/ChannelIcon.tsx
+++ b/web/components/partners/ChannelIcon.tsx
@@ -203,7 +203,13 @@ function NapCatIcon({ size, className }: { size: number; className: string }) {
}
/** DingTalk's wing mark — Ant Design Icons `dingtalk`. */
-function DingTalkIcon({ size, className }: { size: number; className: string }) {
+function DingTalkIcon({
+ size,
+ className,
+}: {
+ size: number;
+ className: string;
+}) {
return (
<svg
viewBox="0 0 1024 1024"
@@ -229,9 +235,11 @@ export default function ChannelIcon({
}) {
const key = name.toLowerCase();
if (key === "feishu") return <FeishuIcon size={size} className={className} />;
- if (key === "dingtalk") return <DingTalkIcon size={size} className={className} />;
+ if (key === "dingtalk")
+ return <DingTalkIcon size={size} className={className} />;
if (key === "wecom") return <WeComIcon size={size} className={className} />;
- if (key === "msteams") return <MSTeamsIcon size={size} className={className} />;
+ if (key === "msteams")
+ return <MSTeamsIcon size={size} className={className} />;
if (key === "napcat") return <NapCatIcon size={size} className={className} />;
const brand = BRAND_PATHS[key];
if (brand) {
diff --git a/web/components/partners/FaceEditor.tsx b/web/components/partners/FaceEditor.tsx
index dfbff4598..d5d12c46c 100644
--- a/web/components/partners/FaceEditor.tsx
+++ b/web/components/partners/FaceEditor.tsx
@@ -15,9 +15,30 @@ import PartnerAvatar, {
} from "@/components/partners/PartnerAvatar";
export const FACE_EMOJIS = [
- "🦊", "🐳", "🦉", "🐱", "🐶", "🐼", "🐨", "🦁",
- "🐯", "🐸", "🐙", "🦄", "🤖", "👾", "🌱", "🌸",
- "🍀", "🌙", "✨", "🔥", "📚", "🎨", "🎧", "🧭",
+ "🦊",
+ "🐳",
+ "🦉",
+ "🐱",
+ "🐶",
+ "🐼",
+ "🐨",
+ "🦁",
+ "🐯",
+ "🐸",
+ "🐙",
+ "🦄",
+ "🤖",
+ "👾",
+ "🌱",
+ "🌸",
+ "🍀",
+ "🌙",
+ "✨",
+ "🔥",
+ "📚",
+ "🎨",
+ "🎧",
+ "🧭",
] as const;
export interface FaceValue {
@@ -150,7 +171,10 @@ export default function FaceEditor({
type="button"
aria-label={preset}
onClick={() =>
- onChange({ ...value, color: value.color === preset ? "" : preset })
+ onChange({
+ ...value,
+ color: value.color === preset ? "" : preset,
+ })
}
className="flex h-6 w-6 items-center justify-center rounded-full transition-transform hover:scale-110"
style={{ background: preset }}
@@ -177,7 +201,7 @@ export default function FaceEditor({
<button
type="button"
onClick={() => fileInputRef.current?.click()}
- className="inline-flex items-center gap-1.5 rounded-lg border border-[var(--border)] px-3 py-1.5 text-[12px] font-medium text-[var(--foreground)] hover:border-[var(--ring)]"
+ className="inline-flex items-center gap-1.5 rounded-lg border border-[var(--border)] px-3 py-1.5 text-[13px] font-medium text-[var(--foreground)] hover:border-[var(--ring)]"
>
<ImagePlus className="h-3.5 w-3.5" />
{hasImage ? t("Replace photo") : t("Upload photo or SVG")}
@@ -186,7 +210,7 @@ export default function FaceEditor({
<button
type="button"
onClick={() => onChange({ ...value, avatar: "" })}
- className="inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-[12px] text-[var(--muted-foreground)] hover:text-[var(--foreground)]"
+ className="inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-[13px] text-[var(--muted-foreground)] hover:text-[var(--foreground)]"
>
<X className="h-3.5 w-3.5" />
{t("Remove")}
@@ -194,7 +218,7 @@ export default function FaceEditor({
)}
</div>
{uploadError && (
- <p className="text-[11.5px] text-[var(--destructive)]">{uploadError}</p>
+ <p className="text-[12px] text-[var(--destructive)]">{uploadError}</p>
)}
</div>
);
diff --git a/web/components/partners/PartnerArchives.tsx b/web/components/partners/PartnerArchives.tsx
index 7b832af7a..127702b48 100644
--- a/web/components/partners/PartnerArchives.tsx
+++ b/web/components/partners/PartnerArchives.tsx
@@ -43,7 +43,8 @@ export default function PartnerArchives({
const [loadingMessages, setLoadingMessages] = useState(false);
const selected = useMemo(
- () => sessions.find((session) => session.session_key === selectedKey) ?? null,
+ () =>
+ sessions.find((session) => session.session_key === selectedKey) ?? null,
[sessions, selectedKey],
);
@@ -53,7 +54,10 @@ export default function PartnerArchives({
const next = await getPartnerSessions(partnerId);
setSessions(next);
setSelectedKey((current) => {
- if (current && next.some((session) => session.session_key === current)) {
+ if (
+ current &&
+ next.some((session) => session.session_key === current)
+ ) {
return current;
}
return next[0]?.session_key ?? "";
@@ -115,7 +119,9 @@ export default function PartnerArchives({
title={t("Refresh")}
className="inline-flex h-7 w-7 items-center justify-center rounded-md text-[var(--muted-foreground)] hover:bg-[var(--muted)] hover:text-[var(--foreground)] disabled:opacity-40"
>
- <RefreshCw className={`h-3.5 w-3.5 ${loadingSessions ? "animate-spin" : ""}`} />
+ <RefreshCw
+ className={`h-3.5 w-3.5 ${loadingSessions ? "animate-spin" : ""}`}
+ />
</button>
</div>
@@ -170,7 +176,9 @@ export default function PartnerArchives({
<div className="flex items-center justify-between gap-3">
<div>
<h3 className="text-[13px] font-medium text-[var(--foreground)]">
- {selected.archived ? t("Archived conversation") : t("Current conversation")}
+ {selected.archived
+ ? t("Archived conversation")
+ : t("Current conversation")}
</h3>
<p className="text-[11.5px] text-[var(--muted-foreground)]">
{formatTime(selected.updated_at)}
@@ -189,11 +197,18 @@ export default function PartnerArchives({
</p>
) : (
messages
- .filter((message) => message.role === "user" || message.role === "assistant")
+ .filter(
+ (message) =>
+ message.role === "user" || message.role === "assistant",
+ )
.map((message, index) => (
<div
key={`${message.timestamp ?? index}-${index}`}
- className={message.role === "user" ? "flex justify-end" : "flex justify-start"}
+ className={
+ message.role === "user"
+ ? "flex justify-end"
+ : "flex justify-start"
+ }
>
<div
className={`max-w-[78%] whitespace-pre-wrap rounded-lg px-3 py-2 text-[13px] leading-relaxed ${
diff --git a/web/components/partners/PartnerChat.tsx b/web/components/partners/PartnerChat.tsx
index 1450ddbbd..bba0bd109 100644
--- a/web/components/partners/PartnerChat.tsx
+++ b/web/components/partners/PartnerChat.tsx
@@ -14,16 +14,21 @@
import { useCallback, useEffect, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import dynamic from "next/dynamic";
+import { Paperclip } from "lucide-react";
import { wsUrl } from "@/lib/api";
import { getPartnerHistory } from "@/lib/partners-api";
import type { StreamEvent } from "@/lib/unified-ws";
+import { docIconFor, formatBytes, isSvgFilename } from "@/lib/doc-attachments";
import {
isNarrationMarker,
recomputeAnswerContent,
shouldAppendEventContent,
} from "@/lib/stream";
import { AssistantActivity } from "@/components/chat/home/TracePanels";
-import { PartnerComposer } from "@/components/partners/PartnerComposer";
+import {
+ PartnerComposer,
+ type PartnerPendingAttachment,
+} from "@/components/partners/PartnerComposer";
import PartnerAvatar from "@/components/partners/PartnerAvatar";
const AssistantResponse = dynamic(
@@ -34,16 +39,118 @@ const AssistantResponse = dynamic(
interface ChatMsg {
role: "user" | "assistant";
content: string;
+ attachments?: PartnerMessageAttachment[];
/** Full turn event stream (live turns only; restored history has none). */
events?: StreamEvent[];
error?: boolean;
}
+interface PartnerMessageAttachment {
+ type: string;
+ filename: string;
+ mimeType?: string;
+ size?: number;
+ previewUrl?: string;
+}
+
function resetsVisibleConversation(content: string) {
const command = content.trim().split(/\s+/, 1)[0]?.toLowerCase();
return command === "/new" || command === "/clear";
}
+function normalizeHistoryAttachments(
+ value: unknown,
+): PartnerMessageAttachment[] {
+ if (!Array.isArray(value)) return [];
+ return value
+ .map((item): PartnerMessageAttachment | null => {
+ if (!item || typeof item !== "object") return null;
+ const obj = item as Record<string, unknown>;
+ const filename = String(obj.filename || "");
+ if (!filename) return null;
+ const sizeRaw = obj.size;
+ return {
+ type: String(obj.type || "file"),
+ filename,
+ mimeType: String(obj.mime_type || obj.mimeType || ""),
+ size: typeof sizeRaw === "number" ? sizeRaw : undefined,
+ };
+ })
+ .filter((item): item is PartnerMessageAttachment => item !== null);
+}
+
+function sentAttachmentsForMessage(
+ attachments: PartnerPendingAttachment[],
+): PartnerMessageAttachment[] {
+ return attachments.map((item) => ({
+ type: item.type,
+ filename: item.filename,
+ mimeType: item.mimeType,
+ size: item.size,
+ previewUrl: item.previewUrl,
+ }));
+}
+
+function AttachmentStrip({
+ attachments,
+}: {
+ attachments?: PartnerMessageAttachment[];
+}) {
+ if (!attachments?.length) return null;
+ return (
+ <div className="mt-2 flex flex-wrap gap-1.5">
+ {attachments.map((attachment, index) => {
+ if (
+ (attachment.type === "image" || isSvgFilename(attachment.filename)) &&
+ attachment.previewUrl
+ ) {
+ return (
+ <div
+ key={`${attachment.filename}-${index}`}
+ className="h-14 w-14 overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--muted)]/35"
+ title={attachment.filename}
+ >
+ {/* eslint-disable-next-line @next/next/no-img-element */}
+ <img
+ src={attachment.previewUrl}
+ alt={attachment.filename}
+ className={`h-full w-full ${isSvgFilename(attachment.filename) ? "object-contain p-1" : "object-cover"}`}
+ />
+ </div>
+ );
+ }
+
+ const spec = docIconFor(attachment.filename);
+ const Icon = spec.Icon;
+ const sizeLabel = attachment.size ? formatBytes(attachment.size) : "";
+ return (
+ <div
+ key={`${attachment.filename}-${index}`}
+ className="flex max-w-[190px] items-center gap-2 rounded-lg border border-[var(--border)] bg-[var(--card)]/80 px-2 py-1.5"
+ title={attachment.filename}
+ >
+ <div className="flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-[var(--muted)]/60">
+ {attachment.filename ? (
+ <Icon size={15} strokeWidth={1.5} className={spec.tint} />
+ ) : (
+ <Paperclip className="h-3.5 w-3.5 text-[var(--muted-foreground)]" />
+ )}
+ </div>
+ <div className="min-w-0 flex-1">
+ <div className="truncate text-[11px] font-medium text-[var(--foreground)]">
+ {attachment.filename}
+ </div>
+ <div className="truncate text-[9px] uppercase text-[var(--muted-foreground)]">
+ {sizeLabel ? `${spec.label} · ${sizeLabel}` : spec.label}
+ </div>
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ );
+}
+
export default function PartnerChat({
partnerId,
partnerName,
@@ -99,6 +206,9 @@ export default function PartnerChat({
.map((m) => ({
role: m.role as "user" | "assistant",
content: m.content,
+ attachments: normalizeHistoryAttachments(
+ (m as Record<string, unknown>).attachments,
+ ),
})),
);
requestAnimationFrame(() => scrollToBottom("instant"));
@@ -118,7 +228,9 @@ export default function PartnerChat({
// socket handlers can mutate it cheaply; renders see snapshots only.
let live: { events: StreamEvent[]; content: string } | null = null;
const publish = () => {
- setDraft(live ? { events: [...live.events], content: live.content } : null);
+ setDraft(
+ live ? { events: [...live.events], content: live.content } : null,
+ );
};
ws.onmessage = (e) => {
@@ -188,26 +300,47 @@ export default function PartnerChat({
}, [partnerId, scrollToBottom]);
const handleSend = useCallback(
- (content: string) => {
+ (content: string, attachments: PartnerPendingAttachment[]) => {
if (
streaming ||
!wsRef.current ||
wsRef.current.readyState !== WebSocket.OPEN
)
return;
+ const visibleContent =
+ content ||
+ (attachments.every((item) => item.type === "image")
+ ? t("Please analyze the attached image(s).")
+ : t("Please use the attached file(s)."));
wsRef.current.send(
- JSON.stringify({ content, session_id: sessionIdRef.current }),
+ JSON.stringify({
+ content: visibleContent,
+ session_id: sessionIdRef.current,
+ attachments: attachments.map((item) => ({
+ type: item.type,
+ filename: item.filename,
+ base64: item.base64,
+ mime_type: item.mimeType,
+ })),
+ }),
);
- if (resetsVisibleConversation(content)) {
+ if (resetsVisibleConversation(visibleContent)) {
setMessages([]);
} else {
- setMessages((msgs) => [...msgs, { role: "user", content }]);
+ setMessages((msgs) => [
+ ...msgs,
+ {
+ role: "user",
+ content: visibleContent,
+ attachments: sentAttachmentsForMessage(attachments),
+ },
+ ]);
}
setDraft({ events: [], content: "" });
setStreaming(true);
scrollToBottom();
},
- [streaming, scrollToBottom],
+ [streaming, scrollToBottom, t],
);
return (
@@ -215,13 +348,21 @@ export default function PartnerChat({
<div ref={scrollRef} className="min-h-0 flex-1 overflow-y-auto px-1 py-4">
{messages.length === 0 && !draft ? (
<div className="flex h-full flex-col items-center justify-center gap-3 text-center">
- <PartnerAvatar name={partnerName} emoji={emoji} color={color} image={avatar} size={56} />
+ <PartnerAvatar
+ name={partnerName}
+ emoji={emoji}
+ color={color}
+ image={avatar}
+ size={56}
+ />
<div>
<p className="text-[15px] font-medium text-[var(--foreground)]">
{partnerName}
</p>
<p className="mt-1 max-w-sm text-[12.5px] text-[var(--muted-foreground)]">
- {t("Say hello — this conversation shares the same memory your partner has on its connected channels.")}
+ {t(
+ "Say hello — this conversation shares the same memory your partner has on its connected channels.",
+ )}
</p>
</div>
</div>
@@ -230,8 +371,11 @@ export default function PartnerChat({
{messages.map((msg, i) =>
msg.role === "user" ? (
<div key={i} className="flex justify-end">
- <div className="max-w-[75%] whitespace-pre-wrap rounded-2xl bg-[var(--secondary)] px-4 py-2.5 text-[14px] leading-relaxed text-[var(--foreground)] shadow-sm">
- {msg.content}
+ <div className="max-w-[75%] rounded-2xl bg-[var(--secondary)] px-4 py-2.5 text-[14px] leading-relaxed text-[var(--foreground)] shadow-sm">
+ {msg.content ? (
+ <div className="whitespace-pre-wrap">{msg.content}</div>
+ ) : null}
+ <AttachmentStrip attachments={msg.attachments} />
</div>
</div>
) : (
@@ -300,7 +444,10 @@ export default function PartnerChat({
{t("Connecting…")}
</p>
)}
- <PartnerComposer onSend={handleSend} disabled={streaming || !connected} />
+ <PartnerComposer
+ onSend={handleSend}
+ disabled={streaming || !connected}
+ />
</div>
</div>
);
diff --git a/web/components/partners/PartnerComposer.tsx b/web/components/partners/PartnerComposer.tsx
index 08c1c055d..568f01d1c 100644
--- a/web/components/partners/PartnerComposer.tsx
+++ b/web/components/partners/PartnerComposer.tsx
@@ -1,41 +1,154 @@
"use client";
/**
- * Compact composer for partner chat — a chat-style rounded card: full-width
- * auto-sizing textarea with an inline send button. (SimpleComposerInput is a
- * bare `flex-1` textarea that collapses outside a flex row; this owns its
- * own shell instead.)
+ * Compact composer for partner chat. Keeps the partner surface focused while
+ * supporting the same file intake paths users expect in the main chat:
+ * picker, paste, and drag/drop.
*/
import { memo, useCallback, useRef, useState } from "react";
-import { ArrowUp } from "lucide-react";
+import { ArrowUp, Paperclip, X } from "lucide-react";
import { useTranslation } from "react-i18next";
import { shouldSubmitOnEnter } from "@/lib/composer-keyboard";
+import {
+ ATTACHMENT_ACCEPT,
+ MAX_ATTACHMENT_BYTES,
+ MAX_TOTAL_ATTACHMENT_BYTES,
+ classifyFile,
+ docIconFor,
+ formatBytes,
+ isSvgFilename,
+} from "@/lib/doc-attachments";
+import {
+ extractBase64FromDataUrl,
+ readFileAsDataUrl,
+} from "@/lib/file-attachments";
import { useAutoSizedTextarea } from "@/lib/use-auto-sized-textarea";
+export interface PartnerPendingAttachment {
+ type: "image" | "file";
+ filename: string;
+ base64: string;
+ previewUrl?: string;
+ size: number;
+ mimeType?: string;
+}
+
export const PartnerComposer = memo(function PartnerComposer({
onSend,
disabled,
placeholder,
}: {
- onSend: (content: string) => void;
+ onSend: (content: string, attachments: PartnerPendingAttachment[]) => void;
disabled?: boolean;
placeholder?: string;
}) {
const { t } = useTranslation();
const [input, setInput] = useState("");
+ const [attachments, setAttachments] = useState<PartnerPendingAttachment[]>(
+ [],
+ );
+ const [dragging, setDragging] = useState(false);
+ const [attachmentError, setAttachmentError] = useState<string | null>(null);
const textareaRef = useRef<HTMLTextAreaElement | null>(null);
+ const fileInputRef = useRef<HTMLInputElement | null>(null);
+ const dragCounterRef = useRef(0);
+ const errorTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const isComposingRef = useRef(false);
useAutoSizedTextarea(textareaRef, input, { min: 24, max: 180 });
+ const showAttachmentError = useCallback((message: string) => {
+ setAttachmentError(message);
+ if (errorTimerRef.current) clearTimeout(errorTimerRef.current);
+ errorTimerRef.current = setTimeout(() => {
+ setAttachmentError(null);
+ errorTimerRef.current = null;
+ }, 4000);
+ }, []);
+
+ const filterFiles = useCallback(
+ (files: File[]) => {
+ let runningTotal = attachments.reduce((sum, item) => sum + item.size, 0);
+ const accepted: File[] = [];
+ const rejected: {
+ name: string;
+ reason: "unsupported" | "too_large" | "quota";
+ }[] = [];
+
+ for (const file of files) {
+ if (!classifyFile(file)) {
+ rejected.push({ name: file.name, reason: "unsupported" });
+ continue;
+ }
+ if (file.size > MAX_ATTACHMENT_BYTES) {
+ rejected.push({ name: file.name, reason: "too_large" });
+ continue;
+ }
+ if (runningTotal + file.size > MAX_TOTAL_ATTACHMENT_BYTES) {
+ rejected.push({ name: file.name, reason: "quota" });
+ break;
+ }
+ runningTotal += file.size;
+ accepted.push(file);
+ }
+
+ if (rejected.length) {
+ const first = rejected[0];
+ if (first.reason === "too_large") {
+ showAttachmentError(
+ t("File too large: {{name}}", { name: first.name }),
+ );
+ } else if (first.reason === "quota") {
+ showAttachmentError(t("Too many files, skipped some"));
+ } else {
+ showAttachmentError(
+ t("Unsupported file type: {{name}}", { name: first.name }),
+ );
+ }
+ }
+
+ return accepted;
+ },
+ [attachments, showAttachmentError, t],
+ );
+
+ const fileToAttachment = useCallback(
+ async (file: File): Promise<PartnerPendingAttachment> => {
+ const raw = await readFileAsDataUrl(file);
+ const svg = isSvgFilename(file.name) || file.type === "image/svg+xml";
+ const isImage = !svg && file.type.startsWith("image/");
+ return {
+ type: isImage ? "image" : "file",
+ filename: file.name,
+ base64: extractBase64FromDataUrl(raw),
+ previewUrl: isImage || svg ? raw : undefined,
+ size: file.size,
+ mimeType: file.type || undefined,
+ };
+ },
+ [],
+ );
+
+ const addFiles = useCallback(
+ async (files: File[]) => {
+ if (disabled) return;
+ const accepted = filterFiles(files);
+ if (!accepted.length) return;
+ const next = await Promise.all(accepted.map(fileToAttachment));
+ setAttachments((prev) => [...prev, ...next]);
+ },
+ [disabled, fileToAttachment, filterFiles],
+ );
+
const submit = useCallback(() => {
const content = input.trim();
- if (!content || disabled) return;
- onSend(content);
+ if ((!content && attachments.length === 0) || disabled) return;
+ onSend(content, attachments);
setInput("");
+ setAttachments([]);
requestAnimationFrame(() => textareaRef.current?.focus());
- }, [input, disabled, onSend]);
+ }, [attachments, disabled, input, onSend]);
const handleKeyDown = useCallback(
(e: React.KeyboardEvent<HTMLTextAreaElement>) => {
@@ -47,19 +160,123 @@ export const PartnerComposer = memo(function PartnerComposer({
[submit],
);
+ const handlePaste = useCallback(
+ async (event: React.ClipboardEvent<HTMLTextAreaElement>) => {
+ const files = Array.from(event.clipboardData.items)
+ .filter((item) => item.kind === "file")
+ .map((item) => item.getAsFile())
+ .filter((file): file is File => file !== null);
+ if (!files.length) return;
+ event.preventDefault();
+ await addFiles(files);
+ },
+ [addFiles],
+ );
+
+ const handleDragEnter = useCallback(
+ (event: React.DragEvent<HTMLDivElement>) => {
+ event.preventDefault();
+ event.stopPropagation();
+ dragCounterRef.current += 1;
+ if (event.dataTransfer.types.includes("Files")) setDragging(true);
+ },
+ [],
+ );
+
+ const handleDragLeave = useCallback(
+ (event: React.DragEvent<HTMLDivElement>) => {
+ event.preventDefault();
+ event.stopPropagation();
+ dragCounterRef.current -= 1;
+ if (dragCounterRef.current <= 0) {
+ dragCounterRef.current = 0;
+ setDragging(false);
+ }
+ },
+ [],
+ );
+
+ const handleDragOver = useCallback(
+ (event: React.DragEvent<HTMLDivElement>) => {
+ event.preventDefault();
+ event.stopPropagation();
+ },
+ [],
+ );
+
+ const handleDrop = useCallback(
+ async (event: React.DragEvent<HTMLDivElement>) => {
+ event.preventDefault();
+ event.stopPropagation();
+ dragCounterRef.current = 0;
+ setDragging(false);
+ await addFiles(Array.from(event.dataTransfer.files));
+ },
+ [addFiles],
+ );
+
+ const handleFileInputChange = useCallback(
+ (event: React.ChangeEvent<HTMLInputElement>) => {
+ const picked = Array.from(event.target.files ?? []);
+ if (picked.length) void addFiles(picked);
+ event.target.value = "";
+ },
+ [addFiles],
+ );
+
+ const removeAttachment = useCallback((index: number) => {
+ setAttachments((prev) => prev.filter((_, i) => i !== index));
+ }, []);
+
+ const canSend = (!!input.trim() || attachments.length > 0) && !disabled;
+
return (
- <div className="rounded-2xl border border-[var(--border)] bg-[var(--card)] shadow-sm transition-colors focus-within:border-[var(--ring)]">
+ <div
+ className={`relative rounded-2xl border bg-[var(--card)] shadow-sm transition-colors focus-within:border-[var(--ring)] ${
+ dragging
+ ? "border-[var(--primary)] bg-[var(--primary)]/[0.03]"
+ : "border-[var(--border)]"
+ }`}
+ onDragEnter={handleDragEnter}
+ onDragLeave={handleDragLeave}
+ onDragOver={handleDragOver}
+ onDrop={handleDrop}
+ >
+ {dragging && (
+ <div className="pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-2xl border-2 border-dashed border-[var(--primary)]/50 bg-[var(--primary)]/[0.04] backdrop-blur-[1px]">
+ <div className="flex flex-col items-center gap-1 text-[var(--primary)]">
+ <Paperclip className="h-5 w-5" strokeWidth={1.7} />
+ <span className="text-[13px] font-medium">
+ {t("Drop files here")}
+ </span>
+ <span className="text-[11px] text-[var(--primary)]/70">
+ {t("Images, Office docs, code & text")}
+ </span>
+ </div>
+ </div>
+ )}
+
+ <input
+ ref={fileInputRef}
+ type="file"
+ multiple
+ accept={ATTACHMENT_ACCEPT}
+ onChange={handleFileInputChange}
+ className="hidden"
+ aria-hidden="true"
+ tabIndex={-1}
+ />
+
<textarea
ref={textareaRef}
value={input}
onChange={(e) => setInput(e.target.value)}
onKeyDown={handleKeyDown}
+ onPaste={handlePaste}
onCompositionStart={() => {
isComposingRef.current = true;
}}
onCompositionEnd={() => {
- // Some IMEs fire compositionend before the confirming Enter
- // keydown — keep the guard through the current event turn.
setTimeout(() => {
isComposingRef.current = false;
}, 0);
@@ -70,11 +287,96 @@ export const PartnerComposer = memo(function PartnerComposer({
disabled={disabled}
className="block w-full resize-none bg-transparent px-3.5 pt-3 pb-1 text-[14px] leading-relaxed text-[var(--foreground)] outline-none placeholder:text-[var(--muted-foreground)] disabled:opacity-50"
/>
- <div className="flex items-center justify-end px-2 pb-2">
+
+ {!!attachments.length && (
+ <div className="flex flex-wrap gap-2 px-3.5 pb-2">
+ {attachments.map((attachment, index) => {
+ const removeLabel = t("Remove attachment");
+ if (
+ (attachment.type === "image" ||
+ isSvgFilename(attachment.filename)) &&
+ attachment.previewUrl
+ ) {
+ return (
+ <div
+ key={`${attachment.filename}-${index}`}
+ className="group relative"
+ >
+ <div className="h-14 w-14 overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--muted)]/35">
+ {/* eslint-disable-next-line @next/next/no-img-element */}
+ <img
+ src={attachment.previewUrl}
+ alt={attachment.filename || t("Attachment preview")}
+ className={`h-full w-full ${isSvgFilename(attachment.filename) ? "object-contain p-1" : "object-cover"}`}
+ />
+ </div>
+ <button
+ type="button"
+ onClick={() => removeAttachment(index)}
+ aria-label={removeLabel}
+ className="absolute -right-1.5 -top-1.5 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--foreground)] text-[var(--background)] opacity-0 shadow-sm transition-opacity group-hover:opacity-100"
+ >
+ <X className="h-2.5 w-2.5" />
+ </button>
+ </div>
+ );
+ }
+
+ const spec = docIconFor(attachment.filename);
+ const Icon = spec.Icon;
+ return (
+ <div
+ key={`${attachment.filename}-${index}`}
+ className="group relative"
+ >
+ <div className="flex h-14 w-[150px] items-center gap-2 rounded-lg border border-[var(--border)] bg-[var(--card)] px-2 text-left">
+ <div className="flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-[var(--muted)]/60">
+ <Icon size={19} strokeWidth={1.5} className={spec.tint} />
+ </div>
+ <div className="min-w-0 flex-1">
+ <div className="truncate text-[12px] font-medium text-[var(--foreground)]">
+ {attachment.filename}
+ </div>
+ <div className="truncate text-[10px] uppercase text-[var(--muted-foreground)]">
+ {spec.label} · {formatBytes(attachment.size)}
+ </div>
+ </div>
+ </div>
+ <button
+ type="button"
+ onClick={() => removeAttachment(index)}
+ aria-label={removeLabel}
+ className="absolute -right-1.5 -top-1.5 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--foreground)] text-[var(--background)] opacity-0 shadow-sm transition-opacity group-hover:opacity-100"
+ >
+ <X className="h-2.5 w-2.5" />
+ </button>
+ </div>
+ );
+ })}
+ </div>
+ )}
+
+ {attachmentError && (
+ <div className="px-3.5 pb-2 text-[11px] text-red-600">
+ {attachmentError}
+ </div>
+ )}
+
+ <div className="flex items-center justify-between px-2 pb-2">
+ <button
+ type="button"
+ onClick={() => fileInputRef.current?.click()}
+ disabled={disabled}
+ aria-label={t("Attach files")}
+ title={t("Attach files")}
+ className="flex h-7 w-7 items-center justify-center rounded-full text-[var(--muted-foreground)] transition-colors hover:bg-[var(--muted)] hover:text-[var(--foreground)] disabled:opacity-30"
+ >
+ <Paperclip className="h-4 w-4" strokeWidth={1.9} />
+ </button>
<button
type="button"
onClick={submit}
- disabled={disabled || !input.trim()}
+ disabled={!canSend}
aria-label={t("Send")}
className="flex h-7 w-7 items-center justify-center rounded-full bg-[var(--primary)] text-[var(--primary-foreground)] transition-opacity hover:opacity-90 disabled:opacity-30"
>
diff --git a/web/components/partners/PartnerConfigure.tsx b/web/components/partners/PartnerConfigure.tsx
index 6a70ebe9e..7ca5cfe7c 100644
--- a/web/components/partners/PartnerConfigure.tsx
+++ b/web/components/partners/PartnerConfigure.tsx
@@ -10,10 +10,7 @@ import { useCallback, useEffect, useMemo, useState } from "react";
import { Loader2, Plus, Save, Trash2, X } from "lucide-react";
import { useTranslation } from "react-i18next";
import PartnerModelSelect from "@/components/partners/PartnerModelSelect";
-import {
- listLLMOptions,
- type LLMOption,
-} from "@/lib/llm-options";
+import { listLLMOptions, type LLMOption } from "@/lib/llm-options";
import type { LLMSelection } from "@/lib/unified-ws";
import {
addPartnerAssets,
@@ -32,6 +29,7 @@ import AssetPicker, {
} from "@/components/partners/AssetPicker";
import ToolPicker from "@/components/partners/ToolPicker";
import FaceEditor, { type FaceValue } from "@/components/partners/FaceEditor";
+import SoulEditor from "@/components/partners/SoulEditor";
function Section({
title,
@@ -48,7 +46,9 @@ function Section({
<section className="rounded-xl border border-[var(--border)] p-4">
<div className="mb-3 flex items-start justify-between gap-3">
<div>
- <h3 className="text-[13px] font-medium text-[var(--foreground)]">{title}</h3>
+ <h3 className="text-[13px] font-medium text-[var(--foreground)]">
+ {title}
+ </h3>
{description && (
<p className="mt-0.5 text-[11.5px] text-[var(--muted-foreground)]">
{description}
@@ -92,7 +92,9 @@ export default function PartnerConfigure({
// Model
const [llmOptions, setLLMOptions] = useState<LLMOption[]>([]);
- const [activeLLMDefault, setActiveLLMDefault] = useState<LLMSelection | null>(null);
+ const [activeLLMDefault, setActiveLLMDefault] = useState<LLMSelection | null>(
+ null,
+ );
const [llmLoading, setLLMLoading] = useState(true);
const [llmError, setLLMError] = useState(false);
const [selection, setSelection] = useState<LLMSelection | null>(
@@ -125,7 +127,9 @@ export default function PartnerConfigure({
setSoulLoaded(true);
})
.catch(() => setSoulLoaded(true));
- void getPartnerAssets(partnerId).then(setAssets).catch(() => {});
+ void getPartnerAssets(partnerId)
+ .then(setAssets)
+ .catch(() => {});
void (async () => {
try {
const payload = await listLLMOptions();
@@ -308,7 +312,9 @@ export default function PartnerConfigure({
>
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
<div>
- <label className="mb-1 block text-[12px] font-medium">{t("Name")}</label>
+ <label className="mb-1 block text-[12px] font-medium">
+ {t("Name")}
+ </label>
<input
value={name}
onChange={(e) => setName(e.target.value)}
@@ -340,7 +346,9 @@ export default function PartnerConfigure({
/>
</div>
<div className="sm:col-span-2 mt-1">
- <span className="mb-2 block text-[12px] font-medium">{t("Face")}</span>
+ <span className="mb-2 block text-[12px] font-medium">
+ {t("Face")}
+ </span>
<FaceEditor name={name} value={face} onChange={setFace} />
</div>
</div>
@@ -348,7 +356,9 @@ export default function PartnerConfigure({
<Section
title={t("Soul")}
- description={t("The partner's persona — injected into every conversation.")}
+ description={t(
+ "The partner's persona — injected into every conversation.",
+ )}
action={
<button
type="button"
@@ -365,17 +375,14 @@ export default function PartnerConfigure({
</button>
}
>
- <textarea
- value={soul}
- onChange={(e) => setSoul(e.target.value)}
- rows={10}
- className="w-full rounded-xl border border-[var(--border)] bg-transparent px-3.5 py-3 font-mono text-[12.5px] leading-relaxed outline-none focus:border-[var(--ring)]"
- />
+ <SoulEditor value={soul} onChange={setSoul} heightClass="h-[280px]" />
</Section>
<Section
title={t("Model")}
- description={t("The primary model answers every turn; if it fails outright, the turn is retried once on the backup.")}
+ description={t(
+ "The primary model answers every turn; if it fails outright, the turn is retried once on the backup.",
+ )}
>
<div className="max-w-md space-y-3">
<div>
@@ -440,7 +447,9 @@ export default function PartnerConfigure({
<Section
title={t("Library")}
- description={t("Knowledge bases, skills, and notebooks copied into this partner's workspace.")}
+ description={t(
+ "Knowledge bases, skills, and notebooks copied into this partner's workspace.",
+ )}
action={
<button
type="button"
@@ -462,7 +471,8 @@ export default function PartnerConfigure({
value={pendingAssets}
onChange={setPendingAssets}
excluded={{
- knowledge_bases: assets?.knowledge_bases.map((kb) => kb.name) ?? [],
+ knowledge_bases:
+ assets?.knowledge_bases.map((kb) => kb.name) ?? [],
skills: assets?.skills.map((skill) => skill.name) ?? [],
notebooks: assets?.notebooks.map((nb) => nb.id) ?? [],
}}
@@ -486,7 +496,9 @@ export default function PartnerConfigure({
{assetRows.length === 0 ? (
<p className="text-[12.5px] text-[var(--muted-foreground)]">
- {t("Nothing assigned yet — this partner only knows what you tell it.")}
+ {t(
+ "Nothing assigned yet — this partner only knows what you tell it.",
+ )}
</p>
) : (
<ul className="divide-y divide-[var(--border)]">
diff --git a/web/components/partners/PartnerModelPicker.tsx b/web/components/partners/PartnerModelPicker.tsx
index e003d7d8e..d68fd8254 100644
--- a/web/components/partners/PartnerModelPicker.tsx
+++ b/web/components/partners/PartnerModelPicker.tsx
@@ -7,7 +7,11 @@
import { Check, Loader2 } from "lucide-react";
import { useTranslation } from "react-i18next";
-import { llmSelectionKey, sameLLMSelection, type LLMOption } from "@/lib/llm-options";
+import {
+ llmSelectionKey,
+ sameLLMSelection,
+ type LLMOption,
+} from "@/lib/llm-options";
import type { LLMSelection } from "@/lib/unified-ws";
function formatContext(tokens?: number): string {
@@ -41,17 +45,17 @@ function Row({
}`}
>
<span className="min-w-0 flex-1">
- <span className="block truncate text-[13px] font-medium text-[var(--foreground)]">
+ <span className="block truncate text-[13.5px] font-medium text-[var(--foreground)]">
{title}
</span>
{subtitle && (
- <span className="block truncate text-[11px] text-[var(--muted-foreground)]">
+ <span className="block truncate text-[11.5px] text-[var(--muted-foreground)]">
{subtitle}
</span>
)}
</span>
{trailing && (
- <span className="shrink-0 text-[11px] text-[var(--muted-foreground)]">
+ <span className="shrink-0 text-[11.5px] text-[var(--muted-foreground)]">
{trailing}
</span>
)}
@@ -87,7 +91,7 @@ export default function PartnerModelPicker({
if (loading) {
return (
- <div className="flex items-center gap-2 py-2 text-[12px] text-[var(--muted-foreground)]">
+ <div className="flex items-center gap-2 py-2 text-[13px] text-[var(--muted-foreground)]">
<Loader2 className="h-3.5 w-3.5 animate-spin" />
{t("Loading models…")}
</div>
@@ -95,8 +99,10 @@ export default function PartnerModelPicker({
}
if (error) {
return (
- <p className="text-[12px] text-[var(--muted-foreground)]">
- {t("Could not load the model catalog — the partner will use the system default.")}
+ <p className="text-[13px] text-[var(--muted-foreground)]">
+ {t(
+ "Could not load the model catalog — the partner will use the system default.",
+ )}
</p>
);
}
@@ -112,7 +118,9 @@ export default function PartnerModelPicker({
<div className="max-h-[340px] space-y-1.5 overflow-y-auto pr-1">
<Row
title={t("System default")}
- subtitle={defaultDetail ?? t("Follows whatever the system default model is.")}
+ subtitle={
+ defaultDetail ?? t("Follows whatever the system default model is.")
+ }
selected={value === null}
onClick={() => onChange(null)}
/>
@@ -123,11 +131,16 @@ export default function PartnerModelPicker({
subtitle={`${option.provider_label || option.provider} · ${option.profile_name}`}
trailing={formatContext(option.context_window)}
selected={value !== null && sameLLMSelection(option, value)}
- onClick={() => onChange({ profile_id: option.profile_id, model_id: option.model_id })}
+ onClick={() =>
+ onChange({
+ profile_id: option.profile_id,
+ model_id: option.model_id,
+ })
+ }
/>
))}
{options.length === 0 && (
- <p className="py-1 text-[12px] text-[var(--muted-foreground)]">
+ <p className="py-1 text-[13px] text-[var(--muted-foreground)]">
{t("No models configured yet — add providers in Settings → LLM.")}
</p>
)}
diff --git a/web/components/partners/PartnerModelSelect.tsx b/web/components/partners/PartnerModelSelect.tsx
index 7d34dfa03..e3ec43dfd 100644
--- a/web/components/partners/PartnerModelSelect.tsx
+++ b/web/components/partners/PartnerModelSelect.tsx
@@ -10,7 +10,11 @@
import { useEffect, useRef, useState } from "react";
import { Check, ChevronDown, Loader2 } from "lucide-react";
import { useTranslation } from "react-i18next";
-import { llmSelectionKey, sameLLMSelection, type LLMOption } from "@/lib/llm-options";
+import {
+ llmSelectionKey,
+ sameLLMSelection,
+ type LLMOption,
+} from "@/lib/llm-options";
import type { LLMSelection } from "@/lib/unified-ws";
function formatContext(tokens?: number): string {
@@ -56,7 +60,7 @@ export default function PartnerModelSelect({
if (loading) {
return (
- <div className="flex items-center gap-2 rounded-xl border border-[var(--border)] px-3.5 py-2.5 text-[12.5px] text-[var(--muted-foreground)]">
+ <div className="flex items-center gap-2 rounded-xl border border-[var(--border)] px-3.5 py-2.5 text-[13.5px] text-[var(--muted-foreground)]">
<Loader2 className="h-3.5 w-3.5 animate-spin" />
{t("Loading models…")}
</div>
@@ -64,8 +68,10 @@ export default function PartnerModelSelect({
}
if (error) {
return (
- <p className="text-[12px] text-[var(--muted-foreground)]">
- {t("Could not load the model catalog — the partner will use the system default.")}
+ <p className="text-[13px] text-[var(--muted-foreground)]">
+ {t(
+ "Could not load the model catalog — the partner will use the system default.",
+ )}
</p>
);
}
@@ -78,7 +84,9 @@ export default function PartnerModelSelect({
: undefined;
const currentTitle = value
- ? (current ? current.model_name || current.model : value.model_id)
+ ? current
+ ? current.model_name || current.model
+ : value.model_id
: noneLabel;
const currentSubtitle = value
? current
@@ -106,11 +114,11 @@ export default function PartnerModelSelect({
}`}
>
<span className="min-w-0 flex-1">
- <span className="block truncate text-[13px] font-medium text-[var(--foreground)]">
+ <span className="block truncate text-[13.5px] font-medium text-[var(--foreground)]">
{currentTitle}
</span>
{currentSubtitle && (
- <span className="block truncate text-[11px] text-[var(--muted-foreground)]">
+ <span className="block truncate text-[11.5px] text-[var(--muted-foreground)]">
{currentSubtitle}
</span>
)}
@@ -138,12 +146,15 @@ export default function PartnerModelSelect({
trailing={formatContext(option.context_window)}
selected={value !== null && sameLLMSelection(option, value)}
onClick={() =>
- select({ profile_id: option.profile_id, model_id: option.model_id })
+ select({
+ profile_id: option.profile_id,
+ model_id: option.model_id,
+ })
}
/>
))}
{options.length === 0 && (
- <p className="px-3 py-2 text-[12px] text-[var(--muted-foreground)]">
+ <p className="px-3 py-2 text-[13px] text-[var(--muted-foreground)]">
{t("No models configured yet — add providers in Settings → LLM.")}
</p>
)}
@@ -175,17 +186,23 @@ function DropdownRow({
}`}
>
<span className="min-w-0 flex-1">
- <span className="block truncate text-[13px] text-[var(--foreground)]">{title}</span>
+ <span className="block truncate text-[13.5px] text-[var(--foreground)]">
+ {title}
+ </span>
{subtitle && (
- <span className="block truncate text-[11px] text-[var(--muted-foreground)]">
+ <span className="block truncate text-[11.5px] text-[var(--muted-foreground)]">
{subtitle}
</span>
)}
</span>
{trailing && (
- <span className="shrink-0 text-[11px] text-[var(--muted-foreground)]">{trailing}</span>
+ <span className="shrink-0 text-[11.5px] text-[var(--muted-foreground)]">
+ {trailing}
+ </span>
+ )}
+ {selected && (
+ <Check className="h-3.5 w-3.5 shrink-0 text-[var(--primary)]" />
)}
- {selected && <Check className="h-3.5 w-3.5 shrink-0 text-[var(--primary)]" />}
</button>
);
}
diff --git a/web/components/partners/SoulEditor.tsx b/web/components/partners/SoulEditor.tsx
new file mode 100644
index 000000000..9cf03f9f5
--- /dev/null
+++ b/web/components/partners/SoulEditor.tsx
@@ -0,0 +1,101 @@
+"use client";
+
+/**
+ * Soul markdown editor with an edit/preview toggle, shared by the creation
+ * wizard (SoulPicker) and the Configure tab. Styled as a quiet "file card":
+ * a SOUL.md chrome strip with an iOS-style sliding segmented control, and a
+ * fixed-height body so toggling never shifts the layout.
+ */
+
+import { useState } from "react";
+import { useTranslation } from "react-i18next";
+import { Eye, PencilLine } from "lucide-react";
+import MarkdownRenderer from "@/components/common/MarkdownRenderer";
+
+type Mode = "edit" | "preview";
+
+export default function SoulEditor({
+ value,
+ onChange,
+ placeholder,
+ heightClass = "h-[320px]",
+}: {
+ value: string;
+ onChange: (next: string) => void;
+ placeholder?: string;
+ heightClass?: string;
+}) {
+ const { t } = useTranslation();
+ const [mode, setMode] = useState<Mode>("edit");
+
+ const segments: { key: Mode; label: string; icon: typeof PencilLine }[] = [
+ { key: "edit", label: t("Edit"), icon: PencilLine },
+ { key: "preview", label: t("Preview"), icon: Eye },
+ ];
+
+ return (
+ <div className="overflow-hidden rounded-xl border border-[var(--border)] bg-[var(--background)] transition-colors focus-within:border-[var(--ring)]">
+ <div className="flex items-center justify-between border-b border-[var(--border)] bg-[var(--muted)]/40 py-1.5 pl-4 pr-1.5">
+ <span className="font-mono text-[11px] tracking-wide text-[var(--muted-foreground)]">
+ SOUL.md
+ </span>
+ <div className="relative grid grid-cols-2 rounded-lg bg-[var(--muted)] p-0.5">
+ <span
+ aria-hidden
+ className={`pointer-events-none absolute bottom-0.5 left-0.5 top-0.5 w-[calc(50%-2px)] rounded-[6px] bg-[var(--background)] shadow-sm transition-transform duration-200 ease-out ${
+ mode === "preview" ? "translate-x-full" : ""
+ }`}
+ />
+ {segments.map(({ key, label, icon: Icon }) => (
+ <button
+ key={key}
+ type="button"
+ onClick={() => setMode(key)}
+ onMouseDown={(e) => e.preventDefault()}
+ aria-pressed={mode === key}
+ className={`relative z-[1] inline-flex items-center justify-center gap-1.5 rounded-[6px] px-3 py-1 text-[12px] transition-colors duration-200 ${
+ mode === key
+ ? "font-medium text-[var(--foreground)]"
+ : "text-[var(--muted-foreground)] hover:text-[var(--foreground)]"
+ }`}
+ >
+ <Icon className="h-3.5 w-3.5" />
+ {label}
+ </button>
+ ))}
+ </div>
+ </div>
+
+ {mode === "edit" ? (
+ <textarea
+ value={value}
+ onChange={(e) => onChange(e.target.value)}
+ placeholder={
+ placeholder ??
+ t(
+ "# Soul\nDescribe who this partner is, how it speaks, what it values…",
+ )
+ }
+ spellCheck={false}
+ className={`block w-full resize-none bg-transparent px-4 py-3.5 font-mono text-[13px] leading-[1.7] text-[var(--foreground)] outline-none placeholder:text-[var(--muted-foreground)]/60 ${heightClass}`}
+ />
+ ) : (
+ <div
+ className={`overflow-y-auto px-5 py-4 animate-fade-in ${heightClass}`}
+ >
+ {value.trim() ? (
+ <MarkdownRenderer
+ content={value}
+ variant="compact"
+ className="!font-sans"
+ />
+ ) : (
+ <p className="text-[13px] italic text-[var(--muted-foreground)]">
+ {t("Nothing to preview yet.")}
+ </p>
+ )}
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/web/components/partners/SoulPicker.tsx b/web/components/partners/SoulPicker.tsx
index 89269a85b..6e14064d4 100644
--- a/web/components/partners/SoulPicker.tsx
+++ b/web/components/partners/SoulPicker.tsx
@@ -2,20 +2,29 @@
/**
* Soul source selector for the creation wizard: start from the library, clone
- * one of the chat personas, or write a custom soul. Always shows a live
- * preview/editor — the chosen text IS the partner's SOUL.md. A custom soul
- * can be saved back into the shared library for future partners.
+ * one of the chat personas, or write a custom soul. Whatever the source, the
+ * chosen text lands in the SoulEditor below — the text IS the partner's
+ * SOUL.md, and editing it detaches a private custom copy. A custom soul can
+ * be saved back into the shared library for future partners.
*/
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
-import { BookHeart, Check, Loader2, Save, Sparkles, UserRound } from "lucide-react";
+import {
+ BookHeart,
+ Check,
+ Loader2,
+ Save,
+ Sparkles,
+ UserRound,
+} from "lucide-react";
import {
createSoulTemplate,
getSoulSources,
type SoulSources,
type SoulSpec,
} from "@/lib/partners-api";
+import SoulEditor from "@/components/partners/SoulEditor";
type SourceTab = "library" | "persona" | "custom";
@@ -39,7 +48,11 @@ export default function SoulPicker({
const { t } = useTranslation();
const [sources, setSources] = useState<SoulSources | null>(null);
const [tab, setTab] = useState<SourceTab>(
- value.source === "persona" ? "persona" : value.source === "custom" ? "custom" : "library",
+ value.source === "persona"
+ ? "persona"
+ : value.source === "custom"
+ ? "custom"
+ : "library",
);
const [saveName, setSaveName] = useState("");
const [saving, setSaving] = useState(false);
@@ -56,6 +69,16 @@ export default function SoulPicker({
})();
}, []);
+ // Untouched wizard ("default" source) → preselect the first library soul
+ // so the editor is visible and the actual content explicit from the start.
+ useEffect(() => {
+ if (value.source !== "default") return;
+ const first = sources?.library[0];
+ if (first)
+ onChange({ source: "library", id: first.id, content: first.content });
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- run once when sources land
+ }, [sources]);
+
const tabs: { key: SourceTab; label: string; icon: typeof Sparkles }[] = [
{ key: "library", label: t("Soul library"), icon: BookHeart },
{ key: "persona", label: t("Clone a persona"), icon: UserRound },
@@ -68,9 +91,17 @@ export default function SoulPicker({
};
const selectPersona = (name: string) => {
- onChange({ source: "persona", id: name });
+ const entry = sources?.personas.find((p) => p.name === name);
+ onChange({ source: "persona", id: name, content: entry?.content });
};
+ // Typing into the editor detaches a private copy of whatever was selected.
+ const editContent = (next: string) =>
+ onChange({ source: "custom", content: next });
+
+ // A template/persona was edited into a private copy on this tab.
+ const detached = tab !== "custom" && value.source === "custom";
+
const saveToLibrary = async () => {
const content = (value.content ?? "").trim();
const name = saveName.trim();
@@ -78,7 +109,11 @@ export default function SoulPicker({
setSaving(true);
setSaveError("");
try {
- const entry = await createSoulTemplate(slugifySoulId(name), name, content);
+ const entry = await createSoulTemplate(
+ slugifySoulId(name),
+ name,
+ content,
+ );
setSavedId(entry.id);
setSources(await getSoulSources());
// Keep the wizard pointed at the (identical) library entry.
@@ -92,9 +127,11 @@ export default function SoulPicker({
}
};
+ const showEditor = tab === "custom" || value.content !== undefined;
+
return (
- <div className="space-y-3">
- <div className="flex w-fit gap-1 rounded-lg bg-[var(--muted)] p-0.5">
+ <div className="space-y-4">
+ <div className="flex w-fit gap-1 rounded-xl bg-[var(--muted)] p-1">
{tabs.map(({ key, label, icon: Icon }) => (
<button
key={key}
@@ -104,26 +141,26 @@ export default function SoulPicker({
if (key === "custom")
onChange({ source: "custom", content: value.content ?? "" });
}}
- className={`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[12px] transition-colors ${
+ className={`inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] transition-all duration-150 ${
tab === key
? "bg-[var(--background)] font-medium text-[var(--foreground)] shadow-sm"
: "text-[var(--muted-foreground)] hover:text-[var(--foreground)]"
}`}
>
- <Icon className="h-3.5 w-3.5" />
+ <Icon className="h-4 w-4" />
{label}
</button>
))}
</div>
{tab === "library" && (
- <div className="flex flex-wrap gap-1.5">
+ <div className="flex flex-wrap gap-2">
{(sources?.library ?? []).map((soul) => (
<button
key={soul.id}
type="button"
onClick={() => selectLibrary(soul.id)}
- className={`rounded-full border px-3 py-1 text-[12px] transition-colors ${
+ className={`rounded-full border px-3.5 py-1.5 text-[13px] transition-all duration-150 active:scale-[0.97] ${
value.source === "library" && value.id === soul.id
? "border-[var(--primary)] bg-[var(--secondary)] font-medium text-[var(--primary)]"
: "border-[var(--border)] text-[var(--muted-foreground)] hover:border-[var(--ring)] hover:text-[var(--foreground)]"
@@ -131,12 +168,12 @@ export default function SoulPicker({
>
{soul.name}
{savedId === soul.id && (
- <Check className="ml-1 inline h-3 w-3 text-[var(--primary)]" />
+ <Check className="ml-1 inline h-3.5 w-3.5 text-[var(--primary)]" />
)}
</button>
))}
{sources && sources.library.length === 0 && (
- <p className="text-[12px] text-[var(--muted-foreground)]">
+ <p className="text-[13px] text-[var(--muted-foreground)]">
{t("No soul templates yet.")}
</p>
)}
@@ -144,14 +181,14 @@ export default function SoulPicker({
)}
{tab === "persona" && (
- <div className="flex flex-wrap gap-1.5">
+ <div className="flex flex-wrap gap-2">
{(sources?.personas ?? []).map((persona) => (
<button
key={persona.name}
type="button"
onClick={() => selectPersona(persona.name)}
title={persona.description}
- className={`rounded-full border px-3 py-1 text-[12px] transition-colors ${
+ className={`rounded-full border px-3.5 py-1.5 text-[13px] transition-all duration-150 active:scale-[0.97] ${
value.source === "persona" && value.id === persona.name
? "border-[var(--primary)] bg-[var(--secondary)] font-medium text-[var(--primary)]"
: "border-[var(--border)] text-[var(--muted-foreground)] hover:border-[var(--ring)] hover:text-[var(--foreground)]"
@@ -161,27 +198,31 @@ export default function SoulPicker({
</button>
))}
{sources && sources.personas.length === 0 && (
- <p className="text-[12px] text-[var(--muted-foreground)]">
+ <p className="text-[13px] text-[var(--muted-foreground)]">
{t("No personas in your chat workspace yet.")}
</p>
)}
- {value.source === "persona" && value.id && (
- <p className="w-full text-[11px] text-[var(--muted-foreground)]">
- {t("The persona's markdown is copied into the partner — later edits to the persona won't affect it.")}
- </p>
- )}
</div>
)}
- {(tab === "custom" ||
- (tab === "library" && value.source === "library" && value.content)) && (
- <textarea
- value={value.content ?? ""}
- onChange={(e) => onChange({ source: "custom", content: e.target.value })}
- rows={10}
- placeholder={t("# Soul\nDescribe who this partner is, how it speaks, what it values…")}
- className="w-full rounded-xl border border-[var(--border)] bg-transparent px-3.5 py-3 font-mono text-[12.5px] leading-relaxed outline-none focus:border-[var(--ring)]"
- />
+ {showEditor && (
+ <div className="space-y-2">
+ <SoulEditor value={value.content ?? ""} onChange={editContent} />
+ {tab === "persona" && value.source === "persona" && value.id && (
+ <p className="text-[12px] leading-relaxed text-[var(--muted-foreground)]">
+ {t(
+ "The persona's markdown is copied into the partner — later edits to the persona won't affect it.",
+ )}
+ </p>
+ )}
+ {detached && (
+ <p className="text-[12px] leading-relaxed text-[var(--muted-foreground)]">
+ {t(
+ "Edited — your version becomes this partner's soul. The original template is untouched.",
+ )}
+ </p>
+ )}
+ </div>
)}
{tab === "custom" && (value.content ?? "").trim() && (
@@ -190,13 +231,13 @@ export default function SoulPicker({
value={saveName}
onChange={(e) => setSaveName(e.target.value)}
placeholder={t("Template name")}
- className="w-44 rounded-lg border border-[var(--border)] bg-transparent px-3 py-1.5 text-[12px] outline-none focus:border-[var(--ring)]"
+ className="w-48 rounded-lg border border-[var(--border)] bg-transparent px-3 py-1.5 text-[13px] outline-none transition-colors focus:border-[var(--ring)]"
/>
<button
type="button"
onClick={() => void saveToLibrary()}
disabled={saving || !saveName.trim()}
- className="inline-flex items-center gap-1.5 rounded-lg border border-[var(--border)] px-3 py-1.5 text-[12px] font-medium text-[var(--foreground)] hover:border-[var(--ring)] disabled:opacity-40"
+ className="inline-flex items-center gap-1.5 rounded-lg border border-[var(--border)] px-3 py-1.5 text-[13px] font-medium text-[var(--foreground)] transition-all duration-150 hover:border-[var(--ring)] active:scale-[0.98] disabled:opacity-40"
>
{saving ? (
<Loader2 className="h-3.5 w-3.5 animate-spin" />
@@ -206,7 +247,9 @@ export default function SoulPicker({
{t("Save to soul library")}
</button>
{saveError && (
- <span className="text-[11.5px] text-[var(--destructive)]">{saveError}</span>
+ <span className="text-[12px] text-[var(--destructive)]">
+ {saveError}
+ </span>
)}
</div>
)}
diff --git a/web/components/partners/ToolPicker.tsx b/web/components/partners/ToolPicker.tsx
index 60fd79013..2c677afd4 100644
--- a/web/components/partners/ToolPicker.tsx
+++ b/web/components/partners/ToolPicker.tsx
@@ -25,11 +25,18 @@ function ToggleRow({
}) {
return (
<label className="flex cursor-pointer items-start gap-2 rounded-lg px-2 py-1.5 hover:bg-[var(--muted)]">
- <input type="checkbox" checked={checked} onChange={onToggle} className="mt-0.5" />
+ <input
+ type="checkbox"
+ checked={checked}
+ onChange={onToggle}
+ className="mt-0.5"
+ />
<span className="min-w-0">
- <span className="block text-[13px] text-[var(--foreground)]">{name}</span>
+ <span className="block text-[13px] text-[var(--foreground)]">
+ {name}
+ </span>
{description && (
- <span className="block truncate text-[11px] text-[var(--muted-foreground)]">
+ <span className="block truncate text-[11.5px] text-[var(--muted-foreground)]">
{description}
</span>
)}
@@ -54,12 +61,20 @@ export default function ToolPicker({
const { t } = useTranslation();
if (!options) {
return (
- <p className="text-[12px] text-[var(--muted-foreground)]">{t("Loading tools…")}</p>
+ <p className="text-[13px] text-[var(--muted-foreground)]">
+ {t("Loading tools…")}
+ </p>
);
}
- const toggle = (list: string[], name: string, setter: (next: string[]) => void) => {
- setter(list.includes(name) ? list.filter((n) => n !== name) : [...list, name]);
+ const toggle = (
+ list: string[],
+ name: string,
+ setter: (next: string[]) => void,
+ ) => {
+ setter(
+ list.includes(name) ? list.filter((n) => n !== name) : [...list, name],
+ );
};
const mcpByServer = new Map<string, typeof options.mcp_tools>();
@@ -72,14 +87,16 @@ export default function ToolPicker({
<div className="space-y-4">
<div>
<div className="mb-1.5 flex items-baseline justify-between">
- <h4 className="text-[12px] font-medium text-[var(--muted-foreground)]">
+ <h4 className="text-[13px] font-medium text-[var(--muted-foreground)]">
{t("System tools")}
</h4>
- <div className="flex gap-2 text-[11px]">
+ <div className="flex gap-2 text-[12px]">
<button
type="button"
className="text-[var(--primary)] hover:underline"
- onClick={() => onChangeEnabledTools(options.tools.map((tl) => tl.name))}
+ onClick={() =>
+ onChangeEnabledTools(options.tools.map((tl) => tl.name))
+ }
>
{t("All")}
</button>
@@ -99,7 +116,9 @@ export default function ToolPicker({
name={tool.name}
description={tool.description}
checked={enabledTools.includes(tool.name)}
- onToggle={() => toggle(enabledTools, tool.name, onChangeEnabledTools)}
+ onToggle={() =>
+ toggle(enabledTools, tool.name, onChangeEnabledTools)
+ }
/>
))}
</div>
@@ -108,14 +127,16 @@ export default function ToolPicker({
{options.mcp_tools.length > 0 && (
<div>
<div className="mb-1.5 flex items-baseline justify-between">
- <h4 className="text-[12px] font-medium text-[var(--muted-foreground)]">
+ <h4 className="text-[13px] font-medium text-[var(--muted-foreground)]">
{t("MCP tools")}
</h4>
- <div className="flex gap-2 text-[11px]">
+ <div className="flex gap-2 text-[12px]">
<button
type="button"
className="text-[var(--primary)] hover:underline"
- onClick={() => onChangeMcpTools(options.mcp_tools.map((tl) => tl.name))}
+ onClick={() =>
+ onChangeMcpTools(options.mcp_tools.map((tl) => tl.name))
+ }
>
{t("All")}
</button>
@@ -130,7 +151,7 @@ export default function ToolPicker({
</div>
{[...mcpByServer.entries()].map(([server, tools]) => (
<div key={server} className="mb-2">
- <p className="mb-0.5 px-2 font-mono text-[11px] text-[var(--muted-foreground)]">
+ <p className="mb-0.5 px-2 font-mono text-[11.5px] text-[var(--muted-foreground)]">
{server}
</p>
<div className="grid grid-cols-1 gap-0.5 sm:grid-cols-2">
@@ -140,7 +161,9 @@ export default function ToolPicker({
name={tool.name}
description={tool.description}
checked={mcpTools.includes(tool.name)}
- onToggle={() => toggle(mcpTools, tool.name, onChangeMcpTools)}
+ onToggle={() =>
+ toggle(mcpTools, tool.name, onChangeMcpTools)
+ }
/>
))}
</div>
diff --git a/web/components/partners/schema-form.tsx b/web/components/partners/schema-form.tsx
index 704b485d0..65ee102dd 100644
--- a/web/components/partners/schema-form.tsx
+++ b/web/components/partners/schema-form.tsx
@@ -6,6 +6,7 @@
* Pydantic JSON schema served by `GET /api/v1/partners/channels/schema`.
*/
+import { useState } from "react";
import { Eye, EyeOff } from "lucide-react";
export type JsonSchema = {
@@ -79,6 +80,70 @@ function FieldLabel({
);
}
+/** Free-form dict field (object without fixed properties) → JSON textarea. */
+function JsonObjectField({
+ label,
+ description,
+ value,
+ onChange,
+}: {
+ label: string;
+ description?: string;
+ value: unknown;
+ onChange: (next: unknown) => void;
+}) {
+ const [draft, setDraft] = useState(() => {
+ const obj =
+ value && typeof value === "object"
+ ? (value as Record<string, unknown>)
+ : {};
+ return Object.keys(obj).length ? JSON.stringify(obj, null, 2) : "";
+ });
+ const [invalid, setInvalid] = useState(false);
+ return (
+ <div>
+ <FieldLabel
+ label={label}
+ description={description ?? 'JSON object, e.g. {"key": "value"}'}
+ />
+ <textarea
+ value={draft}
+ onChange={(e) => {
+ const text = e.target.value;
+ setDraft(text);
+ if (!text.trim()) {
+ setInvalid(false);
+ onChange({});
+ return;
+ }
+ try {
+ const parsed: unknown = JSON.parse(text);
+ if (
+ parsed &&
+ typeof parsed === "object" &&
+ !Array.isArray(parsed)
+ ) {
+ setInvalid(false);
+ onChange(parsed);
+ } else {
+ setInvalid(true);
+ }
+ } catch {
+ setInvalid(true);
+ }
+ }}
+ rows={4}
+ className="w-full rounded-lg border border-[var(--border)] bg-transparent px-3 py-2 font-mono text-[13px] outline-none focus:border-[var(--ring)]"
+ />
+ {invalid && (
+ <p className="mt-1 text-[11px] text-amber-600 dark:text-amber-400">
+ Invalid JSON — value not applied.
+ </p>
+ )}
+ </div>
+ );
+}
+
/** Generic field renderer — recursive for nested objects. */
export function SchemaField({
fieldKey,
@@ -206,6 +271,18 @@ export function SchemaField({
);
}
+ // Free-form dict (additionalProperties only) → JSON textarea.
+ if (v.type === "object") {
+ return (
+ <JsonObjectField
+ label={label}
+ description={description}
+ value={value}
+ onChange={onChange}
+ />
+ );
+ }
+
// Integer/number → number input.
if (v.type === "integer" || v.type === "number") {
return (
diff --git a/web/components/quiz/QuizFollowupTabBody.tsx b/web/components/quiz/QuizFollowupTabBody.tsx
index 13ca0140a..85f38c96c 100644
--- a/web/components/quiz/QuizFollowupTabBody.tsx
+++ b/web/components/quiz/QuizFollowupTabBody.tsx
@@ -29,10 +29,7 @@ import {
AskUserOptions,
extractMessageSegments,
} from "@/components/chat/home/AskUserOptions";
-import {
- StreamingStatus,
- TraceFlow,
-} from "@/components/chat/home/TracePanels";
+import { StreamingStatus, TraceFlow } from "@/components/chat/home/TracePanels";
import { useSmoothStreamText } from "@/hooks/useSmoothStreamText";
import {
type QuizFollowupTabContext,
diff --git a/web/components/space/NotebooksSection.tsx b/web/components/space/NotebooksSection.tsx
index 686fa70a2..4f719829c 100644
--- a/web/components/space/NotebooksSection.tsx
+++ b/web/components/space/NotebooksSection.tsx
@@ -182,7 +182,7 @@ export default function NotebooksSection() {
};
case "tutorbot":
return {
- label: t("Tutorbot"),
+ label: t("Partner"),
color:
"bg-violet-100 text-violet-700 dark:bg-violet-900/40 dark:text-violet-300",
icon: Bot,
diff --git a/web/components/space/PersonasSection.tsx b/web/components/space/PersonasSection.tsx
index bd93ecb8c..14429320a 100644
--- a/web/components/space/PersonasSection.tsx
+++ b/web/components/space/PersonasSection.tsx
@@ -567,7 +567,9 @@ export default function PersonasSection() {
disabled={editor.saving}
className="inline-flex items-center gap-1.5 rounded-md bg-[var(--foreground)] px-3.5 py-1.5 text-[12px] font-medium text-[var(--background)] transition-opacity hover:opacity-90 disabled:opacity-50"
>
- {editor.saving && <Loader2 size={12} className="animate-spin" />}
+ {editor.saving && (
+ <Loader2 size={12} className="animate-spin" />
+ )}
{t("Save")}
</button>
</div>
diff --git a/web/components/space/SkillsSection.tsx b/web/components/space/SkillsSection.tsx
index a0de33ed2..97db6a705 100644
--- a/web/components/space/SkillsSection.tsx
+++ b/web/components/space/SkillsSection.tsx
@@ -603,108 +603,108 @@ export default function SkillsSection() {
? t("Preset")
: null;
return (
- <li
- key={skill.name}
- role="button"
- tabIndex={0}
- onClick={() => void openView(skill)}
- onKeyDown={(e) => {
- if (e.key === "Enter" || e.key === " ") {
- e.preventDefault();
- void openView(skill);
- }
- }}
- title={t("View skill")}
- className="group relative flex cursor-pointer flex-col rounded-xl border border-[var(--border)] bg-[var(--card)] p-4 shadow-sm transition-all hover:border-[var(--foreground)]/30 hover:shadow-md focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)]/40"
- >
- <div className="mb-2 flex items-start justify-between gap-2">
- <div className="flex items-start gap-2.5">
- <span className="mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-[var(--border)]/60 bg-[var(--background)] text-[var(--muted-foreground)]">
- <Wand2 size={13} strokeWidth={1.6} />
- </span>
- <div className="min-w-0">
- <div className="flex items-center gap-1.5">
- <span className="truncate text-[14px] font-semibold tracking-tight text-[var(--foreground)]">
- {skill.name}
- </span>
- {sourceBadge ? (
- <span className="inline-flex shrink-0 items-center gap-1 rounded-md bg-[var(--muted)] px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-[var(--muted-foreground)]">
- {readOnly ? <Lock size={9} /> : null}
- {sourceBadge}
+ <li
+ key={skill.name}
+ role="button"
+ tabIndex={0}
+ onClick={() => void openView(skill)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter" || e.key === " ") {
+ e.preventDefault();
+ void openView(skill);
+ }
+ }}
+ title={t("View skill")}
+ className="group relative flex cursor-pointer flex-col rounded-xl border border-[var(--border)] bg-[var(--card)] p-4 shadow-sm transition-all hover:border-[var(--foreground)]/30 hover:shadow-md focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)]/40"
+ >
+ <div className="mb-2 flex items-start justify-between gap-2">
+ <div className="flex items-start gap-2.5">
+ <span className="mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-[var(--border)]/60 bg-[var(--background)] text-[var(--muted-foreground)]">
+ <Wand2 size={13} strokeWidth={1.6} />
+ </span>
+ <div className="min-w-0">
+ <div className="flex items-center gap-1.5">
+ <span className="truncate text-[14px] font-semibold tracking-tight text-[var(--foreground)]">
+ {skill.name}
</span>
- ) : null}
+ {sourceBadge ? (
+ <span className="inline-flex shrink-0 items-center gap-1 rounded-md bg-[var(--muted)] px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-[var(--muted-foreground)]">
+ {readOnly ? <Lock size={9} /> : null}
+ {sourceBadge}
+ </span>
+ ) : null}
+ </div>
+ {skill.description ? (
+ <p className="mt-0.5 line-clamp-2 text-[12px] leading-relaxed text-[var(--muted-foreground)]">
+ {skill.description}
+ </p>
+ ) : (
+ <p className="mt-0.5 text-[12px] italic text-[var(--muted-foreground)]/60">
+ {t("No description.")}
+ </p>
+ )}
</div>
- {skill.description ? (
- <p className="mt-0.5 line-clamp-2 text-[12px] leading-relaxed text-[var(--muted-foreground)]">
- {skill.description}
- </p>
- ) : (
- <p className="mt-0.5 text-[12px] italic text-[var(--muted-foreground)]/60">
- {t("No description.")}
- </p>
- )}
</div>
+ {readOnly ? (
+ <span className="shrink-0 text-[var(--muted-foreground)] opacity-0 transition-opacity group-hover:opacity-100">
+ <Eye size={13} />
+ </span>
+ ) : (
+ <div className="flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100">
+ <button
+ onClick={(e) => {
+ e.stopPropagation();
+ void openEdit(skill.name);
+ }}
+ className="rounded-md p-1.5 text-[var(--muted-foreground)] transition-colors hover:bg-[var(--muted)] hover:text-[var(--foreground)]"
+ title={t("Edit")}
+ >
+ <Pencil size={13} />
+ </button>
+ <button
+ onClick={(e) => {
+ e.stopPropagation();
+ void handleDelete(skill.name);
+ }}
+ disabled={deleting === skill.name}
+ className="rounded-md p-1.5 text-[var(--muted-foreground)] transition-colors hover:bg-red-50 hover:text-red-600 disabled:opacity-50 dark:hover:bg-red-950/30"
+ title={t("Delete")}
+ >
+ {deleting === skill.name ? (
+ <Loader2 size={13} className="animate-spin" />
+ ) : (
+ <Trash2 size={13} />
+ )}
+ </button>
+ </div>
+ )}
</div>
- {readOnly ? (
- <span className="shrink-0 text-[var(--muted-foreground)] opacity-0 transition-opacity group-hover:opacity-100">
- <Eye size={13} />
- </span>
+
+ {skill.tags && skill.tags.length > 0 ? (
+ <div className="mt-auto flex flex-wrap gap-1 pt-2">
+ {skill.tags.map((tag) => (
+ <button
+ key={tag}
+ onClick={(e) => {
+ e.stopPropagation();
+ setFilterTag(tag);
+ }}
+ className="inline-flex items-center gap-1 rounded-full border border-[var(--border)]/60 bg-[var(--muted)]/40 px-2 py-0.5 text-[10.5px] font-medium text-[var(--muted-foreground)] transition-colors hover:border-[var(--foreground)]/30 hover:text-[var(--foreground)]"
+ >
+ <span className="inline-flex h-1.5 w-1.5 rounded-full bg-[var(--foreground)]/40" />
+ {tag}
+ </button>
+ ))}
+ </div>
) : (
- <div className="flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100">
- <button
- onClick={(e) => {
- e.stopPropagation();
- void openEdit(skill.name);
- }}
- className="rounded-md p-1.5 text-[var(--muted-foreground)] transition-colors hover:bg-[var(--muted)] hover:text-[var(--foreground)]"
- title={t("Edit")}
- >
- <Pencil size={13} />
- </button>
- <button
- onClick={(e) => {
- e.stopPropagation();
- void handleDelete(skill.name);
- }}
- disabled={deleting === skill.name}
- className="rounded-md p-1.5 text-[var(--muted-foreground)] transition-colors hover:bg-red-50 hover:text-red-600 disabled:opacity-50 dark:hover:bg-red-950/30"
- title={t("Delete")}
- >
- {deleting === skill.name ? (
- <Loader2 size={13} className="animate-spin" />
- ) : (
- <Trash2 size={13} />
- )}
- </button>
+ <div className="mt-auto pt-2">
+ <span className="inline-flex items-center gap-1 rounded-full border border-dashed border-[var(--border)] px-2 py-0.5 text-[10.5px] text-[var(--muted-foreground)]/70">
+ <TagIcon size={10} />
+ {t("Untagged")}
+ </span>
</div>
)}
- </div>
-
- {skill.tags && skill.tags.length > 0 ? (
- <div className="mt-auto flex flex-wrap gap-1 pt-2">
- {skill.tags.map((tag) => (
- <button
- key={tag}
- onClick={(e) => {
- e.stopPropagation();
- setFilterTag(tag);
- }}
- className="inline-flex items-center gap-1 rounded-full border border-[var(--border)]/60 bg-[var(--muted)]/40 px-2 py-0.5 text-[10.5px] font-medium text-[var(--muted-foreground)] transition-colors hover:border-[var(--foreground)]/30 hover:text-[var(--foreground)]"
- >
- <span className="inline-flex h-1.5 w-1.5 rounded-full bg-[var(--foreground)]/40" />
- {tag}
- </button>
- ))}
- </div>
- ) : (
- <div className="mt-auto pt-2">
- <span className="inline-flex items-center gap-1 rounded-full border border-dashed border-[var(--border)] px-2 py-0.5 text-[10.5px] text-[var(--muted-foreground)]/70">
- <TagIcon size={10} />
- {t("Untagged")}
- </span>
- </div>
- )}
- </li>
+ </li>
);
})}
</ul>
@@ -724,7 +724,10 @@ export default function SkillsSection() {
>
<div className="flex items-center justify-between gap-3 border-b border-[var(--border)] px-5 py-3">
<div className="flex min-w-0 items-center gap-2">
- <Wand2 size={14} className="shrink-0 text-[var(--muted-foreground)]" />
+ <Wand2
+ size={14}
+ className="shrink-0 text-[var(--muted-foreground)]"
+ />
<h3 className="truncate text-[14px] font-semibold text-[var(--foreground)]">
{viewer.name}
</h3>
diff --git a/web/components/visualize/VisualizationViewer.tsx b/web/components/visualize/VisualizationViewer.tsx
index 156eec3ea..fed664ff4 100644
--- a/web/components/visualize/VisualizationViewer.tsx
+++ b/web/components/visualize/VisualizationViewer.tsx
@@ -267,7 +267,10 @@ function sanitizeSvg(raw: string): string {
ids.has(v.slice(1))
) {
v = `#${prefix}${v.slice(1)}`;
- } else if (lname === "aria-labelledby" || lname === "aria-describedby") {
+ } else if (
+ lname === "aria-labelledby" ||
+ lname === "aria-describedby"
+ ) {
v = v
.split(/\s+/)
.map((token) => (ids.has(token) ? prefix + token : token))
diff --git a/web/components/visualize/svg-theme.css b/web/components/visualize/svg-theme.css
index 8affa1a94..a584a661b 100644
--- a/web/components/visualize/svg-theme.css
+++ b/web/components/visualize/svg-theme.css
@@ -201,7 +201,17 @@
/* Apply ramp vars: shapes take fill+stroke, descendant text takes ramp text. */
.dt-svg-root
- :is(.c-gray, .c-blue, .c-teal, .c-coral, .c-pink, .c-purple, .c-green, .c-amber, .c-red)
+ :is(
+ .c-gray,
+ .c-blue,
+ .c-teal,
+ .c-coral,
+ .c-pink,
+ .c-purple,
+ .c-green,
+ .c-amber,
+ .c-red
+ )
> :is(rect, circle, ellipse, polygon),
.dt-svg-root
:is(rect, circle, ellipse, polygon):is(
@@ -219,7 +229,17 @@
stroke: var(--stroke);
}
.dt-svg-root
- :is(.c-gray, .c-blue, .c-teal, .c-coral, .c-pink, .c-purple, .c-green, .c-amber, .c-red)
+ :is(
+ .c-gray,
+ .c-blue,
+ .c-teal,
+ .c-coral,
+ .c-pink,
+ .c-purple,
+ .c-green,
+ .c-amber,
+ .c-red
+ )
text {
fill: var(--text);
}
diff --git a/web/features/multi-user/components/GrantEditor.tsx b/web/features/multi-user/components/GrantEditor.tsx
index d25b263c1..fd593d256 100644
--- a/web/features/multi-user/components/GrantEditor.tsx
+++ b/web/features/multi-user/components/GrantEditor.tsx
@@ -438,7 +438,9 @@ export function GrantEditor({ userId }: { userId: string }) {
description={tool.description}
checked={grant.enabled_tools!.includes(tool.name)}
disabled={controlsDisabled}
- onToggle={() => toggleToolName("enabled_tools", tool.name)}
+ onToggle={() =>
+ toggleToolName("enabled_tools", tool.name)
+ }
/>
))}
</div>
@@ -499,7 +501,8 @@ export function GrantEditor({ userId }: { userId: string }) {
onToggle={() =>
setGrant((current) => ({
...current,
- exec_enabled: current.exec_enabled === false ? null : false,
+ exec_enabled:
+ current.exec_enabled === false ? null : false,
}))
}
/>
diff --git a/web/hooks/useMasteryTurn.ts b/web/hooks/useMasteryTurn.ts
index dc098dae0..5b849eb50 100644
--- a/web/hooks/useMasteryTurn.ts
+++ b/web/hooks/useMasteryTurn.ts
@@ -139,7 +139,12 @@ function reducer(state: MasteryState, action: Action): MasteryState {
if (!state.currentStage) return state;
const stages = state.stages.map((s) =>
s.stage === state.currentStage
- ? { ...s, content: s.content ? `${s.content}\n${action.content}` : action.content }
+ ? {
+ ...s,
+ content: s.content
+ ? `${s.content}\n${action.content}`
+ : action.content,
+ }
: s,
);
return { ...state, stages };
@@ -160,7 +165,9 @@ function reducer(state: MasteryState, action: Action): MasteryState {
case "DONE": {
const reachedTerminal =
state.completed ||
- state.stages.some((s) => s.stage === "completed" && s.status === "completed");
+ state.stages.some(
+ (s) => s.stage === "completed" && s.status === "completed",
+ );
return {
...state,
busy: false,
@@ -173,7 +180,9 @@ function reducer(state: MasteryState, action: Action): MasteryState {
case "ERROR": {
const stages = state.currentStage
? state.stages.map((s) =>
- s.stage === state.currentStage ? { ...s, status: "error" as const } : s,
+ s.stage === state.currentStage
+ ? { ...s, status: "error" as const }
+ : s,
)
: state.stages;
return {
@@ -329,7 +338,10 @@ export function useMasteryTurn({
if (moduleSwitchRef.current && evt.content?.includes("cancelled")) {
return;
}
- dispatch({ type: "ERROR", message: evt.content || "An error occurred" });
+ dispatch({
+ type: "ERROR",
+ message: evt.content || "An error occurred",
+ });
break;
}
default:
@@ -368,7 +380,9 @@ export function useMasteryTurn({
dispatch({ type: "OPEN" });
// Resume an in-flight turn if one exists; otherwise the response
// (active_turn_info) starts a fresh turn.
- ws.send(JSON.stringify({ type: "check_active_turn", session_id: sessionId }));
+ ws.send(
+ JSON.stringify({ type: "check_active_turn", session_id: sessionId }),
+ );
};
ws.onmessage = (event) => {
@@ -387,13 +401,13 @@ export function useMasteryTurn({
ws.onclose = () => {
if (intentionalCloseRef.current) return;
if (reconnectAttemptsRef.current < MAX_RECONNECT_ATTEMPTS) {
- const delay = Math.min(
- 1000 * 2 ** reconnectAttemptsRef.current,
- 10000,
- );
+ const delay = Math.min(1000 * 2 ** reconnectAttemptsRef.current, 10000);
reconnectAttemptsRef.current += 1;
dispatch({ type: "CONNECTING" });
- reconnectTimerRef.current = setTimeout(() => connectRef.current(), delay);
+ reconnectTimerRef.current = setTimeout(
+ () => connectRef.current(),
+ delay,
+ );
} else {
dispatch({ type: "ERROR", message: "Connection lost" });
}
@@ -447,7 +461,11 @@ export function useMasteryTurn({
const changeModule = useCallback(
(moduleId: string) => {
moduleSwitchRef.current = true;
- send({ type: "change_module", session_id: sessionId, module_id: moduleId });
+ send({
+ type: "change_module",
+ session_id: sessionId,
+ module_id: moduleId,
+ });
},
[send, sessionId],
);
diff --git a/web/lib/iframe-html.ts b/web/lib/iframe-html.ts
index 871eade5e..e798c3863 100644
--- a/web/lib/iframe-html.ts
+++ b/web/lib/iframe-html.ts
@@ -95,7 +95,7 @@ const BRIDGE_SCRIPT =
"<script data-dt-bridge>" +
"(function(){" +
'window.sendPrompt=function(t){try{parent.postMessage({type:"dt:visualize-prompt",text:String(t||"")},"*")}catch(e){}};' +
- "function rh(){try{var b=document.body,h=Math.max(document.documentElement.scrollHeight,b?b.scrollHeight:0);parent.postMessage({type:\"dt:visualize-height\",height:h},\"*\")}catch(e){}}" +
+ 'function rh(){try{var b=document.body,h=Math.max(document.documentElement.scrollHeight,b?b.scrollHeight:0);parent.postMessage({type:"dt:visualize-height",height:h},"*")}catch(e){}}' +
'if(typeof ResizeObserver!=="undefined"){var ro=new ResizeObserver(rh);document.addEventListener("DOMContentLoaded",function(){ro.observe(document.documentElement);rh()})}' +
'document.addEventListener("DOMContentLoaded",rh);window.addEventListener("load",rh);' +
"})();" +
diff --git a/web/lib/learning-api.ts b/web/lib/learning-api.ts
index 302598131..933ba4a71 100644
--- a/web/lib/learning-api.ts
+++ b/web/lib/learning-api.ts
@@ -5,7 +5,12 @@ export interface ModuleInit {
name: string;
order: number;
pass_threshold?: number;
- knowledge_points: { id: string; name: string; type: string; module_id: string }[];
+ knowledge_points: {
+ id: string;
+ name: string;
+ type: string;
+ module_id: string;
+ }[];
}
export interface LearningKnowledgePoint {
@@ -38,11 +43,14 @@ export async function fetchProgress(bookId: string): Promise<ProgressDetail> {
}
export async function initModules(bookId: string, modules: ModuleInit[]) {
- const res = await apiFetch(apiUrl(`/api/v1/learning/progress/${bookId}/init-modules`), {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ modules }),
- });
+ const res = await apiFetch(
+ apiUrl(`/api/v1/learning/progress/${bookId}/init-modules`),
+ {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ modules }),
+ },
+ );
if (!res.ok) throw new Error(`Failed to init modules: ${res.status}`);
return res.json();
}
@@ -69,23 +77,37 @@ export async function fetchAllProgress(): Promise<ProgressListResult> {
}
export async function deleteProgress(bookId: string) {
- const res = await apiFetch(apiUrl(`/api/v1/learning/progress/${encodeURIComponent(bookId)}`), { method: "DELETE" });
+ const res = await apiFetch(
+ apiUrl(`/api/v1/learning/progress/${encodeURIComponent(bookId)}`),
+ { method: "DELETE" },
+ );
if (!res.ok) throw new Error(`Failed to delete progress: ${res.status}`);
return res.json();
}
export async function redoProgress(bookId: string) {
- const res = await apiFetch(apiUrl(`/api/v1/learning/progress/${encodeURIComponent(bookId)}/redo`), { method: "POST" });
+ const res = await apiFetch(
+ apiUrl(`/api/v1/learning/progress/${encodeURIComponent(bookId)}/redo`),
+ { method: "POST" },
+ );
if (!res.ok) throw new Error(`Failed to redo progress: ${res.status}`);
return res.json();
}
-export async function importFromBook(bookId: string, chapters: { title: string; knowledge_points: string[] }[]) {
- const res = await apiFetch(apiUrl(`/api/v1/learning/progress/${encodeURIComponent(bookId)}/import-from-book`), {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ chapters }),
- });
+export async function importFromBook(
+ bookId: string,
+ chapters: { title: string; knowledge_points: string[] }[],
+) {
+ const res = await apiFetch(
+ apiUrl(
+ `/api/v1/learning/progress/${encodeURIComponent(bookId)}/import-from-book`,
+ ),
+ {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ chapters }),
+ },
+ );
if (!res.ok) throw new Error(`Failed to import from book: ${res.status}`);
return res.json();
}
@@ -95,11 +117,17 @@ export async function generateModulesFromNotebook(
notebookId: string,
records: { id: string; type: string; title: string; output: string }[],
): Promise<{ modules: ModuleInit[] }> {
- const res = await apiFetch(apiUrl(`/api/v1/learning/progress/${encodeURIComponent(bookId)}/generate-from-notebook`), {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ notebook_id: notebookId, records }),
- });
- if (!res.ok) throw new Error(`Failed to generate modules from notebook: ${res.status}`);
+ const res = await apiFetch(
+ apiUrl(
+ `/api/v1/learning/progress/${encodeURIComponent(bookId)}/generate-from-notebook`,
+ ),
+ {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ notebook_id: notebookId, records }),
+ },
+ );
+ if (!res.ok)
+ throw new Error(`Failed to generate modules from notebook: ${res.status}`);
return res.json();
}
diff --git a/web/lib/markdown-display.ts b/web/lib/markdown-display.ts
index 5627bb955..d715e5c85 100644
--- a/web/lib/markdown-display.ts
+++ b/web/lib/markdown-display.ts
@@ -506,7 +506,9 @@ export function normalizeMarkdownForDisplay(content: string): string {
*/
export function stripArtifactAnnotations(content: string): string {
if (!content.includes("Generated artifacts")) return content;
- return content.replace(/^\s*\[Generated artifacts?:[^\]]*\]\s*$/gim, "").trim();
+ return content
+ .replace(/^\s*\[Generated artifacts?:[^\]]*\]\s*$/gim, "")
+ .trim();
}
export function hasVisibleMarkdownContent(content: string): boolean {
diff --git a/web/lib/mcp-api.ts b/web/lib/mcp-api.ts
index 6aa43012a..d5b147f98 100644
--- a/web/lib/mcp-api.ts
+++ b/web/lib/mcp-api.ts
@@ -2,11 +2,7 @@ import { apiFetch, apiUrl } from "@/lib/api";
export type McpTransport = "stdio" | "sse" | "streamableHttp";
-export type McpServerStatus =
- | "connecting"
- | "connected"
- | "error"
- | "disabled";
+export type McpServerStatus = "connecting" | "connected" | "error" | "disabled";
export interface McpServerConfig {
type: McpTransport | null;
@@ -124,13 +120,16 @@ function normalizeServerConfig(raw: unknown): McpServerConfig {
? type
: null,
command: String(item.command ?? base.command),
- args: Array.isArray(item.args) ? item.args.map((a) => String(a)) : base.args,
+ args: Array.isArray(item.args)
+ ? item.args.map((a) => String(a))
+ : base.args,
env: normalizeStringMap(item.env),
cwd: String(item.cwd ?? base.cwd),
url: String(item.url ?? base.url),
headers: normalizeStringMap(item.headers),
tool_timeout:
- typeof item.tool_timeout === "number" && Number.isFinite(item.tool_timeout)
+ typeof item.tool_timeout === "number" &&
+ Number.isFinite(item.tool_timeout)
? item.tool_timeout
: base.tool_timeout,
enabled_tools: Array.isArray(item.enabled_tools)
diff --git a/web/lib/memory-graph.ts b/web/lib/memory-graph.ts
index f1141ef5f..b62a24696 100644
--- a/web/lib/memory-graph.ts
+++ b/web/lib/memory-graph.ts
@@ -751,7 +751,7 @@ export const SURFACE_LABEL: Record<Surface, string> = {
quiz: "Quiz",
kb: "Knowledge base",
book: "Book",
- tutorbot: "TutorBot",
+ tutorbot: "Partner",
cowriter: "Co-writer",
};
diff --git a/web/lib/partners-api.ts b/web/lib/partners-api.ts
index 6d8808bad..87af6844c 100644
--- a/web/lib/partners-api.ts
+++ b/web/lib/partners-api.ts
@@ -39,7 +39,7 @@ export interface SoulTemplate {
export interface SoulSources {
library: SoulTemplate[];
- personas: { name: string; description: string }[];
+ personas: { name: string; description: string; content?: string }[];
}
export interface ToolOption {
@@ -120,7 +120,9 @@ async function json<T>(res: Response): Promise<T> {
}
export async function listPartners(): Promise<PartnerInfo[]> {
- return json(await apiFetch(apiUrl("/api/v1/partners"), { cache: "no-store" }));
+ return json(
+ await apiFetch(apiUrl("/api/v1/partners"), { cache: "no-store" }),
+ );
}
export async function getPartner(
@@ -129,7 +131,9 @@ export async function getPartner(
): Promise<PartnerInfo> {
const query = options?.includeSecrets ? "?include_secrets=true" : "";
return json(
- await apiFetch(apiUrl(`/api/v1/partners/${encodeURIComponent(partnerId)}${query}`)),
+ await apiFetch(
+ apiUrl(`/api/v1/partners/${encodeURIComponent(partnerId)}${query}`),
+ ),
);
}
@@ -147,14 +151,19 @@ export async function createPartner(
export async function updatePartner(
partnerId: string,
- payload: Partial<CreatePartnerPayload> & { channels?: Record<string, unknown> },
+ payload: Partial<CreatePartnerPayload> & {
+ channels?: Record<string, unknown>;
+ },
): Promise<PartnerInfo> {
return json(
- await apiFetch(apiUrl(`/api/v1/partners/${encodeURIComponent(partnerId)}`), {
- method: "PATCH",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify(payload),
- }),
+ await apiFetch(
+ apiUrl(`/api/v1/partners/${encodeURIComponent(partnerId)}`),
+ {
+ method: "PATCH",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(payload),
+ },
+ ),
);
}
@@ -178,15 +187,20 @@ export async function stopPartner(partnerId: string): Promise<void> {
export async function destroyPartner(partnerId: string): Promise<void> {
await json(
- await apiFetch(apiUrl(`/api/v1/partners/${encodeURIComponent(partnerId)}`), {
- method: "DELETE",
- }),
+ await apiFetch(
+ apiUrl(`/api/v1/partners/${encodeURIComponent(partnerId)}`),
+ {
+ method: "DELETE",
+ },
+ ),
);
}
export async function getPartnerSoul(partnerId: string): Promise<string> {
const data = await json<{ content: string }>(
- await apiFetch(apiUrl(`/api/v1/partners/${encodeURIComponent(partnerId)}/soul`)),
+ await apiFetch(
+ apiUrl(`/api/v1/partners/${encodeURIComponent(partnerId)}/soul`),
+ ),
);
return data.content ?? "";
}
@@ -196,11 +210,14 @@ export async function savePartnerSoul(
content: string,
): Promise<void> {
await json(
- await apiFetch(apiUrl(`/api/v1/partners/${encodeURIComponent(partnerId)}/soul`), {
- method: "PUT",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ content }),
- }),
+ await apiFetch(
+ apiUrl(`/api/v1/partners/${encodeURIComponent(partnerId)}/soul`),
+ {
+ method: "PUT",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ content }),
+ },
+ ),
);
}
@@ -233,15 +250,23 @@ export async function getPartnerCommands(): Promise<PartnerCommandInfo[]> {
return data.commands;
}
-export async function getPartnerAssets(partnerId: string): Promise<PartnerAssets> {
+export async function getPartnerAssets(
+ partnerId: string,
+): Promise<PartnerAssets> {
return json(
- await apiFetch(apiUrl(`/api/v1/partners/${encodeURIComponent(partnerId)}/assets`)),
+ await apiFetch(
+ apiUrl(`/api/v1/partners/${encodeURIComponent(partnerId)}/assets`),
+ ),
);
}
export async function addPartnerAssets(
partnerId: string,
- assets: { knowledge_bases?: string[]; skills?: string[]; notebooks?: string[] },
+ assets: {
+ knowledge_bases?: string[];
+ skills?: string[];
+ notebooks?: string[];
+ },
): Promise<{ assets: PartnerAssets } & ProvisioningReport> {
return json(
await apiFetch(
@@ -287,7 +312,13 @@ export interface ChannelsSchemaResponse {
}
export async function getChannelSchemas(): Promise<ChannelsSchemaResponse> {
- return json(await apiFetch(apiUrl("/api/v1/partners/channels/schema")));
+ // no-store: availability reflects live server imports (e.g. a dependency
+ // installed minutes ago) — a cached copy here shows phantom-missing channels.
+ return json(
+ await apiFetch(apiUrl("/api/v1/partners/channels/schema"), {
+ cache: "no-store",
+ }),
+ );
}
export async function getPartnerHistory(
@@ -308,7 +339,9 @@ export async function getPartnerHistory(
const query = params.toString() ? `?${params.toString()}` : "";
return json(
await apiFetch(
- apiUrl(`/api/v1/partners/${encodeURIComponent(partnerId)}/history${query}`),
+ apiUrl(
+ `/api/v1/partners/${encodeURIComponent(partnerId)}/history${query}`,
+ ),
),
);
}
diff --git a/web/locales/en/app.json b/web/locales/en/app.json
index 9620b0919..0ae80db43 100644
--- a/web/locales/en/app.json
+++ b/web/locales/en/app.json
@@ -122,7 +122,6 @@
"Research in progress...": "Research in progress...",
"Co-Writer": "Co-Writer",
"Intelligent markdown editor with AI-powered writing assistance.": "Intelligent markdown editor with AI-powered writing assistance.",
- "TutorBot": "TutorBot",
"Knowledge": "Knowledge",
"Memory": "Memory",
"Knowledge Bases": "Knowledge Bases",
@@ -391,7 +390,6 @@
"session": "session",
"sessions": "sessions",
"Chat": "Chat",
- "Tutorbot": "Tutorbot",
"No history found": "No history found",
"Your activities will appear here": "Your activities will appear here",
"Continue": "Continue",
@@ -833,13 +831,10 @@
"Code Block": "Code Block",
"Mermaid Diagram": "Mermaid Diagram",
"Math Block": "Math Block",
- "TutorBot Agents": "TutorBot Agents",
- "Manage your in-process TutorBot instances": "Manage your in-process TutorBot instances",
"Bots": "Bots",
"Profiles": "Profiles",
"Souls": "Souls",
"New Bot": "New Bot",
- "Create TutorBot": "Create TutorBot",
"(optional)": "(optional)",
"e.g. Math Tutor": "e.g. Math Tutor",
"A brief description of what this bot does": "A brief description of what this bot does",
@@ -847,14 +842,11 @@
"Define the bot's personality, values, and communication style in markdown...": "Define the bot's personality, values, and communication style in markdown...",
"Pick a soul from the library above, or write your own. Manage the library in the Souls tab.": "Pick a soul from the library above, or write your own. Manage the library in the Souls tab.",
"Uses default model if empty": "Uses default model if empty",
- "Applies to this TutorBot": "Applies to this TutorBot",
"Choose a configured Settings model, or keep the system default.": "Choose a configured Settings model, or keep the system default.",
"Model saved": "Model saved",
"Failed to save model": "Failed to save model",
"Selected model": "Selected model",
"Create & Start": "Create & Start",
- "No TutorBots yet": "No TutorBots yet",
- "Create your first TutorBot to get started.": "Create your first TutorBot to get started.",
"Stop": "Stop",
"Stop generating": "Stop generating",
"Answer now": "Answer now",
@@ -869,7 +861,6 @@
"Unsaved changes": "Unsaved changes",
"{{file}} is empty": "{{file}} is empty",
"Switch to Edit to add content.": "Switch to Edit to add content.",
- "Reusable soul templates for creating TutorBots.": "Reusable soul templates for creating TutorBots.",
"New Soul": "New Soul",
"Content": "Content",
"e.g. Creative Writer": "e.g. Creative Writer",
@@ -1221,7 +1212,7 @@
"RAG provider": "RAG provider",
"On-disk path": "On-disk path",
"Default knowledge base": "Default knowledge base",
- "The default KB is selected automatically in chat & TutorBot.": "The default KB is selected automatically in chat & TutorBot.",
+ "The default KB is selected automatically in chat & partners.": "The default KB is selected automatically in chat & partners.",
"Currently default": "Currently default",
"Set as default": "Set as default",
"Danger zone": "Danger zone",
@@ -1659,7 +1650,6 @@
"Ask a question about this page. The current chapter content is sent to the assistant automatically.": "Ask a question about this page. The current chapter content is sent to the assistant automatically.",
"Ask about this page...": "Ask about this page...",
"Chat tooltip": "Multi-tool AI chat and search.",
- "TutorBot tooltip": "Persistent, specialized AI agents.",
"Co-Writer tooltip": "AI-powered document editor.",
"Book tooltip": "Create AI-powered books.",
"Knowledge tooltip": "Manage learning personas.",
@@ -2364,5 +2354,7 @@
"That file is too large.": "That file is too large.",
"Could not read that image.": "Could not read that image.",
"Please use the attached file(s).": "Please use the attached file(s).",
- "This channel is not available on the server.": "This channel is not available on the server."
+ "This channel is not available on the server.": "This channel is not available on the server.",
+ "Partner": "Partner",
+ "Edited — your version becomes this partner's soul. The original template is untouched.": "Edited — your version becomes this partner's soul. The original template is untouched."
}
diff --git a/web/locales/zh/app.json b/web/locales/zh/app.json
index 386df320f..86322727c 100644
--- a/web/locales/zh/app.json
+++ b/web/locales/zh/app.json
@@ -122,7 +122,6 @@
"Research in progress...": "研究进行中…",
"Co-Writer": "智能写作",
"Intelligent markdown editor with AI-powered writing assistance.": "带 AI 写作辅助的智能 Markdown 编辑器。",
- "TutorBot": "辅导机器人",
"Knowledge": "知识库",
"Memory": "记忆",
"Knowledge Bases": "知识库",
@@ -391,7 +390,6 @@
"session": "个会话",
"sessions": "个会话",
"Chat": "聊天",
- "Tutorbot": "辅导机器人",
"No history found": "未找到历史记录",
"Your activities will appear here": "您的活动将显示在这里",
"Continue": "继续",
@@ -769,12 +767,9 @@
"Streams config snapshot, request target, response summary, and service-specific validation for the active {{service}} profile.": "为当前 {{service}} 配置文件流式输出配置快照、请求目标、响应摘要和服务特定验证。",
"Run Terminal Tour": "运行终端引导",
"Loading settings...": "加载设置中…",
- "TutorBot Agents": "TutorBot 代理",
- "Manage your in-process TutorBot instances": "管理正在运行的 TutorBot 实例",
"Bots": "机器人",
"Souls": "灵魂",
"New Bot": "新建机器人",
- "Create TutorBot": "创建 TutorBot",
"(optional)": "(可选)",
"e.g. Math Tutor": "例如:数学辅导",
"A brief description of what this bot does": "简要描述该机器人的功能",
@@ -782,14 +777,11 @@
"Define the bot's personality, values, and communication style in markdown...": "用 Markdown 定义机器人的性格、价值观和沟通风格…",
"Pick a soul from the library above, or write your own. Manage the library in the Souls tab.": "从上方的灵魂库中选择,或自行编写。可在「灵魂」标签页管理灵魂库。",
"Uses default model if empty": "留空则使用默认模型",
- "Applies to this TutorBot": "应用于这个 TutorBot",
"Choose a configured Settings model, or keep the system default.": "选择设置中已配置的模型,或保留系统默认。",
"Model saved": "模型已保存",
"Failed to save model": "模型保存失败",
"Selected model": "已选择模型",
"Create & Start": "创建并启动",
- "No TutorBots yet": "暂无 TutorBot",
- "Create your first TutorBot to get started.": "创建你的第一个 TutorBot 开始使用。",
"Stop": "停止",
"Stop generating": "停止生成",
"Answer now": "直接回答",
@@ -804,7 +796,6 @@
"Unsaved changes": "有未保存的更改",
"{{file}} is empty": "{{file}} 为空",
"Switch to Edit to add content.": "切换到编辑模式以添加内容。",
- "Reusable soul templates for creating TutorBots.": "可复用的灵魂模板,用于创建 TutorBot。",
"New Soul": "新建灵魂",
"Content": "内容",
"e.g. Creative Writer": "例如:创意写手",
@@ -1321,7 +1312,7 @@
"RAG provider": "RAG 提供商",
"On-disk path": "磁盘路径",
"Default knowledge base": "默认知识库",
- "The default KB is selected automatically in chat & TutorBot.": "默认知识库会在 Chat 与 TutorBot 中被自动选用。",
+ "The default KB is selected automatically in chat & partners.": "默认知识库会在 Chat 与伙伴中被自动选用。",
"Currently default": "当前默认",
"Set as default": "设为默认",
"Danger zone": "危险操作",
@@ -1758,7 +1749,6 @@
"Ask a question about this page. The current chapter content is sent to the assistant automatically.": "可以询问本页内容。当前章节内容会自动发送给助手。",
"Ask about this page...": "询问本页内容…",
"Chat tooltip": "多工具 AI 对话与搜索。",
- "TutorBot tooltip": "常驻的专业 AI 智能体。",
"Co-Writer tooltip": "AI 驱动的协作文档编辑器。",
"Book tooltip": "生成交互式 AI 书籍。",
"Knowledge tooltip": "管理文档与教学人设。",
@@ -2364,5 +2354,7 @@
"That file is too large.": "文件太大了。",
"Could not read that image.": "无法读取该图片。",
"Please use the attached file(s).": "请结合附件文件回答。",
- "This channel is not available on the server.": "该频道在此服务器上不可用。"
+ "This channel is not available on the server.": "该频道在此服务器上不可用。",
+ "Partner": "伙伴",
+ "Edited — your version becomes this partner's soul. The original template is untouched.": "已编辑——你的版本将成为这个伙伴的 soul,原模板保持不变。"
}
diff --git a/web/proxy.ts b/web/proxy.ts
index f6f51b569..1e3631a2c 100644
--- a/web/proxy.ts
+++ b/web/proxy.ts
@@ -44,7 +44,7 @@ export function proxy(req: NextRequest) {
// Check expiry from payload (base64url-decoded JSON)
try {
const payload = JSON.parse(
- Buffer.from(parts[1], "base64url").toString("utf-8")
+ Buffer.from(parts[1], "base64url").toString("utf-8"),
);
if (payload.exp && Date.now() >= payload.exp * 1000) {
const loginUrl = req.nextUrl.clone();
diff --git a/web/public/provider-icons/aihubmix-color.svg b/web/public/provider-icons/aihubmix-color.svg
index 82ba4ca88..60dca06bc 100644
--- a/web/public/provider-icons/aihubmix-color.svg
+++ b/web/public/provider-icons/aihubmix-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>AiHubMix</title><path d="M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12z" fill="#006FFB"></path><path clip-rule="evenodd" d="M11.24 8.393c.095-.644.302-1.47.624-2.48L12 5.496l.136.417c.322 1.01.53 1.836.624 2.48.071.472.071 1.072 0 1.8-.072.731-.072 1.336 0 1.814.106.7.426 1.281.96 1.744a2.795 2.795 0 001.89.708 2.78 2.78 0 002.034-.84c.56-.559.842-1.234.848-2.024.003-.7.075-1.472.216-2.316.069-.422.14-.775.21-1.06l.095-.384.168.356a7.862 7.862 0 01.76 3.244v.16a7.84 7.84 0 01-.624 3.089 7.952 7.952 0 01-4.228 4.228 7.841 7.841 0 01-3.089.623 7.84 7.84 0 01-3.089-.623 7.952 7.952 0 01-4.228-4.228 7.84 7.84 0 01-.623-3.09v-.159a7.862 7.862 0 01.759-3.244l.169-.356.093.385c.072.284.143.637.211 1.059.141.844.213 1.616.216 2.316.006.79.29 1.465.848 2.024.563.56 1.241.84 2.035.84.715 0 1.345-.236 1.889-.708a2.79 2.79 0 00.96-1.744c.073-.478.073-1.083 0-1.814-.071-.728-.071-1.328 0-1.8zm.76 9.694c1.097 0 2.125-.26 3.085-.778a6.379 6.379 0 001.77-1.399c.063-.07-.01-.178-.101-.153-.37.1-.75.15-1.144.15a4.236 4.236 0 01-2.18-.59 4.253 4.253 0 01-1.35-1.233.099.099 0 00-.16 0 4.253 4.253 0 01-1.35 1.232 4.236 4.236 0 01-2.18.591c-.393 0-.774-.05-1.143-.15-.091-.025-.165.083-.102.153a6.38 6.38 0 001.77 1.399c.96.518 1.988.778 3.085.778z" fill="#fff" fill-rule="evenodd"></path></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>AiHubMix</title><path d="M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12z" fill="#006FFB"></path><path clip-rule="evenodd" d="M11.24 8.393c.095-.644.302-1.47.624-2.48L12 5.496l.136.417c.322 1.01.53 1.836.624 2.48.071.472.071 1.072 0 1.8-.072.731-.072 1.336 0 1.814.106.7.426 1.281.96 1.744a2.795 2.795 0 001.89.708 2.78 2.78 0 002.034-.84c.56-.559.842-1.234.848-2.024.003-.7.075-1.472.216-2.316.069-.422.14-.775.21-1.06l.095-.384.168.356a7.862 7.862 0 01.76 3.244v.16a7.84 7.84 0 01-.624 3.089 7.952 7.952 0 01-4.228 4.228 7.841 7.841 0 01-3.089.623 7.84 7.84 0 01-3.089-.623 7.952 7.952 0 01-4.228-4.228 7.84 7.84 0 01-.623-3.09v-.159a7.862 7.862 0 01.759-3.244l.169-.356.093.385c.072.284.143.637.211 1.059.141.844.213 1.616.216 2.316.006.79.29 1.465.848 2.024.563.56 1.241.84 2.035.84.715 0 1.345-.236 1.889-.708a2.79 2.79 0 00.96-1.744c.073-.478.073-1.083 0-1.814-.071-.728-.071-1.328 0-1.8zm.76 9.694c1.097 0 2.125-.26 3.085-.778a6.379 6.379 0 001.77-1.399c.063-.07-.01-.178-.101-.153-.37.1-.75.15-1.144.15a4.236 4.236 0 01-2.18-.59 4.253 4.253 0 01-1.35-1.233.099.099 0 00-.16 0 4.253 4.253 0 01-1.35 1.232 4.236 4.236 0 01-2.18.591c-.393 0-.774-.05-1.143-.15-.091-.025-.165.083-.102.153a6.38 6.38 0 001.77 1.399c.96.518 1.988.778 3.085.778z" fill="#fff" fill-rule="evenodd"></path></svg>
diff --git a/web/public/provider-icons/anthropic.svg b/web/public/provider-icons/anthropic.svg
index 5b81844cb..b93d6a02f 100644
--- a/web/public/provider-icons/anthropic.svg
+++ b/web/public/provider-icons/anthropic.svg
@@ -1 +1 @@
-<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Anthropic</title><path d="M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z"></path></svg>
\ No newline at end of file
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Anthropic</title><path d="M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z"></path></svg>
diff --git a/web/public/provider-icons/azure-color.svg b/web/public/provider-icons/azure-color.svg
index b3df86558..56b12eb73 100644
--- a/web/public/provider-icons/azure-color.svg
+++ b/web/public/provider-icons/azure-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Azure</title><path d="M7.242 1.613A1.11 1.11 0 018.295.857h6.977L8.03 22.316a1.11 1.11 0 01-1.052.755h-5.43a1.11 1.11 0 01-1.053-1.466L7.242 1.613z" fill="url(#lobe-icons-azure-0-_R_0_)"></path><path d="M18.397 15.296H7.4a.51.51 0 00-.347.882l7.066 6.595c.206.192.477.298.758.298h6.226l-2.706-7.775z" fill="#0078D4"></path><path d="M15.272.857H7.497L0 23.071h7.775l1.596-4.73 5.068 4.73h6.665l-2.707-7.775h-7.998L15.272.857z" fill="url(#lobe-icons-azure-1-_R_0_)"></path><path d="M17.193 1.613a1.11 1.11 0 00-1.052-.756h-7.81.035c.477 0 .9.304 1.052.756l6.748 19.992a1.11 1.11 0 01-1.052 1.466h-.12 7.895a1.11 1.11 0 001.052-1.466L17.193 1.613z" fill="url(#lobe-icons-azure-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-0-_R_0_" x1="8.247" x2="1.002" y1="1.626" y2="23.03"><stop stop-color="#114A8B"></stop><stop offset="1" stop-color="#0669BC"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-1-_R_0_" x1="14.042" x2="12.324" y1="15.302" y2="15.888"><stop stop-opacity=".3"></stop><stop offset=".071" stop-opacity=".2"></stop><stop offset=".321" stop-opacity=".1"></stop><stop offset=".623" stop-opacity=".05"></stop><stop offset="1" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-2-_R_0_" x1="12.841" x2="20.793" y1="1.626" y2="22.814"><stop stop-color="#3CCBF4"></stop><stop offset="1" stop-color="#2892DF"></stop></linearGradient></defs></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Azure</title><path d="M7.242 1.613A1.11 1.11 0 018.295.857h6.977L8.03 22.316a1.11 1.11 0 01-1.052.755h-5.43a1.11 1.11 0 01-1.053-1.466L7.242 1.613z" fill="url(#lobe-icons-azure-0-_R_0_)"></path><path d="M18.397 15.296H7.4a.51.51 0 00-.347.882l7.066 6.595c.206.192.477.298.758.298h6.226l-2.706-7.775z" fill="#0078D4"></path><path d="M15.272.857H7.497L0 23.071h7.775l1.596-4.73 5.068 4.73h6.665l-2.707-7.775h-7.998L15.272.857z" fill="url(#lobe-icons-azure-1-_R_0_)"></path><path d="M17.193 1.613a1.11 1.11 0 00-1.052-.756h-7.81.035c.477 0 .9.304 1.052.756l6.748 19.992a1.11 1.11 0 01-1.052 1.466h-.12 7.895a1.11 1.11 0 001.052-1.466L17.193 1.613z" fill="url(#lobe-icons-azure-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-0-_R_0_" x1="8.247" x2="1.002" y1="1.626" y2="23.03"><stop stop-color="#114A8B"></stop><stop offset="1" stop-color="#0669BC"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-1-_R_0_" x1="14.042" x2="12.324" y1="15.302" y2="15.888"><stop stop-opacity=".3"></stop><stop offset=".071" stop-opacity=".2"></stop><stop offset=".321" stop-opacity=".1"></stop><stop offset=".623" stop-opacity=".05"></stop><stop offset="1" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-2-_R_0_" x1="12.841" x2="20.793" y1="1.626" y2="22.814"><stop stop-color="#3CCBF4"></stop><stop offset="1" stop-color="#2892DF"></stop></linearGradient></defs></svg>
diff --git a/web/public/provider-icons/baidu-color.svg b/web/public/provider-icons/baidu-color.svg
index ead7f8982..a9f84751c 100644
--- a/web/public/provider-icons/baidu-color.svg
+++ b/web/public/provider-icons/baidu-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Baidu</title><path d="M8.859 11.735c1.017-1.71 4.059-3.083 6.202.286 1.579 2.284 4.284 4.397 4.284 4.397s2.027 1.601.73 4.684c-1.24 2.956-5.64 1.607-6.005 1.49l-.024-.009s-1.746-.568-3.776-.112c-2.026.458-3.773.286-3.773.286l-.045-.001c-.328-.01-2.38-.187-3.001-2.968-.675-3.028 2.365-4.687 2.592-4.968.226-.288 1.802-1.37 2.816-3.085zm.986 1.738v2.032h-1.64s-1.64.138-2.213 2.014c-.2 1.252.177 1.99.242 2.148.067.157.596 1.073 1.927 1.342h3.078v-7.514l-1.394-.022zm3.588 2.191l-1.44.024v3.956s.064.985 1.44 1.344h3.541v-5.3h-1.528v3.979h-1.46s-.466-.068-.553-.447v-3.556zM9.82 16.715v3.06H8.58s-.863-.045-1.126-1.049c-.136-.445.02-.959.088-1.16.063-.203.353-.671.951-.85H9.82zm9.525-9.036c2.086 0 2.646 2.06 2.646 2.742 0 .688.284 3.597-2.309 3.655-2.595.057-2.704-1.77-2.704-3.08 0-1.374.277-3.317 2.367-3.317zM4.24 6.08c1.523-.135 2.645 1.55 2.762 2.513.07.625.393 3.486-1.975 4-2.364.515-3.244-2.249-2.984-3.544 0 0 .28-2.797 2.197-2.969zm8.847-1.483c.14-1.31 1.69-3.316 2.931-3.028 1.236.285 2.367 1.944 2.137 3.37-.224 1.428-1.345 3.313-3.095 3.082-1.748-.226-2.143-1.823-1.973-3.424zM9.425 1c1.307 0 2.364 1.519 2.364 3.398 0 1.879-1.057 3.4-2.364 3.4s-2.367-1.521-2.367-3.4C7.058 2.518 8.118 1 9.425 1z" fill="#2932E1" fill-rule="nonzero"></path></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Baidu</title><path d="M8.859 11.735c1.017-1.71 4.059-3.083 6.202.286 1.579 2.284 4.284 4.397 4.284 4.397s2.027 1.601.73 4.684c-1.24 2.956-5.64 1.607-6.005 1.49l-.024-.009s-1.746-.568-3.776-.112c-2.026.458-3.773.286-3.773.286l-.045-.001c-.328-.01-2.38-.187-3.001-2.968-.675-3.028 2.365-4.687 2.592-4.968.226-.288 1.802-1.37 2.816-3.085zm.986 1.738v2.032h-1.64s-1.64.138-2.213 2.014c-.2 1.252.177 1.99.242 2.148.067.157.596 1.073 1.927 1.342h3.078v-7.514l-1.394-.022zm3.588 2.191l-1.44.024v3.956s.064.985 1.44 1.344h3.541v-5.3h-1.528v3.979h-1.46s-.466-.068-.553-.447v-3.556zM9.82 16.715v3.06H8.58s-.863-.045-1.126-1.049c-.136-.445.02-.959.088-1.16.063-.203.353-.671.951-.85H9.82zm9.525-9.036c2.086 0 2.646 2.06 2.646 2.742 0 .688.284 3.597-2.309 3.655-2.595.057-2.704-1.77-2.704-3.08 0-1.374.277-3.317 2.367-3.317zM4.24 6.08c1.523-.135 2.645 1.55 2.762 2.513.07.625.393 3.486-1.975 4-2.364.515-3.244-2.249-2.984-3.544 0 0 .28-2.797 2.197-2.969zm8.847-1.483c.14-1.31 1.69-3.316 2.931-3.028 1.236.285 2.367 1.944 2.137 3.37-.224 1.428-1.345 3.313-3.095 3.082-1.748-.226-2.143-1.823-1.973-3.424zM9.425 1c1.307 0 2.364 1.519 2.364 3.398 0 1.879-1.057 3.4-2.364 3.4s-2.367-1.521-2.367-3.4C7.058 2.518 8.118 1 9.425 1z" fill="#2932E1" fill-rule="nonzero"></path></svg>
diff --git a/web/public/provider-icons/baiducloud-color.svg b/web/public/provider-icons/baiducloud-color.svg
index 40565efc0..fc7038364 100644
--- a/web/public/provider-icons/baiducloud-color.svg
+++ b/web/public/provider-icons/baiducloud-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>BaiduCloud</title><path d="M21.715 5.61l-3.983 2.31a.903.903 0 01-.896 0L12.44 5.384a.903.903 0 00-.897 0L7.156 7.92a.903.903 0 01-.896 0L2.276 5.617 12.002 0l9.713 5.61z" fill="#5BCA87"></path><path d="M18.641 9.467a.89.89 0 00-.438.77v5.072a.896.896 0 01-.445.77l-4.428 2.51a.884.884 0 00-.445.777v4.607l4.429-2.536 5.31-3.047V7.157l-3.983 2.31z" fill="#EC5D3E"></path><path d="M10.98 18.941a.936.936 0 00-.305-.352l-4.429-2.516a.903.903 0 01-.431-.764v-5.078a.89.89 0 00-.452-.757l-.451-.26L1.38 7.158V18.39l5.311 3.047L11.126 24v-4.608a.881.881 0 00-.146-.45z" fill="#2464F5"></path></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>BaiduCloud</title><path d="M21.715 5.61l-3.983 2.31a.903.903 0 01-.896 0L12.44 5.384a.903.903 0 00-.897 0L7.156 7.92a.903.903 0 01-.896 0L2.276 5.617 12.002 0l9.713 5.61z" fill="#5BCA87"></path><path d="M18.641 9.467a.89.89 0 00-.438.77v5.072a.896.896 0 01-.445.77l-4.428 2.51a.884.884 0 00-.445.777v4.607l4.429-2.536 5.31-3.047V7.157l-3.983 2.31z" fill="#EC5D3E"></path><path d="M10.98 18.941a.936.936 0 00-.305-.352l-4.429-2.516a.903.903 0 01-.431-.764v-5.078a.89.89 0 00-.452-.757l-.451-.26L1.38 7.158V18.39l5.311 3.047L11.126 24v-4.608a.881.881 0 00-.146-.45z" fill="#2464F5"></path></svg>
diff --git a/web/public/provider-icons/brave.svg b/web/public/provider-icons/brave.svg
index 3c7f46816..8c56fec96 100644
--- a/web/public/provider-icons/brave.svg
+++ b/web/public/provider-icons/brave.svg
@@ -1 +1 @@
-<svg fill="#FB542B" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Brave</title><path d="M15.68 0l2.096 2.38s1.84-.512 2.709.358c.868.87 1.584 1.638 1.584 1.638l-.562 1.381.715 2.047s-2.104 7.98-2.35 8.955c-.486 1.919-.818 2.66-2.198 3.633-1.38.972-3.884 2.66-4.293 2.916-.409.256-.92.692-1.38.692-.46 0-.97-.436-1.38-.692a185.796 185.796 0 01-4.293-2.916c-1.38-.973-1.712-1.714-2.197-3.633-.247-.975-2.351-8.955-2.351-8.955l.715-2.047-.562-1.381s.716-.768 1.585-1.638c.868-.87 2.708-.358 2.708-.358L8.321 0h7.36zm-3.679 14.936c-.14 0-1.038.317-1.758.69-.72.373-1.242.637-1.409.742-.167.104-.065.301.087.409.152.107 2.194 1.69 2.393 1.866.198.175.489.464.687.464.198 0 .49-.29.688-.464.198-.175 2.24-1.759 2.392-1.866.152-.108.254-.305.087-.41-.167-.104-.689-.368-1.41-.741-.72-.373-1.617-.69-1.757-.69zm0-11.278s-.409.001-1.022.206-1.278.46-1.584.46c-.307 0-2.581-.434-2.581-.434S4.119 7.152 4.119 7.849c0 .697.339.881.68 1.243l2.02 2.149c.192.203.59.511.356 1.066-.235.555-.58 1.26-.196 1.977.384.716 1.042 1.194 1.464 1.115.421-.08 1.412-.598 1.776-.834.364-.237 1.518-1.19 1.518-1.554 0-.365-1.193-1.02-1.413-1.168-.22-.15-1.226-.725-1.247-.95-.02-.227-.012-.293.284-.851.297-.559.831-1.304.742-1.8-.089-.495-.95-.753-1.565-.986-.615-.232-1.799-.671-1.947-.74-.148-.068-.11-.133.339-.175.448-.043 1.719-.212 2.292-.052.573.16 1.552.403 1.632.532.079.13.149.134.067.579-.081.445-.5 2.581-.541 2.96-.04.38-.12.63.288.724.409.094 1.097.256 1.333.256s.924-.162 1.333-.256c.408-.093.329-.344.288-.723-.04-.38-.46-2.516-.541-2.961-.082-.445-.012-.45.067-.579.08-.129 1.059-.372 1.632-.532.573-.16 1.845.009 2.292.052.449.042.487.107.339.175-.148.069-1.332.508-1.947.74-.615.233-1.476.49-1.565.986-.09.496.445 1.241.742 1.8.297.558.304.624.284.85-.02.226-1.026.802-1.247.95-.22.15-1.413.804-1.413 1.169 0 .364 1.154 1.317 1.518 1.554.364.236 1.355.755 1.776.834.422.079 1.08-.4 1.464-1.115.384-.716.039-1.422-.195-1.977-.235-.555.163-.863.355-1.066l2.02-2.149c.341-.362.68-.546.68-1.243 0-.697-2.695-3.96-2.695-3.96s-2.274.436-2.58.436c-.307 0-.972-.256-1.585-.461-.613-.205-1.022-.206-1.022-.206z"/></svg>
\ No newline at end of file
+<svg fill="#FB542B" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Brave</title><path d="M15.68 0l2.096 2.38s1.84-.512 2.709.358c.868.87 1.584 1.638 1.584 1.638l-.562 1.381.715 2.047s-2.104 7.98-2.35 8.955c-.486 1.919-.818 2.66-2.198 3.633-1.38.972-3.884 2.66-4.293 2.916-.409.256-.92.692-1.38.692-.46 0-.97-.436-1.38-.692a185.796 185.796 0 01-4.293-2.916c-1.38-.973-1.712-1.714-2.197-3.633-.247-.975-2.351-8.955-2.351-8.955l.715-2.047-.562-1.381s.716-.768 1.585-1.638c.868-.87 2.708-.358 2.708-.358L8.321 0h7.36zm-3.679 14.936c-.14 0-1.038.317-1.758.69-.72.373-1.242.637-1.409.742-.167.104-.065.301.087.409.152.107 2.194 1.69 2.393 1.866.198.175.489.464.687.464.198 0 .49-.29.688-.464.198-.175 2.24-1.759 2.392-1.866.152-.108.254-.305.087-.41-.167-.104-.689-.368-1.41-.741-.72-.373-1.617-.69-1.757-.69zm0-11.278s-.409.001-1.022.206-1.278.46-1.584.46c-.307 0-2.581-.434-2.581-.434S4.119 7.152 4.119 7.849c0 .697.339.881.68 1.243l2.02 2.149c.192.203.59.511.356 1.066-.235.555-.58 1.26-.196 1.977.384.716 1.042 1.194 1.464 1.115.421-.08 1.412-.598 1.776-.834.364-.237 1.518-1.19 1.518-1.554 0-.365-1.193-1.02-1.413-1.168-.22-.15-1.226-.725-1.247-.95-.02-.227-.012-.293.284-.851.297-.559.831-1.304.742-1.8-.089-.495-.95-.753-1.565-.986-.615-.232-1.799-.671-1.947-.74-.148-.068-.11-.133.339-.175.448-.043 1.719-.212 2.292-.052.573.16 1.552.403 1.632.532.079.13.149.134.067.579-.081.445-.5 2.581-.541 2.96-.04.38-.12.63.288.724.409.094 1.097.256 1.333.256s.924-.162 1.333-.256c.408-.093.329-.344.288-.723-.04-.38-.46-2.516-.541-2.961-.082-.445-.012-.45.067-.579.08-.129 1.059-.372 1.632-.532.573-.16 1.845.009 2.292.052.449.042.487.107.339.175-.148.069-1.332.508-1.947.74-.615.233-1.476.49-1.565.986-.09.496.445 1.241.742 1.8.297.558.304.624.284.85-.02.226-1.026.802-1.247.95-.22.15-1.413.804-1.413 1.169 0 .364 1.154 1.317 1.518 1.554.364.236 1.355.755 1.776.834.422.079 1.08-.4 1.464-1.115.384-.716.039-1.422-.195-1.977-.235-.555.163-.863.355-1.066l2.02-2.149c.341-.362.68-.546.68-1.243 0-.697-2.695-3.96-2.695-3.96s-2.274.436-2.58.436c-.307 0-.972-.256-1.585-.461-.613-.205-1.022-.206-1.022-.206z"/></svg>
diff --git a/web/public/provider-icons/bytedance-color.svg b/web/public/provider-icons/bytedance-color.svg
index 6921097da..2dd4fe7bd 100644
--- a/web/public/provider-icons/bytedance-color.svg
+++ b/web/public/provider-icons/bytedance-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>ByteDance</title><path d="M14.944 18.587l-1.704-.445V10.01l1.824-.462c1-.254 1.84-.461 1.88-.453.032 0 .056 2.235.056 4.972v4.973l-.176-.008c-.104 0-.952-.207-1.88-.446z" fill="#00C8D2" fill-rule="nonzero"></path><path d="M7 16.542c0-2.736.024-4.98.064-4.98.032-.008.872.2 1.88.454l1.816.461-.016 4.05-.024 4.049-1.632.422c-.896.23-1.736.445-1.856.469L7 21.523v-4.98z" fill="#3C8CFF" fill-rule="nonzero"></path><path d="M19.24 12.477c0-9.03.008-9.515.144-9.475.072.024.784.207 1.576.406.792.207 1.576.405 1.744.445l.296.08-.016 8.56-.024 8.568-1.624.414c-.888.23-1.728.437-1.856.47l-.24.055v-9.523z" fill="#78E6DC" fill-rule="nonzero"></path><path d="M1 12.509c0-4.678.024-8.505.064-8.505.032 0 .872.207 1.872.454l1.824.461v7.582c0 4.16-.016 7.574-.032 7.574-.024 0-.872.215-1.88.47L1 21.013v-8.505z" fill="#325AB4"></path></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>ByteDance</title><path d="M14.944 18.587l-1.704-.445V10.01l1.824-.462c1-.254 1.84-.461 1.88-.453.032 0 .056 2.235.056 4.972v4.973l-.176-.008c-.104 0-.952-.207-1.88-.446z" fill="#00C8D2" fill-rule="nonzero"></path><path d="M7 16.542c0-2.736.024-4.98.064-4.98.032-.008.872.2 1.88.454l1.816.461-.016 4.05-.024 4.049-1.632.422c-.896.23-1.736.445-1.856.469L7 21.523v-4.98z" fill="#3C8CFF" fill-rule="nonzero"></path><path d="M19.24 12.477c0-9.03.008-9.515.144-9.475.072.024.784.207 1.576.406.792.207 1.576.405 1.744.445l.296.08-.016 8.56-.024 8.568-1.624.414c-.888.23-1.728.437-1.856.47l-.24.055v-9.523z" fill="#78E6DC" fill-rule="nonzero"></path><path d="M1 12.509c0-4.678.024-8.505.064-8.505.032 0 .872.207 1.872.454l1.824.461v7.582c0 4.16-.016 7.574-.032 7.574-.024 0-.872.215-1.88.47L1 21.013v-8.505z" fill="#325AB4"></path></svg>
diff --git a/web/public/provider-icons/cohere-color.svg b/web/public/provider-icons/cohere-color.svg
index 94bcb82cf..1509c50a7 100644
--- a/web/public/provider-icons/cohere-color.svg
+++ b/web/public/provider-icons/cohere-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cohere</title><path clip-rule="evenodd" d="M8.128 14.099c.592 0 1.77-.033 3.398-.703 1.897-.781 5.672-2.2 8.395-3.656 1.905-1.018 2.74-2.366 2.74-4.18A4.56 4.56 0 0018.1 1H7.549A6.55 6.55 0 001 7.55c0 3.617 2.745 6.549 7.128 6.549z" fill="#39594D" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M9.912 18.61a4.387 4.387 0 012.705-4.052l3.323-1.38c3.361-1.394 7.06 1.076 7.06 4.715a5.104 5.104 0 01-5.105 5.104l-3.597-.001a4.386 4.386 0 01-4.386-4.387z" fill="#D18EE2" fill-rule="evenodd"></path><path d="M4.776 14.962A3.775 3.775 0 001 18.738v.489a3.776 3.776 0 007.551 0v-.49a3.775 3.775 0 00-3.775-3.775z" fill="#FF7759"></path></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cohere</title><path clip-rule="evenodd" d="M8.128 14.099c.592 0 1.77-.033 3.398-.703 1.897-.781 5.672-2.2 8.395-3.656 1.905-1.018 2.74-2.366 2.74-4.18A4.56 4.56 0 0018.1 1H7.549A6.55 6.55 0 001 7.55c0 3.617 2.745 6.549 7.128 6.549z" fill="#39594D" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M9.912 18.61a4.387 4.387 0 012.705-4.052l3.323-1.38c3.361-1.394 7.06 1.076 7.06 4.715a5.104 5.104 0 01-5.105 5.104l-3.597-.001a4.386 4.386 0 01-4.386-4.387z" fill="#D18EE2" fill-rule="evenodd"></path><path d="M4.776 14.962A3.775 3.775 0 001 18.738v.489a3.776 3.776 0 007.551 0v-.49a3.775 3.775 0 00-3.775-3.775z" fill="#FF7759"></path></svg>
diff --git a/web/public/provider-icons/deepseek-color.svg b/web/public/provider-icons/deepseek-color.svg
index 3fc230240..52eec25cd 100644
--- a/web/public/provider-icons/deepseek-color.svg
+++ b/web/public/provider-icons/deepseek-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>DeepSeek</title><path d="M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z" fill="#4D6BFE"></path></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>DeepSeek</title><path d="M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z" fill="#4D6BFE"></path></svg>
diff --git a/web/public/provider-icons/duckduckgo.svg b/web/public/provider-icons/duckduckgo.svg
index 5de935ae5..20d9dd64f 100644
--- a/web/public/provider-icons/duckduckgo.svg
+++ b/web/public/provider-icons/duckduckgo.svg
@@ -1 +1 @@
-<svg fill="#DE5833" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>DuckDuckGo</title><path d="M12 0C5.37 0 0 5.37 0 12s5.37 12 12 12 12-5.37 12-12S18.63 0 12 0zm0 .984C18.083.984 23.016 5.916 23.016 12S18.084 23.016 12 23.016.984 18.084.984 12C.984 5.917 5.916.984 12 .984zm0 .938C6.434 1.922 1.922 6.434 1.922 12c0 4.437 2.867 8.205 6.85 9.55-.237-.82-.776-2.753-1.6-6.052-1.184-4.741-2.064-8.606 2.379-9.813.047-.011.064-.064.03-.093-.514-.467-1.382-.548-2.233-.38a.06.06 0 0 1-.07-.058c0-.011 0-.023.011-.035.205-.286.572-.507.822-.64a1.843 1.843 0 0 0-.607-.335c-.059-.022-.059-.12-.006-.144.006-.006.012-.012.024-.012 1.749-.233 3.586.292 4.49 1.448.011.011.023.017.035.023 2.968.635 3.509 4.837 3.328 5.998a9.607 9.607 0 0 0 2.346-.576c.746-.286 1.008-.222 1.101-.053.1.193-.018.513-.28.81-.496.567-1.393 1.01-2.974 1.137-.546.044-1.029.024-1.445.006-.789-.035-1.339-.059-1.633.39-.192.298-.041.998 1.487 1.22 1.09.157 2.078.047 2.798-.034.643-.07 1.073-.118 1.172.069.21.402-.996 1.207-3.066 1.224-.158 0-.315-.006-.467-.011-1.283-.065-2.227-.414-2.816-.735a.094.094 0 0 1-.035-.017c-.105-.059-.31.045-.188.267.07.134.444.478 1.004.776-.058.466.087 1.184.338 2l.088-.016c.041-.009.087-.019.134-.025.507-.082.775.012.926.175.717-.536 1.913-1.294 2.03-1.154.583.694.66 2.332.53 2.99-.004.012-.017.024-.04.035-.274.117-1.783-.296-1.783-.511-.059-1.075-.26-1.173-.493-1.225h-.156c.006.006.012.018.018.03l.052.12c.093.257.24 1.063.13 1.26-.112.199-.835.297-1.284.303-.443.006-.543-.158-.637-.408-.07-.204-.103-.675-.103-.95a.857.857 0 0 1 .012-.216c-.134.058-.333.193-.397.281-.017.262-.017.682.123 1.149.07.221-1.518 1.164-1.74.99-.227-.181-.634-1.952-.459-2.67-.187.017-.338.075-.42.191-.367.508.093 2.933.582 3.248.257.169 1.54-.553 2.176-1.095.105.145.305.158.553.158.326-.012.782-.06 1.103-.158.192.45.423.972.613 1.388 4.47-1.032 7.803-5.037 7.803-9.82 0-5.566-4.512-10.078-10.078-10.078zm1.791 5.646c-.42 0-.678.146-.795.332-.023.047.047.094.094.07.14-.075.357-.161.701-.156.328.006.516.09.67.159l.023.01c.041.017.088-.03.059-.065-.134-.18-.332-.35-.752-.35zm-5.078.198a1.24 1.24 0 0 0-.522.082c-.454.169-.67.526-.67.76 0 .051.112.057.141.011.081-.123.21-.31.617-.478.408-.17.73-.146.951-.094.047.012.083-.041.041-.07a.989.989 0 0 0-.558-.211zm5.434 1.423a.651.651 0 0 0-.655.647.652.652 0 0 0 1.307 0 .646.646 0 0 0-.652-.647zm.283.262h.008a.17.17 0 0 1 .17.17c0 .093-.077.17-.17.17a.17.17 0 0 1-.17-.17c0-.09.072-.165.162-.17zm-5.358.076a.752.752 0 0 0-.758.758c0 .42.338.758.758.758s.758-.337.758-.758a.756.756 0 0 0-.758-.758zm.328.303h.01c.112 0 .2.089.2.2 0 .11-.088.197-.2.197a.195.195 0 0 1-.197-.198c0-.107.082-.194.187-.199z"/></svg>
\ No newline at end of file
+<svg fill="#DE5833" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>DuckDuckGo</title><path d="M12 0C5.37 0 0 5.37 0 12s5.37 12 12 12 12-5.37 12-12S18.63 0 12 0zm0 .984C18.083.984 23.016 5.916 23.016 12S18.084 23.016 12 23.016.984 18.084.984 12C.984 5.917 5.916.984 12 .984zm0 .938C6.434 1.922 1.922 6.434 1.922 12c0 4.437 2.867 8.205 6.85 9.55-.237-.82-.776-2.753-1.6-6.052-1.184-4.741-2.064-8.606 2.379-9.813.047-.011.064-.064.03-.093-.514-.467-1.382-.548-2.233-.38a.06.06 0 0 1-.07-.058c0-.011 0-.023.011-.035.205-.286.572-.507.822-.64a1.843 1.843 0 0 0-.607-.335c-.059-.022-.059-.12-.006-.144.006-.006.012-.012.024-.012 1.749-.233 3.586.292 4.49 1.448.011.011.023.017.035.023 2.968.635 3.509 4.837 3.328 5.998a9.607 9.607 0 0 0 2.346-.576c.746-.286 1.008-.222 1.101-.053.1.193-.018.513-.28.81-.496.567-1.393 1.01-2.974 1.137-.546.044-1.029.024-1.445.006-.789-.035-1.339-.059-1.633.39-.192.298-.041.998 1.487 1.22 1.09.157 2.078.047 2.798-.034.643-.07 1.073-.118 1.172.069.21.402-.996 1.207-3.066 1.224-.158 0-.315-.006-.467-.011-1.283-.065-2.227-.414-2.816-.735a.094.094 0 0 1-.035-.017c-.105-.059-.31.045-.188.267.07.134.444.478 1.004.776-.058.466.087 1.184.338 2l.088-.016c.041-.009.087-.019.134-.025.507-.082.775.012.926.175.717-.536 1.913-1.294 2.03-1.154.583.694.66 2.332.53 2.99-.004.012-.017.024-.04.035-.274.117-1.783-.296-1.783-.511-.059-1.075-.26-1.173-.493-1.225h-.156c.006.006.012.018.018.03l.052.12c.093.257.24 1.063.13 1.26-.112.199-.835.297-1.284.303-.443.006-.543-.158-.637-.408-.07-.204-.103-.675-.103-.95a.857.857 0 0 1 .012-.216c-.134.058-.333.193-.397.281-.017.262-.017.682.123 1.149.07.221-1.518 1.164-1.74.99-.227-.181-.634-1.952-.459-2.67-.187.017-.338.075-.42.191-.367.508.093 2.933.582 3.248.257.169 1.54-.553 2.176-1.095.105.145.305.158.553.158.326-.012.782-.06 1.103-.158.192.45.423.972.613 1.388 4.47-1.032 7.803-5.037 7.803-9.82 0-5.566-4.512-10.078-10.078-10.078zm1.791 5.646c-.42 0-.678.146-.795.332-.023.047.047.094.094.07.14-.075.357-.161.701-.156.328.006.516.09.67.159l.023.01c.041.017.088-.03.059-.065-.134-.18-.332-.35-.752-.35zm-5.078.198a1.24 1.24 0 0 0-.522.082c-.454.169-.67.526-.67.76 0 .051.112.057.141.011.081-.123.21-.31.617-.478.408-.17.73-.146.951-.094.047.012.083-.041.041-.07a.989.989 0 0 0-.558-.211zm5.434 1.423a.651.651 0 0 0-.655.647.652.652 0 0 0 1.307 0 .646.646 0 0 0-.652-.647zm.283.262h.008a.17.17 0 0 1 .17.17c0 .093-.077.17-.17.17a.17.17 0 0 1-.17-.17c0-.09.072-.165.162-.17zm-5.358.076a.752.752 0 0 0-.758.758c0 .42.338.758.758.758s.758-.337.758-.758a.756.756 0 0 0-.758-.758zm.328.303h.01c.112 0 .2.089.2.2 0 .11-.088.197-.2.197a.195.195 0 0 1-.197-.198c0-.107.082-.194.187-.199z"/></svg>
diff --git a/web/public/provider-icons/exa-color.svg b/web/public/provider-icons/exa-color.svg
index 7b89500db..bdf0f7638 100644
--- a/web/public/provider-icons/exa-color.svg
+++ b/web/public/provider-icons/exa-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Exa</title><path clip-rule="evenodd" d="M3 0h19v1.791L13.892 12 22 22.209V24H3V0zm9.62 10.348l6.589-8.557H6.03l6.59 8.557zM5.138 3.935v7.17h5.52l-5.52-7.17zm5.52 8.96h-5.52v7.17l5.52-7.17zM6.03 22.21l6.59-8.557 6.589 8.557H6.03z" fill="#1F40ED" fill-rule="evenodd"></path></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Exa</title><path clip-rule="evenodd" d="M3 0h19v1.791L13.892 12 22 22.209V24H3V0zm9.62 10.348l6.589-8.557H6.03l6.59 8.557zM5.138 3.935v7.17h5.52l-5.52-7.17zm5.52 8.96h-5.52v7.17l5.52-7.17zM6.03 22.21l6.59-8.557 6.589 8.557H6.03z" fill="#1F40ED" fill-rule="evenodd"></path></svg>
diff --git a/web/public/provider-icons/gemini-color.svg b/web/public/provider-icons/gemini-color.svg
index 62681dfa7..0f2e39809 100644
--- a/web/public/provider-icons/gemini-color.svg
+++ b/web/public/provider-icons/gemini-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Gemini</title><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="#3186FF"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-0-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-1-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-0-_R_0_" x1="7" x2="11" y1="15.5" y2="12"><stop stop-color="#08B962"></stop><stop offset="1" stop-color="#08B962" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-1-_R_0_" x1="8" x2="11.5" y1="5.5" y2="11"><stop stop-color="#F94543"></stop><stop offset="1" stop-color="#F94543" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-2-_R_0_" x1="3.5" x2="17.5" y1="13.5" y2="12"><stop stop-color="#FABC12"></stop><stop offset=".46" stop-color="#FABC12" stop-opacity="0"></stop></linearGradient></defs></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Gemini</title><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="#3186FF"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-0-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-1-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-0-_R_0_" x1="7" x2="11" y1="15.5" y2="12"><stop stop-color="#08B962"></stop><stop offset="1" stop-color="#08B962" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-1-_R_0_" x1="8" x2="11.5" y1="5.5" y2="11"><stop stop-color="#F94543"></stop><stop offset="1" stop-color="#F94543" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-2-_R_0_" x1="3.5" x2="17.5" y1="13.5" y2="12"><stop stop-color="#FABC12"></stop><stop offset=".46" stop-color="#FABC12" stop-opacity="0"></stop></linearGradient></defs></svg>
diff --git a/web/public/provider-icons/githubcopilot.svg b/web/public/provider-icons/githubcopilot.svg
index 3cbf22a59..e152afe52 100644
--- a/web/public/provider-icons/githubcopilot.svg
+++ b/web/public/provider-icons/githubcopilot.svg
@@ -1 +1 @@
-<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>GithubCopilot</title><path d="M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"></path></svg>
\ No newline at end of file
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>GithubCopilot</title><path d="M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"></path></svg>
diff --git a/web/public/provider-icons/groq.svg b/web/public/provider-icons/groq.svg
index 7294646b9..d2953eedb 100644
--- a/web/public/provider-icons/groq.svg
+++ b/web/public/provider-icons/groq.svg
@@ -1 +1 @@
-<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Groq</title><path d="M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z"></path></svg>
\ No newline at end of file
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Groq</title><path d="M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z"></path></svg>
diff --git a/web/public/provider-icons/jina.svg b/web/public/provider-icons/jina.svg
index fc996bf90..9d79ff9f2 100644
--- a/web/public/provider-icons/jina.svg
+++ b/web/public/provider-icons/jina.svg
@@ -1 +1 @@
-<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Jina</title><path d="M6.608 21.416a4.608 4.608 0 100-9.217 4.608 4.608 0 000 9.217zM20.894 2.015c.614 0 1.106.492 1.106 1.106v9.002c0 5.13-4.148 9.309-9.217 9.37v-9.355l-.03-9.032c0-.614.491-1.106 1.106-1.106h7.158l-.123.015z"></path></svg>
\ No newline at end of file
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Jina</title><path d="M6.608 21.416a4.608 4.608 0 100-9.217 4.608 4.608 0 000 9.217zM20.894 2.015c.614 0 1.106.492 1.106 1.106v9.002c0 5.13-4.148 9.309-9.217 9.37v-9.355l-.03-9.032c0-.614.491-1.106 1.106-1.106h7.158l-.123.015z"></path></svg>
diff --git a/web/public/provider-icons/lmstudio.svg b/web/public/provider-icons/lmstudio.svg
index ea0816b63..ae5039616 100644
--- a/web/public/provider-icons/lmstudio.svg
+++ b/web/public/provider-icons/lmstudio.svg
@@ -1 +1 @@
-<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>LM Studio</title><path d="M2.84 2a1.273 1.273 0 100 2.547h14.107a1.273 1.273 0 100-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H22.04a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h14.106a1.274 1.274 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H15.38a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h14.106a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h9.698a1.273 1.273 0 100-2.547h-9.698z" fill-opacity=".3"></path><path d="M2.84 2a1.273 1.273 0 100 2.547h10.287a1.274 1.274 0 000-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H18.22a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H11.56a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h5.78a1.273 1.273 0 100-2.547h-5.78z"></path></svg>
\ No newline at end of file
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>LM Studio</title><path d="M2.84 2a1.273 1.273 0 100 2.547h14.107a1.273 1.273 0 100-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H22.04a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h14.106a1.274 1.274 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H15.38a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h14.106a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h9.698a1.273 1.273 0 100-2.547h-9.698z" fill-opacity=".3"></path><path d="M2.84 2a1.273 1.273 0 100 2.547h10.287a1.274 1.274 0 000-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H18.22a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H11.56a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h5.78a1.273 1.273 0 100-2.547h-5.78z"></path></svg>
diff --git a/web/public/provider-icons/minimax-color.svg b/web/public/provider-icons/minimax-color.svg
index beb7adb86..52b3a336e 100644
--- a/web/public/provider-icons/minimax-color.svg
+++ b/web/public/provider-icons/minimax-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Minimax</title><defs><linearGradient id="lobe-icons-minimax-_R_0_" x1="0%" x2="100.182%" y1="50.057%" y2="50.057%"><stop offset="0%" stop-color="#E2167E"></stop><stop offset="100%" stop-color="#FE603C"></stop></linearGradient></defs><path d="M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z" fill="url(#lobe-icons-minimax-_R_0_)" fill-rule="nonzero"></path></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Minimax</title><defs><linearGradient id="lobe-icons-minimax-_R_0_" x1="0%" x2="100.182%" y1="50.057%" y2="50.057%"><stop offset="0%" stop-color="#E2167E"></stop><stop offset="100%" stop-color="#FE603C"></stop></linearGradient></defs><path d="M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z" fill="url(#lobe-icons-minimax-_R_0_)" fill-rule="nonzero"></path></svg>
diff --git a/web/public/provider-icons/mistral-color.svg b/web/public/provider-icons/mistral-color.svg
index 8e03e244b..7c5e60429 100644
--- a/web/public/provider-icons/mistral-color.svg
+++ b/web/public/provider-icons/mistral-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Mistral</title><path d="M3.428 3.4h3.429v3.428H3.428V3.4zm13.714 0h3.43v3.428h-3.43V3.4z" fill="gold"></path><path d="M3.428 6.828h6.857v3.429H3.429V6.828zm10.286 0h6.857v3.429h-6.857V6.828z" fill="#FFAF00"></path><path d="M3.428 10.258h17.144v3.428H3.428v-3.428z" fill="#FF8205"></path><path d="M3.428 13.686h3.429v3.428H3.428v-3.428zm6.858 0h3.429v3.428h-3.429v-3.428zm6.856 0h3.43v3.428h-3.43v-3.428z" fill="#FA500F"></path><path d="M0 17.114h10.286v3.429H0v-3.429zm13.714 0H24v3.429H13.714v-3.429z" fill="#E10500"></path></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Mistral</title><path d="M3.428 3.4h3.429v3.428H3.428V3.4zm13.714 0h3.43v3.428h-3.43V3.4z" fill="gold"></path><path d="M3.428 6.828h6.857v3.429H3.429V6.828zm10.286 0h6.857v3.429h-6.857V6.828z" fill="#FFAF00"></path><path d="M3.428 10.258h17.144v3.428H3.428v-3.428z" fill="#FF8205"></path><path d="M3.428 13.686h3.429v3.428H3.428v-3.428zm6.858 0h3.429v3.428h-3.429v-3.428zm6.856 0h3.43v3.428h-3.43v-3.428z" fill="#FA500F"></path><path d="M0 17.114h10.286v3.429H0v-3.429zm13.714 0H24v3.429H13.714v-3.429z" fill="#E10500"></path></svg>
diff --git a/web/public/provider-icons/moonshot.svg b/web/public/provider-icons/moonshot.svg
index fb56ac106..829ab293e 100644
--- a/web/public/provider-icons/moonshot.svg
+++ b/web/public/provider-icons/moonshot.svg
@@ -1 +1 @@
-<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>MoonshotAI</title><path d="M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"></path></svg>
\ No newline at end of file
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>MoonshotAI</title><path d="M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"></path></svg>
diff --git a/web/public/provider-icons/nvidia-color.svg b/web/public/provider-icons/nvidia-color.svg
index a9683c2e0..4fe3acf44 100644
--- a/web/public/provider-icons/nvidia-color.svg
+++ b/web/public/provider-icons/nvidia-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Nvidia</title><path d="M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z" fill="#74B71B" fill-rule="nonzero"></path></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Nvidia</title><path d="M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z" fill="#74B71B" fill-rule="nonzero"></path></svg>
diff --git a/web/public/provider-icons/ollama.svg b/web/public/provider-icons/ollama.svg
index cc887e3dc..c5e666a06 100644
--- a/web/public/provider-icons/ollama.svg
+++ b/web/public/provider-icons/ollama.svg
@@ -1 +1 @@
-<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Ollama</title><path d="M7.905 1.09c.216.085.411.225.588.41.295.306.544.744.734 1.263.191.522.315 1.1.362 1.68a5.054 5.054 0 012.049-.636l.051-.004c.87-.07 1.73.087 2.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67 1.67 0 01.589-.41c.257-.1.53-.118.796-.042.401.114.745.368 1.016.737.248.337.434.769.561 1.287.23.934.27 2.163.115 3.645l.053.04.026.019c.757.576 1.284 1.397 1.563 2.35.435 1.487.216 3.155-.534 4.088l-.018.021.002.003c.417.762.67 1.567.724 2.4l.002.03c.064 1.065-.2 2.137-.814 3.19l-.007.01.01.024c.472 1.157.62 2.322.438 3.486l-.006.039a.651.651 0 01-.747.536.648.648 0 01-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643 0 01.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644 0 01.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229 4.229 0 00-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653 0 01-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288 3.288 0 00-1.772-.332c-1.245.099-2.343.801-2.67 1.686a.652.652 0 01-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066 1.588a4.07 4.07 0 00-.068 1.886c.112.558.331 1.02.582 1.269l.008.007c.212.207.257.53.109.785-.36.622-.629 1.549-.673 2.44-.05 1.018.186 1.902.719 2.536l.016.019a.643.643 0 01.095.69c-.576 1.236-.753 2.252-.562 3.052a.652.652 0 01-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339 4.339 0 01-.598-1.309l-.005-.019a5.764 5.764 0 01-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352 5.352 0 01.093-2.49c.262-.915.777-1.701 1.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622 1.015-.737.266-.076.54-.059.797.042zm4.116 9.09c.936 0 1.8.313 2.446.855.63.527 1.005 1.235 1.005 1.94 0 .888-.406 1.58-1.133 2.022-.62.375-1.451.557-2.403.557-1.009 0-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845 0-.707.398-1.417 1.056-1.946.668-.537 1.55-.849 2.485-.849zm0 .896a3.07 3.07 0 00-1.916.65c-.461.37-.722.835-.722 1.25 0 .428.21.829.61 1.134.455.347 1.124.548 1.943.548.799 0 1.473-.147 1.932-.426.463-.28.7-.686.7-1.257 0-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662 1.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375 0 01-.376.373.375.375 0 01-.376-.373v-.46l-.271-.218a.347.347 0 01-.052-.49.353.353 0 01.494-.051l.215.172.22-.174a.353.353 0 01.49.051zm-5.04-1.919c.478 0 .867.39.867.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zm8.706 0c.48 0 .868.39.868.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zM7.44 2.3l-.003.002a.659.659 0 00-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216 1.631-.124 2.782.43-.128.899-.208 1.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628 0 00-.107-.09L7.44 2.3zm9.174.04l-.002.001a.628.628 0 00-.107.09c-.156.163-.32.45-.453.814-.29.794-.387 1.776-.23 2.572l.058.097.008.014h.03a5.184 5.184 0 011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659 0 00-.285-.239h-.004z"></path></svg>
\ No newline at end of file
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Ollama</title><path d="M7.905 1.09c.216.085.411.225.588.41.295.306.544.744.734 1.263.191.522.315 1.1.362 1.68a5.054 5.054 0 012.049-.636l.051-.004c.87-.07 1.73.087 2.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67 1.67 0 01.589-.41c.257-.1.53-.118.796-.042.401.114.745.368 1.016.737.248.337.434.769.561 1.287.23.934.27 2.163.115 3.645l.053.04.026.019c.757.576 1.284 1.397 1.563 2.35.435 1.487.216 3.155-.534 4.088l-.018.021.002.003c.417.762.67 1.567.724 2.4l.002.03c.064 1.065-.2 2.137-.814 3.19l-.007.01.01.024c.472 1.157.62 2.322.438 3.486l-.006.039a.651.651 0 01-.747.536.648.648 0 01-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643 0 01.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644 0 01.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229 4.229 0 00-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653 0 01-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288 3.288 0 00-1.772-.332c-1.245.099-2.343.801-2.67 1.686a.652.652 0 01-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066 1.588a4.07 4.07 0 00-.068 1.886c.112.558.331 1.02.582 1.269l.008.007c.212.207.257.53.109.785-.36.622-.629 1.549-.673 2.44-.05 1.018.186 1.902.719 2.536l.016.019a.643.643 0 01.095.69c-.576 1.236-.753 2.252-.562 3.052a.652.652 0 01-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339 4.339 0 01-.598-1.309l-.005-.019a5.764 5.764 0 01-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352 5.352 0 01.093-2.49c.262-.915.777-1.701 1.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622 1.015-.737.266-.076.54-.059.797.042zm4.116 9.09c.936 0 1.8.313 2.446.855.63.527 1.005 1.235 1.005 1.94 0 .888-.406 1.58-1.133 2.022-.62.375-1.451.557-2.403.557-1.009 0-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845 0-.707.398-1.417 1.056-1.946.668-.537 1.55-.849 2.485-.849zm0 .896a3.07 3.07 0 00-1.916.65c-.461.37-.722.835-.722 1.25 0 .428.21.829.61 1.134.455.347 1.124.548 1.943.548.799 0 1.473-.147 1.932-.426.463-.28.7-.686.7-1.257 0-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662 1.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375 0 01-.376.373.375.375 0 01-.376-.373v-.46l-.271-.218a.347.347 0 01-.052-.49.353.353 0 01.494-.051l.215.172.22-.174a.353.353 0 01.49.051zm-5.04-1.919c.478 0 .867.39.867.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zm8.706 0c.48 0 .868.39.868.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zM7.44 2.3l-.003.002a.659.659 0 00-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216 1.631-.124 2.782.43-.128.899-.208 1.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628 0 00-.107-.09L7.44 2.3zm9.174.04l-.002.001a.628.628 0 00-.107.09c-.156.163-.32.45-.453.814-.29.794-.387 1.776-.23 2.572l.058.097.008.014h.03a5.184 5.184 0 011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659 0 00-.285-.239h-.004z"></path></svg>
diff --git a/web/public/provider-icons/openai.svg b/web/public/provider-icons/openai.svg
index 78caf4fa2..8c3e68d52 100644
--- a/web/public/provider-icons/openai.svg
+++ b/web/public/provider-icons/openai.svg
@@ -1 +1 @@
-<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OpenAI</title><path d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"></path></svg>
\ No newline at end of file
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OpenAI</title><path d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"></path></svg>
diff --git a/web/public/provider-icons/openrouter.svg b/web/public/provider-icons/openrouter.svg
index e6cca2a86..cb51863f0 100644
--- a/web/public/provider-icons/openrouter.svg
+++ b/web/public/provider-icons/openrouter.svg
@@ -1 +1 @@
-<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OpenRouter</title><path d="M16.804 1.957l7.22 4.105v.087L16.73 10.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147 1.352L8.345 11.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314 1.17.796 2.701 1.866 1.11.775 2.083 1.177 3.147 1.352l.3.045c.694.091 1.375.094 2.825.033l.022-2.159 7.22 4.105v.087L16.589 22l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997 21.997 0 00-.755-.498l-.467-.28a55.927 55.927 0 00-.76-.43C2.908 14.73.563 14.116 0 14.116V9.888l.14.004c.564-.007 2.91-.622 3.809-1.124l1.016-.58.438-.274c.428-.28 1.072-.726 2.686-1.853 1.621-1.133 3.186-1.78 4.881-2.059 1.152-.19 1.974-.213 3.814-.138l.02-1.907z"></path></svg>
\ No newline at end of file
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OpenRouter</title><path d="M16.804 1.957l7.22 4.105v.087L16.73 10.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147 1.352L8.345 11.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314 1.17.796 2.701 1.866 1.11.775 2.083 1.177 3.147 1.352l.3.045c.694.091 1.375.094 2.825.033l.022-2.159 7.22 4.105v.087L16.589 22l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997 21.997 0 00-.755-.498l-.467-.28a55.927 55.927 0 00-.76-.43C2.908 14.73.563 14.116 0 14.116V9.888l.14.004c.564-.007 2.91-.622 3.809-1.124l1.016-.58.438-.274c.428-.28 1.072-.726 2.686-1.853 1.621-1.133 3.186-1.78 4.881-2.059 1.152-.19 1.974-.213 3.814-.138l.02-1.907z"></path></svg>
diff --git a/web/public/provider-icons/perplexity-color.svg b/web/public/provider-icons/perplexity-color.svg
index 5f5a5ab5c..4a7163271 100644
--- a/web/public/provider-icons/perplexity-color.svg
+++ b/web/public/provider-icons/perplexity-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Perplexity</title><path d="M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z" fill="#22B8CD" fill-rule="nonzero"></path></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Perplexity</title><path d="M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z" fill="#22B8CD" fill-rule="nonzero"></path></svg>
diff --git a/web/public/provider-icons/qwen-color.svg b/web/public/provider-icons/qwen-color.svg
index f2d0ada16..ac004b1d9 100644
--- a/web/public/provider-icons/qwen-color.svg
+++ b/web/public/provider-icons/qwen-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Qwen</title><path d="M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z" fill="url(#lobe-icons-qwen-_R_0_)" fill-rule="nonzero"></path><defs><linearGradient id="lobe-icons-qwen-_R_0_" x1="0%" x2="100%" y1="0%" y2="0%"><stop offset="0%" stop-color="#6336E7" stop-opacity=".84"></stop><stop offset="100%" stop-color="#6F69F7" stop-opacity=".84"></stop></linearGradient></defs></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Qwen</title><path d="M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z" fill="url(#lobe-icons-qwen-_R_0_)" fill-rule="nonzero"></path><defs><linearGradient id="lobe-icons-qwen-_R_0_" x1="0%" x2="100%" y1="0%" y2="0%"><stop offset="0%" stop-color="#6336E7" stop-opacity=".84"></stop><stop offset="100%" stop-color="#6F69F7" stop-opacity=".84"></stop></linearGradient></defs></svg>
diff --git a/web/public/provider-icons/searxng.svg b/web/public/provider-icons/searxng.svg
index 6637e592c..302e01e96 100644
--- a/web/public/provider-icons/searxng.svg
+++ b/web/public/provider-icons/searxng.svg
@@ -1 +1 @@
-<svg fill="#3050FF" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>SearXNG</title><path d="m13.716 17.261 6.873 6.582L24 20.282l-6.824-6.536a9.11 9.11 0 0 0 1.143-4.43c0-5.055-4.105-9.159-9.16-9.159S0 4.261 0 9.316c0 5.055 4.104 9.159 9.159 9.159a9.11 9.11 0 0 0 4.557-1.214ZM9.159 2.773a6.546 6.546 0 0 1 6.543 6.543 6.545 6.545 0 0 1-6.543 6.542 6.545 6.545 0 0 1-6.542-6.542 6.545 6.545 0 0 1 6.542-6.543ZM7.26 5.713a4.065 4.065 0 0 1 4.744.747 4.064 4.064 0 0 1 .707 4.749l1.157.611a5.376 5.376 0 0 0-.935-6.282 5.377 5.377 0 0 0-6.274-.987l.601 1.162Z"/></svg>
\ No newline at end of file
+<svg fill="#3050FF" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>SearXNG</title><path d="m13.716 17.261 6.873 6.582L24 20.282l-6.824-6.536a9.11 9.11 0 0 0 1.143-4.43c0-5.055-4.105-9.159-9.16-9.159S0 4.261 0 9.316c0 5.055 4.104 9.159 9.159 9.159a9.11 9.11 0 0 0 4.557-1.214ZM9.159 2.773a6.546 6.546 0 0 1 6.543 6.543 6.545 6.545 0 0 1-6.543 6.542 6.545 6.545 0 0 1-6.542-6.542 6.545 6.545 0 0 1 6.542-6.543ZM7.26 5.713a4.065 4.065 0 0 1 4.744.747 4.064 4.064 0 0 1 .707 4.749l1.157.611a5.376 5.376 0 0 0-.935-6.282 5.377 5.377 0 0 0-6.274-.987l.601 1.162Z"/></svg>
diff --git a/web/public/provider-icons/siliconcloud-color.svg b/web/public/provider-icons/siliconcloud-color.svg
index 6b5f6d805..f653ed108 100644
--- a/web/public/provider-icons/siliconcloud-color.svg
+++ b/web/public/provider-icons/siliconcloud-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>SiliconCloud</title><path clip-rule="evenodd" d="M22.956 6.521H12.522c-.577 0-1.044.468-1.044 1.044v3.13c0 .577-.466 1.044-1.043 1.044H1.044c-.577 0-1.044.467-1.044 1.044v4.174C0 17.533.467 18 1.044 18h10.434c.577 0 1.044-.467 1.044-1.043v-3.13c0-.578.466-1.044 1.043-1.044h9.391c.577 0 1.044-.467 1.044-1.044V7.565c0-.576-.467-1.044-1.044-1.044z" fill="#6E29F6" fill-rule="evenodd"></path></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>SiliconCloud</title><path clip-rule="evenodd" d="M22.956 6.521H12.522c-.577 0-1.044.468-1.044 1.044v3.13c0 .577-.466 1.044-1.043 1.044H1.044c-.577 0-1.044.467-1.044 1.044v4.174C0 17.533.467 18 1.044 18h10.434c.577 0 1.044-.467 1.044-1.043v-3.13c0-.578.466-1.044 1.043-1.044h9.391c.577 0 1.044-.467 1.044-1.044V7.565c0-.576-.467-1.044-1.044-1.044z" fill="#6E29F6" fill-rule="evenodd"></path></svg>
diff --git a/web/public/provider-icons/stepfun-color.svg b/web/public/provider-icons/stepfun-color.svg
index 920e8a607..e387600c3 100644
--- a/web/public/provider-icons/stepfun-color.svg
+++ b/web/public/provider-icons/stepfun-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Stepfun</title><path d="M22.012 0h1.032v.927H24v.968h-.956V3.78h-1.032V1.896h-1.878v-.97h1.878V0zM2.6 12.371V1.87h.969v10.502h-.97zm10.423.66h10.95v.918h-6.208v9.579h-4.742V13.03zM5.629 3.333v12.356H0v4.51h10.386V8L20.859 8l-.003-4.668-15.227.001z" fill="url(#lobe-icons-stepfun-_R_0_)" fill-rule="evenodd"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-stepfun-_R_0_" x1="1.646" x2="18.342" y1="1.916" y2="22.091"><stop stop-color="#01A9FF"></stop><stop offset="1" stop-color="#0160FF"></stop></linearGradient></defs></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Stepfun</title><path d="M22.012 0h1.032v.927H24v.968h-.956V3.78h-1.032V1.896h-1.878v-.97h1.878V0zM2.6 12.371V1.87h.969v10.502h-.97zm10.423.66h10.95v.918h-6.208v9.579h-4.742V13.03zM5.629 3.333v12.356H0v4.51h10.386V8L20.859 8l-.003-4.668-15.227.001z" fill="url(#lobe-icons-stepfun-_R_0_)" fill-rule="evenodd"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-stepfun-_R_0_" x1="1.646" x2="18.342" y1="1.916" y2="22.091"><stop stop-color="#01A9FF"></stop><stop offset="1" stop-color="#0160FF"></stop></linearGradient></defs></svg>
diff --git a/web/public/provider-icons/tavily-color.svg b/web/public/provider-icons/tavily-color.svg
index cd3b556d8..7b88fdef5 100644
--- a/web/public/provider-icons/tavily-color.svg
+++ b/web/public/provider-icons/tavily-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Tavily</title><path d="M9.1.503l2.824 4.47a1.078 1.078 0 01-.911 1.655H9.858v6.692h-1.67V0c.35 0 .7.168.912.503z" fill="#8FBCFA"></path><path d="M4.453 4.974L7.277.503A1.07 1.07 0 018.189 0v13.32a2.633 2.633 0 00-1.67.48V6.628H5.364c-.85 0-1.366-.936-.912-1.654z" fill="#468BFF"></path><path d="M17.041 17.74h-7.028c.423-.457.67-1.049.7-1.67h12.956c0 .35-.168.7-.502.912l-4.472 2.823a1.078 1.078 0 01-1.654-.911v-1.155z" fill="#FDBB11"></path><path d="M18.695 12.334l4.47 2.824c.336.212.503.562.503.912H10.713a2.65 2.65 0 00-.493-1.67h6.822v-1.154c0-.85.935-1.366 1.653-.912z" fill="#F6D785"></path><path d="M4.394 19.605L.316 23.683a1.07 1.07 0 001 .29l5.158-1.165A1.078 1.078 0 007 20.994l-.816-.816 3.073-3.074a1.61 1.61 0 000-2.276l-.042-.043-4.82 4.82z" fill="#FF9A9D"></path><path d="M3.822 17.817l3.073-3.074a1.61 1.61 0 012.277 0l.042.043-4.818 4.819-4.08 4.079a1.07 1.07 0 01-.289-1l1.165-5.158A1.078 1.078 0 013.006 17l.816.817z" fill="#FE363B"></path></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Tavily</title><path d="M9.1.503l2.824 4.47a1.078 1.078 0 01-.911 1.655H9.858v6.692h-1.67V0c.35 0 .7.168.912.503z" fill="#8FBCFA"></path><path d="M4.453 4.974L7.277.503A1.07 1.07 0 018.189 0v13.32a2.633 2.633 0 00-1.67.48V6.628H5.364c-.85 0-1.366-.936-.912-1.654z" fill="#468BFF"></path><path d="M17.041 17.74h-7.028c.423-.457.67-1.049.7-1.67h12.956c0 .35-.168.7-.502.912l-4.472 2.823a1.078 1.078 0 01-1.654-.911v-1.155z" fill="#FDBB11"></path><path d="M18.695 12.334l4.47 2.824c.336.212.503.562.503.912H10.713a2.65 2.65 0 00-.493-1.67h6.822v-1.154c0-.85.935-1.366 1.653-.912z" fill="#F6D785"></path><path d="M4.394 19.605L.316 23.683a1.07 1.07 0 001 .29l5.158-1.165A1.078 1.078 0 007 20.994l-.816-.816 3.073-3.074a1.61 1.61 0 000-2.276l-.042-.043-4.82 4.82z" fill="#FF9A9D"></path><path d="M3.822 17.817l3.073-3.074a1.61 1.61 0 012.277 0l.042.043-4.818 4.819-4.08 4.079a1.07 1.07 0 01-.289-1l1.165-5.158A1.078 1.078 0 013.006 17l.816.817z" fill="#FE363B"></path></svg>
diff --git a/web/public/provider-icons/vllm-color.svg b/web/public/provider-icons/vllm-color.svg
index 54acc3de2..07eaef09c 100644
--- a/web/public/provider-icons/vllm-color.svg
+++ b/web/public/provider-icons/vllm-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>vLLM</title><path d="M0 4.973h9.324V23L0 4.973z" fill="#FDB515"></path><path d="M13.986 4.351L22.378 0l-6.216 23H9.324l4.662-18.649z" fill="#30A2FF"></path></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>vLLM</title><path d="M0 4.973h9.324V23L0 4.973z" fill="#FDB515"></path><path d="M13.986 4.351L22.378 0l-6.216 23H9.324l4.662-18.649z" fill="#30A2FF"></path></svg>
diff --git a/web/public/provider-icons/volcengine-color.svg b/web/public/provider-icons/volcengine-color.svg
index ecf6d75e0..1c9447224 100644
--- a/web/public/provider-icons/volcengine-color.svg
+++ b/web/public/provider-icons/volcengine-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Volcengine</title><path d="M19.44 10.153l-2.936 11.586a.215.215 0 00.214.261h5.87a.215.215 0 00.214-.261l-2.95-11.586a.214.214 0 00-.412 0zM3.28 12.778l-2.275 8.96A.214.214 0 001.22 22h4.532a.212.212 0 00.214-.165.214.214 0 000-.097l-2.276-8.96a.214.214 0 00-.41 0z" fill="#00E5E5"></path><path d="M7.29 5.359L3.148 21.738a.215.215 0 00.203.261h8.29a.214.214 0 00.215-.261L7.7 5.358a.214.214 0 00-.41 0z" fill="#006EFF"></path><path d="M14.44.15a.214.214 0 00-.41 0L8.366 21.739a.214.214 0 00.214.261H19.9a.216.216 0 00.171-.078.214.214 0 00.044-.183L14.439.15z" fill="#006EFF"></path><path d="M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.215.215 0 00.214-.264L10.688 7.741a.214.214 0 00-.41 0z" fill="#00E5E5"></path></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Volcengine</title><path d="M19.44 10.153l-2.936 11.586a.215.215 0 00.214.261h5.87a.215.215 0 00.214-.261l-2.95-11.586a.214.214 0 00-.412 0zM3.28 12.778l-2.275 8.96A.214.214 0 001.22 22h4.532a.212.212 0 00.214-.165.214.214 0 000-.097l-2.276-8.96a.214.214 0 00-.41 0z" fill="#00E5E5"></path><path d="M7.29 5.359L3.148 21.738a.215.215 0 00.203.261h8.29a.214.214 0 00.215-.261L7.7 5.358a.214.214 0 00-.41 0z" fill="#006EFF"></path><path d="M14.44.15a.214.214 0 00-.41 0L8.366 21.739a.214.214 0 00.214.261H19.9a.216.216 0 00.171-.078.214.214 0 00.044-.183L14.439.15z" fill="#006EFF"></path><path d="M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.215.215 0 00.214-.264L10.688 7.741a.214.214 0 00-.41 0z" fill="#00E5E5"></path></svg>
diff --git a/web/public/provider-icons/xiaomimimo.svg b/web/public/provider-icons/xiaomimimo.svg
index b8ba03b87..2974f4d37 100644
--- a/web/public/provider-icons/xiaomimimo.svg
+++ b/web/public/provider-icons/xiaomimimo.svg
@@ -1 +1 @@
-<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>XiaomiMiMo</title><path d="M.958 15.936a.459.459 0 01.459.44v2.729a.46.46 0 01-.918 0v-2.729a.459.459 0 01.459-.44zm4.814-2.035a.46.46 0 01.553.45v4.754a.458.458 0 11-.918 0V15.48L3.74 17.202a.462.462 0 01-.655.016.462.462 0 01-.065-.082L.628 14.67a.459.459 0 01.658-.637l2.124 2.187 2.127-2.188a.46.46 0 01.235-.13zm2.068.004a.46.46 0 01.458.445v4.755a.46.46 0 01-.458.458.459.459 0 01-.458-.458V14.35a.459.459 0 01.458-.445zm1.973 2.014a.46.46 0 01.46.457v2.729a.46.46 0 01-.784.324.46.46 0 01-.134-.324v-2.729a.46.46 0 01.458-.458zm.002-2.045a.458.458 0 01.328.157l2.127 2.19 2.125-2.19a.459.459 0 01.784.318v4.756a.46.46 0 01-.455.458.46.46 0 01-.458-.458V15.48l-1.667 1.723a.46.46 0 01-.65.008l-.005-.005c0-.002-.002-.002-.004-.003l-2.455-2.534a.46.46 0 01-.008-.667.461.461 0 01.338-.128zm6.797 1.206a.46.46 0 01.53.651A1.966 1.966 0 0019.81 18.4a.462.462 0 01.623.18.46.46 0 01-.181.624 2.863 2.863 0 01-1.38.353l-.142-.004a2.88 2.88 0 01-2.393-4.263.461.461 0 01.274-.21zm.864-.931a2.884 2.884 0 013.915 3.914.46.46 0 01-.402.24l-.057-.004a.458.458 0 01-.164-.055.46.46 0 01-.182-.622 1.967 1.967 0 00-2.669-2.67.459.459 0 11-.441-.803zM9.59 6.368c1.481 0 1.696 1.202 1.696 1.654v2.648h-.917v-.432c-.26.346-.792.535-1.36.535-.133 0-1.289-.03-1.384-1.136-.082-.932.675-1.61 2.053-1.61h.691c0-.563-.367-.886-.983-.886-.44.013-.864.174-1.2.458l-.36-.664c.484-.379 1.012-.567 1.764-.567zm4.427.1c1.263 0 2.082.97 2.083 2.15 0 1.181-.824 2.154-2.083 2.154-1.26 0-2.084-.972-2.084-2.152 0-1.18.82-2.153 2.084-2.153zm6.801.015c.68 0 1.202.465 1.197 1.548v2.642H21.1V8.29c0-.312-.002-.98-.63-.98s-.628.667-.628.838v2.524h-.89V8.148c0-.17-.001-.838-.63-.838-.628 0-.628.668-.628.98v2.383h-.917v-4.03h.917V7a1.22 1.22 0 01.947-.516c.398 0 .76.193.982.686a1.321 1.321 0 011.195-.686zm-18.093.872l1.457-1.772H5.32L3.311 8.07l2.14 2.602H4.24L2.725 8.796 1.21 10.672H0L2.138 8.07.13 5.583h1.138l1.458 1.772zm4.149 3.317h-.916V6.644h.916v4.028zm16.99 0h-.916V6.644h.916v4.028zM9.925 8.71c-1.055 0-1.359.412-1.326.742.032.329.324.537.757.537a1.013 1.013 0 001.014-.968l.002-.31h-.447zM14.018 7.3c-.663 0-1.184.487-1.184 1.32 0 .832.52 1.32 1.184 1.32.662 0 1.182-.49 1.182-1.32 0-.832-.52-1.32-1.182-1.32zM6.417 5.001a.568.568 0 01.587.582.588.588 0 01-1.175 0A.57.57 0 016.417 5zm16.991 0a.57.57 0 01.592.582.588.588 0 01-1.174 0 .57.57 0 01.357-.542.572.572 0 01.225-.04z"></path></svg>
\ No newline at end of file
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>XiaomiMiMo</title><path d="M.958 15.936a.459.459 0 01.459.44v2.729a.46.46 0 01-.918 0v-2.729a.459.459 0 01.459-.44zm4.814-2.035a.46.46 0 01.553.45v4.754a.458.458 0 11-.918 0V15.48L3.74 17.202a.462.462 0 01-.655.016.462.462 0 01-.065-.082L.628 14.67a.459.459 0 01.658-.637l2.124 2.187 2.127-2.188a.46.46 0 01.235-.13zm2.068.004a.46.46 0 01.458.445v4.755a.46.46 0 01-.458.458.459.459 0 01-.458-.458V14.35a.459.459 0 01.458-.445zm1.973 2.014a.46.46 0 01.46.457v2.729a.46.46 0 01-.784.324.46.46 0 01-.134-.324v-2.729a.46.46 0 01.458-.458zm.002-2.045a.458.458 0 01.328.157l2.127 2.19 2.125-2.19a.459.459 0 01.784.318v4.756a.46.46 0 01-.455.458.46.46 0 01-.458-.458V15.48l-1.667 1.723a.46.46 0 01-.65.008l-.005-.005c0-.002-.002-.002-.004-.003l-2.455-2.534a.46.46 0 01-.008-.667.461.461 0 01.338-.128zm6.797 1.206a.46.46 0 01.53.651A1.966 1.966 0 0019.81 18.4a.462.462 0 01.623.18.46.46 0 01-.181.624 2.863 2.863 0 01-1.38.353l-.142-.004a2.88 2.88 0 01-2.393-4.263.461.461 0 01.274-.21zm.864-.931a2.884 2.884 0 013.915 3.914.46.46 0 01-.402.24l-.057-.004a.458.458 0 01-.164-.055.46.46 0 01-.182-.622 1.967 1.967 0 00-2.669-2.67.459.459 0 11-.441-.803zM9.59 6.368c1.481 0 1.696 1.202 1.696 1.654v2.648h-.917v-.432c-.26.346-.792.535-1.36.535-.133 0-1.289-.03-1.384-1.136-.082-.932.675-1.61 2.053-1.61h.691c0-.563-.367-.886-.983-.886-.44.013-.864.174-1.2.458l-.36-.664c.484-.379 1.012-.567 1.764-.567zm4.427.1c1.263 0 2.082.97 2.083 2.15 0 1.181-.824 2.154-2.083 2.154-1.26 0-2.084-.972-2.084-2.152 0-1.18.82-2.153 2.084-2.153zm6.801.015c.68 0 1.202.465 1.197 1.548v2.642H21.1V8.29c0-.312-.002-.98-.63-.98s-.628.667-.628.838v2.524h-.89V8.148c0-.17-.001-.838-.63-.838-.628 0-.628.668-.628.98v2.383h-.917v-4.03h.917V7a1.22 1.22 0 01.947-.516c.398 0 .76.193.982.686a1.321 1.321 0 011.195-.686zm-18.093.872l1.457-1.772H5.32L3.311 8.07l2.14 2.602H4.24L2.725 8.796 1.21 10.672H0L2.138 8.07.13 5.583h1.138l1.458 1.772zm4.149 3.317h-.916V6.644h.916v4.028zm16.99 0h-.916V6.644h.916v4.028zM9.925 8.71c-1.055 0-1.359.412-1.326.742.032.329.324.537.757.537a1.013 1.013 0 001.014-.968l.002-.31h-.447zM14.018 7.3c-.663 0-1.184.487-1.184 1.32 0 .832.52 1.32 1.184 1.32.662 0 1.182-.49 1.182-1.32 0-.832-.52-1.32-1.182-1.32zM6.417 5.001a.568.568 0 01.587.582.588.588 0 01-1.175 0A.57.57 0 016.417 5zm16.991 0a.57.57 0 01.592.582.588.588 0 01-1.174 0 .57.57 0 01.357-.542.572.572 0 01.225-.04z"></path></svg>
diff --git a/web/public/provider-icons/zhipu-color.svg b/web/public/provider-icons/zhipu-color.svg
index 0c6e61cea..40e5bea20 100644
--- a/web/public/provider-icons/zhipu-color.svg
+++ b/web/public/provider-icons/zhipu-color.svg
@@ -1 +1 @@
-<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Zhipu</title><path d="M11.991 23.503a.24.24 0 00-.244.248.24.24 0 00.244.249.24.24 0 00.245-.249.24.24 0 00-.22-.247l-.025-.001zM9.671 5.365a1.697 1.697 0 011.099 2.132l-.071.172-.016.04-.018.054c-.07.16-.104.32-.104.498-.035.71.47 1.279 1.186 1.314h.366c1.309.053 2.338 1.173 2.286 2.523-.052 1.332-1.152 2.38-2.478 2.327h-.174c-.715.018-1.274.64-1.239 1.368 0 .124.018.23.053.337.209.373.54.658.96.8.75.23 1.517-.125 1.9-.782l.018-.035c.402-.64 1.17-.96 1.92-.711.854.284 1.378 1.226 1.099 2.167a1.661 1.661 0 01-2.077 1.102 1.711 1.711 0 01-.907-.711l-.017-.035c-.2-.323-.463-.58-.851-.711l-.056-.018a1.646 1.646 0 00-1.954.746 1.66 1.66 0 01-1.065.764 1.677 1.677 0 01-1.989-1.279c-.209-.906.332-1.83 1.257-2.043a1.51 1.51 0 01.296-.035h.018c.68-.071 1.151-.622 1.116-1.333a1.307 1.307 0 00-.227-.693 2.515 2.515 0 01-.366-1.403 2.39 2.39 0 01.366-1.208c.14-.195.21-.444.227-.693.018-.71-.506-1.261-1.186-1.332l-.07-.018a1.43 1.43 0 01-.299-.07l-.05-.019a1.7 1.7 0 01-1.047-2.114 1.68 1.68 0 012.094-1.101zm-5.575 10.11c.26-.264.639-.367.994-.27.355.096.633.379.728.74.095.362-.007.748-.267 1.013-.402.41-1.053.41-1.455 0a1.062 1.062 0 010-1.482zm14.845-.294c.359-.09.738.024.992.297.254.274.344.665.237 1.025-.107.36-.396.634-.756.718-.551.128-1.1-.22-1.23-.781a1.05 1.05 0 01.757-1.26zm-.064-4.39c.314.32.49.753.49 1.206 0 .452-.176.886-.49 1.206-.315.32-.74.5-1.185.5-.444 0-.87-.18-1.184-.5a1.727 1.727 0 010-2.412 1.654 1.654 0 012.369 0zm-11.243.163c.364.484.447 1.128.218 1.691a1.665 1.665 0 01-2.188.923c-.855-.36-1.26-1.358-.907-2.228a1.68 1.68 0 011.33-1.038c.593-.08 1.183.169 1.547.652zm11.545-4.221c.368 0 .708.2.892.524.184.324.184.724 0 1.048a1.026 1.026 0 01-.892.524c-.568 0-1.03-.47-1.03-1.048 0-.579.462-1.048 1.03-1.048zm-14.358 0c.368 0 .707.2.891.524.184.324.184.724 0 1.048a1.026 1.026 0 01-.891.524c-.569 0-1.03-.47-1.03-1.048 0-.579.461-1.048 1.03-1.048zm10.031-1.475c.925 0 1.675.764 1.675 1.706s-.75 1.705-1.675 1.705-1.674-.763-1.674-1.705c0-.942.75-1.706 1.674-1.706zm-2.626-.684c.362-.082.653-.356.761-.718a1.062 1.062 0 00-.238-1.028 1.017 1.017 0 00-.996-.294c-.547.14-.881.7-.752 1.257.13.558.675.907 1.225.783zm0 16.876c.359-.087.644-.36.75-.72a1.062 1.062 0 00-.237-1.019 1.018 1.018 0 00-.985-.301 1.037 1.037 0 00-.762.717c-.108.361-.017.754.239 1.028.245.263.606.377.953.305l.043-.01zM17.19 3.5a.631.631 0 00.628-.64c0-.355-.279-.64-.628-.64a.631.631 0 00-.628.64c0 .355.28.64.628.64zm-10.38 0a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64a.631.631 0 00-.628.64c0 .355.279.64.628.64zm-5.182 7.852a.631.631 0 00-.628.64c0 .354.28.639.628.639a.63.63 0 00.627-.606l.001-.034a.62.62 0 00-.628-.64zm5.182 9.13a.631.631 0 00-.628.64c0 .355.279.64.628.64a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64zm10.38.018a.631.631 0 00-.628.64c0 .355.28.64.628.64a.631.631 0 00.628-.64c0-.355-.279-.64-.628-.64zm5.182-9.148a.631.631 0 00-.628.64c0 .354.279.639.628.639a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64zm-.384-4.992a.24.24 0 00.244-.249.24.24 0 00-.244-.249.24.24 0 00-.244.249c0 .142.122.249.244.249zM11.991.497a.24.24 0 00.245-.248A.24.24 0 0011.99 0a.24.24 0 00-.244.249c0 .133.108.236.223.247l.021.001zM2.011 6.36a.24.24 0 00.245-.249.24.24 0 00-.244-.249.24.24 0 00-.244.249.24.24 0 00.244.249zm0 11.263a.24.24 0 00-.243.248.24.24 0 00.244.249.24.24 0 00.244-.249.252.252 0 00-.244-.248zm19.995-.018a.24.24 0 00-.245.248.24.24 0 00.245.25.24.24 0 00.244-.25.252.252 0 00-.244-.248z" fill="#3859FF" fill-rule="nonzero"></path></svg>
\ No newline at end of file
+<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Zhipu</title><path d="M11.991 23.503a.24.24 0 00-.244.248.24.24 0 00.244.249.24.24 0 00.245-.249.24.24 0 00-.22-.247l-.025-.001zM9.671 5.365a1.697 1.697 0 011.099 2.132l-.071.172-.016.04-.018.054c-.07.16-.104.32-.104.498-.035.71.47 1.279 1.186 1.314h.366c1.309.053 2.338 1.173 2.286 2.523-.052 1.332-1.152 2.38-2.478 2.327h-.174c-.715.018-1.274.64-1.239 1.368 0 .124.018.23.053.337.209.373.54.658.96.8.75.23 1.517-.125 1.9-.782l.018-.035c.402-.64 1.17-.96 1.92-.711.854.284 1.378 1.226 1.099 2.167a1.661 1.661 0 01-2.077 1.102 1.711 1.711 0 01-.907-.711l-.017-.035c-.2-.323-.463-.58-.851-.711l-.056-.018a1.646 1.646 0 00-1.954.746 1.66 1.66 0 01-1.065.764 1.677 1.677 0 01-1.989-1.279c-.209-.906.332-1.83 1.257-2.043a1.51 1.51 0 01.296-.035h.018c.68-.071 1.151-.622 1.116-1.333a1.307 1.307 0 00-.227-.693 2.515 2.515 0 01-.366-1.403 2.39 2.39 0 01.366-1.208c.14-.195.21-.444.227-.693.018-.71-.506-1.261-1.186-1.332l-.07-.018a1.43 1.43 0 01-.299-.07l-.05-.019a1.7 1.7 0 01-1.047-2.114 1.68 1.68 0 012.094-1.101zm-5.575 10.11c.26-.264.639-.367.994-.27.355.096.633.379.728.74.095.362-.007.748-.267 1.013-.402.41-1.053.41-1.455 0a1.062 1.062 0 010-1.482zm14.845-.294c.359-.09.738.024.992.297.254.274.344.665.237 1.025-.107.36-.396.634-.756.718-.551.128-1.1-.22-1.23-.781a1.05 1.05 0 01.757-1.26zm-.064-4.39c.314.32.49.753.49 1.206 0 .452-.176.886-.49 1.206-.315.32-.74.5-1.185.5-.444 0-.87-.18-1.184-.5a1.727 1.727 0 010-2.412 1.654 1.654 0 012.369 0zm-11.243.163c.364.484.447 1.128.218 1.691a1.665 1.665 0 01-2.188.923c-.855-.36-1.26-1.358-.907-2.228a1.68 1.68 0 011.33-1.038c.593-.08 1.183.169 1.547.652zm11.545-4.221c.368 0 .708.2.892.524.184.324.184.724 0 1.048a1.026 1.026 0 01-.892.524c-.568 0-1.03-.47-1.03-1.048 0-.579.462-1.048 1.03-1.048zm-14.358 0c.368 0 .707.2.891.524.184.324.184.724 0 1.048a1.026 1.026 0 01-.891.524c-.569 0-1.03-.47-1.03-1.048 0-.579.461-1.048 1.03-1.048zm10.031-1.475c.925 0 1.675.764 1.675 1.706s-.75 1.705-1.675 1.705-1.674-.763-1.674-1.705c0-.942.75-1.706 1.674-1.706zm-2.626-.684c.362-.082.653-.356.761-.718a1.062 1.062 0 00-.238-1.028 1.017 1.017 0 00-.996-.294c-.547.14-.881.7-.752 1.257.13.558.675.907 1.225.783zm0 16.876c.359-.087.644-.36.75-.72a1.062 1.062 0 00-.237-1.019 1.018 1.018 0 00-.985-.301 1.037 1.037 0 00-.762.717c-.108.361-.017.754.239 1.028.245.263.606.377.953.305l.043-.01zM17.19 3.5a.631.631 0 00.628-.64c0-.355-.279-.64-.628-.64a.631.631 0 00-.628.64c0 .355.28.64.628.64zm-10.38 0a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64a.631.631 0 00-.628.64c0 .355.279.64.628.64zm-5.182 7.852a.631.631 0 00-.628.64c0 .354.28.639.628.639a.63.63 0 00.627-.606l.001-.034a.62.62 0 00-.628-.64zm5.182 9.13a.631.631 0 00-.628.64c0 .355.279.64.628.64a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64zm10.38.018a.631.631 0 00-.628.64c0 .355.28.64.628.64a.631.631 0 00.628-.64c0-.355-.279-.64-.628-.64zm5.182-9.148a.631.631 0 00-.628.64c0 .354.279.639.628.639a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64zm-.384-4.992a.24.24 0 00.244-.249.24.24 0 00-.244-.249.24.24 0 00-.244.249c0 .142.122.249.244.249zM11.991.497a.24.24 0 00.245-.248A.24.24 0 0011.99 0a.24.24 0 00-.244.249c0 .133.108.236.223.247l.021.001zM2.011 6.36a.24.24 0 00.245-.249.24.24 0 00-.244-.249.24.24 0 00-.244.249.24.24 0 00.244.249zm0 11.263a.24.24 0 00-.243.248.24.24 0 00.244.249.24.24 0 00.244-.249.252.252 0 00-.244-.248zm19.995-.018a.24.24 0 00-.245.248.24.24 0 00.245.25.24.24 0 00.244-.25.252.252 0 00-.244-.248z" fill="#3859FF" fill-rule="nonzero"></path></svg>