Skip to content

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

release: v1.5.15

Bingxi Zhao (Frank)31bf66b5e13b
diff --git a/README.md b/README.md
index d8670df1c..841ee5ec8 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,8 @@
# DeepTutor: Lifelong Personalized Tutoring
<p align="center">
- <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
+ <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>&nbsp;
+ <a href="https://deeptutor.info/collaborate/" target="_blank"><img alt="Collaborate — work with us" src="https://img.shields.io/badge/Collaborate-work%20with%20us%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
</p>
<p align="center">
@@ -49,15 +50,17 @@
### 📦 Releases
+> **[2026.8.20]** [v1.5.15](https://github.com/HKUDS/DeepTutor/releases/tag/v1.5.15) — **PageIndex OSS** you host yourself with reasoning retrieval, a question bank you can finally file into, third-party tool/capability plugins, and **Apache Tika** parsing.
+
> **[2026.8.19]** [v1.5.14](https://github.com/HKUDS/DeepTutor/releases/tag/v1.5.14) — **Immersive Reading**: a document open beside the thread, cited page by page; DeepTutor configures itself from chat; IMA libraries you browse and write to; a notebook console.
> **[2026.8.17]** [v1.5.13](https://github.com/HKUDS/DeepTutor/releases/tag/v1.5.13) — Books stream while they compile, track your progress, and export to Markdown; a cost estimate before you approve a spine; and home starter suggestions drawn from memory.
-> **[2026.8.13]** [v1.5.12](https://github.com/HKUDS/DeepTutor/releases/tag/v1.5.12) — Web search rebuilt with six new providers (**Doubao**, **Bocha**, **Zhipu**, **Firecrawl**, **Qianfan**, **Aliyun IQS**), a **LiteParse** parsing engine, MCP servers that reconnect on credential change, and **CodeBuddy** + **OrcaRouter**.
-
<details>
<summary><b>Past releases (more than 1 week ago)</b></summary>
+> **[2026.8.13]** [v1.5.12](https://github.com/HKUDS/DeepTutor/releases/tag/v1.5.12) — Web search rebuilt with six new providers (**Doubao**, **Bocha**, **Zhipu**, **Firecrawl**, **Qianfan**, **Aliyun IQS**), a **LiteParse** parsing engine, MCP servers that reconnect on credential change, and **CodeBuddy** + **OrcaRouter**.
+
> **[2026.8.10]** [v1.5.11](https://github.com/HKUDS/DeepTutor/releases/tag/v1.5.11) — Prose around a DSML tool call stops vanishing, a truncated reply continues instead of ending, live memory usage in Settings, and LightRAG indexing off the event loop.
> **[2026.8.7]** [v1.5.10](https://github.com/HKUDS/DeepTutor/releases/tag/v1.5.10) — Every account signs in to its own **Codex**, model output language becomes its own setting, empty tool calls are rejected instead of retried, and uploads stop blocking the loop.
@@ -488,7 +491,7 @@ The loop is deliberately simple: the model thinks in rounds, calls tools when us
<img src="assets/figs/system/chat-agent-loop.png" alt="DeepTutor chat agent loop" width="900">
</div>
-User-toggleable tools are `brainstorm`, `web_search`, `paper_search`, `reason`, and `geogebra_analysis` — plus `imagegen` and `videogen` once you configure the matching generation model. Contextual tools such as `rag`, `kb_files`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, `github`, and `consult_subagent` mount automatically when the turn has the right context.
+User-toggleable tools are `brainstorm`, `web_search`, `paper_search`, `reason`, and `geogebra_analysis` — plus `imagegen` and `videogen` once you configure the matching generation model. Contextual tools such as `rag`, `kb_files`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, `question_bank`, `github`, and `consult_subagent` mount automatically when the turn has the right context.
Context comes in two kinds: **sticky session context** (subagent, knowledge bases, persona, model, voice) lives on the composer toolbar and persists across turns; **one-time references** (files, chat history, books, notebooks, question bank, imported agents) come from the `+` menu for a single turn.
@@ -581,7 +584,7 @@ Each chapter compiles into typed blocks — text, callouts, quizzes, flash cards
<img src="assets/figs/web-1.4.6+/knowledge/00-overview.png" alt="DeepTutor Knowledge Center" width="900">
</div>
-Knowledge bases are the document collections behind RAG — they ground Chat turns, Co-Writer edits, Book generation, and Partner conversations. What's distinctive is a **choice of retrieval engines**: **LlamaIndex** (the default, local vector + BM25), **PageIndex** (hosted, reasoning retrieval with page-level citations), **GraphRAG** and **LightRAG** (knowledge-graph retrieval), **LightRAG Server** (retrieval offloaded to an external LightRAG instance you connect over HTTP), **Tencent IMA** (a library you curate in IMA — searched, browsed, and written back to over its OpenAPI), or a linked **Obsidian** vault the tutor reads and writes in place. Each KB is bound to one engine.
+Knowledge bases are the document collections behind RAG — they ground Chat turns, Co-Writer edits, Book generation, and Partner conversations. What's distinctive is a **choice of retrieval engines**: **LlamaIndex** (the default, local vector + BM25), **PageIndex** (reasoning retrieval with page-level citations, hosted or self-hosted OSS), **GraphRAG** and **LightRAG** (knowledge-graph retrieval), **LightRAG Server** (retrieval offloaded to an external LightRAG instance you connect over HTTP), **Tencent IMA** (a library you curate in IMA — searched, browsed, and written back to over its OpenAPI), or a linked **Obsidian** vault the tutor reads and writes in place. Each KB is bound to one engine.
<div align="center">
<img src="assets/figs/web-1.4.6+/knowledge/01-create%20knowledge%20base.png" alt="Create a knowledge base" width="900">
diff --git a/assets/README/README_AR.md b/assets/README/README_AR.md
index 3ce036d21..b0bbce101 100644
--- a/assets/README/README_AR.md
+++ b/assets/README/README_AR.md
@@ -5,7 +5,8 @@
# DeepTutor: تدريس شخصي مدى الحياة
<p align="center">
- <a href="https://deeptutor.info" target="_blank"><img alt="الوثائق — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
+ <a href="https://deeptutor.info" target="_blank"><img alt="الوثائق — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>&nbsp;
+ <a href="https://deeptutor.info/collaborate/" target="_blank"><img alt="Collaborate — work with us" src="https://img.shields.io/badge/Collaborate-work%20with%20us%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
</p>
<p align="center">
@@ -327,7 +328,7 @@ Chat هي القدرة الافتراضية والمكان الذي يبدأ ف
<img src="../../assets/figs/system/chat-agent-loop.png" alt="حلقة وكيل محادثة DeepTutor" width="900">
</div>
-الأدوات القابلة للتبديل من قِبَل المستخدم هي `brainstorm` و`web_search` و`paper_search` و`reason` و`geogebra_analysis` — بالإضافة إلى `imagegen` و`videogen` بمجرد تهيئة نموذج التوليد المطابق. الأدوات السياقية مثل `rag` و`kb_files` و`read_source` و`read_memory` و`write_memory` و`read_skill` و`load_tools` و`exec` و`web_fetch` و`ask_user` و`list_notebook` و`write_note` و`github` و`consult_subagent` تُثبَّت تلقائياً عندما يكون للدور السياق الصحيح.
+الأدوات القابلة للتبديل من قِبَل المستخدم هي `brainstorm` و`web_search` و`paper_search` و`reason` و`geogebra_analysis` — بالإضافة إلى `imagegen` و`videogen` بمجرد تهيئة نموذج التوليد المطابق. الأدوات السياقية مثل `rag` و`kb_files` و`read_source` و`read_memory` و`write_memory` و`read_skill` و`load_tools` و`exec` و`web_fetch` و`ask_user` و`list_notebook` و`write_note` و`question_bank` و`github` و`consult_subagent` تُثبَّت تلقائياً عندما يكون للدور السياق الصحيح.
يأتي السياق في نوعين: **السياق اللاصق للجلسة** (الوكيل الفرعي وقواعد المعرفة والشخصية والنموذج والصوت) يعيش على شريط أدوات المؤلف ويستمر عبر الأدوار؛ **المراجع لمرة واحدة** (الملفات وتاريخ المحادثة والكتب ودفاتر الملاحظات وبنك الأسئلة والوكلاء المستوردون) تأتي من قائمة `+` لدور واحد.
@@ -420,13 +421,13 @@ Co-Writer هو مساحة عمل Markdown ذات عرض مقسَّم للتقا
<img src="../../assets/figs/web-1.4.6+/knowledge/00-overview.png" alt="مركز المعرفة في DeepTutor" width="900">
</div>
-قواعد المعرفة هي مجموعات المستندات وراء RAG — إنها ترسّخ أدوار Chat وتحرير Co-Writer وتوليد Book ومحادثات Partner. ما يميزها هو **اختيار محرك الاسترجاع**: **LlamaIndex** (الافتراضي، ناقل محلي + BM25)، **PageIndex** (مستضاف، استرجاع تفكيري مع استشهادات على مستوى الصفحة)، **GraphRAG** و**LightRAG** (استرجاع قائم على الرسم البياني المعرفي)، **LightRAG Server** (استرجاع مُحال إلى نسخة LightRAG خارجية تتصل بها عبر HTTP)، **Tencent IMA** (مكتبة تنظّمها ضمن IMA — يُبحث فيها ويُتصفَّح ويُكتَب إليها عبر OpenAPI الخاصة بها)، أو مخزن **Obsidian** مرتبط يقرأ المدرس ويكتب فيه في مكانه. كل قاعدة معرفة مرتبطة بمحرك واحد.
+قواعد المعرفة هي مجموعات المستندات وراء RAG — إنها ترسّخ أدوار Chat وتحرير Co-Writer وتوليد Book ومحادثات Partner. ما يميزها هو **اختيار محرك الاسترجاع**: **LlamaIndex** (الافتراضي، ناقل محلي + BM25)، **PageIndex** (استرجاع تفكيري مع استشهادات على مستوى الصفحة، مستضاف أو مفتوح المصدر ذاتي الاستضافة)، **GraphRAG** و**LightRAG** (استرجاع قائم على الرسم البياني المعرفي)، **LightRAG Server** (استرجاع مُحال إلى نسخة LightRAG خارجية تتصل بها عبر HTTP)، **Tencent IMA** (مكتبة تنظّمها ضمن IMA — يُبحث فيها ويُتصفَّح ويُكتَب إليها عبر OpenAPI الخاصة بها)، أو مخزن **Obsidian** مرتبط يقرأ المدرس ويكتب فيه في مكانه. كل قاعدة معرفة مرتبطة بمحرك واحد.
<div align="center">
<img src="../../assets/figs/web-1.4.6+/knowledge/01-create%20knowledge%20base.png" alt="إنشاء قاعدة معرفة" width="900">
</div>
-عند إنشاء قاعدة معرفة، إما أن **تنشئ جديدة** (تحميل مستندات وبناء فهرس جديد) أو **تربط موجودة** (إعادة استخدام فهرس مبني في مكان آخر، قراءة في مكانه بدون إعادة فهرسة). تكتب إعادة الفهرسة دليل `version-N` مسطحاً جديداً وتحتفظ بالسابقة، لذا لا يُدمَّر فهرس عامل أبداً أثناء إعادة البناء. يمكن إزالة مستند واحد حتى من قاعدة في حالة **خطأ** — إسقاط ملف فشل تحليله بدون حذف وإعادة بناء كاملين. تحليل المستندات — نص فقط أو MinerU أو Docling أو markitdown أو PyMuPDF4LLM أو LiteParse — يُختار في **الإعدادات ← قاعدة المعرفة**، مع إيقاف تنزيلات النماذج المحلية افتراضياً. يمكن لـ Docling أيضاً العمل في وضع **بعيد** مقابل خادم Docling Serve (بلا حاجة إلى تثبيت محلي أو نماذج)، يُهيَّأ عبر **الإعدادات ← تحليل المستندات** (`mode=remote`، وعنوان URL أساسي للخادم، ومفتاح API اختياري) أو متغيرات البيئة `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN`. تعكس واجهة CLI دورة الحياة مع `deeptutor kb list` و`info` و`create` و`add` و`search` و`set-default` و`delete`.
+عند إنشاء قاعدة معرفة، إما أن **تنشئ جديدة** (تحميل مستندات وبناء فهرس جديد) أو **تربط موجودة** (إعادة استخدام فهرس مبني في مكان آخر، قراءة في مكانه بدون إعادة فهرسة). تكتب إعادة الفهرسة دليل `version-N` مسطحاً جديداً وتحتفظ بالسابقة، لذا لا يُدمَّر فهرس عامل أبداً أثناء إعادة البناء. يمكن إزالة مستند واحد حتى من قاعدة في حالة **خطأ** — إسقاط ملف فشل تحليله بدون حذف وإعادة بناء كاملين. تحليل المستندات — نص فقط أو MinerU أو Docling أو Tika أو markitdown أو PyMuPDF4LLM أو LiteParse — يُختار في **الإعدادات ← قاعدة المعرفة**، مع إيقاف تنزيلات النماذج المحلية افتراضياً. يمكن لـ Docling أيضاً العمل في وضع **بعيد** مقابل خادم Docling Serve (بلا حاجة إلى تثبيت محلي أو نماذج)، يُهيَّأ عبر **الإعدادات ← تحليل المستندات** (`mode=remote`، وعنوان URL أساسي للخادم، ومفتاح API اختياري) أو متغيرات البيئة `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN`. أما Tika فهو بعيد فقط ويشير إلى خادم Apache Tika (`TIKA_SERVER_URL`). تعكس واجهة CLI دورة الحياة مع `deeptutor kb list` و`info` و`create` و`add` و`search` و`set-default` و`delete`.
</details>
diff --git a/assets/README/README_CN.md b/assets/README/README_CN.md
index b210e7a21..6e500dda5 100644
--- a/assets/README/README_CN.md
+++ b/assets/README/README_CN.md
@@ -5,7 +5,8 @@
# DeepTutor:终身个性化辅导
<p align="center">
- <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
+ <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>&nbsp;
+ <a href="https://deeptutor.info/collaborate/" target="_blank"><img alt="Collaborate — work with us" src="https://img.shields.io/badge/Collaborate-work%20with%20us%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
</p>
<p align="center">
@@ -327,7 +328,7 @@ Chat 是默认能力,也是大多数工作的起点。单个对话线程可以
<img src="../../assets/figs/system/chat-agent-loop.png" alt="DeepTutor 聊天智能体循环" width="900">
</div>
-用户可切换的工具有 `brainstorm`、`web_search`、`paper_search`、`reason` 和 `geogebra_analysis` — 配置了对应生成模型后还有 `imagegen` 和 `videogen`。上下文工具如 `rag`、`kb_files`、`read_source`、`read_memory`、`write_memory`、`read_skill`、`load_tools`、`exec`、`web_fetch`、`ask_user`、`list_notebook`、`write_note`、`github` 和 `consult_subagent` 会在当前轮次具备相应上下文时自动挂载。
+用户可切换的工具有 `brainstorm`、`web_search`、`paper_search`、`reason` 和 `geogebra_analysis` — 配置了对应生成模型后还有 `imagegen` 和 `videogen`。上下文工具如 `rag`、`kb_files`、`read_source`、`read_memory`、`write_memory`、`read_skill`、`load_tools`、`exec`、`web_fetch`、`ask_user`、`list_notebook`、`write_note`、`question_bank`、`github` 和 `consult_subagent` 会在当前轮次具备相应上下文时自动挂载。
上下文分为两类:**粘性会话上下文**(子智能体、知识库、人格预设、模型、语音)存在于编辑器工具栏,在各轮次间持续保留;**一次性引用**(文件、聊天历史、书籍、笔记本、题库、导入的智能体)通过 `+` 菜单添加,仅用于单次对话轮次。
@@ -420,13 +421,13 @@ Book 将选定的来源转化为交互式**活书** — 不是静态 PDF,而
<img src="../../assets/figs/web-1.4.6+/knowledge/00-overview.png" alt="DeepTutor 知识中心" width="900">
</div>
-知识库是 RAG 背后的文档集合 — 为 Chat 对话、Co-Writer 编辑、Book 生成和 Partner 对话提供依据。其独特之处在于**检索引擎的选择**:**LlamaIndex**(默认,本地向量 + BM25)、**PageIndex**(托管,支持页面级引用的推理检索)、**GraphRAG** 和 **LightRAG**(知识图谱检索)、**LightRAG Server**(将检索卸载至你通过 HTTP 连接的外部 LightRAG 实例)、**Tencent IMA**(在 IMA 中维护的知识库 — 通过其 OpenAPI 进行检索、浏览并写回),或直接在原位读写的链接 **Obsidian** vault。每个 KB 绑定到单一引擎。
+知识库是 RAG 背后的文档集合 — 为 Chat 对话、Co-Writer 编辑、Book 生成和 Partner 对话提供依据。其独特之处在于**检索引擎的选择**:**LlamaIndex**(默认,本地向量 + BM25)、**PageIndex**(支持页面级引用的推理检索,托管或自托管 OSS)、**GraphRAG** 和 **LightRAG**(知识图谱检索)、**LightRAG Server**(将检索卸载至你通过 HTTP 连接的外部 LightRAG 实例)、**Tencent IMA**(在 IMA 中维护的知识库 — 通过其 OpenAPI 进行检索、浏览并写回),或直接在原位读写的链接 **Obsidian** vault。每个 KB 绑定到单一引擎。
<div align="center">
<img src="../../assets/figs/web-1.4.6+/knowledge/01-create%20knowledge%20base.png" alt="创建知识库" width="900">
</div>
-创建 KB 时,可以选择**新建**(上传文档并构建全新索引)或**链接已有**(复用在其他地方构建的索引,原位读取无需重新索引)。重新索引会写入新的平铺 `version-N` 目录并保留旧版本,因此重建过程中现有索引不会被破坏。即使知识库处于 **error** 状态,也可以单独移除其中一份文档 — 无需完整地删除重建,就能丢弃解析失败的文件。文档解析 — 纯文本、MinerU、Docling、markitdown、PyMuPDF4LLM 或 LiteParse — 在 **Settings → Knowledge Base** 中选择,本地模型下载默认关闭。Docling 也可以以 **remote** 模式运行,对接 Docling Serve 服务器(无需本地安装或模型),可在 **Settings → Document Parsing** 中配置(`mode=remote`、服务器 Base URL 和可选的 API Key),或通过 `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN` 环境变量配置。CLI 通过 `deeptutor kb list`、`info`、`create`、`add`、`search`、`set-default` 和 `delete` 来管理完整生命周期。
+创建 KB 时,可以选择**新建**(上传文档并构建全新索引)或**链接已有**(复用在其他地方构建的索引,原位读取无需重新索引)。重新索引会写入新的平铺 `version-N` 目录并保留旧版本,因此重建过程中现有索引不会被破坏。即使知识库处于 **error** 状态,也可以单独移除其中一份文档 — 无需完整地删除重建,就能丢弃解析失败的文件。文档解析 — 纯文本、MinerU、Docling、Tika、markitdown、PyMuPDF4LLM 或 LiteParse — 在 **Settings → Knowledge Base** 中选择,本地模型下载默认关闭。Docling 也可以以 **remote** 模式运行,对接 Docling Serve 服务器(无需本地安装或模型),可在 **Settings → Document Parsing** 中配置(`mode=remote`、服务器 Base URL 和可选的 API Key),或通过 `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN` 环境变量配置。Tika 仅支持远程模式,需指向 Apache Tika 服务器(`TIKA_SERVER_URL`)。CLI 通过 `deeptutor kb list`、`info`、`create`、`add`、`search`、`set-default` 和 `delete` 来管理完整生命周期。
</details>
diff --git a/assets/README/README_ES.md b/assets/README/README_ES.md
index 2a017f26c..6ca68bf87 100644
--- a/assets/README/README_ES.md
+++ b/assets/README/README_ES.md
@@ -5,7 +5,8 @@
# DeepTutor: Tutoría Personalizada de Por Vida
<p align="center">
- <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
+ <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>&nbsp;
+ <a href="https://deeptutor.info/collaborate/" target="_blank"><img alt="Collaborate — work with us" src="https://img.shields.io/badge/Collaborate-work%20with%20us%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
</p>
<p align="center">
@@ -339,7 +340,7 @@ El bucle es deliberadamente simple: el modelo piensa en rondas, llama herramient
<img src="../../assets/figs/system/chat-agent-loop.png" alt="Bucle de agente de chat DeepTutor" width="900">
</div>
-Las herramientas activables por el usuario son `brainstorm`, `web_search`, `paper_search`, `reason` y `geogebra_analysis` — más `imagegen` y `videogen` una vez que configures el modelo de generación correspondiente. Las herramientas contextuales como `rag`, `kb_files`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, `github` y `consult_subagent` se montan automáticamente cuando el turno tiene el contexto adecuado.
+Las herramientas activables por el usuario son `brainstorm`, `web_search`, `paper_search`, `reason` y `geogebra_analysis` — más `imagegen` y `videogen` una vez que configures el modelo de generación correspondiente. Las herramientas contextuales como `rag`, `kb_files`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, `question_bank`, `github` y `consult_subagent` se montan automáticamente cuando el turno tiene el contexto adecuado.
El contexto viene en dos tipos: el **contexto de sesión persistente** (subagente, bases de conocimiento, persona, modelo, voz) vive en la barra de herramientas del compositor y persiste entre turnos; las **referencias de un solo uso** (archivos, historial de chat, libros, cuadernos, banco de preguntas, agentes importados) vienen del menú `+` para un único turno.
@@ -432,13 +433,13 @@ Cada capítulo se compila en bloques tipados — texto, callouts, quizzes, tarje
<img src="../../assets/figs/web-1.4.6+/knowledge/00-overview.png" alt="Centro de Conocimiento DeepTutor" width="900">
</div>
-Las bases de conocimiento son las colecciones de documentos detrás del RAG — fundamentan los turnos de Chat, las ediciones de Co-Writer, la generación de Book y las conversaciones de Partner. Lo que las distingue es la **elección de motores de recuperación**: **LlamaIndex** (el predeterminado, vector local + BM25), **PageIndex** (hospedado, recuperación por razonamiento con citas a nivel de página), **GraphRAG** y **LightRAG** (recuperación por grafo de conocimiento), **LightRAG Server** (recuperación delegada a una instancia externa de LightRAG a la que te conectas por HTTP), **Tencent IMA** (una biblioteca que curas en IMA — consultada, explorada y con escritura de vuelta a través de su OpenAPI), o un vault **Obsidian** vinculado que el tutor lee y escribe en el lugar. Cada KB está vinculada a un motor.
+Las bases de conocimiento son las colecciones de documentos detrás del RAG — fundamentan los turnos de Chat, las ediciones de Co-Writer, la generación de Book y las conversaciones de Partner. Lo que las distingue es la **elección de motores de recuperación**: **LlamaIndex** (el predeterminado, vector local + BM25), **PageIndex** (recuperación por razonamiento con citas a nivel de página, hospedado o autoalojado OSS), **GraphRAG** y **LightRAG** (recuperación por grafo de conocimiento), **LightRAG Server** (recuperación delegada a una instancia externa de LightRAG a la que te conectas por HTTP), **Tencent IMA** (una biblioteca que curas en IMA — consultada, explorada y con escritura de vuelta a través de su OpenAPI), o un vault **Obsidian** vinculado que el tutor lee y escribe en el lugar. Cada KB está vinculada a un motor.
<div align="center">
<img src="../../assets/figs/web-1.4.6+/knowledge/01-create%20knowledge%20base.png" alt="Crear una base de conocimiento" width="900">
</div>
-Al crear una KB, puedes **crear nueva** (subir documentos y construir un índice nuevo) o **vincular existente** (reutilizar un índice construido en otro lugar, leer en el lugar sin re-indexar). La re-indexación escribe un nuevo directorio `version-N` plano y conserva los anteriores, de modo que un índice funcional nunca se destruye a mitad de la reconstrucción. Un solo documento puede eliminarse incluso de una base en estado de **error** — descartando un archivo que no se pudo analizar sin necesidad de borrar y reconstruir todo. El análisis de documentos — Text-only, MinerU, Docling, markitdown, PyMuPDF4LLM o LiteParse — se elige en **Settings → Knowledge Base**, con descargas de modelos locales desactivadas por defecto. Docling también puede ejecutarse en modo **remoto** contra un servidor Docling Serve (sin necesidad de instalación local ni modelos), configurado a través de **Settings → Document Parsing** (`mode=remote`, una URL base de servidor y una clave API opcional) o las variables de entorno `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN`. La CLI refleja el ciclo de vida con `deeptutor kb list`, `info`, `create`, `add`, `search`, `set-default` y `delete`.
+Al crear una KB, puedes **crear nueva** (subir documentos y construir un índice nuevo) o **vincular existente** (reutilizar un índice construido en otro lugar, leer en el lugar sin re-indexar). La re-indexación escribe un nuevo directorio `version-N` plano y conserva los anteriores, de modo que un índice funcional nunca se destruye a mitad de la reconstrucción. Un solo documento puede eliminarse incluso de una base en estado de **error** — descartando un archivo que no se pudo analizar sin necesidad de borrar y reconstruir todo. El análisis de documentos — Text-only, MinerU, Docling, Tika, markitdown, PyMuPDF4LLM o LiteParse — se elige en **Settings → Knowledge Base**, con descargas de modelos locales desactivadas por defecto. Docling también puede ejecutarse en modo **remoto** contra un servidor Docling Serve (sin necesidad de instalación local ni modelos), configurado a través de **Settings → Document Parsing** (`mode=remote`, una URL base de servidor y una clave API opcional) o las variables de entorno `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN`. Tika es solo remoto y apunta a un servidor Apache Tika (`TIKA_SERVER_URL`). La CLI refleja el ciclo de vida con `deeptutor kb list`, `info`, `create`, `add`, `search`, `set-default` y `delete`.
</details>
diff --git a/assets/README/README_FR.md b/assets/README/README_FR.md
index 6af9032a2..4aad8d4f1 100644
--- a/assets/README/README_FR.md
+++ b/assets/README/README_FR.md
@@ -5,7 +5,8 @@
# DeepTutor : Tutorat Personnalisé à Vie
<p align="center">
- <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
+ <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>&nbsp;
+ <a href="https://deeptutor.info/collaborate/" target="_blank"><img alt="Collaborate — work with us" src="https://img.shields.io/badge/Collaborate-work%20with%20us%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
</p>
<p align="center">
@@ -349,7 +350,7 @@ La boucle est délibérément simple : le modèle réfléchit en rounds, appelle
<img src="../../assets/figs/system/chat-agent-loop.png" alt="Boucle d'agent Chat de DeepTutor" width="900">
</div>
-Les outils basculables par l'utilisateur sont `brainstorm`, `web_search`, `paper_search`, `reason` et `geogebra_analysis` — plus `imagegen` et `videogen` une fois que vous avez configuré le modèle de génération correspondant. Les outils contextuels tels que `rag`, `kb_files`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, `github` et `consult_subagent` se montent automatiquement quand le tour dispose du bon contexte.
+Les outils basculables par l'utilisateur sont `brainstorm`, `web_search`, `paper_search`, `reason` et `geogebra_analysis` — plus `imagegen` et `videogen` une fois que vous avez configuré le modèle de génération correspondant. Les outils contextuels tels que `rag`, `kb_files`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, `question_bank`, `github` et `consult_subagent` se montent automatiquement quand le tour dispose du bon contexte.
Le contexte se présente en deux types : le **contexte de session persistant** (sous-agent, bases de connaissances, persona, modèle, voix) vit sur la barre d'outils du compositeur et persiste entre les tours ; les **références ponctuelles** (fichiers, historique de chat, livres, carnets, banque de questions, agents importés) proviennent du menu `+` pour un seul tour.
@@ -442,13 +443,13 @@ Chaque chapitre se compile en blocs typés — texte, encadrés, quiz, fiches, c
<img src="../../assets/figs/web-1.4.6+/knowledge/00-overview.png" alt="Knowledge Center de DeepTutor" width="900">
</div>
-Les bases de connaissances sont les collections de documents derrière le RAG — elles ancrent les tours de Chat, les éditions Co-Writer, la génération de Book et les conversations Partner. Ce qui est distinctif est un **choix de moteurs de récupération** : **LlamaIndex** (par défaut, vecteur local + BM25), **PageIndex** (hébergé, récupération par raisonnement avec citations au niveau de la page), **GraphRAG** et **LightRAG** (récupération par graphe de connaissances), **LightRAG Server** (récupération déléguée à une instance LightRAG externe connectée via HTTP), **Tencent IMA** (une bibliothèque que vous constituez dans IMA — interrogée, parcourue et mise à jour via son OpenAPI), ou un vault **Obsidian** lié que le tuteur lit et écrit en place. Chaque KB est liée à un moteur.
+Les bases de connaissances sont les collections de documents derrière le RAG — elles ancrent les tours de Chat, les éditions Co-Writer, la génération de Book et les conversations Partner. Ce qui est distinctif est un **choix de moteurs de récupération** : **LlamaIndex** (par défaut, vecteur local + BM25), **PageIndex** (récupération par raisonnement avec citations au niveau de la page, hébergé ou OSS auto-hébergé), **GraphRAG** et **LightRAG** (récupération par graphe de connaissances), **LightRAG Server** (récupération déléguée à une instance LightRAG externe connectée via HTTP), **Tencent IMA** (une bibliothèque que vous constituez dans IMA — interrogée, parcourue et mise à jour via son OpenAPI), ou un vault **Obsidian** lié que le tuteur lit et écrit en place. Chaque KB est liée à un moteur.
<div align="center">
<img src="../../assets/figs/web-1.4.6+/knowledge/01-create%20knowledge%20base.png" alt="Créer une base de connaissances" width="900">
</div>
-En créant une KB, vous choisissez soit de **créer nouvelle** (uploadez des documents et construisez un index frais) soit de **lier une existante** (réutilisez un index construit ailleurs, lu en place sans re-indexation). La re-indexation écrit un nouveau répertoire plat `version-N` et conserve les précédents, donc un index fonctionnel n'est jamais détruit en milieu de reconstruction. Un seul document peut être supprimé même d'une base en état d'**erreur** — retirer un fichier dont l'analyse a échoué sans devoir tout supprimer et reconstruire. L'analyse de documents — Text-only, MinerU, Docling, markitdown, PyMuPDF4LLM ou LiteParse — est choisie dans **Paramètres → Base de Connaissances**, avec les téléchargements de modèles locaux désactivés par défaut. Docling peut aussi fonctionner en mode **distant** contre un serveur Docling Serve (aucune installation ni modèle local nécessaire), configuré via **Paramètres → Analyse de Documents** (`mode=remote`, une URL de base de serveur, et une clé API optionnelle) ou les variables d'environnement `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN`. La CLI reprend le cycle de vie avec `deeptutor kb list`, `info`, `create`, `add`, `search`, `set-default` et `delete`.
+En créant une KB, vous choisissez soit de **créer nouvelle** (uploadez des documents et construisez un index frais) soit de **lier une existante** (réutilisez un index construit ailleurs, lu en place sans re-indexation). La re-indexation écrit un nouveau répertoire plat `version-N` et conserve les précédents, donc un index fonctionnel n'est jamais détruit en milieu de reconstruction. Un seul document peut être supprimé même d'une base en état d'**erreur** — retirer un fichier dont l'analyse a échoué sans devoir tout supprimer et reconstruire. L'analyse de documents — Text-only, MinerU, Docling, Tika, markitdown, PyMuPDF4LLM ou LiteParse — est choisie dans **Paramètres → Base de Connaissances**, avec les téléchargements de modèles locaux désactivés par défaut. Docling peut aussi fonctionner en mode **distant** contre un serveur Docling Serve (aucune installation ni modèle local nécessaire), configuré via **Paramètres → Analyse de Documents** (`mode=remote`, une URL de base de serveur, et une clé API optionnelle) ou les variables d'environnement `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN`. Tika est distant uniquement et pointe vers un serveur Apache Tika (`TIKA_SERVER_URL`). La CLI reprend le cycle de vie avec `deeptutor kb list`, `info`, `create`, `add`, `search`, `set-default` et `delete`.
</details>
diff --git a/assets/README/README_HI.md b/assets/README/README_HI.md
index d3f190325..e336b8a42 100644
--- a/assets/README/README_HI.md
+++ b/assets/README/README_HI.md
@@ -5,7 +5,8 @@
# DeepTutor: लाइफलॉन्ग व्यक्तिगत ट्यूटरिंग
<p align="center">
- <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
+ <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>&nbsp;
+ <a href="https://deeptutor.info/collaborate/" target="_blank"><img alt="Collaborate — work with us" src="https://img.shields.io/badge/Collaborate-work%20with%20us%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
</p>
<p align="center">
@@ -327,7 +328,7 @@ Loop जानबूझकर simple है: model rounds में सोचत
<img src="../../assets/figs/system/chat-agent-loop.png" alt="DeepTutor chat agent loop" width="900">
</div>
-User-toggleable tools हैं `brainstorm`, `web_search`, `paper_search`, `reason`, और `geogebra_analysis` — साथ ही `imagegen` और `videogen` जब आप matching generation model configure करें। Contextual tools जैसे `rag`, `kb_files`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, `github`, और `consult_subagent` तब automatically mount होते हैं जब turn के पास सही context हो।
+User-toggleable tools हैं `brainstorm`, `web_search`, `paper_search`, `reason`, और `geogebra_analysis` — साथ ही `imagegen` और `videogen` जब आप matching generation model configure करें। Contextual tools जैसे `rag`, `kb_files`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, `question_bank`, `github`, और `consult_subagent` तब automatically mount होते हैं जब turn के पास सही context हो।
Context दो प्रकार की होती है: **sticky session context** (subagent, knowledge bases, persona, model, voice) composer toolbar पर रहती है और turns के पार persist करती है; **एक-बार references** (files, chat history, books, notebooks, question bank, imported agents) एक single turn के लिए `+` menu से आते हैं।
@@ -420,13 +421,13 @@ Book selected sources को एक interactive **living book** में बद
<img src="../../assets/figs/web-1.4.6+/knowledge/00-overview.png" alt="DeepTutor Knowledge Center" width="900">
</div>
-Knowledge bases RAG के पीछे document collections हैं — वे Chat turns, Co-Writer edits, Book generation, और Partner conversations को ground करते हैं। जो distinctive है वह है **retrieval engines का choice**: **LlamaIndex** (default, local vector + BM25), **PageIndex** (hosted, reasoning retrieval with page-level citations), **GraphRAG** और **LightRAG** (knowledge-graph retrieval), **LightRAG Server** (retrieval एक external LightRAG instance पर offload किया जाता है जिसे आप HTTP पर connect करते हैं), **Tencent IMA** (एक library जिसे आप IMA में curate करते हैं — इसके OpenAPI पर search, browse, और write back किया जाता है), या एक linked **Obsidian** vault जिसे tutor in-place पढ़ता और लिखता है। हर KB एक engine से bound होती है।
+Knowledge bases RAG के पीछे document collections हैं — वे Chat turns, Co-Writer edits, Book generation, और Partner conversations को ground करते हैं। जो distinctive है वह है **retrieval engines का choice**: **LlamaIndex** (default, local vector + BM25), **PageIndex** (reasoning retrieval with page-level citations, hosted या self-hosted OSS), **GraphRAG** और **LightRAG** (knowledge-graph retrieval), **LightRAG Server** (retrieval एक external LightRAG instance पर offload किया जाता है जिसे आप HTTP पर connect करते हैं), **Tencent IMA** (एक library जिसे आप IMA में curate करते हैं — इसके OpenAPI पर search, browse, और write back किया जाता है), या एक linked **Obsidian** vault जिसे tutor in-place पढ़ता और लिखता है। हर KB एक engine से bound होती है।
<div align="center">
<img src="../../assets/figs/web-1.4.6+/knowledge/01-create%20knowledge%20base.png" alt="एक knowledge base बनाएं" width="900">
</div>
-KB बनाते समय, आप either **नया create** करते हैं (documents upload करें और fresh index build करें) या **existing link** करते हैं (कहीं और बना index reuse करें, re-index के बिना in-place पढ़ें)। Re-indexing एक नई flat `version-N` directory लिखता है और prior ones रखता है, इसलिए एक working index rebuild के दौरान कभी destroy नहीं होता। एक single document को **error**-state base से भी remove किया जा सकता है — पूरी delete-and-rebuild के बिना parse होने में failed हुई file को drop करना। Document parsing — Text-only, MinerU, Docling, markitdown, PyMuPDF4LLM, या LiteParse — **Settings → Knowledge Base** में choose किया जाता है, local model downloads default रूप से off हैं। Docling को **remote** mode में भी एक Docling Serve server के विरुद्ध चलाया जा सकता है (कोई local install या models की जरूरत नहीं), जिसे **Settings → Document Parsing** (`mode=remote`, एक server base URL, और एक optional API key) या `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN` environment variables के जरिए configure किया जाता है। CLI lifecycle को `deeptutor kb list`, `info`, `create`, `add`, `search`, `set-default`, और `delete` से mirror करता है।
+KB बनाते समय, आप either **नया create** करते हैं (documents upload करें और fresh index build करें) या **existing link** करते हैं (कहीं और बना index reuse करें, re-index के बिना in-place पढ़ें)। Re-indexing एक नई flat `version-N` directory लिखता है और prior ones रखता है, इसलिए एक working index rebuild के दौरान कभी destroy नहीं होता। एक single document को **error**-state base से भी remove किया जा सकता है — पूरी delete-and-rebuild के बिना parse होने में failed हुई file को drop करना। Document parsing — Text-only, MinerU, Docling, Tika, markitdown, PyMuPDF4LLM, या LiteParse — **Settings → Knowledge Base** में choose किया जाता है, local model downloads default रूप से off हैं। Docling को **remote** mode में भी एक Docling Serve server के विरुद्ध चलाया जा सकता है (कोई local install या models की जरूरत नहीं), जिसे **Settings → Document Parsing** (`mode=remote`, एक server base URL, और एक optional API key) या `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN` environment variables के जरिए configure किया जाता है। Tika remote-only है और एक Apache Tika server (`TIKA_SERVER_URL`) पर point करता है। CLI lifecycle को `deeptutor kb list`, `info`, `create`, `add`, `search`, `set-default`, और `delete` से mirror करता है।
</details>
diff --git a/assets/README/README_JA.md b/assets/README/README_JA.md
index 16bfc69f6..97191e9bc 100644
--- a/assets/README/README_JA.md
+++ b/assets/README/README_JA.md
@@ -5,7 +5,8 @@
# DeepTutor:生涯にわたるパーソナライズド個別指導
<p align="center">
- <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
+ <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>&nbsp;
+ <a href="https://deeptutor.info/collaborate/" target="_blank"><img alt="Collaborate — work with us" src="https://img.shields.io/badge/Collaborate-work%20with%20us%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
</p>
<p align="center">
@@ -327,7 +328,7 @@ Chatはデフォルト機能であり、ほとんどの作業が始まる場所
<img src="../../assets/figs/system/chat-agent-loop.png" alt="DeepTutorチャットエージェントループ" width="900">
</div>
-ユーザーが切り替えられるツールは`brainstorm`、`web_search`、`paper_search`、`reason`、`geogebra_analysis` — 加えて、対応する生成モデルを設定すれば`imagegen`と`videogen`も利用できます。`rag`、`kb_files`、`read_source`、`read_memory`、`write_memory`、`read_skill`、`load_tools`、`exec`、`web_fetch`、`ask_user`、`list_notebook`、`write_note`、`github`、`consult_subagent`などのコンテキスト依存ツールは、ターンに適切なコンテキストがある場合に自動的にマウントされます。
+ユーザーが切り替えられるツールは`brainstorm`、`web_search`、`paper_search`、`reason`、`geogebra_analysis` — 加えて、対応する生成モデルを設定すれば`imagegen`と`videogen`も利用できます。`rag`、`kb_files`、`read_source`、`read_memory`、`write_memory`、`read_skill`、`load_tools`、`exec`、`web_fetch`、`ask_user`、`list_notebook`、`write_note`、`question_bank`、`github`、`consult_subagent`などのコンテキスト依存ツールは、ターンに適切なコンテキストがある場合に自動的にマウントされます。
コンテキストには2種類あります:**スティッキーセッションコンテキスト**(サブエージェント、知識ベース、ペルソナ、モデル、音声)はコンポーザーツールバーに常駐し、ターンをまたいで持続します。**ワンタイム参照**(ファイル、チャット履歴、本、ノートブック、問題バンク、インポートしたエージェント)は単一のターンのために`+`メニューから追加します。
@@ -420,13 +421,13 @@ Bookは選択したソースをインタラクティブな**生きている本**
<img src="../../assets/figs/web-1.4.6+/knowledge/00-overview.png" alt="DeepTutor Knowledge Center" width="900">
</div>
-知識ベースはRAGの背後にあるドキュメントコレクションです — Chatターン、Co-Writerの編集、Book生成、Partnerの会話をグラウンドします。特徴的なのは**検索エンジンの選択**です:**LlamaIndex**(デフォルト、ローカルベクター + BM25)、**PageIndex**(ホスト型、ページレベル引用付き推論検索)、**GraphRAG**と**LightRAG**(知識グラフ検索)、**LightRAG Server**(HTTP経由で接続する外部LightRAGインスタンスに検索をオフロード)、**Tencent IMA**(IMAでキュレートするライブラリで、そのOpenAPI経由で検索・閲覧・書き戻しが可能)、またはチューターがその場で読み書きするリンクされた**Obsidian**ボールト。各KBは1つのエンジンにバインドされます。
+知識ベースはRAGの背後にあるドキュメントコレクションです — Chatターン、Co-Writerの編集、Book生成、Partnerの会話をグラウンドします。特徴的なのは**検索エンジンの選択**です:**LlamaIndex**(デフォルト、ローカルベクター + BM25)、**PageIndex**(ページレベル引用付き推論検索、ホスト型またはセルフホストOSS)、**GraphRAG**と**LightRAG**(知識グラフ検索)、**LightRAG Server**(HTTP経由で接続する外部LightRAGインスタンスに検索をオフロード)、**Tencent IMA**(IMAでキュレートするライブラリで、そのOpenAPI経由で検索・閲覧・書き戻しが可能)、またはチューターがその場で読み書きするリンクされた**Obsidian**ボールト。各KBは1つのエンジンにバインドされます。
<div align="center">
<img src="../../assets/figs/web-1.4.6+/knowledge/01-create%20knowledge%20base.png" alt="知識ベースの作成" width="900">
</div>
-KBを作成する際は、**新規作成**(ドキュメントをアップロードして新しいインデックスを構築)または**既存をリンク**(再インデックスなしで既に構築されたインデックスを再利用)を選択します。再インデックスは新しいフラットな`version-N`ディレクトリを書き込み、以前のものを保持するため、再構築中に作業中のインデックスが破壊されることはありません。解析に失敗したファイルを完全な削除・再構築なしで取り除けるよう、**error**状態のベースからでも単一のドキュメントを削除できます。ドキュメント解析(Text-only、MinerU、Docling、markitdown、PyMuPDF4LLM、LiteParse)は**Settings → Knowledge Base**で選択し、ローカルモデルのダウンロードはデフォルトでオフです。Docling は、Docling Serve サーバーに対して**remote**モードで実行することもできます(ローカルインストールやモデルは不要)。この設定は**Settings → Document Parsing**(`mode=remote`、サーバーのベースURL、オプションのAPIキー)または `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN` 環境変数で行います。CLIは`deeptutor kb list`、`info`、`create`、`add`、`search`、`set-default`、`delete`でライフサイクルをミラーします。
+KBを作成する際は、**新規作成**(ドキュメントをアップロードして新しいインデックスを構築)または**既存をリンク**(再インデックスなしで既に構築されたインデックスを再利用)を選択します。再インデックスは新しいフラットな`version-N`ディレクトリを書き込み、以前のものを保持するため、再構築中に作業中のインデックスが破壊されることはありません。解析に失敗したファイルを完全な削除・再構築なしで取り除けるよう、**error**状態のベースからでも単一のドキュメントを削除できます。ドキュメント解析(Text-only、MinerU、Docling、Tika、markitdown、PyMuPDF4LLM、LiteParse)は**Settings → Knowledge Base**で選択し、ローカルモデルのダウンロードはデフォルトでオフです。Docling は、Docling Serve サーバーに対して**remote**モードで実行することもできます(ローカルインストールやモデルは不要)。この設定は**Settings → Document Parsing**(`mode=remote`、サーバーのベースURL、オプションのAPIキー)または `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN` 環境変数で行います。Tikaはリモート専用で、Apache Tikaサーバー(`TIKA_SERVER_URL`)を指定します。CLIは`deeptutor kb list`、`info`、`create`、`add`、`search`、`set-default`、`delete`でライフサイクルをミラーします。
</details>
diff --git a/assets/README/README_PL.md b/assets/README/README_PL.md
index e0f356110..5104dfebd 100644
--- a/assets/README/README_PL.md
+++ b/assets/README/README_PL.md
@@ -5,7 +5,8 @@
# DeepTutor: Dożywotnie Spersonalizowane Korepetycje
<p align="center">
- <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
+ <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>&nbsp;
+ <a href="https://deeptutor.info/collaborate/" target="_blank"><img alt="Collaborate — work with us" src="https://img.shields.io/badge/Collaborate-work%20with%20us%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
</p>
<p align="center">
@@ -327,7 +328,7 @@ Pętla jest celowo prosta: model myśli w rundach, wywołuje narzędzia gdy są
<img src="../../assets/figs/system/chat-agent-loop.png" alt="Pętla agenta czatu DeepTutor" width="900">
</div>
-Narzędzia przełączalne przez użytkownika to `brainstorm`, `web_search`, `paper_search`, `reason` i `geogebra_analysis` — plus `imagegen` i `videogen` po skonfigurowaniu odpowiedniego modelu generowania. Narzędzia kontekstowe takie jak `rag`, `kb_files`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, `github` i `consult_subagent` montują się automatycznie gdy tura ma odpowiedni kontekst.
+Narzędzia przełączalne przez użytkownika to `brainstorm`, `web_search`, `paper_search`, `reason` i `geogebra_analysis` — plus `imagegen` i `videogen` po skonfigurowaniu odpowiedniego modelu generowania. Narzędzia kontekstowe takie jak `rag`, `kb_files`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, `question_bank`, `github` i `consult_subagent` montują się automatycznie gdy tura ma odpowiedni kontekst.
Kontekst dzieli się na dwa rodzaje: **trwały kontekst sesji** (subagent, bazy wiedzy, persona, model, głos) żyje na pasku narzędziowym kompozytora i jest zachowany przez tury; **jednorazowe odwołania** (pliki, historia czatu, książki, notatniki, bank pytań, zaimportowani agenci) pochodzą z menu `+` dla jednej tury.
@@ -420,13 +421,13 @@ Każdy rozdział kompiluje się do typowanych bloków — tekst, callouts, quizy
<img src="../../assets/figs/web-1.4.6+/knowledge/00-overview.png" alt="Knowledge Center DeepTutor" width="900">
</div>
-Bazy wiedzy to kolekcje dokumentów za RAG — ugruntowują tury Chat, edycje Co-Writer, generowanie Book i konwersacje Partner. Wyróżnikiem jest **wybór silnika wyszukiwania**: **LlamaIndex** (domyślny, lokalny wektor + BM25), **PageIndex** (hostowany, wyszukiwanie z rozumowaniem z cytowaniami na poziomie strony), **GraphRAG** i **LightRAG** (wyszukiwanie oparte na grafach wiedzy), **LightRAG Server** (wyszukiwanie odciążone do zewnętrznej instancji LightRAG którą łączysz przez HTTP), **Tencent IMA** (biblioteka którą kurujesz w IMA — przeszukiwana, przeglądana i zapisywana z powrotem przez jego OpenAPI) lub podłączony vault **Obsidian** który tutor czyta i zapisuje w miejscu. Każda KB jest powiązana z jednym silnikiem.
+Bazy wiedzy to kolekcje dokumentów za RAG — ugruntowują tury Chat, edycje Co-Writer, generowanie Book i konwersacje Partner. Wyróżnikiem jest **wybór silnika wyszukiwania**: **LlamaIndex** (domyślny, lokalny wektor + BM25), **PageIndex** (wyszukiwanie z rozumowaniem z cytowaniami na poziomie strony, hostowany lub samodzielnie hostowany open source), **GraphRAG** i **LightRAG** (wyszukiwanie oparte na grafach wiedzy), **LightRAG Server** (wyszukiwanie odciążone do zewnętrznej instancji LightRAG którą łączysz przez HTTP), **Tencent IMA** (biblioteka którą kurujesz w IMA — przeszukiwana, przeglądana i zapisywana z powrotem przez jego OpenAPI) lub podłączony vault **Obsidian** który tutor czyta i zapisuje w miejscu. Każda KB jest powiązana z jednym silnikiem.
<div align="center">
<img src="../../assets/figs/web-1.4.6+/knowledge/01-create%20knowledge%20base.png" alt="Tworzenie bazy wiedzy" width="900">
</div>
-Tworząc KB, albo **tworzysz nową** (przesyłasz dokumenty i budujesz świeży indeks) albo **łączysz istniejącą** (ponownie używasz indeksu zbudowanego gdzie indziej, czytasz w miejscu bez ponownego indeksowania). Ponowne indeksowanie zapisuje nowy płaski katalog `version-N` i zachowuje poprzednie, więc działający indeks nigdy nie jest niszczony w trakcie przebudowy. Pojedynczy dokument można usunąć nawet z bazy w stanie **błędu** — usuwając plik, który nie sparsował się poprawnie, bez pełnego usuwania i przebudowy. Parsowanie dokumentów — Tylko tekst, MinerU, Docling, markitdown, PyMuPDF4LLM lub LiteParse — jest wybierane w **Settings → Knowledge Base**, z domyślnie wyłączonymi pobieraniami lokalnego modelu. Docling może też działać w trybie **zdalnym** względem serwera Docling Serve (bez lokalnej instalacji czy modeli), konfigurowanym przez **Settings → Document Parsing** (`mode=remote`, bazowy URL serwera i opcjonalny klucz API) lub zmienne środowiskowe `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN`. CLI odzwierciedla cykl życia za pomocą `deeptutor kb list`, `info`, `create`, `add`, `search`, `set-default` i `delete`.
+Tworząc KB, albo **tworzysz nową** (przesyłasz dokumenty i budujesz świeży indeks) albo **łączysz istniejącą** (ponownie używasz indeksu zbudowanego gdzie indziej, czytasz w miejscu bez ponownego indeksowania). Ponowne indeksowanie zapisuje nowy płaski katalog `version-N` i zachowuje poprzednie, więc działający indeks nigdy nie jest niszczony w trakcie przebudowy. Pojedynczy dokument można usunąć nawet z bazy w stanie **błędu** — usuwając plik, który nie sparsował się poprawnie, bez pełnego usuwania i przebudowy. Parsowanie dokumentów — Tylko tekst, MinerU, Docling, Tika, markitdown, PyMuPDF4LLM lub LiteParse — jest wybierane w **Settings → Knowledge Base**, z domyślnie wyłączonymi pobieraniami lokalnego modelu. Docling może też działać w trybie **zdalnym** względem serwera Docling Serve (bez lokalnej instalacji czy modeli), konfigurowanym przez **Settings → Document Parsing** (`mode=remote`, bazowy URL serwera i opcjonalny klucz API) lub zmienne środowiskowe `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN`. Tika jest wyłącznie zdalna i wskazuje na serwer Apache Tika (`TIKA_SERVER_URL`). CLI odzwierciedla cykl życia za pomocą `deeptutor kb list`, `info`, `create`, `add`, `search`, `set-default` i `delete`.
</details>
diff --git a/assets/README/README_PT.md b/assets/README/README_PT.md
index ff2fcf1da..897cbdf71 100644
--- a/assets/README/README_PT.md
+++ b/assets/README/README_PT.md
@@ -5,7 +5,8 @@
# DeepTutor: Tutoria Personalizada Vitalícia
<p align="center">
- <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
+ <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>&nbsp;
+ <a href="https://deeptutor.info/collaborate/" target="_blank"><img alt="Collaborate — work with us" src="https://img.shields.io/badge/Collaborate-work%20with%20us%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
</p>
<p align="center">
@@ -339,7 +340,7 @@ O loop é deliberadamente simples: o modelo pensa em rondas, chama ferramentas q
<img src="../../assets/figs/system/chat-agent-loop.png" alt="Loop de agente de chat DeepTutor" width="900">
</div>
-As ferramentas ativáveis pelo utilizador são `brainstorm`, `web_search`, `paper_search`, `reason` e `geogebra_analysis` — mais `imagegen` e `videogen` depois de configurar o modelo de geração correspondente. Ferramentas contextuais como `rag`, `kb_files`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, `github` e `consult_subagent` montam automaticamente quando o turno tem o contexto certo.
+As ferramentas ativáveis pelo utilizador são `brainstorm`, `web_search`, `paper_search`, `reason` e `geogebra_analysis` — mais `imagegen` e `videogen` depois de configurar o modelo de geração correspondente. Ferramentas contextuais como `rag`, `kb_files`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, `question_bank`, `github` e `consult_subagent` montam automaticamente quando o turno tem o contexto certo.
O contexto é de dois tipos: **contexto de sessão fixo** (subagente, bases de conhecimento, persona, modelo, voz) vive na barra de ferramentas do compositor e persiste entre turnos; **referências únicas** (ficheiros, histórico de chat, livros, notebooks, banco de questões, agentes importados) vêm do menu `+` para um único turno.
@@ -432,13 +433,13 @@ Cada capítulo compila em blocos tipados — texto, callouts, quizzes, cartões
<img src="../../assets/figs/web-1.4.6+/knowledge/00-overview.png" alt="Centro de Conhecimento DeepTutor" width="900">
</div>
-As bases de conhecimento são as coleções de documentos por trás do RAG — fundamentam os turnos do Chat, edições do Co-Writer, geração do Book e conversas do Partner. O que é distintivo é uma **escolha de motores de recuperação**: **LlamaIndex** (o padrão, vetor local + BM25), **PageIndex** (alojado, recuperação de raciocínio com citações ao nível da página), **GraphRAG** e **LightRAG** (recuperação de grafo de conhecimento), **LightRAG Server** (recuperação delegada a uma instância externa de LightRAG conectada via HTTP), **Tencent IMA** (uma biblioteca que cura no IMA — pesquisada, navegada e escrita de volta através da sua OpenAPI), ou um vault **Obsidian** vinculado que o tutor lê e escreve no lugar. Cada KB está vinculada a um motor.
+As bases de conhecimento são as coleções de documentos por trás do RAG — fundamentam os turnos do Chat, edições do Co-Writer, geração do Book e conversas do Partner. O que é distintivo é uma **escolha de motores de recuperação**: **LlamaIndex** (o padrão, vetor local + BM25), **PageIndex** (recuperação de raciocínio com citações ao nível da página, alojado ou OSS auto-hospedado), **GraphRAG** e **LightRAG** (recuperação de grafo de conhecimento), **LightRAG Server** (recuperação delegada a uma instância externa de LightRAG conectada via HTTP), **Tencent IMA** (uma biblioteca que cura no IMA — pesquisada, navegada e escrita de volta através da sua OpenAPI), ou um vault **Obsidian** vinculado que o tutor lê e escreve no lugar. Cada KB está vinculada a um motor.
<div align="center">
<img src="../../assets/figs/web-1.4.6+/knowledge/01-create%20knowledge%20base.png" alt="Criar uma base de conhecimento" width="900">
</div>
-Ao criar uma KB, pode **criar nova** (carregar documentos e construir um índice novo) ou **vincular existente** (reutilizar um índice construído noutro lugar, ler no lugar sem reindexação). A reindexação escreve um novo diretório plano `version-N` e mantém os anteriores, pelo que um índice funcional nunca é destruído a meio de uma reconstrução. Um único documento pode ser removido mesmo de uma base em estado de **erro** — descartando um ficheiro que falhou a análise sem uma eliminação e reconstrução completas. A análise de documentos — Somente Texto, MinerU, Docling, markitdown, PyMuPDF4LLM ou LiteParse — é escolhida em **Settings → Knowledge Base**, com downloads de modelos locais desativados por predefinição. O Docling também pode correr em modo **remoto** contra um servidor Docling Serve (sem necessidade de instalação local nem de modelos), configurado através de **Settings → Document Parsing** (`mode=remote`, um URL base do servidor e uma chave API opcional) ou das variáveis de ambiente `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN`. A CLI espelha o ciclo de vida com `deeptutor kb list`, `info`, `create`, `add`, `search`, `set-default` e `delete`.
+Ao criar uma KB, pode **criar nova** (carregar documentos e construir um índice novo) ou **vincular existente** (reutilizar um índice construído noutro lugar, ler no lugar sem reindexação). A reindexação escreve um novo diretório plano `version-N` e mantém os anteriores, pelo que um índice funcional nunca é destruído a meio de uma reconstrução. Um único documento pode ser removido mesmo de uma base em estado de **erro** — descartando um ficheiro que falhou a análise sem uma eliminação e reconstrução completas. A análise de documentos — Somente Texto, MinerU, Docling, Tika, markitdown, PyMuPDF4LLM ou LiteParse — é escolhida em **Settings → Knowledge Base**, com downloads de modelos locais desativados por predefinição. O Docling também pode correr em modo **remoto** contra um servidor Docling Serve (sem necessidade de instalação local nem de modelos), configurado através de **Settings → Document Parsing** (`mode=remote`, um URL base do servidor e uma chave API opcional) ou das variáveis de ambiente `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN`. O Tika é apenas remoto e aponta para um servidor Apache Tika (`TIKA_SERVER_URL`). A CLI espelha o ciclo de vida com `deeptutor kb list`, `info`, `create`, `add`, `search`, `set-default` e `delete`.
</details>
diff --git a/assets/README/README_RU.md b/assets/README/README_RU.md
index 1a171e8db..6a422359a 100644
--- a/assets/README/README_RU.md
+++ b/assets/README/README_RU.md
@@ -5,7 +5,8 @@
# DeepTutor: Персонализированное Обучение на Базе Агентов
<p align="center">
- <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
+ <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>&nbsp;
+ <a href="https://deeptutor.info/collaborate/" target="_blank"><img alt="Collaborate — work with us" src="https://img.shields.io/badge/Collaborate-work%20with%20us%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
</p>
<p align="center">
@@ -327,7 +328,7 @@ deeptutor config show
<img src="../../assets/figs/system/chat-agent-loop.png" alt="Цикл агента чата DeepTutor" width="900">
</div>
-Переключаемые пользователем инструменты: `brainstorm`, `web_search`, `paper_search`, `reason` и `geogebra_analysis` — плюс `imagegen` и `videogen` после настройки соответствующей генеративной модели. Контекстные инструменты, такие как `rag`, `kb_files`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, `github` и `consult_subagent`, монтируются автоматически, когда ход имеет подходящий контекст.
+Переключаемые пользователем инструменты: `brainstorm`, `web_search`, `paper_search`, `reason` и `geogebra_analysis` — плюс `imagegen` и `videogen` после настройки соответствующей генеративной модели. Контекстные инструменты, такие как `rag`, `kb_files`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, `question_bank`, `github` и `consult_subagent`, монтируются автоматически, когда ход имеет подходящий контекст.
Контекст бывает двух видов: **постоянный контекст сессии** (субагент, базы знаний, персонаж, модель, голос) находится на панели инструментов редактора и сохраняется между ходами; **одноразовые ссылки** (файлы, история чата, книги, блокноты, банк вопросов, импортированные агенты) берутся из меню `+` для одного хода.
@@ -420,13 +421,13 @@ Co-Writer — это разделённое рабочее пространст
<img src="../../assets/figs/web-1.4.6+/knowledge/00-overview.png" alt="Центр Знаний DeepTutor" width="900">
</div>
-Базы знаний — это коллекции документов для RAG, которые обосновывают ходы Chat, редакции Co-Writer, генерацию Book и разговоры с Партнёрами. Отличительной чертой является **выбор движков поиска**: **LlamaIndex** (по умолчанию, локальный вектор + BM25), **PageIndex** (размещённый, поиск с рассуждением с цитатами на уровне страницы), **GraphRAG** и **LightRAG** (поиск на основе графа знаний), **LightRAG Server** (поиск, делегированный внешнему экземпляру LightRAG, подключаемому по HTTP), **Tencent IMA** (библиотека, которую вы курируете в IMA — доступная для поиска, просмотра и записи через её OpenAPI), или связанное хранилище **Obsidian**, которое репетитор читает и записывает на месте. Каждая KB привязана к одному движку.
+Базы знаний — это коллекции документов для RAG, которые обосновывают ходы Chat, редакции Co-Writer, генерацию Book и разговоры с Партнёрами. Отличительной чертой является **выбор движков поиска**: **LlamaIndex** (по умолчанию, локальный вектор + BM25), **PageIndex** (поиск с рассуждением с цитатами на уровне страницы, размещённый или самостоятельно развёрнутый (OSS)), **GraphRAG** и **LightRAG** (поиск на основе графа знаний), **LightRAG Server** (поиск, делегированный внешнему экземпляру LightRAG, подключаемому по HTTP), **Tencent IMA** (библиотека, которую вы курируете в IMA — доступная для поиска, просмотра и записи через её OpenAPI), или связанное хранилище **Obsidian**, которое репетитор читает и записывает на месте. Каждая KB привязана к одному движку.
<div align="center">
<img src="../../assets/figs/web-1.4.6+/knowledge/01-create%20knowledge%20base.png" alt="Создание базы знаний" width="900">
</div>
-При создании KB вы либо **создаёте новую** (загружаете документы и строите свежий индекс), либо **связываете существующую** (повторно используете индекс, построенный в другом месте, читаете на месте без переиндексирования). Переиндексирование записывает новую плоскую директорию `version-N` и сохраняет предыдущие, поэтому рабочий индекс никогда не уничтожается в процессе перестройки. Отдельный документ можно удалить даже из базы в состоянии **error** — убрав файл, который не удалось разобрать, без полного удаления и пересборки. Разбор документов — только текст, MinerU, Docling, markitdown, PyMuPDF4LLM или LiteParse — выбирается в **Настройки → База знаний**, с отключёнными по умолчанию загрузками локальных моделей. Docling может также работать в **удалённом режиме**, обращаясь к серверу Docling Serve (без локальной установки и моделей), который настраивается в **Настройки → Разбор документов** (`mode=remote`, базовый URL сервера и необязательный API-ключ) или через переменные окружения `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN`. CLI отражает жизненный цикл командами `deeptutor kb list`, `info`, `create`, `add`, `search`, `set-default` и `delete`.
+При создании KB вы либо **создаёте новую** (загружаете документы и строите свежий индекс), либо **связываете существующую** (повторно используете индекс, построенный в другом месте, читаете на месте без переиндексирования). Переиндексирование записывает новую плоскую директорию `version-N` и сохраняет предыдущие, поэтому рабочий индекс никогда не уничтожается в процессе перестройки. Отдельный документ можно удалить даже из базы в состоянии **error** — убрав файл, который не удалось разобрать, без полного удаления и пересборки. Разбор документов — только текст, MinerU, Docling, Tika, markitdown, PyMuPDF4LLM или LiteParse — выбирается в **Настройки → База знаний**, с отключёнными по умолчанию загрузками локальных моделей. Docling может также работать в **удалённом режиме**, обращаясь к серверу Docling Serve (без локальной установки и моделей), который настраивается в **Настройки → Разбор документов** (`mode=remote`, базовый URL сервера и необязательный API-ключ) или через переменные окружения `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN`. Tika работает только в удалённом режиме и указывает на сервер Apache Tika (`TIKA_SERVER_URL`). CLI отражает жизненный цикл командами `deeptutor kb list`, `info`, `create`, `add`, `search`, `set-default` и `delete`.
</details>
diff --git a/assets/README/README_TH.md b/assets/README/README_TH.md
index e9040fd11..0b9619d26 100644
--- a/assets/README/README_TH.md
+++ b/assets/README/README_TH.md
@@ -5,7 +5,8 @@
# DeepTutor: การสอนพิเศษส่วนตัวตลอดชีวิต
<p align="center">
- <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
+ <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>&nbsp;
+ <a href="https://deeptutor.info/collaborate/" target="_blank"><img alt="Collaborate — work with us" src="https://img.shields.io/badge/Collaborate-work%20with%20us%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
</p>
<p align="center">
@@ -327,7 +328,7 @@ Chat คือความสามารถเริ่มต้นและส
<img src="../../assets/figs/system/chat-agent-loop.png" alt="DeepTutor chat agent loop" width="900">
</div>
-เครื่องมือที่ผู้ใช้สลับได้ ได้แก่ `brainstorm`, `web_search`, `paper_search`, `reason`, และ `geogebra_analysis` — รวมถึง `imagegen` และ `videogen` เมื่อคุณกำหนดค่าโมเดลสร้างที่ตรงกัน เครื่องมือตามบริบทเช่น `rag`, `kb_files`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, `github`, และ `consult_subagent` จะ mount อัตโนมัติเมื่อ turn มีบริบทที่ถูกต้อง
+เครื่องมือที่ผู้ใช้สลับได้ ได้แก่ `brainstorm`, `web_search`, `paper_search`, `reason`, และ `geogebra_analysis` — รวมถึง `imagegen` และ `videogen` เมื่อคุณกำหนดค่าโมเดลสร้างที่ตรงกัน เครื่องมือตามบริบทเช่น `rag`, `kb_files`, `read_source`, `read_memory`, `write_memory`, `read_skill`, `load_tools`, `exec`, `web_fetch`, `ask_user`, `list_notebook`, `write_note`, `question_bank`, `github`, และ `consult_subagent` จะ mount อัตโนมัติเมื่อ turn มีบริบทที่ถูกต้อง
บริบทมีสองประเภท: **sticky session context** (subagent, knowledge bases, persona, model, voice) อยู่บน composer toolbar และคงอยู่ตลอด turns; **one-time references** (ไฟล์, ประวัติ chat, หนังสือ, notebooks, question bank, imported agents) มาจากเมนู `+` สำหรับ turn เดียว
@@ -420,13 +421,13 @@ Book แปลงแหล่งที่มาที่เลือกให้
<img src="../../assets/figs/web-1.4.6+/knowledge/00-overview.png" alt="DeepTutor Knowledge Center" width="900">
</div>
-Knowledge bases คือคอลเลกชันเอกสารที่อยู่เบื้องหลัง RAG — รองรับ Chat turns, Co-Writer edits, Book generation และบทสนทนา Partner สิ่งที่โดดเด่นคือ **การเลือกเอ็นจิน retrieval**: **LlamaIndex** (ค่าเริ่มต้น, local vector + BM25), **PageIndex** (hosted, reasoning retrieval พร้อม page-level citations), **GraphRAG** และ **LightRAG** (knowledge-graph retrieval), **LightRAG Server** (retrieval ที่ offload ไปยัง LightRAG instance ภายนอกที่คุณเชื่อมต่อผ่าน HTTP), **Tencent IMA** (ไลบรารีที่คุณคัดสรรใน IMA — ค้นหา เรียกดู และเขียนกลับผ่าน OpenAPI ของมัน) หรือ **Obsidian** vault ที่เชื่อมโยง tutor อ่านและเขียนในที่ KB แต่ละอันถูกผูกกับเอ็นจินหนึ่ง
+Knowledge bases คือคอลเลกชันเอกสารที่อยู่เบื้องหลัง RAG — รองรับ Chat turns, Co-Writer edits, Book generation และบทสนทนา Partner สิ่งที่โดดเด่นคือ **การเลือกเอ็นจิน retrieval**: **LlamaIndex** (ค่าเริ่มต้น, local vector + BM25), **PageIndex** (reasoning retrieval พร้อม page-level citations, hosted หรือ self-hosted OSS), **GraphRAG** และ **LightRAG** (knowledge-graph retrieval), **LightRAG Server** (retrieval ที่ offload ไปยัง LightRAG instance ภายนอกที่คุณเชื่อมต่อผ่าน HTTP), **Tencent IMA** (ไลบรารีที่คุณคัดสรรใน IMA — ค้นหา เรียกดู และเขียนกลับผ่าน OpenAPI ของมัน) หรือ **Obsidian** vault ที่เชื่อมโยง tutor อ่านและเขียนในที่ KB แต่ละอันถูกผูกกับเอ็นจินหนึ่ง
<div align="center">
<img src="../../assets/figs/web-1.4.6+/knowledge/01-create%20knowledge%20base.png" alt="สร้าง knowledge base" width="900">
</div>
-เมื่อสร้าง KB คุณ **สร้างใหม่** (อัพโหลดเอกสารและสร้าง index ใหม่) หรือ **เชื่อมโยงที่มีอยู่** (นำ index ที่สร้างไว้มาใช้ซ้ำ อ่านในที่โดยไม่ต้อง re-index) การ re-indexing จะเขียน directory `version-N` ใหม่และเก็บอันก่อนหน้าไว้ ดังนั้น index ที่ทำงานอยู่จะไม่ถูกทำลายระหว่างการสร้างใหม่ การแยกวิเคราะห์เอกสาร — Text-only, MinerU, Docling, markitdown, PyMuPDF4LLM หรือ LiteParse — ถูกเลือกใน **Settings → Knowledge Base** โดยการดาวน์โหลด local model ปิดโดยค่าเริ่มต้น Docling ยังสามารถรันในโหมด **remote** กับเซิร์ฟเวอร์ Docling Serve ได้ (ไม่ต้องติดตั้ง local หรือใช้ model ใด ๆ) โดยถูกกำหนดค่าผ่าน **Settings → Document Parsing** (`mode=remote`, server base URL และ API key ที่เป็นทางเลือก) หรือผ่าน environment variables `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN` CLI ครอบคลุม lifecycle ด้วย `deeptutor kb list`, `info`, `create`, `add`, `search`, `set-default` และ `delete`
+เมื่อสร้าง KB คุณ **สร้างใหม่** (อัพโหลดเอกสารและสร้าง index ใหม่) หรือ **เชื่อมโยงที่มีอยู่** (นำ index ที่สร้างไว้มาใช้ซ้ำ อ่านในที่โดยไม่ต้อง re-index) การ re-indexing จะเขียน directory `version-N` ใหม่และเก็บอันก่อนหน้าไว้ ดังนั้น index ที่ทำงานอยู่จะไม่ถูกทำลายระหว่างการสร้างใหม่ การแยกวิเคราะห์เอกสาร — Text-only, MinerU, Docling, Tika, markitdown, PyMuPDF4LLM หรือ LiteParse — ถูกเลือกใน **Settings → Knowledge Base** โดยการดาวน์โหลด local model ปิดโดยค่าเริ่มต้น Docling ยังสามารถรันในโหมด **remote** กับเซิร์ฟเวอร์ Docling Serve ได้ (ไม่ต้องติดตั้ง local หรือใช้ model ใด ๆ) โดยถูกกำหนดค่าผ่าน **Settings → Document Parsing** (`mode=remote`, server base URL และ API key ที่เป็นทางเลือก) หรือผ่าน environment variables `DOCLING_MODE` / `DOCLING_API_BASE_URL` / `DOCLING_API_TOKEN` Tika ทำงานในโหมด remote เท่านั้นและชี้ไปยังเซิร์ฟเวอร์ Apache Tika (`TIKA_SERVER_URL`) CLI ครอบคลุม lifecycle ด้วย `deeptutor kb list`, `info`, `create`, `add`, `search`, `set-default` และ `delete`
</details>
diff --git a/assets/README/README_TW.md b/assets/README/README_TW.md
index 6fb927d64..d7b0af770 100644
--- a/assets/README/README_TW.md
+++ b/assets/README/README_TW.md
@@ -5,7 +5,8 @@
# DeepTutor:終身個人化學習導師
<p align="center">
- <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
+ <a href="https://deeptutor.info" target="_blank"><img alt="Docs — deeptutor.info" src="https://img.shields.io/badge/Docs-deeptutor.info%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>&nbsp;
+ <a href="https://deeptutor.info/collaborate/" target="_blank"><img alt="Collaborate — work with us" src="https://img.shields.io/badge/Collaborate-work%20with%20us%20%E2%86%97-0A0A0A?style=for-the-badge&labelColor=F5F5F4" height="36"></a>
</p>
<p align="center">
@@ -327,7 +328,7 @@ Chat 是預設能力,也是大多數工作的起點。單一對話可以進行
<img src="../../assets/figs/system/chat-agent-loop.png" alt="DeepTutor Chat 代理程式迴圈" width="900">
</div>
-使用者可切換的工具包括 `brainstorm`、`web_search`、`paper_search`、`reason` 與 `geogebra_analysis`;設定對應的生成模型後,還會有 `imagegen` 與 `videogen`。`rag`、`kb_files`、`read_source`、`read_memory`、`write_memory`、`read_skill`、`load_tools`、`exec`、`web_fetch`、`ask_user`、`list_notebook`、`write_note`、`github` 與 `consult_subagent` 等情境式工具,會在回合具有相符情境時自動掛載。
+使用者可切換的工具包括 `brainstorm`、`web_search`、`paper_search`、`reason` 與 `geogebra_analysis`;設定對應的生成模型後,還會有 `imagegen` 與 `videogen`。`rag`、`kb_files`、`read_source`、`read_memory`、`write_memory`、`read_skill`、`load_tools`、`exec`、`web_fetch`、`ask_user`、`list_notebook`、`write_note`、`question_bank`、`github` 與 `consult_subagent` 等情境式工具,會在回合具有相符情境時自動掛載。
情境分成兩類:**固定的工作階段情境**(子代理程式、知識庫、角色設定、模型、語音)位於輸入框工具列,並會延續到後續回合;**單次參照**(檔案、聊天記錄、書籍、筆記本、題庫、匯入的代理程式)則從 `+` 選單加入,只用於單一回合。
@@ -420,13 +421,13 @@ Book 會將選定來源轉換成互動式**活書**;它不是靜態 PDF,而
<img src="../../assets/figs/web-1.4.6+/knowledge/00-overview.png" alt="DeepTutor Knowledge Center" width="900">
</div>
-知識庫是 RAG 背後的文件集合,可為 Chat 回合、Co-Writer 編輯、Book 生成與 Partner 對話提供依據。其特色在於可**選擇檢索引擎**:**LlamaIndex**(預設,本機 vector+BM25)、**PageIndex**(託管式、可推理的檢索並附頁面層級引用)、**GraphRAG** 與 **LightRAG**(知識圖譜檢索)、**LightRAG Server**(透過 HTTP 連接的外部 LightRAG 執行個體負責檢索)、**Tencent IMA**(在 IMA 中整理的知識庫 — 透過其 OpenAPI 進行搜尋、瀏覽與寫回),或讓導師就地讀寫的已連結 **Obsidian** vault。每個知識庫都會繫結至單一引擎。
+知識庫是 RAG 背後的文件集合,可為 Chat 回合、Co-Writer 編輯、Book 生成與 Partner 對話提供依據。其特色在於可**選擇檢索引擎**:**LlamaIndex**(預設,本機 vector+BM25)、**PageIndex**(可推理的檢索並附頁面層級引用,支援託管式或自架 OSS)、**GraphRAG** 與 **LightRAG**(知識圖譜檢索)、**LightRAG Server**(透過 HTTP 連接的外部 LightRAG 執行個體負責檢索)、**Tencent IMA**(在 IMA 中整理的知識庫 — 透過其 OpenAPI 進行搜尋、瀏覽與寫回),或讓導師就地讀寫的已連結 **Obsidian** vault。每個知識庫都會繫結至單一引擎。
<div align="center">
<img src="../../assets/figs/web-1.4.6+/knowledge/01-create%20knowledge%20base.png" alt="建立知識庫" width="900">
</div>
-建立知識庫時,可以選擇**建立新的知識庫**(上傳文件並建立全新索引),或**連結現有知識庫**(重複使用在其他位置建立的索引、就地讀取且不重新建立索引)。重新建立索引時,系統會寫入新的扁平 `version-N` 目錄並保留先前版本,因此可用索引不會在重建途中遭到破壞。即使知識庫處於 **error** 狀態,也能移除單一文件;可直接刪除解析失敗的檔案,無須刪除並重建全部內容。文件解析方式(Text-only、MinerU、Docling、markitdown 或 PyMuPDF4LLM)可在 **Settings → Knowledge Base** 選擇,預設不下載本機模型。Docling 也可以在**遠端(remote)**模式下運作,改連線至 Docling Serve 伺服器(無須本機安裝或下載模型),可透過 **Settings → Document Parsing**(設定 `mode=remote`、伺服器基礎 URL 與選用的 API 金鑰)或 `DOCLING_MODE`/`DOCLING_API_BASE_URL`/`DOCLING_API_TOKEN` 環境變數進行設定。CLI 也提供對應的完整生命週期指令:`deeptutor kb list`、`info`、`create`、`add`、`search`、`set-default` 與 `delete`。
+建立知識庫時,可以選擇**建立新的知識庫**(上傳文件並建立全新索引),或**連結現有知識庫**(重複使用在其他位置建立的索引、就地讀取且不重新建立索引)。重新建立索引時,系統會寫入新的扁平 `version-N` 目錄並保留先前版本,因此可用索引不會在重建途中遭到破壞。即使知識庫處於 **error** 狀態,也能移除單一文件;可直接刪除解析失敗的檔案,無須刪除並重建全部內容。文件解析方式(Text-only、MinerU、Docling、Tika、markitdown 或 PyMuPDF4LLM)可在 **Settings → Knowledge Base** 選擇,預設不下載本機模型。Docling 也可以在**遠端(remote)**模式下運作,改連線至 Docling Serve 伺服器(無須本機安裝或下載模型),可透過 **Settings → Document Parsing**(設定 `mode=remote`、伺服器基礎 URL 與選用的 API 金鑰)或 `DOCLING_MODE`/`DOCLING_API_BASE_URL`/`DOCLING_API_TOKEN` 環境變數進行設定。Tika 僅支援遠端模式,會連線至 Apache Tika 伺服器(`TIKA_SERVER_URL`)。CLI 也提供對應的完整生命週期指令:`deeptutor kb list`、`info`、`create`、`add`、`search`、`set-default` 與 `delete`。
</details>
diff --git a/assets/releases/ver1-5-12.md b/assets/releases/past_releases/ver1-5-12.md
similarity index 100%
rename from assets/releases/ver1-5-12.md
rename to assets/releases/past_releases/ver1-5-12.md
diff --git a/assets/releases/ver1-5-13.md b/assets/releases/ver1-5-13.md
index 3d31b33d8..1f1caeeed 100644
--- a/assets/releases/ver1-5-13.md
+++ b/assets/releases/ver1-5-13.md
@@ -2,7 +2,7 @@
**Release Date:** 2026.08.17
-[v1.5.12](ver1-5-12.md) was about where an answer's material comes from. This one is mostly about Book — the surface that turns that material into something you *read* rather than something you chat with. A book could be generated but not really used: the page froze while it was being written, the progress it claimed to track was never written down, and what you got could not leave the app. That gap is the bulk of this release. The home screen also stops asking you to start from a blank composer. Drop-in — no migrations, nothing to re-index.
+[v1.5.12](past_releases/ver1-5-12.md) was about where an answer's material comes from. This one is mostly about Book — the surface that turns that material into something you *read* rather than something you chat with. A book could be generated but not really used: the page froze while it was being written, the progress it claimed to track was never written down, and what you got could not leave the app. That gap is the bulk of this release. The home screen also stops asking you to start from a blank composer. Drop-in — no migrations, nothing to re-index.
## What's New
diff --git a/assets/releases/ver1-5-15.md b/assets/releases/ver1-5-15.md
new file mode 100644
index 000000000..898f689eb
--- /dev/null
+++ b/assets/releases/ver1-5-15.md
@@ -0,0 +1,76 @@
+# DeepTutor v1.5.15 Release Notes
+
+**Release Date:** 2026.08.20
+
+[v1.5.14](ver1-5-14.md) put the document next to the conversation. This one is mostly about what sits behind it: PageIndex becomes something you can host yourself and retrieves by reasoning over a document tree, the question bank stops being a list you cannot file into, and third-party packages can now register their own tools and capabilities. Nearly all of it arrived as community pull requests. Drop-in — no migrations, nothing to re-index.
+
+## What's New
+
+### PageIndex you can host yourself, and retrieval that reasons
+
+**PageIndex OSS** joins the engine list as its own knowledge-base type: the same interface as the hosted service, bound to the base's local library, driven by the LLM you already configured instead of a PageIndex API key.
+
+Retrieval changed underneath both variants. A PageIndex base used to be read through a built-in MCP server; that path is gone, replaced by a small reading loop that walks the document tree — structure first, then only the pages it needs. Fewer moving parts, and the same page-level citations come back.
+
+### The question bank stops being write-only
+
+`addEntryToCategory` shipped in **v1.3.6** and was never called from the frontend, so for eleven releases a learner could create categories and never put anything in them. The quiz card's bespoke dropdown now uses the shared category menu that does call it.
+
+The page is rebuilt around the three things a flat list could not do — search, batch selection, and an inbox for questions nobody has filed yet. Graded Mastery Path questions carry their explanation and difficulty in with them.
+
+And the tutor can finally file for you. Asking it to group your wrong answers had no writable handle on the bank, so it reached for `write_note` and your request quietly became a notebook record — the Chinese `write_note` hint even listed 错题分析 as a reason to append. The new `question_bank` tool is name-addressed: `organize` takes a category name and creates it if missing, so filing is one call after one listing. It mounts only when the bank has entries.
+
+### Third-party tools and capabilities
+
+Two entry-point groups let an installed package extend DeepTutor without touching the tree. `deeptutor.plugins` was already imported by the capability registry and `/plugins/list` behind a `try/except` — but the module never existed, so plugin discovery was a dead path; it is now real. `deeptutor.loop_capabilities` registers chat-loop capabilities alongside the built-ins, which win on name collisions. Broken entry points are skipped rather than fatal, and discovery is cached per process so plugin capabilities stay singletons.
+
+### Apache Tika parsing
+
+A seventh document-parsing engine, selectable in **Settings → Knowledge Base**. Tika is remote-only: no Python package, no model download — it points at an Apache Tika server (`TIKA_SERVER_URL`) and converts a broad set of formats to Markdown.
+
+### LightRAG's indexing knobs, in the UI
+
+`max_concurrent_files`, `llm_model_max_async`, and `entity_extract_max_gleaning` reached runtime settings and the API in [#877](https://github.com/HKUDS/DeepTutor/pull/877) but had no inputs, so they were reachable only by hand-editing config. They now sit under their own **Indexing** divider — a different axis from the query knobs above, because they shape how a base is *built*, so a change applies to the next build rather than the next question. The wiring asks the installed RAG-Anything what it accepts and drops the rest with a warning, so an older install keeps running on library defaults instead of raising.
+
+### Rebuilding a document tree in a knowledge base
+
+Three fixes finally close [#866](https://github.com/HKUDS/DeepTutor/issues/866). A linked folder's subdirectories stopped collapsing into `raw/`'s top level; same-named documents from different subtrees stopped silently dropping one another (a clash between different bytes stages under a free sibling name, identical bytes still dedup); and uploads now take an optional **destination folder**.
+
+That last one was the actual blocker. A browser folder pick reports each file's path relative to the directory you chose, so adding `应用开发/钉钉CLI/` one subtree at a time arrived as `钉钉CLI/...` with no way to say where it belonged — every batch piled up at the root, and the missing ancestor was never in the payload to begin with. The picker now offers the base's existing folders once files are staged.
+
+### Book: a learning-capture inbox
+
+Reading segments you select are kept per book with an explicit status lifecycle, so captures can be reviewed before they go anywhere. Separately, drift warnings got honest: stale-page detection is scoped to the KB documents that actually changed, and a warning will not clear while flagged pages are still awaiting recompilation.
+
+### Whisper — a community contribution
+
+`/whisper` is a two-seat counselling-practice room contributed by [@alanguan73](https://github.com/alanguan73): the tutor plays the visitor, you take the trainee seat, and a supervisor whispers coaching only the trainee sees, with an end-of-session debrief. It lives under **Learning Space → More Projects** and needs its own capability package installed — the surface ships, the counselling capability is not part of DeepTutor.
+
+The generally useful half of that work is in the runtime: a capability can now publish a body and its own declared extras on `CAPABILITY_COMPLETE`, while `capability`, `session_id`, and `turn_id` stay unspoofable. Only the explicitly declared sub-dict goes on the event bus — turn metadata is a scratchpad holding live callables and your `ask_user` answers, and it was never a wire format.
+
+### Assorted
+
+- **The model knows what day it is.** Without the real date it resolved "today" from its training cutoff when composing web searches. The injected block is day-granular, so the system prompt stays byte-stable within a day and keeps prompt-cache hits.
+- **Deleting a turn no longer blanks the session.** Descendants pointed at deleted rows, the session lost its root, and the page rendered empty ([#912](https://github.com/HKUDS/DeepTutor/issues/912)). Deleted rows are spliced out of the parent-pointer tree, and already-corrupted sessions are recovered from their oldest orphan.
+- **A stale CA bundle no longer breaks every LLM call.** A leftover `SSL_CERT_FILE` / `SSL_CERT_DIR` — common after cloning a conda env without `ca-certificates` — made httpx raise mid-construction; broken paths are dropped so TLS falls back to the default bundle.
+- **Thinking tags are filtered on non-SSE local streams too.** That branch passed reasoning blocks straight through; both branches now share one incremental parser, so a tag split across chunks or left unclosed behaves the same either way.
+- **Unhandled server errors return JSON** instead of Starlette's plain-text 500, and the handler stays inside the middleware stack so the response still carries CORS headers.
+- **Obsidian vaults survive real-world files** — undecodable bytes and date-typed frontmatter are tolerated, and a vault that fails to open says why instead of failing opaquely.
+- **A stuck session load ends in a retryable state** rather than spinning, and token usage emitted as plain dicts by native adapters is recorded instead of lost.
+- **Mastery reads stop inventing paths**, `end_loop` is honored after an `ask_user` resume, and the `codebuddy` extra resolves again.
+- **The frontend is linted in CI.** ESLint now runs on `web/` on every build.
+
+The docs at [deeptutor.info](https://deeptutor.info/) were refreshed alongside this release.
+
+## Upgrade Notes
+
+`pip install -U deeptutor`; Docker users pull `ghcr.io/hkuds/deeptutor:latest`. No schema changes, no re-index, no migration.
+
+- **PageIndex OSS needs an API-key or local LLM profile.** An OAuth-only provider (OpenAI Codex, GitHub Copilot, CodeBuddy) cannot drive indexing and is rejected with an explanation. OSS bases are **PDF-only**, and at most one may be selected per request.
+- **PageIndex's built-in MCP server is gone.** Nothing to configure — hosted bases keep working through the new reading loop. If you had pinned that MCP server anywhere yourself, drop it.
+- **Tika installs nothing.** Run an Apache Tika server and point `TIKA_SERVER_URL` at it (default `http://localhost:9998`); there is no `parse-tika` extra because there is no Python package.
+- **The LightRAG extra's floor moved** to `raganything>=1.2.5`, the first release carrying the keyword passthrough. Older installs are not broken — unsupported knobs are dropped with a warning — but the three new ones need that floor to take effect. The knobs apply to the **next build**, not the next question.
+- **Book drift warnings re-baseline once.** Fingerprints now carry a scheme tag, so changing the formula re-baselines existing books instead of marking every one of them stale.
+- **Whisper is not a primary nav entry.** It sits under **Learning Space → More Projects**, and the room needs its own capability package — a stock install has the page but not the counselling capability behind it.
+
+**Full Changelog**: https://github.com/HKUDS/DeepTutor/compare/v1.5.14...v1.5.15
diff --git a/deeptutor/__version__.py b/deeptutor/__version__.py
index 391d9166e..95a3cf27c 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.5.14"
+__version__ = "1.5.15"
__all__ = ("__version__",)
diff --git a/deeptutor/capabilities/setup/access.py b/deeptutor/capabilities/setup/access.py
index 8b6eeff3c..c66e93173 100644
--- a/deeptutor/capabilities/setup/access.py
+++ b/deeptutor/capabilities/setup/access.py
@@ -98,7 +98,8 @@ def can_write(scope: Scope) -> AccessDecision:
def writable_scopes() -> tuple[Scope, ...]:
"""Scopes the current turn may write — used to describe the surface up front."""
- return tuple(scope for scope in ("personal", "global") if can_write(scope).allowed)
+ scopes: tuple[Scope, ...] = ("personal", "global")
+ return tuple(scope for scope in scopes if can_write(scope).allowed)
__all__ = ["AccessDecision", "can_write", "writable_scopes"]
diff --git a/deeptutor/services/config/settings_spec.py b/deeptutor/services/config/settings_spec.py
index e8894b3f5..e8ca77117 100644
--- a/deeptutor/services/config/settings_spec.py
+++ b/deeptutor/services/config/settings_spec.py
@@ -525,7 +525,7 @@ async def _probe_llm(value: str) -> ProbeResult:
extra_headers=resolved.extra_headers,
reasoning_effort=resolved.reasoning_effort,
max_retries=_PROBE_MAX_RETRIES,
- **get_token_limit_kwargs(resolved.model, max_tokens=64),
+ **get_token_limit_kwargs(resolved.model, max_tokens=64), # type: ignore[arg-type]
),
timeout=_PROBE_TIMEOUT_SECONDS,
)
diff --git a/deeptutor/services/session/sqlite_store.py b/deeptutor/services/session/sqlite_store.py
index 555147d91..f89eef81e 100644
--- a/deeptutor/services/session/sqlite_store.py
+++ b/deeptutor/services/session/sqlite_store.py
@@ -1730,7 +1730,7 @@ class SQLiteSessionStore:
INNER JOIN notebook_categories c ON c.id = ec.category_id
WHERE ec.entry_id IN ({placeholders})
ORDER BY c.name
- """,
+ """, # nosec B608 - only `?` placeholders are interpolated; every value binds
tuple(entry_ids),
).fetchall()
grouped: dict[int, list[dict[str, Any]]] = {}
@@ -1753,8 +1753,11 @@ class SQLiteSessionStore:
n.followup_session_id, n.ai_judgment, n.created_at, n.updated_at
FROM notebook_entries n
LEFT JOIN sessions s ON s.id = n.session_id{join_sql}
- """
- count_sql = f"SELECT COUNT(*) AS cnt FROM notebook_entries n{join_sql}{where_sql}"
+ """ # nosec B608 - join_sql/where_sql are literal fragments; every value binds via ?
+ count_sql = (
+ # join_sql/where_sql are literal fragments; every value binds via ?
+ f"SELECT COUNT(*) AS cnt FROM notebook_entries n{join_sql}{where_sql}" # nosec B608
+ )
with self._connect() as conn:
total_row = conn.execute(count_sql, tuple(params)).fetchone()
total = int(total_row["cnt"]) if total_row else 0
@@ -2100,7 +2103,7 @@ class SQLiteSessionStore:
known = [
int(r["id"])
for r in conn.execute(
- f"SELECT id FROM notebook_entries WHERE id IN ({placeholders})",
+ f"SELECT id FROM notebook_entries WHERE id IN ({placeholders})", # nosec B608 - only `?` placeholders are interpolated; every value binds
tuple(entry_ids),
).fetchall()
]
diff --git a/deeptutor_cli/kb.py b/deeptutor_cli/kb.py
index 4d1c680ed..5e59ae2c9 100644
--- a/deeptutor_cli/kb.py
+++ b/deeptutor_cli/kb.py
@@ -310,6 +310,6 @@ def register(app: typer.Typer) -> None:
return
answer = result.get("answer") or result.get("content", "")
- provider = result.get("provider", DEFAULT_PROVIDER)
+ provider = str(result.get("provider", DEFAULT_PROVIDER))
console.print(f"[bold]Provider:[/] {provider}")
console.print(f"[bold]Answer:[/]\n{answer}")
diff --git a/web/app/(workspace)/book/components/LearningCapturePanel.tsx b/web/app/(workspace)/book/components/LearningCapturePanel.tsx
index e57af2cc9..4b26d4dbd 100644
--- a/web/app/(workspace)/book/components/LearningCapturePanel.tsx
+++ b/web/app/(workspace)/book/components/LearningCapturePanel.tsx
@@ -19,7 +19,10 @@ const reviewableStatuses = new Set<LearningCapture["status"]>([
"pending_confirmation",
]);
-function statusText(status: LearningCapture["status"], t: (key: string, values?: any) => string) {
+function statusText(
+ status: LearningCapture["status"],
+ t: (key: string, values?: any) => string,
+) {
const map: Record<string, string> = {
captured: t("Captured"),
drafted: t("Drafted"),
@@ -61,22 +64,24 @@ export default function LearningCapturePanel({
onClick={() => setShowAll((current) => !current)}
className="inline-flex items-center gap-1 rounded-md border border-[var(--border)] px-2 py-1 text-[10px] text-[var(--muted-foreground)] hover:border-[var(--primary)]/40 hover:text-[var(--foreground)]"
title={
- showAll ? t("Show only reviewable captures") : t("Show all captures")
+ showAll
+ ? t("Show only reviewable captures")
+ : t("Show all captures")
}
>
<ListFilter className="h-3.5 w-3.5" />
- {showAll ? t("Review") : t("All")}
- </button>
- </div>
+ {showAll ? t("Review") : t("All")}
+ </button>
</div>
+ </div>
{loading && filteredCaptures.length === 0 ? (
- <div className="text-xs text-[var(--muted-foreground)]">{t("Loading captures…")}</div>
+ <div className="text-xs text-[var(--muted-foreground)]">
+ {t("Loading captures…")}
+ </div>
) : filteredCaptures.length === 0 ? (
<div className="text-xs text-[var(--muted-foreground)]">
- {showAll
- ? t("No captures yet.")
- : t("No captures awaiting review.")}
+ {showAll ? t("No captures yet.") : t("No captures awaiting review.")}
</div>
) : (
<div className="max-h-52 space-y-2 overflow-y-auto pr-1">
diff --git a/web/app/(workspace)/book/components/PageReader.tsx b/web/app/(workspace)/book/components/PageReader.tsx
index 88c0274bd..adf3d8d76 100644
--- a/web/app/(workspace)/book/components/PageReader.tsx
+++ b/web/app/(workspace)/book/components/PageReader.tsx
@@ -166,7 +166,9 @@ export default function PageReader({
anchor && anchor.nodeType === Node.TEXT_NODE
? anchor.parentElement
: (anchor as HTMLElement | null);
- const blockEl = anchorEl?.closest?.("[data-block-id]") as HTMLElement | null;
+ const blockEl = anchorEl?.closest?.(
+ "[data-block-id]",
+ ) as HTMLElement | null;
const blockId = blockEl?.getAttribute("data-block-id") || "";
const rawContext = blockEl?.textContent || selection.toString();
@@ -179,7 +181,8 @@ export default function PageReader({
sourceEnd >= 0 ? Math.min(normalizedContext.length, sourceEnd + 120) : 0;
const contextBefore =
sourceStart >= 0 ? normalizedContext.slice(beforeStart, sourceStart) : "";
- const contextAfter = sourceEnd >= 0 ? normalizedContext.slice(sourceEnd, afterEnd) : "";
+ const contextAfter =
+ sourceEnd >= 0 ? normalizedContext.slice(sourceEnd, afterEnd) : "";
const sourceLocator = blockId
? `/book/${page.book_id}/pages/${page.id}/blocks/${blockId}`
diff --git a/web/app/(workspace)/book/page.tsx b/web/app/(workspace)/book/page.tsx
index fc015d398..8c14e41cc 100644
--- a/web/app/(workspace)/book/page.tsx
+++ b/web/app/(workspace)/book/page.tsx
@@ -142,9 +142,10 @@ function BookPageInner() {
const [supplementingBlockId, setSupplementingBlockId] = useState<
string | null
>(null);
- const [learningCaptures, setLearningCaptures] = useState<LearningCapture[]>([]);
- const [loadingLearningCaptures, setLoadingLearningCaptures] =
- useState(false);
+ const [learningCaptures, setLearningCaptures] = useState<LearningCapture[]>(
+ [],
+ );
+ const [loadingLearningCaptures, setLoadingLearningCaptures] = useState(false);
// Phase 5 — live BookEngine progress timeline state.
const [progress, dispatchProgress] = useReducer(
@@ -228,10 +229,13 @@ function BookPageInner() {
setLearningCaptures(captures);
} catch (err) {
const msg = err instanceof Error ? err.message : String(err);
- notify(t("Could not load learning captures: {{message}}", { message: msg }), {
- tone: "error",
- durationMs: 6000,
- });
+ notify(
+ t("Could not load learning captures: {{message}}", { message: msg }),
+ {
+ tone: "error",
+ durationMs: 6000,
+ },
+ );
setLearningCaptures([]);
} finally {
setLoadingLearningCaptures(false);
@@ -803,15 +807,18 @@ function BookPageInner() {
return [...captures].sort((a, b) => b.updated_at - a.updated_at);
}, []);
- const applyCapturePatch = useCallback((capture: LearningCapture) => {
- setLearningCaptures((current) =>
- refreshCapturesSorted(
- current.some((item) => item.id === capture.id)
- ? current.map((item) => (item.id === capture.id ? capture : item))
- : [capture, ...current],
- ),
- );
- }, [refreshCapturesSorted]);
+ const applyCapturePatch = useCallback(
+ (capture: LearningCapture) => {
+ setLearningCaptures((current) =>
+ refreshCapturesSorted(
+ current.some((item) => item.id === capture.id)
+ ? current.map((item) => (item.id === capture.id ? capture : item))
+ : [capture, ...current],
+ ),
+ );
+ },
+ [refreshCapturesSorted],
+ );
const handleCaptureSelection = async (payload: {
page_id: string;
@@ -977,7 +984,9 @@ function BookPageInner() {
void handleRegenerateBlock(block)
}
onDeleteBlock={(block) => void handleDeleteBlock(block)}
- onMoveBlock={(block, dir) => void handleMoveBlock(block, dir)}
+ onMoveBlock={(block, dir) =>
+ void handleMoveBlock(block, dir)
+ }
onChangeBlockType={(block, t) =>
void handleChangeBlockType(block, t)
}
@@ -1023,10 +1032,14 @@ function BookPageInner() {
captures={learningCaptures}
loading={loadingLearningCaptures}
onApprove={(capture) =>
- void guard("Approve capture", () => handleApproveCapture(capture))
+ void guard("Approve capture", () =>
+ handleApproveCapture(capture),
+ )
}
onReject={(capture) =>
- void guard("Reject capture", () => handleRejectCapture(capture))
+ void guard("Reject capture", () =>
+ handleRejectCapture(capture),
+ )
}
/>
</div>
diff --git a/web/app/(workspace)/whisper/page.tsx b/web/app/(workspace)/whisper/page.tsx
index da5b136a8..f2948f262 100644
--- a/web/app/(workspace)/whisper/page.tsx
+++ b/web/app/(workspace)/whisper/page.tsx
@@ -364,7 +364,10 @@ export default function WhisperPage() {
</div>
)}
- <div ref={scrollerRef} className="min-h-0 flex-1 overflow-y-auto px-4 py-4">
+ <div
+ ref={scrollerRef}
+ className="min-h-0 flex-1 overflow-y-auto px-4 py-4"
+ >
<div className="mx-auto w-full max-w-3xl">
<WhisperMessageList messages={visibleMessages} seat={seat} />
</div>
diff --git a/web/components/knowledge/CreateKbModal.tsx b/web/components/knowledge/CreateKbModal.tsx
index 1bdff05c0..541468591 100644
--- a/web/components/knowledge/CreateKbModal.tsx
+++ b/web/components/knowledge/CreateKbModal.tsx
@@ -106,9 +106,9 @@ export default function CreateKbModal({
const [name, setName] = useState("");
const [provider, setProvider] = useState("llamaindex");
const [files, setFiles] = useState<File[]>([]);
- const [pageIndexMode, setPageIndexMode] = useState<
- "" | "flash" | "standard"
- >("");
+ const [pageIndexMode, setPageIndexMode] = useState<"" | "flash" | "standard">(
+ "",
+ );
// Link mode: the source is either an engine id or the Obsidian sentinel.
const [linkSource, setLinkSource] = useState(OBSIDIAN_SOURCE);
const [folderPath, setFolderPath] = useState("");
@@ -554,8 +554,9 @@ function NewModeFields({
connectionForm?: ReactNode;
t: TFn;
}) {
- const readinessReason = providers.find((item) => item.id === provider)
- ?.readiness_reason;
+ const readinessReason = providers.find(
+ (item) => item.id === provider,
+ )?.readiness_reason;
return (
<>
<div>
@@ -579,25 +580,25 @@ function NewModeFields({
: "border-[var(--border)] hover:border-[var(--ring)]"
}`}
>
- <div className="flex items-center justify-between gap-2">
- <span className="text-[13px] font-medium text-[var(--foreground)]">
- {p.name}
- </span>
- {needsKey ? (
- <span className="inline-flex items-center gap-1 rounded-full bg-amber-100 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 dark:bg-amber-950/30 dark:text-amber-300">
- {t("Needs key")}
- </span>
- ) : unavailable ? (
- <span className="inline-flex items-center gap-1 rounded-full bg-[var(--muted)] px-1.5 py-0.5 text-[10px] font-medium text-[var(--muted-foreground)]">
- {t("Not installed")}
+ <div className="flex items-center justify-between gap-2">
+ <span className="text-[13px] font-medium text-[var(--foreground)]">
+ {p.name}
</span>
- ) : selected ? (
- <Check className="h-3.5 w-3.5 text-[var(--primary)]" />
- ) : null}
- </div>
- <span className="text-[11.5px] leading-snug text-[var(--muted-foreground)]">
- {p.description}
- </span>
+ {needsKey ? (
+ <span className="inline-flex items-center gap-1 rounded-full bg-amber-100 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 dark:bg-amber-950/30 dark:text-amber-300">
+ {t("Needs key")}
+ </span>
+ ) : unavailable ? (
+ <span className="inline-flex items-center gap-1 rounded-full bg-[var(--muted)] px-1.5 py-0.5 text-[10px] font-medium text-[var(--muted-foreground)]">
+ {t("Not installed")}
+ </span>
+ ) : selected ? (
+ <Check className="h-3.5 w-3.5 text-[var(--primary)]" />
+ ) : null}
+ </div>
+ <span className="text-[11.5px] leading-snug text-[var(--muted-foreground)]">
+ {p.description}
+ </span>
</button>
{p.id === "pageindex" && (
<a
@@ -622,7 +623,7 @@ function NewModeFields({
? t(
"This engine needs an API key. Configure it before creating.",
)
- : t(
+ : t(
readinessReason ||
"This engine isn't ready on the server. Check its requirements before creating.",
)}
@@ -651,9 +652,7 @@ function NewModeFields({
<select
value={pageIndexMode}
onChange={(event) =>
- setPageIndexMode(
- event.target.value as "" | "flash" | "standard",
- )
+ setPageIndexMode(event.target.value as "" | "flash" | "standard")
}
disabled={submitting}
className="w-full rounded-lg border border-[var(--border)] bg-[var(--background)] px-3 py-2 text-[12.5px] text-[var(--foreground)] outline-none transition-colors focus:border-[var(--foreground)]/25 disabled:opacity-50"
@@ -678,8 +677,11 @@ function NewModeFields({
{t("Initial documents")}
{(isPageIndexCloud || isPageIndexOSS) && (
<span className="ml-2 normal-case tracking-normal text-[var(--muted-foreground)]/80">
- · {isPageIndexOSS
- ? t("PDF only — use PageIndex Cloud for Office, Markdown or CSV")
+ ·{" "}
+ {isPageIndexOSS
+ ? t(
+ "PDF only — use PageIndex Cloud for Office, Markdown or CSV",
+ )
: t("PDF, Office, text and Markdown")}
</span>
)}
diff --git a/web/components/knowledge/KnowledgeBaseDetail.tsx b/web/components/knowledge/KnowledgeBaseDetail.tsx
index e41bbedc8..e6a606b50 100644
--- a/web/components/knowledge/KnowledgeBaseDetail.tsx
+++ b/web/components/knowledge/KnowledgeBaseDetail.tsx
@@ -176,7 +176,8 @@ export default function KnowledgeBaseDetail({
</div>
<p className="mt-1 text-[12px] text-[var(--muted-foreground)]">
{provider}
- {!pageIndexProvider ? ` · ${embeddingLabel}` : ""} · {t("Updated")} {updatedLabel}
+ {!pageIndexProvider ? ` · ${embeddingLabel}` : ""} ·{" "}
+ {t("Updated")} {updatedLabel}
{lastIndexedLabel
? ` · ${t("Last indexed")} ${lastIndexedLabel}`
: ""}
diff --git a/web/components/notebook/NotebookRecordActions.tsx b/web/components/notebook/NotebookRecordActions.tsx
index 4b7a556fa..561803609 100644
--- a/web/components/notebook/NotebookRecordActions.tsx
+++ b/web/components/notebook/NotebookRecordActions.tsx
@@ -157,7 +157,10 @@ export default function NotebookRecordActions({
role="menuitem"
onClick={() => {
close();
- onRelocate(notebook.id, panel === "move" ? "move" : "copy");
+ onRelocate(
+ notebook.id,
+ panel === "move" ? "move" : "copy",
+ );
}}
className="flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-[12.5px] text-[var(--foreground)] transition-colors hover:bg-[var(--muted)]/70"
>
diff --git a/web/components/quiz/QuizViewer.tsx b/web/components/quiz/QuizViewer.tsx
index d25d614cd..d5c8b4598 100644
--- a/web/components/quiz/QuizViewer.tsx
+++ b/web/components/quiz/QuizViewer.tsx
@@ -929,7 +929,6 @@ export default function QuizViewer({
) : null;
})()}
</button>
-
</div>
)}
</div>
diff --git a/web/components/reading/AnnotationLayer.tsx b/web/components/reading/AnnotationLayer.tsx
index 85970d269..5eecc3348 100644
--- a/web/components/reading/AnnotationLayer.tsx
+++ b/web/components/reading/AnnotationLayer.tsx
@@ -46,7 +46,8 @@ export function AnnotationLayer({
{annotations.map((annotation) =>
annotation.rects.map((rect, index) => {
const [x0, y0, x1, y1] = rect;
- const isFocused = annotation.annotation_id === highlightedAnnotationId;
+ const isFocused =
+ annotation.annotation_id === highlightedAnnotationId;
const isUnderline = annotation.kind === "underline";
return (
<button
diff --git a/web/components/reading/AnnotationList.tsx b/web/components/reading/AnnotationList.tsx
index 639000dcf..e835c4ca6 100644
--- a/web/components/reading/AnnotationList.tsx
+++ b/web/components/reading/AnnotationList.tsx
@@ -91,7 +91,9 @@ export function AnnotationList({
<span
aria-hidden
className="absolute left-0 top-2 bottom-2 w-[3px] rounded-full"
- style={{ background: SWATCH[annotation.color] ?? SWATCH.yellow }}
+ style={{
+ background: SWATCH[annotation.color] ?? SWATCH.yellow,
+ }}
/>
{annotation.quote && (
<p className="line-clamp-3 pl-1.5 text-[12px] leading-[1.55] text-[var(--foreground)]">
diff --git a/web/components/reading/AnnotationPopover.tsx b/web/components/reading/AnnotationPopover.tsx
index 21af37f5b..553a116d1 100644
--- a/web/components/reading/AnnotationPopover.tsx
+++ b/web/components/reading/AnnotationPopover.tsx
@@ -1,7 +1,12 @@
"use client";
import { useEffect, useLayoutEffect, useRef, useState } from "react";
-import { Highlighter, MessageSquareQuote, StickyNote, Underline } from "lucide-react";
+import {
+ Highlighter,
+ MessageSquareQuote,
+ StickyNote,
+ Underline,
+} from "lucide-react";
import { useTranslation } from "react-i18next";
import { ANNOTATION_COLORS, type AnnotationColor } from "@/lib/reading-api";
@@ -64,7 +69,10 @@ export function AnnotationPopover({
Math.max(margin, anchor.x - box.width / 2),
window.innerWidth - box.width - margin,
);
- setPosition({ left, top: Math.min(top, window.innerHeight - box.height - margin) });
+ setPosition({
+ left,
+ top: Math.min(top, window.innerHeight - box.height - margin),
+ });
}, [anchor.x, anchor.y, noteOpen]);
useEffect(() => {
diff --git a/web/components/reading/MaterialPicker.tsx b/web/components/reading/MaterialPicker.tsx
index 5fd6ee190..667d8fe9a 100644
--- a/web/components/reading/MaterialPicker.tsx
+++ b/web/components/reading/MaterialPicker.tsx
@@ -25,7 +25,10 @@ export interface MaterialPickerProps {
* read before reopens it *with its annotations* rather than creating a duplicate.
* The copy says so, because otherwise the behaviour looks like a bug.
*/
-export function MaterialPicker({ onOpen, refreshToken = 0 }: MaterialPickerProps) {
+export function MaterialPicker({
+ onOpen,
+ refreshToken = 0,
+}: MaterialPickerProps) {
const { t } = useTranslation();
const inputRef = useRef<HTMLInputElement | null>(null);
const [materials, setMaterials] = useState<MaterialInfo[]>([]);
@@ -133,7 +136,10 @@ export function MaterialPicker({ onOpen, refreshToken = 0 }: MaterialPickerProps
}`}
>
{busy ? (
- <Loader2 size={20} className="animate-spin text-[var(--muted-foreground)]" />
+ <Loader2
+ size={20}
+ className="animate-spin text-[var(--muted-foreground)]"
+ />
) : (
<Upload size={20} className="text-[var(--muted-foreground)]" />
)}
diff --git a/web/components/reading/PdfDocumentView.tsx b/web/components/reading/PdfDocumentView.tsx
index ddbec9275..921645484 100644
--- a/web/components/reading/PdfDocumentView.tsx
+++ b/web/components/reading/PdfDocumentView.tsx
@@ -182,13 +182,17 @@ export function PdfDocumentView({
for (const page of pages) {
const rect = page.getBoundingClientRect();
const covered =
- Math.min(rect.bottom, rootRect.bottom) - Math.max(rect.top, rootRect.top);
+ Math.min(rect.bottom, rootRect.bottom) -
+ Math.max(rect.top, rootRect.top);
if (covered <= 0) continue;
const locator = Number(page.dataset.readerUnit ?? "0");
if (!locator) continue;
if (!best || covered > best.covered) best = { locator, covered };
}
- if (best) setVisibleLocator((current) => (current === best.locator ? current : best.locator));
+ if (best)
+ setVisibleLocator((current) =>
+ current === best.locator ? current : best.locator,
+ );
};
const onScroll = () => {
@@ -219,7 +223,8 @@ export function PdfDocumentView({
*/
const isActive = useCallback(
(locator: number) => {
- const near = (anchor: number) => Math.abs(locator - anchor) <= RENDER_MARGIN;
+ const near = (anchor: number) =>
+ Math.abs(locator - anchor) <= RENDER_MARGIN;
return near(visibleLocator) || (jump ? near(jump.locator) : false);
},
[visibleLocator, jump],
@@ -321,7 +326,8 @@ export function PdfDocumentView({
// superseded by derivation — no timer, and no way for a stale highlight to
// outlive the request behind it. The mark itself persists until then; see the
// `dt-reader-flash` rules for why it does not fade out.
- const activeFlash = flash && jump && flash.nonce === jump.nonce ? flash : null;
+ const activeFlash =
+ flash && jump && flash.nonce === jump.nonce ? flash : null;
// -- selection -----------------------------------------------------------
@@ -419,7 +425,9 @@ export function PdfDocumentView({
annotations={annotations}
highlightedAnnotationId={highlightedAnnotationId}
flashRects={
- activeFlash?.locator === locator ? activeFlash.rects : undefined
+ activeFlash?.locator === locator
+ ? activeFlash.rects
+ : undefined
}
onAnnotationClick={onAnnotationClick}
/>
diff --git a/web/components/reading/PdfPage.tsx b/web/components/reading/PdfPage.tsx
index 715392ca3..ea0913806 100644
--- a/web/components/reading/PdfPage.tsx
+++ b/web/components/reading/PdfPage.tsx
@@ -2,11 +2,7 @@
import { useEffect, useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
-import {
- loadPdfjs,
- outputScale,
- type PdfDocument,
-} from "@/lib/pdfjs-loader";
+import { loadPdfjs, outputScale, type PdfDocument } from "@/lib/pdfjs-loader";
import type { AnnotationItem } from "@/lib/reading-api";
import { AnnotationLayer } from "./AnnotationLayer";
@@ -125,7 +121,10 @@ export function PdfPage({
// allSettled: a canvas failure must not cost the page its text layer,
// and vice versa. Failures are reported below only if BOTH sides failed,
// since either one alone still leaves a usable page.
- const outcomes = await Promise.allSettled([paintCanvas(), buildTextLayer()]);
+ const outcomes = await Promise.allSettled([
+ paintCanvas(),
+ buildTextLayer(),
+ ]);
if (cancelled) return;
const fatal = outcomes.every(
(outcome) =>
diff --git a/web/components/reading/ReaderPane.tsx b/web/components/reading/ReaderPane.tsx
index 8ef544b89..ac8b8e58f 100644
--- a/web/components/reading/ReaderPane.tsx
+++ b/web/components/reading/ReaderPane.tsx
@@ -79,7 +79,9 @@ export function ReaderPane({ onClose }: ReaderPaneProps) {
reportViewport,
} = useReading();
- const [activeAnnotationId, setActiveAnnotationId] = useState<string | null>(null);
+ const [activeAnnotationId, setActiveAnnotationId] = useState<string | null>(
+ null,
+ );
const [selection, setSelection] = useState<SelectionPayload | null>(null);
const [jump, setJump] = useState<JumpRequest | null>(null);
// `null` = follow the document: show the panel once there is something in it.
@@ -116,7 +118,6 @@ export function ReaderPane({ onClose }: ReaderPaneProps) {
});
}, []);
-
// -- viewport reporting --------------------------------------------------
const handleVisibleLocator = useCallback(
@@ -144,7 +145,8 @@ export function ReaderPane({ onClose }: ReaderPaneProps) {
if (!detail || !material) return;
// Ignore actions aimed at a document that is no longer open — a stale
// event replayed from an earlier turn must not move the current view.
- if (detail.material_id && detail.material_id !== material.material_id) return;
+ if (detail.material_id && detail.material_id !== material.material_id)
+ return;
if (detail.reader_action === "annotate" && detail.annotation) {
const incoming = detail.annotation as unknown as AnnotationItem;
@@ -157,7 +159,8 @@ export function ReaderPane({ onClose }: ReaderPaneProps) {
if (locator >= 1) requestJump(locator, detail.quote || undefined);
};
window.addEventListener(READER_ACTION_EVENT, onReaderAction);
- return () => window.removeEventListener(READER_ACTION_EVENT, onReaderAction);
+ return () =>
+ window.removeEventListener(READER_ACTION_EVENT, onReaderAction);
}, [material, autoJump, requestJump, mergeMark]);
/**
@@ -209,7 +212,8 @@ export function ReaderPane({ onClose }: ReaderPaneProps) {
// Leave modified clicks to the browser — a user opening a citation in a
// new tab is asking for the link, not for the reader to move.
if (event.button !== 0) return;
- if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
+ if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)
+ return;
const target = event.target as HTMLElement | null;
const anchor = target?.closest?.("a[href]") as HTMLAnchorElement | null;
const locator = locatorFromHref(anchor?.getAttribute("href"));
@@ -225,7 +229,11 @@ export function ReaderPane({ onClose }: ReaderPaneProps) {
// -- annotations ---------------------------------------------------------
const commitSelection = useCallback(
- (kind: "highlight" | "underline" | "note", color: AnnotationColor, note = "") => {
+ (
+ kind: "highlight" | "underline" | "note",
+ color: AnnotationColor,
+ note = "",
+ ) => {
if (!selection || !material) return;
const temporaryId = `pending-${Date.now()}-${Math.round(Math.random() * 1e6)}`;
const now = Date.now() / 1000;
@@ -302,7 +310,8 @@ export function ReaderPane({ onClose }: ReaderPaneProps) {
const showAnnotations = annotationPanel ?? annotations.length > 0;
const unitWord = material ? t(unitLabel(material.unit)) : "";
const outlineRows = useMemo(
- () => (material?.outline ?? []).filter((row) => row.title.trim().length > 0),
+ () =>
+ (material?.outline ?? []).filter((row) => row.title.trim().length > 0),
[material],
);
@@ -310,7 +319,10 @@ export function ReaderPane({ onClose }: ReaderPaneProps) {
<div className="relative flex h-full min-w-0 flex-col border-r border-[var(--border)] bg-[var(--background)]">
<ReaderResizeHandle />
<header className="flex h-11 shrink-0 items-center gap-1 border-b border-[var(--border)] px-2.5">
- <FileText size={14} className="shrink-0 text-[var(--muted-foreground)]" />
+ <FileText
+ size={14}
+ className="shrink-0 text-[var(--muted-foreground)]"
+ />
<span
className="min-w-0 flex-1 truncate text-[12.5px] font-medium text-[var(--foreground)]"
title={material?.filename}
@@ -335,7 +347,9 @@ export function ReaderPane({ onClose }: ReaderPaneProps) {
icon={Crosshair}
label={
autoJump
- ? t("Auto-jump on — the view follows what the assistant reads")
+ ? t(
+ "Auto-jump on — the view follows what the assistant reads",
+ )
: t("Auto-jump off — the assistant will not move your view")
}
active={autoJump}
@@ -357,7 +371,11 @@ export function ReaderPane({ onClose }: ReaderPaneProps) {
// trigger too keeps it from being a button that does nothing.
className="hidden lg:inline-flex"
/>
- <HeaderButton icon={X} label={t("Close document")} onClick={closeMaterial} />
+ <HeaderButton
+ icon={X}
+ label={t("Close document")}
+ onClick={closeMaterial}
+ />
</>
)}
{!material && (
@@ -419,7 +437,9 @@ export function ReaderPane({ onClose }: ReaderPaneProps) {
{t("Opening document…")}
</div>
) : !material ? (
- <MaterialPicker onOpen={(candidate) => void openMaterial(candidate)} />
+ <MaterialPicker
+ onOpen={(candidate) => void openMaterial(candidate)}
+ />
) : material.has_raw_view ? (
<PdfDocumentView
materialId={material.material_id}
diff --git a/web/components/reading/ReaderResizeHandle.tsx b/web/components/reading/ReaderResizeHandle.tsx
index 77ea74c86..84f19f567 100644
--- a/web/components/reading/ReaderResizeHandle.tsx
+++ b/web/components/reading/ReaderResizeHandle.tsx
@@ -83,7 +83,9 @@ export function ReaderResizeHandle() {
// Storage unavailable — keep the CSS default.
}
if (stored === null) return;
- applyWidthImmediately(clampReaderWidth(stored, containerWidth(ref.current)));
+ applyWidthImmediately(
+ clampReaderWidth(stored, containerWidth(ref.current)),
+ );
}, []);
const persist = useCallback((px: number) => {
@@ -145,7 +147,10 @@ export function ReaderResizeHandle() {
const nudge = useCallback(
(delta: number) => {
const element = ref.current;
- const next = clampReaderWidth(currentWidth(element) + delta, containerWidth(element));
+ const next = clampReaderWidth(
+ currentWidth(element) + delta,
+ containerWidth(element),
+ );
applyWidthImmediately(next);
persist(next);
},
diff --git a/web/components/reading/TextUnitView.tsx b/web/components/reading/TextUnitView.tsx
index c3a119725..71853c7fa 100644
--- a/web/components/reading/TextUnitView.tsx
+++ b/web/components/reading/TextUnitView.tsx
@@ -71,7 +71,9 @@ export function TextUnitView({
} catch (loadError) {
if (!cancelled) {
setError(
- loadError instanceof Error ? loadError.message : t("Could not load this section."),
+ loadError instanceof Error
+ ? loadError.message
+ : t("Could not load this section."),
);
}
} finally {
@@ -102,7 +104,11 @@ export function TextUnitView({
}, [jump, unitCount]);
const runs = useMemo(
- () => segmentTextByQuotes(text, annotations.filter((a) => a.locator === locator)),
+ () =>
+ segmentTextByQuotes(
+ text,
+ annotations.filter((a) => a.locator === locator),
+ ),
[text, annotations, locator],
);
@@ -160,7 +166,9 @@ export function TextUnitView({
<button
type="button"
disabled={!canNext}
- onClick={() => setLocator((current) => Math.min(unitCount, current + 1))}
+ onClick={() =>
+ setLocator((current) => Math.min(unitCount, current + 1))
+ }
className="inline-flex h-7 w-7 items-center justify-center rounded-lg text-[var(--muted-foreground)] transition hover:bg-[var(--muted)] hover:text-[var(--foreground)] disabled:opacity-35 disabled:hover:bg-transparent"
aria-label={t("Next")}
>
@@ -193,7 +201,9 @@ export function TextUnitView({
<mark
key={index}
title={run.mark.note || undefined}
- onClick={() => onAnnotationClick?.(run.mark as AnnotationItem)}
+ onClick={() =>
+ onAnnotationClick?.(run.mark as AnnotationItem)
+ }
className={`cursor-pointer rounded-[2px] px-[1px] text-[var(--foreground)] ${
run.mark.annotation_id === highlightedAnnotationId
? "ring-2 ring-[var(--ring)]"
diff --git a/web/components/sidebar/SidebarShell.tsx b/web/components/sidebar/SidebarShell.tsx
index 294a77a1c..5ef3c627d 100644
--- a/web/components/sidebar/SidebarShell.tsx
+++ b/web/components/sidebar/SidebarShell.tsx
@@ -11,7 +11,6 @@ import {
Bot,
Brain,
ChevronDown,
- Ear,
Github,
HeartHandshake,
House,
@@ -75,13 +74,6 @@ const PRIMARY_NAV: NavEntry[] = [
tooltipKey: "Co-Writer tooltip",
requires: "llm",
},
- {
- href: "/whisper",
- label: "Whisper",
- icon: Ear,
- tooltipKey: "Whisper tooltip",
- requires: "llm",
- },
{
href: "/book",
label: "Book",
diff --git a/web/components/space/SpaceDashboard.tsx b/web/components/space/SpaceDashboard.tsx
index 9854cbb54..305a15c9b 100644
--- a/web/components/space/SpaceDashboard.tsx
+++ b/web/components/space/SpaceDashboard.tsx
@@ -6,6 +6,8 @@ import { useTranslation } from "react-i18next";
import {
ArrowUpRight,
ClipboardList,
+ Ear,
+ Github,
GraduationCap,
History,
NotebookPen,
@@ -43,7 +45,8 @@ type DashKey =
| "skills"
| "mcp"
| "cli_apps"
- | "mastery_path";
+ | "mastery_path"
+ | "whisper";
interface DashboardItem {
key: DashKey;
@@ -51,11 +54,21 @@ interface DashboardItem {
icon: LucideIcon;
title: Lang;
blurb: Lang;
- /** Unit shown after the live count, e.g. "168 conversations". */
- unit: Lang;
+ /**
+ * Unit shown after the live count, e.g. "168 conversations". Omitted
+ * together with ``load`` for a tile that has nothing to count.
+ */
+ unit?: Lang;
/** Icon-tile accent — full class strings so Tailwind keeps them. */
tile: string;
- load: () => Promise<number>;
+ /**
+ * Live count for the tile. Optional: a surface with no countable rows (an
+ * ephemeral room, say) renders as title + blurb instead of showing a
+ * permanently-loading number.
+ */
+ load?: () => Promise<number>;
+ /** GitHub handle of the contributor this surface came from. */
+ credit?: string;
}
interface DashboardGroup {
@@ -187,6 +200,23 @@ const GROUPS: DashboardGroup[] = [
},
],
},
+ {
+ label: { zh: "更多项目", en: "More Projects" },
+ items: [
+ {
+ key: "whisper",
+ href: "/whisper",
+ icon: Ear,
+ title: { zh: "密语", en: "Whisper" },
+ blurb: {
+ zh: "双席位咨询练习房间:督导只对受训者耳语。",
+ en: "Dual-seat practice room — the supervisor whispers to the trainee only.",
+ },
+ tile: "bg-fuchsia-500/10 text-fuchsia-600 dark:text-fuchsia-400",
+ credit: "alanguan73",
+ },
+ ],
+ },
];
const ALL_ITEMS = GROUPS.flatMap((g) => g.items);
@@ -203,6 +233,7 @@ export default function SpaceDashboard() {
// Each tile loads independently so one slow/failed endpoint never blanks
// the whole dashboard.
for (const item of ALL_ITEMS) {
+ if (!item.load) continue;
item
.load()
.then((n) => {
@@ -286,20 +317,22 @@ function DashboardCard({
<h3 className="truncate text-[14.5px] font-medium leading-tight tracking-tight text-[var(--foreground)]">
{tr(item.title)}
</h3>
- <div className="mt-1 flex items-baseline gap-1.5">
- {loaded ? (
- <>
- <span className="text-[20px] font-semibold leading-none tabular-nums text-[var(--foreground)]">
- {formatted}
- </span>
- <span className="text-[12px] text-[var(--muted-foreground)]">
- {tr(item.unit)}
- </span>
- </>
- ) : (
- <span className="my-[3px] h-3.5 w-12 animate-pulse rounded bg-[var(--muted)]" />
- )}
- </div>
+ {item.unit ? (
+ <div className="mt-1 flex items-baseline gap-1.5">
+ {loaded ? (
+ <>
+ <span className="text-[20px] font-semibold leading-none tabular-nums text-[var(--foreground)]">
+ {formatted}
+ </span>
+ <span className="text-[12px] text-[var(--muted-foreground)]">
+ {tr(item.unit)}
+ </span>
+ </>
+ ) : (
+ <span className="my-[3px] h-3.5 w-12 animate-pulse rounded bg-[var(--muted)]" />
+ )}
+ </div>
+ ) : null}
</div>
<ArrowUpRight
size={16}
@@ -309,6 +342,12 @@ function DashboardCard({
<p className="mt-3 text-[12.5px] leading-relaxed text-[var(--muted-foreground)]">
{tr(item.blurb)}
</p>
+ {item.credit ? (
+ <span className="mt-2.5 inline-flex items-center gap-1 self-start text-[11px] leading-none text-[var(--muted-foreground)] opacity-60">
+ <Github size={11} strokeWidth={1.8} aria-hidden />
+ {item.credit}
+ </span>
+ ) : null}
</Link>
);
}
diff --git a/web/components/space/question-bank/BankToolbar.tsx b/web/components/space/question-bank/BankToolbar.tsx
index 0c8fbb8e2..aeb3ed116 100644
--- a/web/components/space/question-bank/BankToolbar.tsx
+++ b/web/components/space/question-bank/BankToolbar.tsx
@@ -1,7 +1,13 @@
"use client";
import { useTranslation } from "react-i18next";
-import { ArrowDownWideNarrow, Loader2, Search, Settings2, X } from "lucide-react";
+import {
+ ArrowDownWideNarrow,
+ Loader2,
+ Search,
+ Settings2,
+ X,
+} from "lucide-react";
import type { BankSort } from "./useQuestionBank";
interface BankToolbarProps {
diff --git a/web/components/space/question-bank/CategoryMenu.tsx b/web/components/space/question-bank/CategoryMenu.tsx
index 83bee08fe..c7c144c69 100644
--- a/web/components/space/question-bank/CategoryMenu.tsx
+++ b/web/components/space/question-bank/CategoryMenu.tsx
@@ -75,18 +75,18 @@ export default function CategoryMenu({
// so no path can fail silently behind a closing menu.
const run = useCallback(
async (action: () => Promise<boolean | void> | boolean | void) => {
- setBusy(true);
- try {
- // An explicit false means the caller already reported the failure.
- return (await action()) !== false;
- } catch (err) {
- notify(err instanceof Error ? err.message : String(err), {
- tone: "error",
- });
- return false;
- } finally {
- setBusy(false);
- }
+ setBusy(true);
+ try {
+ // An explicit false means the caller already reported the failure.
+ return (await action()) !== false;
+ } catch (err) {
+ notify(err instanceof Error ? err.message : String(err), {
+ tone: "error",
+ });
+ return false;
+ } finally {
+ setBusy(false);
+ }
},
[],
);
diff --git a/web/components/space/question-bank/QuestionBankSection.tsx b/web/components/space/question-bank/QuestionBankSection.tsx
index 07e13e031..528277d5e 100644
--- a/web/components/space/question-bank/QuestionBankSection.tsx
+++ b/web/components/space/question-bank/QuestionBankSection.tsx
@@ -2,7 +2,13 @@
import { useState } from "react";
import { useTranslation } from "react-i18next";
-import { AlertTriangle, ClipboardList, Inbox, Loader2, Search } from "lucide-react";
+import {
+ AlertTriangle,
+ ClipboardList,
+ Inbox,
+ Loader2,
+ Search,
+} from "lucide-react";
import SpaceSectionHeader from "@/components/space/SpaceSectionHeader";
import BankScopeRail from "./BankScopeRail";
import BankSelectionBar from "./BankSelectionBar";
@@ -25,7 +31,9 @@ function EmptyState({
<div className="mb-3 rounded-xl bg-[var(--muted)] p-2.5 text-[var(--muted-foreground)]">
<Icon size={18} />
</div>
- <p className="text-[14px] font-medium text-[var(--foreground)]">{title}</p>
+ <p className="text-[14px] font-medium text-[var(--foreground)]">
+ {title}
+ </p>
<p className="mt-1.5 max-w-xs text-[13px] text-[var(--muted-foreground)]">
{hint}
</p>
@@ -119,7 +127,9 @@ export default function QuestionBankSection() {
<EmptyState
icon={Search}
title={t("No matching questions")}
- hint={t("Try a different word, or clear the search to see everything.")}
+ hint={t(
+ "Try a different word, or clear the search to see everything.",
+ )}
/>
) : bank.scope.kind === "uncategorized" ? (
<EmptyState
@@ -160,7 +170,9 @@ export default function QuestionBankSection() {
if (window.confirm(t("Delete this entry?")))
void bank.removeEntry(entry);
}}
- onFile={(categoryId) => bank.fileEntries([entry.id], categoryId)}
+ onFile={(categoryId) =>
+ bank.fileEntries([entry.id], categoryId)
+ }
onUnfile={(categoryId) =>
bank.unfileEntries([entry.id], categoryId)
}
@@ -173,10 +185,13 @@ export default function QuestionBankSection() {
{bank.total > bank.items.length && (
<p className="pt-1 text-center text-[11.5px] text-[var(--muted-foreground)]">
- {t("Showing {{shown}} of {{total}} — narrow the view to see the rest.", {
- shown: bank.items.length,
- total: bank.total,
- })}
+ {t(
+ "Showing {{shown}} of {{total}} — narrow the view to see the rest.",
+ {
+ shown: bank.items.length,
+ total: bank.total,
+ },
+ )}
</p>
)}
diff --git a/web/components/space/question-bank/QuestionCard.tsx b/web/components/space/question-bank/QuestionCard.tsx
index f3320bd79..bd4085e27 100644
--- a/web/components/space/question-bank/QuestionCard.tsx
+++ b/web/components/space/question-bank/QuestionCard.tsx
@@ -3,13 +3,7 @@
import dynamic from "next/dynamic";
import Link from "next/link";
import { useTranslation } from "react-i18next";
-import {
- Bookmark,
- ExternalLink,
- MessageSquare,
- Trash2,
- X,
-} from "lucide-react";
+import { Bookmark, ExternalLink, MessageSquare, Trash2, X } from "lucide-react";
import type { NotebookCategory, NotebookEntry } from "@/lib/notebook-api";
import CategoryMenu from "./CategoryMenu";
diff --git a/web/components/space/question-bank/useQuestionBank.ts b/web/components/space/question-bank/useQuestionBank.ts
index 816bbfc57..170d520ad 100644
--- a/web/components/space/question-bank/useQuestionBank.ts
+++ b/web/components/space/question-bank/useQuestionBank.ts
@@ -298,8 +298,7 @@ export function useQuestionBank(): QuestionBankController {
async (ids: number[], categoryId: number) => {
if (!ids.length) return false;
return withPending(ids, async () => {
- if (ids.length === 1)
- await removeEntryFromCategory(ids[0], categoryId);
+ if (ids.length === 1) await removeEntryFromCategory(ids[0], categoryId);
else await bulkLinkEntriesToCategory(ids, categoryId, false);
await refresh();
});
@@ -348,8 +347,8 @@ export function useQuestionBank(): QuestionBankController {
async (id: number) => {
return attempt(async () => {
await deleteCategory(id);
- // Deleting the category being viewed would otherwise leave the list
- // filtered by an id the server no longer knows.
+ // Deleting the category being viewed would otherwise leave the list
+ // filtered by an id the server no longer knows.
setScopeState((prev) =>
prev.kind === "category" && prev.categoryId === id
? DEFAULT_SCOPE
diff --git a/web/components/whisper/WhisperMessageList.tsx b/web/components/whisper/WhisperMessageList.tsx
index f2407650b..12a665298 100644
--- a/web/components/whisper/WhisperMessageList.tsx
+++ b/web/components/whisper/WhisperMessageList.tsx
@@ -113,7 +113,9 @@ export default function WhisperMessageList({
{metaStage && <span>{metaStage}</span>}
{metaSource && <span>· {metaSource}</span>}
{msg.localSeat && (
- <span>· {t("you")} ({msg.localSeat})</span>
+ <span>
+ · {t("you")} ({msg.localSeat})
+ </span>
)}
</div>
)}
diff --git a/web/context/ReadingContext.tsx b/web/context/ReadingContext.tsx
index 8d1947c6b..508bfb8b8 100644
--- a/web/context/ReadingContext.tsx
+++ b/web/context/ReadingContext.tsx
@@ -51,7 +51,10 @@ export interface ReadingContextValue {
openMaterial: (candidate: MaterialDetail | MaterialInfo) => Promise<void>;
closeMaterial: () => void;
/** Insert or update an annotation, optimistically. */
- saveMark: (draft: AnnotationDraft, optimistic: AnnotationItem) => Promise<void>;
+ saveMark: (
+ draft: AnnotationDraft,
+ optimistic: AnnotationItem,
+ ) => Promise<void>;
/** Remove an annotation, optimistically. */
removeMark: (annotation: AnnotationItem) => Promise<void>;
/** Accept a mark the assistant just made (arrives via a tool result). */
@@ -111,7 +114,9 @@ export function ReadingProvider({ children }: { children: ReactNode }) {
} catch (caught) {
if (token !== openTokenRef.current) return;
setErrorState(
- caught instanceof Error ? caught.message : "This document could not be opened.",
+ caught instanceof Error
+ ? caught.message
+ : "This document could not be opened.",
);
} finally {
if (token === openTokenRef.current) setLoading(false);
@@ -145,10 +150,14 @@ export function ReadingProvider({ children }: { children: ReactNode }) {
);
} catch (caught) {
setAnnotations((current) =>
- current.filter((row) => row.annotation_id !== optimistic.annotation_id),
+ current.filter(
+ (row) => row.annotation_id !== optimistic.annotation_id,
+ ),
);
setErrorState(
- caught instanceof Error ? caught.message : "That annotation could not be saved.",
+ caught instanceof Error
+ ? caught.message
+ : "That annotation could not be saved.",
);
}
},
@@ -162,7 +171,9 @@ export function ReadingProvider({ children }: { children: ReactNode }) {
let previous: AnnotationItem[] = [];
setAnnotations((current) => {
previous = current;
- return current.filter((row) => row.annotation_id !== annotation.annotation_id);
+ return current.filter(
+ (row) => row.annotation_id !== annotation.annotation_id,
+ );
});
try {
await deleteAnnotationApi(materialId, annotation.annotation_id);
@@ -179,13 +190,16 @@ export function ReadingProvider({ children }: { children: ReactNode }) {
const mergeMark = useCallback((annotation: AnnotationItem) => {
if (!annotation?.annotation_id) return;
setAnnotations((current) => [
- ...current.filter((row) => row.annotation_id !== annotation.annotation_id),
+ ...current.filter(
+ (row) => row.annotation_id !== annotation.annotation_id,
+ ),
annotation,
]);
}, []);
const reportViewport = useCallback(
- (next: { locator?: number; selection?: string }) => setReadingViewport(next),
+ (next: { locator?: number; selection?: string }) =>
+ setReadingViewport(next),
[],
);
@@ -223,7 +237,9 @@ export function ReadingProvider({ children }: { children: ReactNode }) {
],
);
- return <ReadingContext.Provider value={value}>{children}</ReadingContext.Provider>;
+ return (
+ <ReadingContext.Provider value={value}>{children}</ReadingContext.Provider>
+ );
}
export function useReading(): ReadingContextValue {
diff --git a/web/hooks/useSetupSync.ts b/web/hooks/useSetupSync.ts
index dbfa6ca1b..143d5b6f9 100644
--- a/web/hooks/useSetupSync.ts
+++ b/web/hooks/useSetupSync.ts
@@ -16,7 +16,8 @@ import type { StreamEvent } from "@/lib/unified-ws";
const THEMES: readonly Theme[] = ["light", "dark", "glass", "snow"];
function asTheme(value: unknown): Theme | null {
- return typeof value === "string" && (THEMES as readonly string[]).includes(value)
+ return typeof value === "string" &&
+ (THEMES as readonly string[]).includes(value)
? (value as Theme)
: null;
}
diff --git a/web/lib/book-api.ts b/web/lib/book-api.ts
index d61d193f2..c8356509a 100644
--- a/web/lib/book-api.ts
+++ b/web/lib/book-api.ts
@@ -325,10 +325,7 @@ export const bookApi = {
{ method: "POST" },
),
- listLearningCaptures: (
- book_id: string,
- status?: LearningCaptureStatus,
- ) =>
+ listLearningCaptures: (book_id: string, status?: LearningCaptureStatus) =>
request<{ captures: LearningCapture[] }>(
`/books/${encodeURIComponent(
book_id,
@@ -350,10 +347,13 @@ export const bookApi = {
status?: LearningCaptureStatus;
},
) =>
- request<{ capture: LearningCapture }>(`/books/${encodeURIComponent(book_id)}/learning-captures`, {
- method: "POST",
- body: JSON.stringify(payload),
- }),
+ request<{ capture: LearningCapture }>(
+ `/books/${encodeURIComponent(book_id)}/learning-captures`,
+ {
+ method: "POST",
+ body: JSON.stringify(payload),
+ },
+ ),
updateLearningCapture: (
book_id: string,
diff --git a/web/lib/notebook-api.ts b/web/lib/notebook-api.ts
index 040f51817..739105396 100644
--- a/web/lib/notebook-api.ts
+++ b/web/lib/notebook-api.ts
@@ -447,10 +447,9 @@ export interface QuestionBankStats {
}
export async function getQuestionBankStats(): Promise<QuestionBankStats> {
- const response = await apiFetch(
- apiUrl("/api/v1/question-notebook/stats"),
- { cache: "no-store" },
- );
+ const response = await apiFetch(apiUrl("/api/v1/question-notebook/stats"), {
+ cache: "no-store",
+ });
return expectJson<QuestionBankStats>(response);
}
diff --git a/web/lib/pdfjs-loader.ts b/web/lib/pdfjs-loader.ts
index 61dc5808e..ebc2bef51 100644
--- a/web/lib/pdfjs-loader.ts
+++ b/web/lib/pdfjs-loader.ts
@@ -15,9 +15,7 @@
import type * as PdfjsModule from "pdfjs-dist";
export type Pdfjs = typeof PdfjsModule;
-export type PdfDocument = Awaited<
- ReturnType<Pdfjs["getDocument"]>["promise"]
->;
+export type PdfDocument = Awaited<ReturnType<Pdfjs["getDocument"]>["promise"]>;
export type PdfPageProxy = Awaited<ReturnType<PdfDocument["getPage"]>>;
let pending: Promise<Pdfjs> | null = null;
diff --git a/web/lib/reading-api.ts b/web/lib/reading-api.ts
index f999de331..faa18ccee 100644
--- a/web/lib/reading-api.ts
+++ b/web/lib/reading-api.ts
@@ -122,9 +122,7 @@ export async function uploadMaterial(file: File): Promise<MaterialDetail> {
);
}
-export async function getMaterial(
- materialId: string,
-): Promise<MaterialDetail> {
+export async function getMaterial(materialId: string): Promise<MaterialDetail> {
return unwrap(
await apiFetch(apiUrl(`${BASE}/materials/${materialId}`), {
cache: "no-store",
@@ -145,10 +143,9 @@ export async function getUnitText(
locator: number,
): Promise<{ locator: number; unit: UnitKind; text: string }> {
return unwrap(
- await apiFetch(
- apiUrl(`${BASE}/materials/${materialId}/units/${locator}`),
- { cache: "no-store" },
- ),
+ await apiFetch(apiUrl(`${BASE}/materials/${materialId}/units/${locator}`), {
+ cache: "no-store",
+ }),
);
}
@@ -211,7 +208,9 @@ export async function fetchExport(
}
return {
blob: await response.blob(),
- filename: filenameFromDisposition(response.headers.get("content-disposition")),
+ filename: filenameFromDisposition(
+ response.headers.get("content-disposition"),
+ ),
};
}
diff --git a/web/lib/reading-citations.ts b/web/lib/reading-citations.ts
index 6d1458d92..9fb91fc7b 100644
--- a/web/lib/reading-citations.ts
+++ b/web/lib/reading-citations.ts
@@ -50,7 +50,8 @@ const CITATION = /\[p\.\s*(\d[\d\s,–—-]*)\]/gi;
*/
export function codeRanges(text: string): Array<[number, number]> {
const ranges: Array<[number, number]> = [];
- const fence = /(^|\n)[ \t]*(`{3,}|~{3,})[^\n]*\n?[\s\S]*?(?:\n[ \t]*\2[ \t]*(?=\n|$)|$)/g;
+ const fence =
+ /(^|\n)[ \t]*(`{3,}|~{3,})[^\n]*\n?[\s\S]*?(?:\n[ \t]*\2[ \t]*(?=\n|$)|$)/g;
let match: RegExpExecArray | null;
while ((match = fence.exec(text)) !== null) {
ranges.push([match.index, match.index + match[0].length]);
@@ -93,7 +94,6 @@ function parseLocatorList(body: string): number[] {
return [...found].sort((a, b) => a - b);
}
-
/**
* Words a model uses when it names a location in prose, per unit kind.
*
@@ -107,7 +107,7 @@ const SPELLED_OUT_LOCATION = new RegExp(
"|" +
// Chinese: "第 3 页", "第3章", "第 3 节", "第3张幻灯片"
"第\\s*(\\d+)\\s*(?:页|章|节|张幻灯片|张)" +
- ")",
+ ")",
"gi",
);
@@ -251,7 +251,9 @@ export function linkifyLocatorCitations(
}
/** Locator encoded in an anchor href, or null when it is a different link. */
-export function locatorFromHref(href: string | null | undefined): number | null {
+export function locatorFromHref(
+ href: string | null | undefined,
+): number | null {
if (!href || !href.startsWith(LOCATOR_HREF_PREFIX)) return null;
const parsed = Number(href.slice(LOCATOR_HREF_PREFIX.length));
return Number.isInteger(parsed) && parsed >= 1 ? parsed : null;
diff --git a/web/lib/reading-quote-locator.ts b/web/lib/reading-quote-locator.ts
index 783b1cb17..dfb17c195 100644
--- a/web/lib/reading-quote-locator.ts
+++ b/web/lib/reading-quote-locator.ts
@@ -33,10 +33,38 @@ export interface QuoteRange {
/** Punctuation that commonly differs between a PDF and a copied quote. */
const SOFT_CHARS = new Set([
- "‘", "’", "“", "”", "–", "—", "-", "_", "'", '"', "`",
- ",", ",", "、", ";", ";", ":", ":", ".", "。",
- "!", "!", "?", "?", "(", ")", "(", ")",
- "[", "]", "【", "】",
+ "‘",
+ "’",
+ "“",
+ "”",
+ "–",
+ "—",
+ "-",
+ "_",
+ "'",
+ '"',
+ "`",
+ ",",
+ ",",
+ "、",
+ ";",
+ ";",
+ ":",
+ ":",
+ ".",
+ "。",
+ "!",
+ "!",
+ "?",
+ "?",
+ "(",
+ ")",
+ "(",
+ ")",
+ "[",
+ "]",
+ "【",
+ "】",
]);
interface Projection {
@@ -130,7 +158,11 @@ export function findQuoteRange(
// before loosening further: a Latin quote needs the joining space, a CJK one
// needs its absence, and getting a strict match under either beats a loose
// match under the other.
- const passes: Array<{ soften: boolean; joinWithSpace: boolean; mode: QuoteRange["mode"] }> = [
+ const passes: Array<{
+ soften: boolean;
+ joinWithSpace: boolean;
+ mode: QuoteRange["mode"];
+ }> = [
{ soften: false, joinWithSpace: true, mode: "collapsed" },
{ soften: false, joinWithSpace: false, mode: "collapsed" },
{ soften: true, joinWithSpace: true, mode: "softened" },
diff --git a/web/lib/reading-reader-action.ts b/web/lib/reading-reader-action.ts
index 7ed796369..69a3a77f2 100644
--- a/web/lib/reading-reader-action.ts
+++ b/web/lib/reading-reader-action.ts
@@ -63,9 +63,10 @@ export function readerActionFrom(event: {
const outer = metadata as Record<string, unknown>;
const nested = outer.tool_metadata;
- const raw = (
- nested && typeof nested === "object" ? nested : outer
- ) as Record<string, unknown>;
+ const raw = (nested && typeof nested === "object" ? nested : outer) as Record<
+ string,
+ unknown
+ >;
const action = raw.reader_action;
if (action !== "goto" && action !== "annotate") return null;
@@ -99,7 +100,9 @@ export function forwardReaderAction(event: {
const payload = readerActionFrom(event);
if (payload) {
if (payload.reader_action === "goto") rememberMoved(turnId);
- window.dispatchEvent(new CustomEvent(READER_ACTION_EVENT, { detail: payload }));
+ window.dispatchEvent(
+ new CustomEvent(READER_ACTION_EVENT, { detail: payload }),
+ );
return;
}
diff --git a/web/lib/reading-selection.ts b/web/lib/reading-selection.ts
index ed93cccc3..3e31f27a0 100644
--- a/web/lib/reading-selection.ts
+++ b/web/lib/reading-selection.ts
@@ -90,7 +90,12 @@ export function normaliseRects(rects: Box[], container: Box): NormalisedRect[] {
const y1 = clamp01(
(rect.top + rect.height - container.top) / container.height,
);
- return [Math.min(x0, x1), Math.min(y0, y1), Math.max(x0, x1), Math.max(y0, y1)];
+ return [
+ Math.min(x0, x1),
+ Math.min(y0, y1),
+ Math.max(x0, x1),
+ Math.max(y0, y1),
+ ];
})
.filter(([x0, y0, x1, y1]) => x1 - x0 > 0.001 && y1 - y0 > 0.001);
}
diff --git a/web/lib/reading-split.ts b/web/lib/reading-split.ts
index 39bb39ba6..855ccfde8 100644
--- a/web/lib/reading-split.ts
+++ b/web/lib/reading-split.ts
@@ -39,7 +39,9 @@ export function clampReaderWidth(px: number, available: number): number {
available > 0
? Math.min(READER_MAX_PX, available - CHAT_MIN_PX)
: READER_MAX_PX;
- return Math.round(Math.max(READER_MIN_PX, Math.min(px, Math.max(READER_MIN_PX, ceiling))));
+ return Math.round(
+ Math.max(READER_MIN_PX, Math.min(px, Math.max(READER_MIN_PX, ceiling))),
+ );
}
/** Parse a persisted width, or null when there is nothing usable stored. */
diff --git a/web/lib/whisper-transcript.ts b/web/lib/whisper-transcript.ts
index 683c0621c..304153bab 100644
--- a/web/lib/whisper-transcript.ts
+++ b/web/lib/whisper-transcript.ts
@@ -21,7 +21,8 @@ export function filterMessagesForSeat(
if (seat === "trainee") return messages;
return messages.filter((msg) => {
if (msg.stage === "whisper") return false;
- if (msg.source === "whisper_trainee" && msg.stage === "debrief") return false;
+ if (msg.source === "whisper_trainee" && msg.stage === "debrief")
+ return false;
return true;
});
}
diff --git a/web/locales/en/app.json b/web/locales/en/app.json
index 778c9532a..33d0d9e30 100644
--- a/web/locales/en/app.json
+++ b/web/locales/en/app.json
@@ -1736,7 +1736,6 @@
"Home tooltip": "Multi-tool AI chat and search.",
"Co-Writer tooltip": "AI-powered document editor.",
"Whisper": "Whisper",
- "Whisper tooltip": "Dual-seat whisper room for visitor and trainee.",
"Book tooltip": "Create AI-powered books.",
"Knowledge tooltip": "Manage learning personas.",
"Space tooltip": "Your personal learning library.",
diff --git a/web/locales/zh/app.json b/web/locales/zh/app.json
index a00a81de4..6e3d56510 100644
--- a/web/locales/zh/app.json
+++ b/web/locales/zh/app.json
@@ -1855,7 +1855,6 @@
"Home tooltip": "多工具 AI 对话与搜索。",
"Co-Writer tooltip": "AI 驱动的协作文档编辑器。",
"Whisper": "密语",
- "Whisper tooltip": "访客与学员双席位密语房间。",
"Book tooltip": "生成交互式 AI 书籍。",
"Knowledge tooltip": "管理文档与教学人设。",
"Space tooltip": "你的个人学习空间。",
diff --git a/web/tests/book-page-chat.test.ts b/web/tests/book-page-chat.test.ts
index be5494330..e997938e8 100644
--- a/web/tests/book-page-chat.test.ts
+++ b/web/tests/book-page-chat.test.ts
@@ -17,7 +17,10 @@ test("resolving the first Page Chat session preserves its active socket", () =>
"initialSessionId === sessionIdRef.current",
effectStart,
);
- const disconnect = source.indexOf("clientRef.current?.disconnect();", effectStart);
+ const disconnect = source.indexOf(
+ "clientRef.current?.disconnect();",
+ effectStart,
+ );
assert.notEqual(effectStart, -1);
assert.notEqual(sameSessionGuard, -1);
diff --git a/web/tests/reading-citations.test.ts b/web/tests/reading-citations.test.ts
index 3927419da..b102828dd 100644
--- a/web/tests/reading-citations.test.ts
+++ b/web/tests/reading-citations.test.ts
@@ -35,7 +35,14 @@ test("bounds an absurd range instead of expanding it", () => {
});
test("ignores brackets that are not locator citations", () => {
- for (const input of ["[12]", "[page 12]", "[p.]", "[p.abc]", "[web-1]", "[0]"]) {
+ for (const input of [
+ "[12]",
+ "[page 12]",
+ "[p.]",
+ "[p.abc]",
+ "[web-1]",
+ "[0]",
+ ]) {
assert.deepEqual(findLocatorCitations(input), [], input);
}
});
@@ -51,16 +58,30 @@ test("does not touch citations inside inline code", () => {
});
test("does not touch citations inside fenced code blocks", () => {
- const text = ["Look at this:", "", "```python", "x = data[p.12]", "```", "", "Then [p.3]."].join(
- "\n",
- );
+ const text = [
+ "Look at this:",
+ "",
+ "```python",
+ "x = data[p.12]",
+ "```",
+ "",
+ "Then [p.3].",
+ ].join("\n");
const found = findLocatorCitations(text);
assert.equal(found.length, 1);
assert.deepEqual(found[0].locators, [3]);
});
test("handles tilde fences and multiple fences", () => {
- const text = ["~~~", "a[p.1]", "~~~", "prose [p.2]", "```", "b[p.3]", "```"].join("\n");
+ const text = [
+ "~~~",
+ "a[p.1]",
+ "~~~",
+ "prose [p.2]",
+ "```",
+ "b[p.3]",
+ "```",
+ ].join("\n");
const found = findLocatorCitations(text);
assert.deepEqual(
found.map((c) => c.locators),
@@ -200,7 +221,9 @@ test("does not absorb a phrase naming a different locator", () => {
test("does not reach across a sentence boundary", () => {
assert.equal(
- linkifyLocatorCitations("It is on page 3. A different claim follows [p.3]."),
+ linkifyLocatorCitations(
+ "It is on page 3. A different claim follows [p.3].",
+ ),
`It is on page 3. A different claim follows [p.3](${LOCATOR_HREF_PREFIX}3).`,
);
});
@@ -230,12 +253,16 @@ test("absorption survives several citations in one answer", () => {
test("a marker with no nearby phrase still renders as a marker", () => {
assert.equal(
- linkifyLocatorCitations("Order is injected explicitly rather than learned [p.3]."),
+ linkifyLocatorCitations(
+ "Order is injected explicitly rather than learned [p.3].",
+ ),
`Order is injected explicitly rather than learned [p.3](${LOCATOR_HREF_PREFIX}3).`,
);
});
test("absorption is still idempotent", () => {
- const once = linkifyLocatorCitations("It is on page 3 of the document [p.3].");
+ const once = linkifyLocatorCitations(
+ "It is on page 3 of the document [p.3].",
+ );
assert.equal(linkifyLocatorCitations(once), once);
});
diff --git a/web/tests/reading-quote-locator.test.ts b/web/tests/reading-quote-locator.test.ts
index 538174ab5..efcf4bc21 100644
--- a/web/tests/reading-quote-locator.test.ts
+++ b/web/tests/reading-quote-locator.test.ts
@@ -72,12 +72,17 @@ test("softens punctuation the PDF renders differently", () => {
});
test("softens a dash mismatch", () => {
- const found = findQuoteRange(["a state—of—the—art result"], "state-of-the-art");
+ const found = findQuoteRange(
+ ["a state—of—the—art result"],
+ "state-of-the-art",
+ );
assert.ok(found);
});
test("falls back to the longest matching prefix of a drifting quote", () => {
- const spans = ["Positional encoding injects order information into the model."];
+ const spans = [
+ "Positional encoding injects order information into the model.",
+ ];
const found = findQuoteRange(
spans,
"Positional encoding injects order information and then some words that are not in the document at all",
@@ -102,7 +107,10 @@ test("a prefix too short to be credible is not highlighted", () => {
});
test("returns null rather than guessing when the quote is absent", () => {
- assert.equal(findQuoteRange(SPANS, "quantum flux capacitor calibration"), null);
+ assert.equal(
+ findQuoteRange(SPANS, "quantum flux capacitor calibration"),
+ null,
+ );
});
test("returns null for empty inputs", () => {
@@ -132,7 +140,10 @@ test("finds a match at the very end of the last segment", () => {
});
test("handles CJK text without whitespace cues", () => {
- const found = findQuoteRange(["本文讨论", "注意力机制的实现细节"], "注意力机制");
+ const found = findQuoteRange(
+ ["本文讨论", "注意力机制的实现细节"],
+ "注意力机制",
+ );
assert.ok(found);
assert.equal(found.start.segment, 1);
});
diff --git a/web/tests/reading-reader-action.test.ts b/web/tests/reading-reader-action.test.ts
index 8f7212686..a72e8d81d 100644
--- a/web/tests/reading-reader-action.test.ts
+++ b/web/tests/reading-reader-action.test.ts
@@ -43,7 +43,10 @@ test("reads an annotate, carrying the stored row", () => {
);
assert.ok(action);
assert.equal(action.reader_action, "annotate");
- assert.equal((action.annotation as { annotation_id: string }).annotation_id, "abc123");
+ assert.equal(
+ (action.annotation as { annotation_id: string }).annotation_id,
+ "abc123",
+ );
});
test("still accepts a flat payload, for events emitted directly", () => {
@@ -69,7 +72,10 @@ test("ignores tool results that carry no reader action", () => {
test("ignores every other event type", () => {
for (const type of ["content", "tool_call", "done", "sources", "error"]) {
assert.equal(
- readerActionFrom({ type, metadata: { tool_metadata: { reader_action: "goto", locator: 1 } } }),
+ readerActionFrom({
+ type,
+ metadata: { tool_metadata: { reader_action: "goto", locator: 1 } },
+ }),
null,
type,
);
@@ -77,10 +83,18 @@ test("ignores every other event type", () => {
});
test("drops nonsense locators rather than jumping somewhere arbitrary", () => {
- assert.equal(readerActionFrom(realEvent({ reader_action: "goto", locator: 0 }))?.locator, undefined);
- assert.equal(readerActionFrom(realEvent({ reader_action: "goto", locator: -2 }))?.locator, undefined);
assert.equal(
- readerActionFrom(realEvent({ reader_action: "goto", locator: "abc" }))?.locator,
+ readerActionFrom(realEvent({ reader_action: "goto", locator: 0 }))?.locator,
+ undefined,
+ );
+ assert.equal(
+ readerActionFrom(realEvent({ reader_action: "goto", locator: -2 }))
+ ?.locator,
+ undefined,
+ );
+ assert.equal(
+ readerActionFrom(realEvent({ reader_action: "goto", locator: "abc" }))
+ ?.locator,
undefined,
);
});
@@ -88,9 +102,15 @@ test("drops nonsense locators rather than jumping somewhere arbitrary", () => {
test("tolerates malformed metadata", () => {
assert.equal(readerActionFrom({ type: "tool_result" }), null);
assert.equal(readerActionFrom({ type: "tool_result", metadata: null }), null);
- assert.equal(readerActionFrom({ type: "tool_result", metadata: "nope" }), null);
assert.equal(
- readerActionFrom({ type: "tool_result", metadata: { tool_metadata: "nope" } }),
+ readerActionFrom({ type: "tool_result", metadata: "nope" }),
+ null,
+ );
+ assert.equal(
+ readerActionFrom({
+ type: "tool_result",
+ metadata: { tool_metadata: "nope" },
+ }),
null,
);
});
@@ -107,7 +127,9 @@ import {
} from "../lib/reading-reader-action";
/** Minimal window stub: these functions only dispatch DOM events. */
-function withWindow<T>(run: (seen: Array<{ type: string; detail: unknown }>) => T): T {
+function withWindow<T>(
+ run: (seen: Array<{ type: string; detail: unknown }>) => T,
+): T {
const seen: Array<{ type: string; detail: unknown }> = [];
const previous = (globalThis as { window?: unknown }).window;
(globalThis as { window?: unknown }).window = {
@@ -196,7 +218,13 @@ test("annotate alone does not count as having moved the reader", () => {
forwardReaderAction({
type: "tool_result",
turn_id: "turn-4",
- metadata: { tool_metadata: { reader_action: "annotate", locator: 2, annotation: { annotation_id: "a" } } },
+ metadata: {
+ tool_metadata: {
+ reader_action: "annotate",
+ locator: 2,
+ annotation: { annotation_id: "a" },
+ },
+ },
});
forwardReaderAction({ type: "done", turn_id: "turn-4" });
assert.deepEqual(
diff --git a/web/tests/reading-turn-state.test.ts b/web/tests/reading-turn-state.test.ts
index 750100c9c..b3f824b80 100644
--- a/web/tests/reading-turn-state.test.ts
+++ b/web/tests/reading-turn-state.test.ts
@@ -30,7 +30,13 @@ test("carries nothing once the user switches to another mode", () => {
setReadingMaterial("d138eacaad029843");
setReadingViewport({ locator: 3 });
- for (const capability of ["", "deep_solve", "deep_research", "mastery_path", "visualize"]) {
+ for (const capability of [
+ "",
+ "deep_solve",
+ "deep_research",
+ "mastery_path",
+ "visualize",
+ ]) {
assert.deepEqual(readingTurnFields(capability), {}, capability);
}
});
@@ -49,7 +55,10 @@ test("the document itself is kept, so returning to the mode resumes it", () => {
assert.deepEqual(readingTurnFields("deep_solve"), {});
// …and back, with the reader still where it was.
assert.equal(getReadingTurnState().materialId, "d138eacaad029843");
- assert.equal(readingTurnFields(READING_CAPABILITY).reading_viewport?.locator, 7);
+ assert.equal(
+ readingTurnFields(READING_CAPABILITY).reading_viewport?.locator,
+ 7,
+ );
});
test("carries nothing in reading mode with no document open", () => {
@@ -62,7 +71,11 @@ test("closing the document clears its viewport too", () => {
setReadingMaterial(null);
assert.deepEqual(readingTurnFields(READING_CAPABILITY), {});
- assert.deepEqual(getReadingTurnState(), { materialId: null, locator: 0, selection: "" });
+ assert.deepEqual(getReadingTurnState(), {
+ materialId: null,
+ locator: 0,
+ selection: "",
+ });
});
test("a viewport with no locator or selection is omitted, not sent empty", () => {
@@ -75,7 +88,13 @@ test("a viewport with no locator or selection is omitted, not sent empty", () =>
test("nonsense viewport values are ignored", () => {
setReadingMaterial("d138eacaad029843");
setReadingViewport({ locator: -3 });
- assert.equal(readingTurnFields(READING_CAPABILITY).reading_viewport, undefined);
+ assert.equal(
+ readingTurnFields(READING_CAPABILITY).reading_viewport,
+ undefined,
+ );
setReadingViewport({ locator: 2.7 });
- assert.equal(readingTurnFields(READING_CAPABILITY).reading_viewport?.locator, 2);
+ assert.equal(
+ readingTurnFields(READING_CAPABILITY).reading_viewport?.locator,
+ 2,
+ );
});
diff --git a/web/tests/session-load-failure.test.ts b/web/tests/session-load-failure.test.ts
index 6edf589db..3ce34de79 100644
--- a/web/tests/session-load-failure.test.ts
+++ b/web/tests/session-load-failure.test.ts
@@ -12,7 +12,11 @@ import {
test("a plain failure on a cold open surfaces", () => {
assert.equal(
- shouldSurfaceLoadFailure({ aborted: false, timedOut: false, cached: false }),
+ shouldSurfaceLoadFailure({
+ aborted: false,
+ timedOut: false,
+ cached: false,
+ }),
true,
);
});
diff --git a/web/tests/setup-signals.test.ts b/web/tests/setup-signals.test.ts
index 774be8216..54414d748 100644
--- a/web/tests/setup-signals.test.ts
+++ b/web/tests/setup-signals.test.ts
@@ -87,14 +87,12 @@ test("collectAppliedSettingIds returns one id per applied change", () => {
const ids = collectAppliedSettingIds([
{
events: [
- toolResult(
- { setup_applied: { key: "interface.language" } },
- { tool_call_id: "call-1" } as Partial<StreamEvent>,
- ),
- toolResult(
- { setup_applied: { key: "interface.theme" } },
- { tool_call_id: "call-2" } as Partial<StreamEvent>,
- ),
+ toolResult({ setup_applied: { key: "interface.language" } }, {
+ tool_call_id: "call-1",
+ } as Partial<StreamEvent>),
+ toolResult({ setup_applied: { key: "interface.theme" } }, {
+ tool_call_id: "call-2",
+ } as Partial<StreamEvent>),
],
},
]);
@@ -104,11 +102,13 @@ test("collectAppliedSettingIds returns one id per applied change", () => {
test("collectAppliedSettingIds deduplicates a replayed tool call", () => {
// History replay re-delivers the same event; honouring it twice would
// overwrite a preference the user has since changed by hand.
- const event = toolResult(
- { setup_applied: { key: "interface.theme" } },
- { tool_call_id: "call-1" } as Partial<StreamEvent>,
- );
- const ids = collectAppliedSettingIds([{ events: [event] }, { events: [event] }]);
+ const event = toolResult({ setup_applied: { key: "interface.theme" } }, {
+ tool_call_id: "call-1",
+ } as Partial<StreamEvent>);
+ const ids = collectAppliedSettingIds([
+ { events: [event] },
+ { events: [event] },
+ ]);
assert.deepEqual(ids, ["call-1"]);
});
diff --git a/web/tests/whisper-i18n.test.ts b/web/tests/whisper-i18n.test.ts
index 6e301c93d..d6d369601 100644
--- a/web/tests/whisper-i18n.test.ts
+++ b/web/tests/whisper-i18n.test.ts
@@ -93,5 +93,9 @@ test("no hardcoded Chinese copy is left in the whisper components", () => {
const src = fs.readFileSync(path.join(WEB, rel), "utf8");
if (/[一-鿿]/.test(src)) offenders.push(rel);
}
- assert.deepEqual(offenders, [], `CJK copy left in source: ${offenders.join(", ")}`);
+ assert.deepEqual(
+ offenders,
+ [],
+ `CJK copy left in source: ${offenders.join(", ")}`,
+ );
});
diff --git a/web/tests/whisper-transcript.test.ts b/web/tests/whisper-transcript.test.ts
index 571c4e910..741d447c8 100644
--- a/web/tests/whisper-transcript.test.ts
+++ b/web/tests/whisper-transcript.test.ts
@@ -10,7 +10,10 @@ import {
} from "../lib/whisper-transcript";
test("parseRoomIdFromContent extracts id from room_id=abc-123", () => {
- assert.equal(parseRoomIdFromContent("join room_id=abc-123 please"), "abc-123");
+ assert.equal(
+ parseRoomIdFromContent("join room_id=abc-123 please"),
+ "abc-123",
+ );
assert.equal(parseRoomIdFromContent("no room here"), null);
});